Loading src/cluster/cluster.cpp +8 −1 Original line number Diff line number Diff line Loading @@ -361,10 +361,13 @@ void cluster(string config_file, string data_file, string output_path) { #ifdef _OPENMP myompthread = omp_get_thread_num(); if (myompthread == 0) ompnumthreads = omp_get_num_threads(); #endif FILE *output_2 = fopen((output_path + "/c_OCLU_" + to_string(myompthread)).c_str(), "w"); fstream tppoan_2; tppoan_2.open((output_path + "/c_TPPOAN_" + to_string(myompthread)).c_str(), ios::out | ios::binary); #else FILE *output_2 = output; fstream &tppoan_2 = tppoan; #endif double *gaps_2 = new double[nsph](); double **tqse_2 = new double*[2]; double **tqce_2 = new double*[2]; Loading Loading @@ -533,8 +536,10 @@ void cluster(string config_file, string data_file, string output_path) { delete c4_2; delete c6_2; delete c9_2; #ifdef _OPENMP fclose(output_2); tppoan_2.close(); #endif delete[] gaps_2; for (int ti = 0; ti <2 -1; ti++) { delete[] tqse_2[ti]; Loading Loading @@ -604,6 +609,7 @@ void cluster(string config_file, string data_file, string output_path) { delete[] am_2; } // jxi488 loop #ifdef _OPENMP for (int ri = 0; ri < ompnumthreads; ri++) { // Giovanni, please add here in this loop code to reopen the temporary files, reread them and append them respectively to the global output and tppoan, before closing them string partial_file_name = output_path + "/c_OCLU_" + to_string(ri); Loading @@ -630,6 +636,7 @@ void cluster(string config_file, string data_file, string output_path) { remove(partial_file_name.c_str()); printf("done.\n"); } #endif tppoan.close(); } else { // In case TPPOAN could not be opened. Should never happen. printf("\nERROR: failed to open TPPOAN file.\n"); Loading Loading
src/cluster/cluster.cpp +8 −1 Original line number Diff line number Diff line Loading @@ -361,10 +361,13 @@ void cluster(string config_file, string data_file, string output_path) { #ifdef _OPENMP myompthread = omp_get_thread_num(); if (myompthread == 0) ompnumthreads = omp_get_num_threads(); #endif FILE *output_2 = fopen((output_path + "/c_OCLU_" + to_string(myompthread)).c_str(), "w"); fstream tppoan_2; tppoan_2.open((output_path + "/c_TPPOAN_" + to_string(myompthread)).c_str(), ios::out | ios::binary); #else FILE *output_2 = output; fstream &tppoan_2 = tppoan; #endif double *gaps_2 = new double[nsph](); double **tqse_2 = new double*[2]; double **tqce_2 = new double*[2]; Loading Loading @@ -533,8 +536,10 @@ void cluster(string config_file, string data_file, string output_path) { delete c4_2; delete c6_2; delete c9_2; #ifdef _OPENMP fclose(output_2); tppoan_2.close(); #endif delete[] gaps_2; for (int ti = 0; ti <2 -1; ti++) { delete[] tqse_2[ti]; Loading Loading @@ -604,6 +609,7 @@ void cluster(string config_file, string data_file, string output_path) { delete[] am_2; } // jxi488 loop #ifdef _OPENMP for (int ri = 0; ri < ompnumthreads; ri++) { // Giovanni, please add here in this loop code to reopen the temporary files, reread them and append them respectively to the global output and tppoan, before closing them string partial_file_name = output_path + "/c_OCLU_" + to_string(ri); Loading @@ -630,6 +636,7 @@ void cluster(string config_file, string data_file, string output_path) { remove(partial_file_name.c_str()); printf("done.\n"); } #endif tppoan.close(); } else { // In case TPPOAN could not be opened. Should never happen. printf("\nERROR: failed to open TPPOAN file.\n"); Loading