From 6650faaaf314959709ad917e200f9f31db3cef67 Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Wed, 13 Jun 2012 11:37:13 +0000 Subject: [PATCH] batchmode fixes --- ng/ngappinit.cpp | 8 -------- ng/ngpkg.cpp | 7 +++++-- ng/parallelfunc.cpp | 24 +++--------------------- 3 files changed, 8 insertions(+), 31 deletions(-) diff --git a/ng/ngappinit.cpp b/ng/ngappinit.cpp index d6412ef5..bf0470fc 100644 --- a/ng/ngappinit.cpp +++ b/ng/ngappinit.cpp @@ -163,9 +163,6 @@ int main(int argc, char ** argv) if(parameters.GetDefineFlag("batchmode")) nodisplay = true; - if(parameters.GetDefineFlag("solve")) - nodisplay = true; - if(parameters.GetDefineFlag("shellmode")) @@ -281,12 +278,7 @@ int main(int argc, char ** argv) // start event-loop Tk_MainLoop(); - Tcl_DeleteInterp (myinterp); - -#ifdef PARALLEL - MPI_Finalize(); -#endif Tcl_Exit(0); } diff --git a/ng/ngpkg.cpp b/ng/ngpkg.cpp index 8875b962..f7b2eb98 100644 --- a/ng/ngpkg.cpp +++ b/ng/ngpkg.cpp @@ -2975,6 +2975,7 @@ void PlayAnimFile(const char* name, int speed, int maxcnt) Tcl_Interp * interp, int argc, tcl_const char *argv[]) { + /* #ifdef PARALLEL int id, rc, ntasks; MPI_Comm_size(MPI_COMM_WORLD, &ntasks); @@ -2982,7 +2983,7 @@ void PlayAnimFile(const char* name, int speed, int maxcnt) if ( id != 0 ) return TCL_OK; #endif - + */ /* if (ngsolve_handle) @@ -3018,7 +3019,9 @@ void PlayAnimFile(const char* name, int speed, int maxcnt) #endif #ifdef PARALLEL - MyMPI_SendCmd ("end"); + if (id == 0) MyMPI_SendCmd ("end"); + cout << "finalize, id = " << id << endl; + MPI_Finalize(); #endif mesh.Reset (NULL); diff --git a/ng/parallelfunc.cpp b/ng/parallelfunc.cpp index d0ea2519..b10f3e4e 100644 --- a/ng/parallelfunc.cpp +++ b/ng/parallelfunc.cpp @@ -80,14 +80,6 @@ using netgen::RegisterUserFormats; -#ifdef PARALLEL -void Ng_Exit () -{ - // Parallel_Exit(); -} -#endif - - void ParallelRun() { @@ -98,12 +90,10 @@ void ParallelRun() MPI_Comm_size(MPI_COMM_WORLD, &ntasks); MPI_Comm_rank(MPI_COMM_WORLD, &id); - bool test = true; - // testout = new ostream(0); testout = new ofstream (string("testout_proc") + id ); - while ( test ) + while ( true ) { #ifdef SCALASCA #pragma pomp inst begin (message) @@ -336,26 +326,18 @@ void ParallelRun() - - - else if ( message == "end" ) { - test = false; - Ng_Exit(); + break; } - else { PrintMessage ( 1, "received unidentified message '" + message + "'\n"); - - test = false; + break; } } - - return; }