From 99927d1a2d65eef34ac74b7f0ef699a3582181ed Mon Sep 17 00:00:00 2001 From: edoardolombardi Date: Fri, 6 Nov 2015 10:48:32 +0100 Subject: [PATCH] log function modified --- lib/Class_Log.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/Class_Log.cpp b/lib/Class_Log.cpp index ff86ab52..6ddcfc93 100644 --- a/lib/Class_Log.cpp +++ b/lib/Class_Log.cpp @@ -47,8 +47,11 @@ void Class_Log::writeLog(string msg) { // =================================================================================== // int rank = 0; + #if NOMPI==0 - int error_flag = MPI_Comm_rank(comm,&rank); + bool flag = MPI::Is_finalized(); + if (!(flag)) + int error_flag = MPI_Comm_rank(comm,&rank); #endif if(rank == 0){ // Open the .log file @@ -62,7 +65,7 @@ void Class_Log::writeLog(string msg) { // Close file file_handle.close(); } -#if NOMPI==0 - error_flag = MPI_Barrier(comm); -#endif +//#if NOMPI==0 +// error_flag = MPI_Barrier(comm); +//#endif return; };