Hands-on; Shared Memory III; MPI with Pthread, OpenMP

  1. Computes the dot product of two vectors; In general, there may be problems if multiple threads make MPI calls. The program may fail or behave unexpectedly. If MPI calls must be made from within a thread, they should be made only by one thread.
  2. Another example (http://siber.cankaya.edu.tr/ozdogan/ParallelComputing/cfiles/code55.c program) for MPI with Pthread.
  3. OpenMP. Two example programs are given; http://siber.cankaya.edu.tr/ozdogan/ParallelComputing/cfiles/code25.c hello, http://siber.cankaya.edu.tr/ozdogan/ParallelComputing/cfiles/code26.c workshare. Follow the steps below before executing OpenMP codes;
    export PGI=/usr/local/pgi
    export PATH=$PGI/linux86/6.2/bin:$PATH
    export MANPATH=$MANPATH:$PGI/linux86/6.2/man
    export LD_LIBRARY_PATH=/usr/local/pgi/linux86/6.2/liblf:
    /usr/local/pgi/linux86/6.2/lib:$LD_LIBRARY_PATH
    
  4. Hello world
  5. Loop work-sharing

Cem Ozdogan 2010-12-13