Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Massive file renaming (stupid CVS) so that we can have more than 9 lessons and still...
[simgrid.git] / doc / gtut-tour-03-args.doc
diff --git a/doc/gtut-tour-03-args.doc b/doc/gtut-tour-03-args.doc
new file mode 100644 (file)
index 0000000..33042c2
--- /dev/null
@@ -0,0 +1,49 @@
+
+/** 
+@page GRAS_tut_tour_args Lesson 3: Passing arguments to the processes (in SG)
+
+\section GRAS_tut_tour_args_toc Table of Contents
+ - \ref GRAS_tut_tour_args_use
+ - \ref GRAS_tut_tour_args_sg
+ - \ref GRAS_tut_tour_args_recap
+   
+<hr>
+
+The most problematic issue with the code of previous lesson is that it does
+not work in RL since we hardcoded the server hostname in the client code. We
+will thus learn you how to pass arguments to your processes to overcome this
+situation.
+
+\section GRAS_tut_tour_args_use Using command line arguments from user code
+
+In RL, the situation is quite simple: we just have to use the command line
+arguments as we would do in a usual C program. In the server, only change
+concern the opennong of the master socket:
+\dontinclude 03-args.c
+\skip gras_socket_server
+\until gras_socket_server
+
+In the client, we only need to change the way we open the client socket:
+\skip gras_socket_client
+\until gras_socket_client
+
+The rest of the program remains inchanged. 
+
+\section GRAS_tut_tour_args_sg Passing command line arguments in deployment files
+
+At this point, the problem is to pass arguments to the processes in SG.
+Fortunately, it is quite simple. You just have to edit your deployment file
+so that it reads: \include 03-args.xml
+The syntax should be self-explanatory at this point.
+
+\section GRAS_tut_tour_args_recap Recaping everything together
+
+The whole program now reads:
+\include 03-args.c
+
+And here is the output:
+\include 03-args.output
+
+Go to \ref GRAS_tut_tour_callbacks
+
+*/