@@ -41,7 +41,7 @@ E4S_CL_IMAGE_DEF=""
4141E4S_CL_REBUILD_IMAGE=" 0"
4242E4S_CL_APPTAINER_BUILD_ARGS=" "
4343E4S_CL_RUN_HOST_BASELINE=" 1"
44- E4S_CL_RUN_CONTAINER_BASELINE=" 0 "
44+ E4S_CL_RUN_CONTAINER_BASELINE=" 1 "
4545E4S_CL_PRUNE_INTEL_OPENCL=" 0"
4646E4S_CL_SKIP_PROFILE_DETECT=" 0"
4747E4S_CL_WI4MPI_CFLAGS=" -Wno-error=implicit-function-declaration -Wno-error=incompatible-pointer-types -Wno-error=format -Wno-error=int-conversion -Wno-error=return-type -include string.h -include sys/time.h"
@@ -52,6 +52,8 @@ E4S_CL_HOST_MPIRUN=""
5252E4S_CL_LAUNCHER=" "
5353E4S_CL_SCHEDULER=" "
5454E4S_CL_E4SCL_LAUNCH_ARGS=" "
55+ E4S_CL_LAUNCHER_ARGS=" "
56+ E4S_CL_OSU_ARGS=" "
5557E4S_CL_TIMEOUT_DURATION=" 60s"
5658
5759log () { printf " [e4s-cl-test] %s\n" " $* " ; }
@@ -129,7 +131,7 @@ Options:
129131 --cache-dir <path> Cache directory (default: _e4scl_cache_<tag>)
130132 --clean-workdir Delete workdir on exit (default: off)
131133 --host-baseline <on|off> Run host-only baseline (default: on)
132- --container-baseline <on|off> Run container-only baseline (default: off )
134+ --container-baseline <on|off> Run container-only baseline (default: on )
133135 --no-prune-intel-opencl Disable workaround that prunes Intel/OpenCL libs from profile (default: pruning enabled)
134136 --skip-profile-detect Skip profile detect if profile already has bindings (default: off)
135137 --wi4mpi-cflags "..." Extra C/C++ flags for Wi4MPI build (default: relax GCC 14 errors)
@@ -139,7 +141,9 @@ Options:
139141 --host-mpirun <path> Override host mpirun/mpiexec (default: auto-detect)
140142 --launcher <cmd> Force launcher (mpirun or srun) (default: auto-detect)
141143 --scheduler <name> If "slurm", use srun when available (default: none)
142- --e4scl-launch-args "..." Extra args for e4s-cl launch (default: none)
144+ --launcher-args "..." Extra arguments for the MPI launcher (e.g. -p partition -N 2)
145+ --osu-args "..." Override OSU benchmark arguments (e.g. "-i 1000 -m 1024:1048576")
146+ Safe for latency, bw, and allreduce.
143147 --timeout <duration> Timeout for MPI runs (default: 60s)
144148 --check Check environment prerequisites and exit
145149 -h, --help Show help
@@ -223,6 +227,8 @@ while [[ $# -gt 0 ]]; do
223227 --launcher) E4S_CL_LAUNCHER=" $2 " ; shift 2 ;;
224228 --scheduler) E4S_CL_SCHEDULER=" $2 " ; shift 2 ;;
225229 --e4scl-launch-args) E4S_CL_E4SCL_LAUNCH_ARGS=" $2 " ; shift 2 ;;
230+ --launcher-args) E4S_CL_LAUNCHER_ARGS=" $2 " ; shift 2 ;;
231+ --osu-args) E4S_CL_OSU_ARGS=" $2 " ; shift 2 ;;
226232 --timeout) E4S_CL_TIMEOUT_DURATION=" $2 " ; shift 2 ;;
227233 --check) E4S_CL_ONLY_CHECK=" 1" ; shift ;;
228234 -h|--help) usage; exit 0 ;;
@@ -334,6 +340,7 @@ run_timed() {
334340 local out_file=" ${E4S_CL_WORKDIR} /timing.dat"
335341
336342 log " Running [${label} ]..."
343+ log " Command: ${cmd[*]} "
337344 # Use python for distinct wall-clock measurement
338345 local start
339346 start=$( python3 -c ' import time; print(time.time())' )
@@ -472,6 +479,11 @@ else
472479 LAUNCHER_ARGS=(" -np" " ${E4S_CL_MPI_PROCS} " )
473480fi
474481
482+ if [[ -n " ${E4S_CL_LAUNCHER_ARGS} " ]]; then
483+ read -r -a EXTRA_LAUNCHER_ARGS <<< " ${E4S_CL_LAUNCHER_ARGS}"
484+ LAUNCHER_ARGS+=(" ${EXTRA_LAUNCHER_ARGS[@]} " )
485+ fi
486+
475487HOST_MPI_VERSION=" $( ${HOST_MPIRUN} --version 2> /dev/null | head -n 2 || true) "
476488HOST_MPI_FAMILY=" $( detect_mpi_family " ${HOST_MPI_VERSION} " ) "
477489CONTAINER_MPI_VERSION=" $( ${CONTAINER_CMD} exec " ${E4S_CL_IMAGE} " mpirun --version 2> /dev/null | head -n 2 || true) "
@@ -548,6 +560,12 @@ E4S_CL_BIN="${REPO_ROOT}/.venv/bin/e4s-cl"
548560
549561if [[ " ${NEEDS_TRANSLATION} " == " 1" ]]; then
550562 log " Wi4MPI translation required; e4s-cl will install Wi4MPI during launch if missing"
563+
564+ # Force wi4mpi to use a local directory inside the workdir
565+ WI4MPI_LOCAL_PREFIX=" ${E4S_CL_WORKDIR} /wi4mpi"
566+ E4SCL_LAUNCH_ARGS+=(" --wi4mpi" " ${WI4MPI_LOCAL_PREFIX} " )
567+ log " CONFIG: using local Wi4MPI prefix: ${WI4MPI_LOCAL_PREFIX} "
568+
551569 if [[ -n " ${E4S_CL_WI4MPI_CFLAGS} " ]]; then
552570 log " CONFIG: Wi4MPI build flags set (for e4s-cl internal use): ${E4S_CL_WI4MPI_CFLAGS} "
553571 log " CONFIG: These flags will be used by e4s-cl when building Wi4MPI, not for OSU benchmarks"
@@ -625,12 +643,21 @@ printf "osu_url=%s\nosu_sha256=%s\n" "${E4S_CL_OSU_URL}" "${E4S_CL_OSU_SHA256}"
625643
626644if [[ " ${E4S_CL_MODE} " == " light" ]]; then
627645 OSU_BENCHES=(" pt2pt/osu_latency" " pt2pt/osu_bw" )
628- OSU_ARGS=(" -x" " 10 " " -i" " 100 " " -m" " 8:1024 " )
646+ OSU_ARGS=(" -x" " 100 " " -i" " 1000 " " -m" " 8:65536 " )
629647else
630648 OSU_BENCHES=(" pt2pt/osu_latency" " pt2pt/osu_bw" " collective/osu_allreduce" )
631649 OSU_ARGS=()
632650fi
633651
652+ if [[ -n " ${E4S_CL_OSU_ARGS} " ]]; then
653+ read -r -a OSU_ARGS <<< " ${E4S_CL_OSU_ARGS}"
654+ else
655+ # Default Arguments:
656+ # - Latency: 1000 iterations to dampen startup noise
657+ # - Bandwidth: up to 1MB (1048576) is usually sufficient to see peak BW without timing out
658+ OSU_ARGS=(" -x" " 100" " -i" " 1000" " -m" " 8:1048576" )
659+ fi
660+
634661if [[ " ${E4S_CL_MPI_PROCS} " != " 2" ]]; then
635662 if printf ' %s\n' " ${OSU_BENCHES[@]} " | grep -q " pt2pt/osu_" ; then
636663 log " NOTE: pt2pt OSU benchmarks require exactly 2 processes (current: ${E4S_CL_MPI_PROCS} )"
@@ -730,6 +757,9 @@ if ! profile_has_bindings; then
730757 fi
731758fi
732759
760+ log " Profile Content (Libraries/Files to be bound):"
761+ " ${E4S_CL_BIN} " profile show
762+
733763log " Step 5: Building Container Benchmarks. We compile the same benchmarks *inside* the container against the Container's MPI to demonstrate ABI compatibility or translation."
734764OSU_CONT_PREFIX=" ${E4S_CL_WORKDIR} /osu-container"
735765OSU_CONT_META=" ${OSU_CONT_PREFIX} /.build-meta"
@@ -750,6 +780,7 @@ if [[ "${REBUILD_CONT_OSU}" == "1" ]]; then
750780 set -euo pipefail; \
751781 unset CFLAGS; \
752782 unset CXXFLAGS; \
783+ unset CXX; \
753784 cd /work; \
754785 rm -rf osu-container-build && mkdir osu-container-build; \
755786 tar -xzf /cache/osu.tar.gz -C osu-container-build --strip-components=1; \
764795fi
765796
766797log " Step 6: MAIN TEST. Running the container-compiled binary using the Host's MPI. e4s-cl handles the library injection and launcher wrapping."
798+ log " Debug: Verifying library resolution inside container (ldd)"
799+ " ${E4S_CL_BIN} " launch " ${E4SCL_LAUNCH_ARGS[@]} " " ${LAUNCHER_BIN} " -n 1 ldd " ${OSU_CONT_PREFIX} /libexec/osu-micro-benchmarks/mpi/pt2pt/osu_latency" | grep -E " libmpi|libmpich|libpami|libfabric" || echo " (ldd check finished, no obvious MPI libs found in grep filter)"
800+
767801for bench in " ${OSU_BENCHES[@]} " ; do
768802 bench_name=" $( basename " ${bench} " ) "
769803 out_file=" ${E4S_CL_WORKDIR} /e4scl_${bench_name} .txt"
0 commit comments