tutoMPI: mpi-start-wrapper.sh

File mpi-start-wrapper.sh, 1010 bytes (added by /O=GRID-FR/C=FR/O=CNRS/OU=LPSC/CN=Fabian Lambert, 16 years ago)
Line 
1#!/bin/bash
2
3# Pull in the arguments.
4MY_EXECUTABLE=`pwd`/$1
5MPI_FLAVOR=$2
6
7# Convert flavor to lowercase for passing to mpi-start.
8MPI_FLAVOR_LOWER=`echo $MPI_FLAVOR | tr '[:upper:]' '[:lower:]'`
9
10# Pull out the correct paths for the requested flavor.
11eval MPI_PATH=`printenv MPI_${MPI_FLAVOR}_PATH`
12
13# Ensure the prefix is correctly set. Don't rely on the defaults.
14eval I2G_${MPI_FLAVOR}_PREFIX=$MPI_PATH
15export I2G_${MPI_FLAVOR}_PREFIX
16
17# Touch the executable. It exist must for the shared file system
18check.
19# If it does not, then mpi-start may try to distribute the executable
20# when it shouldn't.
21touch $MY_EXECUTABLE
22
23# Setup for mpi-start.
24export I2G_MPI_APPLICATION=$MY_EXECUTABLE
25export I2G_MPI_APPLICATION_ARGS=
26export I2G_MPI_TYPE=$MPI_FLAVOR_LOWER
27export I2G_MPI_PRE_RUN_HOOK=mpi-hooks.sh
28export I2G_MPI_POST_RUN_HOOK=mpi-hooks.sh
29
30# If these are set then you will get more debugging information.
31export I2G_MPI_START_VERBOSE=1
32#export I2G_MPI_START_DEBUG=1
33
34# Invoke mpi-start.
35$I2G_MPI_START