BCL Hash size argument

This commit is contained in:
Noah L. Schrick 2022-02-25 00:02:11 -06:00
parent 75048ca849
commit c98fca5012
6 changed files with 5484 additions and 5471 deletions

Binary file not shown.

View File

@ -51,12 +51,21 @@ else
ITFC="wlp2s0"
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
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
@ -72,7 +81,7 @@ if [ "$TYPE" == "$strval1" ]; then
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
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

File diff suppressed because it is too large Load Diff

View File

@ -1038,13 +1038,12 @@ int initQSize, double mem_threshold, mpi::communicator &world)
}
AGGenInstance &AGGen::sg_generate(bool batch_process, int batch_num, int numThrd,\
int initQSize, double mem_threshold, mpi::communicator &world, int state_limit)
int initQSize, double mem_threshold, mpi::communicator &world, int state_limit, int bclhash_size)
{
//Init all Nodes with these variables
std::vector<Exploit> exploit_list = instance.exploits;
//Distributed Hash maps for factbase hashes and explored hashes
//NOTE: At this time, BCL does not support realloc or resizing its containers. This should ideally be changed once support is added.
int bclhash_size = 450;
BCL::HashMap<size_t, int> BCLmap(bclhash_size);
BCL::HashMap<size_t, int> BCLexpl(bclhash_size);

View File

@ -96,7 +96,7 @@ class AGGen {
#endif
AGGenInstance &sg_generate(bool batch_process, int batch_num, int numThrd,\
int initQSize, double mem_threshold, boost::mpi::communicator &world, int state_limit);
int initQSize, double mem_threshold, boost::mpi::communicator &world, int state_limit, int bclhash_size);
AGGenInstance &tasking_generate(bool batch_process, int batch_num, int numThrd,\
int initQSize, double mem_threshold, boost::mpi::communicator &world);

View File

@ -414,6 +414,7 @@ void print_usage() {
std::cout << "\t-a\tDecimal value for specifiying maximum amount of system memory to use" << std::endl;
std::cout << "\t-m\tNumber of MPI Nodes to use" << std::endl;
std::cout << "\t-z\tDatabase name for overriding config.ini file" << std::endl;
std::cout << "\t-f\tBCL Hash Size" << std::endl;
}
inline bool file_exists(const std::string &name) {
@ -458,6 +459,7 @@ int main(int argc, char *argv[]) {
int init_qsize;
int mpi_nodes;
int depth_limit;
int bclhash_size;
bool should_graph = false;
bool no_cycles = false;
@ -470,7 +472,7 @@ int main(int argc, char *argv[]) {
double alpha = 0.5;
int opt;
while ((opt = getopt(argc, argv, "rb:g:dhc:l:n:x:t:q:pa:sem:z:")) != -1) {
while ((opt = getopt(argc, argv, "rb:g:dhc:l:n:x:t:q:pa:f:sem:z:")) != -1) {
switch (opt) {
case 'g':
should_graph = true;
@ -514,6 +516,9 @@ int main(int argc, char *argv[]) {
//Save a 10% buffer for PSQL ops
alpha = atof(optarg) - 0.1;
break;
case 'f':
bclhash_size = atoi(optarg);
break;
case 's':
mpi_subgraphing = true;
break;
@ -709,7 +714,7 @@ int main(int argc, char *argv[]) {
AGGen gen(_instance);//use AGGen class to instantiate an obj with the name gen! _instance obj as the parameter! constructor defined in ag_gen.cpp
if (mpi_subgraphing)
postinstance = gen.sg_generate(batch_process, batch_size, thread_count, init_qsize, alpha, world, depth_limit); //The method call to generate the attack graph, defined in ag_gen.cpp.
postinstance = gen.sg_generate(batch_process, batch_size, thread_count, init_qsize, alpha, world, depth_limit, bclhash_size); //The method call to generate the attack graph, defined in ag_gen.cpp.
else if (mpi_tasking)
postinstance = gen.tasking_generate(batch_process, batch_size, thread_count, init_qsize, alpha, world); //The method call to generate the attack graph, defined in ag_gen.cpp.
else