Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add project code argument and extra scripts #4

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from
3 changes: 3 additions & 0 deletions cleanup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
rm *.in
rm *.out
rm *.sbatch
7 changes: 7 additions & 0 deletions process_vast_epoch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

epoch=$1
in_dir=$SCRATCHDIR/data/vast/epoch_$1
out_dir=$SCRATCHDIR/stokesv_processing/finished/epoch_$1

echo python run_selavy.py $in_dir --out-dir=$out_dir
6 changes: 6 additions & 0 deletions run_selavy.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ def parse_args():
default='21',
help='Number of tasks per node for each slurm job'
)
parser.add_argument('--project-code',
type=str,
default='ja3',
help='Number of tasks per node for each slurm job'
)
parser.add_argument('--submit-jobs',
action='store_true',
help='Submit the jobs'
Expand Down Expand Up @@ -85,6 +90,7 @@ def generate_files(filename, jobname, args, invert=False, outdir="."):
ntasks=args.ntasks,
ntasks_per_node=args.ntasks_per_node,
memory=args.mem_request,
project_code=args.project_code
)
return

Expand Down
1 change: 1 addition & 0 deletions selavybatch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sbatch selavy.nimage.v.VAST_0530-68.SB50408.cont.taylor.0.restored.conv.sbatch
12 changes: 8 additions & 4 deletions setonix_selavy.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ def _write_sbatch(job_name,
walltime,
ntasks,
ntasks_per_node,
memory
memory,
project_code
):
'''write sbatch files'''
logger = logging.getLogger('makeparset.sbatch')
Expand All @@ -181,10 +182,11 @@ def _write_sbatch(job_name,
#SBATCH --ntasks={ntasks}
#SBATCH --ntasks-per-node={ntasks_per_node}
#SBATCH --mem={memory}
#SBATCH --account={project_code}

module use /software/projects/ja3/modulefiles
module load singularity/3.8.6
module load askapsoft/1.10.0.a
module use /software/projects/askaprt/modulefiles
module load singularity/4.1.0-mpi
module load askapsoft/1.15.0

srun selavy -c {parset_name}
''')
Expand All @@ -198,6 +200,7 @@ def writebatch(job_name,
ntasks = '21',
ntasks_per_node = '21',
memory = '110G',
project_code='ja3'
):
'''write the final .sh file for submission'''
logger = logging.getLogger('writebatch')
Expand All @@ -215,6 +218,7 @@ def writebatch(job_name,
ntasks,
ntasks_per_node,
memory,
project_code
)
sbatch_names.append(sbatch_name)
logger.info(f"Written {sbatch_name}")
Expand Down
2 changes: 2 additions & 0 deletions stage_data.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
indir=$1
outdir=$2

mkdir $outdir

mv $indir/selavy-*.xml $outdir/
mv $indir/noiseMap.image.*.fits $outdir/
mv $indir/meanMap.image*.fits $outdir/
8 changes: 8 additions & 0 deletions stage_vast_epoch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

epoch=$1

finished_dir=$SCRATCHDIR/stokesv_processing/finished/epoch_$1
staging_dir=$SCRATCHDIR/stokesv_processing/staging/epoch_$1

./stage_data.sh $finished_dir $staging_dir
6 changes: 6 additions & 0 deletions unstage_data.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
indir=$1
outdir=$2

mv $indir/selavy-*.xml $outdir/
mv $indir/noiseMap.image.*.fits $outdir/
mv $indir/meanMap.image*.fits $outdir/
8 changes: 8 additions & 0 deletions unstage_vast_epoch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

epoch=$1

finished_dir=$SCRATCHDIR/stokesv_processing/finished/epoch_$1
staging_dir=$SCRATCHDIR/stokesv_processing/staging/epoch_$1

mv $staging_dir/* $finished_dir