【正文】
amp。 int id。 ? Parallelism is outside function check_circuit ? It can be an ordinary, sequential function Copyright 169。 … ? Where is variable total stored? Copyright 169。 The McGrawHill Companies, Inc. Permission required for reproduction or display. What about External Variables? int total。 The McGrawHill Companies, Inc. Permission required for reproduction or display. Determine Process Rank ? First argument is municator ? Process rank (in range 0, 1, …, p1) returned through second argument MPI_Comm_rank (MPI_COMM_WORLD, amp。 The McGrawHill Companies, Inc. Permission required for reproduction or display. Communicator MPI_COMM_WORLD Communicator 0 2 1 3 4 5 Processes Ranks Communicator Name Copyright 169。argc, amp。 /* Process rank */ int p。 The McGrawHill Companies, Inc. Permission required for reproduction or display. Summary of Program Design ? Program will consider all 65,536 binations of 16 boolean inputs ? Combinations allocated in cyclic fashion to processes ? Each process examines each of its binations ? If it finds a satisfiable bination, it will print it Copyright 169。 The McGrawHill Companies, Inc. Permission required for reproduction or display. Partitioning: Functional Deposition ? Embarrassingly parallel: No channels between tasks Copyright 169。 The McGrawHill Companies, Inc. Permission required for reproduction or display. Advantages of Messagepassing Model ? Gives programmer ability to manage the memory hierarchy ? Portability to many architectures ? Easier to create a deterministic program ? Simplifies debugging Copyright 169。 The McGrawHill Companies, Inc. Permission required for reproduction or display. Outline ? Messagepassing model ? Message Passing Interface (MPI) ? Coding MPI programs ? Compiling MPI programs ? Running MPI programs ? Benchmarking MPI programs Copyright 169。Copyright 169。 The McGrawHill Companies, Inc. Permission required for reproduction or display. Learning Objectives ? Understanding how MPI programs execute ? Familiarity with fundamental MPI functions Copyright 169。 The McGrawHill Companies, Inc. Permission required for reproduction or display. Processes ? Number is specified at startup time ? Remains constant throughout execution of program ? All execute same program ? Each has unique ID number ? Alternately performs putations and municates Copyright 169。 The McGrawHill Companies, Inc. Permission required for reproduction or display. Solution Method ? Circuit satisfiability is NPplete ? No known algorithms to solve in polynomial time ? We seek all solutions ? We find through exhaustive search ? 16 inputs ? 65,536 binations to test Copyright 169。 The McGrawHill Companies, Inc. Permission required for reproduction or display. Pop Quiz ? Assume n pieces of work, p processes, and cyclic allocation ? What is the most pieces of work any process has? ? What is the least pieces of work any process has? ? How many processes have the most pieces of work? Copyright 169。 int id。 The McGrawHill Companies, Inc. Permiss