X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/0ba6247845b00a203edbc22f64c50a43f047fcdd..33d399c1fa8847652ab2698ed6d7263bccb17447:/examples/gras/mmrpc/mmrpc_server.c diff --git a/examples/gras/mmrpc/mmrpc_server.c b/examples/gras/mmrpc/mmrpc_server.c index 8d94a0d9c0..95d70d5a3a 100644 --- a/examples/gras/mmrpc/mmrpc_server.c +++ b/examples/gras/mmrpc/mmrpc_server.c @@ -8,40 +8,35 @@ * 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