MPI: new check extension compatibility framework
Signed-off-by: Thorsten Liebig <Thorsten.Liebig@gmx.de>pull/1/head
parent
a7380816e8
commit
a704b49947
|
@ -38,6 +38,7 @@ public:
|
|||
|
||||
virtual bool IsCylinderCoordsSave(bool closedAlpha, bool R0_included) const {UNUSED(closedAlpha); UNUSED(R0_included); return true;}
|
||||
virtual bool IsCylindricalMultiGridSave(bool child) const {UNUSED(child); return true;}
|
||||
virtual bool IsMPISave() const {return true;}
|
||||
|
||||
virtual string GetExtensionName() const {return string("Conducting Sheet Extension");}
|
||||
|
||||
|
|
|
@ -38,6 +38,9 @@ public:
|
|||
virtual bool IsCylinderCoordsSave(bool closedAlpha, bool R0_included) const {UNUSED(closedAlpha); UNUSED(R0_included); return true;}
|
||||
virtual bool IsCylindricalMultiGridSave(bool child) const {UNUSED(child); return true;}
|
||||
|
||||
// FIXME, this extension is not save or unknown to be save to use with MPI
|
||||
virtual bool IsMPISave() const {return false;}
|
||||
|
||||
virtual std::string GetExtensionName() const {return std::string("Extension for the Cylinder-Coords Operator");}
|
||||
|
||||
virtual void ShowStat(ostream &ostr) const;
|
||||
|
|
|
@ -40,6 +40,7 @@ public:
|
|||
|
||||
virtual bool IsCylinderCoordsSave(bool closedAlpha, bool R0_included) const {UNUSED(closedAlpha); UNUSED(R0_included); return true;}
|
||||
virtual bool IsCylindricalMultiGridSave(bool child) const {UNUSED(child); return true;}
|
||||
virtual bool IsMPISave() const {return true;}
|
||||
|
||||
virtual string GetExtensionName() const {return string("Excitation Extension");}
|
||||
|
||||
|
|
|
@ -36,6 +36,7 @@ public:
|
|||
|
||||
virtual bool IsCylinderCoordsSave(bool closedAlpha, bool R0_included) const {UNUSED(closedAlpha); UNUSED(R0_included); return true;}
|
||||
virtual bool IsCylindricalMultiGridSave(bool child) const {UNUSED(child); return true;}
|
||||
virtual bool IsMPISave() const {return true;}
|
||||
|
||||
virtual string GetExtensionName() const {return string("Drude/Lorentz Dispersive Material Extension");}
|
||||
|
||||
|
|
|
@ -42,6 +42,7 @@ public:
|
|||
|
||||
virtual bool IsCylinderCoordsSave(bool closedAlpha, bool R0_included) const;
|
||||
virtual bool IsCylindricalMultiGridSave(bool child) const;
|
||||
virtual bool IsMPISave() const {return true;}
|
||||
|
||||
virtual string GetExtensionName() const {return string("Mur ABC Extension");}
|
||||
|
||||
|
|
|
@ -40,6 +40,9 @@ public:
|
|||
virtual bool IsCylinderCoordsSave(bool closedAlpha, bool R0_included) const {UNUSED(closedAlpha); UNUSED(R0_included); return false;}
|
||||
virtual bool IsCylindricalMultiGridSave(bool child) const {UNUSED(child); return false;}
|
||||
|
||||
// FIXME, this extension is not save to use with MPI
|
||||
virtual bool IsMPISave() const {return false;}
|
||||
|
||||
virtual string GetExtensionName() const {return string("Total-Field/Scattered-Field Extension");}
|
||||
|
||||
virtual void ShowStat(ostream &ostr) const;
|
||||
|
|
|
@ -41,6 +41,8 @@ public:
|
|||
//! Returns always true if base grid, Create_UPML will create proper child pml extensions.
|
||||
virtual bool IsCylindricalMultiGridSave(bool child) const {if (child) return false; return true;}
|
||||
|
||||
virtual bool IsMPISave() const {return true;}
|
||||
|
||||
void SetBoundaryCondition(const int* BCs, const unsigned int size[6]);
|
||||
|
||||
void SetRange(const unsigned int start[3], const unsigned int stop[3]);
|
||||
|
|
|
@ -56,6 +56,9 @@ public:
|
|||
//! The cylindrical multi grid operator will check whether the extension is save to use. Default is false. Derive this method to override.
|
||||
virtual bool IsCylindricalMultiGridSave(bool child) const {UNUSED(child); return false;}
|
||||
|
||||
//! The MPI operator (if enabled) will check whether the extension is compatible with MPI. Default is false. Derive this method to override.
|
||||
virtual bool IsMPISave() const {return false;}
|
||||
|
||||
virtual string GetExtensionName() const {return string("Abstract Operator Extension Base Class");}
|
||||
|
||||
virtual void ShowStat(ostream &ostr) const;
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include "operator_sse_compressed.h"
|
||||
#include "engine_sse_compressed.h"
|
||||
#include "engine_mpi.h"
|
||||
#include "extensions/operator_extension.h"
|
||||
#include "tools/array_ops.h"
|
||||
#include "tools/useful.h"
|
||||
#include "mpi.h"
|
||||
|
@ -163,6 +164,21 @@ unsigned int Operator_MPI::GetNumberOfLines(int ny) const
|
|||
return Operator_SSE_Compressed::GetNumberOfLines(ny)-1;
|
||||
}
|
||||
|
||||
void Operator_MPI::AddExtension(Operator_Extension* op_ext)
|
||||
{
|
||||
if (m_MPI_Enabled==false)
|
||||
return Operator_SSE_Compressed::AddExtension(op_ext);
|
||||
|
||||
if (op_ext->IsMPISave())
|
||||
Operator_SSE_Compressed::AddExtension(op_ext);
|
||||
else
|
||||
{
|
||||
delete op_ext;
|
||||
cerr << "Operator_MPI::AddExtension: Warning: Operator extension \"" << op_ext->GetExtensionName() << "\" is not compatible with MPI!! skipping...!" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
string Operator_MPI::PrependRank(string name)
|
||||
{
|
||||
stringstream out_name;
|
||||
|
|
|
@ -52,6 +52,8 @@ public:
|
|||
|
||||
virtual unsigned int GetNumberOfLines(int ny) const;
|
||||
|
||||
virtual void AddExtension(Operator_Extension* op_ext);
|
||||
|
||||
protected:
|
||||
Operator_MPI();
|
||||
bool m_MPI_Enabled;
|
||||
|
|
Loading…
Reference in New Issue