2.7. So how do we mix parallel Python with Fortran and C?

Simply stated, you write a MPI program in Python, one in Fortran and/or C and run them on your parallel machine. The problem is in the details. Most MPI systems have a command such as, mpirun, that launches mpi jobs. The exact method of launching hetrogeneous MPI jobs is machine specific. We will give some examples. We will assume a python application hello_python and a fortran application hello_f.

For the IBM SP running poe the script setup is simple. First, set the environmental variable MP_PGMMODEL to MPMD. You write your script as you normally would but you don't give the name of the executable on the poe command line. You list the names of the executables after the poe command as shown below.

setenv MP_PGMMODEL MPMD

poe  << HERE
/users01/sdsc/tkaiser/hello_python
/users01/sdsc/tkaiser/hello_f
HERE

For machines using MPICH and/or pbs the procedure is a little more complicated. The method is outlined here.