#!/bin/bash # # This file is a part of Elmer Runtime Environment for NorduGrid ARC grid # middleware. It is meant to be called from the users' job scripts, # and it acts as a wrapper for both ElmerSolver and ElmerSolver_mpi. # # The script assumes that the actual RTE setup script (e.g. # /APPS/MATH/ELMER-5.0) has been run prior to it's execution. # The setup script sets the variables $ELMER_NUM_SLOTS, # $ELMER_MACHINEFILE and $ELMER_HOME. # # author: Olli Tourunen # # changelog: # 2006-04-06 tourunen # - ELMER_DIR changed to standard ELMER_HOME # # 2006-03-28 # - initial version # set up the MPI environment that matches the Elmer binaries. # EDIT THIS AS NEEDED source /opt/mpich/mpich-path64.sh mpirun_exe=mpirun # check whether we are running a parallel or a serial job if [ $ELMER_NUM_SLOTS -gt 1 ]; then # we'll use ElmerSolver_mpi for the parallel jobs echo "ElmerSolver_grid: running MPI binary with $ELMER_NUM_SLOTS slots" $mpirun_exe -np $ELMER_NUM_SLOTS -machinefile $ELMER_MACHINEFILE $ELMER_HOME/bin/ElmerSolver_mpi $@ # exits with the return value from the mpirun exit $? else # we'll use ElmerSolver for the serial jobs echo "ElmerSolver_grid: running serial binary" $ELMER_HOME/bin/ElmerSolver $@ # exits with the return value from the ElmerSolver exit $? fi