desihub / desispec

DESI spectral pipeline
BSD 3-Clause "New" or "Revised" License
36 stars 24 forks source link

Slurm batch file creation for desi_tile_redshifts on Perlmutter #1611

Open marcelo-alvarez opened 2 years ago

marcelo-alvarez commented 2 years ago

There is some redundacy in how slurm batch files are created: desi_proc uses workflow.procfuncs.create_batch_script while desi_tile_redshifts uses scripts.tile_redshifts.write_redshift_script. I have modified the former for use on Perlmutter, but not the latter, so automated redshift batch job submission does not work on Perlmutter at present.

@akremin and @sbailey please have a look and advise on whether it makes sense to make the same change I made for workflow.procfuncs.create_batch_script (2nd to 4th bullets of #1595) to scripts.tile_redshifts.write_redshift_script, or if it's better to refactor this (and possibly other batch automation functionality) so that system-dependency common to all automation of slurm commands and batch files is specified only once.

sbailey commented 2 years ago

Indeed, this has evolved organically through multiple generations of the pipeline and has resulted in some duplicated and/or non-coordinated code.

IIUC, the changes needed all apply to the batch script header, and it would be useful to factor that out into a common function that any batch script generation could use. Please explore that refactor. Thanks.