xref: /libCEED/examples/nek/nek-examples.sh (revision ce18bed930e8f3bfebcf709a18844aba97fe4630)
186a4271fSThilina Rathnayake#!/bin/bash
286a4271fSThilina Rathnayake
386a4271fSThilina Rathnayake# Copyright (c) 2017, Lawrence Livermore National Security, LLC. Produced at
486a4271fSThilina Rathnayake# the Lawrence Livermore National Laboratory. LLNL-CODE-734707. All Rights
586a4271fSThilina Rathnayake# reserved. See files LICENSE and NOTICE for details.
686a4271fSThilina Rathnayake#
786a4271fSThilina Rathnayake# This file is part of CEED, a collection of benchmarks, miniapps, software
886a4271fSThilina Rathnayake# libraries and APIs for efficient high-order finite element and spectral
986a4271fSThilina Rathnayake# element discretizations for exascale applications. For more information and
10*3d8e8822SJeremy L Thompson# source code availability see http://github.com/ceed
1186a4271fSThilina Rathnayake#
1286a4271fSThilina Rathnayake# The CEED research is supported by the Exascale Computing Project (17-SC-20-SC)
1386a4271fSThilina Rathnayake# a collaborative effort of two U.S. Department of Energy organizations (Office
1486a4271fSThilina Rathnayake# of Science and the National Nuclear Security Administration) responsible for
1586a4271fSThilina Rathnayake# the planning and preparation of a capable exascale ecosystem, including
1686a4271fSThilina Rathnayake# software, applications, hardware, advanced system engineering and early
1786a4271fSThilina Rathnayake# testbed platforms, in support of the nation's exascale computing imperative.
1886a4271fSThilina Rathnayake###############################################################################
1986a4271fSThilina Rathnayake# Script for Building and Running Nek5000 examples
2086a4271fSThilina Rathnayake###############################################################################
2186a4271fSThilina Rathnayake## Nek5000 path
2286a4271fSThilina Rathnayake#NEK5K_DIR=
2386a4271fSThilina Rathnayake
2486a4271fSThilina Rathnayake## NEKTOOLS path
2586a4271fSThilina Rathnayake#NEK5K_TOOLS_DIR=
2686a4271fSThilina Rathnayake
2786a4271fSThilina Rathnayake## CEED path
2886a4271fSThilina Rathnayake#CEED_DIR=
2986a4271fSThilina Rathnayake
3086a4271fSThilina Rathnayake## Fortran compiler
3186a4271fSThilina Rathnayake#FC=
3286a4271fSThilina Rathnayake
3386a4271fSThilina Rathnayake## C compiler
3486a4271fSThilina Rathnayake#CC=
3586a4271fSThilina Rathnayake
3686a4271fSThilina Rathnayake###############################################################################
3786a4271fSThilina Rathnayake# DONT'T TOUCH WHAT FOLLOWS !!!
3886a4271fSThilina Rathnayake###############################################################################
3986a4271fSThilina Rathnayake# Set defaults for the parameters
4086a4271fSThilina Rathnayake: ${NEK5K_DIR:=`cd "../../../Nek5000"; pwd`}
4186a4271fSThilina Rathnayake: ${NEK5K_TOOLS_DIR:=`cd "${NEK5K_DIR}/bin"; pwd`}
4286a4271fSThilina Rathnayake: ${CEED_DIR:=`cd "../../"; pwd`}
4386a4271fSThilina Rathnayake: ${FC:="mpif77"}
4486a4271fSThilina Rathnayake: ${CC:="mpicc"}
4586a4271fSThilina Rathnayake: ${MPI:=1}
4686a4271fSThilina Rathnayake
4786a4271fSThilina Rathnayake# Exit if being sourced
4886a4271fSThilina Rathnayakeif [[ "${#BASH_ARGV[@]}" -ne "$#" ]]; then
4986a4271fSThilina Rathnayake   nek_exit_cmd=return
5086a4271fSThilina Rathnayakeelse
5186a4271fSThilina Rathnayake   nek_exit_cmd=exit
5286a4271fSThilina Rathnayakefi
5386a4271fSThilina Rathnayake
5486a4271fSThilina Rathnayake# Read in parameter values
5586a4271fSThilina Rathnayakenek_examples=("bp1")
5686a4271fSThilina Rathnayakenek_spec=/cpu/self
5786a4271fSThilina Rathnayakenek_np=1
5886a4271fSThilina Rathnayakenek_box=
5986a4271fSThilina Rathnayakenek_clean="false"
6086a4271fSThilina Rathnayakenek_make="false"
6186a4271fSThilina Rathnayakenek_run="true"
6286a4271fSThilina Rathnayakenek_test="notest"
6386a4271fSThilina Rathnayake# Won't work if there is a symlink.
6486a4271fSThilina Rathnayakenek_box_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )/boxes"
6586a4271fSThilina Rathnayake
6686a4271fSThilina Rathnayake# Set constants
6786a4271fSThilina Rathnayakenek_this_file="${BASH_SOURCE[0]}"
6886a4271fSThilina Rathnayakenek_help_msg="
6986a4271fSThilina Rathnayake$nek_this_file [options]
7086a4271fSThilina Rathnayake
7186a4271fSThilina Rathnayakeoptions:
7286a4271fSThilina Rathnayake   -h|-help     Print this usage information and exit
7386a4271fSThilina Rathnayake   -c|-ceed     Ceed backend to be used for the run (optional, default: /cpu/self)
7486a4271fSThilina Rathnayake   -e|-example  Example name (optional, default: bp1)
7586a4271fSThilina Rathnayake   -n|-np       Specify number of MPI ranks for the run (optional, default: 1)
7686a4271fSThilina Rathnayake   -t|-test     Run in test mode (not on by default)
7786a4271fSThilina Rathnayake   -b|-box      Box case in boxes sub-directory found along with this script (default: 2x2x2)
7886a4271fSThilina Rathnayake   -clean       clean the examples directory
7986a4271fSThilina Rathnayake   -m|-make     Make the examples
8086a4271fSThilina Rathnayake
8186a4271fSThilina RathnayakeExample:
8286a4271fSThilina Rathnayake  Build examples with:
8386a4271fSThilina Rathnayake    ./nek-examples.sh -m -e \"bp1 bp3\"
8486a4271fSThilina Rathnayake  Run them with:
8586a4271fSThilina Rathnayake    ./nek-examples.sh -c /cpu/self -e \"bp1 bp3\" -n 4 -b 3
8686a4271fSThilina Rathnayake  Clean the examples directory with:
8786a4271fSThilina Rathnayake    ./nek-examples.sh -clean
8886a4271fSThilina Rathnayake"
8986a4271fSThilina Rathnayake
9086a4271fSThilina Rathnayakenek_verbose="true"
9186a4271fSThilina Rathnayakenek_mpi="true"
9286a4271fSThilina Rathnayake
9386a4271fSThilina Rathnayakewhile [ $# -gt 0 ]; do
9486a4271fSThilina Rathnayake  case "$1" in
9586a4271fSThilina Rathnayake    -h|-help)
9686a4271fSThilina Rathnayake       echo "$nek_help_msg"
9786a4271fSThilina Rathnayake       $nek_exit_cmd
9886a4271fSThilina Rathnayake       ;;
9986a4271fSThilina Rathnayake    -e|-example)
10086a4271fSThilina Rathnayake       shift
10186a4271fSThilina Rathnayake       nek_examples=($1)
10286a4271fSThilina Rathnayake       ;;
10386a4271fSThilina Rathnayake    -c|-ceed)
10486a4271fSThilina Rathnayake       shift
10586a4271fSThilina Rathnayake       nek_spec="$1"
10686a4271fSThilina Rathnayake       ;;
10786a4271fSThilina Rathnayake    -n|-np)
10886a4271fSThilina Rathnayake       shift
10986a4271fSThilina Rathnayake       nek_np="$1"
11086a4271fSThilina Rathnayake       ;;
11186a4271fSThilina Rathnayake    -b|-box)
11286a4271fSThilina Rathnayake       shift
11386a4271fSThilina Rathnayake       nek_box="$1"
11486a4271fSThilina Rathnayake       ;;
11586a4271fSThilina Rathnayake    -t|-test)
11686a4271fSThilina Rathnayake       nek_verbose="false"
11786a4271fSThilina Rathnayake       nek_mpi="false"
11886a4271fSThilina Rathnayake       nek_test="test"
11986a4271fSThilina Rathnayake       ;;
12086a4271fSThilina Rathnayake    -clean)
12186a4271fSThilina Rathnayake      nek_clean="true"
12286a4271fSThilina Rathnayake      nek_run="false"
12386a4271fSThilina Rathnayake      ;;
12486a4271fSThilina Rathnayake    -m|-make)
12586a4271fSThilina Rathnayake      nek_make="true"
12686a4271fSThilina Rathnayake      nek_run="false"
12786a4271fSThilina Rathnayake      ;;
12886a4271fSThilina Rathnayake  esac
12986a4271fSThilina Rathnayake  shift
13086a4271fSThilina Rathnayakedone
13186a4271fSThilina Rathnayake
13286a4271fSThilina Rathnayakefunction make() {
13386a4271fSThilina Rathnayake  # Set flags
134b3d368a0Sjeremylt  CFLAGS="-fPIC"
13599c88bd8Sjeremylt  FFLAGS="-g -std=legacy -I${CEED_DIR}/include -ffixed-line-length-132 -DEXAMPLE_DIR='\"${PWD}/\"' -fPIC"
136b3d368a0Sjeremylt  USR_LFLAGS="-g -L${CEED_DIR}/lib -Wl,-rpath,${CEED_DIR}/lib -lceed -fPIC"
13786a4271fSThilina Rathnayake
13886a4271fSThilina Rathnayake  # Build examples
13986a4271fSThilina Rathnayake  echo "Building examples:"
14086a4271fSThilina Rathnayake
14186a4271fSThilina Rathnayake  # BP dir
14286a4271fSThilina Rathnayake  if [[ ! -d build ]]; then
14386a4271fSThilina Rathnayake    mkdir build
14486a4271fSThilina Rathnayake  fi
14586a4271fSThilina Rathnayake
14686a4271fSThilina Rathnayake  # Copy makenek from NEK5K_DIR/bin/
14786a4271fSThilina Rathnayake  if [[ ! -f build/makenek ]]; then
14886a4271fSThilina Rathnayake    cp $NEK5K_DIR/bin/makenek build/
14986a4271fSThilina Rathnayake  fi
15086a4271fSThilina Rathnayake
15186a4271fSThilina Rathnayake  # Copy BP files
15286a4271fSThilina Rathnayake  cp bps/bps.* build/
15386a4271fSThilina Rathnayake
15486a4271fSThilina Rathnayake  # Copy SIZE file
15586a4271fSThilina Rathnayake  if [[ ! -f build/SIZE ]]; then
15686a4271fSThilina Rathnayake    cp SIZE.in build/SIZE
15786a4271fSThilina Rathnayake  fi
15886a4271fSThilina Rathnayake
15986a4271fSThilina Rathnayake  # Change to build directory
16086a4271fSThilina Rathnayake  cd build
16186a4271fSThilina Rathnayake
16286a4271fSThilina Rathnayake  # Attempt build
163b3d368a0Sjeremylt  CC=$CC FC=$FC MPI=$MPI NEK_SOURCE_ROOT="${NEK5K_DIR}" CFLAGS="$CFLAGS" \
164b3d368a0Sjeremylt    FFLAGS="$FFLAGS" USR_LFLAGS="$USR_LFLAGS" ./makenek bps >> bps.build.log 2>&1
16586a4271fSThilina Rathnayake
16686a4271fSThilina Rathnayake    # Check and report
16786a4271fSThilina Rathnayake  if [ ! -f ./nek5000 ]; then
16886a4271fSThilina Rathnayake    echo "  Building examples failed. See build/bps.build.log for details."
16986a4271fSThilina Rathnayake    cd ../..
17086a4271fSThilina Rathnayake    ${nek_exit_cmd} 1
17186a4271fSThilina Rathnayake  elif [ ${nek_verbose} = "true" ]; then
17286a4271fSThilina Rathnayake    mv nek5000 bps
17386a4271fSThilina Rathnayake    cd ../
17486a4271fSThilina Rathnayake    echo "  Built examples successfully. See build/bps.build.log for details."
17586a4271fSThilina Rathnayake  fi
17686a4271fSThilina Rathnayake}
17786a4271fSThilina Rathnayake
17886a4271fSThilina Rathnayake# Function to clean
17986a4271fSThilina Rathnayakefunction clean() {
18086a4271fSThilina Rathnayake  if [ ${nek_verbose} = "true" ]; then
18186a4271fSThilina Rathnayake    echo "Cleaning ..."
18286a4271fSThilina Rathnayake  fi
18386a4271fSThilina Rathnayake
18486a4271fSThilina Rathnayake  # Run clean
18586a4271fSThilina Rathnayake  if [[ -f ./build/makenek ]]; then
18686a4271fSThilina Rathnayake    cd build
18786a4271fSThilina Rathnayake    printf "y\n" | NEK_SOURCE_ROOT=${NEK5K_DIR} ./makenek clean 2>&1 >> /dev/null
18886a4271fSThilina Rathnayake    cd ..
18986a4271fSThilina Rathnayake  fi
19086a4271fSThilina Rathnayake
19186a4271fSThilina Rathnayake  # Remove build dir
19286a4271fSThilina Rathnayake  rm -rf build
19386a4271fSThilina Rathnayake
19486a4271fSThilina Rathnayake  # Remove BPs
19586a4271fSThilina Rathnayake  rm -f bps  *log* SESSION.NAME 2> /dev/null
19686a4271fSThilina Rathnayake
19786a4271fSThilina Rathnayake  # Clean box dir
19886a4271fSThilina Rathnayake  find ${nek_box_dir} -type d -regex ".*/b[0-9]+" -exec rm -rf "{}" \; 2>/dev/null
19986a4271fSThilina Rathnayake}
20086a4271fSThilina Rathnayake
20186a4271fSThilina Rathnayake# Functions needed for creating box meshes
20286a4271fSThilina Rathnayakefunction xyz()
20386a4271fSThilina Rathnayake{
20486a4271fSThilina Rathnayake  prod=$1
20586a4271fSThilina Rathnayake  split=$((prod/3))
20686a4271fSThilina Rathnayake
20786a4271fSThilina Rathnayake  nex=$split
20886a4271fSThilina Rathnayake  nez=$split
20986a4271fSThilina Rathnayake  ney=$split
21086a4271fSThilina Rathnayake
21186a4271fSThilina Rathnayake  if [ $((prod%3)) -ne 0 ]; then
21286a4271fSThilina Rathnayake    nex=$((split + 1))
21386a4271fSThilina Rathnayake  fi
21486a4271fSThilina Rathnayake  if [ $((prod%3)) -eq 2 ]; then
21586a4271fSThilina Rathnayake    ney=$((split + 1))
21686a4271fSThilina Rathnayake  fi
21786a4271fSThilina Rathnayake
21886a4271fSThilina Rathnayake  nex=$((2**nex))
21986a4271fSThilina Rathnayake  ney=$((2**ney))
22086a4271fSThilina Rathnayake  nez=$((2**nez))
22186a4271fSThilina Rathnayake
22286a4271fSThilina Rathnayake  echo "$nex $ney $nez"
22386a4271fSThilina Rathnayake}
22486a4271fSThilina Rathnayake
22586a4271fSThilina Rathnayakefunction genbb()
22686a4271fSThilina Rathnayake{
22786a4271fSThilina Rathnayake  cp $1.box ttt.box
22886a4271fSThilina Rathnayake  if [ ${nek_verbose} = "true" ]; then
22986a4271fSThilina Rathnayake    echo "Running genbox ..."
23086a4271fSThilina Rathnayake  fi
23186a4271fSThilina Rathnayake
23286a4271fSThilina Rathnayake  if [ -z ${NEK5K_TOOLS_DIR} ]; then
23386a4271fSThilina Rathnayake    echo "Required variable NEKTOOLS_DIR not found."
23486a4271fSThilina Rathnayake    ${nek_exit_cmd} 1
23586a4271fSThilina Rathnayake  fi
23686a4271fSThilina Rathnayake
23786a4271fSThilina Rathnayake  printf "ttt.box\n" | $NEK5K_TOOLS_DIR/genbox 2>&1 1>>box.log || return 1
23886a4271fSThilina Rathnayake
23986a4271fSThilina Rathnayake  if [ ${nek_verbose} = "true" ]; then
24086a4271fSThilina Rathnayake    echo "Running genmap ..."
24186a4271fSThilina Rathnayake  fi
24286a4271fSThilina Rathnayake  printf "box\n.1\n" | $NEK5K_TOOLS_DIR/genmap 2>&1 1>>box.log || return 1
24386a4271fSThilina Rathnayake
24486a4271fSThilina Rathnayake  if [ ${nek_verbose} = "true" ]; then
24586a4271fSThilina Rathnayake    echo "Running reatore2 ..."
24686a4271fSThilina Rathnayake  fi
24786a4271fSThilina Rathnayake  printf "box\n$1\n" | $NEK5K_TOOLS_DIR/reatore2 2>&1 1>>box.log || return 1
24886a4271fSThilina Rathnayake
24986a4271fSThilina Rathnayake  rm ttt.box 2>/dev/null
25086a4271fSThilina Rathnayake  rm box.rea 2>/dev/null
25186a4271fSThilina Rathnayake  rm box.tmp 2>/dev/null
25286a4271fSThilina Rathnayake  mv box.map $1.map 2>/dev/null
25386a4271fSThilina Rathnayake}
25486a4271fSThilina Rathnayake
25586a4271fSThilina Rathnayakefunction generate_boxes()
25686a4271fSThilina Rathnayake{
25786a4271fSThilina Rathnayake  if [ $# -ne 2 ]; then
25886a4271fSThilina Rathnayake    echo "Error: should be called with two parameters. See syntax below."
25986a4271fSThilina Rathnayake    echo "Syntax: generate_boxes log_2(<min_elem>) log_2(<max_elem>)."
26086a4271fSThilina Rathnayake    echo "Example: generate-boxes 2 4"
26186a4271fSThilina Rathnayake    ${nek_exit_cmd} 1
26286a4271fSThilina Rathnayake  fi
26386a4271fSThilina Rathnayake  local min_elem=$1
26486a4271fSThilina Rathnayake  local max_elem=$2
26586a4271fSThilina Rathnayake  local pwd_=`pwd`
26686a4271fSThilina Rathnayake
26786a4271fSThilina Rathnayake  mkdir -p ${nek_box_dir} && cd ${nek_box_dir}
26886a4271fSThilina Rathnayake  # Run thorugh the box sizes
26986a4271fSThilina Rathnayake  for i in `seq $min_elem 1 $max_elem`; do
27086a4271fSThilina Rathnayake    # Generate the boxes only if they have not
27186a4271fSThilina Rathnayake    # been generated before.
27286a4271fSThilina Rathnayake    if [ ! -f b$i/b$i.map ]; then
27386a4271fSThilina Rathnayake      # Set the number of elements in box file.
27486a4271fSThilina Rathnayake      xyz=$(xyz $i)
27586a4271fSThilina Rathnayake      nex=$( echo $xyz | cut -f 1 -d ' ' )
27686a4271fSThilina Rathnayake      ney=$( echo $xyz | cut -f 2 -d ' ' )
27786a4271fSThilina Rathnayake      nez=$( echo $xyz | cut -f 3 -d ' ' )
27886a4271fSThilina Rathnayake
27986a4271fSThilina Rathnayake      mkdir -p b$i
28086a4271fSThilina Rathnayake      sed "5s/.*/-$nex -$ney -$nez/" ${CEED_DIR}/examples/nek/boxes/b.box > b$i/b$i.box
28186a4271fSThilina Rathnayake      cp ${CEED_DIR}/examples/nek/boxes/b1e.rea b$i/
28286a4271fSThilina Rathnayake
28386a4271fSThilina Rathnayake      cd b$i
28486a4271fSThilina Rathnayake      genbb b$i
28586a4271fSThilina Rathnayake      genbb b$i &> log || {
28686a4271fSThilina Rathnayake        echo "Error generating box. See $PWD/log for details."
28786a4271fSThilina Rathnayake        return 1
28886a4271fSThilina Rathnayake      }
28986a4271fSThilina Rathnayake      cd ..
29086a4271fSThilina Rathnayake    fi
29186a4271fSThilina Rathnayake  done
29286a4271fSThilina Rathnayake  cd $pwd_
29386a4271fSThilina Rathnayake}
29486a4271fSThilina Rathnayake
29586a4271fSThilina Rathnayakefunction run() {
29686a4271fSThilina Rathnayake  for nek_ex in "${nek_examples[@]}"; do
29786a4271fSThilina Rathnayake    if [ ${nek_verbose} = "true" ]; then
29886a4271fSThilina Rathnayake      echo "Running Nek5000 Example: $nek_ex"
29986a4271fSThilina Rathnayake    fi
30086a4271fSThilina Rathnayake
30186a4271fSThilina Rathnayake    # Check for build
30286a4271fSThilina Rathnayake    if [ ! -f $bps ]; then
30386a4271fSThilina Rathnayake      echo "  Examples file does not exist. Build it with nek-examples.sh -m"
30486a4271fSThilina Rathnayake      ${nek_exit_cmd} 1
30586a4271fSThilina Rathnayake    fi
30686a4271fSThilina Rathnayake
30786a4271fSThilina Rathnayake    # Generate boxes, if needed
30886a4271fSThilina Rathnayake    if [ ! -f ${nek_box_dir}/b${nek_box}/b${nek_box}.rea ] || \
30986a4271fSThilina Rathnayake  	 [ ! -f ${nek_box_dir}/b${nek_box}/b${nek_box}.map ]; then
31086a4271fSThilina Rathnayake       if [ -z ${nek_box} ]; then
31186a4271fSThilina Rathnayake         nek_box=3
31286a4271fSThilina Rathnayake       fi
31386a4271fSThilina Rathnayake      generate_boxes ${nek_box} ${nek_box}
31486a4271fSThilina Rathnayake    fi
31586a4271fSThilina Rathnayake
31686a4271fSThilina Rathnayake    # Get CEED spec
31786a4271fSThilina Rathnayake    nek_spec_short=${nek_spec//[\/]}
31886a4271fSThilina Rathnayake
31986a4271fSThilina Rathnayake    # Logging
32086a4271fSThilina Rathnayake    echo b${nek_box}                              > SESSION.NAME
32186a4271fSThilina Rathnayake    echo `cd ${nek_box_dir}/b${nek_box}; pwd`'/' >> SESSION.NAME
32286a4271fSThilina Rathnayake    rm -f logfile
32386a4271fSThilina Rathnayake    rm -f ioinfo
32486a4271fSThilina 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
32586a4271fSThilina Rathnayake
32686a4271fSThilina Rathnayake    # Run example
32786a4271fSThilina Rathnayake    if [ ${nek_mpi} = "false" ]; then
32886a4271fSThilina Rathnayake        ./build/bps ${nek_ex} ${nek_spec} ${nek_test} > ${nek_ex}.${nek_spec_short}.log.${nek_np}.b${nek_box}
32986a4271fSThilina Rathnayake      wait $!
33086a4271fSThilina Rathnayake    else
33186a4271fSThilina Rathnayake      ${MPIEXEC:-mpiexec} -np ${nek_np} ./build/bps ${nek_ex} ${nek_spec} ${nek_test} > \
33286a4271fSThilina Rathnayake        ${nek_ex}.${nek_spec_short}.log.${nek_np}.b${nek_box}
33386a4271fSThilina Rathnayake      wait $!
33486a4271fSThilina Rathnayake    fi
33586a4271fSThilina Rathnayake
33686a4271fSThilina Rathnayake    # Log output location
33786a4271fSThilina Rathnayake    if [ ${nek_verbose} = "true" ]; then
33886a4271fSThilina Rathnayake      echo "  Run finished. Output was written to ${nek_ex}.${nek_spec_short}.log.${nek_np}.b${nek_box}"
33986a4271fSThilina Rathnayake    fi
34086a4271fSThilina Rathnayake
34186a4271fSThilina Rathnayake    # Check error
34286a4271fSThilina Rathnayake    if [[ $(grep 'ERROR IS TOO LARGE' ${nek_ex}.${nek_spec_short}.log*) ]]; then
34386a4271fSThilina Rathnayake      echo "ERROR IS TOO LARGE"
34486a4271fSThilina Rathnayake      ${nek_exit_cmd} 1
34586a4271fSThilina Rathnayake    elif [ ${nek_verbose} != "true" ]; then # Cleanup if test mode
34686a4271fSThilina Rathnayake      rm -f ${nek_ex}.${nek_spec_short}.log*
34786a4271fSThilina Rathnayake    fi
34886a4271fSThilina Rathnayake  done
34986a4271fSThilina Rathnayake
35086a4271fSThilina Rathnayake  ${nek_exit_cmd} 0
35186a4271fSThilina Rathnayake}
35286a4271fSThilina Rathnayake
35386a4271fSThilina Rathnayakeif [ "${nek_clean}" = "true" ]; then
35486a4271fSThilina Rathnayake  clean
35586a4271fSThilina Rathnayakefi
35686a4271fSThilina Rathnayakeif [ "${nek_make}" = "true" ]; then
35786a4271fSThilina Rathnayake  make
35886a4271fSThilina Rathnayakefi
35986a4271fSThilina Rathnayakeif [ "${nek_run}" = "true" ]; then
36086a4271fSThilina Rathnayake  run
36186a4271fSThilina Rathnayakefi
36286a4271fSThilina Rathnayake${nek_exit_cmd} 0
363