X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/12538c6ab1bc03405ac74e6b2995ba1b4ee29bfa..2d3f7295504ccdb4ec0662e80344870128d3cc7f:/examples/gras/mmrpc/mmrpc_client.c?ds=sidebyside diff --git a/examples/gras/mmrpc/mmrpc_client.c b/examples/gras/mmrpc/mmrpc_client.c index edab230f20..acffc9e7f3 100644 --- a/examples/gras/mmrpc/mmrpc_client.c +++ b/examples/gras/mmrpc/mmrpc_client.c @@ -8,6 +8,7 @@ * 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); @@ -17,7 +18,7 @@ int client(int argc,char *argv[]) { gras_socket_t toserver=NULL; /* peer */ gras_socket_t from; - matrix_t request[2], answer; + xbt_matrix_t request[2], answer; int i,j; @@ -56,23 +57,17 @@ int client(int argc,char *argv[]) { /* 7. Prepare and send the request to the server */ - request[0].rows=request[0].cols=request[1].rows=request[1].cols=MATSIZE; + request[0] = xbt_matrix_double_new_id(MATSIZE,MATSIZE); + request[1] = xbt_matrix_double_new_rand(MATSIZE,MATSIZE); - request[0].ctn=xbt_malloc0(sizeof(double)*MATSIZE*MATSIZE); - request[1].ctn=xbt_malloc0(sizeof(double)*MATSIZE*MATSIZE); - - for (i=0; i>>>>>>> Request sent to %s:%d <<<<<<<<", gras_socket_peer_name(toserver),gras_socket_peer_port(toserver)); @@ -80,16 +75,23 @@ int client(int argc,char *argv[]) { /* 8. Wait for the answer from the server, and deal with issues */ gras_msg_wait(6000,gras_msgtype_by_name("answer"),&from,&answer); - /* mat_dump(&answer,"C:answer");*/ - for (i=0; i>>>>>>> Got answer from %s:%d <<<<<<<<", + INFO2(">>>>>>>> Got answer from %s:%d (values are right) <<<<<<<<", gras_socket_peer_name(from),gras_socket_peer_port(from)); /* 10. Free the allocated resources, and shut GRAS down */ - free(answer.ctn); + xbt_matrix_free(request[1]); + xbt_matrix_free(answer); gras_socket_close(toserver); gras_exit(); INFO0("Done.");