Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
model-checker : in second test unit, snapshot comparison done before MC_UNSET_RAW_MEM...
[simgrid.git] / doc / gtut-introduction.doc
index 15450a5..6659aaf 100644 (file)
@@ -1,5 +1,5 @@
-/** 
-@page GRAS_tut_intro Introduction to the GRAS framework
+/** @defgroup GRAS_tut_intro What is GRAS
+    @ingroup GRAS_tut
 
 \htmlinclude .gtut-introduction.doc.toc
 
@@ -12,7 +12,7 @@
 
 \section GRAS_tut_intro_further Further readings
 
-After this page, you may find these one interesting: 
+After this page, you may find these one interesting:
 \ref GRAS_howto_design. If you're new to GRAS, you may want to read the
 initiatic tour first, begining with \ref GRAS_tut_tour_install or
 \ref GRAS_tut_tour_setup.
@@ -31,7 +31,7 @@ GRAS differs from the other existing messaging API by several points:
   - \ref GRAS_tut_intro_what_grid
   - \ref GRAS_tut_intro_what_target
   - \ref GRAS_tut_intro_what_simple
-  
+
 We now detail each of these points.
 
 \subsection GRAS_tut_intro_what_2ways GRAS allows you to run both in simulation mode and on real platforms
@@ -41,7 +41,7 @@ of the SimGrid simulator, allowing you to run your application in a
 controled environment, which reveals precious to debug and study algorithms.
 Everyone who tried to run even simple tests on more than 100 real machines
 will consider a simulator as a nirvana.
-    
+
 The experiments can be reproduced in the exact same conditions (which is
 somehow hard in real settings), allowing for example to reproduce a bug as
 many times as you want while debugging. You can also test your algorithm
@@ -49,7 +49,7 @@ under experimental conditions which you couldn't achieve on a real platform
 (like a network topology and/or size you do don't have access to). Under
 some conditions, SimGrid simulations are also much faster than real
 executions, allowing you to run more experiments in less time.
+
 Once you assessed the quality of your algorithm in the simulator, you can
 deploy it on real platforms using the second implementation of the library.
 Usually, taking an algorithm out of a simulator implies an almost complete
@@ -62,7 +62,7 @@ The sequential parts of your code are not mediated by GRAS or slowed down
 anyhow. The communications use advanced data exchange and conversion
 mecanism ensuring that you are likely to get performance at least comparable
 to other communication solutions (FIXME: cite the paper once it gets
-accepted). 
+accepted).
 
 GRAS applications are portable on several operating systems (Linux, MacOS X,
 Solaris, IRIX, AIX and soon Windows) and several processor architectures
@@ -70,10 +70,10 @@ Solaris, IRIX, AIX and soon Windows) and several processor architectures
 efficiently even when deployed on differing material. You can for example
 have a process deployed on ppc/MacOS X interacting transparently with
 another one deployed on alpha/Linux.
-    
+
 The simulation mode of GRAS is called usually SG (for SimGrid) while the in
 situ execution mode is called RL (for Real Life).
-    
+
 \subsection GRAS_tut_intro_what_dist GRAS was designed for distributed computing, not parallel computing
 
 In GRAS, you build your algorithm as a set of independent processes
@@ -127,7 +127,7 @@ available bandwidth between two remote hosts. It could be used in a
 network-aware parallel matrix multiplication library assigning more work to
 well interconnected nodes. I wouldn't advice to build a physical or
 biological compututation program on top of GRAS, even if it would be
-possible in theory. 
+possible in theory.
 
 In other words, GRAS is not a grid middleware in the common understanding of
 the world, but rather a tool to constitute the building bricks of such a
@@ -144,7 +144,7 @@ There is no threads like the pthread ones in GRAS, and it is not planned to
 introduce this in the future. This is an explicit choice since I consider
 multi-threading as too complicated for usual users. There is too much
 non-determinism, too many race conditions, and too few language-level
-constructs to keep yourself from screwing up. This idea is well expressed 
+constructs to keep yourself from screwing up. This idea is well expressed
 by John Ousterhout in <i>Why Threads Are a Bad Idea (for most purposes)</i>,
 published at USENIX'96. See section \ref GRAS_tut_intro_what_dist for
 platform performance consideration.
@@ -160,14 +160,14 @@ sure that nothing will happen between each lines of it. This assumption
 considerably simplify the code written in GRAS. The main use of of
 interruptions in a distributed application is to timeout communications when
 they fail. GRAS communication calls allow to setup a timeout value, and
-handle it internally (see below). 
+handle it internally (see below).
 
 The only interruption mecanism used is constituted by exceptions, just like
 in C++ or Java (but implemented directly in C). They are propagated from the
 point where they are raised to a point where they will be trapped, if any,
 or abort the execution when not trapped. You can still be certain that
 nothing will happen between two lines of your code, but the second line may
-never be executed if the first one raises an exception ;) 
+never be executed if the first one raises an exception ;)
 
 This exception mecanism was introduced because without it, user code has to
 be loaded by tons of non-functional code to check whether an operation was
@@ -209,7 +209,7 @@ Two main types of events may change the internal state of a given process:
    messages during the transition associated to this event.\n
    \n
    Incoming messages are not handled as soon as they arrive, but only when
-   the process declares to be ready to accept incomming events (using \ref
+   the process declares to be ready to accept incoming events (using \ref
    gras_msg_handle or related functions). It ensures that the treatment of a
    given message won't run in parallel to any other callback, so that
    process globals (its state) can be accessed and modified without
@@ -221,7 +221,7 @@ Two main types of events may change the internal state of a given process:
    \n
    Processes can also wait explicitely for incoming messages matching some
    given criterions (using \ref gras_msg_wait). Any messages received before the
-   one matching the criterions will be added to the incomming messages'
+   one matching the criterions will be added to the incoming messages'
    queue for further use. This may breaks the message delivery order.
    Moreover, there is no restriction on when this can be done. So, a
    callback to a given message can consume messages of other types. There is
@@ -235,7 +235,7 @@ Two main types of events may change the internal state of a given process:
    and start the callbacks associated to them. GRAS thus supports both the
    pure event-based programming model and the more classical message passing
    model.\n
+
  - <b>Internal timers</b>. There is two types of timers: delayed actions and
    repetitive actions. The former happen only once when the delay expires
    while the second happen regularly each time that a period expires.\n
@@ -272,26 +272,29 @@ As in SimGrid v3.3, receive operations are done in a separated thread, but they
 are done sequentially by this thread. The model is thus <b>1-port in
 reception</b>, but something like 2-port in general. Moreover, the messages not
 matching the criterion in explicite receive (see for example \ref
-gras_msg_wait) are queued for further use.
+gras_msg_wait) are queued for further use. Thanks to this specific
+thread, the emission and reception are completely decorelated. Ie, the
+main thread can perfectly send a message while the listener is
+receiving something. We thus have a classical <b>1-port model</b>.
 
 Here is a graphical representation of a scenario involving two processes A and
 B.  Both are naturally composed of two threads: the one running user code, and
 the listener in charge of listening incoming messages from the network. Both
 processes also have a queue for the communication between the two threads, even
-if only the queue of process B is depicted in the graph. 
+if only the queue of process B is depicted in the graph.
 
 The experimental scenario is as follows: <ul>
 
 <li>Process A sends a first message (depicted in red) with gras_msg_send(), do
     some more computation, and then send another message (depicted in
-    yellow). Then, this process handles any incomming message with
+    yellow). Then, this process handles any incoming message with
     gras_msg_handle(). Since no message is already queued in process A at this
     point, this is a blocking call until the third message (depicted in
     magenta) arrives from the other process.</li>
 
 <li>On its side, the process B explicitely wait for the second message with
     gras_msg_wait(), do some computation with it, and then call
-    gras_msg_handle() to handle any incomming message. This will pop the red
+    gras_msg_handle() to handle any incoming message. This will pop the red
     message from the queue, and start the callback attached to that kind of
     messages. This callback sends back a new message (depicted in magenta) back
     to process A.</li>
@@ -307,8 +310,8 @@ reach the machine on which B is running from the machine running on A. The time
 (2) is mainly given by the network bandwidth. This is the time for all bytes of
 the messages to travel from one machine to the other. Please note that the
 models used by SimGrid are a bit more complicated to keep realistic, as
-explained in <a href="http://www.loria.fr/~quinson/articles/simgrid-tutorial.pdf">the 
-tutorial slides</a>, but this not that important here. The time (3) is mainly
+explained in <a href="http://www.loria.fr/~quinson/blog/2010/06/28/Tutorial_at_HPCS/">the
+slides of the HPCS'10</a>, but this not that important here. The time (3) is mainly
 found in the SG version and not in RL (and that's a bug). This is the time to
 make sure that message were received on machine B. In real life, some buffering
 at system and network level may give the illusion to machine A that the message
@@ -328,7 +331,7 @@ network. The order of unexpected messages and subsequent ones is thus preserved
 from the receiver point of view.</li>
 
 <li>gras_msg_wait() and gras_msg_handle() accept timeouts as argument to
-specify how long you are willing to wait at most for incomming messages. These
+specify how long you are willing to wait at most for incoming messages. These
 were ignored here to not complexify the example any further. It is worth
 mentionning that the send operation cannot be timeouted. The existance of the
 listener should make it useless.</li>
@@ -338,7 +341,7 @@ listener should make it useless.</li>
 \subsection GRAS_tut_intro_model_timing_policy Timing policy
 
 All communication primitives allow 3 timout policies: one can only poll for
-incomming events (using timeout=0), wait endlessly for the communication to
+incoming events (using timeout=0), wait endlessly for the communication to
 be performed (using timeout<0) or specify a maximal delay to wait for the
 communication to proceed (using timeout>0, being a number of seconds).