Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-08-12 22:40:23

0001 #! /bin/bash
0002 
0003 VERBOSE=false
0004 RELEASE=false
0005 MCA_PREFIX=cmsenv
0006 
0007 for ARG in "$@"; do
0008   case "$ARG" in
0009     -v|--verbose)
0010       VERBOSE=true
0011       ;;
0012     ${MCA_PREFIX}_release)
0013       RELEASE=true
0014       ;;
0015   esac
0016 done
0017 
0018 # full path to cmsenv_orted
0019 RELEASE_BASE=
0020 for VAR in CMSSW_BASE CMSSW_RELEASE_BASE CMSSW_FULL_RELEASE_BASE; do
0021   TEST_PATH=${!VAR}
0022   if [ -x $TEST_PATH/bin/$SCRAM_ARCH/cmsenv_orted ]; then
0023     RELEASE_BASE=$TEST_PATH
0024     break
0025   fi
0026 done
0027 if [ -z "$RELEASE_BASE" ]; then
0028   echo "Error: cannot find cmsenv_orted in the \$PATH."
0029   exit 1
0030 fi
0031 
0032 # additional options passed to cmsenv_orted
0033 EXTRA_OPTIONS=""
0034 
0035 # if "-v" or "--verbose" are specified, add "-mca cmsenv_verbose true"
0036 $VERBOSE && EXTRA_OPTIONS="$EXTRA_OPTIONS -mca ${MCA_PREFIX}_verbose true"
0037 
0038 # if "-mca cmsenv_release" is not specified, add "-mca cmsenv_release $CMSSW_BASE"
0039 $RELEASE || EXTRA_OPTIONS="$EXTRA_OPTIONS -mca ${MCA_PREFIX}_release $CMSSW_BASE"
0040 
0041 # if "-v" or "--verbose" are specified, print the command that will be executed
0042 $VERBOSE && echo mpirun --launch-agent $RELEASE_BASE/bin/$SCRAM_ARCH/cmsenv_orted $EXTRA_OPTIONS "$@"
0043 exec mpirun --launch-agent $RELEASE_BASE/bin/$SCRAM_ARCH/cmsenv_orted $EXTRA_OPTIONS "$@"