diff --git a/src/alu3dgrid_parallel.cc b/src/alu3dgrid_parallel.cc index a54c281a9cc2eeef946a0db114ffc78aeeb5e616..f93e8dd9d4c2b7833d94334492f31826d1ffee25 100644 --- a/src/alu3dgrid_parallel.cc +++ b/src/alu3dgrid_parallel.cc @@ -1,11 +1,35 @@ #ifndef __ALU3DGRID_PARALLEL_CC_INCLUDED__ #define __ALU3DGRID_PARALLEL_CC_INCLUDED__ -#define _BSGRID_PARALLEL_ - #include "alu3dgrid_parallel.h" -namespace BernhardSchuppGrid { +// partitioning libs +// METIS if not found here then dummy version is included +extern "C" { +#undef METISTITLE +#include <metis.h> +#include "parallel/metis.c" +} + + +// PARTY_LIB if not found here then dummy version is included +#ifdef VERSION +#define _VER_SAVE VERSION +#undef VERSION +#endif + +#include <party_lib.h> +#ifdef VERSION +#define PARTY_LIB_H_INCLUDED +#ifdef _VER_SAVE +#undef VERSION +#define VERSION _VER_SAVE +#endif // end _VER_SAVE +#else +#include "parallel/party_lib.c" +#endif + +namespace ALU3dGridSpace { #include "parallel/gitter_pll_sti.cc" #include "parallel/gitter_pll_ldb.cc" diff --git a/src/alu3dgrid_parallel.h b/src/alu3dgrid_parallel.h index 68618fe2876cfff5a1c4cfecc316d36881c90cdc..0f2cc46342f2f1c89d9ae58877cb0275a67e04a6 100644 --- a/src/alu3dgrid_parallel.h +++ b/src/alu3dgrid_parallel.h @@ -3,6 +3,7 @@ #include "alu3dgrid_serial.h" +#if 0 // partitioning libs // METIS if not found here then dummy version is included extern "C" { @@ -20,8 +21,9 @@ extern "C" { #ifdef VERSION #define PARTY_LIB_H_INCLUDED #endif +#endif -namespace BernhardSchuppGrid { +namespace ALU3dGridSpace { // the parallel stuff #include "parallel/gitter_pll_sti.h" diff --git a/src/alu3dgrid_serial.cc b/src/alu3dgrid_serial.cc index ed7850e3e6c2e1baeeb3755eb90fe77169dd05be..d5be60e7bbc13bfc96e2e9387d3514d0c28395dd 100644 --- a/src/alu3dgrid_serial.cc +++ b/src/alu3dgrid_serial.cc @@ -3,9 +3,7 @@ #include "alu3dgrid_serial.h" -void fakelibtest () {} - -namespace BernhardSchuppGrid { +namespace ALU3dGridSpace { // bsgrid original sources #include "serial/gitter_geo.cc" diff --git a/src/alu3dgrid_serial.h b/src/alu3dgrid_serial.h index c5cda6b6c71027c1d348fafe3cb39b8fcca487b9..1bc9a24fa412ea5e84c36418c135609558144f2f 100644 --- a/src/alu3dgrid_serial.h +++ b/src/alu3dgrid_serial.h @@ -7,9 +7,9 @@ void fakelibtest (); -#define _DUNE_USES_BSGRID_ +#define _DUNE_USES_ALU3DGRID_ -namespace BernhardSchuppGrid { +namespace ALU3dGridSpace { typedef enum {hexa,tetra} grid_t; diff --git a/src/parallel/gitter_pll_impl.cc b/src/parallel/gitter_pll_impl.cc index bb8af63b5aa97244711c382b45ee59831d0649f0..ad83a45897b8a287b5691a91ccb5855a2db780ab 100644 --- a/src/parallel/gitter_pll_impl.cc +++ b/src/parallel/gitter_pll_impl.cc @@ -379,7 +379,7 @@ void TetraPllXBase :: writeDynamicState (ObjectStream & os, int face) const { } */ -#ifdef _DUNE_USES_BSGRID_ +#ifdef _DUNE_USES_ALU3DGRID_ // write level to know the level of ghost on the other side //logFile << "writeLevel " << mytetra().level() << "\n"; @@ -906,7 +906,7 @@ void HexaPllBaseX :: writeDynamicState (ObjectStream & os, int face) const { } */ -#ifdef _DUNE_USES_BSGRID_ +#ifdef _DUNE_USES_ALU3DGRID_ // write level to know the level of ghost on the other side //logFile << "writeLevel " << mytetra().level() << "\n"; diff --git a/src/parallel/gitter_pll_impl.h b/src/parallel/gitter_pll_impl.h index b9b826fff94cb1027a018877343c4a845937c8e8..60ec515b6e531f67e7596bb2c93242fc832db0cc 100644 --- a/src/parallel/gitter_pll_impl.h +++ b/src/parallel/gitter_pll_impl.h @@ -1308,7 +1308,7 @@ template < class A > void BndsegPllBaseXClosure < A > :: readDynamicState (Objec } */ -#ifdef _DUNE_USES_BSGRID_ +#ifdef _DUNE_USES_ALU3DGRID_ // read the real level of ghost os.readObject( _ghostLevel ); //logFile << "readLevel " << _ghostLevel << "\n"; diff --git a/src/parallel/metis.c b/src/parallel/metis.c new file mode 100644 index 0000000000000000000000000000000000000000..d1219018cea5aa3ce850b6a09c5f657dac6a50bd --- /dev/null +++ b/src/parallel/metis.c @@ -0,0 +1,38 @@ +// (c) -- +#ifndef METISTITLE + +#warning -- Compile parallel version without METIS !!! + +#ifndef METIS_C_INCLUDED +#define METIS_C_INCLUDED + +#ifdef IBM_XLC + #define _ANSI_HEADER +#endif + +#ifdef _ANSI_HEADER + using namespace std; + #include <iostream> +#else + #include <iostream.h> +#endif + +static const char metmess [] = "**INFO Aus lizenzrechtlichen Gr\"unden steht die Bibliothek\n" + " metis 3.0 nicht im Rahmen der Quelldateien auf diesem\n" + " Datentr\"ager zur Verf\"ugung. Weitere Hinweise sind in\n" + " der Datei " __FILE__ " enthalten." ; + +void METIS_PartGraphKway(int *,idxtype *,idxtype *,idxtype *,idxtype *,int *,int *,int *,int *,int *,idxtype *) { + cerr << metmess << endl ; + abort(); + return ; +} + +void METIS_PartGraphRecursive(int *,idxtype *,idxtype *,idxtype *,idxtype *,int *,int *,int *,int *,int *,idxtype *) { + cerr << metmess << endl ; + abort(); + return ; +} + +#endif +#endif diff --git a/src/parallel/metis.h b/src/parallel/metis.h index 6d6621354cd9291fd78001bde7f35800c23ce76f..2dee567d397e897f6e265ba0f1b8b7c4707c19fe 100644 --- a/src/parallel/metis.h +++ b/src/parallel/metis.h @@ -1,8 +1,6 @@ // (c) -- #ifndef METISTITLE -#warning -- Compile parallel version without METIS !!! - #ifndef METIS_H_INCLUDED #define METIS_H_INCLUDED @@ -19,22 +17,8 @@ typedef int idxtype ; -static const char metmess [] = "**INFO Aus lizenzrechtlichen Gr\"unden steht die Bibliothek\n" - " metis 3.0 nicht im Rahmen der Quelldateien auf diesem\n" - " Datentr\"ager zur Verf\"ugung. Weitere Hinweise sind in\n" - " der Datei " __FILE__ " enthalten." ; - -inline void METIS_PartGraphKway(int *,idxtype *,idxtype *,idxtype *,idxtype *,int *,int *,int *,int *,int *,idxtype *) { - cerr << metmess << endl ; - abort(); - return ; -} - -inline void METIS_PartGraphRecursive(int *,idxtype *,idxtype *,idxtype *,idxtype *,int *,int *,int *,int *,int *,idxtype *) { - cerr << metmess << endl ; - abort(); - return ; -} +void METIS_PartGraphKway(int *,idxtype *,idxtype *,idxtype *,idxtype *,int *,int *,int *,int *,int *,idxtype *); +void METIS_PartGraphRecursive(int *,idxtype *,idxtype *,idxtype *,idxtype *,int *,int *,int *,int *,int *,idxtype *); #endif #endif diff --git a/src/parallel/party_lib.c b/src/parallel/party_lib.c new file mode 100644 index 0000000000000000000000000000000000000000..6ae5eb623c1e136c0f23e52e97f38a27bb71877a --- /dev/null +++ b/src/parallel/party_lib.c @@ -0,0 +1,59 @@ +// (c) -- +#ifndef PARTY_LIB_C_INCLUDED +#define PARTY_LIB_C_INCLUDED + +#warning -- Compile parallel version without PARTY_LIB !!! + +#ifdef IBM_XLC + #define _ANSI_HEADER +#endif + +#ifdef _ANSI_HEADER + using namespace std; + #include <iostream> +#else + #include <iostream.h> +#endif + +static const char parmess [] = "**INFO Aus lizenzrechtlichen Gr\"unden steht die Bibliothek\n" + " PARTY 1.1 nicht im Rahmen der Quelldateien auf diesem\n" + " Datentr\"ager zur Verf\"ugung. Weitere Hinweise sind in\n" + " der Datei " __FILE__ " enthalten." ; + + +int global_linear (int,float *,int,float,int *) { + cerr << parmess << endl ; + abort(); + return 0 ; +} + +int global_scattered (int,float *,int,float,int *) { + cerr << parmess << endl ; + abort(); + return 0 ; +} + +int global_gain (int,float *,int *,int *,int *,int,float,int *) { + cerr << parmess << endl ; + abort(); + return 0 ; +} + +int global_farhat (int,float *,int *,int *,int *,int,float,int *) { + cerr << parmess << endl ; + abort(); + return 0 ; +} + +int local_kl (int,float *,int *,int *,int *,int,float, int *,int) { + cerr << parmess << endl ; + abort(); + return 0 ; +} + +int local_hs (int n, float *vertex_w, int *edge_p, int *edge, int *edge_w,int p, float add_bal, int *part,int Output) { + cerr << parmess << endl ; + return 0 ; +} + +#endif diff --git a/src/parallel/party_lib.h b/src/parallel/party_lib.h index 6113ffdf7870ffa0ce8374b70668e7be0b75547a..54366017bb7900bc3e83ecfa273d3fcd1a2ceadb 100644 --- a/src/parallel/party_lib.h +++ b/src/parallel/party_lib.h @@ -28,8 +28,6 @@ #ifndef PARTY_LIB_H_INCLUDED #define PARTY_LIB_H_INCLUDED -#warning -- Compile parallel version without PARTY_LIB !!! - #ifdef IBM_XLC #define _ANSI_HEADER #endif @@ -41,45 +39,11 @@ #include <iostream.h> #endif -static const char parmess [] = "**INFO Aus lizenzrechtlichen Gr\"unden steht die Bibliothek\n" - " PARTY 1.1 nicht im Rahmen der Quelldateien auf diesem\n" - " Datentr\"ager zur Verf\"ugung. Weitere Hinweise sind in\n" - " der Datei " __FILE__ " enthalten." ; - - -inline int global_linear (int,float *,int,float,int *) { - cerr << parmess << endl ; - abort(); - return 0 ; -} - -inline int global_scattered (int,float *,int,float,int *) { - cerr << parmess << endl ; - abort(); - return 0 ; -} - -inline int global_gain (int,float *,int *,int *,int *,int,float,int *) { - cerr << parmess << endl ; - abort(); - return 0 ; -} - -inline int global_farhat (int,float *,int *,int *,int *,int,float,int *) { - cerr << parmess << endl ; - abort(); - return 0 ; -} - -inline int local_kl (int,float *,int *,int *,int *,int,float, int *,int) { - cerr << parmess << endl ; - abort(); - return 0 ; -} - -inline int local_hs (int n, float *vertex_w, int *edge_p, int *edge, int *edge_w,int p, float add_bal, int *part,int Output) { - cerr << parmess << endl ; - return 0 ; -} +int global_linear (int,float *,int,float,int *); +int global_scattered (int,float *,int,float,int *); +int global_gain (int,float *,int *,int *,int *,int,float,int *); +int global_farhat (int,float *,int *,int *,int *,int,float,int *); +int local_kl (int,float *,int *,int *,int *,int,float, int *,int); +int local_hs (int n, float *vertex_w, int *edge_p, int *edge, int *edge_w,int p, float add_bal, int *part,int Output); #endif diff --git a/src/serial/gitter_impl.h b/src/serial/gitter_impl.h index 83acf3ea01893849723eca594c26e20a9e0eeac6..d945448080e03e20dd07a64b627c3b8b5b920ff7 100644 --- a/src/serial/gitter_impl.h +++ b/src/serial/gitter_impl.h @@ -76,7 +76,7 @@ class GitterBasis : public virtual Gitter, public Gitter :: Geometric { }; class Hbnd3Default : public hbndseg3_GEO -#ifdef _DUNE_USES_BSGRID_ +#ifdef _DUNE_USES_ALU3DGRID_ , public Dune_hbndDefault<1> #endif { @@ -98,7 +98,7 @@ class GitterBasis : public virtual Gitter, public Gitter :: Geometric { typedef Hbnd3Top < Hbnd3Default > hbndseg3_IMPL ; class Hbnd4Default : public hbndseg4_GEO -#ifdef _DUNE_USES_BSGRID_ +#ifdef _DUNE_USES_ALU3DGRID_ , public Dune_hbndDefault<4> #endif { diff --git a/src/serial/gitter_sti.h b/src/serial/gitter_sti.h index f6c2121f5f48c0909795b0f3fb2249e3831f32de..0b415cac2e4850f63f799566ce4080efd0584e9b 100644 --- a/src/serial/gitter_sti.h +++ b/src/serial/gitter_sti.h @@ -26,10 +26,10 @@ #include "xdrclass.h" -// if DUNE uses this grid the _DUNE_USES_BSGRID_ variable should be defined +// if DUNE uses this grid the _DUNE_USES_ALU3DGRID_ variable should be defined // otherwise some dummy are set #include "indexstack.h" -#ifdef _DUNE_USES_BSGRID_ +#ifdef _DUNE_USES_ALU3DGRID_ enum { lengthOfFiniteStack = 10000 }; typedef IndexStack<int,lengthOfFiniteStack> IndexManagerType; #else @@ -181,7 +181,7 @@ class Gitter { // Kanten, Fl"achen, Elemente und Randelemente definiert. class Dune_vertex { -#ifdef _DUNE_USES_BSGRID_ +#ifdef _DUNE_USES_ALU3DGRID_ protected: int _idx; Dune_vertex () : _idx(-1) {} @@ -191,7 +191,7 @@ class Gitter { virtual void backupIndex (ostream & os ) const {}; virtual void restoreIndex (istream & is ) {}; -#ifdef _DUNE_USES_BSGRID_ +#ifdef _DUNE_USES_ALU3DGRID_ inline int getIndex () const { return _idx; } void setIndex ( const int index ) { _idx = index; } #else @@ -203,7 +203,7 @@ class Gitter { public : class vertex : public stiExtender_t :: VertexIF -#ifdef _DUNE_USES_BSGRID_ +#ifdef _DUNE_USES_ALU3DGRID_ , public Dune_vertex #endif { @@ -227,7 +227,7 @@ class Gitter { // numbering for hedge and hface class Dune_hface_or_hedge { -#ifdef _DUNE_USES_BSGRID_ +#ifdef _DUNE_USES_ALU3DGRID_ protected: int _index; // global_index, unique per level but not per processor Dune_hface_or_hedge () : _index (-1) {} @@ -300,7 +300,7 @@ class Gitter { class Dune_helement { -#ifdef _DUNE_USES_BSGRID_ +#ifdef _DUNE_USES_ALU3DGRID_ protected: int _index; // global_index, unique per level but not per processor bool _refinedTag; // true if element was refined @@ -653,7 +653,7 @@ class Gitter { private : double _c [3] ; int _lvl ; -#ifndef _DUNE_USES_BSGRID_ +#ifndef _DUNE_USES_ALU3DGRID_ int _idx ; // Vertexindex zum Datenrausschreiben #endif // wird nur verwendet, wenn nicht fuer Dune ubersetzt } ; @@ -1122,7 +1122,7 @@ class Gitter { virtual void backupCMode (ostream &) const ; virtual void backupCMode (const char*,const char *) const ; friend class MacroGridBuilder ; -#ifdef _DUNE_USES_BSGRID_ +#ifdef _DUNE_USES_ALU3DGRID_ friend class DuneParallelGridMover; #endif } ; @@ -1433,31 +1433,31 @@ inline int Gitter :: helement :: leaf () const { } inline int Gitter :: Dune_hface_or_hedge :: getIndex () const { -#ifdef _DUNE_USES_BSGRID_ +#ifdef _DUNE_USES_ALU3DGRID_ assert( _index >= 0); return _index; #else - std::cerr << "Dune_hface_or_hedge::getIndex () -- ERROR: '_DUNE_USES_BSGRID_' is not defined, so index cannot be used! " << __FILE__ << __LINE__ << "\n"; + std::cerr << "Dune_hface_or_hedge::getIndex () -- ERROR: '_DUNE_USES_ALU3DGRID_' is not defined, so index cannot be used! " << __FILE__ << __LINE__ << "\n"; abort(); return -1; #endif } inline void Gitter :: Dune_hface_or_hedge :: setIndex (const int index) { -#ifdef _DUNE_USES_BSGRID_ +#ifdef _DUNE_USES_ALU3DGRID_ _index = index; #endif } inline void Gitter :: Dune_hface_or_hedge :: backupIndex (ostream & os ) const { -#ifdef _DUNE_USES_BSGRID_ +#ifdef _DUNE_USES_ALU3DGRID_ cerr << "Dune_hface_or_hedge :: backupIndex : Implemenation should be in inherited class " << __FILE__ << __LINE__ << "\n"; abort(); #endif } inline void Gitter :: Dune_hface_or_hedge :: restoreIndex (istream & is ) { -#ifdef _DUNE_USES_BSGRID_ +#ifdef _DUNE_USES_ALU3DGRID_ cerr << "Dune_hface_or_hedge :: restoreIndex : Implemenation should be in inherited class " << __FILE__ << __LINE__ << "\n"; abort(); #endif @@ -1466,13 +1466,13 @@ inline void Gitter :: Dune_hface_or_hedge :: restoreIndex (istream & is ) { // Dune extensions inline void Gitter :: Dune_helement :: resetRefinedTag () { -#ifdef _DUNE_USES_BSGRID_ +#ifdef _DUNE_USES_ALU3DGRID_ _refinedTag = false; #endif } inline bool Gitter :: Dune_helement :: hasBeenRefined () const { -#ifdef _DUNE_USES_BSGRID_ +#ifdef _DUNE_USES_ALU3DGRID_ return _refinedTag; #else return false; @@ -1480,31 +1480,31 @@ inline bool Gitter :: Dune_helement :: hasBeenRefined () const { } inline int Gitter :: Dune_helement :: getIndex () const { -#ifdef _DUNE_USES_BSGRID_ +#ifdef _DUNE_USES_ALU3DGRID_ assert( _index >= 0); return _index; #else - std::cerr << "helement::getIndex () -- ERROR: '_DUNE_USES_BSGRID_' is not defined, so index cannot be used! " << __FILE__ << __LINE__ << "\n"; + std::cerr << "helement::getIndex () -- ERROR: '_DUNE_USES_ALU3DGRID_' is not defined, so index cannot be used! " << __FILE__ << __LINE__ << "\n"; abort(); return -1; #endif } inline void Gitter :: Dune_helement :: setIndex (const int index) { -#ifdef _DUNE_USES_BSGRID_ +#ifdef _DUNE_USES_ALU3DGRID_ _index = index; #endif } inline void Gitter :: Dune_helement :: backupIndex (ostream & os ) const { -#ifdef _DUNE_USES_BSGRID_ +#ifdef _DUNE_USES_ALU3DGRID_ cerr << "Dune_helement :: backupIndex : Implemenation should be in inherited class " << __FILE__ << __LINE__ << "\n"; abort(); #endif } inline void Gitter :: Dune_helement :: restoreIndex (istream & is ) { -#ifdef _DUNE_USES_BSGRID_ +#ifdef _DUNE_USES_ALU3DGRID_ cerr << "Dune_helement :: restoreIndex : Implemenation should be in inherited class " << __FILE__ << __LINE__ << "\n"; abort(); #endif @@ -1575,13 +1575,13 @@ inline void Gitter :: Geometric :: VertexGeo :: project(const ProjectVertex &pv) } inline void Gitter :: Geometric :: VertexGeo :: backup ( ostream & os ) const { -#ifdef _DUNE_USES_BSGRID_ +#ifdef _DUNE_USES_ALU3DGRID_ os.write( ((const char *) &_idx ), sizeof(int) ) ; #endif } inline void Gitter :: Geometric :: VertexGeo :: restore ( istream & is ) { -#ifdef _DUNE_USES_BSGRID_ +#ifdef _DUNE_USES_ALU3DGRID_ //_indexmanager.freeIndex( _idx ); is.read ( ((char *) &_idx), sizeof(int) ); #endif diff --git a/src/serial/gitter_tetra_top.h b/src/serial/gitter_tetra_top.h index 94f0cf2cba480de7030d73416138d97c696e80f0..68185306eec66f2a274380595d32646c1d77900f 100644 --- a/src/serial/gitter_tetra_top.h +++ b/src/serial/gitter_tetra_top.h @@ -1449,7 +1449,7 @@ template < class A > void TetraTop < A > :: backupCMode (ostream & os) const { // buckupTetra template < class A > void TetraTop < A > :: backupIndex (ostream & os) const { -#ifdef _DUNE_USES_BSGRID_ +#ifdef _DUNE_USES_ALU3DGRID_ os.write( ((const char *) & this->_index ), sizeof(int) ) ; {for (const innertetra_t * c = down () ; c ; c = c->next ()) c->backupIndex (os) ; } #endif @@ -1480,7 +1480,7 @@ template < class A > void TetraTop < A > :: backup (XDRstream_out & os) const // overloaded restoreIndex Method template < class A > inline void TetraTop < A > :: restoreIndex (istream & is) { -#ifdef _DUNE_USES_BSGRID_ +#ifdef _DUNE_USES_ALU3DGRID_ // free index from constructor //_indexManager.freeIndex( this->getIndex() ); is.read ( ((char *) &(this->_index) ), sizeof(int) ); diff --git a/src/serial/indexstack.h b/src/serial/indexstack.h index 8a95d2a8f3a7fb0be637ca9af4023169156de417..1c86ebf6164f9641d61f8690ad78f41b7a320ba2 100644 --- a/src/serial/indexstack.h +++ b/src/serial/indexstack.h @@ -15,7 +15,7 @@ #include <stack.h> #endif -#ifdef _DUNE_USES_BSGRID_ +#ifdef _DUNE_USES_ALU3DGRID_ template<class T, int length> class FiniteStack {