Just ignore all of these lol
This commit is contained in:
parent
409aa3659d
commit
7013ef8e2c
BIN
build/ag_gen
BIN
build/ag_gen
Binary file not shown.
@ -460,6 +460,18 @@ AGGenInstance &AGGen::generate(bool batch_process, int batch_size, int numThrd,
|
|||||||
ttwo_comm, ex_groups, hash_map);
|
ttwo_comm, ex_groups, hash_map);
|
||||||
std::cout << "Finished Task 2 as Node: " << world.rank() << std::endl;
|
std::cout << "Finished Task 2 as Node: " << world.rank() << std::endl;
|
||||||
//Wait for all Task 2 nodes to finish
|
//Wait for all Task 2 nodes to finish
|
||||||
|
|
||||||
|
while(ttwo_comm.iprobe(mpi::any_source, 3) || ttwo_comm.iprobe(mpi::any_source, 4)){
|
||||||
|
NetworkState new_state;
|
||||||
|
Quality fact;
|
||||||
|
|
||||||
|
ttwo_comm.irecv(mpi::any_source, 3, fact);
|
||||||
|
ttwo_comm.irecv(mpi::any_source, 4, new_state);
|
||||||
|
|
||||||
|
instance.facts.hash_table[new_state.compound_assign(fact)]=instance.facts.size();
|
||||||
|
instance.facts.length++;
|
||||||
|
instance.facts.str_vector.push_back(new_state.compound_assign(fact));
|
||||||
|
}
|
||||||
ttwo_comm.barrier();
|
ttwo_comm.barrier();
|
||||||
gettimeofday(&t22,NULL);
|
gettimeofday(&t22,NULL);
|
||||||
total_task2+=(t22.tv_sec-t21.tv_sec)*1000.0+(t22.tv_usec-t21.tv_usec)/1000.0;
|
total_task2+=(t22.tv_sec-t21.tv_sec)*1000.0+(t22.tv_usec-t21.tv_usec)/1000.0;
|
||||||
|
|||||||
@ -571,7 +571,7 @@ int main(int argc, char *argv[]) {
|
|||||||
gettimeofday(&tf2,NULL);
|
gettimeofday(&tf2,NULL);
|
||||||
double tdiff2=(tf2.tv_sec-ts1.tv_sec)*1000.0+(tf2.tv_usec-ts1.tv_usec)/1000.0;
|
double tdiff2=(tf2.tv_sec-ts1.tv_sec)*1000.0+(tf2.tv_usec-ts1.tv_usec)/1000.0;
|
||||||
std::cout<< "Node " << world.rank() << " finished db connection\n" << std::endl;
|
std::cout<< "Node " << world.rank() << " finished db connection\n" << std::endl;
|
||||||
std::cout << "Initialization and Connecting to DB took " << tdiff2 << " for Process " << world.rank() << std::endl;
|
std::cout << "Initialization and Connecting to DB took " << tdiff2 << " ms for Process " << world.rank() << std::endl;
|
||||||
//printf("Initialization and Connecting to DB took %lf ms for this process. \n",tdiff2);
|
//printf("Initialization and Connecting to DB took %lf ms for this process. \n",tdiff2);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -166,6 +166,7 @@ void task_two(AGGenInstance &instance, int alloc, int two_alloc, boost::mpi::com
|
|||||||
world.recv(mpi::any_source, 40, current_state);
|
world.recv(mpi::any_source, 40, current_state);
|
||||||
|
|
||||||
std::cout << "Process " << world.rank() << " received Task 1 data." << std::endl;
|
std::cout << "Process " << world.rank() << " received Task 1 data." << std::endl;
|
||||||
|
std::cout << "Appl exploit size " << appl_exploits.size() << std::endl;
|
||||||
|
|
||||||
std::vector<std::tuple<Exploit, AssetGroup>> partial_appl_exploits;
|
std::vector<std::tuple<Exploit, AssetGroup>> partial_appl_exploits;
|
||||||
if(ttwo_comm.size() > 1)
|
if(ttwo_comm.size() > 1)
|
||||||
@ -247,7 +248,7 @@ void task_two(AGGenInstance &instance, int alloc, int two_alloc, boost::mpi::com
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
std::cout << "Sync exploit size " << sync_exploits.size() << std::endl;
|
||||||
for(auto sync_itr=sync_exploits.begin(); sync_itr!=sync_exploits.end(); sync_itr++){
|
for(auto sync_itr=sync_exploits.begin(); sync_itr!=sync_exploits.end(); sync_itr++){
|
||||||
e = *sync_itr;
|
e = *sync_itr;
|
||||||
exploit = std::get<0>(e);
|
exploit = std::get<0>(e);
|
||||||
@ -284,12 +285,21 @@ void task_two(AGGenInstance &instance, int alloc, int two_alloc, boost::mpi::com
|
|||||||
instance.facts.str_vector.push_back(new_state.compound_assign(fact));
|
instance.facts.str_vector.push_back(new_state.compound_assign(fact));
|
||||||
for (int w = 0; w < world.size(); w++)
|
for (int w = 0; w < world.size(); w++)
|
||||||
{
|
{
|
||||||
if(w != 1 + alloc && w > two_alloc)
|
if(w < 1 + alloc && w > two_alloc)
|
||||||
{
|
{
|
||||||
world.isend(w, 3, new_state);
|
world.isend(w, 3, new_state);
|
||||||
world.isend(w, 4, fact);
|
world.isend(w, 4, fact);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//Update ttwo_comm Nodes
|
||||||
|
if (ttwo_comm.size() > 1){
|
||||||
|
for (int t = 0; t < ttwo_comm.size(); t++){
|
||||||
|
if (t != ttwo_comm.rank()){
|
||||||
|
ttwo_comm.isend(t, 3, new_state);
|
||||||
|
ttwo_comm.isend(t, 4, fact);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user