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

patch on HWs pr #3

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
38 changes: 20 additions & 18 deletions sorc/build_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@
Build UFS-DA
-v:
Execute all build scripts with -v option to turn on verbose where supported
-w:
Use unstructured wave grid
-w:
Use unstructured wave grid
EOF
exit 1
}

script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)
cd "${script_dir}" || exit 1
# shellcheck disable=SC2155
readonly HOMEgfs=$(cd "$(dirname "$(readlink -f -n "${BASH_SOURCE[0]}" )" )/.." && pwd -P)
cd "${HOMEgfs}/sorc" || exit 1

BUILD_TYPE="Release" # This is the default for all applications.
_build_ufs_opt=""
_build_ufsda="NO"
_build_gsi="NO"
Expand All @@ -54,8 +54,6 @@
case "${option}" in
a) _build_ufs_opt+="-a ${OPTARG} ";;
d) _build_debug="-d" ;;
# export BUILD_TYPE="Debug"
# ;;
g) _build_gsi="YES" ;;
h) _usage;;
j) _build_job_max="${OPTARG} ";;
Expand All @@ -75,24 +73,24 @@

shift $((OPTIND-1))

logs_dir="${script_dir}/logs"
logs_dir="${HOMEgfs}/sorc/logs"
if [[ ! -d "${logs_dir}" ]]; then
echo "Creating logs folder"
mkdir "${logs_dir}" || exit 1
mkdir -p "${logs_dir}" || exit 1
fi

# Check final exec folder exists
if [[ ! -d "../exec" ]]; then
echo "Creating ../exec folder"
mkdir ../exec
if [[ ! -d "${HOMEgfs}/exec" ]]; then
echo "Creating ${HOMEgfs}/exec folder"
mkdir -p "${HOMEgfs}/exec"
fi

#------------------------------------
# GET MACHINE
#------------------------------------
export COMPILER="intel"
source gfs_utils.fd/ush/detect_machine.sh
source gfs_utils.fd/ush/module-setup.sh
source ${HOMEgfs}/ush/detect_machine.sh
Fixed Show fixed Hide fixed
source ${HOMEgfs}/ush/module-setup.sh
Fixed Show fixed Hide fixed
if [[ -z "${MACHINE_ID}" ]]; then
echo "FATAL: Unable to determine target machine"
exit 1
Expand Down Expand Up @@ -203,12 +201,16 @@
if [[ -n "${build_jobs[${build}]+0}" && -z "${build_ids[${build}]+0}" ]]; then
# Do we have enough processors to run it?
if [[ ${_build_job_max} -ge $(( build_jobs[build] + procs_in_use )) ]]; then
if [[ "${build}" != "upp" ]]; then
"./build_${build}.sh" -j "${build_jobs[${build}]}" "${build_opts[${build}]:-}" > \
"${logs_dir}/build_${build}.log" 2>&1 &
else
if [[ "${build}" == "upp" ]]; then
set -x
"./build_${build}.sh" "${build_opts[${build}]}" > \
"${logs_dir}/build_${build}.log" 2>&1 &
set +x
else # upp
set -x
"./build_${build}.sh" ${build_opts[${build}]:-} -j "${build_jobs[${build}]}" > \
Fixed Show fixed Hide fixed
"${logs_dir}/build_${build}.log" 2>&1 &
set +x
fi
build_ids["${build}"]=$!
echo "Starting build_${build}.sh"
Expand Down
13 changes: 5 additions & 8 deletions sorc/build_gdas.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
set -eux

OPTIND=1
_opts="-f " # forces a clean build
while getopts ":j:dv" option; do
case "${option}" in
d) export BUILD_TYPE="Debug";;
j) export BUILD_JOBS=${OPTARG};;
v) export BUILD_VERBOSE="YES";;
d) _opts+="-c -DCMAKE_BUILD_TYPE=Debug" ;;
j) BUILD_JOBS=${OPTARG};;
v) _opts+="-v ";;
:)
echo "[${BASH_SOURCE[0]}]: ${option} requires an argument"
usage
Expand All @@ -19,12 +20,8 @@
done
shift $((OPTIND-1))

# TODO: GDASApp does not presently handle BUILD_TYPE

BUILD_TYPE=${BUILD_TYPE:-"Release"} \
BUILD_VERBOSE=${BUILD_VERBOSE:-"NO"} \
BUILD_JOBS="${BUILD_JOBS:-8}" \
WORKFLOW_BUILD="ON" \
./gdas.cd/build.sh
./gdas.cd/build.sh ${_opts}
Fixed Show fixed Hide fixed

exit
10 changes: 4 additions & 6 deletions sorc/build_gfs_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@ EOF
exit 1
}

cwd=$(pwd)

OPTIND=1
while getopts ":j:dvh" option; do
case "${option}" in
d) export BUILD_TYPE="Debug";;
v) export BUILD_VERBOSE="YES";;
j) export BUILD_JOBS="${OPTARG}";;
d) BUILD_TYPE="Debug";;
v) BUILD_VERBOSE="YES";;
j) BUILD_JOBS="${OPTARG}";;
h)
usage
;;
Expand All @@ -44,6 +42,6 @@ shift $((OPTIND-1))
BUILD_TYPE=${BUILD_TYPE:-"Release"} \
BUILD_VERBOSE=${BUILD_VERBOSE:-"NO"} \
BUILD_JOBS=${BUILD_JOBS:-8} \
"${cwd}/gfs_utils.fd/ush/build.sh"
"./gfs_utils.fd/ush/build.sh"

exit
6 changes: 3 additions & 3 deletions sorc/build_gsi_enkf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ set -eux
OPTIND=1
while getopts ":j:dv" option; do
case "${option}" in
d) export BUILD_TYPE="Debug";;
j) export BUILD_JOBS="${OPTARG}";;
v) export BUILD_VERBOSE="YES";;
d) BUILD_TYPE="Debug";;
j) BUILD_JOBS="${OPTARG}";;
v) BUILD_VERBOSE="YES";;
:)
echo "[${BASH_SOURCE[0]}]: ${option} requires an argument"
usage
Expand Down
10 changes: 4 additions & 6 deletions sorc/build_gsi_monitor.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
#! /usr/bin/env bash
set -eux

cwd=$(pwd)

OPTIND=1
while getopts ":j:dv" option; do
case "${option}" in
d) export BUILD_TYPE="Debug";;
j) export BUILD_JOBS="${OPTARG}";;
v) export BUILD_VERBOSE="YES";;
d) BUILD_TYPE="Debug";;
j) BUILD_JOBS="${OPTARG}";;
v) BUILD_VERBOSE="YES";;
:)
echo "[${BASH_SOURCE[0]}]: ${option} requires an argument"
usage
Expand All @@ -24,6 +22,6 @@ shift $((OPTIND-1))
BUILD_TYPE=${BUILD_TYPE:-"Release"} \
BUILD_VERBOSE=${BUILD_VERBOSE:-"NO"} \
BUILD_JOBS=${BUILD_JOBS:-8} \
"${cwd}/gsi_monitor.fd/ush/build.sh"
"./gsi_monitor.fd/ush/build.sh"

exit
10 changes: 4 additions & 6 deletions sorc/build_gsi_utils.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
#! /usr/bin/env bash
set -eux

cwd=$(pwd)

OPTIND=1
while getopts ":j:dv" option; do
case "${option}" in
d) export BUILD_TYPE="Debug";;
j) export BUILD_JOBS="${OPTARG}";;
v) export BUILD_VERBOSE="YES";;
d) BUILD_TYPE="Debug";;
j) BUILD_JOBS="${OPTARG}";;
v) BUILD_VERBOSE="YES";;
:)
echo "[${BASH_SOURCE[0]}]: ${option} requires an argument"
usage
Expand All @@ -25,6 +23,6 @@ BUILD_TYPE=${BUILD_TYPE:-"Release"} \
BUILD_VERBOSE=${BUILD_VERBOSE:-"NO"} \
BUILD_JOBS=${BUILD_JOBS:-8} \
UTIL_OPTS="-DBUILD_UTIL_ENKF_GFS=ON -DBUILD_UTIL_NCIO=ON" \
"${cwd}/gsi_utils.fd/ush/build.sh"
"./gsi_utils.fd/ush/build.sh"

exit
12 changes: 5 additions & 7 deletions sorc/build_ufs_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ set -eux
OPTIND=1
while getopts ":j:dv" option; do
case "${option}" in
d) export BUILD_TYPE="Debug" ;;
j) export BUILD_JOBS="${OPTARG}";;
v) export BUILD_VERBOSE="YES";;
d) BUILD_TYPE="Debug" ;;
j) BUILD_JOBS="${OPTARG}";;
v) BUILD_VERBOSE="YES";;
:)
echo "[${BASH_SOURCE[0]}]: ${option} requires an argument"
usage
Expand All @@ -19,13 +19,11 @@ while getopts ":j:dv" option; do
done
shift $((OPTIND-1))

script_dir=$(dirname "${BASH_SOURCE[0]}")
cd "${script_dir}/ufs_utils.fd" || exit 1

CMAKE_OPTS="-DGFS=ON" \
BUILD_TYPE=${BUILD_TYPE:-"Release"} \
BUILD_JOBS=${BUILD_JOBS:-8} \
BUILD_VERBOSE=${BUILD_VERBOSE:-} \
./build_all.sh
./ufs_utils.fd/build_all.sh

exit

25 changes: 12 additions & 13 deletions sorc/build_upp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,23 @@ cd "${script_dir}" || exit 1
OPTIND=1
_opts=""
while getopts ":dj:v" option; do
case "${option}" in
d) _opts+="-d "
export BUILD_TYPE="Debug" ;;
j) export BUILD_JOBS="${OPTARG}" ;;
v) _opts+="-v ";;
:)
echo "[${BASH_SOURCE[0]}]: ${option} requires an argument"
;;
*)
echo "[${BASH_SOURCE[0]}]: Unrecognized option: ${option}"
;;
esac
case "${option}" in
d) _opts+="-d " ;;
j) BUILD_JOBS="${OPTARG}" ;;
v) _opts+="-v ";;
:)
echo "[${BASH_SOURCE[0]}]: ${option} requires an argument"
;;
*)
echo "[${BASH_SOURCE[0]}]: Unrecognized option: ${option}"
;;
esac
done
shift $((OPTIND-1))

# Check final exec folder exists
if [[ ! -d "../exec" ]]; then
mkdir ../exec
mkdir -p ../exec
fi

cd ufs_model.fd/FV3/upp/tests
Expand Down
16 changes: 8 additions & 8 deletions sorc/build_ww3prepost.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cd "${script_dir}" || exit 1

# Default settings
APP="S2SWA"
PDLIB="OFF"
PDLIB="OFF"

while getopts ":j:a:dvw" option; do
case "${option}" in
Expand All @@ -27,15 +27,15 @@ while getopts ":j:a:dvw" option; do
done

# Determine which switch to use
if [[ "${APP}" == "ATMW" ]]; then
if [[ "${APP}" == "ATMW" ]]; then
ww3switch="model/esmf/switch"
else
if [[ "${PDLIB}" == "ON" ]]; then
else
if [[ "${PDLIB}" == "ON" ]]; then
ww3switch="model/bin/switch_meshcap_pdlib"
else
else
ww3switch="model/bin/switch_meshcap"
fi
fi
fi
fi

# Check final exec folder exists
if [[ ! -d "../exec" ]]; then
Expand Down Expand Up @@ -86,7 +86,7 @@ sed -e "s/DIST/SHRD/g"\
"${path_build}/tempswitch" > "${path_build}/switch"
rm "${path_build}/tempswitch"

echo "Switch file is ${buildswitch} with switches:"
echo "Switch file is ${buildswitch} with switches:"
cat "${buildswitch}"

#define cmake build options
Expand Down
4 changes: 2 additions & 2 deletions ush/module-setup.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
set -u

source "${HOMEgfs}/ush/detect_machine.sh"
source "${HOMEgfs}/ush/detect_machine.sh"

if [[ ${MACHINE_ID} = jet* ]] ; then
# We are on NOAA Jet
Expand Down Expand Up @@ -125,7 +125,7 @@ elif [[ ${MACHINE_ID} = "noaacloud" ]]; then
export SPACK_ROOT=/contrib/global-workflow/spack-stack/spack
export PATH=${PATH}:${SPACK_ROOT}/bin
. "${SPACK_ROOT}"/share/spack/setup-env.sh

else
echo WARNING: UNKNOWN PLATFORM 1>&2
fi
Expand Down
Loading