A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix make dist.
[simgrid.git]
/
examples
/
gras
/
mmrpc
/
mmrpc.c
diff --git
a/examples/gras/mmrpc/mmrpc.c
b/examples/gras/mmrpc/mmrpc.c
index
5ab834d
..
fa9de31
100644
(file)
--- a/
examples/gras/mmrpc/mmrpc.c
+++ b/
examples/gras/mmrpc/mmrpc.c
@@
-6,7
+6,7
@@
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
-#define
GRAS
_DEFINE_TYPE_EXTERN
+#define
XBT
_DEFINE_TYPE_EXTERN
#include "xbt/matrix.h"
#include "mmrpc.h"
#include "xbt/matrix.h"
#include "mmrpc.h"
@@
-16,12
+16,12
@@
XBT_LOG_NEW_DEFAULT_CATEGORY(MatMult, "Messages specific to this example");
(common to client and server) */
void mmrpc_register_messages(void)
{
(common to client and server) */
void mmrpc_register_messages(void)
{
-
gras
_datadesc_type_t matrix_type, request_type;
+
xbt
_datadesc_type_t matrix_type, request_type;
- matrix_type =
gras_datadesc_matrix(gras
_datadesc_by_name("double"),
+ matrix_type =
xbt_datadesc_matrix(xbt
_datadesc_by_name("double"),
NULL);
request_type =
NULL);
request_type =
-
gras
_datadesc_array_fixed("s_matrix_t(double)[2]", matrix_type, 2);
+
xbt
_datadesc_array_fixed("s_matrix_t(double)[2]", matrix_type, 2);
gras_msgtype_declare("answer", matrix_type);
gras_msgtype_declare("request", request_type);
gras_msgtype_declare("answer", matrix_type);
gras_msgtype_declare("request", request_type);
@@
-32,7
+32,7
@@
static int server_cb_request_handler(gras_msg_cb_ctx_t ctx,
void *payload_data)
{
void *payload_data)
{
-
gras
_socket_t expeditor = gras_msg_cb_ctx_from(ctx);
+
xbt
_socket_t expeditor = gras_msg_cb_ctx_from(ctx);
/* 1. Get the payload into the data variable */
xbt_matrix_t *request = (xbt_matrix_t *) payload_data;
/* 1. Get the payload into the data variable */
xbt_matrix_t *request = (xbt_matrix_t *) payload_data;
@@
-55,7
+55,7
@@
static int server_cb_request_handler(gras_msg_cb_ctx_t ctx,
int server(int argc, char *argv[])
{
int server(int argc, char *argv[])
{
-
gras
_socket_t sock = NULL;
+
xbt
_socket_t sock = NULL;
int port = 4000;
/* 1. Init the GRAS infrastructure */
int port = 4000;
/* 1. Init the GRAS infrastructure */
@@
-81,7
+81,7
@@
int server(int argc, char *argv[])
/* 5. Register my callback */
gras_cb_register("request", &server_cb_request_handler);
/* 5. Register my callback */
gras_cb_register("request", &server_cb_request_handler);
- /* 6. Wait up to 10 minutes for an incom
m
ing message to handle */
+ /* 6. Wait up to 10 minutes for an incoming message to handle */
gras_msg_handle(600.0);
/* 7. Free the allocated resources, and shut GRAS down */
gras_msg_handle(600.0);
/* 7. Free the allocated resources, and shut GRAS down */
@@
-95,9
+95,9
@@
int server(int argc, char *argv[])
int client(int argc, char *argv[])
{
int client(int argc, char *argv[])
{
-
gras
_socket_t toserver = NULL; /* peer */
+
xbt
_socket_t toserver = NULL; /* peer */
-
gras
_socket_t from;
+
xbt
_socket_t from;
xbt_matrix_t request[2], answer;
int i, j;
xbt_matrix_t request[2], answer;
int i, j;
@@
-134,7
+134,7
@@
int client(int argc, char *argv[])
/* 6. Keep the user informed of what's going on */
XBT_INFO(">>>>>>>> Connected to server which is on %s:%d <<<<<<<<",
/* 6. Keep the user informed of what's going on */
XBT_INFO(">>>>>>>> Connected to server which is on %s:%d <<<<<<<<",
-
gras_socket_peer_name(toserver), gras
_socket_peer_port(toserver));
+
xbt_socket_peer_name(toserver), xbt
_socket_peer_port(toserver));
/* 7. Prepare and send the request to the server */
/* 7. Prepare and send the request to the server */
@@
-151,7
+151,7
@@
int client(int argc, char *argv[])
xbt_matrix_free(request[0]);
XBT_INFO(">>>>>>>> Request sent to %s:%d <<<<<<<<",
xbt_matrix_free(request[0]);
XBT_INFO(">>>>>>>> Request sent to %s:%d <<<<<<<<",
-
gras_socket_peer_name(toserver), gras
_socket_peer_port(toserver));
+
xbt_socket_peer_name(toserver), xbt
_socket_peer_port(toserver));
/* 8. Wait for the answer from the server, and deal with issues */
gras_msg_wait(6000, "answer", &from, &answer);
/* 8. Wait for the answer from the server, and deal with issues */
gras_msg_wait(6000, "answer", &from, &answer);
@@
-169,7
+169,7
@@
int client(int argc, char *argv[])
/* 9. Keep the user informed of what's going on, again */
XBT_INFO(">>>>>>>> Got answer from %s:%d (values are right) <<<<<<<<",
/* 9. Keep the user informed of what's going on, again */
XBT_INFO(">>>>>>>> Got answer from %s:%d (values are right) <<<<<<<<",
-
gras_socket_peer_name(from), gras
_socket_peer_port(from));
+
xbt_socket_peer_name(from), xbt
_socket_peer_port(from));
/* 10. Free the allocated resources, and shut GRAS down */
xbt_matrix_free(request[1]);
/* 10. Free the allocated resources, and shut GRAS down */
xbt_matrix_free(request[1]);