7#ifndef BALL_SYSTEM_MPISUPPORT_H
8#define BALL_SYSTEM_MPISUPPORT_H
14#ifndef BALL_DATATYPE_STRING_H
18#ifndef BALL_MATHS_VECTOR3_H
22#ifndef BALL_COMMON_EXCEPTION_H
31# define BALL_HAS_MPI2_SUPPORT TRUE
33# undef BALL_HAS_MPI2_SUPPORT
65 MPISupport(MPI_Comm default_communicator = MPI_COMM_WORLD);
82 MPI_Comm default_communicator = MPI_COMM_WORLD,
83 bool accept_communicator =
true);
134 void init(
int argc,
char** argv,
bool accept_communicator =
true);
178 template <
typename valuetype>
184 template <
typename valuetype>
192 template <
typename valuetype>
199 template <
typename valuetype>
268#ifdef BALL_HAS_MPI2_SUPPORT
269 Size spawn(
const String& command,
char *argv[],
Size wanted_number_of_processes = 0,
bool merge_communicator =
true);
278 template <
typename valuetype>
279 valuetype
getSum(valuetype& local_value);
287 template <
typename valuetype>
297 template <
typename valuetype>
307 template <
typename valuetype>
320 int tag = MPI_ANY_TAG,
bool broadcast =
true,
int receiver = 0);
327 bool broadcast =
true,
int source = 0);
MPI_Datatype mpi_Vector3_float_type_
Index getSize()
Return the number of processes in MPI_COMM_WORLD.
System * receiveSystem(bool broadcast=true, int source=MPI_ANY_SOURCE)
MPI_Info mpi_info_object_
valuetype getSum(valuetype &local_value)
void * distributeDatapoints(const void *input, int size, Size &numpoints, MPI_Datatype datatype)
void acceptCombinedDatapoints(std::vector< valuetype > &combined_set, std::vector< valuetype > &our_share)
void * acceptDatapoints(Size &numpoints, MPI_Datatype datatype)
void combineDatapoints(const std::vector< valuetype > &our_share)
bool getFinalizeOnDestruct()
Index getRank()
Return the rank of this process.
void * acceptCombinedDatapoints(const void *input, int size, Size &numpoints, MPI_Datatype datatype)
void setMpiInfo(const MPI_Info &mpi_info)
valuetype getMaximum(valuetype &local_value)
MPISupport(MPI_Comm default_communicator=MPI_COMM_WORLD)
MPI_Comm getDefaultCommunicator()
Return the default communicator used for MPI calls.
valuetype getMinimum(valuetype &local_value)
void setFinalizeOnDestruct(bool new_value)
Decides whether MPI_Finalize will be called in the destructor.
bool finalize_on_destruct_
void combineDatapoints(const void *input, int size, MPI_Datatype datatype)
void acceptDatapoints(std::vector< valuetype > &our_share)
void receivePersistenceStream_(std::istringstream &in, int tag=MPI_ANY_TAG, bool broadcast=true, int source=0)
void setDefaultCommunicator(MPI_Comm default_communicator)
Set the default communicator used for MPI calls.
MPI_Datatype mpi_Vector3_double_type_
Options * receiveOptions(bool broadcast=true, int source=MPI_ANY_SOURCE)
void sendSystem(const System &system, bool broadcast=true, int receiver=0)
bool isMaster()
Returns true if this process is the master, false otherwise.
MPI_Comm default_communicator_
valuetype getProduct(valuetype &local_value)
void sendPersistenceStream_(const std::ostringstream &stream, int tag=MPI_ANY_TAG, bool broadcast=true, int receiver=0)
MPISupport(int argc, char **argv, MPI_Comm default_communicator=MPI_COMM_WORLD, bool accept_communicator=true)
void sendOptions(const Options &options, bool broadcast=true, int receiver=0)
void distributeDatapoints(const std::vector< valuetype > &input, std::vector< valuetype > &our_share)
void init(int argc, char **argv, bool accept_communicator=true)