X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d7c2ab2b9f1e062530c924f187f3fce07d1648d1..96e69d0914a643f29b18149036bbd8d33ff047d9:/doc/gtut-files/gtut-tour-03-args.doc diff --git a/doc/gtut-files/gtut-tour-03-args.doc b/doc/gtut-files/gtut-tour-03-args.doc new file mode 100644 index 0000000000..3e13e0d3e1 --- /dev/null +++ b/doc/gtut-files/gtut-tour-03-args.doc @@ -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 + +
+ +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 + +*/