Skip to content

Commit

Permalink
adding build scripts for cpu and gpu
Browse files Browse the repository at this point in the history
  • Loading branch information
hydrogencl committed Jun 25, 2024
1 parent 126f039 commit 92437b6
Show file tree
Hide file tree
Showing 4 changed files with 142 additions and 0 deletions.
38 changes: 38 additions & 0 deletions config/build_cpu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

strFolderIn=$1
str_in=`uname -a`
if_found=.false.
for i in $str_in ; do
if [[ $i == *"juwels"* ]] ; then
printf "we are on juwels\n"
printf "`uname -a`\n"
printf "PWD: `pwd`\n"
printf "Loading Modules\n"
module load Intel ParaStationMPI netCDF GSL
printf "Compiling MPTRAC using modules on JUWELS ... \n "
cd ./src
make STATIC=0
make check
if_found=.true.

elif [[ $i == *"jureca"* ]] ; then
printf "we are on jureca\n"
printf "`uname -a`\n"
printf "PWD: `pwd`\n"
printf "Loading Modules\n"
module load Intel ParaStationMPI netCDF GSL
printf "Compiling MPTRAC using modules on JURECA ... \n "
cd ./src
make STATIC=0
make check
if_found=.true.
else
printf "None of the machine matches\n"
fi
done

if [[ ! $if_found ]]; then
printf "None of the system matches the configuration \n"
printf "please check that if your machine is registered on the buildbot master\n"
fi
33 changes: 33 additions & 0 deletions config/build_gpu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

# ==============================================================
# Here is the exmample of a build script for WRF.
# It should be noted that the configuration files are tested
# which are based on the the WRF configuration executor.
# ==============================================================

strHPC=`uname -a`
if_found=false
for strIn in $strHPC ; do
## Check which machine
if [[ $strIn == *"juwels"* ]] ; then
# Compiling
echo "Working on compiling the MPTRAC with GPU"
export LD_LIBRARY_PATH=$PWD/libs/build/lib:$LD_LIBRARY_PATH
ml NVHPC ParaStationMPI netCDF
cd src
make clean
make COMPILER=nvc GPU=1 STATIC=0 INFO=1 ZSTD=1 ZFP=1 DEFINES="-DNP=20000" || exit
echo "Done compiling the MPTRAC with GPU"
if_found=true
elif [[ $strIn == *"jureca"* ]] ; then
printf "JURECA is not supported.\n"
printf "Currently supporting JUWELS-BOOST only\n"
if_found=true
fi
done

if [[ ! $if_found ]]; then
printf "None of the system matches the configuration \n"
printf "please check that if your machine is registered on the buildbot master\n"
fi
33 changes: 33 additions & 0 deletions config/prebuild_gpu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

# ==============================================================
# Here is the exmample of a build script for WRF.
# It should be noted that the configuration files are tested
# which are based on the the WRF configuration executor.
# ==============================================================

strHPC=`uname -a`
if_found=false
for strIn in $strHPC ; do
## Check which machine
if [[ $strIn == *"juwels"* ]] ; then
printf "We are on JUWELS ... \n"
printf "compiling something.. \n "
### build script starts here ....
module load Intel ParaStationMPI netCDF GSL
cd ./libs
sh build.sh -ctsgf
make check
### build script ends here ....

if_found=.true.

elif [[ $strIn == *"jureca"* ]] ; then
printf "JURECA is not supported.\n"
fi
done

if [[ ! $if_found ]]; then
printf "None of the system matches the configuration \n"
printf "please check that if your machine is registered on the buildbot master\n"
fi
38 changes: 38 additions & 0 deletions config/test_gpu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

# ==============================================================
# Here is the exmample of a build script for WRF.
# It should be noted that the configuration files are tested
# which are based on the the WRF configuration executor.
# ==============================================================

strHPC=`uname -a`
if_found=false
for strIn in $strHPC ; do
## Check which machine
if [[ $strIn == *"juwels"* ]] ; then
echo "Working on JUWELS-BOOSTER"
ml purge
ml NVHPC ParaStationMPI netCDF
export LD_LIBRARY_PATH=$PWD/../libs/build/lib:$LD_LIBRARY_PATH
# Testing
cd src
echo "#! /bin/bash" > check.sh
echo "make gpu_test" >> check.sh
sbatch --wait --deadline=now+1hour --nodes=1 --ntasks=1 --ntasks-per-node=1 --cpus-per-task=48 --time=00:05:00 --account=slmet --partition=booster --gres=gpu:4 ./check.sh
[ $? -ne 0 ] && result="FAILED" || result="OK"
cat slurm*

# Another Inform
echo "job result: $result"
echo "job finished: $(date)"
if_found=true
elif [[ $strIn == *"jureca"* ]] ; then
printf "JURECA is not supported.\n"
fi
done

if [[ ! $if_found ]]; then
printf "None of the system matches the configuration \n"
printf "please check that if your machine is registered on the buildbot master\n"
fi

0 comments on commit 92437b6

Please sign in to comment.