From 32bf67b3809ab219095a243ce429296605a359d0 Mon Sep 17 00:00:00 2001 From: yuchengt900 Date: Thu, 7 Nov 2024 11:17:16 -0500 Subject: [PATCH] run build process using slurm --- .github/workflows/CEFI_MOM6-ci.yaml | 32 +++++++-------- builds/ci_build_driver.sh | 64 +++++------------------------ 2 files changed, 27 insertions(+), 69 deletions(-) diff --git a/.github/workflows/CEFI_MOM6-ci.yaml b/.github/workflows/CEFI_MOM6-ci.yaml index b71ef8774..f225b22a6 100644 --- a/.github/workflows/CEFI_MOM6-ci.yaml +++ b/.github/workflows/CEFI_MOM6-ci.yaml @@ -32,23 +32,23 @@ jobs: run: | cd ${{ env.TEST_DIR }}/CEFI_MOM6_CHECK/builds pwd - img=/gpfs/f6/ira-cefi/world-shared/container/ubuntu22.04-intel-ufs-env-v1.8.0-llvm.img - apptainer exec -B /gpfs -B /ncrc/home2/Yi-cheng.Teng:/ncrc/home2/Yi-cheng.Teng $img bash linux-build.bash -m docker -p linux-intel -t repro -f mom6sis2 - #jobid=$(sbatch --parsable ci_build_driver.sh | awk -F';' '{print $1}' | cut -f1) - ## - #sleep 1 - #while :; do - # job_status=$(squeue -h -j "$jobid" -o "%T" 2>/dev/null) - # if [ -z "$job_status" ]; then - # echo "Job with ID $jobid is not found or completed." - # break - else - # echo "Job with ID $jobid is still running." - # echo "Job Status: $job_status" - # fi - # sleep 60 # Adjust the sleep duration as needed - #done + #img=/gpfs/f6/ira-cefi/world-shared/container/ubuntu22.04-intel-ufs-env-v1.8.0-llvm.img + #apptainer exec -B /gpfs -B /ncrc/home2/Yi-cheng.Teng:/ncrc/home2/Yi-cheng.Teng $img bash linux-build.bash -m docker -p linux-intel -t repro -f mom6sis2 + jobid=$(sbatch --parsable ci_build_driver.sh | awk -F';' '{print $1}' | cut -f1) # + sleep 1 + while :; do + job_status=$(squeue -h -j "$jobid" -o "%T" 2>/dev/null) + if [ -z "$job_status" ]; then + echo "Job with ID $jobid is not found or completed." + break + else + echo "Job with ID $jobid is still running." + echo "Job Status: $job_status" + fi + sleep 60 # Adjust the sleep duration as needed + done + check_file="${{ env.TEST_DIR }}/CEFI_MOM6_CHECK/builds/build/docker-linux-intel/ocean_ice/repro/MOM6SIS2" if [ -f "$check_file" ]; then echo "PASSED: $check_file" diff --git a/builds/ci_build_driver.sh b/builds/ci_build_driver.sh index 5c61a25cb..4f1ea7d53 100755 --- a/builds/ci_build_driver.sh +++ b/builds/ci_build_driver.sh @@ -1,65 +1,23 @@ #!/bin/bash #SBATCH --nodes=1 -#SBATCH --time=60 -#SBATCH --job-name="MOM6SIS2_ci_build" -#SBATCH --output=MOM6SIS2_ci_build_o.%j -#SBATCH --error=MOM6SIS2_ci_build_e.%j -#SBATCH --qos=debug +#SBATCH --time=360 +#SBATCH --job-name="MOM6SIS2_container_build" +#SBATCH --output=MOM6SIS2_container_build_o.%j +#SBATCH --error=MOM6SIS2_container_build_e.%j +#SBATCH --qos=normal #SBATCH --partition=batch -#SBATCH --clusters=c5 -#SBATCH --account=cefi +#SBATCH --clusters=c6 +#SBATCH --account=ira-cefi # [ -d "build" ] && rm -rf build # -echo "Build MOM6SIS2-COBALT for CI testing started: " `date` +echo "Build MOM6SIS2-COBALT using container started: " `date` # -machine_name="gaea" -platform="ncrc5.intel23" -target="repro" -flavor="fms1_mom6sis2" - -FMSlib_PATH="/gpfs/f5/cefi/scratch/Yi-cheng.Teng/github/FMS/2024.02_FMS1" -rootdir=$(pwd) -abs_rootdir=$rootdir - -echo $abs_rootdir - -#load modules -source $MODULESHOME/init/bash -source $rootdir/$machine_name/$platform.env -. $rootdir/$machine_name/$platform.env - -makeflags="NETCDF=3" - -if [[ $target =~ "repro" ]] ; then - makeflags="$makeflags REPRO=1" -fi - -srcdir=$abs_rootdir/../src - -# -sed -i 's/static pid_t gettid(void)/pid_t gettid(void)/g' $srcdir/FMS/affinity/affinity.c - -# -if [[ $flavor == "fms1_mom6sis2" ]] ; then - echo "build mom6sis2 with FMS1 cap" - - mkdir -p build/$machine_name-$platform/ocean_ice/$target - pushd build/$machine_name-$platform/ocean_ice/$target - rm -f path_names - $srcdir/mkmf/bin/list_paths $srcdir/MOM6/{config_src/infra/FMS1,config_src/memory/dynamic_symmetric,config_src/drivers/FMS_cap,config_src/external/ODA_hooks,config_src/external/database_comms,config_src/external/drifters,config_src/external/stochastic_physics,pkg/GSW-Fortran/{modules,toolbox}/,src/{*,*/*}/} $srcdir/SIS2/{config_src/dynamic_symmetric,config_src/external/Icepack_interfaces,src} $srcdir/icebergs/src $srcdir/FMS/{coupler,include}/ $srcdir/{ocean_BGC/generic_tracers,ocean_BGC/mocsy/src}/ $srcdir/{atmos_null,ice_param,land_null,coupler/shared/,coupler/full/}/ - - compiler_options='-DINTERNAL_FILE_NML -DMAX_FIELDS_=600 -DNOT_SET_AFFINITY -Duse_deprecated_io -D_USE_MOM6_DIAG -D_USE_GENERIC_TRACER -DUSE_PRECISION=2 -D_USE_LEGACY_LAND_ -Duse_AM3_physics' - - $srcdir/mkmf/bin/mkmf -t $abs_rootdir/$machine_name/$platform.mk -o "-I${FMSlib_PATH}/shared/$target" -p MOM6SIS2 -l "-L${FMSlib_PATH}/shared/$target -lfms" -c "$compiler_options" path_names - - make $makeflags MOM6SIS2 - -fi - +export img=/gpfs/f6/ira-cefi/world-shared/container/ubuntu22.04-intel-ufs-env-v1.8.0-llvm.img +apptainer exec -B /gpfs -B /ncrc/home2/Yi-cheng.Teng:/ncrc/home2/Yi-cheng.Teng $img bash linux-build.bash -m docker -p linux-intel -t repro -f mom6sis2 # -echo "Build MOM6SIS2-COBALT for CI testing ended: " `date` +echo "Build MOM6SIS2-COBALT using container ended: " `date`