Commit 74b43883 authored by Chris Cantwell's avatar Chris Cantwell
Browse files

Added Comm initialisation to main() to support parallel execution.

parent f92fcda1
......@@ -179,6 +179,14 @@ namespace Nektar
// Create communicator
CreateComm(argc, argv);
// If running in parallel change the default global sys solution
// type.
if (m_comm->GetSize() > 1)
{
m_solverInfoDefaults["GLOBALSYSSOLN"] =
"IterativeStaticCond";
}
}
......@@ -215,6 +223,14 @@ namespace Nektar
{
m_comm = pComm;
}
// If running in parallel change the default global sys solution
// type.
if (m_comm->GetSize() > 1)
{
m_solverInfoDefaults["GLOBALSYSSOLN"] =
"IterativeStaticCond";
}
}
......@@ -1321,14 +1337,6 @@ namespace Nektar
}
m_comm = GetCommFactory().CreateInstance(vCommModule,argc,argv);
// If running in parallel change the default global sys solution
// type.
if (m_comm->GetSize() > 1)
{
m_solverInfoDefaults["GLOBALSYSSOLN"] =
"IterativeStaticCond";
}
}
}
......
......@@ -74,6 +74,7 @@ namespace Nektar
bool m_declareExpansionAsContField;
bool m_declareExpansionAsDisContField;
LibUtilities::CommSharedPtr m_comm;
LibUtilities::SessionReaderSharedPtr m_session;
SpatialDomains::MeshGraphSharedPtr m_graph;
LibUtilities::FieldIOSharedPtr m_fld;
......
......@@ -181,6 +181,17 @@ int main(int argc, char* argv[])
*/
FieldSharedPtr f = boost::shared_ptr<Field>(new Field());
if (LibUtilities::GetCommFactory().ModuleExists("ParallelMPI"))
{
f->m_comm = LibUtilities::GetCommFactory().CreateInstance(
"ParallelMPI", argc, argv);
}
else
{
f->m_comm = LibUtilities::GetCommFactory().CreateInstance(
"Serial", argc, argv);
}
vector<ModuleSharedPtr> modules;
vector<string> modcmds;
......
......@@ -167,7 +167,7 @@ namespace Nektar
m_f->m_session = LibUtilities::SessionReader::
CreateInstance(0, 0, files);
CreateInstance(0, 0, files, m_f->m_comm);
m_f->m_graph = SpatialDomains::MeshGraph::Read(m_f->m_session,rng);
m_f->m_fld = MemoryManager<LibUtilities::FieldIO>
::AllocateSharedPtr(m_f->m_session->GetComm());
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment