Skip to content

Commit

Permalink
migrate build stage to wm_build.sh
Browse files Browse the repository at this point in the history
Signed-off-by: Bruce Kropp <[email protected]>
  • Loading branch information
BruceKropp-Raytheon committed Nov 19, 2024
1 parent 7380a89 commit 5a7d187
Showing 1 changed file with 46 additions and 1 deletion.
47 changes: 46 additions & 1 deletion .cicd/scripts/wm_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,51 @@ BUILD_DIR=${BUILD_DIR:-${UFS_MODEL_DIR}/build}
TESTS_DIR=${TESTS_DIR:-${UFS_MODEL_DIR}/tests}
mkdir -p "${BUILD_DIR}"

cd "${BUILD_DIR}"
(
cd "${BUILD_DIR}"
pwd
)

pwd
echo "NODE_NAME=${NODE_NAME}"
echo "UFS_PLATFORM=${UFS_PLATFORM}"
echo "UFS_COMPILER=${UFS_COMPILER}"
export workspace=$(pwd)
machine=${NODE_NAME}
echo "machine=<${machine}>"
machine_id=${UFS_PLATFORM}
if [[ ${UFS_PLATFORM} =~ clusternoaa ]] ; then
machine_id="noaacloud"
sed -e "s|EPIC/spack-stack/spack-stack-1.5.0|spack-stack/spack-stack-1.5.1|g" -i modulefiles/ufs_noaacloud.intel.lua
fi
echo "machine_id=<${machine_id}>"

if [[ ${UFS_PLATFORM} = derecho ]] ; then
export ACCNR=nral0032
else
export ACCNR=epic
fi
echo "ACCNR=${ACCNR}"

export LMOD_SH_DBG_ON=0
echo "LMOD_VERSION=${LMOD_VERSION}"
if [[ ${UFS_PLATFORM} = gaea ]] ; then
source /gpfs/f5/epic/scratch/role.epic/contrib/Lmod_init_C5.sh
echo "LMOD_VERSION=${LMOD_VERSION}"
fi
set +x
module use $PWD/modulefiles >/dev/null 2>&1
module load ufs_${machine_id}.${UFS_COMPILER} || true
[[ ${UFS_PLATFORM} = gaea ]] && module load cmake/3.23.1 || true
module list

echo "Pipeline Building WM on ${UFS_PLATFORM} ${UFS_COMPILER} with Account=${ACCNR}."
export CMAKE_FLAGS="-DAPP=ATM -DCCPP_SUITES=FV3_GFS_v16"
/usr/bin/time -p \
-o ${WORKSPACE}/${UFS_PLATFORM}-${UFS_COMPILER}-time-wm_build.json \
-f '{\n "cpu": "%P"\n, "memMax": "%M"\n, "mem": {"text": "%X", "data": "%D", "swaps": "%W", "context": "%c", "waits": "%w"}\n, "pagefaults": {"major": "%F", "minor": "%R"}\n, "filesystem": {"inputs": "%I", "outputs": "%O"}\n, "time": {"real": "%e", "user": "%U", "sys": "%S"}\n}' \
./build.sh | tee ${workspace}/${UFS_PLATFORM}-${UFS_COMPILER}-wm_build-log.txt
status=${PIPESTATUS[0]}
echo "Pipeline Completed WM build on ${UFS_PLATFORM} ${UFS_COMPILER}. status=$status"

ls -l build/ufs_model

0 comments on commit 5a7d187

Please sign in to comment.