diff --git a/src/SH12A_ddd/postprocess.sh b/src/SH12A_ddd/postprocess.sh index 40e6db2..a84bc26 100755 --- a/src/SH12A_ddd/postprocess.sh +++ b/src/SH12A_ddd/postprocess.sh @@ -15,22 +15,17 @@ echo "-----------">> README.md echo "(add your description here)" >> README.md echo "" >> README.md -#switch to wdir and build all +#switch to wdir and convert all bdo files to ddd files cd $pwdir/$wdir for shdir in $(find . -mindepth 3 -maxdepth 3 -type d ) do echo echo "Processing directory: "$wdir/$shdir - cd $shdir - echo convertmc tripddd --many "*.bdo" + cd $shdir + convertmc tripddd --many "*.bdo" cd $pwdir - - # strip energy directory from dir current dir name - tdir=`dirname $shdir` - - # build energy specific target directory and copy ddd file to it - targetdir=$ddir/$tdir - mkdir -p $targetdir - echo cp -v $shdir/*.ddd $targetdir/. done + +cd $pwdir +find $wdir -name "*.ddd" | xargs -i sh -c 'echo {}; echo {} | mkdir -p $ddir/`cut -d/ -f3-4`/; cp -v {} $ddir/`cut -d/ -f3-4`/' \ No newline at end of file diff --git a/src/SH12A_ddd/prepare.py b/src/SH12A_ddd/prepare.py index 40a61b1..2fe9525 100644 --- a/src/SH12A_ddd/prepare.py +++ b/src/SH12A_ddd/prepare.py @@ -68,16 +68,16 @@ def fwhm_to_sigma(fwhm): """ return fwhm / (2.0 * np.sqrt(2.0 * np.log(2.0))) - def read(self, dir): + def read(self, dir_path): """ Reads the template files, and stores them in self object. """ - fname_beam = os.path.join(dir, "beam.dat") - fname_geo = os.path.join(dir, "geo.dat") - fname_mat = os.path.join(dir, "mat.dat") - fname_det = os.path.join(dir, "detect.dat") + fname_beam = os.path.join(dir_path, "beam.dat") + fname_geo = os.path.join(dir_path, "geo.dat") + fname_mat = os.path.join(dir_path, "mat.dat") + fname_det = os.path.join(dir_path, "detect.dat") - self.template_dir = dir + self.template_dir = dir_path with open(fname_beam) as file: self.tbeam = file.readlines() @@ -88,7 +88,7 @@ def read(self, dir): with open(fname_det) as file: self.tdet = file.readlines() - def write(self, ion): + def write(self): """ Write the SH12A output files to self.path for given ion. Stopping power files are symlinked to the files found in template/ @@ -205,9 +205,9 @@ def main(args): logger.info(ion.name) for energy in np.arange(ion.emin, ion.emax, ion.estep): t.generate_dats(ion, energy, nstat, nsave, rifi=True) - t.write(ion) + t.write() t.generate_dats(ion, energy, nstat, nsave, rifi=False) - t.write(ion) + t.write() if __name__ == '__main__': diff --git a/src/SH12A_ddd/rsshield.sh b/src/SH12A_ddd/rsshield.sh index 00b5857..c5e8670 100755 --- a/src/SH12A_ddd/rsshield.sh +++ b/src/SH12A_ddd/rsshield.sh @@ -9,7 +9,10 @@ #SBATCH --output=shieldhitJob.%j.out # standard output file name #SBATCH --error=shieldhitJob.%j.err # standard error output file name #SBATCH --ntasks=1 -#SBATCH --contiguous +#SBATCH --ntasks-per-node=1 +#SBATCH -p plgrid +#SBATCH --time=0:59:00 + #echo Node ID $SLURM_NODEID #echo NTasks $SLURM_NTASKS @@ -17,4 +20,5 @@ #echo LocalID $SLURM_LOCALID #echo Array task ID $SLURM_ARRAY_TASK_ID -shieldhit -N${SLURM_ARRAY_TASK_ID} +# overwrite number of histories and set upper limit on execution time +shieldhit -N${SLURM_ARRAY_TASK_ID} -n 10000000 --time="00:58:00" diff --git a/src/SH12A_ddd/submit.sh b/src/SH12A_ddd/submit.sh index f69fcf3..8be3bb5 100755 --- a/src/SH12A_ddd/submit.sh +++ b/src/SH12A_ddd/submit.sh @@ -7,7 +7,6 @@ for shdir in $(find . -mindepth 3 -maxdepth 3 -type d ) do cd $shdir echo $shdir - # echo sbatch --array 0-16 rsshield.sh - echo sbatch --array 0 ../../../../rsshield.sh + sbatch --array 0 ../../../../rsshield.sh cd ${wdir}/wdir done diff --git a/src/SH12A_ddd/template/geo.dat b/src/SH12A_ddd/template/geo.dat index ca99596..39f9317 100644 --- a/src/SH12A_ddd/template/geo.dat +++ b/src/SH12A_ddd/template/geo.dat @@ -1,5 +1,5 @@ *---><---><--------><------------------------------------------------> - 0 0 Water target for DDD generation. + 1 0 Water target for DDD generation. *---><---><--------><--------><--------><--------><--------><--------> * phantom / target RPP 1 -30.0 30.0 -30.0 30.0 0.0 60.0