X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/0ba6247845b00a203edbc22f64c50a43f047fcdd..2d3f7295504ccdb4ec0662e80344870128d3cc7f:/examples/gras/mmrpc/mmrpc_server.c?ds=sidebyside diff --git a/examples/gras/mmrpc/mmrpc_server.c b/examples/gras/mmrpc/mmrpc_server.c index 8d94a0d9c0..671b97c765 100644 --- a/examples/gras/mmrpc/mmrpc_server.c +++ b/examples/gras/mmrpc/mmrpc_server.c @@ -8,37 +8,32 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #define GRAS_DEFINE_TYPE_EXTERN +#include "xbt/matrix.h" #include "mmrpc.h" XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(MatMult); -static int server_cb_request_handler(gras_msg_cb_ctx_t ctx, void *payload_data) { +typedef xbt_matrix_t request_t[2]; +static int server_cb_request_handler(gras_msg_cb_ctx_t ctx, + void *payload_data) { + gras_socket_t expeditor=gras_msg_cb_ctx_from(ctx); /* 1. Get the payload into the data variable */ - matrix_t *data=(matrix_t*)payload_data; - matrix_t result; - int i,j,k; - - /* 2. Make some room to return the result */ - result.lines = data[0].lines; - result.rows = data[1].rows; - result.ctn = xbt_malloc0(sizeof(double) * result.lines * result.rows); - - /* 3. Do the computation */ - for (i=0; i