5 #ifndef _BCP_MESSAGE_MPI_H 6 #define _BCP_MESSAGE_MPI_H 10 #if defined(COIN_HAS_MPI) 20 static bool mpi_init_called;
23 void check_error(
const int code,
const char* str)
const;
29 static int is_mpi(
int argc,
char *argv[]);
32 BCP_mpi_environment(
int argc,
char *argv[]);
33 ~BCP_mpi_environment();
40 bool alive(
const int pid);
41 const int*
alive(
int num,
const int* pids);
44 void send(
const int target,
47 void multicast(
int num,
const int* targets,
49 void multicast(
int num,
const int* targets,
54 const double timeout);
76 int MPIDI_BGLTS_get_num_messages();
virtual int register_process(USER_initialize *user_init)=0
A process can register (receive its process id) with the message passing environment.
virtual int num_procs()
Return the number of processes.
virtual void send(const int target, const BCP_message_tag tag)=0
Send an empty message (message tag only) to the process given by the frist argument.
virtual int start_process(const BCP_string &exe, const bool debug)=0
Spawn a new process.
This class describes the message buffer used for all processes of BCP.
This is an abstract base class that describes the message passing environment.
This class is an abstract base class for the initializer class the user has to provide.
BCP_message_tag
This enumerative constant describes the message tags different processes of BCP understand.
virtual void receive(const int source, const BCP_message_tag tag, BCP_buffer &buf, const double timeout)=0
Blocking receive with timeout.
virtual int parent_process()=0
Return the process id of the parent process (the process that spawned the currnet process...
virtual bool start_processes(const BCP_string &exe, const int proc_num, const bool debug, int *ids)=0
Spawn proc_num processes, all with the same executable.
This class is a very simple impelementation of a constant length string.
virtual bool alive(const int pid)=0
Test if the process given by the argument is alive or not.
virtual void multicast(int num, const int *targets, const BCP_message_tag tag)=0
Send an empty message (message tag only) to all the processes in the process array.
virtual bool probe(const int source, const BCP_message_tag tag)=0
Probe if there are any messages from the given process with the given message tag.