This commit is contained in:
Joachim Schoeberl 2012-06-16 16:58:46 +00:00
parent 05b0abfce1
commit eade1f6b2d
3 changed files with 8 additions and 32 deletions

View File

@ -9,6 +9,7 @@ METASOURCES = AUTO
noinst_LTLIBRARIES = libgen.la
libgen_la_SOURCES = array.cpp bitarray.cpp dynamicmem.cpp flags.cpp \
hashtabl.cpp mystring.cpp ngexception.cpp optmem.cpp parthreads.cpp \
profiler.cpp seti.cpp sort.cpp spbita2d.cpp symbolta.cpp table.cpp
profiler.cpp seti.cpp sort.cpp spbita2d.cpp symbolta.cpp table.cpp \
mpi_interface.cpp
# moveablemem.cpp

View File

@ -27,7 +27,8 @@ namespace netgen
extern MPI_Comm mesh_comm;
template <class T>
MPI_Datatype MyGetMPIType ( ) { cerr << "ERROR in GetMPIType() -- no type found" << endl;return 0;}
MPI_Datatype MyGetMPIType ( )
{ cerr << "ERROR in GetMPIType() -- no type found" << endl;return 0; }
template <>
inline MPI_Datatype MyGetMPIType<int> ( )
@ -214,36 +215,11 @@ namespace netgen
inline void MyMPI_SendCmd (const char * cmd)
{
char buf[100];
strcpy (buf, cmd);
// MPI_Bcast (&buf, 100, MPI_CHAR, 0, MPI_COMM_WORLD);
extern void MyMPI_SendCmd (const char * cmd);
extern string MyMPI_RecvCmd ();
for (int dest = 1; dest < ntasks; dest++)
MPI_Bsend( &buf, 100, MPI_CHAR, dest, MPI_TAG_CMD, MPI_COMM_WORLD);
}
inline string MyMPI_RecvCmd ()
{
char buf[100];
// MPI_Bcast (&buf, 100, MPI_CHAR, 0, MPI_COMM_WORLD);
VT_OFF();
MPI_Status status;
int flag;
do
{
MPI_Iprobe (0, MPI_TAG_CMD, MPI_COMM_WORLD, &flag, &status);
if (!flag) usleep (1000);
}
while (!flag);
VT_ON();
MPI_Recv( &buf, 100, MPI_CHAR, 0, MPI_TAG_CMD, MPI_COMM_WORLD, &status);
return string(buf);
}
template <class T>
inline void MyMPI_Bcast (T & s, MPI_Comm comm = MPI_COMM_WORLD)

View File

@ -1,5 +1,5 @@
/**************************************************************************/
/* File: optmem.cc */
/* File: optmem.cpp */
/* Author: Joachim Schoeberl */
/* Date: 04. Apr. 97 */
/**************************************************************************/
@ -14,7 +14,6 @@
namespace netgen
{
//using namespace netgen;
BlockAllocator :: BlockAllocator (unsigned asize, unsigned ablocks)
: bablocks (0)