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

*** empty log message ***

parent cac543a4
No related branches found
No related tags found
No related merge requests found
# $Id: Makefile,v 1.124 2001-08-08 14:05:26 remacle Exp $ # $Id: Makefile,v 1.125 2001-08-08 14:30:33 remacle Exp $
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# Makefile for Gmsh # Makefile for Gmsh
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
...@@ -53,10 +53,10 @@ FLTK_LIB_SOLARIS_SCOREC = /users/develop/develop/visual/fltk/1.0/lib/sun4_5/libf ...@@ -53,10 +53,10 @@ FLTK_LIB_SOLARIS_SCOREC = /users/develop/develop/visual/fltk/1.0/lib/sun4_5/libf
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
GMSH_DIR = Adapt Common DataStr Geo Graphics Mesh Parser\ GMSH_DIR = Adapt Common DataStr Geo Graphics Mesh Parser\
Motif Fltk Plugin jpeg utils Motif Fltk Plugin jpeg utils Parallel
GMSH_XMOTIF_DIR = Adapt Common DataStr Geo Graphics Mesh Parser Motif jpeg GMSH_XMOTIF_DIR = Adapt Common DataStr Geo Graphics Mesh Parser Motif jpeg Parallel
GMSH_FLTK_DIR = Adapt Common DataStr Geo Graphics Mesh Parser Fltk jpeg Plugin GMSH_FLTK_DIR = Adapt Common DataStr Geo Graphics Mesh Parser Fltk jpeg Plugin Parallel
GMSH_BOX_DIR = Adapt Box Common DataStr Geo Mesh Parser Plugin GMSH_BOX_DIR = Adapt Box Common DataStr Geo Mesh Parser Plugin Parallel
GMSH_BIN_DIR = bin GMSH_BIN_DIR = bin
GMSH_LIB_DIR = lib GMSH_LIB_DIR = lib
GMSH_DOC_DIR = doc GMSH_DOC_DIR = doc
...@@ -274,6 +274,18 @@ bb: tag ...@@ -274,6 +274,18 @@ bb: tag
); done ); done
$(CC) -o $(GMSH_BIN_DIR)/gmsh-bb $(GMSH_BOX_LIB) -lm $(CC) -o $(GMSH_BIN_DIR)/gmsh-bb $(GMSH_BOX_LIB) -lm
bb-parallel: tag
PARALLEL=1
@for i in $(GMSH_BOX_DIR); do (cd $$i && $(MAKE) \
"CC=mpiCC" \
"C_FLAGS=-O3" \
"OS_FLAGS=" \
"VERSION_FLAGS=-D_BLACKBOX -DPARALLEL" \
"GL_INCLUDE=" \
"GUI_INCLUDE=" \
); done
mpiCC -o $(GMSH_BIN_DIR)/gmsh-bb $(GMSH_BOX_LIB) -lm
bbn: tag bbn: tag
@for i in $(GMSH_BOX_DIR) ; do (cd $$i && $(MAKE) \ @for i in $(GMSH_BOX_DIR) ; do (cd $$i && $(MAKE) \
"CC=g++ -mno-cygwin -I/mingw/include" \ "CC=g++ -mno-cygwin -I/mingw/include" \
......
# $Id: Makefile,v 1.1 2001-08-08 14:06:07 remacle Exp $ # $Id: Makefile,v 1.2 2001-08-08 14:30:33 remacle Exp $
# #
# Makefile for "libBox.a" # Makefile for "libBox.a"
# #
.IGNORE: .IGNORE:
ifeq ($(PARALLEL),1)
CC = mpiCC
else
CC = c++
endif
AR = ar ruvs AR = ar ruvs
RM = rm RM = rm
RANLIB = ranlib RANLIB = ranlib
LIB = ../lib/libParallel.a LIB = ../lib/libParallel.a
INCLUDE = INCLUDE := $(INCLUDE) -I/usr/local/mpich/latest/include/
C_FLAGS = -g C_FLAGS = -g
OS_FLAGS = OS_FLAGS =
...@@ -32,7 +27,7 @@ $(LIB): $(OBJ) ...@@ -32,7 +27,7 @@ $(LIB): $(OBJ)
$(AR) $(LIB) $(OBJ) $(AR) $(LIB) $(OBJ)
$(RANLIB) $(LIB) $(RANLIB) $(LIB)
.cpp.o: .cc.o:
$(CC) $(CFLAGS) -c $< $(CC) $(CFLAGS) -c $<
clean: clean:
......
#include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <string.h> #include <string.h>
#ifdef SUN4
#include <sys/varargs.h>
#else
#include <stdarg.h>
#endif
#include "ParUtil.h" #include "ParUtil.h"
#ifdef PARALLEL #ifdef PARALLEL
#include "autopack.h" #include "mpi.h"
#else #else
#include <sys/time.h> #include <sys/time.h>
#endif #endif
...@@ -40,17 +35,10 @@ void ParUtil::init(int &argc, char **&argv) { ...@@ -40,17 +35,10 @@ void ParUtil::init(int &argc, char **&argv) {
MPI_Comm_rank(MPI_COMM_WORLD, &myrank); MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
MPI_Comm_size(MPI_COMM_WORLD, &mysize); MPI_Comm_size(MPI_COMM_WORLD, &mysize);
MPI_Comm_dup(MPI_COMM_WORLD, &seq_local_comm);
MPI_Errhandler_set(MPI_COMM_WORLD,MPI_ERRORS_RETURN); MPI_Errhandler_set(MPI_COMM_WORLD,MPI_ERRORS_RETURN);
AP_init(&argc, &argv);
AP_setparam(10*4096, 1, 1024, -1);
MPI_Get_processor_name(name,&namelen); MPI_Get_processor_name(name,&namelen);
procName = new char[namelen+1]; procName = new char[namelen+1];
strcpy(procName,name); strcpy(procName,name);
char logname[256];
sprintf(logname,"log-proc%d-%s.dat",myrank,procName);
log = fopen (logname,"w");
vl = 1;
#endif #endif
} }
...@@ -82,55 +70,6 @@ void ParUtil::processorName(char *name) const ...@@ -82,55 +70,6 @@ void ParUtil::processorName(char *name) const
#endif #endif
} }
void ParUtil:: Msg(ParUtil::MessageLevel level, char *fmt, ...)
{
char buff[1024];
va_list args;
va_start (args, fmt);
vsprintf(buff, fmt, args);
va_end (args);
switch(level)
{
case DEBUG1:
if(vl > 1)
{
fprintf(log,"%s",buff);
fflush(log);
}
break;
case DEBUG2:
if(vl > 2)
{
fprintf(log,"%s",buff);
fflush(log);
}
break;
case INFO:
if(vl >= 0 && master())
{
// fprintf(log,"%s",buff);
fprintf(stdout,"%s",buff);
// fflush(log);
}
if(vl > 2)
{
// fprintf(log,"%s",buff);
// fflush(log);
}
break;
case WARNING:
fprintf(stdout,"Processor %d AOMD WARNING : %s",rank(),buff);
fflush(stdout);
break;
case ERROR:
fprintf(stdout,"AOMD FATAL ERROR : %s",buff);
fflush(stdout);
Abort();
break;
}
}
void ParUtil::Abort() void ParUtil::Abort()
{ {
#ifdef PARALLEL #ifdef PARALLEL
...@@ -143,10 +82,9 @@ void ParUtil::Abort() ...@@ -143,10 +82,9 @@ void ParUtil::Abort()
void ParUtil::Barrier(int line, const char *fn) void ParUtil::Barrier(int line, const char *fn)
{ {
#ifdef PARALLEL #ifdef PARALLEL
Msg(DEBUG2,"BARRIER : Line %d in %s\n",line,fn);
MPI_Barrier(MPI_COMM_WORLD); MPI_Barrier(MPI_COMM_WORLD);
Msg(DEBUG2,"BARRIER PASSED : Line %d in %s\n",line,fn);
#endif #endif
} }
ParUtil* ParUtil::instance = 0; ParUtil* ParUtil::instance = 0;
...@@ -2,10 +2,6 @@ ...@@ -2,10 +2,6 @@
#define _H_ParUtil #define _H_ParUtil
#include <stdio.h> #include <stdio.h>
#ifdef PARALLEL
#include "mpi.h"
#endif
/** /**
ParUtil is a Singleton. It gives some ParUtil is a Singleton. It gives some
general services for parallel implementation. general services for parallel implementation.
...@@ -15,8 +11,6 @@ class ParUtil { ...@@ -15,8 +11,6 @@ class ParUtil {
ParUtil(); ParUtil();
~ParUtil(); ~ParUtil();
public: public:
/// Message severity level
typedef enum MessageLevel {DEBUG1,DEBUG2,INFO,WARNING,ERROR};
/// returne the only instance /// returne the only instance
static ParUtil* Instance(); static ParUtil* Instance();
/// initialization, needed for mpi and autopack /// initialization, needed for mpi and autopack
...@@ -27,10 +21,6 @@ public: ...@@ -27,10 +21,6 @@ public:
double wTime () const; double wTime () const;
/// gets the processor name /// gets the processor name
void processorName(char *name) const; void processorName(char *name) const;
/// set the verbosity level (0,1,2,3)
inline void setVertbosityLevel(int i){vl = i;}
/// prints a message, same format as printf
void Msg(MessageLevel lev, char *fmt, ...);
/// abort a calculation /// abort a calculation
void Abort(); void Abort();
#ifdef PARALLEL #ifdef PARALLEL
...@@ -47,14 +37,10 @@ public: ...@@ -47,14 +37,10 @@ public:
#endif #endif
private: private:
static ParUtil *instance; static ParUtil *instance;
FILE *log;
int vl;
int procSpeed;
char *procName; char *procName;
#ifdef PARALLEL #ifdef PARALLEL
int myrank; int myrank;
int mysize; int mysize;
MPI_Comm seq_local_comm;
#endif #endif
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment