Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge pull request #190 from Takishipp/clean_events
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Mon, 19 Jun 2017 12:20:00 +0000 (14:20 +0200)
committerGitHub <noreply@github.com>
Mon, 19 Jun 2017 12:20:00 +0000 (14:20 +0200)
fix leak of memory caused by DefineEventTypeEvent call

136 files changed:
.cproject
.gitignore
BuildSimGrid.sh
ChangeLog
contrib/benchmarking_code_block/inject.h
examples/msg/app-chainsend/peer.c
examples/msg/async-wait/async-wait.c
examples/msg/energy-consumption/energy-consumption.tesh
examples/msg/energy-onoff/energy-onoff.tesh
examples/msg/energy-onoff/platform_onoff.xml
examples/msg/io-remote/io-remote.c
examples/msg/io-storage/io-storage.c
examples/platforms/cluster.xml
examples/platforms/cluster_backbone.xml [new file with mode: 0644]
examples/platforms/energy_cluster.xml
examples/platforms/energy_platform.xml
examples/platforms/two_clusters.xml [deleted file]
examples/s4u/io/s4u_io.cpp
examples/s4u/io/s4u_io.tesh
examples/simdag/dag-dotload/sd_dag-dotload.tesh
examples/simdag/daxload/sd_daxload.tesh
examples/simdag/ptg-dotload/sd_ptg-dotload.tesh
examples/simdag/schedule-dotload/sd_schedule-dotload.tesh
examples/simdag/scheduling/sd_scheduling.c
examples/simdag/throttling/sd_throttling.tesh
examples/simdag/typed_tasks/sd_typed_tasks.tesh
include/simgrid/forward.h
include/simgrid/msg.h
include/simgrid/plugins/energy.h
include/simgrid/s4u/Activity.hpp
include/simgrid/s4u/Actor.hpp
include/simgrid/s4u/Comm.hpp
include/simgrid/s4u/File.hpp
include/simgrid/s4u/Host.hpp
include/simgrid/s4u/Storage.hpp
include/simgrid/simix.h
include/xbt/base.h
include/xbt/exception.hpp
include/xbt/string.hpp
src/include/surf/maxmin.h
src/include/surf/surf.h
src/instr/instr_paje_trace.cpp
src/kernel/activity/ActivityImpl.cpp
src/kernel/activity/ActivityImpl.hpp
src/kernel/activity/CommImpl.cpp
src/kernel/activity/ExecImpl.cpp
src/kernel/activity/MailboxImpl.cpp
src/kernel/activity/MailboxImpl.hpp
src/kernel/activity/SynchroIo.cpp
src/kernel/activity/SynchroIo.hpp
src/kernel/activity/SynchroRaw.cpp
src/kernel/activity/SynchroRaw.hpp
src/mc/AddressSpace.hpp
src/mc/LocationList.hpp
src/mc/VisitedState.hpp
src/mc/checker/Checker.hpp
src/mc/checker/CommunicationDeterminismChecker.cpp
src/mc/checker/CommunicationDeterminismChecker.hpp
src/mc/checker/LivenessChecker.hpp
src/mc/mc_base.cpp
src/mc/mc_comm_pattern.cpp
src/mc/mc_request.cpp
src/mc/mc_state.cpp
src/mc/mc_state.h
src/msg/msg_gos.cpp
src/msg/msg_host.cpp
src/msg/msg_io.cpp
src/msg/msg_private.h
src/msg/msg_process.cpp
src/msg/msg_task.cpp
src/plugins/vm/VirtualMachineImpl.hpp
src/s4u/s4u_actor.cpp
src/s4u/s4u_comm.cpp
src/s4u/s4u_file.cpp
src/s4u/s4u_host.cpp
src/s4u/s4u_storage.cpp
src/simgrid/host.cpp
src/simix/ActorImpl.cpp
src/simix/ActorImpl.hpp
src/simix/libsmx.cpp
src/simix/popping_accessors.h
src/simix/popping_bodies.cpp
src/simix/popping_enum.h
src/simix/popping_generated.cpp
src/simix/popping_private.h
src/simix/simcalls.in
src/simix/simcalls.py
src/simix/smx_global.cpp
src/simix/smx_host.cpp
src/simix/smx_host_private.h
src/simix/smx_io.cpp
src/simix/smx_io_private.h
src/simix/smx_network.cpp
src/simix/smx_private.h
src/simix/smx_synchro.cpp
src/smpi/smpi_comm.cpp
src/smpi/smpi_deployment.cpp
src/smpi/smpi_global.cpp
src/smpi/smpi_pmpi.cpp
src/smpi/smpi_process.cpp
src/smpi/smpi_request.cpp
src/smpi/smpi_topo.hpp
src/surf/HostImpl.cpp
src/surf/HostImpl.hpp
src/surf/StorageImpl.cpp
src/surf/StorageImpl.hpp
src/surf/cpu_interface.hpp
src/surf/maxmin.cpp
src/surf/plugins/host_energy.cpp
src/surf/sg_platf.cpp
src/surf/storage_n11.cpp
src/surf/surf_c_bindings.cpp
src/surf/surf_interface.cpp
src/surf/xml/platf.hpp
src/surf/xml/simgrid.dtd
src/surf/xml/simgrid_dtd.c
src/surf/xml/surfxml_sax_cb.cpp
src/xbt/backtrace.cpp
src/xbt/parmap.cpp
teshsuite/msg/CMakeLists.txt
teshsuite/msg/cloud-sharing/cloud-sharing.c
teshsuite/msg/cloud-sharing/cloud-sharing.tesh
teshsuite/msg/host_on_off_processes/host_on_off_processes.tesh
teshsuite/s4u/CMakeLists.txt
teshsuite/s4u/comm-pt2pt/comm-pt2pt.cpp [new file with mode: 0644]
teshsuite/s4u/comm-waitany/comm-waitany.cpp [new file with mode: 0644]
teshsuite/s4u/listen_async/listen_async.tesh
teshsuite/s4u/storage_client_server/storage_client_server.cpp
teshsuite/s4u/storage_client_server/storage_client_server.tesh
teshsuite/simdag/CMakeLists.txt
teshsuite/simdag/flatifier/bogus_missing_gateway.tesh
teshsuite/simdag/flatifier/flatifier.cpp
teshsuite/simdag/is-router/is-router.cpp
teshsuite/smpi/coll-alltoall/clusters.tesh
tools/cmake/DefinePackages.cmake
tools/cmake/Tests.cmake

index 78e5091..33a4317 100644 (file)
--- a/.cproject
+++ b/.cproject
                                        <folderInfo id="cdt.managedbuild.toolchain.gnu.base.1011977604.157358594" name="/" resourcePath="">
                                                <toolChain id="cdt.managedbuild.toolchain.gnu.base.368132295" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.base">
                                                        <targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.target.gnu.platform.base.1122260779" name="Debug Platform" osList="linux,hpux,aix,qnx" superClass="cdt.managedbuild.target.gnu.platform.base"/>
-                                                       <builder buildPath="${workspace_loc:/simgrid}/" id="cdt.managedbuild.target.gnu.builder.base.1747533038" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.base"/>
+                                                       <builder buildPath="${workspace_loc:/simgrid}/build/default" id="cdt.managedbuild.target.gnu.builder.base.1747533038" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.base"/>
                                                        <tool id="cdt.managedbuild.tool.gnu.archiver.base.374652938" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
                                                        <tool id="cdt.managedbuild.tool.gnu.cpp.compiler.base.738159103" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.base">
-                                                               <option id="gnu.cpp.compiler.option.include.paths.216814103" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
+                                                               <option id="gnu.cpp.compiler.option.include.paths.216814103" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
                                                                        <listOptionValue builtIn="false" value="/usr/include/ns3.26"/>
                                                                        <listOptionValue builtIn="false" value="/opt/gtnets/include"/>
                                                                        <listOptionValue builtIn="false" value="/usr/include/lua5.3"/>
@@ -31,7 +31,7 @@
                                                                <inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1641160853" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
                                                        </tool>
                                                        <tool id="cdt.managedbuild.tool.gnu.c.compiler.base.1053916774" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.base">
-                                                               <option id="gnu.c.compiler.option.include.paths.100642505" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
+                                                               <option id="gnu.c.compiler.option.include.paths.100642505" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
                                                                        <listOptionValue builtIn="false" value="/usr/include/ns3.26"/>
                                                                        <listOptionValue builtIn="false" value="/opt/gtnets/include"/>
                                                                        <listOptionValue builtIn="false" value="/usr/include/lua5.3"/>
index f1b3b52..60839f9 100644 (file)
@@ -1051,6 +1051,7 @@ teshsuite/smpi/macro-partial-shared-communication/macro-partial-shared-communica
 teshsuite/smpi/type-struct/type-struct
 teshsuite/smpi/type-vector/type-vector
 teshsuite/s4u/actor/actor
+teshsuite/s4u/comm-pt2pt/comm-pt2pt
 teshsuite/s4u/concurrent_rw/concurrent_rw
 teshsuite/s4u/host_on_off_wait/host_on_off_wait
 teshsuite/s4u/listen_async/listen_async
index 5f3ce84..f219c89 100755 (executable)
@@ -5,6 +5,9 @@
 #
 # Copyright (C) 2017 The SimGrid Team. Licence: LGPL of WDFPL, as you want.
 
+if [ -e build/default ] ; then
+  cd build/default
+fi
 (
   (nice make -j4 || make) && nice ctest -j4 --output-on-failure ; date
 ) 2>&1 | tee BuildSimGrid.sh.log
index f959057..f903db2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,7 +8,7 @@ SimGrid (3.16) UNRELEASED
  XML platforms: Switch to platform v4.1 format.
  * This is (mainly) a backward compatible change: v4 are valid v4.1 files
    - <zone> can be used as a synonym for the now deprecated <as>
-   - <zoneZoute> an be used as a synonym for the now deprecated <asroute>
+   - <zoneRoute> can be used as a synonym for the now deprecated <asroute>
    - <bypassZoneRoute> an be used as a synonym for the now deprecated <bypassAsRoute>
    - <actor> can be used as a synonym for the now deprecated <process>
    - state_file and avail_file periodicity is now easier to express
@@ -53,6 +53,9 @@ SimGrid (3.16) UNRELEASED
       - MPI_Op_commutative, MPI_Fetch_and_Op, MPI_Compare_and_swap
       - MPI_Rput, MPI_Rget, MPI_Raccumulate, MPI_Rget_accumulate
 
+ S4U
+  - New: this_actor::isMaestro() returns whether we are in kernel mode.
+
  XBT
   - Replay: New function xbt_replay_action_get():
     Retrieve the function previously associated to an event type.
index 57e2c82..c171b09 100644 (file)
  * Histogram entry for each measured block
  * Each entry is guarded inside xbt dictionary which is read from the file */
 typedef struct xbt_hist {
-       int n;
-       int counts;
-       double mean;
-       double *breaks;
-       double *percentage;
-       char* block_id;
+  int n;
+  int counts;
+  double mean;
+  double* breaks;
+  double* percentage;
+  char* block_id;
 } xbt_hist_t;
 
 extern RngStream get_randgen(void);
@@ -54,159 +54,144 @@ static inline double xbt_hist_time(char *key);
 /* Initializing xbt dictionary for SMPI version, reading xbt_hist_t entries line by line */
 static inline void xbt_inject_init(char *inputfile)
 {
-       xbt_dict_t mydict = get_dict();
-       FILE* fpInput = fopen(inputfile, "r");
-       if (fpInput == NULL)
-               printf("Error while opening the inputfile");
-       fseek(fpInput, 0, 0);
-
-       char line[200];
-       char *key;
-       int i;
-       xbt_hist_t* data;
-
-       if (fgets(line, 200, fpInput) == NULL)
-               printf("Error input file is empty!");//Skipping first row
-       while (fgets(line, 200, fpInput) != NULL)
-       {
-               key = strtok(line, "\t");
-
-               data = xbt_dict_get_or_null(mydict, key);
-               if (data)
-                       printf("Error, data with that block_id already exists!");
-
-               data = (xbt_hist_t *) xbt_new(xbt_hist_t, 1);
-
-               data->block_id = key;
-               data->counts = atoi(strtok(NULL, "\t"));
-               data->mean = atof(strtok(NULL, "\t"));
-               data->n = atoi(strtok(NULL, "\t"));
-
-               data->breaks = (double*) malloc(sizeof(double) * data->n);
-               data->percentage = (double*) malloc(sizeof(double) * (data->n - 1));
-               for (i = 0; i < data->n; i++)
-                       data->breaks[i] = atof(strtok(NULL, "\t"));
-               for (i = 0; i < (data->n - 1); i++)
-                       data->percentage[i] = atof(strtok(NULL, "\t"));
-
-               xbt_dict_set(mydict, key, data, NULL);
-       }
+  xbt_dict_t mydict = get_dict();
+  FILE* fpInput     = fopen(inputfile, "r");
+  if (fpInput == NULL)
+    printf("Error while opening the inputfile");
+  fseek(fpInput, 0, 0);
+
+  char line[200];
+  char* key;
+
+  if (fgets(line, 200, fpInput) == NULL)
+    printf("Error input file is empty!"); // Skipping first row
+  while (fgets(line, 200, fpInput) != NULL) {
+    key = strtok(line, "\t");
+
+    xbt_hist_t* data = xbt_dict_get_or_null(mydict, key);
+    if (data)
+      printf("Error, data with that block_id already exists!");
+
+    data = (xbt_hist_t*)xbt_new(xbt_hist_t, 1);
+
+    data->block_id = key;
+    data->counts   = atoi(strtok(NULL, "\t"));
+    data->mean     = atof(strtok(NULL, "\t"));
+    data->n        = atoi(strtok(NULL, "\t"));
+
+    data->breaks     = (double*)malloc(sizeof(double) * data->n);
+    data->percentage = (double*)malloc(sizeof(double) * (data->n - 1));
+    for (int i        = 0; i < data->n; i++)
+      data->breaks[i] = atof(strtok(NULL, "\t"));
+    for (int i            = 0; i < (data->n - 1); i++)
+      data->percentage[i] = atof(strtok(NULL, "\t"));
+
+    xbt_dict_set(mydict, key, data, NULL);
+  }
+  fclose(fInput);
 }
 
 /* Initializing xbt dictionary for StarPU version, reading xbt_hist_t entries line by line */
 static inline void inject_init_starpu(char *inputfile, xbt_dict_t *dict, RngStream *rng)
 {
-       *dict = xbt_dict_new_homogeneous(free);
-       *rng = RngStream_CreateStream("Randgen1");
-       unsigned long seed[] = {134, 233445, 865, 2634, 424242, 876541};
-       RngStream_SetSeed(*rng, seed);
-
-       xbt_dict_t mydict = *dict;
-       mydict = *dict;
-       FILE* fpInput = fopen(inputfile, "r");
-       if (fpInput == NULL)
-       {
-               printf("Error while opening the inputfile");
-               return;
-       }
-
-       fseek(fpInput, 0, 0);
-
-       char line[MAX_LINE_INJ];
-       char *key;
-       int i;
-       xbt_hist_t* data;
-
-       if (fgets(line, MAX_LINE_INJ, fpInput) == NULL)
-       {
-               printf("Error input file is empty!");//Skipping first row
-               return;
-       }
-
-
-       while (fgets(line, MAX_LINE_INJ, fpInput) != NULL)
-       {
-               key = strtok(line, "\t");
-
-               data = xbt_dict_get_or_null(mydict, key);
-               if (data)
-                       printf("Error, data with that block_id already exists!");
-
-               data = (xbt_hist_t *) xbt_new(xbt_hist_t, 1);
-               data->block_id = key;
-               data->counts = atoi(strtok(NULL, "\t"));
-               data->mean = atof(strtok(NULL, "\t"));
-               data->n = atoi(strtok(NULL, "\t"));
-               data->breaks = (double*) malloc(sizeof(double) * data->n);
-               data->percentage = (double*) malloc(sizeof(double) * (data->n - 1));
-
-               for (i = 0; i < data->n; i++)
-                       data->breaks[i] = atof(strtok(NULL, "\t"));
-                       for (i = 0; i < (data->n - 1); i++)
-                       {
-                               data->percentage[i] = atof(strtok(NULL, "\t"));
-                       }
-
-               xbt_dict_set(mydict, key, data, NULL);
-       }
+  *dict                = xbt_dict_new_homogeneous(free);
+  *rng                 = RngStream_CreateStream("Randgen1");
+  unsigned long seed[] = {134, 233445, 865, 2634, 424242, 876541};
+  RngStream_SetSeed(*rng, seed);
+
+  xbt_dict_t mydict = *dict;
+  FILE* fpInput     = fopen(inputfile, "r");
+  if (fpInput == NULL) {
+    printf("Error while opening the inputfile");
+    return;
+  }
+
+  fseek(fpInput, 0, 0);
+
+  char line[MAX_LINE_INJ];
+  char* key;
+
+  if (fgets(line, MAX_LINE_INJ, fpInput) == NULL) {
+    printf("Error input file is empty!"); // Skipping first row
+    return;
+  }
+
+  while (fgets(line, MAX_LINE_INJ, fpInput) != NULL) {
+    key = strtok(line, "\t");
+
+    xbt_hist_t* data = xbt_dict_get_or_null(mydict, key);
+    if (data)
+      printf("Error, data with that block_id already exists!");
+
+    data             = (xbt_hist_t*)xbt_new(xbt_hist_t, 1);
+    data->block_id   = key;
+    data->counts     = atoi(strtok(NULL, "\t"));
+    data->mean       = atof(strtok(NULL, "\t"));
+    data->n          = atoi(strtok(NULL, "\t"));
+    data->breaks     = (double*)malloc(sizeof(double) * data->n);
+    data->percentage = (double*)malloc(sizeof(double) * (data->n - 1));
+
+    for (int i        = 0; i < data->n; i++)
+      data->breaks[i] = atof(strtok(NULL, "\t"));
+    for (int i = 0; i < (data->n - 1); i++) {
+      data->percentage[i] = atof(strtok(NULL, "\t"));
+    }
+
+    xbt_dict_set(mydict, key, data, NULL);
+  }
+  fclose(fInput);
 }
 
 /* Injecting time */
 static inline double xbt_inject_time(char *key)
 {
-       return xbt_hist_time(key);
-       //return xbt_mean_time(key);
+  return xbt_hist_time(key);
+  // return xbt_mean_time(key);
 }
 
 /* Injecting mean value */
 static inline double xbt_mean_time(char *key)
 {
-       xbt_dict_t mydict = get_dict();
-       xbt_hist_t* data = xbt_dict_get_or_null(mydict, key);
+  xbt_dict_t mydict = get_dict();
+  xbt_hist_t* data  = xbt_dict_get_or_null(mydict, key);
 
-       if (!data)
-       {
-         printf("Warning: element with specified key does not exist (%s)\n",key);
-         return 0;
-       }
+  if (!data) {
+    printf("Warning: element with specified key does not exist (%s)\n", key);
+    return 0;
+  }
 
-       return data->mean;
+  return data->mean;
 }
 
 /* Injecting random value from the histogram */
 static inline double xbt_hist_time(char *key)
 {
-       int i, k = 0;
-       double left = 0, right = 1;
-       double timer = 0;
-       RngStream rng_stream;
-       double r, r2;
-
-       xbt_dict_t mydict = get_dict();
-       xbt_hist_t* data = xbt_dict_get_or_null(mydict, key);
-
-       if (!data)
-               {
-                 printf("Warning: element with specified key does not exist (%s)\n",key);
-                 return 0;
-               }
-
-       /* Choosing random interval of the histogram */
-       rng_stream = get_randgen();
-       r = RngStream_RandU01(rng_stream);
-       for (i = 0; i < (data->n - 1); i++)
-       {
-               left += (i == 0) ? 0 : data->percentage[i - 1];
-               right += data->percentage[i];
-               if (left < r && r <= right)
-                       k = i;
-       }
-
-       /* Choosing random value inside the interval of the histogram */
-       r2 = RngStream_RandU01(rng_stream);
-       timer = data->breaks[k] + r2 * (data->breaks[k + 1] - data->breaks[k]);
-
-       return timer;
+  xbt_dict_t mydict = get_dict();
+  xbt_hist_t* data  = xbt_dict_get_or_null(mydict, key);
+
+  if (!data) {
+    printf("Warning: element with specified key does not exist (%s)\n", key);
+    return 0;
+  }
+
+  /* Choosing random interval of the histogram */
+  RngStream rng_stream = get_randgen();
+  double r             = RngStream_RandU01(rng_stream);
+  int k                = 0;
+  double left          = 0;
+  double right         = 1;
+  for (int i = 0; i < (data->n - 1); i++) {
+    left += (i == 0) ? 0 : data->percentage[i - 1];
+    right += data->percentage[i];
+    if (left < r && r <= right)
+      k = i;
+  }
+
+  /* Choosing random value inside the interval of the histogram */
+  double r2    = RngStream_RandU01(rng_stream);
+  double timer = data->breaks[k] + r2 * (data->breaks[k + 1] - data->breaks[k]);
+
+  return timer;
 }
 
 #endif // __INJECT_H__
index f19df05..de72e55 100644 (file)
@@ -39,7 +39,7 @@ int peer_execute_task(peer_t peer, msg_task_t task)
     peer->pieces++;
     peer->bytes += msg->data_length;
     if (peer->pieces >= peer->total_pieces) {
-      XBT_DEBUG("%d pieces receieved", peer->pieces);
+      XBT_DEBUG("%d pieces received", peer->pieces);
       done = 1;
     }
   }
index e13a66a..0c4d599 100644 (file)
@@ -1,4 +1,4 @@
-/* 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. */
@@ -45,10 +45,10 @@ static int sender(int argc, char *argv[])
 
   for (int i = 0; i < receivers_count; i++) {
     char mailbox[80];
-    snprintf(mailbox,79, "receiver-%ld", i % receivers_count);
+    snprintf(mailbox, 79, "receiver-%d", i);
     msg_task_t task = MSG_task_create("finalize", 0, 0, 0);
     msg_comm_t comm = MSG_task_isend(task, mailbox);
-    XBT_INFO("Send to receiver-%ld finalize", i % receivers_count);
+    XBT_INFO("Send to receiver-%d finalize", i);
     if (sleep_test_time > 0) {
       while (MSG_comm_test(comm) == 0) {
         MSG_process_sleep(sleep_test_time);
index b0fde0b..9ed9a15 100644 (file)
@@ -3,12 +3,12 @@
 p Testing the mechanism for computing host energy consumption
 
 $ ${bindir:=.}/energy-consumption/energy-consumption$EXEEXT ${srcdir:=.}/../platforms/energy_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
-> [  0.000000] (1:dvfs_test@MyHost1) Energetic profile: 100.0:120.0:200.0, 93.0:110.0:170.0, 90.0:105.0:150.0
+> [  0.000000] (1:dvfs_test@MyHost1) Energetic profile: 100.0:120.0:120.0, 93.0:110.0:110.0, 90.0:105.0:105.0
 > [  0.000000] (1:dvfs_test@MyHost1) Initial peak speed=1E+08 flop/s; Energy dissipated =0E+00 J
 > [  0.000000] (1:dvfs_test@MyHost1) Sleep for 10 seconds
 > [ 10.000000] (1:dvfs_test@MyHost1) Done sleeping (duration: 10.00 s). Current peak speed=1E+08; Energy dissipated=1000.00 J
 > [ 10.000000] (1:dvfs_test@MyHost1) Run a task of 1E+08 flops
-> [ 11.000000] (1:dvfs_test@MyHost1) Task done (duration: 1.00 s). Current peak speed=1E+08 flop/s; Current consumption: from 120W to 200W depending on load; Energy dissipated=1120 J
+> [ 11.000000] (1:dvfs_test@MyHost1) Task done (duration: 1.00 s). Current peak speed=1E+08 flop/s; Current consumption: from 120W to 120W depending on load; Energy dissipated=1120 J
 > [ 11.000000] (1:dvfs_test@MyHost1) ========= Requesting pstate 2 (speed should be of 2E+07 flop/s and is of 2E+07 flop/s)
 > [ 11.000000] (1:dvfs_test@MyHost1) Run a task of 1E+08 flops
 > [ 16.000000] (1:dvfs_test@MyHost1) Task done (duration: 5.00 s). Current peak speed=2E+07 flop/s; Energy dissipated=1645 J
@@ -23,12 +23,12 @@ $ ${bindir:=.}/energy-consumption/energy-consumption$EXEEXT ${srcdir:=.}/../plat
 > [ 30.000000] (0:maestro@) Energy consumption of host MyHost3: 3000.000000 Joules
 
 $ ${bindir:=.}/energy-consumption/energy-consumption$EXEEXT ${srcdir:=.}/../platforms/energy_cluster.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
-> [  0.000000] (1:dvfs_test@MyHost1) Energetic profile: 100.0:120.0:200.0, 93.0:110.0:170.0, 90.0:105.0:150.0
+> [  0.000000] (1:dvfs_test@MyHost1) Energetic profile: 100.0:120.0:120.0, 93.0:110.0:110.0, 90.0:105.0:105.0
 > [  0.000000] (1:dvfs_test@MyHost1) Initial peak speed=1E+08 flop/s; Energy dissipated =0E+00 J
 > [  0.000000] (1:dvfs_test@MyHost1) Sleep for 10 seconds
 > [ 10.000000] (1:dvfs_test@MyHost1) Done sleeping (duration: 10.00 s). Current peak speed=1E+08; Energy dissipated=1000.00 J
 > [ 10.000000] (1:dvfs_test@MyHost1) Run a task of 1E+08 flops
-> [ 11.000000] (1:dvfs_test@MyHost1) Task done (duration: 1.00 s). Current peak speed=1E+08 flop/s; Current consumption: from 120W to 200W depending on load; Energy dissipated=1120 J
+> [ 11.000000] (1:dvfs_test@MyHost1) Task done (duration: 1.00 s). Current peak speed=1E+08 flop/s; Current consumption: from 120W to 120W depending on load; Energy dissipated=1120 J
 > [ 11.000000] (1:dvfs_test@MyHost1) ========= Requesting pstate 2 (speed should be of 2E+07 flop/s and is of 2E+07 flop/s)
 > [ 11.000000] (1:dvfs_test@MyHost1) Run a task of 1E+08 flops
 > [ 16.000000] (1:dvfs_test@MyHost1) Task done (duration: 5.00 s). Current peak speed=2E+07 flop/s; Energy dissipated=1645 J
index f0c366e..e458bf7 100644 (file)
@@ -4,7 +4,7 @@ p Testing the mechanism for computing host energy consumption
 
 ! output sort 19
 $ ${bindir:=.}/energy-onoff/energy-onoff$EXEEXT ${srcdir:=.}/energy-onoff/platform_onoff.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
-> [  0.000000] (1:onoff_test@MyHost2) Energetic profile: 95.0:120.0:200.0,93.0:110.0:170.0,90.0:100.0:150.0, 120:120:120,110:110:110
+> [  0.000000] (1:onoff_test@MyHost2) Energetic profile: 95.0:120.0:120.0,93.0:110.0:110.0,90.0:100.0:100.0, 120:120:120,110:110:110
 > [  0.000000] (1:onoff_test@MyHost2) Initial peak speed=1E+08 flop/s; Energy dissipated =0E+00 J
 > [  0.000000] (1:onoff_test@MyHost2) Sleep for 10 seconds
 > [ 10.000000] (1:onoff_test@MyHost2) Done sleeping. Current peak speed=1E+08; Energy dissipated=950.00 J
index b0423a9..5d7c62b 100644 (file)
       values that are right for you. -->
 
     <host id="MyHost1" speed="100.0Mf,50.0Mf,20.0Mf,                               0.006666667f,0.1429f" pstate="0" >
-      <prop id="watt_per_state" value="95.0:120.0:200.0,93.0:110.0:170.0,90.0:100.0:150.0, 120:120:120,110:110:110" />
+      <prop id="watt_per_state" value="95.0:120.0:120.0,93.0:110.0:110.0,90.0:100.0:100.0, 120:120:120,110:110:110" />
       <prop id="watt_off"       value="10" />
     </host>
     <host id="MyHost2" speed="100.0Mf" >
-      <prop id="watt_per_state" value="100.0:120.0:200.0" />
+      <prop id="watt_per_state" value="100.0:120.0:120.0" />
       <prop id="watt_off"       value="10" />
     </host>
 
index 85dc770..948950b 100644 (file)
@@ -69,7 +69,7 @@ int main(int argc, char **argv)
   xbt_dynar_foreach(storages, cur, st){
     XBT_INFO("Init: %llu MiB used on '%s'", MSG_storage_get_used_size(st)/INMEGA, MSG_storage_get_name(st));
   }
-  xbt_dynar_free_container(&storages);
+  xbt_dynar_free(&storages);
 
   XBT_INFO("Simulation time %g", MSG_get_clock());
   return res != MSG_OK;
index 4094c93..e4075c1 100644 (file)
@@ -73,6 +73,7 @@ static int host(int argc, char *argv[]){
   /* - Then retrieve this data */
   char *data = MSG_file_get_data(file);
   XBT_INFO("User data attached to the file: %s", data);
+  xbt_free(data);
 
   MSG_file_close(file);
   free(file_name);
@@ -99,11 +100,11 @@ static int host(int argc, char *argv[]){
   char* mountname;
   xbt_dict_t content;
   char* path;
-  sg_size_t *size;
+  sg_size_t size;
   xbt_dict_foreach(contents, curs, mountname, content){
     XBT_INFO("Print the content of mount point: %s",mountname);
     xbt_dict_foreach(content,curs2,path,size){
-       XBT_INFO("%s size: %llu bytes", path,*((sg_size_t*)size));
+      XBT_INFO("%s size: %llu bytes", path, (sg_size_t)size);
     }
     xbt_dict_free(&content);
   }
index 628427b..4417517 100644 (file)
@@ -4,12 +4,16 @@
   <!--             _________
                   |          |
                   |  router  |
-      ____________|__________|_____________ backbone
+      ____________|__________|_____________ backbone link
         |   |   |              |     |   |  
       l0| l1| l2|           l97| l96 |   | l99
         |   |   |   ........   |     |   |
         |                                |
     node-0.acme.org                  node-99.acme.org
+
+    The route from node-0 to node-2 is: l0.UP ; backbone ; l2.DOWN
+
+    The route from node-0 to the outer world begins with: l0.UP ; backbone
   -->
   <cluster id="acme" prefix="node-" radical="0-99" suffix=".acme.org" speed="1Gf" bw="125MBps" lat="50us"
            bb_bw="2.25GBps"  bb_lat="500us"/>
diff --git a/examples/platforms/cluster_backbone.xml b/examples/platforms/cluster_backbone.xml
new file mode 100644 (file)
index 0000000..36211cb
--- /dev/null
@@ -0,0 +1,92 @@
+<?xml version='1.0'?>
+<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd">
+<platform version="4.1">
+  <zone id="world" routing="Full">
+  <!-- this platform models 3 clusters, interconnected over the Internet
+    --
+    -- This example intends to be somewhat exhaustive, your platform should probably be simpler.
+    --
+    -- In particular, the clusters are modeled in very different ways,
+    -- but you should pick the way you prefer, and stick to it.
+    -->
+
+  <!-- Here comes the first cluster, the simplest one.
+     
+       Every nodes are connected through a private link to a router
+       (ie a machine that cannot host computations).
+  
+       node-0.1core.org --[l0]--
+                                \
+       node-1.1core.org --[l1]-- router -- (outer world)
+                ...             /
+       node-7.1core.org --[l9]--
+
+       So the route from node-0 to node-1 is {l0.UP, l1.DOWN}
+    -->
+  <cluster id="simple" prefix="node-" radical="0-7" suffix=".1core.org" speed="1Gf" bw="125MBps" lat="50us" />
+
+
+  <!-- This second cluster has a backbone link, connecting all private links:
+
+       node-0.2cores.org --[l0]-------+
+                                     |
+       node-1.2cores.org --[l1]--[backbone]-- router -- (outer world)
+                ...                  |
+       node-7.2cores.org --[l7]-------+
+
+
+    The route from node-0 to node-1 is: l0.UP ; backbone ; l1.DOWN
+    
+    The route from node-0 to the outer world begins with: l0.UP ; backbone
+  -->    
+  <cluster id="backboned" prefix="node-" radical="0-7" suffix=".2cores.org"
+              speed="1Gf"       core="2" 
+             bw="125MBps"      lat="50us"
+           bb_bw="2.25GBps"  bb_lat="500us"/>
+          
+
+  <!-- This cluster has a backbone link, but no links are fullduplex.
+    -- It means that up and down communications compete as if they
+    -- were using exactly the same resource. If you send and receive
+    -- at the same time, then each get half of the bandwidth.
+    --
+    -- Also, the hosts have 4 cores.
+    -->
+  <cluster id="halfduplex" prefix="node-" radical="0-7" suffix=".4cores.org" speed="1Gf" core="4"
+              bw="125MBps"      lat="50us"     sharing_policy="SHARED"
+          bb_bw="2.25GBps"  bb_lat="500us" bb_sharing_policy="SHARED" />
+
+
+  <!-- And now, we create the routes between the clusters, ie inter-zone routes -->
+  
+  <!-- We have only one outer link, representing the internet 
+    -- Its sharing is FATPIPE, meaning that communications have no impact on each others.
+    -- Any given comm can use the full provided bandwidth. 
+    --
+    -- This models the big links constituting the backbone of the internet, 
+    -- that users cannot saturate. 
+    -- Users' bandwidth is mostly limited by their outgoing connexion,
+    -- not by the network backbone. -->
+
+    <link id="backbone" bandwidth="1.25GBps" latency="500us" sharing_policy="FATPIPE"/>
+
+    <zoneRoute src="simple" dst="backboned" 
+               gw_src="node-simple_router.1core.org"
+               gw_dst="node-backboned_router.2cores.org">
+      <link_ctn id="backbone" />
+    </zoneRoute>
+
+    <zoneRoute src="simple" dst="halfduplex" 
+               gw_src="node-simple_router.1core.org"
+               gw_dst="node-halfduplex_router.4cores.org">
+      <link_ctn id="backbone" />
+    </zoneRoute>
+    
+    <zoneRoute src="backboned" dst="halfduplex" 
+               gw_src="node-backboned_router.2cores.org"
+               gw_dst="node-halfduplex_router.4cores.org">
+      <link_ctn id="backbone" />
+    </zoneRoute>
+</zone>
+</platform>
index 680a30e..da38f4d 100644 (file)
@@ -5,7 +5,7 @@
            bw="125MBps" lat="50us" bb_bw="2.25GBps"  bb_lat="500us">
     <!--  List of idle_power:min_power:max_power pairs (in Watts) -->
     <!--  The list must contain one speed tupple for each previously defined pstate-->
-    <prop id="watt_per_state" value="100.0:120.0:200.0, 93.0:110.0:170.0, 90.0:105.0:150.0" />
+    <prop id="watt_per_state" value="100.0:120.0:120.0, 93.0:110.0:110.0, 90.0:105.0:105.0" />
     <prop id="watt_off" value="10" />
   </cluster>
 </platform>
index 0af3e71..3f0a618 100644 (file)
@@ -5,19 +5,19 @@
     <!-- Multiple pstate processor capacities can be defined as a list of powers specified for a given host -->
     <!-- Attribute 'pstate' specifies the initialy selected pstate (here, the lowest pstate corresponds to the highest
          processor speed) -->
-    <host id="MyHost1" speed="100.0Mf,50.0Mf,20.0Mf" pstate="0" >
+    <host id="MyHost1" speed="100.0Mf,50.0Mf,20.0Mf" pstate="0" core="1" >
       <!--  List of min_power:max_power pairs (in Watts) corresponding to the speed consumed when the processor is idle
             and when it is fully loaded -->
       <!--  The list must contain one speed pair for each previously defined pstate-->
-      <prop id="watt_per_state" value="100.0:120.0:200.0, 93.0:110.0:170.0, 90.0:105.0:150.0" />
+      <prop id="watt_per_state" value="100.0:120.0:120.0, 93.0:110.0:110.0, 90.0:105.0:105.0" />
       <prop id="watt_off" value="10" />
     </host>
     <host id="MyHost2" speed="100.0Mf,50.0Mf,20.0Mf" pstate="0" >
-      <prop id="watt_per_state" value="100.0:120.0:200.0, 93.0:110.0:170.0, 90.0:105.0:150.0" />
+      <prop id="watt_per_state" value="100.0:120.0:120.0, 93.0:110.0:110.0, 90.0:105.0:105.0" />
       <prop id="watt_off" value="10" />
     </host>
     <host id="MyHost3" speed="100.0Mf,50.0Mf,20.0Mf" pstate="0" >
-      <prop id="watt_per_state" value="100.0:120.0:200.0, 93.0:110.0:170.0, 90.0:105.0:150.0" />
+      <prop id="watt_per_state" value="100.0:120.0:120.0, 93.0:110.0:110.0, 90.0:105.0:105.0" />
       <prop id="watt_off" value="10" />
     </host>
 
diff --git a/examples/platforms/two_clusters.xml b/examples/platforms/two_clusters.xml
deleted file mode 100644 (file)
index 29ec619..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd">
-<platform version="4.1">
-<!--                  _________________________________________
-                 ____|_____                                    |
-                |          |                                   |
-                |  router1 |                                   |
-    ____________|__________|_____________ backbone1            |
-      |   |   |              |     |   |                       | backbone
-    l0| l1| l2|            l7|   l8|   |l9                     |
-      |   |   |   ........   |     |   |                       |
-      |                                |                       |
-node-0.acme.org                     node-9.acme.org            |
-                     __________________________________________|
-                 ___|______
-                |          |
-                |  router2 |
-    ____________|__________|_____________ backbone2
-      |   |   |              |     |   |  
-   l10|l11|l12|           l17| l18 |   | l19
-      |   |   |   ........   |     |   |
-      |                                |
-node-10.acme.org               node-19.acme.org -->
-
-  <zone id="AS0" routing="Full">
-    <cluster id="my_cluster_1" prefix="node-" suffix=".acme.org" radical="0-9" speed="1Gf" 
-             bw="125MBps" lat="50us" bb_bw="2.25GBps" bb_lat="500us" />
-
-    <cluster id="my_cluster_2" prefix="node-" suffix=".acme.org" radical="10-19" speed="1Gf" 
-             bw="125MBps" lat="50us" bb_bw="2.25GBps" bb_lat="500us" />
-
-    <link id="backbone" bandwidth="1.25GBps" latency="500us" />
-
-    <zoneRoute src="my_cluster_1" dst="my_cluster_2" gw_src="node-my_cluster_1_router.acme.org"
-             gw_dst="node-my_cluster_2_router.acme.org">
-      <link_ctn id="backbone" />
-    </zoneRoute>
-  </zone>
-</platform>
index 90126b6..d9cd197 100644 (file)
@@ -11,27 +11,27 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "a sample log category");
 
 class MyHost {
 public:
-
-  void show_info(boost::unordered_map <std::string, simgrid::s4u::Storage*> const&mounts) {
+  void show_info(std::unordered_map<std::string, simgrid::s4u::Storage*> const& mounts)
+  {
     XBT_INFO("Storage info on %s:", simgrid::s4u::Host::current()->cname());
 
     for (const auto&kv : mounts) {
       const char* mountpoint = kv.first.c_str();
-      simgrid::s4u::Storage storage = *kv.second;
+      simgrid::s4u::Storage* storage = kv.second;
 
       // Retrieve disk's information
-      sg_size_t free_size = storage.sizeFree();
-      sg_size_t used_size = storage.sizeUsed();
-      sg_size_t size = storage.size();
+      sg_size_t free_size = storage->sizeFree();
+      sg_size_t used_size = storage->sizeUsed();
+      sg_size_t size      = storage->size();
 
-      XBT_INFO("    %s (%s) Used: %llu; Free: %llu; Total: %llu.",
-          storage.name(), mountpoint, used_size, free_size, size);
+      XBT_INFO("    %s (%s) Used: %llu; Free: %llu; Total: %llu.", storage->name(), mountpoint, used_size, free_size,
+               size);
     }
   }
 
   void operator()() {
-    boost::unordered_map <std::string, simgrid::s4u::Storage *> const& mounts =
-      simgrid::s4u::Host::current()->mountedStorages();
+    std::unordered_map<std::string, simgrid::s4u::Storage*> const& mounts =
+        simgrid::s4u::Host::current()->mountedStorages();
 
     show_info(mounts);
 
index 0a17043..84a8d27 100644 (file)
@@ -2,12 +2,12 @@
 
 $ $SG_TEST_EXENV ${bindir:=.}/s4u_io
 > [denise:host:(0) 0.000000] [s4u_test/INFO] Storage info on denise:
-> [denise:host:(0) 0.000000] [s4u_test/INFO]     Disk4 (/home) Used: 13221994; Free: 536857690006; Total: 536870912000.
 > [denise:host:(0) 0.000000] [s4u_test/INFO]     Disk2 (c:) Used: 2391537133; Free: 534479374867; Total: 536870912000.
+> [denise:host:(0) 0.000000] [s4u_test/INFO]     Disk4 (/home) Used: 13221994; Free: 536857690006; Total: 536870912000.
 > [denise:host:(0) 0.003333] [s4u_test/INFO] Create a 200000 bytes file named '/home/tmp/data.txt' on /sd1
 > [denise:host:(0) 0.003333] [s4u_test/INFO] Storage info on denise:
-> [denise:host:(0) 0.003333] [s4u_test/INFO]     Disk4 (/home) Used: 13421994; Free: 536857490006; Total: 536870912000.
 > [denise:host:(0) 0.003333] [s4u_test/INFO]     Disk2 (c:) Used: 2391537133; Free: 534479374867; Total: 536870912000.
+> [denise:host:(0) 0.003333] [s4u_test/INFO]     Disk4 (/home) Used: 13421994; Free: 536857490006; Total: 536870912000.
 > [denise:host:(0) 0.004333] [s4u_test/INFO] Read 200000 bytes on /home/tmp/data.txt
 > [denise:host:(0) 0.006000] [s4u_test/INFO] Write 100000 bytes on /home/tmp/data.txt
 > [denise:host:(0) 0.006000] [s4u_test/INFO] Move '/home/tmp/data.txt' to '/home/tmp/simgrid.readme'
index f24b544..0afa3f4 100644 (file)
@@ -4,7 +4,7 @@ p Test the loader of DAG written in the DOT format
 # The order differ when executed with gcc's thread sanitizer
 ! output sort
 
-$ $SG_TEST_EXENV ${bindir:=.}/dag-dotload/sd_dag-dotload --log=no_loc ${srcdir:=.}/../platforms/two_clusters.xml ${srcdir:=.}/dag-dotload/dag.dot
+$ $SG_TEST_EXENV ${bindir:=.}/dag-dotload/sd_dag-dotload --log=no_loc ${srcdir:=.}/../platforms/cluster.xml ${srcdir:=.}/dag-dotload/dag.dot
 > [0.000000] [xbt_cfg/INFO] Switching to the L07 model to handle parallel tasks.
 > [0.000000] [test/INFO] ------------------- Display all tasks of the loaded DAG ---------------------------
 > [0.000000] [sd_task/INFO] Displaying task root
@@ -189,35 +189,35 @@ $ $SG_TEST_EXENV ${bindir:=.}/dag-dotload/sd_dag-dotload --log=no_loc ${srcdir:=
 > [0.000000] [sd_task/INFO]     7->end
 > [0.000000] [test/INFO] ------------------- Schedule tasks ---------------------------
 > [0.000000] [test/INFO] ------------------- Run the schedule ---------------------------
-> [110.005082] [test/INFO] ------------------- Produce the trace file---------------------------
-> [110.005082] [test/INFO] Producing the trace of the run into dag.trace
+> [110.004162] [test/INFO] ------------------- Produce the trace file---------------------------
+> [110.004162] [test/INFO] Producing the trace of the run into dag.trace
 
 $ cat ${srcdir:=.}/dag-dotload/dag.trace
 > [0.000000->0.000000] node-0.acme.org compute 0.000000 flops # root
 > [0.000000->10.000000] node-1.acme.org compute 10000000129.452715 flops # 0
-> [10.001680->20.001680] node-10.acme.org compute 10000000131.133657 flops # 1
-> [20.002360->30.002360] node-11.acme.org compute 10000000121.124870 flops # 2
-> [30.003040->40.003041] node-12.acme.org compute 10000000230.608025 flops # 3
-> [40.003041->50.003041] node-13.acme.org compute 10000000004.994019 flops # 4
-> [50.003721->60.003721] node-14.acme.org compute 10000000046.016401 flops # 5
-> [60.003721->70.003721] node-15.acme.org compute 10000000091.598791 flops # 6
-> [70.004401->80.004401] node-16.acme.org compute 10000000040.679438 flops # 7
-> [80.005081->90.005081] node-17.acme.org compute 10000000250.490017 flops # 8
-> [90.005081->100.005081] node-18.acme.org compute 10000000079.267649 flops # 9
-> [10.000000 -> 10.001680] node-1.acme.org -> node-10.acme.org transfer of 10001 bytes # 0->1
-> [20.001680 -> 20.002360] node-10.acme.org -> node-11.acme.org transfer of 10004 bytes # 1->2
-> [30.002360 -> 30.003040] node-11.acme.org -> node-12.acme.org transfer of 10002 bytes # 2->3
-> [50.003041 -> 50.003721] node-13.acme.org -> node-14.acme.org transfer of 10029 bytes # 4->5
-> [70.003721 -> 70.004401] node-15.acme.org -> node-16.acme.org transfer of 10005 bytes # 6->7
-> [80.004401 -> 80.005081] node-16.acme.org -> node-17.acme.org transfer of 10000 bytes # 7->8
-> [80.004401 -> 80.086113] node-16.acme.org -> node-0.acme.org transfer of 10014000 bytes # 7->end
-> [0.000000 -> 0.081712] node-0.acme.org -> node-14.acme.org transfer of 10014000 bytes # root->5
-> [100.005081->110.005082] node-0.acme.org compute 10000000129.452715 flops # end
+> [10.000680->20.000680] node-10.acme.org compute 10000000131.133657 flops # 1
+> [20.001360->30.001360] node-11.acme.org compute 10000000121.124870 flops # 2
+> [30.002040->40.002041] node-12.acme.org compute 10000000230.608025 flops # 3
+> [40.002041->50.002041] node-13.acme.org compute 10000000004.994019 flops # 4
+> [50.002721->60.002721] node-14.acme.org compute 10000000046.016401 flops # 5
+> [60.002721->70.002721] node-15.acme.org compute 10000000091.598791 flops # 6
+> [70.003401->80.003401] node-16.acme.org compute 10000000040.679438 flops # 7
+> [80.004161->90.004161] node-17.acme.org compute 10000000250.490017 flops # 8
+> [90.004161->100.004161] node-18.acme.org compute 10000000079.267649 flops # 9
+> [10.000000 -> 10.000680] node-1.acme.org -> node-10.acme.org transfer of 10001 bytes # 0->1
+> [20.000680 -> 20.001360] node-10.acme.org -> node-11.acme.org transfer of 10004 bytes # 1->2
+> [30.001360 -> 30.002040] node-11.acme.org -> node-12.acme.org transfer of 10002 bytes # 2->3
+> [50.002041 -> 50.002721] node-13.acme.org -> node-14.acme.org transfer of 10029 bytes # 4->5
+> [70.002721 -> 70.003401] node-15.acme.org -> node-16.acme.org transfer of 10005 bytes # 6->7
+> [80.003401 -> 80.004161] node-16.acme.org -> node-17.acme.org transfer of 10000 bytes # 7->8
+> [80.003401 -> 80.084193] node-16.acme.org -> node-0.acme.org transfer of 10014000 bytes # 7->end
+> [0.000000 -> 0.080712] node-0.acme.org -> node-14.acme.org transfer of 10014000 bytes # root->5
+> [100.004161->110.004162] node-0.acme.org compute 10000000129.452715 flops # end
 
 $ rm -f ${srcdir:=.}/dag-dotload/dag.trace ${srcdir:=.}/dot.dot
 
 ! expect return 2
-$ $SG_TEST_EXENV ${bindir:=.}/dag-dotload/sd_dag-dotload --log=no_loc ${srcdir:=.}/../platforms/two_clusters.xml ${srcdir:=.}/dag-dotload/dag_with_cycle.dot
+$ $SG_TEST_EXENV ${bindir:=.}/dag-dotload/sd_dag-dotload --log=no_loc ${srcdir:=.}/../platforms/cluster.xml ${srcdir:=.}/dag-dotload/dag_with_cycle.dot
 > [0.000000] [xbt_cfg/INFO] Switching to the L07 model to handle parallel tasks.
 > [0.000000] [sd_daxparse/WARNING] the task root is not marked
 > [0.000000] [sd_daxparse/WARNING] the task 1 is in a cycle
index f081afd..3417134 100644 (file)
@@ -2,7 +2,7 @@
 p Test the DAX loader on a small DAX instance
 
 ! output sort
-$ $SG_TEST_EXENV ${bindir:=.}/daxload/sd_daxload --log=no_loc ${srcdir:=.}/../platforms/two_clusters.xml ${srcdir:=.}/daxload/smalldax.xml
+$ $SG_TEST_EXENV ${bindir:=.}/daxload/sd_daxload --log=no_loc ${srcdir:=.}/../platforms/cluster.xml ${srcdir:=.}/daxload/smalldax.xml
 > [0.000000] [xbt_cfg/INFO] Switching to the L07 model to handle parallel tasks.
 > [0.000000] [sd_daxparse/WARNING] Ignore file o1 size redefinition from 1000000 to 304
 > [0.000000] [sd_daxparse/WARNING] Ignore file o2 size redefinition from 1000000 to 304
@@ -101,32 +101,32 @@ $ $SG_TEST_EXENV ${bindir:=.}/daxload/sd_daxload --log=no_loc ${srcdir:=.}/../pl
 > [0.000000] [sd_task/INFO]     3@task1_o3_end
 > [0.000000] [test/INFO] ------------------- Schedule tasks ---------------------------
 > [0.000000] [test/INFO] ------------------- Run the schedule ---------------------------
-> [84.068138] [test/INFO] ------------------- Produce the trace file---------------------------
-> [84.068138] [test/INFO] Producing the trace of the run into smalldax.trace
+> [84.067138] [test/INFO] ------------------- Produce the trace file---------------------------
+> [84.067138] [test/INFO] Producing the trace of the run into smalldax.trace
 
 $ cat ${srcdir:=.}/daxload/smalldax.trace
 > [0.000000] node-0.acme.org compute 0.000000 # root
-> [0.015600] node-1.acme.org compute 42000000000.000000 # 1@task1
+> [0.016600] node-1.acme.org compute 42000000000.000000 # 1@task1
 > [0.016600] node-10.acme.org compute 42000000000.000000 # 2@task2
 > [42.033200] node-11.acme.org compute 42000000000.000000 # 3@task1
 > [0.000000] node-0.acme.org send node-10.acme.org 1000000.000000 # root_i2_2@task2
 > [0.016600] node-10.acme.org recv node-0.acme.org 1000000.000000 # root_i2_2@task2
-> [42.015600] node-1.acme.org send node-11.acme.org 1000000.000000 # 1@task1_o1_3@task1
+> [42.016600] node-1.acme.org send node-11.acme.org 1000000.000000 # 1@task1_o1_3@task1
 > [42.033200] node-11.acme.org recv node-1.acme.org 1000000.000000 # 1@task1_o1_3@task1
 > [42.016600] node-10.acme.org send node-11.acme.org 1000000.000000 # 2@task2_o2_3@task1
 > [42.033200] node-11.acme.org recv node-10.acme.org 1000000.000000 # 2@task2_o2_3@task1
 > [84.033200] node-11.acme.org send node-0.acme.org 4167312.000000 # 3@task1_o3_end
-> [84.068138] node-0.acme.org recv node-11.acme.org 4167312.000000 # 3@task1_o3_end
+> [84.067138] node-0.acme.org recv node-11.acme.org 4167312.000000 # 3@task1_o3_end
 > [0.000000] node-0.acme.org send node-1.acme.org 1000000.000000 # root_i1_1@task1
-> [0.015600] node-1.acme.org recv node-0.acme.org 1000000.000000 # root_i1_1@task1
-> [84.068138] node-0.acme.org compute 0.000000 # end
+> [0.016600] node-1.acme.org recv node-0.acme.org 1000000.000000 # root_i1_1@task1
+> [84.067138] node-0.acme.org compute 0.000000 # end
 
 $ cmake -E remove -f ${srcdir:=.}/dax.dot ${srcdir:=.}/daxload/smalldax.trace
 
 p Test the DAX loader with a DAX comprising a cycle.
 
 ! expect return 255
-$ $SG_TEST_EXENV ${bindir:=.}/daxload/sd_daxload --log=no_loc ${srcdir:=.}/../platforms/two_clusters.xml ${srcdir:=.}/daxload/simple_dax_with_cycle.xml
+$ $SG_TEST_EXENV ${bindir:=.}/daxload/sd_daxload --log=no_loc ${srcdir:=.}/../platforms/cluster.xml ${srcdir:=.}/daxload/simple_dax_with_cycle.xml
 > [0.000000] [xbt_cfg/INFO] Switching to the L07 model to handle parallel tasks.
 > [0.000000] [sd_daxparse/WARNING] the task root is not marked
 > [0.000000] [sd_daxparse/WARNING] the task 1@task1 is in a cycle
index 240d2c1..9b4ec8e 100644 (file)
@@ -4,7 +4,7 @@ p Test the loader of PTG (Parallel Task Graph) written in the DOT format
 # The order differ when executed with gcc's thread sanitizer
 ! output sort
 
-$ $SG_TEST_EXENV ${bindir:=.}/ptg-dotload/sd_ptg-dotload  ${srcdir:=.}/../platforms/two_clusters.xml ${srcdir:=.}/ptg-dotload/ptg.dot
+$ $SG_TEST_EXENV ${bindir:=.}/ptg-dotload/sd_ptg-dotload  ${srcdir:=.}/../platforms/cluster.xml ${srcdir:=.}/ptg-dotload/ptg.dot
 > [0.000000] [xbt_cfg/INFO] Switching to the L07 model to handle parallel tasks.
 > [0.000000] [test/INFO] ------------------- Display all tasks of the loaded DAG ---------------------------
 > [0.000000] [sd_task/INFO] Displaying task root
@@ -93,5 +93,5 @@ $ $SG_TEST_EXENV ${bindir:=.}/ptg-dotload/sd_ptg-dotload  ${srcdir:=.}/../platfo
 > [0.000000] [sd_task/INFO]     c3->end
 > [0.000000] [test/INFO] ------------------- Schedule tasks ---------------------------
 > [0.000000] [test/INFO] ------------------- Run the schedule ---------------------------
-> [3.126200] [test/INFO] Makespan: 3.126200
+> [2.931978] [test/INFO] Makespan: 2.931978
 
index 7badb06..4beb06d 100644 (file)
@@ -2,7 +2,7 @@
 p Test the loader of DAG written in the DOT format
 
 ! expect return 2
-$ $SG_TEST_EXENV ${bindir:=.}/schedule-dotload/sd_schedule-dotload --log=no_loc  "--log=sd_dotparse.thres:verbose" ${srcdir:=.}/../platforms/two_clusters.xml ${srcdir:=.}/schedule-dotload/dag_with_bad_schedule.dot
+$ $SG_TEST_EXENV ${bindir:=.}/schedule-dotload/sd_schedule-dotload --log=no_loc  "--log=sd_dotparse.thres:verbose" ${srcdir:=.}/../platforms/cluster.xml ${srcdir:=.}/schedule-dotload/dag_with_bad_schedule.dot
 > [0.000000] [xbt_cfg/INFO] Switching to the L07 model to handle parallel tasks.
 > [0.000000] [sd_dotparse/VERBOSE] The schedule is ignored, task 'end' can not be scheduled on -1 hosts
 > [0.000000] [sd_dotparse/VERBOSE] The schedule is ignored, task '1' can not be scheduled on 0 hosts
@@ -15,7 +15,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/schedule-dotload/sd_schedule-dotload --log=no_loc
 # The order differ when executed with gcc's thread sanitizer
 ! output sort
 
-$ $SG_TEST_EXENV ${bindir:=.}/schedule-dotload/sd_schedule-dotload --log=no_loc ${srcdir:=.}/../platforms/two_clusters.xml ${srcdir:=.}/schedule-dotload/dag_with_good_schedule.dot
+$ $SG_TEST_EXENV ${bindir:=.}/schedule-dotload/sd_schedule-dotload --log=no_loc ${srcdir:=.}/../platforms/cluster.xml ${srcdir:=.}/schedule-dotload/dag_with_good_schedule.dot
 > [0.000000] [xbt_cfg/INFO] Switching to the L07 model to handle parallel tasks.
 > [0.000000] [test/INFO] ------------------- Display all tasks of the loaded DAG ---------------------------
 > [0.000000] [sd_task/INFO] Displaying task root
index 8705836..bb53f2b 100644 (file)
@@ -65,14 +65,14 @@ static xbt_dynar_t get_ready_tasks(xbt_dynar_t dax)
 static double finish_on_at(SD_task_t task, sg_host_t host)
 {
   double result;
-  unsigned int i;
-  double data_available = 0.;
-  double redist_time = 0;
-  double last_data_available;
 
   xbt_dynar_t parents = SD_task_get_parents(task);
 
   if (!xbt_dynar_is_empty(parents)) {
+    unsigned int i;
+    double data_available = 0.;
+    double redist_time    = 0;
+    double last_data_available;
     /* compute last_data_available */
     SD_task_t parent;
     last_data_available = -1.0;
index e58c296..c0cd2e6 100644 (file)
@@ -4,7 +4,7 @@ p Modify the rate of communication tasks even when they are auto-scheduled
 # We need to sort this out because the order changes with the sanitizers (at least)
 ! output sort
 
-$ $SG_TEST_EXENV ./throttling/sd_throttling ${srcdir:=.}/../platforms/two_clusters.xml
+$ $SG_TEST_EXENV ./throttling/sd_throttling ${srcdir:=.}/../platforms/cluster.xml
 > [0.000000] [xbt_cfg/INFO] Switching to the L07 model to handle parallel tasks.
 > [5.000000] [sd_comm_throttling/INFO] Simulation stopped after 5.0000 seconds
 > [5.000000] [sd_comm_throttling/INFO] Task 'Task A' start time: 0.000000, finish time: 5.000000
index cfa9910..9da9ebb 100644 (file)
@@ -2,12 +2,12 @@
 p Usage test of simdag's typed tasks
 
 ! output sort
-$ $SG_TEST_EXENV ./typed_tasks/sd_typed_tasks ${srcdir:=.}/../platforms/two_clusters.xml
+$ $SG_TEST_EXENV ./typed_tasks/sd_typed_tasks ${srcdir:=.}/../platforms/cluster.xml
 > [0.000000] [xbt_cfg/INFO] Switching to the L07 model to handle parallel tasks.
 > [2.080600] [sd_typed_tasks_test/INFO] Task 'Par. Comp. 3' start time: 0.000000, finish time: 0.400000
 > [2.080600] [sd_typed_tasks_test/INFO] Task 'Par. Comp. 1' start time: 0.000000, finish time: 0.400000
 > [2.080600] [sd_typed_tasks_test/INFO] Task 'Seq. comp. 1' start time: 0.000000, finish time: 1.000000
-> [2.080600] [sd_typed_tasks_test/INFO] Task 'MxN redist' start time: 0.400000, finish time: 0.721600
-> [2.080600] [sd_typed_tasks_test/INFO] Task 'Par. Comp. 2' start time: 0.721600, finish time: 0.921600
+> [2.080600] [sd_typed_tasks_test/INFO] Task 'MxN redist' start time: 0.400000, finish time: 0.720600
+> [2.080600] [sd_typed_tasks_test/INFO] Task 'Par. Comp. 2' start time: 0.720600, finish time: 0.920600
 > [2.080600] [sd_typed_tasks_test/INFO] Task 'E2E comm.' start time: 1.000000, finish time: 1.080600
 > [2.080600] [sd_typed_tasks_test/INFO] Task 'Seq. comp 2.' start time: 1.080600, finish time: 2.080600
index 64730e0..96e8194 100644 (file)
@@ -17,14 +17,28 @@ namespace simgrid {
 namespace kernel {
 namespace activity {
   class ActivityImpl;
+  using ActivityImplPtr = boost::intrusive_ptr<ActivityImpl>;
   XBT_PUBLIC(void) intrusive_ptr_add_ref(ActivityImpl* activity);
   XBT_PUBLIC(void) intrusive_ptr_release(ActivityImpl* activity);
+
+  class CommImpl;
+  using CommImplPtr = boost::intrusive_ptr<CommImpl>;
+  class ExecImpl;
+  using ExecImplPtr = boost::intrusive_ptr<ExecImpl>;
+  class IoImpl;
+  using IoImplPtr = boost::intrusive_ptr<IoImpl>;
+  class RawImpl;
+  using RawImplPtr = boost::intrusive_ptr<RawImpl>;
+  class SleepImpl;
+  using SleepImplPtr = boost::intrusive_ptr<SleepImpl>;
 }
 namespace routing {
   class NetPoint;
 }
 }
 namespace simix {
+  class ActorImpl;
+  using ActorImplPtr = boost::intrusive_ptr<ActorImpl>;
   class Host;
 }
 namespace surf {
@@ -46,7 +60,7 @@ typedef simgrid::s4u::Link s4u_Link;
 typedef simgrid::s4u::File s4u_File;
 typedef simgrid::s4u::Storage s4u_Storage;
 typedef simgrid::s4u::NetZone s4u_NetZone;
-typedef simgrid::kernel::activity::ActivityImpl* smx_activity_t;
+typedef boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> smx_activity_t;
 typedef simgrid::kernel::routing::NetPoint routing_NetPoint;
 typedef simgrid::surf::Resource surf_Resource;
 typedef simgrid::trace_mgr::trace tmgr_Trace;
index d5bd22e..6eb90dd 100644 (file)
 #include "simgrid/forward.h"
 #include "simgrid/simix.h"
 
+#ifdef __cplusplus
+namespace simgrid {
+namespace msg {
+class Comm;
+}
+}
+typedef simgrid::msg::Comm sg_msg_Comm;
+#else
+typedef struct msg_Comm sg_msg_Comm;
+#endif
+
 SG_BEGIN_DECL()
 
 /* *************************** Network Zones ******************************** */
@@ -74,7 +85,7 @@ typedef sg_storage_t msg_storage_t;
  *
  * Object representing an ongoing communication between processes. Such beast is usually obtained by using #MSG_task_isend, #MSG_task_irecv or friends.
  */
-typedef struct msg_comm *msg_comm_t;
+typedef sg_msg_Comm* msg_comm_t;
 
 /** \brief Default value for an uninitialized #msg_task_t.
     \ingroup m_task_management
@@ -198,7 +209,6 @@ XBT_PUBLIC(void) MSG_file_dump(msg_file_t fd);
 XBT_PUBLIC(msg_error_t) MSG_file_unlink(msg_file_t fd);
 XBT_PUBLIC(msg_error_t) MSG_file_seek(msg_file_t fd, sg_offset_t offset, int origin);
 XBT_PUBLIC(sg_size_t) MSG_file_tell (msg_file_t fd);
-XBT_PUBLIC(void) __MSG_file_get_info(msg_file_t fd);
 XBT_PUBLIC(const char *) MSG_file_get_name(msg_file_t file);
 XBT_PUBLIC(msg_error_t) MSG_file_move(msg_file_t fd, const char* fullpath);
 XBT_PUBLIC(msg_error_t) MSG_file_rcopy(msg_file_t fd, msg_host_t host, const char* fullpath);
index bc1da10..a4d9be7 100644 (file)
@@ -17,11 +17,13 @@ XBT_PUBLIC(void) sg_host_energy_update_all();
 XBT_PUBLIC(double) sg_host_get_consumed_energy(sg_host_t host);
 XBT_PUBLIC(double) sg_host_get_wattmin_at(sg_host_t host, int pstate);
 XBT_PUBLIC(double) sg_host_get_wattmax_at(sg_host_t host, int pstate);
+XBT_PUBLIC(double) sg_host_get_current_consumption(sg_host_t host);
 
 #define MSG_host_energy_plugin_init() sg_energy_plugin_init()
 #define MSG_host_get_consumed_energy(host) sg_host_get_consumed_energy(host)
 #define MSG_host_get_wattmin_at(host,pstate) sg_host_get_wattmin_at(host,pstate)
 #define MSG_host_get_wattmax_at(host,pstate) sg_host_get_wattmax_at(host,pstate)
+#define MSG_host_get_current_consumption(host) sg_host_get_current_consumption(host)
 
 SG_END_DECL()
 
index aaa9e38..d0c8b54 100644 (file)
@@ -25,7 +25,7 @@ XBT_PUBLIC_CLASS Activity {
 
 protected:
   Activity()  = default;
-  ~Activity() = default;
+  virtual ~Activity() = default;
 
 public:
   Activity(Activity const&) = delete;
@@ -61,7 +61,7 @@ public:
   void *getUserData() { return userData_; }
 
 private:
-  simgrid::kernel::activity::ActivityImpl *pimpl_ = nullptr;
+  simgrid::kernel::activity::ActivityImplPtr pimpl_ = nullptr;
   e_s4u_activity_state_t state_ = inited;
   double remains_ = 0;
   void *userData_ = nullptr;
index 8cafe9f..5b0378c 100644 (file)
@@ -281,15 +281,16 @@ public:
  *  @brief Static methods working on the current actor (see @ref s4u::Actor) */
 namespace this_actor {
 
-  /** Block the actor sleeping for that amount of seconds (may throws hostFailure) */
-  XBT_PUBLIC(void) sleep_for(double duration);
-  XBT_PUBLIC(void) sleep_until(double timeout);
+XBT_PUBLIC(bool) isMaestro();
 
-  template<class Rep, class Period>
-  inline void sleep_for(std::chrono::duration<Rep, Period> duration)
-  {
-    auto seconds = std::chrono::duration_cast<SimulationClockDuration>(duration);
-    this_actor::sleep_for(seconds.count());
+/** Block the actor sleeping for that amount of seconds (may throws hostFailure) */
+XBT_PUBLIC(void) sleep_for(double duration);
+XBT_PUBLIC(void) sleep_until(double timeout);
+
+template <class Rep, class Period> inline void sleep_for(std::chrono::duration<Rep, Period> duration)
+{
+  auto seconds = std::chrono::duration_cast<SimulationClockDuration>(duration);
+  this_actor::sleep_for(seconds.count());
   }
   template<class Duration>
   inline void sleep_until(const SimulationTimePoint<Duration>& timeout_time)
index 45db6ec..697f259 100644 (file)
@@ -26,18 +26,22 @@ public:
 
   virtual ~Comm();
 
-  /*! take a range of s4u::Comm* (last excluded) and return when one of them is finished. The return value is an
+  /*! take a range of s4u::CommPtr (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);
+    xbt_dynar_t comms = xbt_dynar_new(sizeof(simgrid::kernel::activity::ActivityImpl*), [](void*ptr){
+      intrusive_ptr_release(*(simgrid::kernel::activity::ActivityImpl**)ptr);
+    });
     for (I iter = first; iter != last; iter++) {
-      Comm& comm = **iter;
-      if (comm.state_ == inited)
-        comm.start();
-      xbt_assert(comm.state_ == started);
-      xbt_dynar_push_as(comms, simgrid::kernel::activity::ActivityImpl*, comm.pimpl_);
+      CommPtr comm = *iter;
+      if (comm->state_ == inited)
+        comm->start();
+      xbt_assert(comm->state_ == started);
+      simgrid::kernel::activity::ActivityImpl* ptr = comm->pimpl_.get();
+      intrusive_ptr_add_ref(ptr);
+      xbt_dynar_push_as(comms, simgrid::kernel::activity::ActivityImpl*, ptr);
     }
     // Call the underlying simcall:
     int idx = simcall_comm_waitany(comms, -1);
@@ -50,17 +54,21 @@ public:
     (*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.*/
+  /*! Same as wait_any, but with a timeout. If the timeout occurs, parameter last is returned.*/
   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);
+    xbt_dynar_t comms = xbt_dynar_new(sizeof(simgrid::kernel::activity::ActivityImpl*), [](void*ptr){
+      intrusive_ptr_release(*(simgrid::kernel::activity::ActivityImpl**)ptr);
+    });
     for (I iter = first; iter != last; iter++) {
-      Comm& comm = **iter;
-      if (comm.state_ == inited)
-        comm.start();
-      xbt_assert(comm.state_ == started);
-      xbt_dynar_push_as(comms, simgrid::kernel::activity::ActivityImpl*, comm.pimpl_);
+      CommPtr comm = *iter;
+      if (comm->state_ == inited)
+        comm->start();
+      xbt_assert(comm->state_ == started);
+      simgrid::kernel::activity::ActivityImpl* ptr = comm->pimpl_.get();
+      intrusive_ptr_add_ref(ptr);
+      xbt_dynar_push_as(comms, simgrid::kernel::activity::ActivityImpl*, ptr);
     }
     // Call the underlying simcall:
     int idx = simcall_comm_waitany(comms, timeout);
index 885509e..27dbf56 100644 (file)
@@ -8,14 +8,12 @@
 
 #include <xbt/base.h>
 
-#include "src/surf/StorageImpl.hpp"
 #include <simgrid/simix.h>
+#include <string>
 
 namespace simgrid {
 namespace s4u {
 
-class Storage;
-
 /** @brief A simulated file
  *
  * Used to simulate the time it takes to access to a file, but does not really store any information.
@@ -28,6 +26,7 @@ XBT_PUBLIC_CLASS File
 {
 public:
   File(const char* fullpath, void* userdata);
+  File(const char* fullpath, sg_host_t host, void* userdata);
   ~File();
 
   /** Retrieves the path to the file */
@@ -39,12 +38,10 @@ public:
    *  Any storage is considered as local, and no network communication ever occur.
    */
   sg_size_t read(sg_size_t size);
-  /** Simulates a write action. Returns the size of data actually written.
-   *
-   *  FIXME: reading from a remotely mounted disk is not implemented yet.
-   *  Any storage is considered as local, and no network communication ever occur.
-   */
+
+  /** Simulates a write action. Returns the size of data actually written. */
   sg_size_t write(sg_size_t size);
+  sg_size_t write(sg_size_t size, sg_host_t host);
 
   /** Allows to store user data on that host */
   void setUserdata(void* data) { userdata_ = data; }
@@ -66,18 +63,20 @@ public:
 
   /** Remove a file from disk */
   void unlink();
+  void unlink(sg_host_t host);
 
   /* FIXME: add these to the S4U API:
   XBT_PUBLIC(const char *) MSG_file_get_name(msg_file_t file);
   XBT_PUBLIC(msg_error_t) MSG_file_rcopy(msg_file_t fd, msg_host_t host, const char* fullpath);
   XBT_PUBLIC(msg_error_t) MSG_file_rmove(msg_file_t fd, msg_host_t host, const char* fullpath);
   */
-  char* storage_type;
-  char* storageId;
-  char* mount_point;
+  const char* storage_type;
+  const char* storageId;
+  std::string mount_point;
   int desc_id = 0;
 
 private:
+  sg_host_t host_   = nullptr;
   smx_file_t pimpl_ = nullptr;
   const char* path_ = nullptr;
   void* userdata_   = nullptr;
index 6f9d6ce..31ecd57 100644 (file)
@@ -7,8 +7,7 @@
 #define SIMGRID_S4U_HOST_HPP
 
 #include <string>
-
-#include <boost/unordered_map.hpp>
+#include <unordered_map>
 
 #include "xbt/Extendable.hpp"
 #include "xbt/dict.h"
@@ -95,21 +94,20 @@ public:
   int pstatesCount() const;
   void setPstate(int pstate_index);
   int pstate();
-  xbt_dict_t mountedStoragesAsDict(); // HACK
   void attachedStorages(std::vector<const char*> * storages);
 
   /** Get an associative list [mount point]->[Storage] of all local mount points.
    *
    *  This is defined in the platform file, and cannot be modified programatically (yet).
    */
-  boost::unordered_map<std::string, Storage*> const& mountedStorages();
+  std::unordered_map<std::string, Storage*> const& mountedStorages();
 
   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
+  std::unordered_map<std::string, Storage*>* mounts = nullptr; // caching
 
 public:
   // TODO, this could be a unique_ptr
@@ -148,6 +146,5 @@ public class Host {
    */
   public native int getLoad();
 
-
 }
 #endif
index 12bfe85..f366c3a 100644 (file)
@@ -17,7 +17,7 @@
 namespace simgrid {
 namespace s4u {
 
-std::map<std::string, Storage*>* allStorages();
+XBT_ATTRIB_PUBLIC std::map<std::string, Storage*>* allStorages();
 
 XBT_PUBLIC_CLASS Storage
 {
@@ -30,17 +30,18 @@ public:
   /** Retrieve a Storage by its name. It must exist in the platform file */
   static Storage* byName(const char* name);
   const char* name();
-  const char* host();
+  const char* type();
+  Host* host();
   sg_size_t sizeFree();
   sg_size_t sizeUsed();
   /** Retrieve the total amount of space of this storage element */
   sg_size_t size();
+
   xbt_dict_t properties();
   const char* property(const char* key);
   void setProperty(const char* key, char* value);
-  std::map<std::string, sg_size_t*>* content();
+  std::map<std::string, sg_size_t>* content();
 
-public:
   void setUserdata(void* data) { userdata_ = data; }
   void* userdata() { return userdata_; }
 
@@ -51,10 +52,12 @@ public:
   /** @brief Callback signal fired when a Link is destroyed */
   static simgrid::xbt::signal<void(s4u::Storage&)> onDestruction;
 
+  Host* attached_to_              = nullptr;
+  surf::StorageImpl* const pimpl_ = nullptr;
+
 private:
   std::string name_;
-  surf::StorageImpl* const pimpl_ = nullptr;
-  void* userdata_      = nullptr;
+  void* userdata_ = nullptr;
 };
 
 } /* namespace s4u */
index 4292d94..6c74149 100644 (file)
@@ -212,6 +212,8 @@ XBT_PUBLIC(int) SIMIX_process_has_pending_comms(smx_actor_t process);
 XBT_PUBLIC(void) SIMIX_process_on_exit_runall(smx_actor_t process);
 XBT_PUBLIC(void) SIMIX_process_on_exit(smx_actor_t process, int_f_pvoid_pvoid_t fun, void *data);
 
+SG_END_DECL()
+
 /****************************** Communication *********************************/
 XBT_PUBLIC(void) SIMIX_comm_set_copy_data_callback(void (*callback) (smx_activity_t, void*, size_t));
 XBT_PUBLIC(void) SIMIX_comm_copy_pointer_callback(smx_activity_t comm, void* buff, size_t buff_size);
@@ -246,6 +248,7 @@ XBT_PUBLIC(void) simcall_execution_set_bound(smx_activity_t execution, double bo
 XBT_PUBLIC(e_smx_state_t) simcall_execution_wait(smx_activity_t execution);
 
 /**************************** Process simcalls ********************************/
+SG_BEGIN_DECL()
 /* Constructor and Destructor */
 XBT_PUBLIC(smx_actor_t)
 simcall_process_create(const char* name, xbt_main_func_t code, void* data, sg_host_t host, int argc, char** argv,
@@ -275,6 +278,7 @@ XBT_PUBLIC(smx_actor_t) simcall_process_restart(smx_actor_t process);
 XBT_PUBLIC(void) simcall_process_join(smx_actor_t process, double timeout);
 /* Sleep control */
 XBT_PUBLIC(e_smx_state_t) simcall_process_sleep(double duration);
+SG_END_DECL()
 
 /************************** Comunication simcalls *****************************/
 
@@ -320,6 +324,7 @@ XBT_PUBLIC(int) simcall_comm_testany(smx_activity_t* comms, size_t count);
 XBT_PUBLIC(void) simcall_set_category(smx_activity_t synchro, const char *category);
 
 /************************** Synchro simcalls **********************************/
+SG_BEGIN_DECL()
 XBT_PUBLIC(smx_mutex_t) simcall_mutex_init();
 XBT_PUBLIC(smx_mutex_t) SIMIX_mutex_ref(smx_mutex_t mutex);
 XBT_PUBLIC(void) SIMIX_mutex_unref(smx_mutex_t mutex);
@@ -348,11 +353,10 @@ XBT_PUBLIC(void *) simcall_file_get_data(smx_file_t fd);
 XBT_PUBLIC(void) simcall_file_set_data(smx_file_t fd, void *data);
 XBT_PUBLIC(sg_size_t) simcall_file_read(smx_file_t fd, sg_size_t size, sg_host_t host);
 XBT_PUBLIC(sg_size_t) simcall_file_write(smx_file_t fd, sg_size_t size, sg_host_t host);
-XBT_PUBLIC(smx_file_t) simcall_file_open(const char* fullpath, sg_host_t host);
+XBT_PUBLIC(smx_file_t) simcall_file_open(const char* mount, const char* path, sg_storage_t st);
 XBT_PUBLIC(int) simcall_file_close(smx_file_t fd, sg_host_t host);
 XBT_PUBLIC(int) simcall_file_unlink(smx_file_t fd, sg_host_t host);
 XBT_PUBLIC(sg_size_t) simcall_file_get_size(smx_file_t fd);
-XBT_PUBLIC(xbt_dynar_t) simcall_file_get_info(smx_file_t fd);
 XBT_PUBLIC(sg_size_t) simcall_file_tell(smx_file_t fd);
 XBT_PUBLIC(int) simcall_file_seek(smx_file_t fd, sg_offset_t offset, int origin);
 XBT_PUBLIC(int) simcall_file_move(smx_file_t fd, const char* fullpath);
@@ -360,4 +364,5 @@ XBT_PUBLIC(int) simcall_file_move(smx_file_t fd, const char* fullpath);
 XBT_PUBLIC(int) simcall_mc_random(int min, int max);
 
 SG_END_DECL()
+
 #endif                          /* _SIMIX_SIMIX_H */
index 68ea79e..ba5e76f 100644 (file)
 
 /* Build the DLL */
 #if defined(DLL_EXPORT)
+#  define XBT_ATTRIB_PUBLIC           __declspec(dllexport)
 #  define XBT_PUBLIC(type)            __declspec(dllexport) type
 #  define XBT_EXPORT_NO_IMPORT(type)  __declspec(dllexport) type
 #  define XBT_IMPORT_NO_EXPORT(type)  type
 
 /* Link against the DLL */
 #elif (defined(_WIN32) && !defined(DLL_EXPORT))
+#  define XBT_ATTRIB_PUBLIC           __declspec(dllimport)
 #  define XBT_PUBLIC(type)            __declspec(dllimport) type
 #  define XBT_EXPORT_NO_IMPORT(type)  type
 #  define XBT_IMPORT_NO_EXPORT(type)  __declspec(dllimport) type
 #  define XBT_PRIVATE
 
 #elif defined(__ELF__)
+#  define XBT_ATTRIB_PUBLIC           __attribute__((visibility("default")))
 #  define XBT_PUBLIC(type)            __attribute__((visibility("default"))) type
 #  define XBT_EXPORT_NO_IMPORT(type)  __attribute__((visibility("default"))) type
 #  define XBT_IMPORT_NO_EXPORT(type)  __attribute__((visibility("default"))) type
 #  define XBT_PRIVATE                 __attribute__((visibility("hidden")))
 
 #else
+#  define XBT_ATTRIB_PUBLIC           /* public */
 #  define XBT_PUBLIC(type)            type
 #  define XBT_EXPORT_NO_IMPORT(type)  type
 #  define XBT_IMPORT_NO_EXPORT(type)  type
index 511f47a..6e80198 100644 (file)
@@ -43,8 +43,7 @@ typedef std::vector<xbt_backtrace_location_t> Backtrace;
 class ThrowPoint {
  public:
   ThrowPoint() = default;
-  ThrowPoint(const char* file, int line, const char* function) :
-    file(file), line(line), function(function) {}
+  explicit ThrowPoint(const char* file, int line, const char* function) : file(file), line(line), function(function) {}
   const char* file = nullptr;
   int line = 0;
   const char* function = nullptr;
index 9343ce6..cafddcb 100644 (file)
@@ -165,10 +165,7 @@ public:
     return data()[i];
   }
   // Conversion
-  operator std::string() const
-  {
-    return std::string(this->c_str(), this->size());
-  }
+  operator std::string() const { return std::string(this->c_str(), this->size()); }
 
   // Iterators
   iterator begin()               { return data(); }
index 7365bfa..df7571f 100644 (file)
@@ -203,6 +203,8 @@ XBT_PUBLIC(void) lmm_constraint_free(lmm_system_t sys, lmm_constraint_t cnst);
  */
 XBT_PUBLIC(double) lmm_constraint_get_usage(lmm_constraint_t cnst);
 
+XBT_PUBLIC(int) lmm_constraint_get_variable_amount(lmm_constraint_t cnst);
+
 /**
  * @brief Sets the concurrency limit for this constraint
  * @param cnst A constraint
index 0d0ced1..22b5e44 100644 (file)
@@ -138,9 +138,6 @@ XBT_PUBLIC(surf_action_t) surf_model_extract_failed_action_set(surf_model_t mode
  */
 XBT_PUBLIC(int) surf_model_running_action_set_size(surf_model_t model);
 
-/** @brief Create a file opening action on the given host */
-XBT_PUBLIC(surf_action_t) surf_host_open(sg_host_t host, const char* fullpath);
-
 /** @brief Create a file closing action on the given host */
 XBT_PUBLIC(surf_action_t) surf_host_close(sg_host_t host, surf_file_t fd);
 
index 3a1033d..6513685 100644 (file)
@@ -217,18 +217,16 @@ void DefineContainerEvent(type_t type)
   XBT_DEBUG("%s: event_type=%d", __FUNCTION__, PAJE_DefineContainerType);
   //print it
   if (instr_fmt_type == instr_fmt_paje) {
-               XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, PAJE_DefineContainerType, TRACE_precision(), 0.);
-               stream << std::fixed << std::setprecision(TRACE_precision());
-               stream << PAJE_DefineContainerType;
-               stream << " " << type->id
-                               << " " << type->father->id
-                               << " " << type->name;
-               print_row();
-       } else if (instr_fmt_type == instr_fmt_TI) {
-               /* Nothing to do */
-       } else {
-               THROW_IMPOSSIBLE;
-       }
+    XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, PAJE_DefineContainerType, TRACE_precision(), 0.);
+    stream << std::fixed << std::setprecision(TRACE_precision());
+    stream << PAJE_DefineContainerType;
+    stream << " " << type->id << " " << type->father->id << " " << type->name;
+    print_row();
+  } else if (instr_fmt_type == instr_fmt_TI) {
+    /* Nothing to do */
+  } else {
+    THROW_IMPOSSIBLE;
+  }
   //--
 }
 
@@ -336,12 +334,12 @@ if (instr_fmt_type == instr_fmt_paje) {
     stream << PAJE_CreateContainer;
     stream << " ";
   /* prevent 0.0000 in the trace - this was the behavior before the transition to c++ */
-     if (timestamp < 1e-12)
-         stream << 0;
-      else 
-         stream << timestamp;
-         stream << " " << container->id << " " << container->type->id << " " << container->father->id << " \""
-            << container->name << "\"";
+    if (timestamp < 1e-12)
+      stream << 0;
+    else
+      stream << timestamp;
+    stream << " " << container->id << " " << container->type->id << " " << container->father->id << " \""
+           << container->name << "\"";
 
     print_row();
   } else if (instr_fmt_type == instr_fmt_TI) {
@@ -756,7 +754,7 @@ ResetStateEvent::ResetStateEvent (double timestamp, container_t container, type_
   XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, (int)event_type, this->timestamp);
 
   insert_into_buffer (this);
-       delete [] this;
+  delete[] this;
 }
 
 void ResetStateEvent::print() {
index c732b28..6a9b6e8 100644 (file)
@@ -5,6 +5,8 @@
 
 #include "src/kernel/activity/ActivityImpl.hpp"
 
+XBT_LOG_EXTERNAL_CATEGORY(simix_process);
+
 namespace simgrid {
 namespace kernel {
 namespace activity {
@@ -12,31 +14,25 @@ namespace activity {
 ActivityImpl::ActivityImpl()  = default;
 ActivityImpl::~ActivityImpl() = default;
 
-void ActivityImpl::ref()
-{
-  // Atomic operation! Do not split in two instructions!
-  xbt_assert(refcount_ != 0);
-  refcount_++;
-}
-
-void ActivityImpl::unref()
-{
-  xbt_assert(refcount_ > 0,
-             "This activity has a negative refcount! You can only call test() or wait() once per activity.");
-  refcount_--;
-  if (refcount_ == 0)
-    delete this;
-}
-
 // boost::intrusive_ptr<Activity> support:
 void intrusive_ptr_add_ref(simgrid::kernel::activity::ActivityImpl* activity)
 {
-  activity->ref();
+  xbt_assert(activity->refcount_ >= 0);
+  activity->refcount_++;
+  XBT_CDEBUG(simix_process, "%p->refcount++ ~> %d", activity, (int)activity->refcount_);
+  if (XBT_LOG_ISENABLED(simix_process, xbt_log_priority_trace))
+    xbt_backtrace_display_current();
 }
 
 void intrusive_ptr_release(simgrid::kernel::activity::ActivityImpl* activity)
 {
-  activity->unref();
+  XBT_CDEBUG(simix_process, "%p->refcount-- ~> %d", activity, ((int)activity->refcount_) - 1);
+  xbt_assert(activity->refcount_ >= 0);
+  activity->refcount_--;
+  if (XBT_LOG_ISENABLED(simix_process, xbt_log_priority_trace))
+    xbt_backtrace_display_current();
+  if (activity->refcount_ <= 0)
+    delete activity;
 }
 }
 }
index 1496c41..2a50de8 100644 (file)
@@ -31,17 +31,12 @@ namespace activity {
     virtual void resume()=0;
     virtual void post() =0; // What to do when a simcall terminates
 
-    /** @brief Increases the refcount */
-    void ref();
-    /** @brief Reduces the refcount */
-    void unref();
-
-     // boost::intrusive_ptr<Activity> support:
+    // boost::intrusive_ptr<ActivityImpl> support:
     friend void intrusive_ptr_add_ref(ActivityImpl * activity);
     friend void intrusive_ptr_release(ActivityImpl * activity);
 
   private:
-    std::atomic_int_fast32_t refcount_{1};
+    std::atomic_int_fast32_t refcount_{0};
   };
 }}} // namespace simgrid::kernel::activity
 
index 85ccbea..33d31e7 100644 (file)
@@ -17,7 +17,6 @@ simgrid::kernel::activity::CommImpl::CommImpl(e_smx_comm_type_t _type) : type(_t
   state    = SIMIX_WAITING;
   src_data = nullptr;
   dst_data = nullptr;
-  intrusive_ptr_add_ref(this);
   XBT_DEBUG("Create comm activity %p", this);
 }
 
@@ -62,7 +61,6 @@ void simgrid::kernel::activity::CommImpl::cancel()
   if (state == SIMIX_WAITING) {
     mbox->remove(this);
     state = SIMIX_CANCELED;
-    this->unref();
   } else if (not MC_is_active() /* when running the MC there are no surf actions */
              && not MC_record_replay_is_active() && (state == SIMIX_READY || state == SIMIX_RUNNING)) {
 
@@ -124,6 +122,5 @@ void simgrid::kernel::activity::CommImpl::post()
   /* if there are simcalls associated with the synchro, then answer them */
   if (not simcalls.empty()) {
     SIMIX_comm_finish(this);
-    this->unref();
   }
 }
index 56c6436..aee76bc 100644 (file)
@@ -16,6 +16,7 @@ simgrid::kernel::activity::ExecImpl::ExecImpl(const char* name, sg_host_t host)
   if (name)
     this->name = name;
   this->state  = SIMIX_RUNNING;
+  XBT_DEBUG("Create exec %p", this);
 }
 
 simgrid::kernel::activity::ExecImpl::~ExecImpl()
@@ -24,6 +25,7 @@ simgrid::kernel::activity::ExecImpl::~ExecImpl()
     surf_exec->unref();
   if (timeoutDetector)
     timeoutDetector->unref();
+  XBT_DEBUG("Destroy exec %p", this);
 }
 void simgrid::kernel::activity::ExecImpl::suspend()
 {
index 8c66d35..3f8cedc 100644 (file)
@@ -53,10 +53,10 @@ void MailboxImpl::setReceiver(s4u::ActorPtr actor)
 /** @brief Pushes a communication activity into a mailbox
  *  @param comm What to add
  */
-void MailboxImpl::push(activity::CommImpl* comm)
+void MailboxImpl::push(activity::CommImplPtr comm)
 {
-  this->comm_queue.push_back(comm);
   comm->mbox = this;
+  this->comm_queue.push_back(std::move(comm));
 }
 
 /** @brief Removes a communication activity from a mailbox
@@ -64,15 +64,18 @@ void MailboxImpl::push(activity::CommImpl* comm)
  */
 void MailboxImpl::remove(smx_activity_t activity)
 {
-  simgrid::kernel::activity::CommImpl* comm = static_cast<simgrid::kernel::activity::CommImpl*>(activity);
+  simgrid::kernel::activity::CommImplPtr comm =
+      boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(activity);
 
+  xbt_assert(comm->mbox == this, "Comm %p is in mailbox %s, not mailbox %s", comm.get(),
+             (comm->mbox ? comm->mbox->name_ : "(null)"), this->name_);
   comm->mbox = nullptr;
   for (auto it = this->comm_queue.begin(); it != this->comm_queue.end(); it++)
     if (*it == comm) {
       this->comm_queue.erase(it);
       return;
     }
-  xbt_die("Cannot remove the comm %p that is not part of the mailbox %s", comm, this->name_);
+  xbt_die("Comm %p not found in mailbox %s", comm.get(), this->name_);
 }
 }
 }
index ea9b272..8c4541d 100644 (file)
@@ -31,12 +31,12 @@ public:
   static MailboxImpl* byNameOrNull(const char* name);
   static MailboxImpl* byNameOrCreate(const char* name);
   void setReceiver(s4u::ActorPtr actor);
-  void push(activity::CommImpl* comm);
+  void push(activity::CommImplPtr comm);
   void remove(smx_activity_t activity);
   simgrid::s4u::Mailbox piface_; // Our interface
   char* name_;
 
-  boost::intrusive_ptr<simgrid::simix::ActorImpl> permanent_receiver; // process which the mailbox is attached to
+  simgrid::simix::ActorImplPtr permanent_receiver; // process which the mailbox is attached to
   boost::circular_buffer_space_optimized<smx_activity_t> comm_queue;
   boost::circular_buffer_space_optimized<smx_activity_t> done_comm_queue; // messages already received in the permanent receive mode
 };
index cef2ced..012165b 100644 (file)
@@ -7,19 +7,19 @@
 #include "src/surf/surf_interface.hpp"
 #include "src/simix/smx_private.h"
 
-void simgrid::kernel::activity::Io::suspend()
+void simgrid::kernel::activity::IoImpl::suspend()
 {
   if (surf_io)
     surf_io->suspend();
 }
 
-void simgrid::kernel::activity::Io::resume()
+void simgrid::kernel::activity::IoImpl::resume()
 {
   if (surf_io)
     surf_io->resume();
 }
 
-void simgrid::kernel::activity::Io::post()
+void simgrid::kernel::activity::IoImpl::post()
 {
   for (smx_simcall_t simcall : simcalls) {
     switch (simcall->call) {
index b9c405d..7a229bf 100644 (file)
@@ -13,14 +13,15 @@ namespace simgrid {
 namespace kernel {
 namespace activity {
 
-  XBT_PUBLIC_CLASS Io : public ActivityImpl {
-  public:
-    void suspend() override;
-    void resume() override;
-    void post() override;
-
-    sg_host_t host = nullptr;
-    surf_action_t surf_io = nullptr;
+XBT_PUBLIC_CLASS IoImpl : public ActivityImpl
+{
+public:
+  void suspend() override;
+  void resume() override;
+  void post() override;
+
+  sg_host_t host        = nullptr;
+  surf_action_t surf_io = nullptr;
   };
 
 }}} // namespace simgrid::kernel::activity
index 0f9e29f..509c41d 100644 (file)
@@ -9,21 +9,21 @@
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_synchro);
 
-simgrid::kernel::activity::Raw::~Raw()
+simgrid::kernel::activity::RawImpl::~RawImpl()
 {
   sleep->unref();
 }
-void simgrid::kernel::activity::Raw::suspend()
+void simgrid::kernel::activity::RawImpl::suspend()
 {
   /* The suspension of raw synchros is delayed to when the process is rescheduled. */
 }
 
-void simgrid::kernel::activity::Raw::resume()
+void simgrid::kernel::activity::RawImpl::resume()
 {
   /* I cannot resume raw synchros directly. This is delayed to when the process is rescheduled at
    * the end of the synchro. */
 }
-void simgrid::kernel::activity::Raw::post()
+void simgrid::kernel::activity::RawImpl::post()
 {
   XBT_IN("(%p)",this);
   if (sleep->getState() == simgrid::surf::Action::State::failed)
index b85e06f..f5ef90d 100644 (file)
@@ -14,14 +14,15 @@ namespace kernel {
 namespace activity {
 
   /** Used to implement mutexes, semaphores and conditions */
-  XBT_PUBLIC_CLASS Raw : public ActivityImpl {
-  public:
-    ~Raw() override;
-    void suspend() override;
-    void resume() override;
-    void post() override;
-
-    surf_action_t sleep = nullptr;
+XBT_PUBLIC_CLASS RawImpl : public ActivityImpl
+{
+public:
+  ~RawImpl() override;
+  void suspend() override;
+  void resume() override;
+  void post() override;
+
+  surf_action_t sleep = nullptr;
   };
 
 }}} // namespace simgrid::kernel::activity
index 050650c..c4985e2 100644 (file)
@@ -50,7 +50,7 @@ class ReadOptions {
 public:
   constexpr ReadOptions() : value_(0) {}
 
-  constexpr operator bool() const { return value_ != 0; }
+  explicit constexpr operator bool() const { return value_ != 0; }
   constexpr bool operator!() const { return value_ == 0; }
 
   constexpr ReadOptions operator|(ReadOptions const& that) const
@@ -111,7 +111,7 @@ class AddressSpace {
 private:
   Process* process_;
 public:
-  AddressSpace(Process* process) : process_(process) {}
+  explicit AddressSpace(Process* process) : process_(process) {}
   virtual ~AddressSpace() = default;
 
   /** The process of this addres space
index da1af22..58b9fe2 100644 (file)
@@ -38,9 +38,7 @@ public:
   LocationListEntry(DwarfExpression expression, range_type range)
     : expression_(std::move(expression)), range_(range)
   {}
-  LocationListEntry(DwarfExpression expression)
-    : expression_(std::move(expression)), range_({0, UINT64_MAX})
-  {}
+  LocationListEntry(DwarfExpression expression) : expression_(std::move(expression)), range_({0, UINT64_MAX}) {}
 
   DwarfExpression& expression()
   {
@@ -67,9 +65,8 @@ private:
   void* memory_;
   int register_id_;
 public:
-  Location(void* x) :memory_(x) {}
-  Location(int register_id) :
-    memory_(nullptr), register_id_(register_id) {}
+  explicit Location(void* x) : memory_(x) {}
+  explicit Location(int register_id) : memory_(nullptr), register_id_(register_id) {}
   // Type of location:
   bool in_register() const { return memory_ == nullptr; }
   bool in_memory()   const { return memory_ != nullptr; }
index 3ac5e7b..3665060 100644 (file)
@@ -24,7 +24,7 @@ struct XBT_PRIVATE VisitedState {
   int num          = 0; // unique id of that state in the storage of all stored IDs
   int original_num = 0; // num field of the VisitedState to which I was declared equal to (used for dot_output)
 
-  VisitedState(unsigned long state_number);
+  explicit VisitedState(unsigned long state_number);
   ~VisitedState();
 };
 
index 3b7079f..ce27ab2 100644 (file)
@@ -34,7 +34,7 @@ namespace mc {
 class Checker {
   Session* session_;
 public:
-  Checker(Session& session);
+  explicit Checker(Session& session);
 
   // No copy:
   Checker(Checker const&) = delete;
index 2410b9d..cb723fb 100644 (file)
@@ -185,7 +185,7 @@ void CommunicationDeterminismChecker::get_comm_pattern(xbt_dynar_t list, smx_sim
   if (call_type == MC_CALL_TYPE_SEND) {
     /* Create comm pattern */
     pattern->type = simgrid::mc::PatternCommunicationType::send;
-    pattern->comm_addr = simcall_comm_isend__get__result(request);
+    pattern->comm_addr = static_cast<simgrid::kernel::activity::CommImpl*>(simcall_comm_isend__getraw__result(request));
 
     simgrid::mc::Remote<simgrid::kernel::activity::CommImpl> temp_synchro;
     mc_model_checker->process().read(temp_synchro,
@@ -223,7 +223,7 @@ void CommunicationDeterminismChecker::get_comm_pattern(xbt_dynar_t list, smx_sim
     }
   } else if (call_type == MC_CALL_TYPE_RECV) {
     pattern->type = simgrid::mc::PatternCommunicationType::receive;
-    pattern->comm_addr = simcall_comm_irecv__get__result(request);
+    pattern->comm_addr = static_cast<simgrid::kernel::activity::CommImpl*>(simcall_comm_irecv__getraw__result(request));
 
     simgrid::smpi::Request mpi_request;
     mc_model_checker->process().read(&mpi_request,
index f14abb1..aa07b43 100644 (file)
@@ -22,7 +22,7 @@ namespace mc {
 
 class XBT_PRIVATE CommunicationDeterminismChecker : public Checker {
 public:
-  CommunicationDeterminismChecker(Session& session);
+  explicit CommunicationDeterminismChecker(Session& session);
   ~CommunicationDeterminismChecker();
   void run() override;
   RecordTrace getRecordTrace() override;
index f57a1ff..2722fc5 100644 (file)
@@ -37,7 +37,7 @@ struct XBT_PRIVATE Pair {
   int depth = 0;
   bool exploration_started = false;
 
-  Pair(unsigned long expanded_pairs);
+  explicit Pair(unsigned long expanded_pairs);
   ~Pair() = default;
 
   Pair(Pair const&) = delete;
index ee5098e..b178888 100644 (file)
@@ -79,7 +79,7 @@ bool request_is_enabled(smx_simcall_t req)
   {
     /* FIXME: check also that src and dst processes are not suspended */
     simgrid::kernel::activity::CommImpl* act =
-        static_cast<simgrid::kernel::activity::CommImpl*>(simcall_comm_wait__get__comm(req));
+        static_cast<simgrid::kernel::activity::CommImpl*>(simcall_comm_wait__getraw__comm(req));
 
 #if SIMGRID_HAVE_MC
     // Fetch from MCed memory:
@@ -107,7 +107,7 @@ bool request_is_enabled(smx_simcall_t req)
   case SIMCALL_COMM_WAITANY: {
     xbt_dynar_t comms;
     simgrid::kernel::activity::CommImpl* act =
-        static_cast<simgrid::kernel::activity::CommImpl*>(simcall_comm_wait__get__comm(req));
+        static_cast<simgrid::kernel::activity::CommImpl*>(&*simcall_comm_wait__get__comm(req));
 
 #if SIMGRID_HAVE_MC
     s_xbt_dynar_t comms_buffer;
index c6eede3..dfba80e 100644 (file)
@@ -88,7 +88,9 @@ void MC_handle_comm_pattern(
     {
     simgrid::mc::RemotePtr<simgrid::kernel::activity::CommImpl> comm_addr = nullptr;
     if (call_type == MC_CALL_TYPE_WAIT)
-      comm_addr = remote(static_cast<simgrid::kernel::activity::CommImpl*>(simcall_comm_wait__get__comm(req)));
+      comm_addr = remote(static_cast<simgrid::kernel::activity::CommImpl*>(
+          simgrid::simix::unmarshal<simgrid::kernel::activity::ActivityImpl*>(req->result)));
+
     else {
       simgrid::kernel::activity::CommImpl* addr;
       // comm_addr = REMOTE(xbt_dynar_get_as(simcall_comm_waitany__get__comms(req), value, smx_synchro_t)):
index 06e09a4..efa8aa7 100644 (file)
@@ -23,9 +23,9 @@ static inline simgrid::kernel::activity::CommImpl* MC_get_comm(smx_simcall_t r)
 {
   switch (r->call ) {
   case SIMCALL_COMM_WAIT:
-    return static_cast<simgrid::kernel::activity::CommImpl*>(simcall_comm_wait__get__comm(r));
+    return static_cast<simgrid::kernel::activity::CommImpl*>(simcall_comm_wait__getraw__comm(r));
   case SIMCALL_COMM_TEST:
-    return static_cast<simgrid::kernel::activity::CommImpl*>(simcall_comm_test__get__comm(r));
+    return static_cast<simgrid::kernel::activity::CommImpl*>(simcall_comm_test__getraw__comm(r));
   default:
     return nullptr;
   }
@@ -257,7 +257,7 @@ std::string simgrid::mc::request_to_string(smx_simcall_t req, int value, simgrid
 
   case SIMCALL_COMM_WAIT: {
     simgrid::kernel::activity::CommImpl* remote_act =
-        static_cast<simgrid::kernel::activity::CommImpl*>(simcall_comm_wait__get__comm(req));
+        static_cast<simgrid::kernel::activity::CommImpl*>(simcall_comm_wait__getraw__comm(req));
     char* p;
     if (value == -1) {
       type = "WaitTimeout";
@@ -290,7 +290,7 @@ std::string simgrid::mc::request_to_string(smx_simcall_t req, int value, simgrid
 
   case SIMCALL_COMM_TEST: {
     simgrid::kernel::activity::CommImpl* remote_act =
-        static_cast<simgrid::kernel::activity::CommImpl*>(simcall_comm_test__get__comm(req));
+        static_cast<simgrid::kernel::activity::CommImpl*>(simcall_comm_test__getraw__comm(req));
     simgrid::mc::Remote<simgrid::kernel::activity::CommImpl> temp_synchro;
     simgrid::kernel::activity::CommImpl* act;
     if (use_remote_comm) {
@@ -329,7 +329,7 @@ std::string simgrid::mc::request_to_string(smx_simcall_t req, int value, simgrid
       read_element(mc_model_checker->process(),
         &remote_sync, remote(simcall_comm_waitany__get__comms(req)), value,
         sizeof(remote_sync));
-      char* p = pointer_to_string(remote_sync);
+      char* p = pointer_to_string(&*remote_sync);
       args = bprintf("comm=%s (%d of %lu)",
         p, value + 1, xbt_dynar_length(&comms));
       xbt_free(p);
@@ -404,25 +404,22 @@ namespace mc {
 
 bool request_is_enabled_by_idx(smx_simcall_t req, unsigned int idx)
 {
-  smx_activity_t remote_act = nullptr;
+  simgrid::kernel::activity::ActivityImpl* remote_act = nullptr;
   switch (req->call) {
 
   case SIMCALL_COMM_WAIT:
     /* FIXME: check also that src and dst processes are not suspended */
-    remote_act = simcall_comm_wait__get__comm(req);
+    remote_act = simcall_comm_wait__getraw__comm(req);
     break;
 
   case SIMCALL_COMM_WAITANY: {
-    read_element(
-      mc_model_checker->process(), &remote_act,
-      remote(simcall_comm_waitany__get__comms(req)),
-      idx, sizeof(remote_act));
+    read_element(mc_model_checker->process(), &remote_act, remote(simcall_comm_waitany__getraw__comms(req)), idx,
+                 sizeof(remote_act));
     }
     break;
 
   case SIMCALL_COMM_TESTANY:
-    remote_act = mc_model_checker->process().read(remote(
-      simcall_comm_testany__get__comms(req) + idx));
+    remote_act = mc_model_checker->process().read(remote(simcall_comm_testany__getraw__comms(req) + idx));
     break;
 
   default:
@@ -489,7 +486,7 @@ std::string request_get_dot_output(smx_simcall_t req, int value)
       else
         label = simgrid::xbt::string_printf("[(%lu)] WaitTimeout", issuer->pid);
     } else {
-      smx_activity_t remote_act = simcall_comm_wait__get__comm(req);
+      simgrid::kernel::activity::ActivityImpl* remote_act = simcall_comm_wait__getraw__comm(req);
       simgrid::mc::Remote<simgrid::kernel::activity::CommImpl> temp_comm;
       mc_model_checker->process().read(temp_comm,
                                        remote(static_cast<simgrid::kernel::activity::CommImpl*>(remote_act)));
@@ -511,7 +508,7 @@ std::string request_get_dot_output(smx_simcall_t req, int value)
   }
 
   case SIMCALL_COMM_TEST: {
-    smx_activity_t remote_act = simcall_comm_test__get__comm(req);
+    simgrid::kernel::activity::ActivityImpl* remote_act = simcall_comm_test__getraw__comm(req);
     simgrid::mc::Remote<simgrid::kernel::activity::CommImpl> temp_comm;
     mc_model_checker->process().read(temp_comm, remote(static_cast<simgrid::kernel::activity::CommImpl*>(remote_act)));
     simgrid::kernel::activity::CommImpl* comm = temp_comm.getBuffer();
index e399fa2..f606492 100644 (file)
@@ -130,7 +130,7 @@ static inline smx_simcall_t MC_state_get_request_for_process(
 
       case SIMCALL_COMM_WAIT: {
         simgrid::mc::RemotePtr<simgrid::kernel::activity::CommImpl> remote_act =
-            remote(static_cast<simgrid::kernel::activity::CommImpl*>(simcall_comm_wait__get__comm(&actor->simcall)));
+            remote(static_cast<simgrid::kernel::activity::CommImpl*>(simcall_comm_wait__getraw__comm(&actor->simcall)));
         simgrid::mc::Remote<simgrid::kernel::activity::CommImpl> temp_act;
         mc_model_checker->process().read(temp_act, remote_act);
         simgrid::kernel::activity::CommImpl* act = temp_act.getBuffer();
@@ -176,10 +176,9 @@ static inline smx_simcall_t MC_state_get_request_for_process(
   switch (req->call) {
   case SIMCALL_COMM_WAITANY: {
     state->internal_req.call = SIMCALL_COMM_WAIT;
-    smx_activity_t remote_comm;
-    read_element(mc_model_checker->process(),
-      &remote_comm, remote(simcall_comm_waitany__get__comms(req)),
-      state->transition.argument, sizeof(remote_comm));
+    simgrid::kernel::activity::ActivityImpl* remote_comm;
+    read_element(mc_model_checker->process(), &remote_comm, remote(simcall_comm_waitany__getraw__comms(req)),
+                 state->transition.argument, sizeof(remote_comm));
     mc_model_checker->process().read(state->internal_comm,
                                      remote(static_cast<simgrid::kernel::activity::CommImpl*>(remote_comm)));
     simcall_comm_wait__set__comm(&state->internal_req, state->internal_comm.getBuffer());
@@ -191,8 +190,8 @@ static inline smx_simcall_t MC_state_get_request_for_process(
     state->internal_req.call = SIMCALL_COMM_TEST;
 
     if (state->transition.argument > 0) {
-      smx_activity_t remote_comm = mc_model_checker->process().read(
-        remote(simcall_comm_testany__get__comms(req) + state->transition.argument));
+      simgrid::kernel::activity::ActivityImpl* remote_comm = mc_model_checker->process().read(
+          remote(simcall_comm_testany__getraw__comms(req) + state->transition.argument));
       mc_model_checker->process().read(state->internal_comm,
                                        remote(static_cast<simgrid::kernel::activity::CommImpl*>(remote_comm)));
     }
@@ -202,15 +201,15 @@ static inline smx_simcall_t MC_state_get_request_for_process(
     break;
 
   case SIMCALL_COMM_WAIT:
-    mc_model_checker->process().read_bytes(&state->internal_comm ,
-      sizeof(state->internal_comm), remote(simcall_comm_wait__get__comm(req)));
+    mc_model_checker->process().read_bytes(&state->internal_comm, sizeof(state->internal_comm),
+                                           remote(simcall_comm_wait__getraw__comm(req)));
     simcall_comm_wait__set__comm(&state->executed_req, state->internal_comm.getBuffer());
     simcall_comm_wait__set__comm(&state->internal_req, state->internal_comm.getBuffer());
     break;
 
   case SIMCALL_COMM_TEST:
-    mc_model_checker->process().read_bytes(&state->internal_comm,
-      sizeof(state->internal_comm), remote(simcall_comm_test__get__comm(req)));
+    mc_model_checker->process().read_bytes(&state->internal_comm, sizeof(state->internal_comm),
+                                           remote(simcall_comm_test__getraw__comm(req)));
     simcall_comm_test__set__comm(&state->executed_req, state->internal_comm.getBuffer());
     simcall_comm_test__set__comm(&state->internal_req, state->internal_comm.getBuffer());
     break;
index e4eb0d9..d6ee814 100644 (file)
@@ -24,7 +24,7 @@ enum class PatternCommunicationType {
 
 struct PatternCommunication {
   int num = 0;
-  smx_activity_t comm_addr;
+  simgrid::kernel::activity::CommImpl* comm_addr;
   PatternCommunicationType type = PatternCommunicationType::send;
   unsigned long src_proc = 0;
   unsigned long dst_proc = 0;
index 77c1b3d..d0127d7 100644 (file)
@@ -5,6 +5,7 @@
 
 #include <xbt/ex.hpp>
 
+#include "src/kernel/activity/ExecImpl.hpp"
 #include "src/msg/msg_private.h"
 #include "src/simix/smx_private.h" /* MSG_task_listen looks inside the rdv directly. Not clean. */
 
@@ -66,12 +67,13 @@ msg_error_t MSG_parallel_task_execute_with_timeout(msg_task_t task, double timeo
     simdata->setUsed();
 
     if (simdata->host_nb > 0) {
-      simdata->compute = static_cast<simgrid::kernel::activity::ExecImpl*>(simcall_execution_parallel_start(
-          task->name, simdata->host_nb, simdata->host_list, simdata->flops_parallel_amount,
-          simdata->bytes_parallel_amount, 1.0, -1.0, timeout));
-      XBT_DEBUG("Parallel execution action created: %p", simdata->compute);
+      simdata->compute =
+          boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(simcall_execution_parallel_start(
+              task->name, simdata->host_nb, simdata->host_list, simdata->flops_parallel_amount,
+              simdata->bytes_parallel_amount, 1.0, -1.0, timeout));
+      XBT_DEBUG("Parallel execution action created: %p", simdata->compute.get());
     } else {
-      simdata->compute = static_cast<simgrid::kernel::activity::ExecImpl*>(
+      simdata->compute = boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(
           simcall_execution_start(task->name, simdata->flops_amount, simdata->priority, simdata->bound));
     }
     simcall_set_category(simdata->compute, task->category);
@@ -315,15 +317,11 @@ static inline msg_comm_t MSG_task_isend_internal(msg_task_t task, const char *al
   /* Send it by calling SIMIX network layer */
   smx_activity_t act = simcall_comm_isend(myself->getImpl(), mailbox->getImpl(), t_simdata->bytes_amount, t_simdata->rate,
                                          task, sizeof(void *), match_fun, cleanup, nullptr, match_data,detached);
-  t_simdata->comm = static_cast<simgrid::kernel::activity::CommImpl*>(act);
+  t_simdata->comm = boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(act);
 
   msg_comm_t comm = nullptr;
   if (not detached) {
-    comm = xbt_new0(s_msg_comm_t, 1);
-    comm->task_sent = task;
-    comm->task_received = nullptr;
-    comm->status = MSG_OK;
-    comm->s_comm = act;
+    comm = new simgrid::msg::Comm(task, nullptr, act);
   }
 
   if (TRACE_is_enabled())
@@ -463,11 +461,9 @@ msg_comm_t MSG_task_irecv_bounded(msg_task_t *task, const char *name, double rat
     XBT_CRITICAL("MSG_task_irecv() was asked to write in a non empty task struct.");
 
   /* Try to receive it by calling SIMIX network layer */
-  msg_comm_t comm = xbt_new0(s_msg_comm_t, 1);
-  comm->task_sent = nullptr;
-  comm->task_received = task;
-  comm->status = MSG_OK;
-  comm->s_comm = simcall_comm_irecv(SIMIX_process_self(), mbox->getImpl(), task, nullptr, nullptr, nullptr, nullptr, rate);
+  msg_comm_t comm =
+      new simgrid::msg::Comm(nullptr, task, simcall_comm_irecv(SIMIX_process_self(), mbox->getImpl(), task, nullptr,
+                                                               nullptr, nullptr, nullptr, rate));
 
   return comm;
 }
@@ -489,7 +485,6 @@ int MSG_comm_test(msg_comm_t comm)
     if (finished && comm->task_received != nullptr) {
       /* I am the receiver */
       (*comm->task_received)->simdata->setNotUsed();
-      comm->s_comm->unref();
     }
   }
   catch (xbt_ex& e) {
@@ -522,7 +517,7 @@ int MSG_comm_testany(xbt_dynar_t comms)
   int finished_index = -1;
 
   /* Create the equivalent array with SIMIX objects: */
-  std::vector<simgrid::kernel::activity::ActivityImpl*> s_comms;
+  std::vector<simgrid::kernel::activity::ActivityImplPtr> s_comms;
   s_comms.reserve(xbt_dynar_length(comms));
   msg_comm_t comm;
   unsigned int cursor;
@@ -557,7 +552,6 @@ int MSG_comm_testany(xbt_dynar_t comms)
     if (status == MSG_OK && comm->task_received != nullptr) {
       /* I am the receiver */
       (*comm->task_received)->simdata->setNotUsed();
-      comm->s_comm->unref();
     }
   }
 
@@ -570,7 +564,7 @@ int MSG_comm_testany(xbt_dynar_t comms)
  */
 void MSG_comm_destroy(msg_comm_t comm)
 {
-  xbt_free(comm);
+  delete comm;
 }
 
 /** \ingroup msg_task_usage
@@ -586,7 +580,6 @@ msg_error_t MSG_comm_wait(msg_comm_t comm, double timeout)
 {
   try {
     simcall_comm_wait(comm->s_comm, timeout);
-    comm->s_comm->unref();
 
     if (comm->task_received != nullptr) {
       /* I am the receiver */
@@ -635,11 +628,14 @@ int MSG_comm_waitany(xbt_dynar_t comms)
   int finished_index = -1;
 
   /* create the equivalent dynar with SIMIX objects */
-  xbt_dynar_t s_comms = xbt_dynar_new(sizeof(smx_activity_t), nullptr);
+  xbt_dynar_t s_comms = xbt_dynar_new(sizeof(smx_activity_t), [](void*ptr){
+    intrusive_ptr_release(*(simgrid::kernel::activity::ActivityImpl**)ptr);
+  });
   msg_comm_t comm;
   unsigned int cursor;
   xbt_dynar_foreach(comms, cursor, comm) {
-    xbt_dynar_push(s_comms, &comm->s_comm);
+    intrusive_ptr_add_ref(comm->s_comm.get());
+    xbt_dynar_push_as(s_comms, simgrid::kernel::activity::ActivityImpl*, comm->s_comm.get());
   }
 
   msg_error_t status = MSG_OK;
@@ -671,7 +667,6 @@ int MSG_comm_waitany(xbt_dynar_t comms)
   if (comm->task_received != nullptr) {
     /* I am the receiver */
     (*comm->task_received)->simdata->setNotUsed();
-    comm->s_comm->unref();
   }
 
   return finished_index;
@@ -710,7 +705,8 @@ msg_task_t MSG_comm_get_task(msg_comm_t comm)
  */
 void MSG_comm_copy_data_from_SIMIX(smx_activity_t synchro, void* buff, size_t buff_size)
 {
-  simgrid::kernel::activity::CommImpl* comm = static_cast<simgrid::kernel::activity::CommImpl*>(synchro);
+  simgrid::kernel::activity::CommImplPtr comm =
+      boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(synchro);
 
   SIMIX_comm_copy_pointer_callback(comm, buff, buff_size);
 
@@ -797,9 +793,8 @@ msg_error_t MSG_task_send_with_timeout(msg_task_t task, const char *alias, doubl
                               t_simdata->rate, task, sizeof(void *), nullptr, nullptr, nullptr, task, 0);
     if (TRACE_is_enabled())
       simcall_set_category(comm, task->category);
-    t_simdata->comm = static_cast<simgrid::kernel::activity::CommImpl*>(comm);
+    t_simdata->comm = boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(comm);
     simcall_comm_wait(comm, timeout);
-    comm->unref();
   }
   catch (xbt_ex& e) {
     switch (e.category) {
@@ -868,7 +863,8 @@ int MSG_task_listen(const char *alias)
 int MSG_task_listen_from(const char *alias)
 {
   simgrid::s4u::MailboxPtr mbox = simgrid::s4u::Mailbox::byName(alias);
-  simgrid::kernel::activity::CommImpl* comm = static_cast<simgrid::kernel::activity::CommImpl*>(mbox->front());
+  simgrid::kernel::activity::CommImplPtr comm =
+      boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(mbox->front());
 
   if (not comm)
     return -1;
index f8e8cd7..6c7c2fe 100644 (file)
@@ -240,8 +240,7 @@ int MSG_host_get_nb_pstates(msg_host_t host) {
  */
 xbt_dict_t MSG_host_get_mounted_storage_list(msg_host_t host)
 {
-  xbt_assert((host != nullptr), "Invalid parameters");
-  return host->mountedStoragesAsDict();
+  return sg_host_get_mounted_storage_list(host);
 }
 
 /** \ingroup m_host_management
@@ -263,19 +262,9 @@ xbt_dict_t MSG_host_get_storage_content(msg_host_t host)
 {
   xbt_assert((host != nullptr), "Invalid parameters");
   xbt_dict_t contents = xbt_dict_new_homogeneous(nullptr);
-  msg_storage_t storage;
-  char* storage_name;
-  char* mount_name;
-  xbt_dict_cursor_t cursor = nullptr;
-
-  xbt_dict_t storage_list = host->mountedStoragesAsDict();
+  for (auto elm : host->mountedStorages())
+    xbt_dict_set(contents, elm.first.c_str(), MSG_storage_get_content(elm.second), nullptr);
 
-  xbt_dict_foreach(storage_list,cursor,mount_name,storage_name){
-    storage            = simgrid::s4u::Storage::byName(storage_name);
-    xbt_dict_t content = MSG_storage_get_content(storage);
-    xbt_dict_set(contents,mount_name, content,nullptr);
-  }
-  xbt_dict_free(&storage_list);
   return contents;
 }
 
index eeb421e..7aa6b09 100644 (file)
@@ -3,7 +3,6 @@
 /* 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/StorageImpl.hpp"
 #include "simgrid/s4u/File.hpp"
 #include "simgrid/s4u/Host.hpp"
 #include "simgrid/s4u/Storage.hpp"
@@ -56,7 +55,7 @@ msg_error_t MSG_file_set_data(msg_file_t fd, void *data)
  *
  * This functions checks whether \a file is a valid pointer and return the user data associated to \a file if possible.
  */
-void *MSG_file_get_data(msg_file_t fd)
+voidMSG_file_get_data(msg_file_t fd)
 {
   return fd->userdata();
 }
@@ -74,7 +73,7 @@ void MSG_file_dump (msg_file_t fd){
            "\t\tStorage Id: '%s'\n"
            "\t\tStorage Type: '%s'\n"
            "\t\tFile Descriptor Id: %d",
-           fd->path(), fd->size(), fd->mount_point, fd->storageId, fd->storage_type, fd->desc_id);
+           fd->path(), fd->size(), fd->mount_point.c_str(), fd->storageId, fd->storage_type, fd->desc_id);
 }
 
 /** \ingroup msg_file
@@ -93,7 +92,7 @@ sg_size_t MSG_file_read(msg_file_t fd, sg_size_t size)
 
   /* Find the host where the file is physically located and read it */
   msg_storage_t storage_src           = simgrid::s4u::Storage::byName(fd->storageId);
-  msg_host_t attached_host            = MSG_host_by_name(storage_src->host());
+  msg_host_t attached_host            = storage_src->host();
   read_size                           = fd->read(size); // TODO re-add attached_host;
 
   if (strcmp(attached_host->cname(), MSG_host_self()->cname())) {
@@ -134,7 +133,7 @@ sg_size_t MSG_file_write(msg_file_t fd, sg_size_t size)
 
   /* Find the host where the file is physically located (remote or local)*/
   msg_storage_t storage_src = simgrid::s4u::Storage::byName(fd->storageId);
-  msg_host_t attached_host  = MSG_host_by_name(storage_src->host());
+  msg_host_t attached_host  = storage_src->host();
 
   if (strcmp(attached_host->cname(), MSG_host_self()->cname())) {
     /* the file is hosted on a remote host, initiate a communication between src and dest hosts for data transfer */
@@ -187,6 +186,7 @@ msg_file_t MSG_file_open(const char* fullpath, void* data)
  */
 int MSG_file_close(msg_file_t fd)
 {
+  MSG_host_release_file_descriptor_id(MSG_host_self(), fd->desc_id);
   delete fd;
 
   return MSG_OK;
@@ -201,9 +201,9 @@ int MSG_file_close(msg_file_t fd)
 msg_error_t MSG_file_unlink(msg_file_t fd)
 {
   /* Find the host where the file is physically located (remote or local)*/
-  // msg_storage_t storage_src           = simgrid::s4u::Storage::byName(fd->storageId);
-  // msg_host_t attached_host            = MSG_host_by_name(storage_src->host());
-  fd->unlink(); // simcall_file_unlink(fd->simdata->smx_file, attached_host);
+  msg_storage_t storage_src = simgrid::s4u::Storage::byName(fd->storageId);
+  msg_host_t attached_host  = storage_src->host();
+  fd->unlink(attached_host);
   return MSG_OK;
 }
 
@@ -213,7 +213,8 @@ msg_error_t MSG_file_unlink(msg_file_t fd)
  * \param fd is the file descriptor (#msg_file_t)
  * \return the size of the file (as a #sg_size_t)
  */
-sg_size_t MSG_file_get_size(msg_file_t fd){
+sg_size_t MSG_file_get_size(msg_file_t fd)
+{
   return fd->size();
 }
 
@@ -276,65 +277,56 @@ msg_error_t MSG_file_rcopy (msg_file_t file, msg_host_t host, const char* fullpa
 {
   /* Find the host where the file is physically located and read it */
   msg_storage_t storage_src = simgrid::s4u::Storage::byName(file->storageId);
-  msg_host_t attached_host  = MSG_host_by_name(storage_src->host());
+  msg_host_t src_host       = storage_src->host();
   MSG_file_seek(file, 0, SEEK_SET);
   sg_size_t read_size = file->read(file->size());
 
-  /* Find the real host destination where the file will be physically stored */
-  xbt_dict_cursor_t cursor   = nullptr;
+  /* Find the host that owns the storage where the file has to be copied */
   msg_storage_t storage_dest = nullptr;
-  msg_host_t host_dest;
+  msg_host_t dst_host;
   size_t longest_prefix_length = 0;
 
-  xbt_dict_t storage_list = host->mountedStoragesAsDict();
-  char *mount_name;
-  char *storage_name;
-  xbt_dict_foreach(storage_list,cursor,mount_name,storage_name){
-    char* file_mount_name = static_cast<char*>(xbt_malloc(strlen(mount_name) + 1));
-    strncpy(file_mount_name, fullpath, strlen(mount_name) + 1);
-    file_mount_name[strlen(mount_name)] = '\0';
-
-    if (not strcmp(file_mount_name, mount_name) && strlen(mount_name) > longest_prefix_length) {
+  for (auto elm : host->mountedStorages()) {
+    std::string mount_point = std::string(fullpath).substr(0, elm.first.size());
+    if (mount_point == elm.first && elm.first.length() > longest_prefix_length) {
       /* The current mount name is found in the full path and is bigger than the previous*/
-      longest_prefix_length = strlen(mount_name);
-      storage_dest          = simgrid::s4u::Storage::byName(storage_name);
+      longest_prefix_length = elm.first.length();
+      storage_dest          = elm.second;
     }
-    xbt_free(file_mount_name);
   }
-  xbt_dict_free(&storage_list);
 
-  if(longest_prefix_length>0){
+  if (longest_prefix_length > 0) {
     /* Mount point found, retrieve the host the storage is attached to */
-    host_dest = MSG_host_by_name(storage_dest->host());
+    dst_host = storage_dest->host();
   }else{
     XBT_WARN("Can't find mount point for '%s' on destination host '%s'", fullpath, host->cname());
     return MSG_TASK_CANCELED;
   }
 
-  XBT_DEBUG("Initiate data transfer of %llu bytes between %s and %s.", read_size, attached_host->cname(),
-            storage_dest->host());
-  msg_host_t m_host_list[] = {attached_host, host_dest};
+  XBT_DEBUG("Initiate data transfer of %llu bytes between %s and %s.", read_size, src_host->cname(),
+            storage_dest->host()->cname());
+  msg_host_t m_host_list[] = {src_host, dst_host};
   double flops_amount[]    = {0, 0};
   double bytes_amount[]    = {0, static_cast<double>(read_size), 0, 0};
 
   msg_task_t task =
       MSG_parallel_task_create("file transfer for write", 2, m_host_list, flops_amount, bytes_amount, nullptr);
-  msg_error_t transfer = MSG_parallel_task_execute(task);
+  msg_error_t err = MSG_parallel_task_execute(task);
   MSG_task_destroy(task);
 
-  if(transfer != MSG_OK){
-    if (transfer == MSG_HOST_FAILURE)
-      XBT_WARN("Transfer error, %s remote host just turned off!", storage_dest->host());
-    if (transfer == MSG_TASK_CANCELED)
+  if (err != MSG_OK) {
+    if (err == MSG_HOST_FAILURE)
+      XBT_WARN("Transfer error, %s remote host just turned off!", storage_dest->host()->cname());
+    if (err == MSG_TASK_CANCELED)
       XBT_WARN("Transfer error, task has been canceled!");
 
-    return transfer;
+    return err;
   }
 
   /* Create file on remote host, write it and close it */
-  smx_file_t smx_file = simcall_file_open(fullpath, host_dest);
-  simcall_file_write(smx_file, read_size, host_dest);
-  simcall_file_close(smx_file, host_dest);
+  msg_file_t fd = new simgrid::s4u::File(fullpath, dst_host, nullptr);
+  fd->write(read_size, dst_host);
+  delete fd;
   return MSG_OK;
 }
 
@@ -364,7 +356,8 @@ msg_error_t MSG_file_rmove (msg_file_t file, msg_host_t host, const char* fullpa
  *
  * This functions checks whether a storage is a valid pointer or not and return its name.
  */
-const char *MSG_storage_get_name(msg_storage_t storage) {
+const char* MSG_storage_get_name(msg_storage_t storage)
+{
   xbt_assert((storage != nullptr), "Invalid parameters");
   return storage->name();
 }
@@ -374,7 +367,8 @@ const char *MSG_storage_get_name(msg_storage_t storage) {
  * \param storage a storage
  * \return the free space size of the storage element (as a #sg_size_t)
  */
-sg_size_t MSG_storage_get_free_size(msg_storage_t storage){
+sg_size_t MSG_storage_get_free_size(msg_storage_t storage)
+{
   return storage->sizeFree();
 }
 
@@ -383,7 +377,8 @@ sg_size_t MSG_storage_get_free_size(msg_storage_t storage){
  * \param storage a storage
  * \return the used space size of the storage element (as a #sg_size_t)
  */
-sg_size_t MSG_storage_get_used_size(msg_storage_t storage){
+sg_size_t MSG_storage_get_used_size(msg_storage_t storage)
+{
   return storage->sizeUsed();
 }
 
@@ -435,11 +430,13 @@ msg_storage_t MSG_storage_get_by_name(const char *name)
 /** \ingroup msg_storage_management
  * \brief Returns a dynar containing all the storage elements declared at a given point of time
  */
-xbt_dynar_t MSG_storages_as_dynar() {
+xbt_dynar_t MSG_storages_as_dynar()
+{
+  std::map<std::string, simgrid::s4u::Storage*>* storage_map = simgrid::s4u::allStorages();
   xbt_dynar_t res = xbt_dynar_new(sizeof(msg_storage_t),nullptr);
-  for (auto s : *simgrid::s4u::allStorages()) {
+  for (auto s : *storage_map)
     xbt_dynar_push(res, &(s.second));
-  }
+  delete storage_map;
   return res;
 }
 
@@ -474,11 +471,11 @@ void *MSG_storage_get_data(msg_storage_t storage)
  */
 xbt_dict_t MSG_storage_get_content(msg_storage_t storage)
 {
-  std::map<std::string, sg_size_t*>* content = storage->content();
+  std::map<std::string, sg_size_t>* content = storage->content();
   xbt_dict_t content_dict = xbt_dict_new_homogeneous(nullptr);
 
   for (auto entry : *content) {
-    xbt_dict_set(content_dict, entry.first.c_str(), entry.second, nullptr);
+    xbt_dict_set(content_dict, entry.first.c_str(), (void*)entry.second, nullptr);
   }
   return content_dict;
 }
@@ -500,9 +497,10 @@ sg_size_t MSG_storage_get_size(msg_storage_t storage)
  *
  * This functions checks whether a storage is a valid pointer or not and return its name.
  */
-const char *MSG_storage_get_host(msg_storage_t storage) {
+const char* MSG_storage_get_host(msg_storage_t storage)
+{
   xbt_assert((storage != nullptr), "Invalid parameters");
-  return storage->host();
+  return storage->host()->cname();
 }
 
 SG_END_DECL()
index b083103..e3f98d8 100644 (file)
@@ -30,9 +30,6 @@ public:
 typedef struct simdata_task {
   ~simdata_task()
   {
-    if (this->compute)
-      this->compute->unref();
-
     /* parallel tasks only */
     xbt_free(this->host_list);
   }
@@ -42,8 +39,8 @@ typedef struct simdata_task {
     this->isused = false;
   }
 
-  simgrid::kernel::activity::ExecImpl* compute = nullptr; /* SIMIX modeling of computation */
-  simgrid::kernel::activity::CommImpl* comm = nullptr; /* SIMIX modeling of communication */
+  simgrid::kernel::activity::ExecImplPtr compute = nullptr; /* SIMIX modeling of computation */
+  simgrid::kernel::activity::CommImplPtr comm    = nullptr; /* SIMIX modeling of communication */
   double bytes_amount = 0.0; /* Data size */
   double flops_amount = 0.0; /* Computation size */
   msg_process_t sender = nullptr;
@@ -73,20 +70,27 @@ typedef struct simdata_file {
 /******************************* Process *************************************/
 
 namespace simgrid {
-class MsgActorExt {
+namespace msg {
+class ActorExt {
 public:
-  explicit MsgActorExt(void* d) : data(d) {}
+  explicit ActorExt(void* d) : data(d) {}
   msg_error_t errno_ = MSG_OK;  /* the last value returned by a MSG_function */
   void* data = nullptr; /* user data */
 };
-}
 
-typedef struct msg_comm {
-  smx_activity_t s_comm;          /* SIMIX communication object encapsulated (the same for both processes) */
+class Comm {
+public:
   msg_task_t task_sent;           /* task sent (NULL for the receiver) */
   msg_task_t *task_received;      /* where the task will be received (NULL for the sender) */
-  msg_error_t status;           /* status of the communication once finished */
-} s_msg_comm_t;
+  smx_activity_t s_comm;          /* SIMIX communication object encapsulated (the same for both processes) */
+  msg_error_t status = MSG_OK;    /* status of the communication once finished */
+  Comm(msg_task_t sent, msg_task_t* received, smx_activity_t comm)
+      : task_sent(sent), task_received(received), s_comm(std::move(comm))
+  {
+  }
+};
+}
+}
 
 /************************** Global variables ********************************/
 typedef struct MSG_Global {
index eda8149..091650e 100644 (file)
@@ -27,15 +27,15 @@ SG_BEGIN_DECL()
  */
 void MSG_process_cleanup_from_SIMIX(smx_actor_t smx_actor)
 {
-  simgrid::MsgActorExt* msg_actor;
+  simgrid::msg::ActorExt* msg_actor;
 
   // get the MSG process from the SIMIX process
   if (smx_actor == SIMIX_process_self()) {
     /* avoid a SIMIX request if this function is called by the process itself */
-    msg_actor = (simgrid::MsgActorExt*)SIMIX_process_self_get_data();
+    msg_actor = (simgrid::msg::ActorExt*)SIMIX_process_self_get_data();
     SIMIX_process_self_set_data(nullptr);
   } else {
-    msg_actor = (simgrid::MsgActorExt*)smx_actor->data;
+    msg_actor = (simgrid::msg::ActorExt*)smx_actor->data;
     simcall_process_set_data(smx_actor, nullptr);
   }
 
@@ -136,7 +136,7 @@ msg_process_t MSG_process_create_from_stdfunc(const char* name, std::function<vo
                                               xbt_dict_t properties)
 {
   xbt_assert(code != nullptr && host != nullptr, "Invalid parameters: host and code params must not be nullptr");
-  simgrid::MsgActorExt* msgExt = new simgrid::MsgActorExt(data);
+  simgrid::msg::ActorExt* msgExt = new simgrid::msg::ActorExt(data);
 
   smx_actor_t process = simcall_process_create(name, std::move(code), msgExt, host, properties);
 
@@ -163,7 +163,8 @@ msg_process_t MSG_process_attach(const char *name, void *data, msg_host_t host,
   xbt_assert(host != nullptr, "Invalid parameters: host and code params must not be nullptr");
 
   /* Let's create the process: SIMIX may decide to start it right now, even before returning the flow control to us */
-  smx_actor_t process = SIMIX_process_attach(name, new simgrid::MsgActorExt(data), host->cname(), properties, nullptr);
+  smx_actor_t process =
+      SIMIX_process_attach(name, new simgrid::msg::ActorExt(data), host->cname(), properties, nullptr);
   if (not process)
     xbt_die("Could not attach");
   simcall_process_on_exit(process,(int_f_pvoid_pvoid_t)TRACE_msg_process_kill,process);
@@ -231,7 +232,7 @@ void* MSG_process_get_data(msg_process_t process)
   xbt_assert(process != nullptr, "Invalid parameter: first parameter must not be nullptr!");
 
   /* get from SIMIX the MSG process data, and then the user data */
-  simgrid::MsgActorExt* msgExt = (simgrid::MsgActorExt*)process->getImpl()->data;
+  simgrid::msg::ActorExt* msgExt = (simgrid::msg::ActorExt*)process->getImpl()->data;
   if (msgExt)
     return msgExt->data;
   else
@@ -247,7 +248,7 @@ msg_error_t MSG_process_set_data(msg_process_t process, void *data)
 {
   xbt_assert(process != nullptr, "Invalid parameter: first parameter must not be nullptr!");
 
-  static_cast<simgrid::MsgActorExt*>(process->getImpl()->data)->data = data;
+  static_cast<simgrid::msg::ActorExt*>(process->getImpl()->data)->data = data;
 
   return MSG_OK;
 }
index 98752c1..42a69af 100644 (file)
@@ -265,7 +265,7 @@ void MSG_task_set_bytes_amount(msg_task_t task, double data_size)
  */
 double MSG_task_get_remaining_communication(msg_task_t task)
 {
-  XBT_DEBUG("calling simcall_communication_get_remains(%p)", task->simdata->comm);
+  XBT_DEBUG("calling simcall_communication_get_remains(%p)", task->simdata->comm.get());
   return task->simdata->comm->remains();
 }
 
index d937176..797bfb0 100644 (file)
@@ -6,6 +6,8 @@
 #include "simgrid/s4u/VirtualMachine.hpp"
 #include "src/simix/ActorImpl.hpp"
 #include "src/surf/HostImpl.hpp"
+#include <algorithm>
+#include <deque>
 
 #ifndef VM_INTERFACE_HPP_
 #define VM_INTERFACE_HPP_
@@ -95,6 +97,7 @@ public:
   e_surf_vm_state_t getState();
   void setState(e_surf_vm_state_t state);
   static std::deque<s4u::VirtualMachine*> allVms_;
+  int coreAmount() { return coreAmount_; }
 
   bool isMigrating = false;
 
index 37d935f..ab6f3a1 100644 (file)
@@ -11,6 +11,9 @@
 #include "simgrid/s4u/Mailbox.hpp"
 
 #include "src/kernel/context/Context.hpp"
+#include "src/simix/smx_private.h"
+
+#include <sstream>
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_actor, "S4U actors");
 
@@ -167,6 +170,21 @@ void Actor::setProperty(const char* key, const char* value)
 
 namespace this_actor {
 
+/** Returns true if run from the kernel mode, and false if run from a real actor
+ *
+ * Everything that is run out of any actor (simulation setup before the engine is run,
+ * computing the model evolutions as a result to the actors' action, etc) is run in
+ * kernel mode, just as in any operating systems.
+ *
+ * In SimGrid, the actor in charge of doing the stuff in kernel mode is called Maestro,
+ * because it is the one scheduling when the others should move or wait.
+ */
+bool isMaestro()
+{
+  smx_actor_t process = SIMIX_process_self();
+  return process == nullptr || process == simix_global->maestro_process;
+}
+
 void sleep_for(double duration)
 {
   if (duration > 0)
index c168cff..7729d3e 100644 (file)
@@ -23,8 +23,6 @@ Comm::~Comm()
       XBT_INFO("pimpl_ is null");
     xbt_backtrace_display_current();
   }
-  if (pimpl_)
-    pimpl_->unref();
 }
 
 s4u::CommPtr Comm::send_init(s4u::MailboxPtr chan)
@@ -90,6 +88,7 @@ void Comm::start() {
         matchFunction_, cleanFunction_, copyDataFunction_,
         userData_, detached_);
   } else if (dstBuff_ != nullptr) { // Receiver side
+    xbt_assert(not detached_, "Receive cannot be detached");
     pimpl_ = simcall_comm_irecv(receiver_, mailbox_->getImpl(), dstBuff_, &dstBuffSize_,
         matchFunction_, copyDataFunction_,
         userData_, rate_);
@@ -117,8 +116,6 @@ void Comm::wait() {
     }
   }
   state_ = finished;
-  if (pimpl_)
-    pimpl_->unref();
 }
 
 void Comm::wait(double timeout) {
@@ -127,7 +124,6 @@ void Comm::wait(double timeout) {
   if (state_ == started) {
     simcall_comm_wait(pimpl_, timeout);
     state_ = finished;
-    pimpl_->unref();
     return;
   }
 
@@ -143,8 +139,6 @@ void Comm::wait(double timeout) {
         userData_, timeout, rate_);
   }
   state_ = finished;
-  if (pimpl_)
-    pimpl_->unref();
 }
 
 void Comm::send_detached(MailboxPtr dest, void* data, int simulatedSize)
@@ -177,7 +171,8 @@ s4u::CommPtr Comm::recv_async(MailboxPtr dest, void** data)
 
 void Comm::cancel()
 {
-  simgrid::kernel::activity::CommImpl* commPimpl = static_cast<simgrid::kernel::activity::CommImpl*>(pimpl_);
+  simgrid::kernel::activity::CommImplPtr commPimpl =
+      boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(pimpl_);
   commPimpl->cancel();
 }
 
@@ -193,7 +188,6 @@ bool Comm::test() {
 
   if(simcall_comm_test(pimpl_)){
     state_ = finished;
-    pimpl_->unref();
     return true;
   }
   return false;
index 0f26d59..ec8cd7c 100644 (file)
@@ -3,60 +3,98 @@
 /* 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/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/File.hpp"
 #include "simgrid/s4u/Host.hpp"
-#include "simgrid/s4u/Mailbox.hpp"
 #include "simgrid/s4u/Storage.hpp"
+#include "src/surf/HostImpl.hpp"
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_file,"S4U files");
 
 namespace simgrid {
 namespace s4u {
 
-File::File(const char* fullpath, void* userdata) : path_(fullpath), userdata_(userdata)
+File::File(const char* fullpath, void* userdata) : File(fullpath, Host::current(), userdata){};
+
+File::File(const char* fullpath, sg_host_t host, void* userdata) : path_(fullpath), userdata_(userdata)
 {
   // this cannot fail because we get a xbt_die if the mountpoint does not exist
-  pimpl_           = simcall_file_open(fullpath, Host::current());
-  xbt_dynar_t info = simcall_file_get_info(pimpl_);
-  storage_type     = xbt_dynar_pop_as(info, char*);
-  storageId        = xbt_dynar_pop_as(info, char*);
-  mount_point      = xbt_dynar_pop_as(info, char*);
-  xbt_dynar_free(&info);
+  Storage* st                  = nullptr;
+  size_t longest_prefix_length = 0;
+  std::string path;
+  XBT_DEBUG("Search for storage name for '%s' on '%s'", fullpath, host->cname());
+
+  for (auto mnt : host->mountedStorages()) {
+    XBT_DEBUG("See '%s'", mnt.first.c_str());
+    mount_point = std::string(fullpath).substr(0, mnt.first.size());
+
+    if (mount_point == mnt.first && mnt.first.length() > longest_prefix_length) {
+      /* The current mount name is found in the full path and is bigger than the previous*/
+      longest_prefix_length = mnt.first.length();
+      st                    = mnt.second;
+    }
+  }
+  if (longest_prefix_length > 0) { /* Mount point found, split fullpath into mount_name and path+filename*/
+    mount_point = std::string(fullpath).substr(0, longest_prefix_length);
+    path        = std::string(fullpath).substr(longest_prefix_length, strlen(fullpath));
+  } else
+    xbt_die("Can't find mount point for '%s' on '%s'", fullpath, host->cname());
+
+  pimpl_       = simcall_file_open(mount_point.c_str(), path.c_str(), st);
+  host_        = host;
+  storage_type = st->type();
+  storageId    = st->name();
 }
 
-File::~File() {
-  //  Host::current()->extension<simgrid::MsgHostExt>()->file_descriptor_table->push_back(desc_id_);
-  simcall_file_close(pimpl_, Host::current());
+File::~File()
+{
+  simcall_file_close(pimpl_, host_);
 }
 
-sg_size_t File::read(sg_size_t size) {
+sg_size_t File::read(sg_size_t size)
+{
   return simcall_file_read(pimpl_, size, Host::current());
 }
-sg_size_t File::write(sg_size_t size) {
+
+sg_size_t File::write(sg_size_t size)
+{
   return simcall_file_write(pimpl_,size, Host::current());
 }
-sg_size_t File::size() {
+
+sg_size_t File::write(sg_size_t size, sg_host_t host)
+{
+  return simcall_file_write(pimpl_, size, host);
+}
+
+sg_size_t File::size()
+{
   return simcall_file_get_size(pimpl_);
 }
 
-void File::seek(sg_size_t pos) {
+void File::seek(sg_size_t pos)
+{
   simcall_file_seek(pimpl_,pos,SEEK_SET);
 }
-sg_size_t File::tell() {
+
+sg_size_t File::tell()
+{
   return simcall_file_tell(pimpl_);
 }
-void File::move(const char*fullpath) {
+
+void File::move(const char* fullpath)
+{
   simcall_file_move(pimpl_,fullpath);
 }
-void File::unlink() {
-  sg_host_t attached = Host::current(); // FIXME: we should check where this file is attached
-  simcall_file_unlink(pimpl_,attached);
+
+void File::unlink()
+{
+  simcall_file_unlink(pimpl_, Host::current());
+}
+
+void File::unlink(sg_host_t host)
+{
+  simcall_file_unlink(pimpl_, host);
 }
 
 }} // namespace simgrid::s4u
index 8ee524a..b131fe6 100644 (file)
@@ -160,6 +160,7 @@ void Host::routeTo(Host* dest, std::vector<Link*>* links, double* latency)
   for (surf::LinkImpl* l : linkImpls)
     links->push_back(&l->piface_);
 }
+
 /** @brief Just like Host::routeTo, but filling an array of link implementations */
 void Host::routeTo(Host* dest, std::vector<surf::LinkImpl*>* links, double* latency)
 {
@@ -172,24 +173,6 @@ void Host::routeTo(Host* dest, std::vector<surf::LinkImpl*>* links, double* late
   }
 }
 
-boost::unordered_map<std::string, Storage*> const& Host::mountedStorages() {
-  if (mounts == nullptr) {
-    mounts = new boost::unordered_map<std::string, Storage*> ();
-
-    xbt_dict_t dict = this->mountedStoragesAsDict();
-
-    xbt_dict_cursor_t cursor;
-    char *mountname;
-    char *storagename;
-    xbt_dict_foreach(dict, cursor, mountname, storagename) {
-      mounts->insert({mountname, Storage::byName(storagename)});
-    }
-    xbt_dict_free(&dict);
-  }
-
-  return *mounts;
-}
-
 /** Get the properties assigned to a host */
 xbt_dict_t Host::properties() {
   return simgrid::simix::kernelImmediate([this] {
@@ -198,13 +181,14 @@ xbt_dict_t Host::properties() {
 }
 
 /** Retrieve the property value (or nullptr if not set) */
-const char*Host::property(const char*key) {
+const char* Host::property(const char* key)
+{
   return this->pimpl_->getProperty(key);
 }
-void Host::setProperty(const char*key, const char *value){
-  simgrid::simix::kernelImmediate([this, key, value] {
-    this->pimpl_->setProperty(key, value);
-  });
+
+void Host::setProperty(const char* key, const char* value)
+{
+  simgrid::simix::kernelImmediate([this, key, value] { this->pimpl_->setProperty(key, value); });
 }
 
 /** Get the processes attached to the host */
@@ -247,22 +231,10 @@ int Host::pstate()
   return this->pimpl_cpu->getPState();
 }
 
-/**
- * \ingroup simix_storage_management
- * \brief Returns the list of storages mounted on an host.
- * \return a dict containing all storages mounted on the host
- */
-xbt_dict_t Host::mountedStoragesAsDict()
-{
-  return simgrid::simix::kernelImmediate([this] {
-    return this->pimpl_->getMountedStorageList();
-  });
-}
-
 /**
  * \ingroup simix_storage_management
  * \brief Returns the list of storages attached to an host.
- * \return a dict containing all storages attached to the host
+ * \return a vector containing all storages attached to the host
  */
 void Host::attachedStorages(std::vector<const char*>* storages)
 {
@@ -271,5 +243,16 @@ void Host::attachedStorages(std::vector<const char*>* storages)
   });
 }
 
+std::unordered_map<std::string, Storage*> const& Host::mountedStorages()
+{
+  if (mounts == nullptr) {
+    mounts = new std::unordered_map<std::string, Storage*>();
+    for (auto m : this->pimpl_->storage_) {
+      mounts->insert({m.first, &m.second->piface_});
+    }
+  }
+  return *mounts;
+}
+
 } // namespace simgrid
 } // namespace s4u
index 23c7e60..b1112a2 100644 (file)
@@ -4,12 +4,15 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "../surf/StorageImpl.hpp"
+#include "simgrid/s4u/Host.hpp"
 #include "simgrid/s4u/Storage.hpp"
 #include "simgrid/simix.hpp"
 #include <unordered_map>
 
 namespace simgrid {
 namespace s4u {
+
+//  attached_to_ = Host::by_name_or_null(pimpl->attach_);
 std::map<std::string, Storage*>* allStorages()
 {
   std::unordered_map<std::string, surf::StorageImpl*>* map = surf::StorageImpl::storagesMap();
@@ -33,9 +36,14 @@ const char* Storage::name()
   return pimpl_->cname();
 }
 
-const char* Storage::host()
+const char* Storage::type()
+{
+  return pimpl_->typeId_;
+}
+
+Host* Storage::host()
 {
-  return pimpl_->attach_;
+  return attached_to_;
 }
 
 sg_size_t Storage::sizeFree()
@@ -67,7 +75,7 @@ void Storage::setProperty(const char* key, char* value)
   xbt_dict_set(this->properties(), key, value, nullptr);
 }
 
-std::map<std::string, sg_size_t*>* Storage::content()
+std::map<std::string, sg_size_t>* Storage::content()
 {
   return simgrid::simix::kernelImmediate([this] { return pimpl_->getContent(); });
 }
index 52e1ab7..dd03b1f 100644 (file)
@@ -3,6 +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 <algorithm>
 #include <vector>
 
 #include "simgrid/host.h"
@@ -120,7 +121,15 @@ void sg_host_user_destroy(sg_host_t host) {
 
 // ========= storage related functions ============
 xbt_dict_t sg_host_get_mounted_storage_list(sg_host_t host){
-  return host->pimpl_->getMountedStorageList();
+  xbt_assert((host != nullptr), "Invalid parameters");
+  xbt_dict_t res = xbt_dict_new_homogeneous(nullptr);
+  for (auto elm : host->mountedStorages()) {
+    const char* mount_name = elm.first.c_str();
+    sg_storage_t storage   = elm.second;
+    xbt_dict_set(res, mount_name, (void*)storage->name(), nullptr);
+  }
+
+  return res;
 }
 
 xbt_dynar_t sg_host_get_attached_storage_list(sg_host_t host){
index 2c59aab..5af5070 100644 (file)
@@ -81,7 +81,8 @@ int SIMIX_process_has_pending_comms(smx_actor_t process) {
  */
 void SIMIX_process_cleanup(smx_actor_t process)
 {
-  XBT_DEBUG("Cleanup process %s (%p), waiting synchro %p", process->name.c_str(), process, process->waiting_synchro);
+  XBT_DEBUG("Cleanup process %s (%p), waiting synchro %p", process->name.c_str(), process,
+            process->waiting_synchro.get());
 
   process->finished = true;
   SIMIX_process_on_exit_runall(process);
@@ -93,26 +94,22 @@ void SIMIX_process_cleanup(smx_actor_t process)
   xbt_os_mutex_acquire(simix_global->mutex);
 
   /* cancel non-blocking communications */
-  smx_activity_t synchro = static_cast<smx_activity_t>(process->comms.front());
+  smx_activity_t synchro = process->comms.front();
   while (not process->comms.empty()) {
-    simgrid::kernel::activity::CommImpl* comm = static_cast<simgrid::kernel::activity::CommImpl*>(synchro);
+    simgrid::kernel::activity::CommImplPtr comm =
+        boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(synchro);
 
     /* make sure no one will finish the comm after this process is destroyed,
      * because src_proc or dst_proc would be an invalid pointer */
 
     if (comm->src_proc == process) {
-      XBT_DEBUG("Found an unfinished send comm %p (detached = %d), state %d, src = %p, dst = %p",
-          comm, comm->detached, (int)comm->state, comm->src_proc, comm->dst_proc);
+      XBT_DEBUG("Found an unfinished send comm %p (detached = %d), state %d, src = %p, dst = %p", comm.get(),
+                comm->detached, (int)comm->state, comm->src_proc, comm->dst_proc);
       comm->src_proc = nullptr;
 
-      /* I'm not supposed to destroy a detached comm from the sender side, */
-      if (comm->detached)
-        XBT_DEBUG("Don't destroy it since it's a detached comm and I'm the sender");
-      else
-        comm->unref();
     } else if (comm->dst_proc == process) {
-      XBT_DEBUG("Found an unfinished recv comm %p, state %d, src = %p, dst = %p",
-          comm, (int)comm->state, comm->src_proc, comm->dst_proc);
+      XBT_DEBUG("Found an unfinished recv comm %p, state %d, src = %p, dst = %p", comm.get(), (int)comm->state,
+                comm->src_proc, comm->dst_proc);
       comm->dst_proc = nullptr;
 
       if (comm->detached && comm->src_proc != nullptr) {
@@ -120,10 +117,10 @@ void SIMIX_process_cleanup(smx_actor_t process)
         comm->src_proc->comms.remove(comm);
       }
     } else {
-      xbt_die("Communication synchro %p is in my list but I'm not the sender nor the receiver", synchro);
+      xbt_die("Communication synchro %p is in my list but I'm not the sender nor the receiver", synchro.get());
     }
     process->comms.pop_front();
-    synchro = static_cast<smx_activity_t>(process->comms.front());
+    synchro = process->comms.front();
     comm->cancel();
   }
 
@@ -278,7 +275,7 @@ smx_actor_t SIMIX_process_create(const char* name, std::function<void()> code, v
   if (host->extension<simgrid::simix::Host>() == nullptr)
     host->extension_set<simgrid::simix::Host>(new simgrid::simix::Host());
 
-  /* Add the process to it's host process list */
+  /* Add the process to its host process list */
   xbt_swag_insert(process, host->extension<simgrid::simix::Host>()->process_list);
 
   XBT_DEBUG("Start context '%s'", process->name.c_str());
@@ -287,6 +284,7 @@ smx_actor_t SIMIX_process_create(const char* name, std::function<void()> code, v
   simix_global->process_list[process->pid] = process;
   XBT_DEBUG("Inserting %s(%s) in the to_run list", process->cname(), host->cname());
   xbt_dynar_push_as(simix_global->process_to_run, smx_actor_t, process);
+  intrusive_ptr_add_ref(process);
 
   /* Tracing the process creation */
   TRACE_msg_process_create(process->cname(), process->pid, process->host);
@@ -421,19 +419,20 @@ void SIMIX_process_kill(smx_actor_t process, smx_actor_t issuer) {
   process->exception = nullptr;
 
   /* destroy the blocking synchro if any */
-  if (process->waiting_synchro) {
-
-    simgrid::kernel::activity::ExecImpl* exec =
-        dynamic_cast<simgrid::kernel::activity::ExecImpl*>(process->waiting_synchro);
-    simgrid::kernel::activity::CommImpl* comm =
-        dynamic_cast<simgrid::kernel::activity::CommImpl*>(process->waiting_synchro);
-    simgrid::kernel::activity::SleepImpl* sleep =
-        dynamic_cast<simgrid::kernel::activity::SleepImpl*>(process->waiting_synchro);
-    simgrid::kernel::activity::Raw *raw = dynamic_cast<simgrid::kernel::activity::Raw*>(process->waiting_synchro);
-    simgrid::kernel::activity::Io *io = dynamic_cast<simgrid::kernel::activity::Io*>(process->waiting_synchro);
+  if (process->waiting_synchro != nullptr) {
+
+    simgrid::kernel::activity::ExecImplPtr exec =
+        boost::dynamic_pointer_cast<simgrid::kernel::activity::ExecImpl>(process->waiting_synchro);
+    simgrid::kernel::activity::CommImplPtr comm =
+        boost::dynamic_pointer_cast<simgrid::kernel::activity::CommImpl>(process->waiting_synchro);
+    simgrid::kernel::activity::SleepImplPtr sleep =
+        boost::dynamic_pointer_cast<simgrid::kernel::activity::SleepImpl>(process->waiting_synchro);
+    simgrid::kernel::activity::RawImplPtr raw =
+        boost::dynamic_pointer_cast<simgrid::kernel::activity::RawImpl>(process->waiting_synchro);
+    simgrid::kernel::activity::IoImplPtr io =
+        boost::dynamic_pointer_cast<simgrid::kernel::activity::IoImpl>(process->waiting_synchro);
 
     if (exec != nullptr) {
-      exec->unref();
 
     } else if (comm != nullptr) {
       process->comms.remove(process->waiting_synchro);
@@ -442,13 +441,11 @@ void SIMIX_process_kill(smx_actor_t process, smx_actor_t issuer) {
       auto i = boost::range::find(process->waiting_synchro->simcalls, &process->simcall);
       if (i != process->waiting_synchro->simcalls.end())
         process->waiting_synchro->simcalls.remove(&process->simcall);
-      comm->unref();
     } else if (sleep != nullptr) {
       SIMIX_process_sleep_destroy(process->waiting_synchro);
 
     } else if (raw != nullptr) {
       SIMIX_synchro_stop_waiting(process, &process->simcall);
-      delete process->waiting_synchro;
 
     } else if (io != nullptr) {
       SIMIX_io_destroy(process->waiting_synchro);
@@ -485,21 +482,21 @@ void SIMIX_process_throw(smx_actor_t process, xbt_errcat_t cat, int value, const
   /* cancel the blocking synchro if any */
   if (process->waiting_synchro) {
 
-    simgrid::kernel::activity::ExecImpl* exec =
-        dynamic_cast<simgrid::kernel::activity::ExecImpl*>(process->waiting_synchro);
+    simgrid::kernel::activity::ExecImplPtr exec =
+        boost::dynamic_pointer_cast<simgrid::kernel::activity::ExecImpl>(process->waiting_synchro);
     if (exec != nullptr) {
       SIMIX_execution_cancel(process->waiting_synchro);
     }
 
-    simgrid::kernel::activity::CommImpl* comm =
-        dynamic_cast<simgrid::kernel::activity::CommImpl*>(process->waiting_synchro);
+    simgrid::kernel::activity::CommImplPtr comm =
+        boost::dynamic_pointer_cast<simgrid::kernel::activity::CommImpl>(process->waiting_synchro);
     if (comm != nullptr) {
       process->comms.remove(comm);
       comm->cancel();
     }
 
-    simgrid::kernel::activity::SleepImpl* sleep =
-        dynamic_cast<simgrid::kernel::activity::SleepImpl*>(process->waiting_synchro);
+    simgrid::kernel::activity::SleepImplPtr sleep =
+        boost::dynamic_pointer_cast<simgrid::kernel::activity::SleepImpl>(process->waiting_synchro);
     if (sleep != nullptr) {
       SIMIX_process_sleep_destroy(process->waiting_synchro);
       if (not xbt_dynar_member(simix_global->process_to_run, &(process)) && process != SIMIX_process_self()) {
@@ -508,12 +505,14 @@ void SIMIX_process_throw(smx_actor_t process, xbt_errcat_t cat, int value, const
       }
     }
 
-    simgrid::kernel::activity::Raw *raw = dynamic_cast<simgrid::kernel::activity::Raw*>(process->waiting_synchro);
+    simgrid::kernel::activity::RawImplPtr raw =
+        boost::dynamic_pointer_cast<simgrid::kernel::activity::RawImpl>(process->waiting_synchro);
     if (raw != nullptr) {
       SIMIX_synchro_stop_waiting(process, &process->simcall);
     }
 
-    simgrid::kernel::activity::Io *io = dynamic_cast<simgrid::kernel::activity::Io*>(process->waiting_synchro);
+    simgrid::kernel::activity::IoImplPtr io =
+        boost::dynamic_pointer_cast<simgrid::kernel::activity::IoImpl>(process->waiting_synchro);
     if (io != nullptr) {
       SIMIX_io_destroy(process->waiting_synchro);
     }
@@ -694,7 +693,8 @@ void simcall_HANDLER_process_join(smx_simcall_t simcall, smx_actor_t process, do
   simcall->issuer->waiting_synchro = sync;
 }
 
-static int SIMIX_process_join_finish(smx_process_exit_status_t status, smx_activity_t synchro){
+static int SIMIX_process_join_finish(smx_process_exit_status_t status, void* synchro)
+{
   simgrid::kernel::activity::SleepImpl* sleep = static_cast<simgrid::kernel::activity::SleepImpl*>(synchro);
 
   if (sleep->surf_sleep) {
@@ -716,7 +716,6 @@ static int SIMIX_process_join_finish(smx_process_exit_status_t status, smx_activ
     sleep->surf_sleep->unref();
     sleep->surf_sleep = nullptr;
   }
-  sleep->unref();
   // intrusive_ptr_release(process); // FIXME: We are leaking here. See comment in SIMIX_process_join()
   return 0;
 }
@@ -724,14 +723,14 @@ static int SIMIX_process_join_finish(smx_process_exit_status_t status, smx_activ
 smx_activity_t SIMIX_process_join(smx_actor_t issuer, smx_actor_t process, double timeout)
 {
   smx_activity_t res = SIMIX_process_sleep(issuer, timeout);
-  static_cast<simgrid::kernel::activity::ActivityImpl*>(res)->ref();
+  intrusive_ptr_add_ref(res.get());
   /* We are leaking the process here, but if we don't take the ref, we get a "use after free".
    * The correct solution would be to derivate the type SynchroSleep into a SynchroProcessJoin,
    * but the code is not clean enough for now for this.
    * The C API should first be properly replaced with the C++ one, which is a fair amount of work.
    */
   intrusive_ptr_add_ref(process);
-  SIMIX_process_on_exit(process, (int_f_pvoid_pvoid_t)SIMIX_process_join_finish, res);
+  SIMIX_process_on_exit(process, (int_f_pvoid_pvoid_t)SIMIX_process_join_finish, &*res);
   return res;
 }
 
@@ -757,7 +756,7 @@ smx_activity_t SIMIX_process_sleep(smx_actor_t process, double duration)
 
   simgrid::kernel::activity::SleepImpl* synchro = new simgrid::kernel::activity::SleepImpl();
   synchro->host = host;
-  synchro->surf_sleep                       = host->pimpl_cpu->sleep(duration);
+  synchro->surf_sleep                           = host->pimpl_cpu->sleep(duration);
   synchro->surf_sleep->setData(synchro);
   XBT_DEBUG("Create sleep synchronization %p", synchro);
 
@@ -766,13 +765,13 @@ smx_activity_t SIMIX_process_sleep(smx_actor_t process, double duration)
 
 void SIMIX_process_sleep_destroy(smx_activity_t synchro)
 {
-  XBT_DEBUG("Destroy synchro %p", synchro);
-  simgrid::kernel::activity::SleepImpl* sleep = static_cast<simgrid::kernel::activity::SleepImpl*>(synchro);
+  XBT_DEBUG("Destroy sleep synchro %p", synchro.get());
+  simgrid::kernel::activity::SleepImplPtr sleep =
+      boost::dynamic_pointer_cast<simgrid::kernel::activity::SleepImpl>(synchro);
 
   if (sleep->surf_sleep) {
     sleep->surf_sleep->unref();
     sleep->surf_sleep = nullptr;
-    sleep->unref();
   }
 }
 
@@ -958,6 +957,7 @@ void SIMIX_segment_index_set(smx_actor_t proc, int index){
  * \param properties the properties of the process
  * \param auto_restart either it is autorestarting or not.
  */
+extern "C"
 smx_actor_t simcall_process_create(const char* name, xbt_main_func_t code, void* data, sg_host_t host, int argc,
                                    char** argv, xbt_dict_t properties)
 {
index 4a53a46..b15d40e 100644 (file)
@@ -70,7 +70,8 @@ public:
 
   /* Refcounting */
 private:
-  std::atomic_int_fast32_t refcount_{1};
+  std::atomic_int_fast32_t refcount_{0};
+
 public:
   friend void intrusive_ptr_add_ref(ActorImpl* process)
   {
@@ -131,17 +132,13 @@ XBT_PRIVATE void SIMIX_process_empty_trash();
 XBT_PRIVATE void SIMIX_process_yield(smx_actor_t self);
 XBT_PRIVATE void SIMIX_process_exception_terminate(xbt_ex_t * e);
 XBT_PRIVATE void SIMIX_process_change_host(smx_actor_t process, sg_host_t dest);
-XBT_PRIVATE smx_activity_t SIMIX_process_suspend(smx_actor_t process, smx_actor_t issuer);
 XBT_PRIVATE void SIMIX_process_resume(smx_actor_t process);
 XBT_PRIVATE int SIMIX_process_get_PID(smx_actor_t self);
 XBT_PRIVATE void SIMIX_process_set_data(smx_actor_t process, void *data);
 XBT_PRIVATE smx_actor_t SIMIX_process_get_by_name(const char* name);
 XBT_PRIVATE int SIMIX_process_is_suspended(smx_actor_t process);
 XBT_PRIVATE xbt_dict_t SIMIX_process_get_properties(smx_actor_t process);
-XBT_PRIVATE smx_activity_t SIMIX_process_join(smx_actor_t issuer, smx_actor_t process, double timeout);
-XBT_PRIVATE smx_activity_t SIMIX_process_sleep(smx_actor_t process, double duration);
 
-XBT_PRIVATE void SIMIX_process_sleep_destroy(smx_activity_t synchro);
 XBT_PRIVATE void SIMIX_process_auto_restart_set(smx_actor_t process, int auto_restart);
 XBT_PRIVATE smx_actor_t SIMIX_process_restart(smx_actor_t process, smx_actor_t issuer);
 
@@ -150,4 +147,9 @@ extern void (*SMPI_switch_data_segment)(int dest);
 
 SG_END_DECL()
 
+XBT_PRIVATE void SIMIX_process_sleep_destroy(smx_activity_t synchro);
+XBT_PRIVATE smx_activity_t SIMIX_process_suspend(smx_actor_t process, smx_actor_t issuer);
+XBT_PRIVATE smx_activity_t SIMIX_process_join(smx_actor_t issuer, smx_actor_t process, double timeout);
+XBT_PRIVATE smx_activity_t SIMIX_process_sleep(smx_actor_t process, double duration);
+
 #endif
index ddb760a..96cd223 100644 (file)
@@ -459,7 +459,8 @@ smx_activity_t simcall_comm_iprobe(smx_mailbox_t mbox, int type, int src, int ta
 void simcall_comm_cancel(smx_activity_t synchro)
 {
   simgrid::simix::kernelImmediate([synchro] {
-    simgrid::kernel::activity::CommImpl* comm = static_cast<simgrid::kernel::activity::CommImpl*>(synchro);
+    simgrid::kernel::activity::CommImplPtr comm =
+        boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(synchro);
     comm->cancel();
   });
 }
@@ -680,9 +681,9 @@ sg_size_t simcall_file_write(smx_file_t fd, sg_size_t size, sg_host_t host)
  * \ingroup simix_file_management
  * \brief
  */
-smx_file_t simcall_file_open(const char* fullpath, sg_host_t host)
+smx_file_t simcall_file_open(const char* mount, const char* path, sg_storage_t st)
 {
-  return simcall_BODY_file_open(fullpath, host);
+  return simcall_BODY_file_open(mount, path, st);
 }
 
 /**
@@ -719,15 +720,6 @@ sg_size_t simcall_file_tell(smx_file_t fd){
   return simcall_BODY_file_tell(fd);
 }
 
-/**
- * \ingroup simix_file_management
- *
- */
-xbt_dynar_t simcall_file_get_info(smx_file_t fd)
-{
-  return simcall_BODY_file_get_info(fd);
-}
-
 /**
  * \ingroup simix_file_management
  *
index fed1099..1b5db25 100644 (file)
 static inline smx_actor_t simcall_process_kill__get__process(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
 }
+static inline smx_actor_t simcall_process_kill__getraw__process(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->args[0]);
+}
 static inline void simcall_process_kill__set__process(smx_simcall_t simcall, smx_actor_t arg) {
     simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
 }
@@ -25,6 +29,10 @@ static inline void simcall_process_kill__set__process(smx_simcall_t simcall, smx
 static inline int simcall_process_killall__get__reset_pid(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<int>(simcall->args[0]);
 }
+static inline int simcall_process_killall__getraw__reset_pid(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<int>(simcall->args[0]);
+}
 static inline void simcall_process_killall__set__reset_pid(smx_simcall_t simcall, int arg) {
     simgrid::simix::marshal<int>(simcall->args[0], arg);
 }
@@ -32,6 +40,10 @@ static inline void simcall_process_killall__set__reset_pid(smx_simcall_t simcall
 static inline smx_actor_t simcall_process_cleanup__get__process(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
 }
+static inline smx_actor_t simcall_process_cleanup__getraw__process(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->args[0]);
+}
 static inline void simcall_process_cleanup__set__process(smx_simcall_t simcall, smx_actor_t arg) {
     simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
 }
@@ -39,6 +51,10 @@ static inline void simcall_process_cleanup__set__process(smx_simcall_t simcall,
 static inline smx_actor_t simcall_process_suspend__get__process(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
 }
+static inline smx_actor_t simcall_process_suspend__getraw__process(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->args[0]);
+}
 static inline void simcall_process_suspend__set__process(smx_simcall_t simcall, smx_actor_t arg) {
     simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
 }
@@ -46,6 +62,10 @@ static inline void simcall_process_suspend__set__process(smx_simcall_t simcall,
 static inline smx_actor_t simcall_process_resume__get__process(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
 }
+static inline smx_actor_t simcall_process_resume__getraw__process(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->args[0]);
+}
 static inline void simcall_process_resume__set__process(smx_simcall_t simcall, smx_actor_t arg) {
     simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
 }
@@ -53,12 +73,20 @@ static inline void simcall_process_resume__set__process(smx_simcall_t simcall, s
 static inline smx_actor_t simcall_process_set_host__get__process(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
 }
+static inline smx_actor_t simcall_process_set_host__getraw__process(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->args[0]);
+}
 static inline void simcall_process_set_host__set__process(smx_simcall_t simcall, smx_actor_t arg) {
     simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
 }
 static inline sg_host_t simcall_process_set_host__get__dest(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<sg_host_t>(simcall->args[1]);
 }
+static inline sg_host_t simcall_process_set_host__getraw__dest(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<sg_host_t>(simcall->args[1]);
+}
 static inline void simcall_process_set_host__set__dest(smx_simcall_t simcall, sg_host_t arg) {
     simgrid::simix::marshal<sg_host_t>(simcall->args[1], arg);
 }
@@ -66,12 +94,20 @@ static inline void simcall_process_set_host__set__dest(smx_simcall_t simcall, sg
 static inline smx_actor_t simcall_process_is_suspended__get__process(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
 }
+static inline smx_actor_t simcall_process_is_suspended__getraw__process(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->args[0]);
+}
 static inline void simcall_process_is_suspended__set__process(smx_simcall_t simcall, smx_actor_t arg) {
     simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
 }
 static inline int simcall_process_is_suspended__get__result(smx_simcall_t simcall){
     return simgrid::simix::unmarshal<int>(simcall->result);
 }
+static inline int simcall_process_is_suspended__getraw__result(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<int>(simcall->result);
+}
 static inline void simcall_process_is_suspended__set__result(smx_simcall_t simcall, int result){
     simgrid::simix::marshal<int>(simcall->result, result);
 }
@@ -79,18 +115,30 @@ static inline void simcall_process_is_suspended__set__result(smx_simcall_t simca
 static inline smx_actor_t simcall_process_join__get__process(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
 }
+static inline smx_actor_t simcall_process_join__getraw__process(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->args[0]);
+}
 static inline void simcall_process_join__set__process(smx_simcall_t simcall, smx_actor_t arg) {
     simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
 }
 static inline double simcall_process_join__get__timeout(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<double>(simcall->args[1]);
 }
+static inline double simcall_process_join__getraw__timeout(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<double>(simcall->args[1]);
+}
 static inline void simcall_process_join__set__timeout(smx_simcall_t simcall, double arg) {
     simgrid::simix::marshal<double>(simcall->args[1], arg);
 }
 static inline int simcall_process_join__get__result(smx_simcall_t simcall){
     return simgrid::simix::unmarshal<int>(simcall->result);
 }
+static inline int simcall_process_join__getraw__result(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<int>(simcall->result);
+}
 static inline void simcall_process_join__set__result(smx_simcall_t simcall, int result){
     simgrid::simix::marshal<int>(simcall->result, result);
 }
@@ -98,12 +146,20 @@ static inline void simcall_process_join__set__result(smx_simcall_t simcall, int
 static inline double simcall_process_sleep__get__duration(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<double>(simcall->args[0]);
 }
+static inline double simcall_process_sleep__getraw__duration(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<double>(simcall->args[0]);
+}
 static inline void simcall_process_sleep__set__duration(smx_simcall_t simcall, double arg) {
     simgrid::simix::marshal<double>(simcall->args[0], arg);
 }
 static inline int simcall_process_sleep__get__result(smx_simcall_t simcall){
     return simgrid::simix::unmarshal<int>(simcall->result);
 }
+static inline int simcall_process_sleep__getraw__result(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<int>(simcall->result);
+}
 static inline void simcall_process_sleep__set__result(smx_simcall_t simcall, int result){
     simgrid::simix::marshal<int>(simcall->result, result);
 }
@@ -111,131 +167,249 @@ static inline void simcall_process_sleep__set__result(smx_simcall_t simcall, int
 static inline const char* simcall_execution_start__get__name(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<const char*>(simcall->args[0]);
 }
+static inline const char* simcall_execution_start__getraw__name(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<const char*>(simcall->args[0]);
+}
 static inline void simcall_execution_start__set__name(smx_simcall_t simcall, const char* arg) {
     simgrid::simix::marshal<const char*>(simcall->args[0], arg);
 }
 static inline double simcall_execution_start__get__flops_amount(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<double>(simcall->args[1]);
 }
+static inline double simcall_execution_start__getraw__flops_amount(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<double>(simcall->args[1]);
+}
 static inline void simcall_execution_start__set__flops_amount(smx_simcall_t simcall, double arg) {
     simgrid::simix::marshal<double>(simcall->args[1], arg);
 }
 static inline double simcall_execution_start__get__priority(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<double>(simcall->args[2]);
 }
+static inline double simcall_execution_start__getraw__priority(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<double>(simcall->args[2]);
+}
 static inline void simcall_execution_start__set__priority(smx_simcall_t simcall, double arg) {
     simgrid::simix::marshal<double>(simcall->args[2], arg);
 }
 static inline double simcall_execution_start__get__bound(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<double>(simcall->args[3]);
 }
+static inline double simcall_execution_start__getraw__bound(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<double>(simcall->args[3]);
+}
 static inline void simcall_execution_start__set__bound(smx_simcall_t simcall, double arg) {
     simgrid::simix::marshal<double>(simcall->args[3], arg);
 }
-static inline smx_activity_t simcall_execution_start__get__result(smx_simcall_t simcall){
-    return simgrid::simix::unmarshal<smx_activity_t>(simcall->result);
+static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
+simcall_execution_start__get__result(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->result);
+}
+static inline simgrid::kernel::activity::ActivityImpl* simcall_execution_start__getraw__result(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ActivityImpl*>(simcall->result);
 }
-static inline void simcall_execution_start__set__result(smx_simcall_t simcall, smx_activity_t result){
-    simgrid::simix::marshal<smx_activity_t>(simcall->result, result);
+static inline void
+simcall_execution_start__set__result(smx_simcall_t simcall,
+                                     boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> result)
+{
+  simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->result, result);
 }
 
 static inline const char* simcall_execution_parallel_start__get__name(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<const char*>(simcall->args[0]);
 }
+static inline const char* simcall_execution_parallel_start__getraw__name(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<const char*>(simcall->args[0]);
+}
 static inline void simcall_execution_parallel_start__set__name(smx_simcall_t simcall, const char* arg) {
     simgrid::simix::marshal<const char*>(simcall->args[0], arg);
 }
 static inline int simcall_execution_parallel_start__get__host_nb(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<int>(simcall->args[1]);
 }
+static inline int simcall_execution_parallel_start__getraw__host_nb(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<int>(simcall->args[1]);
+}
 static inline void simcall_execution_parallel_start__set__host_nb(smx_simcall_t simcall, int arg) {
     simgrid::simix::marshal<int>(simcall->args[1], arg);
 }
 static inline sg_host_t* simcall_execution_parallel_start__get__host_list(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<sg_host_t*>(simcall->args[2]);
 }
+static inline sg_host_t* simcall_execution_parallel_start__getraw__host_list(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<sg_host_t*>(simcall->args[2]);
+}
 static inline void simcall_execution_parallel_start__set__host_list(smx_simcall_t simcall, sg_host_t* arg) {
     simgrid::simix::marshal<sg_host_t*>(simcall->args[2], arg);
 }
 static inline double* simcall_execution_parallel_start__get__flops_amount(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<double*>(simcall->args[3]);
 }
+static inline double* simcall_execution_parallel_start__getraw__flops_amount(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<double*>(simcall->args[3]);
+}
 static inline void simcall_execution_parallel_start__set__flops_amount(smx_simcall_t simcall, double* arg) {
     simgrid::simix::marshal<double*>(simcall->args[3], arg);
 }
 static inline double* simcall_execution_parallel_start__get__bytes_amount(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<double*>(simcall->args[4]);
 }
+static inline double* simcall_execution_parallel_start__getraw__bytes_amount(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<double*>(simcall->args[4]);
+}
 static inline void simcall_execution_parallel_start__set__bytes_amount(smx_simcall_t simcall, double* arg) {
     simgrid::simix::marshal<double*>(simcall->args[4], arg);
 }
 static inline double simcall_execution_parallel_start__get__amount(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<double>(simcall->args[5]);
 }
+static inline double simcall_execution_parallel_start__getraw__amount(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<double>(simcall->args[5]);
+}
 static inline void simcall_execution_parallel_start__set__amount(smx_simcall_t simcall, double arg) {
     simgrid::simix::marshal<double>(simcall->args[5], arg);
 }
 static inline double simcall_execution_parallel_start__get__rate(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<double>(simcall->args[6]);
 }
+static inline double simcall_execution_parallel_start__getraw__rate(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<double>(simcall->args[6]);
+}
 static inline void simcall_execution_parallel_start__set__rate(smx_simcall_t simcall, double arg) {
     simgrid::simix::marshal<double>(simcall->args[6], arg);
 }
 static inline double simcall_execution_parallel_start__get__timeout(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<double>(simcall->args[7]);
 }
+static inline double simcall_execution_parallel_start__getraw__timeout(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<double>(simcall->args[7]);
+}
 static inline void simcall_execution_parallel_start__set__timeout(smx_simcall_t simcall, double arg) {
     simgrid::simix::marshal<double>(simcall->args[7], arg);
 }
-static inline smx_activity_t simcall_execution_parallel_start__get__result(smx_simcall_t simcall){
-    return simgrid::simix::unmarshal<smx_activity_t>(simcall->result);
+static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
+simcall_execution_parallel_start__get__result(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->result);
 }
-static inline void simcall_execution_parallel_start__set__result(smx_simcall_t simcall, smx_activity_t result){
-    simgrid::simix::marshal<smx_activity_t>(simcall->result, result);
+static inline simgrid::kernel::activity::ActivityImpl*
+simcall_execution_parallel_start__getraw__result(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ActivityImpl*>(simcall->result);
 }
-
-static inline smx_activity_t simcall_execution_cancel__get__execution(smx_simcall_t simcall) {
-  return simgrid::simix::unmarshal<smx_activity_t>(simcall->args[0]);
-}
-static inline void simcall_execution_cancel__set__execution(smx_simcall_t simcall, smx_activity_t arg) {
-    simgrid::simix::marshal<smx_activity_t>(simcall->args[0], arg);
+static inline void
+simcall_execution_parallel_start__set__result(smx_simcall_t simcall,
+                                              boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> result)
+{
+  simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->result, result);
 }
 
-static inline smx_activity_t simcall_execution_set_priority__get__execution(smx_simcall_t simcall) {
-  return simgrid::simix::unmarshal<smx_activity_t>(simcall->args[0]);
+static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
+simcall_execution_cancel__get__execution(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]);
+}
+static inline simgrid::kernel::activity::ActivityImpl*
+simcall_execution_cancel__getraw__execution(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ActivityImpl*>(simcall->args[0]);
+}
+static inline void
+simcall_execution_cancel__set__execution(smx_simcall_t simcall,
+                                         boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> arg)
+{
+  simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0], arg);
 }
-static inline void simcall_execution_set_priority__set__execution(smx_simcall_t simcall, smx_activity_t arg) {
-    simgrid::simix::marshal<smx_activity_t>(simcall->args[0], arg);
+
+static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
+simcall_execution_set_priority__get__execution(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]);
+}
+static inline simgrid::kernel::activity::ActivityImpl*
+simcall_execution_set_priority__getraw__execution(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ActivityImpl*>(simcall->args[0]);
+}
+static inline void
+simcall_execution_set_priority__set__execution(smx_simcall_t simcall,
+                                               boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> arg)
+{
+  simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0], arg);
 }
 static inline double simcall_execution_set_priority__get__priority(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<double>(simcall->args[1]);
 }
+static inline double simcall_execution_set_priority__getraw__priority(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<double>(simcall->args[1]);
+}
 static inline void simcall_execution_set_priority__set__priority(smx_simcall_t simcall, double arg) {
     simgrid::simix::marshal<double>(simcall->args[1], arg);
 }
 
-static inline smx_activity_t simcall_execution_set_bound__get__execution(smx_simcall_t simcall) {
-  return simgrid::simix::unmarshal<smx_activity_t>(simcall->args[0]);
-}
-static inline void simcall_execution_set_bound__set__execution(smx_simcall_t simcall, smx_activity_t arg) {
-    simgrid::simix::marshal<smx_activity_t>(simcall->args[0], arg);
+static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
+simcall_execution_set_bound__get__execution(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]);
+}
+static inline simgrid::kernel::activity::ActivityImpl*
+simcall_execution_set_bound__getraw__execution(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ActivityImpl*>(simcall->args[0]);
+}
+static inline void
+simcall_execution_set_bound__set__execution(smx_simcall_t simcall,
+                                            boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> arg)
+{
+  simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0], arg);
 }
 static inline double simcall_execution_set_bound__get__bound(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<double>(simcall->args[1]);
 }
+static inline double simcall_execution_set_bound__getraw__bound(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<double>(simcall->args[1]);
+}
 static inline void simcall_execution_set_bound__set__bound(smx_simcall_t simcall, double arg) {
     simgrid::simix::marshal<double>(simcall->args[1], arg);
 }
 
-static inline smx_activity_t simcall_execution_wait__get__execution(smx_simcall_t simcall) {
-  return simgrid::simix::unmarshal<smx_activity_t>(simcall->args[0]);
+static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
+simcall_execution_wait__get__execution(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]);
 }
-static inline void simcall_execution_wait__set__execution(smx_simcall_t simcall, smx_activity_t arg) {
-    simgrid::simix::marshal<smx_activity_t>(simcall->args[0], arg);
+static inline simgrid::kernel::activity::ActivityImpl* simcall_execution_wait__getraw__execution(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ActivityImpl*>(simcall->args[0]);
+}
+static inline void
+simcall_execution_wait__set__execution(smx_simcall_t simcall,
+                                       boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> arg)
+{
+  simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0], arg);
 }
 static inline int simcall_execution_wait__get__result(smx_simcall_t simcall){
     return simgrid::simix::unmarshal<int>(simcall->result);
 }
+static inline int simcall_execution_wait__getraw__result(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<int>(simcall->result);
+}
 static inline void simcall_execution_wait__set__result(smx_simcall_t simcall, int result){
     simgrid::simix::marshal<int>(simcall->result, result);
 }
@@ -243,18 +417,30 @@ static inline void simcall_execution_wait__set__result(smx_simcall_t simcall, in
 static inline smx_actor_t simcall_process_on_exit__get__process(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
 }
+static inline smx_actor_t simcall_process_on_exit__getraw__process(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->args[0]);
+}
 static inline void simcall_process_on_exit__set__process(smx_simcall_t simcall, smx_actor_t arg) {
     simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
 }
 static inline int_f_pvoid_pvoid_t simcall_process_on_exit__get__fun(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<int_f_pvoid_pvoid_t>(simcall->args[1]);
 }
+static inline int_f_pvoid_pvoid_t simcall_process_on_exit__getraw__fun(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<int_f_pvoid_pvoid_t>(simcall->args[1]);
+}
 static inline void simcall_process_on_exit__set__fun(smx_simcall_t simcall, int_f_pvoid_pvoid_t arg) {
     simgrid::simix::marshal<int_f_pvoid_pvoid_t>(simcall->args[1], arg);
 }
 static inline void* simcall_process_on_exit__get__data(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<void*>(simcall->args[2]);
 }
+static inline void* simcall_process_on_exit__getraw__data(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<void*>(simcall->args[2]);
+}
 static inline void simcall_process_on_exit__set__data(smx_simcall_t simcall, void* arg) {
     simgrid::simix::marshal<void*>(simcall->args[2], arg);
 }
@@ -262,12 +448,20 @@ static inline void simcall_process_on_exit__set__data(smx_simcall_t simcall, voi
 static inline smx_actor_t simcall_process_auto_restart_set__get__process(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
 }
+static inline smx_actor_t simcall_process_auto_restart_set__getraw__process(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->args[0]);
+}
 static inline void simcall_process_auto_restart_set__set__process(smx_simcall_t simcall, smx_actor_t arg) {
     simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
 }
 static inline int simcall_process_auto_restart_set__get__auto_restart(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<int>(simcall->args[1]);
 }
+static inline int simcall_process_auto_restart_set__getraw__auto_restart(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<int>(simcall->args[1]);
+}
 static inline void simcall_process_auto_restart_set__set__auto_restart(smx_simcall_t simcall, int arg) {
     simgrid::simix::marshal<int>(simcall->args[1], arg);
 }
@@ -275,12 +469,20 @@ static inline void simcall_process_auto_restart_set__set__auto_restart(smx_simca
 static inline smx_actor_t simcall_process_restart__get__process(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
 }
+static inline smx_actor_t simcall_process_restart__getraw__process(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->args[0]);
+}
 static inline void simcall_process_restart__set__process(smx_simcall_t simcall, smx_actor_t arg) {
     simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
 }
 static inline smx_actor_t simcall_process_restart__get__result(smx_simcall_t simcall){
     return simgrid::simix::unmarshal<smx_actor_t>(simcall->result);
 }
+static inline smx_actor_t simcall_process_restart__getraw__result(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->result);
+}
 static inline void simcall_process_restart__set__result(smx_simcall_t simcall, smx_actor_t result){
     simgrid::simix::marshal<smx_actor_t>(simcall->result, result);
 }
@@ -288,103 +490,176 @@ static inline void simcall_process_restart__set__result(smx_simcall_t simcall, s
 static inline smx_mailbox_t simcall_comm_iprobe__get__mbox(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[0]);
 }
+static inline smx_mailbox_t simcall_comm_iprobe__getraw__mbox(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<smx_mailbox_t>(simcall->args[0]);
+}
 static inline void simcall_comm_iprobe__set__mbox(smx_simcall_t simcall, smx_mailbox_t arg) {
     simgrid::simix::marshal<smx_mailbox_t>(simcall->args[0], arg);
 }
 static inline int simcall_comm_iprobe__get__type(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<int>(simcall->args[1]);
 }
+static inline int simcall_comm_iprobe__getraw__type(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<int>(simcall->args[1]);
+}
 static inline void simcall_comm_iprobe__set__type(smx_simcall_t simcall, int arg) {
     simgrid::simix::marshal<int>(simcall->args[1], arg);
 }
 static inline int simcall_comm_iprobe__get__src(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<int>(simcall->args[2]);
 }
+static inline int simcall_comm_iprobe__getraw__src(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<int>(simcall->args[2]);
+}
 static inline void simcall_comm_iprobe__set__src(smx_simcall_t simcall, int arg) {
     simgrid::simix::marshal<int>(simcall->args[2], arg);
 }
 static inline int simcall_comm_iprobe__get__tag(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<int>(simcall->args[3]);
 }
+static inline int simcall_comm_iprobe__getraw__tag(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<int>(simcall->args[3]);
+}
 static inline void simcall_comm_iprobe__set__tag(smx_simcall_t simcall, int arg) {
     simgrid::simix::marshal<int>(simcall->args[3], arg);
 }
 static inline simix_match_func_t simcall_comm_iprobe__get__match_fun(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[4]);
 }
+static inline simix_match_func_t simcall_comm_iprobe__getraw__match_fun(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<simix_match_func_t>(simcall->args[4]);
+}
 static inline void simcall_comm_iprobe__set__match_fun(smx_simcall_t simcall, simix_match_func_t arg) {
     simgrid::simix::marshal<simix_match_func_t>(simcall->args[4], arg);
 }
 static inline void* simcall_comm_iprobe__get__data(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<void*>(simcall->args[5]);
 }
+static inline void* simcall_comm_iprobe__getraw__data(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<void*>(simcall->args[5]);
+}
 static inline void simcall_comm_iprobe__set__data(smx_simcall_t simcall, void* arg) {
     simgrid::simix::marshal<void*>(simcall->args[5], arg);
 }
-static inline smx_activity_t simcall_comm_iprobe__get__result(smx_simcall_t simcall){
-    return simgrid::simix::unmarshal<smx_activity_t>(simcall->result);
+static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
+simcall_comm_iprobe__get__result(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->result);
+}
+static inline simgrid::kernel::activity::ActivityImpl* simcall_comm_iprobe__getraw__result(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ActivityImpl*>(simcall->result);
 }
-static inline void simcall_comm_iprobe__set__result(smx_simcall_t simcall, smx_activity_t result){
-    simgrid::simix::marshal<smx_activity_t>(simcall->result, result);
+static inline void
+simcall_comm_iprobe__set__result(smx_simcall_t simcall,
+                                 boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> result)
+{
+  simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->result, result);
 }
 
 static inline smx_actor_t simcall_comm_send__get__sender(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
 }
+static inline smx_actor_t simcall_comm_send__getraw__sender(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->args[0]);
+}
 static inline void simcall_comm_send__set__sender(smx_simcall_t simcall, smx_actor_t arg) {
     simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
 }
 static inline smx_mailbox_t simcall_comm_send__get__mbox(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]);
 }
+static inline smx_mailbox_t simcall_comm_send__getraw__mbox(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<smx_mailbox_t>(simcall->args[1]);
+}
 static inline void simcall_comm_send__set__mbox(smx_simcall_t simcall, smx_mailbox_t arg) {
     simgrid::simix::marshal<smx_mailbox_t>(simcall->args[1], arg);
 }
 static inline double simcall_comm_send__get__task_size(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<double>(simcall->args[2]);
 }
+static inline double simcall_comm_send__getraw__task_size(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<double>(simcall->args[2]);
+}
 static inline void simcall_comm_send__set__task_size(smx_simcall_t simcall, double arg) {
     simgrid::simix::marshal<double>(simcall->args[2], arg);
 }
 static inline double simcall_comm_send__get__rate(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<double>(simcall->args[3]);
 }
+static inline double simcall_comm_send__getraw__rate(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<double>(simcall->args[3]);
+}
 static inline void simcall_comm_send__set__rate(smx_simcall_t simcall, double arg) {
     simgrid::simix::marshal<double>(simcall->args[3], arg);
 }
 static inline void* simcall_comm_send__get__src_buff(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<void*>(simcall->args[4]);
 }
+static inline void* simcall_comm_send__getraw__src_buff(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<void*>(simcall->args[4]);
+}
 static inline void simcall_comm_send__set__src_buff(smx_simcall_t simcall, void* arg) {
     simgrid::simix::marshal<void*>(simcall->args[4], arg);
 }
 static inline size_t simcall_comm_send__get__src_buff_size(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<size_t>(simcall->args[5]);
 }
+static inline size_t simcall_comm_send__getraw__src_buff_size(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<size_t>(simcall->args[5]);
+}
 static inline void simcall_comm_send__set__src_buff_size(smx_simcall_t simcall, size_t arg) {
     simgrid::simix::marshal<size_t>(simcall->args[5], arg);
 }
 static inline simix_match_func_t simcall_comm_send__get__match_fun(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[6]);
 }
+static inline simix_match_func_t simcall_comm_send__getraw__match_fun(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<simix_match_func_t>(simcall->args[6]);
+}
 static inline void simcall_comm_send__set__match_fun(smx_simcall_t simcall, simix_match_func_t arg) {
     simgrid::simix::marshal<simix_match_func_t>(simcall->args[6], arg);
 }
 static inline simix_copy_data_func_t simcall_comm_send__get__copy_data_fun(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args[7]);
 }
+static inline simix_copy_data_func_t simcall_comm_send__getraw__copy_data_fun(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<simix_copy_data_func_t>(simcall->args[7]);
+}
 static inline void simcall_comm_send__set__copy_data_fun(smx_simcall_t simcall, simix_copy_data_func_t arg) {
     simgrid::simix::marshal<simix_copy_data_func_t>(simcall->args[7], arg);
 }
 static inline void* simcall_comm_send__get__data(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<void*>(simcall->args[8]);
 }
+static inline void* simcall_comm_send__getraw__data(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<void*>(simcall->args[8]);
+}
 static inline void simcall_comm_send__set__data(smx_simcall_t simcall, void* arg) {
     simgrid::simix::marshal<void*>(simcall->args[8], arg);
 }
 static inline double simcall_comm_send__get__timeout(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<double>(simcall->args[9]);
 }
+static inline double simcall_comm_send__getraw__timeout(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<double>(simcall->args[9]);
+}
 static inline void simcall_comm_send__set__timeout(smx_simcall_t simcall, double arg) {
     simgrid::simix::marshal<double>(simcall->args[9], arg);
 }
@@ -392,127 +667,215 @@ static inline void simcall_comm_send__set__timeout(smx_simcall_t simcall, double
 static inline smx_actor_t simcall_comm_isend__get__sender(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
 }
+static inline smx_actor_t simcall_comm_isend__getraw__sender(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->args[0]);
+}
 static inline void simcall_comm_isend__set__sender(smx_simcall_t simcall, smx_actor_t arg) {
     simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
 }
 static inline smx_mailbox_t simcall_comm_isend__get__mbox(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]);
 }
+static inline smx_mailbox_t simcall_comm_isend__getraw__mbox(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<smx_mailbox_t>(simcall->args[1]);
+}
 static inline void simcall_comm_isend__set__mbox(smx_simcall_t simcall, smx_mailbox_t arg) {
     simgrid::simix::marshal<smx_mailbox_t>(simcall->args[1], arg);
 }
 static inline double simcall_comm_isend__get__task_size(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<double>(simcall->args[2]);
 }
+static inline double simcall_comm_isend__getraw__task_size(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<double>(simcall->args[2]);
+}
 static inline void simcall_comm_isend__set__task_size(smx_simcall_t simcall, double arg) {
     simgrid::simix::marshal<double>(simcall->args[2], arg);
 }
 static inline double simcall_comm_isend__get__rate(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<double>(simcall->args[3]);
 }
+static inline double simcall_comm_isend__getraw__rate(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<double>(simcall->args[3]);
+}
 static inline void simcall_comm_isend__set__rate(smx_simcall_t simcall, double arg) {
     simgrid::simix::marshal<double>(simcall->args[3], arg);
 }
 static inline void* simcall_comm_isend__get__src_buff(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<void*>(simcall->args[4]);
 }
+static inline void* simcall_comm_isend__getraw__src_buff(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<void*>(simcall->args[4]);
+}
 static inline void simcall_comm_isend__set__src_buff(smx_simcall_t simcall, void* arg) {
     simgrid::simix::marshal<void*>(simcall->args[4], arg);
 }
 static inline size_t simcall_comm_isend__get__src_buff_size(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<size_t>(simcall->args[5]);
 }
+static inline size_t simcall_comm_isend__getraw__src_buff_size(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<size_t>(simcall->args[5]);
+}
 static inline void simcall_comm_isend__set__src_buff_size(smx_simcall_t simcall, size_t arg) {
     simgrid::simix::marshal<size_t>(simcall->args[5], arg);
 }
 static inline simix_match_func_t simcall_comm_isend__get__match_fun(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[6]);
 }
+static inline simix_match_func_t simcall_comm_isend__getraw__match_fun(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<simix_match_func_t>(simcall->args[6]);
+}
 static inline void simcall_comm_isend__set__match_fun(smx_simcall_t simcall, simix_match_func_t arg) {
     simgrid::simix::marshal<simix_match_func_t>(simcall->args[6], arg);
 }
 static inline simix_clean_func_t simcall_comm_isend__get__clean_fun(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<simix_clean_func_t>(simcall->args[7]);
 }
+static inline simix_clean_func_t simcall_comm_isend__getraw__clean_fun(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<simix_clean_func_t>(simcall->args[7]);
+}
 static inline void simcall_comm_isend__set__clean_fun(smx_simcall_t simcall, simix_clean_func_t arg) {
     simgrid::simix::marshal<simix_clean_func_t>(simcall->args[7], arg);
 }
 static inline simix_copy_data_func_t simcall_comm_isend__get__copy_data_fun(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args[8]);
 }
+static inline simix_copy_data_func_t simcall_comm_isend__getraw__copy_data_fun(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<simix_copy_data_func_t>(simcall->args[8]);
+}
 static inline void simcall_comm_isend__set__copy_data_fun(smx_simcall_t simcall, simix_copy_data_func_t arg) {
     simgrid::simix::marshal<simix_copy_data_func_t>(simcall->args[8], arg);
 }
 static inline void* simcall_comm_isend__get__data(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<void*>(simcall->args[9]);
 }
+static inline void* simcall_comm_isend__getraw__data(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<void*>(simcall->args[9]);
+}
 static inline void simcall_comm_isend__set__data(smx_simcall_t simcall, void* arg) {
     simgrid::simix::marshal<void*>(simcall->args[9], arg);
 }
 static inline int simcall_comm_isend__get__detached(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<int>(simcall->args[10]);
 }
+static inline int simcall_comm_isend__getraw__detached(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<int>(simcall->args[10]);
+}
 static inline void simcall_comm_isend__set__detached(smx_simcall_t simcall, int arg) {
     simgrid::simix::marshal<int>(simcall->args[10], arg);
 }
-static inline smx_activity_t simcall_comm_isend__get__result(smx_simcall_t simcall){
-    return simgrid::simix::unmarshal<smx_activity_t>(simcall->result);
+static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
+simcall_comm_isend__get__result(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->result);
+}
+static inline simgrid::kernel::activity::ActivityImpl* simcall_comm_isend__getraw__result(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ActivityImpl*>(simcall->result);
 }
-static inline void simcall_comm_isend__set__result(smx_simcall_t simcall, smx_activity_t result){
-    simgrid::simix::marshal<smx_activity_t>(simcall->result, result);
+static inline void simcall_comm_isend__set__result(smx_simcall_t simcall,
+                                                   boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> result)
+{
+  simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->result, result);
 }
 
 static inline smx_actor_t simcall_comm_recv__get__receiver(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
 }
+static inline smx_actor_t simcall_comm_recv__getraw__receiver(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->args[0]);
+}
 static inline void simcall_comm_recv__set__receiver(smx_simcall_t simcall, smx_actor_t arg) {
     simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
 }
 static inline smx_mailbox_t simcall_comm_recv__get__mbox(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]);
 }
+static inline smx_mailbox_t simcall_comm_recv__getraw__mbox(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<smx_mailbox_t>(simcall->args[1]);
+}
 static inline void simcall_comm_recv__set__mbox(smx_simcall_t simcall, smx_mailbox_t arg) {
     simgrid::simix::marshal<smx_mailbox_t>(simcall->args[1], arg);
 }
 static inline void* simcall_comm_recv__get__dst_buff(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<void*>(simcall->args[2]);
 }
+static inline void* simcall_comm_recv__getraw__dst_buff(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<void*>(simcall->args[2]);
+}
 static inline void simcall_comm_recv__set__dst_buff(smx_simcall_t simcall, void* arg) {
     simgrid::simix::marshal<void*>(simcall->args[2], arg);
 }
 static inline size_t* simcall_comm_recv__get__dst_buff_size(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<size_t*>(simcall->args[3]);
 }
+static inline size_t* simcall_comm_recv__getraw__dst_buff_size(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<size_t*>(simcall->args[3]);
+}
 static inline void simcall_comm_recv__set__dst_buff_size(smx_simcall_t simcall, size_t* arg) {
     simgrid::simix::marshal<size_t*>(simcall->args[3], arg);
 }
 static inline simix_match_func_t simcall_comm_recv__get__match_fun(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[4]);
 }
+static inline simix_match_func_t simcall_comm_recv__getraw__match_fun(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<simix_match_func_t>(simcall->args[4]);
+}
 static inline void simcall_comm_recv__set__match_fun(smx_simcall_t simcall, simix_match_func_t arg) {
     simgrid::simix::marshal<simix_match_func_t>(simcall->args[4], arg);
 }
 static inline simix_copy_data_func_t simcall_comm_recv__get__copy_data_fun(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args[5]);
 }
+static inline simix_copy_data_func_t simcall_comm_recv__getraw__copy_data_fun(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<simix_copy_data_func_t>(simcall->args[5]);
+}
 static inline void simcall_comm_recv__set__copy_data_fun(smx_simcall_t simcall, simix_copy_data_func_t arg) {
     simgrid::simix::marshal<simix_copy_data_func_t>(simcall->args[5], arg);
 }
 static inline void* simcall_comm_recv__get__data(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<void*>(simcall->args[6]);
 }
+static inline void* simcall_comm_recv__getraw__data(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<void*>(simcall->args[6]);
+}
 static inline void simcall_comm_recv__set__data(smx_simcall_t simcall, void* arg) {
     simgrid::simix::marshal<void*>(simcall->args[6], arg);
 }
 static inline double simcall_comm_recv__get__timeout(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<double>(simcall->args[7]);
 }
+static inline double simcall_comm_recv__getraw__timeout(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<double>(simcall->args[7]);
+}
 static inline void simcall_comm_recv__set__timeout(smx_simcall_t simcall, double arg) {
     simgrid::simix::marshal<double>(simcall->args[7], arg);
 }
 static inline double simcall_comm_recv__get__rate(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<double>(simcall->args[8]);
 }
+static inline double simcall_comm_recv__getraw__rate(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<double>(simcall->args[8]);
+}
 static inline void simcall_comm_recv__set__rate(smx_simcall_t simcall, double arg) {
     simgrid::simix::marshal<double>(simcall->args[8], arg);
 }
@@ -520,118 +883,210 @@ static inline void simcall_comm_recv__set__rate(smx_simcall_t simcall, double ar
 static inline smx_actor_t simcall_comm_irecv__get__receiver(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
 }
+static inline smx_actor_t simcall_comm_irecv__getraw__receiver(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->args[0]);
+}
 static inline void simcall_comm_irecv__set__receiver(smx_simcall_t simcall, smx_actor_t arg) {
     simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
 }
 static inline smx_mailbox_t simcall_comm_irecv__get__mbox(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]);
 }
+static inline smx_mailbox_t simcall_comm_irecv__getraw__mbox(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<smx_mailbox_t>(simcall->args[1]);
+}
 static inline void simcall_comm_irecv__set__mbox(smx_simcall_t simcall, smx_mailbox_t arg) {
     simgrid::simix::marshal<smx_mailbox_t>(simcall->args[1], arg);
 }
 static inline void* simcall_comm_irecv__get__dst_buff(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<void*>(simcall->args[2]);
 }
+static inline void* simcall_comm_irecv__getraw__dst_buff(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<void*>(simcall->args[2]);
+}
 static inline void simcall_comm_irecv__set__dst_buff(smx_simcall_t simcall, void* arg) {
     simgrid::simix::marshal<void*>(simcall->args[2], arg);
 }
 static inline size_t* simcall_comm_irecv__get__dst_buff_size(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<size_t*>(simcall->args[3]);
 }
+static inline size_t* simcall_comm_irecv__getraw__dst_buff_size(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<size_t*>(simcall->args[3]);
+}
 static inline void simcall_comm_irecv__set__dst_buff_size(smx_simcall_t simcall, size_t* arg) {
     simgrid::simix::marshal<size_t*>(simcall->args[3], arg);
 }
 static inline simix_match_func_t simcall_comm_irecv__get__match_fun(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[4]);
 }
+static inline simix_match_func_t simcall_comm_irecv__getraw__match_fun(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<simix_match_func_t>(simcall->args[4]);
+}
 static inline void simcall_comm_irecv__set__match_fun(smx_simcall_t simcall, simix_match_func_t arg) {
     simgrid::simix::marshal<simix_match_func_t>(simcall->args[4], arg);
 }
 static inline simix_copy_data_func_t simcall_comm_irecv__get__copy_data_fun(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args[5]);
 }
+static inline simix_copy_data_func_t simcall_comm_irecv__getraw__copy_data_fun(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<simix_copy_data_func_t>(simcall->args[5]);
+}
 static inline void simcall_comm_irecv__set__copy_data_fun(smx_simcall_t simcall, simix_copy_data_func_t arg) {
     simgrid::simix::marshal<simix_copy_data_func_t>(simcall->args[5], arg);
 }
 static inline void* simcall_comm_irecv__get__data(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<void*>(simcall->args[6]);
 }
+static inline void* simcall_comm_irecv__getraw__data(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<void*>(simcall->args[6]);
+}
 static inline void simcall_comm_irecv__set__data(smx_simcall_t simcall, void* arg) {
     simgrid::simix::marshal<void*>(simcall->args[6], arg);
 }
 static inline double simcall_comm_irecv__get__rate(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<double>(simcall->args[7]);
 }
+static inline double simcall_comm_irecv__getraw__rate(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<double>(simcall->args[7]);
+}
 static inline void simcall_comm_irecv__set__rate(smx_simcall_t simcall, double arg) {
     simgrid::simix::marshal<double>(simcall->args[7], arg);
 }
-static inline smx_activity_t simcall_comm_irecv__get__result(smx_simcall_t simcall){
-    return simgrid::simix::unmarshal<smx_activity_t>(simcall->result);
+static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
+simcall_comm_irecv__get__result(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->result);
+}
+static inline simgrid::kernel::activity::ActivityImpl* simcall_comm_irecv__getraw__result(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ActivityImpl*>(simcall->result);
 }
-static inline void simcall_comm_irecv__set__result(smx_simcall_t simcall, smx_activity_t result){
-    simgrid::simix::marshal<smx_activity_t>(simcall->result, result);
+static inline void simcall_comm_irecv__set__result(smx_simcall_t simcall,
+                                                   boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> result)
+{
+  simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->result, result);
 }
 
 static inline xbt_dynar_t simcall_comm_waitany__get__comms(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<xbt_dynar_t>(simcall->args[0]);
 }
+static inline xbt_dynar_t simcall_comm_waitany__getraw__comms(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<xbt_dynar_t>(simcall->args[0]);
+}
 static inline void simcall_comm_waitany__set__comms(smx_simcall_t simcall, xbt_dynar_t arg) {
     simgrid::simix::marshal<xbt_dynar_t>(simcall->args[0], arg);
 }
 static inline double simcall_comm_waitany__get__timeout(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<double>(simcall->args[1]);
 }
+static inline double simcall_comm_waitany__getraw__timeout(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<double>(simcall->args[1]);
+}
 static inline void simcall_comm_waitany__set__timeout(smx_simcall_t simcall, double arg) {
     simgrid::simix::marshal<double>(simcall->args[1], arg);
 }
 static inline int simcall_comm_waitany__get__result(smx_simcall_t simcall){
     return simgrid::simix::unmarshal<int>(simcall->result);
 }
+static inline int simcall_comm_waitany__getraw__result(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<int>(simcall->result);
+}
 static inline void simcall_comm_waitany__set__result(smx_simcall_t simcall, int result){
     simgrid::simix::marshal<int>(simcall->result, result);
 }
 
-static inline smx_activity_t simcall_comm_wait__get__comm(smx_simcall_t simcall) {
-  return simgrid::simix::unmarshal<smx_activity_t>(simcall->args[0]);
+static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
+simcall_comm_wait__get__comm(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]);
 }
-static inline void simcall_comm_wait__set__comm(smx_simcall_t simcall, smx_activity_t arg) {
-    simgrid::simix::marshal<smx_activity_t>(simcall->args[0], arg);
+static inline simgrid::kernel::activity::ActivityImpl* simcall_comm_wait__getraw__comm(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ActivityImpl*>(simcall->args[0]);
+}
+static inline void simcall_comm_wait__set__comm(smx_simcall_t simcall,
+                                                boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> arg)
+{
+  simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0], arg);
 }
 static inline double simcall_comm_wait__get__timeout(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<double>(simcall->args[1]);
 }
+static inline double simcall_comm_wait__getraw__timeout(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<double>(simcall->args[1]);
+}
 static inline void simcall_comm_wait__set__timeout(smx_simcall_t simcall, double arg) {
     simgrid::simix::marshal<double>(simcall->args[1], arg);
 }
 
-static inline smx_activity_t simcall_comm_test__get__comm(smx_simcall_t simcall) {
-  return simgrid::simix::unmarshal<smx_activity_t>(simcall->args[0]);
+static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
+simcall_comm_test__get__comm(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]);
+}
+static inline simgrid::kernel::activity::ActivityImpl* simcall_comm_test__getraw__comm(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ActivityImpl*>(simcall->args[0]);
 }
-static inline void simcall_comm_test__set__comm(smx_simcall_t simcall, smx_activity_t arg) {
-    simgrid::simix::marshal<smx_activity_t>(simcall->args[0], arg);
+static inline void simcall_comm_test__set__comm(smx_simcall_t simcall,
+                                                boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> arg)
+{
+  simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0], arg);
 }
 static inline int simcall_comm_test__get__result(smx_simcall_t simcall){
     return simgrid::simix::unmarshal<int>(simcall->result);
 }
+static inline int simcall_comm_test__getraw__result(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<int>(simcall->result);
+}
 static inline void simcall_comm_test__set__result(smx_simcall_t simcall, int result){
     simgrid::simix::marshal<int>(simcall->result, result);
 }
 
-static inline smx_activity_t* simcall_comm_testany__get__comms(smx_simcall_t simcall) {
-  return simgrid::simix::unmarshal<smx_activity_t*>(simcall->args[0]);
+static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>*
+simcall_comm_testany__get__comms(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>*>(simcall->args[0]);
+}
+static inline simgrid::kernel::activity::ActivityImpl** simcall_comm_testany__getraw__comms(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ActivityImpl**>(simcall->args[0]);
 }
-static inline void simcall_comm_testany__set__comms(smx_simcall_t simcall, smx_activity_t* arg) {
-    simgrid::simix::marshal<smx_activity_t*>(simcall->args[0], arg);
+static inline void simcall_comm_testany__set__comms(smx_simcall_t simcall,
+                                                    boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>* arg)
+{
+  simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>*>(simcall->args[0], arg);
 }
 static inline size_t simcall_comm_testany__get__count(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<size_t>(simcall->args[1]);
 }
+static inline size_t simcall_comm_testany__getraw__count(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<size_t>(simcall->args[1]);
+}
 static inline void simcall_comm_testany__set__count(smx_simcall_t simcall, size_t arg) {
     simgrid::simix::marshal<size_t>(simcall->args[1], arg);
 }
 static inline int simcall_comm_testany__get__result(smx_simcall_t simcall){
     return simgrid::simix::unmarshal<int>(simcall->result);
 }
+static inline int simcall_comm_testany__getraw__result(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<int>(simcall->result);
+}
 static inline void simcall_comm_testany__set__result(smx_simcall_t simcall, int result){
     simgrid::simix::marshal<int>(simcall->result, result);
 }
@@ -639,6 +1094,10 @@ static inline void simcall_comm_testany__set__result(smx_simcall_t simcall, int
 static inline smx_mutex_t simcall_mutex_init__get__result(smx_simcall_t simcall){
     return simgrid::simix::unmarshal<smx_mutex_t>(simcall->result);
 }
+static inline smx_mutex_t simcall_mutex_init__getraw__result(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<smx_mutex_t>(simcall->result);
+}
 static inline void simcall_mutex_init__set__result(smx_simcall_t simcall, smx_mutex_t result){
     simgrid::simix::marshal<smx_mutex_t>(simcall->result, result);
 }
@@ -646,6 +1105,10 @@ static inline void simcall_mutex_init__set__result(smx_simcall_t simcall, smx_mu
 static inline smx_mutex_t simcall_mutex_lock__get__mutex(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[0]);
 }
+static inline smx_mutex_t simcall_mutex_lock__getraw__mutex(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<smx_mutex_t>(simcall->args[0]);
+}
 static inline void simcall_mutex_lock__set__mutex(smx_simcall_t simcall, smx_mutex_t arg) {
     simgrid::simix::marshal<smx_mutex_t>(simcall->args[0], arg);
 }
@@ -653,12 +1116,20 @@ static inline void simcall_mutex_lock__set__mutex(smx_simcall_t simcall, smx_mut
 static inline smx_mutex_t simcall_mutex_trylock__get__mutex(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[0]);
 }
+static inline smx_mutex_t simcall_mutex_trylock__getraw__mutex(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<smx_mutex_t>(simcall->args[0]);
+}
 static inline void simcall_mutex_trylock__set__mutex(smx_simcall_t simcall, smx_mutex_t arg) {
     simgrid::simix::marshal<smx_mutex_t>(simcall->args[0], arg);
 }
 static inline int simcall_mutex_trylock__get__result(smx_simcall_t simcall){
     return simgrid::simix::unmarshal<int>(simcall->result);
 }
+static inline int simcall_mutex_trylock__getraw__result(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<int>(simcall->result);
+}
 static inline void simcall_mutex_trylock__set__result(smx_simcall_t simcall, int result){
     simgrid::simix::marshal<int>(simcall->result, result);
 }
@@ -666,6 +1137,10 @@ static inline void simcall_mutex_trylock__set__result(smx_simcall_t simcall, int
 static inline smx_mutex_t simcall_mutex_unlock__get__mutex(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[0]);
 }
+static inline smx_mutex_t simcall_mutex_unlock__getraw__mutex(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<smx_mutex_t>(simcall->args[0]);
+}
 static inline void simcall_mutex_unlock__set__mutex(smx_simcall_t simcall, smx_mutex_t arg) {
     simgrid::simix::marshal<smx_mutex_t>(simcall->args[0], arg);
 }
@@ -673,6 +1148,10 @@ static inline void simcall_mutex_unlock__set__mutex(smx_simcall_t simcall, smx_m
 static inline smx_cond_t simcall_cond_init__get__result(smx_simcall_t simcall){
     return simgrid::simix::unmarshal<smx_cond_t>(simcall->result);
 }
+static inline smx_cond_t simcall_cond_init__getraw__result(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<smx_cond_t>(simcall->result);
+}
 static inline void simcall_cond_init__set__result(smx_simcall_t simcall, smx_cond_t result){
     simgrid::simix::marshal<smx_cond_t>(simcall->result, result);
 }
@@ -680,6 +1159,10 @@ static inline void simcall_cond_init__set__result(smx_simcall_t simcall, smx_con
 static inline smx_cond_t simcall_cond_signal__get__cond(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<smx_cond_t>(simcall->args[0]);
 }
+static inline smx_cond_t simcall_cond_signal__getraw__cond(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<smx_cond_t>(simcall->args[0]);
+}
 static inline void simcall_cond_signal__set__cond(smx_simcall_t simcall, smx_cond_t arg) {
     simgrid::simix::marshal<smx_cond_t>(simcall->args[0], arg);
 }
@@ -687,12 +1170,20 @@ static inline void simcall_cond_signal__set__cond(smx_simcall_t simcall, smx_con
 static inline smx_cond_t simcall_cond_wait__get__cond(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<smx_cond_t>(simcall->args[0]);
 }
+static inline smx_cond_t simcall_cond_wait__getraw__cond(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<smx_cond_t>(simcall->args[0]);
+}
 static inline void simcall_cond_wait__set__cond(smx_simcall_t simcall, smx_cond_t arg) {
     simgrid::simix::marshal<smx_cond_t>(simcall->args[0], arg);
 }
 static inline smx_mutex_t simcall_cond_wait__get__mutex(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[1]);
 }
+static inline smx_mutex_t simcall_cond_wait__getraw__mutex(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<smx_mutex_t>(simcall->args[1]);
+}
 static inline void simcall_cond_wait__set__mutex(smx_simcall_t simcall, smx_mutex_t arg) {
     simgrid::simix::marshal<smx_mutex_t>(simcall->args[1], arg);
 }
@@ -700,18 +1191,30 @@ static inline void simcall_cond_wait__set__mutex(smx_simcall_t simcall, smx_mute
 static inline smx_cond_t simcall_cond_wait_timeout__get__cond(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<smx_cond_t>(simcall->args[0]);
 }
+static inline smx_cond_t simcall_cond_wait_timeout__getraw__cond(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<smx_cond_t>(simcall->args[0]);
+}
 static inline void simcall_cond_wait_timeout__set__cond(smx_simcall_t simcall, smx_cond_t arg) {
     simgrid::simix::marshal<smx_cond_t>(simcall->args[0], arg);
 }
 static inline smx_mutex_t simcall_cond_wait_timeout__get__mutex(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[1]);
 }
+static inline smx_mutex_t simcall_cond_wait_timeout__getraw__mutex(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<smx_mutex_t>(simcall->args[1]);
+}
 static inline void simcall_cond_wait_timeout__set__mutex(smx_simcall_t simcall, smx_mutex_t arg) {
     simgrid::simix::marshal<smx_mutex_t>(simcall->args[1], arg);
 }
 static inline double simcall_cond_wait_timeout__get__timeout(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<double>(simcall->args[2]);
 }
+static inline double simcall_cond_wait_timeout__getraw__timeout(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<double>(simcall->args[2]);
+}
 static inline void simcall_cond_wait_timeout__set__timeout(smx_simcall_t simcall, double arg) {
     simgrid::simix::marshal<double>(simcall->args[2], arg);
 }
@@ -719,6 +1222,10 @@ static inline void simcall_cond_wait_timeout__set__timeout(smx_simcall_t simcall
 static inline smx_cond_t simcall_cond_broadcast__get__cond(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<smx_cond_t>(simcall->args[0]);
 }
+static inline smx_cond_t simcall_cond_broadcast__getraw__cond(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<smx_cond_t>(simcall->args[0]);
+}
 static inline void simcall_cond_broadcast__set__cond(smx_simcall_t simcall, smx_cond_t arg) {
     simgrid::simix::marshal<smx_cond_t>(simcall->args[0], arg);
 }
@@ -726,12 +1233,20 @@ static inline void simcall_cond_broadcast__set__cond(smx_simcall_t simcall, smx_
 static inline unsigned int simcall_sem_init__get__capacity(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<unsigned int>(simcall->args[0]);
 }
+static inline unsigned int simcall_sem_init__getraw__capacity(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<unsigned int>(simcall->args[0]);
+}
 static inline void simcall_sem_init__set__capacity(smx_simcall_t simcall, unsigned int arg) {
     simgrid::simix::marshal<unsigned int>(simcall->args[0], arg);
 }
 static inline smx_sem_t simcall_sem_init__get__result(smx_simcall_t simcall){
     return simgrid::simix::unmarshal<smx_sem_t>(simcall->result);
 }
+static inline smx_sem_t simcall_sem_init__getraw__result(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<smx_sem_t>(simcall->result);
+}
 static inline void simcall_sem_init__set__result(smx_simcall_t simcall, smx_sem_t result){
     simgrid::simix::marshal<smx_sem_t>(simcall->result, result);
 }
@@ -739,6 +1254,10 @@ static inline void simcall_sem_init__set__result(smx_simcall_t simcall, smx_sem_
 static inline smx_sem_t simcall_sem_release__get__sem(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<smx_sem_t>(simcall->args[0]);
 }
+static inline smx_sem_t simcall_sem_release__getraw__sem(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<smx_sem_t>(simcall->args[0]);
+}
 static inline void simcall_sem_release__set__sem(smx_simcall_t simcall, smx_sem_t arg) {
     simgrid::simix::marshal<smx_sem_t>(simcall->args[0], arg);
 }
@@ -746,12 +1265,20 @@ static inline void simcall_sem_release__set__sem(smx_simcall_t simcall, smx_sem_
 static inline smx_sem_t simcall_sem_would_block__get__sem(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<smx_sem_t>(simcall->args[0]);
 }
+static inline smx_sem_t simcall_sem_would_block__getraw__sem(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<smx_sem_t>(simcall->args[0]);
+}
 static inline void simcall_sem_would_block__set__sem(smx_simcall_t simcall, smx_sem_t arg) {
     simgrid::simix::marshal<smx_sem_t>(simcall->args[0], arg);
 }
 static inline int simcall_sem_would_block__get__result(smx_simcall_t simcall){
     return simgrid::simix::unmarshal<int>(simcall->result);
 }
+static inline int simcall_sem_would_block__getraw__result(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<int>(simcall->result);
+}
 static inline void simcall_sem_would_block__set__result(smx_simcall_t simcall, int result){
     simgrid::simix::marshal<int>(simcall->result, result);
 }
@@ -759,6 +1286,10 @@ static inline void simcall_sem_would_block__set__result(smx_simcall_t simcall, i
 static inline smx_sem_t simcall_sem_acquire__get__sem(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<smx_sem_t>(simcall->args[0]);
 }
+static inline smx_sem_t simcall_sem_acquire__getraw__sem(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<smx_sem_t>(simcall->args[0]);
+}
 static inline void simcall_sem_acquire__set__sem(smx_simcall_t simcall, smx_sem_t arg) {
     simgrid::simix::marshal<smx_sem_t>(simcall->args[0], arg);
 }
@@ -766,12 +1297,20 @@ static inline void simcall_sem_acquire__set__sem(smx_simcall_t simcall, smx_sem_
 static inline smx_sem_t simcall_sem_acquire_timeout__get__sem(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<smx_sem_t>(simcall->args[0]);
 }
+static inline smx_sem_t simcall_sem_acquire_timeout__getraw__sem(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<smx_sem_t>(simcall->args[0]);
+}
 static inline void simcall_sem_acquire_timeout__set__sem(smx_simcall_t simcall, smx_sem_t arg) {
     simgrid::simix::marshal<smx_sem_t>(simcall->args[0], arg);
 }
 static inline double simcall_sem_acquire_timeout__get__timeout(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<double>(simcall->args[1]);
 }
+static inline double simcall_sem_acquire_timeout__getraw__timeout(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<double>(simcall->args[1]);
+}
 static inline void simcall_sem_acquire_timeout__set__timeout(smx_simcall_t simcall, double arg) {
     simgrid::simix::marshal<double>(simcall->args[1], arg);
 }
@@ -779,12 +1318,20 @@ static inline void simcall_sem_acquire_timeout__set__timeout(smx_simcall_t simca
 static inline smx_sem_t simcall_sem_get_capacity__get__sem(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<smx_sem_t>(simcall->args[0]);
 }
+static inline smx_sem_t simcall_sem_get_capacity__getraw__sem(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<smx_sem_t>(simcall->args[0]);
+}
 static inline void simcall_sem_get_capacity__set__sem(smx_simcall_t simcall, smx_sem_t arg) {
     simgrid::simix::marshal<smx_sem_t>(simcall->args[0], arg);
 }
 static inline int simcall_sem_get_capacity__get__result(smx_simcall_t simcall){
     return simgrid::simix::unmarshal<int>(simcall->result);
 }
+static inline int simcall_sem_get_capacity__getraw__result(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<int>(simcall->result);
+}
 static inline void simcall_sem_get_capacity__set__result(smx_simcall_t simcall, int result){
     simgrid::simix::marshal<int>(simcall->result, result);
 }
@@ -792,24 +1339,40 @@ static inline void simcall_sem_get_capacity__set__result(smx_simcall_t simcall,
 static inline smx_file_t simcall_file_read__get__fd(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<smx_file_t>(simcall->args[0]);
 }
+static inline smx_file_t simcall_file_read__getraw__fd(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<smx_file_t>(simcall->args[0]);
+}
 static inline void simcall_file_read__set__fd(smx_simcall_t simcall, smx_file_t arg) {
     simgrid::simix::marshal<smx_file_t>(simcall->args[0], arg);
 }
 static inline sg_size_t simcall_file_read__get__size(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<sg_size_t>(simcall->args[1]);
 }
+static inline sg_size_t simcall_file_read__getraw__size(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<sg_size_t>(simcall->args[1]);
+}
 static inline void simcall_file_read__set__size(smx_simcall_t simcall, sg_size_t arg) {
     simgrid::simix::marshal<sg_size_t>(simcall->args[1], arg);
 }
 static inline sg_host_t simcall_file_read__get__host(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<sg_host_t>(simcall->args[2]);
 }
+static inline sg_host_t simcall_file_read__getraw__host(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<sg_host_t>(simcall->args[2]);
+}
 static inline void simcall_file_read__set__host(smx_simcall_t simcall, sg_host_t arg) {
     simgrid::simix::marshal<sg_host_t>(simcall->args[2], arg);
 }
 static inline sg_size_t simcall_file_read__get__result(smx_simcall_t simcall){
     return simgrid::simix::unmarshal<sg_size_t>(simcall->result);
 }
+static inline sg_size_t simcall_file_read__getraw__result(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<sg_size_t>(simcall->result);
+}
 static inline void simcall_file_read__set__result(smx_simcall_t simcall, sg_size_t result){
     simgrid::simix::marshal<sg_size_t>(simcall->result, result);
 }
@@ -817,43 +1380,87 @@ static inline void simcall_file_read__set__result(smx_simcall_t simcall, sg_size
 static inline smx_file_t simcall_file_write__get__fd(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<smx_file_t>(simcall->args[0]);
 }
+static inline smx_file_t simcall_file_write__getraw__fd(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<smx_file_t>(simcall->args[0]);
+}
 static inline void simcall_file_write__set__fd(smx_simcall_t simcall, smx_file_t arg) {
     simgrid::simix::marshal<smx_file_t>(simcall->args[0], arg);
 }
 static inline sg_size_t simcall_file_write__get__size(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<sg_size_t>(simcall->args[1]);
 }
+static inline sg_size_t simcall_file_write__getraw__size(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<sg_size_t>(simcall->args[1]);
+}
 static inline void simcall_file_write__set__size(smx_simcall_t simcall, sg_size_t arg) {
     simgrid::simix::marshal<sg_size_t>(simcall->args[1], arg);
 }
 static inline sg_host_t simcall_file_write__get__host(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<sg_host_t>(simcall->args[2]);
 }
+static inline sg_host_t simcall_file_write__getraw__host(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<sg_host_t>(simcall->args[2]);
+}
 static inline void simcall_file_write__set__host(smx_simcall_t simcall, sg_host_t arg) {
     simgrid::simix::marshal<sg_host_t>(simcall->args[2], arg);
 }
 static inline sg_size_t simcall_file_write__get__result(smx_simcall_t simcall){
     return simgrid::simix::unmarshal<sg_size_t>(simcall->result);
 }
+static inline sg_size_t simcall_file_write__getraw__result(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<sg_size_t>(simcall->result);
+}
 static inline void simcall_file_write__set__result(smx_simcall_t simcall, sg_size_t result){
     simgrid::simix::marshal<sg_size_t>(simcall->result, result);
 }
 
-static inline const char* simcall_file_open__get__fullpath(smx_simcall_t simcall) {
+static inline const char* simcall_file_open__get__mount(smx_simcall_t simcall)
+{
   return simgrid::simix::unmarshal<const char*>(simcall->args[0]);
 }
-static inline void simcall_file_open__set__fullpath(smx_simcall_t simcall, const char* arg) {
-    simgrid::simix::marshal<const char*>(simcall->args[0], arg);
+static inline const char* simcall_file_open__getraw__mount(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<const char*>(simcall->args[0]);
 }
-static inline sg_host_t simcall_file_open__get__host(smx_simcall_t simcall) {
-  return simgrid::simix::unmarshal<sg_host_t>(simcall->args[1]);
+static inline void simcall_file_open__set__mount(smx_simcall_t simcall, const char* arg)
+{
+  simgrid::simix::marshal<const char*>(simcall->args[0], arg);
 }
-static inline void simcall_file_open__set__host(smx_simcall_t simcall, sg_host_t arg) {
-    simgrid::simix::marshal<sg_host_t>(simcall->args[1], arg);
+static inline const char* simcall_file_open__get__path(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal<const char*>(simcall->args[1]);
+}
+static inline const char* simcall_file_open__getraw__path(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<const char*>(simcall->args[1]);
+}
+static inline void simcall_file_open__set__path(smx_simcall_t simcall, const char* arg)
+{
+  simgrid::simix::marshal<const char*>(simcall->args[1], arg);
+}
+static inline sg_storage_t simcall_file_open__get__st(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal<sg_storage_t>(simcall->args[2]);
+}
+static inline sg_storage_t simcall_file_open__getraw__st(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<sg_storage_t>(simcall->args[2]);
+}
+static inline void simcall_file_open__set__st(smx_simcall_t simcall, sg_storage_t arg)
+{
+  simgrid::simix::marshal<sg_storage_t>(simcall->args[2], arg);
 }
 static inline smx_file_t simcall_file_open__get__result(smx_simcall_t simcall){
     return simgrid::simix::unmarshal<smx_file_t>(simcall->result);
 }
+static inline smx_file_t simcall_file_open__getraw__result(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<smx_file_t>(simcall->result);
+}
 static inline void simcall_file_open__set__result(smx_simcall_t simcall, smx_file_t result){
     simgrid::simix::marshal<smx_file_t>(simcall->result, result);
 }
@@ -861,18 +1468,30 @@ static inline void simcall_file_open__set__result(smx_simcall_t simcall, smx_fil
 static inline smx_file_t simcall_file_close__get__fd(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<smx_file_t>(simcall->args[0]);
 }
+static inline smx_file_t simcall_file_close__getraw__fd(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<smx_file_t>(simcall->args[0]);
+}
 static inline void simcall_file_close__set__fd(smx_simcall_t simcall, smx_file_t arg) {
     simgrid::simix::marshal<smx_file_t>(simcall->args[0], arg);
 }
 static inline sg_host_t simcall_file_close__get__host(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<sg_host_t>(simcall->args[1]);
 }
+static inline sg_host_t simcall_file_close__getraw__host(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<sg_host_t>(simcall->args[1]);
+}
 static inline void simcall_file_close__set__host(smx_simcall_t simcall, sg_host_t arg) {
     simgrid::simix::marshal<sg_host_t>(simcall->args[1], arg);
 }
 static inline int simcall_file_close__get__result(smx_simcall_t simcall){
     return simgrid::simix::unmarshal<int>(simcall->result);
 }
+static inline int simcall_file_close__getraw__result(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<int>(simcall->result);
+}
 static inline void simcall_file_close__set__result(smx_simcall_t simcall, int result){
     simgrid::simix::marshal<int>(simcall->result, result);
 }
@@ -880,18 +1499,30 @@ static inline void simcall_file_close__set__result(smx_simcall_t simcall, int re
 static inline smx_file_t simcall_file_unlink__get__fd(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<smx_file_t>(simcall->args[0]);
 }
+static inline smx_file_t simcall_file_unlink__getraw__fd(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<smx_file_t>(simcall->args[0]);
+}
 static inline void simcall_file_unlink__set__fd(smx_simcall_t simcall, smx_file_t arg) {
     simgrid::simix::marshal<smx_file_t>(simcall->args[0], arg);
 }
 static inline sg_host_t simcall_file_unlink__get__host(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<sg_host_t>(simcall->args[1]);
 }
+static inline sg_host_t simcall_file_unlink__getraw__host(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<sg_host_t>(simcall->args[1]);
+}
 static inline void simcall_file_unlink__set__host(smx_simcall_t simcall, sg_host_t arg) {
     simgrid::simix::marshal<sg_host_t>(simcall->args[1], arg);
 }
 static inline int simcall_file_unlink__get__result(smx_simcall_t simcall){
     return simgrid::simix::unmarshal<int>(simcall->result);
 }
+static inline int simcall_file_unlink__getraw__result(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<int>(simcall->result);
+}
 static inline void simcall_file_unlink__set__result(smx_simcall_t simcall, int result){
     simgrid::simix::marshal<int>(simcall->result, result);
 }
@@ -899,12 +1530,20 @@ static inline void simcall_file_unlink__set__result(smx_simcall_t simcall, int r
 static inline smx_file_t simcall_file_get_size__get__fd(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<smx_file_t>(simcall->args[0]);
 }
+static inline smx_file_t simcall_file_get_size__getraw__fd(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<smx_file_t>(simcall->args[0]);
+}
 static inline void simcall_file_get_size__set__fd(smx_simcall_t simcall, smx_file_t arg) {
     simgrid::simix::marshal<smx_file_t>(simcall->args[0], arg);
 }
 static inline sg_size_t simcall_file_get_size__get__result(smx_simcall_t simcall){
     return simgrid::simix::unmarshal<sg_size_t>(simcall->result);
 }
+static inline sg_size_t simcall_file_get_size__getraw__result(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<sg_size_t>(simcall->result);
+}
 static inline void simcall_file_get_size__set__result(smx_simcall_t simcall, sg_size_t result){
     simgrid::simix::marshal<sg_size_t>(simcall->result, result);
 }
@@ -912,12 +1551,20 @@ static inline void simcall_file_get_size__set__result(smx_simcall_t simcall, sg_
 static inline smx_file_t simcall_file_tell__get__fd(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<smx_file_t>(simcall->args[0]);
 }
+static inline smx_file_t simcall_file_tell__getraw__fd(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<smx_file_t>(simcall->args[0]);
+}
 static inline void simcall_file_tell__set__fd(smx_simcall_t simcall, smx_file_t arg) {
     simgrid::simix::marshal<smx_file_t>(simcall->args[0], arg);
 }
 static inline sg_size_t simcall_file_tell__get__result(smx_simcall_t simcall){
     return simgrid::simix::unmarshal<sg_size_t>(simcall->result);
 }
+static inline sg_size_t simcall_file_tell__getraw__result(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<sg_size_t>(simcall->result);
+}
 static inline void simcall_file_tell__set__result(smx_simcall_t simcall, sg_size_t result){
     simgrid::simix::marshal<sg_size_t>(simcall->result, result);
 }
@@ -925,56 +1572,71 @@ static inline void simcall_file_tell__set__result(smx_simcall_t simcall, sg_size
 static inline smx_file_t simcall_file_seek__get__fd(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<smx_file_t>(simcall->args[0]);
 }
+static inline smx_file_t simcall_file_seek__getraw__fd(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<smx_file_t>(simcall->args[0]);
+}
 static inline void simcall_file_seek__set__fd(smx_simcall_t simcall, smx_file_t arg) {
     simgrid::simix::marshal<smx_file_t>(simcall->args[0], arg);
 }
 static inline sg_offset_t simcall_file_seek__get__offset(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<sg_offset_t>(simcall->args[1]);
 }
+static inline sg_offset_t simcall_file_seek__getraw__offset(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<sg_offset_t>(simcall->args[1]);
+}
 static inline void simcall_file_seek__set__offset(smx_simcall_t simcall, sg_offset_t arg) {
     simgrid::simix::marshal<sg_offset_t>(simcall->args[1], arg);
 }
 static inline int simcall_file_seek__get__origin(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<int>(simcall->args[2]);
 }
+static inline int simcall_file_seek__getraw__origin(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<int>(simcall->args[2]);
+}
 static inline void simcall_file_seek__set__origin(smx_simcall_t simcall, int arg) {
     simgrid::simix::marshal<int>(simcall->args[2], arg);
 }
 static inline int simcall_file_seek__get__result(smx_simcall_t simcall){
     return simgrid::simix::unmarshal<int>(simcall->result);
 }
+static inline int simcall_file_seek__getraw__result(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<int>(simcall->result);
+}
 static inline void simcall_file_seek__set__result(smx_simcall_t simcall, int result){
     simgrid::simix::marshal<int>(simcall->result, result);
 }
 
-static inline smx_file_t simcall_file_get_info__get__fd(smx_simcall_t simcall) {
-  return simgrid::simix::unmarshal<smx_file_t>(simcall->args[0]);
-}
-static inline void simcall_file_get_info__set__fd(smx_simcall_t simcall, smx_file_t arg) {
-    simgrid::simix::marshal<smx_file_t>(simcall->args[0], arg);
-}
-static inline xbt_dynar_t simcall_file_get_info__get__result(smx_simcall_t simcall){
-    return simgrid::simix::unmarshal<xbt_dynar_t>(simcall->result);
-}
-static inline void simcall_file_get_info__set__result(smx_simcall_t simcall, xbt_dynar_t result){
-    simgrid::simix::marshal<xbt_dynar_t>(simcall->result, result);
-}
-
 static inline smx_file_t simcall_file_move__get__fd(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<smx_file_t>(simcall->args[0]);
 }
+static inline smx_file_t simcall_file_move__getraw__fd(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<smx_file_t>(simcall->args[0]);
+}
 static inline void simcall_file_move__set__fd(smx_simcall_t simcall, smx_file_t arg) {
     simgrid::simix::marshal<smx_file_t>(simcall->args[0], arg);
 }
 static inline const char* simcall_file_move__get__fullpath(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<const char*>(simcall->args[1]);
 }
+static inline const char* simcall_file_move__getraw__fullpath(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<const char*>(simcall->args[1]);
+}
 static inline void simcall_file_move__set__fullpath(smx_simcall_t simcall, const char* arg) {
     simgrid::simix::marshal<const char*>(simcall->args[1], arg);
 }
 static inline int simcall_file_move__get__result(smx_simcall_t simcall){
     return simgrid::simix::unmarshal<int>(simcall->result);
 }
+static inline int simcall_file_move__getraw__result(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<int>(simcall->result);
+}
 static inline void simcall_file_move__set__result(smx_simcall_t simcall, int result){
     simgrid::simix::marshal<int>(simcall->result, result);
 }
@@ -982,31 +1644,55 @@ static inline void simcall_file_move__set__result(smx_simcall_t simcall, int res
 static inline int simcall_mc_random__get__min(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<int>(simcall->args[0]);
 }
+static inline int simcall_mc_random__getraw__min(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<int>(simcall->args[0]);
+}
 static inline void simcall_mc_random__set__min(smx_simcall_t simcall, int arg) {
     simgrid::simix::marshal<int>(simcall->args[0], arg);
 }
 static inline int simcall_mc_random__get__max(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<int>(simcall->args[1]);
 }
+static inline int simcall_mc_random__getraw__max(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<int>(simcall->args[1]);
+}
 static inline void simcall_mc_random__set__max(smx_simcall_t simcall, int arg) {
     simgrid::simix::marshal<int>(simcall->args[1], arg);
 }
 static inline int simcall_mc_random__get__result(smx_simcall_t simcall){
     return simgrid::simix::unmarshal<int>(simcall->result);
 }
+static inline int simcall_mc_random__getraw__result(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<int>(simcall->result);
+}
 static inline void simcall_mc_random__set__result(smx_simcall_t simcall, int result){
     simgrid::simix::marshal<int>(simcall->result, result);
 }
 
-static inline smx_activity_t simcall_set_category__get__synchro(smx_simcall_t simcall) {
-  return simgrid::simix::unmarshal<smx_activity_t>(simcall->args[0]);
+static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
+simcall_set_category__get__synchro(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]);
+}
+static inline simgrid::kernel::activity::ActivityImpl* simcall_set_category__getraw__synchro(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ActivityImpl*>(simcall->args[0]);
 }
-static inline void simcall_set_category__set__synchro(smx_simcall_t simcall, smx_activity_t arg) {
-    simgrid::simix::marshal<smx_activity_t>(simcall->args[0], arg);
+static inline void simcall_set_category__set__synchro(smx_simcall_t simcall,
+                                                      boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> arg)
+{
+  simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0], arg);
 }
 static inline const char* simcall_set_category__get__category(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<const char*>(simcall->args[1]);
 }
+static inline const char* simcall_set_category__getraw__category(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<const char*>(simcall->args[1]);
+}
 static inline void simcall_set_category__set__category(smx_simcall_t simcall, const char* arg) {
     simgrid::simix::marshal<const char*>(simcall->args[1], arg);
 }
@@ -1014,6 +1700,10 @@ static inline void simcall_set_category__set__category(smx_simcall_t simcall, co
 static inline std::function<void()> const* simcall_run_kernel__get__code(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<std::function<void()> const*>(simcall->args[0]);
 }
+static inline std::function<void()> const* simcall_run_kernel__getraw__code(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<std::function<void()> const*>(simcall->args[0]);
+}
 static inline void simcall_run_kernel__set__code(smx_simcall_t simcall, std::function<void()> const* arg) {
     simgrid::simix::marshal<std::function<void()> const*>(simcall->args[0], arg);
 }
@@ -1021,6 +1711,10 @@ static inline void simcall_run_kernel__set__code(smx_simcall_t simcall, std::fun
 static inline std::function<void()> const* simcall_run_blocking__get__code(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<std::function<void()> const*>(simcall->args[0]);
 }
+static inline std::function<void()> const* simcall_run_blocking__getraw__code(smx_simcall_t simcall)
+{
+  return simgrid::simix::unmarshal_raw<std::function<void()> const*>(simcall->args[0]);
+}
 static inline void simcall_run_blocking__set__code(smx_simcall_t simcall, std::function<void()> const* arg) {
     simgrid::simix::marshal<std::function<void()> const*>(simcall->args[0], arg);
 }
@@ -1033,18 +1727,36 @@ XBT_PRIVATE void simcall_HANDLER_process_suspend(smx_simcall_t simcall, smx_acto
 XBT_PRIVATE void simcall_HANDLER_process_set_host(smx_simcall_t simcall, smx_actor_t process, sg_host_t dest);
 XBT_PRIVATE void simcall_HANDLER_process_join(smx_simcall_t simcall, smx_actor_t process, double timeout);
 XBT_PRIVATE void simcall_HANDLER_process_sleep(smx_simcall_t simcall, double duration);
-XBT_PRIVATE smx_activity_t simcall_HANDLER_execution_start(smx_simcall_t simcall, const char* name, double flops_amount, double priority, double bound);
-XBT_PRIVATE void simcall_HANDLER_execution_wait(smx_simcall_t simcall, smx_activity_t execution);
+XBT_PRIVATE boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
+simcall_HANDLER_execution_start(smx_simcall_t simcall, const char* name, double flops_amount, double priority,
+                                double bound);
+XBT_PRIVATE void
+simcall_HANDLER_execution_wait(smx_simcall_t simcall,
+                               boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> execution);
 XBT_PRIVATE smx_actor_t simcall_HANDLER_process_restart(smx_simcall_t simcall, smx_actor_t process);
-XBT_PRIVATE smx_activity_t simcall_HANDLER_comm_iprobe(smx_simcall_t simcall, smx_mailbox_t mbox, int type, int src, int tag, simix_match_func_t match_fun, void* data);
+XBT_PRIVATE boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
+simcall_HANDLER_comm_iprobe(smx_simcall_t simcall, smx_mailbox_t mbox, int type, int src, int tag,
+                            simix_match_func_t match_fun, void* data);
 XBT_PRIVATE void simcall_HANDLER_comm_send(smx_simcall_t simcall, smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout);
-XBT_PRIVATE smx_activity_t simcall_HANDLER_comm_isend(smx_simcall_t simcall, smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_clean_func_t clean_fun, simix_copy_data_func_t copy_data_fun, void* data, int detached);
+XBT_PRIVATE boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
+simcall_HANDLER_comm_isend(smx_simcall_t simcall, smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate,
+                           void* src_buff, size_t src_buff_size, simix_match_func_t match_fun,
+                           simix_clean_func_t clean_fun, simix_copy_data_func_t copy_data_fun, void* data,
+                           int detached);
 XBT_PRIVATE void simcall_HANDLER_comm_recv(smx_simcall_t simcall, smx_actor_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout, double rate);
-XBT_PRIVATE smx_activity_t simcall_HANDLER_comm_irecv(smx_simcall_t simcall, smx_actor_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double rate);
+XBT_PRIVATE boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
+simcall_HANDLER_comm_irecv(smx_simcall_t simcall, smx_actor_t receiver, smx_mailbox_t mbox, void* dst_buff,
+                           size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun,
+                           void* data, double rate);
 XBT_PRIVATE void simcall_HANDLER_comm_waitany(smx_simcall_t simcall, xbt_dynar_t comms, double timeout);
-XBT_PRIVATE void simcall_HANDLER_comm_wait(smx_simcall_t simcall, smx_activity_t comm, double timeout);
-XBT_PRIVATE void simcall_HANDLER_comm_test(smx_simcall_t simcall, smx_activity_t comm);
-XBT_PRIVATE void simcall_HANDLER_comm_testany(smx_simcall_t simcall, smx_activity_t* comms, size_t count);
+XBT_PRIVATE void simcall_HANDLER_comm_wait(smx_simcall_t simcall,
+                                           boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> comm,
+                                           double timeout);
+XBT_PRIVATE void simcall_HANDLER_comm_test(smx_simcall_t simcall,
+                                           boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> comm);
+XBT_PRIVATE void simcall_HANDLER_comm_testany(smx_simcall_t simcall,
+                                              boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>* comms,
+                                              size_t count);
 XBT_PRIVATE smx_mutex_t simcall_HANDLER_mutex_init(smx_simcall_t simcall);
 XBT_PRIVATE void simcall_HANDLER_mutex_lock(smx_simcall_t simcall, smx_mutex_t mutex);
 XBT_PRIVATE int simcall_HANDLER_mutex_trylock(smx_simcall_t simcall, smx_mutex_t mutex);
@@ -1058,11 +1770,10 @@ XBT_PRIVATE void simcall_HANDLER_sem_acquire_timeout(smx_simcall_t simcall, smx_
 XBT_PRIVATE int simcall_HANDLER_sem_get_capacity(smx_simcall_t simcall, smx_sem_t sem);
 XBT_PRIVATE void simcall_HANDLER_file_read(smx_simcall_t simcall, smx_file_t fd, sg_size_t size, sg_host_t host);
 XBT_PRIVATE void simcall_HANDLER_file_write(smx_simcall_t simcall, smx_file_t fd, sg_size_t size, sg_host_t host);
-XBT_PRIVATE void simcall_HANDLER_file_open(smx_simcall_t simcall, const char* fullpath, sg_host_t host);
+XBT_PRIVATE void simcall_HANDLER_file_open(smx_simcall_t simcall, const char* mount, const char* path, sg_storage_t st);
 XBT_PRIVATE void simcall_HANDLER_file_close(smx_simcall_t simcall, smx_file_t fd, sg_host_t host);
 XBT_PRIVATE sg_size_t simcall_HANDLER_file_get_size(smx_simcall_t simcall, smx_file_t fd);
 XBT_PRIVATE sg_size_t simcall_HANDLER_file_tell(smx_simcall_t simcall, smx_file_t fd);
 XBT_PRIVATE int simcall_HANDLER_file_seek(smx_simcall_t simcall, smx_file_t fd, sg_offset_t offset, int origin);
-XBT_PRIVATE xbt_dynar_t simcall_HANDLER_file_get_info(smx_simcall_t simcall, smx_file_t fd);
 XBT_PRIVATE int simcall_HANDLER_file_move(smx_simcall_t simcall, smx_file_t fd, const char* fullpath);
 XBT_PRIVATE int simcall_HANDLER_mc_random(smx_simcall_t simcall, int min, int max);
\ No newline at end of file
index 2c1ad74..02f679a 100644 (file)
@@ -90,40 +90,61 @@ inline static int simcall_BODY_process_sleep(double duration) {
     return simcall<int, double>(SIMCALL_PROCESS_SLEEP, duration);
   }
 
-inline static smx_activity_t simcall_BODY_execution_start(const char* name, double flops_amount, double priority, double bound) {
+  inline static boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
+  simcall_BODY_execution_start(const char* name, double flops_amount, double priority, double bound)
+  {
     /* Go to that function to follow the code flow through the simcall barrier */
     if (0) simcall_HANDLER_execution_start(&SIMIX_process_self()->simcall, name, flops_amount, priority, bound);
-    return simcall<smx_activity_t, const char*, double, double, double>(SIMCALL_EXECUTION_START, name, flops_amount, priority, bound);
+    return simcall<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>, const char*, double, double, double>(
+        SIMCALL_EXECUTION_START, name, flops_amount, priority, bound);
   }
 
-inline static smx_activity_t simcall_BODY_execution_parallel_start(const char* name, int host_nb, sg_host_t* host_list, double* flops_amount, double* bytes_amount, double amount, double rate, double timeout) {
+  inline static boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
+  simcall_BODY_execution_parallel_start(const char* name, int host_nb, sg_host_t* host_list, double* flops_amount,
+                                        double* bytes_amount, double amount, double rate, double timeout)
+  {
     /* Go to that function to follow the code flow through the simcall barrier */
     if (0) SIMIX_execution_parallel_start(name, host_nb, host_list, flops_amount, bytes_amount, amount, rate, timeout);
-    return simcall<smx_activity_t, const char*, int, sg_host_t*, double*, double*, double, double, double>(SIMCALL_EXECUTION_PARALLEL_START, name, host_nb, host_list, flops_amount, bytes_amount, amount, rate, timeout);
+    return simcall<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>, const char*, int, sg_host_t*, double*,
+                   double*, double, double, double>(SIMCALL_EXECUTION_PARALLEL_START, name, host_nb, host_list,
+                                                    flops_amount, bytes_amount, amount, rate, timeout);
   }
 
-inline static void simcall_BODY_execution_cancel(smx_activity_t execution) {
+  inline static void
+  simcall_BODY_execution_cancel(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> execution)
+  {
     /* Go to that function to follow the code flow through the simcall barrier */
     if (0) SIMIX_execution_cancel(execution);
-    return simcall<void, smx_activity_t>(SIMCALL_EXECUTION_CANCEL, execution);
+    return simcall<void, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(SIMCALL_EXECUTION_CANCEL,
+                                                                                        execution);
   }
 
-inline static void simcall_BODY_execution_set_priority(smx_activity_t execution, double priority) {
+  inline static void
+  simcall_BODY_execution_set_priority(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> execution,
+                                      double priority)
+  {
     /* Go to that function to follow the code flow through the simcall barrier */
     if (0) SIMIX_execution_set_priority(execution, priority);
-    return simcall<void, smx_activity_t, double>(SIMCALL_EXECUTION_SET_PRIORITY, execution, priority);
+    return simcall<void, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>, double>(
+        SIMCALL_EXECUTION_SET_PRIORITY, execution, priority);
   }
 
-inline static void simcall_BODY_execution_set_bound(smx_activity_t execution, double bound) {
+  inline static void
+  simcall_BODY_execution_set_bound(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> execution,
+                                   double bound)
+  {
     /* Go to that function to follow the code flow through the simcall barrier */
     if (0) SIMIX_execution_set_bound(execution, bound);
-    return simcall<void, smx_activity_t, double>(SIMCALL_EXECUTION_SET_BOUND, execution, bound);
+    return simcall<void, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>, double>(
+        SIMCALL_EXECUTION_SET_BOUND, execution, bound);
   }
 
-inline static int simcall_BODY_execution_wait(smx_activity_t execution) {
+  inline static int simcall_BODY_execution_wait(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> execution)
+  {
     /* Go to that function to follow the code flow through the simcall barrier */
     if (0) simcall_HANDLER_execution_wait(&SIMIX_process_self()->simcall, execution);
-    return simcall<int, smx_activity_t>(SIMCALL_EXECUTION_WAIT, execution);
+    return simcall<int, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(SIMCALL_EXECUTION_WAIT,
+                                                                                       execution);
   }
 
 inline static void simcall_BODY_process_on_exit(smx_actor_t process, int_f_pvoid_pvoid_t fun, void* data) {
@@ -144,10 +165,13 @@ inline static smx_actor_t simcall_BODY_process_restart(smx_actor_t process) {
     return simcall<smx_actor_t, smx_actor_t>(SIMCALL_PROCESS_RESTART, process);
   }
 
-inline static smx_activity_t simcall_BODY_comm_iprobe(smx_mailbox_t mbox, int type, int src, int tag, simix_match_func_t match_fun, void* data) {
+  inline static boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
+  simcall_BODY_comm_iprobe(smx_mailbox_t mbox, int type, int src, int tag, simix_match_func_t match_fun, void* data)
+  {
     /* Go to that function to follow the code flow through the simcall barrier */
     if (0) simcall_HANDLER_comm_iprobe(&SIMIX_process_self()->simcall, mbox, type, src, tag, match_fun, data);
-    return simcall<smx_activity_t, smx_mailbox_t, int, int, int, simix_match_func_t, void*>(SIMCALL_COMM_IPROBE, mbox, type, src, tag, match_fun, data);
+    return simcall<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>, smx_mailbox_t, int, int, int,
+                   simix_match_func_t, void*>(SIMCALL_COMM_IPROBE, mbox, type, src, tag, match_fun, data);
   }
 
 inline static void simcall_BODY_comm_send(smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout) {
@@ -156,10 +180,17 @@ inline static void simcall_BODY_comm_send(smx_actor_t sender, smx_mailbox_t mbox
     return simcall<void, smx_actor_t, smx_mailbox_t, double, double, void*, size_t, simix_match_func_t, simix_copy_data_func_t, void*, double>(SIMCALL_COMM_SEND, sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, copy_data_fun, data, timeout);
   }
 
-inline static smx_activity_t simcall_BODY_comm_isend(smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_clean_func_t clean_fun, simix_copy_data_func_t copy_data_fun, void* data, int detached) {
+  inline static boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
+  simcall_BODY_comm_isend(smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff,
+                          size_t src_buff_size, simix_match_func_t match_fun, simix_clean_func_t clean_fun,
+                          simix_copy_data_func_t copy_data_fun, void* data, int detached)
+  {
     /* Go to that function to follow the code flow through the simcall barrier */
     if (0) simcall_HANDLER_comm_isend(&SIMIX_process_self()->simcall, sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, clean_fun, copy_data_fun, data, detached);
-    return simcall<smx_activity_t, smx_actor_t, smx_mailbox_t, double, double, void*, size_t, simix_match_func_t, simix_clean_func_t, simix_copy_data_func_t, void*, int>(SIMCALL_COMM_ISEND, sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, clean_fun, copy_data_fun, data, detached);
+    return simcall<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>, smx_actor_t, smx_mailbox_t, double,
+                   double, void*, size_t, simix_match_func_t, simix_clean_func_t, simix_copy_data_func_t, void*, int>(
+        SIMCALL_COMM_ISEND, sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, clean_fun, copy_data_fun,
+        data, detached);
   }
 
 inline static void simcall_BODY_comm_recv(smx_actor_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout, double rate) {
@@ -168,10 +199,15 @@ inline static void simcall_BODY_comm_recv(smx_actor_t receiver, smx_mailbox_t mb
     return simcall<void, smx_actor_t, smx_mailbox_t, void*, size_t*, simix_match_func_t, simix_copy_data_func_t, void*, double, double>(SIMCALL_COMM_RECV, receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, timeout, rate);
   }
 
-inline static smx_activity_t simcall_BODY_comm_irecv(smx_actor_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double rate) {
+  inline static boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
+  simcall_BODY_comm_irecv(smx_actor_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size,
+                          simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double rate)
+  {
     /* Go to that function to follow the code flow through the simcall barrier */
     if (0) simcall_HANDLER_comm_irecv(&SIMIX_process_self()->simcall, receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, rate);
-    return simcall<smx_activity_t, smx_actor_t, smx_mailbox_t, void*, size_t*, simix_match_func_t, simix_copy_data_func_t, void*, double>(SIMCALL_COMM_IRECV, receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, rate);
+    return simcall<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>, smx_actor_t, smx_mailbox_t, void*,
+                   size_t*, simix_match_func_t, simix_copy_data_func_t, void*, double>(
+        SIMCALL_COMM_IRECV, receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, rate);
   }
 
 inline static int simcall_BODY_comm_waitany(xbt_dynar_t comms, double timeout) {
@@ -180,22 +216,29 @@ inline static int simcall_BODY_comm_waitany(xbt_dynar_t comms, double timeout) {
     return simcall<int, xbt_dynar_t, double>(SIMCALL_COMM_WAITANY, comms, timeout);
   }
 
-inline static void simcall_BODY_comm_wait(smx_activity_t comm, double timeout) {
+  inline static void simcall_BODY_comm_wait(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> comm,
+                                            double timeout)
+  {
     /* Go to that function to follow the code flow through the simcall barrier */
     if (0) simcall_HANDLER_comm_wait(&SIMIX_process_self()->simcall, comm, timeout);
-    return simcall<void, smx_activity_t, double>(SIMCALL_COMM_WAIT, comm, timeout);
+    return simcall<void, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>, double>(SIMCALL_COMM_WAIT, comm,
+                                                                                                timeout);
   }
 
-inline static int simcall_BODY_comm_test(smx_activity_t comm) {
+  inline static int simcall_BODY_comm_test(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> comm)
+  {
     /* Go to that function to follow the code flow through the simcall barrier */
     if (0) simcall_HANDLER_comm_test(&SIMIX_process_self()->simcall, comm);
-    return simcall<int, smx_activity_t>(SIMCALL_COMM_TEST, comm);
+    return simcall<int, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(SIMCALL_COMM_TEST, comm);
   }
 
-inline static int simcall_BODY_comm_testany(smx_activity_t* comms, size_t count) {
+  inline static int simcall_BODY_comm_testany(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>* comms,
+                                              size_t count)
+  {
     /* Go to that function to follow the code flow through the simcall barrier */
     if (0) simcall_HANDLER_comm_testany(&SIMIX_process_self()->simcall, comms, count);
-    return simcall<int, smx_activity_t*, size_t>(SIMCALL_COMM_TESTANY, comms, count);
+    return simcall<int, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>*, size_t>(SIMCALL_COMM_TESTANY,
+                                                                                                comms, count);
   }
 
 inline static smx_mutex_t simcall_BODY_mutex_init() {
@@ -300,10 +343,12 @@ inline static sg_size_t simcall_BODY_file_write(smx_file_t fd, sg_size_t size, s
     return simcall<sg_size_t, smx_file_t, sg_size_t, sg_host_t>(SIMCALL_FILE_WRITE, fd, size, host);
   }
 
-inline static smx_file_t simcall_BODY_file_open(const char* fullpath, sg_host_t host) {
+  inline static smx_file_t simcall_BODY_file_open(const char* mount, const char* path, sg_storage_t st)
+  {
     /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_file_open(&SIMIX_process_self()->simcall, fullpath, host);
-    return simcall<smx_file_t, const char*, sg_host_t>(SIMCALL_FILE_OPEN, fullpath, host);
+    if (0)
+      simcall_HANDLER_file_open(&SIMIX_process_self()->simcall, mount, path, st);
+    return simcall<smx_file_t, const char*, const char*, sg_storage_t>(SIMCALL_FILE_OPEN, mount, path, st);
   }
 
 inline static int simcall_BODY_file_close(smx_file_t fd, sg_host_t host) {
@@ -336,12 +381,6 @@ inline static int simcall_BODY_file_seek(smx_file_t fd, sg_offset_t offset, int
     return simcall<int, smx_file_t, sg_offset_t, int>(SIMCALL_FILE_SEEK, fd, offset, origin);
   }
 
-inline static xbt_dynar_t simcall_BODY_file_get_info(smx_file_t fd) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_file_get_info(&SIMIX_process_self()->simcall, fd);
-    return simcall<xbt_dynar_t, smx_file_t>(SIMCALL_FILE_GET_INFO, fd);
-  }
-
 inline static int simcall_BODY_file_move(smx_file_t fd, const char* fullpath) {
     /* Go to that function to follow the code flow through the simcall barrier */
     if (0) simcall_HANDLER_file_move(&SIMIX_process_self()->simcall, fd, fullpath);
@@ -354,10 +393,13 @@ inline static int simcall_BODY_mc_random(int min, int max) {
     return simcall<int, int, int>(SIMCALL_MC_RANDOM, min, max);
   }
 
-inline static void simcall_BODY_set_category(smx_activity_t synchro, const char* category) {
+  inline static void simcall_BODY_set_category(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> synchro,
+                                               const char* category)
+  {
     /* Go to that function to follow the code flow through the simcall barrier */
     if (0) SIMIX_set_category(synchro, category);
-    return simcall<void, smx_activity_t, const char*>(SIMCALL_SET_CATEGORY, synchro, category);
+    return simcall<void, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>, const char*>(
+        SIMCALL_SET_CATEGORY, synchro, category);
   }
 
 inline static void simcall_BODY_run_kernel(std::function<void()> const* code) {
index 4e59ccf..1a6d2d7 100644 (file)
@@ -69,7 +69,6 @@ typedef enum {
   SIMCALL_FILE_GET_SIZE,
   SIMCALL_FILE_TELL,
   SIMCALL_FILE_SEEK,
-  SIMCALL_FILE_GET_INFO,
   SIMCALL_FILE_MOVE,
   SIMCALL_MC_RANDOM,
   SIMCALL_SET_CATEGORY,
index e19ac64..1fc2e8a 100644 (file)
@@ -75,7 +75,6 @@ const char* simcall_names[] = {
     "SIMCALL_FILE_GET_SIZE",
     "SIMCALL_FILE_TELL",
     "SIMCALL_FILE_SEEK",
-    "SIMCALL_FILE_GET_INFO",
     "SIMCALL_FILE_MOVE",
     "SIMCALL_MC_RANDOM",
     "SIMCALL_SET_CATEGORY",
@@ -137,33 +136,51 @@ case SIMCALL_PROCESS_SLEEP:
       break;
 
 case SIMCALL_EXECUTION_START:
-      simgrid::simix::marshal<smx_activity_t>(simcall->result, simcall_HANDLER_execution_start(simcall, simgrid::simix::unmarshal<const char*>(simcall->args[0]), simgrid::simix::unmarshal<double>(simcall->args[1]), simgrid::simix::unmarshal<double>(simcall->args[2]), simgrid::simix::unmarshal<double>(simcall->args[3])));
-      SIMIX_simcall_answer(simcall);
-      break;
+  simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(
+      simcall->result,
+      simcall_HANDLER_execution_start(simcall, simgrid::simix::unmarshal<const char*>(simcall->args[0]),
+                                      simgrid::simix::unmarshal<double>(simcall->args[1]),
+                                      simgrid::simix::unmarshal<double>(simcall->args[2]),
+                                      simgrid::simix::unmarshal<double>(simcall->args[3])));
+  SIMIX_simcall_answer(simcall);
+  break;
 
 case SIMCALL_EXECUTION_PARALLEL_START:
-      simgrid::simix::marshal<smx_activity_t>(simcall->result, SIMIX_execution_parallel_start(simgrid::simix::unmarshal<const char*>(simcall->args[0]), simgrid::simix::unmarshal<int>(simcall->args[1]), simgrid::simix::unmarshal<sg_host_t*>(simcall->args[2]), simgrid::simix::unmarshal<double*>(simcall->args[3]), simgrid::simix::unmarshal<double*>(simcall->args[4]), simgrid::simix::unmarshal<double>(simcall->args[5]), simgrid::simix::unmarshal<double>(simcall->args[6]), simgrid::simix::unmarshal<double>(simcall->args[7])));
-      SIMIX_simcall_answer(simcall);
-      break;
+  simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(
+      simcall->result,
+      SIMIX_execution_parallel_start(
+          simgrid::simix::unmarshal<const char*>(simcall->args[0]), simgrid::simix::unmarshal<int>(simcall->args[1]),
+          simgrid::simix::unmarshal<sg_host_t*>(simcall->args[2]), simgrid::simix::unmarshal<double*>(simcall->args[3]),
+          simgrid::simix::unmarshal<double*>(simcall->args[4]), simgrid::simix::unmarshal<double>(simcall->args[5]),
+          simgrid::simix::unmarshal<double>(simcall->args[6]), simgrid::simix::unmarshal<double>(simcall->args[7])));
+  SIMIX_simcall_answer(simcall);
+  break;
 
 case SIMCALL_EXECUTION_CANCEL:
-      SIMIX_execution_cancel(simgrid::simix::unmarshal<smx_activity_t>(simcall->args[0]));
-      SIMIX_simcall_answer(simcall);
-      break;
+  SIMIX_execution_cancel(
+      simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]));
+  SIMIX_simcall_answer(simcall);
+  break;
 
 case SIMCALL_EXECUTION_SET_PRIORITY:
-      SIMIX_execution_set_priority(simgrid::simix::unmarshal<smx_activity_t>(simcall->args[0]), simgrid::simix::unmarshal<double>(simcall->args[1]));
-      SIMIX_simcall_answer(simcall);
-      break;
+  SIMIX_execution_set_priority(
+      simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]),
+      simgrid::simix::unmarshal<double>(simcall->args[1]));
+  SIMIX_simcall_answer(simcall);
+  break;
 
 case SIMCALL_EXECUTION_SET_BOUND:
-      SIMIX_execution_set_bound(simgrid::simix::unmarshal<smx_activity_t>(simcall->args[0]), simgrid::simix::unmarshal<double>(simcall->args[1]));
-      SIMIX_simcall_answer(simcall);
-      break;
+  SIMIX_execution_set_bound(
+      simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]),
+      simgrid::simix::unmarshal<double>(simcall->args[1]));
+  SIMIX_simcall_answer(simcall);
+  break;
 
 case SIMCALL_EXECUTION_WAIT:
-      simcall_HANDLER_execution_wait(simcall, simgrid::simix::unmarshal<smx_activity_t>(simcall->args[0]));
-      break;
+  simcall_HANDLER_execution_wait(
+      simcall,
+      simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]));
+  break;
 
 case SIMCALL_PROCESS_ON_EXIT:
       SIMIX_process_on_exit(simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]), simgrid::simix::unmarshal<int_f_pvoid_pvoid_t>(simcall->args[1]), simgrid::simix::unmarshal<void*>(simcall->args[2]));
@@ -181,43 +198,75 @@ case SIMCALL_PROCESS_RESTART:
       break;
 
 case SIMCALL_COMM_IPROBE:
-      simgrid::simix::marshal<smx_activity_t>(simcall->result, simcall_HANDLER_comm_iprobe(simcall, simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[0]), simgrid::simix::unmarshal<int>(simcall->args[1]), simgrid::simix::unmarshal<int>(simcall->args[2]), simgrid::simix::unmarshal<int>(simcall->args[3]), simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[4]), simgrid::simix::unmarshal<void*>(simcall->args[5])));
-      SIMIX_simcall_answer(simcall);
-      break;
+  simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(
+      simcall->result, simcall_HANDLER_comm_iprobe(simcall, simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[0]),
+                                                   simgrid::simix::unmarshal<int>(simcall->args[1]),
+                                                   simgrid::simix::unmarshal<int>(simcall->args[2]),
+                                                   simgrid::simix::unmarshal<int>(simcall->args[3]),
+                                                   simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[4]),
+                                                   simgrid::simix::unmarshal<void*>(simcall->args[5])));
+  SIMIX_simcall_answer(simcall);
+  break;
 
 case SIMCALL_COMM_SEND:
       simcall_HANDLER_comm_send(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]), simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]), simgrid::simix::unmarshal<double>(simcall->args[2]), simgrid::simix::unmarshal<double>(simcall->args[3]), simgrid::simix::unmarshal<void*>(simcall->args[4]), simgrid::simix::unmarshal<size_t>(simcall->args[5]), simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[6]), simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args[7]), simgrid::simix::unmarshal<void*>(simcall->args[8]), simgrid::simix::unmarshal<double>(simcall->args[9]));
       break;
 
 case SIMCALL_COMM_ISEND:
-      simgrid::simix::marshal<smx_activity_t>(simcall->result, simcall_HANDLER_comm_isend(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]), simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]), simgrid::simix::unmarshal<double>(simcall->args[2]), simgrid::simix::unmarshal<double>(simcall->args[3]), simgrid::simix::unmarshal<void*>(simcall->args[4]), simgrid::simix::unmarshal<size_t>(simcall->args[5]), simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[6]), simgrid::simix::unmarshal<simix_clean_func_t>(simcall->args[7]), simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args[8]), simgrid::simix::unmarshal<void*>(simcall->args[9]), simgrid::simix::unmarshal<int>(simcall->args[10])));
-      SIMIX_simcall_answer(simcall);
-      break;
+  simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(
+      simcall->result,
+      simcall_HANDLER_comm_isend(
+          simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]),
+          simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]),
+          simgrid::simix::unmarshal<double>(simcall->args[2]), simgrid::simix::unmarshal<double>(simcall->args[3]),
+          simgrid::simix::unmarshal<void*>(simcall->args[4]), simgrid::simix::unmarshal<size_t>(simcall->args[5]),
+          simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[6]),
+          simgrid::simix::unmarshal<simix_clean_func_t>(simcall->args[7]),
+          simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args[8]),
+          simgrid::simix::unmarshal<void*>(simcall->args[9]), simgrid::simix::unmarshal<int>(simcall->args[10])));
+  SIMIX_simcall_answer(simcall);
+  break;
 
 case SIMCALL_COMM_RECV:
       simcall_HANDLER_comm_recv(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]), simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]), simgrid::simix::unmarshal<void*>(simcall->args[2]), simgrid::simix::unmarshal<size_t*>(simcall->args[3]), simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[4]), simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args[5]), simgrid::simix::unmarshal<void*>(simcall->args[6]), simgrid::simix::unmarshal<double>(simcall->args[7]), simgrid::simix::unmarshal<double>(simcall->args[8]));
       break;
 
 case SIMCALL_COMM_IRECV:
-      simgrid::simix::marshal<smx_activity_t>(simcall->result, simcall_HANDLER_comm_irecv(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]), simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]), simgrid::simix::unmarshal<void*>(simcall->args[2]), simgrid::simix::unmarshal<size_t*>(simcall->args[3]), simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[4]), simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args[5]), simgrid::simix::unmarshal<void*>(simcall->args[6]), simgrid::simix::unmarshal<double>(simcall->args[7])));
-      SIMIX_simcall_answer(simcall);
-      break;
+  simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(
+      simcall->result, simcall_HANDLER_comm_irecv(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]),
+                                                  simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]),
+                                                  simgrid::simix::unmarshal<void*>(simcall->args[2]),
+                                                  simgrid::simix::unmarshal<size_t*>(simcall->args[3]),
+                                                  simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[4]),
+                                                  simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args[5]),
+                                                  simgrid::simix::unmarshal<void*>(simcall->args[6]),
+                                                  simgrid::simix::unmarshal<double>(simcall->args[7])));
+  SIMIX_simcall_answer(simcall);
+  break;
 
 case SIMCALL_COMM_WAITANY:
       simcall_HANDLER_comm_waitany(simcall, simgrid::simix::unmarshal<xbt_dynar_t>(simcall->args[0]), simgrid::simix::unmarshal<double>(simcall->args[1]));
       break;
 
 case SIMCALL_COMM_WAIT:
-      simcall_HANDLER_comm_wait(simcall, simgrid::simix::unmarshal<smx_activity_t>(simcall->args[0]), simgrid::simix::unmarshal<double>(simcall->args[1]));
-      break;
+  simcall_HANDLER_comm_wait(
+      simcall,
+      simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]),
+      simgrid::simix::unmarshal<double>(simcall->args[1]));
+  break;
 
 case SIMCALL_COMM_TEST:
-      simcall_HANDLER_comm_test(simcall, simgrid::simix::unmarshal<smx_activity_t>(simcall->args[0]));
-      break;
+  simcall_HANDLER_comm_test(
+      simcall,
+      simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]));
+  break;
 
 case SIMCALL_COMM_TESTANY:
-      simcall_HANDLER_comm_testany(simcall, simgrid::simix::unmarshal<smx_activity_t*>(simcall->args[0]), simgrid::simix::unmarshal<size_t>(simcall->args[1]));
-      break;
+  simcall_HANDLER_comm_testany(
+      simcall,
+      simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>*>(simcall->args[0]),
+      simgrid::simix::unmarshal<size_t>(simcall->args[1]));
+  break;
 
 case SIMCALL_MUTEX_INIT:
       simgrid::simix::marshal<smx_mutex_t>(simcall->result, simcall_HANDLER_mutex_init(simcall));
@@ -298,8 +347,10 @@ case SIMCALL_FILE_WRITE:
       break;
 
 case SIMCALL_FILE_OPEN:
-      simcall_HANDLER_file_open(simcall, simgrid::simix::unmarshal<const char*>(simcall->args[0]), simgrid::simix::unmarshal<sg_host_t>(simcall->args[1]));
-      break;
+  simcall_HANDLER_file_open(simcall, simgrid::simix::unmarshal<const char*>(simcall->args[0]),
+                            simgrid::simix::unmarshal<const char*>(simcall->args[1]),
+                            simgrid::simix::unmarshal<sg_storage_t>(simcall->args[2]));
+  break;
 
 case SIMCALL_FILE_CLOSE:
       simcall_HANDLER_file_close(simcall, simgrid::simix::unmarshal<smx_file_t>(simcall->args[0]), simgrid::simix::unmarshal<sg_host_t>(simcall->args[1]));
@@ -325,11 +376,6 @@ case SIMCALL_FILE_SEEK:
       SIMIX_simcall_answer(simcall);
       break;
 
-case SIMCALL_FILE_GET_INFO:
-      simgrid::simix::marshal<xbt_dynar_t>(simcall->result, simcall_HANDLER_file_get_info(simcall, simgrid::simix::unmarshal<smx_file_t>(simcall->args[0])));
-      SIMIX_simcall_answer(simcall);
-      break;
-
 case SIMCALL_FILE_MOVE:
       simgrid::simix::marshal<int>(simcall->result, simcall_HANDLER_file_move(simcall, simgrid::simix::unmarshal<smx_file_t>(simcall->args[0]), simgrid::simix::unmarshal<const char*>(simcall->args[1])));
       SIMIX_simcall_answer(simcall);
@@ -341,9 +387,11 @@ case SIMCALL_MC_RANDOM:
       break;
 
 case SIMCALL_SET_CATEGORY:
-      SIMIX_set_category(simgrid::simix::unmarshal<smx_activity_t>(simcall->args[0]), simgrid::simix::unmarshal<const char*>(simcall->args[1]));
-      SIMIX_simcall_answer(simcall);
-      break;
+  SIMIX_set_category(
+      simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]),
+      simgrid::simix::unmarshal<const char*>(simcall->args[1]));
+  SIMIX_simcall_answer(simcall);
+  break;
 
 case SIMCALL_RUN_KERNEL:
       SIMIX_run_kernel(simgrid::simix::unmarshal<std::function<void()> const*>(simcall->args[0]));
index 389f89b..c04b0b2 100644 (file)
@@ -71,6 +71,20 @@ SG_END_DECL()
 
 #ifdef __cplusplus
 
+/* Defines the marshal/unmarshal functions for each type of parameters.
+ *
+ * They will be used in popping_accessors.h to define the functions allowing
+ * to retrieve/set each parameter of each simcall.
+ *
+ * There is a unmarshal_raw() function, which is exactly similar to unmarshal()
+ * for all types but boost::intrusive_ptr(T). For that type, the unmarshal()
+ * function builds a new intrusive_ptr wrapping the pointer (that is stored raw
+ * within the simcall) while the unmarshal_raw retrieves the raw pointer.
+ *
+ * This is used in <simcall>_getraw_<param> functions, that allow the
+ * model-checker, to read the data in the remote memory of the MCed.
+ */
+
 namespace simgrid {
 namespace simix {
 
@@ -85,15 +99,11 @@ class type {
 };
 
 template<typename T> struct marshal_t {};
-#define SIMIX_MARSHAL(T, field) \
-  inline void marshal(type<T>, u_smx_scalar& simcall, T value) \
-  { \
-    simcall.field = value; \
-  } \
-  inline T unmarshal(type<T>, u_smx_scalar const& simcall) \
-  { \
-    return simcall.field; \
-  }
+#define SIMIX_MARSHAL(T, field)                                                                                        \
+  inline void marshal(type<T>, u_smx_scalar& simcall, T value) { simcall.field = value; }                              \
+  inline T unmarshal(type<T>, u_smx_scalar const& simcall) { return simcall.field; }                                   \
+  inline T unmarshal_raw(type<T>, u_smx_scalar const& simcall)                                                         \
+  { /* Exactly same as unmarshal. It differs only for intrusive_ptr */ return simcall.field; }
 
 SIMIX_MARSHAL(char, c);
 SIMIX_MARSHAL(short, s);
@@ -109,8 +119,14 @@ SIMIX_MARSHAL(float, d);
 SIMIX_MARSHAL(double, d);
 SIMIX_MARSHAL(FPtr, fp);
 
-inline
-void unmarshal(type<void>, u_smx_scalar const& simcall) {}
+inline void unmarshal(type<void>, u_smx_scalar const& simcall)
+{
+  /* Nothing to do for void data */
+}
+inline void unmarshal_raw(type<void>, u_smx_scalar const& simcall)
+{
+  /* Nothing to do for void data */
+}
 
 template<class T> inline
 void marshal(type<T*>, u_smx_scalar& simcall, T* value)
@@ -122,19 +138,31 @@ T* unmarshal(type<T*>, u_smx_scalar const& simcall)
 {
   return static_cast<T*>(simcall.dp);
 }
+template <class T> inline T* unmarshal_raw(type<T*>, u_smx_scalar const& simcall)
+{
+  return static_cast<T*>(simcall.dp);
+}
 
 template <class T>
 inline void marshal(type<boost::intrusive_ptr<T>>, u_smx_scalar& simcall, boost::intrusive_ptr<T> value)
 {
-  intrusive_ptr_add_ref(&*value);
-  simcall.dp = static_cast<void*>(&*value);
+  if (value.get() == nullptr) { // Sometimes we return nullptr in an intrusive_ptr...
+    simcall.dp = nullptr;
+  } else {
+    intrusive_ptr_add_ref(&*value);
+    simcall.dp = static_cast<void*>(&*value);
+  }
 }
 template <class T> inline boost::intrusive_ptr<T> unmarshal(type<boost::intrusive_ptr<T>>, u_smx_scalar const& simcall)
 {
+  // refcount was already increased during the marshaling, thus the "false" as last argument
   boost::intrusive_ptr<T> res = boost::intrusive_ptr<T>(static_cast<T*>(simcall.dp), false);
-  intrusive_ptr_release(&*res);
   return res;
 }
+template <class T> inline T* unmarshal_raw(type<boost::intrusive_ptr<T>>, u_smx_scalar const& simcall)
+{
+  return static_cast<T*>(simcall.dp);
+}
 
 template<class R, class... T> inline
 void marshal(type<R(*)(T...)>, u_smx_scalar& simcall, R(*value)(T...))
@@ -146,6 +174,10 @@ auto unmarshal(type<R(*)(T...)>, u_smx_scalar simcall) -> R(*)(T...)
 {
   return (R(*)(T...)) simcall.fp;
 }
+template <class R, class... T> inline auto unmarshal_raw(type<R (*)(T...)>, u_smx_scalar simcall) -> R (*)(T...)
+{
+  return (R(*)(T...))simcall.fp;
+}
 
 template<class T> inline
 void marshal(u_smx_scalar& simcall, T const& value)
@@ -157,6 +189,10 @@ typename std::remove_reference<T>::type unmarshal(u_smx_scalar& simcall)
 {
   return unmarshal(type<T>(), simcall);
 }
+template <class T> inline typename std::remove_reference<T>::type unmarshal_raw(u_smx_scalar& simcall)
+{
+  return unmarshal(type<T>(), simcall);
+}
 
 template<std::size_t I>
 inline void marshalArgs(smx_simcall_t simcall) {}
index 649adfa..a7879aa 100644 (file)
@@ -46,26 +46,26 @@ int  process_is_suspended(smx_actor_t process) [[nohandler]];
 int  process_join(smx_actor_t process, double timeout) [[block]];
 int  process_sleep(double duration) [[block]];
 
-smx_activity_t execution_start(const char* name, double flops_amount, double priority, double bound);
-smx_activity_t execution_parallel_start(const char* name, int host_nb, sg_host_t* host_list, double* flops_amount, double* bytes_amount, double amount, double rate, double timeout) [[nohandler]];
-void          execution_cancel(smx_activity_t execution) [[nohandler]];
-void          execution_set_priority(smx_activity_t execution, double priority) [[nohandler]];
-void          execution_set_bound(smx_activity_t execution, double bound) [[nohandler]];
-int           execution_wait(smx_activity_t execution) [[block]];
+boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> execution_start(const char* name, double flops_amount, double priority, double bound);
+boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> execution_parallel_start(const char* name, int host_nb, sg_host_t* host_list, double* flops_amount, double* bytes_amount, double amount, double rate, double timeout) [[nohandler]];
+void          execution_cancel(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> execution) [[nohandler]];
+void          execution_set_priority(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> execution, double priority) [[nohandler]];
+void          execution_set_bound(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> execution, double bound) [[nohandler]];
+int           execution_wait(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> execution) [[block]];
 
 void          process_on_exit(smx_actor_t process, int_f_pvoid_pvoid_t fun, void* data) [[nohandler]];
 void          process_auto_restart_set(smx_actor_t process, int auto_restart) [[nohandler]];
 smx_actor_t   process_restart(smx_actor_t process);
 
-smx_activity_t comm_iprobe(smx_mailbox_t mbox, int type, int src, int tag, simix_match_func_t match_fun, void* data);
+boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> comm_iprobe(smx_mailbox_t mbox, int type, int src, int tag, simix_match_func_t match_fun, void* data);
 void           comm_send(smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout) [[block]];
-smx_activity_t comm_isend(smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_clean_func_t clean_fun, simix_copy_data_func_t copy_data_fun, void* data, int detached);
+boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> comm_isend(smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_clean_func_t clean_fun, simix_copy_data_func_t copy_data_fun, void* data, int detached);
 void           comm_recv(smx_actor_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout, double rate) [[block]];
-smx_activity_t comm_irecv(smx_actor_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double rate);
+boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> comm_irecv(smx_actor_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double rate);
 int            comm_waitany(xbt_dynar_t comms, double timeout) [[block]];
-void           comm_wait(smx_activity_t comm, double timeout) [[block]];
-int            comm_test(smx_activity_t comm) [[block]];
-int            comm_testany(smx_activity_t* comms, size_t count) [[block]];
+void           comm_wait(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> comm, double timeout) [[block]];
+int            comm_test(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> comm) [[block]];
+int            comm_testany(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>* comms, size_t count) [[block]];
 
 smx_mutex_t mutex_init();
 void        mutex_lock(smx_mutex_t mutex) [[block]];
@@ -87,17 +87,16 @@ int       sem_get_capacity(smx_sem_t sem);
 
 sg_size_t   file_read(smx_file_t fd, sg_size_t size, sg_host_t host) [[block]];
 sg_size_t   file_write(smx_file_t fd, sg_size_t size, sg_host_t host) [[block]];
-smx_file_t  file_open(const char* fullpath, sg_host_t host) [[block]];
+smx_file_t  file_open(const char* mount, const char* path, sg_storage_t st) [[block]];
 int         file_close(smx_file_t fd, sg_host_t host) [[block]];
 int         file_unlink(smx_file_t fd, sg_host_t host) [[nohandler]];
 sg_size_t   file_get_size(smx_file_t fd);
 sg_size_t   file_tell(smx_file_t fd);
 int         file_seek(smx_file_t fd, sg_offset_t offset, int origin);
-xbt_dynar_t file_get_info(smx_file_t fd);
 int         file_move(smx_file_t fd, const char* fullpath);
 
 int        mc_random(int min, int max);
-void       set_category(smx_activity_t synchro, const char* category) [[nohandler]];
+void       set_category(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> synchro, const char* category) [[nohandler]];
 
 void       run_kernel(std::function<void()> const* code) [[nohandler]];
 void       run_blocking(std::function<void()> const* code) [[block,nohandler]];
index 68635e5..f846463 100755 (executable)
@@ -80,14 +80,21 @@ class Simcall(object):
     def accessors(self):
         res = []
         res.append('')
+        regex = re.compile(r"^boost::intrusive_ptr<(.*?)>(.*)$") #┬áto compute the raw type
         # Arguments getter/setters
         for i in range(len(self.args)):
             arg = self.args[i]
+            rawtype = regex.sub(r'\1*\2', arg.rettype())
             res.append('static inline %s simcall_%s__get__%s(smx_simcall_t simcall) {' % (
                 arg.rettype(), self.name, arg.name))
             res.append(
                 '  return simgrid::simix::unmarshal<%s>(simcall->args[%i]);' % (arg.rettype(), i))
             res.append('}')
+            res.append('static inline %s simcall_%s__getraw__%s(smx_simcall_t simcall) {' % (
+                rawtype, self.name, arg.name))
+            res.append(
+                '  return simgrid::simix::unmarshal_raw<%s>(simcall->args[%i]);' % (rawtype, i))
+            res.append('}')
             res.append('static inline void simcall_%s__set__%s(smx_simcall_t simcall, %s arg) {' % (
                 self.name, arg.name, arg.rettype()))
             res.append('    simgrid::simix::marshal<%s>(simcall->args[%i], arg);' % (arg.rettype(), i))
@@ -95,10 +102,15 @@ class Simcall(object):
 
         # Return value getter/setters
         if self.res.type != 'void':
+            rawtype = regex.sub(r'\1*\2', self.res.rettype())
             res.append(
                 'static inline %s simcall_%s__get__result(smx_simcall_t simcall){' % (self.res.rettype(), self.name))
             res.append('    return simgrid::simix::unmarshal<%s>(simcall->result);' % self.res.rettype())
             res.append('}')
+            res.append(
+                'static inline %s simcall_%s__getraw__result(smx_simcall_t simcall){' % (rawtype, self.name))
+            res.append('    return simgrid::simix::unmarshal_raw<%s>(simcall->result);' % rawtype)
+            res.append('}')
             res.append(
                 'static inline void simcall_%s__set__result(smx_simcall_t simcall, %s result){' % (self.name, self.res.rettype()))
             res.append('    simgrid::simix::marshal<%s>(simcall->result, result);' % (self.res.rettype()))
index 6511f0c..39c1c41 100644 (file)
@@ -356,7 +356,7 @@ static void SIMIX_wake_processes()
     XBT_DEBUG("Handling the processes whose action failed (if any)");
     while ((action = surf_model_extract_failed_action_set(model))) {
       XBT_DEBUG("   Handling Action %p",action);
-      SIMIX_simcall_exit((smx_activity_t) action->getData());
+      SIMIX_simcall_exit(static_cast<simgrid::kernel::activity::ActivityImpl*>(action->getData()));
     }
     XBT_DEBUG("Handling the processes whose action terminated normally (if any)");
     while ((action = surf_model_extract_done_action_set(model))) {
@@ -364,7 +364,7 @@ static void SIMIX_wake_processes()
       if (action->getData() == nullptr)
         XBT_DEBUG("probably vcpu's action %p, skip", action);
       else
-        SIMIX_simcall_exit((smx_activity_t) action->getData());
+        SIMIX_simcall_exit(static_cast<simgrid::kernel::activity::ActivityImpl*>(action->getData()));
     }
   }
 }
@@ -653,19 +653,19 @@ void SIMIX_display_process_status()
 
       const char* synchro_description = "unknown";
 
-      if (dynamic_cast<simgrid::kernel::activity::ExecImpl*>(process->waiting_synchro) != nullptr)
+      if (boost::dynamic_pointer_cast<simgrid::kernel::activity::ExecImpl>(process->waiting_synchro) != nullptr)
         synchro_description = "execution";
 
-      if (dynamic_cast<simgrid::kernel::activity::CommImpl*>(process->waiting_synchro) != nullptr)
+      if (boost::dynamic_pointer_cast<simgrid::kernel::activity::CommImpl>(process->waiting_synchro) != nullptr)
         synchro_description = "communication";
 
-      if (dynamic_cast<simgrid::kernel::activity::SleepImpl*>(process->waiting_synchro) != nullptr)
+      if (boost::dynamic_pointer_cast<simgrid::kernel::activity::SleepImpl>(process->waiting_synchro) != nullptr)
         synchro_description = "sleeping";
 
-      if (dynamic_cast<simgrid::kernel::activity::Raw*>(process->waiting_synchro) != nullptr)
+      if (boost::dynamic_pointer_cast<simgrid::kernel::activity::RawImpl>(process->waiting_synchro) != nullptr)
         synchro_description = "synchronization";
 
-      if (dynamic_cast<simgrid::kernel::activity::Io*>(process->waiting_synchro) != nullptr)
+      if (boost::dynamic_pointer_cast<simgrid::kernel::activity::IoImpl>(process->waiting_synchro) != nullptr)
         synchro_description = "I/O";
 
 
@@ -681,7 +681,7 @@ void SIMIX_display_process_status()
 */
 
       XBT_INFO("Process %lu (%s@%s): waiting for %s synchro %p (%s) in state %d to finish", process->pid,
-               process->cname(), process->host->cname(), synchro_description, process->waiting_synchro,
+               process->cname(), process->host->cname(), synchro_description, process->waiting_synchro.get(),
                process->waiting_synchro->name.c_str(), (int)process->waiting_synchro->state);
     }
     else {
index e459249..7519162 100644 (file)
@@ -161,20 +161,21 @@ smx_activity_t SIMIX_execution_start(smx_actor_t issuer, const char *name, doubl
                                     double bound){
 
   /* alloc structures and initialize */
-  simgrid::kernel::activity::ExecImpl* exec = new simgrid::kernel::activity::ExecImpl(name, issuer->host);
+  simgrid::kernel::activity::ExecImplPtr exec =
+      simgrid::kernel::activity::ExecImplPtr(new simgrid::kernel::activity::ExecImpl(name, issuer->host));
 
   /* set surf's action */
   if (not MC_is_active() && not MC_record_replay_is_active()) {
 
     exec->surf_exec = issuer->host->pimpl_cpu->execution_start(flops_amount);
-    exec->surf_exec->setData(exec);
+    exec->surf_exec->setData(exec.get());
     exec->surf_exec->setPriority(priority);
 
     if (bound > 0)
       static_cast<simgrid::surf::CpuAction*>(exec->surf_exec)->setBound(bound);
   }
 
-  XBT_DEBUG("Create execute synchro %p: %s", exec, exec->name.c_str());
+  XBT_DEBUG("Create execute synchro %p: %s", exec.get(), exec->name.c_str());
 
   return exec;
 }
@@ -184,7 +185,8 @@ smx_activity_t SIMIX_execution_parallel_start(const char* name, int host_nb, sg_
 {
 
   /* alloc structures and initialize */
-  simgrid::kernel::activity::ExecImpl* exec = new simgrid::kernel::activity::ExecImpl(name, nullptr);
+  simgrid::kernel::activity::ExecImplPtr exec =
+      simgrid::kernel::activity::ExecImplPtr(new simgrid::kernel::activity::ExecImpl(name, nullptr));
 
   /* set surf's synchro */
   sg_host_t *host_list_cpy = xbt_new0(sg_host_t, host_nb);
@@ -201,21 +203,22 @@ smx_activity_t SIMIX_execution_parallel_start(const char* name, int host_nb, sg_
   /* set surf's synchro */
   if (not MC_is_active() && not MC_record_replay_is_active()) {
     exec->surf_exec = surf_host_model->executeParallelTask(host_nb, host_list_cpy, flops_amount, bytes_amount, rate);
-    exec->surf_exec->setData(exec);
+    exec->surf_exec->setData(exec.get());
     if (timeout > 0) {
       exec->timeoutDetector = host_list[0]->pimpl_cpu->sleep(timeout);
-      exec->timeoutDetector->setData(exec);
+      exec->timeoutDetector->setData(exec.get());
     }
   }
-  XBT_DEBUG("Create parallel execute synchro %p", exec);
+  XBT_DEBUG("Create parallel execute synchro %p", exec.get());
 
   return exec;
 }
 
 void SIMIX_execution_cancel(smx_activity_t synchro)
 {
-  XBT_DEBUG("Cancel synchro %p", synchro);
-  simgrid::kernel::activity::ExecImpl* exec = static_cast<simgrid::kernel::activity::ExecImpl*>(synchro);
+  XBT_DEBUG("Cancel synchro %p", synchro.get());
+  simgrid::kernel::activity::ExecImplPtr exec =
+      boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(synchro);
 
   if (exec->surf_exec)
     exec->surf_exec->cancel();
@@ -223,22 +226,25 @@ void SIMIX_execution_cancel(smx_activity_t synchro)
 
 void SIMIX_execution_set_priority(smx_activity_t synchro, double priority)
 {
-  simgrid::kernel::activity::ExecImpl* exec = static_cast<simgrid::kernel::activity::ExecImpl*>(synchro);
+  simgrid::kernel::activity::ExecImplPtr exec =
+      boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(synchro);
   if(exec->surf_exec)
     exec->surf_exec->setPriority(priority);
 }
 
 void SIMIX_execution_set_bound(smx_activity_t synchro, double bound)
 {
-  simgrid::kernel::activity::ExecImpl* exec = static_cast<simgrid::kernel::activity::ExecImpl*>(synchro);
+  simgrid::kernel::activity::ExecImplPtr exec =
+      boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(synchro);
   if(exec->surf_exec)
     static_cast<simgrid::surf::CpuAction*>(exec->surf_exec)->setBound(bound);
 }
 
 void simcall_HANDLER_execution_wait(smx_simcall_t simcall, smx_activity_t synchro)
 {
-  simgrid::kernel::activity::ExecImpl* exec = static_cast<simgrid::kernel::activity::ExecImpl*>(synchro);
-  XBT_DEBUG("Wait for execution of synchro %p, state %d", synchro, (int)synchro->state);
+  simgrid::kernel::activity::ExecImplPtr exec =
+      boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(synchro);
+  XBT_DEBUG("Wait for execution of synchro %p, state %d", synchro.get(), (int)synchro->state);
 
   /* Associate this simcall to the synchro */
   synchro->simcalls.push_back(simcall);
@@ -256,7 +262,7 @@ void simcall_HANDLER_execution_wait(smx_simcall_t simcall, smx_activity_t synchr
     SIMIX_execution_finish(exec);
 }
 
-void SIMIX_execution_finish(simgrid::kernel::activity::ExecImpl* exec)
+void SIMIX_execution_finish(simgrid::kernel::activity::ExecImplPtr exec)
 {
   for (smx_simcall_t simcall : exec->simcalls) {
     switch (exec->state) {
@@ -294,9 +300,6 @@ void SIMIX_execution_finish(simgrid::kernel::activity::ExecImpl* exec)
     simcall_execution_wait__set__result(simcall, exec->state);
     SIMIX_simcall_answer(simcall);
   }
-
-  /* We no longer need it */
-  exec->unref();
 }
 
 void SIMIX_set_category(smx_activity_t synchro, const char *category)
@@ -304,13 +307,15 @@ void SIMIX_set_category(smx_activity_t synchro, const char *category)
   if (synchro->state != SIMIX_RUNNING)
     return;
 
-  simgrid::kernel::activity::ExecImpl* exec = dynamic_cast<simgrid::kernel::activity::ExecImpl*>(synchro);
+  simgrid::kernel::activity::ExecImplPtr exec =
+      boost::dynamic_pointer_cast<simgrid::kernel::activity::ExecImpl>(synchro);
   if (exec != nullptr) {
     exec->surf_exec->setCategory(category);
     return;
   }
 
-  simgrid::kernel::activity::CommImpl* comm = dynamic_cast<simgrid::kernel::activity::CommImpl*>(synchro);
+  simgrid::kernel::activity::CommImplPtr comm =
+      boost::dynamic_pointer_cast<simgrid::kernel::activity::CommImpl>(synchro);
   if (comm != nullptr) {
     comm->surf_comm->setCategory(category);
   }
index 91149d1..5a953dd 100644 (file)
@@ -48,20 +48,21 @@ XBT_PRIVATE void SIMIX_host_add_auto_restart_process(sg_host_t host,
                                          int auto_restart);
 
 XBT_PRIVATE void SIMIX_host_autorestart(sg_host_t host);
-XBT_PRIVATE smx_activity_t SIMIX_execution_start(smx_actor_t issuer, const char *name,
-    double flops_amount, double priority, double bound);
-XBT_PRIVATE smx_activity_t SIMIX_execution_parallel_start(const char* name, int host_nb, sg_host_t* host_list,
-                                                          double* flops_amount, double* bytes_amount, double amount,
-                                                          double rate, double timeout);
 XBT_PRIVATE void SIMIX_execution_cancel(smx_activity_t synchro);
 XBT_PRIVATE void SIMIX_execution_set_priority(smx_activity_t synchro, double priority);
 XBT_PRIVATE void SIMIX_execution_set_bound(smx_activity_t synchro, double bound);
 
-XBT_PRIVATE void SIMIX_execution_finish(simgrid::kernel::activity::ExecImpl* exec);
+XBT_PRIVATE void SIMIX_execution_finish(simgrid::kernel::activity::ExecImplPtr exec);
 
 XBT_PRIVATE void SIMIX_set_category(smx_activity_t synchro, const char *category);
 
 SG_END_DECL()
 
+XBT_PRIVATE smx_activity_t SIMIX_execution_start(smx_actor_t issuer, const char* name, double flops_amount,
+                                                 double priority, double bound);
+XBT_PRIVATE smx_activity_t SIMIX_execution_parallel_start(const char* name, int host_nb, sg_host_t* host_list,
+                                                          double* flops_amount, double* bytes_amount, double amount,
+                                                          double rate, double timeout);
+
 #endif
 
index 9ba2b7e..e033cb9 100644 (file)
@@ -9,6 +9,8 @@
 #include <xbt/dict.h>
 
 #include "simgrid/s4u/Host.hpp"
+#include "simgrid/s4u/Storage.hpp"
+#include "src/surf/StorageImpl.hpp"
 
 #include <mc/mc.h>
 
@@ -33,7 +35,7 @@ smx_activity_t SIMIX_file_read(smx_file_t fd, sg_size_t size, sg_host_t host)
   if (host->isOff())
     THROWF(host_error, 0, "Host %s failed, you cannot call this function", host->cname());
 
-  simgrid::kernel::activity::Io *synchro = new simgrid::kernel::activity::Io();
+  simgrid::kernel::activity::IoImpl* synchro = new simgrid::kernel::activity::IoImpl();
   synchro->host = host;
   synchro->surf_io = surf_host_read(host, fd->surf_file, size);
 
@@ -56,7 +58,7 @@ smx_activity_t SIMIX_file_write(smx_file_t fd, sg_size_t size, sg_host_t host)
   if (host->isOff())
     THROWF(host_error, 0, "Host %s failed, you cannot call this function", host->cname());
 
-  simgrid::kernel::activity::Io *synchro = new simgrid::kernel::activity::Io();
+  simgrid::kernel::activity::IoImpl* synchro = new simgrid::kernel::activity::IoImpl();
   synchro->host = host;
   synchro->surf_io = surf_host_write(host, fd->surf_file, size);
   synchro->surf_io->setData(synchro);
@@ -66,21 +68,21 @@ smx_activity_t SIMIX_file_write(smx_file_t fd, sg_size_t size, sg_host_t host)
 }
 
 //SIMIX FILE OPEN
-void simcall_HANDLER_file_open(smx_simcall_t simcall, const char* fullpath, sg_host_t host)
+void simcall_HANDLER_file_open(smx_simcall_t simcall, const char* mount, const char* path, sg_storage_t st)
 {
-  smx_activity_t synchro = SIMIX_file_open(fullpath, host);
+  smx_activity_t synchro = SIMIX_file_open(mount, path, st);
   synchro->simcalls.push_back(simcall);
   simcall->issuer->waiting_synchro = synchro;
 }
 
-smx_activity_t SIMIX_file_open(const char* fullpath, sg_host_t host)
+smx_activity_t SIMIX_file_open(const char* mount, const char* path, sg_storage_t st)
 {
-  if (host->isOff())
-    THROWF(host_error, 0, "Host %s failed, you cannot call this function", host->cname());
+  if (st->host()->isOff())
+    THROWF(host_error, 0, "Host %s failed, you cannot call this function", st->host()->cname());
 
-  simgrid::kernel::activity::Io *synchro = new simgrid::kernel::activity::Io();
-  synchro->host = host;
-  synchro->surf_io = surf_host_open(host, fullpath);
+  simgrid::kernel::activity::IoImpl* synchro = new simgrid::kernel::activity::IoImpl();
+  synchro->host                              = st->host();
+  synchro->surf_io                           = st->pimpl_->open(mount, path);
   synchro->surf_io->setData(synchro);
   XBT_DEBUG("Create io synchro %p", synchro);
 
@@ -100,7 +102,7 @@ smx_activity_t SIMIX_file_close(smx_file_t fd, sg_host_t host)
   if (host->isOff())
     THROWF(host_error, 0, "Host %s failed, you cannot call this function", host->cname());
 
-  simgrid::kernel::activity::Io *synchro = new simgrid::kernel::activity::Io();
+  simgrid::kernel::activity::IoImpl* synchro = new simgrid::kernel::activity::IoImpl();
   synchro->host = host;
   synchro->surf_io = surf_host_close(host, fd->surf_file);
   synchro->surf_io->setData(synchro);
@@ -142,18 +144,6 @@ sg_size_t SIMIX_file_tell(smx_actor_t process, smx_file_t fd)
   return  surf_host_file_tell(host, fd->surf_file);
 }
 
-
-xbt_dynar_t simcall_HANDLER_file_get_info(smx_simcall_t simcall, smx_file_t fd)
-{
-  return SIMIX_file_get_info(simcall->issuer, fd);
-}
-
-xbt_dynar_t SIMIX_file_get_info(smx_actor_t process, smx_file_t fd)
-{
-  sg_host_t host = process->host;
-  return  surf_host_get_info(host, fd->surf_file);
-}
-
 int simcall_HANDLER_file_seek(smx_simcall_t simcall, smx_file_t fd, sg_offset_t offset, int origin)
 {
   return SIMIX_file_seek(simcall->issuer, fd, offset, origin);
@@ -178,11 +168,10 @@ int SIMIX_file_move(smx_actor_t process, smx_file_t file, const char* fullpath)
 
 void SIMIX_io_destroy(smx_activity_t synchro)
 {
-  simgrid::kernel::activity::Io *io = static_cast<simgrid::kernel::activity::Io*>(synchro);
-  XBT_DEBUG("Destroy synchro %p", synchro);
+  simgrid::kernel::activity::IoImplPtr io = boost::static_pointer_cast<simgrid::kernel::activity::IoImpl>(synchro);
+  XBT_DEBUG("Destroy synchro %p", synchro.get());
   if (io->surf_io)
     io->surf_io->unref();
-  delete io;
 }
 
 void SIMIX_io_finish(smx_activity_t synchro)
index 0d48df1..70e553d 100644 (file)
 
 XBT_PRIVATE smx_activity_t SIMIX_file_read(smx_file_t fd, sg_size_t size, sg_host_t host);
 XBT_PRIVATE smx_activity_t SIMIX_file_write(smx_file_t fd, sg_size_t size, sg_host_t host);
-XBT_PRIVATE smx_activity_t SIMIX_file_open(const char* fullpath, sg_host_t host);
+XBT_PRIVATE smx_activity_t SIMIX_file_open(const char* mount, const char* path, sg_storage_t st);
 XBT_PRIVATE smx_activity_t SIMIX_file_close(smx_file_t fd, sg_host_t host);
 XBT_PRIVATE int SIMIX_file_unlink(smx_file_t fd, sg_host_t host);
 XBT_PRIVATE sg_size_t SIMIX_file_get_size(smx_actor_t process, smx_file_t fd);
 XBT_PRIVATE sg_size_t SIMIX_file_tell(smx_actor_t process, smx_file_t fd);
-XBT_PRIVATE xbt_dynar_t SIMIX_file_get_info(smx_actor_t process, smx_file_t fd);
 XBT_PRIVATE int SIMIX_file_seek(smx_actor_t process, smx_file_t fd, sg_offset_t offset, int origin);
 XBT_PRIVATE int SIMIX_file_move(smx_actor_t process, smx_file_t fd, const char* fullpath);
 
index 1fbcb08..07f4c3c 100644 (file)
@@ -26,18 +26,14 @@ 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 simgrid::kernel::activity::CommImpl*
-_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 void SIMIX_comm_start(simgrid::kernel::activity::CommImplPtr synchro);
 
 /**
  *  \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 activity if found, nullptr otherwise
  */
-static simgrid::kernel::activity::CommImpl*
+static simgrid::kernel::activity::CommImplPtr
 _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)
@@ -46,19 +42,19 @@ _find_matching_comm(boost::circular_buffer_space_optimized<smx_activity_t>* dequ
 
   for(auto it = deque->begin(); it != deque->end(); it++){
     smx_activity_t synchro = *it;
-    simgrid::kernel::activity::CommImpl* comm = static_cast<simgrid::kernel::activity::CommImpl*>(synchro);
+    simgrid::kernel::activity::CommImplPtr comm =
+        boost::dynamic_pointer_cast<simgrid::kernel::activity::CommImpl>(std::move(synchro));
 
     if (comm->type == SIMIX_COMM_SEND) {
       other_user_data = comm->src_data;
     } else if (comm->type == SIMIX_COMM_RECEIVE) {
       other_user_data = comm->dst_data;
     }
-    if (comm->type == type && (match_fun == nullptr || match_fun(this_user_data, other_user_data, synchro)) &&
+    if (comm->type == type && (match_fun == nullptr || match_fun(this_user_data, other_user_data, comm)) &&
         (not comm->match_fun || comm->match_fun(other_user_data, this_user_data, my_synchro))) {
-      XBT_DEBUG("Found a matching communication synchro %p", comm);
+      XBT_DEBUG("Found a matching communication synchro %p", comm.get());
       if (remove_matching)
         deque->erase(it);
-      comm->ref();
 #if SIMGRID_HAVE_MC
       comm->mbox_cpy = comm->mbox;
 #endif
@@ -67,7 +63,7 @@ _find_matching_comm(boost::circular_buffer_space_optimized<smx_activity_t>* dequ
     }
     XBT_DEBUG("Sorry, communication synchro %p does not match our needs:"
               " its type is %d but we are looking for a comm of type %d (or maybe the filtering didn't match)",
-              comm, (int)comm->type, (int)type);
+              comm.get(), (int)comm->type, (int)type);
   }
   XBT_DEBUG("No matching communication synchro found");
   return nullptr;
@@ -96,36 +92,34 @@ XBT_PRIVATE smx_activity_t simcall_HANDLER_comm_isend(smx_simcall_t simcall, smx
                                   void (*copy_data_fun)(smx_activity_t, void*, size_t),// used to copy data if not default one
                           void *data, int detached)
 {
-  XBT_DEBUG("send from %p", mbox);
+  XBT_DEBUG("send from mailbox %p", mbox);
 
   /* Prepare a synchro describing us, so that it gets passed to the user-provided filter of other side */
-  simgrid::kernel::activity::CommImpl* this_comm = new simgrid::kernel::activity::CommImpl(SIMIX_COMM_SEND);
+  simgrid::kernel::activity::CommImplPtr this_comm =
+      simgrid::kernel::activity::CommImplPtr(new simgrid::kernel::activity::CommImpl(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 */
-  simgrid::kernel::activity::CommImpl* other_comm =
+  simgrid::kernel::activity::CommImplPtr other_comm =
       _find_matching_comm(&mbox->comm_queue, SIMIX_COMM_RECEIVE, match_fun, data, this_comm, /*remove_matching*/ true);
 
   if (not other_comm) {
-    other_comm = this_comm;
+    other_comm = std::move(this_comm);
 
-    if (mbox->permanent_receiver!=nullptr){
+    if (mbox->permanent_receiver != nullptr) {
       //this mailbox is for small messages, which have to be sent right now
       other_comm->state   = SIMIX_READY;
       other_comm->dst_proc=mbox->permanent_receiver.get();
-      other_comm->ref();
       mbox->done_comm_queue.push_back(other_comm);
-      XBT_DEBUG("pushing a message into the permanent receive list %p, comm %p", mbox, other_comm);
+      XBT_DEBUG("pushing a message into the permanent receive list %p, comm %p", mbox, other_comm.get());
 
     }else{
-      mbox->push(this_comm);
+      mbox->push(other_comm);
     }
   } else {
     XBT_DEBUG("Receive already pushed");
-    this_comm->unref();
-    this_comm->unref();
 
     other_comm->state = SIMIX_READY;
     other_comm->type = SIMIX_COMM_READY;
@@ -185,14 +179,14 @@ smx_activity_t SIMIX_comm_irecv(smx_actor_t dst_proc, smx_mailbox_t mbox, void *
     void (*copy_data_fun)(smx_activity_t, void*, size_t), // used to copy data if not default one
     void *data, double rate)
 {
-  simgrid::kernel::activity::CommImpl* this_synchro = new simgrid::kernel::activity::CommImpl(SIMIX_COMM_RECEIVE);
-  XBT_DEBUG("recv from %p %p. this_synchro=%p", mbox, &mbox->comm_queue, this_synchro);
+  simgrid::kernel::activity::CommImplPtr this_synchro =
+      simgrid::kernel::activity::CommImplPtr(new simgrid::kernel::activity::CommImpl(SIMIX_COMM_RECEIVE));
+  XBT_DEBUG("recv from mbox %p. this_synchro=%p", mbox, this_synchro.get());
 
-  simgrid::kernel::activity::CommImpl* other_comm;
+  simgrid::kernel::activity::CommImplPtr other_comm;
   //communication already done, get it inside the list of completed comms
   if (mbox->permanent_receiver != nullptr && not mbox->done_comm_queue.empty()) {
 
-    this_synchro->unref();
     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_comm = _find_matching_comm(&mbox->done_comm_queue, SIMIX_COMM_SEND, match_fun, data, this_synchro,
@@ -204,14 +198,11 @@ smx_activity_t SIMIX_comm_irecv(smx_actor_t dst_proc, smx_mailbox_t mbox, void *
       mbox->push(this_synchro);
     } else {
       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);
+        XBT_DEBUG("comm %p has been already sent, and is finished, destroy it", other_comm.get());
         other_comm->state = SIMIX_DONE;
         other_comm->type = SIMIX_COMM_DONE;
         other_comm->mbox = nullptr;
-        other_comm->unref();
       }
-      other_comm->unref();
-      this_synchro->unref();
     }
   } else {
     /* Prepare a comm describing us, so that it gets passed to the user-provided filter of other side */
@@ -223,19 +214,15 @@ smx_activity_t SIMIX_comm_irecv(smx_actor_t dst_proc, smx_mailbox_t mbox, void *
     other_comm = _find_matching_comm(&mbox->comm_queue, SIMIX_COMM_SEND, match_fun, data, this_synchro,
                                      /*remove_matching*/ true);
 
-    if (not other_comm) {
-      XBT_DEBUG("Receive pushed first %zu", mbox->comm_queue.size());
+    if (other_comm == nullptr) {
+      XBT_DEBUG("Receive pushed first (%zu comm enqueued so far)", mbox->comm_queue.size());
       other_comm = this_synchro;
       mbox->push(this_synchro);
     } else {
-      XBT_DEBUG("Match my %p with the existing %p", this_synchro, other_comm);
-
-      other_comm = static_cast<simgrid::kernel::activity::CommImpl*>(other_comm);
+      XBT_DEBUG("Match my %p with the existing %p", this_synchro.get(), other_comm.get());
 
       other_comm->state = SIMIX_READY;
       other_comm->type = SIMIX_COMM_READY;
-      this_synchro->unref();
-      this_synchro->unref();
     }
     dst_proc->comms.push_back(other_comm);
   }
@@ -272,13 +259,13 @@ smx_activity_t SIMIX_comm_iprobe(smx_actor_t dst_proc, smx_mailbox_t mbox, int t
                               int tag, int (*match_fun)(void *, void *, smx_activity_t), void *data)
 {
   XBT_DEBUG("iprobe from %p %p", mbox, &mbox->comm_queue);
-  simgrid::kernel::activity::CommImpl* this_comm;
+  simgrid::kernel::activity::CommImplPtr this_comm;
   int smx_type;
   if(type == 1){
-    this_comm = new simgrid::kernel::activity::CommImpl(SIMIX_COMM_SEND);
+    this_comm = simgrid::kernel::activity::CommImplPtr(new simgrid::kernel::activity::CommImpl(SIMIX_COMM_SEND));
     smx_type = SIMIX_COMM_RECEIVE;
   } else{
-    this_comm = new simgrid::kernel::activity::CommImpl(SIMIX_COMM_RECEIVE);
+    this_comm = simgrid::kernel::activity::CommImplPtr(new simgrid::kernel::activity::CommImpl(SIMIX_COMM_RECEIVE));
     smx_type = SIMIX_COMM_SEND;
   }
   smx_activity_t other_synchro=nullptr;
@@ -293,17 +280,13 @@ smx_activity_t SIMIX_comm_iprobe(smx_actor_t dst_proc, smx_mailbox_t mbox, int t
       (e_smx_comm_type_t) smx_type, match_fun, data, this_comm,/*remove_matching*/false);
   }
 
-  if(other_synchro)
-    other_synchro->unref();
-
-  this_comm->unref();
   return other_synchro;
 }
 
 void simcall_HANDLER_comm_wait(smx_simcall_t simcall, smx_activity_t synchro, double timeout)
 {
   /* Associate this simcall to the wait synchro */
-  XBT_DEBUG("simcall_HANDLER_comm_wait, %p", synchro);
+  XBT_DEBUG("simcall_HANDLER_comm_wait, %p", synchro.get());
 
   synchro->simcalls.push_back(simcall);
   simcall->issuer->waiting_synchro = synchro;
@@ -318,7 +301,8 @@ void simcall_HANDLER_comm_wait(smx_simcall_t simcall, smx_activity_t synchro, do
       if (timeout < 0.0)
         THROW_IMPOSSIBLE;
 
-      simgrid::kernel::activity::CommImpl* comm = static_cast<simgrid::kernel::activity::CommImpl*>(synchro);
+      simgrid::kernel::activity::CommImplPtr comm =
+          boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(synchro);
       if (comm->src_proc == simcall->issuer)
         comm->state = SIMIX_SRC_TIMEOUT;
       else
@@ -335,9 +319,10 @@ void simcall_HANDLER_comm_wait(smx_simcall_t simcall, smx_activity_t synchro, do
     SIMIX_comm_finish(synchro);
   } else { /* if (timeout >= 0) { we need a surf sleep action even when there is no timeout, otherwise surf won't tell us when the host fails */
     surf_action_t sleep = simcall->issuer->host->pimpl_cpu->sleep(timeout);
-    sleep->setData(synchro);
+    sleep->setData(&*synchro);
 
-    simgrid::kernel::activity::CommImpl* comm = static_cast<simgrid::kernel::activity::CommImpl*>(synchro);
+    simgrid::kernel::activity::CommImplPtr comm =
+        boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(synchro);
     if (simcall->issuer == comm->src_proc)
       comm->src_timeout = sleep;
     else
@@ -347,7 +332,8 @@ void simcall_HANDLER_comm_wait(smx_simcall_t simcall, smx_activity_t synchro, do
 
 void simcall_HANDLER_comm_test(smx_simcall_t simcall, smx_activity_t synchro)
 {
-  simgrid::kernel::activity::CommImpl* comm = static_cast<simgrid::kernel::activity::CommImpl*>(synchro);
+  simgrid::kernel::activity::CommImplPtr comm =
+      boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(synchro);
 
   if (MC_is_active() || MC_record_replay_is_active()){
     simcall_comm_test__set__result(simcall, comm->src_proc && comm->dst_proc);
@@ -370,8 +356,8 @@ void simcall_HANDLER_comm_test(smx_simcall_t simcall, smx_activity_t synchro)
   }
 }
 
-void simcall_HANDLER_comm_testany(
-  smx_simcall_t simcall, simgrid::kernel::activity::ActivityImpl* comms[], size_t count)
+void simcall_HANDLER_comm_testany(smx_simcall_t simcall, simgrid::kernel::activity::ActivityImplPtr comms[],
+                                  size_t count)
 {
   // The default result is -1 -- this means, "nothing is ready".
   // It can be changed below, but only if something matches.
@@ -382,7 +368,7 @@ void simcall_HANDLER_comm_testany(
     if(idx == -1){
       SIMIX_simcall_answer(simcall);
     }else{
-      simgrid::kernel::activity::ActivityImpl* synchro = comms[idx];
+      simgrid::kernel::activity::ActivityImplPtr synchro = comms[idx];
       simcall_comm_testany__set__result(simcall, idx);
       synchro->simcalls.push_back(simcall);
       synchro->state = SIMIX_DONE;
@@ -392,7 +378,7 @@ void simcall_HANDLER_comm_testany(
   }
 
   for (std::size_t i = 0; i != count; ++i) {
-    simgrid::kernel::activity::ActivityImpl* synchro = comms[i];
+    simgrid::kernel::activity::ActivityImplPtr synchro = comms[i];
     if (synchro->state != SIMIX_WAITING && synchro->state != SIMIX_RUNNING) {
       simcall_comm_testany__set__result(simcall, i);
       synchro->simcalls.push_back(simcall);
@@ -405,14 +391,11 @@ void simcall_HANDLER_comm_testany(
 
 void simcall_HANDLER_comm_waitany(smx_simcall_t simcall, xbt_dynar_t synchros, double timeout)
 {
-  smx_activity_t synchro;
-  unsigned int cursor = 0;
-
   if (MC_is_active() || MC_record_replay_is_active()){
     if (timeout > 0.0)
       xbt_die("Timeout not implemented for waitany in the model-checker");
     int idx = SIMCALL_GET_MC_VALUE(simcall);
-    synchro = xbt_dynar_get_as(synchros, idx, smx_activity_t);
+    smx_activity_t synchro = xbt_dynar_get_as(synchros, idx, smx_activity_t);
     synchro->simcalls.push_back(simcall);
     simcall_comm_waitany__set__result(simcall, idx);
     synchro->state = SIMIX_DONE;
@@ -430,7 +413,10 @@ void simcall_HANDLER_comm_waitany(smx_simcall_t simcall, xbt_dynar_t synchros, d
     });
   }
 
-  xbt_dynar_foreach(synchros, cursor, synchro){
+  unsigned int cursor;
+  simgrid::kernel::activity::ActivityImpl* ptr;
+  xbt_dynar_foreach(synchros, cursor, ptr){
+    smx_activity_t synchro = simgrid::kernel::activity::ActivityImplPtr(ptr);
     /* associate this simcall to the the synchro */
     synchro->simcalls.push_back(simcall);
 
@@ -444,11 +430,13 @@ void simcall_HANDLER_comm_waitany(smx_simcall_t simcall, xbt_dynar_t synchros, d
 
 void SIMIX_waitany_remove_simcall_from_actions(smx_simcall_t simcall)
 {
-  smx_activity_t synchro;
   unsigned int cursor = 0;
   xbt_dynar_t synchros = simcall_comm_waitany__get__comms(simcall);
 
-  xbt_dynar_foreach(synchros, cursor, synchro) {
+  simgrid::kernel::activity::ActivityImpl* ptr;
+  xbt_dynar_foreach(synchros, cursor, ptr){
+    smx_activity_t synchro = simgrid::kernel::activity::ActivityImplPtr(ptr);
+
     // Remove the first occurence of simcall:
     auto i = boost::range::find(synchro->simcalls, simcall);
     if (i !=  synchro->simcalls.end())
@@ -460,21 +448,19 @@ void SIMIX_waitany_remove_simcall_from_actions(smx_simcall_t simcall)
  *  \brief Starts the simulation of a communication synchro.
  *  \param synchro the communication synchro
  */
-static inline void SIMIX_comm_start(smx_activity_t synchro)
+static inline void SIMIX_comm_start(simgrid::kernel::activity::CommImplPtr comm)
 {
-  simgrid::kernel::activity::CommImpl* comm = static_cast<simgrid::kernel::activity::CommImpl*>(synchro);
-
   /* If both the sender and the receiver are already there, start the communication */
-  if (synchro->state == SIMIX_READY) {
+  if (comm->state == SIMIX_READY) {
 
     simgrid::s4u::Host* sender   = comm->src_proc->host;
     simgrid::s4u::Host* receiver = comm->dst_proc->host;
 
     comm->surf_comm = surf_network_model->communicate(sender, receiver, comm->task_size, comm->rate);
-    comm->surf_comm->setData(synchro);
+    comm->surf_comm->setData(comm.get());
     comm->state = SIMIX_RUNNING;
 
-    XBT_DEBUG("Starting communication %p from '%s' to '%s' (surf_action: %p)", synchro, sender->cname(),
+    XBT_DEBUG("Starting communication %p from '%s' to '%s' (surf_action: %p)", comm.get(), sender->cname(),
               receiver->cname(), comm->surf_comm);
 
     /* If a link is failed, detect it immediately */
@@ -508,7 +494,8 @@ static inline void SIMIX_comm_start(smx_activity_t synchro)
  */
 void SIMIX_comm_finish(smx_activity_t synchro)
 {
-  simgrid::kernel::activity::CommImpl* comm = static_cast<simgrid::kernel::activity::CommImpl*>(synchro);
+  simgrid::kernel::activity::CommImplPtr comm =
+      boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(synchro);
 
   while (not synchro->simcalls.empty()) {
     smx_simcall_t simcall = synchro->simcalls.front();
@@ -546,7 +533,7 @@ void SIMIX_comm_finish(smx_activity_t synchro)
       switch (comm->state) {
 
         case SIMIX_DONE:
-          XBT_DEBUG("Communication %p complete!", synchro);
+          XBT_DEBUG("Communication %p complete!", synchro.get());
           SIMIX_comm_copy_data(synchro);
           break;
 
@@ -577,7 +564,7 @@ void SIMIX_comm_finish(smx_activity_t synchro)
         case SIMIX_LINK_FAILURE:
           XBT_DEBUG("Link failure in synchro %p between '%s' and '%s': posting an exception to the issuer: %s (%p) "
                     "detached:%d",
-                    synchro, comm->src_proc ? comm->src_proc->host->cname() : nullptr,
+                    synchro.get(), comm->src_proc ? comm->src_proc->host->cname() : nullptr,
                     comm->dst_proc ? comm->dst_proc->host->cname() : nullptr, simcall->issuer->cname(), simcall->issuer,
                     comm->detached);
           if (comm->src_proc == simcall->issuer) {
@@ -666,7 +653,8 @@ void SIMIX_comm_set_copy_data_callback(void (*callback) (smx_activity_t, void*,
 
 void SIMIX_comm_copy_pointer_callback(smx_activity_t synchro, void* buff, size_t buff_size)
 {
-  simgrid::kernel::activity::CommImpl* comm = static_cast<simgrid::kernel::activity::CommImpl*>(synchro);
+  simgrid::kernel::activity::CommImplPtr comm =
+      boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(synchro);
 
   xbt_assert((buff_size == sizeof(void *)), "Cannot copy %zu bytes: must be sizeof(void*)", buff_size);
   *(void **) (comm->dst_buff) = buff;
@@ -674,7 +662,8 @@ void SIMIX_comm_copy_pointer_callback(smx_activity_t synchro, void* buff, size_t
 
 void SIMIX_comm_copy_buffer_callback(smx_activity_t synchro, void* buff, size_t buff_size)
 {
-  simgrid::kernel::activity::CommImpl* comm = static_cast<simgrid::kernel::activity::CommImpl*>(synchro);
+  simgrid::kernel::activity::CommImplPtr comm =
+      boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(synchro);
 
   XBT_DEBUG("Copy the data over");
   memcpy(comm->dst_buff, buff, buff_size);
@@ -690,14 +679,15 @@ void SIMIX_comm_copy_buffer_callback(smx_activity_t synchro, void* buff, size_t
  */
 void SIMIX_comm_copy_data(smx_activity_t synchro)
 {
-  simgrid::kernel::activity::CommImpl* comm = static_cast<simgrid::kernel::activity::CommImpl*>(synchro);
+  simgrid::kernel::activity::CommImplPtr comm =
+      boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(synchro);
 
   size_t buff_size = comm->src_buff_size;
   /* If there is no data to copy then return */
   if (not comm->src_buff || not comm->dst_buff || comm->copied)
     return;
 
-  XBT_DEBUG("Copying comm %p data from %s (%p) -> %s (%p) (%zu bytes)", comm,
+  XBT_DEBUG("Copying comm %p data from %s (%p) -> %s (%p) (%zu bytes)", comm.get(),
             comm->src_proc ? comm->src_proc->host->cname() : "a finished process", comm->src_buff,
             comm->dst_proc ? comm->dst_proc->host->cname() : "a finished process", comm->dst_buff, buff_size);
 
index 602dfdf..85d9107 100644 (file)
@@ -6,8 +6,9 @@
 #ifndef SIMIX_PRIVATE_H
 #define SIMIX_PRIVATE_H
 
-#include <signal.h>
+#include "simgrid/s4u/Actor.hpp"
 #include "src/kernel/context/Context.hpp"
+#include <signal.h>
 
 #include <map>
 
@@ -17,6 +18,8 @@ namespace simgrid {
 namespace simix {
 
 class Global {
+  friend bool simgrid::s4u::this_actor::isMaestro();
+
 public:
   smx_context_factory_t context_factory = nullptr;
   xbt_dynar_t process_to_run = nullptr;
index c063d08..c4d9731 100644 (file)
@@ -27,9 +27,10 @@ static smx_activity_t SIMIX_synchro_wait(sg_host_t smx_host, double timeout)
 {
   XBT_IN("(%p, %f)",smx_host,timeout);
 
-  simgrid::kernel::activity::Raw *sync = new simgrid::kernel::activity::Raw();
+  simgrid::kernel::activity::RawImplPtr sync =
+      simgrid::kernel::activity::RawImplPtr(new simgrid::kernel::activity::RawImpl());
   sync->sleep                          = smx_host->pimpl_cpu->sleep(timeout);
-  sync->sleep->setData(sync);
+  sync->sleep->setData(&*sync);
   XBT_OUT();
   return sync;
 }
@@ -67,7 +68,7 @@ void SIMIX_synchro_stop_waiting(smx_actor_t process, smx_simcall_t simcall)
 
 void SIMIX_synchro_finish(smx_activity_t synchro)
 {
-  XBT_IN("(%p)",synchro);
+  XBT_IN("(%p)", synchro.get());
   smx_simcall_t simcall = synchro->simcalls.front();
   synchro->simcalls.pop_front();
 
@@ -89,7 +90,6 @@ void SIMIX_synchro_finish(smx_activity_t synchro)
 
   SIMIX_synchro_stop_waiting(simcall->issuer, simcall);
   simcall->issuer->waiting_synchro = nullptr;
-  delete synchro;
   SIMIX_simcall_answer(simcall);
   XBT_OUT();
 }
@@ -175,7 +175,6 @@ void MutexImpl::unlock(smx_actor_t issuer)
   if (xbt_swag_size(this->sleeping) > 0) {
     /*process to wake up */
     smx_actor_t p = (smx_actor_t) xbt_swag_extract(this->sleeping);
-    delete p->waiting_synchro;
     p->waiting_synchro = nullptr;
     this->owner = p;
     SIMIX_simcall_answer(&p->simcall);
@@ -318,7 +317,6 @@ void SIMIX_cond_signal(smx_cond_t cond)
   if ((proc = (smx_actor_t) xbt_swag_extract(cond->sleeping))) {
 
     /* Destroy waiter's synchronization */
-    delete proc->waiting_synchro;
     proc->waiting_synchro = nullptr;
 
     /* Now transform the cond wait simcall into a mutex lock one */
@@ -431,7 +429,6 @@ void SIMIX_sem_release(smx_sem_t sem)
 
   XBT_DEBUG("Sem release semaphore %p", sem);
   if ((proc = (smx_actor_t) xbt_swag_extract(sem->sleeping))) {
-    delete proc->waiting_synchro;
     proc->waiting_synchro = nullptr;
     SIMIX_simcall_answer(&proc->simcall);
   } else {
index d1e2ab0..f128f59 100644 (file)
@@ -4,6 +4,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "simgrid/s4u/Host.hpp"
+#include <climits>
 
 #include "src/simix/smx_private.h"
 #include "src/smpi/private.h"
index 791b8da..1abaa45 100644 (file)
@@ -5,9 +5,10 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "simgrid/msg.h" /* barrier */
+#include "src/smpi/SmpiHost.hpp"
 #include "src/smpi/private.h"
 #include "src/smpi/smpi_comm.hpp"
-#include "src/smpi/SmpiHost.hpp"
+#include <map>
 
 namespace simgrid {
 namespace smpi {
index ad0834c..b7a827c 100644 (file)
@@ -79,7 +79,7 @@ simgrid::smpi::Process* smpi_process()
   smx_actor_t me = SIMIX_process_self();
   if (me == nullptr) // This happens sometimes (eg, when linking against NS3 because it pulls openMPI...)
     return nullptr;
-  simgrid::MsgActorExt* msgExt = static_cast<simgrid::MsgActorExt*>(me->data);
+  simgrid::msg::ActorExt* msgExt = static_cast<simgrid::msg::ActorExt*>(me->data);
   return static_cast<simgrid::smpi::Process*>(msgExt->data);
 }
 
@@ -144,7 +144,8 @@ static void check_blocks(std::vector<std::pair<size_t, size_t>> &private_blocks,
 
 void smpi_comm_copy_buffer_callback(smx_activity_t synchro, void *buff, size_t buff_size)
 {
-  simgrid::kernel::activity::CommImpl* comm = dynamic_cast<simgrid::kernel::activity::CommImpl*>(synchro);
+  simgrid::kernel::activity::CommImplPtr comm =
+      boost::dynamic_pointer_cast<simgrid::kernel::activity::CommImpl>(synchro);
   int src_shared                        = 0;
   int dst_shared                        = 0;
   size_t src_offset                     = 0;
@@ -179,7 +180,7 @@ void smpi_comm_copy_buffer_callback(smx_activity_t synchro, void *buff, size_t b
        XBT_DEBUG("Privatization : We are copying from a zone inside global memory... Saving data to temp buffer !");
 
        smpi_switch_data_segment(
-           static_cast<simgrid::smpi::Process*>((static_cast<simgrid::MsgActorExt*>(comm->src_proc->data)->data))
+           static_cast<simgrid::smpi::Process*>((static_cast<simgrid::msg::ActorExt*>(comm->src_proc->data)->data))
                ->index());
        tmpbuff = static_cast<void*>(xbt_malloc(buff_size));
        memcpy_private(tmpbuff, buff, private_blocks);
@@ -189,7 +190,7 @@ void smpi_comm_copy_buffer_callback(smx_activity_t synchro, void *buff, size_t b
       && ((char*)comm->dst_buff < smpi_start_data_exe + smpi_size_data_exe )){
        XBT_DEBUG("Privatization : We are copying to a zone inside global memory - Switch data segment");
        smpi_switch_data_segment(
-           static_cast<simgrid::smpi::Process*>((static_cast<simgrid::MsgActorExt*>(comm->dst_proc->data)->data))
+           static_cast<simgrid::smpi::Process*>((static_cast<simgrid::msg::ActorExt*>(comm->dst_proc->data)->data))
                ->index());
   }
   XBT_DEBUG("Copying %zu bytes from %p to %p", buff_size, tmpbuff,comm->dst_buff);
index 528bcaa..635e0d7 100644 (file)
@@ -3,6 +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 <climits>
+
 #include "simgrid/s4u/Engine.hpp"
 #include "simgrid/s4u/Host.hpp"
 #include "src/smpi/private.h"
index b6bc56a..41dd614 100644 (file)
@@ -76,7 +76,7 @@ void Process::set_data(int index, int* argc, char*** argv)
     instance_id_ = instance_id;
     index_ = index;
 
-    static_cast<simgrid::MsgActorExt*>(SIMIX_process_self()->data)->data = this;
+    static_cast<simgrid::msg::ActorExt*>(SIMIX_process_self()->data)->data = this;
 
     if (*argc > 3) {
       memmove(&(*argv)[0], &(*argv)[2], sizeof(char *) * (*argc - 2));