Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
925dc0bd646a0ef4976a6a19d47f41d173ee50f0
[simgrid.git] / cruft / doc / tmpl / gras_sg.sgml
1 <!-- ##### SECTION Title ##### -->
2 SG
3
4 <!-- ##### SECTION Short_Description ##### -->
5 Implementation of GRAS on top of the simulator.
6
7 <!-- ##### SECTION Long_Description ##### -->
8 <para>
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).
13 </para>
14
15 <para>
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
20   reality also.
21 </para>
22
23 <para>
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.
30 </para>
31
32 <para>
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.
44 </para>
45
46 <para>
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.
52 </para>
53
54 <!-- ##### SECTION See_Also ##### -->
55 <para>
56 RL, the implementation suited for real life.
57 </para>
58
59 <!--
60 Local variables:
61 sgml-parent-document:\.\./gras-docs\.sgml
62 sgml-omittag:t
63 sgml-shorttag:t
64 sgml-namecase-general:t
65 sgml-general-insert-case:lower
66 sgml-minimize-attributes:nil
67 sgml-always-quote-attributes:t
68 sgml-indent-step:2
69 sgml-indent-data:nil
70 sgml-exposed-tags:nil
71 sgml-local-catalogs:nil
72 sgml-local-ecat-files:nil
73 End:
74 -->
75