Adding message when SVG is being created.

This commit is contained in:
Noah L. Schrick 2022-07-15 18:52:13 -05:00
parent 146ea8a0c3
commit f588cf33e7
5 changed files with 4818 additions and 0 deletions

View File

@ -143,7 +143,9 @@ fi #END Hammer/Non-Hammer
#Graphviz Strict graphing to avoid duplicate nodes and edges
if [ "$CREATE_SVG" = "true" ]; then
echo "Creating SVG..."
echo -n 'strict ' | cat - DOTFILE.dot > temp && mv temp DOTFILE.dot
#dot -Tsvg new.dot > ag.svg
dot -Tsvg DOTFILE.dot > ag.svg
echo "Done."
fi

View File

@ -0,0 +1,34 @@
network model =
assets:
# Cars
car1;
car2;
facts:
quality:car1,brake_months=0;
quality:car1,exhaust_months=0;
quality:car1,ac_odometer=0;
quality:car1,vacuum_odometer=0;
quality:car1,engine=gas;
quality:car1,brake_vio=false;
quality:car1,exhaust_vio=false;
quality:car1,ac_vio=false;
quality:car1,vacuum_vio=false;
quality:car1,compliance_vio=false;
quality:car1,TIME_ADVANCE_STEP=0;
quality:car2,brake_months=0;
quality:car2,exhaust_months=0;
quality:car2,ac_odometer=0;
quality:car2,vacuum_odometer=0;
quality:car2,engine=diesel;
quality:car2,brake_vio=false;
quality:car2,exhaust_vio=false;
quality:car2,ac_vio=false;
quality:car2,vacuum_vio=false;
quality:car2,compliance_vio=false;
quality:car2,TIME_ADVANCE_STEP=0;
topology:car1<->car2,road;
tags:
.

View File

@ -0,0 +1,68 @@
exploit brake_pads(a)=
preconditions:
quality:a,brake_months>=6;
quality:a,brake_vio=false;
postconditions:
update quality:a,brake_vio=true;
update quality:a,compliance_vio=true;
update quality:a,TIME_ADVANCE_FLAG=0;
.
exploit exhaust_pipes(a)=
preconditions:
quality:a,exhaust_months>=12;
quality:a,exhaust_vio=false;
postconditions:
update quality:a,compliance_vio=true;
update quality:a,exhaust_vio=true;
update quality:a,TIME_ADVANCE_FLAG=0;
.
exploit ac_filter(a)=
preconditions:
quality:a,ac_odometer>=120000;
quality:a,ac_vio=false;
postconditions:
insert quality:a,is_critical=true;
update quality:a,compliance_vio=true;
update quality:a,TIME_ADVANCE_FLAG=0;
update quality:a,ac_vio=true;
.
exploit vacuum_pump(a)=
preconditions:
quality:a,vacuum_odometer>=120000;
quality:a,engine=diesel;
quality:a,vacuum_vio=false;
postconditions:
insert quality:a,is_critical=true;
update quality:a,compliance_vio=true;
update quality:a,TIME_ADVANCE_FLAG=0;
update quality:a,vacuum_vio=true;
.
exploit brake_service(a)=
preconditions:
quality:a,brake_months=1;
postconditions:
update quality:a,brake_vio=false;
update quality:a,brake_months=0;
.
exploit time_advance_0(a)=
preconditions:
quality:a,brake_months=0;
quality:a,exhaust_months=0;
quality:a,ac_odometer=0;
quality:a,vacuum_odometer=0;
quality:a,brake_vio=false;
quality:a,exhaust_vio=false;
quality:a,ac_vio=false;
quality:a,vacuum_vio=false;
postconditions:
update quality:a,brake_months=1;
update quality:a,TIME_ADVANCE_FLAG=1;
update quality:a,TIME_ADVANCE_STEP+=1;
.

151
generic_project_folder/run.sh Executable file
View File

@ -0,0 +1,151 @@
#!/usr/bin/env bash
#Optional Arguments for running batches of tests.
# These are meant to be specified by command line, but the :-{VAL} specifies the default to use.
# Can change the default here as desired. Ex: Changing to 2 Services would be: NUM_SERV=${1:-2}
NUM_SERV=${1:-1}
TYPE=${2:-sync} # sync or non-sync. Use sync unless you are specifically testing non-sync.
CARS=${3:-2} # used for network model scripting. Can ignore.
DBNAME=${4:-ag} # name of database table. can leave as default or change to whatever you prefer
NUM_THREADS=${5:-1} # number of OMP threads to use
NODES=${6:-1} # number of MPI nodes to use (for tasking or subgraphing)
MPI_TYPE=${7-serial} # tasking or subgraphing. Put serial or OMP if you do not wish to use MPI.
ESIZE=${8:-6} # exploit file scripting. Can ignore.
# Avoid multiple users fighting over same database if default name is used (hacky solution)
DBNAME="$DBNAME$USER"
### AG Gen Network Model and Exploit File settings - adjust as desired.
NM="generic_timeline_maintenance.nm"
XP="generic_timeline_maintenance.xp"
SYNC_XP="generic_timeline_maintenance.xp"
### MPI Parameters - adjust as desired.
MPI_PARAMS="mpiexec --mca btl_openib_allow_ib 1 --mca opal_warn_on_missing_libcuda 0 -np ${NODES} --timeout 129600"
# Common Hammer parameters
MPI_HAMMER_PARAMS="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 Parameters. Please run the AG generator with the '-h' parameter to see all options. Adjust as desired.
AG_PARAMS="-t ${NUM_THREADS} -q 1 -p -a 0.6 -z ${DBNAME}"
AG_SUBG_PARAMS="-t ${NUM_THREADS} -q 1 -p -a 0.6 -z ${DBNAME} -l 200 -s"
AG_TASK_PARAMS="-t ${NUM_THREADS} -q 1 -p -a 0.6 -z ${DBNAME} -e"
# Do you want to create an SVG from the DOTFILE? Uncomment/comment to select
CREATE_SVG="true"
#CREATE_SVG="false"
# If using MPI Subgraphing, do you want to use a DHT? Uncomment to select, and please adjust the BCL Hash Size
#DHT="true"
DHT="false"
BCLHASH=2300
### Running
# Var concats
if [ "$DHT" == "true" ]; then
AG_SUBG_PARAMS+=" -uf "
AG_SUBG_PARAMS+=${BCLHASH}
fi
if [ "$CREATE_SVG" == "true" ]; then
AG_PARAMS+=" -g DOTFILE.dot"
AG_SUBG_PARAMS+=" -g DOTFILE.dot"
AG_TASK_PARAMS+=" -g DOTFILE.dot"
fi
if [ "$TYPE" == "sync" ]; then
XP="$SYNC_XP"
fi
## Database Work
#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" < ../build/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" < ../build/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" < ../build/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" < ../build/schema.sql
fi
fi
## Running the scripts
# NOTE: Do not use 'bash -c' or 'eval' unless you fully understand shell parsing. We are building an array
# of arguments dynamically to avoid wordsplitting and wildcard expansions
CMD=()
if [ "$(dnsdomainname)" = "hammer.esg.utulsa.edu" ]; then
CMD+=$MPI_HAMMER_PARAMS
CMD+=" ../build/ag_gen -n "
CMD+=${NM}
CMD+=" -x "
CMD+=${XP}
CMD+=" "
if [ "$MPI_TYPE" == subgraphing ]; then
CMD+=${AG_SUBG_PARAMS}
${CMD}
elif [ "$MPI_TYPE" == tasking ]; then
CMD+=${AG_TASK_PARAMS}
${CMD}
elif [ "$MPI_TYPE" == testing ]; then
CMD+=${AG_PARAMS}
${CMD}
else
CMD+=${AG_PARAMS}
${CMD}
#Serial/OMP
fi #Subg/Task/Serial/OMP
#Local
else
CMD+=${MPI_PARAMS}
CMD+=" ../build/ag_gen -n "
CMD+=${NM}
CMD+=" -x "
CMD+=${XP}
CMD+=" "
if [ "$MPI_TYPE" == subgraphing ]; then
CMD+=${AG_SUBG_PARAMS}
${CMD}
elif [ "$MPI_TYPE" == tasking ]; then
CMD+=${AG_TASK_PARAMS}
${CMD}
elif [ "$MPI_TYPE" == testing ]; then
CMD+=${AG_PARAMS}
${CMD}
else
#Serial/OMP
CMD+=${AG_PARAMS}
${CMD}
fi
fi #END Hammer/Non-Hammer
#Graphviz Strict graphing to avoid duplicate nodes and edges
if [ "$CREATE_SVG" = "true" ]; then
echo "Creating SVG..."
echo -n 'strict ' | cat - DOTFILE.dot > temp && mv temp DOTFILE.dot
#dot -Tsvg new.dot > ag.svg
dot -Tsvg DOTFILE.dot > ag.svg
echo "Done."
fi

File diff suppressed because it is too large Load Diff