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

Quickbuild tests #593

Merged
merged 29 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
2c5622e
Adding quickbuild_tests to developer_tests
ann-norcio Nov 8, 2023
4371d60
Resolution to Issue #336 - updated nc_check
c-merchant Dec 2, 2023
c8b8d49
Merge branch 'main' into nc_check_subroutine
hkershaw-brown Dec 4, 2023
8cce38e
Removed nc_check from utilities_mod.f90
c-merchant Dec 6, 2023
e3eb511
Modify all_quickbuilds.sh
ann-norcio Dec 6, 2023
601291c
fix output of number of obs converted, and make input.nml defaults be…
nancycollins Dec 7, 2023
389e434
Merge branch 'main' into quickbuild_tests
hkershaw-brown Dec 8, 2023
89fc244
make script executable
hkershaw-brown Dec 8, 2023
58217a7
remove multiple compilers from single script
hkershaw-brown Dec 8, 2023
4a985d3
chore: file shuffling, Ann's all_quickdbuild.sh replace run_all_quick…
hkershaw-brown Dec 8, 2023
ef9209a
submittion script for Derecho
hkershaw-brown Dec 8, 2023
86849ca
renamed FC to compiler since FC is an enviroment variable
hkershaw-brown Dec 8, 2023
1e23a24
actually running quickbuild.sh
hkershaw-brown Dec 8, 2023
f6148ac
submit all jobs for all compilers
hkershaw-brown Dec 8, 2023
5f47089
obs converters, do not use mpif08 option
hkershaw-brown Dec 8, 2023
3cc10f5
skip template model since this is not supposed to compile
hkershaw-brown Dec 8, 2023
abef575
cce takes 12 minutes
hkershaw-brown Dec 8, 2023
0921b58
readme: how to look for failures in results
hkershaw-brown Dec 11, 2023
4d92949
update usage and simpler message print
hkershaw-brown Dec 11, 2023
73457ac
eqv for logicals comparison
hkershaw-brown Dec 11, 2023
42b33e6
add option to build a different branch
hkershaw-brown Dec 11, 2023
2851c07
add branch_name to README usage
hkershaw-brown Dec 11, 2023
a1e063c
Removing the statement to use nc_check from netcdf_utilities_mod in t…
mjs2369 Dec 11, 2023
a20971a
added ifx as an option
hkershaw-brown Dec 11, 2023
c95a630
speed test, using /tmp vs filesystem
hkershaw-brown Dec 12, 2023
707fe9a
Merge pull request #587 from c-merchant/nc_check_subroutine
hkershaw-brown Dec 13, 2023
6774b60
Merge pull request #597 from NCAR/airs_fix
hkershaw-brown Dec 13, 2023
99c6e58
Merge pull request #600 from NCAR/mom6-eqv-test
hkershaw-brown Dec 13, 2023
54a374d
CHANGELOG and bump version for release
hkershaw-brown Dec 13, 2023
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
7 changes: 4 additions & 3 deletions developer_tests/build_everything/README
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Run all quickbuilds.sh in the DART Repo at once

Run with a fresh checkout of DART
Edit mkmf.template.compile_all to match the compiler you want to run with
Recommend running on Cheyenne with submit_me.sh as run_all_quickbuilds.sh uses a lot of threads
Usage: ./submit_jobs.sh

hkershaw-brown marked this conversation as resolved.
Show resolved Hide resolved
Find failed builds in logfile, e.g.:
grep -a FAILED build-everything-nvhpc.o2633030
65 changes: 0 additions & 65 deletions developer_tests/build_everything/all_quickbuilds

This file was deleted.

158 changes: 0 additions & 158 deletions developer_tests/build_everything/mkmf.template.compile_all

This file was deleted.

125 changes: 87 additions & 38 deletions developer_tests/build_everything/run_all_quickbuilds.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,77 +4,126 @@
# by UCAR, "as is", without charge, subject to all terms of use at
# http://www.image.ucar.edu/DAReS/DART/DART_download

# options to set
# 1. DART directory
# 2. compiler

export DART=$(git rev-parse --show-toplevel)
FC=intel
# Usage: run_all_quickbuilds.sh compiler [gcc intel nvhpc cce]

if [ $# -eq 0 ]; then
echo "ERROR: expecting at least one argument"
exit 1
fi

if [[ ! -d $DART ]] ; then
echo "No DART directory: " $DART
exit 1
fi
compiler=$1
branch=${2:-main} # checkout branch if given, or use main

if [[ -z $PBS_ENVIRONMENT ]]; then
echo "ERROR: Run this in a batch job"
# Check if the script is running in a batch job or interactive session
if [[ -z $PBS_ENVIRONMENT ]]; then
echo "ERROR: You must run this in a batch job"
echo " qsub submit_me.sh"
echo " or an interactive session"
exit 2
fi

cp mkmf.template.compile_all $DART/build_templates/mkmf.template
cd $DART
# Specify the mkmf template for each compiler
if [[ $compiler == "intel" ]]; then
mkmf_template="mkmf.template.intel.linux"
elif [[ $compiler == "gcc" ]]; then
mkmf_template="mkmf.template.gfortran"
elif [[ $compiler == "cce" ]]; then
mkmf_template="mkmf.template.cce"
elif [[ $compiler == "nvhpc" ]]; then
mkmf_template="mkmf.template.nvhpc"
else
echo "$compiler is not a valid argument"
exit 3
fi


# run fixsystem
# running this once at the beginning otherwise all make commands will
# try and alter the mpi_*_utilities_mod.f90 simultaneously
cd assimilation_code/modules/utilities; ./fixsystem $FC
cd -
test_dir="/glade/derecho/scratch/$USER/build_everything/$compiler"
if [[ -d $test_dir ]]; then
echo "Directory exists: $test_dir"
exit 4
fi

mkdir -p $test_dir
cd $test_dir
git clone 'https://github.com/NCAR/DART.git'
cd DART
export DART=$(git rev-parse --show-toplevel)
git checkout $branch
if [[ $? -ne 0 ]]; then
echo "unknown branch"
exit 5
fi

# mkmf for chosen compiler
module load $compiler
cp build_templates/$mkmf_template build_templates/mkmf.template

# Run fixsystem to avoid all make commands from altering mpi_*_utilities_mod.f90 simultaneously
cd assimilation_code/modules/utilities; ./fixsystem $compiler
hkershaw-brown marked this conversation as resolved.
Show resolved Hide resolved
cd -

# build preprocess once
# Build preprocess once
pp_dir=$DART/assimilation_code/programs/preprocess
cd $pp_dir
$DART/build_templates/mkmf -x -p $pp_dir/preprocess \
-a $DART $pp_dir/path_names_preprocess
cd -

# local versions of obs_def_mod.f90 and obs_kind_mod.f90
find . -name input.nml -exec sed -i -e "/^[[:space:]]*#/! s|.*output_obs_def_mod_file.*|output_obs_def_mod_file = './obs_def_mod.f90'|g" \
# Modify input.nml files to use local versions of obs_def_mod.f90 and obs_kind_mod.f90
find . -name input.nml -exec sed -i -e "/^[[:space:]]*#/! s|.*output_obs_def_mod_file.*|output_obs_def_mod_file = './obs_def_mod.f90'|g" \
-e "/^[[:space:]]*#/! s|.*output_obs_qty_mod_file.*|output_obs_qty_mod_file = './obs_kind_mod.f90'|g" \
-e "/^[[:space:]]*#/! s|.*output_obs_kind_mod_file.*|output_obs_qty_mod_file = './obs_kind_mod.f90'|g" {} \;
-e "/^[[:space:]]*#/! s|.*output_obs_kind_mod_file.*|output_obs_qty_mod_file = './obs_kind_mod.f90'|g" {} \;

# Store the current directory and initialize arrays to hold process IDs, directories, and status codes
my_dir=$(pwd)
pids=()
dirs=()
status=()

while read f; do
# Find all quickbuild.sh executable files and remove './' and 'quickbuild.sh'
files_to_process=( $(find $DART -executable -type f -name quickbuild.sh | sed -E 's#(\./|quickbuild\.sh)##g') )

# Iterate over each file to and run quickbuild.sh
for f in "${files_to_process[@]}"; do

cd $f; ./quickbuild.sh &
pids+=( "$!" )
dirs+=( "$f" )
cd $my_dir
if [[ $f == *"template"* ]]; then
continue # template model not for compiling
fi

if [[ $compiler == "gcc" ]]; then
case "$f" in
*obs_converters* ) cd $f; ./quickbuild.sh & ;;
* ) cd $f; ./quickbuild.sh mpif08 & ;;
esac
else
cd $f; ./quickbuild.sh &
fi

done < $DART/developer_tests/build_everything/all_quickbuilds
# Record the PID and directory of the each process then cd back to starting directory
pids+=( "$!" )
dirs+=( "$f" )
cd $my_dir
done

# Wait for all background processes to finish and record their exit statuses
for pid in ${pids[@]}; do
#echo "${pid}"
wait ${pid}
status+=( "$?" )
done

# looping through the status arr to check exit code for each
# Check the status of each build process and log results
i=0
for st in ${status[@]}; do
if [[ ${st} -ne 0 ]]; then
echo "RESULT: $i ${dirs[$i]} failed"
OVERALL_EXIT=1
else
echo "RESULT: $i ${dirs[$i]} finished"
fi
((i+=1))
# Display failed vs. passed processes
if [[ ${st} -ne 0 ]]; then
echo "$compiler RESULT: $i ${dirs[$i]} FAILED"
else
echo "$compiler RESULT: $i ${dirs[$i]} PASSED"
fi
((i+=1))
done

module -t list
echo "branch : " $(git branch --show-current)

mv $test_dir $test_dir.$(date +"%FT%H%M")
Loading