Skip to content

Commit

Permalink
run build process using slurm
Browse files Browse the repository at this point in the history
  • Loading branch information
yichengt900 committed Nov 7, 2024
1 parent fd78891 commit 32bf67b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 69 deletions.
32 changes: 16 additions & 16 deletions .github/workflows/CEFI_MOM6-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
64 changes: 11 additions & 53 deletions builds/ci_build_driver.sh
Original file line number Diff line number Diff line change
@@ -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`

0 comments on commit 32bf67b

Please sign in to comment.