Skip to content
Snippets Groups Projects
Commit 3a84c78d authored by Giovanni La Mura's avatar Giovanni La Mura
Browse files

Remove also the c_OCLU_MPIRANK_0 files

parent b1b06a1b
No related branches found
No related tags found
No related merge requests found
...@@ -258,8 +258,12 @@ void cluster(const string& config_file, const string& data_file, const string& o ...@@ -258,8 +258,12 @@ void cluster(const string& config_file, const string& data_file, const string& o
#pragma omp barrier #pragma omp barrier
{ {
// thread 0 already wrote on global files, skip it and take care of appending the others // thread 0 already wrote on global files, skip it and take care of appending the others
for (int ri = 1; ri < ompnumthreads; ri++) { for (int ri = 0; ri < ompnumthreads; ri++) {
// still, we need to remove all c_OCLU_RANK_0 files
string partial_file_name = output_path + "/c_OCLU_" + to_string(mpidata->rank) + "_" + to_string(ri); string partial_file_name = output_path + "/c_OCLU_" + to_string(mpidata->rank) + "_" + to_string(ri);
if (ri == 0) {
remove(partial_file_name.c_str());
} else {
string message = "Copying ASCII output in MPI process " + to_string(mpidata->rank) + " of thread " + to_string(ri) + " of " + to_string(ompnumthreads - 1) + "... "; string message = "Copying ASCII output in MPI process " + to_string(mpidata->rank) + " of thread " + to_string(ri) + " of " + to_string(ompnumthreads - 1) + "... ";
logger->log(message, LOG_DEBG); logger->log(message, LOG_DEBG);
FILE *partial_output = fopen(partial_file_name.c_str(), "r"); FILE *partial_output = fopen(partial_file_name.c_str(), "r");
...@@ -288,6 +292,7 @@ void cluster(const string& config_file, const string& data_file, const string& o ...@@ -288,6 +292,7 @@ void cluster(const string& config_file, const string& data_file, const string& o
logger->log("done.\n", LOG_DEBG); logger->log("done.\n", LOG_DEBG);
} }
} }
}
#endif #endif
// here go the code to append the files written in MPI processes > 0 to the ones on MPI process 0 // here go the code to append the files written in MPI processes > 0 to the ones on MPI process 0
#ifdef MPI_VERSION #ifdef MPI_VERSION
...@@ -453,6 +458,7 @@ void cluster(const string& config_file, const string& data_file, const string& o ...@@ -453,6 +458,7 @@ void cluster(const string& config_file, const string& data_file, const string& o
MPI_Send(&chunk_buffer_size, 1, MPI_INT, 0, 1, MPI_COMM_WORLD); MPI_Send(&chunk_buffer_size, 1, MPI_INT, 0, 1, MPI_COMM_WORLD);
partial_output.close(); partial_output.close();
delete[] chunk_buffer; delete[] chunk_buffer;
remove(partial_file_name.c_str());
partial_file_name = output_path + "/c_TPPOAN_" + to_string(mpidata->rank) + "_" + to_string(ri); partial_file_name = output_path + "/c_TPPOAN_" + to_string(mpidata->rank) + "_" + to_string(ri);
message = "Copying binary output in MPI process " + to_string(mpidata->rank) + " of thread " + to_string(ri) + " of " + to_string(ompnumthreads - 1) + "... "; message = "Copying binary output in MPI process " + to_string(mpidata->rank) + " of thread " + to_string(ri) + " of " + to_string(ompnumthreads - 1) + "... ";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment