LAM/MPI logo

LAM/MPI General User's Mailing List Archives

  |   Home   |   Download   |   Documentation   |   FAQ   |   all just in this list

From: Edwin Vollebregt (edwin.vollebregt_at_[hidden])
Date: 2004-03-24 08:18:31


Hello,

Does anyone have suggestions for the following situation:

We have parallelized a program with PVM in such a way that the same
executable can be used for stand-alone sequential runs as well as for
master-slave parallel runs. Now we are porting to MPI.

The application is started by a shell script with option -npart <xx>: number
of parts to be used in the decomposition.

   if [ $npart -le 1 ]; then
      program.exe
   else
      mpiexec -machinefile ... -n 1 master.exe < config
      # --> master starts the appropriate number of instances of program.exe
   fi

The problem is that calling MPI_Init in a sequential run kills the program
because LAM has not been booted.

How can we detect whether MPI is running within the program ?

This problem is similar to "detecting mpirun" on the archive of the
mailinglist. It is a slightly different scenario than the ones I found
there, so maybe there are different options.

Any thoughts ?

Thanks,
        Edwin

-- 
 _______________________________________________________________________
|                                                                       |
|  VORtech Computing                                                    |
|_______________________________________________________________________|
|                                      experts in industrial computing  |
|    %""                                                                |
|  %%  %%%%    dr.ir. E.A.H. Vollebregt                                 |
| %%  "   %%                                     phone +31(0)15-2850125 |
| %%       %   P.O. Box 260                        fax +31(0)15-2850126 |
| %%      %%   2600 AG Delft                       web   www.vortech.nl |
|  %%    %%    the Netherlands              edwin.vollebregt_at_[hidden] |
|   %%%%%%                                                              |
|     ""       visit-address: Torenhove building, M.Nijhoflaan 2, Delft |
|_______________________________________________________________________|