Skip to content

Commit

Permalink
explicit cameras in tilenight slurm script
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelo-alvarez committed Mar 10, 2023
1 parent 42f42d8 commit f7ade05
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
13 changes: 9 additions & 4 deletions py/desispec/scripts/proc_tilenight.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ def main(args=None, comm=None):
if args.laststeps is not None:
keep &= np.isin(exptable['LASTSTEP'].astype(str), args.laststeps)

#- Camera superset from args.cameras; if None default to all
camera_superset = 'a0123456789'
if args.cameras is not None:
camera_superset = args.cameras

exptable = exptable[keep]

if len(exptable) == 0:
Expand All @@ -98,7 +103,7 @@ def main(args=None, comm=None):
prestd_camwords[expids[i]] = difference_camwords(camword,badcamword,suppress_logging=True)
else:
prestd_camwords[expids[i]] = camword
prestd_camwords[expids[i]] = camword_intersection([prestd_camwords[expids[i]],args.cameras])
prestd_camwords[expids[i]] = camword_intersection([prestd_camwords[expids[i]],camera_superset])

laststep = str(exptable['LASTSTEP'][i]).lower()
if laststep in ('all', 'fluxcalib', 'skysub'):
Expand All @@ -108,11 +113,11 @@ def main(args=None, comm=None):
poststdstar_expids.append(expid)

joint_camwords = camword_union(list(prestd_camwords.values()), full_spectros_only=True)
joint_camwords = camword_intersection([joint_camwords, args.cameras])
joint_camwords = camword_intersection([joint_camwords, camera_superset])

poststd_camwords = dict()
for expid, camword in prestd_camwords.items():
poststd_camwords[expid] = camword_intersection([joint_camwords, camword, args.cameras])
poststd_camwords[expid] = camword_intersection([joint_camwords, camword, camera_superset])

#-------------------------------------------------------------------------
#- Create and submit a batch job if requested
Expand All @@ -128,7 +133,7 @@ def main(args=None, comm=None):
mpistdstars=args.mpistdstars,
use_specter=args.use_specter,
no_gpu=args.no_gpu,
cameras=args.cameras
cameras=camera_superset
)
err = 0
if not args.nosubmit:
Expand Down
8 changes: 4 additions & 4 deletions py/desispec/workflow/desi_proc_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -970,18 +970,18 @@ def create_desi_proc_tilenight_batch_script(night, exp, tileid, ncameras, queue,
cmd += f' -n {night}'
cmd += f' -t {tileid}'
cmd += f' --mpi'
if cameras is not None:
cmd += f' --cameras {cameras}'
else:
cmd += f' --cameras a0123456789'
if mpistdstars:
cmd += f' --mpistdstars'
if no_gpu:
cmd += f' --no-gpu'
elif use_specter:
cmd += f' --use-specter'

cmd += f' --timingfile {timingfile}'

if cameras is not None:
cmd += f' --cameras {cameras}'

fx.write(f'# running a tile-night\n')
fx.write(f'# using {ncores} cores on {nodes} nodes\n\n')

Expand Down

0 comments on commit f7ade05

Please sign in to comment.