From 1058576e95d2c301068aaad857166cca391eeec5 Mon Sep 17 00:00:00 2001 From: Paul Fleming Date: Tue, 26 Nov 2024 08:13:09 -0700 Subject: [PATCH] Update kestrel run scripts --- .../01_amr_wind_only/sbatch_script.sh | 14 ++--- .../kestrel_run_script.sh | 53 +++++++++++++++++++ 2 files changed, 60 insertions(+), 7 deletions(-) create mode 100644 example_case_folders/05_floris_standin_and_electrolyzer/kestrel_run_script.sh diff --git a/example_case_folders/01_amr_wind_only/sbatch_script.sh b/example_case_folders/01_amr_wind_only/sbatch_script.sh index 77be7e4a..e430d0b2 100755 --- a/example_case_folders/01_amr_wind_only/sbatch_script.sh +++ b/example_case_folders/01_amr_wind_only/sbatch_script.sh @@ -7,15 +7,15 @@ # #SBATCH --qos=high # Uncomment for higher prioirty # A lot of modules and conda stuff -source /nopt/nrel/apps/anaconda/5.3/etc/profile.d/conda.sh -module use /not/nrel/apps/modules/default/modulefiles +# source /nopt/nrel/apps/anaconda/5.3/etc/profile.d/conda.sh +# module use /not/nrel/apps/modules/default/modulefiles module purge module load conda -export PREFIX=~/.conda-envs/hercules -export PATH=$PREFIX/bin:$PATH -export FI_PROVIDER_PATH=$PREFIX/lib/libfabric/prov -export LD_LIBRARY_PATH=$PREFIX/lib/libfabric:$PREFIX/lib/release_mt:$LD_LIBRARY_PATH -source activate hercules +# export PREFIX=~/.conda-envs/hercules +# export PATH=$PREFIX/bin:$PATH +# export FI_PROVIDER_PATH=$PREFIX/lib/libfabric/prov +# export LD_LIBRARY_PATH=$PREFIX/lib/libfabric:$PREFIX/lib/release_mt:$LD_LIBRARY_PATH +conda activate hercules module load helics/3.4.0-gcc10.1.0-open-mpi module load netcdf-c/4.9.2-openmpi-gcc diff --git a/example_case_folders/05_floris_standin_and_electrolyzer/kestrel_run_script.sh b/example_case_folders/05_floris_standin_and_electrolyzer/kestrel_run_script.sh new file mode 100644 index 00000000..0c306cbd --- /dev/null +++ b/example_case_folders/05_floris_standin_and_electrolyzer/kestrel_run_script.sh @@ -0,0 +1,53 @@ +#!/bin/bash +#SBATCH --job-name=hercules +#SBATCH --time=1:00:00 +#SBATCH --nodes=1 +#SBATCH --account=ssc +# #SBATCH --qos=high # Uncomment for higher prioirty + +# Kill any active helics jobs +source ../find_and_kill_helics + +# Source the Conda initialization script +module purge +module load conda +conda activate hercules + + # Versions: + # helics/3.1.0-cray-mpich-intel + # helics/3.4.0-cray-mpich-intel + # helics/3.4.0-gcc10.1.0-open-mpi + +# Set up helics and netcdf +module load helics/3.4.0-cray-mpich-intel +# module load netcdf-c/4.9.2-openmpi-gcc + +# Clean up existing outputs +if [ -d outputs ]; then rm -r outputs; fi +mkdir -p outputs + +# Generate floris standin data +python ../../hercules/tools/generate_amr_standin_data.py floris_standin_data.csv + +# Set the helics port to use: +export HELICS_PORT=32000 + +helics_broker -t zmq -f 2 --loglevel="debug" --local_port=$HELICS_PORT & +python hercules_runscript_CLcontrol.py hercules_input_000.yaml >> outputs/loghercules_cl 2>&1 & +python floris_runscript.py amr_input.inp floris_standin_data.csv >> outputs/logfloris_cl 2>&1 + +# Clean up helics output if there +# Search for a file that begins with the current year +# And ends with csv +# If the file exists, move to outputs folder +current_year=$(date +"%Y") +for file in ${current_year}*.csv; do + if [ -f "$file" ]; then + mv "$file" outputs/ + fi +done + +# If everything is successful +echo "Finished running hercules" +exit 0 +