From b24259ed8cdb273273f82c2b3f3a2dcac60b32ba Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Mon, 29 Oct 2018 14:24:08 -0500 Subject: Add files and changes to cross compile with CrayLinuxEnvironment and run ctest tests with a batch job on knl compute nodes. --- bin/batch/knl_H5detect.sl.in.cmake | 20 ++++++++++++++++++++ bin/batch/knl_ctestSP.sl | 28 ++++++++++++++++++++++++++++ config/toolchain/crayle.cmake | 20 ++++++++++++++++++++ src/CMakeLists.txt | 6 +++--- 4 files changed, 71 insertions(+), 3 deletions(-) create mode 100644 bin/batch/knl_H5detect.sl.in.cmake create mode 100644 bin/batch/knl_ctestSP.sl create mode 100644 config/toolchain/crayle.cmake diff --git a/bin/batch/knl_H5detect.sl.in.cmake b/bin/batch/knl_H5detect.sl.in.cmake new file mode 100644 index 0000000..39a3ef3 --- /dev/null +++ b/bin/batch/knl_H5detect.sl.in.cmake @@ -0,0 +1,20 @@ +#!/bin/bash + +#SBATCH -p knl -C quad +#SBATCH --nodes=1 +#SBATCH -t 00:10:00 +#SBATCH --mail-type=BEGIN,END,FAIL +#SBATCH --mail-user=@sandia.gov +#SBATCH --export=ALL +#SBATCH --job-name=knl_h5detect + + +# Inputs: Build directory, output file name, executable file name (username/email if available). +PROGNAME=H5detect +OUTPUT=H5Tinit.c + +CMD="@HDF5_BINARY_DIR@/bin/${PROGNAME} @HDF5_GENERATED_SOURCE_DIR@/${OUTPUT}" +echo "Run $CMD" +srun -n 1 $CMD +echo "Done running $CMD" + diff --git a/bin/batch/knl_ctestSP.sl b/bin/batch/knl_ctestSP.sl new file mode 100644 index 0000000..56da347 --- /dev/null +++ b/bin/batch/knl_ctestSP.sl @@ -0,0 +1,28 @@ +#!/bin/bash + +#SBATCH -p knl -C quad,flat +#SBATCH --nodes=1 +#SBATCH -t 01:00:00 +#SBATCH --mail-type=BEGIN,END,FAIL +##SBATCH --mail-user=@sandia.gov +#SBATCH --export=ALL +#SBATCH --job-name=h5_ctestS + +module load cmake +module load craype-hugepages4M + +cd build +CMD="ctest . -E TEST_PAR|H5DIFF|PERFORM -C Release -j 32 -T test" + +echo "Run $CMD. Test output will be in build/ctestS.out" +$CMD >& ctestS.out +echo "Done running $CMD" + + +#run parallel tests except t_cache_image test +CMD="ctest . -R TEST_PAR|PH5DIFF|PERFORM -E t_cache_image -C Release -T test" + +echo "Run $CMD. Test output will be in build/ctestP.out" +$CMD >& ctestP.out +echo "Done running $CMD" + diff --git a/config/toolchain/crayle.cmake b/config/toolchain/crayle.cmake new file mode 100644 index 0000000..a83147b --- /dev/null +++ b/config/toolchain/crayle.cmake @@ -0,0 +1,20 @@ +# Uncomment the following to use cross-compiling +set(CMAKE_SYSTEM_NAME Linux) +set(CMAKE_COMPILER_VENDOR "CrayLinuxEnvironment") + +set(CMAKE_C_COMPILER cc) +set(CMAKE_Fortran_COMPILER ftn) + +# the following is used if cross-compiling +set(CMAKE_CROSSCOMPILING_EMULATOR "") + +# option to use pre-generated H5Tinit.c file +set(HDF5_USE_PREGEN OFF) +# directory where H5Tinit.c file will be found +#set(HDF5_USE_PREGEN_DIR "/lscratch1/lknox/HDF5_1_10_4/CMake-hdf5-1.10.4") + +# option to generate H5Tinit.c by running H5detect on knl compute node during build +set(HDF5_BATCH_H5DETECT ON) +set(HDF5_BATCH_CMD "sbatch") +set(HDF5_BATCH_H5DETECT_SCRIPT "knl_H5detect.sl") +set(MPIEXEC_EXECUTABLE "srun") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 311f8b4..a1bab5c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -943,13 +943,13 @@ if (NOT EXISTS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c) if (HDF5_BATCH_H5DETECT) configure_file ( - ${HDF5_SOURCE_DIR}/bin/batch/${HDF5_DETECT_BATCH_SCRIPT}.in - ${HDF5_BINARY_DIR}/${HDF5_DETECT_BATCH_SCRIPT} ESCAPE_QUOTES @ONLY + ${HDF5_SOURCE_DIR}/bin/batch/${HDF5_BATCH_H5DETECT_SCRIPT}.in.cmake + ${HDF5_BINARY_DIR}/${HDF5_BATCH_H5DETECT_SCRIPT} ESCAPE_QUOTES @ONLY ) add_custom_command ( OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c COMMAND ${HDF5_BATCH_CMD} - ARGS ${HDF5_BATCH_H5DETECT_SCRIPT} + ARGS ${HDF5_BINARY_DIR}/${HDF5_BATCH_H5DETECT_SCRIPT} DEPENDS H5detect WORKING_DIRECTORY ${HDF5_GENERATED_SOURCE_DIR} ) -- cgit v0.12