From 74c6704665e8283007db44b767e21166cadf62f0 Mon Sep 17 00:00:00 2001 From: tbritton Date: Tue, 5 Sep 2017 15:03:59 -0400 Subject: [PATCH 1/3] tweak to work around a private edit at W&M --- MCwrapper/MakeMC.csh | 16 +++++++++++++++- MCwrapper/MakeMC.sh | 13 +++++++++++++ MCwrapper/gluex_MC.py | 2 +- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/MCwrapper/MakeMC.csh b/MCwrapper/MakeMC.csh index 91181ca0..67775eec 100755 --- a/MCwrapper/MakeMC.csh +++ b/MCwrapper/MakeMC.csh @@ -19,6 +19,8 @@ setenv CALIBTIME $1 set wholecontext = $VERSION if($CALIBTIME != "notime") then set wholecontext = "variation=$VERSION calibtime=$CALIBTIME" +else +set wholecontext = "variation=$VERSION" endif setenv JANA_CALIB_CONTEXT "$wholecontext" shift @@ -124,12 +126,12 @@ endif setenv COHERENT_PEAK $copeak setenv eBEAM_ENERGY $elecE - # PRINT INPUTS echo "Job started: " `date` echo "sqlite path: " $SQLITEPATH echo "Producing file number: "$FILE_NUMBER echo "Containing at most "$PER_FILE" events" +echo "Running location:" $RUNNING_DIR echo "Output location: "$OUTDIR echo "Environment file: " $ENVIRONMENT echo "Context: "$JANA_CALIB_CONTEXT @@ -153,8 +155,20 @@ echo "==============================================" echo "" echo "" + +if (! -d $RUNNING_DIR) then +mkdir $RUNNING_DIR +endif + cd $RUNNING_DIR +if(! -d $RUNNING_DIR/${RUN_NUMBER}_${FILE_NUMBER}) then +mkdir $RUNNING_DIR/${RUN_NUMBER}_${FILE_NUMBER} +endif + +cd $RUNNING_DIR/${RUN_NUMBER}_${FILE_NUMBER} + + #necessary to run swif, uses local directory if swif=0 is used if ( "$BATCHRUN" != "0" ) then # ENVIRONMENT diff --git a/MCwrapper/MakeMC.sh b/MCwrapper/MakeMC.sh index b3552f4d..d5ca6b5c 100755 --- a/MCwrapper/MakeMC.sh +++ b/MCwrapper/MakeMC.sh @@ -19,6 +19,8 @@ export CALIBTIME $1 wholecontext=$VERSION if [[ $CALIBTIME != "notime" ]]; then wholecontext="variation=$VERSION calibtime=$CALIBTIME" +else +wholecontext="variation=$VERSION" fi setenv JANA_CALIB_CONTEXT "$wholecontext" shift @@ -127,6 +129,7 @@ export eBEAM_ENERGY=$elecE echo "Job started: " `date` echo "Producing file number: "$FILE_NUMBER echo "Containing at most "$PER_FILE" events" +echo "Running location:" $RUNNING_DIR echo "Output location: "$OUTDIR echo "Environment file: " $ENVIRONMENT echo "Context: "$JANA_CALIB_CONTEXT @@ -149,8 +152,18 @@ echo "==============================================" echo "" echo "" +if [[ ! -d $RUNNING_DIR ]]; then +mkdir $RUNNING_DIR +fi + cd $RUNNING_DIR +if [[ ! -d $RUNNING_DIR/${RUN_NUMBER}_${FILE_NUMBER} ]] then +mkdir $RUNNING_DIR/${RUN_NUMBER}_${FILE_NUMBER} +fi + +cd $RUNNING_DIR/${RUN_NUMBER}_${FILE_NUMBER} + #printenv #necessary to run swif, uses local directory if swif=0 is used if [[ "$BATCHRUN" != "0" ]]; then diff --git a/MCwrapper/gluex_MC.py b/MCwrapper/gluex_MC.py index 9a30cbe3..20f432d7 100755 --- a/MCwrapper/gluex_MC.py +++ b/MCwrapper/gluex_MC.py @@ -191,7 +191,7 @@ def main(argv): print "*********************************" print "Welcome to v1.8.0 of the MCwrapper" - print "Thomas Britton 09/1/17" + print "Thomas Britton 09/4/17" print "*********************************" #load all argument passed in and set default options From ca421097e8f40fe41f9e5e33d0da90f75af44b6c Mon Sep 17 00:00:00 2001 From: tbritton Date: Tue, 5 Sep 2017 15:29:09 -0400 Subject: [PATCH 2/3] proper mapping to bash --- MCwrapper/MakeMC.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/MCwrapper/MakeMC.sh b/MCwrapper/MakeMC.sh index d5ca6b5c..85407964 100755 --- a/MCwrapper/MakeMC.sh +++ b/MCwrapper/MakeMC.sh @@ -13,16 +13,16 @@ export FILE_NUMBER=$1 shift export EVT_TO_GEN=$1 shift -export VERSION $1 +export VERSION=$1 shift -export CALIBTIME $1 +export CALIBTIME=$1 wholecontext=$VERSION -if [[ $CALIBTIME != "notime" ]]; then +if [[ "$CALIBTIME" != "notime" ]]; then wholecontext="variation=$VERSION calibtime=$CALIBTIME" else wholecontext="variation=$VERSION" fi -setenv JANA_CALIB_CONTEXT "$wholecontext" +export JANA_CALIB_CONTEXT="$wholecontext" shift export GENR=$1 shift @@ -158,7 +158,7 @@ fi cd $RUNNING_DIR -if [[ ! -d $RUNNING_DIR/${RUN_NUMBER}_${FILE_NUMBER} ]] then +if [[ ! -d $RUNNING_DIR/${RUN_NUMBER}_${FILE_NUMBER} ]]; then mkdir $RUNNING_DIR/${RUN_NUMBER}_${FILE_NUMBER} fi @@ -554,7 +554,7 @@ if [[ "$GENR" != "0" ]]; then if [[ -f dana_rest.hddm ]]; then mv dana_rest.hddm dana_rest_$STANDARD_NAME.hddm - fi + fi if [[ "$CLEANGEANT" == "1" ]]; then @@ -591,7 +591,7 @@ if [[ "$GENR" != "0" ]]; then done fi fi - fi + fi fi if [[ "$gen_pre" != "file" ]]; then mv $PWD/*.conf $OUTDIR/configurations/generation/ From 0553959de8cb7abe3d6c6bea0e39397b063e829c Mon Sep 17 00:00:00 2001 From: T-Britton Date: Tue, 5 Sep 2017 16:53:03 -0400 Subject: [PATCH 3/3] Auto stash before merge of "DEV" and "origin/master" --- MCwrapper/gluex_MC.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MCwrapper/gluex_MC.py b/MCwrapper/gluex_MC.py index 20f432d7..cc094fdf 100755 --- a/MCwrapper/gluex_MC.py +++ b/MCwrapper/gluex_MC.py @@ -461,7 +461,7 @@ def main(argv): COMMAND=ENVFILE+" "+GENCONFIG+" "+str(outdir)+" "+str(RUNNUM)+" "+str(FILENUM-1)+" "+str(num)+" "+str(VERSION)+" "+str(CALIBTIME)+" "+str(GENR)+" "+str(GEANT)+" "+str(SMEAR)+" "+str(RECON)+" "+str(CLEANGENR)+" "+str(CLEANGEANT)+" "+str(CLEANSMEAR)+" "+str(CLEANRECON)+" "+str(BATCHRUN)+" "+str(BATCHRUN)+" "+str(NCORES).split(':')[-1]+" "+str(GENERATOR)+" "+str(GEANTVER)+" "+str(BGFOLD)+" "+str(CUSTOM_GCONTROL)+" "+str(eBEAM_ENERGY)+" "+str(COHERENT_PEAK)+" "+str(MIN_GEN_ENERGY)+" "+str(MAX_GEN_ENERGY)+" "+str(TAGSTR)+" "+str(CUSTOM_PLUGINS)+" "+str(PERFILE)+" "+str(RUNNING_DIR)+" "+str(SQLITEPATH) - #print COMMAND + #print COMMAND #either call MakeMC.csh or add a job depending on swif flag if BATCHRUN == 0 or BATCHSYS=="NULL": os.system(str(indir)+" "+COMMAND)