parallel fixes

This commit is contained in:
Joachim Schoeberl 2012-06-13 09:07:11 +00:00
parent 368da4c996
commit 27f8e452fd
13 changed files with 223 additions and 281 deletions

View File

@ -170,8 +170,15 @@ namespace netgen
public: public:
/// Generate array of logical and physical size asize /// Generate array of logical and physical size asize
explicit Array(int asize = 0) explicit Array()
: FlatArray<T, BASE> (asize, asize ? new T[asize] : 0) : FlatArray<T, BASE> (0, NULL)
{
allocsize = 0;
ownmem = 1;
}
explicit Array(int asize)
: FlatArray<T, BASE> (asize, new T[asize])
{ {
allocsize = asize; allocsize = asize;
ownmem = 1; ownmem = 1;

View File

@ -272,59 +272,15 @@ extern "C" {
double * p3d, double * jacobian); double * p3d, double * jacobian);
#ifdef PARALLEL #ifdef PARALLEL
// Is Element ei an element of this processor ??
bool Ng_IsGhostEl (int ei);
void Ng_SetGhostEl(const int ei, const bool aisghost );
bool Ng_IsGhostSEl (int ei);
void Ng_SetGhostSEl(const int ei, const bool aisghost );
bool Ng_IsGhostVert ( int pnum );
bool Ng_IsGhostEdge ( int ednum );
bool Ng_IsGhostFace ( int fanum );
bool Ng_IsExchangeEl ( int elnum );
bool Ng_IsExchangeSEl ( int selnr );
void Ng_UpdateOverlap ();
int Ng_Overlap();
/* void Ng_SetGhostVert ( const int pnum, const bool aisghost ); */
/* void Ng_SetGhostEdge ( const int ednum, const bool aisghost ); */
/* void Ng_SetGhostFace ( const int fanum, const bool aisghost ); */
// the folling functions are 0-base !! // the folling functions are 0-base !!
int NgPar_GetLoc2Glob_VolEl ( int locnum );
// int NgPar_GetDistantNodeNums ( int nt, int locnum, int * procs, int * distnum);
// number on distant processor // number on distant processor
// returns pairs (dist_proc, num_on_dist_proc)
// gibt anzahl an distant pnums zurueck
// * pnums entspricht ARRAY<int[2] >
int NgPar_GetDistantNodeNums ( int nodetype, int locnum, int * pnums ); int NgPar_GetDistantNodeNums ( int nodetype, int locnum, int * pnums );
int NgPar_GetNDistantNodeNums ( int nodetype, int locnum ); int NgPar_GetNDistantNodeNums ( int nodetype, int locnum );
int NgPar_GetDistantPNum ( int proc, int locnum ) ; int NgPar_GetGlobalNodeNum (int nodetype, int locnum);
int NgPar_GetDistantEdgeNum ( int proc, int locnum ) ;
int NgPar_GetDistantFaceNum ( int proc, int locnum ) ;
int NgPar_GetDistantElNum ( int proc, int locnum );
bool NgPar_IsExchangeFace ( int fnr ) ;
bool NgPar_IsExchangeVert ( int vnum );
bool NgPar_IsExchangeEdge ( int ednum );
bool NgPar_IsExchangeElement ( int elnum );
void NgPar_PrintParallelMeshTopology ();
bool NgPar_IsElementInPartition ( int elnum, int dest );
bool NgPar_IsGhostFace ( int facenum );
bool NgPar_IsGhostEdge ( int edgenum );
#endif #endif

View File

@ -24,42 +24,42 @@
// #include <pthread.h> // #include <pthread.h>
static pthread_t meshingthread; static pthread_t meshingthread;
void RunParallel ( void * (*fun)(void *), void * in) void RunParallel ( void * (*fun)(void *), void * in)
{ {
if (netgen::mparam.parthread) // && (ntasks == 1) ) if (netgen::mparam.parthread) // && (ntasks == 1) )
{ {
pthread_attr_t attr; pthread_attr_t attr;
pthread_attr_init (&attr); pthread_attr_init (&attr);
// the following call can be removed if not available: // the following call can be removed if not available:
pthread_attr_setstacksize(&attr, 1000000); pthread_attr_setstacksize(&attr, 1000000);
//pthread_create (&meshingthread, &attr, fun, NULL); //pthread_create (&meshingthread, &attr, fun, NULL);
pthread_create (&meshingthread, &attr, fun, in); pthread_create (&meshingthread, &attr, fun, in);
} }
else else
fun (in); fun (in);
} }
#else // Using MS VC++ Standard / Enterprise / Professional edition #else // Using MS VC++ Standard / Enterprise / Professional edition
// Afx - Threads need different return - value: // Afx - Threads need different return - value:
static void* (*sfun)(void *); static void* (*sfun)(void *);
unsigned int fun2 (void * val) unsigned int fun2 (void * val)
{ {
sfun (val); sfun (val);
return 0; return 0;
} }
void RunParallel ( void* (*fun)(void *), void * in) void RunParallel ( void* (*fun)(void *), void * in)
{ {
sfun = fun; sfun = fun;
if (netgen::mparam.parthread) if (netgen::mparam.parthread)
AfxBeginThread (fun2, in); AfxBeginThread (fun2, in);
//AfxBeginThread (fun2, NULL); //AfxBeginThread (fun2, NULL);
else else
fun (in); fun (in);
} }
#endif // #ifdef MSVC_EXPRESS #endif // #ifdef MSVC_EXPRESS
@ -67,31 +67,31 @@
// #include <pthread.h> // #include <pthread.h>
static pthread_t meshingthread; static pthread_t meshingthread;
void RunParallel ( void * (*fun)(void *), void * in) void RunParallel ( void * (*fun)(void *), void * in)
{ {
bool parthread = netgen::mparam.parthread; bool parthread = netgen::mparam.parthread;
#ifdef PARALLEL #ifdef PARALLEL
int provided; int provided;
MPI_Query_thread(&provided); MPI_Query_thread(&provided);
if (provided < 3) if (provided < 3)
if (netgen::ntasks > 1) parthread = false; if (netgen::ntasks > 1) parthread = false;
// cout << "runparallel = " << parthread << endl; // cout << "runparallel = " << parthread << endl;
#endif #endif
if (parthread) if (parthread)
{ {
pthread_attr_t attr; pthread_attr_t attr;
pthread_attr_init (&attr); pthread_attr_init (&attr);
// the following call can be removed if not available: // the following call can be removed if not available:
pthread_attr_setstacksize(&attr, 1000000); pthread_attr_setstacksize(&attr, 1000000);
//pthread_create (&meshingthread, &attr, fun, NULL); //pthread_create (&meshingthread, &attr, fun, NULL);
pthread_create (&meshingthread, &attr, fun, in); pthread_create (&meshingthread, &attr, fun, in);
} }
else else
fun (in); fun (in);
} }
#endif // #ifdef _MSC_VER #endif // #ifdef _MSC_VER
@ -937,9 +937,9 @@ bool Ng_IsGhostEl (int ei)
{ {
return false; return false;
/* /*
if ( mesh->GetDimension() == 3 ) if ( mesh->GetDimension() == 3 )
return mesh->VolumeElement(ei).IsGhost(); return mesh->VolumeElement(ei).IsGhost();
else else
return false; return false;
*/ */
} }
@ -948,7 +948,7 @@ void Ng_SetGhostEl(const int ei, const bool aisghost )
{ {
; ;
/* /*
if ( mesh -> GetDimension () == 3 ) if ( mesh -> GetDimension () == 3 )
mesh -> VolumeElement(ei).SetGhost (aisghost); mesh -> VolumeElement(ei).SetGhost (aisghost);
*/ */
} }
@ -957,9 +957,9 @@ bool Ng_IsGhostSEl (int ei)
{ {
return false; return false;
/* /*
if ( mesh -> GetDimension () == 3 ) if ( mesh -> GetDimension () == 3 )
return mesh->SurfaceElement(ei).IsGhost(); return mesh->SurfaceElement(ei).IsGhost();
else else
return false; return false;
*/ */
} }
@ -968,7 +968,7 @@ void Ng_SetGhostSEl(const int ei, const bool aisghost )
{ {
; ;
/* /*
if ( mesh -> GetDimension () == 3 ) if ( mesh -> GetDimension () == 3 )
mesh -> SurfaceElement(ei).SetGhost (aisghost); mesh -> SurfaceElement(ei).SetGhost (aisghost);
*/ */
} }
@ -1015,106 +1015,120 @@ int Ng_Overlap ()
int NgPar_GetLoc2Glob_VolEl ( int locnum ) int NgPar_GetLoc2Glob_VolEl ( int locnum )
{ {
return mesh -> GetParallelTopology().GetLoc2Glob_VolEl ( locnum+1) -1; return mesh -> GetParallelTopology().GetLoc2Glob_VolEl ( locnum+1) -1;
} }
// gibt anzahl an distant pnums zurueck // gibt anzahl an distant pnums zurueck
// * pnums entspricht ARRAY<int[2] > // * pnums entspricht ARRAY<int[2] >
int NgPar_GetDistantNodeNums ( int nodetype, int locnum, int * distnums ) int NgPar_GetDistantNodeNums ( int nodetype, int locnum, int * distnums )
{ {
int size; int size;
switch ( nodetype ) switch ( nodetype )
{ {
case 0: case 0:
size = mesh->GetParallelTopology().GetDistantPNums( locnum+1, distnums ); size = mesh->GetParallelTopology().GetDistantPNums( locnum+1, distnums );
break; break;
case 1: case 1:
size = mesh->GetParallelTopology().GetDistantEdgeNums( locnum+1, distnums ); size = mesh->GetParallelTopology().GetDistantEdgeNums( locnum+1, distnums );
break; break;
case 2: case 2:
size = mesh->GetParallelTopology().GetDistantFaceNums( locnum+1, distnums ); size = mesh->GetParallelTopology().GetDistantFaceNums( locnum+1, distnums );
break; break;
case 3: case 3:
size = mesh->GetParallelTopology().GetDistantElNums( locnum+1, distnums ); size = mesh->GetParallelTopology().GetDistantElNums( locnum+1, distnums );
break; break;
default: default:
cerr << "NgPar_GetDistantNodeNums() Unknown nodetype " << nodetype << endl; cerr << "NgPar_GetDistantNodeNums() Unknown nodetype " << nodetype << endl;
size = -1; size = -1;
} }
// 0 - based // 0 - based
for ( int i = 0; i < size; i++ ) for ( int i = 0; i < size; i++ )
distnums[2*i+1]--; distnums[2*i+1]--;
return size; return size;
} }
int NgPar_GetNDistantNodeNums ( int nodetype, int locnum ) int NgPar_GetNDistantNodeNums ( int nodetype, int locnum )
{ {
switch ( nodetype ) switch ( nodetype )
{ {
case 0: case 0:
return mesh->GetParallelTopology().GetNDistantPNums( locnum+1 ); return mesh->GetParallelTopology().GetNDistantPNums( locnum+1 );
case 1: case 1:
return mesh->GetParallelTopology().GetNDistantEdgeNums( locnum+1 ); return mesh->GetParallelTopology().GetNDistantEdgeNums( locnum+1 );
case 2: case 2:
return mesh->GetParallelTopology().GetNDistantFaceNums( locnum+1 ); return mesh->GetParallelTopology().GetNDistantFaceNums( locnum+1 );
case 3: case 3:
return mesh->GetParallelTopology().GetNDistantElNums( locnum+1 ); return mesh->GetParallelTopology().GetNDistantElNums( locnum+1 );
} }
return -1; return -1;
} }
int NgPar_GetDistantPNum ( int proc, int locpnum ) int NgPar_GetGlobalNodeNum (int nodetype, int locnum)
{ {
return mesh->GetParallelTopology().GetDistantPNum( proc, locpnum+1) - 1; switch (nodetype)
} {
case 0: return mesh->GetParallelTopology().GetDistantPNum (0, locnum+1)-1;
int NgPar_GetDistantEdgeNum ( int proc, int locpnum ) case 1: return mesh->GetParallelTopology().GetDistantEdgeNum (0, locnum+1)-1;
{ case 2: return mesh->GetParallelTopology().GetDistantFaceNum (0, locnum+1)-1;
return mesh->GetParallelTopology().GetDistantEdgeNum( proc, locpnum+1) - 1; case 3: return mesh->GetParallelTopology().GetDistantElNum (0, locnum+1)-1;
} }
return -1;
int NgPar_GetDistantFaceNum ( int proc, int locpnum ) }
{
return mesh->GetParallelTopology().GetDistantFaceNum (proc, locpnum+1 ) - 1;
}
int NgPar_GetDistantElNum ( int proc, int locelnum )
{
return mesh->GetParallelTopology().GetDistantElNum (proc, locelnum+1 ) - 1;
}
bool NgPar_IsExchangeFace ( int fnr )
{
return (mesh->GetParallelTopology().GetNDistantFaceNums( fnr+1 ) > 0);
// return mesh->GetParallelTopology().IsExchangeFace ( fnr+1 );
}
bool NgPar_IsExchangeVert ( int vnum )
{
return (mesh->GetParallelTopology().GetNDistantPNums( vnum+1 ) > 0);
// return mesh->GetParallelTopology().IsExchangeVert ( vnum+1 );
}
bool NgPar_IsExchangeEdge ( int ednum )
{
return (mesh->GetParallelTopology().GetNDistantEdgeNums( ednum+1 ) > 0);
// return mesh->GetParallelTopology().IsExchangeEdge ( ednum+1 );
}
bool NgPar_IsExchangeElement ( int elnum )
{
return (mesh->GetParallelTopology().GetNDistantElNums( elnum+1 ) > 0);
// return mesh->GetParallelTopology().IsExchangeElement ( elnum+1 );
}
void NgPar_PrintParallelMeshTopology ()
{ int NgPar_GetDistantPNum ( int proc, int locpnum )
mesh -> GetParallelTopology().Print (); {
} return mesh->GetParallelTopology().GetDistantPNum( proc, locpnum+1) - 1;
}
int NgPar_GetDistantEdgeNum ( int proc, int locpnum )
{
return mesh->GetParallelTopology().GetDistantEdgeNum( proc, locpnum+1) - 1;
}
int NgPar_GetDistantFaceNum ( int proc, int locpnum )
{
return mesh->GetParallelTopology().GetDistantFaceNum (proc, locpnum+1 ) - 1;
}
int NgPar_GetDistantElNum ( int proc, int locelnum )
{
return mesh->GetParallelTopology().GetDistantElNum (proc, locelnum+1 ) - 1;
}
bool NgPar_IsExchangeFace ( int fnr )
{
return (mesh->GetParallelTopology().GetNDistantFaceNums( fnr+1 ) > 0);
// return mesh->GetParallelTopology().IsExchangeFace ( fnr+1 );
}
bool NgPar_IsExchangeVert ( int vnum )
{
return (mesh->GetParallelTopology().GetNDistantPNums( vnum+1 ) > 0);
// return mesh->GetParallelTopology().IsExchangeVert ( vnum+1 );
}
bool NgPar_IsExchangeEdge ( int ednum )
{
return (mesh->GetParallelTopology().GetNDistantEdgeNums( ednum+1 ) > 0);
// return mesh->GetParallelTopology().IsExchangeEdge ( ednum+1 );
}
bool NgPar_IsExchangeElement ( int elnum )
{
return (mesh->GetParallelTopology().GetNDistantElNums( elnum+1 ) > 0);
// return mesh->GetParallelTopology().IsExchangeElement ( elnum+1 );
}
void NgPar_PrintParallelMeshTopology ()
{
mesh -> GetParallelTopology().Print ();
}
#endif #endif

View File

@ -343,8 +343,8 @@ namespace netgen
// boundary layer list // boundary layer list
if(!surfid.Contains(mesh.LineSegment(j).si)) if(!surfid.Contains(mesh.LineSegment(j).si))
{ {
int pnt_commelem = 0; int pnt_commelem = 0;
int pnum_commelem = 0; int pnum_commelem = 0;
Array<int> pnt1_elems; Array<int> pnt1_elems;
Array<int> pnt2_elems; Array<int> pnt2_elems;

View File

@ -1446,7 +1446,7 @@ namespace netgen
{ {
for(ElementIndex i=0;i<mesh.GetNE(); i++) for(ElementIndex i=0;i<mesh.GetNE(); i++)
{ {
Element el = mesh[i] ; // Element el = mesh[i] ;
HPRefElement & hpel = hpelements[mesh[i].hp_elnr]; HPRefElement & hpel = hpelements[mesh[i].hp_elnr];
const ELEMENT_EDGE * edges = MeshTopology::GetEdges1 (mesh[i].GetType()); const ELEMENT_EDGE * edges = MeshTopology::GetEdges1 (mesh[i].GetType());
double dist[3] = {0,0,0}; double dist[3] = {0,0,0};

View File

@ -748,9 +748,6 @@ namespace netgen
/// loads a mesh sent from master processor /// loads a mesh sent from master processor
void ReceiveParallelMesh (); void ReceiveParallelMesh ();
void UpdateOverlap ();
#endif #endif

View File

@ -249,7 +249,6 @@ namespace netgen
for (int dest = 1; dest < ntasks; dest++) for (int dest = 1; dest < ntasks; dest++)
{ {
FlatArray<PointIndex> verts = verts_of_proc[dest]; FlatArray<PointIndex> verts = verts_of_proc[dest];
sendrequests.Append (MyMPI_ISend (verts, dest, MPI_TAG_MESH+1)); sendrequests.Append (MyMPI_ISend (verts, dest, MPI_TAG_MESH+1));
MPI_Datatype mptype = MeshPoint::MyGetMPIType(); MPI_Datatype mptype = MeshPoint::MyGetMPIType();
@ -257,7 +256,7 @@ namespace netgen
int numv = verts.Size(); int numv = verts.Size();
MPI_Datatype newtype; MPI_Datatype newtype;
Array<int> blocklen (numv); Array<int> blocklen (numv);
blocklen = 1; blocklen = 1;
MPI_Type_indexed (numv, &blocklen[0], MPI_Type_indexed (numv, &blocklen[0],
@ -270,7 +269,6 @@ namespace netgen
sendrequests.Append (request); sendrequests.Append (request);
} }
Array<int> num_distpnums(ntasks); Array<int> num_distpnums(ntasks);
num_distpnums = 0; num_distpnums = 0;
@ -481,10 +479,10 @@ namespace netgen
// receive vertices // receive vertices
NgProfiler::StartTimer (timer_pts); NgProfiler::StartTimer (timer_pts);
Array<int> verts; Array<int> verts;
MyMPI_Recv (verts, 0, MPI_TAG_MESH+1); MyMPI_Recv (verts, 0, MPI_TAG_MESH+1);
int numvert = verts.Size(); int numvert = verts.Size();
paralleltop -> SetNV (numvert); paralleltop -> SetNV (numvert);
@ -542,7 +540,8 @@ namespace netgen
MyMPI_Recv (fddata, 0, MPI_TAG_MESH+3); MyMPI_Recv (fddata, 0, MPI_TAG_MESH+3);
for (int i = 0; i < fddata.Size(); i += 6) for (int i = 0; i < fddata.Size(); i += 6)
{ {
int faceind = AddFaceDescriptor (FaceDescriptor(int(fddata[i]), int(fddata[i+1]), int(fddata[i+2]), 0)); int faceind = AddFaceDescriptor
(FaceDescriptor(int(fddata[i]), int(fddata[i+1]), int(fddata[i+2]), 0));
GetFaceDescriptor(faceind).SetBCProperty (int(fddata[i+3])); GetFaceDescriptor(faceind).SetBCProperty (int(fddata[i+3]));
GetFaceDescriptor(faceind).domin_singular = fddata[i+4]; GetFaceDescriptor(faceind).domin_singular = fddata[i+4];
GetFaceDescriptor(faceind).domout_singular = fddata[i+5]; GetFaceDescriptor(faceind).domout_singular = fddata[i+5];
@ -1150,22 +1149,6 @@ namespace netgen
void Mesh :: UpdateOverlap()
{
cout << "UpdateOverlap depreciated" << endl;
}
} }

View File

@ -11,8 +11,9 @@ namespace netgen
static MPI_Group MPI_HIGHORDER_WORLD; static MPI_Group MPI_HIGHORDER_WORLD;
static MPI_Comm MPI_HIGHORDER_COMM; static MPI_Comm MPI_HIGHORDER_COMM;
void MyMPI_ExchangeTable (TABLE<int> & send_verts, template <typename T>
TABLE<int> & recv_verts, int tag, void MyMPI_ExchangeTable (TABLE<T> & send_verts,
TABLE<T> & recv_verts, int tag,
MPI_Comm comm = MPI_COMM_WORLD) MPI_Comm comm = MPI_COMM_WORLD)
{ {
int ntasks, rank; int ntasks, rank;

View File

@ -76,8 +76,6 @@ namespace netgen
ParallelMeshTopology & paralleltop = mesh.GetParallelTopology(); ParallelMeshTopology & paralleltop = mesh.GetParallelTopology();
#endif #endif
bool isparallel = 0;
if (timestamp > mesh.GetTimeStamp()) return; if (timestamp > mesh.GetTimeStamp()) return;
@ -1151,23 +1149,12 @@ namespace netgen
if (cnt_err && ntasks == 1) if (cnt_err && ntasks == 1)
cout << cnt_err << " elements are not matching !!!" << endl; cout << cnt_err << " elements are not matching !!!" << endl;
if (cnt_err && ntasks > 1)
isparallel = 1;
} }
} }
#ifdef PARALLEL #ifdef PARALLEL
if (mesh.GetDimension() == 3) if (id != 0)
if (isparallel != (id != 0))
{
cerr << " ****************************** " << endl;
cerr << " **** wrong isparallel ****** " << endl;
cerr << " ****************************** " << endl;
}
if (id != 0) // if (isparallel)
{ {
paralleltop.Update(); paralleltop.Update();
if ( paralleltop.DoCoarseUpdate() ) if ( paralleltop.DoCoarseUpdate() )

View File

@ -746,14 +746,14 @@ namespace netgen
{ {
string displname; string displname;
Display * dpy = glXGetCurrentDisplay(); // Display * dpy = glXGetCurrentDisplay();
GLXDrawable drawable = glXGetCurrentDrawable(); GLXDrawable drawable = glXGetCurrentDrawable();
GLXContext ctx = glXGetCurrentContext(); GLXContext ctx = glXGetCurrentContext();
GLXContextID xid = glXGetContextIDEXT (ctx); GLXContextID xid = glXGetContextIDEXT (ctx);
displname = XDisplayName (0); displname = XDisplayName (0);
/*
/*
cout << "Init Parallel GL" << endl; cout << "Init Parallel GL" << endl;
cout << "DisplayName = " << displname << endl; cout << "DisplayName = " << displname << endl;
cout << "current display = " << dpy << endl; cout << "current display = " << dpy << endl;

View File

@ -2223,28 +2223,27 @@ namespace netgen
MyMPI_Bcast (comp); MyMPI_Bcast (comp);
#endif #endif
const SolData * sol;
double val; double val;
bool considerElem; // bool considerElem;
bool hasit = false; bool hasit = false;
minv = 0; maxv = 1; minv = 0; maxv = 1;
if (funcnr != -1)
if ((ntasks == 1) || (id > 0))
if (funcnr != -1)
{ {
sol = soldata[funcnr]; const SolData * sol = soldata[funcnr];
if (sol->draw_volume) if (sol->draw_volume)
{ {
int ne = mesh->GetNE(); int ne = mesh->GetNE();
for (int i = 0; i < ne; i++) for (int i = 0; i < ne; i++)
{ {
considerElem = GetValue (sol, i, 0.333, 0.333, 0.333, comp, val); bool considerElem = GetValue (sol, i, 0.333, 0.333, 0.333, comp, val);
if (considerElem) if (considerElem)
{ {
if (val > maxv || !hasit) if (val > maxv || !hasit) maxv = val;
maxv = val; if (val < minv || !hasit) minv = val;
if (val < minv || !hasit)
minv = val;
hasit = true; hasit = true;
} }
} }
@ -2255,16 +2254,14 @@ namespace netgen
for (int i = 0; i < nse; i++) for (int i = 0; i < nse; i++)
{ {
ELEMENT_TYPE type = mesh->SurfaceElement(i+1).GetType(); ELEMENT_TYPE type = mesh->SurfaceElement(i+1).GetType();
if (type == QUAD) bool considerElem = (type == QUAD)
considerElem = GetSurfValue (sol, i, -1, 0.5, 0.5, comp, val); ? GetSurfValue (sol, i, -1, 0.5, 0.5, comp, val)
else : GetSurfValue (sol, i, -1, 0.3333333, 0.3333333, comp, val);
considerElem = GetSurfValue (sol, i, -1, 0.3333333, 0.3333333, comp, val);
if (considerElem) if (considerElem)
{ {
if (val > maxv || !hasit) if (val > maxv || !hasit) maxv = val;
maxv = val; if (val < minv || !hasit) minv = val;
if (val < minv || !hasit)
minv = val;
hasit = true; hasit = true;
} }
} }

View File

@ -68,18 +68,12 @@ int main(int argc, char ** argv)
{ {
#ifdef PARALLEL #ifdef PARALLEL
// MPI_Init(&argc, &argv); int mpi_required = MPI_THREAD_MULTIPLE, mpi_provided;
MPI_Init_thread(&argc, &argv, mpi_required, &mpi_provided);
int required = MPI_THREAD_MULTIPLE;
// int required = 0;
int provided;
MPI_Init_thread(&argc, &argv, required, &provided);
MPI_Comm_size(MPI_COMM_WORLD, &netgen::ntasks); MPI_Comm_size(MPI_COMM_WORLD, &netgen::ntasks);
MPI_Comm_rank(MPI_COMM_WORLD, &netgen::id); MPI_Comm_rank(MPI_COMM_WORLD, &netgen::id);
if (netgen::id == 0 && provided == MPI_THREAD_MULTIPLE)
cout << "multithreaded mpi is supported" << endl;
MPI_Comm_dup ( MPI_COMM_WORLD, &netgen::mesh_comm); MPI_Comm_dup ( MPI_COMM_WORLD, &netgen::mesh_comm);
#endif #endif
@ -114,9 +108,21 @@ int main(int argc, char ** argv)
#ifdef PARALLEL #ifdef PARALLEL
cout << "Running MPI - parallel using " if (netgen::ntasks == 1)
<< netgen::ntasks << " processor" {
<< ((netgen::ntasks > 1) ? "s " : " ") << endl; cout << "Run parallel Netgen with 'mpirun -np xy netgen'" << endl;
}
else
{
cout << "Running MPI - parallel using "
<< netgen::ntasks << " processor"
<< ((netgen::ntasks > 1) ? "s " : " ") << endl;
cout << "MPI-version = " << MPI_VERSION << '.' << MPI_SUBVERSION << endl;
if (mpi_provided == MPI_THREAD_MULTIPLE)
cout << "multithreaded MPI is supported" << endl;
}
#endif #endif
} }

View File

@ -148,12 +148,6 @@ void ParallelRun()
VT_USER_END ("Mesh::ReceiveParallelMesh"); VT_USER_END ("Mesh::ReceiveParallelMesh");
} }
else if ( message == "overlap++" )
{
PrintMessage (1, "overlap++++++");
mesh -> UpdateOverlap();
}
else if ( message == "visualize" ) else if ( message == "visualize" )
{ {
cout << "parallel message visualize depreciated" << endl; cout << "parallel message visualize depreciated" << endl;