SimGrid 3.6.2
Scalable simulation of distributed systems
|
Functions | |
int | gras_socket_is_meas (gras_socket_t sock) |
Check if the provided socket is a measurement one (or a regular one) | |
void | gras_socket_meas_send (gras_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 | gras_socket_meas_recv (gras_socket_t peer, unsigned int timeout, unsigned long int msgSize, unsigned long int msgAmount) |
Receive a chunk of data over a measurement socket. | |
gras_socket_t | gras_socket_meas_accept (gras_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 openned with the "measurement" boolean set to true.
void gras_socket_meas_send | ( | gras_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 gras_socket_meas_send() and gras_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 gras_socket_meas_recv | ( | gras_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 gras_socket_meas_send() and gras_socket_meas_recv() on each side of the socket should be paired.
gras_socket_t gras_socket_meas_accept | ( | gras_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.6.2. Documentation of other versions can be found in their respective archive files (directory doc/html). |
Generated for SimGridAPI by
![]() |