diff --git a/src/cluster/cluster.cpp b/src/cluster/cluster.cpp index b35fe1d9b996816382e413089321f30548e6880c..06410a2b71fd03a834806a6421f2bfb39ad97025 100644 --- a/src/cluster/cluster.cpp +++ b/src/cluster/cluster.cpp @@ -13,7 +13,7 @@ limitations under the License. */ -/*! \file cluster.cp +/*! \file cluster.cpp * * \brief Implementation of the calculation for a cluster of spheres. */ @@ -388,7 +388,7 @@ void cluster(const string& config_file, const string& data_file, const string& o delete[] chunk_buffer; MPI_Recv(&chunk_buffer_size, 1, MPI_INT, rr, 1, MPI_COMM_WORLD, MPI_STATUS_IGNORE); } - fprintf(output, "\n"); + // if (ri<remotethreads-1) fprintf(output, "\n"); // now get the binary local file long buffer_size = 0; @@ -508,11 +508,11 @@ void cluster(const string& config_file, const string& data_file, const string& o 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); fstream partial_output; - partial_output.open(partial_file_name.c_str(), ios::in | ios::binary); + partial_output.open(partial_file_name.c_str(), ios::in); partial_output.seekg(0, ios::end); const long partial_output_size = partial_output.tellg(); partial_output.close(); - partial_output.open(partial_file_name.c_str(), ios::in | ios::binary); + partial_output.open(partial_file_name.c_str(), ios::in); int chunk_buffer_size = 25165824; // Length of char array with 24Mb size char *chunk_buffer = new char[chunk_buffer_size](); int full_chunks = (int)(partial_output_size / chunk_buffer_size); @@ -535,7 +535,7 @@ void cluster(const string& config_file, const string& data_file, const string& o delete[] chunk_buffer; chunk_buffer = new char[chunk_buffer_size]; partial_output.read(chunk_buffer, chunk_buffer_size); - chunk_buffer[chunk_buffer_size - 1] = '\0'; + // chunk_buffer[chunk_buffer_size - 1] = '\0'; // Send the size of the buffer that is being transmitted (Node-0 does not know whether it is full or not) MPI_Send(&chunk_buffer_size, 1, MPI_INT, 0, 1, MPI_COMM_WORLD); // Actually send the file contents to Node-0 diff --git a/src/scripts/pycompare.py b/src/scripts/pycompare.py index c1e6f639e881c5816ce2a7192b33e75a4fcf025e..193860f0b95245e47976bc1be916374d75e3837d 100755 --- a/src/scripts/pycompare.py +++ b/src/scripts/pycompare.py @@ -125,7 +125,7 @@ def compare_files(config): return mismatch_count f_lines[0] = fortran_file.readline() c_lines[0] = c_file.readline() - if (c_lines[0] != ''): + if (c_lines[0] not in ['', '\n']): print("ERROR: C++ file is longer than FORTRAN file.") fortran_file.close() c_file.close()