43 namespace LibUtilities
55 MPI_Initialized(&init);
56 ASSERTL0(!init,
"MPI has already been initialised.");
58 int retval = MPI_Init(&narg, &arg);
59 if (retval != MPI_SUCCESS)
61 ASSERTL0(
false,
"Failed to initialise MPI");
64 std::string localName =
"";
65 for (
int i = 0; i < narg; ++i)
67 if (!std::strcmp(arg[i],
"--cwipi"))
69 localName = arg[i + 1];
74 cwipi_init(MPI_COMM_WORLD, localName.c_str(), &localComm);
77 MPI_Comm_size(m_comm, &
m_size);
78 MPI_Comm_rank(m_comm, &
m_rank);
80 m_type =
"Parallel MPI with CWIPI";
#define ASSERTL0(condition, msg)
virtual void v_Finalise()
std::string m_type
Type of communication.
CommFactory & GetCommFactory()
static CommSharedPtr create(int narg, char *arg[])
Creates an instance of this class.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
virtual void v_Finalise()
static std::string className
Name of class.
int m_size
Number of processes.
CommCwipi(int narg, char *arg[])