Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Kill old $Id$ command dating from CVS
[simgrid.git] / src / gras / Virtu / virtu_sg.h
1 /* virtu_sg - specific GRAS implementation for simulator                    */
2
3 /* Copyright (c) 2003, 2004 Martin Quinson. All rights reserved.            */
4
5 /* This program is free software; you can redistribute it and/or modify it
6  * under the terms of the license (GNU LGPL) which comes with this package. */
7
8 #ifndef VIRTU_SG_H
9 #define VIRTU_SG_H
10
11 #include "gras/Virtu/virtu_private.h"
12 #include "xbt/dynar.h"
13 #include "simix/simix.h"        /* SimGrid header */
14 #include "gras/Transport/transport_private.h"
15
16 typedef struct {
17   int port;                     /* list of ports used by a server socket */
18   int meas;                     /* (boolean) the channel is for measurements or for messages */
19   smx_process_t process;
20   gras_socket_t socket;
21 } gras_sg_portrec_t;
22
23 /* Data for each host */
24 typedef struct {
25   int refcount;
26
27   xbt_dynar_t ports;
28
29 } gras_hostdata_t;
30
31 /* data for each socket (FIXME: find a better location for that)*/
32 typedef struct {
33   smx_process_t from_process;
34   smx_process_t to_process;
35
36   smx_host_t to_host;           /* Who's on other side */
37
38   smx_cond_t cond;
39   smx_mutex_t mutex;
40   gras_socket_t to_socket;
41 } gras_trp_sg_sock_data_t;
42
43
44 void *gras_libdata_by_name_from_remote(const char *name, smx_process_t p);
45 /* The same function by id would be really dangerous.
46  * 
47  * Indeed, it would rely on the fact that all process register libdatas in
48  * the same order, which is wrong if they init amok modules in different
49  * order.
50  */
51
52 #endif /* VIRTU_SG_H */