Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Tue, 10 Oct 2017 12:29:16 +0000 (14:29 +0200)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Tue, 10 Oct 2017 12:29:16 +0000 (14:29 +0200)
332 files changed:
doc/doxygen/inside_extending.doc
doc/doxygen/module-smpi.doc
doc/doxygen/uhood_switch.doc
include/simgrid/forward.h
include/simgrid/jedule/jedule.hpp
include/simgrid/jedule/jedule_events.hpp
include/simgrid/jedule/jedule_platform.hpp
src/bindings/java/JavaContext.cpp
src/bindings/java/JavaContext.hpp
src/bindings/java/jmsg.cpp
src/bindings/java/jmsg.hpp [moved from src/bindings/java/jmsg.h with 55% similarity]
src/bindings/java/jmsg_as.cpp
src/bindings/java/jmsg_as.hpp [moved from src/bindings/java/jmsg_as.h with 89% similarity]
src/bindings/java/jmsg_comm.cpp
src/bindings/java/jmsg_file.cpp
src/bindings/java/jmsg_host.cpp
src/bindings/java/jmsg_process.cpp
src/bindings/java/jmsg_rngstream.cpp
src/bindings/java/jmsg_storage.cpp
src/bindings/java/jmsg_synchro.cpp
src/bindings/java/jmsg_task.cpp
src/bindings/java/jmsg_vm.cpp
src/bindings/java/jtrace.cpp
src/bindings/java/jxbt_utilities.cpp
src/bindings/java/jxbt_utilities.hpp [moved from src/bindings/java/jxbt_utilities.h with 53% similarity]
src/bindings/lua/lua_debug.cpp
src/bindings/lua/lua_host.cpp
src/bindings/lua/lua_platf.cpp
src/bindings/lua/lua_private.h [deleted file]
src/bindings/lua/lua_private.hpp [new file with mode: 0644]
src/bindings/lua/lua_utils.hpp [moved from src/bindings/lua/lua_utils.h with 90% similarity]
src/bindings/lua/simgrid_lua.cpp
src/bindings/lua/simgrid_lua.hpp [moved from src/bindings/lua/simgrid_lua.h with 86% similarity]
src/include/smpi/smpi_utils.hpp
src/include/surf/maxmin.hpp [moved from src/include/surf/maxmin.h with 89% similarity]
src/instr/instr_config.cpp
src/instr/instr_interface.cpp
src/instr/instr_paje_containers.cpp
src/instr/instr_paje_header.cpp
src/instr/instr_paje_trace.cpp
src/instr/instr_paje_types.cpp
src/instr/instr_paje_values.cpp
src/instr/instr_private.hpp [moved from src/instr/instr_private.h with 66% similarity]
src/instr/instr_resource_utilization.cpp
src/instr/instr_smpi.hpp [moved from src/instr/instr_smpi.h with 87% similarity]
src/kernel/activity/CommImpl.cpp
src/kernel/activity/ExecImpl.cpp
src/kernel/activity/SleepImpl.cpp
src/kernel/activity/SynchroIo.cpp
src/kernel/context/Context.cpp
src/kernel/context/Context.hpp
src/kernel/context/ContextBoost.cpp
src/kernel/context/ContextRaw.cpp
src/kernel/context/ContextThread.cpp
src/kernel/context/ContextUnix.cpp
src/kernel/future.cpp
src/kernel/routing/RoutedZone.hpp
src/mc/DwarfExpression.cpp
src/mc/ModelChecker.cpp
src/mc/ObjectInformation.hpp
src/mc/PageStore.cpp
src/mc/PageStore.hpp
src/mc/RegionSnapshot.cpp
src/mc/Session.cpp
src/mc/VisitedState.cpp
src/mc/VisitedState.hpp
src/mc/checker/Checker.hpp
src/mc/checker/CommunicationDeterminismChecker.cpp
src/mc/checker/LivenessChecker.cpp
src/mc/checker/LivenessChecker.hpp
src/mc/checker/SafetyChecker.cpp
src/mc/checker/SafetyChecker.hpp
src/mc/checker/simgrid_mc.cpp
src/mc/compare.cpp
src/mc/mc_base.cpp
src/mc/mc_checkpoint.cpp
src/mc/mc_client_api.cpp
src/mc/mc_comm_pattern.cpp
src/mc/mc_comm_pattern.hpp
src/mc/mc_config.cpp
src/mc/mc_dwarf.cpp
src/mc/mc_exit.hpp [moved from src/mc/mc_exit.h with 71% similarity]
src/mc/mc_global.cpp
src/mc/mc_hash.cpp
src/mc/mc_member.cpp
src/mc/mc_memory.cpp
src/mc/mc_mmu.hpp [moved from src/mc/mc_mmu.h with 83% similarity]
src/mc/mc_page_snapshot.cpp
src/mc/mc_private.hpp [moved from src/mc/mc_private.h with 75% similarity]
src/mc/mc_record.cpp
src/mc/mc_record.hpp [moved from src/mc/mc_record.h with 93% similarity]
src/mc/mc_request.cpp
src/mc/mc_request.hpp [moved from src/mc/mc_request.h with 87% similarity]
src/mc/mc_safety.hpp [moved from src/mc/mc_safety.h with 87% similarity]
src/mc/mc_smx.cpp
src/mc/mc_smx.hpp [moved from src/mc/mc_smx.h with 95% similarity]
src/mc/mc_snapshot.cpp
src/mc/mc_snapshot.hpp [moved from src/mc/mc_snapshot.h with 66% similarity]
src/mc/mc_state.cpp
src/mc/mc_state.hpp [moved from src/mc/mc_state.h with 81% similarity]
src/mc/mc_unw.cpp
src/mc/mc_unw.hpp [moved from src/mc/mc_unw.h with 63% similarity]
src/mc/mc_unw_vmread.cpp
src/mc/remote/Client.cpp
src/mc/remote/RemoteClient.cpp
src/mc/remote/RemoteClient.hpp
src/msg/instr_msg_process.cpp
src/msg/instr_msg_task.cpp
src/msg/msg_actions.cpp
src/msg/msg_deployment.cpp
src/msg/msg_environment.cpp
src/msg/msg_global.cpp
src/msg/msg_gos.cpp
src/msg/msg_host.cpp
src/msg/msg_io.cpp
src/msg/msg_mailbox.cpp
src/msg/msg_private.hpp [moved from src/msg/msg_private.h with 68% similarity]
src/msg/msg_process.cpp
src/msg/msg_synchro.cpp
src/msg/msg_task.cpp
src/msg/msg_vm.cpp
src/plugins/vm/VirtualMachineImpl.cpp
src/plugins/vm/s4u_VirtualMachine.cpp
src/s4u/s4u_actor.cpp
src/s4u/s4u_comm.cpp
src/s4u/s4u_host.cpp
src/s4u/s4u_mailbox.cpp
src/s4u/s4u_mutex.cpp
src/simdag/simdag_private.hpp
src/simgrid/host.cpp
src/simgrid/sg_config.cpp
src/simix/ActorImpl.cpp
src/simix/ActorImpl.hpp
src/simix/libsmx.cpp
src/simix/popping.cpp
src/simix/popping_accessors.hpp [moved from src/simix/popping_accessors.h with 91% similarity]
src/simix/popping_bodies.cpp
src/simix/popping_generated.cpp
src/simix/popping_private.hpp [moved from src/simix/popping_private.h with 72% similarity]
src/simix/simcalls.py
src/simix/smx_context.cpp
src/simix/smx_deployment.cpp
src/simix/smx_environment.cpp
src/simix/smx_global.cpp
src/simix/smx_host.cpp
src/simix/smx_host_private.hpp [moved from src/simix/smx_host_private.h with 74% similarity]
src/simix/smx_io.cpp
src/simix/smx_io_private.hpp [moved from src/simix/smx_io_private.h with 86% similarity]
src/simix/smx_network.cpp
src/simix/smx_network_private.hpp [moved from src/simix/smx_network_private.h with 93% similarity]
src/simix/smx_private.hpp [moved from src/simix/smx_private.h with 66% similarity]
src/simix/smx_synchro.cpp
src/smpi/bindings/smpi_f77.cpp
src/smpi/bindings/smpi_f77_coll.cpp
src/smpi/bindings/smpi_f77_comm.cpp
src/smpi/bindings/smpi_f77_request.cpp
src/smpi/bindings/smpi_f77_type.cpp
src/smpi/bindings/smpi_mpi.cpp
src/smpi/bindings/smpi_pmpi.cpp
src/smpi/bindings/smpi_pmpi_coll.cpp
src/smpi/bindings/smpi_pmpi_comm.cpp
src/smpi/bindings/smpi_pmpi_group.cpp
src/smpi/bindings/smpi_pmpi_info.cpp
src/smpi/bindings/smpi_pmpi_op.cpp
src/smpi/bindings/smpi_pmpi_request.cpp
src/smpi/bindings/smpi_pmpi_topo.cpp
src/smpi/bindings/smpi_pmpi_type.cpp
src/smpi/bindings/smpi_pmpi_win.cpp
src/smpi/colls/allgather/allgather-2dmesh.cpp
src/smpi/colls/allgather/allgather-3dmesh.cpp
src/smpi/colls/allgather/allgather-GB.cpp
src/smpi/colls/allgather/allgather-NTSLR-NB.cpp
src/smpi/colls/allgather/allgather-NTSLR.cpp
src/smpi/colls/allgather/allgather-SMP-NTS.cpp
src/smpi/colls/allgather/allgather-bruck.cpp
src/smpi/colls/allgather/allgather-loosely-lr.cpp
src/smpi/colls/allgather/allgather-mvapich-smp.cpp
src/smpi/colls/allgather/allgather-ompi-neighborexchange.cpp
src/smpi/colls/allgather/allgather-pair.cpp
src/smpi/colls/allgather/allgather-rdb.cpp
src/smpi/colls/allgather/allgather-rhv.cpp
src/smpi/colls/allgather/allgather-ring.cpp
src/smpi/colls/allgather/allgather-smp-simple.cpp
src/smpi/colls/allgather/allgather-spreading-simple.cpp
src/smpi/colls/allgatherv/allgatherv-GB.cpp
src/smpi/colls/allgatherv/allgatherv-mpich-rdb.cpp
src/smpi/colls/allgatherv/allgatherv-mpich-ring.cpp
src/smpi/colls/allgatherv/allgatherv-ompi-bruck.cpp
src/smpi/colls/allgatherv/allgatherv-ompi-neighborexchange.cpp
src/smpi/colls/allgatherv/allgatherv-pair.cpp
src/smpi/colls/allgatherv/allgatherv-ring.cpp
src/smpi/colls/allreduce/allreduce-lr.cpp
src/smpi/colls/allreduce/allreduce-mvapich-rs.cpp
src/smpi/colls/allreduce/allreduce-mvapich-two-level.cpp
src/smpi/colls/allreduce/allreduce-ompi-ring-segmented.cpp
src/smpi/colls/allreduce/allreduce-rab-rdb.cpp
src/smpi/colls/allreduce/allreduce-rab1.cpp
src/smpi/colls/allreduce/allreduce-rab2.cpp
src/smpi/colls/allreduce/allreduce-rdb.cpp
src/smpi/colls/allreduce/allreduce-redbcast.cpp
src/smpi/colls/allreduce/allreduce-smp-binomial-pipeline.cpp
src/smpi/colls/allreduce/allreduce-smp-binomial.cpp
src/smpi/colls/allreduce/allreduce-smp-rdb.cpp
src/smpi/colls/allreduce/allreduce-smp-rsag-lr.cpp
src/smpi/colls/allreduce/allreduce-smp-rsag-rab.cpp
src/smpi/colls/allreduce/allreduce-smp-rsag.cpp
src/smpi/colls/alltoall/alltoall-2dmesh.cpp
src/smpi/colls/alltoall/alltoall-3dmesh.cpp
src/smpi/colls/alltoall/alltoall-basic-linear.cpp
src/smpi/colls/alltoall/alltoall-bruck.cpp
src/smpi/colls/alltoall/alltoall-mvapich-scatter-dest.cpp
src/smpi/colls/alltoall/alltoall-pair-light-barrier.cpp
src/smpi/colls/alltoall/alltoall-pair-mpi-barrier.cpp
src/smpi/colls/alltoall/alltoall-pair-one-barrier.cpp
src/smpi/colls/alltoall/alltoall-pair.cpp
src/smpi/colls/alltoall/alltoall-rdb.cpp
src/smpi/colls/alltoall/alltoall-ring-light-barrier.cpp
src/smpi/colls/alltoall/alltoall-ring-mpi-barrier.cpp
src/smpi/colls/alltoall/alltoall-ring-one-barrier.cpp
src/smpi/colls/alltoall/alltoall-ring.cpp
src/smpi/colls/alltoallv/alltoallv-bruck.cpp
src/smpi/colls/alltoallv/alltoallv-ompi-basic-linear.cpp
src/smpi/colls/alltoallv/alltoallv-pair-light-barrier.cpp
src/smpi/colls/alltoallv/alltoallv-pair-mpi-barrier.cpp
src/smpi/colls/alltoallv/alltoallv-pair-one-barrier.cpp
src/smpi/colls/alltoallv/alltoallv-pair.cpp
src/smpi/colls/alltoallv/alltoallv-ring-light-barrier.cpp
src/smpi/colls/alltoallv/alltoallv-ring-mpi-barrier.cpp
src/smpi/colls/alltoallv/alltoallv-ring-one-barrier.cpp
src/smpi/colls/alltoallv/alltoallv-ring.cpp
src/smpi/colls/barrier/barrier-mvapich2-pair.cpp
src/smpi/colls/barrier/barrier-ompi.cpp
src/smpi/colls/bcast/bcast-NTSB.cpp
src/smpi/colls/bcast/bcast-NTSL-Isend.cpp
src/smpi/colls/bcast/bcast-NTSL.cpp
src/smpi/colls/bcast/bcast-SMP-binary.cpp
src/smpi/colls/bcast/bcast-SMP-binomial.cpp
src/smpi/colls/bcast/bcast-SMP-linear.cpp
src/smpi/colls/bcast/bcast-arrival-pattern-aware-wait.cpp
src/smpi/colls/bcast/bcast-arrival-pattern-aware.cpp
src/smpi/colls/bcast/bcast-arrival-scatter.cpp
src/smpi/colls/bcast/bcast-binomial-tree.cpp
src/smpi/colls/bcast/bcast-flattree-pipeline.cpp
src/smpi/colls/bcast/bcast-flattree.cpp
src/smpi/colls/bcast/bcast-mvapich-smp.cpp
src/smpi/colls/bcast/bcast-ompi-pipeline.cpp
src/smpi/colls/bcast/bcast-ompi-split-bintree.cpp
src/smpi/colls/bcast/bcast-scatter-LR-allgather.cpp
src/smpi/colls/bcast/bcast-scatter-rdb-allgather.cpp
src/smpi/colls/coll_tuned_topo.cpp
src/smpi/colls/coll_tuned_topo.h [deleted file]
src/smpi/colls/coll_tuned_topo.hpp [new file with mode: 0644]
src/smpi/colls/colls_private.hpp [moved from src/smpi/colls/colls_private.h with 81% similarity]
src/smpi/colls/gather/gather-mvapich.cpp
src/smpi/colls/gather/gather-ompi.cpp
src/smpi/colls/reduce/reduce-NTSL.cpp
src/smpi/colls/reduce/reduce-arrival-pattern-aware.cpp
src/smpi/colls/reduce/reduce-binomial.cpp
src/smpi/colls/reduce/reduce-flat-tree.cpp
src/smpi/colls/reduce/reduce-mvapich-knomial.cpp
src/smpi/colls/reduce/reduce-mvapich-two-level.cpp
src/smpi/colls/reduce/reduce-ompi.cpp
src/smpi/colls/reduce/reduce-rab.cpp
src/smpi/colls/reduce/reduce-scatter-gather.cpp
src/smpi/colls/reduce_scatter/reduce_scatter-mpich.cpp
src/smpi/colls/reduce_scatter/reduce_scatter-ompi.cpp
src/smpi/colls/scatter/scatter-mvapich-two-level.cpp
src/smpi/colls/scatter/scatter-ompi.cpp
src/smpi/colls/smpi_automatic_selector.cpp
src/smpi/colls/smpi_coll.cpp
src/smpi/colls/smpi_default_selector.cpp
src/smpi/colls/smpi_intel_mpi_selector.cpp
src/smpi/colls/smpi_mpich_selector.cpp
src/smpi/colls/smpi_mvapich2_selector.cpp
src/smpi/colls/smpi_mvapich2_selector_stampede.h [deleted file]
src/smpi/colls/smpi_mvapich2_selector_stampede.hpp [new file with mode: 0644]
src/smpi/colls/smpi_openmpi_selector.cpp
src/smpi/include/private.h [deleted file]
src/smpi/include/private.hpp
src/smpi/include/smpi_coll.hpp
src/smpi/include/smpi_process.hpp
src/smpi/include/smpi_win.hpp
src/smpi/internals/instr_smpi.cpp
src/smpi/internals/smpi_bench.cpp
src/smpi/internals/smpi_deployment.cpp
src/smpi/internals/smpi_global.cpp
src/smpi/internals/smpi_memory.cpp
src/smpi/internals/smpi_process.cpp
src/smpi/internals/smpi_replay.cpp
src/smpi/internals/smpi_shared.cpp
src/smpi/internals/smpi_static_variables.cpp
src/smpi/mpi/smpi_comm.cpp
src/smpi/mpi/smpi_datatype.cpp
src/smpi/mpi/smpi_f2c.cpp
src/smpi/mpi/smpi_keyvals.cpp
src/smpi/mpi/smpi_op.cpp
src/smpi/mpi/smpi_request.cpp
src/smpi/mpi/smpi_status.cpp
src/smpi/mpi/smpi_topo.cpp
src/smpi/mpi/smpi_win.cpp
src/surf/StorageImpl.cpp
src/surf/cpu_interface.cpp
src/surf/instr_routing.cpp
src/surf/instr_surf.cpp
src/surf/maxmin.cpp
src/surf/maxmin_private.hpp
src/surf/network_cm02.cpp
src/surf/network_ns3.cpp
src/surf/network_ns3.hpp
src/surf/ns3/ns3_interface.hpp [moved from src/surf/ns3/ns3_interface.h with 86% similarity]
src/surf/ns3/ns3_simulator.cpp
src/surf/ns3/ns3_simulator.hpp [moved from src/surf/ns3/ns3_simulator.h with 93% similarity]
src/surf/plugins/host_energy.cpp
src/surf/plugins/host_load.cpp
src/surf/sg_platf.cpp
src/surf/surf_c_bindings.cpp
src/surf/surf_interface.cpp
src/surf/surf_interface.hpp
src/surf/surf_private.h [deleted file]
src/surf/surf_private.hpp [new file with mode: 0644]
src/surf/trace_mgr.cpp
src/surf/trace_mgr.hpp
src/surf/xml/platf.hpp
src/surf/xml/platf_private.hpp
src/surf/xml/surfxml_parseplatf.cpp
src/surf/xml/surfxml_sax_cb.cpp
teshsuite/mc/dwarf-expression/dwarf-expression.cpp
teshsuite/mc/dwarf/dwarf.cpp
teshsuite/surf/lmm_usage/lmm_usage.cpp
teshsuite/surf/maxmin_bench/maxmin_bench.cpp
tools/cmake/DefinePackages.cmake
tools/cmake/MaintainerMode.cmake

index a0a8a97..9593489 100644 (file)
@@ -160,13 +160,13 @@ the simcall definitions from src/simix/simcalls.in, checks that both
 `simcall_<name>()` and `simcall_HANDLER()` are defined somewhere, and
 generates the following files:
 
-- smx_popping_accessors.h:
+- popping_accessors.hpp:
   Helper functions to get and set simcall arguments and results
-- smx_popping_bodies.cpp:
+- popping_bodies.cpp:
   The BODY function of each simcall
-- smx_popping_enum.c:
+- popping_enum.h:
   Definition of type `enum e_smx_simcall_t` (one value per existing simcall)
-- smx_popping_generated.cpp:
+- popping_generated.cpp:
   Definitions of `simcall_names[]` (debug name of each simcall), and
   SIMIX_simcall_enter() that deals with the simcall from within the kernel
 
index ae3d115..238ba47 100644 (file)
@@ -412,7 +412,7 @@ changed to use smpi version of the calls instead (MPI_Send will become smpi_mpi_
 
 Example: adding a "pair" version of the Alltoall collective.
 
- - Implement it in a file called alltoall-pair.c in the src/smpi/colls folder. This file should include colls_private.h.
+ - Implement it in a file called alltoall-pair.c in the src/smpi/colls folder. This file should include colls_private.hpp.
 
  - The name of the new algorithm function should be smpi_coll_tuned_alltoall_pair, with the same signature as MPI_Alltoall.
 
index 3515d8c..ccb9e72 100644 (file)
@@ -371,7 +371,7 @@ this generates a bunch of C++ files:
   responsible for wrapping the parameters in the `struct s_smx_simcall`;
   and wrapping out the result;
 
-* [accessors](https://github.com/simgrid/simgrid/blob/4ae2fd01d8cc55bf83654e29f294335e3cb1f022/src/simix/popping_accessors.h)
+* [accessors](https://github.com/simgrid/simgrid/blob/4ae2fd01d8cc55bf83654e29f294335e3cb1f022/src/simix/popping_accessors.hpp)
    to get/set values of of `struct s_smx_simcall`;
 
 * a simulation-kernel-side [big switch](https://github.com/simgrid/simgrid/blob/4ae2fd01d8cc55bf83654e29f294335e3cb1f022/src/simix/popping_generated.cpp#L106)
index 45a0af2..e2cdeab 100644 (file)
@@ -98,6 +98,9 @@ typedef struct Trace tmgr_Trace;
 
 typedef struct s_smx_context* smx_context_t;
 typedef struct s_smx_actor* smx_actor_t;
+typedef struct s_smx_mutex* smx_mutex_t;
+typedef struct s_smx_mailbox* smx_mailbox_t;
+typedef struct s_surf_file* surf_file_t;
 
 #endif
 
index ebb956e..0ea9ab8 100644 (file)
@@ -36,11 +36,9 @@ public:
 }
 }
 
-SG_BEGIN_DECL()
-
+extern "C" {
 typedef simgrid::jedule::Jedule *jedule_t;
-
-SG_END_DECL()
+}
 #endif
 
 #endif /* JEDULE_HPP_ */
index aa16099..704d4f6 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2012, 2014-2016. The SimGrid Team.
+/* Copyright (c) 2010-2012, 2014-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -40,11 +40,9 @@ XBT_PUBLIC_CLASS Event{
 }
 }
 
-SG_BEGIN_DECL()
-
+extern "C" {
 typedef simgrid::jedule::Event * jed_event_t;
-
-SG_END_DECL()
+}
 
 #endif
 
index caaf672..9510ad0 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2012, 2014-2016. The SimGrid Team.
+/* Copyright (c) 2010-2012, 2014-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -50,12 +50,11 @@ public:
 
 }
 }
-SG_BEGIN_DECL()
+extern "C" {
 typedef simgrid::jedule::Container * jed_container_t;
 typedef simgrid::jedule::Subset * jed_subset_t;
 void get_resource_selection_by_hosts(std::vector<jed_subset_t>* subset_list, std::vector<sg_host_t> *host_list);
-
-SG_END_DECL()
+}
 
 #endif
 
index 7865d16..6ddcd92 100644 (file)
@@ -6,8 +6,8 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "JavaContext.hpp"
-#include "jxbt_utilities.h"
-#include "src/simix/smx_private.h"
+#include "jxbt_utilities.hpp"
+#include "src/simix/smx_private.hpp"
 #include "xbt/ex.hpp"
 
 #include <functional>
index 6ebaad4..7af0b5e 100644 (file)
 #include <jni.h>
 
 #include "simgrid/simix.h"
-#include "src/simix/smx_private.h"
+#include "src/simix/smx_private.hpp"
 #include "xbt/xbt_os_thread.h"
 
-#include "jmsg.h"
+#include "jmsg.hpp"
 
 namespace simgrid {
 namespace kernel {
index 1bb1487..6119a64 100644 (file)
 
 #include "simgrid/s4u/Host.hpp"
 
-#include "src/simix/smx_private.h"
+#include "src/simix/smx_private.hpp"
 
-#include "jmsg_process.h"
-#include "jmsg_as.h"
+#include "jmsg.hpp"
+#include "jmsg_as.hpp"
 #include "jmsg_host.h"
+#include "jmsg_process.h"
 #include "jmsg_storage.h"
 #include "jmsg_task.h"
-#include "jxbt_utilities.h"
-#include "jmsg.h"
+#include "jxbt_utilities.hpp"
 
 #include "JavaContext.hpp"
 
@@ -38,7 +38,7 @@
 #endif
 /* end of eclipse-mandated pimple */
 
-SG_BEGIN_DECL()
+extern "C" {
 
 int JAVA_HOST_LEVEL = -1;
 
@@ -243,8 +243,7 @@ Java_org_simgrid_msg_Msg_deployApplication(JNIEnv * env, jclass cls, jstring jde
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_energyInit() {
   sg_host_energy_plugin_init();
 }
-
-SG_END_DECL()
+} // extern "C"
 
 /** Run a Java org.simgrid.msg.Process
  *
similarity index 55%
rename from src/bindings/java/jmsg.h
rename to src/bindings/java/jmsg.hpp
index c0e7e2d..295a938 100644 (file)
@@ -5,13 +5,13 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#ifndef MSG4JAVA_H
-#define MSG4JAVA_H
+#ifndef JMSG_HPP
+#define JMSG_HPP
 #include <jni.h>
 #include <simgrid/msg.h>
 #include <unordered_map>
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /* Shut up some errors in eclipse online compiler. I wish such a pimple wouldn't be needed */
 #ifndef JNIEXPORT
@@ -25,29 +25,28 @@ SG_BEGIN_DECL()
 extern int JAVA_HOST_LEVEL;
 static std::unordered_map<msg_storage_t, jobject> java_storage_map;
 
-JavaVM *get_java_VM();
-JNIEnv *get_current_thread_env();
+JavaVMget_java_VM();
+JNIEnvget_current_thread_env();
 /**
  * This function throws the correct exception according to the status provided.
  */
-void jmsg_throw_status(JNIEnv *env, msg_error_t status);
+void jmsg_throw_status(JNIEnvenv, msg_error_t status);
 
-JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Msg_getClock(JNIEnv * env, jclass cls);
-JNIEXPORT void JNICALL JNICALL Java_org_simgrid_msg_Msg_run(JNIEnv * env, jclass cls);
+JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Msg_getClock(JNIEnv* env, jclass cls);
+JNIEXPORT void JNICALL JNICALL Java_org_simgrid_msg_Msg_run(JNIEnv* env, jclass cls);
 
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_init(JNIEnv * env, jclass cls, jobjectArray jargs);
+JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_init(JNIEnv* env, jclass cls, jobjectArray jargs);
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_energyInit();
 
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_debug(JNIEnv * env, jclass cls, jstring jargs);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_verb(JNIEnv * env, jclass cls, jstring jargs);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_info(JNIEnv * env, jclass cls, jstring jargs);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_warn(JNIEnv * env, jclass cls, jstring jargs);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_error(JNIEnv * env, jclass cls, jstring jargs);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_critical(JNIEnv * env, jclass cls, jstring jargs);
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_createEnvironment(JNIEnv * env, jclass cls, jstring jplatformFile);
-JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Msg_environmentGetRoutingRoot(JNIEnv * env, jclass cls);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_deployApplication(JNIEnv * env, jclass cls, jstring jdeploymentFile);
-
-SG_END_DECL()
+JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_debug(JNIEnv* env, jclass cls, jstring jargs);
+JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_verb(JNIEnv* env, jclass cls, jstring jargs);
+JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_info(JNIEnv* env, jclass cls, jstring jargs);
+JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_warn(JNIEnv* env, jclass cls, jstring jargs);
+JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_error(JNIEnv* env, jclass cls, jstring jargs);
+JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_critical(JNIEnv* env, jclass cls, jstring jargs);
+
+JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_createEnvironment(JNIEnv* env, jclass cls, jstring jplatformFile);
+JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Msg_environmentGetRoutingRoot(JNIEnv* env, jclass cls);
+JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_deployApplication(JNIEnv* env, jclass cls, jstring jdeploymentFile);
+}
 #endif
index 41ed0b3..d06d1d4 100644 (file)
@@ -9,14 +9,14 @@
 #include "simgrid/s4u/NetZone.hpp"
 #include "src/kernel/routing/NetZoneImpl.hpp"
 
-#include "jmsg_as.h"
+#include "jmsg.hpp"
+#include "jmsg_as.hpp"
 #include "jmsg_host.h"
-#include "jxbt_utilities.h"
-#include "jmsg.h"
+#include "jxbt_utilities.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
 
-SG_BEGIN_DECL()
+extern "C" {
 
 static jmethodID jas_method_As_constructor;
 static jfieldID jas_field_As_bind;
@@ -155,5 +155,4 @@ JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_As_getHosts(JNIEnv * env, jo
   }
   return jtable;
 }
-
-SG_END_DECL()
+}
similarity index 89%
rename from src/bindings/java/jmsg_as.h
rename to src/bindings/java/jmsg_as.hpp
index 89ac082..2ce24f7 100644 (file)
@@ -5,12 +5,12 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#ifndef MSG_JAS_H
-#define MSG_JAS_H
-#include <jni.h>
+#ifndef JMSG_AS_HPP
+#define JMSG_AS_HPP
 #include "simgrid/msg.h"
+#include <jni.h>
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /* Shut up some errors in eclipse online compiler. I wish such a pimple wouldn't be needed */
 #ifndef JNIEXPORT
@@ -27,11 +27,10 @@ void jnetzone_unref(JNIEnv* env, jobject jnetzone);
 void jnetzone_bind(jobject jas, msg_netzone_t as, JNIEnv* env);
 simgrid::s4u::NetZone* jnetzone_get_native(JNIEnv* env, jobject jnetzone);
 
-JNIEXPORT void JNICALL Java_org_simgrid_msg_As_nativeInit(JNIEnv *env, jclass cls);
-JNIEXPORT jobject JNICALL Java_org_simgrid_msg_As_getName(JNIEnv * env, jobject jas);
+JNIEXPORT void JNICALL Java_org_simgrid_msg_As_nativeInit(JNIEnvenv, jclass cls);
+JNIEXPORT jobject JNICALL Java_org_simgrid_msg_As_getName(JNIEnv* env, jobject jas);
 JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_As_getSons(JNIEnv* env, jobject jnetzone);
-JNIEXPORT jobject JNICALL Java_org_simgrid_msg_As_getProperty(JNIEnv *env, jobject jhost, jobject jname);
+JNIEXPORT jobject JNICALL Java_org_simgrid_msg_As_getProperty(JNIEnvenv, jobject jhost, jobject jname);
 JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_As_getHosts(JNIEnv* env, jobject jnetzone);
-
-SG_END_DECL()
+}
 #endif
index 47f14d6..d3e4127 100644 (file)
@@ -6,15 +6,15 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "jmsg_comm.h"
-#include "jxbt_utilities.h"
-#include "jmsg.h"
+#include "jmsg.hpp"
+#include "jxbt_utilities.hpp"
 
 #include <simgrid/msg.h>
 #include <string>
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
 
-SG_BEGIN_DECL()
+extern "C" {
 
 static jfieldID jcomm_field_Comm_bind;
 static jfieldID jcomm_field_Comm_finished;
@@ -166,5 +166,4 @@ JNIEXPORT int JNICALL Java_org_simgrid_msg_Comm_waitAny(JNIEnv *env, jclass cls,
   xbt_dynar_free(&dyn);
   return rank;
 }
-
-SG_END_DECL()
+}
index 8243f6a..ff8dcba 100644 (file)
@@ -1,14 +1,14 @@
 /* Java bindings of the file API.                                           */
 
-/* Copyright (c) 2012-2015. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2012-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "jmsg_file.h"
-#include "jxbt_utilities.h"
+#include "jxbt_utilities.hpp"
 
-SG_BEGIN_DECL()
+extern "C" {
 
 void jfile_bind(JNIEnv *env, jobject jfile, msg_file_t fd) {
   env->SetLongField(jfile, jfile_field_bind, reinterpret_cast<std::intptr_t>(fd));
@@ -53,5 +53,4 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_File_close(JNIEnv *env, jobject jfil
   MSG_file_close(file);
   jfile_bind(env, jfile, nullptr);
 }
-
-SG_END_DECL()
+}
index a255e2e..f51c91d 100644 (file)
@@ -9,14 +9,14 @@
 #include "simgrid/s4u/Host.hpp"
 #include "simgrid/s4u/Storage.hpp"
 
-#include "jmsg.h"
+#include "jmsg.hpp"
 #include "jmsg_host.h"
-#include "jxbt_utilities.h"
 #include "jmsg_storage.h"
+#include "jxbt_utilities.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
 
-SG_BEGIN_DECL()
+extern "C" {
 
 static jmethodID jhost_method_Host_constructor;
 static jfieldID jhost_field_Host_bind;
@@ -374,5 +374,4 @@ JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getPowerPeakAt(JNIEnv* env,
   msg_host_t host = jhost_get_native(env, jhost);
   return MSG_host_get_power_peak_at(host, pstate);
 }
-
-SG_END_DECL()
+}
index ec8c032..ad3f399 100644 (file)
@@ -9,14 +9,14 @@
 
 #include "jmsg_process.h"
 
-#include "jmsg.h"
-#include "jmsg_host.h"
-#include "jxbt_utilities.h"
 #include "JavaContext.hpp"
+#include "jmsg.hpp"
+#include "jmsg_host.h"
+#include "jxbt_utilities.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
 
-SG_BEGIN_DECL()
+extern "C" {
 
 jfieldID jprocess_field_Process_bind;
 jfieldID jprocess_field_Process_host;
@@ -289,5 +289,4 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_setKillTime (JNIEnv *env , j
 JNIEXPORT jint JNICALL Java_org_simgrid_msg_Process_getCount(JNIEnv * env, jclass cls) {
   return (jint) MSG_process_get_number();
 }
-
-SG_END_DECL()
+}
index 0bb54a2..cf069b3 100644 (file)
@@ -8,9 +8,9 @@
 #include "xbt/sysdep.h"
 
 #include "jmsg_rngstream.h"
-#include "jxbt_utilities.h"
+#include "jxbt_utilities.hpp"
 
-SG_BEGIN_DECL()
+extern "C" {
 
 jfieldID jrngstream_bind;
 
@@ -145,5 +145,4 @@ JNIEXPORT jint JNICALL Java_org_simgrid_msg_RngStream_randInt(JNIEnv *env, jobje
 
   return (jint)RngStream_RandInt(rngstream, (int)i, (int)j);
 }
-
-SG_END_DECL()
+}
index 7b5003f..e92d050 100644 (file)
@@ -7,13 +7,13 @@
 
 #include "simgrid/msg.h"
 
-#include "jmsg.h"
+#include "jmsg.hpp"
 #include "jmsg_storage.h"
-#include "jxbt_utilities.h"
+#include "jxbt_utilities.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
 
-SG_BEGIN_DECL()
+extern "C" {
 
 static jmethodID jstorage_method_Storage_constructor;
 static jfieldID jstorage_field_Storage_bind;
@@ -227,5 +227,4 @@ JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_Storage_all(JNIEnv * env, jc
   xbt_dynar_free(&table);
   return jtable;
 }
-
-SG_END_DECL()
+}
index 9749bf3..a831b3f 100644 (file)
@@ -7,14 +7,14 @@
 
 #include <xbt/ex.hpp>
 
-#include "jmsg.h"
+#include "jmsg.hpp"
 #include "jmsg_synchro.h"
-#include "jxbt_utilities.h"
+#include "jxbt_utilities.hpp"
 #include "xbt/synchro.h"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
 
-SG_BEGIN_DECL()
+extern "C" {
 
 static jfieldID jsynchro_field_Mutex_bind;
 
@@ -94,5 +94,4 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Semaphore_nativeFinalize(JNIEnv * en
   sem = (msg_sem_t)(uintptr_t)env->GetLongField(obj, jsynchro_field_Semaphore_bind);
   MSG_sem_destroy(sem);
 }
-
-SG_END_DECL()
+}
index eb5ca2d..7a473f6 100644 (file)
@@ -7,15 +7,15 @@
 
 #include "simgrid/s4u/Host.hpp"
 
-#include "jmsg.h"
+#include "jmsg.hpp"
 #include "jmsg_host.h"
-#include "jmsg_task.h"
 #include "jmsg_process.h"
-#include "jxbt_utilities.h"
+#include "jmsg_task.h"
+#include "jxbt_utilities.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
 
-SG_BEGIN_DECL()
+extern "C" {
 
 static jmethodID jtask_method_Comm_constructor;
 
@@ -525,5 +525,4 @@ JNIEXPORT jint JNICALL Java_org_simgrid_msg_Task_listenFrom(JNIEnv * env, jclass
 
   return (jint) rv;
 }
-
-SG_END_DECL()
+}
index 76b0dce..70dc62c 100644 (file)
@@ -7,13 +7,13 @@
 
 #include "jmsg_vm.h"
 #include "jmsg_host.h"
-#include "jxbt_utilities.h"
+#include "jxbt_utilities.hpp"
 #include "src/plugins/vm/VirtualMachineImpl.hpp"
 #include "xbt/ex.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
 
-SG_BEGIN_DECL()
+extern "C" {
 
 extern int JAVA_HOST_LEVEL;
 static jfieldID jvm_field_bind;
@@ -186,4 +186,4 @@ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_VM_getVMByName(JNIEnv* env, jclas
 
   return static_cast<jobject>(host->extension(JAVA_HOST_LEVEL));
 }
-SG_END_DECL()
+}
index 667c7b4..02f22f1 100644 (file)
@@ -20,7 +20,7 @@
 // Define a new category
 XBT_LOG_NEW_DEFAULT_CATEGORY (jtrace, "TRACE for Java(TM)");
 
-SG_BEGIN_DECL()
+extern "C" {
 
 JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_hostStateDeclare(JNIEnv * env, jclass cls, jstring js)
 {
@@ -198,5 +198,4 @@ JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkSrcDstVariableSet
    JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkSrcDstVariableSubWithTime(JNIEnv *env, jclass cls, jdouble,
                                                                                      jstring, jstring, jstring, jdouble)
 */
-
-SG_END_DECL()
+}
index a5e6ed1..1853d1b 100644 (file)
@@ -5,12 +5,12 @@
 /* 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 "jxbt_utilities.hpp"
 #include "xbt/sysdep.h"
-#include "jxbt_utilities.h"
 
 #include <cstdlib> /* abort */
 
-SG_BEGIN_DECL()
+extern "C" {
 
 jclass jxbt_get_class(JNIEnv * env, const char *name)
 {
@@ -211,5 +211,4 @@ void jxbt_throw_task_cancelled(JNIEnv* env, std::string details)
 {
   jxbt_throw_by_name(env, "org/simgrid/msg/TaskCancelledException", details);
 }
-
-SG_END_DECL()
+}
similarity index 53%
rename from src/bindings/java/jxbt_utilities.h
rename to src/bindings/java/jxbt_utilities.hpp
index 067a654..e496893 100644 (file)
@@ -5,48 +5,50 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#ifndef JXBT_UTILITY_H
-#define JXBT_UTILITY_H
+#ifndef JXBT_UTILITIES_HPP
+#define JXBT_UTILITIES_HPP
 
+#include <cstdint>
 #include <jni.h>
-#include <stdint.h>
 #include <string>
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /* Search a class and throw an exception if not found */
-jclass jxbt_get_class(JNIEnv * env, const char *name);
+jclass jxbt_get_class(JNIEnv* env, const char* name);
 
 /* Search a method in a class and throw an exception if not found(it's ok to to pass a NULL class: it's a noop) */
-jmethodID jxbt_get_jmethod(JNIEnv * env, jclass cls, const char *name, const char *signature);
+jmethodID jxbt_get_jmethod(JNIEnv* env, jclass cls, const char* name, const char* signature);
 
 /* Like the jxbt_get_class() but get a static method */
-jmethodID jxbt_get_static_jmethod(JNIEnv * env, jclass cls, const char *name, const char *signature);
+jmethodID jxbt_get_static_jmethod(JNIEnv* env, jclass cls, const char* name, const char* signature);
 
 /* Search a field in a class and throw an exception if not found (it's ok to to pass a NULL class: it's a noop) */
-jfieldID jxbt_get_jfield(JNIEnv * env, jclass cls, const char *name, const char *signature);
+jfieldID jxbt_get_jfield(JNIEnv* env, jclass cls, const char* name, const char* signature);
 
 /* Search a method in a class and throw an exception if not found (it's ok to to pass a NULL class: it's a noop) */
-jmethodID jxbt_get_smethod(JNIEnv * env, const char *classname, const char *name, const char *signature);
+jmethodID jxbt_get_smethod(JNIEnv* env, const char* classname, const char* name, const char* signature);
 
 /* Like the jxbt_get_smethod() but get a static method */
-jmethodID jxbt_get_static_smethod(JNIEnv * env, const char *classname, const char *name, const char *signature);
+jmethodID jxbt_get_static_smethod(JNIEnv* env, const char* classname, const char* name, const char* signature);
 
 /* Search a field in a class and throw an exception if not found (it's ok to to pass a NULL class: it's a noop) */
-jfieldID jxbt_get_sfield(JNIEnv * env, const char *classname, const char *name, const char *signature);
-
-#define jxbt_check_res(fun, res, allowed_exceptions, detail) do {\
-    if (res != MSG_OK && (res | allowed_exceptions)) { \
-      xbt_die("%s failed with error code %d, which is not an allowed exception. Please fix me.",fun,res); \
-    } else if (res == MSG_HOST_FAILURE) { \
-      jxbt_throw_host_failure(env, detail); \
-    } else if (res == MSG_TRANSFER_FAILURE) { \
-      jxbt_throw_transfer_failure(env,detail); \
-    } else if (res == MSG_TIMEOUT) { \
-      jxbt_throw_time_out_failure(env,detail); \
-    } else if (res == MSG_TASK_CANCELED){ \
-      jxbt_throw_task_cancelled(env,detail); \
-   } } while (0)
+jfieldID jxbt_get_sfield(JNIEnv* env, const char* classname, const char* name, const char* signature);
+
+#define jxbt_check_res(fun, res, allowed_exceptions, detail)                                                           \
+  do {                                                                                                                 \
+    if (res != MSG_OK && (res | allowed_exceptions)) {                                                                 \
+      xbt_die("%s failed with error code %d, which is not an allowed exception. Please fix me.", fun, res);            \
+    } else if (res == MSG_HOST_FAILURE) {                                                                              \
+      jxbt_throw_host_failure(env, detail);                                                                            \
+    } else if (res == MSG_TRANSFER_FAILURE) {                                                                          \
+      jxbt_throw_transfer_failure(env, detail);                                                                        \
+    } else if (res == MSG_TIMEOUT) {                                                                                   \
+      jxbt_throw_time_out_failure(env, detail);                                                                        \
+    } else if (res == MSG_TASK_CANCELED) {                                                                             \
+      jxbt_throw_task_cancelled(env, detail);                                                                          \
+    }                                                                                                                  \
+  } while (0)
 
 /* Throws an exception according to its name */
 void jxbt_throw_by_name(JNIEnv* env, const char* name, std::string msg);
@@ -73,6 +75,5 @@ void jxbt_throw_time_out_failure(JNIEnv* env, std::string details);
 void jxbt_throw_task_cancelled(JNIEnv* env, std::string details);
 /** Thrown when looking for a storage from name does not lead to anything */
 void jxbt_throw_storage_not_found(JNIEnv* env, std::string invalid_name);
-
-SG_END_DECL()
+}
 #endif
index c02d921..ddf1fb4 100644 (file)
@@ -1,10 +1,9 @@
-/* Copyright (c) 2010-2016. The SimGrid Team.
+/* 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. */
 
-
 /*
  * This file contains functions that aid users to debug their lua scripts; for instance,
  * tables can be easily output and values are represented in a human-readable way. (For instance,
@@ -15,7 +14,7 @@
 extern "C" {
 #include <lauxlib.h>
 }
-#include "lua_utils.h"
+#include "lua_utils.hpp"
 #include "xbt.h"
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(lua_debug, "Lua bindings (helper functions)");
index 9220e67..f511ec3 100644 (file)
@@ -5,7 +5,7 @@
 
 /* SimGrid Lua bindings                                                     */
 
-#include "lua_private.h"
+#include "lua_private.hpp"
 #include "simgrid/s4u/Host.hpp"
 extern "C" {
 #include <lauxlib.h>
index cddfe8a..90c72c6 100644 (file)
@@ -5,7 +5,7 @@
 
 /* SimGrid Lua bindings                                                     */
 
-#include "lua_private.h"
+#include "lua_private.hpp"
 #include "src/kernel/routing/NetPoint.hpp"
 #include "src/surf/network_interface.hpp"
 #include "src/surf/xml/platf_private.hpp"
@@ -16,7 +16,7 @@ extern "C" {
 #include <lauxlib.h>
 }
 
-#include "src/surf/surf_private.h"
+#include "src/surf/surf_private.hpp"
 #include <boost/algorithm/string/classification.hpp>
 #include <boost/algorithm/string/split.hpp>
 #include <simgrid/s4u/Host.hpp>
diff --git a/src/bindings/lua/lua_private.h b/src/bindings/lua/lua_private.h
deleted file mode 100644 (file)
index 0010302..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Copyright (c) 2010-2015. 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. */
-
-/* SimGrid Lua bindings                                                     */
-
-#ifndef LUA_PRIVATE_H
-#define LUA_PRIVATE_H
-
-#include "simgrid/msg.h"
-#include "simgrid_lua.h"
-
-extern "C" {
-
-void sglua_register_host_functions(lua_State* L);
-msg_host_t sglua_check_host(lua_State* L, int index);
-
-void sglua_register_platf_functions(lua_State* L);
-
-const char* sglua_get_msg_error(msg_error_t err);
-
-}
-
-#define lua_ensure(...) \
-  _XBT_IF_ONE_ARG(_lua_ensure_ARG1, _lua_ensure_ARGN, __VA_ARGS__)(__VA_ARGS__)
-#define _lua_ensure_ARG1(cond) \
-  _lua_ensure_ARGN(cond, "Assertion %s failed", #cond)
-#define _lua_ensure_ARGN(cond, ...) \
-  do { if (!(cond)) { luaL_error(L, __VA_ARGS__); return -1;} } while (0)
-
-#endif
diff --git a/src/bindings/lua/lua_private.hpp b/src/bindings/lua/lua_private.hpp
new file mode 100644 (file)
index 0000000..abcfd70
--- /dev/null
@@ -0,0 +1,34 @@
+/* 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. */
+
+/* SimGrid Lua bindings                                                     */
+
+#ifndef LUA_PRIVATE_HPP
+#define LUA_PRIVATE_HPP
+
+#include "simgrid/msg.h"
+#include "simgrid_lua.hpp"
+
+extern "C" {
+
+void sglua_register_host_functions(lua_State* L);
+msg_host_t sglua_check_host(lua_State* L, int index);
+
+void sglua_register_platf_functions(lua_State* L);
+
+const char* sglua_get_msg_error(msg_error_t err);
+}
+
+#define lua_ensure(...) _XBT_IF_ONE_ARG(_lua_ensure_ARG1, _lua_ensure_ARGN, __VA_ARGS__)(__VA_ARGS__)
+#define _lua_ensure_ARG1(cond) _lua_ensure_ARGN(cond, "Assertion %s failed", #cond)
+#define _lua_ensure_ARGN(cond, ...)                                                                                    \
+  do {                                                                                                                 \
+    if (!(cond)) {                                                                                                     \
+      luaL_error(L, __VA_ARGS__);                                                                                      \
+      return -1;                                                                                                       \
+    }                                                                                                                  \
+  } while (0)
+
+#endif
similarity index 90%
rename from src/bindings/lua/lua_utils.h
rename to src/bindings/lua/lua_utils.hpp
index 203c0e4..cbf83e7 100644 (file)
@@ -5,8 +5,8 @@
 
 /* SimGrid Lua helper functions                                             */
 
-#ifndef LUA_UTILS_H
-#define LUA_UTILS_H
+#ifndef LUA_UTILS_HPP
+#define LUA_UTILS_HPP
 
 extern "C" {
 
@@ -25,12 +25,11 @@ typedef struct s_sglua_buffer {
 
 const char* sglua_tostring(lua_State* L, int index);
 const char* sglua_keyvalue_tostring(lua_State* L, int key_index, int value_index);
-void sglua_stack_dump(lua_State* L, const char *msg);
+void sglua_stack_dump(lua_State* L, const charmsg);
 static int sglua_dump_table(lua_State* L);
 void* sglua_checkudata_debug(lua_State* L, int ud, const char* tname);
 const char* sglua_get_spaces(int length);
 int sglua_memory_writer(lua_State* L, const void* source, size_t size, void* userdata);
-
 }
 
 #endif
index 846d2b0..1bca949 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2015. The SimGrid Team.
+/* Copyright (c) 2010-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -6,8 +6,8 @@
 
 /* SimGrid Lua bindings                                                     */
 
-#include "lua_private.h"
-#include "lua_utils.h"
+#include "lua_private.hpp"
+#include "lua_utils.hpp"
 #include "src/surf/xml/platf.hpp"
 
 
similarity index 86%
rename from src/bindings/lua/simgrid_lua.h
rename to src/bindings/lua/simgrid_lua.hpp
index f95d620..33e8a47 100644 (file)
@@ -3,8 +3,8 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#ifndef SIMGRID_LUA_H
-#define SIMGRID_LUA_H
+#ifndef SIMGRID_LUA_HPP
+#define SIMGRID_LUA_HPP
 
 extern "C" {
 #include <lua.h>
@@ -13,8 +13,8 @@ extern "C" {
 /*                           Plaftorm functions                                      */
 /* ********************************************************************************* */
 
-int console_open(lua_State *L);
-int console_close(lua_State *L);
+int console_open(lua_StateL);
+int console_close(lua_StateL);
 
 int console_add_backbone(lua_State*);
 int console_add_host___link(lua_State*);
@@ -24,7 +24,7 @@ int console_add_router(lua_State* L);
 int console_add_route(lua_State*);
 int console_add_ASroute(lua_State*);
 int console_AS_open(lua_State*);
-int console_AS_seal(lua_State *L);
+int console_AS_seal(lua_StateL);
 int console_set_function(lua_State*);
 int console_host_set_property(lua_State*);
 }
index 0f98f38..8af0b0a 100644 (file)
@@ -9,7 +9,7 @@
 #include <cstddef>
 #include <vector>
 
-SG_BEGIN_DECL()
+extern "C" {
 
 // Methods used to parse and store the values for timing injections in smpi
 typedef struct s_smpi_factor *smpi_os_factor_t;
@@ -17,8 +17,7 @@ typedef struct s_smpi_factor{
   size_t factor=0;
   std::vector<double> values;
 } s_smpi_factor_t;
-
-SG_END_DECL()
+}
 
 XBT_PUBLIC(std::vector<s_smpi_factor_t>) parse_factor(const char *smpi_coef_string);
 
similarity index 89%
rename from src/include/surf/maxmin.h
rename to src/include/surf/maxmin.hpp
index df7571f..1df5043 100644 (file)
@@ -3,14 +3,14 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#ifndef SURF_MAXMIN_H
-#define SURF_MAXMIN_H
+#ifndef SURF_MAXMIN_HPP
+#define SURF_MAXMIN_HPP
 
 #include "src/internal_config.h"
-#include "xbt/misc.h"
-#include "xbt/asserts.h"
 #include "surf/datatypes.h"
-#include <math.h>
+#include "xbt/asserts.h"
+#include "xbt/misc.h"
+#include <cmath>
 
 namespace simgrid {
 namespace surf {
@@ -131,13 +131,13 @@ XBT_PUBLIC_DATA(double) sg_maxmin_precision;
 XBT_PUBLIC_DATA(double) sg_surf_precision;
 XBT_PUBLIC_DATA(int) sg_concurrency_limit;
 
-static inline void double_update(double *variable, double value, double precision)
+static inline void double_update(doublevariable, double value, double precision)
 {
-  //printf("Updating %g -= %g +- %g\n",*variable,value,precision);
-  //xbt_assert(value==0  || value>precision);
-  //Check that precision is higher than the machine-dependent size of the mantissa. If not, brutal rounding  may happen,
-  //and the precision mechanism is not active...
-  //xbt_assert(*variable< (2<<DBL_MANT_DIG)*precision && FLT_RADIX==2);
+  // printf("Updating %g -= %g +- %g\n",*variable,value,precision);
+  // xbt_assert(value==0  || value>precision);
+  // Check that precision is higher than the machine-dependent size of the mantissa. If not, brutal rounding  may
+  // happen, and the precision mechanism is not active...
+  // xbt_assert(*variable< (2<<DBL_MANT_DIG)*precision && FLT_RADIX==2);
   *variable -= value;
   if (*variable < precision)
     *variable = 0.0;
@@ -153,7 +153,7 @@ static inline int double_equals(double value1, double value2, double precision)
   return (fabs(value1 - value2) < precision);
 }
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /** @{ @ingroup SURF_lmm */
 /**
@@ -174,7 +174,7 @@ XBT_PUBLIC(void) lmm_system_free(lmm_system_t sys);
  * @param id Data associated to the constraint (e.g.: a network link)
  * @param bound_value The bound value of the constraint
  */
-XBT_PUBLIC(lmm_constraint_t) lmm_constraint_new(lmm_system_t sys, void *id,double bound_value);
+XBT_PUBLIC(lmm_constraint_t) lmm_constraint_new(lmm_system_t sys, void* id, double bound_value);
 
 /**
  * @brief Share a constraint
@@ -332,7 +332,7 @@ XBT_PUBLIC(int) lmm_get_number_of_cnst_from_var(lmm_system_t sys, lmm_variable_t
  * @param elem A element of constraint of the constraint or NULL
  * @return A variable associated to a constraint
  */
-XBT_PUBLIC(lmm_variable_t) lmm_get_var_from_cnst(lmm_system_t sys, lmm_constraint_t cnst, lmm_element_t * elem);
+XBT_PUBLIC(lmm_variable_t) lmm_get_var_from_cnst(lmm_system_t sys, lmm_constraint_t cnst, lmm_element_t* elem);
 
 /**
  * @brief Get a var associated to a constraint
@@ -344,8 +344,9 @@ XBT_PUBLIC(lmm_variable_t) lmm_get_var_from_cnst(lmm_system_t sys, lmm_constrain
  *
  * @return A variable associated to a constraint
  */
-XBT_PUBLIC(lmm_variable_t) lmm_get_var_from_cnst_safe(lmm_system_t sys, lmm_constraint_t cnst,
-                                     lmm_element_t * elem, lmm_element_t * nextelem, int * numelem);
+XBT_PUBLIC(lmm_variable_t)
+lmm_get_var_from_cnst_safe(lmm_system_t sys, lmm_constraint_t cnst, lmm_element_t* elem, lmm_element_t* nextelem,
+                           int* numelem);
 
 /**
  * @brief Get the first active constraint of a system
@@ -368,14 +369,14 @@ XBT_PUBLIC(lmm_constraint_t) lmm_get_next_active_constraint(lmm_system_t sys, lm
  * @param cnst A constraint
  * @return The data associated to the constraint
  */
-XBT_PUBLIC(void *) lmm_constraint_id(lmm_constraint_t cnst);
+XBT_PUBLIC(void*) lmm_constraint_id(lmm_constraint_t cnst);
 
 /**
  * @brief Get the data associated to a variable
  * @param var A variable
  * @return The data associated to the variable
  */
-XBT_PUBLIC(void *) lmm_variable_id(lmm_variable_t var);
+XBT_PUBLIC(void*) lmm_variable_id(lmm_variable_t var);
 
 /**
  * @brief Update the value of element linking the constraint and the variable
@@ -442,23 +443,24 @@ XBT_PUBLIC(void) bottleneck_solve(lmm_system_t sys);
 
 /** Default functions associated to the chosen protocol. When using the lagrangian approach. */
 
-XBT_PUBLIC(void) lmm_set_default_protocol_function(double (*func_f)(lmm_variable_t var,double x),
-                                                   double (*func_fp)(lmm_variable_t var,double x),
-                                                   double (*func_fpi)(lmm_variable_t var,double x));
+XBT_PUBLIC(void)
+lmm_set_default_protocol_function(double (*func_f)(lmm_variable_t var, double x),
+                                  double (*func_fp)(lmm_variable_t var, double x),
+                                  double (*func_fpi)(lmm_variable_t var, double x));
 
-XBT_PUBLIC(double func_reno_f) (lmm_variable_t var, double x);
-XBT_PUBLIC(double func_reno_fp) (lmm_variable_t var, double x);
-XBT_PUBLIC(double func_reno_fpi) (lmm_variable_t var, double x);
+XBT_PUBLIC(double) func_reno_f(lmm_variable_t var, double x);
+XBT_PUBLIC(double) func_reno_fp(lmm_variable_t var, double x);
+XBT_PUBLIC(double) func_reno_fpi(lmm_variable_t var, double x);
 
-XBT_PUBLIC(double func_reno2_f) (lmm_variable_t var, double x);
-XBT_PUBLIC(double func_reno2_fp) (lmm_variable_t var, double x);
-XBT_PUBLIC(double func_reno2_fpi) (lmm_variable_t var, double x);
+XBT_PUBLIC(double) func_reno2_f(lmm_variable_t var, double x);
+XBT_PUBLIC(double) func_reno2_fp(lmm_variable_t var, double x);
+XBT_PUBLIC(double) func_reno2_fpi(lmm_variable_t var, double x);
 
-XBT_PUBLIC(double func_vegas_f) (lmm_variable_t var, double x);
-XBT_PUBLIC(double func_vegas_fp) (lmm_variable_t var, double x);
-XBT_PUBLIC(double func_vegas_fpi) (lmm_variable_t var, double x);
+XBT_PUBLIC(double) func_vegas_f(lmm_variable_t var, double x);
+XBT_PUBLIC(double) func_vegas_fp(lmm_variable_t var, double x);
+XBT_PUBLIC(double) func_vegas_fpi(lmm_variable_t var, double x);
 
 /** @} */
-SG_END_DECL()
+}
 
 #endif
index 44077df..e6f06de 100644 (file)
@@ -3,7 +3,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "src/instr/instr_private.h"
+#include "src/instr/instr_private.hpp"
 #include "surf/surf.h"
 #include <string>
 #include <vector>
index 121b6f9..71762f4 100644 (file)
@@ -1,14 +1,14 @@
-/* Copyright (c) 2010-2015. The SimGrid Team.
+/* Copyright (c) 2010-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "simgrid_config.h"
-#include "src/instr/instr_private.h"
+#include "src/instr/instr_private.hpp"
 #include "src/kernel/routing/NetPoint.hpp"
 #include "src/surf/network_interface.hpp"
-#include "src/surf/surf_private.h"
+#include "src/surf/surf_private.hpp"
 #include "surf/surf.h"
 #include <algorithm>
 
index 0ab2877..9922c8a 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "surf/surf.h"
 
-#include "src/instr/instr_private.h"
+#include "src/instr/instr_private.hpp"
 
 #include <unordered_map>
 
index 362c5f0..0e3338c 100644 (file)
@@ -4,8 +4,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 "src/instr/instr_private.h"
 #include "simgrid/sg_config.h"
+#include "src/instr/instr_private.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(instr_paje_header, instr, "Paje tracing event system (header)");
 
index 29c3588..23ed224 100644 (file)
@@ -4,12 +4,12 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "src/instr/instr_private.h"
-#include "src/instr/instr_smpi.h"
+#include "simgrid/sg_config.h"
+#include "src/instr/instr_private.hpp"
+#include "src/instr/instr_smpi.hpp"
 #include "src/smpi/include/private.hpp"
 #include "typeinfo"
 #include "xbt/virtu.h" /* sg_cmdline */
-#include "simgrid/sg_config.h"
 
 #include <sstream>
 #include <vector>
index e8b59fa..b1e5532 100644 (file)
@@ -4,7 +4,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 "src/instr/instr_private.h"
+#include "src/instr/instr_private.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_paje_types, instr, "Paje tracing event system (types)");
 
index e4a1f7b..5a4d269 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2015. The SimGrid Team.
+/* Copyright (c) 2012-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -6,7 +6,7 @@
 
 #include <xbt/ex.hpp>
 
-#include "src/instr/instr_private.h"
+#include "src/instr/instr_private.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_paje_values, instr, "Paje tracing event system (values)");
 
similarity index 66%
rename from src/instr/instr_private.h
rename to src/instr/instr_private.hpp
index 039c580..0e3d8ec 100644 (file)
@@ -3,8 +3,8 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#ifndef INSTR_PRIVATE_H_
-#define INSTR_PRIVATE_H_
+#ifndef INSTR_PRIVATE_HPP
+#define INSTR_PRIVATE_HPP
 
 #include <xbt/base.h>
 
 /* Need to define function drand48 for Windows */
 /* FIXME: use _drand48() defined in src/surf/random_mgr.c instead */
 #ifdef _WIN32
-#  define drand48() (rand()/(RAND_MAX + 1.0))
+#define drand48() (rand() / (RAND_MAX + 1.0))
 #endif
 
 #define INSTR_DEFAULT_STR_SIZE 500
 
-#include "xbt/graph.h"
 #include "xbt/dict.h"
+#include "xbt/graph.h"
 
 namespace simgrid {
 namespace instr {
@@ -50,13 +50,7 @@ typedef enum {
   PAJE_NewEvent
 } e_event_type;
 
-typedef enum {
-  TYPE_VARIABLE,
-  TYPE_LINK,
-  TYPE_CONTAINER,
-  TYPE_STATE,
-  TYPE_EVENT
-} e_entity_types;
+typedef enum { TYPE_VARIABLE, TYPE_LINK, TYPE_CONTAINER, TYPE_STATE, TYPE_EVENT } e_entity_types;
 
 //--------------------------------------------------
 
@@ -127,80 +121,79 @@ public:
 
 //--------------------------------------------------
 class PajeEvent {
-  public:
-    double timestamp_;
-    e_event_type eventType_;
-    virtual void print() = 0;
-    virtual ~PajeEvent();
+public:
+  double timestamp_;
+  e_event_type eventType_;
+  virtual void print() = 0;
+  virtual ~PajeEvent();
 };
 
 //--------------------------------------------------
-class SetVariableEvent : public PajeEvent  {
-  private:
-    Container* container;
-    Type* type;
-    double value;
-
-  public:
-    SetVariableEvent(double timestamp, Container* container, Type* type, double value);
-    void print() override;
+class SetVariableEvent : public PajeEvent {
+private:
+  Container* container;
+  Type* type;
+  double value;
+
+public:
+  SetVariableEvent(double timestamp, Container* container, Type* type, double value);
+  void print() override;
 };
 
-class AddVariableEvent:public PajeEvent {
-  private:
-    Container* container;
-    Type* type;
-    double value;
+class AddVariableEvent : public PajeEvent {
+private:
+  Container* container;
+  Type* type;
+  double value;
 
-  public:
-    AddVariableEvent(double timestamp, Container* container, Type* type, double value);
-    void print() override;
+public:
+  AddVariableEvent(double timestamp, Container* container, Type* type, double value);
+  void print() override;
 };
 //--------------------------------------------------
 
+class SubVariableEvent : public PajeEvent {
+private:
+  Container* container;
+  Type* type;
+  double value;
 
-class SubVariableEvent : public PajeEvent  {
-  private:
-    Container* container;
-    Type* type;
-    double value;
-  public:
-    SubVariableEvent(double timestamp, Container* container, Type* type, double value);
-    void print() override;
+public:
+  SubVariableEvent(double timestamp, Container* container, Type* type, double value);
+  void print() override;
 };
 //--------------------------------------------------
 
-class SetStateEvent : public PajeEvent  {
-  private:
-    Container* container;
-    Type* type;
-    Value* value;
-    const char* filename;
-    int linenumber;
-
-  public:
-    SetStateEvent(double timestamp, Container* container, Type* type, Value* val);
-    void print() override;
+class SetStateEvent : public PajeEvent {
+private:
+  Container* container;
+  Type* type;
+  Value* value;
+  const char* filename;
+  int linenumber;
+
+public:
+  SetStateEvent(double timestamp, Container* container, Type* type, Value* val);
+  void print() override;
 };
 
+class PushStateEvent : public PajeEvent {
+public:
+  Container* container;
+  Type* type;
+  Value* value;
+  int size;
+  const char* filename;
+  int linenumber;
+  void* extra_;
 
-class PushStateEvent : public PajeEvent  {
-  public:
-    Container* container;
-    Type* type;
-    Value* value;
-    int size;
-    const char* filename;
-    int linenumber;
-    void* extra_;
-
-  public:
-    PushStateEvent(double timestamp, Container* container, Type* type, Value* val);
-    PushStateEvent(double timestamp, Container* container, Type* type, Value* val, void* extra);
-    void print() override;
+public:
+  PushStateEvent(double timestamp, Container* container, Type* type, Value* val);
+  PushStateEvent(double timestamp, Container* container, Type* type, Value* val, void* extra);
+  void print() override;
 };
 
-class PopStateEvent : public PajeEvent  {
+class PopStateEvent : public PajeEvent {
   Container* container;
   Type* type;
 
@@ -209,7 +202,7 @@ public:
   void print() override;
 };
 
-class ResetStateEvent : public PajeEvent  {
+class ResetStateEvent : public PajeEvent {
   Container* container;
   Type* type;
 
@@ -218,7 +211,7 @@ public:
   void print() override;
 };
 
-class StartLinkEvent : public PajeEvent  {
+class StartLinkEvent : public PajeEvent {
   Container* container_;
   Type* type_;
   Container* sourceContainer_;
@@ -234,7 +227,7 @@ public:
   void print() override;
 };
 
-class EndLinkEvent : public PajeEvent  {
+class EndLinkEvent : public PajeEvent {
   Container* container;
   Type* type;
   Container* destContainer;
@@ -248,22 +241,21 @@ public:
   void print() override;
 };
 
+class NewEvent : public PajeEvent {
+public:
+  Container* container;
+  Type* type;
+  Value* val;
 
-class NewEvent : public PajeEvent  {
-  public:
-    Container* container;
-    Type* type;
-    Value* val;
-
-  public:
-    NewEvent(double timestamp, Container* container, Type* type, Value* val);
-    void print() override;
+public:
+  NewEvent(double timestamp, Container* container, Type* type, Value* val);
+  void print() override;
 };
 }
 } // namespace simgrid::instr
 typedef simgrid::instr::Container* container_t;
 
-SG_BEGIN_DECL()
+extern "C" {
 
 extern XBT_PRIVATE std::set<std::string> created_categories;
 extern XBT_PRIVATE std::set<std::string> declared_marks;
@@ -278,36 +270,35 @@ XBT_PRIVATE void TRACE_header(int basic, int size);
 /* from paje.c */
 XBT_PRIVATE void TRACE_paje_start();
 XBT_PRIVATE void TRACE_paje_end();
-XBT_PRIVATE void TRACE_paje_dump_buffer (int force);
-
+XBT_PRIVATE void TRACE_paje_dump_buffer(int force);
 
 /* from instr_config.c */
-XBT_PRIVATE bool TRACE_needs_platform ();
+XBT_PRIVATE bool TRACE_needs_platform();
 XBT_PRIVATE bool TRACE_is_enabled();
 XBT_PRIVATE bool TRACE_platform();
 XBT_PRIVATE bool TRACE_platform_topology();
 XBT_PRIVATE bool TRACE_is_configured();
-XBT_PRIVATE bool TRACE_categorized ();
-XBT_PRIVATE bool TRACE_uncategorized ();
+XBT_PRIVATE bool TRACE_categorized();
+XBT_PRIVATE bool TRACE_uncategorized();
 XBT_PRIVATE bool TRACE_msg_process_is_enabled();
 XBT_PRIVATE bool TRACE_msg_vm_is_enabled();
-XBT_PRIVATE bool TRACE_buffer ();
+XBT_PRIVATE bool TRACE_buffer();
 XBT_PRIVATE bool TRACE_disable_link();
 XBT_PRIVATE bool TRACE_disable_speed();
-XBT_PRIVATE bool TRACE_onelink_only ();
-XBT_PRIVATE bool TRACE_disable_destroy ();
-XBT_PRIVATE bool TRACE_basic ();
-XBT_PRIVATE bool TRACE_display_sizes ();
-XBT_PRIVATE char *TRACE_get_comment ();
-XBT_PRIVATE char *TRACE_get_comment_file ();
-XBT_PRIVATE int TRACE_precision ();
-XBT_PRIVATE char *TRACE_get_filename();
-XBT_PRIVATE char *TRACE_get_viva_uncat_conf ();
-XBT_PRIVATE char *TRACE_get_viva_cat_conf ();
-XBT_PRIVATE void TRACE_generate_viva_uncat_conf ();
-XBT_PRIVATE void TRACE_generate_viva_cat_conf ();
-XBT_PRIVATE void instr_pause_tracing ();
-XBT_PRIVATE void instr_resume_tracing ();
+XBT_PRIVATE bool TRACE_onelink_only();
+XBT_PRIVATE bool TRACE_disable_destroy();
+XBT_PRIVATE bool TRACE_basic();
+XBT_PRIVATE bool TRACE_display_sizes();
+XBT_PRIVATE char* TRACE_get_comment();
+XBT_PRIVATE char* TRACE_get_comment_file();
+XBT_PRIVATE int TRACE_precision();
+XBT_PRIVATE charTRACE_get_filename();
+XBT_PRIVATE char* TRACE_get_viva_uncat_conf();
+XBT_PRIVATE char* TRACE_get_viva_cat_conf();
+XBT_PRIVATE void TRACE_generate_viva_uncat_conf();
+XBT_PRIVATE void TRACE_generate_viva_cat_conf();
+XBT_PRIVATE void instr_pause_tracing();
+XBT_PRIVATE void instr_resume_tracing();
 
 /* Public functions used in SMPI */
 XBT_PUBLIC(bool) TRACE_smpi_is_enabled();
@@ -317,17 +308,17 @@ XBT_PUBLIC(bool) TRACE_smpi_is_sleeping();
 XBT_PUBLIC(bool) TRACE_smpi_view_internals();
 
 /* from resource_utilization.c */
-XBT_PRIVATE void TRACE_surf_host_set_utilization(const char *resource, const char *category, double value, double now,
-                                     double delta);
-XBT_PRIVATE void TRACE_surf_link_set_utilization(const char *resource,const char *category, double value, double now,
-                                     double delta);
+XBT_PRIVATE void TRACE_surf_host_set_utilization(const char* resource, const char* category, double value, double now,
+                                                 double delta);
+XBT_PRIVATE void TRACE_surf_link_set_utilization(const char* resource, const char* category, double value, double now,
+                                                 double delta);
 XBT_PUBLIC(void) TRACE_surf_resource_utilization_alloc();
 
 /* instr_paje.c */
 extern XBT_PRIVATE std::set<std::string> trivaNodeTypes;
 extern XBT_PRIVATE std::set<std::string> trivaEdgeTypes;
-XBT_PRIVATE long long int instr_new_paje_id ();
-XBT_PUBLIC(container_t) PJ_container_get (const char *name);
+XBT_PRIVATE long long int instr_new_paje_id();
+XBT_PUBLIC(container_t) PJ_container_get(const char* name);
 XBT_PUBLIC(simgrid::instr::Container*) PJ_container_get_or_null(const char* name);
 XBT_PUBLIC(container_t) PJ_container_get_root ();
 XBT_PUBLIC(void) PJ_container_set_root (container_t root);
@@ -340,14 +331,14 @@ XBT_PUBLIC(simgrid::instr::Type*) PJ_type_get_root();
 XBT_PRIVATE void TRACE_TI_start();
 XBT_PRIVATE void TRACE_TI_end();
 
-XBT_PRIVATE void TRACE_paje_dump_buffer (int force);
-XBT_PRIVATE void dump_comment_file (const char *filename);
-XBT_PRIVATE void dump_comment (const char *comment);
+XBT_PRIVATE void TRACE_paje_dump_buffer(int force);
+XBT_PRIVATE void dump_comment_file(const char* filename);
+XBT_PRIVATE void dump_comment(const char* comment);
 
 struct s_instr_extra_data;
-typedef struct s_instr_extra_data *instr_extra_data;
+typedef struct s_instr_extra_datainstr_extra_data;
 
-typedef enum{
+typedef enum {
   TRACING_INIT,
   TRACING_FINALIZE,
   TRACING_COMM_SIZE,
@@ -381,7 +372,7 @@ typedef enum{
   TRACING_SLEEPING,
   TRACING_SCAN,
   TRACING_EXSCAN
-} e_caller_type ;
+} e_caller_type;
 
 typedef struct s_instr_extra_data {
   e_caller_type type;
@@ -394,28 +385,28 @@ typedef struct s_instr_extra_data {
   int root;
   const char* datatype1;
   const char* datatype2;
-  int * sendcounts;
-  int * recvcounts;
+  int* sendcounts;
+  int* recvcounts;
   int num_processes;
 } s_instr_extra_data_t;
 
 /* Format of TRACING output.
  *   - paje is the regular format, that we all know
- *   - TI is a trick to reuse the tracing functions to generate a time independent trace during the execution. Such trace can easily be replayed with smpi_replay afterward.
- *     This trick should be removed and replaced by some code using the signal that we will create to cleanup the TRACING
+ *   - TI is a trick to reuse the tracing functions to generate a time independent trace during the execution. Such
+ *     trace can easily be replayed with smpi_replay afterward. This trick should be removed and replaced by some code
+ *     using the signal that we will create to cleanup the TRACING
  */
 typedef enum { instr_fmt_paje, instr_fmt_TI } instr_fmt_type_t;
 extern instr_fmt_type_t instr_fmt_type;
-
-SG_END_DECL()
+}
 
 void LogContainerTypeDefinition(simgrid::instr::Type* type);
 void LogVariableTypeDefinition(simgrid::instr::Type* type);
 void LogStateTypeDefinition(simgrid::instr::Type* type);
 void LogLinkTypeDefinition(simgrid::instr::Type* type, simgrid::instr::Type* source, simgrid::instr::Type* dest);
 void LogEntityValue(simgrid::instr::Value* val);
-void LogContainerCreation (container_t container);
-void LogContainerDestruction (container_t container);
+void LogContainerCreation(container_t container);
+void LogContainerDestruction(container_t container);
 void LogDefineEventType(simgrid::instr::Type* type);
 
 #endif
index 374f569..ead0ea4 100644 (file)
@@ -4,7 +4,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 "src/instr/instr_private.h"
+#include "src/instr/instr_private.hpp"
 #include <string>
 #include <unordered_map>
 
similarity index 87%
rename from src/instr/instr_smpi.h
rename to src/instr/instr_smpi.hpp
index cd6faa5..9b01f6f 100644 (file)
@@ -3,17 +3,14 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#ifndef INSTR_SMPI_H_
-#define INSTR_SMPI_H_
-
-#ifdef __cplusplus
-#include <string>
-#endif
+#ifndef INSTR_SMPI_HPP
+#define INSTR_SMPI_HPP
 
 #include "smpi/smpi.h"
-#include "src/instr/instr_private.h"
+#include "src/instr/instr_private.hpp"
+#include <string>
 
-SG_BEGIN_DECL()
+extern "C" {
 
 XBT_PRIVATE void TRACE_internal_smpi_set_category(const char* category);
 XBT_PRIVATE const char* TRACE_internal_smpi_get_category();
@@ -46,14 +43,13 @@ typedef struct smpi_trace_call_location {
   const char* previous_filename;
   int previous_linenumber;
 
-#ifdef __cplusplus
-  std::string get_composed_key() {
-    return std::string(previous_filename) + ':' + std::to_string(previous_linenumber) + ':' + filename + ':' + std::to_string(linenumber);
+  std::string get_composed_key()
+  {
+    return std::string(previous_filename) + ':' + std::to_string(previous_linenumber) + ':' + filename + ':' +
+           std::to_string(linenumber);
   }
-#endif
 
 } smpi_trace_call_location_t;
-
-SG_END_DECL()
+}
 
 #endif
index 33d31e7..c7517bf 100644 (file)
@@ -7,7 +7,7 @@
 
 #include "simgrid/modelchecker.h"
 #include "src/mc/mc_replay.h"
-#include "src/simix/smx_network_private.h"
+#include "src/simix/smx_network_private.hpp"
 #include "src/surf/surf_interface.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_network);
index aee76bc..95a4e38 100644 (file)
@@ -6,7 +6,7 @@
 #include "simgrid/s4u/Host.hpp"
 
 #include "src/kernel/activity/ExecImpl.hpp"
-#include "src/simix/smx_host_private.h"
+#include "src/simix/smx_host_private.hpp"
 #include "src/surf/surf_interface.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_process);
index 88cd15b..7b8f3d5 100644 (file)
@@ -9,7 +9,7 @@
 #include "src/kernel/context/Context.hpp"
 
 #include "src/simix/ActorImpl.hpp"
-#include "src/simix/popping_private.h"
+#include "src/simix/popping_private.hpp"
 #include "src/surf/surf_interface.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_process);
index 7e8ea86..65ac052 100644 (file)
@@ -1,10 +1,10 @@
-/* Copyright (c) 2007-2016. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "src/kernel/activity/SynchroIo.hpp"
-#include "src/simix/smx_private.h"
+#include "src/simix/smx_private.hpp"
 #include "src/surf/surf_interface.hpp"
 
 void simgrid::kernel::activity::IoImpl::suspend()
index bf07805..1a9dae5 100644 (file)
@@ -6,7 +6,7 @@
 #include "mc/mc.h"
 
 #include "src/kernel/context/Context.hpp"
-#include "src/simix/smx_private.h"
+#include "src/simix/smx_private.hpp"
 
 /**
  * @brief creates a new context for a user level process
index c184df4..c467f05 100644 (file)
 #include <xbt/functional.hpp>
 
 #include "simgrid/simix.h"
-#include "src/instr/instr_private.h"
+#include "src/instr/instr_private.hpp"
 #include "src/internal_config.h"
-#include "src/simix/popping_private.h"
-#include "src/simix/smx_host_private.h"
-#include "src/simix/smx_io_private.h"
-#include "src/simix/smx_network_private.h"
+#include "src/simix/popping_private.hpp"
+#include "src/simix/smx_host_private.hpp"
+#include "src/simix/smx_io_private.hpp"
+#include "src/simix/smx_network_private.hpp"
 #include "src/simix/smx_synchro_private.hpp"
 #include "surf/surf.h"
 #include "xbt/base.h"
@@ -148,8 +148,7 @@ XBT_PRIVATE ContextFactory* boost_factory();
 
 typedef simgrid::kernel::context::ContextFactory *smx_context_factory_t;
 
-SG_BEGIN_DECL()
-
+extern "C" {
 
 XBT_PRIVATE void SIMIX_context_mod_init();
 XBT_PRIVATE void SIMIX_context_mod_exit();
@@ -185,8 +184,7 @@ XBT_PRIVATE smx_context_t SIMIX_context_get_current();
 XBT_PUBLIC(int) SIMIX_process_get_maxpid();
 
 XBT_PRIVATE void SIMIX_post_create_environment();
-
-SG_END_DECL()
+}
 
 XBT_PRIVATE simgrid::simix::ActorCodeFactory& SIMIX_get_actor_code_factory(const char *name);
 
index 8e1eabd..3e18362 100644 (file)
@@ -14,9 +14,9 @@
 #include <xbt/log.h>
 #include <xbt/xbt_os_thread.h>
 
-#include "src/simix/smx_private.h"
 #include "src/internal_config.h"
 #include "src/kernel/context/ContextBoost.hpp"
+#include "src/simix/smx_private.hpp"
 
 #if HAVE_SANITIZE_ADDRESS_FIBER_SUPPORT
 #include <sanitizer/asan_interface.h>
index 8e83fa5..1df1de7 100644 (file)
@@ -7,8 +7,8 @@
 
 #include "xbt/parmap.hpp"
 
-#include "src/simix/smx_private.h"
 #include "mc/mc.h"
+#include "src/simix/smx_private.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_context);
 
index 8e9ee72..ebcdfbe 100644 (file)
@@ -6,12 +6,12 @@
 #include <utility>
 #include <functional>
 
+#include "src/internal_config.h" /* loads context system definitions */
+#include "src/simix/smx_private.hpp"
+#include "src/xbt_modinter.h" /* prototype of os thread module's init/exit in XBT */
 #include "xbt/function_types.h"
-#include "src/simix/smx_private.h"
-#include "src/internal_config.h"           /* loads context system definitions */
 #include "xbt/swag.h"
 #include "xbt/xbt_os_thread.h"
-#include "src/xbt_modinter.h"       /* prototype of os thread module's init/exit in XBT */
 
 #include "src/kernel/context/ContextThread.hpp"
 
index 0ee4c14..ae143b8 100644 (file)
@@ -10,7 +10,7 @@
 #include "mc/mc.h"
 #include "src/mc/mc_ignore.h"
 #include "src/simix/ActorImpl.hpp"
-#include "src/simix/smx_private.h"
+#include "src/simix/smx_private.hpp"
 #include "xbt/parmap.hpp"
 
 /** Many integers are needed to store a pointer
index 4252161..4eb9900 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2016. The SimGrid Team.
+/* Copyright (c) 2016-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -8,7 +8,7 @@
 
 #include <simgrid/kernel/future.hpp>
 
-#include "src/simix/smx_private.h"
+#include "src/simix/smx_private.hpp"
 
 namespace simgrid {
 namespace kernel {
index 3904232..74e655b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2016. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2013-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -64,9 +64,9 @@ protected:
 }
 } // namespace
 
-SG_BEGIN_DECL()
+extern "C" {
 XBT_PRIVATE xbt_node_t new_xbt_graph_node(xbt_graph_t graph, const char* name, xbt_dict_t nodes);
 XBT_PRIVATE xbt_edge_t new_xbt_graph_edge(xbt_graph_t graph, xbt_node_t s, xbt_node_t d, xbt_dict_t edges);
-SG_END_DECL()
+}
 
 #endif /* SIMGRID_ROUTING_GENERIC_HPP_ */
index fe55a37..bfa4f16 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2015. The SimGrid Team.
+/* Copyright (c) 2014-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -9,14 +9,15 @@
 
 #include <dwarf.h>
 #include <elfutils/libdw.h>
+#include <libunwind.h>
 
-#include "src/mc/mc_private.h"
-#include "src/mc/LocationList.hpp"
 #include "src/mc/AddressSpace.hpp"
+#include "src/mc/DwarfExpression.hpp"
 #include "src/mc/Frame.hpp"
+#include "src/mc/LocationList.hpp"
 #include "src/mc/ObjectInformation.hpp"
-#include "src/mc/DwarfExpression.hpp"
 #include "src/mc/mc_dwarf.hpp"
+#include "src/mc/mc_private.hpp"
 
 using simgrid::mc::remote;
 
index 8de1553..4c47db5 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008-2015. The SimGrid Team.
+/* Copyright (c) 2008-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -26,9 +26,9 @@
 #include "src/mc/PageStore.hpp"
 #include "src/mc/Transition.hpp"
 #include "src/mc/checker/Checker.hpp"
-#include "src/mc/mc_exit.h"
-#include "src/mc/mc_private.h"
-#include "src/mc/mc_record.h"
+#include "src/mc/mc_exit.hpp"
+#include "src/mc/mc_private.hpp"
+#include "src/mc/mc_record.hpp"
 #include "src/mc/remote/mc_protocol.h"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_ModelChecker, mc, "ModelChecker");
index 019e75b..a7e9bf5 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2015. The SimGrid Team.
+/* Copyright (c) 2007-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -19,7 +19,7 @@
 #include "src/mc/Type.hpp"
 #include "src/mc/Frame.hpp"
 
-#include "src/smpi/include/private.h"
+#include "src/smpi/include/private.hpp"
 
 namespace simgrid {
 namespace mc {
index b258b16..5f2d921 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "src/mc/PageStore.hpp"
 
-#include "src/mc/mc_mmu.h"
+#include "src/mc/mc_mmu.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_page_snapshot, mc, "Logging specific to mc_page_snapshot");
 
index 80332ea..4ae359f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015. The SimGrid Team.
+/* Copyright (c) 2015-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -15,8 +15,8 @@
 
 #include "xbt/base.h"
 
-#include "src/mc/mc_mmu.h"
 #include "src/mc/mc_forward.hpp"
+#include "src/mc/mc_mmu.hpp"
 
 namespace simgrid {
 namespace mc {
index c120607..445daed 100644 (file)
@@ -12,7 +12,7 @@
 #endif
 
 #include "mc/mc.h"
-#include "src/mc/mc_snapshot.h"
+#include "src/mc/mc_snapshot.hpp"
 
 #include "src/mc/ChunkedData.hpp"
 #include "src/mc/RegionSnapshot.hpp"
index ce79e7c..b88f98d 100644 (file)
@@ -16,9 +16,9 @@
 #include <simgrid/sg_config.h>
 
 #include "src/mc/Session.hpp"
-#include "src/mc/mc_state.h"
-#include "src/mc/mc_private.h"
 #include "src/mc/checker/Checker.hpp"
+#include "src/mc/mc_private.hpp"
+#include "src/mc/mc_state.hpp"
 
 #include "src/smpi/include/private.hpp"
 
index a85f282..cb22a57 100644 (file)
@@ -15,8 +15,8 @@
 
 #include "src/mc/VisitedState.hpp"
 #include "src/mc/mc_comm_pattern.hpp"
-#include "src/mc/mc_private.h"
-#include "src/mc/mc_smx.h"
+#include "src/mc/mc_private.hpp"
+#include "src/mc/mc_smx.hpp"
 #include "src/mc/remote/RemoteClient.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_VisitedState, mc, "Logging specific to state equality detection mechanisms");
index a9a1b82..ebc6dcb 100644 (file)
@@ -11,8 +11,8 @@
 
 #include <memory>
 
-#include "src/mc/mc_snapshot.h"
-#include "src/mc/mc_state.h"
+#include "src/mc/mc_snapshot.hpp"
+#include "src/mc/mc_state.hpp"
 
 namespace simgrid {
 namespace mc {
index ce27ab2..4de42ae 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2016. The SimGrid Team.
+/* Copyright (c) 2016-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -11,9 +11,9 @@
 #include <memory>
 #include <string>
 
-#include "src/mc/mc_forward.hpp"
-#include "src/mc/mc_record.h"
 #include "src/mc/Session.hpp"
+#include "src/mc/mc_forward.hpp"
+#include "src/mc/mc_record.hpp"
 
 namespace simgrid {
 namespace mc {
index c4dd392..6c50eb7 100644 (file)
 #include "src/mc/Transition.hpp"
 #include "src/mc/VisitedState.hpp"
 #include "src/mc/checker/CommunicationDeterminismChecker.hpp"
-#include "src/mc/mc_exit.h"
-#include "src/mc/mc_private.h"
-#include "src/mc/mc_record.h"
-#include "src/mc/mc_request.h"
-#include "src/mc/mc_smx.h"
-#include "src/mc/mc_state.h"
+#include "src/mc/mc_exit.hpp"
+#include "src/mc/mc_private.hpp"
+#include "src/mc/mc_record.hpp"
+#include "src/mc/mc_request.hpp"
+#include "src/mc/mc_smx.hpp"
+#include "src/mc/mc_state.hpp"
 #include "src/mc/remote/Client.hpp"
 
 #include "smpi_request.hpp"
index 42ce4dc..6eef330 100644 (file)
 #include "src/mc/Session.hpp"
 #include "src/mc/Transition.hpp"
 #include "src/mc/checker/LivenessChecker.hpp"
-#include "src/mc/mc_exit.h"
-#include "src/mc/mc_private.h"
-#include "src/mc/mc_private.h"
-#include "src/mc/mc_record.h"
+#include "src/mc/mc_exit.hpp"
+#include "src/mc/mc_private.hpp"
+#include "src/mc/mc_private.hpp"
+#include "src/mc/mc_record.hpp"
 #include "src/mc/mc_replay.h"
-#include "src/mc/mc_request.h"
-#include "src/mc/mc_smx.h"
+#include "src/mc/mc_request.hpp"
+#include "src/mc/mc_smx.hpp"
 #include "src/mc/remote/Client.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_liveness, mc, "Logging specific to algorithms for liveness properties verification");
index ed4994e..160b77c 100644 (file)
 #include <memory>
 #include <vector>
 
+#include "src/mc/checker/Checker.hpp"
+#include "src/mc/mc_state.hpp"
 #include <simgrid_config.h>
-#include <xbt/base.h>
 #include <xbt/automaton.h>
-#include "src/mc/mc_state.h"
-#include "src/mc/checker/Checker.hpp"
-
-SG_BEGIN_DECL()
-
-SG_END_DECL()
+#include <xbt/base.h>
 
 namespace simgrid {
 namespace mc {
index e360a1e..0003a8f 100644 (file)
 #include "src/mc/Transition.hpp"
 #include "src/mc/VisitedState.hpp"
 #include "src/mc/checker/SafetyChecker.hpp"
-#include "src/mc/mc_exit.h"
-#include "src/mc/mc_private.h"
-#include "src/mc/mc_record.h"
-#include "src/mc/mc_request.h"
-#include "src/mc/mc_smx.h"
+#include "src/mc/mc_exit.hpp"
+#include "src/mc/mc_private.hpp"
+#include "src/mc/mc_record.hpp"
+#include "src/mc/mc_request.hpp"
+#include "src/mc/mc_smx.hpp"
 
 #include "src/xbt/mmalloc/mmprivate.h"
 
index ffc27f1..f299d9b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008-2016. The SimGrid Team.
+/* Copyright (c) 2008-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -15,7 +15,7 @@
 #include "src/mc/VisitedState.hpp"
 #include "src/mc/checker/Checker.hpp"
 #include "src/mc/mc_forward.hpp"
-#include "src/mc/mc_safety.h"
+#include "src/mc/mc_safety.hpp"
 
 namespace simgrid {
 namespace mc {
index 1b57a3f..45f1201 100644 (file)
@@ -23,9 +23,9 @@
 #include "src/mc/checker/Checker.hpp"
 #include "src/mc/mc_base.h"
 #include "src/mc/mc_comm_pattern.hpp"
-#include "src/mc/mc_exit.h"
-#include "src/mc/mc_private.h"
-#include "src/mc/mc_safety.h"
+#include "src/mc/mc_exit.hpp"
+#include "src/mc/mc_private.hpp"
+#include "src/mc/mc_safety.hpp"
 #include "src/mc/remote/mc_protocol.h"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_main, mc, "Entry point for simgrid-mc");
index 03f96ae..6516f89 100644 (file)
 #include "src/xbt/mmalloc/mmprivate.h"
 
 #if HAVE_SMPI
-#include "src/smpi/include/private.h"
 #include "src/smpi/include/private.hpp"
 #endif
 
-#include "src/mc/mc_forward.hpp"
-#include "src/mc/mc_private.h"
-#include "src/mc/mc_smx.h"
-#include "src/mc/mc_dwarf.hpp"
 #include "src/mc/Frame.hpp"
 #include "src/mc/ObjectInformation.hpp"
+#include "src/mc/Type.hpp"
 #include "src/mc/Variable.hpp"
-#include "src/mc/mc_private.h"
-#include "src/mc/mc_snapshot.h"
 #include "src/mc/mc_dwarf.hpp"
-#include "src/mc/Type.hpp"
+#include "src/mc/mc_forward.hpp"
+#include "src/mc/mc_private.hpp"
+#include "src/mc/mc_smx.hpp"
+#include "src/mc/mc_snapshot.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_compare, xbt, "Logging specific to mc_compare in mc");
 
index f2b9548..dbafa01 100644 (file)
@@ -8,7 +8,7 @@
 #include "mc/mc.h"
 #include "src/mc/mc_base.h"
 #include "src/mc/mc_replay.h"
-#include "src/simix/smx_private.h"
+#include "src/simix/smx_private.hpp"
 
 #if SIMGRID_HAVE_MC
 #include "src/mc/ModelChecker.hpp"
index 44d5091..d5a334f 100644 (file)
 #endif
 
 #include "src/internal_config.h"
-#include "src/mc/mc_private.h"
-#include "src/smpi/include/private.h"
+#include "src/mc/mc_private.hpp"
+#include "src/smpi/include/private.hpp"
 #include "xbt/mmalloc.h"
 #include "xbt/module.h"
 
 #include "src/xbt/mmalloc/mmprivate.h"
 
-#include "src/simix/smx_private.h"
+#include "src/simix/smx_private.hpp"
 
 #include <libunwind.h>
 #include <libelf.h>
 
-#include "src/mc/mc_private.h"
+#include "src/mc/mc_private.hpp"
 #include <mc/mc.h>
 
 #include "src/mc/mc_hash.hpp"
-#include "src/mc/mc_mmu.h"
-#include "src/mc/mc_smx.h"
-#include "src/mc/mc_snapshot.h"
-#include "src/mc/mc_unw.h"
+#include "src/mc/mc_mmu.hpp"
+#include "src/mc/mc_smx.hpp"
+#include "src/mc/mc_snapshot.hpp"
+#include "src/mc/mc_unw.hpp"
 #include "src/mc/remote/mc_protocol.h"
 
 #include "src/mc/RegionSnapshot.hpp"
index fee19b6..aab4ac6 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008-2015. The SimGrid Team.
+/* Copyright (c) 2008-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -10,8 +10,8 @@
 
 #include "src/mc/ModelChecker.hpp"
 #include "src/mc/mc_ignore.h"
-#include "src/mc/mc_private.h"
-#include "src/mc/mc_record.h"
+#include "src/mc/mc_private.hpp"
+#include "src/mc/mc_record.hpp"
 #include "src/mc/remote/Client.hpp"
 #include "src/mc/remote/mc_protocol.h"
 
index cb7029c..48608a8 100644 (file)
@@ -11,7 +11,7 @@
 
 #include "src/mc/checker/CommunicationDeterminismChecker.hpp"
 #include "src/mc/mc_comm_pattern.hpp"
-#include "src/mc/mc_smx.h"
+#include "src/mc/mc_smx.hpp"
 #include "src/mc/mc_xbt.hpp"
 
 using simgrid::mc::remote;
index 0d99b67..feac5b4 100644 (file)
@@ -11,7 +11,7 @@
 #include "smpi/smpi.h"
 #include "xbt/dynar.h"
 
-#include "src/mc/mc_state.h"
+#include "src/mc/mc_state.hpp"
 
 namespace simgrid {
 namespace mc {
@@ -23,7 +23,7 @@ struct PatternCommunicationList {
 }
 }
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /**
  *  Type: `xbt_dynar_t<mc_list_comm_pattern_t>`
@@ -77,7 +77,6 @@ XBT_PRIVATE void MC_restore_communications_pattern(simgrid::mc::State* state);
 
 XBT_PRIVATE void MC_state_copy_incomplete_communications_pattern(simgrid::mc::State* state);
 XBT_PRIVATE void MC_state_copy_index_communications_pattern(simgrid::mc::State* state);
-
-SG_END_DECL()
+}
 
 #endif
index e61201c..566544c 100644 (file)
 #include <simgrid/sg_config.h>
 
 #if SIMGRID_HAVE_MC
-#include "src/mc/mc_safety.h"
-#include "src/mc/mc_private.h"
+#include "src/mc/mc_private.hpp"
+#include "src/mc/mc_safety.hpp"
 #endif
 
-#include "src/mc/mc_record.h"
+#include "src/mc/mc_record.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_config, mc, "Configuration of the Model Checker");
 
index c7a785b..3a21afc 100644 (file)
@@ -25,8 +25,8 @@
 #include "xbt/sysdep.h"
 #include <simgrid_config.h>
 
-#include "src/mc/mc_private.h"
 #include "src/mc/mc_dwarf.hpp"
+#include "src/mc/mc_private.hpp"
 
 #include "src/mc/ObjectInformation.hpp"
 #include "src/mc/Variable.hpp"
similarity index 71%
rename from src/mc/mc_exit.h
rename to src/mc/mc_exit.hpp
index 83fe9dc..cede412 100644 (file)
@@ -7,21 +7,21 @@
 #define SIMGRID_MC_EXIT_HPP
 #include "xbt/base.h"
 
-#define SIMGRID_MC_EXIT_SUCCESS  0
-#define SIMGRID_MC_EXIT_SAFETY   1
+#define SIMGRID_MC_EXIT_SUCCESS 0
+#define SIMGRID_MC_EXIT_SAFETY 1
 #define SIMGRID_MC_EXIT_LIVENESS 2
 #define SIMGRID_MC_EXIT_DEADLOCK 3
 #define SIMGRID_MC_EXIT_NON_TERMINATION 4
 #define SIMGRID_MC_EXIT_NON_DETERMINISM 5
 #define SIMGRID_MC_EXIT_PROGRAM_CRASH 6
 
-#define SIMGRID_MC_EXIT_ERROR         63
+#define SIMGRID_MC_EXIT_ERROR 63
 
 namespace simgrid {
 namespace mc {
-XBT_PUBLIC_CLASS DeadlockError {};
-XBT_PUBLIC_CLASS TerminationError {};
-XBT_PUBLIC_CLASS LivenessError {};
+XBT_PUBLIC_CLASS DeadlockError{};
+XBT_PUBLIC_CLASS TerminationError{};
+XBT_PUBLIC_CLASS LivenessError{};
 }
 }
 
index 0204bbd..0e86c47 100644 (file)
 #if SIMGRID_HAVE_MC
 #include "src/mc/checker/Checker.hpp"
 #include "src/mc/mc_comm_pattern.hpp"
-#include "src/mc/mc_private.h"
-#include "src/mc/mc_request.h"
-#include "src/mc/mc_safety.h"
-#include "src/mc/mc_smx.h"
-#include "src/mc/mc_snapshot.h"
-#include "src/mc/mc_unw.h"
+#include "src/mc/mc_private.hpp"
+#include "src/mc/mc_request.hpp"
+#include "src/mc/mc_safety.hpp"
+#include "src/mc/mc_smx.hpp"
+#include "src/mc/mc_snapshot.hpp"
+#include "src/mc/mc_unw.hpp"
 #include <libunwind.h>
 #endif
 
 #include "src/mc/Transition.hpp"
-#include "src/mc/mc_record.h"
+#include "src/mc/mc_record.hpp"
 #include "src/mc/remote/Client.hpp"
 #include "src/mc/remote/mc_protocol.h"
 
index d537cfe..9a77423 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2015. The SimGrid Team.
+/* Copyright (c) 2014-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
 
 #include "xbt/log.h"
 
-#include "src/mc/mc_private.h"
-#include "src/mc/mc_snapshot.h"
 #include "mc/datatypes.h"
 #include "src/mc/mc_hash.hpp"
+#include "src/mc/mc_private.hpp"
+#include "src/mc/mc_snapshot.hpp"
 #include <mc/mc.h>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_hash, mc, "Logging specific to mc_hash");
index ff4c77f..c2c67e7 100644 (file)
@@ -1,12 +1,12 @@
-/* Copyright (c) 2014-2015. The SimGrid Team.
+/* Copyright (c) 2014-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "src/mc/mc_private.h"
 #include "src/mc/Type.hpp"
 #include "src/mc/mc_dwarf.hpp"
+#include "src/mc/mc_private.hpp"
 
 namespace simgrid {
 namespace dwarf {
index d0bb0a6..28ff84b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008-2015. The SimGrid Team.
+/* Copyright (c) 2008-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -10,7 +10,7 @@
 #include "xbt/log.h"
 
 #include "mc/mc.h"
-#include "src/mc/mc_private.h"
+#include "src/mc/mc_private.hpp"
 #include "src/xbt/mmalloc/mmprivate.h"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_memory, mc,
similarity index 83%
rename from src/mc/mc_mmu.h
rename to src/mc/mc_mmu.hpp
index c7d5b97..b220822 100644 (file)
@@ -3,10 +3,12 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#ifndef SIMGRID_MC_MMU_H
-#define SIMGRID_MC_MMU_H
+#ifndef SIMGRID_MC_MMU_HPP
+#define SIMGRID_MC_MMU_HPP
 
 #include "xbt/misc.h" // xbt_pagesize...
+#include <cstdint>
+#include <utility>
 
 namespace simgrid {
 namespace mc {
@@ -26,24 +28,21 @@ static int chunkSize()
 static XBT_ALWAYS_INLINE std::size_t chunkCount(std::size_t size)
 {
   size_t page_count = size >> xbt_pagebits;
-  if (size & (xbt_pagesize-1))
-    page_count ++;
+  if (size & (xbt_pagesize - 1))
+    page_count++;
   return page_count;
 }
 
 /** @brief Split into chunk number and remaining offset */
 static XBT_ALWAYS_INLINE std::pair<std::size_t, std::uintptr_t> split(std::uintptr_t offset)
 {
-  return {
-    offset >> xbt_pagebits,
-    offset & (xbt_pagesize-1)
-  };
+  return {offset >> xbt_pagebits, offset & (xbt_pagesize - 1)};
 }
 
 /** Merge chunk number and remaining offset info a global offset */
 static XBT_ALWAYS_INLINE std::uintptr_t join(std::size_t page, std::uintptr_t offset)
 {
-  return ((std::uintptr_t) page << xbt_pagebits) + offset;
+  return ((std::uintptr_t)page << xbt_pagebits) + offset;
 }
 
 static XBT_ALWAYS_INLINE std::uintptr_t join(std::pair<std::size_t, std::uintptr_t> value)
@@ -55,7 +54,6 @@ static XBT_ALWAYS_INLINE bool sameChunk(std::uintptr_t a, std::uintptr_t b)
 {
   return (a >> xbt_pagebits) == (b >> xbt_pagebits);
 }
-
 }
 }
 }
index 5c6f2bf..dacbbb6 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2015. The SimGrid Team.
+/* Copyright (c) 2014-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -10,9 +10,9 @@
 #include <unistd.h> // pread, pwrite
 
 #include "src/mc/PageStore.hpp"
-#include "src/mc/mc_mmu.h"
-#include "src/mc/mc_private.h"
-#include "src/mc/mc_snapshot.h"
+#include "src/mc/mc_mmu.hpp"
+#include "src/mc/mc_private.hpp"
+#include "src/mc/mc_snapshot.hpp"
 
 #include <xbt/mmalloc.h>
 #include "src/mc/ChunkedData.hpp"
similarity index 75%
rename from src/mc/mc_private.h
rename to src/mc/mc_private.hpp
index 0bdeb53..f51b0e9 100644 (file)
@@ -3,40 +3,34 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#ifndef SIMGRID_MC_PRIVATE_H
-#define SIMGRID_MC_PRIVATE_H
+#ifndef SIMGRID_MC_PRIVATE_HPP
+#define SIMGRID_MC_PRIVATE_HPP
 
 #include "mc/mc.h"
 #include "xbt/automaton.h"
 
-#ifdef __cplusplus
 #include "src/mc/mc_forward.hpp"
 #include "src/xbt/memory_map.hpp"
-#endif
 
-#ifdef __cplusplus
 namespace simgrid {
 namespace mc {
 
 struct DerefAndCompareByActorsCountAndUsedHeap {
-  template<class X, class Y>
-  bool operator()(X const& a, Y const& b)
+  template <class X, class Y> bool operator()(X const& a, Y const& b)
   {
     return std::make_pair(a->actors_count, a->heap_bytes_used) < std::make_pair(b->actors_count, b->heap_bytes_used);
   }
 };
-
 }
 }
-#endif
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /********************************* MC Global **********************************/
 
 XBT_PRIVATE void MC_init_dot_output();
 
-XBT_PRIVATE extern FILE *dot_output;
+XBT_PRIVATE extern FILEdot_output;
 
 XBT_PRIVATE void MC_show_deadlock(void);
 
@@ -46,26 +40,20 @@ XBT_PRIVATE void MC_show_deadlock(void);
 #define MC_VERBOSE 1
 
 /********************************** Miscellaneous **********************************/
-
-SG_END_DECL()
-
-#ifdef __cplusplus
+}
 
 namespace simgrid {
 namespace mc {
 
-XBT_PRIVATE void find_object_address(
-  std::vector<simgrid::xbt::VmMap> const& maps, simgrid::mc::ObjectInformation* result);
+XBT_PRIVATE void find_object_address(std::vector<simgrid::xbt::VmMap> const& maps,
+                                     simgrid::mc::ObjectInformation* result);
 
 XBT_PRIVATE
 int snapshot_compare(int num1, simgrid::mc::Snapshot* s1, int num2, simgrid::mc::Snapshot* s2);
 
 // Move is somewhere else (in the LivenessChecker class, in the Session class?):
 extern XBT_PRIVATE xbt_automaton_t property_automaton;
-
 }
 }
 
 #endif
-
-#endif
index a8dfdb1..5939b84 100644 (file)
 #include "simgrid/simix.h"
 
 #include "src/kernel/context/Context.hpp"
-#include "src/simix/ActorImpl.hpp"
-#include "src/simix/smx_private.h"
+#include "src/mc/mc_record.hpp"
 #include "src/mc/mc_replay.h"
-#include "src/mc/mc_record.h"
+#include "src/simix/ActorImpl.hpp"
+#include "src/simix/smx_private.hpp"
 
 #include "src/mc/mc_base.h"
 #include "src/mc/Transition.hpp"
 
 #if SIMGRID_HAVE_MC
-#include "src/mc/mc_request.h"
-#include "src/mc/mc_private.h"
-#include "src/mc/mc_state.h"
-#include "src/mc/mc_smx.h"
 #include "src/mc/checker/Checker.hpp"
+#include "src/mc/mc_private.hpp"
+#include "src/mc/mc_request.hpp"
+#include "src/mc/mc_smx.hpp"
+#include "src/mc/mc_state.hpp"
 #endif
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_record, mc,
similarity index 93%
rename from src/mc/mc_record.h
rename to src/mc/mc_record.hpp
index 56a3410..af99482 100644 (file)
@@ -3,7 +3,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-/** \file mc_record.h
+/** \file mc_record.hpp
  *
  *  This file contains the MC replay/record functionnality.
  *  A MC path may be recorded by using ``-cfg=model-check/record:1`'`.
@@ -14,8 +14,8 @@
  *  passed to the application (without the MC specific arguments).
  */
 
-#ifndef SIMGRID_MC_RECORD_H
-#define SIMGRID_MC_RECORD_H
+#ifndef SIMGRID_MC_RECORD_HPP
+#define SIMGRID_MC_RECORD_HPP
 
 #include "src/mc/Transition.hpp"
 #include "xbt/base.h"
@@ -35,12 +35,9 @@ XBT_PRIVATE void dumpRecordPath();
 
 XBT_PRIVATE void replay(RecordTrace const& trace);
 XBT_PRIVATE void replay(const char* trace);
-
 }
 }
 
-SG_BEGIN_DECL()
-
 /** Whether the MC record mode is enabled
  *
  *  The behaviour is not changed. The only real difference is that
@@ -50,6 +47,4 @@ SG_BEGIN_DECL()
 
 // **** Data conversion
 
-SG_END_DECL()
-
 #endif
index 59ccaa9..e4fbdf6 100644 (file)
@@ -7,8 +7,8 @@
 
 #include "src/include/mc/mc.h"
 #include "src/mc/ModelChecker.hpp"
-#include "src/mc/mc_request.h"
-#include "src/mc/mc_smx.h"
+#include "src/mc/mc_request.hpp"
+#include "src/mc/mc_smx.hpp"
 #include "src/mc/mc_xbt.hpp"
 
 using simgrid::mc::remote;
similarity index 87%
rename from src/mc/mc_request.h
rename to src/mc/mc_request.hpp
index f7085c6..6036769 100644 (file)
@@ -3,10 +3,10 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#ifndef SIMGRID_MC_REQUEST_H
-#define SIMGRID_MC_REQUEST_H
+#ifndef SIMGRID_MC_REQUEST_HPP
+#define SIMGRID_MC_REQUEST_HPP
 
-#include "src/simix/smx_private.h"
+#include "src/simix/smx_private.hpp"
 
 namespace simgrid {
 namespace mc {
@@ -24,7 +24,6 @@ XBT_PRIVATE std::string request_to_string(smx_simcall_t req, int value, simgrid:
 XBT_PRIVATE bool request_is_enabled_by_idx(smx_simcall_t req, unsigned int idx);
 
 XBT_PRIVATE std::string request_get_dot_output(smx_simcall_t req, int value);
-
 }
 }
 
similarity index 87%
rename from src/mc/mc_safety.h
rename to src/mc/mc_safety.hpp
index 2c31b5d..bf1853d 100644 (file)
@@ -3,8 +3,8 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#ifndef SIMGRID_MC_SAFETY_H
-#define SIMGRID_MC_SAFETY_H
+#ifndef SIMGRID_MC_SAFETY_HPP
+#define SIMGRID_MC_SAFETY_HPP
 
 #include "xbt/base.h"
 
@@ -18,7 +18,6 @@ enum class ReductionMode {
 };
 
 extern XBT_PRIVATE simgrid::mc::ReductionMode reduction_mode;
-
 }
 }
 
index c37252a..4711074 100644 (file)
@@ -5,8 +5,8 @@
 
 #include "simgrid/s4u/Host.hpp"
 
-#include "src/mc/mc_smx.h"
 #include "src/mc/ModelChecker.hpp"
+#include "src/mc/mc_smx.hpp"
 
 using simgrid::mc::remote;
 
similarity index 95%
rename from src/mc/mc_smx.h
rename to src/mc/mc_smx.hpp
index be72eaa..cebb749 100644 (file)
@@ -3,8 +3,8 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#ifndef SIMGRID_MC_SMX_H
-#define SIMGRID_MC_SMX_H
+#ifndef SIMGRID_MC_SMX_HPP
+#define SIMGRID_MC_SMX_HPP
 
 #include "src/mc/remote/RemoteClient.hpp"
 
@@ -28,7 +28,7 @@
  * MCed code.
  */
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /** Get the issuer of  a simcall (`req->issuer`)
  *
@@ -47,7 +47,6 @@ XBT_PRIVATE const char* MC_smx_actor_get_host_name(smx_actor_t p);
 XBT_PRIVATE int MC_smpi_process_count(void);
 
 XBT_PRIVATE unsigned long MC_smx_get_maxpid(void);
-
-SG_END_DECL()
+}
 
 #endif
index 11dba26..ce1c2a8 100644 (file)
 #include "xbt/sysdep.h"
 
 #include "src/internal_config.h"
-#include "src/smpi/include/private.h"
+#include "src/smpi/include/private.hpp"
 
-#include "src/mc/mc_snapshot.h"
-#include "src/mc/mc_private.h"
-#include "src/mc/mc_mmu.h"
 #include "src/mc/PageStore.hpp"
+#include "src/mc/mc_mmu.hpp"
+#include "src/mc/mc_private.hpp"
+#include "src/mc/mc_snapshot.hpp"
 
 extern "C" {
 
@@ -201,9 +201,9 @@ const void* Snapshot::read_bytes(void* buffer, std::size_t size,
 
 #include <sys/mman.h>
 
-#include "src/mc/mc_private.h"
-#include "src/mc/mc_snapshot.h"
-#include "src/mc/mc_mmu.h"
+#include "src/mc/mc_mmu.hpp"
+#include "src/mc/mc_private.hpp"
+#include "src/mc/mc_snapshot.hpp"
 
 XBT_TEST_SUITE("mc_snapshot", "Snapshots");
 
similarity index 66%
rename from src/mc/mc_snapshot.h
rename to src/mc/mc_snapshot.hpp
index 1b1c7c1..8c97902 100644 (file)
@@ -3,20 +3,20 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#ifndef SIMGRID_MC_SNAPSHOT_H
-#define SIMGRID_MC_SNAPSHOT_H
+#ifndef SIMGRID_MC_SNAPSHOT_HPP
+#define SIMGRID_MC_SNAPSHOT_HPP
 
-#include <vector>
+#include <memory>
 #include <set>
 #include <string>
-#include <memory>
+#include <vector>
 
 #include "src/mc/ModelChecker.hpp"
 #include "src/mc/RegionSnapshot.hpp"
 #include "src/mc/mc_forward.hpp"
-#include "src/mc/mc_unw.h"
+#include "src/mc/mc_unw.hpp"
 
-SG_BEGIN_DECL()
+extern "C" {
 
 // ***** Snapshot region
 
@@ -24,29 +24,27 @@ XBT_PRIVATE void mc_region_restore_sparse(simgrid::mc::RemoteClient* process, mc
 
 static XBT_ALWAYS_INLINE void* mc_translate_address_region_chunked(uintptr_t addr, mc_mem_region_t region)
 {
-  auto split = simgrid::mc::mmu::split(addr - region->start().address());
-  auto pageno = split.first;
-  auto offset = split.second;
+  auto split                = simgrid::mc::mmu::split(addr - region->start().address());
+  auto pageno               = split.first;
+  auto offset               = split.second;
   const void* snapshot_page = region->page_data().page(pageno);
-  return (char*) snapshot_page + offset;
+  return (char*)snapshot_page + offset;
 }
 
 static XBT_ALWAYS_INLINE void* mc_translate_address_region(uintptr_t addr, mc_mem_region_t region, int process_index)
 {
   switch (region->storage_type()) {
-  case simgrid::mc::StorageType::Flat:
-    {
-      uintptr_t offset = (uintptr_t) addr - (uintptr_t) region->start().address();
-      return (void *) ((uintptr_t) region->flat_data().get() + offset);
+    case simgrid::mc::StorageType::Flat: {
+      uintptr_t offset = (uintptr_t)addr - (uintptr_t)region->start().address();
+      return (void*)((uintptr_t)region->flat_data().get() + offset);
     }
-  case simgrid::mc::StorageType::Chunked:
-    return mc_translate_address_region_chunked(addr, region);
-  case simgrid::mc::StorageType::Privatized:
-    {
-    xbt_assert(process_index >= 0, "Missing process index for privatized region");
-    xbt_assert((size_t)process_index < region->privatized_data().size(), "Out of range process index");
-    simgrid::mc::RegionSnapshot& subregion = region->privatized_data()[process_index];
-    return mc_translate_address_region(addr, &subregion, process_index);
+    case simgrid::mc::StorageType::Chunked:
+      return mc_translate_address_region_chunked(addr, region);
+    case simgrid::mc::StorageType::Privatized: {
+      xbt_assert(process_index >= 0, "Missing process index for privatized region");
+      xbt_assert((size_t)process_index < region->privatized_data().size(), "Out of range process index");
+      simgrid::mc::RegionSnapshot& subregion = region->privatized_data()[process_index];
+      return mc_translate_address_region(addr, &subregion, process_index);
     }
     case simgrid::mc::StorageType::NoData:
     default:
@@ -70,7 +68,7 @@ typedef struct s_mc_snapshot_ignored_data {
   std::vector<char> data;
 } s_mc_snapshot_ignored_data_t;
 
-typedef struct s_fd_infos{
+typedef struct s_fd_infos {
   std::string filename;
   int number;
   off_t current_position;
@@ -90,12 +88,12 @@ typedef struct s_mc_stack_frame {
 } s_mc_stack_frame_t;
 typedef s_mc_stack_frame_t* mc_stack_frame_t;
 
-typedef struct s_local_variable{
+typedef struct s_local_variable {
   simgrid::mc::Frame* subprogram;
   unsigned long ip;
   std::string name;
   simgrid::mc::Type* type;
-  void *address;
+  voidaddress;
   int region;
 } s_local_variable_t;
 typedef s_local_variable_t* local_variable_t;
@@ -114,9 +112,8 @@ class XBT_PRIVATE Snapshot final : public AddressSpace {
 public:
   Snapshot(RemoteClient* process, int num_state);
   ~Snapshot() = default;
-  const void* read_bytes(void* buffer, std::size_t size,
-    RemotePtr<void> address, int process_index = ProcessIndexAny,
-    ReadOptions options = ReadOptions::none()) const override;
+  const void* read_bytes(void* buffer, std::size_t size, RemotePtr<void> address, int process_index = ProcessIndexAny,
+                         ReadOptions options = ReadOptions::none()) const override;
 
   // To be private
   int num_state;
@@ -131,7 +128,6 @@ public:
   std::vector<s_mc_snapshot_ignored_data> ignored_data;
   std::vector<s_fd_infos_t> current_fds;
 };
-
 }
 }
 
@@ -147,41 +143,32 @@ static XBT_ALWAYS_INLINE mc_mem_region_t mc_get_region_hinted(void* addr, simgri
 }
 
 static const void* mc_snapshot_get_heap_end(simgrid::mc::Snapshot* snapshot);
-
 }
 
-#ifdef __cplusplus
-
 namespace simgrid {
 namespace mc {
 
 XBT_PRIVATE std::shared_ptr<simgrid::mc::Snapshot> take_snapshot(int num_state);
 XBT_PRIVATE void restore_snapshot(std::shared_ptr<simgrid::mc::Snapshot> snapshot);
-
 }
 }
 
-#endif
-
 extern "C" {
 
 XBT_PRIVATE void mc_restore_page_snapshot_region(simgrid::mc::RemoteClient* process, void* start_addr,
                                                  simgrid::mc::ChunkedData const& pagenos);
 
-const void* MC_region_read_fragmented(
-  mc_mem_region_t region, void* target, const void* addr, std::size_t size);
+const void* MC_region_read_fragmented(mc_mem_region_t region, void* target, const void* addr, std::size_t size);
 
-int MC_snapshot_region_memcmp(
-  const void* addr1, mc_mem_region_t region1,
-  const void* addr2, mc_mem_region_t region2, std::size_t size);
-XBT_PRIVATE int MC_snapshot_memcmp(
-  const void* addr1, simgrid::mc::Snapshot* snapshot1,
-  const void* addr2, simgrid::mc::Snapshot* snapshot2, int process_index, std::size_t size);
+int MC_snapshot_region_memcmp(const void* addr1, mc_mem_region_t region1, const void* addr2, mc_mem_region_t region2,
+                              std::size_t size);
+XBT_PRIVATE int MC_snapshot_memcmp(const void* addr1, simgrid::mc::Snapshot* snapshot1, const void* addr2,
+                                   simgrid::mc::Snapshot* snapshot2, int process_index, std::size_t size);
 
 static XBT_ALWAYS_INLINE const void* mc_snapshot_get_heap_end(simgrid::mc::Snapshot* snapshot)
 {
-  if(snapshot==nullptr)
-      xbt_die("snapshot is nullptr");
+  if (snapshot == nullptr)
+    xbt_die("snapshot is nullptr");
   return mc_model_checker->process().get_heap()->breakval;
 }
 
@@ -203,39 +190,37 @@ static XBT_ALWAYS_INLINE const void* MC_region_read(mc_mem_region_t region, void
   xbt_assert(region->contain(simgrid::mc::remote(addr)), "Trying to read out of the region boundary.");
 
   switch (region->storage_type()) {
-  case simgrid::mc::StorageType::NoData:
-  default:
-    xbt_die("Storage type not supported");
+    case simgrid::mc::StorageType::NoData:
+    default:
+      xbt_die("Storage type not supported");
 
-  case simgrid::mc::StorageType::Flat:
-    return (char*) region->flat_data().get() + offset;
+    case simgrid::mc::StorageType::Flat:
+      return (char*)region->flat_data().get() + offset;
 
-  case simgrid::mc::StorageType::Chunked:
-    {
+    case simgrid::mc::StorageType::Chunked: {
       // Last byte of the region:
-      void* end = (char*) addr + size - 1;
-      if (simgrid::mc::mmu::sameChunk((std::uintptr_t) addr, (std::uintptr_t) end) ) {
+      void* end = (char*)addr + size - 1;
+      if (simgrid::mc::mmu::sameChunk((std::uintptr_t)addr, (std::uintptr_t)end)) {
         // The memory is contained in a single page:
-        return mc_translate_address_region_chunked((uintptr_t) addr, region);
+        return mc_translate_address_region_chunked((uintptr_t)addr, region);
       } else {
         // The memory spans several pages:
         return MC_region_read_fragmented(region, target, addr, size);
       }
     }
 
-  // We currently do not pass the process_index to this function so we assume
-  // that the privatized region has been resolved in the callers:
-  case simgrid::mc::StorageType::Privatized:
-    xbt_die("Storage type not supported");
+    // We currently do not pass the process_index to this function so we assume
+    // that the privatized region has been resolved in the callers:
+    case simgrid::mc::StorageType::Privatized:
+      xbt_die("Storage type not supported");
   }
 }
 
 static XBT_ALWAYS_INLINE void* MC_region_read_pointer(mc_mem_region_t region, const void* addr)
 {
   void* res;
-  return *(void**) MC_region_read(region, &res, addr, sizeof(void*));
+  return *(void**)MC_region_read(region, &res, addr, sizeof(void*));
+}
 }
-
-SG_END_DECL()
 
 #endif
index 0bce019..3fce2df 100644 (file)
 
 #include "src/mc/Transition.hpp"
 #include "src/mc/mc_comm_pattern.hpp"
-#include "src/mc/mc_private.h"
-#include "src/mc/mc_request.h"
-#include "src/mc/mc_smx.h"
-#include "src/mc/mc_state.h"
+#include "src/mc/mc_private.hpp"
+#include "src/mc/mc_request.hpp"
+#include "src/mc/mc_smx.hpp"
+#include "src/mc/mc_state.hpp"
 #include "src/mc/mc_xbt.hpp"
-#include "src/simix/smx_private.h"
+#include "src/simix/smx_private.hpp"
 
 using simgrid::mc::remote;
 
similarity index 81%
rename from src/mc/mc_state.h
rename to src/mc/mc_state.hpp
index 7e6a78d..edef946 100644 (file)
@@ -3,22 +3,22 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#ifndef SIMGRID_MC_STATE_H
-#define SIMGRID_MC_STATE_H
+#ifndef SIMGRID_MC_STATE_HPP
+#define SIMGRID_MC_STATE_HPP
 
 #include <list>
 #include <memory>
 
-#include "src/mc/mc_snapshot.h"
-#include "src/mc/mc_record.h"
 #include "src/mc/Transition.hpp"
+#include "src/mc/mc_record.hpp"
+#include "src/mc/mc_snapshot.hpp"
 
 namespace simgrid {
 namespace mc {
 
 enum class PatternCommunicationType {
-  none = 0,
-  send = 1,
+  none    = 0,
+  send    = 1,
   receive = 2,
 };
 
@@ -27,37 +27,33 @@ public:
   int num = 0;
   simgrid::kernel::activity::CommImpl* comm_addr;
   PatternCommunicationType type = PatternCommunicationType::send;
-  unsigned long src_proc = 0;
-  unsigned long dst_proc = 0;
-  const char *src_host = nullptr;
-  const char *dst_host = nullptr;
+  unsigned long src_proc        = 0;
+  unsigned long dst_proc        = 0;
+  const char* src_host          = nullptr;
+  const char* dst_host          = nullptr;
   std::string rdv;
   std::vector<char> data;
-  int tag = 0;
+  int tag   = 0;
   int index = 0;
 
-  PatternCommunication()
-  {
-    std::memset(&comm_addr, 0, sizeof(comm_addr));
-  }
+  PatternCommunication() { std::memset(&comm_addr, 0, sizeof(comm_addr)); }
 
   PatternCommunication dup() const
   {
     simgrid::mc::PatternCommunication res;
     // num?
     res.comm_addr = this->comm_addr;
-    res.type = this->type;
+    res.type      = this->type;
     // src_proc?
     // dst_proc?
     res.dst_proc = this->dst_proc;
     res.dst_host = this->dst_host;
-    res.rdv = this->rdv;
-    res.data = this->data;
+    res.rdv      = this->rdv;
+    res.data     = this->data;
     // tag?
     res.index = this->index;
     return res;
   }
-
 };
 
 /* On every state, each process has an entry of the following type.
@@ -79,28 +75,22 @@ class ProcessState {
 
   /** Exploration control information */
   InterleavingType state = InterleavingType::disabled;
+
 public:
   /** Number of times that the process was considered to be executed */
   // TODO, make this private
   unsigned int times_considered = 0;
 
-  bool isDisabled() const {
-    return this->state == InterleavingType::disabled;
-  }
-  bool isDone() const {
-    return this->state == InterleavingType::done;
-  }
-  bool isTodo() const {
-    return this->state == InterleavingType::todo;
-  }
+  bool isDisabled() const { return this->state == InterleavingType::disabled; }
+  bool isDone() const { return this->state == InterleavingType::done; }
+  bool isTodo() const { return this->state == InterleavingType::todo; }
   /** Mark that we should try executing this process at some point in the future of the checker algorithm */
-  void consider() {
+  void consider()
+  {
     this->state            = InterleavingType::todo;
     this->times_considered = 0;
   }
-  void setDone() {
-    this->state = InterleavingType::done;
-  }
+  void setDone() { this->state = InterleavingType::done; }
 };
 
 /* A node in the exploration graph (kind-of)
@@ -141,7 +131,6 @@ public:
   void addInterleavingSet(smx_actor_t actor) { this->actorStates[actor->pid].consider(); }
   Transition getTransition() const;
 };
-
 }
 }
 
index 85b6129..b85172e 100644 (file)
@@ -23,7 +23,7 @@ typedef register_t greg_t;
 #include <libunwind.h>
 
 #include "src/mc/Frame.hpp"
-#include "src/mc/mc_unw.h"
+#include "src/mc/mc_unw.hpp"
 #include "src/mc/remote/RemoteClient.hpp"
 
 using simgrid::mc::remote;
similarity index 63%
rename from src/mc/mc_unw.h
rename to src/mc/mc_unw.hpp
index 6a6b861..7eeec0a 100644 (file)
@@ -3,8 +3,8 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#ifndef SIMGRID_MC_UNW_H
-#define SIMGRID_MC_UNW_H
+#ifndef SIMGRID_MC_UNW_HPP
+#define SIMGRID_MC_UNW_HPP
 
 /** @file
  *  Libunwind implementation for the model-checker
@@ -28,8 +28,8 @@
 #include "src/mc/mc_forward.hpp"
 #include "xbt/base.h"
 
+#include <cstdio>
 #include <libunwind.h>
-#include <stdio.h>
 #include <sys/types.h>
 
 namespace simgrid {
@@ -37,7 +37,6 @@ namespace unw {
 
 XBT_PRIVATE unw_addr_space_t create_addr_space();
 XBT_PRIVATE void* create_context(unw_addr_space_t as, pid_t pid);
-
 }
 }
 
@@ -57,30 +56,19 @@ public:
   unw_cursor_t cursor();
 
 private: // Methods and virtual table for libunwind
-  static int find_proc_info(unw_addr_space_t as,
-                unw_word_t ip, unw_proc_info_t *pip,
-                int need_unwind_info, void* arg) noexcept;
-  static void put_unwind_info(unw_addr_space_t as,
-                unw_proc_info_t *pip, void* arg) noexcept;
-  static int get_dyn_info_list_addr(unw_addr_space_t as,
-                unw_word_t *dilap, void* arg) noexcept;
-  static int access_mem(unw_addr_space_t as,
-                unw_word_t addr, unw_word_t *valp,
-                int write, void* arg) noexcept;
+  static int find_proc_info(unw_addr_space_t as, unw_word_t ip, unw_proc_info_t* pip, int need_unwind_info,
+                            void* arg) noexcept;
+  static void put_unwind_info(unw_addr_space_t as, unw_proc_info_t* pip, void* arg) noexcept;
+  static int get_dyn_info_list_addr(unw_addr_space_t as, unw_word_t* dilap, void* arg) noexcept;
+  static int access_mem(unw_addr_space_t as, unw_word_t addr, unw_word_t* valp, int write, void* arg) noexcept;
   static void* get_reg(unw_context_t* context, unw_regnum_t regnum) noexcept;
-  static int access_reg(unw_addr_space_t as,
-                unw_regnum_t regnum, unw_word_t *valp,
-                int write, void* arg) noexcept;
-  static int access_fpreg(unw_addr_space_t as,
-                unw_regnum_t regnum, unw_fpreg_t *fpvalp,
-                int write, void* arg) noexcept;
-  static int resume(unw_addr_space_t as,
-                unw_cursor_t *cp, void* arg) noexcept;
-  static int get_proc_name(unw_addr_space_t as,
-                unw_word_t addr, char *bufp,
-                size_t buf_len, unw_word_t *offp,
-                void* arg) noexcept;
+  static int access_reg(unw_addr_space_t as, unw_regnum_t regnum, unw_word_t* valp, int write, void* arg) noexcept;
+  static int access_fpreg(unw_addr_space_t as, unw_regnum_t regnum, unw_fpreg_t* fpvalp, int write, void* arg) noexcept;
+  static int resume(unw_addr_space_t as, unw_cursor_t* cp, void* arg) noexcept;
+  static int get_proc_name(unw_addr_space_t as, unw_word_t addr, char* bufp, size_t buf_len, unw_word_t* offp,
+                           void* arg) noexcept;
   static unw_accessors_t accessors;
+
 public:
   // Create a libunwind address space:
   static unw_addr_space_t createUnwindAddressSpace();
@@ -89,7 +77,6 @@ public:
 void MC_dump_stack_unw(FILE* file, unw_cursor_t cursor);
 void dumpStack(FILE* file, unw_cursor_t cursor);
 void dumpStack(FILE* file, pid_t pid);
-
 }
 }
 
index 97b5646..2777a0c 100644 (file)
@@ -11,7 +11,7 @@
 #include <libunwind.h>
 #include <libunwind-ptrace.h>
 
-#include "src/mc/mc_unw.h"
+#include "src/mc/mc_unw.hpp"
 #include "src/mc/remote/RemoteClient.hpp"
 
 /** \file
index 93f0bc0..362a3cd 100644 (file)
 
 #include "src/internal_config.h"
 
-#include "src/mc/mc_request.h"
+#include "src/mc/mc_request.hpp"
 #include "src/mc/remote/Client.hpp"
 #include "src/mc/remote/mc_protocol.h"
 
 #include "src/smpi/include/private.hpp"
 
 // We won't need those once the separation MCer/MCed is complete:
-#include "src/mc/mc_smx.h"
+#include "src/mc/mc_smx.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_client, mc, "MC client logic");
 
index 74ffde1..b2ac880 100644 (file)
@@ -31,9 +31,9 @@
 #include "xbt/log.h"
 #include <xbt/mmalloc.h>
 
-#include "src/mc/mc_smx.h"
-#include "src/mc/mc_snapshot.h"
-#include "src/mc/mc_unw.h"
+#include "src/mc/mc_smx.hpp"
+#include "src/mc/mc_snapshot.hpp"
+#include "src/mc/mc_unw.hpp"
 
 #include "src/mc/AddressSpace.hpp"
 #include "src/mc/ObjectInformation.hpp"
index 2fc8586..c0d6ec7 100644 (file)
@@ -26,8 +26,8 @@
 #include "src/mc/remote/Channel.hpp"
 #include "src/mc/remote/RemotePtr.hpp"
 
-#include "src/simix/popping_private.h"
-#include "src/simix/smx_private.h"
+#include "src/simix/popping_private.hpp"
+#include "src/simix/smx_private.hpp"
 #include <simgrid/simix.h>
 
 #include "src/xbt/memory_map.hpp"
index a3a69f9..6c396a1 100644 (file)
@@ -4,8 +4,8 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "simgrid/s4u/Host.hpp"
-#include "src/instr/instr_private.h"
-#include "src/msg/msg_private.h"
+#include "src/instr/instr_private.hpp"
+#include "src/msg/msg_private.hpp"
 #include "src/simix/ActorImpl.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_msg_process, instr, "MSG process");
index 49f94db..4c54cf2 100644 (file)
@@ -1,12 +1,12 @@
-/* Copyright (c) 2010, 2012-2015. The SimGrid Team.
+/* Copyright (c) 2010, 2012-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "mc/mc.h"
-#include "src/instr/instr_private.h"
-#include "src/msg/msg_private.h"
+#include "src/instr/instr_private.hpp"
+#include "src/msg/msg_private.hpp"
 
 #include <atomic>
 
index 917c868..82619ee 100644 (file)
@@ -3,14 +3,14 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "src/msg/msg_private.h"
+#include "src/msg/msg_private.hpp"
 #include "xbt/replay.hpp"
 
 #include <cerrno>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_action, msg, "MSG actions for trace driven simulation");
 
-SG_BEGIN_DECL()
+extern "C" {
 
 void MSG_action_init()
 {
@@ -52,5 +52,4 @@ msg_error_t MSG_action_trace_run(char *path)
 
   return res;
 }
-
-SG_END_DECL()
+}
index a5089f6..ae3d87a 100644 (file)
@@ -1,11 +1,11 @@
-/* Copyright (c) 2004-2014. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2004-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "src/msg/msg_private.h"
+#include "src/msg/msg_private.hpp"
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /** \ingroup msg_simulation
  * \brief An application deployer.
@@ -59,5 +59,4 @@ void MSG_set_function(const char *host_id, const char *function_name, xbt_dynar_
 {
   SIMIX_process_set_function(host_id, function_name, arguments, -1, -1);
 }
-
-SG_END_DECL()
+}
index 8399065..92d67e9 100644 (file)
@@ -5,7 +5,7 @@
 
 #include "simgrid/s4u/Engine.hpp"
 #include "simgrid/s4u/NetZone.hpp"
-#include "src/msg/msg_private.h"
+#include "src/msg/msg_private.hpp"
 
 #if SIMGRID_HAVE_LUA
 #include <lua.h>
@@ -13,7 +13,7 @@
 #include <lualib.h>
 #endif
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /********************************* MSG **************************************/
 
@@ -76,5 +76,4 @@ void MSG_zone_get_hosts(msg_netzone_t netzone, xbt_dynar_t whereto)
   for (auto const& host : hosts)
     xbt_dynar_push(whereto, &host);
 }
-
-SG_END_DECL()
+}
index f2f926b..5651178 100644 (file)
@@ -8,12 +8,12 @@
 
 #include "instr/instr_interface.h"
 #include "mc/mc.h"
-#include "src/msg/msg_private.h"
+#include "src/msg/msg_private.hpp"
 
 XBT_LOG_NEW_CATEGORY(msg, "All MSG categories");
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_kernel, msg, "Logging specific to MSG (kernel)");
 
-SG_BEGIN_DECL()
+extern "C" {
 
 MSG_Global_t msg_global = nullptr;
 static void MSG_exit();
@@ -130,5 +130,4 @@ unsigned long int MSG_get_sent_msg()
 {
   return msg_global->sent_msg;
 }
-
-SG_END_DECL()
+}
index feb9577..3846e9e 100644 (file)
@@ -6,12 +6,12 @@
 #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. */
+#include "src/msg/msg_private.hpp"
+#include "src/simix/smx_private.hpp" /* MSG_task_listen looks inside the rdv directly. Not clean. */
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_gos, msg, "Logging specific to MSG (gos)");
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /** \ingroup msg_task_usage
  * \brief Executes a task and waits for its termination.
@@ -907,5 +907,4 @@ const char *MSG_task_get_category (msg_task_t task)
 {
   return task->category;
 }
-
-SG_END_DECL()
+}
index e40c790..7605967 100644 (file)
@@ -5,16 +5,15 @@
 
 #include "simgrid/s4u/Host.hpp"
 #include "simgrid/s4u/Storage.hpp"
-#include "src/msg/msg_private.h"
+#include "src/msg/msg_private.hpp"
 #include "src/simix/ActorImpl.hpp"
-#include "src/simix/smx_host_private.h"
-
+#include "src/simix/smx_host_private.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(msg);
 
 simgrid::xbt::Extension<simgrid::s4u::Host, simgrid::MsgHostExt> simgrid::MsgHostExt::EXTENSION_ID;
 
-SG_BEGIN_DECL()
+extern "C" {
 
 int sg_storage_max_file_descriptors = 1024;
 
@@ -267,5 +266,4 @@ xbt_dict_t MSG_host_get_storage_content(msg_host_t host)
 
   return contents;
 }
-
-SG_END_DECL()
+}
index eebcbc9..592312a 100644 (file)
@@ -6,12 +6,12 @@
 #include "simgrid/s4u/File.hpp"
 #include "simgrid/s4u/Host.hpp"
 #include "simgrid/s4u/Storage.hpp"
-#include "src/msg/msg_private.h"
+#include "src/msg/msg_private.hpp"
 #include <numeric>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_io, msg, "Logging specific to MSG (io)");
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /** @addtogroup msg_file
  * (#msg_file_t) and the functions for managing it.
@@ -510,5 +510,4 @@ const char* MSG_storage_get_host(msg_storage_t storage)
   xbt_assert((storage != nullptr), "Invalid parameters");
   return storage->getHost()->getCname();
 }
-
-SG_END_DECL()
+}
index d27f199..791e59d 100644 (file)
@@ -6,11 +6,11 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "simgrid/s4u/Mailbox.hpp"
-#include "src/msg/msg_private.h"
+#include "src/msg/msg_private.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_mailbox, msg, "Logging specific to MSG (mailbox)");
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /** \ingroup msg_mailbox_management
  * \brief Set the mailbox to receive in asynchronous mode
@@ -26,5 +26,4 @@ void MSG_mailbox_set_async(const char *alias){
   mailbox->setReceiver(simgrid::s4u::Actor::self());
   XBT_VERB("%s mailbox set to receive eagerly for myself\n",alias);
 }
-
-SG_END_DECL()
+}
similarity index 68%
rename from src/msg/msg_private.h
rename to src/msg/msg_private.hpp
index 656d67f..e7d1ef9 100644 (file)
@@ -3,8 +3,8 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#ifndef METASIMGRID_PRIVATE_H
-#define METASIMGRID_PRIVATE_H
+#ifndef MSG_PRIVATE_HPP
+#define MSG_PRIVATE_HPP
 
 #include "simgrid/msg.h"
 
@@ -21,9 +21,7 @@ class MsgHostExt {
 public:
   static simgrid::xbt::Extension<s4u::Host, MsgHostExt> EXTENSION_ID;
 
-  ~MsgHostExt() {
-    delete file_descriptor_table;
-  }
+  ~MsgHostExt() { delete file_descriptor_table; }
   std::vector<int>* file_descriptor_table = nullptr; // Created lazily on need
 };
 }
@@ -36,29 +34,26 @@ typedef struct simdata_task {
     xbt_free(this->host_list);
   }
   void setUsed();
-  void setNotUsed()
-  {
-    this->isused = false;
-  }
+  void setNotUsed() { this->isused = false; }
 
   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;
-  msg_process_t receiver = nullptr;
-  msg_host_t source = nullptr;
+  double bytes_amount                            = 0.0;     /* Data size */
+  double flops_amount                            = 0.0;     /* Computation size */
+  msg_process_t sender                           = nullptr;
+  msg_process_t receiver                         = nullptr;
+  msg_host_t source                              = nullptr;
 
   double priority = 1.0;
   double bound    = 0.0; /* Capping for CPU resource, or 0 for no capping */
   double rate     = -1;  /* Capping for network resource, or -1 for no capping*/
 
-  bool isused = false;  /* Indicates whether the task is used in SIMIX currently */
-  int host_nb = 0;      /* ==0 if sequential task; parallel task if not */
+  bool isused = false; /* Indicates whether the task is used in SIMIX currently */
+  int host_nb = 0;     /* ==0 if sequential task; parallel task if not */
   /*******  Parallel Tasks Only !!!! *******/
-  sg_host_t *host_list = nullptr;
-  double *flops_parallel_amount = nullptr;
-  double *bytes_parallel_amount = nullptr;
+  sg_host_t* host_list          = nullptr;
+  doubleflops_parallel_amount = nullptr;
+  doublebytes_parallel_amount = nullptr;
 
 private:
   void reportMultipleUse() const;
@@ -72,15 +67,15 @@ class ActorExt {
 public:
   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 */
+  void* data         = nullptr; /* user data */
 };
 
 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) */
-  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 */
+  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) */
+  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))
   {
@@ -91,14 +86,14 @@ public:
 
 /************************** Global variables ********************************/
 typedef struct MSG_Global {
-  int debug_multiple_use;       /* whether we want an error message when reusing the same Task for 2 things */
+  int debug_multiple_use;            /* whether we want an error message when reusing the same Task for 2 things */
   std::atomic_int_fast32_t sent_msg; /* Total amount of messages sent during the simulation */
-  void (*task_copy_callback) (msg_task_t task, msg_process_t src, msg_process_t dst);
+  void (*task_copy_callback)(msg_task_t task, msg_process_t src, msg_process_t dst);
   void_f_pvoid_t process_data_cleanup;
 } s_MSG_Global_t;
 typedef s_MSG_Global_t* MSG_Global_t;
 
-SG_BEGIN_DECL()
+extern "C" {
 
 XBT_PUBLIC_DATA(MSG_Global_t) msg_global;
 
@@ -114,29 +109,28 @@ XBT_PRIVATE void MSG_host_del_task(msg_host_t host, msg_task_t task);
 
 /********** Tracing **********/
 /* declaration of instrumentation functions from msg_task_instr.c */
-XBT_PRIVATE void TRACE_msg_set_task_category(msg_task_t task, const char *category);
+XBT_PRIVATE void TRACE_msg_set_task_category(msg_task_t task, const charcategory);
 XBT_PRIVATE void TRACE_msg_task_create(msg_task_t task);
 XBT_PRIVATE void TRACE_msg_task_execute_start(msg_task_t task);
 XBT_PRIVATE void TRACE_msg_task_execute_end(msg_task_t task);
 XBT_PRIVATE void TRACE_msg_task_destroy(msg_task_t task);
 XBT_PRIVATE void TRACE_msg_task_get_end(double start_time, msg_task_t task);
 XBT_PRIVATE void TRACE_msg_task_get_start();
-XBT_PRIVATE int TRACE_msg_task_put_start(msg_task_t task);    //returns TRUE if the task_put_end must be called
+XBT_PRIVATE int TRACE_msg_task_put_start(msg_task_t task); // returns TRUE if the task_put_end must be called
 XBT_PRIVATE void TRACE_msg_task_put_end();
 
 /* declaration of instrumentation functions from msg_process_instr.c */
-XBT_PRIVATE char *instr_process_id (msg_process_t proc, char *str, int len);
-XBT_PRIVATE char *instr_process_id_2 (const char *process_name, int process_pid, char *str, int len);
+XBT_PRIVATE char* instr_process_id(msg_process_t proc, char* str, int len);
+XBT_PRIVATE char* instr_process_id_2(const char* process_name, int process_pid, char* str, int len);
 XBT_PRIVATE void TRACE_msg_process_change_host(msg_process_t process, msg_host_t new_host);
-XBT_PRIVATE void TRACE_msg_process_create (const char *process_name, int process_pid, msg_host_t host);
-XBT_PRIVATE void TRACE_msg_process_destroy (const char *process_name, int process_pid);
+XBT_PRIVATE void TRACE_msg_process_create(const char* process_name, int process_pid, msg_host_t host);
+XBT_PRIVATE void TRACE_msg_process_destroy(const char* process_name, int process_pid);
 XBT_PRIVATE void TRACE_msg_process_kill(smx_process_exit_status_t status, msg_process_t process);
 XBT_PRIVATE void TRACE_msg_process_suspend(msg_process_t process);
 XBT_PRIVATE void TRACE_msg_process_resume(msg_process_t process);
-XBT_PRIVATE void TRACE_msg_process_sleep_in(msg_process_t process);   //called from msg/gos.c
+XBT_PRIVATE void TRACE_msg_process_sleep_in(msg_process_t process); // called from msg/gos.c
 XBT_PRIVATE void TRACE_msg_process_sleep_out(msg_process_t process);
-
-SG_END_DECL()
+}
 
 inline void simdata_task::setUsed()
 {
index 75a3997..465e4cf 100644 (file)
@@ -3,14 +3,14 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "msg_private.h"
+#include "msg_private.hpp"
 #include "simgrid/s4u/Host.hpp"
 #include "src/simix/ActorImpl.hpp"
-#include "src/simix/smx_private.h"
+#include "src/simix/smx_private.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_process, msg, "Logging specific to MSG (process)");
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /** @addtogroup m_process_management
  *
@@ -138,8 +138,7 @@ msg_process_t MSG_process_create_with_environment(const char *name, xbt_main_fun
   xbt_free(argv);
   return res;
 }
-
-SG_END_DECL()
+}
 
 msg_process_t MSG_process_create_from_stdfunc(const char* name, std::function<void()> code, void* data, msg_host_t host,
                                               std::map<std::string, std::string>* properties)
@@ -158,7 +157,7 @@ msg_process_t MSG_process_create_from_stdfunc(const char* name, std::function<vo
   return process->ciface();
 }
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /* Become a process in the simulation
  *
@@ -524,5 +523,4 @@ XBT_PUBLIC(void) MSG_process_unref(msg_process_t process)
 {
   intrusive_ptr_release(process);
 }
-
-SG_END_DECL()
+}
index 5cf06a0..703fbee 100644 (file)
@@ -6,8 +6,8 @@
 
 #include "xbt/ex.hpp"
 
-#include "msg_private.h"
-#include "src/simix/smx_private.h"
+#include "msg_private.hpp"
+#include "src/simix/smx_private.hpp"
 #include "xbt/synchro.h"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_synchro, msg, "Logging specific to MSG (synchro)");
index 42a69af..814282b 100644 (file)
@@ -1,12 +1,12 @@
-/* Copyright (c) 2004-2016. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2004-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "msg_private.h"
-#include "src/simix/smx_private.h"
+#include "msg_private.hpp"
+#include "src/simix/smx_private.hpp"
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /** @addtogroup m_task_management
  *
@@ -304,5 +304,4 @@ void MSG_task_set_bound(msg_task_t task, double bound)
   if (task->simdata->compute)
     simcall_execution_set_bound(task->simdata->compute, task->simdata->bound);
 }
-
-SG_END_DECL()
+}
index 1829b63..50f0f47 100644 (file)
 
 #include <xbt/ex.hpp>
 
-#include "src/instr/instr_private.h"
-#include "src/msg/msg_private.h"
+#include "src/instr/instr_private.hpp"
+#include "src/msg/msg_private.hpp"
 #include "src/plugins/vm/VirtualMachineImpl.hpp"
 #include "src/plugins/vm/VmHostExt.hpp"
 
 #include "simgrid/host.h"
 #include "simgrid/simix.hpp"
 
-SG_BEGIN_DECL()
+extern "C" {
 
 struct dirty_page {
   double prev_clock;
@@ -830,5 +830,4 @@ void MSG_vm_set_bound(msg_vm_t vm, double bound)
 {
   simgrid::simix::kernelImmediate([vm, bound]() { vm->pimpl_vm_->setBound(bound); });
 }
-
-SG_END_DECL()
+}
index c300f94..7122b93 100644 (file)
@@ -6,7 +6,7 @@
 
 #include "src/plugins/vm/VirtualMachineImpl.hpp"
 #include "src/simix/ActorImpl.hpp"
-#include "src/simix/smx_host_private.h"
+#include "src/simix/smx_host_private.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_vm, surf, "Logging specific to the SURF VM module");
 
index 14c29fe..d6369ee 100644 (file)
@@ -3,10 +3,10 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "src/instr/instr_private.h"
+#include "src/instr/instr_private.hpp"
 #include "src/plugins/vm/VirtualMachineImpl.hpp"
 #include "src/plugins/vm/VmHostExt.hpp"
-#include "src/simix/smx_host_private.h"
+#include "src/simix/smx_host_private.hpp"
 #include "src/surf/cpu_cas01.hpp"
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_vm, "S4U virtual machines");
index f3f5ab0..c5fa2f2 100644 (file)
@@ -11,7 +11,7 @@
 #include "simgrid/s4u/Mailbox.hpp"
 
 #include "src/kernel/context/Context.hpp"
-#include "src/simix/smx_private.h"
+#include "src/simix/smx_private.hpp"
 
 #include <sstream>
 
index bfd0faa..f1f3135 100644 (file)
@@ -3,8 +3,8 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
+#include "src/msg/msg_private.hpp"
 #include "xbt/log.h"
-#include "src/msg/msg_private.h"
 
 #include "simgrid/s4u/Comm.hpp"
 #include "simgrid/s4u/Mailbox.hpp"
index 763fe98..904b950 100644 (file)
@@ -14,9 +14,9 @@
 #include "simgrid/s4u/Storage.hpp"
 #include "simgrid/simix.hpp"
 #include "src/kernel/routing/NetPoint.hpp"
-#include "src/msg/msg_private.h"
+#include "src/msg/msg_private.hpp"
 #include "src/simix/ActorImpl.hpp"
-#include "src/simix/smx_private.h"
+#include "src/simix/smx_private.hpp"
 #include "src/surf/HostImpl.hpp"
 #include "src/surf/cpu_interface.hpp"
 #include "xbt/log.h"
index 245bd53..5a594bc 100644 (file)
@@ -5,9 +5,9 @@
 
 #include "simgrid/s4u/Comm.hpp"
 #include "simgrid/s4u/Mailbox.hpp"
-#include "src/msg/msg_private.h"
+#include "src/msg/msg_private.hpp"
 #include "src/simix/ActorImpl.hpp"
-#include "src/simix/smx_network_private.h"
+#include "src/simix/smx_network_private.hpp"
 #include "xbt/log.h"
 
 XBT_LOG_EXTERNAL_CATEGORY(s4u);
index 5e63f24..7e0e852 100644 (file)
@@ -3,7 +3,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "src/msg/msg_private.h"
+#include "src/msg/msg_private.hpp"
 #include "src/simix/smx_synchro_private.hpp"
 #include "xbt/log.h"
 
index b5e52f0..84cb5ee 100644 (file)
@@ -34,7 +34,7 @@ std::set<SD_task_t>* simulate (double how_long);
 }
 }
 
-SG_BEGIN_DECL()
+extern "C" {
 extern XBT_PRIVATE simgrid::sd::Global *sd_global;
 
 /* Task */
@@ -71,5 +71,5 @@ XBT_PRIVATE void SD_task_run(SD_task_t task);
 XBT_PRIVATE bool acyclic_graph_detail(xbt_dynar_t dag);
 XBT_PRIVATE void uniq_transfer_task_name(SD_task_t task);
 XBT_PRIVATE const char *__get_state_name(e_SD_task_state_t state);
-SG_END_DECL()
+}
 #endif
index 3d528ae..336e5a3 100644 (file)
@@ -12,7 +12,7 @@
 #include "xbt/dict.h"
 
 #include "src/kernel/routing/NetPoint.hpp"
-#include "src/simix/smx_host_private.h"
+#include "src/simix/smx_host_private.hpp"
 #include "src/surf/HostImpl.hpp"
 #include "src/surf/cpu_interface.hpp"
 
index 0c10cd4..752cf85 100644 (file)
@@ -6,22 +6,22 @@
 
 /* sg_config: configuration infrastructure for the simulation world       */
 
-#include "xbt/misc.h"
-#include "xbt/config.h"
-#include "xbt/config.hpp"
-#include "xbt/log.h"
-#include "xbt/mallocator.h"
-#include "xbt/sysdep.h"
-#include "surf/surf.h"
-#include "surf/maxmin.h"
-#include "instr/instr_interface.h"
-#include "simgrid/simix.h"
 #include "simgrid/sg_config.h"
-#include "simgrid_config.h" /* what was compiled in? */
+#include "instr/instr_interface.h"
 #include "mc/mc.h"
 #include "simgrid/instr.h"
+#include "simgrid/simix.h"
+#include "simgrid_config.h" /* what was compiled in? */
 #include "src/mc/mc_replay.h"
 #include "src/surf/surf_interface.hpp"
+#include "surf/maxmin.hpp"
+#include "surf/surf.h"
+#include "xbt/config.h"
+#include "xbt/config.hpp"
+#include "xbt/log.h"
+#include "xbt/mallocator.h"
+#include "xbt/misc.h"
+#include "xbt/sysdep.h"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_config, surf, "About the configuration of SimGrid");
 
index 49d14cb..61355a1 100644 (file)
 
 #include "mc/mc.h"
 
-#include "smx_private.h"
+#include "smx_private.hpp"
 #include "src/kernel/activity/SleepImpl.hpp"
 #include "src/kernel/activity/SynchroIo.hpp"
 #include "src/kernel/activity/SynchroRaw.hpp"
 #include "src/mc/mc_replay.h"
 #include "src/mc/remote/Client.hpp"
-#include "src/msg/msg_private.h"
+#include "src/msg/msg_private.hpp"
 #include "src/surf/cpu_interface.hpp"
 #include "src/surf/surf_interface.hpp"
 
index dcdea7a..5e9b5c2 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2016. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -7,7 +7,7 @@
 #define SIMIX_ACTORIMPL_H
 
 #include "simgrid/s4u/Actor.hpp"
-#include "src/simix/popping_private.h"
+#include "src/simix/popping_private.hpp"
 #include "src/surf/PropertyHolder.hpp"
 #include "xbt/swag.h"
 #include <list>
@@ -122,7 +122,7 @@ typedef simgrid::simix::ProcessArg *smx_process_arg_t;
 
 typedef simgrid::simix::ActorImpl* smx_actor_t;
 
-SG_BEGIN_DECL()
+extern "C" {
 
 XBT_PRIVATE smx_actor_t SIMIX_process_create(const char* name, std::function<void()> code, void* data, sg_host_t host,
                                              std::map<std::string, std::string>* properties,
@@ -142,8 +142,7 @@ XBT_PRIVATE smx_actor_t SIMIX_process_get_by_name(const char* name);
 XBT_PRIVATE void SIMIX_process_auto_restart_set(smx_actor_t process, int auto_restart);
 
 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_join(smx_actor_t issuer, smx_actor_t process, double timeout);
index b26dcb7..cb14efd 100644 (file)
@@ -5,7 +5,7 @@
 /*                                                                            */
 /* This is somehow the "libc" of SimGrid                                      */
 
-/* Copyright (c) 2010-2015. The SimGrid Team.
+/* Copyright (c) 2010-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
 #include "simgrid/s4u/VirtualMachine.hpp"
 #include "simgrid/simix.hpp"
 #include "simgrid/simix/blocking_simcall.hpp"
-#include "smx_private.h"
+#include "smx_private.hpp"
 #include "src/kernel/activity/CommImpl.hpp"
 #include "src/mc/mc_forward.hpp"
 #include "src/mc/mc_replay.h"
 #include "src/plugins/vm/VirtualMachineImpl.hpp"
-#include "src/simix/smx_host_private.h"
+#include "src/simix/smx_host_private.hpp"
 #include "xbt/ex.h"
 #include "xbt/functional.hpp"
 
index 6210e32..2672a4a 100644 (file)
@@ -3,10 +3,10 @@
 /* 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 "smx_private.h"
+#include "smx_private.hpp"
 #include "xbt/xbt_os_thread.h"
 #if SIMGRID_HAVE_MC
-#include "src/mc/mc_private.h"
+#include "src/mc/mc_private.hpp"
 #endif
 
 #include "src/kernel/activity/CommImpl.hpp"
similarity index 91%
rename from src/simix/popping_accessors.h
rename to src/simix/popping_accessors.hpp
index a101a80..3201a9e 100644 (file)
@@ -14,7 +14,7 @@
  * That's not about http://en.wikipedia.org/wiki/Poop, despite the odor :)
  */
 
-#include "src/simix/popping_private.h"
+#include "src/simix/popping_private.hpp"
 static inline int simcall_process_killall__get__reset_pid(smx_simcall_t simcall)
 {
   return simgrid::simix::unmarshal<int>(simcall->args[0]);
@@ -86,8 +86,9 @@ 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);
+static inline void simcall_process_join__set__result(smx_simcall_t simcall, int result)
+{
+  simgrid::simix::marshal<int>(simcall->result, result);
 }
 
 static inline double simcall_process_sleep__get__duration(smx_simcall_t simcall)
@@ -110,8 +111,9 @@ 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);
+static inline void simcall_process_sleep__set__result(smx_simcall_t simcall, int result)
+{
+  simgrid::simix::marshal<int>(simcall->result, result);
 }
 
 static inline const char* simcall_execution_start__get__name(smx_simcall_t simcall)
@@ -162,8 +164,7 @@ static inline void simcall_execution_start__set__bound(smx_simcall_t simcall, do
 {
   simgrid::simix::marshal<double>(simcall->args[3], arg);
 }
-static inline boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>
-simcall_execution_start__get__result(smx_simcall_t simcall)
+static inline boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl> simcall_execution_start__get__result(smx_simcall_t simcall)
 {
   return simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>>(simcall->result);
 }
@@ -171,9 +172,7 @@ static inline simgrid::kernel::activity::ExecImpl* simcall_execution_start__getr
 {
   return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ExecImpl*>(simcall->result);
 }
-static inline void
-simcall_execution_start__set__result(smx_simcall_t simcall,
-                                     boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl> result)
+static inline void simcall_execution_start__set__result(smx_simcall_t simcall, boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl> result)
 {
   simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>>(simcall->result, result);
 }
@@ -262,25 +261,20 @@ static inline void simcall_execution_parallel_start__set__timeout(smx_simcall_t
 {
   simgrid::simix::marshal<double>(simcall->args[6], arg);
 }
-static inline boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>
-simcall_execution_parallel_start__get__result(smx_simcall_t simcall)
+static inline boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl> simcall_execution_parallel_start__get__result(smx_simcall_t simcall)
 {
   return simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>>(simcall->result);
 }
-static inline simgrid::kernel::activity::ExecImpl*
-simcall_execution_parallel_start__getraw__result(smx_simcall_t simcall)
+static inline simgrid::kernel::activity::ExecImpl* simcall_execution_parallel_start__getraw__result(smx_simcall_t simcall)
 {
   return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ExecImpl*>(simcall->result);
 }
-static inline void
-simcall_execution_parallel_start__set__result(smx_simcall_t simcall,
-                                              boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl> result)
+static inline void simcall_execution_parallel_start__set__result(smx_simcall_t simcall, boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl> result)
 {
   simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>>(simcall->result, result);
 }
 
-static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
-simcall_execution_wait__get__execution(smx_simcall_t simcall)
+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]);
 }
@@ -288,9 +282,7 @@ static inline simgrid::kernel::activity::ActivityImpl* simcall_execution_wait__g
 {
   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)
+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);
 }
@@ -302,8 +294,9 @@ 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);
+static inline void simcall_execution_wait__set__result(smx_simcall_t simcall, int result)
+{
+  simgrid::simix::marshal<int>(simcall->result, result);
 }
 
 static inline smx_actor_t simcall_process_on_exit__get__process(smx_simcall_t simcall)
@@ -391,8 +384,7 @@ static inline void simcall_comm_iprobe__set__data(smx_simcall_t simcall, void* a
 {
   simgrid::simix::marshal<void*>(simcall->args[3], arg);
 }
-static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
-simcall_comm_iprobe__get__result(smx_simcall_t simcall)
+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);
 }
@@ -400,9 +392,7 @@ static inline simgrid::kernel::activity::ActivityImpl* simcall_comm_iprobe__getr
 {
   return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ActivityImpl*>(simcall->result);
 }
-static inline void
-simcall_comm_iprobe__set__result(smx_simcall_t simcall,
-                                 boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> 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);
 }
@@ -660,8 +650,7 @@ static inline void simcall_comm_isend__set__detached(smx_simcall_t simcall, int
 {
   simgrid::simix::marshal<int>(simcall->args[10], arg);
 }
-static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
-simcall_comm_isend__get__result(smx_simcall_t simcall)
+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);
 }
@@ -669,8 +658,7 @@ static inline simgrid::kernel::activity::ActivityImpl* simcall_comm_isend__getra
 {
   return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ActivityImpl*>(simcall->result);
 }
-static inline void simcall_comm_isend__set__result(smx_simcall_t simcall,
-                                                   boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> 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);
 }
@@ -880,8 +868,7 @@ static inline void simcall_comm_irecv__set__rate(smx_simcall_t simcall, double a
 {
   simgrid::simix::marshal<double>(simcall->args[7], arg);
 }
-static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
-simcall_comm_irecv__get__result(smx_simcall_t simcall)
+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);
 }
@@ -889,8 +876,7 @@ static inline simgrid::kernel::activity::ActivityImpl* simcall_comm_irecv__getra
 {
   return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ActivityImpl*>(simcall->result);
 }
-static inline void simcall_comm_irecv__set__result(smx_simcall_t simcall,
-                                                   boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> 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);
 }
@@ -927,12 +913,12 @@ 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 void simcall_comm_waitany__set__result(smx_simcall_t simcall, int result)
+{
+  simgrid::simix::marshal<int>(simcall->result, result);
 }
 
-static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
-simcall_comm_wait__get__comm(smx_simcall_t simcall)
+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]);
 }
@@ -940,8 +926,7 @@ static inline simgrid::kernel::activity::ActivityImpl* simcall_comm_wait__getraw
 {
   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)
+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);
 }
@@ -958,8 +943,7 @@ static inline void simcall_comm_wait__set__timeout(smx_simcall_t simcall, double
   simgrid::simix::marshal<double>(simcall->args[1], arg);
 }
 
-static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
-simcall_comm_test__get__comm(smx_simcall_t simcall)
+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]);
 }
@@ -967,8 +951,7 @@ static inline simgrid::kernel::activity::ActivityImpl* simcall_comm_test__getraw
 {
   return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ActivityImpl*>(simcall->args[0]);
 }
-static inline void simcall_comm_test__set__comm(smx_simcall_t simcall,
-                                                boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> 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);
 }
@@ -980,12 +963,12 @@ 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 void simcall_comm_test__set__result(smx_simcall_t simcall, int result)
+{
+  simgrid::simix::marshal<int>(simcall->result, result);
 }
 
-static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>*
-simcall_comm_testany__get__comms(smx_simcall_t simcall)
+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]);
 }
@@ -993,8 +976,7 @@ static inline simgrid::kernel::activity::ActivityImpl** simcall_comm_testany__ge
 {
   return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ActivityImpl**>(simcall->args[0]);
 }
-static inline void simcall_comm_testany__set__comms(smx_simcall_t simcall,
-                                                    boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>* 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);
 }
@@ -1018,8 +1000,9 @@ 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);
+static inline void simcall_comm_testany__set__result(smx_simcall_t simcall, int result)
+{
+  simgrid::simix::marshal<int>(simcall->result, result);
 }
 
 static inline smx_mutex_t simcall_mutex_lock__get__mutex(smx_simcall_t simcall)
@@ -1055,8 +1038,9 @@ 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);
+static inline void simcall_mutex_trylock__set__result(smx_simcall_t simcall, int result)
+{
+  simgrid::simix::marshal<int>(simcall->result, result);
 }
 
 static inline smx_mutex_t simcall_mutex_unlock__get__mutex(smx_simcall_t simcall)
@@ -1080,8 +1064,9 @@ 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);
+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);
 }
 
 static inline smx_cond_t simcall_cond_signal__get__cond(smx_simcall_t simcall)
@@ -1242,8 +1227,9 @@ 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);
+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);
 }
 
 static inline surf_file_t simcall_file_write__get__fd(smx_simcall_t simcall)
@@ -1278,8 +1264,9 @@ 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 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 int simcall_mc_random__get__min(smx_simcall_t simcall)
@@ -1314,12 +1301,12 @@ 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 void simcall_mc_random__set__result(smx_simcall_t simcall, int result)
+{
+  simgrid::simix::marshal<int>(simcall->result, result);
 }
 
-static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
-simcall_set_category__get__synchro(smx_simcall_t simcall)
+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]);
 }
@@ -1327,8 +1314,7 @@ static inline simgrid::kernel::activity::ActivityImpl* simcall_set_category__get
 {
   return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ActivityImpl*>(simcall->args[0]);
 }
-static inline void simcall_set_category__set__synchro(smx_simcall_t simcall,
-                                                      boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> 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);
 }
@@ -1377,35 +1363,17 @@ XBT_PRIVATE void simcall_HANDLER_process_killall(smx_simcall_t simcall, int rese
 XBT_PRIVATE void simcall_HANDLER_process_suspend(smx_simcall_t simcall, smx_actor_t process);
 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 boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>
-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 boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
-simcall_HANDLER_comm_iprobe(smx_simcall_t simcall, smx_mailbox_t mbox, int type, simix_match_func_t match_fun,
-                            void* data);
+XBT_PRIVATE boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl> 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 boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> simcall_HANDLER_comm_iprobe(smx_simcall_t simcall, smx_mailbox_t mbox, int type, 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 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 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 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 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,
-                                           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 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 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);
 XBT_PRIVATE void simcall_HANDLER_mutex_unlock(smx_simcall_t simcall, smx_mutex_t mutex);
index 4f3e9a7..f942251 100644 (file)
  * That's not about http://en.wikipedia.org/wiki/Poop, despite the odor :)
  */
 
-#include <functional>
-#include "smx_private.h"
+#include "smx_private.hpp"
 #include "src/mc/mc_forward.hpp"
 #include "xbt/ex.h"
+#include <functional>
 #include <simgrid/simix.hpp>
 /** @cond */ // Please Doxygen, don't look at this
 
@@ -36,247 +36,240 @@ inline static R simcall(e_smx_simcall_t call, T const&... t)
   return simgrid::simix::unmarshal<R>(self->simcall.result);
 }
 
-inline static void simcall_BODY_process_killall(int reset_pid) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_process_killall(&SIMIX_process_self()->simcall, reset_pid);
-    return simcall<void, int>(SIMCALL_PROCESS_KILLALL, reset_pid);
-  }
+inline static void simcall_BODY_process_killall(int reset_pid)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_process_killall(&SIMIX_process_self()->simcall, reset_pid);
+  return simcall<void, int>(SIMCALL_PROCESS_KILLALL, reset_pid);
+}
 
-inline static void simcall_BODY_process_cleanup(smx_actor_t process) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) SIMIX_process_cleanup(process);
-    return simcall<void, smx_actor_t>(SIMCALL_PROCESS_CLEANUP, process);
-  }
+inline static void simcall_BODY_process_cleanup(smx_actor_t process)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    SIMIX_process_cleanup(process);
+  return simcall<void, smx_actor_t>(SIMCALL_PROCESS_CLEANUP, process);
+}
 
-inline static void simcall_BODY_process_suspend(smx_actor_t process) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_process_suspend(&SIMIX_process_self()->simcall, process);
-    return simcall<void, smx_actor_t>(SIMCALL_PROCESS_SUSPEND, process);
-  }
+inline static void simcall_BODY_process_suspend(smx_actor_t process)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_process_suspend(&SIMIX_process_self()->simcall, process);
+  return simcall<void, smx_actor_t>(SIMCALL_PROCESS_SUSPEND, process);
+}
 
-inline static int simcall_BODY_process_join(smx_actor_t process, double timeout) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_process_join(&SIMIX_process_self()->simcall, process, timeout);
-    return simcall<int, smx_actor_t, double>(SIMCALL_PROCESS_JOIN, process, timeout);
-  }
+inline static int simcall_BODY_process_join(smx_actor_t process, double timeout)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_process_join(&SIMIX_process_self()->simcall, process, timeout);
+  return simcall<int, smx_actor_t, double>(SIMCALL_PROCESS_JOIN, process, timeout);
+}
 
-inline static int simcall_BODY_process_sleep(double duration) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_process_sleep(&SIMIX_process_self()->simcall, duration);
-    return simcall<int, double>(SIMCALL_PROCESS_SLEEP, duration);
-  }
+inline static int simcall_BODY_process_sleep(double duration)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_process_sleep(&SIMIX_process_self()->simcall, duration);
+  return simcall<int, double>(SIMCALL_PROCESS_SLEEP, duration);
+}
 
-  inline static boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>
-  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<boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>, const char*, double, double, double>(
-        SIMCALL_EXECUTION_START, name, flops_amount, priority, bound);
-  }
+inline static boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl> simcall_BODY_execution_start(const char* name, double flops_amount, double priority, double bound)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_execution_start(&SIMIX_process_self()->simcall, name, flops_amount, priority, bound);
+  return simcall<boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>, const char*, double, double, double>(SIMCALL_EXECUTION_START, name, flops_amount, priority, bound);
+}
 
-  inline static boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>
-  simcall_BODY_execution_parallel_start(const char* name, int host_nb, sg_host_t* host_list, double* flops_amount,
-                                        double* bytes_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, rate, timeout);
-    return simcall<boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>, const char*, int, sg_host_t*, double*,
-                   double*, double, double>(SIMCALL_EXECUTION_PARALLEL_START, name, host_nb, host_list, flops_amount,
-                                            bytes_amount, rate, timeout);
-  }
+inline static boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl> simcall_BODY_execution_parallel_start(const char* name, int host_nb, sg_host_t* host_list, double* flops_amount, double* bytes_amount, double rate, double timeout)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    SIMIX_execution_parallel_start(name, host_nb, host_list, flops_amount, bytes_amount, rate, timeout);
+  return simcall<boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>, const char*, int, sg_host_t*, double*, double*, double, double>(SIMCALL_EXECUTION_PARALLEL_START, name, host_nb, host_list, flops_amount, bytes_amount, rate, timeout);
+}
 
-  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, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(SIMCALL_EXECUTION_WAIT,
-                                                                                       execution);
-  }
+inline static int simcall_BODY_execution_wait(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> execution)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_execution_wait(&SIMIX_process_self()->simcall, 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) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) SIMIX_process_on_exit(process, fun, data);
-    return simcall<void, smx_actor_t, int_f_pvoid_pvoid_t, void*>(SIMCALL_PROCESS_ON_EXIT, process, fun, data);
-  }
+inline static void simcall_BODY_process_on_exit(smx_actor_t process, int_f_pvoid_pvoid_t fun, void* data)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    SIMIX_process_on_exit(process, fun, data);
+  return simcall<void, smx_actor_t, int_f_pvoid_pvoid_t, void*>(SIMCALL_PROCESS_ON_EXIT, process, fun, data);
+}
 
-  inline static boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
-  simcall_BODY_comm_iprobe(smx_mailbox_t mbox, int type, 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, match_fun, data);
-    return simcall<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>, smx_mailbox_t, int,
-                   simix_match_func_t, void*>(SIMCALL_COMM_IPROBE, mbox, type, match_fun, data);
-  }
+inline static boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> simcall_BODY_comm_iprobe(smx_mailbox_t mbox, int type, simix_match_func_t match_fun, void* data)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_comm_iprobe(&SIMIX_process_self()->simcall, mbox, type, match_fun, data);
+  return simcall<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>, smx_mailbox_t, int, simix_match_func_t, void*>(SIMCALL_COMM_IPROBE, mbox, type, 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) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_comm_send(&SIMIX_process_self()->simcall, sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, copy_data_fun, data, timeout);
-    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 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)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_comm_send(&SIMIX_process_self()->simcall, sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, copy_data_fun, data, timeout);
+  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 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<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 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)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    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<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) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_comm_recv(&SIMIX_process_self()->simcall, receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, timeout, rate);
-    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 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)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_comm_recv(&SIMIX_process_self()->simcall, receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, timeout, rate);
+  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 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<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 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)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_comm_irecv(&SIMIX_process_self()->simcall, 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) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_comm_waitany(&SIMIX_process_self()->simcall, comms, timeout);
-    return simcall<int, xbt_dynar_t, double>(SIMCALL_COMM_WAITANY, comms, timeout);
-  }
+inline static int simcall_BODY_comm_waitany(xbt_dynar_t comms, double timeout)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_comm_waitany(&SIMIX_process_self()->simcall, comms, timeout);
+  return simcall<int, xbt_dynar_t, double>(SIMCALL_COMM_WAITANY, comms, 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, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>, double>(SIMCALL_COMM_WAIT, comm,
-                                                                                                timeout);
-  }
+inline static void simcall_BODY_comm_wait(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> comm, double timeout)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_comm_wait(&SIMIX_process_self()->simcall, 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(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, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(SIMCALL_COMM_TEST, comm);
-  }
+inline static int simcall_BODY_comm_test(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> comm)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_comm_test(&SIMIX_process_self()->simcall, comm);
+  return simcall<int, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(SIMCALL_COMM_TEST, comm);
+}
 
-  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, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>*, size_t>(SIMCALL_COMM_TESTANY,
-                                                                                                comms, count);
-  }
+inline static int simcall_BODY_comm_testany(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>* comms, size_t count)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_comm_testany(&SIMIX_process_self()->simcall, comms, count);
+  return simcall<int, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>*, size_t>(SIMCALL_COMM_TESTANY, comms, count);
+}
 
-inline static void simcall_BODY_mutex_lock(smx_mutex_t mutex) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_mutex_lock(&SIMIX_process_self()->simcall, mutex);
-    return simcall<void, smx_mutex_t>(SIMCALL_MUTEX_LOCK, mutex);
-  }
+inline static void simcall_BODY_mutex_lock(smx_mutex_t mutex)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_mutex_lock(&SIMIX_process_self()->simcall, mutex);
+  return simcall<void, smx_mutex_t>(SIMCALL_MUTEX_LOCK, mutex);
+}
 
-inline static int simcall_BODY_mutex_trylock(smx_mutex_t mutex) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_mutex_trylock(&SIMIX_process_self()->simcall, mutex);
-    return simcall<int, smx_mutex_t>(SIMCALL_MUTEX_TRYLOCK, mutex);
-  }
+inline static int simcall_BODY_mutex_trylock(smx_mutex_t mutex)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_mutex_trylock(&SIMIX_process_self()->simcall, mutex);
+  return simcall<int, smx_mutex_t>(SIMCALL_MUTEX_TRYLOCK, mutex);
+}
 
-inline static void simcall_BODY_mutex_unlock(smx_mutex_t mutex) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_mutex_unlock(&SIMIX_process_self()->simcall, mutex);
-    return simcall<void, smx_mutex_t>(SIMCALL_MUTEX_UNLOCK, mutex);
-  }
+inline static void simcall_BODY_mutex_unlock(smx_mutex_t mutex)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_mutex_unlock(&SIMIX_process_self()->simcall, mutex);
+  return simcall<void, smx_mutex_t>(SIMCALL_MUTEX_UNLOCK, mutex);
+}
 
-inline static smx_cond_t simcall_BODY_cond_init() {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) SIMIX_cond_init();
-    return simcall<smx_cond_t>(SIMCALL_COND_INIT);
-  }
+inline static smx_cond_t simcall_BODY_cond_init()
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    SIMIX_cond_init();
+  return simcall<smx_cond_t>(SIMCALL_COND_INIT);
+}
 
-inline static void simcall_BODY_cond_signal(smx_cond_t cond) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) SIMIX_cond_signal(cond);
-    return simcall<void, smx_cond_t>(SIMCALL_COND_SIGNAL, cond);
-  }
+inline static void simcall_BODY_cond_signal(smx_cond_t cond)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    SIMIX_cond_signal(cond);
+  return simcall<void, smx_cond_t>(SIMCALL_COND_SIGNAL, cond);
+}
 
-inline static void simcall_BODY_cond_wait(smx_cond_t cond, smx_mutex_t mutex) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_cond_wait(&SIMIX_process_self()->simcall, cond, mutex);
-    return simcall<void, smx_cond_t, smx_mutex_t>(SIMCALL_COND_WAIT, cond, mutex);
-  }
+inline static void simcall_BODY_cond_wait(smx_cond_t cond, smx_mutex_t mutex)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_cond_wait(&SIMIX_process_self()->simcall, cond, mutex);
+  return simcall<void, smx_cond_t, smx_mutex_t>(SIMCALL_COND_WAIT, cond, mutex);
+}
 
-inline static void simcall_BODY_cond_wait_timeout(smx_cond_t cond, smx_mutex_t mutex, double timeout) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_cond_wait_timeout(&SIMIX_process_self()->simcall, cond, mutex, timeout);
-    return simcall<void, smx_cond_t, smx_mutex_t, double>(SIMCALL_COND_WAIT_TIMEOUT, cond, mutex, timeout);
-  }
+inline static void simcall_BODY_cond_wait_timeout(smx_cond_t cond, smx_mutex_t mutex, double timeout)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_cond_wait_timeout(&SIMIX_process_self()->simcall, cond, mutex, timeout);
+  return simcall<void, smx_cond_t, smx_mutex_t, double>(SIMCALL_COND_WAIT_TIMEOUT, cond, mutex, timeout);
+}
 
-inline static void simcall_BODY_cond_broadcast(smx_cond_t cond) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) SIMIX_cond_broadcast(cond);
-    return simcall<void, smx_cond_t>(SIMCALL_COND_BROADCAST, cond);
-  }
+inline static void simcall_BODY_cond_broadcast(smx_cond_t cond)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    SIMIX_cond_broadcast(cond);
+  return simcall<void, smx_cond_t>(SIMCALL_COND_BROADCAST, cond);
+}
 
-inline static void simcall_BODY_sem_acquire(smx_sem_t sem) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_sem_acquire(&SIMIX_process_self()->simcall, sem);
-    return simcall<void, smx_sem_t>(SIMCALL_SEM_ACQUIRE, sem);
-  }
+inline static void simcall_BODY_sem_acquire(smx_sem_t sem)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_sem_acquire(&SIMIX_process_self()->simcall, sem);
+  return simcall<void, smx_sem_t>(SIMCALL_SEM_ACQUIRE, sem);
+}
 
-inline static void simcall_BODY_sem_acquire_timeout(smx_sem_t sem, double timeout) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_sem_acquire_timeout(&SIMIX_process_self()->simcall, sem, timeout);
-    return simcall<void, smx_sem_t, double>(SIMCALL_SEM_ACQUIRE_TIMEOUT, sem, timeout);
-  }
+inline static void simcall_BODY_sem_acquire_timeout(smx_sem_t sem, double timeout)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_sem_acquire_timeout(&SIMIX_process_self()->simcall, sem, timeout);
+  return simcall<void, smx_sem_t, double>(SIMCALL_SEM_ACQUIRE_TIMEOUT, sem, timeout);
+}
 
-  inline static sg_size_t simcall_BODY_file_read(surf_file_t fd, sg_size_t size)
-  {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0)
-      simcall_HANDLER_file_read(&SIMIX_process_self()->simcall, fd, size);
-    return simcall<sg_size_t, surf_file_t, sg_size_t>(SIMCALL_FILE_READ, fd, size);
-  }
+inline static sg_size_t simcall_BODY_file_read(surf_file_t fd, sg_size_t size)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_file_read(&SIMIX_process_self()->simcall, fd, size);
+  return simcall<sg_size_t, surf_file_t, sg_size_t>(SIMCALL_FILE_READ, fd, size);
+}
 
-  inline static sg_size_t simcall_BODY_file_write(surf_file_t fd, sg_size_t size)
-  {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0)
-      simcall_HANDLER_file_write(&SIMIX_process_self()->simcall, fd, size);
-    return simcall<sg_size_t, surf_file_t, sg_size_t>(SIMCALL_FILE_WRITE, fd, size);
-  }
+inline static sg_size_t simcall_BODY_file_write(surf_file_t fd, sg_size_t size)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_file_write(&SIMIX_process_self()->simcall, fd, size);
+  return simcall<sg_size_t, surf_file_t, sg_size_t>(SIMCALL_FILE_WRITE, fd, size);
+}
 
-inline static int simcall_BODY_mc_random(int min, int max) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_mc_random(&SIMIX_process_self()->simcall, min, max);
-    return simcall<int, int, int>(SIMCALL_MC_RANDOM, min, max);
-  }
+inline static int simcall_BODY_mc_random(int min, int max)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_mc_random(&SIMIX_process_self()->simcall, min, max);
+  return simcall<int, int, int>(SIMCALL_MC_RANDOM, min, max);
+}
 
-  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, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>, const char*>(
-        SIMCALL_SET_CATEGORY, synchro, category);
-  }
+inline static void simcall_BODY_set_category(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> synchro, const char* category)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    SIMIX_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) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) SIMIX_run_kernel(code);
-    return simcall<void, std::function<void()> const*>(SIMCALL_RUN_KERNEL, code);
-  }
+inline static void simcall_BODY_run_kernel(std::function<void()> const* code)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    SIMIX_run_kernel(code);
+  return simcall<void, std::function<void()> const*>(SIMCALL_RUN_KERNEL, code);
+}
 
-inline static void simcall_BODY_run_blocking(std::function<void()> const* code) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) SIMIX_run_blocking(code);
-    return simcall<void, std::function<void()> const*>(SIMCALL_RUN_BLOCKING, code);
-  }/** @endcond */
+inline static void simcall_BODY_run_blocking(std::function<void()> const* code)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    SIMIX_run_blocking(code);
+  return simcall<void, std::function<void()> const*>(SIMCALL_RUN_BLOCKING, code);
+} /** @endcond */
index 7f4fc93..dfed3e3 100644 (file)
@@ -14,8 +14,8 @@
  * That's not about http://en.wikipedia.org/wiki/Poop, despite the odor :)
  */
 
+#include "smx_private.hpp"
 #include <xbt/base.h>
-#include "smx_private.h"
 #if SIMGRID_HAVE_MC
 #include "src/mc/mc_forward.hpp"
 #endif
@@ -73,203 +73,156 @@ void SIMIX_simcall_handle(smx_simcall_t simcall, int value) {
     return;
   switch (simcall->call) {
 case SIMCALL_PROCESS_KILLALL:
-      simcall_HANDLER_process_killall(simcall, simgrid::simix::unmarshal<int>(simcall->args[0]));
-      SIMIX_simcall_answer(simcall);
-      break;
+  simcall_HANDLER_process_killall(simcall, simgrid::simix::unmarshal<int>(simcall->args[0]));
+  SIMIX_simcall_answer(simcall);
+  break;
 
 case SIMCALL_PROCESS_CLEANUP:
-      SIMIX_process_cleanup(simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]));
-      SIMIX_simcall_answer(simcall);
-      break;
+  SIMIX_process_cleanup(simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]));
+  SIMIX_simcall_answer(simcall);
+  break;
 
 case SIMCALL_PROCESS_SUSPEND:
-      simcall_HANDLER_process_suspend(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]));
-      break;
+  simcall_HANDLER_process_suspend(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]));
+  break;
 
 case SIMCALL_PROCESS_JOIN:
-      simcall_HANDLER_process_join(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]), simgrid::simix::unmarshal<double>(simcall->args[1]));
-      break;
+  simcall_HANDLER_process_join(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]), simgrid::simix::unmarshal<double>(simcall->args[1]));
+  break;
 
 case SIMCALL_PROCESS_SLEEP:
-      simcall_HANDLER_process_sleep(simcall, simgrid::simix::unmarshal<double>(simcall->args[0]));
-      break;
+  simcall_HANDLER_process_sleep(simcall, simgrid::simix::unmarshal<double>(simcall->args[0]));
+  break;
 
 case SIMCALL_EXECUTION_START:
-  simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>>(
-      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])));
+  simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>>(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<boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>>(
-      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::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>>(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])));
   SIMIX_simcall_answer(simcall);
   break;
 
 case SIMCALL_EXECUTION_WAIT:
-  simcall_HANDLER_execution_wait(
-      simcall,
-      simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]));
+  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]));
-      SIMIX_simcall_answer(simcall);
-      break;
+  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]));
+  SIMIX_simcall_answer(simcall);
+  break;
 
 case SIMCALL_COMM_IPROBE:
-  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<simix_match_func_t>(simcall->args[2]),
-                                                   simgrid::simix::unmarshal<void*>(simcall->args[3])));
+  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<simix_match_func_t>(simcall->args[2]), simgrid::simix::unmarshal<void*>(simcall->args[3])));
   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;
+  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<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])));
+  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;
+  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<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])));
+  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;
+  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<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]),
-      simgrid::simix::unmarshal<double>(simcall->args[1]));
+  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<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]));
+  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<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>*>(simcall->args[0]),
-      simgrid::simix::unmarshal<size_t>(simcall->args[1]));
+  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_LOCK:
-      simcall_HANDLER_mutex_lock(simcall, simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[0]));
-      break;
+  simcall_HANDLER_mutex_lock(simcall, simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[0]));
+  break;
 
 case SIMCALL_MUTEX_TRYLOCK:
-      simgrid::simix::marshal<int>(simcall->result, simcall_HANDLER_mutex_trylock(simcall, simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[0])));
-      SIMIX_simcall_answer(simcall);
-      break;
+  simgrid::simix::marshal<int>(simcall->result, simcall_HANDLER_mutex_trylock(simcall, simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[0])));
+  SIMIX_simcall_answer(simcall);
+  break;
 
 case SIMCALL_MUTEX_UNLOCK:
-      simcall_HANDLER_mutex_unlock(simcall, simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[0]));
-      SIMIX_simcall_answer(simcall);
-      break;
+  simcall_HANDLER_mutex_unlock(simcall, simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[0]));
+  SIMIX_simcall_answer(simcall);
+  break;
 
 case SIMCALL_COND_INIT:
-      simgrid::simix::marshal<smx_cond_t>(simcall->result, SIMIX_cond_init());
-      SIMIX_simcall_answer(simcall);
-      break;
+  simgrid::simix::marshal<smx_cond_t>(simcall->result, SIMIX_cond_init());
+  SIMIX_simcall_answer(simcall);
+  break;
 
 case SIMCALL_COND_SIGNAL:
-      SIMIX_cond_signal(simgrid::simix::unmarshal<smx_cond_t>(simcall->args[0]));
-      SIMIX_simcall_answer(simcall);
-      break;
+  SIMIX_cond_signal(simgrid::simix::unmarshal<smx_cond_t>(simcall->args[0]));
+  SIMIX_simcall_answer(simcall);
+  break;
 
 case SIMCALL_COND_WAIT:
-      simcall_HANDLER_cond_wait(simcall, simgrid::simix::unmarshal<smx_cond_t>(simcall->args[0]), simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[1]));
-      break;
+  simcall_HANDLER_cond_wait(simcall, simgrid::simix::unmarshal<smx_cond_t>(simcall->args[0]), simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[1]));
+  break;
 
 case SIMCALL_COND_WAIT_TIMEOUT:
-      simcall_HANDLER_cond_wait_timeout(simcall, simgrid::simix::unmarshal<smx_cond_t>(simcall->args[0]), simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[1]), simgrid::simix::unmarshal<double>(simcall->args[2]));
-      break;
+  simcall_HANDLER_cond_wait_timeout(simcall, simgrid::simix::unmarshal<smx_cond_t>(simcall->args[0]), simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[1]), simgrid::simix::unmarshal<double>(simcall->args[2]));
+  break;
 
 case SIMCALL_COND_BROADCAST:
-      SIMIX_cond_broadcast(simgrid::simix::unmarshal<smx_cond_t>(simcall->args[0]));
-      SIMIX_simcall_answer(simcall);
-      break;
+  SIMIX_cond_broadcast(simgrid::simix::unmarshal<smx_cond_t>(simcall->args[0]));
+  SIMIX_simcall_answer(simcall);
+  break;
 
 case SIMCALL_SEM_ACQUIRE:
-      simcall_HANDLER_sem_acquire(simcall, simgrid::simix::unmarshal<smx_sem_t>(simcall->args[0]));
-      break;
+  simcall_HANDLER_sem_acquire(simcall, simgrid::simix::unmarshal<smx_sem_t>(simcall->args[0]));
+  break;
 
 case SIMCALL_SEM_ACQUIRE_TIMEOUT:
-      simcall_HANDLER_sem_acquire_timeout(simcall, simgrid::simix::unmarshal<smx_sem_t>(simcall->args[0]), simgrid::simix::unmarshal<double>(simcall->args[1]));
-      break;
+  simcall_HANDLER_sem_acquire_timeout(simcall, simgrid::simix::unmarshal<smx_sem_t>(simcall->args[0]), simgrid::simix::unmarshal<double>(simcall->args[1]));
+  break;
 
 case SIMCALL_FILE_READ:
-  simcall_HANDLER_file_read(simcall, simgrid::simix::unmarshal<surf_file_t>(simcall->args[0]),
-                            simgrid::simix::unmarshal<sg_size_t>(simcall->args[1]));
+  simcall_HANDLER_file_read(simcall, simgrid::simix::unmarshal<surf_file_t>(simcall->args[0]), simgrid::simix::unmarshal<sg_size_t>(simcall->args[1]));
   break;
 
 case SIMCALL_FILE_WRITE:
-  simcall_HANDLER_file_write(simcall, simgrid::simix::unmarshal<surf_file_t>(simcall->args[0]),
-                             simgrid::simix::unmarshal<sg_size_t>(simcall->args[1]));
+  simcall_HANDLER_file_write(simcall, simgrid::simix::unmarshal<surf_file_t>(simcall->args[0]), simgrid::simix::unmarshal<sg_size_t>(simcall->args[1]));
   break;
 
 case SIMCALL_MC_RANDOM:
-      simgrid::simix::marshal<int>(simcall->result, simcall_HANDLER_mc_random(simcall, simgrid::simix::unmarshal<int>(simcall->args[0]), simgrid::simix::unmarshal<int>(simcall->args[1])));
-      SIMIX_simcall_answer(simcall);
-      break;
+  simgrid::simix::marshal<int>(simcall->result, simcall_HANDLER_mc_random(simcall, simgrid::simix::unmarshal<int>(simcall->args[0]), simgrid::simix::unmarshal<int>(simcall->args[1])));
+  SIMIX_simcall_answer(simcall);
+  break;
 
 case SIMCALL_SET_CATEGORY:
-  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_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]));
-      SIMIX_simcall_answer(simcall);
-      break;
+  SIMIX_run_kernel(simgrid::simix::unmarshal<std::function<void()> const*>(simcall->args[0]));
+  SIMIX_simcall_answer(simcall);
+  break;
 
 case SIMCALL_RUN_BLOCKING:
-      SIMIX_run_blocking(simgrid::simix::unmarshal<std::function<void()> const*>(simcall->args[0]));
-      break;
+  SIMIX_run_blocking(simgrid::simix::unmarshal<std::function<void()> const*>(simcall->args[0]));
+  break;
     case NUM_SIMCALLS:
       break;
     case SIMCALL_NONE:
similarity index 72%
rename from src/simix/popping_private.h
rename to src/simix/popping_private.hpp
index 160e55e..d6c0a5c 100644 (file)
@@ -3,11 +3,11 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#ifndef SG_POPPING_PRIVATE_H
-#define SG_POPPING_PRIVATE_H
+#ifndef SG_POPPING_PRIVATE_HPP
+#define SG_POPPING_PRIVATE_HPP
 
-#include <xbt/base.h>
 #include <simgrid/simix.h>
+#include <xbt/base.h>
 
 #include <src/kernel/activity/ActivityImpl.hpp>
 #include <src/kernel/activity/CommImpl.hpp>
@@ -15,7 +15,7 @@
 
 #include <boost/intrusive_ptr.hpp>
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /********************************* Simcalls *********************************/
 XBT_PUBLIC_DATA(const char*) simcall_names[]; /* Name of each simcall */
@@ -24,24 +24,24 @@ XBT_PUBLIC_DATA(const char*) simcall_names[]; /* Name of each simcall */
 
 typedef int (*simix_match_func_t)(void*, void*, simgrid::kernel::activity::CommImpl*);
 typedef void (*simix_copy_data_func_t)(smx_activity_t, void*, size_t);
-typedef void (*simix_clean_func_t)(void *);
+typedef void (*simix_clean_func_t)(void*);
 typedef void (*FPtr)(void); // Hide the ugliness
 
 /* Pack all possible scalar types in an union */
 union u_smx_scalar {
-  char            c;
-  short           s;
-  int             i;
-  long            l;
-  long long       ll;
-  unsigned char   uc;
-  unsigned short  us;
-  unsigned int    ui;
-  unsigned long   ul;
+  char c;
+  short s;
+  int i;
+  long l;
+  long long ll;
+  unsigned char uc;
+  unsigned short us;
+  unsigned int ui;
+  unsigned long ul;
   unsigned long long ull;
-  double          d;
-  void*           dp;
-  FPtr            fp;
+  double d;
+  void* dp;
+  FPtr fp;
 };
 
 /**
@@ -64,17 +64,14 @@ struct s_smx_simcall {
 XBT_PRIVATE void SIMIX_simcall_answer(smx_simcall_t simcall);
 XBT_PRIVATE void SIMIX_simcall_handle(smx_simcall_t simcall, int value);
 XBT_PRIVATE void SIMIX_simcall_exit(smx_activity_t synchro);
-XBT_PRIVATE const char *SIMIX_simcall_name(e_smx_simcall_t kind);
+XBT_PRIVATE const charSIMIX_simcall_name(e_smx_simcall_t kind);
 XBT_PRIVATE void SIMIX_run_kernel(std::function<void()> const* code);
 XBT_PRIVATE void SIMIX_run_blocking(std::function<void()> const* code);
-
-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
+ * They will be used in popping_accessors.hpp 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()
@@ -89,17 +86,15 @@ SG_END_DECL()
 namespace simgrid {
 namespace simix {
 
-template<class T>
-class type {
-  constexpr bool operator==(type) const    { return true; }
-  template<class U>
-  constexpr bool operator==(type<U>) const { return false; }
-  constexpr bool operator!=(type) const    { return false; }
-  template<class U>
-  constexpr bool operator!=(type<U>) const { return true; }
+template <class T> class type {
+  constexpr bool operator==(type) const { return true; }
+  template <class U> constexpr bool operator==(type<U>) const { return false; }
+  constexpr bool operator!=(type) const { return false; }
+  template <class U> constexpr bool operator!=(type<U>) const { return true; }
 };
 
-template<typename T> struct marshal_t {};
+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; }                                   \
@@ -129,13 +124,11 @@ 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)
+template <class T> inline void marshal(type<T*>, u_smx_scalar& simcall, T* value)
 {
-  simcall.dp = (void*) value;
+  simcall.dp = (void*)value;
 }
-template<class T> inline
-T* unmarshal(type<T*>, u_smx_scalar const& simcall)
+template <class T> inline T* unmarshal(type<T*>, u_smx_scalar const& simcall)
 {
   return static_cast<T*>(simcall.dp);
 }
@@ -165,28 +158,24 @@ template <class T> inline T* unmarshal_raw(type<boost::intrusive_ptr<T>>, u_smx_
   return static_cast<T*>(simcall.dp);
 }
 
-template<class R, class... T> inline
-void marshal(type<R(*)(T...)>, u_smx_scalar& simcall, R(*value)(T...))
+template <class R, class... T> inline void marshal(type<R (*)(T...)>, u_smx_scalar& simcall, R (*value)(T...))
 {
-  simcall.fp = (FPtr) value;
+  simcall.fp = (FPtr)value;
 }
-template<class R, class... T> inline
-auto unmarshal(type<R(*)(T...)>, u_smx_scalar simcall) -> R(*)(T...)
+template <class R, class... T> inline auto unmarshal(type<R (*)(T...)>, u_smx_scalar simcall) -> R (*)(T...)
 {
-  return (R(*)(T...)) simcall.fp;
+  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)
+template <class T> inline void marshal(u_smx_scalar& simcall, T const& value)
 {
   return marshal(type<T>(), simcall, value);
 }
-template<class T> inline
-typename std::remove_reference<T>::type unmarshal(u_smx_scalar& simcall)
+template <class T> inline typename std::remove_reference<T>::type unmarshal(u_smx_scalar& simcall)
 {
   return unmarshal(type<T>(), simcall);
 }
@@ -195,37 +184,32 @@ template <class T> inline typename std::remove_reference<T>::type unmarshal_raw(
   return unmarshal(type<T>(), simcall);
 }
 
-template<std::size_t I>
-inline void marshalArgs(smx_simcall_t simcall) {}
+template <std::size_t I> inline void marshalArgs(smx_simcall_t simcall)
+{
+}
 
-template<std::size_t I, class A>
-inline void marshalArgs(smx_simcall_t simcall, A const& a)
+template <std::size_t I, class A> inline void marshalArgs(smx_simcall_t simcall, A const& a)
 {
   marshal(simcall->args[I], a);
 }
 
-template<std::size_t I, class A, class... B>
-inline void marshalArgs(smx_simcall_t simcall, A const& a, B const&... b)
+template <std::size_t I, class A, class... B> inline void marshalArgs(smx_simcall_t simcall, A const& a, B const&... b)
 {
   marshal(simcall->args[I], a);
-  marshalArgs<I+1>(simcall, b...);
+  marshalArgs<I + 1>(simcall, b...);
 }
 
 /** Initialize the simcall */
-template<class... A> inline
-void marshal(smx_simcall_t simcall, e_smx_simcall_t call, A const&... a)
+template <class... A> inline void marshal(smx_simcall_t simcall, e_smx_simcall_t call, A const&... a)
 {
   simcall->call = call;
   memset(&simcall->result, 0, sizeof(simcall->result));
   memset(simcall->args, 0, sizeof(simcall->args));
   marshalArgs<0>(simcall, a...);
 }
-
 }
 }
 
-#endif
-
-#include "popping_accessors.h"
+#include "popping_accessors.hpp"
 
 #endif
index 4465a64..093fe97 100755 (executable)
@@ -41,8 +41,9 @@ class Simcall(object):
         if self.name not in self.simcalls_BODY:
             print ('# ERROR: No function calling simcall_BODY_%s' % self.name)
             print ('# Add something like this to libsmx.c:')
-            print ('%s simcall_%s(%s) {' % (self.res.rettype(), self.name, ', '.
+            print ('%s simcall_%s(%s)' % (self.res.rettype(), self.name, ', '.
                    join('%s %s' % (arg.rettype(), arg.name) for arg in self.args)))
+            print ('{')
             print ('  return simcall_BODY_%s(%s);' % (self.name, "..."))
             print ('}')
             return False
@@ -59,8 +60,9 @@ class Simcall(object):
             if self.name not in self.simcalls_PRE:
                 print ('# ERROR: No function called simcall_HANDLER_%s' % self.name)
                 print ('# Add something like this to the relevant C file (like smx_io.c if it\'s an IO call):')
-                print ('%s simcall_HANDLER_%s(smx_simcall_t simcall%s) {' % (self.res.rettype(), self.name, ''.
+                print ('%s simcall_HANDLER_%s(smx_simcall_t simcall%s)' % (self.res.rettype(), self.name, ''.
                        join(', %s %s' % (arg.rettype(), arg.name)for arg in self.args)))
+                print ('{')
                 print ('  // Your code handling the simcall')
                 print ('}')
                 return False
@@ -98,7 +100,7 @@ class Simcall(object):
             res.append('static inline void simcall_%s__set__%s(smx_simcall_t simcall, %s arg)' % (
                 self.name, arg.name, arg.rettype()))
             res.append('{')
-            res.append('    simgrid::simix::marshal<%s>(simcall->args[%i], arg);' % (arg.rettype(), i))
+            res.append('  simgrid::simix::marshal<%s>(simcall->args[%i], arg);' % (arg.rettype(), i))
             res.append('}')
 
         # Return value getter/setters
@@ -107,16 +109,16 @@ class Simcall(object):
             res.append(
                 'static inline %s simcall_%s__get__result(smx_simcall_t simcall)' % (self.res.rettype(), self.name))
             res.append('{')
-
-            res.append('    return simgrid::simix::unmarshal<%s>(simcall->result);' % self.res.rettype())
+            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('static inline %s simcall_%s__getraw__result(smx_simcall_t simcall)' % (rawtype, self.name))
+            res.append('{')
+            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()))
+                'static inline void simcall_%s__set__result(smx_simcall_t simcall, %s result)' % (self.name, self.res.rettype()))
+            res.append('{')
+            res.append('  simgrid::simix::marshal<%s>(simcall->result, result);' % (self.res.rettype()))
             res.append('}')
         return '\n'.join(res)
 
@@ -132,36 +134,36 @@ class Simcall(object):
         else:
             call = "SIMIX_%s(%s)" % (self.name, ', '.join(args))
         if self.call_kind == 'Func':
-            res.append("      simgrid::simix::marshal<%s>(simcall->result, %s);" % (self.res.rettype(), call))
+            res.append("  simgrid::simix::marshal<%s>(simcall->result, %s);" % (self.res.rettype(), call))
         else:
-            res.append("      " + call + ";");
+            res.append("  " + call + ";");
         if self.call_kind != 'Blck':
-            res.append('      SIMIX_simcall_answer(simcall);')
-        res.append('      break;')
+            res.append('  SIMIX_simcall_answer(simcall);')
+        res.append('  break;')
         res.append('')
         return '\n'.join(res)
 
     def body(self):
         res = ['']
         res.append(
-            'inline static %s simcall_BODY_%s(%s) {' % (self.res.rettype(),
+            'inline static %s simcall_BODY_%s(%s)' % (self.res.rettype(),
                                                         self.name,
                                                         ', '.join('%s %s' % (arg.rettype(), arg.name) for arg in self.args)))
-        res.append(
-            '    /* Go to that function to follow the code flow through the simcall barrier */')
+        res.append('{')
+        res.append('  if (0) /* Go to that function to follow the code flow through the simcall barrier */')
         if self.need_handler:
-            res.append('    if (0) simcall_HANDLER_%s(%s);' % (self.name,
-                                                               ', '.join(["&SIMIX_process_self()->simcall"] + [arg.name for arg in self.args])))
+            res.append('    simcall_HANDLER_%s(%s);' % (self.name,
+                                                        ', '.join(["&SIMIX_process_self()->simcall"] + [arg.name for arg in self.args])))
         else:
-            res.append('    if (0) SIMIX_%s(%s);' % (self.name,
+            res.append('    SIMIX_%s(%s);' % (self.name,
                                                      ', '.join(arg.name for arg in self.args)))
-        res.append('    return simcall<%s%s>(SIMCALL_%s%s);' % (
+        res.append('  return simcall<%s%s>(SIMCALL_%s%s);' % (
             self.res.rettype(),
             "".join([ ", " + arg.rettype() for i, arg in enumerate(self.args) ]),
             self.name.upper(),
             "".join([ ", " + arg.name for i, arg in enumerate(self.args) ])
             ));
-        res.append('  }')
+        res.append('}')
         return '\n'.join(res)
 
     def handler_prototype(self):
@@ -272,10 +274,10 @@ if __name__ == '__main__':
     #  sys.exit(1)
 
     #
-    # smx_popping_accessors.c
+    # popping_accessors.hpp
     #
-    fd = header('popping_accessors.h')
-    fd.write('#include "src/simix/popping_private.h"');
+    fd = header('popping_accessors.hpp')
+    fd.write('#include "src/simix/popping_private.hpp"');
     handle(fd, Simcall.accessors, simcalls, simcalls_dict)
     fd.write(
         "\n\n/* The prototype of all simcall handlers, automatically generated for you */\n\n")
@@ -283,7 +285,7 @@ if __name__ == '__main__':
     fd.close()
 
     #
-    # smx_popping_enum.c
+    # popping_enum.h
     #
     fd = header("popping_enum.h")
     fd.write('/**\n')
@@ -299,13 +301,13 @@ if __name__ == '__main__':
     fd.close()
 
     #
-    # smx_popping_generated.cpp
+    # popping_generated.cpp
     #
 
     fd = header("popping_generated.cpp")
 
+    fd.write('#include "smx_private.hpp"\n')
     fd.write('#include <xbt/base.h>\n')
-    fd.write('#include "smx_private.h"\n')
     fd.write('#if SIMGRID_HAVE_MC\n')
     fd.write('#include "src/mc/mc_forward.hpp"\n')
     fd.write('#endif\n')
@@ -324,7 +326,7 @@ if __name__ == '__main__':
     fd.write('/** @private\n')
     fd.write(
         ' * @brief (in kernel mode) unpack the simcall and activate the handler\n')
-    fd.write(' * \n')
+    fd.write(' *\n')
     fd.write(' * This function is generated from src/simix/simcalls.in\n')
     fd.write(' */\n')
     fd.write(
@@ -354,13 +356,13 @@ if __name__ == '__main__':
     fd.close()
 
     #
-    # smx_popping_bodies.cpp
+    # popping_bodies.cpp
     #
     fd = header('popping_bodies.cpp')
-    fd.write('#include <functional>\n')
-    fd.write('#include "smx_private.h"\n')
+    fd.write('#include "smx_private.hpp"\n')
     fd.write('#include "src/mc/mc_forward.hpp"\n')
     fd.write('#include "xbt/ex.h"\n')
+    fd.write('#include <functional>\n')
     fd.write('#include <simgrid/simix.hpp>\n')
     fd.write("/** @cond */ // Please Doxygen, don't look at this\n")
     fd.write('''
@@ -380,5 +382,5 @@ inline static R simcall(e_smx_simcall_t call, T const&... t)
 }
 ''')
     handle(fd, Simcall.body, simcalls, simcalls_dict)
-    fd.write("/** @endcond */\n");
+    fd.write(" /** @endcond */\n");
     fd.close()
index e399163..6b0c54b 100644 (file)
 #include <xbt/range.hpp>
 #include <xbt/sysdep.h>
 
+#include "simgrid/modelchecker.h"
+#include "simgrid/sg_config.h"
+#include "smx_private.hpp"
 #include "src/internal_config.h"
 #include "xbt/log.h"
 #include "xbt/swag.h"
 #include "xbt/xbt_os_thread.h"
-#include "smx_private.h"
-#include "simgrid/sg_config.h"
-#include "src/internal_config.h"
-#include "simgrid/modelchecker.h"
-
 
 #ifdef _WIN32
 #include <windows.h>
index 6fad27e..3093fc5 100644 (file)
@@ -7,7 +7,7 @@
 #include <vector>
 
 #include "simgrid/s4u/Host.hpp"
-#include "smx_private.h"
+#include "smx_private.hpp"
 #include "src/surf/xml/platf_private.hpp" // FIXME: KILLME. There must be a better way than mimicking XML here
 #include <xbt/ex.hpp>
 
index d0c7d02..3332c1d 100644 (file)
@@ -1,15 +1,15 @@
-/* Copyright (c) 2007-2015. The SimGrid Team.
+/* Copyright (c) 2007-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "smx_private.h"
-#include <xbt/ex.hpp>
-#include "xbt/sysdep.h"
+#include "smx_private.hpp"
+#include "xbt/config.h"
 #include "xbt/log.h"
+#include "xbt/sysdep.h"
 #include "xbt/xbt_os_time.h"
-#include "xbt/config.h"
+#include <xbt/ex.hpp>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_environment, simix, "Logging specific to SIMIX (environment)");
 
index 61469fb..d01e0f8 100644 (file)
 #include "simgrid/s4u/Engine.hpp"
 #include "simgrid/s4u/Host.hpp"
 
+#include "smx_private.hpp"
 #include "src/surf/surf_interface.hpp"
 #include "src/surf/xml/platf.hpp"
-#include "smx_private.h"
-#include "xbt/ex.h"             /* ex_backtrace_display */
+#include "xbt/ex.h" /* ex_backtrace_display */
 
 #include "mc/mc.h"
 #include "simgrid/sg_config.h"
 #include "src/kernel/activity/SynchroRaw.hpp"
 
 #if SIMGRID_HAVE_MC
-#include "src/mc/mc_private.h"
+#include "src/mc/mc_private.hpp"
 #include "src/mc/remote/Client.hpp"
 #include "src/mc/remote/mc_protocol.h"
 #endif
 
-#include "src/mc/mc_record.h"
+#include "src/mc/mc_record.hpp"
 
 #if HAVE_SMPI
-#include "src/smpi/include/private.h"
 #include "src/smpi/include/private.hpp"
 #endif
 
index 8698541..855b491 100644 (file)
@@ -1,10 +1,10 @@
-/* Copyright (c) 2007-2016. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "mc/mc.h"
-#include "smx_private.h"
+#include "smx_private.hpp"
 #include "src/kernel/activity/CommImpl.hpp"
 #include "src/mc/mc_replay.h"
 #include "src/plugins/vm/VirtualMachineImpl.hpp"
similarity index 74%
rename from src/simix/smx_host_private.h
rename to src/simix/smx_host_private.hpp
index d9a6b57..6943f19 100644 (file)
@@ -3,43 +3,43 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#ifndef SIMIX_HOST_PRIVATE_H
-#define SIMIX_HOST_PRIVATE_H
+#ifndef SIMIX_HOST_PRIVATE_HPP
+#define SIMIX_HOST_PRIVATE_HPP
 
 #include <functional>
 #include <map>
 #include <vector>
 
-#include <xbt/base.h>
 #include <xbt/Extendable.hpp>
+#include <xbt/base.h>
 
+#include "popping_private.hpp"
 #include "simgrid/simix.h"
-#include "popping_private.h"
 
 #include "src/kernel/activity/ExecImpl.hpp"
 
 /** @brief Host datatype from SIMIX POV */
 namespace simgrid {
-  namespace simix {
-    class ProcessArg;
+namespace simix {
+class ProcessArg;
 
-    class Host {
-    public:
-      static simgrid::xbt::Extension<simgrid::s4u::Host, Host> EXTENSION_ID;
+class Host {
+public:
+  static simgrid::xbt::Extension<simgrid::s4u::Host, Host> EXTENSION_ID;
 
-      explicit Host();
-      virtual ~Host();
+  explicit Host();
+  virtual ~Host();
 
-      xbt_swag_t process_list;
-      std::vector<ProcessArg*> auto_restart_processes;
-      std::vector<ProcessArg*> boot_processes;
+  xbt_swag_t process_list;
+  std::vector<ProcessArg*> auto_restart_processes;
+  std::vector<ProcessArg*> boot_processes;
 
-      void turnOn();
-    };
-  }
+  void turnOn();
+};
+}
 }
 
-SG_BEGIN_DECL()
+extern "C" {
 XBT_PRIVATE void SIMIX_host_add_auto_restart_process(sg_host_t host, const char* name, std::function<void()> code,
                                                      void* data, double kill_time,
                                                      std::map<std::string, std::string>* properties, int auto_restart);
@@ -48,9 +48,8 @@ XBT_PRIVATE void SIMIX_host_autorestart(sg_host_t host);
 
 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 void SIMIX_set_category(smx_activity_t synchro, const char* category);
+}
 
 XBT_PRIVATE boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>
 SIMIX_execution_start(smx_actor_t issuer, const char* name, double flops_amount, double priority, double bound);
@@ -59,4 +58,3 @@ SIMIX_execution_parallel_start(const char* name, int host_nb, sg_host_t* host_li
                                double* bytes_amount, double rate, double timeout);
 
 #endif
-
index 1493988..90c7f88 100644 (file)
@@ -14,8 +14,8 @@
 #include "src/surf/StorageImpl.hpp"
 #include "surf/surf.h"
 
+#include "smx_private.hpp"
 #include "src/surf/surf_interface.hpp"
-#include "smx_private.h"
 
 #include "src/kernel/activity/SynchroIo.hpp"
 
similarity index 86%
rename from src/simix/smx_io_private.h
rename to src/simix/smx_io_private.hpp
index db1c66d..05846b7 100644 (file)
@@ -3,13 +3,13 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#ifndef SIMIX_IO_PRIVATE_H
-#define SIMIX_IO_PRIVATE_H
+#ifndef SIMIX_IO_PRIVATE_HPP
+#define SIMIX_IO_PRIVATE_HPP
 
 #include <xbt/base.h>
 
+#include "popping_private.hpp"
 #include "simgrid/simix.h"
-#include "popping_private.h"
 
 XBT_PRIVATE smx_activity_t SIMIX_file_read(surf_file_t fd, sg_size_t size);
 XBT_PRIVATE smx_activity_t SIMIX_file_write(surf_file_t fd, sg_size_t size);
index 591cf58..e75e0b4 100644 (file)
@@ -16,7 +16,7 @@
 #include "simgrid/s4u/Activity.hpp"
 #include "simgrid/s4u/Mailbox.hpp"
 #include "src/mc/mc_replay.h"
-#include "src/simix/smx_private.h"
+#include "src/simix/smx_private.hpp"
 #include "src/surf/cpu_interface.hpp"
 #include "src/surf/surf_interface.hpp"
 
similarity index 93%
rename from src/simix/smx_network_private.h
rename to src/simix/smx_network_private.hpp
index 0ed901f..0540c7b 100644 (file)
@@ -3,8 +3,8 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#ifndef SIMIX_NETWORK_PRIVATE_H
-#define SIMIX_NETWORK_PRIVATE_H
+#ifndef SIMIX_NETWORK_PRIVATE_HPP
+#define SIMIX_NETWORK_PRIVATE_HPP
 
 #include "simgrid/s4u/Mailbox.hpp"
 #include "src/kernel/activity/MailboxImpl.hpp"
similarity index 66%
rename from src/simix/smx_private.h
rename to src/simix/smx_private.hpp
index f10bf4d..a14ab8b 100644 (file)
@@ -3,12 +3,12 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#ifndef SIMIX_PRIVATE_H
-#define SIMIX_PRIVATE_H
+#ifndef SIMIX_PRIVATE_HPP
+#define SIMIX_PRIVATE_HPP
 
 #include "simgrid/s4u/Actor.hpp"
 #include "src/kernel/context/Context.hpp"
-#include <signal.h>
+#include <csignal>
 
 #include <map>
 #include <vector>
@@ -37,7 +37,7 @@ public:
   xbt_dynar_t actors_vector = xbt_dynar_new(sizeof(smx_actor_t), nullptr);
 #endif
   xbt_swag_t process_to_destroy = nullptr;
-  smx_actor_t maestro_process = nullptr;
+  smx_actor_t maestro_process   = nullptr;
 
   // Maps function names to actor code:
   std::unordered_map<std::string, simgrid::simix::ActorCodeFactory> registered_functions;
@@ -49,18 +49,17 @@ public:
   void_pfn_smxprocess_t kill_process_function = nullptr;
   /** Callback used when killing a SMX_process */
   void_pfn_smxprocess_t cleanup_process_function = nullptr;
-  xbt_os_mutex_t mutex = nullptr;
+  xbt_os_mutex_t mutex                           = nullptr;
 
   std::vector<simgrid::xbt::Task<void()>> tasks;