1*86a4271fSThilina Rathnayake#!/bin/bash 2*86a4271fSThilina Rathnayake 3*86a4271fSThilina Rathnayake# Copyright (c) 2017, Lawrence Livermore National Security, LLC. Produced at 4*86a4271fSThilina Rathnayake# the Lawrence Livermore National Laboratory. LLNL-CODE-734707. All Rights 5*86a4271fSThilina Rathnayake# reserved. See files LICENSE and NOTICE for details. 6*86a4271fSThilina Rathnayake# 7*86a4271fSThilina Rathnayake# This file is part of CEED, a collection of benchmarks, miniapps, software 8*86a4271fSThilina Rathnayake# libraries and APIs for efficient high-order finite element and spectral 9*86a4271fSThilina Rathnayake# element discretizations for exascale applications. For more information and 10*86a4271fSThilina Rathnayake# source code availability see http://github.com/ceed. 11*86a4271fSThilina Rathnayake# 12*86a4271fSThilina Rathnayake# The CEED research is supported by the Exascale Computing Project (17-SC-20-SC) 13*86a4271fSThilina Rathnayake# a collaborative effort of two U.S. Department of Energy organizations (Office 14*86a4271fSThilina Rathnayake# of Science and the National Nuclear Security Administration) responsible for 15*86a4271fSThilina Rathnayake# the planning and preparation of a capable exascale ecosystem, including 16*86a4271fSThilina Rathnayake# software, applications, hardware, advanced system engineering and early 17*86a4271fSThilina Rathnayake# testbed platforms, in support of the nation's exascale computing imperative. 18*86a4271fSThilina Rathnayake############################################################################### 19*86a4271fSThilina Rathnayake# Script for Building and Running Nek5000 examples 20*86a4271fSThilina Rathnayake############################################################################### 21*86a4271fSThilina Rathnayake## Nek5000 path 22*86a4271fSThilina Rathnayake#NEK5K_DIR= 23*86a4271fSThilina Rathnayake 24*86a4271fSThilina Rathnayake## NEKTOOLS path 25*86a4271fSThilina Rathnayake#NEK5K_TOOLS_DIR= 26*86a4271fSThilina Rathnayake 27*86a4271fSThilina Rathnayake## CEED path 28*86a4271fSThilina Rathnayake#CEED_DIR= 29*86a4271fSThilina Rathnayake 30*86a4271fSThilina Rathnayake## Fortran compiler 31*86a4271fSThilina Rathnayake#FC= 32*86a4271fSThilina Rathnayake 33*86a4271fSThilina Rathnayake## C compiler 34*86a4271fSThilina Rathnayake#CC= 35*86a4271fSThilina Rathnayake 36*86a4271fSThilina Rathnayake############################################################################### 37*86a4271fSThilina Rathnayake# DONT'T TOUCH WHAT FOLLOWS !!! 38*86a4271fSThilina Rathnayake############################################################################### 39*86a4271fSThilina Rathnayake# Set defaults for the parameters 40*86a4271fSThilina Rathnayake: ${NEK5K_DIR:=`cd "../../../Nek5000"; pwd`} 41*86a4271fSThilina Rathnayake: ${NEK5K_TOOLS_DIR:=`cd "${NEK5K_DIR}/bin"; pwd`} 42*86a4271fSThilina Rathnayake: ${CEED_DIR:=`cd "../../"; pwd`} 43*86a4271fSThilina Rathnayake: ${FC:="mpif77"} 44*86a4271fSThilina Rathnayake: ${CC:="mpicc"} 45*86a4271fSThilina Rathnayake: ${MPI:=1} 46*86a4271fSThilina Rathnayake 47*86a4271fSThilina Rathnayake# Exit if being sourced 48*86a4271fSThilina Rathnayakeif [[ "${#BASH_ARGV[@]}" -ne "$#" ]]; then 49*86a4271fSThilina Rathnayake nek_exit_cmd=return 50*86a4271fSThilina Rathnayakeelse 51*86a4271fSThilina Rathnayake nek_exit_cmd=exit 52*86a4271fSThilina Rathnayakefi 53*86a4271fSThilina Rathnayake 54*86a4271fSThilina Rathnayake# Read in parameter values 55*86a4271fSThilina Rathnayakenek_examples=("bp1") 56*86a4271fSThilina Rathnayakenek_spec=/cpu/self 57*86a4271fSThilina Rathnayakenek_np=1 58*86a4271fSThilina Rathnayakenek_box= 59*86a4271fSThilina Rathnayakenek_clean="false" 60*86a4271fSThilina Rathnayakenek_make="false" 61*86a4271fSThilina Rathnayakenek_run="true" 62*86a4271fSThilina Rathnayakenek_test="notest" 63*86a4271fSThilina Rathnayake# Won't work if there is a symlink. 64*86a4271fSThilina Rathnayakenek_box_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )/boxes" 65*86a4271fSThilina Rathnayake 66*86a4271fSThilina Rathnayake# Set constants 67*86a4271fSThilina Rathnayakenek_this_file="${BASH_SOURCE[0]}" 68*86a4271fSThilina Rathnayakenek_help_msg=" 69*86a4271fSThilina Rathnayake$nek_this_file [options] 70*86a4271fSThilina Rathnayake 71*86a4271fSThilina Rathnayakeoptions: 72*86a4271fSThilina Rathnayake -h|-help Print this usage information and exit 73*86a4271fSThilina Rathnayake -c|-ceed Ceed backend to be used for the run (optional, default: /cpu/self) 74*86a4271fSThilina Rathnayake -e|-example Example name (optional, default: bp1) 75*86a4271fSThilina Rathnayake -n|-np Specify number of MPI ranks for the run (optional, default: 1) 76*86a4271fSThilina Rathnayake -t|-test Run in test mode (not on by default) 77*86a4271fSThilina Rathnayake -b|-box Box case in boxes sub-directory found along with this script (default: 2x2x2) 78*86a4271fSThilina Rathnayake -clean clean the examples directory 79*86a4271fSThilina Rathnayake -m|-make Make the examples 80*86a4271fSThilina Rathnayake 81*86a4271fSThilina RathnayakeExample: 82*86a4271fSThilina Rathnayake Build examples with: 83*86a4271fSThilina Rathnayake ./nek-examples.sh -m -e \"bp1 bp3\" 84*86a4271fSThilina Rathnayake Run them with: 85*86a4271fSThilina Rathnayake ./nek-examples.sh -c /cpu/self -e \"bp1 bp3\" -n 4 -b 3 86*86a4271fSThilina Rathnayake Clean the examples directory with: 87*86a4271fSThilina Rathnayake ./nek-examples.sh -clean 88*86a4271fSThilina Rathnayake" 89*86a4271fSThilina Rathnayake 90*86a4271fSThilina Rathnayakenek_verbose="true" 91*86a4271fSThilina Rathnayakenek_mpi="true" 92*86a4271fSThilina Rathnayake 93*86a4271fSThilina Rathnayakewhile [ $# -gt 0 ]; do 94*86a4271fSThilina Rathnayake case "$1" in 95*86a4271fSThilina Rathnayake -h|-help) 96*86a4271fSThilina Rathnayake echo "$nek_help_msg" 97*86a4271fSThilina Rathnayake $nek_exit_cmd 98*86a4271fSThilina Rathnayake ;; 99*86a4271fSThilina Rathnayake -e|-example) 100*86a4271fSThilina Rathnayake shift 101*86a4271fSThilina Rathnayake nek_examples=($1) 102*86a4271fSThilina Rathnayake ;; 103*86a4271fSThilina Rathnayake -c|-ceed) 104*86a4271fSThilina Rathnayake shift 105*86a4271fSThilina Rathnayake nek_spec="$1" 106*86a4271fSThilina Rathnayake ;; 107*86a4271fSThilina Rathnayake -n|-np) 108*86a4271fSThilina Rathnayake shift 109*86a4271fSThilina Rathnayake nek_np="$1" 110*86a4271fSThilina Rathnayake ;; 111*86a4271fSThilina Rathnayake -b|-box) 112*86a4271fSThilina Rathnayake shift 113*86a4271fSThilina Rathnayake nek_box="$1" 114*86a4271fSThilina Rathnayake ;; 115*86a4271fSThilina Rathnayake -t|-test) 116*86a4271fSThilina Rathnayake nek_verbose="false" 117*86a4271fSThilina Rathnayake nek_mpi="false" 118*86a4271fSThilina Rathnayake nek_test="test" 119*86a4271fSThilina Rathnayake ;; 120*86a4271fSThilina Rathnayake -clean) 121*86a4271fSThilina Rathnayake nek_clean="true" 122*86a4271fSThilina Rathnayake nek_run="false" 123*86a4271fSThilina Rathnayake ;; 124*86a4271fSThilina Rathnayake -m|-make) 125*86a4271fSThilina Rathnayake nek_make="true" 126*86a4271fSThilina Rathnayake nek_run="false" 127*86a4271fSThilina Rathnayake ;; 128*86a4271fSThilina Rathnayake esac 129*86a4271fSThilina Rathnayake shift 130*86a4271fSThilina Rathnayakedone 131*86a4271fSThilina Rathnayake 132*86a4271fSThilina Rathnayakefunction make() { 133*86a4271fSThilina Rathnayake # Set flags 134*86a4271fSThilina Rathnayake FFLAGS="-g -std=legacy -I${CEED_DIR}/include" 135*86a4271fSThilina Rathnayake USR_LFLAGS="-g -L${CEED_DIR}/lib -Wl,-rpath,${CEED_DIR}/lib -lceed" 136*86a4271fSThilina Rathnayake 137*86a4271fSThilina Rathnayake # Build examples 138*86a4271fSThilina Rathnayake echo "Building examples:" 139*86a4271fSThilina Rathnayake 140*86a4271fSThilina Rathnayake # BP dir 141*86a4271fSThilina Rathnayake if [[ ! -d build ]]; then 142*86a4271fSThilina Rathnayake mkdir build 143*86a4271fSThilina Rathnayake fi 144*86a4271fSThilina Rathnayake 145*86a4271fSThilina Rathnayake # Copy makenek from NEK5K_DIR/bin/ 146*86a4271fSThilina Rathnayake if [[ ! -f build/makenek ]]; then 147*86a4271fSThilina Rathnayake cp $NEK5K_DIR/bin/makenek build/ 148*86a4271fSThilina Rathnayake fi 149*86a4271fSThilina Rathnayake 150*86a4271fSThilina Rathnayake # Copy BP files 151*86a4271fSThilina Rathnayake cp bps/bps.* build/ 152*86a4271fSThilina Rathnayake 153*86a4271fSThilina Rathnayake # Copy SIZE file 154*86a4271fSThilina Rathnayake if [[ ! -f build/SIZE ]]; then 155*86a4271fSThilina Rathnayake cp SIZE.in build/SIZE 156*86a4271fSThilina Rathnayake fi 157*86a4271fSThilina Rathnayake 158*86a4271fSThilina Rathnayake # Change to build directory 159*86a4271fSThilina Rathnayake cd build 160*86a4271fSThilina Rathnayake 161*86a4271fSThilina Rathnayake # Attempt build 162*86a4271fSThilina Rathnayake CC=$CC FC=$FC MPI=$MPI NEK_SOURCE_ROOT="${NEK5K_DIR}" FFLAGS="$FFLAGS" \ 163*86a4271fSThilina Rathnayake USR_LFLAGS="$USR_LFLAGS" ./makenek bps >> bps.build.log 2>&1 164*86a4271fSThilina Rathnayake 165*86a4271fSThilina Rathnayake # Check and report 166*86a4271fSThilina Rathnayake if [ ! -f ./nek5000 ]; then 167*86a4271fSThilina Rathnayake echo " Building examples failed. See build/bps.build.log for details." 168*86a4271fSThilina Rathnayake cd ../.. 169*86a4271fSThilina Rathnayake ${nek_exit_cmd} 1 170*86a4271fSThilina Rathnayake elif [ ${nek_verbose} = "true" ]; then 171*86a4271fSThilina Rathnayake mv nek5000 bps 172*86a4271fSThilina Rathnayake cd ../ 173*86a4271fSThilina Rathnayake echo " Built examples successfully. See build/bps.build.log for details." 174*86a4271fSThilina Rathnayake fi 175*86a4271fSThilina Rathnayake} 176*86a4271fSThilina Rathnayake 177*86a4271fSThilina Rathnayake# Function to clean 178*86a4271fSThilina Rathnayakefunction clean() { 179*86a4271fSThilina Rathnayake if [ ${nek_verbose} = "true" ]; then 180*86a4271fSThilina Rathnayake echo "Cleaning ..." 181*86a4271fSThilina Rathnayake fi 182*86a4271fSThilina Rathnayake 183*86a4271fSThilina Rathnayake # Run clean 184*86a4271fSThilina Rathnayake if [[ -f ./build/makenek ]]; then 185*86a4271fSThilina Rathnayake cd build 186*86a4271fSThilina Rathnayake printf "y\n" | NEK_SOURCE_ROOT=${NEK5K_DIR} ./makenek clean 2>&1 >> /dev/null 187*86a4271fSThilina Rathnayake cd .. 188*86a4271fSThilina Rathnayake fi 189*86a4271fSThilina Rathnayake 190*86a4271fSThilina Rathnayake # Remove build dir 191*86a4271fSThilina Rathnayake rm -rf build 192*86a4271fSThilina Rathnayake 193*86a4271fSThilina Rathnayake # Remove BPs 194*86a4271fSThilina Rathnayake rm -f bps *log* SESSION.NAME 2> /dev/null 195*86a4271fSThilina Rathnayake 196*86a4271fSThilina Rathnayake # Clean box dir 197*86a4271fSThilina Rathnayake find ${nek_box_dir} -type d -regex ".*/b[0-9]+" -exec rm -rf "{}" \; 2>/dev/null 198*86a4271fSThilina Rathnayake} 199*86a4271fSThilina Rathnayake 200*86a4271fSThilina Rathnayake# Functions needed for creating box meshes 201*86a4271fSThilina Rathnayakefunction xyz() 202*86a4271fSThilina Rathnayake{ 203*86a4271fSThilina Rathnayake prod=$1 204*86a4271fSThilina Rathnayake split=$((prod/3)) 205*86a4271fSThilina Rathnayake 206*86a4271fSThilina Rathnayake nex=$split 207*86a4271fSThilina Rathnayake nez=$split 208*86a4271fSThilina Rathnayake ney=$split 209*86a4271fSThilina Rathnayake 210*86a4271fSThilina Rathnayake if [ $((prod%3)) -ne 0 ]; then 211*86a4271fSThilina Rathnayake nex=$((split + 1)) 212*86a4271fSThilina Rathnayake fi 213*86a4271fSThilina Rathnayake if [ $((prod%3)) -eq 2 ]; then 214*86a4271fSThilina Rathnayake ney=$((split + 1)) 215*86a4271fSThilina Rathnayake fi 216*86a4271fSThilina Rathnayake 217*86a4271fSThilina Rathnayake nex=$((2**nex)) 218*86a4271fSThilina Rathnayake ney=$((2**ney)) 219*86a4271fSThilina Rathnayake nez=$((2**nez)) 220*86a4271fSThilina Rathnayake 221*86a4271fSThilina Rathnayake echo "$nex $ney $nez" 222*86a4271fSThilina Rathnayake} 223*86a4271fSThilina Rathnayake 224*86a4271fSThilina Rathnayakefunction genbb() 225*86a4271fSThilina Rathnayake{ 226*86a4271fSThilina Rathnayake cp $1.box ttt.box 227*86a4271fSThilina Rathnayake if [ ${nek_verbose} = "true" ]; then 228*86a4271fSThilina Rathnayake echo "Running genbox ..." 229*86a4271fSThilina Rathnayake fi 230*86a4271fSThilina Rathnayake 231*86a4271fSThilina Rathnayake if [ -z ${NEK5K_TOOLS_DIR} ]; then 232*86a4271fSThilina Rathnayake echo "Required variable NEKTOOLS_DIR not found." 233*86a4271fSThilina Rathnayake ${nek_exit_cmd} 1 234*86a4271fSThilina Rathnayake fi 235*86a4271fSThilina Rathnayake 236*86a4271fSThilina Rathnayake printf "ttt.box\n" | $NEK5K_TOOLS_DIR/genbox 2>&1 1>>box.log || return 1 237*86a4271fSThilina Rathnayake 238*86a4271fSThilina Rathnayake if [ ${nek_verbose} = "true" ]; then 239*86a4271fSThilina Rathnayake echo "Running genmap ..." 240*86a4271fSThilina Rathnayake fi 241*86a4271fSThilina Rathnayake printf "box\n.1\n" | $NEK5K_TOOLS_DIR/genmap 2>&1 1>>box.log || return 1 242*86a4271fSThilina Rathnayake 243*86a4271fSThilina Rathnayake if [ ${nek_verbose} = "true" ]; then 244*86a4271fSThilina Rathnayake echo "Running reatore2 ..." 245*86a4271fSThilina Rathnayake fi 246*86a4271fSThilina Rathnayake printf "box\n$1\n" | $NEK5K_TOOLS_DIR/reatore2 2>&1 1>>box.log || return 1 247*86a4271fSThilina Rathnayake 248*86a4271fSThilina Rathnayake rm ttt.box 2>/dev/null 249*86a4271fSThilina Rathnayake rm box.rea 2>/dev/null 250*86a4271fSThilina Rathnayake rm box.tmp 2>/dev/null 251*86a4271fSThilina Rathnayake mv box.map $1.map 2>/dev/null 252*86a4271fSThilina Rathnayake} 253*86a4271fSThilina Rathnayake 254*86a4271fSThilina Rathnayakefunction generate_boxes() 255*86a4271fSThilina Rathnayake{ 256*86a4271fSThilina Rathnayake if [ $# -ne 2 ]; then 257*86a4271fSThilina Rathnayake echo "Error: should be called with two parameters. See syntax below." 258*86a4271fSThilina Rathnayake echo "Syntax: generate_boxes log_2(<min_elem>) log_2(<max_elem>)." 259*86a4271fSThilina Rathnayake echo "Example: generate-boxes 2 4" 260*86a4271fSThilina Rathnayake ${nek_exit_cmd} 1 261*86a4271fSThilina Rathnayake fi 262*86a4271fSThilina Rathnayake local min_elem=$1 263*86a4271fSThilina Rathnayake local max_elem=$2 264*86a4271fSThilina Rathnayake local pwd_=`pwd` 265*86a4271fSThilina Rathnayake 266*86a4271fSThilina Rathnayake mkdir -p ${nek_box_dir} && cd ${nek_box_dir} 267*86a4271fSThilina Rathnayake # Run thorugh the box sizes 268*86a4271fSThilina Rathnayake for i in `seq $min_elem 1 $max_elem`; do 269*86a4271fSThilina Rathnayake # Generate the boxes only if they have not 270*86a4271fSThilina Rathnayake # been generated before. 271*86a4271fSThilina Rathnayake if [ ! -f b$i/b$i.map ]; then 272*86a4271fSThilina Rathnayake # Set the number of elements in box file. 273*86a4271fSThilina Rathnayake xyz=$(xyz $i) 274*86a4271fSThilina Rathnayake nex=$( echo $xyz | cut -f 1 -d ' ' ) 275*86a4271fSThilina Rathnayake ney=$( echo $xyz | cut -f 2 -d ' ' ) 276*86a4271fSThilina Rathnayake nez=$( echo $xyz | cut -f 3 -d ' ' ) 277*86a4271fSThilina Rathnayake 278*86a4271fSThilina Rathnayake mkdir -p b$i 279*86a4271fSThilina Rathnayake sed "5s/.*/-$nex -$ney -$nez/" ${CEED_DIR}/examples/nek/boxes/b.box > b$i/b$i.box 280*86a4271fSThilina Rathnayake cp ${CEED_DIR}/examples/nek/boxes/b1e.rea b$i/ 281*86a4271fSThilina Rathnayake 282*86a4271fSThilina Rathnayake cd b$i 283*86a4271fSThilina Rathnayake genbb b$i 284*86a4271fSThilina Rathnayake genbb b$i &> log || { 285*86a4271fSThilina Rathnayake echo "Error generating box. See $PWD/log for details." 286*86a4271fSThilina Rathnayake return 1 287*86a4271fSThilina Rathnayake } 288*86a4271fSThilina Rathnayake cd .. 289*86a4271fSThilina Rathnayake fi 290*86a4271fSThilina Rathnayake done 291*86a4271fSThilina Rathnayake cd $pwd_ 292*86a4271fSThilina Rathnayake} 293*86a4271fSThilina Rathnayake 294*86a4271fSThilina Rathnayakefunction run() { 295*86a4271fSThilina Rathnayake for nek_ex in "${nek_examples[@]}"; do 296*86a4271fSThilina Rathnayake if [ ${nek_verbose} = "true" ]; then 297*86a4271fSThilina Rathnayake echo "Running Nek5000 Example: $nek_ex" 298*86a4271fSThilina Rathnayake fi 299*86a4271fSThilina Rathnayake 300*86a4271fSThilina Rathnayake # Check for build 301*86a4271fSThilina Rathnayake if [ ! -f $bps ]; then 302*86a4271fSThilina Rathnayake echo " Examples file does not exist. Build it with nek-examples.sh -m" 303*86a4271fSThilina Rathnayake ${nek_exit_cmd} 1 304*86a4271fSThilina Rathnayake fi 305*86a4271fSThilina Rathnayake 306*86a4271fSThilina Rathnayake # Generate boxes, if needed 307*86a4271fSThilina Rathnayake if [ ! -f ${nek_box_dir}/b${nek_box}/b${nek_box}.rea ] || \ 308*86a4271fSThilina Rathnayake [ ! -f ${nek_box_dir}/b${nek_box}/b${nek_box}.map ]; then 309*86a4271fSThilina Rathnayake if [ -z ${nek_box} ]; then 310*86a4271fSThilina Rathnayake nek_box=3 311*86a4271fSThilina Rathnayake fi 312*86a4271fSThilina Rathnayake generate_boxes ${nek_box} ${nek_box} 313*86a4271fSThilina Rathnayake fi 314*86a4271fSThilina Rathnayake 315*86a4271fSThilina Rathnayake # Get CEED spec 316*86a4271fSThilina Rathnayake nek_spec_short=${nek_spec//[\/]} 317*86a4271fSThilina Rathnayake 318*86a4271fSThilina Rathnayake # Logging 319*86a4271fSThilina Rathnayake echo b${nek_box} > SESSION.NAME 320*86a4271fSThilina Rathnayake echo `cd ${nek_box_dir}/b${nek_box}; pwd`'/' >> SESSION.NAME 321*86a4271fSThilina Rathnayake rm -f logfile 322*86a4271fSThilina Rathnayake rm -f ioinfo 323*86a4271fSThilina Rathnayake mv ${nek_ex}.${nek_spec_short}.log.${nek_np}.b${nek_box} ${nek_ex}.${nek_spec_short}.log1.${nek_np}.b${nek_box} 2>/dev/null 324*86a4271fSThilina Rathnayake 325*86a4271fSThilina Rathnayake # Run example 326*86a4271fSThilina Rathnayake if [ ${nek_mpi} = "false" ]; then 327*86a4271fSThilina Rathnayake ./build/bps ${nek_ex} ${nek_spec} ${nek_test} > ${nek_ex}.${nek_spec_short}.log.${nek_np}.b${nek_box} 328*86a4271fSThilina Rathnayake wait $! 329*86a4271fSThilina Rathnayake else 330*86a4271fSThilina Rathnayake ${MPIEXEC:-mpiexec} -np ${nek_np} ./build/bps ${nek_ex} ${nek_spec} ${nek_test} > \ 331*86a4271fSThilina Rathnayake ${nek_ex}.${nek_spec_short}.log.${nek_np}.b${nek_box} 332*86a4271fSThilina Rathnayake wait $! 333*86a4271fSThilina Rathnayake fi 334*86a4271fSThilina Rathnayake 335*86a4271fSThilina Rathnayake # Log output location 336*86a4271fSThilina Rathnayake if [ ${nek_verbose} = "true" ]; then 337*86a4271fSThilina Rathnayake echo " Run finished. Output was written to ${nek_ex}.${nek_spec_short}.log.${nek_np}.b${nek_box}" 338*86a4271fSThilina Rathnayake fi 339*86a4271fSThilina Rathnayake 340*86a4271fSThilina Rathnayake # Check error 341*86a4271fSThilina Rathnayake if [[ $(grep 'ERROR IS TOO LARGE' ${nek_ex}.${nek_spec_short}.log*) ]]; then 342*86a4271fSThilina Rathnayake echo "ERROR IS TOO LARGE" 343*86a4271fSThilina Rathnayake ${nek_exit_cmd} 1 344*86a4271fSThilina Rathnayake elif [ ${nek_verbose} != "true" ]; then # Cleanup if test mode 345*86a4271fSThilina Rathnayake rm -f ${nek_ex}.${nek_spec_short}.log* 346*86a4271fSThilina Rathnayake fi 347*86a4271fSThilina Rathnayake done 348*86a4271fSThilina Rathnayake 349*86a4271fSThilina Rathnayake ${nek_exit_cmd} 0 350*86a4271fSThilina Rathnayake} 351*86a4271fSThilina Rathnayake 352*86a4271fSThilina Rathnayakeif [ "${nek_clean}" = "true" ]; then 353*86a4271fSThilina Rathnayake clean 354*86a4271fSThilina Rathnayakefi 355*86a4271fSThilina Rathnayakeif [ "${nek_make}" = "true" ]; then 356*86a4271fSThilina Rathnayake make 357*86a4271fSThilina Rathnayakefi 358*86a4271fSThilina Rathnayakeif [ "${nek_run}" = "true" ]; then 359*86a4271fSThilina Rathnayake run 360*86a4271fSThilina Rathnayakefi 361*86a4271fSThilina Rathnayake${nek_exit_cmd} 0 362