X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/20bce0939a53dd9bb3c6ea68107e9529372db19b..b8f1fa1304e5b8ad170ef29c9fcb14ccf0a6d832:/doc/FAQ.doc diff --git a/doc/FAQ.doc b/doc/FAQ.doc index 2953a568ea..f48d3fab69 100644 --- a/doc/FAQ.doc +++ b/doc/FAQ.doc @@ -112,7 +112,7 @@ For Unix and MacOS: \li cmake (download page) For Windows : - \li cmake 2.8.3 (download page) + \li cmake 2.8 (download page) \li perl strawberry (download page) \li pcre-7.0 (download page) @@ -120,11 +120,9 @@ For Windows : \verbatim "cmake -D[name]=[value] ... ./" - + [name] enable_gtnets [value] ON/OFF or TRUE/FALSE or 1/0 - enable_java ON/OFF or TRUE/FALSE or 1/0 enable_lua ON/OFF or TRUE/FALSE or 1/0 - enable_ruby ON/OFF or TRUE/FALSE or 1/0 enable_compile_optimizations ON/OFF or TRUE/FALSE or 1/0 enable_compile_warnings ON/OFF or TRUE/FALSE or 1/0 enable_smpi ON/OFF or TRUE/FALSE or 1/0 @@ -132,23 +130,25 @@ For Windows : enable_supernovae ON/OFF or TRUE/FALSE or 1/0 enable_tracing ON/OFF or TRUE/FALSE or 1/0 enable_coverage ON/OFF or TRUE/FALSE or 1/0 - enable_memcheck ON/OFF or TRUE/FALSE or 1/0 + enable_memcheck ON/OFF or TRUE/FALSE or 1/0 enable_model-checking ON/OFF or TRUE/FALSE or 1/0 + enable_debug ON/OFF or TRUE/FALSE or 1/0 + enable_jedule ON/OFF or TRUE/FALSE or 1/0 + enable_latency_bound_tracking ON/OFF or TRUE/FALSE or 1/0 + enable_lib_static ON/OFF or TRUE/FALSE or 1/0 + enable_pcre ON/OFF or TRUE/FALSE or 1/0 + custom_flags gtnets_path CMAKE_INSTALL_PREFIX - pipol_user + pipol_user \endverbatim \subsubsection faq_cmakeoption2 Options explaination \li enable_gtnets : set to true implie that user wants to use gtnets. - \li enable_java : set to true implie that user wants to add java langage into simgrid compilation. - \li enable_lua : set to true implie that user wants to add lua langage into simgrid compilation. - \li enable_ruby : set to true implie that user wants to add ruby langage into simgrid compilation. - \li enable_compile_optimizations : add flags "-O3 -finline-functions -funroll-loops -fno-strict-aliasing" \li enable_compile_warnings : add flags "-Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wcomment -Wformat -Wwrite-strings -Wno-unused-function -Wno-unused-parameter -Wno-strict-aliasing -Wno-format-nonliteral -Werror" @@ -159,7 +159,7 @@ For Windows : \li enable_supernovae : set to true make one file for each lib and compile with those generated files. - \li enable_tracing : To enable the generation of simulation traces for visualization + \li enable_tracing : To enable the generation of simulation traces for visualization. \li enable_coverage : When set to true this option enable code coverage by setting -fprofile-arcs -ftest-coverage flags. @@ -167,6 +167,18 @@ For Windows : \li enable_model-checking : Enable the model checking when set to true. + \li enable_debug : If enable_debug is set to 'off' Simgrid compil flag has '-DNDEBUG' option. + + \li enable_jedule : To enable jedule mode, which creates visualizations of task schedules with Simdag. + + \li enable_latency_bound_tracking : Set to on if you want to be warned when communications are limited by round trip time. + + \li enable_lib_static : Enable generated Simgrid and smpi static libraries. + + \li enable_pcre : Use or not the pcre lib for memory optimization. + + \li custom_flags : If user wants to use a specific flag during compilation, give here. + \li gtnets_path : Path to gtnets install directory (ex /usr) \li CMAKE_INSTALL_PREFIX : Path where are installed lib/ doc/ and include/ directories (ex /usr/local) @@ -180,18 +192,22 @@ Those options are initialized the first time you launch "cmake ." whithout speci \verbatim enable_gtnets on enable_lua on -enable_ruby on -enable_java on enable_smpi on enable_supernovae on enable_tracing on enable_compile_optimizations on +enable_debug on +enable_pcre on enable_compile_warnings off enable_maintainer_mode off enable_coverage off enable_memcheck off enable_model-checking off +enable_jedule off +enable_latency_bound_tracking off +enable_lib_static off CMAKE_INSTALL_PREFIX /usr/local +custom_flags null gtnets_path null pipol_user null \endverbatim @@ -298,8 +314,8 @@ For Windows: \verbatim cmake -G"Unix Makefiles" -DCMAKE_INSTALL_PREFIX=C:\simgrid_install ./ -make -make install +gmake +gmake install \endverbatim \subsubsection faq_cmakeinstall2 From a distrib @@ -1607,7 +1623,13 @@ that are created during the simulation (for example, tasks from server1, server2, or request tasks, computation tasks, communication tasks). All resource utilization (host power and link bandwidth) will be classified according to the task category. Tasks that do not belong to a -category are not traced. +category are not traced. The color for the category that is being declared +is random (use next function to specify a color). + +\li \c TRACE_category_with_color (const char *category, const char *color): Same +as TRACE_category, but let user specify a color encoded as a RGB-like string with +three floats from 0 to 1. So, to specify a red color, the user can pass "1 0 0" as +color parameter. A light-gray color can be specified using "0.7 0.7 0.7" as color. \li \c TRACE_msg_set_task_category (m_task_t task, const char *category): This function should be called after the creation of a MSG task, to define the @@ -1623,17 +1645,32 @@ created with the function \c MSG_task_create. The second parameter \c category must contain a category that was previously defined by the function \c TRACE_category. -\li \c TRACE_host_variable_declare (const char *variable): -Declare a user variable that will be associated to hosts. A variable can +\li \c TRACE_[host|link]_variable_declare (const char *variable): +Declare a user variable that will be associated to host/link. A variable can be used to trace user variables such as the number of tasks in a server, -the number of clients in an application, and so on. - -\li \c TRACE_host_variable_[set|add|sub] (const char *variable, double -value): -Set the value of a given user variable. It is important to remind that -the value of this variable is always associated to the host. The host -that will be used when these functions are called is the one returned by -the function \c MSG_host_self(). +the number of clients in an application (for hosts), and so on. + +\li \c TRACE_[host|link]_variable_[set|add|sub] (const char *[host|link], const char *variable, double value): +Set the value of a given user variable for a given host/link. The value +of this variable is always associated to the host/link. The host/link +parameters should be its name as the one listed in the platform file. + +\li \c TRACE_[host|link]_variable_[set|add|sub]_with_time (double time, const char *[host|link], const char *variable, double value): +Same as TRACE_[host|link]_variable_[set|add|sub], but let user specify +the time used to trace it. Users can specify a time that is not the +simulated clock time as defined by the core simulator. This allows +a fine-grain control of time definition, but should be used with +caution since the trace can be inconsistent if resource utilization +traces are also traced. + +\li \c TRACE_link_srcdst_variable_[set|add|sub] (const char *src, const char *dst, const char *variable, double value): +Same as TRACE_link_variable_[set|add|sub], but now users specify a source and +destination hosts (as the names from the platform file). The tracing library +will get the corresponding route that connects those two hosts (src and dst) and +[set|add|sub] the value's variable for all the links of the route. + +\li \c TRACE_link_srcdst_variable_[set|add|sub]_with_time (double time, const char *src, const char *dst, const char *variable, double value): +Same as TRACE_link_srcdst_variable_[set|add|sub], but user specify a time different from the simulated time. \subsubsection faq_tracing_options Tracing configuration Options @@ -1642,8 +1679,21 @@ These are the options accepted by the tracing system of SimGrid: \li \c tracing : - It activates the tracing system and register the simulation platform - in the trace file. You have to enable this option to others take effect. + Safe switch. It activates (or deactivates) the tracing system. + No other tracing options take effect if this one is not activated. + +\li \c +tracing/platform +: + Register the simulation platform in the trace file. + +\li \c +tracing/onelink_only +: + By default, the tracing system uses all routes in the platform file + to re-create a "graph" of the platform and register it in the trace file. + This option let the user tell the tracing system to use only the routes + that are composed with just one link. \li \c tracing/categorized @@ -1658,20 +1708,6 @@ tracing/uncategorized this simulator do not use tracing categories and resource use have to be traced. -\li \c -tracing/platform/method -: - It changes the way resource utilization (categorized or not) is traced - inside the simulation core. Method 'a' (default) traces all updates defined - by the CPU/network model of a given resource. Depending on the interface used - by this simulator (MSG, SMPI, SimDAG), the default method can generate large - trace files. Method 'b' tries to make smaller tracefiles using clever updates, - without losing details of resource utilization. Method 'c' generates even - smaller files by doing time integration during the simulation, but it loses - precision. If this last method is used, the smallest timeslice used in the - tracefile analysis must be bigger than the smaller resource utilization. If - unsure, do not change this option. - \li \c tracing/filename : @@ -1708,11 +1744,18 @@ tracing/msg/process behavior of all categorized MSG processes, grouping them by hosts. This option can be used to track process location if this simulator has process migration. + +\li \c +triva/categorized:graph_categorized.plist +: + This option generates a graph configuration file for Triva considering + categorized resource utilization. + \li \c -tracing/msg/volume +triva/uncategorized:graph_uncategorized.plist : - This experimental option only has effect if this simulator is MSG-based. - It traces the communication volume of MSG send/receive. + This option generates a graph configuration file for Triva considering + uncategorized resource utilization. \subsubsection faq_tracing_example Example of Instrumentation @@ -1723,13 +1766,13 @@ int main (int argc, char **argv) { MSG_global_init (&argc, &argv); - //note that TRACE_start must be called after MSG_global_init + //(... after deployment ...) + + //note that category declaration must be called after MSG_create_environment TRACE_category_with_color ("request", "1 0 0"); TRACE_category_with_color ("computation", "0.3 1 0.4"); TRACE_category ("finalize"); - //(... after deployment ...) - m_task_t req1 = MSG_task_create("1st_request_task", 10, 10, NULL); m_task_t req2 = MSG_task_create("2nd_request_task", 10, 10, NULL); m_task_t req3 = MSG_task_create("3rd_request_task", 10, 10, NULL); @@ -2114,7 +2157,7 @@ Actually, the use of lua in Simgrid is quite simple, you have just to follow the - loading the platforme/deployment XML file that describe the environment of simulation - and … Running the Simulation. -\dontinclude lua/master_slave.lua +\dontinclude lua/masterslave/master.lua \subsubsection faq_binding_lua_example_master_slave Master/Slave Example \li Master Code @@ -2123,16 +2166,18 @@ we mainly use simgrid.Task.new(task_name,computation_size,communication_size) then simgrid.Task.send(task,alias) to send it. we use also simgrid.Task.name(task), to get the task's name. +\dontinclude lua/masterslave/slave.lua \li Slave Code \until end_of_slave Here, we see the use of simgrid.Task.recv(alias) to receive a task with a specific alias, this function return directly the task recevied. +\dontinclude lua/masterslave/master_slave.lua \li Set Environmenet and run application \until simgrid.clean() \subsubsection faq_binding_lua_example_data Exchanging Data -You can also exchange data between Process using lua. for that, you have to deal with lua task as a table, +You can also exchange data between Process using lua. for that, you have to deal with lua task as a table, since lua is based itself on a mechanism of tables, so you can exchange any kind of data (tables, matrix, strings,…) between process via tasks. @@ -2240,7 +2285,6 @@ the full example is distributed in the file examples/lua/master_slave_bypass.lua Since v3.4, the use of ruby in simgrid is available for the MSG Module. you can find almost all MSG functionalities in Ruby code, that allows you to set up your environment, manage tasks between hosts and run the simulation. -\dontinclude ruby/MasterSlave.rb \subsubsection faq_binding_ruby_example Master/Slave Ruby Application for each process method(master and slave in this example), you have to associate a ruby class, that should inherit from MSG::Process ruby class, with a 'main' function that describe the behaviour of the process during the simulation. @@ -2251,7 +2295,44 @@ include MSG \endverbatim \li Master code -\until end_of_master +\verbatim +class Master < MSG::Process + # main : that function that will be executed when running simulation + + def main(args) # args is an array containing arguments for function master + size = args.size + for i in 0..size-1 + MSG::info("args["+String(i)+"]="+args[i]) + end + + raise "Master needs 3 arguments" if size < 3 + numberOfTask = Integer(args[0]) + taskComputeSize = Float(args[1]) + taskCommunicationSize = Float(args[2]) + slaveCount = Integer(args[3]) + + # Creates and sends the tasks + for i in 0..numberOfTask-1 + task = Task.new("Task_"+ i.to_s, taskComputeSize , taskCommunicationSize); + mailbox = "slave " + (i%slaveCount).to_s + MSG::info("Master Sending "+ task.name + " to " + mailbox + " with Comput Size " + + task.compSize.to_s) + task.send(mailbox) + MSG::info("Master Done Sending " + task.name + " to " + mailbox) + end + + # Sending Finalize MSG::Tasks + MSG::info("Master: All tasks have been dispatched. Let's tell everybody the computation is over.") + for i in 0..slaveCount-1 + mailbox = "slave " + i.to_s + finalize_task = Task.new("finalize",0,0) + finalize_task.send(mailbox) + end + MSG::info("Master : Everything's Done") + end +end +\endverbatim + the class MSG::Task contains methods that allows the management of the native MSG tasks. in master ruby code we used : @@ -2260,11 +2341,50 @@ in master ruby code we used : - MSG::Task.name : to get the task's name. \li Slave code -\until end_of_slave +\verbatim +class Slave < MSG::Process + + def main(args) + mailbox = "slave " + args[0] + for i in 0..args.size-1 + MSG::debug("args["+String(i)+"]="+args[i]) + end + + while true + MSG::info("Slave '"+ mailbox +"' waiting for new task"); + task = Task.receive(mailbox) + if (task.name == "finalize") + break + end + task.execute + MSG::info("Slave '" + mailbox + "' done executing task "+ task.name + ".") + end + MSG::info("I'm done, see you") + end +end +\enverbatim to receive a task, we use the method MSG::Task.receive(mailbox) that return a MSG:Task object (received task). \li Main chunk -\until MSG.exit + +\verbatim +require 'simgrid' +include MSG +(...) + +if (ARGV.length == 2) + MSG.createEnvironment(ARGV[0]) + MSG.deployApplication(ARGV[1]) + +else + + MSG.createEnvironment("platform.xml") + MSG.deployApplication("deploy.xml") +end +MSG.run +puts "Simulation time : " + MSG.getClock.to_s +MSG.exit +\endverbatim - MSG.createEnvironment(platform_file) : set up the environment - MSG.deployApplication(deployment_file) : load the deployment file description. @@ -2272,7 +2392,7 @@ to receive a task, we use the method MSG::Task.receive(mailbox) that retu \subsubsection faq_binding_ruby_data Exchanging data ruby bindings provides two ways to exchange data between ruby processes. -\li MSG::Task.join & MSG::Task.data \br +\li MSG::Task.join & MSG::Task.data
the MSG::Task class contains 2 methods that allows a data exchange between 2 process. @@ -2321,45 +2441,29 @@ end \subsection faq_trouble_lib_compil SimGrid compilation and installation problems -\subsubsection faq_trouble_lib_config ./configure fails! +\subsubsection faq_trouble_lib_config cmake fails! We know only one reason for the configure to fail: - You are using a broken build environment\n - If symptom is that configure complains about gcc not being able to build + If symptom is that the configury magic complains about gcc not being able to build executables, you are probably missing the libc6-dev package. Damn Ubuntu. If you experience other kind of issue, please get in touch with us. We are always interested in improving our portability to new systems. -\subsubsection faq_trouble_distcheck Dude! "make check" fails on my machine! +\subsubsection faq_trouble_distcheck Dude! "ctest" fails on my machine! Don't assume we never run this target, because we do. Check -http://bob.loria.fr:8010 if you don't believe us. - -There is several reasons which may cause the make check to fail on your -machine: - - - You are using a broken libc (probably concerning the contextes).\n - The symptom is that the "make check" fails within the examples/msg directory.\n - By default, SimGrid uses something called ucontexts. This is part of the - libc, but it's quite undertested. For example, some (old) versions of the - glibc on alpha do not implement these functions, but provide the stubs - (which return ENOSYS: not implemented). It may fool our detection mechanism - and leads to segfaults. There is not much we can do to fix the bug. - A workaround is to compile with --with-context=pthread to avoid - ucontext completely. You'll be a bit more limited in the number - of simulated processes you can start concurrently, but 5000 - processes is still enough for most purposes, isn't it?\n - This limitation is the reason why we insist on using this piece of ... - software even if it's so troublesome.\n - => use --with-pthread on AMD64 architecture that do not have an - ultra-recent libc. - - - There is a bug in SimGrid we aren't aware of.\n - If none of the above apply, please drop us a mail on the mailing list so - that we can check it out. Make sure to read \ref faq_bugrepport - before you do so. +http://cdash.inria.fr/CDash/index.php?project=Simgrid (click on +previous if there is no result for today: results are produced only by +11am, French time) and +https://buildd.debian.org/status/logs.php?pkg=simgrid if you don't believe us. + +If it's failing on your machine in a way not experienced by the +autobuilders above, please drop us a mail on the mailing list so that +we can check it out. Make sure to read \ref faq_bugrepport before you +do so. \subsection faq_trouble_compil User code compilation problems