Commit 3a84c78d authored by Giovanni La Mura's avatar Giovanni La Mura
Browse files

Remove also the c_OCLU_MPIRANK_0 files

parent b1b06a1b
Loading
Loading
Loading
Loading
+32 −26
Original line number Diff line number Diff line
@@ -258,8 +258,12 @@ void cluster(const string& config_file, const string& data_file, const string& o
#pragma omp barrier
	{
	  // 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);
	    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) + "... ";
	      logger->log(message, LOG_DEBG);
	      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
	      logger->log("done.\n", LOG_DEBG);
	    }
	  }
	}
#endif
	// here go the code to append the files written in MPI processes > 0 to the ones on MPI process 0
#ifdef MPI_VERSION
@@ -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);
	partial_output.close();
	delete[] chunk_buffer;
	remove(partial_file_name.c_str());

	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) + "... ";