move parallel files

This commit is contained in:
Joachim Schoeberl 2009-01-25 19:37:14 +00:00
parent 1fc0ec21cd
commit 4f6f77f2f3
8 changed files with 3900 additions and 9 deletions

View File

@ -2,5 +2,4 @@ AM_CPPFLAGS =
METASOURCES = AUTO
SUBDIRS = csg general geom2d gprim include interface linalg meshing occ \
parallel stlgeom visualization
SUBDIRS = csg general geom2d gprim include interface linalg meshing occ stlgeom visualization

View File

@ -216,9 +216,7 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AM_CPPFLAGS =
METASOURCES = AUTO
SUBDIRS = csg general geom2d gprim include interface linalg meshing occ \
parallel stlgeom visualization
SUBDIRS = csg general geom2d gprim include interface linalg meshing occ stlgeom visualization
all: all-recursive
.SUFFIXES:

View File

@ -23,4 +23,5 @@ libmesh_la_SOURCES = adfront2.cpp adfront3.cpp bisect.cpp boundarylayer.cpp \
pyramid2rls.cpp pyramidrls.cpp quadrls.cpp refine.cpp \
ruler2.cpp ruler3.cpp secondorder.cpp smoothing2.5.cpp \
smoothing2.cpp smoothing3.cpp specials.cpp tetrarls.cpp \
topology.cpp triarls.cpp validate.cpp zrefine.cpp
topology.cpp triarls.cpp validate.cpp zrefine.cpp \
parallelmesh.cpp paralleltop.cpp paralleltop.hpp

View File

@ -57,7 +57,8 @@ am_libmesh_la_OBJECTS = adfront2.lo adfront3.lo bisect.lo \
prism2rls.lo pyramid2rls.lo pyramidrls.lo quadrls.lo refine.lo \
ruler2.lo ruler3.lo secondorder.lo smoothing2.5.lo \
smoothing2.lo smoothing3.lo specials.lo tetrarls.lo \
topology.lo triarls.lo validate.lo zrefine.lo
topology.lo triarls.lo validate.lo zrefine.lo parallelmesh.lo \
paralleltop.lo
libmesh_la_OBJECTS = $(am_libmesh_la_OBJECTS)
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
@ -71,6 +72,15 @@ CXXLD = $(CXX)
CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
SOURCES = $(libmesh_la_SOURCES)
DIST_SOURCES = $(libmesh_la_SOURCES)
HEADERS = $(noinst_HEADERS)
@ -254,7 +264,8 @@ libmesh_la_SOURCES = adfront2.cpp adfront3.cpp bisect.cpp boundarylayer.cpp \
pyramid2rls.cpp pyramidrls.cpp quadrls.cpp refine.cpp \
ruler2.cpp ruler3.cpp secondorder.cpp smoothing2.5.cpp \
smoothing2.cpp smoothing3.cpp specials.cpp tetrarls.cpp \
topology.cpp triarls.cpp validate.cpp zrefine.cpp
topology.cpp triarls.cpp validate.cpp zrefine.cpp \
parallelmesh.cpp paralleltop.cpp paralleltop.hpp
all: all-am
@ -331,6 +342,8 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msghandler.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netrule2.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netrule3.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parallelmesh.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/paralleltop.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parser2.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parser3.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prism2rls.Plo@am__quote@

View File

@ -67,7 +67,7 @@ namespace netgen
#include "validate.hpp"
#ifdef PARALLEL
#include "../parallel/paralleltop.hpp"
#include "paralleltop.hpp"
// #include "../parallel/parallelmesh.hpp"
#endif

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,269 @@
#ifndef FILE_PARALLELTOP
#define FILE_PARALLELTOP
#include <meshing.hpp>
extern int ntasks;
class ParallelMeshTopology
{
const Mesh & mesh;
// number of local elements, vertices, points (?), edges, faces
int ne, nv, np, ned, nfa;
// number of local segments and surface elements
int nseg, nsurfel;
// number of global elements, vertices, ???, faces
int neglob, nvglob;
int nparel;
int nfaglob;
/**
mapping from local to distant vertex number
each row of the table corresponds to one vertex
each row contains a list of pairs (procnr, dist_vnum)
*/
TABLE<int,PointIndex::BASE> loc2distvert;
TABLE<int,0> loc2distedge, loc2distface, loc2distel;
TABLE<int,0> loc2distsegm, loc2distsurfel;
BitArray * isexchangeface, * isexchangevert, * isexchangeedge, * isexchangeel;
BitArray isghostedge, isghostface;
bool coarseupdate;
int overlap;
public:
ParallelMeshTopology (const Mesh & amesh);
~ParallelMeshTopology ();
/// set number of local vertices, reset sizes of loc2dist_vert, isexchangevert...
void SetNV ( int anv );
void SetNE ( int ane );
void SetNSE ( int anse );
void SetNSegm ( int anseg );
void Reset ();
void SetLoc2Glob_Vert ( int locnum, int globnum ) { loc2distvert[locnum][0] = globnum; }
void SetLoc2Glob_VolEl ( int locnum, int globnum ) { loc2distel[locnum-1][0] = globnum; }
void SetLoc2Glob_SurfEl ( int locnum, int globnum ) { loc2distsurfel[locnum-1][0] = globnum; }
void SetLoc2Glob_Segm ( int locnum, int globnum ) { loc2distsegm[locnum-1][0] = globnum; }
int GetLoc2Glob_Vert ( int locnum ) const { return loc2distvert[locnum][0]; }
int GetLoc2Glob_VolEl ( int locnum ) const { return loc2distel[locnum-1][0]; }
void GetVertNeighbours ( int vnum, Array<int> & dests ) const;
int Glob2Loc_SurfEl ( int globnum );
int Glob2Loc_VolEl ( int globnum );
int Glob2Loc_Segm ( int globnum );
int Glob2Loc_Vert ( int globnum );
int GetNDistantPNums ( int locpnum ) const { return loc2distvert[locpnum].Size() / 2 + 1; }
int GetNDistantFaceNums ( int locfacenum ) const { return loc2distface[locfacenum-1].Size() / 2 + 1; }
int GetNDistantEdgeNums ( int locedgenum ) const { return loc2distedge[locedgenum-1].Size() / 2 + 1; }
int GetNDistantElNums ( int locelnum ) const { return loc2distel[locelnum-1].Size() / 2 + 1; }
int GetDistantPNum ( int proc, int locpnum ) const;
int GetDistantEdgeNum ( int proc, int locedgenum ) const;
int GetDistantFaceNum ( int proc, int locedgenum ) const;
int GetDistantElNum ( int proc, int locelnum ) const;
int GetDistantPNums ( int locpnum, int * distpnums ) const;
int GetDistantEdgeNums ( int locedgenum, int * distedgenums ) const;
int GetDistantFaceNums ( int locedgenum, int * distfacenums ) const;
int GetDistantElNums ( int locelnum, int * distfacenums ) const;
void Print() const;
void SetExchangeFace ( int fnr ) { isexchangeface->Set( (fnr-1)*(ntasks+1) ); }
void SetExchangeVert ( int vnum ) { isexchangevert->Set( (vnum-1)*(ntasks+1) ); }
void SetExchangeElement ( int elnum ) { isexchangeel->Set((elnum-1)*(ntasks+1) ); }
void SetExchangeEdge ( int ednum ) { isexchangeedge->Set ((ednum-1)*(ntasks+1)); }
// fuer diese Fkts kann man ja O(N) - bitarrays lassen
bool IsExchangeVert ( PointIndex vnum ) const
{
return loc2distvert[vnum].Size() > 1;
// return isexchangevert->Test((vnum-1)*(ntasks+1));
}
bool IsExchangeEdge ( int ednum ) const
{
/*
if ( isexchangeedge->Test( (ednum-1)*(ntasks+1) ) !=
( loc2distedge[ednum-1].Size() > 1) )
{
cerr << "isexedge differs, id = " << id << ", ednum = " << ednum << endl;
}
*/
// return loc2distedge[ednum-1].Size() > 1;
int i = (ednum-1)*(ntasks+1);
return isexchangeedge->Test(i);
}
bool IsExchangeFace ( int fnum ) const
{
/*
if ( isexchangeface->Test( (fnum-1)*(ntasks+1) ) !=
( loc2distface[fnum-1].Size() > 1) )
{
cerr << "it differs, id = " << id << ", fnum = " << fnum << endl;
}
*/
// nur hier funktioniert's so nicht ???? (JS)
// return loc2distface[fnum-1].Size() > 1;
return isexchangeface->Test( (fnum-1)*(ntasks+1) );
}
bool IsExchangeElement ( int elnum ) const
{
// return loc2distel[elnum-1].Size() > 1;
return isexchangeel->Test((elnum-1)*(ntasks+1));
}
bool IsExchangeSEl ( int selnum ) const
{
return loc2distsurfel[selnum-1].Size() > 1;
}
void SetExchangeFace (int dest, int fnr )
{
// isexchangeface->Set((fnr-1)*(ntasks+1) + (dest+1));
}
void SetExchangeVert (int dest, int vnum )
{
// isexchangevert->Set((vnum-1)*(ntasks+1) + (dest+1) );
}
void SetExchangeElement (int dest, int vnum )
{
isexchangeel->Set( (vnum-1)*(ntasks+1) + (dest+1) );
}
void SetExchangeEdge (int dest, int ednum )
{
// isexchangeedge->Set ( (ednum-1)*(ntasks+1) + (dest+1) );
}
bool IsExchangeVert (int dest, int vnum ) const
{
FlatArray<int> exchange = loc2distvert[vnum];
for (int i = 1; i < exchange.Size(); i += 2)
if (exchange[i] == dest) return true;
return false;
// return isexchangevert->Test((vnum-1)*(ntasks+1) + (dest+1) );
}
bool IsExchangeEdge (int dest, int ednum ) const
{
FlatArray<int> exchange = loc2distedge[ednum-1];
for (int i = 1; i < exchange.Size(); i += 2)
if (exchange[i] == dest) return true;
return false;
// return isexchangeedge->Test((ednum-1)*(ntasks+1) + (dest+1));
}
bool IsExchangeFace (int dest, int fnum ) const
{
FlatArray<int> exchange = loc2distface[fnum-1];
for (int i = 1; i < exchange.Size(); i += 2)
if (exchange[i] == dest) return true;
return false;
// return isexchangeface->Test((fnum-1)*(ntasks+1) + (dest+1) );
}
bool IsExchangeElement (int dest, int elnum ) const
{
// das geht auch nicht
/*
FlatArray<int> exchange = loc2distel[elnum-1];
for (int i = 1; i < exchange.Size(); i += 2)
if (exchange[i] == dest) return true;
return false;
*/
return isexchangeel->Test((elnum-1)*(ntasks+1) + (dest+1));
}
int Overlap() const
{ return overlap; }
int IncreaseOverlap ()
{ overlap++; return overlap; }
void Update();
void UpdateCoarseGrid();
void UpdateCoarseGridOverlap();
void UpdateRefinement ();
void UpdateTopology ();
void UpdateExchangeElements();
void UpdateCoarseGridGlobal();
bool DoCoarseUpdate() const
{ return !coarseupdate; }
void SetDistantFaceNum ( int dest, int locnum, int distnum );
void SetDistantPNum ( int dest, int locnum, int distnum );
void SetDistantEdgeNum ( int dest, int locnum, int distnum );
void SetDistantEl ( int dest, int locnum, int distnum );
void SetDistantSurfEl ( int dest, int locnum, int distnum );
void SetDistantSegm ( int dest, int locnum, int distnum );
bool IsGhostEl ( int elnum ) const { return mesh.VolumeElement(elnum).IsGhost(); }
bool IsGhostFace ( int fanum ) const { return isghostface.Test(fanum-1); }
bool IsGhostEdge ( int ednum ) const { return isghostedge.Test(ednum-1); }
bool IsGhostVert ( int pnum ) const { return mesh.Point(pnum).IsGhost(); }
// inline void SetGhostVert ( const int pnum )
// { isghostvert.Set(pnum-1); }
void SetGhostEdge ( int ednum )
{ isghostedge.Set(ednum-1); }
void ClearGhostEdge ( int ednum )
{ isghostedge.Clear(ednum-1); }
void SetGhostFace ( int fanum )
{ isghostface.Set(fanum-1); }
void ClearGhostFace ( int fanum )
{ isghostface.Clear(fanum-1); }
bool IsElementInPartition ( int elnum, int dest ) const
{
return IsExchangeElement ( dest, elnum);
}
void SetElementInPartition ( int elnum, int dest )
{
SetExchangeElement ( dest, elnum );
}
void SetNVGlob ( int anvglob ) { nvglob = anvglob; }
void SetNEGlob ( int aneglob ) { neglob = aneglob; }
int GetNVGlob () { return nvglob; }
int GetNEGlob () { return neglob; }
};
#endif