Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
_upstream/
.deps/
build/
# vendored upstream source directories that happen to be named build/ (Level 2 byte-identical copies);
# a clean clone cannot build hipBone / miniWeather without them
!level2/hipbone/occa/scripts/build/
!level2/miniweather/cpp/build/
cmake-build-*/
results/

Expand Down
16 changes: 15 additions & 1 deletion level2/branson/validate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,22 @@ command -v mpirun >/dev/null 2>&1 || fail "mpirun not on PATH (source $R/hpcperf
command -v python3 >/dev/null 2>&1 || fail "python3 not on PATH"

# ---------------------------------------------------------------- (A) ctest
# Upstream's 2-rank unit tests (test_imc_state_2pe, test_photon_2pe) are launched by ctest with a bare
# `mpirun -np 2`. Inside a Slurm allocation made with one task slot per node (SLURM_TASKS_PER_NODE=1) PRRTE
# refuses that launch ("not enough slots"); the project launcher relaxes the same limit per launch after its
# GPU checks (hpcperf_mpi_launch.sh, --map-by :OVERSUBSCRIBE). The same relaxation is applied here, for the
# ctest step only, and only when the allocation actually has fewer slots than the tests need (2 CPU ranks on
# one node; no GPU sharing is involved).
# The relaxation is a command-local environment of the ctest invocation only (never exported, so the caller's
# environment and the later 1-rank GPU run (B) are untouched).
SLOTS="${SLURM_TASKS_PER_NODE:-}"; SLOTS="${SLOTS%%[^0-9]*}"
CTEST_ENV=()
if [ -n "${SLURM_JOB_ID:-}" ] && [ -n "$SLOTS" ] && [ "$SLOTS" -lt 2 ]; then
CTEST_ENV=(env PRTE_MCA_rmaps_default_mapping_policy=":OVERSUBSCRIBE")
echo "== note: Slurm allocation has $SLOTS task slot(s)/node; PRRTE mapping relaxed for the 2-rank unit tests (ctest command only)"
fi
echo "== (A) upstream ctest in $BUILD (test_input_1pe excluded, see header)"
if ! ctest --test-dir "$BUILD" -E test_input_1pe --output-on-failure > "$BUILD/validate_ctest.log" 2>&1; then
if ! "${CTEST_ENV[@]}" ctest --test-dir "$BUILD" -E test_input_1pe --output-on-failure > "$BUILD/validate_ctest.log" 2>&1; then
tail -30 "$BUILD/validate_ctest.log"
fail "ctest failed (log: $BUILD/validate_ctest.log)"
fi
Expand Down
31 changes: 31 additions & 0 deletions level2/hipbone/occa/scripts/build/Make.fortran
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#---[ Paths/Flags ]-------------------------------
# OCCA (global) library path
fPaths = -L$(OCCA_DIR)/lib

# Extra (user-supplied) include and library paths
fPaths += $(foreach path, $(subst :, ,$(OCCA_INCLUDE_PATH)), -I$(path))
fPaths += $(foreach path, $(subst :, ,$(OCCA_LIBRARY_PATH)), -L$(path))

# OCCA (global) Fortran module path - add as include path to allow for
# specifying a local project module path)
fPaths += -I$(subst $(PROJ_DIR),$(OCCA_DIR),$(modPath))

fLinkerFlags += $(fCppFlag) -locca -locca_fortran

fSoNameFlag = $(subst libocca,libocca_fortran,$(soNameFlag))
#=================================================


#---[ Source/Object files ]-----------------------
# ---[ libocca_fortran ]-------------
# Fortran source files
fSources = $(shell find $(OCCA_DIR)/src/fortran -type f -iname '*.f90')
fSrcToObject = $(subst $(OCCA_DIR)/src,$(objPath),$(1:.f90=.o))
fObjects = $(call fSrcToObject,$(fSources))
# ===================================

# ---[ Fortran tests ]---------------
fTestSources = $(realpath $(shell find $(PROJ_DIR)/tests/src -type f -name '*.f90'))
fTests = $(subst $(testPath)/src,$(testPath)/bin,$(fTestSources:.f90=))
# ===================================
#=================================================
28 changes: 28 additions & 0 deletions level2/hipbone/occa/scripts/build/Make.fortran_rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#---[ Fortran rules ]-----------------------------
# Fortran module dependencies
fObjPath = $(objPath)/fortran
$(fObjPath)/occa_types_m.o: $(fObjPath)/occa_typedefs_m.o
$(fObjPath)/occa_base_m.o: $(fObjPath)/occa_types_m.o
$(fObjPath)/occa_dtype_m.o: $(fObjPath)/occa_types_m.o
$(fObjPath)/occa_device_m.o: $(fObjPath)/occa_types_m.o
$(fObjPath)/occa_memory_m.o: $(fObjPath)/occa_types_m.o
$(fObjPath)/occa_kernel_m.o: $(fObjPath)/occa_types_m.o
$(fObjPath)/occa_kernelBuilder_m.o: $(fObjPath)/occa_types_m.o
$(fObjPath)/occa_stream_m.o: $(fObjPath)/occa_types_m.o
$(fObjPath)/occa_uva_m.o: $(fObjPath)/occa_types_m.o
$(fObjPath)/occa_scope_m.o: $(fObjPath)/occa_types_m.o
$(fObjPath)/occa_json_m.o: $(fObjPath)/occa_types_m.o
$(fObjPath)/occa_m.o: $(fObjPath)/fc_string_m.o \
$(fObjPath)/occa_typedefs_m.o \
$(fObjPath)/occa_types_m.o \
$(fObjPath)/occa_base_m.o \
$(fObjPath)/occa_dtype_m.o \
$(fObjPath)/occa_device_m.o \
$(fObjPath)/occa_memory_m.o \
$(fObjPath)/occa_kernel_m.o \
$(fObjPath)/occa_kernelBuilder_m.o \
$(fObjPath)/occa_stream_m.o \
$(fObjPath)/occa_uva_m.o \
$(fObjPath)/occa_scope_m.o \
$(fObjPath)/occa_json_m.o
# ================================================
Loading