Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
merge changes: modify GRAS vs. kill GRAS, kill wins
[simgrid.git] / doc / user_guide / doxygen / use.doc
index 3933f92..f5bbdc0 100644 (file)
 /*! \page use Using SimGrid
 
-\section use_welcome Welcome to SimGrid!
+SimGrid comes with many examples provided in the examples/ directory. Those examples are described in section \ref MSG_examples . Those examples are commented and should be easy to understand. for a first step into SimGrid we also provide some more detailed examples in the sections below. 
 
-If you don't know were to look to start with, you should probably have
-a look at the following presentation first to get the basic concepts.
-Afterward, you probably want to proceed to the \ref MSG_API. Of
-course, if you're curious or if you know what you want, you may prefer
-to go to \ref SMPI_API, or even \ref GRAS_API.
-
-The scientific bases of the SimGrid project are presented in a 3 ou 4
-hours-long tutorial. It can be found at the following locations.
- - https://gforge.inria.fr/plugins/scmgit/cgi-bin/gitweb.cgi?p=simgrid/propaganda.git;a=blob_plain;f=tutorial/simgrid-tutorial.pdf;hb=HEAD
- - http://webloria.loria.fr/~quinson/blog/2010/0628/Tutorial_at_HPCS/
+\htmlonly
+You should also check our online <a href="http://simgrid.gforge.inria.fr/tutorials.html"> tutorial section</a> that contains a generic tutorial about using SimGrid. 
+\endhtmlonly
 
-\latexonly
-\includepdf[nup=2x4,pages=1-]{../webcruft/simgrid-101.pdf}
-\endlatexonly
 
+\section using_msg Using MSG
 \htmlonly
-<script language="javascript">
-var base="simgrid-101",max=30,cur=1;
-function pad(){ return cur < 10 ? '00' + cur : cur < 100 ? '0' + cur : '' + cur; }
-function slidemove(dir) {
-        var nums=document.getElementById('nums'), display=document.getElementById('display');
-        if (cur+dir>0 && cur+dir<=max)  cur+=dir;
-       display.src=base+'_'+pad()+'.png';
-       nums.innerHTML=(cur)+'/'+max;
-}
-</script>
-
-<div id='blah' style='text-align:center;'>
-  <div id='practical-simgrid' >
-    <img src='simgrid-101_001.png' id="display" onclick='slidemove(1)'/>
-    <br/>
-    <form>
-      <input type='button' value='&laquo; Previous' onclick="slidemove(-1)"/>
-      &nbsp;&nbsp;
-      <span id="nums">1/30</span>&nbsp;&nbsp
-      <input type='button' value='Next &raquo;' onclick="slidemove(1)"/>
-      <br/>
-      <a href='simgrid-101.pdf'>Download PDF version</a>
-    </form>
-  </div>
-</div>
+You should also check our online <a href="http://simgrid.gforge.inria.fr/tutorials.html"> tutorial section</a> that contains a dedicated tutorial. 
 \endhtmlonly
 
 
-*/
\ No newline at end of file
+
+Here are some examples on how to use MSG, the most used API.
+
+tr
+MSG comes with an extensive set of examples. It is sometimes difficult
+to find the one you need. This list aims at helping you finding the
+example from which you can learn what you want to.
+
+\subsection MSG_ex_basics Basic examples and features
+
+\subsubsection MSG_ex_asynchronous_communications Asynchronous communications
+
+
+Simulation of asynchronous communications between a sender and a receiver using a realistic platform and
+an external description of the deployment.
+
+ - \ref MSG_ext_icomms_code
+   - \ref MSG_ext_icomms_preliminary
+   - \ref MSG_ext_icomms_Sender
+   - \ref MSG_ext_icomms_Receiver
+   - \ref MSG_ext_icomms_core
+   - \ref MSG_ext_icomms_Main
+ - \ref MSG_ext_icomms_fct_Waitall
+ - \ref MSG_ext_icomms_fct_Waitany
+
+<hr>
+
+\dontinclude msg/icomms/peer.c
+
+\paragraph MSG_ext_icomms_code Code of the application
+
+\paragraph MSG_ext_icomms_preliminary Preliminary declarations
+\skip include
+\until Sender function
+
+\paragraph MSG_ext_icomms_Sender Sender function
+
+The sender send to a receiver an asynchronous message with the function "MSG_task_isend()". Cause this function is non-blocking
+we have to make "MSG_comm_test()" to know   if the communication is finished for finally destroy it with function "MSG_comm_destroy()".
+It also available to "make MSG_comm_wait()" which make both of them.
+
+  C style arguments (argc/argv) are interpreted as:
+   - the number of tasks to distribute
+   - the computation size of each task
+   - the size of the files associated to each task
+   - a list of host that will accept those tasks.
+   - the time to sleep at the beginning of the function
+   - This time defined the process sleep time
+                       if time = 0 use of MSG_comm_wait()
+                       if time > 0 use of MSG_comm_test()
+
+
+\until Receiver function
+
+\paragraph MSG_ext_icomms_Receiver Receiver function
+
+This function executes tasks when it receives them. As the receiving is asynchronous we have to test the communication to know
+if it is completed or not with "MSG_comm_test()" or wait for the completion "MSG_comm_wait()".
+
+  C style arguments (argc/argv) are interpreted as:
+   - the id to use for received the communication.
+   - the time to sleep at the beginning of the function
+   - This time defined the process sleep time
+                       if time = 0 use of MSG_comm_wait()
+                       if time > 0 use of MSG_comm_test()
+
+\until Test function
+
+\paragraph MSG_ext_icomms_core Simulation core
+
+  This function is the core of the simulation and is divided only into 3 parts
+  thanks to MSG_create_environment() and MSG_launch_application().
+     -# Simulation settings : MSG_create_environment() creates a realistic
+        environment
+     -# Application deployment : create the processes on the right locations with
+        MSG_launch_application()
+     -# The simulation is run with #MSG_main()
+
+  Its arguments are:
+       - <i>platform_file</i>: the name of a file containing an valid surfxml platform description.
+       - <i>application_file</i>: the name of a file containing a valid surfxml application description
+
+\until Main function
+
+\paragraph MSG_ext_icomms_Main Main function
+
+This initializes MSG, runs a simulation, and free all data-structures created by MSG.
+
+\until end_of_main
+
+\dontinclude msg/icomms/peer2.c
+
+\paragraph MSG_ext_icomms_fct_Waitall Waitall function for sender
+
+The use of this function permit to send all messages and wait for the completion of all in one time.
+
+\skipline Sender function
+\until end_of_sender
+
+\paragraph MSG_ext_icomms_fct_Waitany Waitany function
+
+The MSG_comm_waitany() function return the place of the first message send or receive from a xbt_dynar_t table.
+
+\paragraph MSG_ext_icomms_fct_Waitany_sender From a sender
+We can use this function to wait all sent messages.
+\dontinclude msg/icomms/peer3.c
+\skipline Sender function
+\until end_of_sender
+
+\paragraph MSG_ext_icomms_fct_Waitany_receiver From a receiver
+We can also wait for the arrival of all messages.
+\dontinclude msg/icomms/peer3.c
+\skipline Receiver function
+\until end_of_receiver
+
+\subsubsection MSG_ex_master_slave Basic Master/Slaves
+
+Simulation of a master-slave application using a realistic platform
+and an external description of the deployment.
+
+\paragraph MSG_ex_ms_TOC Table of contents:
+
+   - \ref MSG_ext_ms_preliminary
+   - \ref MSG_ext_ms_master
+   - \ref MSG_ext_ms_slave
+   - \ref MSG_ext_ms_forwarder
+   - \ref MSG_ext_ms_core
+   - \ref MSG_ext_ms_main
+   - \ref MSG_ext_ms_helping
+   - \ref MSG_ext_ms_application
+   - \ref MSG_ext_ms_platform
+
+<hr>
+
+\dontinclude msg/masterslave/masterslave_forwarder.c
+
+
+\paragraph MSG_ext_ms_preliminary Preliminary declarations
+
+\skip include
+\until printf
+\until }
+
+\paragraph MSG_ext_ms_master Master code
+
+This function has to be assigned to a msg_process_t that will behave as
+the master. It should not be called directly but either given as a
+parameter to #MSG_process_create() or registered as a public function
+through #MSG_function_register() and then automatically assigned to a
+process through #MSG_launch_application().
+
+C style arguments (argc/argv) are interpreted as:
+   - the number of tasks to distribute
+   - the computation size of each task
+   - the size of the files associated to each task
+   - a list of host that will accept those tasks.
+
+Tasks are dumbly sent in a round-robin style.
+
+\until end_of_master
+
+\paragraph MSG_ext_ms_slave Slave code
+
+This function has to be assigned to a #msg_process_t that has to behave
+as a slave. Just like the master fuction (described in \ref
+MSG_ext_ms_master), it should not be called directly.
+
+This function keeps waiting for tasks and executes them as it receives them.
+
+\until end_of_slave
+
+\paragraph MSG_ext_ms_forwarder Forwarder code
+
+This function has to be assigned to a #msg_process_t that has to behave
+as a forwarder. Just like the master function (described in \ref
+MSG_ext_ms_master), it should not be called directly.
+
+C style arguments (argc/argv) are interpreted as a list of host that
+will accept those tasks.
+
+This function keeps waiting for tasks and dispathes them to its slaves.
+
+\until end_of_forwarder
+
+\paragraph MSG_ext_ms_core Simulation core
+
+This function is the core of the simulation and is divided only into 3 parts
+thanks to MSG_create_environment() and MSG_launch_application().
+   -# Simulation settings : MSG_create_environment() creates a realistic
+      environment
+   -# Application deployment : create the processes on the right locations with
+      MSG_launch_application()
+   -# The simulation is run with #MSG_main()
+
+Its arguments are:
+       - <i>platform_file</i>: the name of a file containing an valid surfxml platform description.
+       - <i>application_file</i>: the name of a file containing a valid surfxml application description
+
+\until end_of_test_all
+
+\paragraph MSG_ext_ms_main Main() function
+
+This initializes MSG, runs a simulation, and free all data-structures created by MSG.
+
+\until end_of_main
+
+\subsubsection MSG_ext_ms_helping Helping files
+
+\paragraph MSG_ext_ms_application Example of application file
+
+\include msg/masterslave/deployment_masterslave.xml
+
+\paragraph MSG_ext_ms_platform Example of platform file
+
+\include msg/small_platform.xml
+
+\section using_smpi Using SMPI
+You should check our online <a href="http://simgrid.gforge.inria.fr/tutorials.html"> tutorial section</a> that contains a dedicated tutorial. 
+
+\section using_MC Using Model Checking
+You should check our online <a href="http://simgrid.gforge.inria.fr/tutorials.html"> tutorial section</a> that contains a dedicated tutorial. 
+
+\section using_trace Using Trace
+Check out the \ref tracing section.
+
+You should check our online <a href="http://simgrid.gforge.inria.fr/tutorials.html"> tutorial section</a> that contains a dedicated tutorial. 
+
+\section using_simdag Using SimDag
+You should check our online <a href="http://simgrid.gforge.inria.fr/tutorials.html"> tutorial section</a> that contains a dedicated tutorial. 
+
+\section using_simix Using SIMIX
+You should check our online <a href="http://simgrid.gforge.inria.fr/tutorials.html"> tutorial section</a> that contains a dedicated tutorial. 
+
+*/
+
+