SimGrid 3.7.1
Scalable simulation of distributed systems
|
Managing remote servers. More...
Functions | |
void | amok_pm_init (void) |
Initialize the peer management module. Every process must run it before use. | |
void | amok_pm_exit (void) |
Finalize the peer management module. Every process should run it after use. | |
void | amok_pm_mainloop (double timeOut) |
Enter the main loop of the program. It won't return until we get a kill message. | |
void | amok_pm_kill_hp (char *name, int port) |
kill a buddy identified by its peername and port. Note that it is not removed from any group it may belong to. | |
void | amok_pm_kill (xbt_socket_t buddy) |
kill a buddy to which we have a socket already. Note that it is not removed from any group it may belong to. | |
void | amok_pm_kill_sync (xbt_socket_t buddy) |
kill syncronously a buddy (do not return before its death). Note that it is not removed from any group it may belong to. | |
xbt_dynar_t | amok_pm_group_new (const char *group_name) |
create a new peermanagement group located on local peer | |
xbt_dynar_t | amok_pm_group_get (xbt_socket_t master, const char *group_name) |
retrieve all members of the given remote group | |
int | amok_pm_group_join (xbt_socket_t master, const char *group_name) |
add current peer to the given remote group | |
void | amok_pm_group_leave (xbt_socket_t master, const char *group_name) |
remove current peer from the given remote group if found | |
void | amok_pm_group_shutdown (const char *group_name) |
stops all members of the given local group | |
void | amok_pm_group_shutdown_remote (xbt_socket_t master, const char *group_name) |
stops all members of the given remote group |
Managing remote servers.
This module provide the main loop of servers designed to answer to callbacks. They can furthermore be stopped remotely.
This module is especially useful to program following the centralized master/slave architecture. In this architecture, one of the processes acts as a master dispatching orders to the others, which are called slaves.
The source code of the slaves then only consists in:
The master, on its side, should create declare the datatypes and messages just like slaves. It should then create a group with amok_pm_group_new().
Afterward, there is two solutions.
The API described here is as of SimGrid 3.2 and higher. In version 3.1 (where this module were introduced), all functions were named amok_hm_* This was because the module used to be named HostManagement, but it was renamed before being released to betterly express its purpose. Unfortunately, the rename was not done properly before version 3.2.
xbt_dynar_t amok_pm_group_new | ( | const char * | group_name | ) |
create a new peermanagement group located on local peer
The dynar elements are of type xbt_peer_t
int amok_pm_group_join | ( | xbt_socket_t | master, |
const char * | group_name | ||
) |
add current peer to the given remote group
Returns the rank of the process in the group.
void amok_pm_group_leave | ( | xbt_socket_t | master, |
const char * | group_name | ||
) |
remove current peer from the given remote group if found
If not found, call is ignored
Back to the main Simgrid Documentation page |
The version of SimGrid documented here is v3.7.1. Documentation of other versions can be found in their respective archive files (directory doc/html). |
Generated by ![]() |