#include "amok/Bandwidth/bandwidth_private.h"
#include "gras/Msg/msg_private.h" /* FIXME: This mucks with contextes to answer RPC directly */
#include "amok/Bandwidth/bandwidth_private.h"
#include "gras/Msg/msg_private.h" /* FIXME: This mucks with contextes to answer RPC directly */
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(amok_bw_sat,amok_bw,"Everything concerning the SATuration part of the amok_bw module");
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(amok_bw_sat,amok_bw,"Everything concerning the SATuration part of the amok_bw module");
/* Build the saturation datatype descriptions */
sat_request_desc = gras_datadesc_struct("s_sat_request_desc_t");
/* Build the saturation datatype descriptions */
sat_request_desc = gras_datadesc_struct("s_sat_request_desc_t");
gras_datadesc_struct_append(sat_request_desc,"msg_size",gras_datadesc_by_name("unsigned int"));
gras_datadesc_struct_append(sat_request_desc,"duration",gras_datadesc_by_name("unsigned int"));
gras_datadesc_struct_close(sat_request_desc);
gras_datadesc_struct_append(sat_request_desc,"msg_size",gras_datadesc_by_name("unsigned int"));
gras_datadesc_struct_append(sat_request_desc,"duration",gras_datadesc_by_name("unsigned int"));
gras_datadesc_struct_close(sat_request_desc);
* @param from_port: port on which the process we are asking for an experiment is listening
* (for message, do not give a raw socket here. The needed raw socket will be negociated
* between the peers)
* @param from_port: port on which the process we are asking for an experiment is listening
* (for message, do not give a raw socket here. The needed raw socket will be negociated
* between the peers)
* @param to_port: port on which the peer process is listening for message
* @param msg_size: Size of each message sent.
* @param duration: How long in maximum should be the saturation.
* @param to_port: port on which the peer process is listening for message
* @param msg_size: Size of each message sent.
* @param duration: How long in maximum should be the saturation.
const char* to_name,unsigned int to_port,
unsigned int msg_size, double duration) {
gras_socket_t sock;
const char* to_name,unsigned int to_port,
unsigned int msg_size, double duration) {
gras_socket_t sock;
gras_msg_rpccall(sock,60,gras_msgtype_by_name("amok_bw_sat start"),&request, NULL);
gras_msg_rpccall(sock,60,gras_msgtype_by_name("amok_bw_sat start"),&request, NULL);
+ }CATCH(e){
+ if (e.value==1)
+ THROW1(0,1,"%s",to_name);
+ THROW1(0,0,"%s",from_name);
+ }
static int amok_bw_cb_sat_start(gras_msg_cb_ctx_t ctx, void *payload){
sat_request_t request = *(sat_request_t*)payload;
gras_socket_t expeditor = gras_msg_cb_ctx_from(ctx);
static int amok_bw_cb_sat_start(gras_msg_cb_ctx_t ctx, void *payload){
sat_request_t request = *(sat_request_t*)payload;
gras_socket_t expeditor = gras_msg_cb_ctx_from(ctx);
VERB4("Asked by %s:%d to start a saturation to %s:%d",
gras_socket_peer_name(expeditor),gras_socket_peer_port(expeditor),
VERB4("Asked by %s:%d to start a saturation to %s:%d",
gras_socket_peer_name(expeditor),gras_socket_peer_port(expeditor),
- free(request->host.name);
+
+ }CATCH(e){
+ THROW1(0,1," can not connect %s ",((request)->peer.name));
+ }
+
+ free(request->peer.name);
+
* @brief Start saturating between the current process and the designated peer
*
* Note that the only way to break this function before the end of the timeout
* @brief Start saturating between the current process and the designated peer
*
* Note that the only way to break this function before the end of the timeout
ctx = gras_msg_rpc_async_call(peer_cmd, 60,
gras_msgtype_by_name("amok_bw_sat begin"),
&request);
free(request);
gras_msg_rpc_async_wait(ctx,&request);
ctx = gras_msg_rpc_async_call(peer_cmd, 60,
gras_msgtype_by_name("amok_bw_sat begin"),
&request);
free(request);
gras_msg_rpc_async_wait(ctx,&request);
* @param from_port: port on which the process we are asking for an experiment is listening
* @param time: the duration of the experiment
* @param bw: the achieved bandwidth
* @param from_port: port on which the process we are asking for an experiment is listening
* @param time: the duration of the experiment
* @param bw: the achieved bandwidth