Go to the documentation of this file.
3 #ifndef _BCP_MESSAGE_SINGLE_H
4 #define _BCP_MESSAGE_SINGLE_H
40 const int*
alive(
int num,
const int* pids);
43 void send(
const int target,
53 const double timeout);
void send(const int target, const BCP_message_tag tag, const BCP_buffer &buf)
Send the message in the buffer with the given message tag to the process given by the first argument.
BCP_single_environment(int my_id)
void multicast(int num, const int *targets, const BCP_message_tag tag)
Send an empty message (message tag only) to all the processes in the process array.
const int * alive(int num, const int *pids)
Test if the processes given by the process array in the argument are alive or not.
int parent_process()
Return the process id of the parent process (the process that spawned the currnet process.
BCP_message_tag
This enumerative constant describes the message tags different processes of BCP understand.
static std::map< int, BCP_process * > processes
int start_process(const BCP_string &exe, const bool debug)
Spawn a new process.
void receive(const int source, const BCP_message_tag tag, BCP_buffer &buf, const double timeout)
Blocking receive with timeout.
void multicast(int num, const int *targets, const BCP_message_tag tag, const BCP_buffer &buf)
Send the message in the buffer with the given message tag to all processes in the process array.
This class is a very simple impelementation of a constant length string.
void send(const int target, const BCP_message_tag tag)
Send an empty message (message tag only) to the process given by the frist argument.
This class is an abstract base class for the initializer class the user has to provide.
bool probe(const int source, const BCP_message_tag tag)
Probe if there are any messages from the given process with the given message tag.
virtual ~BCP_single_environment()
bool start_processes(const BCP_string &exe, const int proc_num, const BCP_vec< BCP_string > &machines, const bool debug, int *ids)
Spawn proc_num processes on the machines given by the third argument, all with the same executable.
bool start_processes(const BCP_string &exe, const int proc_num, const bool debug, int *ids)
Spawn proc_num processes, all with the same executable.
void set_arguments(const int argnum, const char *const *args)
This is an abstract base class that describes the message passing environment.
int start_process(const BCP_string &exe, const BCP_string &machine, const bool debug)
Spawn a new process on the machine specified by the second argument.
This class describes the message buffer used for all processes of BCP.
int register_process(USER_initialize *user_init)
A process can register (receive its process id) with the message passing environment.
bool alive(const int pid)
Test if the process given by the argument is alive or not.