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