Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
I forgot to update my tree before commiting (once again), and got conflicts as punishment
[simgrid.git] / src / gras / Virtu / virtu_sg.h
1 /* virtu_sg - specific GRAS implementation for simulator                    */
2
3 /* Copyright (c) 2004, 2005, 2006, 2007, 2009, 2010. The SimGrid Team.
4  * All rights reserved.                                                     */
5
6 /* This program is free software; you can redistribute it and/or modify it
7  * under the terms of the license (GNU LGPL) which comes with this package. */
8
9 #ifndef VIRTU_SG_H
10 #define VIRTU_SG_H
11
12 #include "gras/Virtu/virtu_private.h"
13 #include "xbt/dynar.h"
14 #include "simgrid/simix.h"        /* SimGrid header */
15 #include "gras/Transport/transport_private.h"
16
17 typedef struct {
18   int port;                     /* list of ports used by a server socket */
19   int meas:1;                   /* (boolean) the channel is for measurements or for messages */
20   smx_process_t server;
21   smx_rdv_t rdv;
22 } s_gras_sg_portrec_t, *gras_sg_portrec_t;
23
24 /* Data for each host */
25 typedef struct {
26   int refcount;
27
28   xbt_dynar_t ports;
29
30 } gras_hostdata_t;
31
32 /* data for each socket (FIXME: find a better location for that) */
33 typedef struct {
34   smx_process_t server;
35   smx_process_t client;
36
37   smx_rdv_t rdv_server;         /* The rendez-vous point to use */
38   smx_rdv_t rdv_client;         /* The rendez-vous point to use */
39   smx_action_t comm_recv;       /* The comm of irecv on receiver side */
40   gras_msg_t msg;               /* The destination buffer of the comm data */
41
42   int server_port;
43   int client_port;
44 } s_gras_trp_sg_sock_data_t, *gras_trp_sg_sock_data_t;
45
46
47 /** \brief Returns if I am on the server side of this socket (either server or listener of server) */
48 /* FIXME make an im_the_server function in each socket plugin */
49 int gras_socket_im_the_server(xbt_socket_t sock);
50
51
52 void *gras_libdata_by_name_from_remote(const char *name, smx_process_t p);
53 /* The same function by id would be really dangerous.
54  * 
55  * Indeed, it would rely on the fact that all process register libdatas in
56  * the same order, which is wrong if they init amok modules in different
57  * order.
58  */
59
60 #endif                          /* VIRTU_SG_H */