Skip to content
Snippets Groups Projects
Commit f7c35cf9 authored by Jean-François Remacle's avatar Jean-François Remacle
Browse files

*** empty log message ***

parent 66cf3da3
No related branches found
No related tags found
No related merge requests found
// $Id: Main.cpp,v 1.5 2001-05-25 11:03:38 geuzaine Exp $ // $Id: Main.cpp,v 1.6 2001-08-08 15:36:09 remacle Exp $
#include <signal.h> #include <signal.h>
#include "ParUtil.h"
#include <signal.h> #include <signal.h>
#if !defined(WIN32) || defined(__CYGWIN__) #if !defined(WIN32) || defined(__CYGWIN__)
...@@ -66,6 +67,8 @@ void Info (int level, char *arg0){ ...@@ -66,6 +67,8 @@ void Info (int level, char *arg0){
int main(int argc, char *argv[]){ int main(int argc, char *argv[]){
int i, nbf; int i, nbf;
ParUtil::Instance()->init(argc,argv);
if(argc < 2) Info(0,argv[0]); if(argc < 2) Info(0,argv[0]);
Init_Options(0); Init_Options(0);
...@@ -90,7 +93,7 @@ int main(int argc, char *argv[]){ ...@@ -90,7 +93,7 @@ int main(int argc, char *argv[]){
OpenProblem(CTX.filename); OpenProblem(CTX.filename);
if(yyerrorstate) if(yyerrorstate)
exit(1); ParUtil::Instance()->Abort();
else{ else{
for(i=1;i<nbf;i++) MergeProblem(TheFileNameTab[i]); for(i=1;i<nbf;i++) MergeProblem(TheFileNameTab[i]);
if(TheBgmFileName){ if(TheBgmFileName){
...@@ -108,7 +111,7 @@ int main(int argc, char *argv[]){ ...@@ -108,7 +111,7 @@ int main(int argc, char *argv[]){
Print_Geo(THEM, CTX.output_filename); Print_Geo(THEM, CTX.output_filename);
if(CTX.mesh.histogram) if(CTX.mesh.histogram)
Print_Histogram(THEM->Histogram[0]); Print_Histogram(THEM->Histogram[0]);
exit(1); ParUtil::Instance()->Exit();
} }
} }
......
# $Id: Makefile,v 1.7 2001-02-17 22:08:53 geuzaine Exp $ # $Id: Makefile,v 1.8 2001-08-08 15:36:09 remacle Exp $
# #
# Makefile for "libBox.a" # Makefile for "libBox.a"
# #
...@@ -11,7 +11,7 @@ RM = rm ...@@ -11,7 +11,7 @@ RM = rm
RANLIB = ranlib RANLIB = ranlib
LIB = ../lib/libBox.a LIB = ../lib/libBox.a
INCLUDE = -I../Common -I../DataStr -I../Geo\ INCLUDE = -I../Common -I../DataStr -I../Geo\
-I../Graphics -I../Mesh -I../Parser -I../Motif -I../Fltk -I../Graphics -I../Mesh -I../Parser -I../Motif -I../Fltk -I../Parallel
C_FLAGS = -g C_FLAGS = -g
OS_FLAGS = OS_FLAGS =
......
...@@ -79,6 +79,15 @@ void ParUtil::Abort() ...@@ -79,6 +79,15 @@ void ParUtil::Abort()
#endif #endif
} }
void ParUtil::Exit()
{
#ifdef PARALLEL
MPI_Finalize();
#else
exit(1);
#endif
}
void ParUtil::Barrier(int line, const char *fn) void ParUtil::Barrier(int line, const char *fn)
{ {
#ifdef PARALLEL #ifdef PARALLEL
......
...@@ -18,6 +18,8 @@ public: ...@@ -18,6 +18,8 @@ public:
/// adds a barrier /// adds a barrier
void Barrier(int, const char*); void Barrier(int, const char*);
/// compute wall time /// compute wall time
void Exit();
/// compute wall time
double wTime () const; double wTime () const;
/// gets the processor name /// gets the processor name
void processorName(char *name) const; void processorName(char *name) const;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment