3 /* GridRPC - Fake Grid RPC thingy doing matrix multiplications (as expected)*/
5 /* Copyright (c) 2005 Martin Quinson. All rights reserved. */
7 /* This program is free software; you can redistribute it and/or modify it
8 * under the terms of the license (GNU LGPL) which comes with this package. */
12 XBT_LOG_NEW_DEFAULT_CATEGORY(MatMult,"Messages specific to this example");
14 /* register messages which may be sent and their payload
15 (common to client and server) */
16 void mmrpc_register_messages(void) {
17 gras_datadesc_type_t matrix_type, request_type;
19 matrix_type=gras_datadesc_by_symbol(s_matrix);
20 request_type=gras_datadesc_array_fixed("matrix_t[2]",matrix_type,2);
22 gras_msgtype_declare("answer", matrix_type);
23 gras_msgtype_declare("request", request_type);
26 void mat_dump(matrix_t *mat, const char* name) {
29 printf(">>> Matrix %s dump (%d x %d)\n",name,mat->lines,mat->rows);
30 for (i=0; i<mat->lines; i++) {
32 for (j=0; j<mat->rows; j++)
33 printf(" %.2f",mat->ctn[i*mat->rows + j]);
36 printf("<<< end_of_matrix %s dump\n",name);