Skip to content

Commit

Permalink
Update worker entrypoints for local data.
Browse files Browse the repository at this point in the history
Updating main entrypoint scripts for ngen and calibration worker images
for local data handling.
  • Loading branch information
robertbartel committed Jul 12, 2024
1 parent bbce5d7 commit ea6992c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docker/main/ngen/ngen_cal_entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ while [ ${#} -gt 0 ]; do
declare -x CALIBRATION_CONFIG_BASENAME="${2:?}"
shift
;;
--primary-workers)
declare -x PRIMARY_WORKERS="${2:?}"
shift
;;
esac
shift
done
Expand Down Expand Up @@ -101,6 +105,10 @@ start_calibration() {
return ${NGEN_RETURN}
}

# Run make_data_local Python functions to make necessary data local
# Called for every worker, but Python code will make sure only one worker per node makes a call that has effect
py_funcs make_data_local ${WORKER_INDEX:-0} ${PRIMARY_WORKERS:-0}

# We can allow worker index to not be supplied when executing serially
if [ "${WORKER_INDEX:-0}" = "0" ]; then
if [ "$(whoami)" = "${MPI_USER:?MPI user not defined}" ]; then
Expand Down
8 changes: 8 additions & 0 deletions docker/main/ngen/ngen_entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ while [ ${#} -gt 0 ]; do
declare -x WORKER_INDEX="${2:?}"
shift
;;
--primary-workers)
declare -x PRIMARY_WORKERS="${2:?}"
shift
;;
esac
shift
done
Expand All @@ -60,6 +64,10 @@ if [ ! -e /dmod/datasets/linked_job_output ]; then
ln -s ${JOB_OUTPUT_WRITE_DIR} /dmod/datasets/linked_job_output
fi

# Run make_data_local Python functions to make necessary data local
# Called for every worker, but Python code will make sure only one worker per node makes a call that has effect
py_funcs make_data_local ${WORKER_INDEX:-0} ${PRIMARY_WORKERS:-0}

# We can allow worker index to not be supplied when executing serially
if [ "${WORKER_INDEX:-0}" = "0" ]; then
if [ "$(whoami)" = "${MPI_USER:?MPI user not defined}" ]; then
Expand Down

0 comments on commit ea6992c

Please sign in to comment.