github.com/DARA-Project/GoDist-Scheduler@v0.0.0-20201030134746-668de4acea0d/structured/dphil_local/exec_script.sh (about)

     1  #!/bin/bash
     2  
     3  # Enable Job Control
     4  set -m
     5  exec 666<> ./DaraSharedMem
     6  GoDist-Scheduler $1 &
     7  sleep 2
     8  
     9  export GOMAXPROCS=1
    10  export DARAON=true
    11  export DARA_PROFILING=true
    12  export DARAPID=1
    13  
    14  launch_program() {
    15      if [ -z "$RUN_SCRIPT" ]
    16      then
    17          ./$PROGRAM
    18      else
    19          ./$RUN_SCRIPT
    20      fi
    21  }
    22  
    23  start_program() {
    24      if [ "$DARA_MODE" = "explore" ]
    25      then
    26          while [ ! -f ./explore_finish ]
    27          do
    28              launch_program
    29              while [ ! -f ./explore_restart ]
    30              do
    31                  sleep 1
    32                  if [ -f ./explore_finish ]; then
    33                      break
    34                  fi
    35              done
    36              rm ./explore_restart
    37          done    
    38      else
    39          launch_program
    40      fi
    41  }
    42  
    43  if [ -z "$BENCH_RECORD" ]
    44  then
    45  	start_program
    46  else
    47      date +"%s%6N" > record.tmp
    48      start_program
    49      date +"%s%6N" >> record.tmp
    50  fi
    51  # Bring back GoDist-Scheduler to foreground
    52  fg
    53  RC=$?
    54  if [ $RC != 0 ]; then
    55      exit 0
    56  fi
    57  rm ./DaraSharedMem