Skip to content
Snippets Groups Projects
Select Git revision
  • c937d9be09a7c0ff7266005074b0a63f28c80d57
  • master default protected
  • enxhi_issue460_remove_TOAR-I_access
  • michael_issue459_preprocess_german_stations
  • sh_pollutants
  • develop protected
  • release_v2.4.0
  • michael_issue450_feat_load-ifs-data
  • lukas_issue457_feat_set-config-paths-as-parameter
  • lukas_issue454_feat_use-toar-statistics-api-v2
  • lukas_issue453_refac_advanced-retry-strategy
  • lukas_issue452_bug_update-proj-version
  • lukas_issue449_refac_load-era5-data-from-toar-db
  • lukas_issue451_feat_robust-apriori-estimate-for-short-timeseries
  • lukas_issue448_feat_load-model-from-path
  • lukas_issue447_feat_store-and-load-local-clim-apriori-data
  • lukas_issue445_feat_data-insight-plot-monthly-distribution
  • lukas_issue442_feat_bias-free-evaluation
  • lukas_issue444_feat_choose-interp-method-cams
  • 414-include-crps-analysis-and-other-ens-verif-methods-or-plots
  • lukas_issue384_feat_aqw-data-handler
  • v2.4.0 protected
  • v2.3.0 protected
  • v2.2.0 protected
  • v2.1.0 protected
  • Kleinert_etal_2022_initial_submission
  • v2.0.0 protected
  • v1.5.0 protected
  • v1.4.0 protected
  • v1.3.0 protected
  • v1.2.1 protected
  • v1.2.0 protected
  • v1.1.0 protected
  • IntelliO3-ts-v1.0_R1-submit
  • v1.0.0 protected
  • v0.12.2 protected
  • v0.12.1 protected
  • v0.12.0 protected
  • v0.11.0 protected
  • v0.10.0 protected
  • IntelliO3-ts-v1.0_initial-submit
41 results

run_zam347.py

Blame
  • create_runscripts_HPC.sh 2.32 KiB
    #!/bin/csh -x
    
    echo "############################################################"
    echo "#                                                          #"
    echo "#            user interaction required                     #"
    echo "#                                                          #"
    echo "############################################################"
    echo 
    
    echo "This script creates the HPC batch scripts to run mlt on compute nodes (gpus and develgpus)."
    echo "You can modify the created run scripts afterwards if needed."
    
    while true; do
        read -p "Do you wish to create run scripts for JUWELS? [yes/no]" yn
        case $yn in
            [Yy]* ) juwels=True; break;;
            [Nn]* ) juwels=False;;
            * ) echo "Please answer yes or no.";;
       esac
    done
    
    while true; do
        read -p "Do you wish to create run script for HDFML? [yes/no]" yn
        case $yn in
            [Yy]* ) hdfml=True; break;;
            [Nn]* ) hdfml=False;;
            * ) echo "Please answer yes or no.";;
       esac
    done
    
    
    budget=''
    while [[ $budget == '' ]]
    do
     echo
     read -p "Enter project budget for --account flag: " budget 
    done
    
    email=`jutil user show -o json | grep email | cut -f2 -d':' | cut -f1 -d',' | cut -f2 -d'"'`
    echo
    read -p "Enter e-mail address for --mail-user (default: ${email}): " new_email
    
    if [[ -z "$new_email" ]]; then
        new_email=$email
    fi
    
    # create HPC_logging dir
    hpclogging="../HPC_logging/"
    mkdir -p $hpclogging
    
    
    # ordering for looping:
    # "partition nGPUs timing"
    if [[ $juwels == True ]]; then
      for i in "develgpus 2  02:00:00" "gpus 4 08:00:00"; do
          set -- $i
    
    cat <<EOT > run_$1.bash
    #!/bin/bash -x
    #SBATCH --account=${budget}
    #SBATCH --nodes=1
    #SBATCH --output=${hpclogging}mlt-out.%j
    #SBATCH --error=${hpclogging}/mlt-err.%j
    #SBATCH --time=$3 
    #SBATCH --partition=$1 
    #SBATCH --gres=gpu:$2
    #SBATCH --mail-type=ALL
    #SBATCH --mail-user=${email}
    
    source mlt_modules_.sh
    source venv/bin/activate
    
    timestamp=\`date +"%Y-%m-%d_%H%M-%S"\`
    
    export PYTHONPATH=\${PWD}/venv/lib/python3.6/site-packages:\${PYTHONPATH}
    
    srun python run.py --experiment_date=\$timestamp
    EOT
    
      echo "Created runscript: run_$1.bash"
    
      done
    fi
    
    echo
    echo "You have to run the the following command on a login node to download data:"
    echo "          \`python run.py'"
    echo
    echo "Please execute the following command to check if the setup went well:"
    echo "          \`sbatch run_develgpus.bash'"