SimGrid 3.7.1
Scalable simulation of distributed systems
|
Functions | |
int | xbt_socket_is_meas (xbt_socket_t sock) |
Check if the provided socket is a measurement one (or a regular one) | |
void | xbt_socket_meas_send (xbt_socket_t peer, unsigned int timeout, unsigned long int msgSize, unsigned long int msgAmount) |
Send a chunk of (random) data over a measurement socket. | |
void | xbt_socket_meas_recv (xbt_socket_t peer, unsigned int timeout, unsigned long int msgSize, unsigned long int msgAmount) |
Receive a chunk of data over a measurement socket. | |
xbt_socket_t | xbt_socket_meas_accept (xbt_socket_t peer) |
Something similar to the good old accept system call. |
You may want to use sockets not to exchange valuable data (in messages), but to conduct some bandwidth measurements and related experiments. If so, try those measurement sockets.
You can only use those functions on sockets opened with the "measurement" boolean set to true.
void xbt_socket_meas_send | ( | xbt_socket_t | peer, |
unsigned int | timeout, | ||
unsigned long int | msg_size, | ||
unsigned long int | msg_amount | ||
) |
Send a chunk of (random) data over a measurement socket.
peer | measurement socket to use for the experiment |
timeout | timeout (in seconds) |
msg_size | size of each chunk sent over the socket (in bytes). |
msg_amount | how many of these packets you want to send. |
Calls to xbt_socket_meas_send() and xbt_socket_meas_recv() on each side of the socket should be paired.
The exchanged data is zeroed to make sure it's initialized, but there is no way to control what is sent (ie, you cannot use these functions to exchange data out of band).
void xbt_socket_meas_recv | ( | xbt_socket_t | peer, |
unsigned int | timeout, | ||
unsigned long int | msg_size, | ||
unsigned long int | msg_amount | ||
) |
Receive a chunk of data over a measurement socket.
Calls to xbt_socket_meas_send() and xbt_socket_meas_recv() on each side of the socket should be paired.
xbt_socket_t xbt_socket_meas_accept | ( | xbt_socket_t | peer | ) |
Something similar to the good old accept system call.
Make sure that there is someone speaking to the provided server socket. In RL, it does an accept(2) and return the result as last argument. In SG, as accepts are useless, it returns the provided argument as result. You should thus test whether (peer != accepted) before closing both of them.
You should only call this on measurement sockets. It is automatically done for regular sockets, but you usually want more control about what's going on with measurement sockets.
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 ![]() |