Commit 07e90136 authored by maximilianlohoefer's avatar maximilianlohoefer
Browse files

Updates of positions file will now be buffered until after checkpointing of slave 1 is done.


git-svn-id: https://svn.rwth-aachen.de/repos/sw440870_load_leveller/trunk@42 36cca2a8-63f0-4188-8a56-663e3b0d1cf3
parent f775b147
...@@ -95,6 +95,10 @@ void runner_pt :: M_update(int node) ...@@ -95,6 +95,10 @@ void runner_pt :: M_update(int node)
MPI_Recv((char*) &act, task_comm_size, MPI_CHAR, node, T_STATUS, MPI_COMM_WORLD, &stat); MPI_Recv((char*) &act, task_comm_size, MPI_CHAR, node, T_STATUS, MPI_COMM_WORLD, &stat);
pt_node_steps_done[node-1]=act.steps_done; pt_node_steps_done[node-1]=act.steps_done;
pt_node_mes_done[node-1]=act.mes_done; pt_node_mes_done[node-1]=act.mes_done;
#ifdef MCL_POS
if (node == 1)
M_report_pt_positions();
#endif
} }
if (node_status == S_IDLE) { if (node_status == S_IDLE) {
if(time_is_up()) M_send_action(A_EXIT,node); if(time_is_up()) M_send_action(A_EXIT,node);
...@@ -315,15 +319,25 @@ void runner_pt :: M_report_acc_ratio() { ...@@ -315,15 +319,25 @@ void runner_pt :: M_report_acc_ratio() {
afile.close(); afile.close();
} }
void runner_pt::M_report_pt_positions() {
std::ofstream afile(positionsfile.c_str(), std::ios::out | std::ios::app);
afile << pt_position_order.str();
afile.close();
pt_position_order.str("");
}
void runner_pt :: M_global_update() void runner_pt :: M_global_update()
{ {
//(*STATUS) << my_rank << ": start global update"<< "\n"; //(*STATUS) << my_rank << ": start global update"<< "\n";
#ifdef MCL_POS #ifdef MCL_POS
std::ofstream afile(positionsfile.c_str(),std::ios::out|std::ios::app); /* std::ofstream afile(positionsfile.c_str(),std::ios::out|std::ios::app);
for (uint i = 0; i < pt_node_order.size(); ++i) for (uint i = 0; i < pt_node_order.size(); ++i)
afile<< pt_node_order[i] << " "; afile << pt_node_order[i] << " ";
afile << "\n"; afile << "\n";
afile.close(); afile.close();*/
for (uint i = 0; i < pt_node_order.size(); ++i)
pt_position_order << pt_node_order[i] << " ";
pt_position_order << "\n";
#endif #endif
++pt_moves; ++pt_moves;
......
...@@ -54,7 +54,9 @@ class runner_pt ...@@ -54,7 +54,9 @@ class runner_pt
std::vector<int> histogram_up, std::vector<int> histogram_up,
histogram_down; histogram_down;
#endif #endif
#ifdef MCL_POS
std::stringstream pt_position_order;
#endif
std::vector<int> pt_accepted; std::vector<int> pt_accepted;
int pt_moves; int pt_moves;
...@@ -78,6 +80,7 @@ class runner_pt ...@@ -78,6 +80,7 @@ class runner_pt
void M_update(int); void M_update(int);
void M_report(); void M_report();
void M_report_acc_ratio(); void M_report_acc_ratio();
void M_report_pt_positions();
void M_global_update(); void M_global_update();
// slave stuff // slave stuff
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment