Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Mon, 1 May 2017 12:19:09 +0000 (14:19 +0200)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Mon, 1 May 2017 12:19:09 +0000 (14:19 +0200)
85 files changed:
BuildSimGrid.sh [new file with mode: 0755]
doc/doxygen/deployment.doc
doc/doxygen/getting_started.doc
doc/doxygen/platform.doc
include/simgrid/forward.h
include/simgrid/s4u.hpp
include/simgrid/s4u/Actor.hpp
include/simgrid/s4u/Comm.hpp [moved from include/simgrid/s4u/comm.hpp with 72% similarity]
include/simgrid/s4u/Engine.hpp [moved from include/simgrid/s4u/engine.hpp with 84% similarity]
include/simgrid/s4u/File.hpp [moved from include/simgrid/s4u/file.hpp with 84% similarity]
include/simgrid/s4u/Host.hpp [moved from include/simgrid/s4u/host.hpp with 69% similarity]
include/simgrid/s4u/Mailbox.hpp
include/simgrid/s4u/Mutex.hpp
include/simgrid/s4u/Storage.hpp [moved from include/simgrid/s4u/storage.hpp with 88% similarity]
include/simgrid/s4u/VirtualMachine.hpp
include/simgrid/simix.h
src/bindings/java/jmsg.cpp
src/bindings/java/jmsg_as.cpp
src/bindings/java/jmsg_host.cpp
src/bindings/java/jmsg_task.cpp
src/instr/instr_paje_containers.cpp
src/instr/jedule/jedule_sd_binding.cpp
src/kernel/EngineImpl.cpp
src/kernel/activity/MailboxImpl.cpp
src/kernel/activity/MailboxImpl.hpp
src/kernel/activity/SynchroExec.cpp
src/kernel/activity/SynchroSleep.cpp
src/kernel/routing/NetPoint.cpp
src/kernel/routing/NetZoneImpl.cpp
src/kernel/routing/VivaldiZone.cpp
src/mc/ChunkedData.cpp
src/mc/PageStore.cpp
src/mc/PageStore.hpp
src/mc/mc_base.cpp
src/mc/mc_mmu.h
src/mc/mc_smx.cpp
src/mc/mc_snapshot.h
src/msg/instr_msg_process.cpp
src/msg/msg_environment.cpp
src/msg/msg_global.cpp
src/msg/msg_host.cpp
src/msg/msg_io.cpp
src/msg/msg_process.cpp
src/s4u/s4u_actor.cpp
src/s4u/s4u_comm.cpp
src/s4u/s4u_engine.cpp
src/s4u/s4u_file.cpp
src/s4u/s4u_host.cpp
src/s4u/s4u_netzone.cpp
src/s4u/s4u_storage.cpp
src/simdag/sd_global.cpp
src/simgrid/host.cpp
src/simix/ActorImpl.cpp
src/simix/ActorImpl.hpp
src/simix/smx_deployment.cpp
src/simix/smx_global.cpp
src/simix/smx_io.cpp
src/simix/smx_network.cpp
src/simix/smx_private.h
src/smpi/SmpiHost.cpp
src/smpi/SmpiHost.hpp
src/smpi/smpi_comm.cpp
src/smpi/smpi_datatype.cpp
src/smpi/smpi_dvfs.cpp
src/smpi/smpi_pmpi.cpp
src/smpi/smpi_request.cpp
src/surf/cpu_interface.hpp
src/surf/instr_routing.cpp
src/surf/network_cm02.cpp
src/surf/network_interface.hpp
src/surf/plugins/host_energy.cpp
src/surf/plugins/host_load.cpp
src/surf/sg_platf.cpp
src/surf/storage_interface.hpp
src/surf/storage_n11.cpp
src/surf/surf_c_bindings.cpp
src/surf/surf_interface.cpp
src/surf/xml/surfxml_sax_cb.cpp
teshsuite/s4u/actor/actor.cpp
teshsuite/simdag/flatifier/flatifier.cpp
teshsuite/simdag/is-router/is-router.cpp
teshsuite/surf/surf_usage/surf_usage.cpp
teshsuite/surf/surf_usage2/surf_usage2.cpp
tools/cmake/DefinePackages.cmake
tools/internal/check_dist_archive.exclude

diff --git a/BuildSimGrid.sh b/BuildSimGrid.sh
new file mode 100755 (executable)
index 0000000..5f3ce84
--- /dev/null
@@ -0,0 +1,11 @@
+#! /bin/sh
+#
+# This little script rebuilds and runs the SimGrid archive in parallel, extracting a log
+# This is almost an internal script, but others may find this useful
+#
+# Copyright (C) 2017 The SimGrid Team. Licence: LGPL of WDFPL, as you want.
+
+(
+  (nice make -j4 || make) && nice ctest -j4 --output-on-failure ; date
+) 2>&1 | tee BuildSimGrid.sh.log
+exit 0
index 3870070..5d24f76 100644 (file)
@@ -1,15 +1,40 @@
 /*! @page deployment Deploy the simulation
 
-When you want to simulate the behavior of your code with SimGrid, you need
-to tell SimGrid exactly what code (that you wrote) is supposed to be run by which host - so you need to assign
-processes/functions to hosts. The hosts in question here are the hosts of your platform model; see Section @ref platform for details on how to set one up.
-
-This assignment of the form @c code -> @c host is what the deployment file is all about, which will
-be discussed briefly here.
-
-@note 
-    You can bypass the deployment file by hardcoding it in your user code, at least when you're using
-    MSG.
+Once you've specified your @ref platform "virtual platform" and the
+@ref application "application" you want to study, you must describe
+the mapping of the application onto the platform. This page says how
+to do that if you go for online simulation (that is, the study of a
+program), you must say which code starts on which host, with which
+parameters. You can also go for offline simulation, i.e. the study of
+a trace captured from a past applicative run, as briefly explained
+@ref XBT_replay "here".
+
+There is two ways to specify the mapping of your program onto virtual
+hosts: either directly from your program (with @ref MSG_process_create
+or as in @ref s4u_ex_basics "this S4U example"), or using an external
+XML file.  You should really logically separate your application from
+the deployment, as it will ease your experimental campain afterward.
+How exactly you organize your work remains up to you.
+
+@section deploy_s4u
+
+The following example shows the several ways of doing so in the S4U
+interface: @ref examples/s4u/actor-create/s4u_actor-create.cpp.
+Associated XML file: @ref examples/s4u/actor-create/s4u_actor-create_d.xml
+
+@section deploy_msg
+
+If you're stuck with the MSG interface, then you should simply use one
+of the following functions to start new actors onto your virtual
+hosts: @ref MSG_process_create, @ref MSG_process_create_with_arguments
+or @ref MSG_process_create_with_environment. These functions are used
+in many of the provided example, just grep for them.
+
+@section deploy_xml
+
+This section presents how to deploy from an XML file, as it is
+classically done. You will find a huge amount of examples of this in
+the @c examples directory.
 
 The deployment file looks just like a @ref platform "platform" file, except that in
 this case, only two different tags are used: @c process and @c argument, whereas
index 4ef1c69..19f0bae 100644 (file)
@@ -38,7 +38,8 @@ Any SimGrid study entails the following components:
 
  - The studied **Application**. This can be either a distributed
    algorithm described in our simple APIs, or a full featured real
-   parallel application using the MPI interface (or other).
+   parallel application using for example the MPI interface 
+   @ref application "(more info)".
 
  - The **Virtual Platform**. This is a description of a given
    distributed system (machines, links, disks, clusters, etc). Most of
@@ -47,19 +48,21 @@ Any SimGrid study entails the following components:
    Platform with a Dynamic Scenario where for example the links are
    slowed down (because of external usage), the machines fail. You
    have even support to specify the applicative workload that you want
-   to feed to your application.
+   to feed to your application  @ref platform "(more info)".
 
- - The application's **Deployment Description**. In SimGrid terminology,
-   the application is an inert set of source files and binaries. To
-   make it run, you have to describe how your application should be
-   deployed on the virtual platform. Specify which process is located
-   on which host, along with its parameters.
+ - The application's **Deployment Description**. In SimGrid
+   terminology, the application is an inert set of source files and
+   binaries. To make it run, you have to describe how your application
+   should be deployed on the virtual platform. You need to specify
+   which process is mapped on which host, along with their parameters
+   @ref deployment "(more info)".
 
  - The **Platform Models**. They describe how the virtual platform
    reacts to the actions of the application. For example, they compute
    the time taken by a given communication on the virtual platform.
    These models are already included in SimGrid, and you only need to
-   pick one and maybe tweak its configuration to get your results.
+   pick one and maybe tweak its configuration to get your results
+   @ref models "(more info)".
 
 These components are put together to run a **simulation**, that is an
 experiment or a probe. The result of one or many simulation provides
@@ -85,6 +88,22 @@ The questions that SimGrid can solve include the following:
    probe will not change the simulated state). It also makes it easy
    to mock some parts of the real system that are not under study.
 
+Depending on the context, you may see some parts of this process as
+less important, but you should pay close attention if you want to be
+confident in the results coming out of your simulations. In
+particular, you should not trust blindly your results but always
+strive to double-check them. Likewise, you should question the realism
+of your input configuration, and we even encourage you to doubt (and
+check) the provided performance models.
+
+To ease such questionning, you really should logically separate these
+parts in your experimental setup. It is seen as a very bad practice to
+merge the application, the platform and the deployment all together.
+SimGrid is versatile and your milleage may vary, but you should start
+with your Application specified as a C++ or Java program, using one of
+the provided XML platform file, and with your deployment in a separate
+XML file.
+
 @section starting_gears SimGrid Execution Gears
 
 Depending on the intended study, SimGrid can be run in several gears,
@@ -97,7 +116,7 @@ the experimental scenario.
 In this gear, SimGrid can provide information about the time taken by
 your application, the amount of energy dissipated by the platform to
 run your application and the detailed usage of each resource.
-   
+
 ** **Model-Checking Gear**. This can be seen as a sort of exhaustive
 testing gear, where every possible outcome of your application is
 explored. In some sense, this gear tests your application for all
@@ -106,15 +125,15 @@ possible platforms that you could imagine (and more).
 You just provide the application and its deployment (amount of
 processes and parameters), and the model-checker will litterally
 explore all possible outcomes by testing all possible message
-interleaving: if at some point a given process can either receive the
+interleavings: if at some point a given process can either receive the
 message A first or the message B depending on the platform
 characteristics, the model-checker will explore the scenario where A
 arrives first, and then rewind to the same point to explore the
-scenarion where B arrives first.
+scenario where B arrives first.
 
 This is a very powerful gear, where you can evaluate the correction of
-your application. It can verify either *safety properties* (asserts) 
-or *liveless properties* stating for example that if a given event
+your application. It can verify either **safety properties** (asserts) 
+or **liveless properties** stating for example that if a given event
 occures, then another given event will occur in a finite amount of
 steps. This gear is not only usable with the abstract algorithms
 developed on top of the SimGrid APIs, but also with real MPI
@@ -122,10 +141,16 @@ applications (to some extend).
 
 The main limit of Model Checking lays in the huge amount of scenarios
 to explore. SimGrid tries to explore only non-redundent scenarios
-thanks to classical reduction techniques (such as DPOR and statefull
+thanks to classical reduction techniques (such as DPOR and stateful
 exploration) but the exploration may well never finish if you don't
 carefully adapt your application to this gear.
 
+A classical trap is that the Model Checker can only verify whether
+your application fits the provided properties, which is useless if you
+have a bug in your property. Remember also that one way for your
+application to never violate a given assert is to not start at all
+because of a stupid bug.
+
 Another limit of this gear is that it does not use the performance
 models of the simulation gear. Time becomes discrete: You can say for
 example that the application took 42 steps to run, but there is no way
index 14b94aa..f9601f9 100644 (file)
@@ -2,46 +2,63 @@
 
 @tableofcontents
 
-In order to run any simulation, SimGrid must be provided with three things:
-something to run (i.e., your code), a description of the platform on which you want to simulate your application, and 
-information about the deployment of the application: Which process should be executed onto which processor/core?
-
-For the last two items, there are essentially three possible ways you can provide
-this information as an input:
-\li You can program, if you're using MSG, some of the platform and
-    deployment functions. If you choose to follow this approach, check the dedicated documentation
-    (\ref msg_simulation).
-\li You can use two XML files: one for the platform description and the other for the deployment. 
-\li You can program the description of your platform  in Lua format.
-
-For more information on SimGrid's deployment features, please refer to the \ref deployment section.
-
-The platform description may be intricate. This documentation is all
-about how to write this file. You should read about the
-@ref routing_basics "routing basic concepts" before proceeding. This page
-first contain a reference guide of the XML. Finally, it gives some hints and tips on how to write a better 
-platform description.
-
-\section pf_overview Some words about XML and DTD
-
-We opted for XML not only because it is extensible but also because many tools (and plugins for existing tools) are 
-available that facilitate editing and validating XML files. Furthermore, libraries that parse XML are often already
-available and very well tested.
-
-The XML checking is done based on the [simgrid.dtd](http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd) Document Type 
-Definition (DTD) file.
-
-If you read the DTD, you should notice the following:
-\li The platform tag has a version attribute. The current version is <b>4</b>. This attribute might be used in the 
-    provide backward compatibility.
-\li The DTD contains definitions for both the platform description and deployment files used by SimGrid.
-
-\section pf_netzones Defining a netzone
-
-Here is a simplistic example, describing a netzone using the Full
-routing.  Other supported values for the routing attribute can be
-found below, Section \ref pf_raf.
-
+As @ref starting_components "explained in the introduction," any
+SimGrid study must entail the description of the platform on which you
+want to simulate your application. You have to describe **each element
+of your platform**, such as computing hosts, clusters, each disks,
+links, etc. You must also define the **routing on your platform**, ie
+which path is taken between two hosts. Finally, you may also describe
+an **experimental scenario**, with qualitative changes (e.g.,
+bandwidth changes representing an external load) and qualitative
+changes (representing how some elements fail and restart over time).
+
+You should really separate your application from the platform
+description, as it will ease your experimental campain afterward.
+Mixing them is seen as a really bad experimental practice. The easiest
+to enforce this split is to put the platform description in a XML
+file. Many example platforms are provided in the archive, and this
+page gives all needed details to write such files, as well as some
+hints and tricks about describing your platform.
+
+On the other side, XML is sometimes not expressive enough for some
+platforms, in particular large platforms exhibiting repetitive
+patterns that are not simply expressed in XML.  In practice, many
+users end up generating their XML platform files from some sort of
+scripts. It is probably preferable to rewrite your XML @ref
+platform_lua "platform using the lua scripting language" instead.
+In the future, it should be possible to describe the platform directly
+in C++, but this is not possible yet.
+
+As usual, SimGrid is a versatile framework, and you should find the
+way of describing your platform that best fits your experimental
+practice. 
+
+\section pf_overview Describing the platform with XML
+
+Your platform description should follow the specification presented in
+the [simgrid.dtd](http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd)
+DTD file. The same DTD is used for both the platform and deployment
+files.
+
+From time to time, this DTD evolves to introduce possibly
+backward-incompatible changes. That is why each platform desciption is
+enclosed within a @c platform tag, that have a @c version attribute. 
+The current version is <b>4</b>. The @c simgrid_update_xml program can
+upgrade most of the past platform files to the recent formalism.
+
+\section pf_netzones Defining a NetZone
+
+In SimGrid, any resource must be located within a given **NetZone**.
+Each netzone is in charge of the routing between its resources. It
+means that when an host wants to communicate with another host of the
+same NetZone, it is the NetZone's duty to find the list of links that
+are involved in the communication. If the hosts are not in the same
+NetZone, @ref routing_basics "things are slightly more complex" to
+determine the links involved in a time- and space-efficient manner.
+
+But only one NetZone is really sufficient to begin with. The following
+chunk describes a simplistic NetZone using the Full routing (we will
+have to specify each and every routes manually). 
 
 \verbatim
 <AS id="netzone0" routing="Full">
index 5081b05..6f81a81 100644 (file)
@@ -112,4 +112,6 @@ typedef unsigned long long sg_size_t;
  */
 typedef long long sg_offset_t;
 
+typedef unsigned long aid_t;
+
 #endif
index 0da7c98..b4a1a64 100644 (file)
@@ -8,15 +8,15 @@
 
 #include <simgrid/s4u/Activity.hpp>
 #include <simgrid/s4u/Actor.hpp>
+#include <simgrid/s4u/Engine.hpp>
+#include <simgrid/s4u/Host.hpp>
 #include <simgrid/s4u/Mailbox.hpp>
-#include <simgrid/s4u/engine.hpp>
-#include <simgrid/s4u/host.hpp>
 
+#include <simgrid/s4u/Comm.hpp>
 #include <simgrid/s4u/ConditionVariable.hpp>
 #include <simgrid/s4u/Mutex.hpp>
-#include <simgrid/s4u/comm.hpp>
 
-#include <simgrid/s4u/storage.hpp>
-#include <simgrid/s4u/file.hpp>
+#include <simgrid/s4u/File.hpp>
+#include <simgrid/s4u/Storage.hpp>
 
 #endif /* SIMGRID_S4U_S4U_H */
index c158e9d..24f7437 100644 (file)
@@ -207,10 +207,14 @@ public:
   simgrid::xbt::string name();
   /** Retrieves the host on which that actor is running */
   s4u::Host* host();
-  /** Retrieves the PID of that actor */
-  int pid();
-  /** Retrieves the PPID of that actor */
-  int ppid();
+  /** Retrieves the PID of that actor
+   *
+   * actor_id_t is an alias for unsigned long */
+  aid_t pid();
+  /** Retrieves the PPID of that actor
+   *
+   * actor_id_t is an alias for unsigned long */
+  aid_t ppid();
 
   /** Suspend an actor by suspending the task on which it was waiting for the completion. */
   void suspend();
@@ -246,10 +250,10 @@ public:
    */
   void kill();
 
-  static void kill(int pid);
+  static void kill(aid_t pid);
 
   /** Retrieves the actor that have the given PID (or nullptr if not existing) */
-  static ActorPtr byPid(int pid);
+  static ActorPtr byPid(aid_t pid);
 
   /** @brief Wait for the actor to finish.
    *
@@ -313,11 +317,11 @@ namespace this_actor {
 
   XBT_PUBLIC(Comm&) isend(MailboxPtr chan, void* payload, double simulatedSize);
 
-  /** @brief Returns the PID of the current actor. */
-  XBT_PUBLIC(int) pid();
+  /** @brief Returns the actor ID of the current actor (same as pid). */
+  XBT_PUBLIC(aid_t) pid();
 
-  /** @brief Returns the PPID of the current actor. */
-  XBT_PUBLIC(int) ppid();
+  /** @brief Returns the ancestor's actor ID of the current actor (same as ppid). */
+  XBT_PUBLIC(aid_t) ppid();
 
   /** @brief Returns the name of the current actor. */
   XBT_PUBLIC(std::string) name();
similarity index 72%
rename from include/simgrid/s4u/comm.hpp
rename to include/simgrid/s4u/Comm.hpp
index 239755e..2a49c55 100644 (file)
@@ -8,31 +8,30 @@
 
 #include <xbt/base.h>
 
+#include <simgrid/forward.h>
 #include <simgrid/s4u/Activity.hpp>
 #include <simgrid/s4u/forward.hpp>
-#include <simgrid/forward.h>
-
 
 namespace simgrid {
 namespace s4u {
 
-
 /** @brief Communication async
  *
  * Represents all asynchronous communications, that you can test or wait onto.
  */
-XBT_PUBLIC_CLASS Comm : public Activity {
+XBT_PUBLIC_CLASS Comm : public Activity
+{
   Comm() : Activity() {}
 public:
   ~Comm() override;
 
-  /*! take a range of s4u::Comm* (last excluded) and return when one of them is finished. The return value is an iterator on the finished Comms. */
-  template<class I> static
-  I wait_any(I first, I last)
+  /*! take a range of s4u::Comm* (last excluded) and return when one of them is finished. The return value is an
+   * iterator on the finished Comms. */
+  template <class I> static I wait_any(I first, I last)
   {
     // Map to dynar<Synchro*>:
     xbt_dynar_t comms = xbt_dynar_new(sizeof(simgrid::kernel::activity::ActivityImpl*), NULL);
-    for(I iter = first; iter != last; iter++) {
+    for (I iter = first; iter != last; iter++) {
       Comm& comm = **iter;
       if (comm.state_ == inited)
         comm.start();
@@ -46,17 +45,16 @@ public:
     if (idx == -1)
       return last;
     // Lift the index to the corresponding iterator:
-    auto res = std::next(first, idx);
+    auto res       = std::next(first, idx);
     (*res)->state_ = finished;
     return res;
   }
   /*! Same as wait_any, but with a timeout. If wait_any_for return because of the timeout last is returned.*/
-  template<class I> static
-  I wait_any_for(I first, I last, double timeout)
+  template <class I> static I wait_any_for(I first, I last, double timeout)
   {
     // Map to dynar<Synchro*>:
     xbt_dynar_t comms = xbt_dynar_new(sizeof(simgrid::kernel::activity::ActivityImpl*), NULL);
-    for(I iter = first; iter != last; iter++) {
+    for (I iter = first; iter != last; iter++) {
       Comm& comm = **iter;
       if (comm.state_ == inited)
         comm.start();
@@ -70,18 +68,18 @@ public:
     if (idx == -1)
       return last;
     // Lift the index to the corresponding iterator:
-    auto res = std::next(first, idx);
+    auto res       = std::next(first, idx);
     (*res)->state_ = finished;
     return res;
   }
   /** Creates (but don't start) an async send to the mailbox @p dest */
-  static Comm &send_init(MailboxPtr dest);
+  static Commsend_init(MailboxPtr dest);
   /** Creates and start an async send to the mailbox @p dest */
-  static Comm &send_async(MailboxPtr dest, void *data, int simulatedByteAmount);
-    /** Creates (but don't start) an async recv onto the mailbox @p from */
-  static Comm &recv_init(MailboxPtr from);
+  static Comm& send_async(MailboxPtr dest, void* data, int simulatedByteAmount);
+  /** Creates (but don't start) an async recv onto the mailbox @p from */
+  static Commrecv_init(MailboxPtr from);
   /** Creates and start an async recv to the mailbox @p from */
-  static Comm &recv_async(MailboxPtr from, void **data);
+  static Comm& recv_async(MailboxPtr from, void** data);
 
   void start() override;
   void wait() override;
@@ -91,40 +89,39 @@ public:
   void setRate(double rate);
 
   /** Specify the data to send */
-  void setSrcData(void * buff);
+  void setSrcData(void* buff);
   /** Specify the size of the data to send */
   void setSrcDataSize(size_t size);
   /** Specify the data to send and its size */
-  void setSrcData(void * buff, size_t size);
+  void setSrcData(void* buff, size_t size);
 
   /** Specify where to receive the data */
-  void setDstData(void ** buff);
+  void setDstData(void** buff);
   /** Specify the buffer in which the data should be received */
-  void setDstData(void ** buff, size_t size);
+  void setDstData(void** buff, size_t size);
   /** Retrieve the size of the received data */
   size_t getDstDataSize();
 
   bool test();
 
-
 private:
-  double rate_ = -1;
-  void *dstBuff_ = nullptr;
+  double rate_        = -1;
+  void* dstBuff_      = nullptr;
   size_t dstBuffSize_ = 0;
-  void *srcBuff_ = nullptr;
+  void* srcBuff_      = nullptr;
   size_t srcBuffSize_ = sizeof(void*);
 
   /* FIXME: expose these elements in the API */
   int detached_ = 0;
-  int (*matchFunction_)(void *, void *, smx_activity_t) = nullptr;
-  void (*cleanFunction_)(void *) = nullptr;
+  int (*matchFunction_)(void*, void*, smx_activity_t) = nullptr;
+  void (*cleanFunction_)(void*) = nullptr;
   void (*copyDataFunction_)(smx_activity_t, void*, size_t) = nullptr;
 
-  smx_actor_t sender_ = nullptr;
+  smx_actor_t sender_   = nullptr;
   smx_actor_t receiver_ = nullptr;
-  MailboxPtr mailbox_ = nullptr;
+  MailboxPtr mailbox_   = nullptr;
 };
-
-}} // namespace simgrid::s4u
+}
+} // namespace simgrid::s4u
 
 #endif /* SIMGRID_S4U_COMM_HPP */
similarity index 84%
rename from include/simgrid/s4u/engine.hpp
rename to include/simgrid/s4u/Engine.hpp
index ea09d3e..9aab4fe 100644 (file)
@@ -26,13 +26,14 @@ namespace s4u {
  *
  * This class is an interface to the simulation engine.
  */
-XBT_PUBLIC_CLASS Engine {
+XBT_PUBLIC_CLASS Engine
+{
 private:
   ~Engine();
 
 public:
   /** Constructor, taking the command line parameters of your main function */
-  Engine(int *argc, char **argv);
+  Engine(int* argc, char** argv);
 
   /** Finalize the default engine and all its dependencies */
   static void shutdown();
@@ -42,20 +43,20 @@ public:
    * The environment is either a XML file following the simgrid.dtd formalism, or a lua file.
    * Some examples can be found in the directory examples/platforms.
    */
-  void loadPlatform(const char *platf);
+  void loadPlatform(const charplatf);
 
   /** Registers the main function of an actor that will be launched from the deployment file */
-  void registerFunction(const char*name, int (*code)(int,char**));
+  void registerFunction(const char* name, int (*code)(int, char**));
 
   /** Registers a function as the default main function of actors
    *
    * It will be used as fallback when the function requested from the deployment file was not registered.
    * It is used for trace-based simulations (see examples/msg/actions).
    */
-  void registerDefault(int (*code)(int,char**));
+  void registerDefault(int (*code)(int, char**));
 
   /** @brief Load a deployment file and launch the actors that it contains */
-  void loadDeployment(const char *deploy);
+  void loadDeployment(const chardeploy);
 
   size_t hostCount();
   void hostList(std::vector<Host*> * whereTo);
@@ -65,9 +66,9 @@ public:
 
   /** @brief Retrieve the simulation time */
   static double getClock();
-  
+
   /** @brief Retrieve the engine singleton */
-  static s4u::Engine *instance();
+  static s4u::Engineinstance();
 
   /** @brief Retrieve the root netzone, containing all others */
   simgrid::s4u::NetZone* netRoot();
@@ -81,10 +82,9 @@ public:
   void netpointRegister(simgrid::kernel::routing::NetPoint * card);
   void netpointUnregister(simgrid::kernel::routing::NetPoint * card);
 
-  template<class F>
-  void registerFunction(const char* name)
+  template <class F> void registerFunction(const char* name)
   {
-    simgrid::simix::registerFunction(name, [](std::vector<std::string> args){
+    simgrid::simix::registerFunction(name, [](std::vector<std::string> args) {
       return simgrid::simix::ActorCode([args] {
         F code(std::move(args));
         code();
@@ -92,13 +92,10 @@ public:
     });
   }
 
-  template<class F>
-  void registerFunction(const char* name, F code)
+  template <class F> void registerFunction(const char* name, F code)
   {
-    simgrid::simix::registerFunction(name, [code](std::vector<std::string> args){
-      return simgrid::simix::ActorCode([code,args] {
-        code(std::move(args));
-      });
+    simgrid::simix::registerFunction(name, [code](std::vector<std::string> args) {
+      return simgrid::simix::ActorCode([code, args] { code(std::move(args)); });
     });
   }
 
@@ -108,7 +105,7 @@ public:
   simgrid::kernel::EngineImpl* pimpl;
 
 private:
-  static s4u::Engine *instance_;
+  static s4u::Engineinstance_;
 };
 
 /** Callback fired when the platform is created (ie, the xml file parsed),
@@ -120,6 +117,7 @@ extern XBT_PRIVATE xbt::signal<void()> onSimulationEnd;
 
 /** Callback fired when the time jumps into the future */
 extern XBT_PRIVATE xbt::signal<void(double)> onTimeAdvance;
-}} // namespace simgrid::s4u
+}
+} // namespace simgrid::s4u
 
 #endif /* SIMGRID_S4U_ENGINE_HPP */
similarity index 84%
rename from include/simgrid/s4u/file.hpp
rename to include/simgrid/s4u/File.hpp
index 1c552d1..d9d0080 100644 (file)
@@ -19,16 +19,18 @@ class Storage;
  *
  * Used to simulate the time it takes to access to a file, but does not really store any information.
  *
- * They are located on @ref simgrid::s4u::Storage that are accessed from a given @ref simgrid::s4u::Host through mountpoints.
+ * They are located on @ref simgrid::s4u::Storage that are accessed from a given @ref simgrid::s4u::Host through
+ * mountpoints.
  * For now, you cannot change the mountpoints programatically, and must declare them from your platform file.
  */
-XBT_PUBLIC_CLASS File {
+XBT_PUBLIC_CLASS File
+{
 public:
-  File(const char *fullpath, void* userdata);
+  File(const charfullpath, void* userdata);
   ~File();
 
   /** Retrieves the path to the file */
-  const char *path() { return path_;}
+  const char* path() { return path_; }
 
   /** Simulates a read action. Returns the size of data actually read
    *
@@ -44,9 +46,9 @@ public:
   sg_size_t write(sg_size_t size);
 
   /** Allows to store user data on that host */
-  void setUserdata(void *data) {userdata_ = data;}
+  void setUserdata(void* data) { userdata_ = data; }
   /** Retrieves the previously stored data */
-  void* userdata() {return userdata_;}
+  void* userdata() { return userdata_; }
 
   /** Retrieve the datasize */
   sg_size_t size();
@@ -59,7 +61,7 @@ public:
   /** Rename a file
    *
    * WARNING: It is forbidden to move the file to another mount point */
-  void move(const char*fullpath);
+  void move(const char* fullpath);
 
   /** Remove a file from disk */
   void unlink();
@@ -72,10 +74,10 @@ public:
 
 private:
   smx_file_t pimpl_ = nullptr;
-  const char *path_ = nullptr;
-  void *userdata_ = nullptr;
+  const charpath_ = nullptr;
+  void* userdata_   = nullptr;
 };
-
-}} // namespace simgrid::s4u
+}
+} // namespace simgrid::s4u
 
 #endif /* SIMGRID_S4U_HOST_HPP */
similarity index 69%
rename from include/simgrid/s4u/host.hpp
rename to include/simgrid/s4u/Host.hpp
index 463043e..999098f 100644 (file)
 namespace simgrid {
 
 namespace xbt {
-  extern template class XBT_PUBLIC() Extendable<simgrid::s4u::Host>;
+extern template class XBT_PUBLIC() Extendable<simgrid::s4u::Host>;
 }
 namespace s4u {
 
 /** @ingroup s4u_api
  *
- * @tableofcontents 
+ * @tableofcontents
  *
  * An host represents some physical resource with computing and networking capabilities.
  *
@@ -39,11 +39,11 @@ namespace s4u {
  * You can retrieve a particular host using simgrid::s4u::Host::byName()
  * and actors can retrieve the host on which they run using simgrid::s4u::Host::current().
  */
-XBT_PUBLIC_CLASS Host :
-  public simgrid::xbt::Extendable<Host> {
+XBT_PUBLIC_CLASS Host : public simgrid::xbt::Extendable<Host>
+{
 
 public:
-  explicit Host(const char *name);
+  explicit Host(const charname);
 
   /** Host destruction logic */
 protected:
@@ -51,6 +51,7 @@ protected:
 
 private:
   bool currentlyDestroying_ = false;
+
 public:
   void destroy();
   // No copy/move
@@ -62,9 +63,9 @@ public:
   /** Retrieves an host from its name, or return nullptr */
   static Host* by_name_or_null(std::string name);
   /** Retrieves an host from its name, or die */
-  static s4u::Host *by_name(std::string name);
+  static s4u::Hostby_name(std::string name);
   /** Retrieves the host on which the current actor is running */
-  static s4u::Host *current();
+  static s4u::Hostcurrent();
 
   simgrid::xbt::string const& name() const { return name_; }
   const char* cname() { return name_.c_str(); }
@@ -87,9 +88,9 @@ public:
   double speed();
   int coreCount();
   xbt_dict_t properties();
-  const char*property(const char*key);
-  void setProperty(const char*key, const char *value);
-  void processes(std::vector<ActorPtr>* list);
+  const char* property(const char* key);
+  void setProperty(const char* key, const char* value);
+  void processes(std::vector<ActorPtr> * list);
   double getPstateSpeed(int pstate_index);
   int pstatesCount() const;
   void setPstate(int pstate_index);
@@ -101,20 +102,20 @@ public:
    *
    *  This is defined in the platform file, and cannot be modified programatically (yet).
    */
-  boost::unordered_map<std::string, Storage*> const &mountedStorages();
+  boost::unordered_map<std::string, Storage*> constmountedStorages();
 
   void routeTo(Host * dest, std::vector<Link*> * links, double* latency);
   void routeTo(Host * dest, std::vector<surf::LinkImpl*> * links, double* latency);
 
 private:
   simgrid::xbt::string name_ = "noname";
-  boost::unordered_map<std::string, Storage*> *mounts = nullptr; // caching
+  boost::unordered_map<std::string, Storage*>mounts = nullptr; // caching
 
 public:
   // TODO, this could be a unique_ptr
   surf::HostImpl* pimpl_ = nullptr;
   /** DO NOT USE DIRECTLY (@todo: these should be protected, once our code is clean) */
-  surf::Cpu     *pimpl_cpu = nullptr;
+  surf::Cpupimpl_cpu = nullptr;
   /** DO NOT USE DIRECTLY (@todo: these should be protected, once our code is clean) */
   kernel::routing::NetPoint* pimpl_netpoint = nullptr;
 
@@ -128,45 +129,16 @@ public:
    * (either because of a pstate switch or because of an external load event coming from the profile) */
   static simgrid::xbt::signal<void(Host&)> onSpeedChange;
 };
-
-}} // namespace simgrid::s4u
+}
+} // namespace simgrid::s4u
 
 extern int USER_HOST_LEVEL;
 
 #endif /* SIMGRID_S4U_HOST_HPP */
 
 #if 0
-/* Bindings to the MSG hosts */
-
-/* Copyright (c) 2006-2014. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package org.simgrid.msg;
 
 public class Host {
-  /**
-   * This static method returns all of the hosts of the installed platform.
-   *
-   * @return      An array containing all the hosts installed.
-   *
-   */ 
-  public native static Host[] all();
-
-  /** 
-   * This static method sets a mailbox to receive in asynchronous mode.
-   * 
-   * All messages sent to this mailbox will be transferred to 
-   * the receiver without waiting for the receive call. 
-   * The receive call will still be necessary to use the received data.
-   * If there is a need to receive some messages asynchronously, and some not, 
-   * two different mailboxes should be used.
-   *
-   * @param mailboxName The name of the mailbox
-   */
-  public static native void setAsyncMailbox(String mailboxName);
 
   /**
    * This method returns the number of tasks currently running on a host.
@@ -177,11 +149,5 @@ public class Host {
   public native int getLoad();
 
 
-  /** This methods returns the list of storages attached to an host
-   * @return An array containing all storages (name) attached to the host
-   */
-  public native String[] getAttachedStorage();
-
-
-} 
+}
 #endif
index bd0a479..62c36fd 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2015. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2006-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
index a0f8c0c..3603d18 100644 (file)
@@ -22,9 +22,9 @@ class ConditionVariable;
 /** @brief A classical mutex, but blocking in the simulation world
  *  @ingroup s4u_api
  *
- * It is strictly impossible to use a real mutex (such as
+ * It is strictly impossible to use a real mutexsuch as
  * [std::mutex](http://en.cppreference.com/w/cpp/thread/mutex)
- * or [pthread_mutex_t](http://pubs.opengroup.org/onlinepubs/007908775/xsh/pthread_mutex_lock.html)),
+ * or [pthread_mutex_t](http://pubs.opengroup.org/onlinepubs/007908775/xsh/pthread_mutex_lock.html),
  * because it would block the whole simulation.
  * Instead, you should use the present class, that is a drop-in replacement of
  * [std::mutex](http://en.cppreference.com/w/cpp/thread/mutex).
similarity index 88%
rename from include/simgrid/s4u/storage.hpp
rename to include/simgrid/s4u/Storage.hpp
index 79f6ac5..305bbba 100644 (file)
@@ -17,7 +17,8 @@
 namespace simgrid {
 namespace s4u {
 
-XBT_PUBLIC_CLASS Storage {
+XBT_PUBLIC_CLASS Storage
+{
   friend s4u::Engine;
 
   Storage(std::string name, smx_storage_t inferior);
@@ -26,8 +27,8 @@ public:
   Storage() = default;
   virtual ~Storage();
   /** Retrieve a Storage by its name. It must exist in the platform file */
-  static Storage &byName(const char* name);
-  const char *name();
+  static StoragebyName(const char* name);
+  const charname();
   const char* host();
   sg_size_t sizeFree();
   sg_size_t sizeUsed();
@@ -43,9 +44,9 @@ protected:
   smx_storage_t inferior();
 
 public:
-  void setUserdata(void *data) {userdata_ = data;}
-  void *userdata() {return userdata_;}
-  
+  void setUserdata(void* data) { userdata_ = data; }
+  void* userdata() { return userdata_; }
+
 private:
   static std::unordered_map<std::string, Storage*>* storages_;
 
index 0d3c791..2085fae 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015-2016. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2015-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -7,8 +7,8 @@
 #define SIMGRID_S4U_VM_HPP
 
 #include "simgrid/datatypes.h"
+#include "simgrid/s4u/Host.hpp"
 #include "simgrid/s4u/forward.hpp"
-#include "simgrid/s4u/host.hpp"
 
 typedef enum {
   SURF_VM_STATE_CREATED, /**< created, but not yet started */
index 5c3cf43..e06f54f 100644 (file)
@@ -127,7 +127,7 @@ extern int smx_context_guard_size_was_set;
 SG_BEGIN_DECL()
 
 XBT_PUBLIC(xbt_dynar_t) SIMIX_process_get_runnable();
-XBT_PUBLIC(smx_actor_t) SIMIX_process_from_PID(int PID);
+XBT_PUBLIC(smx_actor_t) SIMIX_process_from_PID(aid_t PID);
 XBT_PUBLIC(xbt_dynar_t) SIMIX_processes_as_dynar();
 
 /* parallelism */
index 7ffbb23..265fd61 100644 (file)
@@ -7,13 +7,13 @@
 
 #include <locale.h>
 
-#include <simgrid/msg.h>
-#include <simgrid/simix.h>
-#include <simgrid/plugins/energy.h>
+#include "simgrid/msg.h"
+#include "simgrid/plugins/energy.h"
+#include "simgrid/simix.h"
 
-#include <simgrid/s4u/host.hpp>
+#include "simgrid/s4u/Host.hpp"
 
-#include <src/simix/smx_private.h>
+#include "src/simix/smx_private.h"
 
 #include "jmsg_process.h"
 #include "jmsg_as.h"
index 271990a..9b4f7bf 100644 (file)
@@ -5,8 +5,8 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
+#include "simgrid/s4u/Host.hpp"
 #include "simgrid/s4u/NetZone.hpp"
-#include "simgrid/s4u/host.hpp"
 #include "src/kernel/routing/NetZoneImpl.hpp"
 
 #include "jmsg_as.h"
index 938391c..7b45e78 100644 (file)
@@ -6,7 +6,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "simgrid/plugins/energy.h"
-#include "simgrid/s4u/host.hpp"
+#include "simgrid/s4u/Host.hpp"
 
 #include "jmsg.h"
 #include "jmsg_host.h"
index b8ebf84..d615184 100644 (file)
@@ -5,7 +5,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include <simgrid/s4u/host.hpp>
+#include "simgrid/s4u/Host.hpp"
 
 #include "jmsg.h"
 #include "jmsg_host.h"
index 87edfbe..7a98c74 100644 (file)
@@ -1,18 +1,12 @@
-/* Copyright (c) 2010, 2012-2015. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2010-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "simgrid/s4u/engine.hpp"
-#include "simgrid/s4u/host.hpp"
+#include "simgrid/s4u/Engine.hpp"
+#include "simgrid/s4u/Host.hpp"
 
-#include <xbt/dict.h>
-#include <xbt/lib.h>
-#include <xbt/log.h>
-
-#include <surf/surf.h>
-#include <surf/surf_routing.h>
+#include "surf/surf.h"
 
 #include "src/instr/instr_private.h"
 
index 4206fdb..782bb6e 100644 (file)
@@ -1,18 +1,15 @@
-/* Copyright (c) 2010-2016. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2010-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "xbt/asserts.h"
 #include "simgrid/jedule/jedule_sd_binding.h"
 
-#include "simgrid/forward.h"
-
-#include "../../simdag/simdag_private.hpp"
 #include "simgrid/jedule/jedule.hpp"
+#include "src/simdag/simdag_private.hpp"
+
+#include "simgrid/s4u/Engine.hpp"
 #include "simgrid/s4u/NetZone.hpp"
-#include "simgrid/s4u/engine.hpp"
 
 #if HAVE_JEDULE
 
index 3375539..1760dcf 100644 (file)
@@ -4,9 +4,9 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "src/kernel/EngineImpl.hpp"
+#include "simgrid/s4u/Host.hpp"
 #include "src/kernel/routing/NetPoint.hpp"
 #include "src/kernel/routing/NetZoneImpl.hpp"
-#include <simgrid/s4u/host.hpp>
 
 namespace simgrid {
 namespace kernel {
index b8ff612..06060f4 100644 (file)
@@ -50,11 +50,10 @@ void MailboxImpl::setReceiver(s4u::ActorPtr actor)
   this->permanent_receiver = actor.get()->getImpl();
 }
 /** @brief Pushes a communication activity into a mailbox
- *  @param activity What to add
+ *  @param comm What to add
  */
-void MailboxImpl::push(smx_activity_t synchro)
+void MailboxImpl::push(activity::Comm* comm)
 {
-  simgrid::kernel::activity::Comm* comm = static_cast<simgrid::kernel::activity::Comm*>(synchro);
   this->comm_queue.push_back(comm);
   comm->mbox = this;
 }
index f62d326..2a2ec0d 100644 (file)
@@ -9,6 +9,7 @@
 #include <boost/circular_buffer.hpp>
 
 #include "simgrid/s4u/Mailbox.hpp"
+#include "src/kernel/activity/SynchroComm.hpp"
 #include "src/simix/ActorImpl.hpp"
 
 #define MAX_MAILBOX_SIZE 10000000
@@ -30,7 +31,7 @@ public:
   static MailboxImpl* byNameOrNull(const char* name);
   static MailboxImpl* byNameOrCreate(const char* name);
   void setReceiver(s4u::ActorPtr actor);
-  void push(smx_activity_t synchro);
+  void push(activity::Comm* comm);
   void remove(smx_activity_t activity);
   simgrid::s4u::Mailbox piface_; // Our interface
   char* name_;
index a9d0656..5528f86 100644 (file)
@@ -1,9 +1,9 @@
-/* Copyright (c) 2007-2016. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include <simgrid/s4u/host.hpp>
+#include "simgrid/s4u/Host.hpp"
 
 #include "src/kernel/activity/SynchroExec.hpp"
 #include "src/surf/surf_interface.hpp"
index 9fe6be3..a2f281e 100644 (file)
@@ -1,11 +1,9 @@
-/* Copyright (c) 2007-2016. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include <xbt/log.h>
-
-#include <simgrid/s4u/host.hpp>
+#include "simgrid/s4u/Host.hpp"
 
 #include "src/kernel/context/Context.hpp"
 #include "src/kernel/activity/SynchroSleep.hpp"
index d1f353c..616fdc5 100644 (file)
@@ -1,13 +1,12 @@
-/* Copyright (c) 2009-2011, 2013-2016. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2009-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "src/kernel/routing/NetPoint.hpp"
 
-#include "simgrid/s4u/engine.hpp"
-#include "simgrid/s4u/host.hpp"
+#include "simgrid/s4u/Engine.hpp"
+#include "simgrid/s4u/Host.hpp"
 #include "surf/surf_routing.h"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route, surf, "Routing part of surf");
index efbfb1c..5a64836 100644 (file)
@@ -1,11 +1,11 @@
-/* Copyright (c) 2006-2016. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2006-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "src/kernel/routing/NetZoneImpl.hpp"
-#include "simgrid/s4u/engine.hpp"
-#include "simgrid/s4u/host.hpp"
+#include "simgrid/s4u/Engine.hpp"
+#include "simgrid/s4u/Host.hpp"
 #include "src/kernel/routing/NetPoint.hpp"
 #include "src/surf/cpu_interface.hpp"
 #include "src/surf/network_interface.hpp"
index 78e500c..79a5d19 100644 (file)
@@ -1,12 +1,12 @@
-/* Copyright (c) 2013-2016. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2013-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include <boost/algorithm/string.hpp>
 
-#include "simgrid/s4u/engine.hpp"
-#include "simgrid/s4u/host.hpp"
+#include "simgrid/s4u/Engine.hpp"
+#include "simgrid/s4u/Host.hpp"
 
 #include "src/kernel/routing/NetPoint.hpp"
 #include "src/kernel/routing/VivaldiZone.hpp"
index 8db8c4e..c860d45 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2007-2015. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -21,7 +20,7 @@ namespace mc {
 
 /** Take a per-page snapshot of a region
  *
- *  @param data            The start of the region (must be at the beginning of a page)
+ *  @param addr            The start of the region (must be at the beginning of a page)
  *  @param page_count      Number of pages of the region
  *  @return                Snapshot page numbers of this new snapshot
  */
index 90bfa3e..a8e149a 100644 (file)
@@ -36,8 +36,7 @@ namespace mc {
  *  @param data Memory page
  *  @return hash off the page
  */
-static inline  __attribute__ ((always_inline))
-PageStore::hash_type mc_hash_page(const void* data)
+static XBT_ALWAYS_INLINE PageStore::hash_type mc_hash_page(const void* data)
 {
   const std::uint64_t* values = (const uint64_t*) data;
   std::size_t n = xbt_pagesize / sizeof(uint64_t);
index bb6be39..640e63c 100644 (file)
@@ -157,37 +157,33 @@ public: // Debug/test methods
 
 };
 
-inline __attribute__((always_inline))
-void PageStore::unref_page(std::size_t pageno) {
+XBT_ALWAYS_INLINE void PageStore::unref_page(std::size_t pageno)
+{
   if ((--this->page_counts_[pageno]) == 0)
     this->remove_page(pageno);
 }
 
-inline __attribute__((always_inline))
-void PageStore::ref_page(size_t pageno)
+XBT_ALWAYS_INLINE void PageStore::ref_page(size_t pageno)
 {
   ++this->page_counts_[pageno];
 }
 
-inline __attribute__((always_inline))
-const void* PageStore::get_page(std::size_t pageno) const
+XBT_ALWAYS_INLINE const void* PageStore::get_page(std::size_t pageno) const
 {
   return (void*) simgrid::mc::mmu::join(pageno, (std::uintptr_t) this->memory_);
 }
 
-inline __attribute__((always_inline))
-std::size_t PageStore::get_ref(std::size_t pageno)
+XBT_ALWAYS_INLINE std::size_t PageStore::get_ref(std::size_t pageno)
 {
   return this->page_counts_[pageno];
 }
 
-inline __attribute__((always_inline))
-std::size_t PageStore::size() {
+XBT_ALWAYS_INLINE std::size_t PageStore::size()
+{
   return this->top_index_ - this->free_pages_.size();
 }
 
-inline __attribute__((always_inline))
-std::size_t PageStore::capacity()
+XBT_ALWAYS_INLINE std::size_t PageStore::capacity()
 {
   return this->capacity_;
 }
index cc57a3c..edcf150 100644 (file)
@@ -70,7 +70,7 @@ void wait_for_requests(void)
   }
 #if HAVE_MC
   xbt_dynar_reset(simix_global->actors_vector);
-  for (std::pair<int, smx_actor_t> kv : simix_global->process_list) {
+  for (std::pair<aid_t, smx_actor_t> kv : simix_global->process_list) {
     xbt_dynar_push_as(simix_global->actors_vector, smx_actor_t, kv.second);
   }
 #endif
index eb6d337..9e2aaa5 100644 (file)
@@ -31,8 +31,7 @@ static int chunkSize()
  *  @param size Byte size
  *  @return Number of memory pages
  */
-static inline __attribute__ ((always_inline))
-std::size_t chunkCount(std::size_t size)
+static XBT_ALWAYS_INLINE std::size_t chunkCount(std::size_t size)
 {
   size_t page_count = size >> xbt_pagebits;
   if (size & (xbt_pagesize-1))
@@ -41,8 +40,7 @@ std::size_t chunkCount(std::size_t size)
 }
 
 /** @brief Split into chunk number and remaining offset */
-static inline __attribute__ ((always_inline))
-std::pair<std::size_t, std::uintptr_t> split(std::uintptr_t offset)
+static XBT_ALWAYS_INLINE std::pair<std::size_t, std::uintptr_t> split(std::uintptr_t offset)
 {
   return {
     offset >> xbt_pagebits,
@@ -51,20 +49,17 @@ std::pair<std::size_t, std::uintptr_t> split(std::uintptr_t offset)
 }
 
 /** Merge chunk number and remaining offset info a global offset */
-static inline __attribute__ ((always_inline))
-std::uintptr_t join(std::size_t page, std::uintptr_t offset)
+static XBT_ALWAYS_INLINE std::uintptr_t join(std::size_t page, std::uintptr_t offset)
 {
   return ((std::uintptr_t) page << xbt_pagebits) + offset;
 }
 
-static inline __attribute__ ((always_inline))
-std::uintptr_t join(std::pair<std::size_t,std::uintptr_t> value)
+static XBT_ALWAYS_INLINE std::uintptr_t join(std::pair<std::size_t, std::uintptr_t> value)
 {
   return join(value.first, value.second);
 }
 
-static inline __attribute__ ((always_inline))
-bool sameChunk(std::uintptr_t a, std::uintptr_t b)
+static XBT_ALWAYS_INLINE bool sameChunk(std::uintptr_t a, std::uintptr_t b)
 {
   return (a >> xbt_pagebits) == (b >> xbt_pagebits);
 }
index ff841f7..85b31ed 100644 (file)
@@ -3,22 +3,8 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include <cassert>
-#include <cstddef>
-#include <cstdlib>
+#include "simgrid/s4u/Host.hpp"
 
-#include <memory>
-#include <type_traits>
-#include <utility>
-#include <vector>
-
-#include <xbt/log.h>
-#include <xbt/str.h>
-#include <xbt/swag.h>
-
-#include <simgrid/s4u/host.hpp>
-
-#include "src/simix/smx_private.h"
 #include "src/mc/mc_smx.h"
 #include "src/mc/ModelChecker.hpp"
 
index 8fbba24..c217c97 100644 (file)
@@ -34,8 +34,7 @@ SG_BEGIN_DECL()
 
 XBT_PRIVATE void mc_region_restore_sparse(simgrid::mc::Process* process, mc_mem_region_t reg);
 
-static inline __attribute__((always_inline))
-void* mc_translate_address_region_chunked(uintptr_t addr, mc_mem_region_t region)
+static XBT_ALWAYS_INLINE void* mc_translate_address_region_chunked(uintptr_t addr, mc_mem_region_t region)
 {
   auto split = simgrid::mc::mmu::split(addr - region->start().address());
   auto pageno = split.first;
@@ -44,8 +43,7 @@ void* mc_translate_address_region_chunked(uintptr_t addr, mc_mem_region_t region
   return (char*) snapshot_page + offset;
 }
 
-static inline __attribute__((always_inline))
-void* mc_translate_address_region(uintptr_t addr, mc_mem_region_t region, int process_index)
+static XBT_ALWAYS_INLINE void* mc_translate_address_region(uintptr_t addr, mc_mem_region_t region, int process_index)
 {
   switch (region->storage_type()) {
   case simgrid::mc::StorageType::NoData:
@@ -156,8 +154,8 @@ public: // To be private
 
 extern "C" {
 
-static inline __attribute__ ((always_inline))
-mc_mem_region_t mc_get_region_hinted(void* addr, simgrid::mc::Snapshot* snapshot, int process_index, mc_mem_region_t region)
+static XBT_ALWAYS_INLINE mc_mem_region_t mc_get_region_hinted(void* addr, simgrid::mc::Snapshot* snapshot,
+                                                              int process_index, mc_mem_region_t region)
 {
   if (region->contain(simgrid::mc::remote(addr)))
     return region;
@@ -198,8 +196,7 @@ XBT_PRIVATE int MC_snapshot_memcmp(
   const void* addr1, simgrid::mc::Snapshot* snapshot1,
   const void* addr2, simgrid::mc::Snapshot* snapshot2, int process_index, std::size_t size);
 
-static inline __attribute__ ((always_inline))
-const void* mc_snapshot_get_heap_end(simgrid::mc::Snapshot* snapshot)
+static XBT_ALWAYS_INLINE const void* mc_snapshot_get_heap_end(simgrid::mc::Snapshot* snapshot)
 {
   if(snapshot==nullptr)
       xbt_die("snapshot is nullptr");
@@ -214,9 +211,8 @@ const void* mc_snapshot_get_heap_end(simgrid::mc::Snapshot* snapshot)
  *  @param size    Size of the data to read in bytes
  *  @return Pointer where the data is located (target buffer of original location)
  */
-static inline __attribute__((always_inline))
-const void* MC_region_read(
-  mc_mem_region_t region, void* target, const void* addr, std::size_t size)
+static XBT_ALWAYS_INLINE const void* MC_region_read(mc_mem_region_t region, void* target, const void* addr,
+                                                    std::size_t size)
 {
   xbt_assert(region);
 
@@ -254,8 +250,7 @@ const void* MC_region_read(
   }
 }
 
-static inline __attribute__ ((always_inline))
-void* MC_region_read_pointer(mc_mem_region_t region, const void* addr)
+static XBT_ALWAYS_INLINE void* MC_region_read_pointer(mc_mem_region_t region, const void* addr)
 {
   void* res;
   return *(void**) MC_region_read(region, &res, addr, sizeof(void*));
index 8bb5b20..d200f1e 100644 (file)
@@ -1,9 +1,9 @@
-/* Copyright (c) 2010, 2012-2016. The SimGrid Team. All rights reserved.    */
+/* Copyright (c) 2010, 2012-2017. The SimGrid Team. All rights reserved.    */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "simgrid/s4u/host.hpp"
+#include "simgrid/s4u/Host.hpp"
 #include "src/instr/instr_private.h"
 #include "src/msg/msg_private.h"
 #include "src/simix/ActorImpl.hpp"
index 3c3bdf8..e50abe0 100644 (file)
@@ -1,10 +1,10 @@
-/* Copyright (c) 2004-2016. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2004-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
+#include "simgrid/s4u/Engine.hpp"
 #include "simgrid/s4u/NetZone.hpp"
-#include "simgrid/s4u/engine.hpp"
 #include "src/msg/msg_private.h"
 
 #if HAVE_LUA
index bec6a7b..1eefcc5 100644 (file)
@@ -1,10 +1,10 @@
-/* Copyright (c) 2004-2015. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2004-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "simgrid/s4u/engine.hpp"
-#include "simgrid/s4u/host.hpp"
+#include "simgrid/s4u/Engine.hpp"
+#include "simgrid/s4u/Host.hpp"
 
 #include "instr/instr_interface.h"
 #include "mc/mc.h"
index 7c86679..43a6b24 100644 (file)
@@ -1,11 +1,10 @@
-/* Copyright (c) 2004-2015. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2004-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "simgrid/s4u/host.hpp"
-#include "simgrid/s4u/storage.hpp"
+#include "simgrid/s4u/Host.hpp"
+#include "simgrid/s4u/Storage.hpp"
 #include "src/msg/msg_private.h"
 #include "src/simix/ActorImpl.hpp"
 #include "src/simix/smx_host_private.h"
index cfd487c..282f46a 100644 (file)
@@ -1,9 +1,9 @@
-/* Copyright (c) 2004-2016. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2004-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "simgrid/s4u/host.hpp"
+#include "simgrid/s4u/Host.hpp"
 #include "src/msg/msg_private.h"
 #include "src/surf/storage_interface.hpp"
 #include <numeric>
index d0b03bf..f000746 100644 (file)
@@ -4,7 +4,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "msg_private.h"
-#include "simgrid/s4u/host.hpp"
+#include "simgrid/s4u/Host.hpp"
 #include "src/simix/ActorImpl.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_process, msg, "Logging specific to MSG (process)");
@@ -22,8 +22,8 @@ SG_BEGIN_DECL()
 
 /******************************** Process ************************************/
 /**
- * \brief Cleans the MSG data of a process.
- * \param smx_proc a SIMIX process
+ * \brief Cleans the MSG data of an actor
+ * \param smx_actor a SIMIX actor
  */
 void MSG_process_cleanup_from_SIMIX(smx_actor_t smx_actor)
 {
index 96ec075..de5b546 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2006-2014. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2006-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -7,8 +6,8 @@
 #include "xbt/log.h"
 
 #include "simgrid/s4u/Actor.hpp"
-#include "simgrid/s4u/comm.hpp"
-#include "simgrid/s4u/host.hpp"
+#include "simgrid/s4u/Comm.hpp"
+#include "simgrid/s4u/Host.hpp"
 #include "simgrid/s4u/Mailbox.hpp"
 
 #include "src/kernel/context/Context.hpp"
@@ -77,12 +76,12 @@ simgrid::xbt::string Actor::name()
   return this->pimpl_->name;
 }
 
-int Actor::pid()
+aid_t Actor::pid()
 {
   return this->pimpl_->pid;
 }
 
-int Actor::ppid()
+aid_t Actor::ppid()
 {
   return this->pimpl_->ppid;
 }
@@ -111,7 +110,8 @@ double Actor::killTime()
   return simcall_process_get_kill_time(pimpl_);
 }
 
-void Actor::kill(int pid) {
+void Actor::kill(aid_t pid)
+{
   smx_actor_t process = SIMIX_process_from_PID(pid);
   if(process != nullptr) {
     simcall_process_kill(process);
@@ -132,7 +132,7 @@ void Actor::kill() {
 
 // ***** Static functions *****
 
-ActorPtr Actor::byPid(int pid)
+ActorPtr Actor::byPid(aid_t pid)
 {
   smx_actor_t process = SIMIX_process_from_PID(pid);
   if (process != nullptr)
@@ -209,12 +209,12 @@ Comm& irecv(MailboxPtr chan, void** data)
   return Comm::recv_async(chan, data);
 }
 
-int pid()
+aid_t pid()
 {
   return SIMIX_process_self()->pid;
 }
 
-int ppid()
+aid_t ppid()
 {
   return SIMIX_process_self()->ppid;
 }
index eaa6009..5fecc95 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2006-2015. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2006-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -7,9 +6,8 @@
 #include "xbt/log.h"
 #include "src/msg/msg_private.h"
 
-#include "simgrid/s4u/comm.hpp"
-#include <simgrid/s4u/Mailbox.hpp>
-
+#include "simgrid/s4u/Comm.hpp"
+#include "simgrid/s4u/Mailbox.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(s4u_comm,s4u_activity,"S4U asynchronous communications");
 
index 3d98c54..7c1d47d 100644 (file)
@@ -1,23 +1,23 @@
 /* s4u::Engine Simulation Engine and global functions. */
 
-/* Copyright (c) 2006-2015. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2006-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "instr/instr_interface.h"
 #include "mc/mc.h"
+#include "simgrid/s4u/Engine.hpp"
+#include "simgrid/s4u/Host.hpp"
 #include "simgrid/s4u/Mailbox.hpp"
 #include "simgrid/s4u/NetZone.hpp"
-#include "simgrid/s4u/engine.hpp"
-#include "simgrid/s4u/host.hpp"
-#include "simgrid/s4u/storage.hpp"
+#include "simgrid/s4u/Storage.hpp"
 #include "simgrid/simix.h"
 #include "src/kernel/EngineImpl.hpp"
 #include "src/kernel/routing/NetPoint.hpp"
 #include "src/kernel/routing/NetZoneImpl.hpp"
 #include "src/surf/network_interface.hpp"
-#include "surf/surf.h"               // routing_platf. FIXME:KILLME. SOON
+#include "surf/surf.h" // routing_platf. FIXME:KILLME. SOON
 
 XBT_LOG_NEW_CATEGORY(s4u,"Log channels of the S4U (Simgrid for you) interface");
 
index bb87435..fafc21d 100644 (file)
@@ -1,21 +1,20 @@
-/* Copyright (c) 2015. The SimGrid Team. All rights reserved.               */
+/* Copyright (c) 2015-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "xbt/log.h"
+#include "simgrid/simix.h"
 #include "src/msg/msg_private.h"
+#include "xbt/log.h"
 
 #include "simgrid/s4u/Actor.hpp"
-#include "simgrid/s4u/comm.hpp"
-#include "simgrid/s4u/host.hpp"
+#include "simgrid/s4u/Comm.hpp"
+#include "simgrid/s4u/File.hpp"
+#include "simgrid/s4u/Host.hpp"
 #include "simgrid/s4u/Mailbox.hpp"
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_file,"S4U files");
 
-#include "simgrid/s4u/file.hpp"
-#include "simgrid/s4u/host.hpp"
-#include "simgrid/simix.h"
 
 namespace simgrid {
 namespace s4u {
index 6c8a7ec..7846f76 100644 (file)
@@ -9,9 +9,9 @@
 
 #include <map>
 
-#include "simgrid/s4u/engine.hpp"
-#include "simgrid/s4u/host.hpp"
-#include "simgrid/s4u/storage.hpp"
+#include "simgrid/s4u/Engine.hpp"
+#include "simgrid/s4u/Host.hpp"
+#include "simgrid/s4u/Storage.hpp"
 #include "simgrid/simix.hpp"
 #include "src/kernel/routing/NetPoint.hpp"
 #include "src/msg/msg_private.h"
index 6aa572d..17035d2 100644 (file)
@@ -1,12 +1,12 @@
-/* Copyright (c) 2006-2016. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2006-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "xbt/log.h"
 
+#include "simgrid/s4u/Host.hpp"
 #include "simgrid/s4u/NetZone.hpp"
-#include "simgrid/s4u/host.hpp"
 #include "simgrid/simix.hpp"
 #include "src/kernel/routing/NetPoint.hpp"
 #include "src/surf/network_interface.hpp" // Link FIXME: move to proper header
index 53cfb30..ba1820b 100644 (file)
@@ -1,10 +1,9 @@
-/* Copyright (c) 2006-2015, 2017. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2006-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "simgrid/s4u/storage.hpp"
+#include "simgrid/s4u/Storage.hpp"
 #include "simgrid/simix.hpp"
 #include "src/surf/storage_interface.hpp"
 #include "xbt/lib.h"
index a8e4ddd..0248689 100644 (file)
@@ -1,12 +1,10 @@
-/* Copyright (c) 2006-2016. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2006-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "simdag_private.hpp"
-#include "simgrid/host.h"
-#include "simgrid/s4u/engine.hpp"
+#include "simgrid/s4u/Engine.hpp"
 #include "simgrid/sg_config.h"
 #include "src/include/instr/instr_interface.h"
 #include "src/surf/surf_interface.hpp"
index 5bf6743..308a135 100644 (file)
@@ -1,15 +1,14 @@
-/* Copyright (c) 2013-2016. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2013-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include <vector>
 
-#include "xbt/dict.h"
 #include "simgrid/host.h"
-#include <xbt/Extendable.hpp>
-#include <simgrid/s4u/host.hpp>
+#include "simgrid/s4u/Host.hpp"
+#include "xbt/Extendable.hpp"
+#include "xbt/dict.h"
 
 #include "src/kernel/routing/NetPoint.hpp"
 #include "src/simix/smx_host_private.h"
index 43944d0..b16b66d 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2007-2015. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -17,7 +16,7 @@
 #include <xbt/log.h>
 #include <xbt/dict.h>
 
-#include <simgrid/s4u/host.hpp>
+#include "simgrid/s4u/Host.hpp"
 
 #include <mc/mc.h>
 
@@ -866,7 +865,7 @@ xbt_dynar_t SIMIX_process_get_runnable()
 /**
  * \brief Returns the process from PID.
  */
-smx_actor_t SIMIX_process_from_PID(int PID)
+smx_actor_t SIMIX_process_from_PID(aid_t PID)
 {
   if (simix_global->process_list.find(PID) == simix_global->process_list.end())
     return nullptr;
index 9e4930d..e1ffbda 100644 (file)
@@ -33,6 +33,7 @@ public:
 class ActorImpl {
 public:
   ActorImpl() : piface_(this) {}
+  ~ActorImpl();
 
   // TODO, replace with boost intrusive container hooks
   s_xbt_swag_hookup_t process_hookup   = { nullptr, nullptr }; /* simix_global->process_list */
@@ -40,8 +41,8 @@ public:
   s_xbt_swag_hookup_t host_proc_hookup = { nullptr, nullptr }; /* smx_host->process_lis */
   s_xbt_swag_hookup_t destroy_hookup   = { nullptr, nullptr }; /* simix_global->process_to_destroy */
 
-  unsigned long pid  = 0;
-  unsigned long ppid = -1;
+  aid_t pid  = 0;
+  aid_t ppid = -1;
   simgrid::xbt::string name;
   const char* cname() { return name.c_str(); }
   s4u::Host* host       = nullptr; /* the host on which the process is running */
@@ -56,7 +57,7 @@ public:
 
   sg_host_t new_host            = nullptr; /* if not null, the host on which the process must migrate to */
   smx_activity_t waiting_synchro = nullptr; /* the current blocking synchro if any */
-  std::list<smx_activity_t> comms               ;           /* the current non-blocking communication synchros */
+  std::list<smx_activity_t> comms;          /* the current non-blocking communication synchros */
   xbt_dict_t properties         = nullptr;
   s_smx_simcall_t simcall;
   void *data          = nullptr; /* kept for compatibility, it should be replaced with moddata */
@@ -66,31 +67,42 @@ public:
   smx_timer_t kill_timer = nullptr;
   int segment_index = -1; /* Reference to an SMPI process' data segment. Default value is -1 if not in SMPI context*/
 
+  /* Refcounting */
+private:
+  std::atomic_int_fast32_t refcount_{1};
+public:
   friend void intrusive_ptr_add_ref(ActorImpl* process)
   {
-    process->refcount_.fetch_add(1, std::memory_order_relaxed);
+    // std::memory_order_relaxed ought to be enough here instead of std::memory_order_seq_cst
+    // But then, we have a threading issue when an actor commits a suicide:
+    //  it seems that in this case, the worker thread kills the last occurrence of the actor
+    //  while usually, the maestro does so. FIXME: we should change how actors suicide
+    process->refcount_.fetch_add(1, std::memory_order_seq_cst);
   }
   friend void intrusive_ptr_release(ActorImpl* process)
   {
     // inspired from http://www.boost.org/doc/libs/1_55_0/doc/html/atomic/usage_examples.html
     if (process->refcount_.fetch_sub(1, std::memory_order_release) == 1) {
+      // Make sure that any changes done on other threads before their acquire are committed before our delete
+      // http://stackoverflow.com/questions/27751025/why-is-an-acquire-barrier-needed-before-deleting-the-data-in-an-atomically-refer
       std::atomic_thread_fence(std::memory_order_acquire);
       delete process;
     }
   }
 
-  ~ActorImpl();
-
+  /* S4U/implem interfaces */
+private:
+  simgrid::s4u::Actor piface_; // Our interface is part of ourselves
+public:
   simgrid::s4u::ActorPtr iface() { return s4u::ActorPtr(&piface_); }
   simgrid::s4u::Actor* ciface() { return &piface_; }
 
-  void daemonize();
-  bool isDaemon();
-
+  /* Daemon actors are automatically killed when the last non-daemon leaves */
 private:
   bool daemon = false;
-  std::atomic_int_fast32_t refcount_ { 1 };
-  simgrid::s4u::Actor piface_; // Our interface is part of ourselves
+public:
+  void daemonize();
+  bool isDaemon();
 };
 
 }
index 492e147..569d96b 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2007, 2009-2016. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -7,12 +6,9 @@
 #include <string>
 #include <vector>
 
-#include "simgrid/s4u/host.hpp"
+#include "simgrid/s4u/Host.hpp"
 #include "smx_private.h"
 #include "src/surf/xml/platf_private.hpp" // FIXME: KILLME. There must be a better way than mimicking XML here
-#include "xbt/dict.h"
-#include "xbt/log.h"
-#include "xbt/sysdep.h"
 #include <xbt/ex.hpp>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_deployment, simix, "Logging specific to SIMIX (deployment)");
index e34130d..09313d8 100644 (file)
 
 #include <xbt/functional.hpp>
 
-#include "simgrid/s4u/engine.hpp"
-#include "simgrid/s4u/host.hpp"
+#include "simgrid/s4u/Engine.hpp"
+#include "simgrid/s4u/Host.hpp"
 
 #include "src/surf/surf_interface.hpp"
 #include "src/surf/storage_interface.hpp"
 #include "src/surf/xml/platf.hpp"
 #include "smx_private.h"
-#include "xbt/str.h"
 #include "xbt/ex.h"             /* ex_backtrace_display */
 #include "mc/mc.h"
 #include "src/mc/mc_replay.h"
index 73f4d1b..88892bf 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2007-2010, 2012-2015. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -9,7 +8,7 @@
 #include <xbt/log.h>
 #include <xbt/dict.h>
 
-#include <simgrid/s4u/host.hpp>
+#include "simgrid/s4u/Host.hpp"
 
 #include <mc/mc.h>
 
index d961211..852db10 100644 (file)
@@ -9,7 +9,7 @@
 
 #include <xbt/ex.hpp>
 
-#include <simgrid/s4u/host.hpp>
+#include "simgrid/s4u/Host.hpp"
 
 #include "mc/mc.h"
 #include "simgrid/s4u/Mailbox.hpp"
@@ -17,8 +17,6 @@
 #include "src/simix/smx_private.h"
 #include "src/surf/cpu_interface.hpp"
 #include "src/surf/surf_interface.hpp"
-#include "xbt/dict.h"
-#include "xbt/log.h"
 
 #include "src/kernel/activity/SynchroComm.hpp"
 #include "src/surf/network_interface.hpp"
@@ -28,16 +26,20 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_network, simix, "SIMIX network-related syn
 static void SIMIX_waitany_remove_simcall_from_actions(smx_simcall_t simcall);
 static void SIMIX_comm_copy_data(smx_activity_t comm);
 static void SIMIX_comm_start(smx_activity_t synchro);
-static smx_activity_t _find_matching_comm(boost::circular_buffer_space_optimized<smx_activity_t> *deque, e_smx_comm_type_t type,
-    int (*match_fun)(void *, void *,smx_activity_t), void *user_data, smx_activity_t my_synchro, bool remove_matching);
+static simgrid::kernel::activity::Comm*
+_find_matching_comm(boost::circular_buffer_space_optimized<smx_activity_t>* deque, e_smx_comm_type_t type,
+                    int (*match_fun)(void*, void*, smx_activity_t), void* user_data, smx_activity_t my_synchro,
+                    bool remove_matching);
 
 /**
- *  \brief Checks if there is a communication synchro queued in a deque matching our needs
+ *  \brief Checks if there is a communication activity queued in a deque matching our needs
  *  \param type The type of communication we are looking for (comm_send, comm_recv)
- *  \return The communication synchro if found, nullptr otherwise
+ *  \return The communication activity if found, nullptr otherwise
  */
-static smx_activity_t _find_matching_comm(boost::circular_buffer_space_optimized<smx_activity_t> *deque, e_smx_comm_type_t type,
-    int (*match_fun)(void *, void *,smx_activity_t), void *this_user_data, smx_activity_t my_synchro, bool remove_matching)
+static simgrid::kernel::activity::Comm*
+_find_matching_comm(boost::circular_buffer_space_optimized<smx_activity_t>* deque, e_smx_comm_type_t type,
+                    int (*match_fun)(void*, void*, smx_activity_t), void* this_user_data, smx_activity_t my_synchro,
+                    bool remove_matching)
 {
   void* other_user_data = nullptr;
 
@@ -97,42 +99,38 @@ XBT_PRIVATE smx_activity_t simcall_HANDLER_comm_isend(smx_simcall_t simcall, smx
   XBT_DEBUG("send from %p", mbox);
 
   /* Prepare a synchro describing us, so that it gets passed to the user-provided filter of other side */
-  simgrid::kernel::activity::Comm* this_synchro = new simgrid::kernel::activity::Comm(SIMIX_COMM_SEND);
+  simgrid::kernel::activity::Comm* this_comm = new simgrid::kernel::activity::Comm(SIMIX_COMM_SEND);
 
   /* Look for communication synchro matching our needs. We also provide a description of
    * ourself so that the other side also gets a chance of choosing if it wants to match with us.
    *
    * If it is not found then push our communication into the rendez-vous point */
-  smx_activity_t other_synchro =
-      _find_matching_comm(&mbox->comm_queue, SIMIX_COMM_RECEIVE, match_fun, data, this_synchro, /*remove_matching*/true);
-  simgrid::kernel::activity::Comm *other_comm = static_cast<simgrid::kernel::activity::Comm*>(other_synchro);
+  simgrid::kernel::activity::Comm* other_comm =
+      _find_matching_comm(&mbox->comm_queue, SIMIX_COMM_RECEIVE, match_fun, data, this_comm, /*remove_matching*/ true);
 
-
-  if (!other_synchro) {
-    other_synchro = this_synchro;
-    other_comm = static_cast<simgrid::kernel::activity::Comm*>(other_synchro);
+  if (!other_comm) {
+    other_comm = this_comm;
 
     if (mbox->permanent_receiver!=nullptr){
       //this mailbox is for small messages, which have to be sent right now
-      other_synchro->state = SIMIX_READY;
+      other_comm->state   = SIMIX_READY;
       other_comm->dst_proc=mbox->permanent_receiver.get();
       other_comm->ref();
-      mbox->done_comm_queue.push_back(other_synchro);
+      mbox->done_comm_queue.push_back(other_comm);
       XBT_DEBUG("pushing a message into the permanent receive list %p, comm %p", mbox, &(other_comm));
 
     }else{
-      mbox->push(this_synchro);
+      mbox->push(this_comm);
     }
   } else {
     XBT_DEBUG("Receive already pushed");
-    this_synchro->unref();
+    this_comm->unref();
 
     other_comm->state = SIMIX_READY;
     other_comm->type = SIMIX_COMM_READY;
 
   }
-  src_proc->comms.push_back(other_synchro);
-
+  src_proc->comms.push_back(other_comm);
 
   if (detached) {
     other_comm->detached = true;
@@ -190,21 +188,20 @@ smx_activity_t SIMIX_comm_irecv(smx_actor_t dst_proc, smx_mailbox_t mbox, void *
   XBT_DEBUG("recv from %p %p", mbox, &mbox->comm_queue);
   simgrid::kernel::activity::Comm* this_synchro = new simgrid::kernel::activity::Comm(SIMIX_COMM_RECEIVE);
 
-  smx_activity_t other_synchro;
+  simgrid::kernel::activity::Comm* other_comm;
   //communication already done, get it inside the list of completed comms
   if (mbox->permanent_receiver != nullptr && ! mbox->done_comm_queue.empty()) {
 
     XBT_DEBUG("We have a comm that has probably already been received, trying to match it, to skip the communication");
     //find a match in the list of already received comms
-    other_synchro = _find_matching_comm(&mbox->done_comm_queue, SIMIX_COMM_SEND, match_fun, data, this_synchro,/*remove_matching*/true);
+    other_comm = _find_matching_comm(&mbox->done_comm_queue, SIMIX_COMM_SEND, match_fun, data, this_synchro,
+                                     /*remove_matching*/ true);
     //if not found, assume the receiver came first, register it to the mailbox in the classical way
-    if (!other_synchro)  {
+    if (!other_comm) {
       XBT_DEBUG("We have messages in the permanent receive list, but not the one we are looking for, pushing request into list");
-      other_synchro = this_synchro;
+      other_comm = this_synchro;
       mbox->push(this_synchro);
     } else {
-      simgrid::kernel::activity::Comm *other_comm = static_cast<simgrid::kernel::activity::Comm*>(other_synchro);
-
       if(other_comm->surf_comm && other_comm->remains() < 1e-12) {
         XBT_DEBUG("comm %p has been already sent, and is finished, destroy it",other_comm);
         other_comm->state = SIMIX_DONE;
@@ -215,30 +212,29 @@ smx_activity_t SIMIX_comm_irecv(smx_actor_t dst_proc, smx_mailbox_t mbox, void *
       static_cast<simgrid::kernel::activity::Comm*>(this_synchro)->unref();
     }
   } else {
-    /* Prepare a synchro describing us, so that it gets passed to the user-provided filter of other side */
+    /* Prepare a comm describing us, so that it gets passed to the user-provided filter of other side */
 
-    /* Look for communication synchro matching our needs. We also provide a description of
+    /* Look for communication activity matching our needs. We also provide a description of
      * ourself so that the other side also gets a chance of choosing if it wants to match with us.
      *
      * If it is not found then push our communication into the rendez-vous point */
-    other_synchro = _find_matching_comm(&mbox->comm_queue, SIMIX_COMM_SEND, match_fun, data, this_synchro,/*remove_matching*/true);
+    other_comm = _find_matching_comm(&mbox->comm_queue, SIMIX_COMM_SEND, match_fun, data, this_synchro,
+                                     /*remove_matching*/ true);
 
-    if (!other_synchro) {
+    if (!other_comm) {
       XBT_DEBUG("Receive pushed first %zu", mbox->comm_queue.size());
-      other_synchro = this_synchro;
+      other_comm = this_synchro;
       mbox->push(this_synchro);
     } else {
       this_synchro->unref();
-      simgrid::kernel::activity::Comm *other_comm = static_cast<simgrid::kernel::activity::Comm*>(other_synchro);
 
       other_comm->state = SIMIX_READY;
       other_comm->type = SIMIX_COMM_READY;
     }
-    dst_proc->comms.push_back(other_synchro);
+    dst_proc->comms.push_back(other_comm);
   }
 
   /* Setup communication synchro */
-  simgrid::kernel::activity::Comm *other_comm = static_cast<simgrid::kernel::activity::Comm*>(other_synchro);
   other_comm->dst_proc = dst_proc;
   other_comm->dst_buff = dst_buff;
   other_comm->dst_buff_size = dst_buff_size;
@@ -251,12 +247,12 @@ smx_activity_t SIMIX_comm_irecv(smx_actor_t dst_proc, smx_mailbox_t mbox, void *
   other_comm->copy_data_fun = copy_data_fun;
 
   if (MC_is_active() || MC_record_replay_is_active()) {
-    other_synchro->state = SIMIX_RUNNING;
-    return other_synchro;
+    other_comm->state = SIMIX_RUNNING;
+    return other_comm;
   }
 
-  SIMIX_comm_start(other_synchro);
-  return other_synchro;
+  SIMIX_comm_start(other_comm);
+  return other_comm;
 }
 
 smx_activity_t simcall_HANDLER_comm_iprobe(smx_simcall_t simcall, smx_mailbox_t mbox,
index 6999488..9ec2107 100644 (file)
@@ -21,7 +21,7 @@ public:
   smx_context_factory_t context_factory = nullptr;
   xbt_dynar_t process_to_run = nullptr;
   xbt_dynar_t process_that_ran = nullptr;
-  std::map<int, smx_actor_t> process_list;
+  std::map<aid_t, smx_actor_t> process_list;
 #if HAVE_MC
   /* MCer cannot read the std::map above in the remote process, so we copy the info it needs in a dynar.
    * FIXME: This is supposed to be a temporary hack.
index 79ea6b1..9f0e626 100644 (file)
@@ -1,6 +1,12 @@
-#include "smpi/smpi_utils.hpp"
+/* Copyright (c) 2017. The SimGrid Team. All rights reserved.               */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
 #include "src/smpi/SmpiHost.hpp"
-#include <simgrid/s4u/VirtualMachine.hpp>
+#include "simgrid/s4u/VirtualMachine.hpp"
+#include "smpi/smpi_utils.hpp"
+
 #include <string>
 #include <vector>
 
index d746dd3..a3667fe 100644 (file)
@@ -1,15 +1,18 @@
+/* Copyright (c) 2017. The SimGrid Team. All rights reserved.               */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
 #ifndef SMPI_HOST_HPP_
 #define SMPI_HOST_HPP_
 
 #include "src/include/smpi/smpi_utils.hpp"
 
-#include <simgrid/s4u/host.hpp>
+#include "simgrid/s4u/Host.hpp"
 #include <string>
 #include <vector>
-#include <xbt/config.hpp>
 #include <xbt/Extendable.hpp>
-
-
+#include <xbt/config.hpp>
 
 namespace simgrid {
 namespace smpi {
index 9bb515e..a3b9f5f 100644 (file)
@@ -1,17 +1,9 @@
-/* Copyright (c) 2010-2017. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2010-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include <stdlib.h>
-#include <limits.h>
-
-#include <xbt/dict.h>
-#include <xbt/ex.h>
-#include <xbt/ex.hpp>
-
-#include <simgrid/s4u/host.hpp>
+#include "simgrid/s4u/Host.hpp"
 
 #include "private.h"
 #include "src/simix/smx_private.h"
index 2a774f3..6dfe3bd 100644 (file)
@@ -272,13 +272,6 @@ int Datatype::copy(void *sendbuf, int sendcount, MPI_Datatype sendtype,
   int count;
 
 // FIXME Handle the case of a partial shared malloc.
-#if 0
-  if(smpi_is_shared(sendbuf)){
-    XBT_DEBUG("Copy input buf %p is shared. Let's ignore it.", sendbuf);
-  }else if(smpi_is_shared(recvbuf)){
-    XBT_DEBUG("Copy output buf %p is shared. Let's ignore it.", recvbuf);
-  }
-#endif
 
   if(smpi_privatize_global_variables == SMPI_PRIVATIZE_MMAP){
     smpi_switch_data_segment(smpi_process()->index());
index c5910cb..bc9d903 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2013-2017. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2013-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -7,9 +6,9 @@
 #include <xbt/log.h>
 
 // FIXME: this plugin should be separated from the core
+#include "simgrid/s4u/Host.hpp"
 #include <simgrid/plugins/energy.h>
 #include <simgrid/simix.h>
-#include <simgrid/s4u/host.hpp>
 
 #include <smpi/smpi.h>
 
index 7a11da6..91e1456 100644 (file)
@@ -3,8 +3,8 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include <simgrid/s4u/engine.hpp>
-#include <simgrid/s4u/host.hpp>
+#include "simgrid/s4u/Engine.hpp"
+#include "simgrid/s4u/Host.hpp"
 
 #include "private.h"
 
index c7a048b..4bc218b 100644 (file)
@@ -3,18 +3,14 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include <xbt/config.hpp>
-#include <algorithm>
 #include "private.h"
 #include "mc/mc.h"
 #include "src/mc/mc_replay.h"
-#include "src/simix/smx_private.h"
-#include "simgrid/sg_config.h"
-#include "smpi/smpi_utils.hpp"
 #include "src/smpi/SmpiHost.hpp"
-#include <simgrid/s4u/host.hpp>
 #include "src/kernel/activity/SynchroComm.hpp"
 
+#include <algorithm>
+
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_request, smpi, "Logging specific to SMPI (reques)");
 
 static simgrid::config::Flag<double> smpi_iprobe_sleep(
index ed0aa26..11c8ca0 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2004-2015. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2004-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -7,7 +6,7 @@
 #ifndef SURF_CPU_INTERFACE_HPP_
 #define SURF_CPU_INTERFACE_HPP_
 
-#include "simgrid/s4u/host.hpp"
+#include "simgrid/s4u/Host.hpp"
 #include "src/surf/maxmin_private.hpp"
 
 /***********
index 8386f55..6c4a484 100644 (file)
@@ -1,13 +1,12 @@
-/* Copyright (c) 2010, 2012-2015. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2010-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "src/instr/instr_private.h"
 
-#include "simgrid/s4u/engine.hpp"
-#include "simgrid/s4u/host.hpp"
+#include "simgrid/s4u/Engine.hpp"
+#include "simgrid/s4u/Host.hpp"
 #include "src/kernel/routing/NetZoneImpl.hpp"
 #include "src/surf/network_interface.hpp"
 #include "src/surf/xml/platf_private.hpp"
index 2049393..22f0325 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2013-2015. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2013-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -8,7 +7,7 @@
 
 #include "maxmin_private.hpp"
 #include "network_cm02.hpp"
-#include "simgrid/s4u/host.hpp"
+#include "simgrid/s4u/Host.hpp"
 #include "simgrid/sg_config.h"
 #include "src/instr/instr_private.h" // TRACE_is_enabled(). FIXME: remove by subscribing tracing to the surf signals
 
index d9a1671..2e6d67b 100644 (file)
@@ -200,8 +200,7 @@ public:
    * @param model The NetworkModel associated to this NetworkAction
    * @param cost The cost of this  NetworkAction in [TODO]
    * @param failed [description]
-   * @param var The lmm variable associated to this Action if it is part of a
-   * LMM component
+   * @param var The lmm variable associated to this Action if it is part of a LMM component
    */
   NetworkAction(simgrid::surf::Model* model, double cost, bool failed, lmm_variable_t var)
       : simgrid::surf::Action(model, cost, failed, var){};
index 17fd032..608a3c3 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2012-2016. The SimGrid Team. All rights reserved.    */
+/* Copyright (c) 2010-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -8,9 +8,10 @@
 #include "src/plugins/vm/VirtualMachineImpl.hpp"
 #include "src/surf/cpu_interface.hpp"
 
+#include "simgrid/s4u/Engine.hpp"
+
 #include <boost/algorithm/string/classification.hpp>
 #include <boost/algorithm/string/split.hpp>
-#include <simgrid/s4u/engine.hpp>
 #include <string>
 #include <utility>
 #include <vector>
index 623ae67..024b629 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2012-2016. The SimGrid Team. All rights reserved.    */
+/* Copyright (c) 2010-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -8,9 +8,10 @@
 #include "src/plugins/vm/VirtualMachineImpl.hpp"
 #include "src/surf/cpu_interface.hpp"
 
+#include "simgrid/s4u/Engine.hpp"
+
 #include <boost/algorithm/string/classification.hpp>
 #include <boost/algorithm/string/split.hpp>
-#include <simgrid/s4u/engine.hpp>
 #include <string>
 #include <utility>
 #include <vector>
index bc3b670..283970c 100644 (file)
@@ -3,7 +3,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "simgrid/s4u/engine.hpp"
+#include "simgrid/s4u/Engine.hpp"
 
 #include "src/kernel/EngineImpl.hpp"
 #include "src/simix/smx_private.h"
index 555de3e..eaeec0c 100644 (file)
@@ -80,13 +80,7 @@ class Storage : public simgrid::surf::Resource,
         public simgrid::surf::PropertyHolder {
 public:
 
-  /**
-   * @brief Storage constructor
-   *
-   * @param model StorageModel associated to this Storage
-   * @param name The name of the Storage
-   * @param props Dictionary of properties associated to this Storage
-   */
+  /** @brief Storage constructor */
   Storage(Model* model, const char* name, lmm_system_t maxminSystem, double bread, double bwrite, double bconnection,
           const char* type_id, const char* content_name, const char* content_type, sg_size_t size, const char* attach);
 
index e54a651..275667e 100644 (file)
@@ -1,13 +1,11 @@
-/* Copyright (c) 2013-2015. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2013-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "storage_n11.hpp"
-#include "simgrid/s4u/engine.hpp"
+#include "simgrid/s4u/Engine.hpp"
 #include "src/kernel/routing/NetPoint.hpp"
-#include "surf_private.h"
 #include <math.h> /*ceil*/
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_storage);
index 94e1980..e57d90b 100644 (file)
@@ -1,10 +1,9 @@
-/* Copyright (c) 2013-2015. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2013-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "simgrid/s4u/engine.hpp"
+#include "simgrid/s4u/Engine.hpp"
 #include "src/instr/instr_private.h"
 #include "src/plugins/vm/VirtualMachineImpl.hpp"
 
index 6c00e7c..2b1cfbb 100644 (file)
@@ -1,21 +1,16 @@
-/* Copyright (c) 2004-2015. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2004-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "surf_interface.hpp"
-#include "cpu_interface.hpp"
 #include "mc/mc.h"
-#include "network_interface.hpp"
-#include "simgrid/s4u/engine.hpp"
+#include "simgrid/s4u/Engine.hpp"
 #include "simgrid/sg_config.h"
 #include "src/instr/instr_private.h" // TRACE_is_enabled(). FIXME: remove by subscribing tracing to the surf signals
-#include "src/internal_config.h"
 #include "src/kernel/routing/NetPoint.hpp"
-#include "src/simix/smx_host_private.h"
 #include "src/surf/HostImpl.hpp"
-#include "surf_private.h"
+
 #include <fstream>
 #include <vector>
 
index 43f712c..f33d910 100644 (file)
@@ -3,21 +3,11 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include <errno.h>
-#include <math.h>
-#include <stdarg.h> /* va_arg */
-
-#include "simgrid/link.h"
-#include "simgrid/s4u/engine.hpp"
+#include "simgrid/s4u/Engine.hpp"
 #include "simgrid/sg_config.h"
 #include "src/kernel/routing/NetPoint.hpp"
 #include "src/surf/network_interface.hpp"
-#include "src/surf/surf_private.h"
-#include "xbt/dict.h"
 #include "xbt/file.h"
-#include "xbt/log.h"
-#include "xbt/misc.h"
-#include "xbt/str.h"
 
 #include "src/surf/xml/platf_private.hpp"
 #include <boost/algorithm/string.hpp>
index d7a8628..3be9b12 100644 (file)
@@ -10,7 +10,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "Messages specific for this s4u example")
 static void worker()
 {
   simgrid::s4u::this_actor::sleep_for(.5);
-  XBT_INFO("Worker started (PID:%d, PPID:%d)", simgrid::s4u::this_actor::pid(), simgrid::s4u::this_actor::ppid());
+  XBT_INFO("Worker started (PID:%lu, PPID:%lu)", simgrid::s4u::this_actor::pid(), simgrid::s4u::this_actor::ppid());
   while (1) {
     XBT_INFO("Plop i am %ssuspended", simgrid::s4u::this_actor::isSuspended() ? "" : "not ");
     simgrid::s4u::this_actor::sleep_for(1);
@@ -25,7 +25,7 @@ static void master()
   simgrid::s4u::this_actor::host()->actorList(actor_list);
 
   for (auto actor : *actor_list) {
-    XBT_INFO("Actor (pid=%d, ppid=%d, name=%s)", actor->pid(), actor->ppid(), actor->name().c_str());
+    XBT_INFO("Actor (pid=%lu, ppid=%lu, name=%s)", actor->pid(), actor->ppid(), actor->name().c_str());
     if (simgrid::s4u::this_actor::pid() != actor->pid())
       actor->kill();
   }
@@ -34,16 +34,16 @@ static void master()
       simgrid::s4u::Actor::createActor("worker from master", simgrid::s4u::this_actor::host(), worker);
   simgrid::s4u::this_actor::sleep_for(2);
 
-  XBT_INFO("Suspend Actor (pid=%d)", actor->pid());
+  XBT_INFO("Suspend Actor (pid=%lu)", actor->pid());
   actor->suspend();
 
-  XBT_INFO("Actor (pid=%d) is %ssuspended", actor->pid(), actor->isSuspended() ? "" : "not ");
+  XBT_INFO("Actor (pid=%lu) is %ssuspended", actor->pid(), actor->isSuspended() ? "" : "not ");
   simgrid::s4u::this_actor::sleep_for(2);
 
-  XBT_INFO("Resume Actor (pid=%d)", actor->pid());
+  XBT_INFO("Resume Actor (pid=%lu)", actor->pid());
   actor->resume();
 
-  XBT_INFO("Actor (pid=%d) is %ssuspended", actor->pid(), actor->isSuspended() ? "" : "not ");
+  XBT_INFO("Actor (pid=%lu) is %ssuspended", actor->pid(), actor->isSuspended() ? "" : "not ");
   simgrid::s4u::this_actor::sleep_for(2);
   actor->kill();
 
index 6675df2..5baf868 100644 (file)
@@ -1,23 +1,14 @@
-/* Copyright (c) 2008-2015. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2008-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include <cstdio>
-#include <cstdlib>
-#include <cstring>
-
-#include <xbt/dict.h>
-#include <xbt/lib.h>
-#include <xbt/log.h>
-#include <xbt/sysdep.h>
 #include <xbt/xbt_os_time.h>
 
-#include "simgrid/s4u/engine.hpp"
-#include "simgrid/s4u/host.hpp"
+#include "simgrid/s4u/Engine.hpp"
+#include "simgrid/s4u/Host.hpp"
 
-#include <simgrid/simdag.h>
+#include "simgrid/simdag.h"
 
 #include "src/kernel/routing/NetPoint.hpp"
 #include "src/surf/network_interface.hpp"
index eaa9d45..242d10b 100644 (file)
@@ -1,10 +1,10 @@
-/* Copyright (c) 2008-2016. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2008-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "simgrid/s4u/engine.hpp"
-#include "simgrid/s4u/host.hpp"
+#include "simgrid/s4u/Engine.hpp"
+#include "simgrid/s4u/Host.hpp"
 #include "simgrid/simdag.h"
 #include "src/kernel/routing/NetPoint.hpp"
 #include "surf/surf_routing.h"
index 6aec7c0..6d71570 100644 (file)
@@ -1,20 +1,14 @@
 /* A few basic tests for the surf library                                   */
 
-/* Copyright (c) 2004-2015. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2004-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "surf/surf.h"
 #include "simgrid/host.h"
-#include "simgrid/s4u/host.hpp"
-#include "simgrid/sg_config.h"
 #include "src/surf/cpu_interface.hpp"
 #include "src/surf/network_interface.hpp"
-#include "src/surf/surf_interface.hpp"
-#include <stdio.h>
 
-#include "xbt/log.h"
 XBT_LOG_NEW_DEFAULT_CATEGORY(surf_test, "Messages specific for surf example");
 
 static const char *string_action(simgrid::surf::Action::State state)
index 3825f36..1ce4276 100644 (file)
@@ -1,19 +1,14 @@
 /* A few basic tests for the surf library                                   */
 
-/* Copyright (c) 2004-2015. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2004-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "surf/surf.h"
 #include "simgrid/host.h"
-#include "simgrid/s4u/host.hpp"
-#include "simgrid/sg_config.h"
 #include "src/surf/cpu_interface.hpp"
 #include "src/surf/network_interface.hpp"
-#include "src/surf/surf_interface.hpp"
 
-#include "xbt/log.h"
 XBT_LOG_NEW_DEFAULT_CATEGORY(surf_test, "Messages specific for surf example");
 
 int main(int argc, char **argv)
index 91b4f30..3ee6a75 100644 (file)
@@ -673,16 +673,16 @@ set(headers_to_install
   include/simgrid/s4u/forward.hpp
   include/simgrid/s4u/Activity.hpp
   include/simgrid/s4u/Actor.hpp
-  include/simgrid/s4u/comm.hpp
+  include/simgrid/s4u/Comm.hpp
   include/simgrid/s4u/ConditionVariable.hpp
-  include/simgrid/s4u/engine.hpp  
-  include/simgrid/s4u/file.hpp  
-  include/simgrid/s4u/host.hpp  
+  include/simgrid/s4u/Engine.hpp  
+  include/simgrid/s4u/File.hpp  
+  include/simgrid/s4u/Host.hpp  
   include/simgrid/s4u/Link.hpp  
   include/simgrid/s4u/Mailbox.hpp
   include/simgrid/s4u/Mutex.hpp
   include/simgrid/s4u/NetZone.hpp
-  include/simgrid/s4u/storage.hpp  
+  include/simgrid/s4u/Storage.hpp  
   include/simgrid/s4u/VirtualMachine.hpp  
   include/simgrid/s4u.hpp
   include/simgrid/plugins/energy.h
index 628bd82..bc1ee3f 100644 (file)
@@ -9,6 +9,7 @@
 - Makefile
 - doc/html/.*
 
++ BuildSimGrid.sh
 + \.classpath
 + \.cproject
 + \.project