-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.sh
executable file
·44 lines (31 loc) · 855 Bytes
/
script.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
#
# Script for generating simulation data.
# Author: Nathan Malamud
#
# SCRIPT CONFIG - - - //
INPUT_FILE="cariaco.txt"
NUM_SETS=2
RUNS_PER_SIM=30
# Never do too many threads -- this causes issues in data output.
NUM_THREADS=3
OUTPUT_DIR=data
# - - - - - - - - - - //
# WARNING: RUNNING THIS SCRIPT WILL OVERWRITE THE EXISTING DATA DIRECTORY
rm -rf $OUTPUT_DIR
COUNTER=0
for SET in $(seq 1 $NUM_SETS); do
# Run 'NUM_THREADS' simulations in parallel
for i in $(seq 1 $NUM_THREADS); do
((COUNTER++))
printf -v LABEL "%02d" $COUNTER
# Execute simulation
python3 main.py \
--runs=$RUNS_PER_SIM \
--out="$OUTPUT_DIR/batch_$LABEL" \
--debug \
< $INPUT_FILE \
& \
done
wait # until current set is complete before moving on
done