Skip to content

Commit

Permalink
Merge branch 'main' into tulio/radiation_feeder
Browse files Browse the repository at this point in the history
  • Loading branch information
MTCam committed Jun 28, 2023
2 parents 99168eb + dd58da4 commit 83fd48a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
6 changes: 4 additions & 2 deletions scripts/lassen-parallel-spawner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
# unset CUDA_CACHE_DISABLE
POCL_CACHE_ROOT=${POCL_CACHE_ROOT:-"/tmp/$USER/pocl-scratch"}
XDG_CACHE_ROOT=${XDG_CACHE_HOME:-"/tmp/$USER/xdg-scratch"}
export POCL_CACHE_DIR="${POCL_CACHE_ROOT}/rank$OMPI_COMM_WORLD_RANK"
export XDG_CACHE_HOME="${XDG_CACHE_ROOT}/rank$OMPI_COMM_WORLD_RANK"
POCL_CACHE_DIR=${POCL_CACHE_DIR:-"${POCL_CACHE_ROOT}/rank$OMPI_COMM_WORLD_RANK"}
XDG_CACHE_HOME=${XDG_CACHE_HOME:-"${XDG_CACHE_ROOT}/rank$OMPI_COMM_WORLD_RANK"}
export POCL_CACHE_DIR
export XDG_CACHE_HOME

"$@"
3 changes: 2 additions & 1 deletion scripts/mirge-testing-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ MIRGE_MPI_EXEC="mpiexec"
PYOPENCL_TEST=""
PYOPENCL_CTX=""

# Add new hosts here, and <hostname>-parallel-spawner.sh
if [[ $(hostname) == "porter" ]]; then
MIRGE_PARALLEL_SPAWNER="bash ${MIRGE_HOME}/scripts/run-gpus-generic.sh"
MIRGE_PARALLEL_SPAWNER="bash ${MIRGE_HOME}/scripts/porter-parallel-spawner.sh"
PYOPENCL_TEST="port:nv"
PYOPENCL_CTX="port:nv"

Expand Down
11 changes: 11 additions & 0 deletions scripts/run-gpus-generic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,24 @@
#
# Run it like this:
# mpiexec -n 2 bash run-gpus-generic.sh python -m mpi4py pulse-mpi.py --lazy
# unset CUDA_CACHE_DISABLE
POCL_CACHE_ROOT=${POCL_CACHE_ROOT:-"/tmp/$USER/pocl-scratch"}
XDG_CACHE_ROOT=${XDG_CACHE_HOME:-"/tmp/$USER/xdg-scratch"}

if [[ -n "$OMPI_COMM_WORLD_NODE_RANK" ]]; then
# Open MPI
export CUDA_VISIBLE_DEVICES=$OMPI_COMM_WORLD_LOCAL_RANK
RANK_ID="rank${OMPI_COMM_WORLD_RANK}"
elif [[ -n "$MPI_LOCALRANKID" ]]; then
# mpich/mvapich
export CUDA_VISIBLE_DEVICES=$MPI_LOCALRANKID
RANK_ID="rank${MPI_LOCALRANKID}"
fi

POCL_CACHE_DIR=${POCL_CACHE_DIR:-"${POCL_CACHE_ROOT}/${RANK_ID}"}
XDG_CACHE_HOME=${XDG_CACHE_HOME:-"${XDG_CACHE_ROOT}/${RANK_ID}"}

export POCL_CACHE_DIR
export XDG_CACHE_HOME

"$@"

0 comments on commit 83fd48a

Please sign in to comment.