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
Branches
Tags
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
# ----------------------------------------------------------------------
......@@ -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\
Motif Fltk Plugin jpeg utils
GMSH_XMOTIF_DIR = Adapt Common DataStr Geo Graphics Mesh Parser Motif jpeg
GMSH_FLTK_DIR = Adapt Common DataStr Geo Graphics Mesh Parser Fltk jpeg Plugin
GMSH_BOX_DIR = Adapt Box Common DataStr Geo Mesh Parser Plugin
Motif Fltk Plugin jpeg utils Parallel
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 Parallel
GMSH_BOX_DIR = Adapt Box Common DataStr Geo Mesh Parser Plugin Parallel
GMSH_BIN_DIR = bin
GMSH_LIB_DIR = lib
GMSH_DOC_DIR = doc
......@@ -274,6 +274,18 @@ bb: tag
); done
$(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
@for i in $(GMSH_BOX_DIR) ; do (cd $$i && $(MAKE) \
"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"
#
.IGNORE:
ifeq ($(PARALLEL),1)
CC = mpiCC
else
CC = c++
endif
AR = ar ruvs
RM = rm
RANLIB = ranlib
LIB = ../lib/libParallel.a
INCLUDE =
INCLUDE := $(INCLUDE) -I/usr/local/mpich/latest/include/
C_FLAGS = -g
OS_FLAGS =
......@@ -32,7 +27,7 @@ $(LIB): $(OBJ)
$(AR) $(LIB) $(OBJ)
$(RANLIB) $(LIB)
.cpp.o:
.cc.o:
$(CC) $(CFLAGS) -c $<
clean:
......
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef SUN4
#include <sys/varargs.h>
#else
#include <stdarg.h>
#endif
#include "ParUtil.h"
#ifdef PARALLEL
#include "autopack.h"
#include "mpi.h"
#else
#include <sys/time.h>
#endif
......@@ -40,17 +35,10 @@ void ParUtil::init(int &argc, char **&argv) {
MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
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);
AP_init(&argc, &argv);
AP_setparam(10*4096, 1, 1024, -1);
MPI_Get_processor_name(name,&namelen);
procName = new char[namelen+1];
strcpy(procName,name);
char logname[256];
sprintf(logname,"log-proc%d-%s.dat",myrank,procName);
log = fopen (logname,"w");
vl = 1;
#endif
}
......@@ -82,55 +70,6 @@ void ParUtil::processorName(char *name) const
#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()
{
#ifdef PARALLEL
......@@ -143,10 +82,9 @@ void ParUtil::Abort()
void ParUtil::Barrier(int line, const char *fn)
{
#ifdef PARALLEL
Msg(DEBUG2,"BARRIER : Line %d in %s\n",line,fn);
MPI_Barrier(MPI_COMM_WORLD);
Msg(DEBUG2,"BARRIER PASSED : Line %d in %s\n",line,fn);
#endif
}
ParUtil* ParUtil::instance = 0;
......@@ -2,10 +2,6 @@
#define _H_ParUtil
#include <stdio.h>
#ifdef PARALLEL
#include "mpi.h"
#endif
/**
ParUtil is a Singleton. It gives some
general services for parallel implementation.
......@@ -15,8 +11,6 @@ class ParUtil {
ParUtil();
~ParUtil();
public:
/// Message severity level
typedef enum MessageLevel {DEBUG1,DEBUG2,INFO,WARNING,ERROR};
/// returne the only instance
static ParUtil* Instance();
/// initialization, needed for mpi and autopack
......@@ -27,10 +21,6 @@ public:
double wTime () const;
/// gets the processor name
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
void Abort();
#ifdef PARALLEL
......@@ -47,14 +37,10 @@ public:
#endif
private:
static ParUtil *instance;
FILE *log;
int vl;
int procSpeed;
char *procName;
#ifdef PARALLEL
int myrank;
int mysize;
MPI_Comm seq_local_comm;
#endif
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment