Netzer & Miller 1990: On the Complexity of Event Ordering for Shared-Memory Parallel Program Executions.

Slides:



Advertisements
Similar presentations
Theory of Computing Lecture 18 MAS 714 Hartmut Klauck.
Advertisements

Lecture 23. Subset Sum is NPC
 2004 SDU Lecture17-P,NP, NPC.  2004 SDU 2 1.Decision problem and language decision problem decision problem and language 2.P and NP Definitions of.
CS21 Decidability and Tractability
February 23, 2015CS21 Lecture 201 CS21 Decidability and Tractability Lecture 20 February 23, 2015.
Computability and Complexity 15-1 Computability and Complexity Andrei Bulatov NP-Completeness.
NP-Complete Problems Reading Material: Chapter 10 Sections 1, 2, 3, and 4 only.
1 Polynomial Time Reductions Polynomial Computable function : For any computes in polynomial time.
NP-Complete Problems Problems in Computer Science are classified into
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 23 Instructor: Paul Beame.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 24 Instructor: Paul Beame.
Toward NP-Completeness: Introduction Almost all the algorithms we studies so far were bounded by some polynomial in the size of the input, so we call them.
The Theory of NP-Completeness 1. What is NP-completeness? Consider the circuit satisfiability problem Difficult to answer the decision problem in polynomial.
Lecture 22 More NPC problems
NP Complexity By Mussie Araya. What is NP Complexity? Formal Definition: NP is the set of decision problems solvable in polynomial time by a non- deterministic.
MCS 312: NP Completeness and Approximation algorthms Instructor Neelima Gupta
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
EMIS 8373: Integer Programming NP-Complete Problems updated 21 April 2009.
NP-Complete Problems. Running Time v.s. Input Size Concern with problems whose complexity may be described by exponential functions. Tractable problems.
Chapter 11 Introduction to Computational Complexity Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1.
NPC.
COMPLEXITY. Satisfiability(SAT) problem Conjunctive normal form(CNF): Let S be a Boolean expression in CNF. That is, S is the product(and) of several.
CSCI 2670 Introduction to Theory of Computing December 2, 2004.
CSCI 2670 Introduction to Theory of Computing December 7, 2005.
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
COMPLEXITY. Satisfiability(SAT) problem Conjunctive normal form(CNF): Let S be a Boolean expression in CNF. That is, S is the product(and) of several.
 2005 SDU Lecture15 P,NP,NP-complete.  2005 SDU 2 The PATH problem PATH = { | G is a directed graph that has a directed path from s to t} s t
Advanced Algorithms NP-hard and NP-Complete Problems Instructor: Saeid Abrishami Ferdowsi University of Mashhad.
ICS 353: Design and Analysis of Algorithms NP-Complete Problems King Fahd University of Petroleum & Minerals Information & Computer Science Department.
Cook Theorem and NP-complete problems
The Theory of NP-Completeness
NP-Completeness A problem is NP-complete if: It is in NP
The NP class. NP-completeness
NP-Completeness (2) NP-Completeness Graphs 4/13/2018 5:22 AM x x x x x
More NP-Complete and NP-hard Problems
Chapter 10 NP-Complete Problems.
L is in NP means: There is a language L’ in P and a polynomial p so that L1 ≤ L2 means: For some polynomial time computable map r :  x: x  L1 iff.
Richard Anderson Lecture 26 NP-Completeness
NP-Completeness (2) NP-Completeness Graphs 7/23/ :02 PM x x x x
NP-Completeness (2) NP-Completeness Graphs 7/23/ :02 PM x x x x
NP-Completeness Proofs
Richard Anderson Lecture 26 NP-Completeness
(xy)(yz)(xz)(zy)
NP-Completeness Yin Tat Lee
CS21 Decidability and Tractability
Intro to Theory of Computation
CS154, Lecture 16: More NP-Complete Problems; PCPs
ICS 353: Design and Analysis of Algorithms
NP-Completeness (2) NP-Completeness Graphs 11/23/2018 2:12 PM x x x x
Richard Anderson Lecture 25 NP-Completeness
NP-Completeness Proofs
How Hard Can It Be?.
Richard Anderson Lecture 28 NP-Completeness
Richard Anderson Lecture 28 NP Completeness
NP-Complete Problems.
More NP-Complete Problems
CS 3343: Analysis of Algorithms
NP-Completeness Yin Tat Lee
CS21 Decidability and Tractability
CSE 6408 Advanced Algorithms.
CS21 Decidability and Tractability
Our First NP-Complete Problem
The Theory of NP-Completeness
CS21 Decidability and Tractability
Instructor: Aaron Roth
Our old list of problems
NP-Completeness (2) NP-Completeness Graphs 7/9/2019 6:12 AM x x x x x
The Satisfiability Problem
Lecture 23 NP-Hard Problems
Presentation transcript:

Netzer & Miller 1990: On the Complexity of Event Ordering for Shared-Memory Parallel Program Executions

Programs and Executions (histories) We consider temporal relations: A must happen before B C can happen before A D happened before E Program: Execution: P1: Loop: W X,1 A: W Y,1 sync R X if X==1 goto loop; P1: W X,1 W Y,1 sync E: R X,2 P2: R X,1 sync D: W X,2 R Y,1 P2: C: R X sync B: R X W X,2 R Y

Relations For an execution – either the relation holds or not. For a program – “must happen” if relation holds in every possible execution. “can happen” – if holds in part of the possible executions. Let a,b denote events (or instructions) in a program. a happens before b (a  b ), if a finishes before b starts in every execution (global observer-wise). a and b are ordered if in every execution a  b or b  a. Similarly – unordered. Note the global observer makes this definition hold for any memory model.

Example: X := 0 Fork P1: {X := 1;} P2: {if X == 1 foo();} Join a In this example, for almost all memory models, a must happen before b despite the fact that there is no synchronization (because of the read-write dependence). b

Theorem: given a program P that uses semaphores, and given events a,b in P, the decision whether a  b, whether a and b are ordered, or whether a and b are unordered, is Co-NP Complete. Proof: We will see for a  b. Proofs of other relations are similar. The proof is by reduction from 3-CNF-NSAT, so every boolean formula is not satisfiable iff a  b for two events a,b that are defined by the reduction from the specific formula.

Informal Reminder: NP and Co-NP There is a set NP of problems for which: we do not have a polynomial solution, we have an exponential solution. A problem in NP is complete when: we have polynomial reduction from each of the other problems in NP to this problem. Co-NP Completeness: Same but for the set of “complement problems” (e.g.: satisfiable vs non-satisfiable).

3-CNF-SAT An instance of 3-CNF-SAT has n variables V={x1,…,xn} and a Boolean formula B having m clauses C1^C2^…^Cm. A clause is a disjunction of 3 literals (xi or not(xi)) from V – (L1vL2vL3).

Idea of the proof Given a boolean formula B, we will construct a program of 3n+3m+2 processes which use 3n+m+1 semaphores (initialized to 0). The execution of the program is a simulation of a non-deterministic computation of B. Use semaphores to compute truth values assignment of variables and clauses. Prove that the execution of the program assumes certain interleavings iff B is not satisfiable.

Idea of the proof – cntd. The parallel program uses semaphores xi and not-xi to represent the truth value of a variable xi: signal(xi) (signal(not-xi) represents an assignment of True (False) to xi. The processes make progress in 2 rounds. The first round is a non-deterministic guess of a truth value to each variable. The assignment is represented by letting either signal(xi) or signal(not-xi) to perform, but not both. The second round begins after signal(pass2), and ensures there are no deadlocks in the program: perform all semaphores that were not performed in the first round.

Details of the reduction: the construction per clause For every clause Cj=L1vL2vL3 construct a program: Pj1: wait(L1) signal(Cj) Pj2: wait(L2) Pj3: wait(L3) L1,L2,L3 are semaphores corresponding to literals in Cj. The semaphore Cj represents the truth value of the clause Cj. The semaphore Cj will be signaled if the random assignment of truth values to the literals in the first round implies Cj==True.

The construction per variable For each variable xi construct the 3 processes: Pi1: wait(Ai) signal(xi) : Pi2: signal(not-xi) Pi3: signal(Ai) wait(pass2) Where “:” denotes signal(xi) or signal(not-xi) according to the occurance of xi or not-xi in B.

Putting the construction together Construct two additional control processes: P1: wait(C1) : wait(Cm) b: P2: a: signal(pass2) m n There are n operations signal(pass2) (one for every variable xi). Since there are no conditional operations and shared variables, every run of the program produces the same execution.

Claim: a  b iff B is not satisfiable Assume that B is not satisfiable. Then there is always a Cj which is not satisfied by the truth values that were guessed in round 1. Thus, signal(Cj) is not performed in round 1. B will not be performed until signal(Cj) occurs in round 2. Round 2 occurs only after a, hence a happens before b.

Proof cntd. Suppose a  b. I.e., there is no execution in which b happens before a or is not synchronized with a. Assume by way of contradiction that B is satisfiable. Then there exists a guess of round 1 that satisfies all clauses.This would have made the occurance of b precede that of a, thus contradicting the assignment.

Other relations Similar reductions prove that computing a is always ordered with b, and a is always not ordered with b is Co-NP hard. Same reductions give that b  a may happen iff B is satisfiable, and so computing the above is NP-complete. Similar reductions show that computing may happen that a,b are ordered/unordered are NP-complete.