\li cmake <a href="http://www.cmake.org/cmake/resources/software.html">(download page)</a>
For Windows :
- \li cmake 2.8.3 <a href="http://www.cmake.org/files/v2.8/cmake-2.8.3-win32-x86.exe">(download page)</a>
- \li Dev-c++ <a href="ftp://75d353a9ed4a246611464e0cb31af917:1296070940@ftpclubic22.clubic.com/logiciel/dev-c-_dev-c_5.0_beta_9.2_anglais_9832.exe">(download page)</a>
+ \li cmake 2.8 <a href="http://www.cmake.org/cmake/resources/software.html">(download page)</a>
\li perl strawberry <a href="http://www.strawberryperl.com/download/5.12.2.0/strawberry-perl-5.12.2.0.msi">(download page)</a>
\li pcre-7.0 <a href="http://sourceforge.net/projects/gnuwin32/files/pcre/7.0/pcre-7.0.exe/download">(download page)</a>
- \li Set environment variables.
-
-\verbatim
-CC to C:\Dev-Cpp\bin\gcc
-CXX to C:\Dev-Cpp\bin\g++
-INCLUDE to C:\Dev-Cpp\include
-LIB to C:\Dev-Cpp\lib
-PCRE_LIBRARY_PATH to C:\
-PATH to C:\Dev-Cpp\bin
-\endverbatim
\subsubsection faq_cmakeoption1 Liste of options
\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
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 <flags>
gtnets_path <path_to_gtnets_directory>
CMAKE_INSTALL_PREFIX <path_to_install_directory>
- pipol_user <pipol_username>
+ pipol_user <pipol_username>
\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"
\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.
\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)
\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
make
\endverbatim
+On Windows
+
+\verbatim
+cmake -G"Unix Makefiles" -D[name]=[value] ... ./
+gmake
+\endverbatim
+
\subsubsection faq_cmakecompilation2 With ccmake tool.
\verbatim
\verbatim
cmake -G"Unix Makefiles" -DCMAKE_INSTALL_PREFIX=C:\simgrid_install ./
-make
-make install
+gmake
+gmake install
\endverbatim
\subsubsection faq_cmakeinstall2 From a distrib
/* Parse the file */
surf_parse_open(file);
- xbt_assert1((!surf_parse()), "Parse error in %s", file);
+ xbt_assert(!surf_parse(), "Parse error in %s", file);
surf_parse_close();
\endverbatim
- 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
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.
Since v3.4, the use of <a href="http://ruby-lang.org">ruby</a> 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 <i>MSG::Process</i> ruby class,
with a 'main' function that describe the behaviour of the process during the simulation.
\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 :
- <i>MSG::Task.name</i> : 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 <i>MSG::Task.receive(mailbox)</i> 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
- <i>MSG.createEnvironment(platform_file)</i> : set up the environment
- <i>MSG.deployApplication(deployment_file)</i> : load the deployment file description.
\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 <br/>
the MSG::Task class contains 2 methods that allows a data exchange between 2 process.