1 <!-- ##### SECTION Title ##### -->
4 <!-- ##### SECTION Short_Description ##### -->
5 Implementation of GRAS on top of the simulator.
7 <!-- ##### SECTION Long_Description ##### -->
9 SimGrid was designed to ease the comparison of algorithms and
10 heuristics. That way, a lot of complicated notion from the system layer
11 were volontary left off. For example, migrating a process from an host to
12 another is as easy as: MSG_process_change_host(process, new_host).
16 No need to tell that performing this operation on real platform is really
17 harder. This simplification is a very good thing when you want to rapidly
18 prototype code, but makes things somehow more complicated in GRAS since
19 we want to have a realistic API, since it have to be implemented in
24 The best example of complexity in GRAS_SG induced by simplicity in
25 SimGrid is the sockets handling. There is no "socket" in SG, but only
26 m_channel_t. In contrary to sockets from RL, no special treatment is
27 needed for a process before writing or reading on/from a channel. So, a
28 given channel can be pooled by more than one process. Likewise, you can
29 send data to a channel that nobody is actually listening to.
33 The SG implementation of GRAS repport as an error the fact that nobody is
34 listening to the socket when trying to open a socket, or send stuff using
35 a previously openned socket. That way, the SG version can be used to
36 debug all syncronization issues. For that, we store mainly the PID of
37 both the sender and the receiver in the socket structure, and then
38 resolve PID->process at the lastest moment. This search is a bit
39 expensive, but as long as there is no real garbage collection in SG, with
40 the information "dead process" within the structure, it's the only
41 solution to make sure that we won't dereference pointers to an old freed
42 structure when the process on the other side of the structure did finish
43 since the creation of the socket.
47 As said in the overview, the processes can declare to hear on several
48 sockets, but all incoming messages are handled by the same loop. So, we
49 can use only one channel per process, and use a table on each host to
50 determine to which process a message should be delivered depending on the
51 socket number provided by the sender.
54 <!-- ##### SECTION See_Also ##### -->
56 RL, the implementation suited for real life.
61 sgml-parent-document:\.\./gras-docs\.sgml
64 sgml-namecase-general:t
65 sgml-general-insert-case:lower
66 sgml-minimize-attributes:nil
67 sgml-always-quote-attributes:t
71 sgml-local-catalogs:nil
72 sgml-local-ecat-files:nil