Skip to content

Commit 24a4b29

Browse files
committed
fix: use custom coatjava
1 parent 3e77b07 commit 24a4b29

1 file changed

Lines changed: 23 additions & 8 deletions

File tree

bin/qtl-reheat

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ $(for key in "${!REHEAT_METHODS[@]}"; do printf "%24s %-11s %-s\n" "" "$key" "${
4242
OPTIONAL OPTIONS:
4343
-d [DATASET] unique name for this dataset
4444
default: $dataset
45-
-c [COATJAVA_VER] coatjava version number
45+
-c [COATJAVA_VER] coatjava version number, either
46+
- version from coatjava env module
47+
- absolute path to coatjava
4648
default: $coatjava_version
4749
--submit submit the slurm jobs, rather than just
4850
printing the \`sbatch\` command
@@ -116,19 +118,32 @@ for inputFile in ${inputFiles[@]}; do
116118
cat > $jobScript << EOF
117119
#!/usr/bin/env bash
118120
set -eou pipefail
121+
# set env vars
122+
source $TIMELINESRC/libexec/environ.sh
123+
# logger info
124+
echo "INPUT FILE: $inputFile"
125+
echo "OUTPUT FILE: $outputFile"
126+
EOF
127+
128+
# handle coatjava
129+
if [[ "$coatjava_version" == /* ]]; then
130+
cat >> $jobScript << EOF
131+
# set coatjava environment
132+
export COATJAVA=$coatjava_version
133+
export CLAS12DIR=\$COATJAVA
134+
echo "COATJAVA: \$COATJAVA"
135+
EOF
136+
else
137+
cat >> $jobScript << EOF
119138
# load coatjava module
120139
source /usr/share/Modules/init/bash
121140
module purge
122141
module use /scigroup/cvmfs/hallb/clas12/sw/modulefiles
123142
module load clas12
124143
module switch coatjava/$coatjava_version
125-
echo "COATJAVA = \$COATJAVA"
126-
# set env vars
127-
source $TIMELINESRC/libexec/environ.sh
128-
# logger info
129-
echo "INPUT FILE: $inputFile"
130-
echo "OUTPUT FILE: $outputFile"
144+
echo "COATJAVA: \$COATJAVA"
131145
EOF
146+
fi
132147

133148
# add main command to the job script
134149
case $mtd in
@@ -137,8 +152,8 @@ EOF
137152
mkdir -p $outputDir/tmp
138153
tmpFile=$outputDir/tmp/$inputBase.hipo
139154
cat >> $jobScript << EOF
140-
echo "TMP FILE: $tmpFile"
141155
# fix the clock rollover
156+
echo "TMP FILE: $tmpFile"
142157
\$COATJAVA/bin/rebuild-scalers -l INFO -c X -o $tmpFile $inputFile -- -Xmx1536m
143158
\$COATJAVA/bin/postprocess -l INFO -q 1 -o $outputFile $tmpFile
144159
rm -v $tmpFile

0 commit comments

Comments
 (0)