Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for cmake build system. #11

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
update ccpp prebuild step for out-of-source build. run all compiles c…
…oncurently
  • Loading branch information
DusanJovic-NOAA committed Nov 5, 2019
commit cf8e622e16771dda58987181bc294de3837f8dca
23 changes: 15 additions & 8 deletions tests/compile_cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ else
clean_before=${5:-YES}
clean_after=${6:-YES}
fi
BUILD_DIR=build_${BUILD_NAME}

# ----------------------------------------------------------------------
# Make sure we have reasonable number of threads.
Expand All @@ -64,9 +65,11 @@ cd ${PATHTR}/tests
echo "Compiling ${MAKE_OPT} into $BUILD_NAME.exe on $MACHINE_ID"

if [ $clean_before = YES ] ; then
rm -rf build_${BUILD_NAME}
rm -rf ${BUILD_DIR}
fi

mkdir -p ${BUILD_DIR}

# set CCPP_CMAKE_FLAGS based on $MAKE_OPT

CCPP_CMAKE_FLAGS=""
Expand Down Expand Up @@ -117,6 +120,7 @@ if [[ "${MAKE_OPT}" == *"CCPP=Y"* ]]; then
if [[ "${MAKE_OPT}" == *"STATIC=Y"* ]]; then
CCPP_CMAKE_FLAGS="${CCPP_CMAKE_FLAGS} -DSTATIC=ON"
else
echo "Error, cmake build not compatible with dynamic CCPP"
exit 1
fi

Expand All @@ -129,34 +133,37 @@ if [[ "${MAKE_OPT}" == *"CCPP=Y"* ]]; then
(
SUITES=$( echo $MAKE_OPT | sed 's/.* SUITES=https://' | sed 's/ .*//' )
cd ${PATHTR}
./ccpp/framework/scripts/ccpp_prebuild.py --config=ccpp/config/ccpp_prebuild_config.py --static --suites=${SUITES}
./FV3/ccpp/framework/scripts/ccpp_prebuild.py --config=FV3/ccpp/config/ccpp_prebuild_config.py --static --suites=${SUITES} --builddir=tests/${BUILD_DIR}/FV3
)

fi
# Read list of schemes, caps, and static API
source ${BUILD_DIR}/FV3/ccpp/physics/CCPP_SCHEMES.sh
source ${BUILD_DIR}/FV3/ccpp/physics/CCPP_CAPS.sh
source ${BUILD_DIR}/FV3/ccpp/physics/CCPP_STATIC_API.sh

fi

if [[ "${MAKE_OPT}" == *"NAM_phys=Y"* ]]; then
CCPP_CMAKE_FLAGS="${CCPP_CMAKE_FLAGS} -DPHYS=nam"
fi
CCPP_CMAKE_FLAGS=$(trim "${CCPP_CMAKE_FLAGS}")

mkdir -p build_${BUILD_NAME}

(
source $PATHTR/NEMS/src/conf/module-setup.sh.inc
module use $PATHTR/modulefiles/${MACHINE_ID}
module load fv3

cd build_${BUILD_NAME}
cd ${BUILD_DIR}

cmake ${PATHTR} ${CCPP_CMAKE_FLAGS}
make -j ${MAKE_THREADS} VERBOSE=1
make -j ${MAKE_THREADS}
mv NEMS.exe ../${BUILD_NAME}.exe
cp ${PATHTR}/modulefiles/${MACHINE_ID}/fv3 ../modules.${BUILD_NAME}
cd ..
)

if [ $clean_after = YES ] ; then
rm -rf build_${BUILD_NAME}
rm -rf ${BUILD_DIR}
fi

elapsed=$SECONDS
Expand Down
2 changes: 1 addition & 1 deletion tests/rt.conf
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ COMPILE | REPRO=Y CCPP=Y STATIC=Y SUITES=FV3_GFS_2017_gfdlmp_regional,FV3_GFS_20
COMPILE | REPRO=Y CCPP=Y STATIC=Y SUITES=FV3_GFS_2017_gfdlmp_regional,FV3_GFS_2017_gfdlmp_regional_c768 32BIT=Y | standard | jet.intel | |

RUN | fv3_ccpp_regional_control | standard | | |
RUN | fv3_ccpp_regional_restart | standard | | |
RUN | fv3_ccpp_regional_restart | standard | | | fv3_ccpp_regional_control
RUN | fv3_ccpp_regional_quilt | standard | | |
# fv3_regional_c768 not working on Cheyenne, code aborts with invalid values
# for surface pressure, out of range warnings and all other sorts of errors
Expand Down
14 changes: 7 additions & 7 deletions tests/rt_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -465,12 +465,12 @@ rocoto_create_compile_task() {

# serialize CCPP builds. FIXME
DusanJovic-NOAA marked this conversation as resolved.
Show resolved Hide resolved
DEP_STRING=""
if [[ ${NEMS_VER^^} =~ "CCPP=Y" && ${COMPILE_NR_DEP} != '' ]]; then
DEP_STRING="<dependency><taskdep task=\"compile_${COMPILE_NR_DEP}\"/></dependency>"
fi
#if [[ ${NEMS_VER^^} =~ "CCPP=Y" && ${COMPILE_NR_DEP} != '' ]]; then
# DEP_STRING="<dependency><taskdep task=\"compile_${COMPILE_NR_DEP}\"/></dependency>"
#fi

cat << EOF >> $ROCOTO_XML
<task name="compile_${COMPILE_NR}" maxtries="1">
<task name="compile_${COMPILE_NR}" maxtries="3">
${DEP_STRING}
<command>$rocoto_cmd</command>
<jobname>compile_${COMPILE_NR}</jobname>
Expand Down Expand Up @@ -569,9 +569,9 @@ EOF
echo " task compile_${COMPILE_NR}" >> ${ECFLOW_RUN}/regtest.def
echo " inlimit max_builds" >> ${ECFLOW_RUN}/regtest.def
# serialize CCPP builds. FIXME
if [[ ${NEMS_VER^^} =~ "CCPP=Y" && ${COMPILE_NR_DEP} != '' ]]; then
echo " trigger compile_${COMPILE_NR_DEP} == complete" >> ${ECFLOW_RUN}/regtest.def
fi
#if [[ ${NEMS_VER^^} =~ "CCPP=Y" && ${COMPILE_NR_DEP} != '' ]]; then
# echo " trigger compile_${COMPILE_NR_DEP} == complete" >> ${ECFLOW_RUN}/regtest.def
#fi

}

Expand Down