140 lines
8.0 KiB
Bash
Executable File
140 lines
8.0 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
#Optional Arguments for running batches of tests
|
|
NUM_SERV=${1:-1}
|
|
TYPE=${2:-sync}
|
|
CARS=${3:-2}
|
|
DBNAME=${4:-ag}
|
|
NUM_THREADS=${5:-1}
|
|
NODES=${6:-2}
|
|
MPI_TYPE=${7-serial}
|
|
ESIZE=${8:-6}
|
|
|
|
ITFC="eth0"
|
|
|
|
strval1="sync"
|
|
strval2="non-sync"
|
|
|
|
#Change these to match your desired network model and exploit file paths
|
|
NM=../Oct_2021/nm_files/"$CARS"_car_timeline_maintenance.nm
|
|
XP=../Oct_2021/Sync/4_Exploits/"$NUM_SERV"_Serv/sync_timeline_maintenance.xp
|
|
|
|
#Hammer
|
|
if [ "$(dnsdomainname)" = "hammer.esg.utulsa.edu" ]; then
|
|
#Database stored on node with port
|
|
if psql -p 5240 -h compute03 ${DBNAME} -c '\q' 2>&1; then
|
|
echo "Database ${DBNAME} exists. Dropping and recreating from dump."
|
|
|
|
psql -p 5240 -h compute03 postgres -c "DROP DATABASE "$DBNAME""
|
|
psql -p 5240 -h compute03 postgres -c "CREATE DATABASE "$DBNAME" WITH OWNER = ag_gen"
|
|
psql -q -p 5240 -h compute03 "$DBNAME" < schema.sql
|
|
|
|
else
|
|
echo "Database ${DBNAME} does not exist. Creating and importing from dump."
|
|
|
|
psql -p 5240 -h compute03 postgres -c "CREATE DATABASE "$DBNAME" WITH OWNER = ag_gen"
|
|
psql -q -p 5240 -h compute03 "$DBNAME" < schema.sql
|
|
fi
|
|
#Local
|
|
else
|
|
if psql ${DBNAME} -c '\q' 2>&1; then
|
|
echo "Database ${DBNAME} exists. Dropping and recreating from dump."
|
|
|
|
psql postgres -c "DROP DATABASE "$DBNAME""
|
|
psql postgres -c "CREATE DATABASE "$DBNAME" WITH OWNER = ag_gen"
|
|
psql -q "$DBNAME" < schema.sql
|
|
else
|
|
echo "Database ${DBNAME} does not exist. Creating and importing from dump."
|
|
|
|
psql postgres -c "CREATE DATABASE "$DBNAME" WITH OWNER = ag_gen"
|
|
psql -q "$DBNAME" < schema.sql
|
|
fi
|
|
fi
|
|
|
|
if [[ "$NUM_SERV" -eq 1 ]]; then
|
|
BCLHASH=450
|
|
elif [[ "$NUM_SERV" -eq 2 ]]; then
|
|
BCLHASH=800
|
|
elif [[ "$NUM_SERV" -eq 3 ]]; then
|
|
BCLHASH=1700
|
|
else
|
|
BCLHASH=2300
|
|
fi
|
|
|
|
if [ "$TYPE" == "$strval1" ]; then
|
|
if [ "$(dnsdomainname)" = "hammer.esg.utulsa.edu" ]; then
|
|
if [ "$MPI_TYPE" == subgraphing ]; then
|
|
#4 Exploit Option
|
|
mpiexec --mca btl_openib_allow_ib 1 --mca btl openib,self,vader --mca opal_warn_on_missing_libcuda 0 --bind-to numa --map-by numa -np "$NODES" --timeout 129600 ./ag_gen -n ../Oct_2021/nm_files/"$CARS"_car_timeline_maintenance.nm -x ../Oct_2021/Sync/4_Exploits/"$NUM_SERV"_Serv/sync_timeline_maintenance.xp -t "$NUM_THREADS" -q 1 -p -a 0.6 -z "$DBNAME" -l 200 -s -f "$BCLHASH"
|
|
elif [ "$MPI_TYPE" == tasking ]; then
|
|
#4 Exploit Option
|
|
mpiexec --mca btl_openib_allow_ib 1 --mca btl openib,self,vader --mca opal_warn_on_missing_libcuda 0 --bind-to numa --map-by numa -np "$NODES" --timeout 129600 ./ag_gen -n ../Oct_2021/nm_files/"$CARS"_car_timeline_maintenance.nm -x ../Oct_2021/Sync/4_Exploits/"$NUM_SERV"_Serv/sync_timeline_maintenance.xp -t "$NUM_THREADS" -q 1 -p -a 0.6 -z "$DBNAME" -l 200 -e
|
|
elif [ "$MPI_TYPE" == testing ]; then
|
|
mpiexec --mca btl_openib_allow_ib 1 --mca btl openib,self,vader --mca opal_warn_on_missing_libcuda 0 --bind-to numa --map-by numa -np "$NODES" --timeout 129600 ./ag_gen -n ../esize_test/generic_timeline_maintenance.nm -x ../esize_test/"$ESIZE"/sync_timeline_maintenance.xp -t "$NUM_THREADS" -q 1 -p -a 0.6 -z "$DBNAME" -l 200 -e
|
|
else
|
|
#Serial/OMP
|
|
#4 Exploit Option
|
|
mpiexec --mca btl_openib_allow_ib 1 --mca btl openib,self,vader --mca opal_warn_on_missing_libcuda 0 --bind-to numa --map-by numa -np "$NODES" --timeout 129600 ./ag_gen -n ../Oct_2021/nm_files/"$CARS"_car_timeline_maintenance.nm -x ../Oct_2021/Sync/4_Exploits/"$NUM_SERV"_Serv/sync_timeline_maintenance.xp -t "$NUM_THREADS" -q 1 -p -a 0.6 -z "$DBNAME" -l 200
|
|
fi #END Hammer
|
|
|
|
#Local
|
|
else
|
|
if [ "$MPI_TYPE" == subgraphing ]; then
|
|
#4 Exploit Option
|
|
mpiexec --mca btl_openib_allow_ib 1 --mca opal_warn_on_missing_libcuda 0 --bind-to numa --map-by numa -np "$NODES" --timeout 129600 ./ag_gen -n ../Oct_2021/nm_files/"$CARS"_car_timeline_maintenance.nm -x ../Oct_2021/Sync/4_Exploits/"$NUM_SERV"_Serv/sync_timeline_maintenance.xp -t "$NUM_THREADS" -q 1 -p -a 0.6 -z "$DBNAME" -l 80 -s -f "$BCLHASH"
|
|
elif [ "$MPI_TYPE" == tasking ]; then
|
|
#4 Exploit Option
|
|
mpiexec --mca btl_openib_allow_ib 1 --mca opal_warn_on_missing_libcuda 0 --bind-to numa --map-by numa -np "$NODES" --timeout 129600 ./ag_gen -n ../Oct_2021/nm_files/"$CARS"_car_timeline_maintenance.nm -x ../Oct_2021/Sync/4_Exploits/"$NUM_SERV"_Serv/sync_timeline_maintenance.xp -t "$NUM_THREADS" -q 1 -p -a 0.6 -z "$DBNAME" -l 200 -e
|
|
elif [ "$MPI_TYPE" == testing ]; then
|
|
mpiexec --mca btl_openib_allow_ib 1 --mca opal_warn_on_missing_libcuda 0 --bind-to numa --map-by numa -np "$NODES" --timeout 129600 ./ag_gen -n ../esize_test/generic_timeline_maintenance.nm -x ../esize_test/"$ESIZE"/sync_timeline_maintenance.xp -t "$NUM_THREADS" -q 1 -p -a 0.6 -z "$DBNAME" -l 200
|
|
else
|
|
#Serial/OMP
|
|
#4 Exploit Option
|
|
mpiexec --mca btl_openib_allow_ib 1 --mca opal_warn_on_missing_libcuda 0 --bind-to numa --map-by numa -np "$NODES" --timeout 129600 ./ag_gen -n "$NM" -x "$XP" -t "$NUM_THREADS" -q 1 -p -a 0.6 -z "$DBNAME" -g DOTFILE.dot
|
|
fi #END Non-Hammer
|
|
fi #END Sync
|
|
|
|
|
|
elif [ "$TYPE" == "$strval2" ]; then
|
|
if [ "$(dnsdomainname)" = "hammer.esg.utulsa.edu" ]; then
|
|
if [ "$MPI_TYPE" == subgraphing ]; then
|
|
#4 Exploit Option
|
|
mpiexec --mca btl_openib_allow_ib 1 --mca btl openib,self,vader --mca opal_warn_on_missing_libcuda 0 --bind-to numa --map-by numa -np "$NODES" --timeout 129600 ./ag_gen -n ../Oct_2021/nm_files/"$CARS"_car_timeline_maintenance.nm -x ../Oct_2021/Non_Sync/4_Exploits/"$NUM_SERV"_Serv/generic_timeline_maintenance.xp -t "$NUM_THREADS" -q 1 -p -a 0.6 -z "$DBNAME" -l 200 -s
|
|
elif [ "$MPI_TYPE" == tasking ]; then
|
|
#4 Exploit Option
|
|
mpiexec --mca btl_openib_allow_ib 1 --mca btl openib,self,vader --mca opal_warn_on_missing_libcuda 0 --bind-to numa --map-by numa -np "$NODES" --timeout 129600 ./ag_gen -n ../Oct_2021/nm_files/"$CARS"_car_timeline_maintenance.nm -x ../Oct_2021/Non_Sync/4_Exploits/"$NUM_SERV"_Serv/generic_timeline_maintenance.xp -t "$NUM_THREADS" -q 1 -p -a 0.6 -z "$DBNAME" -l 200 -e
|
|
else
|
|
#OMP/Serial
|
|
#4 Exploit Option
|
|
mpiexec --mca btl_openib_allow_ib 1 --mca btl openib,self,vader --mca opal_warn_on_missing_libcuda 0 --bind-to numa --map-by numa -np "$NODES" --timeout 129600 ./ag_gen -n ../Oct_2021/nm_files/"$CARS"_car_timeline_maintenance.nm -x ../Oct_2021/Non_Sync/4_Exploits/"$NUM_SERV"_Serv/generic_timeline_maintenance.xp -t "$NUM_THREADS" -q 1 -p -a 0.6 -z "$DBNAME" -g DOTFILE.dot
|
|
fi #END Hammer
|
|
|
|
#Local
|
|
else
|
|
if [ "$MPI_TYPE" == subgraphing ]; then
|
|
#4 Exploit Option
|
|
mpiexec --mca btl_openib_allow_ib 1 --mca opal_warn_on_missing_libcuda 0 --bind-to numa --map-by numa -np "$NODES" --timeout 129600 ./ag_gen -n ../Oct_2021/nm_files/"$CARS"_car_timeline_maintenance.nm -x ../Oct_2021/Non_Sync/4_Exploits/"$NUM_SERV"_Serv/generic_timeline_maintenance.xp -t "$NUM_THREADS" -q 1 -p -a 0.6 -z "$DBNAME" -l 200 -s
|
|
elif [ "$MPI_TYPE" == tasking ]; then
|
|
#4 Exploit Option
|
|
mpiexec --mca btl_openib_allow_ib 1 --mca opal_warn_on_missing_libcuda 0 --bind-to numa --map-by numa -np "$NODES" --timeout 129600 ./ag_gen -n ../Oct_2021/nm_files/"$CARS"_car_timeline_maintenance.nm -x ../Oct_2021/Non_Sync/4_Exploits/"$NUM_SERV"_Serv/generic_timeline_maintenance.xp -t "$NUM_THREADS" -q 1 -p -a 0.6 -z "$DBNAME" -l 200 -e
|
|
else
|
|
#OMP/Serial
|
|
#4 Exploit Option
|
|
mpiexec --mca btl_openib_allow_ib 1 --mca opal_warn_on_missing_libcuda 0 --bind-to numa --map-by numa -np "$NODES" --timeout 129600 ./ag_gen -n "$NM" -x "$XP" -t "$NUM_THREADS" -q 1 -p -a 0.6 -z "$DBNAME" -l 200
|
|
fi #END Non-Hammer
|
|
fi #END Non-Sync
|
|
|
|
else
|
|
echo "Running default."
|
|
mpiexec --mca btl_openib_allow_ib 1 --mca btl openib,self,vader --mca opal_warn_on_missing_libcuda 0 --bind-to numa --map-by numa --timeout 129600 ./ag_gen -n ../Oct_2021/nm_files/1_car_timeline_maintenance.nm -x ../Oct_2021/Sync/10_Exploits/1_Serv/sync_timeline_maintenance.xp -t "$NUM_THREADS" -q 1 -p -a 0.6 -z "$DBNAME"
|
|
|
|
fi #END Sync/Non-Sync/Default
|
|
|
|
|
|
#Graphviz Strict graphing to avoid duplicate nodes and edges
|
|
echo -n 'strict ' | cat - DOTFILE.dot > temp && mv temp DOTFILE.dot
|
|
|
|
#dot -Tsvg new.dot > ag.svg
|
|
|
|
dot -Tsvg DOTFILE.dot > ag.svg
|