mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-27 06:10:34 +05:00
mpi
This commit is contained in:
parent
05b0abfce1
commit
eade1f6b2d
@ -9,6 +9,7 @@ METASOURCES = AUTO
|
|||||||
noinst_LTLIBRARIES = libgen.la
|
noinst_LTLIBRARIES = libgen.la
|
||||||
libgen_la_SOURCES = array.cpp bitarray.cpp dynamicmem.cpp flags.cpp \
|
libgen_la_SOURCES = array.cpp bitarray.cpp dynamicmem.cpp flags.cpp \
|
||||||
hashtabl.cpp mystring.cpp ngexception.cpp optmem.cpp parthreads.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
|
# moveablemem.cpp
|
||||||
|
@ -27,7 +27,8 @@ namespace netgen
|
|||||||
extern MPI_Comm mesh_comm;
|
extern MPI_Comm mesh_comm;
|
||||||
|
|
||||||
template <class T>
|
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 <>
|
template <>
|
||||||
inline MPI_Datatype MyGetMPIType<int> ( )
|
inline MPI_Datatype MyGetMPIType<int> ( )
|
||||||
@ -214,36 +215,11 @@ namespace netgen
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
inline void MyMPI_SendCmd (const char * cmd)
|
extern void MyMPI_SendCmd (const char * cmd);
|
||||||
{
|
extern string MyMPI_RecvCmd ();
|
||||||
char buf[100];
|
|
||||||
strcpy (buf, cmd);
|
|
||||||
// MPI_Bcast (&buf, 100, MPI_CHAR, 0, MPI_COMM_WORLD);
|
|
||||||
|
|
||||||
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>
|
template <class T>
|
||||||
inline void MyMPI_Bcast (T & s, MPI_Comm comm = MPI_COMM_WORLD)
|
inline void MyMPI_Bcast (T & s, MPI_Comm comm = MPI_COMM_WORLD)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
/* File: optmem.cc */
|
/* File: optmem.cpp */
|
||||||
/* Author: Joachim Schoeberl */
|
/* Author: Joachim Schoeberl */
|
||||||
/* Date: 04. Apr. 97 */
|
/* Date: 04. Apr. 97 */
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
@ -14,7 +14,6 @@
|
|||||||
|
|
||||||
namespace netgen
|
namespace netgen
|
||||||
{
|
{
|
||||||
//using namespace netgen;
|
|
||||||
|
|
||||||
BlockAllocator :: BlockAllocator (unsigned asize, unsigned ablocks)
|
BlockAllocator :: BlockAllocator (unsigned asize, unsigned ablocks)
|
||||||
: bablocks (0)
|
: bablocks (0)
|
||||||
|
Loading…
Reference in New Issue
Block a user