Skip to content

Commit

Permalink
Merge pull request #27 from desihub/fuji-guadalupe
Browse files Browse the repository at this point in the history
Updates for fuji and guadalupe
  • Loading branch information
weaverba137 authored Jun 1, 2022
2 parents 04bab4f + b427ed6 commit 735e805
Show file tree
Hide file tree
Showing 4 changed files with 172 additions and 9 deletions.
6 changes: 4 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,12 @@ raise an exception.
Change Log
----------

0.3.1 (unreleased)
0.3.1 (2022-06-01)
~~~~~~~~~~~~~~~~~~

* No changes yet.
* Updates for ``fuji`` and ``guadalupe`` (PR `#27`_).

.. _`#27`: https://github.com/desihub/desiBackup/pull/27

0.3.0 (2021-09-10)
~~~~~~~~~~~~~~~~~~
Expand Down
30 changes: 30 additions & 0 deletions bin/create_xfer_jobs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash
if [[ $# < 1 ]]; then
echo "SPECPROD is required!"
exit 1
fi
if [[ $# < 2 ]]; then
echo "DIRECTORY is required!"
exit 1
fi
export SPECPROD=$1
directory=$2
[[ -z "${DESI_SPECTRO_REDUX}" ]] && export DESI_SPECTRO_REDUX=/global/cfs/cdirs/desi/spectro/redux
for d in ${DESI_SPECTRO_REDUX}/${SPECPROD}/${directory}/*; do
n=$(basename ${d})
job_name=redux_${SPECPROD}_$(tr '/' '_' <<<${directory})_${n}
cat > ${job_name}.sh <<EOT
#!/bin/bash
#SBATCH --account=desi
#SBATCH --qos=xfer
#SBATCH --time=12:00:00
#SBATCH --mem=10GB
#SBATCH --job-name=${job_name}
#SBATCH --licenses=cfs
cd ${DESI_SPECTRO_REDUX}/${SPECPROD}/${directory}
hsi mkdir -p desi/spectro/redux/${SPECPROD}/${directory}
htar -cvf desi/spectro/redux/${SPECPROD}/${directory}/${job_name}.tar -H crc:verify=all ${n}
[[ \$? == 0 ]] && mv -v /global/homes/d/desi/jobs/${job_name}.sh /global/homes/d/desi/jobs/done
EOT
chmod +x ${job_name}.sh
done
71 changes: 71 additions & 0 deletions bin/submit_xfer_jobs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#!/bin/bash
#
module load esslurm
function usage() {
local execName=$(basename $0)
(
echo "${execName} [-h] [-j JOBS] [-m JOBS] [-s SECONDS] [-t] [-v] PREFIX"
echo ""
echo "Submit jobs that match PREFIX."
echo ""
echo " -h = Print this message and exit."
echo " -j JOBS = Fill the queue up to JOBS jobs (default 12)."
echo " -m JOBS = Submit no more that JOBS jobs total (default is all matching jobs)."
echo " -s SECONDS = Sleep between submission batches (default 60)."
echo " -t = Test mode. Do not actually make any changes. Implies -v."
echo " -v = Verbose mode. Print extra information."
# echo " -V = Version. Print a version string and exit."
) >&2
}
max_jobs=12
total_jobs=''
sleepy_time=60
verbose=false
test=false
while getopts hj:m:s:tv argname; do
case ${argname} in
h) usage; exit 0 ;;
j) max_jobs=${OPTARG} ;;
m) total_jobs=${OPTARG} ;;
s) sleepy_time=${OPTARG} ;;
t) test=true; verbose=true ;;
v) verbose=true ;;
*) usage; exit 1 ;;
esac
done
shift $((OPTIND-1))
if (( $# < 1 )); then
echo "ERROR: PREFIX required!"
exit 1
fi
prefix=$1
available_jobs=($(ls ${prefix}*))
if [[ -n "${total_jobs}" ]]; then
n_available=${total_jobs}
else
n_available=${#available_jobs[*]}
fi
j=0
while true; do
echo -n "INFO: "
date
foo=$(squeue -u ${USER} | wc -l)
n_jobs=$(( foo - 1 ))
if (( n_jobs < max_jobs )); then
n_submitted=0
while (( j < n_available && n_submitted + n_jobs < max_jobs )); do
${verbose} && echo "DEBUG: sbatch ${available_jobs[${j}]}"
${test} || sbatch ${available_jobs[${j}]}
n_submitted=$(( n_submitted + 1 ))
j=$(( j + 1 ))
done
echo "INFO: Submitted ${n_submitted} jobs."
${verbose} && echo "DEBUG: Job index is ${j}."
fi
if (( j == n_available)); then
echo "INFO: All jobs submitted."
break
fi
${verbose} && echo "DEBUG: sleep ${sleepy_time}"
sleep ${sleepy_time}
done
74 changes: 67 additions & 7 deletions etc/desi.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,27 @@
"Abacus/(MiniAbacusSummit|AbacusSummit)_(base|high|highbase|huge|hugebase)_(c[0-9]+)_(ph[0-9]+)/[^/]+$":"Abacus/\\1_\\2_\\3_\\4/\\1_\\2_\\3_\\4_aux.tar",
"Abacus/(scripts|verified_checksums)/.*$":"Abacus/Abacus_aux.tar"
},
"AbacusHOD_mocks":{},
"ELG_HOD":{},
"EZmock_lightcones":{},
"FirstGenMocks":{},
"KP45":{},
"NFW_Abacus":{},
"TNG_Rockstar":{},
"Uchuu":{},
"UNIT-BAO-RSD-challenge":{},
"UNITSIM":{},
"cov_mat_challenge":{},
"mocks_SV3":{},
"proto_sim":{}
},
"da":{
"__exclude__":["README.html"],
"edr":{
},
"ets":{
}
},
"datachallenge":{
"__exclude__":["svdc-summer2019/svdc2019c/README"],
"Argonne2015":{
Expand Down Expand Up @@ -167,6 +181,10 @@
},
"engineering":{
"__exclude__":[],
"2021_summer_illumination_checks":{
},
"donut":{
},
"focalplane":{
},
"fvc":{
Expand Down Expand Up @@ -209,6 +227,8 @@
"lya_forest/saclay/README",
"lya_forest/saclay/README~"
],
"CCMD_BGS":{
},
"DarkSky":{
"DarkSky/.*$":"DarkSky.tar"
},
Expand All @@ -227,9 +247,15 @@
"LGal_spectra":{
"LGal_spectra/.*$":"LGal_spectra.tar"
},
"MXXL":{
},
"OIIlf_may16_comparat":{
},
"TNG_spectra":{
"TNG_spectra/.*$":"TNG_spectra.tar"
},
"Uchuu":{
},
"UNIT":{
},
"bgs":{
Expand Down Expand Up @@ -312,10 +338,14 @@
},
"gqc":{
},
"gqp":{
},
"lya":{
},
"mws":{
},
"redux":{
},
"td":{
}
},
Expand All @@ -339,6 +369,8 @@
},
"desi_spectro_calib":{
},
"desi_spectro_dark":{
},
"fastspecfit":{
},
"new-code-old-calib":{
Expand All @@ -356,15 +388,15 @@
"quicklook":{
},
"redux":{
"redux/(?!andes|blanc|cascades|denali|everest|minisv2|oak1)([^/]+)/.*$":"EXCLUDE",
"redux/(?!andes|blanc|cascades|denali|everest|fuji|guadalupe|minisv2|oak1)([^/]+)/.*$":"EXCLUDE",
"redux/blanctest/.*$":"EXCLUDE",
"redux/(andes|blanc|cascades|denali|everest)/[^/]+$":"redux/\\1/redux_\\1_files.tar",
"redux/(andes|blanc|cascades|denali|everest)/(calibnight|dashboard|exposure_tables|processing_tables|run|zcatalog)/.*$":"redux/\\1/redux_\\1_\\2.tar",
"redux/(andes|blanc|cascades|denali|everest|fuji|guadalupe)/[^/]+$":"redux/\\1/redux_\\1_files.tar",
"redux/(andes|blanc|cascades|denali|everest|fuji|guadalupe)/(calibnight|dashboard|exposure_tables|processing_tables|run|zcatalog)/.*$":"redux/\\1/redux_\\1_\\2.tar",
"redux/(andes|blanc|cascades)/(exposures|preproc|tiles)/([0-9]+)/.*$":"redux/\\1/\\2/redux_\\1_\\2_\\3.tar",
"redux/(denali|everest)/(exposures|preproc)/([0-9]+)/.*$":"redux/\\1/\\2/redux_\\1_\\2_\\3.tar",
"redux/everest/healpix/[^/]+$":"redux/everest/healpix/redux_everest_healpix_files.tar",
"redux/everest/healpix/(main|sv1|sv2|sv3)/(backup|bright|dark|other)/([0-9]+)/.*$":"redux/everest/healpix/\\1/\\2/redux_everest_healpix_\\1_\\2_\\3.tar",
"redux/(denali|everest)/tiles/(1x_depth|4x_depth|cumulative|perexp|pernight)/([0-9]+)/.*$":"redux/\\1/tiles/\\2/redux_\\1_tiles_\\2_\\3.tar",
"redux/(denali|everest|fuji|guadalupe)/(exposures|preproc)/([0-9]+)/.*$":"redux/\\1/\\2/redux_\\1_\\2_\\3.tar",
"redux/(everest|fuji|guadalupe)/healpix/[^/]+$":"redux/\\1/healpix/redux_\\1_healpix_files.tar",
"redux/(everest|fuji|guadalupe)/healpix/(cmx|main|special|sv1|sv2|sv3)/(backup|bright|dark|other)/([0-9]+)/.*$":"redux/\\1/healpix/\\2/\\3/redux_\\1_healpix_\\2_\\3_\\4.tar",
"redux/(denali|everest|fuji|guadalupe)/tiles/(1x_depth|4x_depth|lowspeed|cumulative|perexp|pernight)/([0-9]+)/.*$":"redux/\\1/tiles/\\2/redux_\\1_tiles_\\2_\\3.tar",
"redux/minisv2/(alt|calibnight|run|tiles)/.*$":"redux/minisv2/redux_minisv2_\\1.tar",
"redux/minisv2/(exposures|preproc)/([0-9]+)/.*$":"redux/minisv2/\\1/redux_minisv2_\\1_\\2.tar",
"redux/oak1/.*$":"redux/oak1.tar"
Expand All @@ -378,17 +410,33 @@
"testdata":{
},
"teststand":{
},
"users":{
}
},
"survey":{
"__exclude__":[],
"GFA":{
},
"analysis":{
},
"catalogs":{
},
"fiberassign":{
},
"observations":{
},
"ops":{
},
"planning":{
},
"sims":{
}
},
"sv":{
"__exclude__":[],
"bgs":{
},
"forecasts":{
},
"tiles":{
Expand All @@ -401,6 +449,8 @@
"__exclude__":["README.html"],
"RF_files":{
},
"ToO":{
},
"analysis":{
},
"catalogs":{
Expand All @@ -416,18 +466,28 @@
},
"gaia_dr2_match_dr6":{
},
"gaia_edr3":{
},
"masks":{
},
"mws":{
},
"proposals":{
},
"qso_targets_dr3":{
},
"qso_training":{
},
"secondary":{
},
"skybricks":{
},
"skyhealpixs":{
},
"stripe82-dr2":{
},
"surveyops":{
},
"tycho_dr2":{
},
"urat_dr1":{
Expand Down

0 comments on commit 735e805

Please sign in to comment.