#!/bin/bash

# ICON
#
# ------------------------------------------
# Copyright (C) 2004-2026, DWD, MPI-M, DKRZ, KIT, ETH, MeteoSwiss
# Contact information: icon-model.org
# See AUTHORS.TXT for a list of authors
# See LICENSES/ for license information
# SPDX-License-Identifier: BSD-3-Clause
# ------------------------------------------

# abort on error
set -euo pipefail

cd $(dirname "${BASH_SOURCE[0]}")

addexp="./addexp"
#############################################################################
##
## create nightly list: This can be run to test if ICON runs at JSC
##
############################################################################

listname=${1:-nightly}
./rmlist $listname

## JSC:
#./create_all_builders $listname
machine=jsc
./addmachine $machine --list $listname
./addbuilder cluster_intel_ompi  --machine $machine  --build_script="config/buildbot/cluster_intel_ompi"  --builderflags="Inactive"   --list $listname
./addbuilder cluster_intel_psmpi --machine $machine  --build_script="config/buildbot/cluster_intel_psmpi" --builderflags="Active"     --list $listname
./addbuilder cluster_nvhpc_psmpi --machine $machine  --build_script="config/buildbot/cluster_nvhpc_psmpi" --builderflags="Active"     --list $listname
./addbuilder booster_nvhpc_ompi  --machine $machine  --build_script="config/buildbot/booster_nvhpc_ompi"  --builderflags="build_only" --list $listname
./addbuilder booster_nvhpc_psmpi --machine $machine  --build_script="config/buildbot/booster_nvhpc_psmpi" --builderflags="Active"     --list $listname

# add bench experiments
./addexp "checksuite.atm/exp.NextGEMS_R2B4_jsc.run"     --builders "booster_nvhpc_psmpi" --list $listname
./addexp "checksuite.atm/exp.NextGEMS_R2B4_jsc_cpu.run" --builders "cluster_nvhpc_psmpi" --list $listname
./addexp "exp.aes_bubble_land_test"                     --builders "cluster_intel_psmpi" --list $listname


#lets see the list
./lslist $listname
#-----------------------------------------------------------
