Search code examples
parallel-processingmpiplatformmpich

Does MPICH support cross platform execution?


I found that MPICH binaries are available for both Windows and Linux. However I did not understand whether I can use the same executable specified by the -n switch for both platforms or do I need to cross compile my executables?


Solution

  • Despite you can cross-compile, maybe you can consider running the MPI application as if it is composed by different binaries (one per platform). That way you could avoid dealing with cross compilation as well as dealing with all the libraries.

    To achieve that, mpiexec [http://www.mpich.org/static/docs/v3.1/www1/mpiexec.html] allows you to pass multiple binaries (even one per platform) as if your application was MPMD.

    Synopsis

    mpiexec args executable pgmargs [ : args executable pgmargs ... ]
    

    where args are command line arguments for mpiexec (see below), executable is the name of an executable MPI program, and pgmargs are command line arguments for the executable. Multiple executables can be specified by using the colon notation (for MPMD - Multiple Program Multiple Data applications).

    So if you want to spawn 4 processes on system1 and 4 processes on system2, you could use the following command:

    mpiexec -np 4 -host <system1> <binary-system-1> <params> : -np 4 -host <system2> <binary-system-2> <params>