Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Initial structure to implement gras using simix.
[simgrid.git] / src / gras_simix / Virtu / gras_simix_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_simix/Virtu/gras_simix_virtu_private.h"
14 #include "xbt/dynar.h"
15 //#include "msg/msg.h" /* SimGrid header */
16 #include "simix/simix.h" /* SimGrid header */
17
18 typedef struct {
19   int port;  /* list of ports used by a server socket */
20 //  int tochan; /* the channel it points to */
21         int meas;   /* (boolean) the channel is for measurements or for messages */
22 } gras_sg_portrec_t;
23
24 /* Data for each host */
25 typedef struct {
26   int refcount;
27 //  int proc[XBT_MAX_CHANNEL]; /* PID of who's connected to each channel */
28                               /* If =0, then free */
29
30         smx_cond_t cond_port[65536];
31
32   xbt_dynar_t ports;
33
34 } gras_hostdata_t;
35
36 /* data for each socket (FIXME: find a better location for that)*/
37 typedef struct {
38   //int from_PID;    /* process which sent this message */
39   //int to_PID;      /* process to which this message is destinated */
40         smx_process_t from_process;
41         smx_process_t to_process;
42
43   smx_host_t to_host;   /* Who's on other side */
44         gras_sg_portrec_t port;
45   //m_channel_t to_chan;/* Channel on which the other side is earing */
46 } gras_trp_sg_sock_data_t;
47
48
49 void *gras_libdata_by_name_from_remote(const char *name, smx_process_t p);
50 /* The same function by id would be really dangerous.
51  * 
52  * Indeed, it would rely on the fact that all process register libdatas in
53  * the same order, which is wrong if they init amok modules in different
54  * order.
55  */
56    
57    
58 #endif /* VIRTU_SG_H */