MPI: new methode to define neighbors
parent
729a92c5e1
commit
14e12f9138
|
@ -118,10 +118,12 @@ bool openEMS_FDTD_MPI::SetupMPI(TiXmlElement* FDTD_Opts)
|
|||
|
||||
//lower neighbor is ID-1
|
||||
if (m_MyID>0)
|
||||
m_MPI_Op->m_NeighborDown[2]=m_MyID-1;
|
||||
m_MPI_Op->SetNeighborDown(2,m_MyID-1);
|
||||
//upper neighbor is ID+1
|
||||
if (m_MyID<m_NumProc-1)
|
||||
m_MPI_Op->m_NeighborUp[2]=m_MyID+1;
|
||||
m_MPI_Op->SetNeighborUp(2,m_MyID+1);
|
||||
|
||||
m_MPI_Op->SetTag(0);
|
||||
}
|
||||
else
|
||||
cerr << "openEMS_FDTD_MPI::SetupMPI: Warning: Number of MPI processes is 1, skipping MPI engine... " << endl;
|
||||
|
|
|
@ -99,6 +99,20 @@ Engine* Operator_MPI::CreateEngine() const
|
|||
return Engine_SSE_Compressed::New(this);
|
||||
}
|
||||
|
||||
void Operator_MPI::SetNeighborUp(int ny, int id)
|
||||
{
|
||||
if ((ny<0) || (ny>2))
|
||||
return;
|
||||
m_NeighborUp[ny]=id;
|
||||
}
|
||||
|
||||
void Operator_MPI::SetNeighborDown(int ny, int id)
|
||||
{
|
||||
if ((ny<0) || (ny>2))
|
||||
return;
|
||||
m_NeighborDown[ny]=id;
|
||||
}
|
||||
|
||||
void Operator_MPI::Init()
|
||||
{
|
||||
Operator_SSE_Compressed::Init();
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
class Operator_MPI : public Operator_SSE_Compressed
|
||||
{
|
||||
friend class Engine_MPI;
|
||||
friend class openEMS_FDTD_MPI;
|
||||
public:
|
||||
//! Create a new operator
|
||||
static Operator_MPI* New();
|
||||
|
@ -36,6 +35,11 @@ public:
|
|||
|
||||
virtual Engine* CreateEngine() const;
|
||||
|
||||
virtual void SetTag(int tag) {m_MyTag=tag;}
|
||||
|
||||
virtual void SetNeighborUp(int ny, int id);
|
||||
virtual void SetNeighborDown(int ny, int id);
|
||||
|
||||
protected:
|
||||
Operator_MPI();
|
||||
bool m_MPI_Enabled;
|
||||
|
|
Loading…
Reference in New Issue