Ruprecht-Karls-Universität Heidelberg

This is an archive of our old website and not updated anymore

The current website can be found at conan.iwr.uni-heidelberg.de

Download create_mpihost.sh

create_mpihosts.sh

Execution of an MPI-parallel program in the pool

To work in parallel with MPI on multiple computer in the CIP pool, you should first generate a file with the names of the computers, that shall perform the computation of your program. For this you use the script create_mpihosts.sh, call it on the command line with

      
        ./create_mpihosts.sh
      
    
It writes in your Home directory in the file mpihosts the names of current computers, that are to date not loaded (used for computations). After that you could start parallel computations with
      
        mpirun -np <p> -machinefile ~/mpihosts ./<executable>
      
    
For <p> you substitute the number of desired processes, <executable> is the desired parallele program.

Please consider the following points:

  • If possible do not compute too much over the day, since there take place exercises in the pool. At the weekend or in the evening you will disturb noone when you draw computing power with your calculations.
  • Call before each parallel program start the script create_mpihosts.sh , such that the currently not loaded machines can be detected.
  • Be careful with the number of machines, that have been written into the mpihosts file. Each machine has two processor cores, such that you should gain the optimal performance placing to processes per machine. Each compute should therefore have to entries in the file.
  • Calculate the memory consumption before program start. For each machine you should use at most 1.5 GB of memory, for stabile running computations.
If you like to terminate a parallel calculation, just press simply Strg-C. Here it can happen, that on the nodes some some processes remain hanging. These can be safely terminated with the command line
      
        for i in `seq -w 50`; do ssh cip$i killall -9 ./<executable>; done
      
    

Compiling of a parallel program in the pool

For usage of MPI library you have to include the MPI header file:

      
        #include <mpi.h>
      
    
To compile a program for parallel execution in the pool, used the command line:
      
        mpicc -o <executable> <prog.c>
      
    
where <prog.c> is your parallel C-program and <executable> the name of the executable file. Write your MPI programs preferntial in C, the C++ bindings is more difficult. Measurement of the elapsed time can be done similar to OpenMP with:
      
        double tStart = MPI_Wtime();
        double telapsed = MPI_Wtime() - tStart;
      
    


Revision: 2242     Letzte Änderung: 2016-10-07 11