|
| 1 | +#! /usr/bin/env bash |
| 2 | +set -eu |
| 3 | + |
| 4 | +# TITAN WORKFLOW |
| 5 | +# Main entry point for P1B3 mlrMBO workflow |
| 6 | + |
| 7 | +# Autodetect this workflow directory |
| 8 | +export EMEWS_PROJECT_ROOT=$( cd $( dirname $0 )/.. ; /bin/pwd ) |
| 9 | + |
| 10 | +# USER SETTINGS START |
| 11 | + |
| 12 | +# See README.md for more information |
| 13 | + |
| 14 | +# The directory in the Benchmarks repo containing P1B3 |
| 15 | +P1B3_DIR=$( cd $EMEWS_PROJECT_ROOT/../../../Benchmarks/Pilot1/P1B3 ; /bin/pwd ) |
| 16 | + |
| 17 | +echo $P1B3_DIR ; ls $P1B3_DIR |
| 18 | + |
| 19 | +# The number of MPI processes |
| 20 | +# Note that 2 processes are reserved for Swift/EMEMS |
| 21 | +# The default of 4 gives you 2 workers, i.e., 2 concurrent Keras runs |
| 22 | +export PROCS=${PROCS:-4} |
| 23 | + |
| 24 | +# MPI processes per node |
| 25 | +export PPN=${PPN:-4} |
| 26 | + |
| 27 | +export QUEUE=${QUEUE:-debug} |
| 28 | +export WALLTIME=${WALLTIME:-00:02:00} |
| 29 | + |
| 30 | +# mlrMBO settings |
| 31 | +# How many to runs evaluate per iteration |
| 32 | +MAX_CONCURRENT_EVALUATIONS=${MAX_CONCURRENT_EVALUATIONS:-2} |
| 33 | +# Total iterations |
| 34 | +MAX_ITERATIONS=${MAX_ITERATIONS:-3} |
| 35 | +PARAM_SET_FILE=${PARAM_SET_FILE:-$EMEWS_PROJECT_ROOT/data/parameter_set.R} |
| 36 | +# pbalabra: |
| 37 | +# PARAM_SET_FILE="$EMEWS_PROJECT_ROOT/data/parameter_set1.R" |
| 38 | + |
| 39 | +# USER SETTINGS END |
| 40 | + |
| 41 | +# Source some utility functions used by EMEWS in this script |
| 42 | +source "${EMEWS_PROJECT_ROOT}/etc/emews_utils.sh" |
| 43 | + |
| 44 | +if [ "$#" -ne 1 ]; then |
| 45 | + script_name=$(basename $0) |
| 46 | + echo "Usage: ${script_name} EXPERIMENT_ID (e.g. ${script_name} experiment_1)" |
| 47 | + exit 1 |
| 48 | +fi |
| 49 | + |
| 50 | +# Uncomment to turn on Swift/T logging. Can also set TURBINE_LOG, |
| 51 | +# TURBINE_DEBUG, and ADLB_DEBUG to 0 to turn off logging |
| 52 | +#export TURBINE_LOG=1 TURBINE_DEBUG=1 ADLB_DEBUG=1 |
| 53 | + |
| 54 | +export EXPID=$1 |
| 55 | +export TURBINE_OUTPUT=$HOME/FS/experiments/$EXPID |
| 56 | +check_directory_exists |
| 57 | + |
| 58 | +export TURBINE_JOBNAME="${EXPID}_job" |
| 59 | + |
| 60 | +# if R cannot be found, then these will need to be |
| 61 | +# uncommented and set correctly. |
| 62 | +# export R_HOME=/path/to/R |
| 63 | +# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$R_HOME/lib |
| 64 | +# export PYTHONHOME= |
| 65 | + |
| 66 | +#P1B3_DIR=$EMEWS_PROJECT_ROOT/../../../Benchmarks/Pilot1/P1B3 |
| 67 | + |
| 68 | +export LD_LIBRARY_PATH=/sw/xk6/deeplearning/1.0/sles11.3_gnu4.9.3/lib:/sw/xk6/deeplearning/1.0/sles11.3_gnu4.9.3/cuda/lib64 |
| 69 | + |
| 70 | +export PYTHONPATH=$EMEWS_PROJECT_ROOT/python:$P1B3_DIR:$PYTHONPATH |
| 71 | + |
| 72 | +# Resident task workers and ranks |
| 73 | +export TURBINE_RESIDENT_WORK_WORKERS=1 |
| 74 | +export RESIDENT_WORK_RANKS=$(( PROCS - 2 )) |
| 75 | + |
| 76 | +# EQ/R location |
| 77 | +EQR=$EMEWS_PROJECT_ROOT/ext/EQ-R |
| 78 | + |
| 79 | +CMD_LINE_ARGS="$* -pp=$MAX_CONCURRENT_EVALUATIONS -it=$MAX_ITERATIONS " |
| 80 | +CMD_LINE_ARGS+="-param_set_file=$PARAM_SET_FILE " |
| 81 | + |
| 82 | +# set machine to your scheduler type (e.g. pbs, slurm, cobalt etc.), |
| 83 | +# or empty for an immediate non-queued unscheduled run |
| 84 | +MACHINE="cray" |
| 85 | +if [ -n "$MACHINE" ]; then |
| 86 | + MACHINE="-m $MACHINE" |
| 87 | +fi |
| 88 | + |
| 89 | +# Add any script variables that you want to log as |
| 90 | +# part of the experiment meta data to the USER_VARS array, |
| 91 | +# for example, USER_VARS=("VAR_1" "VAR_2") |
| 92 | +USER_VARS=($CMD_LINE_ARGS) |
| 93 | +# log variables and script to to TURBINE_OUTPUT directory |
| 94 | +log_script |
| 95 | + |
| 96 | +R_LIB=/sw/xk6/r/3.3.2/sles11.3_gnu4.9.3x/lib64/R/lib |
| 97 | +GCC_LIB=/opt/gcc/4.9.3/snos/lib64 |
| 98 | + |
| 99 | +set -x |
| 100 | +WORKFLOW_SWIFT=workflow.swift |
| 101 | +swift-t -n $PROCS $MACHINE -p -I $EQR -r $EQR \ |
| 102 | + -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$R_LIB:$GCC_LIB \ |
| 103 | + -e EMEWS_PROJECT_ROOT \ |
| 104 | + -e TURBINE_RESIDENT_WORK_WORKERS \ |
| 105 | + -e RESIDENT_WORK_RANKS \ |
| 106 | + -e PYTHONPATH \ |
| 107 | + $EMEWS_PROJECT_ROOT/swift/$WORKFLOW_SWIFT $CMD_LINE_ARGS |
0 commit comments