Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge pull request #202 from Takishipp/clear_fct
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Mon, 24 Jul 2017 20:10:12 +0000 (22:10 +0200)
committerGitHub <noreply@github.com>
Mon, 24 Jul 2017 20:10:12 +0000 (22:10 +0200)
Turn paje_value to a class

112 files changed:
.gitignore
CMakeLists.txt
contrib/benchmarking_code_block/inject.h
doc/doxygen/module-smpi.doc
doc/doxygen/options.doc
examples/java/dht/chord/Node.java
examples/java/io/file/Node.java
examples/msg/app-bittorrent/peer.c
examples/msg/dht-kademlia/routing_table.c
examples/msg/mc/bugged1.tesh
examples/msg/mc/bugged1_liveness.tesh
examples/msg/mc/bugged1_liveness_sparse.tesh
examples/msg/mc/bugged1_liveness_stack_cleaner
examples/msg/mc/bugged1_liveness_visited.tesh
examples/msg/mc/bugged1_liveness_visited_sparse.tesh
examples/msg/mc/bugged2.tesh
examples/msg/mc/electric_fence.c
examples/msg/trace-host-user-variables/trace-host-user-variables.tesh
examples/smpi/CMakeLists.txt
examples/smpi/mc/bugged1_liveness.c
examples/smpi/mc/non_deterministic.tesh
examples/smpi/mc/only_send_deterministic.tesh
examples/smpi/replay_multiple/CMakeLists.txt
examples/smpi/replay_multiple/replay_multiple.tesh
examples/smpi/trace/trace.tesh
examples/smpi/trace_call_location/trace_call_location.tesh
examples/smpi/trace_simple/trace_simple.tesh
include/simgrid/kernel/future.hpp
include/simgrid/msg.h
include/simgrid/s4u/Actor.hpp
include/simgrid/s4u/Comm.hpp
include/simgrid/s4u/ConditionVariable.hpp
include/simgrid/s4u/NetZone.hpp
include/simgrid/s4u/Storage.hpp
include/simgrid/simdag.h
include/simgrid/simix.h
include/xbt/Extendable.hpp
include/xbt/dict.h
include/xbt/exception.hpp
src/bindings/java/jmsg_process.cpp
src/include/surf/surf.h
src/kernel/routing/ClusterZone.cpp
src/kernel/routing/FloydZone.cpp
src/kernel/routing/FullZone.cpp
src/kernel/routing/RoutedZone.cpp
src/mc/PageStore.cpp
src/mc/VisitedState.cpp
src/mc/VisitedState.hpp
src/mc/checker/LivenessChecker.cpp
src/mc/checker/LivenessChecker.hpp
src/mc/checker/simgrid_mc.cpp
src/mc/mc_base.cpp
src/mc/mc_snapshot.h
src/mc/mc_state.cpp
src/msg/msg_gos.cpp
src/msg/msg_process.cpp
src/msg/msg_synchro.cpp
src/s4u/s4u_actor.cpp
src/s4u/s4u_storage.cpp
src/simgrid/sg_config.cpp
src/simix/ActorImpl.cpp
src/simix/ActorImpl.hpp
src/simix/libsmx.cpp
src/simix/popping_accessors.h
src/simix/popping_bodies.cpp
src/simix/popping_enum.h
src/simix/popping_generated.cpp
src/simix/simcalls.in
src/simix/smx_host.cpp
src/simix/smx_host_private.h
src/simix/smx_synchro.cpp
src/smpi/bindings/smpi_f77.cpp
src/smpi/include/smpi_group.hpp
src/smpi/internals/smpi_bench.cpp
src/smpi/internals/smpi_global.cpp
src/smpi/mpi/smpi_group.cpp
src/surf/StorageImpl.hpp
src/surf/cpu_ti.cpp
src/surf/cpu_ti.hpp
src/surf/maxmin.cpp
src/surf/network_cm02.cpp
src/surf/sg_platf.cpp
src/surf/surf_interface.cpp
src/surf/surf_interface.hpp
src/surf/trace_mgr_test.cpp
src/surf/xml/surfxml_parseplatf.cpp
src/xbt/dict.cpp
src/xbt/log.c
teshsuite/s4u/storage_client_server/storage_client_server.cpp
teshsuite/smpi/isp/umpire/CMakeLists.txt
teshsuite/smpi/mpich3-test/coll/CMakeLists.txt
teshsuite/smpi/mpich3-test/f77/attr/CMakeLists.txt
teshsuite/smpi/mpich3-test/f77/coll/CMakeLists.txt
teshsuite/smpi/mpich3-test/f77/comm/CMakeLists.txt
teshsuite/smpi/mpich3-test/f77/datatype/CMakeLists.txt
teshsuite/smpi/mpich3-test/f77/ext/CMakeLists.txt
teshsuite/smpi/mpich3-test/f77/info/CMakeLists.txt
teshsuite/smpi/mpich3-test/f77/init/CMakeLists.txt
teshsuite/smpi/mpich3-test/f77/pt2pt/CMakeLists.txt
teshsuite/smpi/mpich3-test/f77/rma/CMakeLists.txt
teshsuite/smpi/mpich3-test/f77/topo/CMakeLists.txt
teshsuite/smpi/mpich3-test/f77/util/CMakeLists.txt
teshsuite/smpi/mpich3-test/f90/rma/CMakeLists.txt
teshsuite/smpi/mpich3-test/perf/CMakeLists.txt
teshsuite/smpi/mpich3-test/runtests
teshsuite/xbt/parallel_log_crashtest/parallel_log_crashtest.c
tools/cmake/DefinePackages.cmake
tools/cmake/GCCFlags.cmake
tools/cmake/Modules/FindLibelf.cmake [new file with mode: 0644]
tools/cmake/Tests.cmake
tools/graphicator/CMakeLists.txt
tools/simgrid.supp

index c054e5b..2b2b42b 100644 (file)
@@ -666,7 +666,6 @@ teshsuite/smpi/mpich3-test/f77/datatype/gaddressf
 teshsuite/smpi/mpich3-test/f77/datatype/hindex1f
 teshsuite/smpi/mpich3-test/f77/datatype/hindexed_blockf
 teshsuite/smpi/mpich3-test/f77/datatype/packef
-teshsuite/smpi/mpich3-test/f77/datatype/typeaints
 teshsuite/smpi/mpich3-test/f77/datatype/typeaints.h
 teshsuite/smpi/mpich3-test/f77/datatype/typecntsf
 teshsuite/smpi/mpich3-test/f77/datatype/typem2f
index 19a9267..8c2ea59 100644 (file)
@@ -403,15 +403,16 @@ if(HAVE_LIBUNWIND)
   endif()
 else()
   if(enable_model-checking)
-    message(FATAL_ERROR "Please install libunwind-dev libdw-dev libevent-dev if you want to compile the SimGrid model checker.")
+    message(FATAL_ERROR "Please install libunwind-dev libdw-dev libelf-dev libevent-dev if you want to compile the SimGrid model checker.")
   endif()
 endif()
 
 if(enable_model-checking)
   find_package(Libdw REQUIRED)
+  find_package(Libelf REQUIRED)
   find_package(Libevent REQUIRED)
-  include_directories(${LIBDW_INCLUDE_DIR} ${LIBEVENT_INCLUDE_DIR})
-  set(SIMGRID_DEP "${SIMGRID_DEP} ${LIBEVENT_LIBRARIES} ${LIBDW_LIBRARIES}")
+  include_directories(${LIBDW_INCLUDE_DIR} ${LIBELF_INCLUDE_DIR} ${LIBEVENT_INCLUDE_DIR})
+  set(SIMGRID_DEP "${SIMGRID_DEP} ${LIBEVENT_LIBRARIES} ${LIBELF_LIBRARIES} ${LIBDW_LIBRARIES}")
   set(SIMGRID_HAVE_MC 1)
   if("${CMAKE_SYSTEM}" MATCHES "FreeBSD" AND enable_java)
     message(WARNING "FreeBSD + Model-Checking + Java = too much for now. Disabling java")
index c171b09..a79ac28 100644 (file)
@@ -88,7 +88,7 @@ static inline void xbt_inject_init(char *inputfile)
 
     xbt_dict_set(mydict, key, data, NULL);
   }
-  fclose(fInput);
+  fclose(fpInput);
 }
 
 /* Initializing xbt dictionary for StarPU version, reading xbt_hist_t entries line by line */
@@ -113,6 +113,7 @@ static inline void inject_init_starpu(char *inputfile, xbt_dict_t *dict, RngStre
 
   if (fgets(line, MAX_LINE_INJ, fpInput) == NULL) {
     printf("Error input file is empty!"); // Skipping first row
+    fclose(fpInput);
     return;
   }
 
@@ -139,7 +140,7 @@ static inline void inject_init_starpu(char *inputfile, xbt_dict_t *dict, RngStre
 
     xbt_dict_set(mydict, key, data, NULL);
   }
-  fclose(fInput);
+  fclose(fpInput);
 }
 
 /* Injecting time */
index 811a399..ae3d115 100644 (file)
@@ -118,7 +118,7 @@ selector algorithms, that were collected directly in the source code
 of the targeted MPI implementations.
 
 You can switch the automatic selector through the
-\c smpi/coll_selector configuration item. Possible values:
+\c smpi/coll-selector configuration item. Possible values:
 
  - <b>ompi</b>: default selection logic of OpenMPI (version 1.7)
  - <b>mpich</b>: default selection logic of MPICH (version 3.0.4)
index 879a1bf..2ec954e 100644 (file)
@@ -73,7 +73,7 @@ int main(int argc, char *argv[]) {
 - \c contexts/factory: \ref options_virt_factory
 - \c contexts/guard-size: \ref options_virt_guard_size
 - \c contexts/nthreads: \ref options_virt_parallel
-- \c contexts/parallel_threshold: \ref options_virt_parallel
+- \c contexts/parallel-threshold: \ref options_virt_parallel
 - \c contexts/stack-size: \ref options_virt_stacksize
 - \c contexts/synchro: \ref options_virt_parallel
 
@@ -515,7 +515,7 @@ liveness violation) as well as the cycle for liveness properties. This dot file
 can then fed to the graphviz dot tool to generate an corresponding graphical
 representation.
 
-\subsection options_modelchecking_max_depth model-check/max_depth, Depth limit
+\subsection options_modelchecking_max_depth model-check/max-depth, Depth limit
 
 The \b model-checker/max-depth can set the maximum depth of the exploration
 graph of the model-checker. If this limit is reached, a logging message is
index f29ead5..2ef023c 100644 (file)
@@ -64,47 +64,49 @@ public class Node extends Process {
 
       joinSuccess = join(knownId);
     }
-    if (joinSuccess) {
-      double currentClock = Msg.getClock();
-      while (currentClock < (initTime + deadline) && currentClock < Common.MAX_SIMULATION_TIME) {
-        if (commReceive == null) {
-          commReceive = Task.irecv(this.mailbox);
-        }
-        try {
-          if (!commReceive.test()) {
-            if (currentClock >= nextStabilizeDate) {
-              stabilize();
-              nextStabilizeDate = Msg.getClock() + Common.PERIODIC_STABILIZE_DELAY;
-            } else if (currentClock >= nextFixFingersDate) {
-              fixFingers();
-              nextFixFingersDate = Msg.getClock() + Common.PERIODIC_FIX_FINGERS_DELAY;
-            } else if (currentClock >= nextCheckPredecessorDate) {
-              this.checkPredecessor();
-              nextCheckPredecessorDate = Msg.getClock() + Common.PERIODIC_CHECK_PREDECESSOR_DELAY;
-            } else if (currentClock >= nextLookupDate) {
-              this.randomLookup();
-              nextLookupDate = Msg.getClock() + Common.PERIODIC_LOOKUP_DELAY;
-            } else {
-              waitFor(5);
-            }
-            currentClock = Msg.getClock();
+
+    if (!joinSuccess) {
+      Msg.info("I couldn't join the ring");
+      return;
+    }
+
+    double currentClock = Msg.getClock();
+    while (currentClock < (initTime + deadline) && currentClock < Common.MAX_SIMULATION_TIME) {
+      if (commReceive == null) {
+        commReceive = Task.irecv(this.mailbox);
+      }
+      try {
+        if (!commReceive.test()) {
+          if (currentClock >= nextStabilizeDate) {
+            stabilize();
+            nextStabilizeDate = Msg.getClock() + Common.PERIODIC_STABILIZE_DELAY;
+          } else if (currentClock >= nextFixFingersDate) {
+            fixFingers();
+            nextFixFingersDate = Msg.getClock() + Common.PERIODIC_FIX_FINGERS_DELAY;
+          } else if (currentClock >= nextCheckPredecessorDate) {
+            this.checkPredecessor();
+            nextCheckPredecessorDate = Msg.getClock() + Common.PERIODIC_CHECK_PREDECESSOR_DELAY;
+          } else if (currentClock >= nextLookupDate) {
+            this.randomLookup();
+            nextLookupDate = Msg.getClock() + Common.PERIODIC_LOOKUP_DELAY;
           } else {
-            handleTask(commReceive.getTask());
-            currentClock = Msg.getClock();
-            commReceive = null;
+            waitFor(5);
           }
-        }
-        catch (Exception e) {
+          currentClock = Msg.getClock();
+        } else {
+          handleTask(commReceive.getTask());
           currentClock = Msg.getClock();
           commReceive = null;
         }
       }
-      leave();
-      if (commReceive != null) {
+      catch (Exception e) {
+        currentClock = Msg.getClock();
         commReceive = null;
       }
-    } else {
-      Msg.info("I couldn't join the ring");
+    }
+    leave();
+    if (commReceive != null) {
+      commReceive = null;
     }
   }
 
index 82ce689..706c3b9 100644 (file)
@@ -39,11 +39,10 @@ public class Node extends Process {
   }
 
   public void main(String[] args) throws MsgException {
-    String mount;
+    String mount = "/home";
     String fileName;
     switch (rank) {
       case 4:
-        mount = "/home";
         fileName = mount + file1;
       break;
       case 0:
@@ -51,16 +50,14 @@ public class Node extends Process {
         fileName = mount + file2;
       break;
       case 2:
-        mount = "/home";
         fileName = mount + file3;
       break;
       case 1:
-        mount = "/home";
         fileName = mount + file4;
       break;
       default:
-        mount = "/home";
         fileName = mount + file1;
+      break;
     }
 
     Msg.info("Open file " + fileName);
index 959e523..427df2b 100644 (file)
@@ -742,10 +742,9 @@ int is_interested_and_free(peer_t peer, connection_t remote_peer)
 int partially_downloaded_piece(peer_t peer, connection_t remote_peer)
 {
   for (int i = 0; i < FILE_PIECES; i++) {
-    if (peer_has_not_piece(peer, i) && connection_has_piece(remote_peer,i)&& peer_is_not_downloading_piece(peer, i)) {
-      if (get_first_block(peer, i) > 0)
-        return i;
-    }
+    if (peer_has_not_piece(peer, i) && connection_has_piece(remote_peer, i) && peer_is_not_downloading_piece(peer, i) &&
+        get_first_block(peer, i) > 0)
+      return i;
   }
   return -1;
 }
index d39741e..f0d6a6e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2016. 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
@@ -90,7 +90,7 @@ bucket_t routing_table_find_bucket(routing_table_t table, unsigned int id)
 {
   unsigned int xor_number = table->id ^ id;
   unsigned int prefix = get_node_prefix(xor_number, identifier_size);
-  xbt_assert(prefix >= 0 && prefix <= identifier_size, "Tried to return a  bucket that doesn't exist.");
+  xbt_assert(prefix <= identifier_size, "Tried to return a  bucket that doesn't exist.");
   bucket_t bucket = &table->buckets[prefix];
   return bucket;
 }
index 298d92e..0ff51f6 100644 (file)
@@ -2,7 +2,7 @@
 
 ! expect return 1
 ! timeout 20
-$ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/bugged1 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --log=xbt_cfg.thresh:warning --cfg=contexts/stack_size:256
+$ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/bugged1 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --log=xbt_cfg.thresh:warning --cfg=contexts/stack-size:256
 > [  0.000000] (0:maestro@) Check a safety property. Reduction is: dpor.
 > [  0.000000] (2:client@HostB) Sent!
 > [  0.000000] (3:client@HostC) Sent!
index f816cd3..519a86e 100644 (file)
@@ -3,7 +3,7 @@
 ! expect return 2
 ! timeout 20
 ! output ignore
-$ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/bugged1_liveness ${srcdir:=.}/../../platforms/small_platform.xml ${srcdir:=.}/deploy_bugged1_liveness.xml --log=xbt_cfg.thresh:warning "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=contexts/factory:ucontext --cfg=contexts/stack_size:256 --cfg=model-check/property:promela_bugged1_liveness
+$ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/bugged1_liveness ${srcdir:=.}/../../platforms/small_platform.xml ${srcdir:=.}/deploy_bugged1_liveness.xml --log=xbt_cfg.thresh:warning "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=contexts/factory:ucontext --cfg=contexts/stack-size:256 --cfg=model-check/property:promela_bugged1_liveness
 > [  0.000000] (0:maestro@) Check the liveness property promela_bugged1_liveness
 > [  0.000000] (2:client@Boivin) Ask the request
 > [  0.000000] (3:client@Fafard) Ask the request
index cdd83a9..76be52f 100644 (file)
@@ -3,7 +3,7 @@
 ! expect return 2
 ! timeout 20
 ! output ignore
-$ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/bugged1_liveness ${srcdir:=.}/../../platforms/small_platform.xml ${srcdir:=.}/deploy_bugged1_liveness.xml --log=xbt_cfg.thresh:warning "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=contexts/factory:ucontext --cfg=contexts/stack_size:256 --cfg=model-check/sparse-checkpoint:yes --cfg=model-check/property:promela_bugged1_liveness
+$ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/bugged1_liveness ${srcdir:=.}/../../platforms/small_platform.xml ${srcdir:=.}/deploy_bugged1_liveness.xml --log=xbt_cfg.thresh:warning "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=contexts/factory:ucontext --cfg=contexts/stack-size:256 --cfg=model-check/sparse-checkpoint:yes --cfg=model-check/property:promela_bugged1_liveness
 > [  0.000000] (0:maestro@) Check the liveness property promela_bugged1_liveness
 > [  0.000000] (2:client@Boivin) Ask the request
 > [  0.000000] (3:client@Fafard) Ask the request
index a1619a4..09d5f66 100755 (executable)
@@ -34,7 +34,7 @@ run() {
     ${srcdir:=.}/deploy_bugged1_liveness.xml \
     "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" \
     --cfg=contexts/factory:ucontext \
-    --cfg=contexts/stack_size:256
+    --cfg=contexts/stack-size:256
   assert 'test $? = 134'
 }
 
index 20b4b49..8966f6d 100644 (file)
@@ -3,7 +3,7 @@
 ! expect return 2
 ! timeout 20
 ! output ignore
-$ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/bugged1_liveness ${srcdir:=.}/../../platforms/small_platform.xml ${srcdir:=.}/deploy_bugged1_liveness_visited.xml --log=xbt_cfg.thresh:warning "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=contexts/factory:ucontext --cfg=model-check/visited:100 --cfg=contexts/stack_size:256  --cfg=model-check/property:promela_bugged1_liveness
+$ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/bugged1_liveness ${srcdir:=.}/../../platforms/small_platform.xml ${srcdir:=.}/deploy_bugged1_liveness_visited.xml --log=xbt_cfg.thresh:warning "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=contexts/factory:ucontext --cfg=model-check/visited:100 --cfg=contexts/stack-size:256  --cfg=model-check/property:promela_bugged1_liveness
 > [  0.000000] (0:maestro@) Check the liveness property promela_bugged1_liveness
 > [  0.000000] (2:client@Boivin) Ask the request
 > [  0.000000] (3:client@Fafard) Ask the request
index 01f6827..c584098 100644 (file)
@@ -3,7 +3,7 @@
 ! expect return 2
 ! timeout 20
 ! output ignore
-$ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/bugged1_liveness ${srcdir:=.}/../../platforms/small_platform.xml ${srcdir:=.}/deploy_bugged1_liveness_visited.xml --log=xbt_cfg.thresh:warning "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=contexts/factory:ucontext --cfg=model-check/visited:100 --cfg=contexts/stack_size:256 --cfg=model-check/sparse-checkpoint:yes  --cfg=model-check/property:promela_bugged1_liveness
+$ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/bugged1_liveness ${srcdir:=.}/../../platforms/small_platform.xml ${srcdir:=.}/deploy_bugged1_liveness_visited.xml --log=xbt_cfg.thresh:warning "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=contexts/factory:ucontext --cfg=model-check/visited:100 --cfg=contexts/stack-size:256 --cfg=model-check/sparse-checkpoint:yes  --cfg=model-check/property:promela_bugged1_liveness
 > [  0.000000] (0:maestro@) Check the liveness property promela_bugged1_liveness
 > [  0.000000] (2:client@Boivin) Ask the request
 > [  0.000000] (3:client@Fafard) Ask the request
index ba13938..4609e75 100644 (file)
@@ -2,7 +2,7 @@
 
 ! expect return 1
 ! timeout 20
-$ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/bugged2 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --log=xbt_cfg.thresh:warning --cfg=contexts/stack_size:256
+$ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/bugged2 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --log=xbt_cfg.thresh:warning --cfg=contexts/stack-size:256
 > [  0.000000] (0:maestro@) Check a safety property. Reduction is: dpor.
 > [  0.000000] (2:client@HostB) Send 1
 > [  0.000000] (3:client@HostC) Send 2
index 7729c38..d8f74df 100644 (file)
@@ -7,7 +7,7 @@
 /* This example implements one process which receives messages from two other */
 /* processes. There is no bug on it, it is just provided to test the soundness*/
 /* of the state space reduction with DPOR, if the maximum depth (defined with */
-/* --cfg=model-check/max_depth:) is reached.                                  */
+/* --cfg=model-check/max-depth:) is reached.                                  */
 /******************************************************************************/
 
 #include <simgrid/msg.h>
index d537d35..d45d68c 100644 (file)
@@ -20,3 +20,5 @@ $ rm -f viva_graph.plist
 
 p Not tracing user variables
 $ $SG_TEST_EXENV ${bindir:=.}/trace-host-user-variables$EXEEXT ${srcdir:=.}/small_platform.xml ${srcdir:=.}/../msg/app-masterworker/app-masterworker_d.xml
+
+$ rm -f simgrid.trace viva_graph.plist
index ace4e78..a83ddd9 100644 (file)
@@ -59,9 +59,9 @@ if(enable_smpi)
     ADD_TESH(smpi-mc-only-send-determinism --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi/mc --cd ${CMAKE_BINARY_DIR}/examples/smpi/mc ${CMAKE_HOME_DIRECTORY}/examples/smpi/mc/only_send_deterministic.tesh)
   endif()
 
-  ADD_TESH(smpi-tracing        --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/trace/trace.tesh)
-  ADD_TESH(smpi-tracing-simple --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/trace_simple/trace_simple.tesh)
-  ADD_TESH(smpi-tracing-call-location --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/trace_call_location/trace_call_location.tesh)
+  ADD_TESH(smpi-tracing        --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi --cd ${CMAKE_BINARY_DIR}/examples/smpi/trace ${CMAKE_HOME_DIRECTORY}/examples/smpi/trace/trace.tesh)
+  ADD_TESH(smpi-tracing-simple --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi --cd ${CMAKE_BINARY_DIR}/examples/smpi/trace_simple ${CMAKE_HOME_DIRECTORY}/examples/smpi/trace_simple/trace_simple.tesh)
+  ADD_TESH(smpi-tracing-call-location --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi --cd ${CMAKE_BINARY_DIR}/examples/smpi/trace_call_location ${CMAKE_HOME_DIRECTORY}/examples/smpi/trace_call_location/trace_call_location.tesh)
   ADD_TESH(smpi-replay         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/replay.tesh)
   ADD_TESH_FACTORIES(smpi-energy "thread;ucontext;raw;boost" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi/energy --cd ${CMAKE_BINARY_DIR}/examples/smpi/energy ${CMAKE_HOME_DIRECTORY}/examples/smpi/energy/energy.tesh)
 endif()
index 317eecc..2bf4f87 100644 (file)
 /******************************************************************************/
 
 /* Run :
-  /usr/bin/time -f "clock:%e user:%U sys:%S swapped:%W exitval:%x max:%Mk" "$@" ../../../smpi_script/bin/smpirun -hostfile hostfile_bugged1_liveness -platform ../../platforms/cluster.xml --cfg=contexts/factory:ucontext --cfg=model-check/reduction:none --cfg=model-check/property:promela_bugged1_liveness --cfg=smpi/send-is-detached-thresh:0 --cfg=contexts/stack_size:128 --cfg=model-check/visited:100000 --cfg=model-check/max_depth:100000 ./bugged1_liveness */
+  /usr/bin/time -f "clock:%e user:%U sys:%S swapped:%W exitval:%x max:%Mk" "$@" \
+    ../../../smpi_script/bin/smpirun -hostfile hostfile_bugged1_liveness -platform ../../platforms/cluster.xml \
+    --cfg=contexts/factory:ucontext --cfg=model-check/reduction:none \
+    --cfg=model-check/property:promela_bugged1_liveness --cfg=smpi/send-is-detached-thresh:0 \
+    --cfg=contexts/stack-size:128 --cfg=model-check/visited:100000 --cfg=model-check/max-depth:100000 ./bugged1_liveness
+*/
 
 #include <stdio.h>
 #include <mpi.h>
index 03a4db5..a69af43 100644 (file)
@@ -1,7 +1,7 @@
 #! ./tesh
 
 ! timeout 60
-$ ../../../smpi_script/bin/smpirun -wrapper ${bindir:=.}/../../../bin/simgrid-mc -hostfile ${srcdir:=.}/hostfile_non_deterministic  -platform ${srcdir:=.}/../../platforms/cluster.xml --log=xbt_cfg.thresh:warning --cfg=model-check/communications_determinism:1 --cfg=smpi/send-is-detached-thresh:0 --cfg=smpi/host-speed:1e9 ./smpi_non_deterministic
+$ ../../../smpi_script/bin/smpirun -wrapper ${bindir:=.}/../../../bin/simgrid-mc -hostfile ${srcdir:=.}/hostfile_non_deterministic  -platform ${srcdir:=.}/../../platforms/cluster.xml --log=xbt_cfg.thresh:warning --cfg=model-check/communications-determinism:1 --cfg=smpi/send-is-detached-thresh:0 --cfg=smpi/host-speed:1e9 ./smpi_non_deterministic
 > [0.000000] [mc_global/INFO] Check communication determinism
 > [0.000000] [mc_comm_determinism/INFO] The communications pattern of the process 1 is different! (Different communication : 1)
 > [0.000000] [mc_comm_determinism/INFO] ****************************************************
index 99ea34b..74ae1f2 100644 (file)
@@ -1,7 +1,7 @@
 #! ./tesh
 
 ! timeout 60
-$ ../../../smpi_script/bin/smpirun -wrapper "${bindir:=.}/../../../bin/simgrid-mc" --log=xbt_cfg.thresh:warning -hostfile ${srcdir:=.}/hostfile_only_send_deterministic  -platform ${srcdir:=.}/../../platforms/cluster.xml --cfg=model-check/communications_determinism:1 --cfg=smpi/send-is-detached-thresh:0 --cfg=smpi/host-speed:1e9 ./smpi_only_send_deterministic
+$ ../../../smpi_script/bin/smpirun -wrapper "${bindir:=.}/../../../bin/simgrid-mc" --log=xbt_cfg.thresh:warning -hostfile ${srcdir:=.}/hostfile_only_send_deterministic  -platform ${srcdir:=.}/../../platforms/cluster.xml --cfg=model-check/communications-determinism:1 --cfg=smpi/send-is-detached-thresh:0 --cfg=smpi/host-speed:1e9 ./smpi_only_send_deterministic
 > [0.000000] [mc_comm_determinism/INFO] Check communication determinism
 > [0.000000] [mc_comm_determinism/INFO] ******************************************************
 > [0.000000] [mc_comm_determinism/INFO] **** Only-send-deterministic communication pattern ****
index cf33945..bcd9d36 100644 (file)
@@ -3,7 +3,7 @@ if(enable_smpi)
 
   add_executable       (replay_multiple replay_multiple.c)
   target_link_libraries(replay_multiple simgrid)
-  ADD_TESH(smpi-replay-multiple --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple --cd ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple ${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple/replay_multiple.tesh)
+  ADD_TESH(smpi-replay-multiple --setenv srcdir=${CMAKE_CURRENT_SOURCE_DIR} --setenv bindir=${CMAKE_CURRENT_BINARY_DIR} --cd ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/replay_multiple.tesh)
 endif()
 
 set(txt_files     ${txt_files}     ${CMAKE_CURRENT_SOURCE_DIR}/generate_multiple_deployment.sh
index a8816fd..3e2ab0a 100644 (file)
@@ -1,16 +1,14 @@
 p Test the replay with multiple instances 
 
 p first generate the deployment file
-$ ${srcdir:=.}/generate_multiple_deployment.sh -platform ${srcdir:=.}/../../platforms/small_platform_with_routers.xml -hostfile ${srcdir:=.}/../hostfile  ${srcdir:=.}/description_file ${srcdir:=.}/deployment.xml
+$ ${srcdir:=.}/generate_multiple_deployment.sh -platform ${srcdir:=.}/../../platforms/small_platform_with_routers.xml -hostfile ${srcdir:=.}/../hostfile  ${srcdir:=.}/description_file ${bindir:=.}/deployment.xml
 
 p This test needs maxmin/concurrency-limit=100 because it starts 64 hosts on 5 machines.
 ! timeout 120
-$ ./replay_multiple description_file ${srcdir:=.}/../../platforms/small_platform_with_routers.xml ${srcdir:=.}/deployment.xml --log=smpi.:info --cfg=maxmin/concurrency-limit:100
+$ ./replay_multiple description_file ${srcdir:=.}/../../platforms/small_platform_with_routers.xml ${bindir:=.}/deployment.xml --log=smpi.:info --cfg=maxmin/concurrency-limit:100
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/concurrency-limit' to '100'
 > [0.000000] [msg_test/INFO] Initializing instance 1 of size 32
 > [0.000000] [msg_test/INFO] Initializing instance 2 of size 32
 > [0.000000] [smpi_kernel/INFO] You did not set the power of the host running the simulation.  The timings will certainly not be accurate.  Use the option "--cfg=smpi/host-speed:<flops>" to set its value.Check http://simgrid.org/simgrid/latest/doc/options.html#options_smpi_bench for more information.
 > [Jupiter:2:(52) 1140688.493796] [smpi_replay/INFO] Simulation time 1124371.141124
 > [1140688.493796] [msg_test/INFO] Simulation time 1.14069e+06
-
-$ rm -f deployment.xml
index 2578ace..07008d4 100644 (file)
@@ -3,6 +3,6 @@
 # Go for the first test
 
 p Test instrumentation of SMPI
-$ ../../smpi_script/bin/smpirun -trace -trace-resource -trace-file smpi_trace.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../platforms/small_platform.xml --cfg=path:${srcdir:=.}/../msg -np 3 ./trace/smpi_trace --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
+$ ../../../smpi_script/bin/smpirun -trace -trace-resource -trace-file smpi_trace.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../platforms/small_platform.xml --cfg=path:${srcdir:=.}/../msg -np 3 ./smpi_trace --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
 
 $ rm -f smpi_trace.trace
index 8d4be9c..bbffa88 100644 (file)
@@ -4,7 +4,7 @@
 
 p Test SMPI with call-location tracing. This means that the binary must have
 p already been compiled with the -trace-call-location switch.
-$ ../../smpi_script/bin/smpirun -trace -trace-file smpi_trace.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../platforms/small_platform.xml --cfg=smpi/trace-call-location:1 -np 3 ${bindir:=.}/trace_call_location/smpi_trace_call_location --cfg=smpi/host-speed:-1 --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
+$ ../../../smpi_script/bin/smpirun -trace -trace-file smpi_trace.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../platforms/small_platform.xml --cfg=smpi/trace-call-location:1 -np 3 ./smpi_trace_call_location --cfg=smpi/host-speed:-1 --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
 
 $ grep --quiet "12 0.* 2 1 5 .*trace_call_location\.c\" 14$" ./smpi_trace.trace 
 
index 1dddb4e..c3c3773 100644 (file)
@@ -3,22 +3,22 @@
 # Go for the first test
 
 p SMPI test
-$ ../../smpi_script/bin/smpirun -trace -trace-resource -trace-file smpi_trace.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../platforms/small_platform.xml --cfg=path:${srcdir:=.}/../msg -np 3 ./trace_simple/smpi_trace_simple --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
+$ ../../../smpi_script/bin/smpirun -trace -trace-resource -trace-file smpi_trace.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../platforms/small_platform.xml --cfg=path:${srcdir:=.}/../msg -np 3 ./smpi_trace_simple --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
 
 p Another SMPI test, with only -trace
-$ ../../smpi_script/bin/smpirun -trace -trace-file smpi_trace.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../platforms/small_platform.xml --cfg=path:${srcdir:=.}/../msg -np 3 ./trace_simple/smpi_trace_simple --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
+$ ../../../smpi_script/bin/smpirun -trace -trace-file smpi_trace.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../platforms/small_platform.xml --cfg=path:${srcdir:=.}/../msg -np 3 ./smpi_trace_simple --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
 
 p Testing without trace parameters
-$ ../../smpi_script/bin/smpirun -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../platforms/small_platform.xml --cfg=path:${srcdir:=.}/../msg -np 3 ./trace_simple/smpi_trace_simple --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
+$ ../../../smpi_script/bin/smpirun -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../platforms/small_platform.xml --cfg=path:${srcdir:=.}/../msg -np 3 ./smpi_trace_simple --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
 
 p Testing grouped tracing
-$ ../../smpi_script/bin/smpirun -trace -trace-grouped -trace-file smpi_trace.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../platforms/small_platform.xml --cfg=path:${srcdir:=.}/../msg -np 3 ./trace_simple/smpi_trace_simple --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
+$ ../../../smpi_script/bin/smpirun -trace -trace-grouped -trace-file smpi_trace.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../platforms/small_platform.xml --cfg=path:${srcdir:=.}/../msg -np 3 ./smpi_trace_simple --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
 
 p Testing generation of viva configuration files
-$ ../../smpi_script/bin/smpirun -trace -trace-resource -trace-viva -trace-file smpi_trace.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../platforms/small_platform.xml --cfg=path:${srcdir:=.}/../msg --cfg=smpi/simulate-computation:no -np 3 ./trace_simple/smpi_trace_simple --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
+$ ../../../smpi_script/bin/smpirun -trace -trace-resource -trace-viva -trace-file smpi_trace.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../platforms/small_platform.xml --cfg=path:${srcdir:=.}/../msg --cfg=smpi/simulate-computation:no -np 3 ./smpi_trace_simple --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
 > [0.003952] [instr_config/INFO] No categories declared, ignoring generation of viva graph configuration
 
 p Testing with parameters but without activating them with the safe switch (-trace)
-$ ../../smpi_script/bin/smpirun -trace-resource -trace-viva -trace-file smpi_trace.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../platforms/small_platform.xml --cfg=path:${srcdir:=.}/../msg -np 3 ./trace_simple/smpi_trace_simple --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
+$ ../../../smpi_script/bin/smpirun -trace-resource -trace-viva -trace-file smpi_trace.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../platforms/small_platform.xml --cfg=path:${srcdir:=.}/../msg -np 3 ./smpi_trace_simple --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
 
 $ rm -f smpi_trace.trace smpi_uncat.plist smpi_cat.plist
index 777a9f4..766d425 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
@@ -181,7 +181,7 @@ public:
     xbt_assert(this->value_);
     T* result = value_;
     value_ = nullptr;
-    return *value_;
+    return *result;
   }
 
 private:
index 345b584..e13be7c 100644 (file)
@@ -169,35 +169,32 @@ XBT_PUBLIC(const char*) MSG_zone_get_property_value(msg_netzone_t as, const char
 XBT_PUBLIC(void) MSG_zone_set_property_value(msg_netzone_t netzone, const char* name, char* value);
 XBT_PUBLIC(void) MSG_zone_get_hosts(msg_netzone_t zone, xbt_dynar_t whereto);
 
-static inline XBT_ATTRIB_DEPRECATED_v319(
-    "Use MSG_zone_get_root() instead: v3.19 will remove MSG_environment_get_routing_root() completely.") msg_netzone_t
-    MSG_environment_get_routing_root()
+static inline XBT_ATTRIB_DEPRECATED_v319("Use MSG_zone_get_root() instead: v3.19 will turn this warning into an error.")
+    msg_netzone_t MSG_environment_get_routing_root()
 {
   return MSG_zone_get_root();
 }
-static inline XBT_ATTRIB_DEPRECATED_v319(
-    "Use MSG_zone_get_name() instead: v3.19 will remove MSG_environment_as_get_name() completely.") const
-    char* MSG_environment_as_get_name(msg_netzone_t zone)
+static inline XBT_ATTRIB_DEPRECATED_v319("Use MSG_zone_get_name() instead: v3.19 will turn this warning into an error.")
+    const char* MSG_environment_as_get_name(msg_netzone_t zone)
 {
   return MSG_zone_get_name(zone);
 }
 static inline XBT_ATTRIB_DEPRECATED_v319(
-    "Use MSG_zone_get_by_name() instead: v3.19 will remove MSG_environment_as_get_by_name() completely.") msg_netzone_t
+    "Use MSG_zone_get_by_name() instead: v3.19 will turn this warning into an error.") msg_netzone_t
     MSG_environment_as_get_by_name(const char* name)
 {
   return MSG_zone_get_by_name(name);
 }
-static inline XBT_ATTRIB_DEPRECATED_v319(
-    "Use MSG_zone_get_sons() instead: v3.19 will remove MSG_environment_as_get_routing_sons() completely.") xbt_dict_t
-    MSG_environment_as_get_routing_sons(msg_netzone_t zone)
+static inline XBT_ATTRIB_DEPRECATED_v319("Use MSG_zone_get_sons() instead: v3.19 will turn this warning into an error.")
+    xbt_dict_t MSG_environment_as_get_routing_sons(msg_netzone_t zone)
 {
   xbt_dict_t res = xbt_dict_new_homogeneous(NULL);
   MSG_zone_get_sons(zone, res);
   return res;
 }
 static inline XBT_ATTRIB_DEPRECATED_v319(
-    "Use MSG_zone_get_property_value() instead: v3.19 will remove MSG_environment_as_get_property_value() completely.")
-    const char* MSG_environment_as_get_property_value(msg_netzone_t zone, const char* name)
+    "Use MSG_zone_get_property_value() instead: v3.19 will turn this warning into an error.") const
+    char* MSG_environment_as_get_property_value(msg_netzone_t zone, const char* name)
 {
   return MSG_zone_get_property_value(zone, name);
 }
index 99ede18..eef1611 100644 (file)
@@ -269,6 +269,7 @@ public:
   /** Retrieve the property value (or nullptr if not set) */
   const char* getProperty(const char* key);
   void setProperty(const char* key, const char* value);
+  Actor* restart();
 };
 
 /** @ingroup s4u_api
@@ -293,7 +294,8 @@ template <class Rep, class Period> inline void sleep_for(std::chrono::duration<R
     this_actor::sleep_until(timeout_native.time_since_epoch().count());
   }
 
-  XBT_ATTRIB_DEPRECATED_v320("Use sleep_for(): v3.20 will drop sleep() completely.") inline void sleep(double duration)
+  XBT_ATTRIB_DEPRECATED_v320("Use sleep_for(): v3.20 will turn this warning into an error.") inline void sleep(
+      double duration)
   {
     return sleep_for(duration);
   }
@@ -306,12 +308,12 @@ template <class Rep, class Period> inline void sleep_for(std::chrono::duration<R
    * See \ref Comm for the full communication API (including non blocking communications).
    */
   XBT_PUBLIC(void*)
-  XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::get(): v3.20 will remove Actor::recv() completely.") recv(MailboxPtr chan);
+  XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::get(): v3.20 will turn this warning into an error.") recv(MailboxPtr chan);
   XBT_PUBLIC(void*)
-  XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::get(): v3.20 will remove Actor::recv() completely.")
+  XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::get(): v3.20 will turn this warning into an error.")
       recv(MailboxPtr chan, double timeout);
   XBT_PUBLIC(CommPtr)
-  XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::recv_async(): v3.20 will remove Actor::irecv() completely.")
+  XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::recv_async(): v3.20 will turn this warning into an error.")
       irecv(MailboxPtr chan, void** data);
 
   /** Block the actor until it delivers a message of the given simulated size to the given mailbox
@@ -319,14 +321,14 @@ template <class Rep, class Period> inline void sleep_for(std::chrono::duration<R
    * See \ref Comm for the full communication API (including non blocking communications).
   */
   XBT_PUBLIC(void)
-  XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put(): v3.20 will remove Actor::send() completely.")
+  XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put(): v3.20 will turn this warning into an error.")
       send(MailboxPtr chan, void* payload, double simulatedSize); // 3.17
   XBT_PUBLIC(void)
-  XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put(): v3.20 will remove Actor::send() completely.")
+  XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put(): v3.20 will turn this warning into an error.")
       send(MailboxPtr chan, void* payload, double simulatedSize, double timeout); // 3.17
 
   XBT_PUBLIC(CommPtr)
-  XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put_async(): v3.20 will remove Actor::isend() completely.")
+  XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put_async(): v3.20 will turn this warning into an error.")
       isend(MailboxPtr chan, void* payload, double simulatedSize);
 
   /** @brief Returns the actor ID of the current actor (same as pid). */
index c1b27c9..dd4dcc8 100644 (file)
@@ -55,33 +55,31 @@ public:
     return idx;
   }
   /** Creates (but don't start) an async send to the mailbox @p dest */
-  static CommPtr XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put_init(): v3.20 will remove Comm::send_init() completely.")
+  static CommPtr XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put_init(): v3.20 will turn this warning into an error.")
       send_init(MailboxPtr dest)
   {
     return dest->put_init();
   }
   /** Creates (but don't start) an async send to the mailbox @p dest */
-  static CommPtr XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put_init(): v3.20 will remove Comm::send_init() completely.")
+  static CommPtr XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put_init(): v3.20 will turn this warning into an error.")
       send_init(MailboxPtr dest, void* data, int simulatedByteAmount)
   {
     return dest->put_init(data, simulatedByteAmount);
   }
   /** Creates and start an async send to the mailbox @p dest */
-  static CommPtr XBT_ATTRIB_DEPRECATED_v320(
-      "Use Mailbox::put_async(): v3.20 will remove Comm::send_async() completely.")
+  static CommPtr XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put_async(): v3.20 will turn this warning into an error.")
       send_async(MailboxPtr dest, void* data, int simulatedByteAmount)
   {
     return dest->put_async(data, simulatedByteAmount);
   }
   /** Creates (but don't start) an async recv onto the mailbox @p from */
-  static CommPtr XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::get_init(): v3.20 will remove Comm::recv_init() completely.")
+  static CommPtr XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::get_init(): v3.20 will turn this warning into an error.")
       recv_init(MailboxPtr from)
   {
     return from->get_init();
   }
   /** Creates and start an async recv to the mailbox @p from */
-  static CommPtr XBT_ATTRIB_DEPRECATED_v320(
-      "Use Mailbox::get_async(): v3.20 will remove Comm::recv_async() completely.")
+  static CommPtr XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::get_async(): v3.20 will turn this warning into an error.")
       recv_async(MailboxPtr from, void** data)
   {
     return from->get_async(data);
index c40482f..5af3446 100644 (file)
@@ -104,7 +104,10 @@ public:
   void notify_one();
   void notify_all();
 
-  XBT_ATTRIB_DEPRECATED_v319("Use notify_one(): v3.19 will remove notify() completely.") void notify() { notify_one(); }
+  XBT_ATTRIB_DEPRECATED_v319("Use notify_one(): v3.19 will change this warning into an error.") void notify()
+  {
+    notify_one();
+  }
 };
 
 using ConditionVariablePtr = ConditionVariable::Ptr;
index cb9d1ee..fa5ca04 100644 (file)
@@ -71,10 +71,13 @@ public:
   static simgrid::xbt::signal<void(NetZone&)> onSeal;
 
 protected:
-  std::vector<kernel::routing::NetPoint*>
-      vertices_; // our content, as known to our graph routing algorithm (maps vertexId -> vertex)
+  unsigned int getTableSize() { return vertices_.size(); }
+  std::vector<kernel::routing::NetPoint*> getVertices() { return vertices_; }
 
 private:
+  // our content, as known to our graph routing algorithm (maps vertexId -> vertex)
+  std::vector<kernel::routing::NetPoint*> vertices_;
+
   std::unordered_map<std::string, std::string> properties_;
   NetZone* father_ = nullptr;
   char* name_      = nullptr;
index 854e0f9..2ece591 100644 (file)
@@ -38,7 +38,7 @@ public:
 
   xbt_dict_t getProperties();
   const char* getProperty(const char* key);
-  void setProperty(const char* key, char* value);
+  void setProperty(const char* key, const char* value);
   std::map<std::string, sg_size_t>* getContent();
 
   void setUserdata(void* data) { userdata_ = data; }
index 27efe34..55f8ba0 100644 (file)
@@ -158,13 +158,6 @@ XBT_PUBLIC(xbt_dynar_t) SD_daxload(const char *filename);
 XBT_PUBLIC(xbt_dynar_t) SD_dotload(const char *filename);
 XBT_PUBLIC(xbt_dynar_t) SD_dotload_with_sched(const char *filename);
 XBT_PUBLIC(xbt_dynar_t) SD_PTG_dotload(const char *filename);
-#ifdef __cplusplus
-namespace simgrid {
-namespace sd {
-XBT_PUBLIC(std::set<SD_task_t>*) simulate(double how_long);
-}
-}
-#endif
 /** @} */
 
 /* Support some backward compatibility */
@@ -203,4 +196,13 @@ XBT_PUBLIC(std::set<SD_task_t>*) simulate(double how_long);
 //SD_route_get_list
 //TRACE_sd_set_task_category
 SG_END_DECL()
+
+#ifdef __cplusplus
+namespace simgrid {
+namespace sd {
+XBT_PUBLIC(std::set<SD_task_t>*) simulate(double how_long);
+}
+}
+#endif
+
 #endif
index 6921451..e5886a3 100644 (file)
@@ -191,7 +191,7 @@ XBT_PUBLIC(smx_activity_t) simcall_execution_start(const char *name,
                                                 double priority, double bound);
 XBT_PUBLIC(smx_activity_t)
 simcall_execution_parallel_start(const char* name, int host_nb, sg_host_t* host_list, double* flops_amount,
-                                 double* bytes_amount, double amount, double rate, double timeout);
+                                 double* bytes_amount, double rate, double timeout);
 XBT_PUBLIC(void) simcall_execution_cancel(smx_activity_t execution);
 XBT_PUBLIC(void) simcall_execution_set_priority(smx_activity_t execution, double priority);
 XBT_PUBLIC(void) simcall_execution_set_bound(smx_activity_t execution, double bound);
@@ -219,8 +219,6 @@ XBT_PUBLIC(void) simcall_process_set_data(smx_actor_t process, void *data);
 XBT_PUBLIC(xbt_dict_t) simcall_process_get_properties(smx_actor_t host);
 XBT_PUBLIC(void) simcall_process_set_kill_time(smx_actor_t process, double kill_time);
 XBT_PUBLIC(void) simcall_process_on_exit(smx_actor_t process, int_f_pvoid_pvoid_t fun, void *data);
-XBT_PUBLIC(void) simcall_process_auto_restart_set(smx_actor_t process, int auto_restart);
-XBT_PUBLIC(smx_actor_t) simcall_process_restart(smx_actor_t process);
 XBT_PUBLIC(void) simcall_process_join(smx_actor_t process, double timeout);
 /* Sleep control */
 XBT_PUBLIC(e_smx_state_t) simcall_process_sleep(double duration);
@@ -280,13 +278,9 @@ XBT_PUBLIC(void) simcall_cond_wait(smx_cond_t cond, smx_mutex_t mutex);
 XBT_PUBLIC(void) simcall_cond_wait_timeout(smx_cond_t cond, smx_mutex_t mutex, double max_duration);
 XBT_PUBLIC(void) simcall_cond_broadcast(smx_cond_t cond);
 
-XBT_PUBLIC(smx_sem_t) simcall_sem_init(int capacity);
 XBT_PUBLIC(void) SIMIX_sem_destroy(smx_sem_t sem);
-XBT_PUBLIC(void) simcall_sem_release(smx_sem_t sem);
-XBT_PUBLIC(int) simcall_sem_would_block(smx_sem_t sem);
 XBT_PUBLIC(void) simcall_sem_acquire(smx_sem_t sem);
 XBT_PUBLIC(void) simcall_sem_acquire_timeout(smx_sem_t sem, double max_duration);
-XBT_PUBLIC(int) simcall_sem_get_capacity(smx_sem_t sem);
 
 /*****************************   File   **********************************/
 XBT_PUBLIC(sg_size_t) simcall_file_read(surf_file_t fd, sg_size_t size);
index f158d50..5cf36a9 100644 (file)
@@ -24,7 +24,7 @@ class Extension {
   friend class Extendable<T>;
   constexpr Extension(std::size_t id) : id_(id) {}
 public:
-  constexpr Extension() : id_(INVALID_ID) {}
+  explicit constexpr Extension() : id_(INVALID_ID) {}
   std::size_t id() const { return id_; }
   bool valid() { return id_ != INVALID_ID; }
 };
index f1eb29e..fd6edf5 100644 (file)
@@ -55,7 +55,9 @@ typedef struct s_xbt_dictelm {
   xbt_dictelm_t next;
 } s_xbt_dictelm_t;
 
-XBT_PUBLIC(xbt_dict_t) xbt_dict_new();
+XBT_PUBLIC(xbt_dict_t)
+XBT_ATTRIB_DEPRECATED_v319("Use xbt_dict_new_homogeneous(). v3.19 will turn this warning into an error.")
+    xbt_dict_new();
 XBT_PUBLIC(xbt_dict_t) xbt_dict_new_homogeneous(void_f_pvoid_t free_ctn);
 XBT_PUBLIC(void) xbt_dict_free(xbt_dict_t * dict);
 XBT_PUBLIC(unsigned int) xbt_dict_size(xbt_dict_t dict);
index 6e80198..7c826cd 100644 (file)
@@ -72,16 +72,10 @@ public:
     procname_(xbt_procname()),
     pid_(xbt_getpid())
   {}
-  WithContextException(Backtrace bt) :
-    backtrace_(std::move(bt)),
-    procname_(xbt_procname()),
-    pid_(xbt_getpid())
+  explicit WithContextException(Backtrace bt) : backtrace_(std::move(bt)), procname_(xbt_procname()), pid_(xbt_getpid())
   {}
-  WithContextException(ThrowPoint throwpoint, Backtrace bt) :
-    backtrace_(std::move(bt)),
-    procname_(xbt_procname()),
-    pid_(xbt_getpid()),
-    throwpoint_(throwpoint)
+  explicit WithContextException(ThrowPoint throwpoint, Backtrace bt)
+      : backtrace_(std::move(bt)), procname_(xbt_procname()), pid_(xbt_getpid()), throwpoint_(throwpoint)
   {}
   virtual ~WithContextException();
   Backtrace const& backtrace() const
@@ -116,7 +110,7 @@ public:
   WithContext(E exception, WithContextException context) :
     E(std::move(exception)),
     WithContextException(std::move(context)) {}
-  ~WithContext() override {}
+  ~WithContext() override = default;
 };
 
 /** Throw a C++ exception with some context
index 2676857..184e259 100644 (file)
@@ -187,21 +187,15 @@ JNICALL Java_org_simgrid_msg_Process_setAutoRestart (JNIEnv *env, jobject jproce
 
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_restart (JNIEnv *env, jobject jprocess) {
   msg_process_t process = jprocess_to_native(jprocess, env);
-  xbt_ex_t e;
 
   if (not process) {
     jxbt_throw_notbound(env, "process", jprocess);
     return;
   }
 
-  try {
-    MSG_process_restart(process);
-  }
-  catch (xbt_ex& e) {
-    // Nothing to do
-  }
-
+  MSG_process_restart(process);
 }
+
 JNIEXPORT jboolean JNICALL Java_org_simgrid_msg_Process_isSuspended(JNIEnv * env, jobject jprocess)
 {
   msg_process_t process = jprocess_to_native(jprocess, env);
index 4a43c92..6d3b3b9 100644 (file)
@@ -434,9 +434,6 @@ XBT_PUBLIC_DATA(xbt_dict_t) current_property_set;// the prop set for the current
 /* surf parse file related (public because called from a test suite) */
 XBT_PUBLIC(void) parse_platform_file(const char *file);
 
-/* For the trace and trace:connect tag (store their content till the end of the parsing) */
-XBT_PUBLIC_DATA(xbt_dict_t) traces_set_list;
-
 /*
  * Returns the initial path. On Windows the initial path is the current directory for the current process in the other
  * case the function returns "./" that represents the current directory on Unix/Linux platforms.
index 73ab218..1a191c8 100644 (file)
@@ -88,7 +88,7 @@ void ClusterZone::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges
     new_xbt_graph_edge(graph, routerNode, backboneNode, edges);
   }
 
-  for (auto src : vertices_) {
+  for (auto src : getVertices()) {
     if (not src->isRouter()) {
       xbt_node_t previous = new_xbt_graph_node(graph, src->cname(), nodes);
 
index 894aa18..457b0e1 100644 (file)
@@ -32,10 +32,10 @@ FloydZone::~FloydZone()
 {
   if (linkTable_ == nullptr) // Dealing with a parse error in the file?
     return;
-  int table_size = vertices_.size();
+  unsigned int table_size = getTableSize();
   /* Delete link_table */
-  for (int i = 0; i < table_size; i++)
-    for (int j = 0; j < table_size; j++)
+  for (unsigned int i = 0; i < table_size; i++)
+    for (unsigned int j = 0; j < table_size; j++)
       routing_route_free(TO_FLOYD_LINK(i, j));
   xbt_free(linkTable_);
 
@@ -45,7 +45,7 @@ FloydZone::~FloydZone()
 
 void FloydZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t route, double* lat)
 {
-  size_t table_size = vertices_.size();
+  unsigned int table_size = getTableSize();
 
   getRouteCheckParams(src, dst);
 
@@ -87,7 +87,7 @@ void FloydZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg
 void FloydZone::addRoute(sg_platf_route_cbarg_t route)
 {
   /* set the size of table routing */
-  int table_size = static_cast<int>(vertices_.size());
+  unsigned int table_size = getTableSize();
 
   addRouteCheckParams(route);
 
@@ -98,8 +98,8 @@ void FloydZone::addRoute(sg_platf_route_cbarg_t route)
     linkTable_        = xbt_new0(sg_platf_route_cbarg_t, table_size * table_size); /* actual link between src and dst */
 
     /* Initialize costs and predecessors */
-    for (int i = 0; i < table_size; i++)
-      for (int j = 0; j < table_size; j++) {
+    for (unsigned int i = 0; i < table_size; i++)
+      for (unsigned int j = 0; j < table_size; j++) {
         TO_FLOYD_COST(i, j) = DBL_MAX;
         TO_FLOYD_PRED(i, j) = -1;
         TO_FLOYD_LINK(i, j) = nullptr;
@@ -156,7 +156,7 @@ void FloydZone::addRoute(sg_platf_route_cbarg_t route)
 void FloydZone::seal()
 {
   /* set the size of table routing */
-  size_t table_size = vertices_.size();
+  unsigned int table_size = getTableSize();
 
   if (not linkTable_) {
     /* Create Cost, Predecessor and Link tables */
index 89cdec6..7f6a98e 100644 (file)
@@ -20,7 +20,7 @@ FullZone::FullZone(NetZone* father, const char* name) : RoutedZone(father, name)
 
 void FullZone::seal()
 {
-  int table_size = static_cast<int>(vertices_.size());
+  unsigned int table_size = getTableSize();
 
   /* Create table if needed */
   if (not routingTable_)
@@ -28,7 +28,7 @@ void FullZone::seal()
 
   /* Add the loopback if needed */
   if (surf_network_model->loopback_ && hierarchy_ == RoutingMode::base) {
-    for (int i = 0; i < table_size; i++) {
+    for (unsigned int i = 0; i < table_size; i++) {
       sg_platf_route_cbarg_t e_route = TO_ROUTE_FULL(i, i);
       if (not e_route) {
         e_route            = xbt_new0(s_sg_platf_route_cbarg_t, 1);
@@ -45,10 +45,10 @@ void FullZone::seal()
 FullZone::~FullZone()
 {
   if (routingTable_) {
-    int table_size = static_cast<int>(vertices_.size());
+    unsigned int table_size = getTableSize();
     /* Delete routing table */
-    for (int i = 0; i < table_size; i++)
-      for (int j = 0; j < table_size; j++) {
+    for (unsigned int i = 0; i < table_size; i++)
+      for (unsigned int j = 0; j < table_size; j++) {
         if (TO_ROUTE_FULL(i, j)) {
           delete TO_ROUTE_FULL(i, j)->link_list;
           xbt_free(TO_ROUTE_FULL(i, j));
@@ -62,7 +62,7 @@ void FullZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_
 {
   XBT_DEBUG("full getLocalRoute from %s[%d] to %s[%d]", src->cname(), src->id(), dst->cname(), dst->id());
 
-  size_t table_size              = vertices_.size();
+  unsigned int table_size        = getTableSize();
   sg_platf_route_cbarg_t e_route = TO_ROUTE_FULL(src->id(), dst->id());
 
   if (e_route != nullptr) {
@@ -82,7 +82,7 @@ void FullZone::addRoute(sg_platf_route_cbarg_t route)
   NetPoint* dst = route->dst;
   addRouteCheckParams(route);
 
-  size_t table_size = vertices_.size();
+  unsigned int table_size = getTableSize();
 
   if (not routingTable_)
     routingTable_ = xbt_new0(sg_platf_route_cbarg_t, table_size * table_size);
index d947b4a..35f44d8 100644 (file)
@@ -72,8 +72,10 @@ RoutedZone::RoutedZone(NetZone* father, const char* name) : NetZoneImpl(father,
 
 void RoutedZone::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges)
 {
-  for (auto my_src : vertices_) {
-    for (auto my_dst : vertices_) {
+  std::vector<kernel::routing::NetPoint*> vertices = getVertices();
+
+  for (auto my_src : vertices) {
+    for (auto my_dst : vertices) {
       if (my_src == my_dst)
         continue;
 
index 56c33d4..29d624c 100644 (file)
@@ -22,8 +22,7 @@
 
 #include "src/mc/mc_mmu.h"
 
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_page_snapshot, mc,
-                                "Logging specific to mc_page_snapshot");
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_page_snapshot, mc, "Logging specific to mc_page_snapshot");
 
 namespace simgrid {
 namespace mc {
@@ -50,18 +49,14 @@ static XBT_ALWAYS_INLINE PageStore::hash_type mc_hash_page(const void* data)
 
 // ***** snapshot_page_manager
 
-PageStore::PageStore(size_t size) :
-  memory_(nullptr), capacity_(0), top_index_(0)
+PageStore::PageStore(size_t size) : memory_(nullptr), capacity_(size), top_index_(0)
 {
-  // Using mmap in order to be able to expand the region
-  // by relocating it somewhere else in the virtual memory
-  // space:
+  // Using mmap in order to be able to expand the region by relocating it somewhere else in the virtual memory space:
   void* memory = ::mmap(nullptr, size << xbt_pagebits, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_POPULATE, -1, 0);
   if (memory == MAP_FAILED)
     xbt_die("Could not mmap initial snapshot pages.");
 
   this->top_index_ = 0;
-  this->capacity_ = size;
   this->memory_ = memory;
   this->page_counts_.resize(size);
 }
@@ -143,7 +138,6 @@ std::size_t PageStore::alloc_page()
     size_t res = this->free_pages_[this->free_pages_.size() - 1];
     this->free_pages_.pop_back();
     return res;
-
   }
 }
 
@@ -160,8 +154,7 @@ std::size_t PageStore::store_page(void* page)
 {
   xbt_assert(top_index_ <= this->capacity_, "top_index is not consistent");
 
-  // First, we check if a page with the same content is already in the page
-  // store:
+  // First, we check if a page with the same content is already in the page store:
   //  1. compute the hash of the page;
   //  2. find pages with the same hash using `hash_index_`;
   //  3. find a page with the same content.
@@ -173,16 +166,14 @@ std::size_t PageStore::store_page(void* page)
     const void* snapshot_page = this->get_page(pageno);
     if (memcmp(page, snapshot_page, xbt_pagesize) == 0) {
 
-      // If a page with the same content is already in the page store it is
-      // reused and its reference count is incremented.
+      // If a page with the same content is already in the page store it's reused and its refcount is incremented.
       page_counts_[pageno]++;
       return pageno;
 
     }
   }
 
-  // Otherwise, a new page is allocated in the page store and the content
-  // of the page is `memcpy()`-ed to this new page.
+  // Otherwise, a new page is allocated in the page store and the content of the page is `memcpy()`-ed to this new page.
   std::size_t pageno = alloc_page();
   xbt_assert(this->page_counts_[pageno]==0, "Allocated page is already used");
   void* snapshot_page = (void*) this->get_page(pageno);
@@ -227,8 +218,7 @@ XBT_TEST_UNIT("base", test_mc_page_store, "Test adding/removing pages in the sto
 
   xbt_test_add("Init");
   std::size_t pagesize = (size_t) getpagesize();
-  std::unique_ptr<PageStore> store
-    = std::unique_ptr<PageStore>(new simgrid::mc::PageStore(500));
+  std::unique_ptr<PageStore> store = std::unique_ptr<PageStore>(new simgrid::mc::PageStore(500));
   void* data = getpage();
   xbt_test_assert(store->size()==0, "Bad size");
 
index 308a584..a85f282 100644 (file)
@@ -34,7 +34,7 @@ static int snapshot_compare(simgrid::mc::VisitedState* state1, simgrid::mc::Visi
 }
 
 /** @brief Save the current state */
-VisitedState::VisitedState(unsigned long state_number)
+VisitedState::VisitedState(unsigned long state_number) : num(state_number)
 {
   simgrid::mc::RemoteClient* process = &(mc_model_checker->process());
   this->heap_bytes_used = mmalloc_get_bytes_used_remote(
@@ -44,14 +44,9 @@ VisitedState::VisitedState(unsigned long state_number)
   this->actors_count = mc_model_checker->process().actors().size();
 
   this->system_state = simgrid::mc::take_snapshot(state_number);
-  this->num = state_number;
   this->original_num = -1;
 }
 
-VisitedState::~VisitedState()
-{
-}
-
 void VisitedStates::prune()
 {
   while (states_.size() > (std::size_t)_sg_mc_max_visited_states) {
index 3665060..7028f4d 100644 (file)
@@ -25,7 +25,7 @@ struct XBT_PRIVATE VisitedState {
   int original_num = 0; // num field of the VisitedState to which I was declared equal to (used for dot_output)
 
   explicit VisitedState(unsigned long state_number);
-  ~VisitedState();
+  ~VisitedState() = default;
 };
 
 class XBT_PRIVATE VisitedStates {
index 01ab0ac..7cc2f8b 100644 (file)
@@ -39,24 +39,20 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_liveness, mc, "Logging specific to algorithms
 namespace simgrid {
 namespace mc {
 
-VisitedPair::VisitedPair(
-  int pair_num, xbt_automaton_state_t automaton_state,
-  std::shared_ptr<const std::vector<int>> atomic_propositions,
-  std::shared_ptr<simgrid::mc::State> graph_state)
+VisitedPair::VisitedPair(int pair_num, xbt_automaton_state_t automaton_state,
+                         std::shared_ptr<const std::vector<int>> atomic_propositions,
+                         std::shared_ptr<simgrid::mc::State> graph_state)
+    : num(pair_num), automaton_state(automaton_state)
 {
   simgrid::mc::RemoteClient* process = &(mc_model_checker->process());
 
   this->graph_state = std::move(graph_state);
   if(this->graph_state->system_state == nullptr)
     this->graph_state->system_state = simgrid::mc::take_snapshot(pair_num);
-  this->heap_bytes_used = mmalloc_get_bytes_used_remote(
-    process->get_heap()->heaplimit,
-    process->get_malloc_info());
+  this->heap_bytes_used = mmalloc_get_bytes_used_remote(process->get_heap()->heaplimit, process->get_malloc_info());
 
   this->actors_count = mc_model_checker->process().actors().size();
 
-  this->automaton_state = automaton_state;
-  this->num = pair_num;
   this->other_num = -1;
   this->atomic_propositions = std::move(atomic_propositions);
 }
index 2722fc5..16bfff7 100644 (file)
@@ -45,10 +45,10 @@ struct XBT_PRIVATE Pair {
 };
 
 struct XBT_PRIVATE VisitedPair {
-  int num = 0;
+  int num;
   int other_num = 0; /* Dot output for */
   std::shared_ptr<simgrid::mc::State> graph_state = nullptr; /* System state included */
-  xbt_automaton_state_t automaton_state = nullptr;
+  xbt_automaton_state_t automaton_state;
   std::shared_ptr<const std::vector<int>> atomic_propositions;
   std::size_t heap_bytes_used = 0;
   int actors_count            = 0;
index ffcff71..1b57a3f 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
@@ -56,6 +56,7 @@ std::unique_ptr<simgrid::mc::Checker> createChecker(simgrid::mc::Session& sessio
 int main(int argc, char** argv)
 {
   using simgrid::mc::Session;
+  XBT_LOG_CONNECT(mc_main);
 
   try {
     if (argc < 2)
index 90fedff..f3bc7d9 100644 (file)
@@ -155,16 +155,10 @@ bool request_is_visible(smx_simcall_t req)
   xbt_assert(mc_model_checker == nullptr, "This should be called from the client side");
 #endif
 
-  return req->call == SIMCALL_COMM_ISEND
-      || req->call == SIMCALL_COMM_IRECV
-      || req->call == SIMCALL_COMM_WAIT
-      || req->call == SIMCALL_COMM_WAITANY
-      || req->call == SIMCALL_COMM_TEST
-      || req->call == SIMCALL_COMM_TESTANY
-      || req->call == SIMCALL_MC_RANDOM
-      || req->call == SIMCALL_MUTEX_LOCK
-      || req->call == SIMCALL_MUTEX_TRYLOCK
-      ;
+  return req->call == SIMCALL_COMM_ISEND || req->call == SIMCALL_COMM_IRECV || req->call == SIMCALL_COMM_WAIT ||
+         req->call == SIMCALL_COMM_WAITANY || req->call == SIMCALL_COMM_TEST || req->call == SIMCALL_COMM_TESTANY ||
+         req->call == SIMCALL_MC_RANDOM || req->call == SIMCALL_MUTEX_LOCK || req->call == SIMCALL_MUTEX_TRYLOCK ||
+         req->call == SIMCALL_MUTEX_UNLOCK;
 }
 
 }
index 03a47e5..1b1c7c1 100644 (file)
@@ -34,34 +34,28 @@ static XBT_ALWAYS_INLINE void* mc_translate_address_region_chunked(uintptr_t add
 static XBT_ALWAYS_INLINE void* mc_translate_address_region(uintptr_t addr, mc_mem_region_t region, int process_index)
 {
   switch (region->storage_type()) {
-  case simgrid::mc::StorageType::NoData:
-  default:
-    xbt_die("Storage type not supported");
-
   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);
+    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:
+      xbt_die("Storage type not supported");
   }
 }
 
-XBT_PRIVATE mc_mem_region_t mc_get_snapshot_region(
-  const void* addr, const simgrid::mc::Snapshot *snapshot, int process_index);
-
+XBT_PRIVATE mc_mem_region_t mc_get_snapshot_region(const void* addr, const simgrid::mc::Snapshot* snapshot,
+                                                   int process_index);
 }
 
 // ***** MC Snapshot
@@ -74,18 +68,16 @@ XBT_PRIVATE mc_mem_region_t mc_get_snapshot_region(
 typedef struct s_mc_snapshot_ignored_data {
   void* start;
   std::vector<char> data;
-} s_mc_snapshot_ignored_data_t, *mc_snapshot_ignored_data_t;
+} s_mc_snapshot_ignored_data_t;
 
 typedef struct s_fd_infos{
   std::string filename;
   int number;
   off_t current_position;
   int flags;
-}s_fd_infos_t, *fd_infos_t;
+} s_fd_infos_t;
 
-/** Information about a given stack frame
- *
- */
+/** Information about a given stack frame */
 typedef struct s_mc_stack_frame {
   /** Instruction pointer */
   unw_word_t ip;
@@ -95,7 +87,8 @@ typedef struct s_mc_stack_frame {
   simgrid::mc::Frame* frame;
   std::string frame_name;
   unw_cursor_t unw_cursor;
-} s_mc_stack_frame_t, *mc_stack_frame_t;
+} s_mc_stack_frame_t;
+typedef s_mc_stack_frame_t* mc_stack_frame_t;
 
 typedef struct s_local_variable{
   simgrid::mc::Frame* subprogram;
@@ -104,7 +97,8 @@ typedef struct s_local_variable{
   simgrid::mc::Type* type;
   void *address;
   int region;
-} s_local_variable_t, *local_variable_t;
+} s_local_variable_t;
+typedef s_local_variable_t* local_variable_t;
 
 typedef struct XBT_PRIVATE s_mc_snapshot_stack {
   std::vector<s_local_variable> local_variables;
@@ -123,7 +117,8 @@ public:
   const void* read_bytes(void* buffer, std::size_t size,
     RemotePtr<void> address, int process_index = ProcessIndexAny,
     ReadOptions options = ReadOptions::none()) const override;
-public: // To be private
+
+  // To be private
   int num_state;
   std::size_t heap_bytes_used;
   std::vector<std::unique_ptr<s_mc_mem_region_t>> snapshot_regions;
index 94ef188..1a36d31 100644 (file)
@@ -26,14 +26,13 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_state, mc, "Logging specific to MC (state)");
 namespace simgrid {
 namespace mc {
 
-State::State(unsigned long state_number)
+State::State(unsigned long state_number) : num(state_number)
 {
   this->internal_comm.clear();
   std::memset(&this->internal_req, 0, sizeof(this->internal_req));
   std::memset(&this->executed_req, 0, sizeof(this->executed_req));
 
   actorStates.resize(MC_smx_get_maxpid());
-  num = state_number;
   /* Stateful model checking */
   if ((_sg_mc_checkpoint > 0 && (state_number % _sg_mc_checkpoint == 0)) || _sg_mc_termination) {
     system_state = simgrid::mc::take_snapshot(num);
@@ -46,8 +45,7 @@ State::State(unsigned long state_number)
 
 std::size_t State::interleaveSize() const
 {
-  return boost::range::count_if(this->actorStates,
-    [](simgrid::mc::ProcessState const& p) { return p.isTodo(); });
+  return boost::range::count_if(this->actorStates, [](simgrid::mc::ProcessState const& p) { return p.isTodo(); });
 }
 
 Transition State::getTransition() const
@@ -67,12 +65,10 @@ Transition State::getTransition() const
  *  - which simcall can currently be executed (like a comm where the other partner is already known)
  * Once we returned the last enabled transition of a process, it is marked done.
  *
- * Things can get muddled with the WAITANY and TESTANY simcalls, that are rewritten
- * on the fly to a bunch of WAIT (resp TEST) transitions using the transition.argument
- * field to remember what was the last returned sub-transition.
+ * Things can get muddled with the WAITANY and TESTANY simcalls, that are rewritten on the fly to a bunch of WAIT
+ * (resp TEST) transitions using the transition.argument field to remember what was the last returned sub-transition.
  */
-static inline smx_simcall_t MC_state_get_request_for_process(
-  simgrid::mc::State* state, smx_actor_t actor)
+static inline smx_simcall_t MC_state_get_request_for_process(simgrid::mc::State* state, smx_actor_t actor)
 {
   /* reset the outgoing transition */
   simgrid::mc::ProcessState* procstate = &state->actorStates[actor->pid];
@@ -85,80 +81,74 @@ static inline smx_simcall_t MC_state_get_request_for_process(
 
   smx_simcall_t req = nullptr;
   switch (actor->simcall.call) {
-      case SIMCALL_COMM_WAITANY:
-        state->transition.argument = -1;
-        while (procstate->times_considered <
-              read_length(mc_model_checker->process(),
-                remote(simcall_comm_waitany__get__comms(&actor->simcall)))) {
-          if (simgrid::mc::request_is_enabled_by_idx(&actor->simcall,
-              procstate->times_considered++)) {
-            state->transition.argument = procstate->times_considered - 1;
-            break;
-          }
+    case SIMCALL_COMM_WAITANY:
+      state->transition.argument = -1;
+      while (procstate->times_considered <
+             read_length(mc_model_checker->process(), remote(simcall_comm_waitany__get__comms(&actor->simcall)))) {
+        if (simgrid::mc::request_is_enabled_by_idx(&actor->simcall, procstate->times_considered++)) {
+          state->transition.argument = procstate->times_considered - 1;
+          break;
         }
-
-        if (procstate->times_considered >=
-            simgrid::mc::read_length(mc_model_checker->process(),
-              simgrid::mc::remote(simcall_comm_waitany__get__comms(&actor->simcall))))
-          procstate->setDone();
-        if (state->transition.argument != -1)
-          req = &actor->simcall;
-        break;
-
-      case SIMCALL_COMM_TESTANY: {
-        unsigned start_count = procstate->times_considered;
-        state->transition.argument = -1;
-        while (procstate->times_considered <
-                simcall_comm_testany__get__count(&actor->simcall))
-          if (simgrid::mc::request_is_enabled_by_idx(&actor->simcall,
-              procstate->times_considered++)) {
-            state->transition.argument = procstate->times_considered - 1;
-            break;
-          }
-
-        if (procstate->times_considered >=
-            simcall_comm_testany__get__count(&actor->simcall))
-          procstate->setDone();
-
-        if (state->transition.argument != -1 || start_count == 0)
-           req = &actor->simcall;
-
-        break;
       }
 
-      case SIMCALL_COMM_WAIT: {
-        simgrid::mc::RemotePtr<simgrid::kernel::activity::CommImpl> remote_act =
-            remote(static_cast<simgrid::kernel::activity::CommImpl*>(simcall_comm_wait__getraw__comm(&actor->simcall)));
-        simgrid::mc::Remote<simgrid::kernel::activity::CommImpl> temp_act;
-        mc_model_checker->process().read(temp_act, remote_act);
-        simgrid::kernel::activity::CommImpl* act = temp_act.getBuffer();
-        if (act->src_proc && act->dst_proc)
-          state->transition.argument = 0;
-        else if (act->src_proc == nullptr && act->type == SIMIX_COMM_READY
-              && act->detached == 1)
-          state->transition.argument = 0;
-        else
-          state->transition.argument = -1;
+      if (procstate->times_considered >=
+          simgrid::mc::read_length(mc_model_checker->process(),
+                                   simgrid::mc::remote(simcall_comm_waitany__get__comms(&actor->simcall))))
         procstate->setDone();
+      if (state->transition.argument != -1)
         req = &actor->simcall;
-        break;
-      }
+      break;
+
+    case SIMCALL_COMM_TESTANY: {
+      unsigned start_count       = procstate->times_considered;
+      state->transition.argument = -1;
+      while (procstate->times_considered < simcall_comm_testany__get__count(&actor->simcall))
+        if (simgrid::mc::request_is_enabled_by_idx(&actor->simcall, procstate->times_considered++)) {
+          state->transition.argument = procstate->times_considered - 1;
+          break;
+        }
+
+      if (procstate->times_considered >= simcall_comm_testany__get__count(&actor->simcall))
+        procstate->setDone();
 
-      case SIMCALL_MC_RANDOM: {
-        int min_value = simcall_mc_random__get__min(&actor->simcall);
-        state->transition.argument = procstate->times_considered + min_value;
-        procstate->times_considered++;
-        if (state->transition.argument == simcall_mc_random__get__max(&actor->simcall))
-          procstate->setDone();
+      if (state->transition.argument != -1 || start_count == 0)
         req = &actor->simcall;
-        break;
-      }
 
-      default:
-        procstate->setDone();
+      break;
+    }
+
+    case SIMCALL_COMM_WAIT: {
+      simgrid::mc::RemotePtr<simgrid::kernel::activity::CommImpl> remote_act =
+          remote(static_cast<simgrid::kernel::activity::CommImpl*>(simcall_comm_wait__getraw__comm(&actor->simcall)));
+      simgrid::mc::Remote<simgrid::kernel::activity::CommImpl> temp_act;
+      mc_model_checker->process().read(temp_act, remote_act);
+      simgrid::kernel::activity::CommImpl* act = temp_act.getBuffer();
+      if (act->src_proc && act->dst_proc)
         state->transition.argument = 0;
-        req = &actor->simcall;
-        break;
+      else if (act->src_proc == nullptr && act->type == SIMIX_COMM_READY && act->detached == 1)
+        state->transition.argument = 0;
+      else
+        state->transition.argument = -1;
+      procstate->setDone();
+      req = &actor->simcall;
+      break;
+    }
+
+    case SIMCALL_MC_RANDOM: {
+      int min_value              = simcall_mc_random__get__min(&actor->simcall);
+      state->transition.argument = procstate->times_considered + min_value;
+      procstate->times_considered++;
+      if (state->transition.argument == simcall_mc_random__get__max(&actor->simcall))
+        procstate->setDone();
+      req = &actor->simcall;
+      break;
+    }
+
+    default:
+      procstate->setDone();
+      state->transition.argument = 0;
+      req                        = &actor->simcall;
+      break;
   }
   if (not req)
     return nullptr;
@@ -168,9 +158,8 @@ static inline smx_simcall_t MC_state_get_request_for_process(
   // Fetch the data of the request and translate it:
   state->internal_req = *req;
 
-  /* The waitany and testany request are transformed into a wait or test request
-   * over the corresponding communication action so it can be treated later by
-   * the dependence function. */
+  /* The waitany and testany request are transformed into a wait or test request over the corresponding communication
+   * action so it can be treated later by the dependence function. */
   switch (req->call) {
   case SIMCALL_COMM_WAITANY: {
     state->internal_req.call = SIMCALL_COMM_WAIT;
index 53ea92d..feb9577 100644 (file)
@@ -70,7 +70,7 @@ msg_error_t MSG_parallel_task_execute_with_timeout(msg_task_t task, double timeo
       simdata->compute =
           boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(simcall_execution_parallel_start(
               task->name, simdata->host_nb, simdata->host_list, simdata->flops_parallel_amount,
-              simdata->bytes_parallel_amount, 1.0, -1.0, timeout));
+              simdata->bytes_parallel_amount, -1.0, timeout));
       XBT_DEBUG("Parallel execution action created: %p", simdata->compute.get());
     } else {
       simdata->compute = boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(
index af044f0..b3ea3c9 100644 (file)
@@ -189,7 +189,7 @@ void MSG_process_detach()
  */
 void MSG_process_kill(msg_process_t process)
 {
-  simcall_process_kill(process->getImpl());
+  process->kill();
 }
 
 /**
@@ -464,14 +464,14 @@ void MSG_process_on_exit(int_f_pvoid_pvoid_t fun, void *data) {
  * If the flag is set to 1, the process will be automatically restarted when its host comes back up.
  */
 XBT_PUBLIC(void) MSG_process_auto_restart_set(msg_process_t process, int auto_restart) {
-  simcall_process_auto_restart_set(process->getImpl(), auto_restart);
+  process->setAutoRestart(auto_restart);
 }
 /**
  * \ingroup m_process_management
  * \brief Restarts a process from the beginning.
  */
 XBT_PUBLIC(msg_process_t) MSG_process_restart(msg_process_t process) {
-  return simcall_process_restart(process->getImpl())->ciface();
+  return process->restart();
 }
 
 /** @ingroup m_process_management
index bf625ec..827c481 100644 (file)
@@ -7,6 +7,7 @@
 #include "xbt/ex.hpp"
 
 #include "msg_private.h"
+#include "src/simix/smx_private.h"
 #include "xbt/synchro.h"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_synchro, msg, "Logging specific to MSG (synchro)");
@@ -18,7 +19,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_synchro, msg, "Logging specific to MSG (sync
 
 /** @brief creates a semaphore object of the given initial capacity */
 msg_sem_t MSG_sem_init(int initial_value) {
-  return simcall_sem_init(initial_value);
+  return simgrid::simix::kernelImmediate([initial_value] { return SIMIX_sem_init(initial_value); });
 }
 
 /** @brief locks on a semaphore object */
@@ -41,11 +42,11 @@ msg_error_t MSG_sem_acquire_timeout(msg_sem_t sem, double timeout) {
 
 /** @brief releases the semaphore object */
 void MSG_sem_release(msg_sem_t sem) {
-  simcall_sem_release(sem);
+  simgrid::simix::kernelImmediate([sem] { SIMIX_sem_release(sem); });
 }
 
 int MSG_sem_get_capacity(msg_sem_t sem) {
-  return simcall_sem_get_capacity(sem);
+  return simgrid::simix::kernelImmediate([sem] { return SIMIX_sem_get_capacity(sem); });
 }
 
 void MSG_sem_destroy(msg_sem_t sem) {
@@ -58,7 +59,7 @@ void MSG_sem_destroy(msg_sem_t sem) {
  * But that's a classical semaphore issue, and SimGrid's semaphore are not different to usual ones here.
  */
 int MSG_sem_would_block(msg_sem_t sem) {
-  return simcall_sem_would_block(sem);
+  return simgrid::simix::kernelImmediate([sem] { return SIMIX_sem_would_block(sem); });
 }
 
 /*-**** barrier related functions ****-*/
index 3d8a38e..6b6f2ef 100644 (file)
@@ -62,7 +62,7 @@ void Actor::join() {
 }
 
 void Actor::setAutoRestart(bool autorestart) {
-  simcall_process_auto_restart_set(pimpl_,autorestart);
+  simgrid::simix::kernelImmediate([this, autorestart]() { pimpl_->auto_restart = autorestart; });
 }
 
 void Actor::onExit(int_f_pvoid_pvoid_t fun, void* data)
@@ -184,6 +184,11 @@ void Actor::setProperty(const char* key, const char* value)
   });
 }
 
+Actor* Actor::restart()
+{
+  return simgrid::simix::kernelImmediate([this]() { return pimpl_->restart(); });
+}
+
 // ***** this_actor *****
 
 namespace this_actor {
@@ -222,31 +227,32 @@ void execute(double flops)
   simcall_execution_wait(s);
 }
 
-void* recv(MailboxPtr chan) {
+void* recv(MailboxPtr chan) // deprecated
+{
   return chan->get();
 }
 
-void* recv(MailboxPtr chan, double timeout)
+void* recv(MailboxPtr chan, double timeout) // deprecated
 {
   return chan->get(timeout);
 }
 
-void send(MailboxPtr chan, void* payload, double simulatedSize)
+void send(MailboxPtr chan, void* payload, double simulatedSize) // deprecated
 {
   chan->put(payload, simulatedSize);
 }
 
-void send(MailboxPtr chan, void* payload, double simulatedSize, double timeout)
+void send(MailboxPtr chan, void* payload, double simulatedSize, double timeout) // deprecated
 {
   chan->put(payload, simulatedSize, timeout);
 }
 
-CommPtr isend(MailboxPtr chan, void* payload, double simulatedSize)
+CommPtr isend(MailboxPtr chan, void* payload, double simulatedSize) // deprecated
 {
   return chan->put_async(payload, simulatedSize);
 }
 
-CommPtr irecv(MailboxPtr chan, void** data)
+CommPtr irecv(MailboxPtr chan, void** data) // deprecated
 {
   return chan->get_async(data);
 }
index f746562..74770d9 100644 (file)
@@ -70,7 +70,7 @@ const char* Storage::getProperty(const char* key)
   return this->pimpl_->getProperty(key);
 }
 
-void Storage::setProperty(const char* key, char* value)
+void Storage::setProperty(const char* key, const char* value)
 {
   simgrid::simix::kernelImmediate([this, key, value] { this->pimpl_->setProperty(key, value); });
 }
index c3c0666..978210a 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009-2010, 2012-2015. The SimGrid Team.
+/* Copyright (c) 2009-2010, 2012-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -457,7 +457,7 @@ void sg_config_init(int *argc, char **argv)
     xbt_cfg_register_boolean("network/crosstraffic", "yes", _sg_cfg_cb__surf_network_crosstraffic,
         "Activate the interferences between uploads and downloads for fluid max-min models (LV08, CM02)");
 
-    //For smpi/bw_factor and smpi/lat_factor
+    // For smpi/bw-factor and smpi/lat-factor
     // SMPI model can be used without enable_smpi, so keep this out of the ifdef.
     xbt_cfg_register_string("smpi/bw-factor",
         "65472:0.940694;15424:0.697866;9376:0.58729;5776:1.08739;3484:0.77493;1426:0.608902;732:0.341987;257:0.338112;0:0.812084", nullptr,
index f9b0f73..25902ce 100644 (file)
@@ -167,7 +167,7 @@ void ActorImpl::daemonize()
   }
 }
 
-ActorImpl* ActorImpl::restart(ActorImpl* issuer)
+simgrid::s4u::Actor* ActorImpl::restart()
 {
   XBT_DEBUG("Restarting process %s on %s", cname(), host->getCname());
 
@@ -183,7 +183,7 @@ ActorImpl* ActorImpl::restart(ActorImpl* issuer)
   arg.auto_restart = auto_restart;
 
   // kill the old process
-  SIMIX_process_kill(this, issuer);
+  SIMIX_process_kill(this, this);
 
   // start the new process
   ActorImpl* actor = simix_global->create_process_function(arg.name.c_str(), std::move(arg.code), arg.data, arg.host,
@@ -191,9 +191,9 @@ ActorImpl* ActorImpl::restart(ActorImpl* issuer)
   if (arg.kill_time >= 0)
     simcall_process_set_kill_time(actor, arg.kill_time);
   if (arg.auto_restart)
-    simcall_process_auto_restart_set(actor, arg.auto_restart);
+    actor->auto_restart = arg.auto_restart;
 
-  return actor;
+  return actor->ciface();
 }
 
 smx_activity_t ActorImpl::suspend(ActorImpl* issuer)
@@ -755,8 +755,7 @@ void SIMIX_process_sleep_destroy(smx_activity_t synchro)
 /**
  * \brief Calling this function makes the process to yield.
  *
- * Only the current process can call this function, giving back the control to
- * maestro.
+ * Only the current process can call this function, giving back the control to maestro.
  *
  * \param self the current process
  */
@@ -815,17 +814,13 @@ void SIMIX_process_exception_terminate(xbt_ex_t * e)
   xbt_abort();
 }
 
-/**
- * \brief Returns the list of processes to run.
- */
+/** @brief Returns the list of processes to run. */
 xbt_dynar_t SIMIX_process_get_runnable()
 {
   return simix_global->process_to_run;
 }
 
-/**
- * \brief Returns the process from PID.
- */
+/** @brief Returns the process from PID. */
 smx_actor_t SIMIX_process_from_PID(aid_t PID)
 {
   if (simix_global->process_list.find(PID) == simix_global->process_list.end())
@@ -862,17 +857,12 @@ void SIMIX_process_on_exit(smx_actor_t process, int_f_pvoid_pvoid_t fun, void *d
 
 /**
  * \brief Sets the auto-restart status of the process.
- * If set to 1, the process will be automatically restarted when its host
- * comes back.
+ * If set to 1, the process will be automatically restarted when its host comes back.
  */
 void SIMIX_process_auto_restart_set(smx_actor_t process, int auto_restart) {
   process->auto_restart = auto_restart;
 }
 
-smx_actor_t simcall_HANDLER_process_restart(smx_simcall_t simcall, smx_actor_t process) {
-  return process->restart(simcall->issuer);
-}
-
 /** @brief Restart a process, starting it again from the beginning. */
 /**
  * \ingroup simix_process_management
index 6baac2c..952546b 100644 (file)
@@ -106,7 +106,7 @@ public:
   void daemonize();
   bool isDaemon() { return daemon; } /** Whether this actor has been daemonized */
   bool isSuspended() { return suspended; }
-  ActorImpl* restart(ActorImpl* issuer);
+  simgrid::s4u::Actor* restart();
   smx_activity_t suspend(ActorImpl* issuer);
   void resume();
   smx_activity_t sleep(double duration);
index f05e1f1..15aeec6 100644 (file)
@@ -84,8 +84,7 @@ smx_activity_t simcall_execution_start(const char *name,
  * \return A new SIMIX execution synchronization
  */
 smx_activity_t simcall_execution_parallel_start(const char* name, int host_nb, sg_host_t* host_list,
-                                                double* flops_amount, double* bytes_amount, double amount, double rate,
-                                                double timeout)
+                                                double* flops_amount, double* bytes_amount, double rate, double timeout)
 {
   /* checking for infinite values */
   for (int i = 0 ; i < host_nb ; ++i) {
@@ -98,11 +97,9 @@ smx_activity_t simcall_execution_parallel_start(const char* name, int host_nb, s
     }
   }
 
-  xbt_assert(std::isfinite(amount), "amount is not finite!");
   xbt_assert(std::isfinite(rate), "rate is not finite!");
 
-  return simcall_BODY_execution_parallel_start(name, host_nb, host_list, flops_amount, bytes_amount, amount, rate,
-                                               timeout);
+  return simcall_BODY_execution_parallel_start(name, host_nb, host_list, flops_amount, bytes_amount, rate, timeout);
 }
 
 /**
@@ -267,25 +264,7 @@ XBT_PUBLIC(void) simcall_process_on_exit(smx_actor_t process, int_f_pvoid_pvoid_
 {
   simcall_BODY_process_on_exit(process, fun, data);
 }
-/**
- * \ingroup simix_process_management
- * \brief Sets the process to be auto-restarted or not by SIMIX when its host comes back up.
- * Will restart the process when the host comes back up if auto_restart is set to 1.
- */
-
-XBT_PUBLIC(void) simcall_process_auto_restart_set(smx_actor_t process, int auto_restart)
-{
-  simcall_BODY_process_auto_restart_set(process, auto_restart);
-}
 
-/**
- * \ingroup simix_process_management
- * \brief Restarts the process, killing it and starting it again from scratch.
- */
-XBT_PUBLIC(smx_actor_t) simcall_process_restart(smx_actor_t process)
-{
-  return (smx_actor_t) simcall_BODY_process_restart(process);
-}
 /**
  * \ingroup simix_process_management
  * \brief Creates a new sleep SIMIX synchro.
@@ -472,7 +451,7 @@ smx_mutex_t simcall_mutex_init()
     fprintf(stderr,"You must run MSG_init before using MSG\n"); // We can't use xbt_die since we may get there before the initialization
     xbt_abort();
   }
-  return simcall_BODY_mutex_init();
+  return simgrid::simix::kernelImmediate([] { return new simgrid::simix::MutexImpl(); });
 }
 
 /**
@@ -550,33 +529,6 @@ void simcall_cond_broadcast(smx_cond_t cond)
   simcall_BODY_cond_broadcast(cond);
 }
 
-/**
- * \ingroup simix_synchro_management
- *
- */
-smx_sem_t simcall_sem_init(int capacity)
-{
-  return simcall_BODY_sem_init(capacity);
-}
-
-/**
- * \ingroup simix_synchro_management
- *
- */
-void simcall_sem_release(smx_sem_t sem)
-{
-  simcall_BODY_sem_release(sem);
-}
-
-/**
- * \ingroup simix_synchro_management
- *
- */
-int simcall_sem_would_block(smx_sem_t sem)
-{
-  return simcall_BODY_sem_would_block(sem);
-}
-
 /**
  * \ingroup simix_synchro_management
  *
@@ -596,15 +548,6 @@ void simcall_sem_acquire_timeout(smx_sem_t sem, double timeout)
   simcall_BODY_sem_acquire_timeout(sem, timeout);
 }
 
-/**
- * \ingroup simix_synchro_management
- *
- */
-int simcall_sem_get_capacity(smx_sem_t sem)
-{
-  return simcall_BODY_sem_get_capacity(sem);
-}
-
 /**
  * \ingroup simix_file_management
  *
index 1966f28..d16dc06 100644 (file)
@@ -251,41 +251,29 @@ static inline void simcall_execution_parallel_start__set__bytes_amount(smx_simca
 {
   simgrid::simix::marshal<double*>(simcall->args[4], arg);
 }
-static inline double simcall_execution_parallel_start__get__amount(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal<double>(simcall->args[5]);
-}
-static inline double simcall_execution_parallel_start__getraw__amount(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal_raw<double>(simcall->args[5]);
-}
-static inline void simcall_execution_parallel_start__set__amount(smx_simcall_t simcall, double arg)
-{
-  simgrid::simix::marshal<double>(simcall->args[5], arg);
-}
 static inline double simcall_execution_parallel_start__get__rate(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<double>(simcall->args[6]);
+  return simgrid::simix::unmarshal<double>(simcall->args[5]);
 }
 static inline double simcall_execution_parallel_start__getraw__rate(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<double>(simcall->args[6]);
+  return simgrid::simix::unmarshal_raw<double>(simcall->args[5]);
 }
 static inline void simcall_execution_parallel_start__set__rate(smx_simcall_t simcall, double arg)
 {
-  simgrid::simix::marshal<double>(simcall->args[6], arg);
+  simgrid::simix::marshal<double>(simcall->args[5], arg);
 }
 static inline double simcall_execution_parallel_start__get__timeout(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<double>(simcall->args[7]);
+  return simgrid::simix::unmarshal<double>(simcall->args[6]);
 }
 static inline double simcall_execution_parallel_start__getraw__timeout(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<double>(simcall->args[7]);
+  return simgrid::simix::unmarshal_raw<double>(simcall->args[6]);
 }
 static inline void simcall_execution_parallel_start__set__timeout(smx_simcall_t simcall, double arg)
 {
-  simgrid::simix::marshal<double>(simcall->args[7], arg);
+  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)
@@ -443,55 +431,6 @@ static inline void simcall_process_on_exit__set__data(smx_simcall_t simcall, voi
   simgrid::simix::marshal<void*>(simcall->args[2], arg);
 }
 
-static inline smx_actor_t simcall_process_auto_restart_set__get__process(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
-}
-static inline smx_actor_t simcall_process_auto_restart_set__getraw__process(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->args[0]);
-}
-static inline void simcall_process_auto_restart_set__set__process(smx_simcall_t simcall, smx_actor_t arg)
-{
-  simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
-}
-static inline int simcall_process_auto_restart_set__get__auto_restart(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal<int>(simcall->args[1]);
-}
-static inline int simcall_process_auto_restart_set__getraw__auto_restart(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal_raw<int>(simcall->args[1]);
-}
-static inline void simcall_process_auto_restart_set__set__auto_restart(smx_simcall_t simcall, int arg)
-{
-  simgrid::simix::marshal<int>(simcall->args[1], arg);
-}
-
-static inline smx_actor_t simcall_process_restart__get__process(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
-}
-static inline smx_actor_t simcall_process_restart__getraw__process(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->args[0]);
-}
-static inline void simcall_process_restart__set__process(smx_simcall_t simcall, smx_actor_t arg)
-{
-  simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
-}
-static inline smx_actor_t simcall_process_restart__get__result(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal<smx_actor_t>(simcall->result);
-}
-static inline smx_actor_t simcall_process_restart__getraw__result(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->result);
-}
-static inline void simcall_process_restart__set__result(smx_simcall_t simcall, smx_actor_t result){
-    simgrid::simix::marshal<smx_actor_t>(simcall->result, result);
-}
-
 static inline smx_mailbox_t simcall_comm_iprobe__get__mbox(smx_simcall_t simcall)
 {
   return simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[0]);
@@ -1171,18 +1110,6 @@ static inline void simcall_comm_testany__set__result(smx_simcall_t simcall, int
     simgrid::simix::marshal<int>(simcall->result, result);
 }
 
-static inline smx_mutex_t simcall_mutex_init__get__result(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal<smx_mutex_t>(simcall->result);
-}
-static inline smx_mutex_t simcall_mutex_init__getraw__result(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal_raw<smx_mutex_t>(simcall->result);
-}
-static inline void simcall_mutex_init__set__result(smx_simcall_t simcall, smx_mutex_t result){
-    simgrid::simix::marshal<smx_mutex_t>(simcall->result, result);
-}
-
 static inline smx_mutex_t simcall_mutex_lock__get__mutex(smx_simcall_t simcall)
 {
   return simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[0]);
@@ -1333,67 +1260,6 @@ static inline void simcall_cond_broadcast__set__cond(smx_simcall_t simcall, smx_
   simgrid::simix::marshal<smx_cond_t>(simcall->args[0], arg);
 }
 
-static inline unsigned int simcall_sem_init__get__capacity(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal<unsigned int>(simcall->args[0]);
-}
-static inline unsigned int simcall_sem_init__getraw__capacity(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal_raw<unsigned int>(simcall->args[0]);
-}
-static inline void simcall_sem_init__set__capacity(smx_simcall_t simcall, unsigned int arg)
-{
-  simgrid::simix::marshal<unsigned int>(simcall->args[0], arg);
-}
-static inline smx_sem_t simcall_sem_init__get__result(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal<smx_sem_t>(simcall->result);
-}
-static inline smx_sem_t simcall_sem_init__getraw__result(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal_raw<smx_sem_t>(simcall->result);
-}
-static inline void simcall_sem_init__set__result(smx_simcall_t simcall, smx_sem_t result){
-    simgrid::simix::marshal<smx_sem_t>(simcall->result, result);
-}
-
-static inline smx_sem_t simcall_sem_release__get__sem(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal<smx_sem_t>(simcall->args[0]);
-}
-static inline smx_sem_t simcall_sem_release__getraw__sem(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal_raw<smx_sem_t>(simcall->args[0]);
-}
-static inline void simcall_sem_release__set__sem(smx_simcall_t simcall, smx_sem_t arg)
-{
-  simgrid::simix::marshal<smx_sem_t>(simcall->args[0], arg);
-}
-
-static inline smx_sem_t simcall_sem_would_block__get__sem(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal<smx_sem_t>(simcall->args[0]);
-}
-static inline smx_sem_t simcall_sem_would_block__getraw__sem(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal_raw<smx_sem_t>(simcall->args[0]);
-}
-static inline void simcall_sem_would_block__set__sem(smx_simcall_t simcall, smx_sem_t arg)
-{
-  simgrid::simix::marshal<smx_sem_t>(simcall->args[0], arg);
-}
-static inline int simcall_sem_would_block__get__result(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal<int>(simcall->result);
-}
-static inline int simcall_sem_would_block__getraw__result(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal_raw<int>(simcall->result);
-}
-static inline void simcall_sem_would_block__set__result(smx_simcall_t simcall, int result){
-    simgrid::simix::marshal<int>(simcall->result, result);
-}
-
 static inline smx_sem_t simcall_sem_acquire__get__sem(smx_simcall_t simcall)
 {
   return simgrid::simix::unmarshal<smx_sem_t>(simcall->args[0]);
@@ -1432,30 +1298,6 @@ static inline void simcall_sem_acquire_timeout__set__timeout(smx_simcall_t simca
   simgrid::simix::marshal<double>(simcall->args[1], arg);
 }
 
-static inline smx_sem_t simcall_sem_get_capacity__get__sem(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal<smx_sem_t>(simcall->args[0]);
-}
-static inline smx_sem_t simcall_sem_get_capacity__getraw__sem(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal_raw<smx_sem_t>(simcall->args[0]);
-}
-static inline void simcall_sem_get_capacity__set__sem(smx_simcall_t simcall, smx_sem_t arg)
-{
-  simgrid::simix::marshal<smx_sem_t>(simcall->args[0], arg);
-}
-static inline int simcall_sem_get_capacity__get__result(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal<int>(simcall->result);
-}
-static inline int simcall_sem_get_capacity__getraw__result(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal_raw<int>(simcall->result);
-}
-static inline void simcall_sem_get_capacity__set__result(smx_simcall_t simcall, int result){
-    simgrid::simix::marshal<int>(simcall->result, result);
-}
-
 static inline surf_file_t simcall_file_read__get__fd(smx_simcall_t simcall)
 {
   return simgrid::simix::unmarshal<surf_file_t>(simcall->args[0]);
@@ -1630,7 +1472,6 @@ simcall_HANDLER_execution_start(smx_simcall_t simcall, const char* name, double
 XBT_PRIVATE void
 simcall_HANDLER_execution_wait(smx_simcall_t simcall,
                                boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> execution);
-XBT_PRIVATE smx_actor_t simcall_HANDLER_process_restart(smx_simcall_t simcall, smx_actor_t process);
 XBT_PRIVATE 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);
@@ -1654,17 +1495,13 @@ XBT_PRIVATE void simcall_HANDLER_comm_test(smx_simcall_t simcall,
 XBT_PRIVATE void simcall_HANDLER_comm_testany(smx_simcall_t simcall,
                                               boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>* comms,
                                               size_t count);
-XBT_PRIVATE smx_mutex_t simcall_HANDLER_mutex_init(smx_simcall_t simcall);
 XBT_PRIVATE void simcall_HANDLER_mutex_lock(smx_simcall_t simcall, smx_mutex_t mutex);
 XBT_PRIVATE int simcall_HANDLER_mutex_trylock(smx_simcall_t simcall, smx_mutex_t mutex);
 XBT_PRIVATE void simcall_HANDLER_mutex_unlock(smx_simcall_t simcall, smx_mutex_t mutex);
 XBT_PRIVATE void simcall_HANDLER_cond_wait(smx_simcall_t simcall, smx_cond_t cond, smx_mutex_t mutex);
 XBT_PRIVATE void simcall_HANDLER_cond_wait_timeout(smx_simcall_t simcall, smx_cond_t cond, smx_mutex_t mutex, double timeout);
-XBT_PRIVATE void simcall_HANDLER_sem_release(smx_simcall_t simcall, smx_sem_t sem);
-XBT_PRIVATE int simcall_HANDLER_sem_would_block(smx_simcall_t simcall, smx_sem_t sem);
 XBT_PRIVATE void simcall_HANDLER_sem_acquire(smx_simcall_t simcall, smx_sem_t sem);
 XBT_PRIVATE void simcall_HANDLER_sem_acquire_timeout(smx_simcall_t simcall, smx_sem_t sem, double timeout);
-XBT_PRIVATE int simcall_HANDLER_sem_get_capacity(smx_simcall_t simcall, smx_sem_t sem);
 XBT_PRIVATE void simcall_HANDLER_file_read(smx_simcall_t simcall, surf_file_t fd, sg_size_t size);
 XBT_PRIVATE void simcall_HANDLER_file_write(smx_simcall_t simcall, surf_file_t fd, sg_size_t size);
 XBT_PRIVATE int simcall_HANDLER_mc_random(smx_simcall_t simcall, int min, int max);
\ No newline at end of file
index 486da23..c2c83cc 100644 (file)
@@ -83,13 +83,14 @@ inline static int simcall_BODY_process_sleep(double duration) {
 
   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 amount, double rate, double timeout)
+                                        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, amount, rate, timeout);
+    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, double>(SIMCALL_EXECUTION_PARALLEL_START, name, host_nb, host_list,
-                                                    flops_amount, bytes_amount, amount, rate, timeout);
+                   double*, double, double>(SIMCALL_EXECUTION_PARALLEL_START, name, host_nb, host_list, flops_amount,
+                                            bytes_amount, rate, timeout);
   }
 
   inline static void
@@ -135,18 +136,6 @@ inline static void simcall_BODY_process_on_exit(smx_actor_t process, int_f_pvoid
     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_auto_restart_set(smx_actor_t process, int auto_restart) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) SIMIX_process_auto_restart_set(process, auto_restart);
-    return simcall<void, smx_actor_t, int>(SIMCALL_PROCESS_AUTO_RESTART_SET, process, auto_restart);
-  }
-
-inline static smx_actor_t simcall_BODY_process_restart(smx_actor_t process) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_process_restart(&SIMIX_process_self()->simcall, process);
-    return simcall<smx_actor_t, smx_actor_t>(SIMCALL_PROCESS_RESTART, process);
-  }
-
   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)
   {
@@ -224,12 +213,6 @@ inline static int simcall_BODY_comm_waitany(xbt_dynar_t comms, double timeout) {
                                                                                                 comms, count);
   }
 
-inline static smx_mutex_t simcall_BODY_mutex_init() {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_mutex_init(&SIMIX_process_self()->simcall);
-    return simcall<smx_mutex_t>(SIMCALL_MUTEX_INIT);
-  }
-
 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);
@@ -278,24 +261,6 @@ inline static void simcall_BODY_cond_broadcast(smx_cond_t cond) {
     return simcall<void, smx_cond_t>(SIMCALL_COND_BROADCAST, cond);
   }
 
-inline static smx_sem_t simcall_BODY_sem_init(unsigned int capacity) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) SIMIX_sem_init(capacity);
-    return simcall<smx_sem_t, unsigned int>(SIMCALL_SEM_INIT, capacity);
-  }
-
-inline static void simcall_BODY_sem_release(smx_sem_t sem) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_sem_release(&SIMIX_process_self()->simcall, sem);
-    return simcall<void, smx_sem_t>(SIMCALL_SEM_RELEASE, sem);
-  }
-
-inline static int simcall_BODY_sem_would_block(smx_sem_t sem) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_sem_would_block(&SIMIX_process_self()->simcall, sem);
-    return simcall<int, smx_sem_t>(SIMCALL_SEM_WOULD_BLOCK, sem);
-  }
-
 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);
@@ -308,12 +273,6 @@ inline static void simcall_BODY_sem_acquire_timeout(smx_sem_t sem, double timeou
     return simcall<void, smx_sem_t, double>(SIMCALL_SEM_ACQUIRE_TIMEOUT, sem, timeout);
   }
 
-inline static int simcall_BODY_sem_get_capacity(smx_sem_t sem) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_sem_get_capacity(&SIMIX_process_self()->simcall, sem);
-    return simcall<int, smx_sem_t>(SIMCALL_SEM_GET_CAPACITY, sem);
-  }
-
   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 */
index eede34f..8c5c937 100644 (file)
@@ -32,8 +32,6 @@ typedef enum {
   SIMCALL_EXECUTION_SET_BOUND,
   SIMCALL_EXECUTION_WAIT,
   SIMCALL_PROCESS_ON_EXIT,
-  SIMCALL_PROCESS_AUTO_RESTART_SET,
-  SIMCALL_PROCESS_RESTART,
   SIMCALL_COMM_IPROBE,
   SIMCALL_COMM_SEND,
   SIMCALL_COMM_ISEND,
@@ -43,7 +41,6 @@ typedef enum {
   SIMCALL_COMM_WAIT,
   SIMCALL_COMM_TEST,
   SIMCALL_COMM_TESTANY,
-  SIMCALL_MUTEX_INIT,
   SIMCALL_MUTEX_LOCK,
   SIMCALL_MUTEX_TRYLOCK,
   SIMCALL_MUTEX_UNLOCK,
@@ -52,12 +49,8 @@ typedef enum {
   SIMCALL_COND_WAIT,
   SIMCALL_COND_WAIT_TIMEOUT,
   SIMCALL_COND_BROADCAST,
-  SIMCALL_SEM_INIT,
-  SIMCALL_SEM_RELEASE,
-  SIMCALL_SEM_WOULD_BLOCK,
   SIMCALL_SEM_ACQUIRE,
   SIMCALL_SEM_ACQUIRE_TIMEOUT,
-  SIMCALL_SEM_GET_CAPACITY,
   SIMCALL_FILE_READ,
   SIMCALL_FILE_WRITE,
   SIMCALL_MC_RANDOM,
index 0de896d..d388546 100644 (file)
@@ -38,8 +38,6 @@ const char* simcall_names[] = {
     "SIMCALL_EXECUTION_SET_BOUND",
     "SIMCALL_EXECUTION_WAIT",
     "SIMCALL_PROCESS_ON_EXIT",
-    "SIMCALL_PROCESS_AUTO_RESTART_SET",
-    "SIMCALL_PROCESS_RESTART",
     "SIMCALL_COMM_IPROBE",
     "SIMCALL_COMM_SEND",
     "SIMCALL_COMM_ISEND",
@@ -49,7 +47,6 @@ const char* simcall_names[] = {
     "SIMCALL_COMM_WAIT",
     "SIMCALL_COMM_TEST",
     "SIMCALL_COMM_TESTANY",
-    "SIMCALL_MUTEX_INIT",
     "SIMCALL_MUTEX_LOCK",
     "SIMCALL_MUTEX_TRYLOCK",
     "SIMCALL_MUTEX_UNLOCK",
@@ -58,12 +55,8 @@ const char* simcall_names[] = {
     "SIMCALL_COND_WAIT",
     "SIMCALL_COND_WAIT_TIMEOUT",
     "SIMCALL_COND_BROADCAST",
-    "SIMCALL_SEM_INIT",
-    "SIMCALL_SEM_RELEASE",
-    "SIMCALL_SEM_WOULD_BLOCK",
     "SIMCALL_SEM_ACQUIRE",
     "SIMCALL_SEM_ACQUIRE_TIMEOUT",
-    "SIMCALL_SEM_GET_CAPACITY",
     "SIMCALL_FILE_READ",
     "SIMCALL_FILE_WRITE",
     "SIMCALL_MC_RANDOM",
@@ -127,7 +120,7 @@ case SIMCALL_EXECUTION_PARALLEL_START:
           simgrid::simix::unmarshal<const char*>(simcall->args[0]), simgrid::simix::unmarshal<int>(simcall->args[1]),
           simgrid::simix::unmarshal<sg_host_t*>(simcall->args[2]), simgrid::simix::unmarshal<double*>(simcall->args[3]),
           simgrid::simix::unmarshal<double*>(simcall->args[4]), simgrid::simix::unmarshal<double>(simcall->args[5]),
-          simgrid::simix::unmarshal<double>(simcall->args[6]), simgrid::simix::unmarshal<double>(simcall->args[7])));
+          simgrid::simix::unmarshal<double>(simcall->args[6])));
   SIMIX_simcall_answer(simcall);
   break;
 
@@ -162,16 +155,6 @@ case SIMCALL_PROCESS_ON_EXIT:
       SIMIX_simcall_answer(simcall);
       break;
 
-case SIMCALL_PROCESS_AUTO_RESTART_SET:
-      SIMIX_process_auto_restart_set(simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]), simgrid::simix::unmarshal<int>(simcall->args[1]));
-      SIMIX_simcall_answer(simcall);
-      break;
-
-case SIMCALL_PROCESS_RESTART:
-      simgrid::simix::marshal<smx_actor_t>(simcall->result, simcall_HANDLER_process_restart(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0])));
-      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]),
@@ -241,11 +224,6 @@ case SIMCALL_COMM_TESTANY:
       simgrid::simix::unmarshal<size_t>(simcall->args[1]));
   break;
 
-case SIMCALL_MUTEX_INIT:
-      simgrid::simix::marshal<smx_mutex_t>(simcall->result, simcall_HANDLER_mutex_init(simcall));
-      SIMIX_simcall_answer(simcall);
-      break;
-
 case SIMCALL_MUTEX_LOCK:
       simcall_HANDLER_mutex_lock(simcall, simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[0]));
       break;
@@ -283,21 +261,6 @@ case SIMCALL_COND_BROADCAST:
       SIMIX_simcall_answer(simcall);
       break;
 
-case SIMCALL_SEM_INIT:
-      simgrid::simix::marshal<smx_sem_t>(simcall->result, SIMIX_sem_init(simgrid::simix::unmarshal<unsigned int>(simcall->args[0])));
-      SIMIX_simcall_answer(simcall);
-      break;
-
-case SIMCALL_SEM_RELEASE:
-      simcall_HANDLER_sem_release(simcall, simgrid::simix::unmarshal<smx_sem_t>(simcall->args[0]));
-      SIMIX_simcall_answer(simcall);
-      break;
-
-case SIMCALL_SEM_WOULD_BLOCK:
-      simgrid::simix::marshal<int>(simcall->result, simcall_HANDLER_sem_would_block(simcall, simgrid::simix::unmarshal<smx_sem_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;
@@ -306,11 +269,6 @@ 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;
 
-case SIMCALL_SEM_GET_CAPACITY:
-      simgrid::simix::marshal<int>(simcall->result, simcall_HANDLER_sem_get_capacity(simcall, simgrid::simix::unmarshal<smx_sem_t>(simcall->args[0])));
-      SIMIX_simcall_answer(simcall);
-      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]));
index 69734e4..3a6cc0f 100644 (file)
@@ -43,15 +43,13 @@ int  process_join(smx_actor_t process, double timeout) [[block]];
 int  process_sleep(double duration) [[block]];
 
 boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl> execution_start(const char* name, double flops_amount, double priority, double bound);
-boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl> execution_parallel_start(const char* name, int host_nb, sg_host_t* host_list, double* flops_amount, double* bytes_amount, double amount, double rate, double timeout) [[nohandler]];
+boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl> execution_parallel_start(const char* name, int host_nb, sg_host_t* host_list, double* flops_amount, double* bytes_amount, double rate, double timeout) [[nohandler]];
 void          execution_cancel(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> execution) [[nohandler]];
 void          execution_set_priority(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> execution, double priority) [[nohandler]];
 void          execution_set_bound(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> execution, double bound) [[nohandler]];
 int           execution_wait(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> execution) [[block]];
 
 void          process_on_exit(smx_actor_t process, int_f_pvoid_pvoid_t fun, void* data) [[nohandler]];
-void          process_auto_restart_set(smx_actor_t process, int auto_restart) [[nohandler]];
-smx_actor_t   process_restart(smx_actor_t process);
 
 boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> comm_iprobe(smx_mailbox_t mbox, int type, simix_match_func_t match_fun, void* data);
 void           comm_send(smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout) [[block]];
@@ -63,7 +61,6 @@ void           comm_wait(boost::intrusive_ptr<simgrid::kernel::activity::Activit
 int            comm_test(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> comm) [[block]];
 int            comm_testany(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>* comms, size_t count) [[block]];
 
-smx_mutex_t mutex_init();
 void        mutex_lock(smx_mutex_t mutex) [[block]];
 int         mutex_trylock(smx_mutex_t mutex);
 void        mutex_unlock(smx_mutex_t mutex);
@@ -74,12 +71,8 @@ void       cond_wait(smx_cond_t cond, smx_mutex_t mutex) [[block]];
 void       cond_wait_timeout(smx_cond_t cond, smx_mutex_t mutex, double timeout) [[block]];
 void       cond_broadcast(smx_cond_t cond) [[nohandler]];
 
-smx_sem_t sem_init(unsigned int capacity) [[nohandler]];
-void      sem_release(smx_sem_t sem);
-int       sem_would_block(smx_sem_t sem);
 void      sem_acquire(smx_sem_t sem) [[block]];
 void      sem_acquire_timeout(smx_sem_t sem, double timeout) [[block]];
-int       sem_get_capacity(smx_sem_t sem);
 
 sg_size_t   file_read(surf_file_t fd, sg_size_t size) [[block]];
 sg_size_t   file_write(surf_file_t fd, sg_size_t size) [[block]];
index 18e9829..3fb82a4 100644 (file)
@@ -29,17 +29,13 @@ namespace simgrid {
     {
       /* Clean Simulator data */
       if (xbt_swag_size(process_list) != 0) {
-        char *msg = xbt_strdup("Shutting down host, but it's not empty:");
-        char *tmp;
+        std::string msg     = std::string("Shutting down host, but it's not empty:");
         smx_actor_t process = nullptr;
 
-        xbt_swag_foreach(process, process_list) {
-          tmp = bprintf("%s\n\t%s", msg, process->name.c_str());
-          free(msg);
-          msg = tmp;
-        }
+        xbt_swag_foreach(process, process_list) msg = msg + "\n\t" + process->name.c_str();
+
         SIMIX_display_process_status();
-        THROWF(arg_error, 0, "%s", msg);
+        THROWF(arg_error, 0, "%s", msg.c_str());
       }
       for (auto arg : auto_restart_processes)
         delete arg;
@@ -63,7 +59,7 @@ namespace simgrid {
         if (arg->kill_time >= 0)
           simcall_process_set_kill_time(actor, arg->kill_time);
         if (arg->auto_restart)
-          simcall_process_auto_restart_set(actor, arg->auto_restart);
+          actor->auto_restart = arg->auto_restart;
       }
     }
 
@@ -147,7 +143,7 @@ void SIMIX_host_autorestart(sg_host_t host)
     if (arg->kill_time >= 0)
       simcall_process_set_kill_time(actor, arg->kill_time);
     if (arg->auto_restart)
-      simcall_process_auto_restart_set(actor, arg->auto_restart);
+      actor->auto_restart = arg->auto_restart;
   }
   process_list.clear();
 }
@@ -186,7 +182,7 @@ SIMIX_execution_start(smx_actor_t issuer, const char* name, double flops_amount,
 
 boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>
 SIMIX_execution_parallel_start(const char* name, int host_nb, sg_host_t* host_list, double* flops_amount,
-                               double* bytes_amount, double amount, double rate, double timeout)
+                               double* bytes_amount, double rate, double timeout)
 {
 
   /* alloc structures and initialize */
index a642409..ffdcd20 100644 (file)
@@ -62,7 +62,7 @@ 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);
 XBT_PRIVATE boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>
 SIMIX_execution_parallel_start(const char* name, int host_nb, sg_host_t* host_list, double* flops_amount,
-                               double* bytes_amount, double amount, double rate, double timeout);
+                               double* bytes_amount, double rate, double timeout);
 
 #endif
 
index 6f53958..bad673a 100644 (file)
@@ -204,11 +204,6 @@ void SIMIX_mutex_unref(smx_mutex_t mutex)
     intrusive_ptr_release(mutex);
 }
 
-smx_mutex_t simcall_HANDLER_mutex_init(smx_simcall_t simcall)
-{
-  return new simgrid::simix::MutexImpl();
-}
-
 // Simcall handlers:
 
 void simcall_HANDLER_mutex_lock(smx_simcall_t simcall, smx_mutex_t mutex)
@@ -414,9 +409,6 @@ void SIMIX_sem_destroy(smx_sem_t sem)
   XBT_OUT();
 }
 
-void simcall_HANDLER_sem_release(smx_simcall_t simcall, smx_sem_t sem){
-  SIMIX_sem_release(sem);
-}
 /** @brief release the semaphore
  *
  * Unlock a process waiting on the semaphore.
@@ -445,9 +437,6 @@ int SIMIX_sem_would_block(smx_sem_t sem)
   return (sem->value <= 0);
 }
 
-int simcall_HANDLER_sem_get_capacity(smx_simcall_t simcall, smx_sem_t sem){
-  return SIMIX_sem_get_capacity(sem);
-}
 /** @brief Returns the current capacity of the semaphore */
 int SIMIX_sem_get_capacity(smx_sem_t sem)
 {
@@ -496,6 +485,3 @@ void simcall_HANDLER_sem_acquire_timeout(smx_simcall_t simcall, smx_sem_t sem, d
   _SIMIX_sem_wait(sem, timeout, simcall->issuer, simcall);
   XBT_OUT();
 }
-int simcall_HANDLER_sem_would_block(smx_simcall_t simcall, smx_sem_t sem) {
-  return SIMIX_sem_would_block(sem);
-}
index ad40a6b..c8f0680 100644 (file)
@@ -399,8 +399,9 @@ void mpi_fetch_and_op_( int *origin_addr, int* result_addr, int* datatype, int*
               *target_disp, simgrid::smpi::Op::f2c(*op), simgrid::smpi::Win::f2c(*win));
 }
 
-void mpi_compare_and_swap_( int *origin_addr, int* compare_addr, int* result_addr, 
-    int* datatype, int* target_rank, MPI_Aint* target_disp, int* win, int* ierr){
+void mpi_compare_and_swap_(int* origin_addr, int* compare_addr, int* result_addr, int* datatype, int* target_rank,
+                           MPI_Aint* target_disp, int* win, int* ierr)
+{
   *ierr =  MPI_Compare_and_swap( static_cast<void *>(origin_addr),static_cast<void *>(compare_addr),
               static_cast<void *>(result_addr), simgrid::smpi::Datatype::f2c(*datatype),*target_rank,
               *target_disp, simgrid::smpi::Win::f2c(*win));
@@ -409,20 +410,22 @@ void mpi_compare_and_swap_( int *origin_addr, int* compare_addr, int* result_add
 void mpi_get_accumulate_(int *origin_addr, int* origin_count, int* origin_datatype, int* result_addr,
                         int* result_count, int* result_datatype, int* target_rank, MPI_Aint* target_disp, int* target_count,
                         int* target_datatype, int* op, int* win, int* ierr){
-  *ierr = MPI_Get_accumulate( static_cast<void *>(origin_addr), *origin_count, simgrid::smpi::Datatype::f2c(*origin_datatype),
-                               static_cast<void *>(result_addr), *result_count, simgrid::smpi::Datatype::f2c(*result_datatype), 
-                               *target_rank, *target_disp, *target_count, simgrid::smpi::Datatype::f2c(*target_datatype),   
-                               simgrid::smpi::Op::f2c(*op), simgrid::smpi::Win::f2c(*win));
+  *ierr =
+      MPI_Get_accumulate(static_cast<void*>(origin_addr), *origin_count, simgrid::smpi::Datatype::f2c(*origin_datatype),
+                         static_cast<void*>(result_addr), *result_count, simgrid::smpi::Datatype::f2c(*result_datatype),
+                         *target_rank, *target_disp, *target_count, simgrid::smpi::Datatype::f2c(*target_datatype),
+                         simgrid::smpi::Op::f2c(*op), simgrid::smpi::Win::f2c(*win));
 }
 
 void mpi_rget_accumulate_(int *origin_addr, int* origin_count, int* origin_datatype, int* result_addr,
                         int* result_count, int* result_datatype, int* target_rank, MPI_Aint* target_disp, int* target_count,
                         int* target_datatype, int* op, int* win, int* request, int* ierr){
   MPI_Request req;
-  *ierr = MPI_Rget_accumulate( static_cast<void *>(origin_addr), *origin_count, simgrid::smpi::Datatype::f2c(*origin_datatype),
-                               static_cast<void *>(result_addr), *result_count, simgrid::smpi::Datatype::f2c(*result_datatype), 
-                               *target_rank, *target_disp, *target_count, simgrid::smpi::Datatype::f2c(*target_datatype),   
-                               simgrid::smpi::Op::f2c(*op), simgrid::smpi::Win::f2c(*win), &req);
+  *ierr = MPI_Rget_accumulate(static_cast<void*>(origin_addr), *origin_count,
+                              simgrid::smpi::Datatype::f2c(*origin_datatype), static_cast<void*>(result_addr),
+                              *result_count, simgrid::smpi::Datatype::f2c(*result_datatype), *target_rank, *target_disp,
+                              *target_count, simgrid::smpi::Datatype::f2c(*target_datatype),
+                              simgrid::smpi::Op::f2c(*op), simgrid::smpi::Win::f2c(*win), &req);
   if(*ierr == MPI_SUCCESS) {
     *request = req->add_f();
   }
@@ -430,7 +433,6 @@ void mpi_rget_accumulate_(int *origin_addr, int* origin_count, int* origin_datat
 
 //following are automatically generated, and have to be checked
 void mpi_finalized_ (int * flag, int* ierr){
-
  *ierr = MPI_Finalized(flag);
 }
 
@@ -441,7 +443,6 @@ void mpi_init_thread_ (int* required, int *provided, int* ierr){
 }
 
 void mpi_query_thread_ (int *provided, int* ierr){
-
  *ierr = MPI_Query_thread(provided);
 }
 
index 64812ca..7380364 100644 (file)
@@ -16,7 +16,7 @@ class Group : public F2C{
   private:
     int size_;
     int *rank_to_index_map_;
-    xbt_dict_t index_to_rank_map_;
+    std::unordered_map<int, int> index_to_rank_map_;
     int refcount_;
   public:
     explicit Group();
index b570e7b..6342bd9 100644 (file)
@@ -73,7 +73,7 @@ void smpi_execute(double duration)
     TRACE_smpi_computing_out(rank);
 
   } else {
-    XBT_DEBUG("Real computation took %g while option smpi/cpu_threshold is set to %g => ignore it", duration,
+    XBT_DEBUG("Real computation took %g while option smpi/cpu-threshold is set to %g => ignore it", duration,
               smpi_cpu_threshold);
   }
 }
index 3352cc0..47fa986 100644 (file)
@@ -421,11 +421,13 @@ static void smpi_init_logs(){
   XBT_LOG_CONNECT(smpi_datatype);
   XBT_LOG_CONNECT(smpi_dvfs);
   XBT_LOG_CONNECT(smpi_group);
+  XBT_LOG_CONNECT(smpi_host);
   XBT_LOG_CONNECT(smpi_kernel);
   XBT_LOG_CONNECT(smpi_mpi);
   XBT_LOG_CONNECT(smpi_memory);
   XBT_LOG_CONNECT(smpi_op);
   XBT_LOG_CONNECT(smpi_pmpi);
+  XBT_LOG_CONNECT(smpi_process);
   XBT_LOG_CONNECT(smpi_request);
   XBT_LOG_CONNECT(smpi_replay);
   XBT_LOG_CONNECT(smpi_rma);
index 115cf49..89abd06 100644 (file)
@@ -16,64 +16,46 @@ namespace smpi{
 
 Group::Group()
 {
-  size_=0;                            /* size */
-  rank_to_index_map_=nullptr;                         /* rank_to_index_map_ */
-  index_to_rank_map_=nullptr;                         /* index_to_rank_map_ */
-  refcount_=1;                            /* refcount_: start > 0 so that this group never gets freed */
+  size_              = 0;       /* size */
+  rank_to_index_map_ = nullptr; /* rank_to_index_map_ */
+  refcount_          = 1;       /* refcount_: start > 0 so that this group never gets freed */
 }
 
 Group::Group(int n) : size_(n)
 {
-  rank_to_index_map_ = xbt_new(int, size_);
-  index_to_rank_map_ = xbt_dict_new_homogeneous(xbt_free_f);
+  rank_to_index_map_ = new int[size_];
   refcount_ = 1;
-  for (int i = 0; i < size_; i++) {
+  for (int i              = 0; i < size_; i++)
     rank_to_index_map_[i] = MPI_UNDEFINED;
-  }
 }
 
 Group::Group(MPI_Group origin)
 {
-  if(origin != MPI_GROUP_NULL
-            && origin != MPI_GROUP_EMPTY)
-    {
-      size_ = origin->size();
-      rank_to_index_map_ = xbt_new(int, size_);
-      index_to_rank_map_ = xbt_dict_new_homogeneous(xbt_free_f);
-      refcount_ = 1;
-      for (int i = 0; i < size_; i++) {
-        rank_to_index_map_[i] = origin->rank_to_index_map_[i];
-      }
+  if (origin != MPI_GROUP_NULL && origin != MPI_GROUP_EMPTY) {
+    size_              = origin->size();
+    rank_to_index_map_ = new int[size_];
+    refcount_          = 1;
+    for (int i = 0; i < size_; i++) {
+      rank_to_index_map_[i] = origin->rank_to_index_map_[i];
+    }
 
-      char* key;
-      char* ptr_rank;
-      xbt_dict_cursor_t cursor = nullptr;
-      xbt_dict_foreach(origin->index_to_rank_map_, cursor, key, ptr_rank) {
-        int * cp = static_cast<int*>(xbt_malloc(sizeof(int)));
-        *cp=*reinterpret_cast<int*>(ptr_rank);
-        xbt_dict_set(index_to_rank_map_, key, cp, nullptr);
-      }
+    for (auto elm : origin->index_to_rank_map_) {
+      index_to_rank_map_.insert({elm.first, elm.second});
     }
+  }
 }
 
 Group::~Group()
 {
-  xbt_free(rank_to_index_map_);
-  xbt_dict_free(&index_to_rank_map_);
+  delete[] rank_to_index_map_;
 }
 
 void Group::set_mapping(int index, int rank)
 {
   if (rank < size_) {
     rank_to_index_map_[rank] = index;
-    if (index!=MPI_UNDEFINED ) {
-      int* val_rank = static_cast<int*>(xbt_malloc(sizeof(int)));
-      *val_rank = rank;
-
-      char * key = bprintf("%d", index);
-      xbt_dict_set(index_to_rank_map_, key, val_rank, nullptr);
-      xbt_free(key);
-    }
+    if (index != MPI_UNDEFINED)
+      index_to_rank_map_.insert({index, rank});
   }
 }
 
@@ -89,16 +71,12 @@ int Group::index(int rank)
 
 int Group::rank(int index)
 {
-  int * ptr_rank = nullptr;
-  if (this==MPI_GROUP_EMPTY)
+  if (this == MPI_GROUP_EMPTY)
     return MPI_UNDEFINED;
-  char * key = bprintf("%d", index);
-  ptr_rank = static_cast<int*>(xbt_dict_get_or_null(index_to_rank_map_, key));
-  xbt_free(key);
-
-  if (ptr_rank==nullptr)
+  if (index_to_rank_map_.find(index) == index_to_rank_map_.end())
     return MPI_UNDEFINED;
-  return *ptr_rank;
+  else
+    return index_to_rank_map_.at(index);
 }
 
 void Group::ref()
index c2ea20b..186fd7c 100644 (file)
@@ -89,7 +89,6 @@ public:
 
   ~StorageImpl() override;
 
-public:
   /** @brief Public interface */
   s4u::Storage piface_;
   static StorageImpl* byName(const char* name);
@@ -142,7 +141,6 @@ public:
   virtual std::string getHost() { return attach_; }
 
   std::map<std::string, sg_size_t>* parseContent(const char* filename);
-  static std::unordered_map<std::string, StorageImpl*>* storages;
   static std::unordered_map<std::string, StorageImpl*>* storagesMap() { return StorageImpl::storages; }
 
   lmm_constraint_t constraintWrite_; /* Constraint for maximum write bandwidth*/
@@ -153,6 +151,7 @@ public:
 
 private:
   sg_size_t size_;
+  static std::unordered_map<std::string, StorageImpl*>* storages;
   std::map<std::string, sg_size_t>* content_;
   // Name of the host to which this storage is attached. Only used at platform parsing time, then the interface stores
   // the Host directly.
index 9173e1d..dd6c06f 100644 (file)
@@ -665,6 +665,7 @@ CpuTiAction::CpuTiAction(CpuTiModel *model_, double cost, bool failed, CpuTi *cp
  : CpuAction(model_, cost, failed)
  , cpu_(cpu)
 {
+  indexHeap_ = -1;
   cpu_->modified(true);
 }
 
index 3f0fc96..4bdbe14 100644 (file)
@@ -88,7 +88,7 @@ public:
   void setState(simgrid::surf::Action::State state) override;
   int unref() override;
   void cancel() override;
-  void updateIndexHeap(int i);
+  void updateIndexHeap(int i) override;
   void suspend() override;
   void resume() override;
   void setMaxDuration(double duration) override;
@@ -96,8 +96,6 @@ public:
   double getRemains() override;
 
   CpuTi *cpu_;
-  int indexHeap_ = -1;
-  int suspended_ = 0;
 
   boost::intrusive::list_member_hook<> action_ti_hook;
 };
@@ -153,14 +151,6 @@ public:
   ActionList *runningActionSetThatDoesNotNeedBeingChecked_;
   CpuTiList *modifiedCpu_;
   xbt_heap_t tiActionHeap_;
-
-protected:
-  void NotifyResourceTurnedOn(simgrid::surf::Resource*){};
-  void NotifyResourceTurnedOff(simgrid::surf::Resource*){};
-
-  void NotifyActionCancel(Action*){};
-  void NotifyActionResume(Action*){};
-  void NotifyActionSuspend(Action*){};
 };
 
 }
index a444396..0fafd62 100644 (file)
@@ -12,7 +12,6 @@
 #include <cxxabi.h>
 #include <limits>
 #include <math.h>
-#include <stdio.h> /* sprintf */
 #include <stdlib.h>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_maxmin, surf, "Logging specific to SURF (maxmin)");
@@ -21,7 +20,8 @@ typedef struct s_dyn_light {
   int *data;
   int pos;
   int size;
-} s_dyn_light_t, *dyn_light_t;
+} s_dyn_light_t;
+typedef s_dyn_light_t* dyn_light_t;
 
 double sg_maxmin_precision = 0.00001; /* Change this with --cfg=maxmin/precision:VALUE */
 double sg_surf_precision   = 0.00001; /* Change this with --cfg=surf/precision:VALUE */
@@ -35,7 +35,6 @@ static void lmm_remove_all_modified_set(lmm_system_t sys);
 static int Global_debug_id = 1;
 static int Global_const_debug_id = 1;
 
-static void lmm_var_free(lmm_system_t sys, lmm_variable_t var);
 static inline void lmm_cnst_free(lmm_system_t sys, lmm_constraint_t cnst);
 
 static void lmm_on_disabled_var(lmm_system_t sys, lmm_constraint_t cnstr);
@@ -45,8 +44,6 @@ static void lmm_disable_var(lmm_system_t sys, lmm_variable_t var);
 static int lmm_concurrency_slack(lmm_constraint_t cnstr);
 static int lmm_cnstrs_min_concurrency_slack(lmm_variable_t var);
 
-static void lmm_check_concurrency(lmm_system_t sys);
-
 inline int lmm_element_concurrency(lmm_element_t elem) {
   //Ignore element with weight less than one (e.g. cross-traffic)
   return (elem->consumption_weight >= 1) ? 1 : 0;
@@ -75,13 +72,116 @@ inline void lmm_increase_concurrency(lmm_element_t elem) {
              "Concurrency limit overflow!");
 }
 
+static void lmm_check_concurrency(lmm_system_t sys)
+{
+  // These checks are very expensive, so do them only if we want to debug SURF LMM
+  if (not XBT_LOG_ISENABLED(surf_maxmin, xbt_log_priority_debug))
+    return;
+
+  void* cnstIt;
+  xbt_swag_foreach(cnstIt, &(sys->constraint_set))
+  {
+    lmm_constraint_t cnst = (lmm_constraint_t)cnstIt;
+    int concurrency       = 0;
+    void* elemIt;
+    xbt_swag_foreach(elemIt, &(cnst->enabled_element_set))
+    {
+      lmm_element_t elem = (lmm_element_t)elemIt;
+      xbt_assert(elem->variable->sharing_weight > 0);
+      concurrency += lmm_element_concurrency(elem);
+    }
+
+    xbt_swag_foreach(elemIt, &(cnst->disabled_element_set))
+    {
+      lmm_element_t elem = (lmm_element_t)elemIt;
+      // We should have staged variables only if concurrency is reached in some constraint
+      xbt_assert(cnst->concurrency_limit < 0 || elem->variable->staged_weight == 0 ||
+                     lmm_cnstrs_min_concurrency_slack(elem->variable) < elem->variable->concurrency_share,
+                 "should not have staged variable!");
+    }
+
+    xbt_assert(cnst->concurrency_limit < 0 || cnst->concurrency_limit >= concurrency, "concurrency check failed!");
+    xbt_assert(cnst->concurrency_current == concurrency, "concurrency_current is out-of-date!");
+  }
+
+  // Check that for each variable, all corresponding elements are in the same state (i.e. same element sets)
+  void* varIt;
+  xbt_swag_foreach(varIt, &(sys->variable_set))
+  {
+    lmm_variable_t var = (lmm_variable_t)varIt;
+
+    if (not var->cnsts_number)
+      continue;
+
+    lmm_element_t elem     = &var->cnsts[0];
+    int belong_to_enabled  = xbt_swag_belongs(elem, &(elem->constraint->enabled_element_set));
+    int belong_to_disabled = xbt_swag_belongs(elem, &(elem->constraint->disabled_element_set));
+    int belong_to_active   = xbt_swag_belongs(elem, &(elem->constraint->active_element_set));
+
+    for (int i = 1; i < var->cnsts_number; i++) {
+      elem = &var->cnsts[i];
+      xbt_assert(belong_to_enabled == xbt_swag_belongs(elem, &(elem->constraint->enabled_element_set)),
+                 "Variable inconsistency (1): enabled_element_set");
+      xbt_assert(belong_to_disabled == xbt_swag_belongs(elem, &(elem->constraint->disabled_element_set)),
+                 "Variable inconsistency (2): disabled_element_set");
+      xbt_assert(belong_to_active == xbt_swag_belongs(elem, &(elem->constraint->active_element_set)),
+                 "Variable inconsistency (3): active_element_set");
+    }
+  }
+}
+
+static inline void lmm_variable_remove(lmm_system_t sys, lmm_variable_t var)
+{
+  XBT_IN("(sys=%p, var=%p)", sys, var);
+  sys->modified = 1;
+
+  // TODOLATER Can do better than that by leaving only the variable in only one enabled_element_set, call
+  // lmm_update_modified_set, and then remove it..
+  if (var->cnsts_number)
+    lmm_update_modified_set(sys, var->cnsts[0].constraint);
+
+  for (int i = 0; i < var->cnsts_number; i++) {
+    lmm_element_t elem = &var->cnsts[i];
+    if (var->sharing_weight > 0)
+      lmm_decrease_concurrency(elem);
+    xbt_swag_remove(elem, &(elem->constraint->enabled_element_set));
+    xbt_swag_remove(elem, &(elem->constraint->disabled_element_set));
+    xbt_swag_remove(elem, &(elem->constraint->active_element_set));
+    int nelements = xbt_swag_size(&(elem->constraint->enabled_element_set)) +
+                    xbt_swag_size(&(elem->constraint->disabled_element_set));
+    if (nelements == 0)
+      make_constraint_inactive(sys, elem->constraint);
+    else
+      lmm_on_disabled_var(sys, elem->constraint);
+  }
+
+  // Check if we can enable new variables going through the constraints where var was.
+  // Do it after removing all elements, so he first disabled variables get priority over those with smaller requirement
+  for (int i = 0; i < var->cnsts_number; i++) {
+    lmm_element_t elem = &var->cnsts[i];
+    if (xbt_swag_size(&(elem->constraint->disabled_element_set)))
+      lmm_on_disabled_var(sys, elem->constraint);
+  }
+
+  var->cnsts_number = 0;
+
+  lmm_check_concurrency(sys);
+
+  XBT_OUT();
+}
+
+static void lmm_var_free(lmm_system_t sys, lmm_variable_t var)
+{
+  lmm_variable_remove(sys, var);
+  xbt_mallocator_release(sys->variable_mallocator, var);
+}
+
 lmm_system_t lmm_system_new(bool selective_update)
 {
-  lmm_system_t l = nullptr;
   s_lmm_variable_t var;
   s_lmm_constraint_t cnst;
 
-  l = xbt_new0(s_lmm_system_t, 1);
+  lmm_system_t l = xbt_new0(s_lmm_system_t, 1);
 
   l->modified = 0;
   l->selective_update_active = selective_update;
@@ -132,56 +232,6 @@ void lmm_system_free(lmm_system_t sys)
   free(sys);
 }
 
-static inline void lmm_variable_remove(lmm_system_t sys, lmm_variable_t var)
-{
-  int i;
-
-  lmm_element_t elem = nullptr;
-
-  XBT_IN("(sys=%p, var=%p)", sys, var);
-  sys->modified = 1;
-
-  //TODOLATER Can do better than that by leaving only the variable in only one enabled_element_set, call
-  //lmm_update_modified_set, and then remove it..
-  if(var->cnsts_number)
-    lmm_update_modified_set(sys, var->cnsts[0].constraint);
-
-  for (i = 0; i < var->cnsts_number; i++) {
-    elem = &var->cnsts[i];
-    if (var->sharing_weight > 0)
-      lmm_decrease_concurrency(elem);
-    xbt_swag_remove(elem, &(elem->constraint->enabled_element_set));
-    xbt_swag_remove(elem, &(elem->constraint->disabled_element_set));
-    xbt_swag_remove(elem, &(elem->constraint->active_element_set));
-    int nelements = xbt_swag_size(&(elem->constraint->enabled_element_set)) +
-                    xbt_swag_size(&(elem->constraint->disabled_element_set));
-    if (nelements == 0)
-      make_constraint_inactive(sys, elem->constraint);
-    else
-      lmm_on_disabled_var(sys,elem->constraint);
-  }
-
-  //Check if we can enable new variables going through the constraints where var was.
-  //Do it after removing all elements, so he first disabled variables get priority over those with smaller requirement
-  for (i = 0; i < var->cnsts_number; i++) {
-    elem = &var->cnsts[i];
-    if(xbt_swag_size(&(elem->constraint->disabled_element_set)))
-      lmm_on_disabled_var(sys,elem->constraint);
-  }
-
-  var->cnsts_number = 0;
-
-  lmm_check_concurrency(sys);
-
-  XBT_OUT();
-}
-
-static void lmm_var_free(lmm_system_t sys, lmm_variable_t var)
-{
-  lmm_variable_remove(sys, var);
-  xbt_mallocator_release(sys->variable_mallocator, var);
-}
-
 static inline void lmm_cnst_free(lmm_system_t sys, lmm_constraint_t cnst)
 {
   make_constraint_inactive(sys, cnst);
@@ -278,16 +328,13 @@ static void lmm_variable_mallocator_free_f(void *var)
 lmm_variable_t lmm_variable_new(lmm_system_t sys, simgrid::surf::Action* id, double sharing_weight, double bound,
                                 int number_of_constraints)
 {
-  lmm_variable_t var = nullptr;
-  int i;
-
   XBT_IN("(sys=%p, id=%p, weight=%f, bound=%f, num_cons =%d)", sys, id, sharing_weight, bound, number_of_constraints);
 
-  var = (lmm_variable_t) xbt_mallocator_get(sys->variable_mallocator);
+  lmm_variable_t var = (lmm_variable_t)xbt_mallocator_get(sys->variable_mallocator);
   var->id = id;
   var->id_int = Global_debug_id++;
   var->cnsts = (s_lmm_element_t *) xbt_realloc(var->cnsts, number_of_constraints * sizeof(s_lmm_element_t));
-  for (i = 0; i < number_of_constraints; i++) {
+  for (int i = 0; i < number_of_constraints; i++) {
     var->cnsts[i].enabled_element_set_hookup.next = nullptr;
     var->cnsts[i].enabled_element_set_hookup.prev = nullptr;
     var->cnsts[i].disabled_element_set_hookup.next = nullptr;
@@ -352,8 +399,7 @@ void lmm_shrink(lmm_system_t sys, lmm_constraint_t cnst, lmm_variable_t var)
   lmm_element_t elem = nullptr;
   int found = 0;
 
-  int i;
-  for (i = 0; i < var->cnsts_number; i++) {
+  for (int i = 0; i < var->cnsts_number; i++) {
     elem = &(var->cnsts[i]);
     if (elem->constraint == cnst) {
       found = 1;
@@ -403,16 +449,13 @@ void lmm_shrink(lmm_system_t sys, lmm_constraint_t cnst, lmm_variable_t var)
 
 void lmm_expand(lmm_system_t sys, lmm_constraint_t cnst, lmm_variable_t var, double consumption_weight)
 {
-  lmm_element_t elem = nullptr;
-  int i,current_share;
-
   sys->modified = 1;
 
   //Check if this variable already has an active element in this constraint
   //If it does, substract it from the required slack
-  current_share=0;
+  int current_share = 0;
   if(var->concurrency_share>1){
-    for( i=0; i<var->cnsts_number;i++){
+    for (int i = 0; i < var->cnsts_number; i++) {
       if(var->cnsts[i].constraint==cnst &&
          xbt_swag_belongs(&var->cnsts[i],&(var->cnsts[i].constraint->enabled_element_set)))
          current_share+=lmm_element_concurrency(&(var->cnsts[i]));
@@ -423,7 +466,7 @@ void lmm_expand(lmm_system_t sys, lmm_constraint_t cnst, lmm_variable_t var, dou
   if (var->sharing_weight > 0 && var->concurrency_share - current_share > lmm_concurrency_slack(cnst)) {
     double weight = var->sharing_weight;
     lmm_disable_var(sys,var);
-    for (i = 0; i < var->cnsts_number; i++)
+    for (int i = 0; i < var->cnsts_number; i++)
       lmm_on_disabled_var(sys,var->cnsts[i].constraint);
     consumption_weight = 0;
     var->staged_weight=weight;
@@ -432,7 +475,7 @@ void lmm_expand(lmm_system_t sys, lmm_constraint_t cnst, lmm_variable_t var, dou
 
   xbt_assert(var->cnsts_number < var->cnsts_size, "Too much constraints");
 
-  elem = &(var->cnsts[var->cnsts_number++]);
+  lmm_element_t elem = &(var->cnsts[var->cnsts_number++]);
 
   elem->consumption_weight = consumption_weight;
   elem->constraint = cnst;
@@ -622,7 +665,7 @@ static inline void saturated_variable_set_update(s_lmm_constraint_light_t *cnst_
       elem = (lmm_element_t)_elem;
       //Visiting active_element_set, so, by construction, should never get a zero weight, correct?
       xbt_assert(elem->variable->sharing_weight > 0);
-      if ((elem->consumption_weight > 0))
+      if (elem->consumption_weight > 0)
         xbt_swag_insert(elem->variable, &(sys->saturated_variable_set));
     }
   }
@@ -630,21 +673,13 @@ static inline void saturated_variable_set_update(s_lmm_constraint_light_t *cnst_
 
 void lmm_print(lmm_system_t sys)
 {
-  void* _cnst;
-  void* _elem;
-  void* _var;
-  lmm_constraint_t cnst = nullptr;
-  lmm_element_t elem    = nullptr;
-  lmm_variable_t var    = nullptr;
-  xbt_swag_t cnst_list  = nullptr;
-  xbt_swag_t var_list   = nullptr;
-  xbt_swag_t elem_list  = nullptr;
   std::string buf       = std::string("MAX-MIN ( ");
+  void* _var;
 
   /* Printing Objective */
-  var_list = &(sys->variable_set);
+  xbt_swag_t var_list = &(sys->variable_set);
   xbt_swag_foreach(_var, var_list) {
-    var = (lmm_variable_t)_var;
+    lmm_variable_t var = (lmm_variable_t)_var;
     buf = buf + "'" + std::to_string(var->id_int) + "'(" + std::to_string(var->sharing_weight) + ") ";
   }
   buf += ")";
@@ -653,16 +688,18 @@ void lmm_print(lmm_system_t sys)
 
   XBT_DEBUG("Constraints");
   /* Printing Constraints */
-  cnst_list = &(sys->active_constraint_set);
+  void* _cnst;
+  xbt_swag_t cnst_list = &(sys->active_constraint_set);
   xbt_swag_foreach(_cnst, cnst_list) {
-    cnst       = (lmm_constraint_t)_cnst;
+    lmm_constraint_t cnst = (lmm_constraint_t)_cnst;
     double sum = 0.0;
     //Show  the enabled variables
-    elem_list = &(cnst->enabled_element_set);
+    void* _elem;
+    xbt_swag_t elem_list = &(cnst->enabled_element_set);
     buf += "\t";
     buf += ((cnst->sharing_policy) ? "(" : "max(");
     xbt_swag_foreach(_elem, elem_list) {
-      elem = (lmm_element_t)_elem;
+      lmm_element_t elem = (lmm_element_t)_elem;
       buf  = buf + std::to_string(elem->consumption_weight) + ".'" + std::to_string(elem->variable->id_int) + "'(" +
             std::to_string(elem->variable->value) + ")" + ((cnst->sharing_policy) ? " + " : " , ");
       if(cnst->sharing_policy)
@@ -673,7 +710,7 @@ void lmm_print(lmm_system_t sys)
     //TODO: Adding disabled elements only for test compatibility, but do we really want them to be printed?
     elem_list = &(cnst->disabled_element_set);
     xbt_swag_foreach(_elem, elem_list) {
-      elem = (lmm_element_t)_elem;
+      lmm_element_t elem = (lmm_element_t)_elem;
       buf  = buf + std::to_string(elem->consumption_weight) + ".'" + std::to_string(elem->variable->id_int) + "'(" +
             std::to_string(elem->variable->value) + ")" + ((cnst->sharing_policy) ? " + " : " , ");
       if(cnst->sharing_policy)
@@ -691,14 +728,12 @@ void lmm_print(lmm_system_t sys)
     buf.clear();
     xbt_assert(not double_positive(sum - cnst->bound, cnst->bound * sg_maxmin_precision),
                "Incorrect value (%f is not smaller than %f): %g", sum, cnst->bound, sum - cnst->bound);
-    // if(double_positive(sum - cnst->bound, cnst->bound*sg_maxmin_precision))
-    // XBT_ERROR("Incorrect value (%f is not smaller than %f): %g",sum, cnst->bound, sum - cnst->bound);
   }
 
   XBT_DEBUG("Variables");
   /* Printing Result */
   xbt_swag_foreach(_var, var_list) {
-  var = (lmm_variable_t)_var;
+    lmm_variable_t var = (lmm_variable_t)_var;
     if (var->bound > 0) {
       XBT_DEBUG("'%d'(%f) : %f (<=%f)", var->id_int, var->sharing_weight, var->value, var->bound);
       xbt_assert(not double_positive(var->value - var->bound, var->bound * sg_maxmin_precision),
@@ -711,13 +746,9 @@ void lmm_print(lmm_system_t sys)
 
 void lmm_solve(lmm_system_t sys)
 {
-  void *_var, *_cnst, *_cnst_next, *_elem;
-  lmm_variable_t var = nullptr;
-  lmm_constraint_t cnst = nullptr;
-  lmm_element_t elem = nullptr;
-  xbt_swag_t cnst_list = nullptr;
-  xbt_swag_t var_list = nullptr;
-  xbt_swag_t elem_list = nullptr;
+  void* _cnst;
+  void* _cnst_next;
+  void* _elem;
   double min_usage = -1;
   double min_bound = -1;
 
@@ -729,16 +760,16 @@ void lmm_solve(lmm_system_t sys)
   /* Compute Usage and store the variables that reach the maximum. If selective_update_active is true, only constraints
    * that changed are considered. Otherwise all constraints with active actions are considered.
    */
-  cnst_list = sys->selective_update_active ? &(sys->modified_constraint_set) : &(sys->active_constraint_set);
+  xbt_swag_t cnst_list = sys->selective_update_active ? &(sys->modified_constraint_set) : &(sys->active_constraint_set);
 
   XBT_DEBUG("Active constraints : %d", xbt_swag_size(cnst_list));
   /* Init: Only modified code portions: reset the value of active variables */
   xbt_swag_foreach(_cnst, cnst_list) {
-  cnst = (lmm_constraint_t)_cnst;
-    elem_list = &(cnst->enabled_element_set);
+    lmm_constraint_t cnst = (lmm_constraint_t)_cnst;
+    xbt_swag_t elem_list  = &(cnst->enabled_element_set);
     //XBT_DEBUG("Variable set : %d", xbt_swag_size(elem_list));
     xbt_swag_foreach(_elem, elem_list) {
-      var = ((lmm_element_t)_elem)->variable;
+      lmm_variable_t var = ((lmm_element_t)_elem)->variable;
       xbt_assert(var->sharing_weight > 0.0);
       var->value = 0.0;
     }
@@ -752,18 +783,18 @@ void lmm_solve(lmm_system_t sys)
   saturated_constraint_set->data = xbt_new0(int, saturated_constraint_set->size);
 
   xbt_swag_foreach_safe(_cnst, _cnst_next, cnst_list) {
-  cnst = (lmm_constraint_t)_cnst;
+    lmm_constraint_t cnst = (lmm_constraint_t)_cnst;
     /* INIT: Collect constraints that actually need to be saturated (i.e remaining  and usage are strictly positive)
      * into cnst_light_tab. */
     cnst->remaining = cnst->bound;
     if (not double_positive(cnst->remaining, cnst->bound * sg_maxmin_precision))
       continue;
     cnst->usage = 0;
-    elem_list = &(cnst->enabled_element_set);
+    xbt_swag_t elem_list = &(cnst->enabled_element_set);
     xbt_swag_foreach(_elem, elem_list) {
-      elem = (lmm_element_t)_elem;
+      lmm_element_t elem = (lmm_element_t)_elem;
       xbt_assert(elem->variable->sharing_weight > 0);
-      if ((elem->consumption_weight > 0)) {
+      if (elem->consumption_weight > 0) {
         if (cnst->sharing_policy)
           cnst->usage += elem->consumption_weight / elem->variable->sharing_weight;
         else if (cnst->usage < elem->consumption_weight / elem->variable->sharing_weight)
@@ -795,8 +826,9 @@ void lmm_solve(lmm_system_t sys)
   /* Saturated variables update */
   do {
     /* Fix the variables that have to be */
-    var_list = &(sys->saturated_variable_set);
-
+    xbt_swag_t var_list = &(sys->saturated_variable_set);
+    void* _var;
+    lmm_variable_t var = nullptr;
     xbt_swag_foreach(_var, var_list) {
       var = (lmm_variable_t)_var;
       if (var->sharing_weight <= 0.0)
@@ -839,8 +871,8 @@ void lmm_solve(lmm_system_t sys)
 
       /* Update the usage of contraints where this variable is involved */
       for (i = 0; i < var->cnsts_number; i++) {
-        elem = &var->cnsts[i];
-        cnst = elem->constraint;
+        lmm_element_t elem    = &var->cnsts[i];
+        lmm_constraint_t cnst = elem->constraint;
         if (cnst->sharing_policy) {
           //Remember: shared constraints require that sum(elem->value * var->value) < cnst->bound
           double_update(&(cnst->remaining), elem->consumption_weight * var->value, cnst->bound * sg_maxmin_precision);
@@ -868,7 +900,7 @@ void lmm_solve(lmm_system_t sys)
           //Remember: non-shared constraints only require that max(elem->value * var->value) < cnst->bound
           cnst->usage = 0.0;
           make_elem_inactive(elem);
-          elem_list = &(cnst->enabled_element_set);
+          xbt_swag_t elem_list = &(cnst->enabled_element_set);
           xbt_swag_foreach(_elem, elem_list) {
             elem = (lmm_element_t)_elem;
             xbt_assert(elem->variable->sharing_weight > 0);
@@ -991,21 +1023,18 @@ int lmm_can_enable_var(lmm_variable_t var){
 //A priori not a big performance issue, but we might do better by calling lmm_update_modified_set within the for loops
 // (after doing the first for enabling==1, and before doing the last for disabling==1)
 void lmm_enable_var(lmm_system_t sys, lmm_variable_t var){
-  int i;
-  lmm_element_t elem;
-
   xbt_assert(lmm_can_enable_var(var));
 
   var->sharing_weight = var->staged_weight;
   var->staged_weight = 0;
 
-  //Enabling the variable, move to var to list head. Subtility is: here, we need to call lmm_update_modified_set AFTER
+  // Enabling the variable, move to var to list head. Subtlety is: here, we need to call lmm_update_modified_set AFTER
   // moving at least one element of var.
 
   xbt_swag_remove(var, &(sys->variable_set));
   xbt_swag_insert_at_head(var, &(sys->variable_set));
-  for (i = 0; i < var->cnsts_number; i++) {
-    elem = &var->cnsts[i];
+  for (int i = 0; i < var->cnsts_number; i++) {
+    lmm_element_t elem = &var->cnsts[i];
     xbt_swag_remove(elem, &(elem->constraint->disabled_element_set));
     xbt_swag_insert_at_head(elem, &(elem->constraint->enabled_element_set));
     lmm_increase_concurrency(elem);
@@ -1020,18 +1049,15 @@ void lmm_enable_var(lmm_system_t sys, lmm_variable_t var){
 }
 
 void lmm_disable_var(lmm_system_t sys, lmm_variable_t var){
-  int i;
-  lmm_element_t elem;
-
   xbt_assert(not var->staged_weight, "Staged weight should have been cleared");
-  //Disabling the variable, move to var to list tail. Subtility is: here, we need to call lmm_update_modified_set BEFORE
-  //moving the last element of var.
+  // Disabling the variable, move to var to list tail. Subtlety is: here, we need to call lmm_update_modified_set BEFORE
+  // moving the last element of var.
   xbt_swag_remove(var, &(sys->variable_set));
   xbt_swag_insert_at_tail(var, &(sys->variable_set));
   if (var->cnsts_number)
     lmm_update_modified_set(sys, var->cnsts[0].constraint);
-  for (i = 0; i < var->cnsts_number; i++) {
-    elem = &var->cnsts[i];
+  for (int i = 0; i < var->cnsts_number; i++) {
+    lmm_element_t elem = &var->cnsts[i];
     xbt_swag_remove(elem, &(elem->constraint->enabled_element_set));
     xbt_swag_insert_at_tail(elem, &(elem->constraint->disabled_element_set));
 
@@ -1096,7 +1122,6 @@ void lmm_on_disabled_var(lmm_system_t sys, lmm_constraint_t cnstr){
  */
 void lmm_update_variable_weight(lmm_system_t sys, lmm_variable_t var, double weight)
 {
-
   xbt_assert(weight>=0,"Variable weight should not be negative!");
 
   if (weight == var->sharing_weight)
@@ -1159,8 +1184,8 @@ inline lmm_constraint_t lmm_get_next_active_constraint(lmm_system_t sys, lmm_con
   return (lmm_constraint_t)xbt_swag_getNext(cnst, (sys->active_constraint_set).offset);
 }
 
-/** \brief Update the constraint set propagating recursively to
- *  other constraints so the system should not be entirely computed.
+/** \brief Update the constraint set propagating recursively to other constraints so the system should not be entirely
+ *  computed.
  *
  *  \param sys the lmm_system_t
  *  \param cnst the lmm_constraint_t affected by the change
@@ -1218,32 +1243,34 @@ static void lmm_remove_all_modified_set(lmm_system_t sys)
 }
 
 /**
- *  Returns resource load (in flop per second, or byte per second, or similar)
+ * Returns resource load (in flop per second, or byte per second, or similar)
  *
- *  If the resource is shared (the default case), the load is sum of
- *  resource usage made by every variables located on this resource.
+ * If the resource is shared (the default case), the load is sum of resource usage made by every variables located on
+ * this resource.
+ *
+ * If the resource is not shared (ie in FATPIPE mode), then the load is the max (not the sum) of all resource usages
+ * located on this resource.
  *
- * If the resource is not shared (ie in FATPIPE mode), then the the
- * load is the max (not the sum) of all resource usages located on this resource.
- * .
  * \param cnst the lmm_constraint_t associated to the resource
  */
 double lmm_constraint_get_usage(lmm_constraint_t cnst) {
-   double usage = 0.0;
-   xbt_swag_t elem_list = &(cnst->enabled_element_set);
-   void *_elem;
-
-   xbt_swag_foreach(_elem, elem_list) {
-     lmm_element_t elem = (lmm_element_t)_elem;
-     if (elem->consumption_weight > 0) {
-       if (cnst->sharing_policy)
-         usage += elem->consumption_weight * elem->variable->value;
-       else if (usage < elem->consumption_weight * elem->variable->value)
-         usage = std::max(usage, elem->consumption_weight * elem->variable->value);
-     }
-   }
+  double usage         = 0.0;
+  xbt_swag_t elem_list = &(cnst->enabled_element_set);
+  void* _elem;
+
+  xbt_swag_foreach(_elem, elem_list)
+  {
+    lmm_element_t elem = (lmm_element_t)_elem;
+    if (elem->consumption_weight > 0) {
+      if (cnst->sharing_policy)
+        usage += elem->consumption_weight * elem->variable->value;
+      else if (usage < elem->consumption_weight * elem->variable->value)
+        usage = std::max(usage, elem->consumption_weight * elem->variable->value);
+    }
+  }
   return usage;
 }
+
 int lmm_constraint_get_variable_amount(lmm_constraint_t cnst) {
   int usage = 0;
   xbt_swag_t elem_list = &(cnst->enabled_element_set);
@@ -1256,59 +1283,3 @@ int lmm_constraint_get_variable_amount(lmm_constraint_t cnst) {
   }
  return usage;
 }
-
-void lmm_check_concurrency(lmm_system_t sys){
-  //These checks are very expensive, so do them only if we want to debug SURF LMM
-  if (XBT_LOG_ISENABLED(surf_maxmin, xbt_log_priority_debug)) {
-    void* cnstIt;
-    xbt_swag_foreach(cnstIt, &(sys->constraint_set))
-    {
-      lmm_constraint_t cnst = (lmm_constraint_t)cnstIt;
-      int concurrency       = 0;
-      void* elemIt;
-      xbt_swag_foreach(elemIt, &(cnst->enabled_element_set))
-      {
-        lmm_element_t elem = (lmm_element_t)elemIt;
-        xbt_assert(elem->variable->sharing_weight > 0);
-        concurrency+=lmm_element_concurrency(elem);
-      }
-
-      xbt_swag_foreach(elemIt, &(cnst->disabled_element_set))
-      {
-        lmm_element_t elem = (lmm_element_t)elemIt;
-        //We should have staged variables only if concurrency is reached in some constraint
-        xbt_assert(cnst->concurrency_limit<0 || elem->variable->staged_weight==0 ||
-                   lmm_cnstrs_min_concurrency_slack(elem->variable) < elem->variable->concurrency_share,
-                   "should not have staged variable!");
-      }
-
-      xbt_assert(cnst->concurrency_limit<0 || cnst->concurrency_limit >= concurrency,"concurrency check failed!");
-      xbt_assert(cnst->concurrency_current == concurrency, "concurrency_current is out-of-date!");
-    }
-
-    //Check that for each variable, all corresponding elements are in the same state (i.e. same element sets)
-    void* varIt;
-    xbt_swag_foreach(varIt, &(sys->variable_set))
-    {
-      lmm_variable_t var = (lmm_variable_t)varIt;
-
-      if (not var->cnsts_number)
-        continue;
-
-      lmm_element_t elem     = &var->cnsts[0];
-      int belong_to_enabled  = xbt_swag_belongs(elem, &(elem->constraint->enabled_element_set));
-      int belong_to_disabled = xbt_swag_belongs(elem, &(elem->constraint->disabled_element_set));
-      int belong_to_active   = xbt_swag_belongs(elem, &(elem->constraint->active_element_set));
-
-      for (int i = 1; i < var->cnsts_number; i++) {
-        elem = &var->cnsts[i];
-        xbt_assert(belong_to_enabled==xbt_swag_belongs(elem,&(elem->constraint->enabled_element_set)),
-                   "Variable inconsistency (1): enabled_element_set");
-        xbt_assert(belong_to_disabled==xbt_swag_belongs(elem,&(elem->constraint->disabled_element_set)),
-                   "Variable inconsistency (2): disabled_element_set");
-        xbt_assert(belong_to_active==xbt_swag_belongs(elem,&(elem->constraint->active_element_set)),
-                   "Variable inconsistency (3): active_element_set");
-      }
-    }
-  }
-}
index 4a771e9..5a4eb90 100644 (file)
@@ -208,8 +208,6 @@ void NetworkCm02Model::updateActionsStateLazy(double now, double /*delta*/)
       action->finish();
       action->setState(Action::State::done);
       action->heapRemove(actionHeap_);
-
-      action->gapRemove();
     }
   }
 }
@@ -264,7 +262,6 @@ void NetworkCm02Model::updateActionsStateFull(double now, double delta)
         ((action->getMaxDuration() > NO_MAX_DURATION) && (action->getMaxDuration() <= 0))) {
       action->finish();
       action->setState(Action::State::done);
-      action->gapRemove();
     }
   }
 }
index 663f8c8..e376085 100644 (file)
@@ -711,5 +711,5 @@ void sg_platf_new_trace(sg_platf_trace_cbarg_t trace)
         "Trace '%s' must have either a content, or point to a file on disk.",trace->id);
     tmgr_trace = tmgr_trace_new_from_string(trace->id, trace->pc_data, trace->periodicity);
   }
-  xbt_dict_set(traces_set_list, trace->id, static_cast<void*>(tmgr_trace), nullptr);
+  traces_set_list.insert({trace->id, tmgr_trace});
 }
index cf5f486..249ee23 100644 (file)
@@ -161,9 +161,8 @@ FILE *surf_fopen(const char *name, const char *mode)
 
   /* search relative files in the path */
   for (auto path_elm : surf_path) {
-    char* buff = bprintf("%s" FILE_DELIM "%s", path_elm.c_str(), name);
-    file = fopen(buff, mode);
-    free(buff);
+    std::string buff = path_elm + FILE_DELIM + name;
+    file             = fopen(buff.c_str(), mode);
 
     if (file)
       return file;
@@ -379,9 +378,9 @@ void surf_exit()
     delete stype->model_properties;
     free(stype);
   }
-  for (auto s : *simgrid::surf::StorageImpl::storages)
+  for (auto s : *simgrid::surf::StorageImpl::storagesMap())
     delete s.second;
-  delete simgrid::surf::StorageImpl::storages;
+  delete simgrid::surf::StorageImpl::storagesMap();
 
   for (auto model : *all_existing_models)
     delete model;
@@ -739,8 +738,6 @@ void Action::setMaxDuration(double duration)
     heapRemove(getModel()->getActionHeap());
 }
 
-void Action::gapRemove() {}
-
 void Action::setSharingWeight(double weight)
 {
   XBT_IN("(%p,%g)", this, weight);
index b9e8b2c..63a79ae 100644 (file)
@@ -14,6 +14,7 @@
 
 #include <boost/intrusive/list.hpp>
 #include <string>
+#include <unordered_map>
 
 #define NO_MAX_DURATION -1.0
 
@@ -29,6 +30,7 @@ extern XBT_PRIVATE double sg_bandwidth_factor;
 extern XBT_PRIVATE double sg_weight_S_parameter;
 extern XBT_PRIVATE int sg_network_crosstraffic;
 extern XBT_PRIVATE std::vector<std::string> surf_path;
+extern XBT_PRIVATE std::unordered_map<std::string, tmgr_trace_t> traces_set_list;
 
 extern "C" {
 XBT_PUBLIC(double) surf_get_clock();
@@ -61,12 +63,6 @@ enum heap_action_type{
   NOTSET
 };
 
-/*********
- * Trace *
- *********/
-/* For the trace and trace:connect tag (store their content till the end of the parsing) */
-XBT_PUBLIC_DATA(xbt_dict_t) traces_set_list;
-
 /**********
  * Action *
  **********/
@@ -233,13 +229,12 @@ public:
   void heapInsert(xbt_heap_t heap, double key, enum heap_action_type hat);
   void heapRemove(xbt_heap_t heap);
   void heapUpdate(xbt_heap_t heap, double key, enum heap_action_type hat);
-  void updateIndexHeap(int i);
+  virtual void updateIndexHeap(int i);
   lmm_variable_t getVariable() {return variable_;}
   double getLastUpdate() {return lastUpdate_;}
   void refreshLastUpdate() {lastUpdate_ = surf_get_clock();}
   enum heap_action_type getHat() {return hat_;}
   bool is_linked() {return action_lmm_hook.is_linked();}
-  void gapRemove();
 
 protected:
   lmm_variable_t variable_ = nullptr;
index 30b261e..bc2d47c 100644 (file)
@@ -157,6 +157,7 @@ static bool init_function()
 
 int main(int argc, char** argv)
 {
+  XBT_LOG_CONNECT(unit);
   xbt_log_init(&argc, argv);
   return ::boost::unit_test::unit_test_main(&init_function, argc, argv);
 }
index 5f02c52..0e905d7 100644 (file)
@@ -27,20 +27,19 @@ extern "C" {
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_parse);
 
-SG_BEGIN_DECL()
 
 /* Trace related stuff */
-
-xbt_dict_t traces_set_list = nullptr;
+XBT_PRIVATE std::unordered_map<std::string, tmgr_trace_t> traces_set_list;
 XBT_PRIVATE std::unordered_map<std::string, std::string> trace_connect_list_host_avail;
 XBT_PRIVATE std::unordered_map<std::string, std::string> trace_connect_list_host_speed;
 XBT_PRIVATE std::unordered_map<std::string, std::string> trace_connect_list_link_avail;
 XBT_PRIVATE std::unordered_map<std::string, std::string> trace_connect_list_link_bw;
 XBT_PRIVATE std::unordered_map<std::string, std::string> trace_connect_list_link_lat;
 
+SG_BEGIN_DECL()
 void sg_platf_trace_connect(sg_platf_trace_connect_cbarg_t trace_connect)
 {
-  xbt_assert(xbt_dict_get_or_null(traces_set_list, trace_connect->trace),
+  xbt_assert(traces_set_list.find(trace_connect->trace) != traces_set_list.end(),
              "Cannot connect trace %s to %s: trace unknown", trace_connect->trace, trace_connect->element);
 
   switch (trace_connect->kind) {
@@ -116,15 +115,13 @@ void parse_platform_file(const char *file)
     after_config_done = 0;
     surf_parse_open(file);
 
-    traces_set_list = xbt_dict_new_homogeneous(nullptr);
-
     /* Do the actual parsing */
     parse_status = surf_parse();
 
     /* connect all traces relative to hosts */
     for (auto elm : trace_connect_list_host_avail) {
-      tmgr_trace_t trace = (tmgr_trace_t)xbt_dict_get_or_null(traces_set_list, elm.first.c_str());
-      xbt_assert(trace, "Trace %s undefined", elm.first.c_str());
+      xbt_assert(traces_set_list.find(elm.first) != traces_set_list.end(), "Trace %s undefined", elm.first.c_str());
+      tmgr_trace_t trace = traces_set_list.at(elm.first);
 
       simgrid::s4u::Host* host = sg_host_by_name(elm.second.c_str());
       xbt_assert(host, "Host %s undefined", elm.second.c_str());
@@ -134,8 +131,8 @@ void parse_platform_file(const char *file)
     }
 
     for (auto elm : trace_connect_list_host_speed) {
-      tmgr_trace_t trace = (tmgr_trace_t)xbt_dict_get_or_null(traces_set_list, elm.first.c_str());
-      xbt_assert(trace, "Trace %s undefined", elm.first.c_str());
+      xbt_assert(traces_set_list.find(elm.first) != traces_set_list.end(), "Trace %s undefined", elm.first.c_str());
+      tmgr_trace_t trace = traces_set_list.at(elm.first);
 
       simgrid::s4u::Host* host = sg_host_by_name(elm.second.c_str());
       xbt_assert(host, "Host %s undefined", elm.second.c_str());
@@ -145,8 +142,8 @@ void parse_platform_file(const char *file)
     }
 
     for (auto elm : trace_connect_list_link_avail) {
-      tmgr_trace_t trace = (tmgr_trace_t)xbt_dict_get_or_null(traces_set_list, elm.first.c_str());
-      xbt_assert(trace, "Trace %s undefined", elm.first.c_str());
+      xbt_assert(traces_set_list.find(elm.first) != traces_set_list.end(), "Trace %s undefined", elm.first.c_str());
+      tmgr_trace_t trace = traces_set_list.at(elm.first);
 
       sg_link_t link = simgrid::s4u::Link::byName(elm.second.c_str());
       xbt_assert(link, "Link %s undefined", elm.second.c_str());
@@ -154,24 +151,21 @@ void parse_platform_file(const char *file)
     }
 
     for (auto elm : trace_connect_list_link_bw) {
-      tmgr_trace_t trace = (tmgr_trace_t)xbt_dict_get_or_null(traces_set_list, elm.first.c_str());
-      xbt_assert(trace, "Trace %s undefined", elm.first.c_str());
+      xbt_assert(traces_set_list.find(elm.first) != traces_set_list.end(), "Trace %s undefined", elm.first.c_str());
+      tmgr_trace_t trace = traces_set_list.at(elm.first);
       sg_link_t link = simgrid::s4u::Link::byName(elm.second.c_str());
       xbt_assert(link, "Link %s undefined", elm.second.c_str());
       link->setBandwidthTrace(trace);
     }
 
     for (auto elm : trace_connect_list_link_lat) {
-      tmgr_trace_t trace = (tmgr_trace_t)xbt_dict_get_or_null(traces_set_list, elm.first.c_str());
-      xbt_assert(trace, "Trace %s undefined", elm.first.c_str());
+      xbt_assert(traces_set_list.find(elm.first) != traces_set_list.end(), "Trace %s undefined", elm.first.c_str());
+      tmgr_trace_t trace = traces_set_list.at(elm.first);
       sg_link_t link = simgrid::s4u::Link::byName(elm.second.c_str());
       xbt_assert(link, "Link %s undefined", elm.second.c_str());
       link->setLatencyTrace(trace);
     }
 
-    /* Free my data */
-    xbt_dict_free(&traces_set_list);
-
     surf_parse_close();
 
     if (parse_status)
index 5f53f43..7436c33 100644 (file)
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_dict, xbt, "Dictionaries provide the same functionalities as hash tables");
 
-/**
- * \brief Constructor
- * \return pointer to the destination
- * \see xbt_dict_new_homogenous(), xbt_dict_free()
- *
- * Creates and initialize a new dictionary with a default hashtable size.
- * The dictionary is heterogeneous: each element can have a different free function.
- */
 xbt_dict_t xbt_dict_new()
 {
   XBT_WARN("Function xbt_dict_new() will soon be dropped. Please switch to xbt_dict_new_homogeneous()");
index df31ba7..7d82b13 100644 (file)
@@ -1,6 +1,6 @@
 /* log - a generic logging facility in the spirit of log4j                  */
 
-/* Copyright (c) 2004-2015. The SimGrid Team.
+/* Copyright (c) 2004-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -199,6 +199,8 @@ static void xbt_log_connect_categories(void)
   XBT_LOG_CONNECT(s4u_channel);
   XBT_LOG_CONNECT(s4u_comm);
   XBT_LOG_CONNECT(s4u_file);
+  XBT_LOG_CONNECT(s4u_link);
+  XBT_LOG_CONNECT(s4u_vm);
 
   /* sg */
   XBT_LOG_CONNECT(sg_host);
@@ -220,6 +222,7 @@ static void xbt_log_connect_categories(void)
   XBT_LOG_CONNECT(simix_host);
   XBT_LOG_CONNECT(simix_io);
   XBT_LOG_CONNECT(simix_kernel);
+  XBT_LOG_CONNECT(simix_mailbox);
   XBT_LOG_CONNECT(simix_network);
   XBT_LOG_CONNECT(simix_process);
   XBT_LOG_CONNECT(simix_popping);
@@ -235,6 +238,7 @@ static void xbt_log_connect_categories(void)
   XBT_LOG_CONNECT(surf_cpu_cas);
   XBT_LOG_CONNECT(surf_cpu_ti);
   XBT_LOG_CONNECT(surf_energy);
+  XBT_LOG_CONNECT(surf_file);
   XBT_LOG_CONNECT(surf_kernel);
   XBT_LOG_CONNECT(surf_lagrange);
   XBT_LOG_CONNECT(surf_lagrange_dichotomy);
@@ -244,6 +248,7 @@ static void xbt_log_connect_categories(void)
   XBT_LOG_CONNECT(ns3);
 #endif
   XBT_LOG_CONNECT(surf_parse);
+  XBT_LOG_CONNECT(surf_plugin_load);
   XBT_LOG_CONNECT(surf_route);
   XBT_LOG_CONNECT(surf_routing_generic);
   XBT_LOG_CONNECT(surf_route_cluster);
@@ -273,9 +278,7 @@ static void xbt_log_help_categories(void);
 void xbt_log_init(int *argc, char **argv)
 {
   unsigned help_requested = 0;  /* 1: logs; 2: categories */
-  int i;
-  int j;
-  char *opt;
+  int j                   = 1;
 
   /* uncomment to set the LOG category to debug directly */
   //    _XBT_LOGV(log).threshold = xbt_log_priority_debug;
@@ -283,9 +286,9 @@ void xbt_log_init(int *argc, char **argv)
   xbt_log_connect_categories();
 
   /* Set logs and init log submodule */
-  for (j = i = 1; i < *argc; i++) {
+  for (int i = 1; i < *argc; i++) {
     if (!strncmp(argv[i], "--log=", strlen("--log="))) {
-      opt = strchr(argv[i], '=');
+      char* opt = strchr(argv[i], '=');
       opt++;
       xbt_log_control_set(opt);
       XBT_DEBUG("Did apply '%s' as log setting", opt);
index 10ea064..db4614c 100644 (file)
@@ -98,7 +98,7 @@ static void dump_platform_storages()
 
   for (auto storage : *storages) {
     XBT_INFO("Storage %s is attached to %s", storage.first.c_str(), storage.second->getHost()->getCname());
-    storage.second->setProperty("other usage", xbt_strdup("gpfs"));
+    storage.second->setProperty("other usage", "gpfs");
   }
   delete storages;
 }
index b639c18..e43d774 100644 (file)
@@ -218,14 +218,14 @@ if(enable_smpi AND enable_model-checking AND enable_smpi_ISP_testsuite)
   foreach (test ${umpire_tests_passing})
     write_file(${CMAKE_CURRENT_BINARY_DIR}/${test}.tesh "! timeout 30")
     write_file(${CMAKE_CURRENT_BINARY_DIR}/${test}.tesh "! output display" APPEND)
-    write_file(${CMAKE_CURRENT_BINARY_DIR}/${test}.tesh "\$ \${bindir:=.}/../../../../smpi_script/bin/smpirun -wrapper \"\${bindir:=.}/../../../../bin/simgrid-mc\" -hostfile ../../hostfile -platform ../../../../examples/platforms/small_platform.xml --log=xbt_cfg.thresh:warning -np 3 --cfg=smpi/host-speed:1e9 --cfg=smpi/coll_selector:mpich \${bindir:=.}/${test} --log=smpi_coll.thresh:error" APPEND)
+    write_file(${CMAKE_CURRENT_BINARY_DIR}/${test}.tesh "\$ \${bindir:=.}/../../../../smpi_script/bin/smpirun -wrapper \"\${bindir:=.}/../../../../bin/simgrid-mc\" -hostfile ../../hostfile -platform ../../../../examples/platforms/small_platform.xml --log=xbt_cfg.thresh:warning -np 3 --cfg=smpi/host-speed:1e9 --cfg=smpi/coll-selector:mpich \${bindir:=.}/${test} --log=smpi_coll.thresh:error" APPEND)
   endforeach()
 
   foreach (test ${umpire_tests_deadlock} ${umpire_tests_problematic} )
     write_file(${CMAKE_CURRENT_BINARY_DIR}/${test}.tesh "! timeout 30"     )
     write_file(${CMAKE_CURRENT_BINARY_DIR}/${test}.tesh "! expect return 3" APPEND)
     write_file(${CMAKE_CURRENT_BINARY_DIR}/${test}.tesh "! output display"  APPEND)
-    write_file(${CMAKE_CURRENT_BINARY_DIR}/${test}.tesh "\$ \${bindir:=.}/../../../../smpi_script/bin/smpirun -wrapper \"\${bindir:=.}/../../../../bin/simgrid-mc\" -hostfile ../../hostfile -platform ../../../../examples/platforms/small_platform.xml --log=xbt_cfg.thresh:warning -np 3 --cfg=smpi/host-speed:1e9 --cfg=smpi/coll_selector:mpich \${bindir:=.}/${test} --log=smpi_coll.thresh:error" APPEND)
+    write_file(${CMAKE_CURRENT_BINARY_DIR}/${test}.tesh "\$ \${bindir:=.}/../../../../smpi_script/bin/smpirun -wrapper \"\${bindir:=.}/../../../../bin/simgrid-mc\" -hostfile ../../hostfile -platform ../../../../examples/platforms/small_platform.xml --log=xbt_cfg.thresh:warning -np 3 --cfg=smpi/host-speed:1e9 --cfg=smpi/coll-selector:mpich \${bindir:=.}/${test} --log=smpi_coll.thresh:error" APPEND)
   endforeach()
 endif()
 
index 32a6785..5aedd5f 100644 (file)
@@ -222,33 +222,33 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite)
   
   # Test OMPI selector: CONTEXT if available; RAW if not (with mmap privatization or none)
   if(HAVE_UCONTEXT_CONTEXTS)
-    ADD_TEST(test-smpi-mpich3-coll-ompi-ucontext ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:ucontext -execarg=--cfg=smpi/coll_selector:ompi -execarg=--cfg=smpi/privatization:${HAVE_PRIVATIZATION} -execarg=--cfg=smpi/bcast:binomial_tree)
+    ADD_TEST(test-smpi-mpich3-coll-ompi-ucontext ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:ucontext -execarg=--cfg=smpi/coll-selector:ompi -execarg=--cfg=smpi/privatization:${HAVE_PRIVATIZATION} -execarg=--cfg=smpi/bcast:binomial_tree)
     SET_TESTS_PROPERTIES(test-smpi-mpich3-coll-ompi-ucontext PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!")
   else()
     if(HAVE_RAW_CONTEXTS)
-      ADD_TEST(test-smpi-mpich3-coll-ompi-raw ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:raw -execarg=--cfg=smpi/coll_selector:ompi -execarg=--cfg=smpi/privatization:${HAVE_PRIVATIZATION} -execarg=--cfg=smpi/bcast:binomial_tree)
+      ADD_TEST(test-smpi-mpich3-coll-ompi-raw ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:raw -execarg=--cfg=smpi/coll-selector:ompi -execarg=--cfg=smpi/privatization:${HAVE_PRIVATIZATION} -execarg=--cfg=smpi/bcast:binomial_tree)
     SET_TESTS_PROPERTIES(test-smpi-mpich3-coll-ompi-raw PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!")
     endif()
   endif()
 
   # Test MPICH selector: dlopen privatization and PTHREAD if exists (without priv and with raw if not)
   if(HAVE_PRIVATIZATION AND HAVE_THREAD_CONTEXTS)
-    ADD_TEST(test-smpi-mpich3-coll-mpich-thread-dlopen ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:thread -execarg=--cfg=smpi/coll_selector:mpich -execarg=--cfg=smpi/privatization:dlopen)
+    ADD_TEST(test-smpi-mpich3-coll-mpich-thread-dlopen ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:thread -execarg=--cfg=smpi/coll-selector:mpich -execarg=--cfg=smpi/privatization:dlopen)
     SET_TESTS_PROPERTIES(test-smpi-mpich3-coll-mpich-thread-dlopen PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!")
   else()
     if(HAVE_RAW_CONTEXTS)
-      ADD_TEST(test-smpi-mpich3-coll-mpich-raw ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:raw -execarg=--cfg=smpi/coll_selector:mpich -execarg=--cfg=smpi/privatization:${HAVE_PRIVATIZATION})
+      ADD_TEST(test-smpi-mpich3-coll-mpich-raw ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:raw -execarg=--cfg=smpi/coll-selector:mpich -execarg=--cfg=smpi/privatization:${HAVE_PRIVATIZATION})
       SET_TESTS_PROPERTIES(test-smpi-mpich3-coll-mpich-raw PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!")
     endif()
   endif()
 
   # Test MVAPICH2 selector: dlopen privatization and UCONTEXT if exists (without priv and with raw if not)
   if(HAVE_PRIVATIZATION AND HAVE_UCONTEXT_CONTEXTS)
-    ADD_TEST(test-smpi-mpich3-coll-mvapich2-ucontext-dlopen ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:ucontext -execarg=--cfg=smpi/coll_selector:mvapich2 -execarg=--cfg=smpi/privatization:dlopen)
+    ADD_TEST(test-smpi-mpich3-coll-mvapich2-ucontext-dlopen ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:ucontext -execarg=--cfg=smpi/coll-selector:mvapich2 -execarg=--cfg=smpi/privatization:dlopen)
     SET_TESTS_PROPERTIES(test-smpi-mpich3-coll-mvapich2-ucontext-dlopen PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!")
   else()
     if(HAVE_RAW_CONTEXTS)
-      ADD_TEST(test-smpi-mpich3-coll-mvapich2-raw ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:raw -execarg=--cfg=smpi/coll_selector:mvapich2 -execarg=--cfg=smpi/privatization:${HAVE_PRIVATIZATION})
+      ADD_TEST(test-smpi-mpich3-coll-mvapich2-raw ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:raw -execarg=--cfg=smpi/coll-selector:mvapich2 -execarg=--cfg=smpi/privatization:${HAVE_PRIVATIZATION})
       SET_TESTS_PROPERTIES(test-smpi-mpich3-coll-mvapich2-raw PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!")
     endif()
   endif()
@@ -256,10 +256,10 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite)
   # Test IMPI selector: always raw, with dlopen if priv exists
   if(HAVE_RAW_CONTEXTS)
     if(HAVE_PRIVATIZATION)
-      ADD_TEST(test-smpi-mpich3-coll-impi-raw-dlopen ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:raw -execarg=--cfg=smpi/coll_selector:impi -execarg=--cfg=smpi/privatization:dlopen)
+      ADD_TEST(test-smpi-mpich3-coll-impi-raw-dlopen ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:raw -execarg=--cfg=smpi/coll-selector:impi -execarg=--cfg=smpi/privatization:dlopen)
       SET_TESTS_PROPERTIES(test-smpi-mpich3-coll-impi-raw-dlopen  PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!")
     else()
-      ADD_TEST(test-smpi-mpich3-coll-impi-raw-nopriv ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:raw -execarg=--cfg=smpi/coll_selector:impi -execarg=--cfg=smpi/privatization:no)
+      ADD_TEST(test-smpi-mpich3-coll-impi-raw-nopriv ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:raw -execarg=--cfg=smpi/coll-selector:impi -execarg=--cfg=smpi/privatization:no)
       SET_TESTS_PROPERTIES(test-smpi-mpich3-coll-impi-raw-nopriv  PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!")
     endif()
   endif()
index 013b1c2..4950ac7 100644 (file)
@@ -7,7 +7,6 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
   endif()
 
   include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
-  include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../../include/")
 
   add_executable(attrmpi1f attrmpi1f.f)
   add_executable(baseattr2f baseattr2f.f)
index d8e0cd7..8134355 100644 (file)
@@ -7,7 +7,6 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
   endif()
 
   include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
-  include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
 
 #  add_executable(allredint8f allredint8f.f)
 #  add_executable(allredopttf allredopttf.f)
index 7ec483b..cb6c37a 100644 (file)
@@ -7,7 +7,6 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
   endif()
 
   include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
-  include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
 
  # add_executable(commerrf commerrf.f)
 #  add_executable(commnamef commnamef.f)
index 26b871a..bda4c89 100644 (file)
@@ -7,9 +7,9 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
   endif()
 
   include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
-  include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
+  include_directories(${CMAKE_CURRENT_BINARY_DIR})
 
-  configure_file(${CMAKE_CURRENT_SOURCE_DIR}/typeaints.h.in ${CMAKE_CURRENT_SOURCE_DIR}/typeaints.h @ONLY)
+  configure_file(${CMAKE_CURRENT_SOURCE_DIR}/typeaints.h.in typeaints.h @ONLY)
 
 #  add_executable(allctypesf allctypesf.f)
   add_executable(gaddressf gaddressf.f)
index 858c661..da6e1c8 100644 (file)
@@ -7,7 +7,6 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
   endif()
 
   include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
-  include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
 
 #  add_executable(allocmemf allocmemf.f)
 #  add_executable(c2f2cf c2f2cf.f c2f2c.c)
index 312c945..6568a72 100644 (file)
@@ -8,7 +8,6 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
 
   set(CMAKE_INCLUDE_CURRENT_DIR ON)
   include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
-  include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
 
   add_executable(infotest2f infotest2f.f ../util/mtestf.f)
   add_executable(infotestf infotestf.f ../util/mtestf.f)
index d96353a..deda911 100644 (file)
@@ -7,7 +7,6 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
   endif()
 
   include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
-  include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
 
   add_executable(baseenvf baseenvf.f)
   target_link_libraries(baseenvf simgrid mtest_f77)
index db09537..9b0f807 100644 (file)
@@ -8,7 +8,6 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
 
   set(CMAKE_INCLUDE_CURRENT_DIR ON)
   include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
-  include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
 
   add_executable(allpairf allpairf.f)
 #  add_executable(greqf greqf.f dummyf.f)
index afd0b85..2bdb749 100644 (file)
@@ -7,7 +7,6 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
   endif()
 
   include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
-  include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
 
   add_executable(winaccf winaccf.f)
 #  add_executable(winerrf winerrf.f)
index 8ec623e..7929cec 100644 (file)
@@ -7,7 +7,6 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
   endif()
 
   include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
-  include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
 
   add_executable(cartcrf cartcrf.f)
 #  add_executable(dgraph_unwgtf dgraph_unwgtf.f)
index 15a52a7..1387e60 100644 (file)
@@ -7,7 +7,6 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
   endif()
 
   include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
-  include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
 
   #F77 version of the mtest library
   add_library(mtest_f77 STATIC ../util/mtestf.f)
index ba8a0d3..fb41d8b 100644 (file)
@@ -7,7 +7,6 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
   endif()
 
   include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
-  include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
 
   add_executable(winaccf90 winaccf90.f90)
 #  add_executable(winerrf90 winerrf90.f90)
index 9bdedeb..a9ac647 100644 (file)
@@ -17,7 +17,7 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite)
 endif()
 
 if (enable_smpi_MPICH3_testsuite AND HAVE_RAW_CONTEXTS)
-  ADD_TEST(test-smpi-mpich3-perf-raw       ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/perf ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/perf -tests=testlist -execarg=--cfg=contexts/factory:raw -execarg=--cfg=smpi/running-power:-1)
+  ADD_TEST(test-smpi-mpich3-perf-raw       ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/perf ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/perf -tests=testlist -execarg=--cfg=contexts/factory:raw -execarg=--cfg=smpi/host-speed:-1)
 endif()
 
 foreach(file allredtrace commcreatep non_zero_root sendrecvl timer transp-datatype twovec dtpack indexperf manyrma 
index 4bd97a2..ea6c304 100755 (executable)
@@ -157,7 +157,7 @@ foreach $_ (@ARGV) {
     elsif (/--?maxnp=(.*)/) { $np_max = $1; }
     elsif (/--?tests=(.*)/) { $listfiles = $1; }
     elsif (/--?srcdir=(.*)/) { $srcdir = $1;
-       $mpiexec="$mpiexec  -platform ${srcdir}/../../../../examples/platforms/small_platform_with_routers.xml -hostfile ${srcdir}/../../hostfile_coll --log=root.thr:critical --cfg=smpi/running-power:1e9  --cfg=smpi/async-small-thresh:65536"; }
+       $mpiexec="$mpiexec  -platform ${srcdir}/../../../../examples/platforms/small_platform_with_routers.xml -hostfile ${srcdir}/../../hostfile_coll --log=root.thr:critical --cfg=smpi/host-speed:1e9  --cfg=smpi/async-small-thresh:65536"; }
     elsif (/--?verbose/) { $verbose = 1; }
     elsif (/--?showprogress/) { $showProgress = 1; }
     elsif (/--?debug/) { $debug = 1; }
index 76cce8d..d904a1a 100644 (file)
@@ -6,6 +6,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
+#include "simgrid/msg.h"
 #include "xbt.h"
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(synchro_crashtest, "Logs of this example");
@@ -31,29 +32,24 @@ static void* crasher_thread(void *arg)
   return NULL;
 }
 
-static int crasher(int argc, char *argv[])
+static int crasher()
 {
-  int i;
-  xbt_os_thread_t *crashers;
-
-  xbt_init(&argc, argv);
-
   /* initializations of the philosopher mechanisms */
   id = xbt_new0(int, crasher_amount);
-  crashers = xbt_new(xbt_os_thread_t, crasher_amount);
+  xbt_os_thread_t* crashers = xbt_new(xbt_os_thread_t, crasher_amount);
 
-  for (i = 0; i < crasher_amount; i++)
+  for (int i = 0; i < crasher_amount; i++)
     id[i] = i;
 
   /* spawn threads */
-  for (i = 0; i < crasher_amount; i++) {
+  for (int i = 0; i < crasher_amount; i++) {
     char *name = bprintf("thread %d", i);
     crashers[i] = xbt_os_thread_create(name, &crasher_thread, &id[i], NULL );
     free(name);
   }
 
   /* wait for them */
-  for (i = 0; i < crasher_amount; i++)
+  for (int i = 0; i < crasher_amount; i++)
     xbt_os_thread_join(crashers[i],NULL);
 
   xbt_free(crashers);
@@ -64,5 +60,6 @@ static int crasher(int argc, char *argv[])
 
 int main(int argc, char *argv[])
 {
-  return crasher(argc, argv);
+  MSG_init(&argc, argv);
+  return crasher();
 }
index 41f0565..2807095 100644 (file)
@@ -1039,6 +1039,7 @@ set(CMAKE_SOURCE_FILES
   tools/cmake/MakeLibWin.cmake
   tools/cmake/Modules/FindGraphviz.cmake
   tools/cmake/Modules/FindLibdw.cmake
+  tools/cmake/Modules/FindLibelf.cmake
   tools/cmake/Modules/FindLibunwind.cmake
   tools/cmake/Modules/FindLibevent.cmake
   tools/cmake/Modules/FindLuaSimgrid.cmake
index 68bbde4..5731bda 100644 (file)
@@ -166,12 +166,12 @@ if(enable_coverage)
   find_program(GCOV_PATH gcov)
   if(GCOV_PATH)
     set(COVERAGE_COMMAND "${GCOV_PATH}" CACHE TYPE FILEPATH FORCE)
+    set(COVERAGE_EXTRA_FLAGS "-l -p")
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DCOVERAGE")
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")
     set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage")
     set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fprofile-arcs -ftest-coverage")
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
-    set(TESH_OPTION --enable-coverage)
     add_definitions(-fprofile-arcs -ftest-coverage)
   endif()
 endif()
diff --git a/tools/cmake/Modules/FindLibelf.cmake b/tools/cmake/Modules/FindLibelf.cmake
new file mode 100644 (file)
index 0000000..1e1af81
--- /dev/null
@@ -0,0 +1,34 @@
+find_path(LIBELF_INCLUDE_DIR "libelf.h"
+  HINTS
+  $ENV{SIMGRID_LIBELF_LIBRARY_PATH}
+  $ENV{LD_LIBRARY_PATH}
+  $ENV{LIBELF_LIBRARY_PATH}
+  PATH_SUFFIXES include/ GnuWin32/include
+  PATHS
+  /opt
+  /opt/local
+  /opt/csw
+  /sw
+  /usr)
+find_library(LIBELF_LIBRARY
+  NAMES elf
+  HINTS
+  $ENV{SIMGRID_LIBELF_LIBRARY_PATH}
+  $ENV{LD_LIBRARY_PATH}
+  $ENV{LIBELF_LIBRARY_PATH}
+  PATH_SUFFIXES lib/ GnuWin32/lib
+  PATHS
+  /opt
+  /opt/local
+  /opt/csw
+  /sw
+  /usr)
+set(LIBELF_LIBRARIES "${LIBELF_LIBRARY}")
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(
+  Libelf
+  DEFAULT_MSG
+  LIBELF_LIBRARIES
+  LIBELF_INCLUDE_DIR)
+mark_as_advanced(LIBELF_INCLUDE_DIR LIBELF_LIBRARIES)
index c432450..a6aea40 100644 (file)
@@ -73,7 +73,7 @@ IF(SIMGRID_HAVE_MC)
 ENDIF()
 
 IF(enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN AND HAVE_THREAD_CONTEXTS)
-  ADD_TEST(test-smpi-mpich3-thread-f77     ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/f77/ ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/f77/ -tests=testlist -privatization=${HAVE_PRIVATIZATION} -execarg=--cfg=contexts/stack_size:8000 -execarg=--cfg=contexts/factory:thread -execarg=--cfg=smpi/privatization:${HAVE_PRIVATIZATION})
+  ADD_TEST(test-smpi-mpich3-thread-f77     ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/f77/ ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/f77/ -tests=testlist -privatization=${HAVE_PRIVATIZATION} -execarg=--cfg=contexts/stack-size:8000 -execarg=--cfg=contexts/factory:thread -execarg=--cfg=smpi/privatization:${HAVE_PRIVATIZATION})
   SET_TESTS_PROPERTIES(test-smpi-mpich3-thread-f77 PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!")
   ADD_TEST(test-smpi-mpich3-thread-f90     ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/f90/ ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/f90/ -tests=testlist -privatization=${HAVE_PRIVATIZATION} -execarg=--cfg=smpi/privatization:${HAVE_PRIVATIZATION} -execarg=--cfg=contexts/factory:thread)
   SET_TESTS_PROPERTIES(test-smpi-mpich3-thread-f90 PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!")
index baa41d8..954e3ee 100644 (file)
@@ -1,7 +1,7 @@
 add_executable       (graphicator graphicator.c)
 target_link_libraries(graphicator simgrid)
 set_target_properties(graphicator PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
-ADD_TESH(graphicator --setenv srcdir=${CMAKE_HOME_DIRECTORY} --setenv bindir=${CMAKE_BINARY_DIR}/bin --cd ${CMAKE_HOME_DIRECTORY}/tools/graphicator graphicator.tesh)
+ADD_TESH(graphicator --setenv srcdir=${CMAKE_HOME_DIRECTORY} --setenv bindir=${CMAKE_BINARY_DIR}/bin --cd ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/graphicator.tesh)
 
 ## Clean generated files
 get_directory_property(extra_clean_files ADDITIONAL_MAKE_CLEAN_FILES)
index 9f742a7..6a0800b 100644 (file)
    obj:/usr/bin/*
 }
 
+{
+   Memory leak in cmake
+   Memcheck:Leak
+   ...
+   obj:cmake
+}
+
 # There's a constant leak of 56 bytes in the depths of libc which
 # manifests, for example, when using backtrace()
 {