#include "amok/Bandwidth/bandwidth_private.h"
#include "gras/messages.h"
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(bw,amok,"Bandwidth testing");
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(amok_bw,amok,"Bandwidth testing");
/******************************
* \brief bandwidth measurement between localhost and \e peer
*
* \arg peer: A (regular) socket at which the the host with which we should conduct the experiment can be contacted
- * \arg buf_size: Size of the socket buffer
+ * \arg buf_size: Size of the socket buffer. If 0, a sain default is used (32k, but may change)
* \arg exp_size: Total size of data sent across the network
* \arg msg_size: Size of each message sent. Ie, (\e expSize % \e msgSize) messages will be sent.
* \arg sec: where the result (in seconds) should be stored.
if (port == 10000 -1) {
RETHROW0("Error caught while opening a measurement socket: %s");
} else {
- xbt_ex_free(&e);
+ xbt_ex_free(e);
}
}
}
request->msg_size=msg_size;
request->host.name = NULL;
request->host.port = gras_socket_my_port(measMasterIn);
- VERB5("Handshaking with %s:%d to connect it back on my %d (expsize=%ld byte= %ld b)",
+ DEBUG5("Handshaking with %s:%d to connect it back on my %d (expsize=%ld byte= %ld b)",
gras_socket_peer_name(peer),gras_socket_peer_port(peer), request->host.port,
buf_size,request->buf_size);
xbt_ex_t e;
int port;
- VERB5("Handshaked to connect to %s:%d (sizes: buf=%lu exp=%lu msg=%lu)",
+ DEBUG5("Handshaked to connect to %s:%d (sizes: buf=%lu exp=%lu msg=%lu)",
gras_socket_peer_name(expeditor),request->host.port,
request->buf_size,request->exp_size,request->msg_size);
} CATCH(e) {
measMasterIn = NULL;
if (port < 10000)
- xbt_ex_free(&e);
+ xbt_ex_free(e);
else
/* FIXME: tell error to remote */
RETHROW0("Error encountered while opening a measurement server socket: %s");
* \arg to_port: port on which the second process is listening (for messages, do not
* give a measurement socket here. The needed measurement sockets will be created
* automatically and negociated between the peers)
- * \arg buf_size: Size of the socket buffer
+ * \arg buf_size: Size of the socket buffer. If 0, a sain default is used (32k, but may change)
* \arg exp_size: Total size of data sent across the network
* \arg msg_size: Size of each message sent. (\e expSize % \e msgSize) messages will be sent.
* \arg sec: where the result (in seconds) should be stored.
if (bw)
*bw =result->bw;
- VERB6("BW test between %s:%d and %s:%d took %f sec, achieving %f kb/s",
+ VERB6("BW test (%s:%d -> %s:%d) took %f sec (%f kb/s)",
from_name,from_port, to_name,to_port,
- *sec,((double)*bw)/1024.0);
+ result->sec,((double)result->bw)/1024.0);
gras_socket_close(sock);
free(result);
/* specification of the test to run, and our answer */
bw_request_t request = *(bw_request_t*)payload;
bw_res_t result = xbt_new0(s_bw_res_t,1);
- gras_socket_t peer;
+ gras_socket_t peer,asker;
+ asker=gras_msg_cb_ctx_from(ctx);
+ VERB4("Asked by %s:%d to conduct a bw XP with %s:%d",
+ gras_socket_peer_name(asker),gras_socket_peer_port(asker),
+ request->host.name,request->host.port);
peer = gras_socket_client(request->host.name,request->host.port);
amok_bw_test(peer,
request->buf_size,request->exp_size,request->msg_size,
gras_msg_rpcreturn(240,ctx,&result);
gras_os_sleep(1);
- gras_socket_close(peer);
+ gras_socket_close(peer); /* FIXME: it should be blocking in RL until everything is sent */
free(request->host.name);
free(request);
free(result);