Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
dab2df5c474caa7277ab60909cf84d4be53c815b
[simgrid.git] / src / gras / Virtu / virtu_sg.h
1 /* $Id$ */
2
3 /* virtu_sg - specific GRAS implementation for simulator                    */
4
5 /* Copyright (c) 2003, 2004 Martin Quinson. All rights reserved.            */
6
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. */
9
10 #ifndef VIRTU_SG_H
11 #define VIRTU_SG_H
12
13 #include "gras/Virtu/virtu_private.h"
14 #include "xbt/dynar.h"
15 #include "simix/simix.h"        /* SimGrid header */
16 #include "gras/Transport/transport_private.h"
17
18 typedef struct {
19   int port;                     /* list of ports used by a server socket */
20   int meas;                     /* (boolean) the channel is for measurements or for messages */
21   smx_process_t process;
22   gras_socket_t socket;
23 } gras_sg_portrec_t;
24
25 /* Data for each host */
26 typedef struct {
27   int refcount;
28
29   /* Nothing in particular (anymore) */
30 } gras_hostdata_t;
31
32 /* data for each socket (FIXME: find a better location for that)*/
33 typedef struct {
34   smx_rdv_t rdv;
35
36   smx_process_t from_process; /* the one who created the socket */
37   smx_host_t to_host;           /* Who's on other side */
38   smx_comm_t comm; /* Ongoing communication */
39
40   s_gras_msg_t ongoing_msg;
41   size_t ongoing_msg_size;
42
43   gras_socket_t to_socket; /* If != NULL, this socket was created as accept when receiving onto to_socket */
44 } gras_trp_sg_sock_data_t;
45
46
47 void *gras_libdata_by_name_from_remote(const char *name, smx_process_t p);
48 /* The same function by id would be really dangerous.
49  * 
50  * Indeed, it would rely on the fact that all process register libdatas in
51  * the same order, which is wrong if they init amok modules in different
52  * order.
53  */
54
55 #endif /* VIRTU_SG_H */