Skip to content

Commit

Permalink
use shared directories
Browse files Browse the repository at this point in the history
  • Loading branch information
ehneilsen committed Jan 7, 2025
1 parent c5e9f8e commit 12b36db
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 43 deletions.
29 changes: 7 additions & 22 deletions batch/compile_prenight_metadata_cache.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#!/usr/bin/env bash
#SBATCH --account=rubin:developers # Account name
#SBATCH --job-name=auxtel_prenight_daily # Job name
#SBATCH --output=/sdf/data/rubin/user/neilsen/batch/auxtel_prenight_daily/daily.out # Output file (stdout)
#SBATCH --error=/sdf/data/rubin/user/neilsen/batch/auxtel_prenight_daily/daily.err # Error file (stderr)
#SBATCH --output=/sdf/data/rubin/shared/scheduler/prenight/sbatch/compile_prenight_metadata_cache.out # Output file (stdout)
#SBATCH --error=/sdf/data/rubin/shared/scheduler/prenight/sbatch/compile_prenight_metadata_cache.err # Error file (stderr)
#SBATCH --partition=milano # Partition (queue) names
#SBATCH --nodes=1 # Number of nodes
#SBATCH --ntasks=1 # Number of tasks run in parallel
#SBATCH --cpus-per-task=1 # Number of CPUs per task
#SBATCH --mem=16G # Requested memory
#SBATCH --time=1:00:00 # Wall time (hh:mm:ss)

echo "******** START of run_prenight_sims.sh **********"
echo "******** START of compile_prenight_metadata_cache.sh **********"

# Source global definitions
if [ -f /etc/bashrc ]; then
Expand All @@ -22,29 +22,14 @@ if [[ -e ~/.profile.d && -n "$(ls -A ~/.profile.d/)" ]]; then
source <(cat $(find -L ~/.profile.d -name '*.conf'))
fi

__conda_setup="$('/sdf/group/rubin/user/neilsen/mambaforge/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/sdf/group/rubin/user/neilsen/mambaforge/etc/profile.d/conda.sh" ]; then
. "/sdf/group/rubin/user/neilsen/mambaforge/etc/profile.d/conda.sh"
else
export PATH="/sdf/group/rubin/user/neilsen/mambaforge/bin:$PATH"
fi
fi
unset __conda_setup

if [ -f "/sdf/group/rubin/user/neilsen/mambaforge/etc/profile.d/mamba.sh" ]; then
. "/sdf/group/rubin/user/neilsen/mambaforge/etc/profile.d/mamba.sh"
fi

mamba activate prenight
source /sdf/group/rubin/sw/w_latest/loadLSST.sh
conda activate /sdf/data/rubin/shared/scheduler/envs/prenight
export AWS_PROFILE=prenight
WORK_DIR=$(date '+/sdf/data/rubin/user/neilsen/batch/compile_prenight_metadata/%Y-%m-%dT%H%M%S' --utc)
WORK_DIR=$(date '+/sdf/data/rubin/shared/scheduler/prenight/work/compile_prenight_metadata_cache/%Y-%m-%dT%H%M%S' --utc)
echo "Working in $WORK_DIR"
mkdir ${WORK_DIR}
printenv > env.out
cd ${WORK_DIR}
printenv > env.out
compile_sim_archive_metadata_resource --append
echo "******* END of compile_prenight_metadata_cache.sh *********"

27 changes: 6 additions & 21 deletions batch/run_prenight_sims.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env bash
#SBATCH --account=rubin:developers # Account name
#SBATCH --job-name=auxtel_prenight_daily # Job name
#SBATCH --output=/sdf/data/rubin/user/neilsen/batch/auxtel_prenight_daily/daily.out # Output file (stdout)
#SBATCH --error=/sdf/data/rubin/user/neilsen/batch/auxtel_prenight_daily/daily.err # Error file (stderr)
#SBATCH --output=/sdf/data/rubin/shared/scheduler/prenight/sbatch/run_prenight_sims.out # Output file (stdout)
#SBATCH --error=/sdf/data/rubin/shared/scheduler/prenight/sbatch/run_prenight_sims.err # Error file (stderr)
#SBATCH --partition=milano # Partition (queue) names
#SBATCH --nodes=1 # Number of nodes
#SBATCH --ntasks=1 # Number of tasks run in parallel
Expand All @@ -22,29 +22,14 @@ if [[ -e ~/.profile.d && -n "$(ls -A ~/.profile.d/)" ]]; then
source <(cat $(find -L ~/.profile.d -name '*.conf'))
fi

__conda_setup="$('/sdf/group/rubin/user/neilsen/mambaforge/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/sdf/group/rubin/user/neilsen/mambaforge/etc/profile.d/conda.sh" ]; then
. "/sdf/group/rubin/user/neilsen/mambaforge/etc/profile.d/conda.sh"
else
export PATH="/sdf/group/rubin/user/neilsen/mambaforge/bin:$PATH"
fi
fi
unset __conda_setup

if [ -f "/sdf/group/rubin/user/neilsen/mambaforge/etc/profile.d/mamba.sh" ]; then
. "/sdf/group/rubin/user/neilsen/mambaforge/etc/profile.d/mamba.sh"
fi

mamba activate prenight
source /sdf/group/rubin/sw/w_latest/loadLSST.sh
conda activate /sdf/data/rubin/shared/scheduler/envs/prenight
export AWS_PROFILE=prenight
WORK_DIR=$(date '+/sdf/data/rubin/user/neilsen/batch/auxtel_prenight_daily/%Y-%m-%dT%H%M%S' --utc)
WORK_DIR=$(date '+/sdf/data/rubin/shared/scheduler/prenight/work/run_prenight_sims/%Y-%m-%dT%H%M%S' --utc)
echo "Working in $WORK_DIR"
mkdir ${WORK_DIR}
printenv > env.out
cd ${WORK_DIR}
printenv > env.out
prenight_sim --scheduler auxtel.pickle.xz --opsim None --repo "https://github.com/lsst-ts/ts_config_ocs.git" --script "Scheduler/feature_scheduler/auxtel/fbs_config_image_photocal_survey.py" --branch main
echo "******* END of run_prenight_sims.sh *********"

0 comments on commit 12b36db

Please sign in to comment.