Skip to content

Commit

Permalink
Correct binding for single-node local mpi.sh.
Browse files Browse the repository at this point in the history
  • Loading branch information
PapyChacal committed Oct 20, 2023
1 parent e601647 commit 3c88ccd
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions fast/mpi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ export OMP_PLACES=cores
export OMP_PROC_BIND=true

# Doing 4 ranks X 4 threads locally here
export OMP_NUM_THREADS=16
export MPI_NUM_RANKS=8

export OMP_NUM_THREADS=4
export MPI_NUM_RANKS=4
export HYDRA_TOPO_DEBUG=1
# Just extract the reported throughput from the whole output of the passed command
get_throughput() {
#echo $($@)
$@ |& grep Global | head -n 1 | cut -d ' ' -f6
}

Expand All @@ -45,8 +46,8 @@ do
# mpirun -np $MPI_NUM_RANKS --bind-to=core python $bench -so $so --xdsl 1

# Get the runtimes
DEVITO_MPI=diag2 devito_time=$(get_throughput mpirun -np $MPI_NUM_RANKS --bind-to core python $bench -so $so --devito 1)
xdsl_time=$(get_throughput mpirun -np $MPI_NUM_RANKS --bind-to core python $bench -so $so --xdsl 1)
DEVITO_MPI=diag2 devito_time=$(get_throughput mpirun -n $MPI_NUM_RANKS --bind-to core:$OMP_NUM_THREADS python $bench -so $so --devito 1)
xdsl_time=$(get_throughput mpirun -n $MPI_NUM_RANKS --bind-to core:$OMP_NUM_THREADS python $bench -so $so --xdsl 1)
# print CSV line
echo $bench_name,$so,$devito_time,$xdsl_time
done
Expand Down

0 comments on commit 3c88ccd

Please sign in to comment.