X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/12538c6ab1bc03405ac74e6b2995ba1b4ee29bfa..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 9d8bc211e7..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.rows = data[0].rows; - result.cols = data[1].cols; - result.ctn = xbt_malloc0(sizeof(double) * result.rows * result.cols); - - /* 3. Do the computation */ - for (i=0; i