Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove XBT_INFO call
authorPierre Veyre <pierre.veyre@cc.in2p3.fr>
Mon, 31 Mar 2014 15:19:31 +0000 (17:19 +0200)
committerPierre Veyre <pierre.veyre@cc.in2p3.fr>
Mon, 31 Mar 2014 15:19:31 +0000 (17:19 +0200)
62 files changed:
.gitignore
buildtools/Cmake/AddTests.cmake
buildtools/Cmake/DefinePackages.cmake
buildtools/Cmake/MakeExe.cmake
examples/java/reservationSurfPlugin/Receiver.java
examples/java/reservationSurfPlugin/ReservationPlugin.java
examples/java/reservationSurfPlugin/Sender.java
examples/java/reservationSurfPlugin/TestPlugin.java
examples/java/reservationSurfPlugin/reservationSurfPluginDeployment.xml
examples/java/reservationSurfPlugin/reservationSurfPluginPlatform.xml
examples/java/reservationSurfPlugin/reservation_surf_plugin.tesh
examples/java/surfPlugin/TracePlugin.java
examples/msg/mc/bugged1.tesh
examples/msg/mc/bugged1_liveness.tesh
examples/msg/mc/bugged1_liveness_visited.tesh
examples/msg/mc/bugged2.tesh
examples/smpi/CMakeLists.txt
examples/smpi/mc/hostfile_mutual_exclusion [deleted file]
examples/smpi/mc/mutual_exclusion.c [deleted file]
src/bindings/java/surf.i
src/bindings/java/surf_swig.cpp
src/bindings/java/surf_swig.hpp
src/mc/mc_checkpoint.c
src/mc/mc_dwarf.c
src/mc/mc_dwarf_expression.c
src/mc/mc_global.c
src/mc/mc_private.h
src/msg/msg_io.c
src/simix/smx_global.c
src/simix/smx_io.c
src/smpi/smpi_base.c
src/smpi/smpi_bench.c
src/smpi/smpi_global.c
src/smpi/smpi_pmpi.c
src/surf/cpu_interface.cpp
src/surf/cpu_interface.hpp
src/surf/network_cm02.cpp
src/surf/network_cm02.hpp
src/surf/network_constant.cpp
src/surf/network_interface.cpp
src/surf/network_interface.hpp
src/surf/network_ns3.cpp
src/surf/network_ns3.hpp
src/surf/ns3/ns3_interface.cc
src/surf/ns3/ns3_interface.h
src/surf/plugins/energy.cpp
src/surf/storage_interface.cpp
src/surf/storage_interface.hpp
src/surf/surf_interface.cpp
src/surf/workstation_interface.cpp
src/surf/workstation_interface.hpp
src/surf/workstation_ptask_L07.cpp
src/surf/workstation_ptask_L07.hpp
src/xbt/mmalloc/mmorecore.c
teshsuite/bug-17132/CMakeLists.txt [deleted file]
teshsuite/bug-17132/README [deleted file]
teshsuite/bug-17132/bug-17132.c [deleted file]
teshsuite/bug-17132/bug-17132.tesh [deleted file]
teshsuite/bug-17132/hostfile.txt [deleted file]
teshsuite/bug-17132/small_platform.xml [deleted file]
teshsuite/simix/stack_overflow.tesh
testsuite/mc/dwarf_expression.c

index 5b889c1..6dc00ee 100644 (file)
@@ -254,7 +254,6 @@ examples/smpi/mc/bugged2
 
 src/replay/replay
 src/testall
-teshsuite/bug-17132/bug-17132
 teshsuite/smpi/allgather_coll
 teshsuite/smpi/allgatherv_coll
 teshsuite/smpi/allreduce_coll
index 1b7ea2c..03ad3a8 100644 (file)
@@ -444,10 +444,6 @@ if(NOT enable_memcheck)
     ADD_TEST(smpi-struct-thread                 ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/struct.tesh)
     ADD_TEST(smpi-pt2pt-thread                  ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/pt2pt.tesh)
     ADD_TEST(smpi-compute-thread                ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/compute.tesh)
-    
-    # https://gforge.inria.fr/tracker/index.php?func=detail&aid=17132&group_id=12&atid=165
-    ADD_TEST(smpi-bug-17132                ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/bug-17132 --cd ${CMAKE_BINARY_DIR}/teshsuite/bug-17132 ${CMAKE_HOME_DIRECTORY}/teshsuite/bug-17132/bug-17132.tesh)
-    
     if (NOT WIN32)
       ADD_TEST(smpi-shared-thread               ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/shared.tesh)
     endif()
index 013c8fc..2c0e140 100644 (file)
@@ -505,13 +505,7 @@ set(JSURF_JAVA_GENERATED_SRC
   ${CMAKE_BINARY_DIR}/src/bindings/java/org/simgrid/surf/NetworkLink.java
   ${CMAKE_BINARY_DIR}/src/bindings/java/org/simgrid/surf/NetworkAction.java
 
-  ${CMAKE_BINARY_DIR}/src/bindings/java/org/simgrid/surf/RoutingEdge.java
-
-  ${CMAKE_BINARY_DIR}/src/bindings/java/org/simgrid/surf/ActionState.java
-  ${CMAKE_BINARY_DIR}/src/bindings/java/org/simgrid/surf/ResourceState.java
-
   ${CMAKE_BINARY_DIR}/src/bindings/java/org/simgrid/surf/LmmConstraint.java
-  ${CMAKE_BINARY_DIR}/src/bindings/java/org/simgrid/surf/LmmVariable.java
   ${CMAKE_BINARY_DIR}/src/bindings/java/org/simgrid/surf/XbtDict.java
 )
 
@@ -981,7 +975,6 @@ set(TESHSUITE_CMAKEFILES_TXT
   teshsuite/msg/CMakeLists.txt
   teshsuite/msg/storage/CMakeLists.txt
   teshsuite/msg/trace/CMakeLists.txt
-  teshsuite/bug-17132/CMakeLists.txt
   teshsuite/simdag/CMakeLists.txt
   teshsuite/simdag/availability/CMakeLists.txt
   teshsuite/simdag/network/CMakeLists.txt
index b9445e4..a5a5819 100644 (file)
@@ -90,8 +90,6 @@ add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/p2p)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/partask)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms)
 
-add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/bug-17132)
-
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/simix)
 
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi)
index 7097e5b..cd66bb4 100644 (file)
@@ -21,11 +21,15 @@ public class Receiver extends Process {
    public void main(String[] args) throws MsgException {
 
       Msg.info("helloo!");
+      double communicationTime=0;
 
-      Task task;
-      task = Task.receive(getHost().getName());
-      task = Task.receive(getHost().getName());
-      task = Task.receive(getHost().getName());
+      Msg.info("try to get a task");
+
+      Task task = Task.receive(getHost().getName());
+      double timeGot = Msg.getClock();
+
+      Msg.info("Got at time "+ timeGot);
+      task.execute();
 
       Msg.info("goodbye!");
     }
index 8f3b6b7..0bd91aa 100644 (file)
@@ -7,34 +7,55 @@ import java.util.HashMap;
 public class ReservationPlugin extends Plugin {
 
   public ReservationPlugin() {
-    activateNetworkCommunicateCallback();
+    activateCpuCreatedCallback();
+    activateCpuDestructedCallback();
+    activateCpuStateChangedCallback();
+    activateCpuActionStateChangedCallback();
+
+    activateNetworkLinkCreatedCallback();
+    activateNetworkLinkDestructedCallback();
+    activateNetworkLinkStateChangedCallback();
+    activateNetworkActionStateChangedCallback();
+
+  }
+
+  public void init() {
+    NetworkLink[] route = Surf.getRoute("Jacquelin", "Boivin");
+    Msg.info("RouteLength:"+route.length);
+    Msg.info("RouteName0:"+route[0].getName());
+    Msg.info("RouteName1:"+route[1].getName());
   }
 
-  //HashMap<String,Reservation> reservations;
-  double bandwidth = 0;
-  String src = "";
-  String dst = "";
+  public void cpuCreatedCallback(Cpu cpu) {
+    Msg.info("Trace: Cpu created "+cpu.getName());
+  }
+
+  public void cpuDestructedCallback(Cpu cpu) {
+    Msg.info("Trace: Cpu destructed "+cpu.getName());
+  }
+
+  public void cpuStateChangedCallback(Cpu cpu){
+    Msg.info("Trace: Cpu state changed "+cpu.getName());
+  }
+
+  public void cpuActionStateChangedCallback(CpuAction action){
+    Msg.info("Trace: CpuAction state changed "+action.getModel().getName());
+  }
+
+  public void networkLinkCreatedCallback(NetworkLink link) {
+    Msg.info("Trace: NetworkLink created "+link.getName());
+  }
 
-  public void limitBandwidthActions(String src, String dst, double bandwidth){
-    this.bandwidth = bandwidth;
-    this.src = src;
-    this.dst = dst;
+  public void networkLinkDestructedCallback(NetworkLink link) {
+    Msg.info("Trace: NetworkLink destructed "+link.getName());
   }
 
-  public void updateBandwidthRoute(String src, String dst, double bandwidth){
-    NetworkLink[] route = Surf.getRoute(src, dst);
-    for (int i =0; i<route.length; i++){
-      Msg.info("Trace: bandwidth of "+route[i].getName()+" before "+route[i].getBandwidth());
-      route[i].updateBandwidth(bandwidth);//getName();
-      Msg.info("Trace: bandwidth of "+route[i].getName()+" after "+route[i].getBandwidth());
-    }
+  public void networkLinkStateChangedCallback(NetworkLink link){
+    Msg.info("Trace: NetworkLink state changed "+link.getName());
   }
 
-  public void networkCommunicateCallback(NetworkAction action, RoutingEdge src, RoutingEdge dst, double size, double rate){
-    if (src.getName().equals(this.src) && dst.getName().equals(this.dst)) {
-      action.setBound(this.bandwidth);
-    }
-    Msg.info("Trace: Communicate message of size "+size+" with rate "+rate+" and bound "+action.getBound()+" from "+src.getName()+" to "+dst.getName());
+  public void networkActionStateChangedCallback(NetworkAction action){
+    Msg.info("Trace: NetworkAction state changed "+action.getModel().getName());
   }
 
 }
index 5f6ca38..6f5ccf4 100644 (file)
@@ -23,31 +23,33 @@ public class Sender extends Process {
 
        Msg.info("helloo!");
 
-       String receiverName = args[0];
-       double oldTime, curTime;
+       int hostCount = args.length;
+
+       Msg.info("host count: " + hostCount);
+       String mailboxes[] = new String[hostCount];
+       double time;
        double computeDuration = 10000;
        Task task;
 
-       oldTime = Msg.getClock();
-            task = new Task("no name",computeDuration,commSizeLat);
-            task.send(receiverName);
-       curTime = Msg.getClock();
-       Msg.info("Send duration: " + (curTime - oldTime));
-
-       TestPlugin.tp.updateBandwidthRoute("Jacquelin", "Boivin", 10E2);
-       oldTime = curTime;
-       task = new Task("no name",computeDuration,commSizeLat);
-       task.send(receiverName);
-       curTime = Msg.getClock();
-       Msg.info("Send duration with update bandwidth: " + (curTime - oldTime));
-
-       TestPlugin.tp.limitBandwidthActions("Jacquelin", "Boivin", 10E1);
-       oldTime = curTime;
-       task = new Task("no name",computeDuration,commSizeLat);
-       task.send(receiverName);
-       curTime = Msg.getClock();
-       Msg.info("Send normal duration with limited bandwidth: " + (curTime - oldTime));
-
-       Msg.info("goodbye!");
+       for(int pos = 0; pos < args.length ; pos++) {
+         try {
+            mailboxes[pos] = Host.getByName(args[pos]).getName();
+         } catch (HostNotFoundException e) {
+            Msg.info("Invalid deployment file: " + e.toString());
+            System.exit(1);
+         }
+        }
+
+        for (int pos = 0; pos < hostCount; pos++) {
+          time = Msg.getClock();
+
+          Msg.info("sender time: " + time);
+
+          task = new Task("no name",computeDuration,commSizeLat);
+
+          task.send(mailboxes[pos]);
+        }
+
+        Msg.info("goodbye!");
     }
 }
index 64e0a6c..cedbb04 100644 (file)
@@ -16,7 +16,7 @@ public class TestPlugin {
   *   java simgrid.msg.Msg
   * which also contains such a launcher
   */
-  public static ReservationPlugin tp = new ReservationPlugin();
+  static ReservationPlugin tp = new ReservationPlugin();
 
   public static void main(String[] args) throws NativeException {
     /* initialize the MSG simulation. Must be done before anything else (even logging). */
@@ -26,12 +26,10 @@ public class TestPlugin {
       Msg.info("example : TestPlugin ping_pong_platform.xml ping_pong_deployment.xml");
       System.exit(1);
     }
-
     /* construct the platform and deploy the application */
     Msg.createEnvironment(args[0]);
     Msg.deployApplication(args[1]);
-
-
+    tp.init();
 
     // getName());
     /*  execute the simulation. */
index c238e1e..9101480 100644 (file)
@@ -1,8 +1,8 @@
 <?xml version='1.0'?>
 <!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
 <platform version="3">
-  <process host="Jacquelin" function="reservationSurfPlugin.Sender">
+  <process host="Jacquelin" function="surfPlugin.Sender">
       <argument value="Boivin"/>
   </process>
-<process host="Boivin" function="reservationSurfPlugin.Receiver"/>
+<process host="Boivin" function="surfPlugin.Receiver"/>
 </platform>
index 155dd2d..2712607 100644 (file)
@@ -5,9 +5,9 @@
    <host id="Jacquelin" power="137.333Mf"/>
    <host id="Boivin" power="98.095Mf"/>
    <host id="TeX" power="68.667Mf"/>
-   <link id="link0" bandwidth="1MBps" latency="1ms"/>
-   <link id="link1" bandwidth="1MBps" latency="1ms"/>
-   <link id="link2" bandwidth="1MBps" latency="1ms"/>
+   <link id="link0" bandwidth="1MBps" latency="100ms"/>
+   <link id="link1" bandwidth="1MBps" latency="100ms"/>
+   <link id="link2" bandwidth="1MBps" latency="100ms"/>
    <route src="Jacquelin" dst="Boivin">
      <link_ctn id="link0"/>
      <link_ctn id="link1"/>
index 3d2e4b2..012094f 100644 (file)
@@ -2,18 +2,26 @@
 
 $ java -classpath ${classpath:=.} reservationSurfPlugin/TestPlugin ${srcdir:=.}/reservationSurfPlugin/reservationSurfPluginPlatform.xml ${srcdir:=.}/reservationSurfPlugin/reservationSurfPluginDeployment.xml
 > [0.000000] [jmsg/INFO] Using regular java threads. Coroutines could speed your simulation up.
-> [Jacquelin:reservationSurfPlugin.Sender:(1) 0.000000] [jmsg/INFO] helloo!
-> [Boivin:reservationSurfPlugin.Receiver:(2) 0.000000] [jmsg/INFO] helloo!
-> [0.000000] [jmsg/INFO] Trace: Communicate message of size 1.0 with rate -1.0 and bound 1.048576E9 from Jacquelin to Boivin
-> [Jacquelin:reservationSurfPlugin.Sender:(1) 0.026021] [jmsg/INFO] Send duration: 0.026021082474226805
-> [Jacquelin:reservationSurfPlugin.Sender:(1) 0.026021] [jmsg/INFO] Trace: bandwidth of link0 before 1000000.0
-> [Jacquelin:reservationSurfPlugin.Sender:(1) 0.026021] [jmsg/INFO] Trace: bandwidth of link0 after 1000.0
-> [Jacquelin:reservationSurfPlugin.Sender:(1) 0.026021] [jmsg/INFO] Trace: bandwidth of link1 before 1000000.0
-> [Jacquelin:reservationSurfPlugin.Sender:(1) 0.026021] [jmsg/INFO] Trace: bandwidth of link1 after 1000.0
-> [0.026021] [jmsg/INFO] Trace: Communicate message of size 1.0 with rate -1.0 and bound 1.048576E9 from Jacquelin to Boivin
-> [Jacquelin:reservationSurfPlugin.Sender:(1) 0.053124] [jmsg/INFO] Send duration with update bandwidth: 0.027102474226804125
-> [0.053124] [jmsg/INFO] Trace: Communicate message of size 1.0 with rate -1.0 and bound 100.0 from Jacquelin to Boivin
-> [Boivin:reservationSurfPlugin.Receiver:(2) 0.089144] [jmsg/INFO] goodbye!
-> [Jacquelin:reservationSurfPlugin.Sender:(1) 0.089144] [jmsg/INFO] Send normal duration with limited bandwidth: 0.036019999999999996
-> [Jacquelin:reservationSurfPlugin.Sender:(1) 0.089144] [jmsg/INFO] goodbye!
-> [0.089144] [jmsg/INFO] MSG_main finished; Cleaning up the simulation...
+> [0.000000] [jmsg/INFO] Trace: NetworkLink created __loopback__
+> [0.000000] [jmsg/INFO] Trace: NetworkLink state changed __loopback__
+> [0.000000] [jmsg/INFO] Trace: Cpu created Jacquelin
+> [0.000000] [jmsg/INFO] Trace: Cpu state changed Jacquelin
+> [0.000000] [jmsg/INFO] Trace: Cpu created Boivin
+> [0.000000] [jmsg/INFO] Trace: Cpu state changed Boivin
+> [0.000000] [jmsg/INFO] Trace: NetworkLink created link
+> [0.000000] [jmsg/INFO] Trace: NetworkLink state changed link
+> [Jacquelin:surfPlugin.Sender:(1) 0.000000] [jmsg/INFO] helloo!
+> [Jacquelin:surfPlugin.Sender:(1) 0.000000] [jmsg/INFO] host count: 1
+> [Jacquelin:surfPlugin.Sender:(1) 0.000000] [jmsg/INFO] sender time: 0.0
+> [Boivin:surfPlugin.Receiver:(2) 0.000000] [jmsg/INFO] helloo!
+> [Boivin:surfPlugin.Receiver:(2) 0.000000] [jmsg/INFO] try to get a task
+> [1.301001] [jmsg/INFO] Trace: NetworkAction state changed network
+> [Boivin:surfPlugin.Receiver:(2) 1.301001] [jmsg/INFO] Got at time 1.3010010824742269
+> [Jacquelin:surfPlugin.Sender:(1) 1.301001] [jmsg/INFO] goodbye!
+> [1.301103] [jmsg/INFO] Trace: CpuAction state changed cpu
+> [Boivin:surfPlugin.Receiver:(2) 1.301103] [jmsg/INFO] goodbye!
+> [1.301103] [jmsg/INFO] MSG_main finished; Cleaning up the simulation...
+> [1.301103] [jmsg/INFO] Trace: Cpu destructed Jacquelin
+> [1.301103] [jmsg/INFO] Trace: Cpu destructed Boivin
+> [1.301103] [jmsg/INFO] Trace: NetworkLink destructed link
+> [1.301103] [jmsg/INFO] Trace: NetworkLink destructed __loopback__
index 0d1fec4..6de1823 100644 (file)
@@ -26,11 +26,11 @@ public class TracePlugin extends Plugin {
     Msg.info("Trace: Cpu destructed "+cpu.getName());
   }
 
-  public void cpuStateChangedCallback(Cpu cpu, ResourceState old, ResourceState cur){
+  public void cpuStateChangedCallback(Cpu cpu){
     Msg.info("Trace: Cpu state changed "+cpu.getName());
   }
 
-  public void cpuActionStateChangedCallback(CpuAction action, ActionState old, ActionState cur){
+  public void cpuActionStateChangedCallback(CpuAction action){
     Msg.info("Trace: CpuAction state changed "+action.getModel().getName());
   }
 
@@ -42,11 +42,11 @@ public class TracePlugin extends Plugin {
     Msg.info("Trace: NetworkLink destructed "+link.getName());
   }
 
-  public void networkLinkStateChangedCallback(NetworkLink link, ResourceState old, ResourceState cur){
+  public void networkLinkStateChangedCallback(NetworkLink link){
     Msg.info("Trace: NetworkLink state changed "+link.getName());
   }
 
-  public void networkActionStateChangedCallback(NetworkAction action, ActionState old, ActionState cur){
+  public void networkActionStateChangedCallback(NetworkAction action){
     Msg.info("Trace: NetworkAction state changed "+action.getModel().getName());
   }
 
index 85cd2ce..504b90e 100644 (file)
@@ -2,7 +2,7 @@
 
 ! expect signal SIGABRT
 ! timeout 20
-$ ${bindir:=.}/bugged1 --cfg=model-check:1 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=contexts/stack_size:256
+$ ${bindir:=.}/bugged1 --cfg=model-check:1 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (0:@) Configuration change: Set 'model-check' to '1'
 > [  0.000000] (0:@) Check a safety property
 > [  0.000000] (0:@) Get debug information ...
index ff3cd79..fd34555 100644 (file)
@@ -2,7 +2,7 @@
 
 ! expect signal SIGABRT
 ! timeout 20
-$ ${bindir:=.}/bugged1_liveness ${srcdir:=.}/../msg_platform.xml ${srcdir:=.}/deploy_bugged1_liveness.xml --cfg=model-check:1 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=contexts/factory:ucontext --cfg=contexts/stack_size:256
+$ ${bindir:=.}/bugged1_liveness ${srcdir:=.}/../msg_platform.xml ${srcdir:=.}/deploy_bugged1_liveness.xml --cfg=model-check:1 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=contexts/factory:ucontext
 > [  0.000000] (0:@) Configuration change: Set 'model-check' to '1'
 > [  0.000000] (0:@) Check the liveness property promela_bugged1_liveness
 > [  0.000000] (0:@) Get debug information ...
index 4775fdc..f117bb4 100644 (file)
@@ -2,7 +2,7 @@
 
 ! expect signal SIGABRT
 ! timeout 90
-$ ${bindir:=.}/bugged1_liveness ${srcdir:=.}/../msg_platform.xml ${srcdir:=.}/deploy_bugged1_liveness_visited.xml --cfg=model-check:1 "--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
+$ ${bindir:=.}/bugged1_liveness ${srcdir:=.}/../msg_platform.xml ${srcdir:=.}/deploy_bugged1_liveness_visited.xml --cfg=model-check:1 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=contexts/factory:ucontext --cfg=model-check/visited:100
 > [  0.000000] (0:@) Configuration change: Set 'model-check' to '1'
 > [  0.000000] (0:@) Configuration change: Set 'model-check/visited' to '100'
 > [  0.000000] (0:@) Check the liveness property promela_bugged1_liveness
index d3d7eec..3d65e67 100644 (file)
@@ -2,7 +2,7 @@
 
 ! expect signal SIGABRT
 ! timeout 20
-$ ${bindir:=.}/bugged2 --cfg=model-check:1 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=contexts/stack_size:256
+$ ${bindir:=.}/bugged2 --cfg=model-check:1 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (0:@) Configuration change: Set 'model-check' to '1'
 > [  0.000000] (0:@) Check a safety property
 > [  0.000000] (0:@) Get debug information ...
index 7420e84..9afad64 100644 (file)
@@ -25,14 +25,12 @@ if(enable_smpi)
     add_executable(mc/bugged1_liveness mc/bugged1_liveness.c)
     add_executable(mc/send_deterministic mc/send_deterministic.c)
     add_executable(mc/non_deterministic mc/non_deterministic.c)
-    add_executable(mc/mutual_exclusion mc/mutual_exclusion.c)
   
     target_link_libraries(mc/bugged1 simgrid)
     target_link_libraries(mc/bugged2 simgrid)
     target_link_libraries(mc/bugged1_liveness simgrid)
     target_link_libraries(mc/send_deterministic simgrid)
     target_link_libraries(mc/non_deterministic simgrid)
-    target_link_libraries(mc/mutual_exclusion simgrid)
   endif()
   
   target_link_libraries(bcbench simgrid)
@@ -66,7 +64,6 @@ set(examples_src
   ${CMAKE_CURRENT_SOURCE_DIR}/mc/bugged1_liveness.c
   ${CMAKE_CURRENT_SOURCE_DIR}/mc/send_deterministic.c
   ${CMAKE_CURRENT_SOURCE_DIR}/mc/non_deterministic.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/mc/mutual_exclusion.c
   PARENT_SCOPE
   )
 set(bin_files
@@ -78,7 +75,6 @@ set(bin_files
   ${CMAKE_CURRENT_SOURCE_DIR}/mc/hostfile_bugged2
   ${CMAKE_CURRENT_SOURCE_DIR}/mc/hostfile_send_deterministic
   ${CMAKE_CURRENT_SOURCE_DIR}/mc/hostfile_non_deterministic
-  ${CMAKE_CURRENT_SOURCE_DIR}/mc/hostfile_mutual_exclusion     
   PARENT_SCOPE
   )
 set(txt_files
diff --git a/examples/smpi/mc/hostfile_mutual_exclusion b/examples/smpi/mc/hostfile_mutual_exclusion
deleted file mode 100644 (file)
index b6d1c07..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-c-1.me
-c-2.me
-c-3.me
diff --git a/examples/smpi/mc/mutual_exclusion.c b/examples/smpi/mc/mutual_exclusion.c
deleted file mode 100644 (file)
index a917060..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-#include <stdio.h>
-#include <mpi.h>
-#include <simgrid/modelchecker.h>
-
-#define GRANT_TAG 0
-#define REQUEST_TAG 1
-#define RELEASE_TAG 2
-
-int main(int argc, char **argv){
-
-  int err, size, rank;
-  int recv_buff;
-  MPI_Status status;
-  int CS_used = 0;
-  xbt_dynar_t requests = xbt_dynar_new(sizeof(int), NULL);
-  
-  /* Initialize MPI */
-  err = MPI_Init(&argc, &argv);
-  if(err !=  MPI_SUCCESS){
-    printf("MPI initialization failed !\n");
-    exit(1);
-  }
-
-  MC_ignore(&(status.count), sizeof(status.count));
-
-  /* Get number of processes */
-  err = MPI_Comm_size(MPI_COMM_WORLD, &size);
-  /* Get id of this process */
-  err = MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-
-  if(rank == 0){ /* Coordinator */
-    while(1){
-      MPI_Recv(&recv_buff, 1, MPI_INT, MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &status);
-      if(status.MPI_TAG == REQUEST_TAG){
-        if(CS_used){
-          printf("CS already used. Queue the request.\n");
-          xbt_dynar_push(requests, &recv_buff);
-        }else{
-          printf("CS idle. Grant immediatly.\n");
-          MPI_Send(&rank, 1, MPI_INT, recv_buff, GRANT_TAG, MPI_COMM_WORLD);
-          CS_used = 1;
-        }
-      }else{
-        if(!xbt_dynar_is_empty(requests)){
-          printf("CS release. Grant to queued requests (queue size: %lu)",
-              xbt_dynar_length(requests));
-          xbt_dynar_shift(requests, &recv_buff);
-          MPI_Send(&rank, 1, MPI_INT, recv_buff, GRANT_TAG, MPI_COMM_WORLD);
-          CS_used = 1;
-        }else{
-          printf("CS release. Resource now idle.\n");
-          CS_used = 0;
-        }
-      }
-    }
-  }else{ /* Client */
-    while(1){
-      printf("%d asks the request.\n", rank);
-      MPI_Send(&rank, 1, MPI_INT, 0, REQUEST_TAG, MPI_COMM_WORLD);
-    
-      MPI_Recv(&recv_buff, 1, MPI_INT, 0, MPI_ANY_TAG, MPI_COMM_WORLD, &status);
-    
-      printf("%d got the answer. Release it.\n", rank);
-      MPI_Send(&rank, 1, MPI_INT, 0, RELEASE_TAG, MPI_COMM_WORLD);
-    
-    }
-  }
-
-  MPI_Finalize();
-
-  return 0;
-}
index 91e75dc..d860b98 100644 (file)
@@ -40,14 +40,9 @@ JAVA_ARRAYSOFCLASSES(NetworkLink);
 %typemap(out) NetworkLinkDynar {
   long l = xbt_dynar_length($1);
   $result = jenv->NewLongArray(l);
-  unsigned i;
-  NetworkLink *link;
-  jlong *elts = jenv->GetLongArrayElements($result, NULL);
-  xbt_dynar_foreach($1, i, link) {
-    elts[i] = (jlong)link;
-  }
-  jenv->ReleaseLongArrayElements($result, elts, 0);
-  xbt_dynar_free(&$1);
+  NetworkLink **lout = (NetworkLink **)xbt_dynar_to_array($1);
+  jenv->SetLongArrayRegion($result, 0, l, (const jlong*)lout);
+  free(lout);
 }
 
 /* Allow to subclass Plugin and send java object to C++ code */
@@ -81,18 +76,11 @@ class NetworkLink : public Resource {
 public:
   NetworkLink();
   ~NetworkLink();
-  double getBandwidth();
-  void updateBandwidth(double value, double date=surf_get_clock());
-  double getLatency();
-  void updateLatency(double value, double date=surf_get_clock());
 };
 
 class Action {
 public:
   Model *getModel();
-  lmm_variable *getVariable();
-  double getBound();
-  void setBound(double bound);
 };
 
 class CpuAction : public Action {
@@ -110,12 +98,6 @@ public:
 }
 };
 
-%nodefaultctor RoutingEdge;
-class RoutingEdge {
-public:
-  virtual char *getName()=0;
-};
-
 %rename lmm_constraint LmmConstraint;
 struct lmm_constraint {
 %extend {
@@ -123,33 +105,9 @@ struct lmm_constraint {
 }
 };
 
-%rename lmm_variable LmmVariable;
-struct lmm_variable {
-%extend {
-  double getValue() {return lmm_variable_getvalue($self);}
-}
-};
-
 %rename s_xbt_dict XbtDict;
 struct s_xbt_dict {
 %extend {
   char *getValue(char *key) {return (char*)xbt_dict_get_or_null($self, key);}
 }
 };
-
-%rename e_surf_action_state_t ActionState;
-typedef enum {
-  SURF_ACTION_READY = 0,        /**< Ready        */
-  SURF_ACTION_RUNNING,          /**< Running      */
-  SURF_ACTION_FAILED,           /**< Task Failure */
-  SURF_ACTION_DONE,             /**< Completed    */
-  SURF_ACTION_TO_FREE,          /**< Action to free in next cleanup */
-  SURF_ACTION_NOT_IN_THE_SYSTEM
-                                /**< Not in the system anymore. Why did you ask ? */
-} e_surf_action_state_t;
-
-%rename e_surf_resource_state_t ResourceState;
-typedef enum {
-  SURF_RESOURCE_ON = 1,                   /**< Up & ready        */
-  SURF_RESOURCE_OFF = 0                   /**< Down & broken     */
-} e_surf_resource_state_t;
index 88f0ee6..32f557f 100644 (file)
@@ -24,6 +24,7 @@ NetworkLinkDynar getRoute(char *srcName, char *dstName) {
     xbt_die("TOTO");
   if (dst==NULL)
     xbt_die("TOTO");
+  printf("src: %s\ndst: %s\n", src->getName(), dst->getName());
   xbt_dynar_t route = xbt_dynar_new(sizeof(RoutingEdgePtr), NULL);
   routing_platf->getRouteAndLatency(src, dst, &route, NULL);
   return route;
@@ -38,11 +39,11 @@ void Plugin::activateCpuDestructedCallback(){
 }
 
 void Plugin::activateCpuStateChangedCallback(){
-  surf_callback_connect(cpuStateChangedCallbacks, boost::bind(&Plugin::cpuStateChangedCallback, this, _1, _2, _3));
+  surf_callback_connect(cpuStateChangedCallbacks, boost::bind(&Plugin::cpuStateChangedCallback, this, _1));
 }
 
 void Plugin::activateCpuActionStateChangedCallback(){
-  surf_callback_connect(cpuActionStateChangedCallbacks, boost::bind(&Plugin::cpuActionStateChangedCallback, this, _1, _2, _3));
+  surf_callback_connect(cpuActionStateChangedCallbacks, boost::bind(&Plugin::cpuActionStateChangedCallback, this, _1));
 }
 
 
@@ -55,16 +56,11 @@ void Plugin::activateNetworkLinkDestructedCallback(){
 }
 
 void Plugin::activateNetworkLinkStateChangedCallback(){
-  surf_callback_connect(networkLinkStateChangedCallbacks, boost::bind(&Plugin::networkLinkStateChangedCallback, this, _1, _2, _3));
+  surf_callback_connect(networkLinkStateChangedCallbacks, boost::bind(&Plugin::networkLinkStateChangedCallback, this, _1));
 }
 
 void Plugin::activateNetworkActionStateChangedCallback(){
-  surf_callback_connect(networkActionStateChangedCallbacks, boost::bind(&Plugin::networkActionStateChangedCallback, this, _1, _2, _3));
+  surf_callback_connect(networkActionStateChangedCallbacks, boost::bind(&Plugin::networkActionStateChangedCallback, this, _1));
 }
 
-void Plugin::activateNetworkCommunicateCallback(){
-  surf_callback_connect(networkCommunicateCallbacks, boost::bind(&Plugin::networkCommunicateCallback, this, _1, _2, _3, _4, _5));
-}
-
-
 
index a7e7024..1c51c7b 100644 (file)
@@ -25,10 +25,10 @@ public:
  virtual void cpuDestructedCallback(Cpu *cpu) {}
 
  void activateCpuStateChangedCallback();
- virtual void cpuStateChangedCallback(Cpu *cpu, e_surf_resource_state_t, e_surf_resource_state_t) {}
+ virtual void cpuStateChangedCallback(Cpu *cpu) {}
 
  void activateCpuActionStateChangedCallback();
- virtual void cpuActionStateChangedCallback(CpuAction *action, e_surf_action_state_t, e_surf_action_state_t) {}
+ virtual void cpuActionStateChangedCallback(CpuAction *action) {}
 
 
  void activateNetworkLinkCreatedCallback();
@@ -38,11 +38,11 @@ public:
  virtual void networkLinkDestructedCallback(NetworkLink *link) {}
 
  void activateNetworkLinkStateChangedCallback();
- virtual void networkLinkStateChangedCallback(NetworkLink *link, e_surf_resource_state_t, e_surf_resource_state_t) {}
+ virtual void networkLinkStateChangedCallback(NetworkLink *link) {}
 
  void activateNetworkActionStateChangedCallback();
- virtual void networkActionStateChangedCallback(NetworkAction *action, e_surf_action_state_t old, e_surf_action_state_t cur) {}
+ virtual void networkActionStateChangedCallback(NetworkAction *action) {}
 
- void activateNetworkCommunicateCallback();
- virtual void networkCommunicateCallback(NetworkAction *action, RoutingEdge *src, RoutingEdge *dst, double size, double rate) {}
 };
+
+
index e482c42..cece2e8 100644 (file)
@@ -323,13 +323,8 @@ static xbt_dynar_t MC_unwind_stack_frames(void *stack_context) {
 
   unw_cursor_t c;
 
-  // TODO, check condition check (unw_init_local==0 means end of frame)
-  if(unw_init_local(&c, (unw_context_t *)stack_context)!=0) {
-
-    xbt_die("Could not initialize stack unwinding");
-
-  } else while(1) {
-
+  int ret;
+  for(ret = unw_init_local(&c, (unw_context_t *)stack_context); ret >= 0; ret = unw_step(&c)){
     mc_stack_frame_t stack_frame = xbt_new(s_mc_stack_frame_t, 1);
     xbt_dynar_push(result, &stack_frame);
 
@@ -353,19 +348,11 @@ static xbt_dynar_t MC_unwind_stack_frames(void *stack_context) {
       stack_frame->frame_base = (unw_word_t)mc_find_frame_base(frame, frame->object_info, &c);
     } else {
       stack_frame->frame_base = 0;
-      stack_frame->frame_name = NULL;
     }
 
     /* Stop before context switch with maestro */
     if(frame!=NULL && frame->name!=NULL && !strcmp(frame->name, "smx_ctx_sysv_wrapper"))
       break;
-
-    int ret = ret = unw_step(&c);
-    if(ret==0) {
-      xbt_die("Unexpected end of stack.");
-    } else if(ret<0) {
-      xbt_die("Error while unwinding stack.");
-    }
   }
 
   if(xbt_dynar_length(result) == 0){
index b24af22..2533500 100644 (file)
@@ -4,7 +4,6 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include <stdlib.h>
-#define DW_LANG_Objc DW_LANG_ObjC /* fix spelling error in older dwarf.h */
 #include <dwarf.h>
 #include <elfutils/libdw.h>
 #include <inttypes.h>
@@ -454,8 +453,8 @@ static void MC_dwarf_fill_member_location(dw_type_t type, dw_type_t member, Dwar
   if (!dwarf_hasattr_integrate(child, DW_AT_data_member_location)) {
     if (type->type != DW_TAG_union_type) {
         xbt_die(
-          "Missing DW_AT_data_member_location field in DW_TAG_member %s of type <%"PRIx64">%s",
-          member->name, (uint64_t) type->id, type->name);
+          "Missing DW_AT_data_member_location field in DW_TAG_member %s of type <%p>%s",
+          member->name, type->id, type->name);
     } else {
       return;
     }
@@ -474,9 +473,9 @@ static void MC_dwarf_fill_member_location(dw_type_t type, dw_type_t member, Dwar
       size_t len;
       if (dwarf_getlocation(&attr, &expr, &len)) {
         xbt_die(
-          "Could not read location expression DW_AT_data_member_location in DW_TAG_member %s of type <%"PRIx64">%s",
+          "Could not read location expression DW_AT_data_member_location in DW_TAG_member %s of type <%p>%s",
           MC_dwarf_attr_integrate_string(child, DW_AT_name),
-          (uint64_t) type->id, type->name);
+          type->id, type->name);
       }
       if (len==1 && expr[0].atom == DW_OP_plus_uconst) {
         member->offset =  expr[0].number;
@@ -492,9 +491,9 @@ static void MC_dwarf_fill_member_location(dw_type_t type, dw_type_t member, Dwar
       if (!dwarf_formudata(&attr, &offset))
         member->offset = offset;
       else
-        xbt_die("Cannot get %s location <%"PRIx64">%s",
+        xbt_die("Cannot get %s location <%p>%s",
           MC_dwarf_attr_integrate_string(child, DW_AT_name),
-          (uint64_t) type->id, type->name);
+          type->id, type->name);
       break;
     }
   case MC_DW_CLASS_LOCLISTPTR:
@@ -544,7 +543,7 @@ static void MC_dwarf_add_members(mc_object_info_t info, Dwarf_Die* die, Dwarf_Di
       member->type = tag;
 
       // Global Offset:
-      member->id = dwarf_dieoffset(&child);
+      member->id = (void *) dwarf_dieoffset(&child);
 
       const char* name = MC_dwarf_attr_integrate_string(&child, DW_AT_name);
       if(name)
@@ -566,7 +565,7 @@ static void MC_dwarf_add_members(mc_object_info_t info, Dwarf_Die* die, Dwarf_Di
       MC_dwarf_fill_member_location(type, member, &child);
 
       if (!member->dw_type_id) {
-        xbt_die("Missing type for member %s of <%"PRIx64">%s", member->name, (uint64_t) type->id, type->name);
+        xbt_die("Missing type for member %s of <%p>%s", member->name, type->id, type->name);
       }
 
       xbt_dynar_push(type->members, &member);
@@ -585,7 +584,7 @@ static dw_type_t MC_dwarf_die_to_type(mc_object_info_t info, Dwarf_Die* die, Dwa
 
   dw_type_t type = xbt_new0(s_dw_type_t, 1);
   type->type = -1;
-  type->id = 0;
+  type->id = NULL;
   type->name = NULL;
   type->byte_size = 0;
   type->element_count = -1;
@@ -597,7 +596,7 @@ static dw_type_t MC_dwarf_die_to_type(mc_object_info_t info, Dwarf_Die* die, Dwa
   type->type = dwarf_tag(die);
 
   // Global Offset
-  type->id = dwarf_dieoffset(die);
+  type->id = (void *) dwarf_dieoffset(die);
 
   const char* prefix = "";
   switch (type->type) {
@@ -619,6 +618,8 @@ static dw_type_t MC_dwarf_die_to_type(mc_object_info_t info, Dwarf_Die* die, Dwa
     type->name = namespace ? bprintf("%s%s::%s", prefix, namespace, name) : bprintf("%s%s", prefix, name);
   }
 
+  XBT_DEBUG("Processing type <%p>%s", type->id, type->name);
+
   type->dw_type_id = MC_dwarf_at_type(die);
 
   // Computation of the byte_size;
@@ -707,14 +708,14 @@ static dw_variable_t MC_die_to_variable(mc_object_info_t info, Dwarf_Die* die, D
       size_t len;
       if (dwarf_getlocation(&attr_location, &expr, &len)) {
         xbt_die(
-          "Could not read location expression in DW_AT_location of variable <%"PRIx64">%s",
-          (uint64_t) variable->dwarf_offset, variable->name);
+          "Could not read location expression in DW_AT_location of variable <%p>%s",
+          (void*) variable->dwarf_offset, variable->name);
       }
 
       if (len==1 && expr[0].atom == DW_OP_addr) {
         variable->global = 1;
-        uintptr_t offset = (uintptr_t) expr[0].number;
-        uintptr_t base   = (uintptr_t) MC_object_base_address(info);
+        Dwarf_Off offset = expr[0].number;
+        Dwarf_Off base = (Dwarf_Off) MC_object_base_address(info);
         variable->address = (void*) (base + offset);
       } else {
         mc_dwarf_location_list_init_from_expression(&variable->locations, len, expr);
@@ -728,8 +729,8 @@ static dw_variable_t MC_die_to_variable(mc_object_info_t info, Dwarf_Die* die, D
     mc_dwarf_location_list_init(&variable->locations, info, die, &attr_location);
     break;
   default:
-    xbt_die("Unexpected form 0x%x (%i), class 0x%x (%i) list for location in <%"PRIx64">%s",
-      form, form, klass, klass, (uint64_t) variable->dwarf_offset, variable->name);
+    xbt_die("Unexpected form 0x%x (%i), class 0x%x (%i) list for location in <%p>%s",
+      form, form, klass, klass, (void*) variable->dwarf_offset, variable->name);
   }
 
   // Handle start_scope:
@@ -745,7 +746,6 @@ static dw_variable_t MC_die_to_variable(mc_object_info_t info, Dwarf_Die* die, D
       variable->start_scope = dwarf_formudata(&attr, &value) == 0 ? (size_t) value : 0;
       break;
     }
-    case MC_DW_CLASS_RANGELISTPTR: // TODO
     default:
       xbt_die("Unhandled form 0x%x, class 0x%X for DW_AT_start_scope of variable %s",
         form, klass, name==NULL ? "?" : name);
@@ -811,40 +811,29 @@ static void MC_dwarf_handle_scope_die(mc_object_info_t info, Dwarf_Die* die, Dwa
 
   // Variables are filled in the (recursive) call of MC_dwarf_handle_children:
   frame->variables = xbt_dynar_new(sizeof(dw_variable_t), dw_variable_free_voidp);
+  frame->low_pc = ((char*) base) + MC_dwarf_attr_integrate_addr(die, DW_AT_low_pc);
 
-  // TODO, support DW_AT_ranges
-  uint64_t low_pc = MC_dwarf_attr_integrate_addr(die, DW_AT_low_pc);
-  frame->low_pc = low_pc ? ((char*) base) + low_pc : 0;
-  if(low_pc) {
-    // DW_AT_high_pc:
+  // DW_AT_high_pc:
+  {
     Dwarf_Attribute attr;
-    if(!dwarf_attr_integrate(die, DW_AT_high_pc, &attr)) {
-      xbt_die("Missing DW_AT_high_pc matching with DW_AT_low_pc");
-    }
-
-    Dwarf_Sword offset;
-    Dwarf_Addr high_pc;
-
-    switch(MC_dwarf_form_get_class(dwarf_whatform(&attr))) {
-
-    // DW_AT_high_pc if an offset from the low_pc:
-    case MC_DW_CLASS_CONSTANT:
-
-      if (dwarf_formsdata(&attr, &offset) !=0)
-        xbt_die("Could not read constant");
-      frame->high_pc = (void*) ((char*)frame->low_pc + offset);
-      break;
-
-    // DW_AT_high_pc is a relocatable address:
-    case MC_DW_CLASS_ADDRESS:
-      if (dwarf_formaddr(&attr, &high_pc) != 0)
-        xbt_die("Could not read address");
-      frame->high_pc = ((char*) base) + high_pc;
-      break;
-
-    default:
-      xbt_die("Unexpected class for DW_AT_high_pc");
-
+    if(dwarf_attr_integrate(die, DW_AT_high_pc, &attr)) {
+      uint64_t high_pc;
+      Dwarf_Addr value;
+      if (dwarf_formaddr(&attr, &value) == 0)
+        high_pc = (uint64_t) value;
+      else
+        high_pc = 0;
+
+      int form = dwarf_whatform(&attr);
+      int klass = MC_dwarf_form_get_class(form);
+      if (klass == MC_DW_CLASS_CONSTANT)
+        frame->high_pc = (void*) ((Dwarf_Off)frame->low_pc + high_pc);
+      else if(klass == MC_DW_CLASS_ADDRESS)
+        frame->high_pc = ((char*) base) + high_pc;
+      else
+        xbt_die("Unexpected class for DW_AT_high_pc");
+    } else {
+      frame->high_pc = 0;
     }
   }
 
index c349091..caaf932 100644 (file)
@@ -92,8 +92,7 @@ int mc_dwarf_execute_expression(
         return MC_EXPRESSION_E_NO_BASE_ADDRESS;
       if(state->stack_size==MC_EXPRESSION_STACK_SIZE)
         return MC_EXPRESSION_E_STACK_OVERFLOW;
-      error = mc_dwarf_push_value(state,
-        (Dwarf_Off)(uintptr_t)MC_object_base_address(state->object_info) + op->number);
+      error = mc_dwarf_push_value(state,  (Dwarf_Off)MC_object_base_address(state->object_info) + op->number);
       break;
 
     case DW_OP_const1u:
@@ -261,7 +260,7 @@ int mc_dwarf_execute_expression(
 /** \brief Resolve a location expression
  *  \deprecated Use mc_dwarf_resolve_expression
  */
-uintptr_t mc_dwarf_resolve_location(mc_expression_t expression, mc_object_info_t object_info, unw_cursor_t* c, void* frame_pointer_address, mc_snapshot_t snapshot) {
+Dwarf_Off mc_dwarf_resolve_location(mc_expression_t expression, mc_object_info_t object_info, unw_cursor_t* c, void* frame_pointer_address, mc_snapshot_t snapshot) {
   s_mc_expression_state_t state;
   memset(&state, 0, sizeof(s_mc_expression_state_t));
   state.frame_base = frame_pointer_address;
@@ -274,10 +273,10 @@ uintptr_t mc_dwarf_resolve_location(mc_expression_t expression, mc_object_info_t
   if(state.stack_size==0)
     xbt_die("No value on the stack");
   else
-    return state.stack[state.stack_size-1];
+    return (Dwarf_Off) state.stack[state.stack_size-1];
 }
 
-uintptr_t mc_dwarf_resolve_locations(mc_location_list_t locations, mc_object_info_t object_info, unw_cursor_t* c, void* frame_pointer_address, mc_snapshot_t snapshot) {
+Dwarf_Off mc_dwarf_resolve_locations(mc_location_list_t locations, mc_object_info_t object_info, unw_cursor_t* c, void* frame_pointer_address, mc_snapshot_t snapshot) {
 
   unw_word_t ip;
   if(c) {
index 55cf908..0457aa9 100644 (file)
@@ -8,7 +8,6 @@
 #include <sys/types.h>
 #include <sys/wait.h>
 #include <sys/time.h>
-#include <sys/mman.h>
 #include <libgen.h>
 
 #include "simgrid/sg_config.h"
@@ -800,14 +799,6 @@ static void MC_init_debug_info(void) {
   mc_libsimgrid_info = MC_find_object_info(maps, libsimgrid_path, 0);
   mc_object_infos[1] = mc_libsimgrid_info;
 
-#ifdef MADV_MERGEABLE
-  for(int i=0; i!=mc_object_infos_size; ++i) {
-    void* start = mc_object_infos[i]->start_rw;
-    void* end = mc_object_infos[i]->end_rw;
-    madvise(start, (char*)end - (char*)start, MADV_MERGEABLE);
-  }
-#endif
-
   // Use information of the other objects:
   MC_post_process_object_info(mc_binary_info);
   MC_post_process_object_info(mc_libsimgrid_info);
index 20e4ab8..6b2ae33 100644 (file)
@@ -416,8 +416,8 @@ typedef struct s_mc_location_list {
   mc_expression_t locations;
 } s_mc_location_list_t, *mc_location_list_t;
 
-uintptr_t mc_dwarf_resolve_location(mc_expression_t expression, mc_object_info_t object_info, unw_cursor_t* c, void* frame_pointer_address, mc_snapshot_t snapshot);
-uintptr_t mc_dwarf_resolve_locations(mc_location_list_t locations, mc_object_info_t object_info, unw_cursor_t* c, void* frame_pointer_address, mc_snapshot_t snapshot);
+Dwarf_Off mc_dwarf_resolve_location(mc_expression_t expression, mc_object_info_t object_info, unw_cursor_t* c, void* frame_pointer_address, mc_snapshot_t snapshot);
+Dwarf_Off mc_dwarf_resolve_locations(mc_location_list_t locations, mc_object_info_t object_info, unw_cursor_t* c, void* frame_pointer_address, mc_snapshot_t snapshot);
 
 void mc_dwarf_expression_clear(mc_expression_t expression);
 void mc_dwarf_expression_init(mc_expression_t expression, size_t len, Dwarf_Op* ops);
@@ -431,7 +431,7 @@ void mc_dwarf_location_list_init(mc_location_list_t target, mc_object_info_t inf
 
 struct s_dw_type{
   e_dw_type_type type;
-  Dwarf_Off id; /* Offset in the section (in hexadecimal form) */
+  void *id; /* Offset in the section (in hexadecimal form) */
   char *name; /* Name of the type */
   int byte_size; /* Size in bytes */
   int element_count; /* Number of elements for array type */
index 9a8b5c4..f632e57 100644 (file)
@@ -326,7 +326,7 @@ msg_error_t MSG_file_move (msg_file_t fd, const char* fullpath)
 /**
  * \ingroup msg_file_management
  * \brief Copy a file to another location on a remote host.
- * \param file : the file to move
+ * \param fd : the file to move
  * \param host : the remote host where the file has to be copied
  * \param fullpath : the complete path destination on the remote host
  * \return If successful, the function returns MSG_OK. Otherwise, it returns
@@ -406,7 +406,7 @@ msg_error_t MSG_file_rcopy (msg_file_t file, msg_host_t host, const char* fullpa
 /**
  * \ingroup msg_file_management
  * \brief Move a file to another location on a remote host.
- * \param file : the file to move
+ * \param fd : the file to move
  * \param host : the remote host where the file has to be moved
  * \param fullpath : the complete path destination on the remote host
  * \return If successful, the function returns MSG_OK. Otherwise, it returns
index 71a85a4..7df250c 100644 (file)
@@ -44,12 +44,7 @@ static void _XBT_CALL segvhandler(int signum, siginfo_t *siginfo, void *context)
 {
   if (siginfo->si_signo == SIGSEGV && siginfo->si_code == SEGV_ACCERR) {
     fprintf(stderr,
-            "Access violation detected.\n"
-            "This can result from a programming error in your code or, although less likely,\n"
-            "from a bug in SimGrid itself.  This can also be the sign of a bug in the OS or\n"
-            "in third-party libraries.  Failing hardware can sometimes generate such errors\n"
-            "too.\n"
-            "Finally, if nothing of the above applies, this can result from a stack overflow.\n"
+            "Access violation detected. This can result from a stack overflow.\n"
             "Try to increase stack size with --cfg=contexts/stack_size (current size is %d KiB).\n",
             smx_context_stack_size / 1024);
     if (XBT_LOG_ISENABLED(simix_kernel, xbt_log_priority_debug)) {
index 4be4d69..4b5b1f2 100644 (file)
@@ -112,7 +112,7 @@ smx_action_t SIMIX_file_write(smx_process_t process, smx_file_t fd, sg_size_t si
   action->io.surf_io = surf_workstation_write(host, fd->surf_file, size);
 
   surf_action_set_data(action->io.surf_io, action);
-  XBT_INFO("Create io action %p", action);
+  XBT_DEBUG("Create io action %p", action);
 
   return action;
 }
index f2085f2..6295038 100644 (file)
@@ -377,11 +377,14 @@ void smpi_mpi_start(MPI_Request request)
         oldbuf = request->buf;
         if (!_xbt_replay_is_active() && oldbuf && request->size!=0){
           if((smpi_privatize_global_variables)
-             && ((char*)request->buf >= start_data_exe)
-             && ((char*)request->buf < start_data_exe + size_data_exe )){
-            XBT_DEBUG("Privatization : We are sending from a zone inside global memory. Switch data segment ");
-                   switch_data_segment(smpi_process_index());
-         }
+           && ((char*)request->buf >= start_data_exe)
+           && ((char*)request->buf < start_data_exe + size_data_exe )
+       ){
+                 XBT_WARN("Privatization : We are sending from a zone inside global memory. Switch data segment ");
+                 switch_data_segment(smpi_process_index());
+       }
+
+
           buf = xbt_malloc(request->size);
           memcpy(buf,oldbuf,request->size);
         }
index fe8f3b4..126d181 100644 (file)
@@ -590,18 +590,11 @@ void switch_data_segment(int dest){
 
   if (loaded_page==dest)//no need to switch either
     return;
-
-
 #ifdef HAVE_MMAP
-  int i;
-  if(loaded_page==-1){//initial switch, do the copy from the real page here
-    for (i=0; i< SIMIX_process_count(); i++){
-      memcpy(mappings[i],TOPAGE(start_data_exe),size_data_exe);
-    }
-  }
   int current= fds[dest];
   XBT_VERB("Switching data frame to the one of process %d", dest);
   void* tmp = mmap (TOPAGE(start_data_exe), size_data_exe, PROT_READ | PROT_WRITE, MAP_FIXED | MAP_SHARED, current, 0);
+  msync(TOPAGE(start_data_exe), size_data_exe, MS_SYNC | MS_INVALIDATE );
   if (tmp != TOPAGE(start_data_exe))
     xbt_die("Couldn't map the new region");
   loaded_page=dest;
index 75815c1..60e550f 100644 (file)
@@ -72,7 +72,6 @@ void smpi_process_init(int *argc, char ***argv)
 #ifdef SMPI_F2C
     smpi_current_rank = index;
 #endif
-
     data = smpi_process_remote_data(index);
     simcall_process_set_data(proc, data);
     if (*argc > 2) {
@@ -86,11 +85,6 @@ void smpi_process_init(int *argc, char ***argv)
     // set the process attached to the mailbox
     simcall_rdv_set_receiver(data->mailbox_small, proc);
     XBT_DEBUG("<%d> New process in the game: %p", index, proc);
-
-    if(smpi_privatize_global_variables){
-      switch_data_segment(index);
-    }
-
   }
   if (smpi_process_data() == NULL)
     xbt_die("smpi_process_data() returned NULL. You probably gave a NULL parameter to MPI_Init. Although it's required by MPI-2, this is currently not supported by SMPI.");
@@ -99,9 +93,6 @@ void smpi_process_init(int *argc, char ***argv)
 void smpi_process_destroy(void)
 {
   int index = smpi_process_index();
-  if(smpi_privatize_global_variables){
-    switch_data_segment(index);
-  }
   process_data[index]->state = SMPI_FINALIZED;
   XBT_DEBUG("<%d> Process left the game", index);
 }
@@ -343,7 +334,7 @@ static void smpi_comm_copy_buffer_callback(smx_action_t comm,
       && ((char*)buff >= start_data_exe)
       && ((char*)buff < start_data_exe + size_data_exe )
     ){
-       XBT_DEBUG("Privatization : We are copying from a zone inside global memory... Saving data to temp buffer !");
+       XBT_WARN("Privatization : We are copying from a zone inside global memory... Saving data to temp buffer !");
        switch_data_segment(((smpi_process_data_t)SIMIX_process_get_data(comm->comm.src_proc))->index);
        tmpbuff = (void*)xbt_malloc(buff_size);
        memcpy(tmpbuff, buff, buff_size);
@@ -354,7 +345,7 @@ static void smpi_comm_copy_buffer_callback(smx_action_t comm,
       && ((char*)comm->comm.dst_buff >= start_data_exe)
       && ((char*)comm->comm.dst_buff < start_data_exe + size_data_exe )
     ){
-       XBT_DEBUG("Privatization : We are copying to a zone inside global memory - Switch data segment");
+       XBT_WARN("Privatization : We are copying to a zone inside global memory - Switch data segment");
        switch_data_segment(((smpi_process_data_t)SIMIX_process_get_data(comm->comm.dst_proc))->index);
   }
 
index 5b51a9b..cfd9b5b 100644 (file)
@@ -93,12 +93,14 @@ int PMPI_Query_thread(int *provided)
 {
   int retval = 0;
 
+  smpi_bench_end();
   if (provided == NULL) {
     retval = MPI_ERR_ARG;
   } else {
     *provided = MPI_THREAD_MULTIPLE;
     retval = MPI_SUCCESS;
   }
+  smpi_bench_begin();
   return retval;
 }
 
@@ -106,12 +108,14 @@ int PMPI_Is_thread_main(int *flag)
 {
   int retval = 0;
 
+  smpi_bench_end();
   if (flag == NULL) {
     retval = MPI_ERR_ARG;
   } else {
     *flag = smpi_process_index() == 0;
     retval = MPI_SUCCESS;
   }
+  smpi_bench_begin();
   return retval;
 }
 
@@ -147,12 +151,14 @@ int PMPI_Address(void *location, MPI_Aint * address)
 {
   int retval = 0;
 
+  smpi_bench_end();
   if (!address) {
     retval = MPI_ERR_ARG;
   } else {
     *address = (MPI_Aint) location;
     retval = MPI_SUCCESS;
   }
+  smpi_bench_begin();
   return retval;
 }
 
@@ -165,12 +171,14 @@ int PMPI_Type_free(MPI_Datatype * datatype)
 {
   int retval = 0;
 
+  smpi_bench_end();
   if (!datatype) {
     retval = MPI_ERR_ARG;
   } else {
     smpi_datatype_free(datatype);
     retval = MPI_SUCCESS;
   }
+  smpi_bench_begin();
   return retval;
 }
 
@@ -178,6 +186,7 @@ int PMPI_Type_size(MPI_Datatype datatype, int *size)
 {
   int retval = 0;
 
+  smpi_bench_end();
   if (datatype == MPI_DATATYPE_NULL) {
     retval = MPI_ERR_TYPE;
   } else if (size == NULL) {
@@ -186,6 +195,7 @@ int PMPI_Type_size(MPI_Datatype datatype, int *size)
     *size = (int) smpi_datatype_size(datatype);
     retval = MPI_SUCCESS;
   }
+  smpi_bench_begin();
   return retval;
 }
 
@@ -193,6 +203,7 @@ int PMPI_Type_get_extent(MPI_Datatype datatype, MPI_Aint * lb, MPI_Aint * extent
 {
   int retval = 0;
 
+  smpi_bench_end();
   if (datatype == MPI_DATATYPE_NULL) {
     retval = MPI_ERR_TYPE;
   } else if (lb == NULL || extent == NULL) {
@@ -200,6 +211,7 @@ int PMPI_Type_get_extent(MPI_Datatype datatype, MPI_Aint * lb, MPI_Aint * extent
   } else {
     retval = smpi_datatype_extent(datatype, lb, extent);
   }
+  smpi_bench_begin();
   return retval;
 }
 
@@ -212,6 +224,7 @@ int PMPI_Type_extent(MPI_Datatype datatype, MPI_Aint * extent)
 {
   int retval = 0;
 
+  smpi_bench_end();
   if (datatype == MPI_DATATYPE_NULL) {
     retval = MPI_ERR_TYPE;
   } else if (extent == NULL) {
@@ -220,6 +233,7 @@ int PMPI_Type_extent(MPI_Datatype datatype, MPI_Aint * extent)
     *extent = smpi_datatype_get_extent(datatype);
     retval = MPI_SUCCESS;
   }
+  smpi_bench_begin();
   return retval;
 }
 
@@ -227,6 +241,7 @@ int PMPI_Type_lb(MPI_Datatype datatype, MPI_Aint * disp)
 {
   int retval = 0;
 
+  smpi_bench_end();
   if (datatype == MPI_DATATYPE_NULL) {
     retval = MPI_ERR_TYPE;
   } else if (disp == NULL) {
@@ -235,6 +250,7 @@ int PMPI_Type_lb(MPI_Datatype datatype, MPI_Aint * disp)
     *disp = smpi_datatype_lb(datatype);
     retval = MPI_SUCCESS;
   }
+  smpi_bench_begin();
   return retval;
 }
 
@@ -242,6 +258,7 @@ int PMPI_Type_ub(MPI_Datatype datatype, MPI_Aint * disp)
 {
   int retval = 0;
 
+  smpi_bench_end();
   if (datatype == MPI_DATATYPE_NULL) {
     retval = MPI_ERR_TYPE;
   } else if (disp == NULL) {
@@ -250,6 +267,7 @@ int PMPI_Type_ub(MPI_Datatype datatype, MPI_Aint * disp)
     *disp = smpi_datatype_ub(datatype);
     retval = MPI_SUCCESS;
   }
+  smpi_bench_begin();
   return retval;
 }
 
@@ -257,12 +275,14 @@ int PMPI_Op_create(MPI_User_function * function, int commute, MPI_Op * op)
 {
   int retval = 0;
 
+  smpi_bench_end();
   if (function == NULL || op == NULL) {
     retval = MPI_ERR_ARG;
   } else {
     *op = smpi_op_new(function, commute);
     retval = MPI_SUCCESS;
   }
+  smpi_bench_begin();
   return retval;
 }
 
@@ -270,6 +290,7 @@ int PMPI_Op_free(MPI_Op * op)
 {
   int retval = 0;
 
+  smpi_bench_end();
   if (op == NULL) {
     retval = MPI_ERR_ARG;
   } else if (*op == MPI_OP_NULL) {
@@ -279,6 +300,7 @@ int PMPI_Op_free(MPI_Op * op)
     *op = MPI_OP_NULL;
     retval = MPI_SUCCESS;
   }
+  smpi_bench_begin();
   return retval;
 }
 
@@ -286,6 +308,7 @@ int PMPI_Group_free(MPI_Group * group)
 {
   int retval = 0;
 
+  smpi_bench_end();
   if (group == NULL) {
     retval = MPI_ERR_ARG;
   } else {
@@ -293,6 +316,7 @@ int PMPI_Group_free(MPI_Group * group)
     *group = MPI_GROUP_NULL;
     retval = MPI_SUCCESS;
   }
+  smpi_bench_begin();
   return retval;
 }
 
@@ -300,6 +324,7 @@ int PMPI_Group_size(MPI_Group group, int *size)
 {
   int retval = 0;
 
+  smpi_bench_end();
   if (group == MPI_GROUP_NULL) {
     retval = MPI_ERR_GROUP;
   } else if (size == NULL) {
@@ -308,6 +333,7 @@ int PMPI_Group_size(MPI_Group group, int *size)
     *size = smpi_group_size(group);
     retval = MPI_SUCCESS;
   }
+  smpi_bench_begin();
   return retval;
 }
 
@@ -315,6 +341,7 @@ int PMPI_Group_rank(MPI_Group group, int *rank)
 {
   int retval = 0;
 
+  smpi_bench_end();
   if (group == MPI_GROUP_NULL) {
     retval = MPI_ERR_GROUP;
   } else if (rank == NULL) {
@@ -323,6 +350,7 @@ int PMPI_Group_rank(MPI_Group group, int *rank)
     *rank = smpi_group_rank(group, smpi_process_index());
     retval = MPI_SUCCESS;
   }
+  smpi_bench_begin();
   return retval;
 }
 
@@ -330,6 +358,7 @@ int PMPI_Group_translate_ranks(MPI_Group group1, int n, int *ranks1,
                               MPI_Group group2, int *ranks2)
 {
   int retval, i, index;
+  smpi_bench_end();
   if (group1 == MPI_GROUP_NULL || group2 == MPI_GROUP_NULL) {
     retval = MPI_ERR_GROUP;
   } else {
@@ -343,6 +372,7 @@ int PMPI_Group_translate_ranks(MPI_Group group1, int n, int *ranks1,
     }
     retval = MPI_SUCCESS;
   }
+  smpi_bench_begin();
   return retval;
 }
 
@@ -350,6 +380,7 @@ int PMPI_Group_compare(MPI_Group group1, MPI_Group group2, int *result)
 {
   int retval = 0;
 
+  smpi_bench_end();
   if (group1 == MPI_GROUP_NULL || group2 == MPI_GROUP_NULL) {
     retval = MPI_ERR_GROUP;
   } else if (result == NULL) {
@@ -358,6 +389,7 @@ int PMPI_Group_compare(MPI_Group group1, MPI_Group group2, int *result)
     *result = smpi_group_compare(group1, group2);
     retval = MPI_SUCCESS;
   }
+  smpi_bench_begin();
   return retval;
 }
 
@@ -366,6 +398,7 @@ int PMPI_Group_union(MPI_Group group1, MPI_Group group2,
 {
   int retval, i, proc1, proc2, size, size2;
 
+  smpi_bench_end();
   if (group1 == MPI_GROUP_NULL || group2 == MPI_GROUP_NULL) {
     retval = MPI_ERR_GROUP;
   } else if (newgroup == NULL) {
@@ -396,6 +429,7 @@ int PMPI_Group_union(MPI_Group group1, MPI_Group group2,
     }
     retval = MPI_SUCCESS;
   }
+  smpi_bench_begin();
   return retval;
 }
 
@@ -404,6 +438,7 @@ int PMPI_Group_intersection(MPI_Group group1, MPI_Group group2,
 {
   int retval, i, proc1, proc2, size;
 
+  smpi_bench_end();
   if (group1 == MPI_GROUP_NULL || group2 == MPI_GROUP_NULL) {
     retval = MPI_ERR_GROUP;
   } else if (newgroup == NULL) {
@@ -433,6 +468,7 @@ int PMPI_Group_intersection(MPI_Group group1, MPI_Group group2,
     }
     retval = MPI_SUCCESS;
   }
+  smpi_bench_begin();
   return retval;
 }
 
@@ -440,6 +476,7 @@ int PMPI_Group_difference(MPI_Group group1, MPI_Group group2, MPI_Group * newgro
 {
   int retval, i, proc1, proc2, size, size2;
 
+  smpi_bench_end();
   if (group1 == MPI_GROUP_NULL || group2 == MPI_GROUP_NULL) {
     retval = MPI_ERR_GROUP;
   } else if (newgroup == NULL) {
@@ -467,6 +504,7 @@ int PMPI_Group_difference(MPI_Group group1, MPI_Group group2, MPI_Group * newgro
     }
     retval = MPI_SUCCESS;
   }
+  smpi_bench_begin();
   return retval;
 }
 
@@ -474,6 +512,7 @@ int PMPI_Group_incl(MPI_Group group, int n, int *ranks, MPI_Group * newgroup)
 {
   int retval, i, index;
 
+  smpi_bench_end();
   if (group == MPI_GROUP_NULL) {
     retval = MPI_ERR_GROUP;
   } else if (newgroup == NULL) {
@@ -497,6 +536,7 @@ int PMPI_Group_incl(MPI_Group group, int n, int *ranks, MPI_Group * newgroup)
     }
     retval = MPI_SUCCESS;
   }
+  smpi_bench_begin();
   return retval;
 }
 
@@ -504,6 +544,7 @@ int PMPI_Group_excl(MPI_Group group, int n, int *ranks, MPI_Group * newgroup)
 {
   int retval, i, j, newsize, oldsize, index;
 
+  smpi_bench_end();
   if (group == MPI_GROUP_NULL) {
     retval = MPI_ERR_GROUP;
   } else if (newgroup == NULL) {
@@ -542,6 +583,7 @@ int PMPI_Group_excl(MPI_Group group, int n, int *ranks, MPI_Group * newgroup)
     }
     retval = MPI_SUCCESS;
   }
+  smpi_bench_begin();
   return retval;
 }
 
@@ -550,6 +592,7 @@ int PMPI_Group_range_incl(MPI_Group group, int n, int ranges[][3],
 {
   int retval, i, j, rank, size, index;
 
+  smpi_bench_end();
   if (group == MPI_GROUP_NULL) {
     retval = MPI_ERR_GROUP;
   } else if (newgroup == NULL) {
@@ -598,6 +641,7 @@ int PMPI_Group_range_incl(MPI_Group group, int n, int ranges[][3],
     }
     retval = MPI_SUCCESS;
   }
+  smpi_bench_begin();
   return retval;
 }
 
@@ -606,6 +650,7 @@ int PMPI_Group_range_excl(MPI_Group group, int n, int ranges[][3],
 {
   int retval, i, rank, newrank,oldrank, size, index, add;
 
+  smpi_bench_end();
   if (group == MPI_GROUP_NULL) {
     retval = MPI_ERR_GROUP;
   } else if (newgroup == NULL) {
@@ -674,12 +719,15 @@ int PMPI_Group_range_excl(MPI_Group group, int n, int ranges[][3],
 
     retval = MPI_SUCCESS;
   }
+  smpi_bench_begin();
   return retval;
 }
 
 int PMPI_Comm_rank(MPI_Comm comm, int *rank)
 {
   int retval = 0;
+
+  smpi_bench_end();
   if (comm == MPI_COMM_NULL) {
     retval = MPI_ERR_COMM;
   } else if (rank == NULL) {
@@ -688,12 +736,15 @@ int PMPI_Comm_rank(MPI_Comm comm, int *rank)
     *rank = smpi_comm_rank(comm);
     retval = MPI_SUCCESS;
   }
+  smpi_bench_begin();
   return retval;
 }
 
 int PMPI_Comm_size(MPI_Comm comm, int *size)
 {
   int retval = 0;
+
+  smpi_bench_end();
   if (comm == MPI_COMM_NULL) {
     retval = MPI_ERR_COMM;
   } else if (size == NULL) {
@@ -702,6 +753,7 @@ int PMPI_Comm_size(MPI_Comm comm, int *size)
     *size = smpi_comm_size(comm);
     retval = MPI_SUCCESS;
   }
+  smpi_bench_begin();
   return retval;
 }
 
@@ -709,6 +761,7 @@ int PMPI_Comm_get_name (MPI_Comm comm, char* name, int* len)
 {
   int retval = 0;
 
+  smpi_bench_end();
   if (comm == MPI_COMM_NULL)  {
     retval = MPI_ERR_COMM;
   } else if (name == NULL || len == NULL)  {
@@ -717,6 +770,7 @@ int PMPI_Comm_get_name (MPI_Comm comm, char* name, int* len)
     smpi_comm_get_name(comm, name, len);
     retval = MPI_SUCCESS;
   }
+  smpi_bench_begin();
   return retval;
 }
 
@@ -724,6 +778,7 @@ int PMPI_Comm_group(MPI_Comm comm, MPI_Group * group)
 {
   int retval = 0;
 
+  smpi_bench_end();
   if (comm == MPI_COMM_NULL) {
     retval = MPI_ERR_COMM;
   } else if (group == NULL) {
@@ -737,6 +792,7 @@ int PMPI_Comm_group(MPI_Comm comm, MPI_Group * group)
     smpi_group_use(*group);
     retval = MPI_SUCCESS;
   }
+  smpi_bench_begin();
   return retval;
 }
 
@@ -744,6 +800,7 @@ int PMPI_Comm_compare(MPI_Comm comm1, MPI_Comm comm2, int *result)
 {
   int retval = 0;
 
+  smpi_bench_end();
   if (comm1 == MPI_COMM_NULL || comm2 == MPI_COMM_NULL) {
     retval = MPI_ERR_COMM;
   } else if (result == NULL) {
@@ -761,6 +818,7 @@ int PMPI_Comm_compare(MPI_Comm comm1, MPI_Comm comm2, int *result)
     }
     retval = MPI_SUCCESS;
   }
+  smpi_bench_begin();
   return retval;
 }
 
@@ -768,6 +826,7 @@ int PMPI_Comm_dup(MPI_Comm comm, MPI_Comm * newcomm)
 {
   int retval = 0;
 
+  smpi_bench_end();
   if (comm == MPI_COMM_NULL) {
     retval = MPI_ERR_COMM;
   } else if (newcomm == NULL) {
@@ -776,6 +835,7 @@ int PMPI_Comm_dup(MPI_Comm comm, MPI_Comm * newcomm)
     *newcomm = smpi_comm_new(smpi_comm_group(comm));
     retval = MPI_SUCCESS;
   }
+  smpi_bench_begin();
   return retval;
 }
 
@@ -783,6 +843,7 @@ int PMPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm * newcomm)
 {
   int retval = 0;
 
+  smpi_bench_end();
   if (comm == MPI_COMM_NULL) {
     retval = MPI_ERR_COMM;
   } else if (group == MPI_GROUP_NULL) {
@@ -797,6 +858,7 @@ int PMPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm * newcomm)
     *newcomm = smpi_comm_new(group);
     retval = MPI_SUCCESS;
   }
+  smpi_bench_begin();
   return retval;
 }
 
@@ -804,6 +866,7 @@ int PMPI_Comm_free(MPI_Comm * comm)
 {
   int retval = 0;
 
+  smpi_bench_end();
   if (comm == NULL) {
     retval = MPI_ERR_ARG;
   } else if (*comm == MPI_COMM_NULL) {
@@ -813,6 +876,7 @@ int PMPI_Comm_free(MPI_Comm * comm)
     *comm = MPI_COMM_NULL;
     retval = MPI_SUCCESS;
   }
+  smpi_bench_begin();
   return retval;
 }
 
@@ -821,6 +885,7 @@ int PMPI_Comm_disconnect(MPI_Comm * comm)
   /* TODO: wait until all communication in comm are done */
   int retval = 0;
 
+  smpi_bench_end();
   if (comm == NULL) {
     retval = MPI_ERR_ARG;
   } else if (*comm == MPI_COMM_NULL) {
@@ -830,14 +895,15 @@ int PMPI_Comm_disconnect(MPI_Comm * comm)
     *comm = MPI_COMM_NULL;
     retval = MPI_SUCCESS;
   }
+  smpi_bench_begin();
   return retval;
 }
 
 int PMPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm* comm_out)
 {
   int retval = 0;
-  smpi_bench_end();
 
+  smpi_bench_end();
   if (comm_out == NULL) {
     retval = MPI_ERR_ARG;
   } else if (comm == MPI_COMM_NULL) {
@@ -847,7 +913,6 @@ int PMPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm* comm_out)
     retval = MPI_SUCCESS;
   }
   smpi_bench_begin();
-
   return retval;
 }
 
@@ -2360,6 +2425,7 @@ int PMPI_Get_processor_name(char *name, int *resultlen)
 {
   int retval = MPI_SUCCESS;
 
+  smpi_bench_end();
   strncpy(name, SIMIX_host_get_name(SIMIX_host_self()),
           strlen(SIMIX_host_get_name(SIMIX_host_self())) < MPI_MAX_PROCESSOR_NAME - 1 ?
           strlen(SIMIX_host_get_name(SIMIX_host_self())) +1 :
@@ -2368,6 +2434,7 @@ int PMPI_Get_processor_name(char *name, int *resultlen)
       strlen(name) >
       MPI_MAX_PROCESSOR_NAME ? MPI_MAX_PROCESSOR_NAME : strlen(name);
 
+  smpi_bench_begin();
   return retval;
 }
 
@@ -2376,6 +2443,7 @@ int PMPI_Get_count(MPI_Status * status, MPI_Datatype datatype, int *count)
   int retval = MPI_SUCCESS;
   size_t size;
 
+  smpi_bench_end();
   if (status == NULL || count == NULL) {
     retval = MPI_ERR_ARG;
   } else if (datatype == MPI_DATATYPE_NULL) {
@@ -2390,12 +2458,14 @@ int PMPI_Get_count(MPI_Status * status, MPI_Datatype datatype, int *count)
       *count = smpi_mpi_get_count(status, datatype);
     }
   }
+  smpi_bench_begin();
   return retval;
 }
 
 int PMPI_Type_contiguous(int count, MPI_Datatype old_type, MPI_Datatype* new_type) {
   int retval = 0;
 
+  smpi_bench_end();
   if (old_type == MPI_DATATYPE_NULL) {
     retval = MPI_ERR_TYPE;
   } else if (count<0){
@@ -2403,18 +2473,21 @@ int PMPI_Type_contiguous(int count, MPI_Datatype old_type, MPI_Datatype* new_typ
   } else {
     retval = smpi_datatype_contiguous(count, old_type, new_type, 0);
   }
+  smpi_bench_begin();
   return retval;
 }
 
 int PMPI_Type_commit(MPI_Datatype* datatype) {
   int retval = 0;
 
+  smpi_bench_end();
   if (datatype == NULL || *datatype == MPI_DATATYPE_NULL) {
     retval = MPI_ERR_TYPE;
   } else {
     smpi_datatype_commit(datatype);
     retval = MPI_SUCCESS;
   }
+  smpi_bench_begin();
   return retval;
 }
 
@@ -2422,6 +2495,7 @@ int PMPI_Type_commit(MPI_Datatype* datatype) {
 int PMPI_Type_vector(int count, int blocklen, int stride, MPI_Datatype old_type, MPI_Datatype* new_type) {
   int retval = 0;
 
+  smpi_bench_end();
   if (old_type == MPI_DATATYPE_NULL) {
     retval = MPI_ERR_TYPE;
   } else if (count<0 || blocklen<0){
@@ -2429,12 +2503,14 @@ int PMPI_Type_vector(int count, int blocklen, int stride, MPI_Datatype old_type,
   } else {
     retval = smpi_datatype_vector(count, blocklen, stride, old_type, new_type);
   }
+  smpi_bench_begin();
   return retval;
 }
 
 int PMPI_Type_hvector(int count, int blocklen, MPI_Aint stride, MPI_Datatype old_type, MPI_Datatype* new_type) {
   int retval = 0;
 
+  smpi_bench_end();
   if (old_type == MPI_DATATYPE_NULL) {
     retval = MPI_ERR_TYPE;
   } else if (count<0 || blocklen<0){
@@ -2442,6 +2518,7 @@ int PMPI_Type_hvector(int count, int blocklen, MPI_Aint stride, MPI_Datatype old
   } else {
     retval = smpi_datatype_hvector(count, blocklen, stride, old_type, new_type);
   }
+  smpi_bench_begin();
   return retval;
 }
 
@@ -2452,6 +2529,7 @@ int PMPI_Type_create_hvector(int count, int blocklen, MPI_Aint stride, MPI_Datat
 int PMPI_Type_indexed(int count, int* blocklens, int* indices, MPI_Datatype old_type, MPI_Datatype* new_type) {
   int retval = 0;
 
+  smpi_bench_end();
   if (old_type == MPI_DATATYPE_NULL) {
     retval = MPI_ERR_TYPE;
   } else if (count<0){
@@ -2459,12 +2537,14 @@ int PMPI_Type_indexed(int count, int* blocklens, int* indices, MPI_Datatype old_
   } else {
     retval = smpi_datatype_indexed(count, blocklens, indices, old_type, new_type);
   }
+  smpi_bench_begin();
   return retval;
 }
 
 int PMPI_Type_create_indexed(int count, int* blocklens, int* indices, MPI_Datatype old_type, MPI_Datatype* new_type) {
   int retval = 0;
 
+  smpi_bench_end();
   if (old_type == MPI_DATATYPE_NULL) {
     retval = MPI_ERR_TYPE;
   } else if (count<0){
@@ -2472,12 +2552,14 @@ int PMPI_Type_create_indexed(int count, int* blocklens, int* indices, MPI_Dataty
   } else {
     retval = smpi_datatype_indexed(count, blocklens, indices, old_type, new_type);
   }
+  smpi_bench_begin();
   return retval;
 }
 
 int PMPI_Type_create_indexed_block(int count, int blocklength, int* indices, MPI_Datatype old_type, MPI_Datatype* new_type) {
   int retval,i;
 
+  smpi_bench_end();
   if (old_type == MPI_DATATYPE_NULL) {
     retval = MPI_ERR_TYPE;
   } else if (count<0){
@@ -2488,6 +2570,7 @@ int PMPI_Type_create_indexed_block(int count, int blocklength, int* indices, MPI
     retval = smpi_datatype_indexed(count, blocklens, indices, old_type, new_type);
     xbt_free(blocklens);
   }
+  smpi_bench_begin();
   return retval;
 }
 
@@ -2495,6 +2578,7 @@ int PMPI_Type_create_indexed_block(int count, int blocklength, int* indices, MPI
 int PMPI_Type_hindexed(int count, int* blocklens, MPI_Aint* indices, MPI_Datatype old_type, MPI_Datatype* new_type) {
   int retval = 0;
 
+  smpi_bench_end();
   if (old_type == MPI_DATATYPE_NULL) {
     retval = MPI_ERR_TYPE;
   } else if (count<0){
@@ -2502,6 +2586,7 @@ int PMPI_Type_hindexed(int count, int* blocklens, MPI_Aint* indices, MPI_Datatyp
   } else {
     retval = smpi_datatype_hindexed(count, blocklens, indices, old_type, new_type);
   }
+  smpi_bench_begin();
   return retval;
 }
 
@@ -2512,6 +2597,7 @@ int PMPI_Type_create_hindexed(int count, int* blocklens, MPI_Aint* indices, MPI_
 int PMPI_Type_create_hindexed_block(int count, int blocklength, MPI_Aint* indices, MPI_Datatype old_type, MPI_Datatype* new_type) {
   int retval,i;
 
+  smpi_bench_end();
   if (old_type == MPI_DATATYPE_NULL) {
     retval = MPI_ERR_TYPE;
   } else if (count<0){
@@ -2522,6 +2608,7 @@ int PMPI_Type_create_hindexed_block(int count, int blocklength, MPI_Aint* indice
     retval = smpi_datatype_hindexed(count, blocklens, indices, old_type, new_type);
     xbt_free(blocklens);
   }
+  smpi_bench_begin();
   return retval;
 }
 
@@ -2529,11 +2616,13 @@ int PMPI_Type_create_hindexed_block(int count, int blocklength, MPI_Aint* indice
 int PMPI_Type_struct(int count, int* blocklens, MPI_Aint* indices, MPI_Datatype* old_types, MPI_Datatype* new_type) {
   int retval = 0;
 
+  smpi_bench_end();
   if (count<0){
     retval = MPI_ERR_COUNT;
   } else {
     retval = smpi_datatype_struct(count, blocklens, indices, old_types, new_type);
   }
+  smpi_bench_begin();
   return retval;
 }
 
index 246f48f..736b29e 100644 (file)
@@ -25,8 +25,8 @@ CpuPtr getActionCpu(CpuActionPtr action) {
 
 surf_callback(void, CpuPtr) cpuCreatedCallbacks;
 surf_callback(void, CpuPtr) cpuDestructedCallbacks;
-surf_callback(void, CpuPtr, e_surf_resource_state_t, e_surf_resource_state_t) cpuStateChangedCallbacks;
-surf_callback(void, CpuActionPtr, e_surf_action_state_t, e_surf_action_state_t) cpuActionStateChangedCallbacks;
+surf_callback(void, CpuPtr) cpuStateChangedCallbacks;
+surf_callback(void, CpuActionPtr) cpuActionStateChangedCallbacks;
 
 /*********
  * Model *
@@ -203,9 +203,8 @@ int Cpu::getCore()
 
 void Cpu::setState(e_surf_resource_state_t state)
 {
-  e_surf_resource_state_t old = Resource::getState();
   Resource::setState(state);
-  surf_callback_emit(cpuStateChangedCallbacks, this, old, state);
+  surf_callback_emit(cpuStateChangedCallbacks, this);
 }
 /**********
  * Action *
@@ -310,7 +309,6 @@ void CpuAction::setAffinity(CpuPtr cpu, unsigned long mask)
 }
 
 void CpuAction::setState(e_surf_action_state_t state){
-  e_surf_action_state_t old = getState();
   Action::setState(state);
-  surf_callback_emit(cpuActionStateChangedCallbacks, this, old, state);
+  surf_callback_emit(cpuActionStateChangedCallbacks, this);
 }
index 7e2203f..c72e0f5 100644 (file)
@@ -31,28 +31,28 @@ typedef CpuPlugin *CpuPluginPtr;
 CpuPtr getActionCpu(CpuActionPtr action);
 
 /** @ingroup SURF_callbacks
- * @brief Callbacks handler which emit the callbacks after Cpu creation *
+ * @brief Callbacks handler which emit the callbacks after Cpu creation * 
  * @details Callback functions have the following signature: `void(CpuPtr)`
  */
 extern surf_callback(void, CpuPtr) cpuCreatedCallbacks;
 
 /** @ingroup SURF_callbacks
- * @brief Callbacks handler which emit the callbacks after Cpu destruction *
+ * @brief Callbacks handler which emit the callbacks after Cpu destruction * 
  * @details Callback functions have the following signature: `void(CpuPtr)`
  */
 extern surf_callback(void, CpuPtr) cpuDestructedCallbacks;
 
 /** @ingroup SURF_callbacks
- * @brief Callbacks handler which emit the callbacks after Cpu State changed *
- * @details Callback functions have the following signature: `void(CpuActionPtr action, e_surf_resource_state_t old, e_surf_resource_state_t current)`
+ * @brief Callbacks handler which emit the callbacks after Cpu State changed * 
+ * @details Callback functions have the following signature: `void(CpuActionPtr)`
  */
-extern surf_callback(void, CpuPtr, e_surf_resource_state_t, e_surf_resource_state_t) cpuStateChangedCallbacks;
+extern surf_callback(void, CpuPtr) cpuStateChangedCallbacks;
 
 /** @ingroup SURF_callbacks
- * @brief Callbacks handler which emit the callbacks after CpuAction State changed *
- * @details Callback functions have the following signature: `void(CpuActionPtr action, e_surf_action_state_t old, e_surf_action_state_t current)`
+ * @brief Callbacks handler which emit the callbacks after CpuAction State changed * 
+ * @details Callback functions have the following signature: `void(CpuActionPtr)`
  */
-extern surf_callback(void, CpuActionPtr, e_surf_action_state_t, e_surf_action_state_t) cpuActionStateChangedCallbacks;
+extern surf_callback(void, CpuActionPtr) cpuActionStateChangedCallbacks;
 
 /*********
  * Model *
@@ -66,16 +66,16 @@ class CpuModel : public Model {
 public:
   /**
    * @brief CpuModel constructor
-   *
+   * 
    * @param name The name of the model
    */
   CpuModel(const char *name) : Model(name) {};
 
   /**
    * @brief Create a Cpu
-   *
+   * 
    * @param name The name of the Cpu
-   *
+   * 
    * @return The created Cpu
    */
   CpuPtr createResource(string name);
@@ -105,7 +105,7 @@ public:
 
   /**
    * @brief Cpu constructor
-   *
+   * 
    * @param model The CpuModel associated to this Cpu
    * @param name The name of the Cpu
    * @param props Dictionary of properties associated to this Cpu
@@ -119,7 +119,7 @@ public:
 
   /**
    * @brief Cpu constructor
-   *
+   * 
    * @param model The CpuModel associated to this Cpu
    * @param name The name of the Cpu
    * @param props Dictionary of properties associated to this Cpu
@@ -137,7 +137,7 @@ public:
 
   /**
    * @brief Execute some quantity of computation
-   *
+   * 
    * @param size The value of the processing amount (in flop) needed to process
    * @return The CpuAction corresponding to the processing
    */
@@ -145,7 +145,7 @@ public:
 
   /**
    * @brief Make a process sleep for duration (in seconds)
-   *
+   * 
    * @param duration The number of seconds to sleep
    * @return The CpuAction corresponding to the sleeping
    */
@@ -153,7 +153,7 @@ public:
 
   /**
    * @brief Get the number of cores of the current Cpu
-   *
+   * 
    * @return The number of cores of the current Cpu
    */
   virtual int getCore();
@@ -161,9 +161,9 @@ public:
   /**
    * @brief Get the speed of the current Cpu
    * @details [TODO] load * m_powerPeak
-   *
+   * 
    * @param load [TODO]
-   *
+   * 
    * @return The speed of the current Cpu
    */
   virtual double getSpeed(double load);
@@ -171,23 +171,23 @@ public:
   /**
    * @brief Get the available speed of the current Cpu
    * @details [TODO]
-   *
+   * 
    * @return The available speed of the current Cpu
    */
   virtual double getAvailableSpeed();
 
   /**
    * @brief Get the current Cpu power peak
-   *
+   * 
    * @return The current Cpu power peak
    */
   virtual double getCurrentPowerPeak()=0;
 
 
   virtual double getPowerPeakAt(int pstate_index)=0;
-
+  
   virtual int getNbPstates()=0;
-
+  
   virtual void setPowerPeakAt(int pstate_index)=0;
 
   void setState(e_surf_resource_state_t state);
@@ -220,7 +220,7 @@ public:
 
   /**
    * @brief CpuAction constructor
-   *
+   * 
    * @param model The CpuModel associated to this CpuAction
    * @param cost [TODO]
    * @param failed [TODO]
@@ -230,7 +230,7 @@ public:
 
   /**
    * @brief CpuAction constructor
-   *
+   * 
    * @param model The CpuModel associated to this CpuAction
    * @param cost [TODO]
    * @param failed [TODO]
@@ -242,7 +242,7 @@ public:
   /**
    * @brief Set the affinity of the current CpuAction
    * @details [TODO]
-   *
+   * 
    * @param cpu [TODO]
    * @param mask [TODO]
    */
index 66e5883..b80ddfd 100644 (file)
@@ -482,7 +482,6 @@ ActionPtr NetworkCm02Model::communicate(RoutingEdgePtr src, RoutingEdgePtr dst,
   xbt_dynar_free(&route);
   XBT_OUT();
 
-  surf_callback_emit(networkCommunicateCallbacks, action, src, dst, size, rate);
   return action;
 }
 
@@ -531,11 +530,59 @@ void NetworkCm02Link::updateState(tmgr_trace_event_t event_type,
   /*     value, event_type); */
 
   if (event_type == p_power.event) {
-    updateBandwidth(value, date);
+    double delta =
+        sg_weight_S_parameter / value - sg_weight_S_parameter /
+        (p_power.peak * p_power.scale);
+    lmm_variable_t var = NULL;
+    lmm_element_t elem = NULL;
+    NetworkCm02ActionPtr action = NULL;
+
+    p_power.peak = value;
+    lmm_update_constraint_bound(getModel()->getMaxminSystem(),
+                                   getConstraint(),
+                                sg_bandwidth_factor *
+                                (p_power.peak * p_power.scale));
+#ifdef HAVE_TRACING
+    TRACE_surf_link_set_bandwidth(date, getName(), sg_bandwidth_factor * p_power.peak * p_power.scale);
+#endif
+    if (sg_weight_S_parameter > 0) {
+      while ((var = lmm_get_var_from_cnst(getModel()->getMaxminSystem(), getConstraint(), &elem))) {
+        action = (NetworkCm02ActionPtr) lmm_variable_id(var);
+        action->m_weight += delta;
+        if (!action->isSuspended())
+          lmm_update_variable_weight(getModel()->getMaxminSystem(), action->getVariable(), action->m_weight);
+      }
+    }
     if (tmgr_trace_event_free(event_type))
       p_power.event = NULL;
   } else if (event_type == p_latEvent) {
-    updateLatency(value, date);
+    double delta = value - m_latCurrent;
+    lmm_variable_t var = NULL;
+    lmm_element_t elem = NULL;
+    NetworkCm02ActionPtr action = NULL;
+
+    m_latCurrent = value;
+    while ((var = lmm_get_var_from_cnst(getModel()->getMaxminSystem(), getConstraint(), &elem))) {
+      action = (NetworkCm02ActionPtr) lmm_variable_id(var);
+      action->m_latCurrent += delta;
+      action->m_weight += delta;
+      if (action->m_rate < 0)
+        lmm_update_variable_bound(getModel()->getMaxminSystem(), action->getVariable(), sg_tcp_gamma / (2.0 * action->m_latCurrent));
+      else {
+        lmm_update_variable_bound(getModel()->getMaxminSystem(), action->getVariable(),
+                                  min(action->m_rate, sg_tcp_gamma / (2.0 * action->m_latCurrent)));
+
+        if (action->m_rate < sg_tcp_gamma / (2.0 * action->m_latCurrent)) {
+          XBT_INFO("Flow is limited BYBANDWIDTH");
+        } else {
+          XBT_INFO("Flow is limited BYLATENCY, latency of flow is %f",
+                   action->m_latCurrent);
+        }
+      }
+      if (!action->isSuspended())
+        lmm_update_variable_weight(getModel()->getMaxminSystem(), action->getVariable(), action->m_weight);
+
+    }
     if (tmgr_trace_event_free(event_type))
       p_latEvent = NULL;
   } else if (event_type == p_stateEvent) {
@@ -570,60 +617,6 @@ void NetworkCm02Link::updateState(tmgr_trace_event_t event_type,
   return;
 }
 
-void NetworkCm02Link::updateBandwidth(double value, double date){
-  double delta = sg_weight_S_parameter / value - sg_weight_S_parameter /
-                 (p_power.peak * p_power.scale);
-  lmm_variable_t var = NULL;
-  lmm_element_t elem = NULL;
-  NetworkCm02ActionPtr action = NULL;
-
-  p_power.peak = value;
-  lmm_update_constraint_bound(getModel()->getMaxminSystem(),
-                              getConstraint(),
-                              sg_bandwidth_factor *
-                              (p_power.peak * p_power.scale));
-#ifdef HAVE_TRACING
-  TRACE_surf_link_set_bandwidth(date, getName(), sg_bandwidth_factor * p_power.peak * p_power.scale);
-#endif
-  if (sg_weight_S_parameter > 0) {
-    while ((var = lmm_get_var_from_cnst(getModel()->getMaxminSystem(), getConstraint(), &elem))) {
-      action = (NetworkCm02ActionPtr) lmm_variable_id(var);
-      action->m_weight += delta;
-      if (!action->isSuspended())
-        lmm_update_variable_weight(getModel()->getMaxminSystem(), action->getVariable(), action->m_weight);
-    }
-  }
-}
-
-void NetworkCm02Link::updateLatency(double value, double date){
-  double delta = value - m_latCurrent;
-  lmm_variable_t var = NULL;
-  lmm_element_t elem = NULL;
-  NetworkCm02ActionPtr action = NULL;
-
-  m_latCurrent = value;
-  while ((var = lmm_get_var_from_cnst(getModel()->getMaxminSystem(), getConstraint(), &elem))) {
-    action = (NetworkCm02ActionPtr) lmm_variable_id(var);
-    action->m_latCurrent += delta;
-    action->m_weight += delta;
-    if (action->m_rate < 0)
-      lmm_update_variable_bound(getModel()->getMaxminSystem(), action->getVariable(), sg_tcp_gamma / (2.0 * action->m_latCurrent));
-    else {
-      lmm_update_variable_bound(getModel()->getMaxminSystem(), action->getVariable(),
-                                min(action->m_rate, sg_tcp_gamma / (2.0 * action->m_latCurrent)));
-
-      if (action->m_rate < sg_tcp_gamma / (2.0 * action->m_latCurrent)) {
-        XBT_INFO("Flow is limited BYBANDWIDTH");
-      } else {
-        XBT_INFO("Flow is limited BYLATENCY, latency of flow is %f",
-                 action->m_latCurrent);
-      }
-    }
-    if (!action->isSuspended())
-      lmm_update_variable_weight(getModel()->getMaxminSystem(), action->getVariable(), action->m_weight);
-  }
-}
-
 /**********
  * Action *
  **********/
index c31c1c9..b4d4048 100644 (file)
@@ -80,8 +80,6 @@ public:
                                   tmgr_trace_t lat_trace,
                                e_surf_link_sharing_policy_t policy);
   void updateState(tmgr_trace_event_t event_type, double value, double date);
-  void updateBandwidth(double value, double date=surf_get_clock());
-  void updateLatency(double value, double date=surf_get_clock());
 };
 
 
index e813122..d9f36dd 100644 (file)
@@ -88,7 +88,6 @@ ActionPtr NetworkConstantModel::communicate(RoutingEdgePtr src, RoutingEdgePtr d
   NetworkConstantActionPtr action = new NetworkConstantAction(this, size, sg_latency_factor);
   XBT_OUT();
 
-  surf_callback_emit(networkCommunicateCallbacks, action, src, dst, size, rate);
   return action;
 }
 
index 39195ef..49e4c6d 100644 (file)
@@ -19,9 +19,8 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_network, surf,
 
 surf_callback(void, NetworkLinkPtr) networkLinkCreatedCallbacks;
 surf_callback(void, NetworkLinkPtr) networkLinkDestructedCallbacks;
-surf_callback(void, NetworkLinkPtr, e_surf_resource_state_t, e_surf_resource_state_t) networkLinkStateChangedCallbacks;
-surf_callback(void, NetworkActionPtr, e_surf_action_state_t, e_surf_action_state_t) networkActionStateChangedCallbacks;
-surf_callback(void, NetworkActionPtr, RoutingEdgePtr src, RoutingEdgePtr dst, double size, double rate) networkCommunicateCallbacks;
+surf_callback(void, NetworkLinkPtr) networkLinkStateChangedCallbacks;
+surf_callback(void, NetworkActionPtr) networkActionStateChangedCallbacks;
 
 /*********
  * Model *
@@ -90,9 +89,8 @@ bool NetworkLink::isShared()
 }
 
 void NetworkLink::setState(e_surf_resource_state_t state){
-  e_surf_resource_state_t old = Resource::getState();
   Resource::setState(state);
-  surf_callback_emit(networkLinkStateChangedCallbacks, this, old, state);
+  surf_callback_emit(networkLinkStateChangedCallbacks, this);
 }
 
 /**********
@@ -100,9 +98,8 @@ void NetworkLink::setState(e_surf_resource_state_t state){
  **********/
 
 void NetworkAction::setState(e_surf_action_state_t state){
-  e_surf_action_state_t old = getState();
   Action::setState(state);
-  surf_callback_emit(networkActionStateChangedCallbacks, this, old, state);
+  surf_callback_emit(networkActionStateChangedCallbacks, this);
 }
 
 #endif /* NETWORK_INTERFACE_CPP_ */
index 05792b2..8988357 100644 (file)
@@ -27,34 +27,28 @@ typedef NetworkAction *NetworkActionPtr;
  *************/
 
 /** @ingroup SURF_callbacks
- * @brief Callbacks handler which emit the callbacks after NetworkLink creation
+ * @brief Callbacks handler which emit the callbacks after NetworkLink creation *
  * @details Callback functions have the following signature: `void(NetworkLinkPtr)`
  */
 extern surf_callback(void, NetworkLinkPtr) networkLinkCreatedCallbacks;
 
 /** @ingroup SURF_callbacks
- * @brief Callbacks handler which emit the callbacks after NetworkLink destruction
+ * @brief Callbacks handler which emit the callbacks after NetworkLink destruction *
  * @details Callback functions have the following signature: `void(NetworkLinkPtr)`
  */
 extern surf_callback(void, NetworkLinkPtr) networkLinkDestructedCallbacks;
 
 /** @ingroup SURF_callbacks
- * @brief Callbacks handler which emit the callbacks after NetworkLink State changed
- * @details Callback functions have the following signature: `void(NetworkLinkActionPtr action, e_surf_resource_state_t old, e_surf_resource_state_t current)`
+ * @brief Callbacks handler which emit the callbacks after NetworkLink State changed *
+ * @details Callback functions have the following signature: `void(NetworkLinkActionPtr)`
  */
-extern surf_callback(void, NetworkLinkPtr, e_surf_resource_state_t, e_surf_resource_state_t) networkLinkStateChangedCallbacks;
+extern surf_callback(void, NetworkLinkPtr) networkLinkStateChangedCallbacks;
 
 /** @ingroup SURF_callbacks
- * @brief Callbacks handler which emit the callbacks after NetworkAction State changed
- * @details Callback functions have the following signature: `void(NetworkActionPtr action, e_surf_action_state_t old, e_surf_action_state_t current)`
+ * @brief Callbacks handler which emit the callbacks after NetworkAction State changed *
+ * @details Callback functions have the following signature: `void(NetworkActionPtr)`
  */
-extern surf_callback(void, NetworkActionPtr, e_surf_action_state_t, e_surf_action_state_t) networkActionStateChangedCallbacks;
-
-/** @ingroup SURF_callbacks
- * @brief Callbacks handler which emit the callbacks after communication created
- * @details Callback functions have the following signature: `void(NetworkActionPtr action, RoutingEdgePtr src, RoutingEdgePtr dst, double size, double rate)`
- */
-extern surf_callback(void, NetworkActionPtr, RoutingEdgePtr src, RoutingEdgePtr dst, double size, double rate) networkCommunicateCallbacks;
+extern surf_callback(void, NetworkActionPtr) networkActionStateChangedCallbacks;
 
 /*********
  * Tools *
@@ -79,7 +73,7 @@ public:
 
   /**
    * @brief NetworkModel constructor
-   *
+   * 
    * @param name The name of the NetworkModel
    */
   NetworkModel(const char *name) : Model(name) {
@@ -101,7 +95,7 @@ public:
 
   /**
    * @brief Create a NetworkLink
-   *
+   * 
    * @param name The name of the NetworkLink
    * @param bw_initial The initial bandwidth of the NetworkLink in bytes per second
    * @param bw_trace The trace associated to the NetworkLink bandwidth [TODO]
@@ -129,11 +123,11 @@ public:
   /**
    * @brief Create a communication between two [TODO]
    * @details [TODO]
-   *
+   * 
    * @param src The source [TODO]
    * @param dst The destination [TODO]
    * @param size The size of the communication in bytes
-   * @param rate The
+   * @param rate The 
    * @return The action representing the communication
    */
   virtual ActionPtr communicate(RoutingEdgePtr src, RoutingEdgePtr dst,
@@ -141,7 +135,7 @@ public:
 
   /**
    * @brief Function pointer to the function to use to solve the lmm_system_t
-   *
+   * 
    * @param system The lmm_system_t to solve
    */
   void (*f_networkSolve)(lmm_system_t);
@@ -149,7 +143,7 @@ public:
   /**
    * @brief [brief description]
    * @details [long description]
-   *
+   * 
    * @param size [description]
    * @return [description]
    */
@@ -158,7 +152,7 @@ public:
   /**
    * @brief [brief description]
    * @details [long description]
-   *
+   * 
    * @param size [description]
    * @return [description]
    */
@@ -167,7 +161,7 @@ public:
   /**
    * @brief [brief description]
    * @details [long description]
-   *
+   * 
    * @param rate [description]
    * @param bound [description]
    * @param size [description]
@@ -188,7 +182,7 @@ class NetworkLink : public Resource {
 public:
   /**
    * @brief NetworkLink constructor
-   *
+   * 
    * @param model The CpuModel associated to this NetworkLink
    * @param name The name of the NetworkLink
    * @param props Dictionary of properties associated to this NetworkLink
@@ -197,7 +191,7 @@ public:
 
   /**
    * @brief NetworkLink constructor
-   *
+   * 
    * @param model The CpuModel associated to this NetworkLink
    * @param name The name of the NetworkLink
    * @param props Dictionary of properties associated to this NetworkLink
@@ -217,39 +211,29 @@ public:
 
   /**
    * @brief Get the bandwidth in bytes per second of current NetworkLink
-   *
+   * 
    * @return The bandwith in bytes per second of the current NetworkLink
    */
   virtual double getBandwidth();
 
-  /**
-   * @brief Update the bandwidth in bytes per second of current NetworkLink
-   */
-  virtual void updateBandwidth(double value, double date=surf_get_clock())=0;
-
   /**
    * @brief Get the latency in seconds of current NetworkLink
-   *
+   * 
    * @return The latency in seconds of the current NetworkLink
    */
   virtual double getLatency();
 
-  /**
-   * @brief Update the latency in seconds of current NetworkLink
-   */
-  virtual void updateLatency(double value, double date=surf_get_clock())=0;
-
   /**
    * @brief Check if the NetworkLink is shared
    * @details [long description]
-   *
+   * 
    * @return true if the current NetwokrLink is shared, false otherwise
    */
   virtual bool isShared();
 
   /**
    * @brief Check if the NetworkLink is used
-   *
+   * 
    * @return true if the current NetwokrLink is used, false otherwise
    */
   bool isUsed();
@@ -277,7 +261,7 @@ class NetworkAction : public Action {
 public:
   /**
    * @brief NetworkAction constructor
-   *
+   * 
    * @param model The NetworkModel associated to this NetworkAction
    * @param cost The cost of this  NetworkAction in [TODO]
    * @param failed [description]
@@ -287,7 +271,7 @@ public:
 
   /**
    * @brief NetworkAction constructor
-   *
+   * 
    * @param model The NetworkModel associated to this NetworkAction
    * @param cost The cost of this  NetworkAction in [TODO]
    * @param failed [description]
index b133fb8..4fecb0f 100644 (file)
@@ -331,7 +331,6 @@ ActionPtr NetworkNS3Model::communicate(RoutingEdgePtr src, RoutingEdgePtr dst,
   action->p_srcElm = src;
   action->p_dstElm = dst;
 #endif
-  surf_callback_emit(networkCommunicateCallbacks, action, src, dst, size, rate);
 
   return (surf_action_t) action;
 }
@@ -428,8 +427,8 @@ void NetworkNS3Model::updateActionsState(double now, double delta)
 NetworkNS3Link::NetworkNS3Link(NetworkNS3ModelPtr model, const char *name, xbt_dict_t props,
                                       double bw_initial, double lat_initial)
  : NetworkLink(model, name, props)
- , p_lat(bprintf("%f", lat_initial))
  , p_bdw(bprintf("%f", bw_initial))
+ , p_lat(bprintf("%f", lat_initial))
  , m_created(1)
 {
 }
@@ -441,6 +440,14 @@ NetworkNS3Link::~NetworkNS3Link()
 void NetworkNS3Link::updateState(tmgr_trace_event_t event_type, double value, double date)
 {
 
+}
+double NetworkNS3Link::getLatency()
+{
+
+}
+double NetworkNS3Link::getBandwidth()
+{
+
 }
 
 /**********
index 8aab263..f5389b8 100644 (file)
@@ -61,10 +61,8 @@ public:
   ~NetworkNS3Link();
 
   void updateState(tmgr_trace_event_t event_type, double value, double date);
-  double getLatency(){THROW_UNIMPLEMENTED;}
-  double getBandwidth(){THROW_UNIMPLEMENTED;}
-  void updateBandwidth(double value, double date=surf_get_clock()){THROW_UNIMPLEMENTED;}
-  void updateLatency(double value, double date=surf_get_clock()){THROW_UNIMPLEMENTED;}
+  double getLatency();
+  double getBandwidth();
 
 //private:
  char *p_id;
index 900f77b..4c3d591 100644 (file)
@@ -122,7 +122,6 @@ int ns3_initialize(const char* TcpProtocol){
   }
 
   XBT_ERROR("The ns3/TcpModel must be : NewReno or Reno or Tahoe");
-  return 0;
 }
 
 void * ns3_add_host(const char * id)
@@ -168,7 +167,7 @@ void * ns3_add_router(const char * id)
        return router;
 }
 
-void ns3_add_cluster(char * bw,char * lat,const char *id)
+void ns3_add_cluster(char * bw,char * lat,const char *id)
 {
 
        XBT_DEBUG("cluster_id: %s",id);
@@ -176,7 +175,7 @@ void ns3_add_cluster(char * bw,char * lat,const char *id)
        XBT_DEBUG("Number of %s nodes: %d",id,Cluster_nodes.GetN() - number_of_clusters_nodes);
 
        NodeContainer Nodes;
-       unsigned int i;
+       int i;
 
        for(i = number_of_clusters_nodes; i < Cluster_nodes.GetN() ; i++){
                Nodes.Add(Cluster_nodes.Get(i));
@@ -226,7 +225,7 @@ static char* transformIpv4Address (Ipv4Address from){
                return bprintf("%s",s.c_str());
 }
 
-void ns3_add_link(int src, e_ns3_network_element_type_t type_src,
+void ns3_add_link(int src, e_ns3_network_element_type_t type_src,
                                        int dst, e_ns3_network_element_type_t type_dst,
                                        char * bw,char * lat)
 {
@@ -274,7 +273,7 @@ void ns3_add_link(int src, e_ns3_network_element_type_t type_src,
        }
 }
 
-void ns3_end_platform(void)
+void ns3_end_platform(void)
 {
        XBT_DEBUG("InitializeRoutes");
        GlobalRouteManager::BuildGlobalRoutingDatabase();
index 8aaf466..db6b193 100644 (file)
@@ -40,11 +40,11 @@ XBT_PUBLIC(void *) ns3_add_host(const char * id);
 XBT_PUBLIC(void *) ns3_add_host_cluster(const char * id);
 XBT_PUBLIC(void *) ns3_add_router(const char * id);
 XBT_PUBLIC(void *) ns3_add_AS(const char * id);
-XBT_PUBLIC(void) ns3_add_link(int src, e_ns3_network_element_type_t type_src,
+XBT_PUBLIC(void *) ns3_add_link(int src, e_ns3_network_element_type_t type_src,
                 int dst, e_ns3_network_element_type_t type_dst,
                 char * bw,char * lat);
-XBT_PUBLIC(void) ns3_end_platform(void);
-XBT_PUBLIC(void) ns3_add_cluster(char * bw,char * lat,const char *id);
+XBT_PUBLIC(void *) ns3_end_platform(void);
+XBT_PUBLIC(void *) ns3_add_cluster(char * bw,char * lat,const char *id);
 
 SG_END_DECL()
 
index 4fd94ac..993ac0b 100644 (file)
@@ -8,8 +8,8 @@
 #include "../cpu_cas01.hpp"
 
 /** @addtogroup SURF_plugin_energy
- *
- *
+ *    
+ *  
  *  BlaBla energy
  */
 
@@ -31,7 +31,7 @@ static void energyCpuDestructedCallback(CpuPtr cpu){
   surf_energy->erase(cpuIt);
 }
 
-static void energyCpuActionStateChangedCallback(CpuActionPtr action, e_surf_action_state_t old, e_surf_action_state_t cur){
+static void energyCpuActionStateChangedCallback(CpuActionPtr action){
   CpuPtr cpu  = getActionCpu(action);
   CpuEnergyPtr cpu_energy = (*surf_energy)[cpu];
 
index d1c824d..5e1ef73 100644 (file)
@@ -26,8 +26,8 @@ StorageModelPtr surf_storage_model = NULL;
 
 surf_callback(void, StoragePtr) storageCreatedCallbacks;
 surf_callback(void, StoragePtr) storageDestructedCallbacks;
-surf_callback(void, StoragePtr, e_surf_resource_state_t, e_surf_resource_state_t) storageStateChangedCallbacks;
-surf_callback(void, StorageActionPtr, e_surf_action_state_t, e_surf_action_state_t) storageActionStateChangedCallbacks;
+surf_callback(void, StoragePtr) storageStateChangedCallbacks;
+surf_callback(void, StorageActionPtr) storageActionStateChangedCallbacks;
 
 /*********
  * Model *
@@ -138,9 +138,8 @@ void Storage::updateState(tmgr_trace_event_t /*event_type*/, double /*value*/, d
 
 void Storage::setState(e_surf_resource_state_t state)
 {
-  e_surf_resource_state_t old = Resource::getState();
   Resource::setState(state);
-  surf_callback_emit(storageStateChangedCallbacks, this, old, state);
+  surf_callback_emit(storageStateChangedCallbacks, this);
 }
 
 xbt_dict_t Storage::getContent()
@@ -180,7 +179,6 @@ StorageAction::StorageAction(ModelPtr model, double cost, bool failed, lmm_varia
 }
 
 void StorageAction::setState(e_surf_action_state_t state){
-  e_surf_action_state_t old = getState();
   Action::setState(state);
-  surf_callback_emit(storageActionStateChangedCallbacks, this, old, state);
+  surf_callback_emit(storageActionStateChangedCallbacks, this);
 }
index d0e7df6..c63d044 100644 (file)
@@ -48,15 +48,15 @@ extern surf_callback(void, StoragePtr) storageDestructedCallbacks;
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after Storage State changed *
- * @details Callback functions have the following signature: `void(StorageActionPtr action, e_surf_resource_state_t old, e_surf_resource_state_t current)`
+ * @details Callback functions have the following signature: `void(StorageActionPtr)`
  */
-extern surf_callback(void, StoragePtr, e_surf_resource_state_t, e_surf_resource_state_t) storageStateChangedCallbacks;
+extern surf_callback(void, StoragePtr) storageStateChangedCallbacks;
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after StorageAction State changed *
- * @details Callback functions have the following signature: `void(StorageActionPtr action, e_surf_action_state_t old, e_surf_action_state_t current)`
+ * @details Callback functions have the following signature: `void(StorageActionPtr)`
  */
-extern surf_callback(void, StorageActionPtr, e_surf_action_state_t, e_surf_action_state_t) storageActionStateChangedCallbacks;
+extern surf_callback(void, StorageActionPtr) storageActionStateChangedCallbacks;
 
 /*********
  * Model *
@@ -79,7 +79,7 @@ public:
 
   /**
    * @brief Create a Storage
-   *
+   * 
    * @param id [description]
    * @param type_id [description]
    * @param content_name [description]
@@ -109,7 +109,7 @@ class Storage : public Resource {
 public:
   /**
    * @brief Storage constructor
-   *
+   * 
    * @param model StorageModel associated to this Storage
    * @param name The name of the Storage
    * @param props Dictionary of properties associated to this Storage
@@ -124,7 +124,7 @@ public:
 
   /**
    * @brief Storage constructor
-   *
+   * 
    * @param model StorageModel associated to this Storage
    * @param name The name of the Storage
    * @param props Dictionary of properties associated to this Storage
@@ -151,14 +151,14 @@ public:
 
   /**
    * @brief Check if the Storage is used
-   *
+   * 
    * @return true if the current Storage is used, false otherwise
    */
   bool isUsed();
 
   /**
    * @brief Update the state of the current Storage
-   *
+   * 
    * @param event_type [description]
    * @param value [description]
    * @param date [description]
@@ -176,17 +176,17 @@ public:
 
   /**
    * @brief Open a file
-   *
+   * 
    * @param mount The mount point
    * @param path The path to the file
-   *
+   * 
    * @return The StorageAction corresponding to the opening
    */
   virtual StorageActionPtr open(const char* mount, const char* path)=0;
 
   /**
    * @brief Close a file
-   *
+   * 
    * @param fd The file descriptor to close
    * @return The StorageAction corresponding to the closing
    */
@@ -195,7 +195,7 @@ public:
   /**
    * @brief List directory contents of a path
    * @details [long description]
-   *
+   * 
    * @param path The path to the directory
    * @return The StorageAction corresponding to the ls action
    */
@@ -203,7 +203,7 @@ public:
 
   /**
    * @brief Read a file
-   *
+   * 
    * @param fd The file descriptor to read
    * @param size The size in bytes to read
    * @return The StorageAction corresponding to the reading
@@ -212,7 +212,7 @@ public:
 
   /**
    * @brief Write a file
-   *
+   * 
    * @param fd The file descriptor to write
    * @param size The size in bytes to write
    * @return The StorageAction corresponding to the writing
@@ -221,14 +221,14 @@ public:
 
   /**
    * @brief Get the content of the current Storage
-   *
+   * 
    * @return A xbt_dict_t with path as keys and size in bytes as values
    */
   virtual xbt_dict_t getContent();
 
   /**
    * @brief Get the size in bytes of the current Storage
-   *
+   * 
    * @return The size in bytes of the current Storage
    */
   virtual sg_size_t getSize();
@@ -269,7 +269,7 @@ public:
 
   /**
    * @brief StorageAction constructor
-   *
+   * 
    * @param model The StorageModel associated to this StorageAction
    * @param cost The cost of this  NetworkAction in [TODO]
    * @param failed [description]
@@ -281,7 +281,7 @@ public:
 
     /**
    * @brief StorageAction constructor
-   *
+   * 
    * @param model The StorageModel associated to this StorageAction
    * @param cost The cost of this  StorageAction in [TODO]
    * @param failed [description]
index 56454da..6be998b 100644 (file)
@@ -260,7 +260,7 @@ static const char *disk_drives_letter_table[MAX_DRIVE] = {
   "Y:\\",
   "Z:\\"
 };
-#endif
+#endif  
 
 /*
  * Returns the initial path. On Windows the initial path is
@@ -872,8 +872,8 @@ void Action::setBound(double bound)
   if (p_variable)
     lmm_update_variable_bound(getModel()->getMaxminSystem(), getVariable(), bound);
 
-  if (getModel()->getUpdateMechanism() == UM_LAZY && getLastUpdate()!=surf_get_clock())
-         heapRemove(getModel()->getActionHeap());
+  if (getModel()->getUpdateMechanism() == UM_LAZY)
+       heapRemove(getModel()->getActionHeap());
   XBT_OUT();
 }
 
index dae99c9..b04b719 100644 (file)
@@ -22,8 +22,8 @@ WorkstationModelPtr surf_workstation_model = NULL;
 
 surf_callback(void, WorkstationPtr) workstationCreatedCallbacks;
 surf_callback(void, WorkstationPtr) workstationDestructedCallbacks;
-surf_callback(void, WorkstationPtr, e_surf_resource_state_t, e_surf_resource_state_t) workstationStateChangedCallbacks;
-surf_callback(void, WorkstationActionPtr, e_surf_action_state_t, e_surf_action_state_t) workstationActionStateChangedCallbacks;
+surf_callback(void, WorkstationPtr) workstationStateChangedCallbacks;
+surf_callback(void, WorkstationActionPtr) workstationActionStateChangedCallbacks;
 
 /*********
  * Model *
@@ -112,9 +112,8 @@ Workstation::~Workstation(){
 }
 
 void Workstation::setState(e_surf_resource_state_t state){
-  e_surf_resource_state_t old = Resource::getState();
   Resource::setState(state);
-  surf_callback_emit(workstationStateChangedCallbacks, this, old, state);
+  surf_callback_emit(workstationStateChangedCallbacks, this);
 }
 
 int Workstation::getCore(){
@@ -508,7 +507,6 @@ void Workstation::setParams(ws_params_t params)
  **********/
 
 void WorkstationAction::setState(e_surf_action_state_t state){
-  e_surf_action_state_t old = getState();
   Action::setState(state);
-  surf_callback_emit(workstationActionStateChangedCallbacks, this, old, state);
+  surf_callback_emit(workstationActionStateChangedCallbacks, this);
 }
index 799ee13..c472d37 100644 (file)
@@ -43,15 +43,15 @@ extern surf_callback(void, WorkstationPtr) workstationDestructedCallbacks;
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after Workstation State changed *
- * @details Callback functions have the following signature: `void(WorkstationActionPtr action, e_surf_resource_state_t old, e_surf_resource_state_t current)`
+ * @details Callback functions have the following signature: `void(WorkstationActionPtr)`
  */
-extern surf_callback(void, WorkstationPtr, e_surf_resource_state_t, e_surf_resource_state_t) workstationStateChangedCallbacks;
+extern surf_callback(void, WorkstationPtr) workstationStateChangedCallbacks;
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after WorkstationAction State changed *
- * @details Callback functions have the following signature: `void(WorkstationActionPtr action, e_surf_resource_state_t old, e_surf_resource_state_t current)`
+ * @details Callback functions have the following signature: `void(WorkstationActionPtr)`
  */
-extern surf_callback(void, WorkstationActionPtr, e_surf_action_state_t, e_surf_action_state_t) workstationActionStateChangedCallbacks;
+extern surf_callback(void, WorkstationActionPtr) workstationActionStateChangedCallbacks;
 
 /*********
  * Tools *
@@ -67,9 +67,9 @@ extern WorkstationModelPtr surf_workstation_model;
  */
 class WorkstationModel : public Model {
 public:
-    /**
+    /** 
    * @brief WorkstationModel constructor
-   *
+   * 
    * @param name the name of the model
    */
   WorkstationModel(const char *name);
@@ -89,11 +89,11 @@ public:
    * @details [long description]
    */
   virtual void adjustWeightOfDummyCpuActions();
-
+  
   /**
    * @brief [brief description]
    * @details [long description]
-   *
+   * 
    * @param workstation_nb [description]
    * @param workstation_list [description]
    * @param computation_amount [description]
@@ -110,7 +110,7 @@ public:
  /**
   * @brief [brief description]
   * @details [long description]
-  *
+  * 
   * @param src [description]
   * @param dst [description]
   * @param size [description]
@@ -138,7 +138,7 @@ public:
 
   /**
    * @brief Workstation constructor
-   *
+   * 
    * @param model WorkstationModel associated to this Workstation
    * @param name The name of the Workstation
    * @param props Dictionary of properties associated to this Workstation
@@ -151,7 +151,7 @@ public:
 
   /**
    * @brief Workstation constructor
-   *
+   * 
    * @param model WorkstationModel associated to this Workstation
    * @param name The name of the Workstation
    * @param props Dictionary of properties associated to this Workstation
@@ -179,7 +179,7 @@ public:
 
   /**
    * @brief Execute some quantity of computation
-   *
+   * 
    * @param size The value of the processing amount (in flop) needed to process
    * @return The CpuAction corresponding to the processing
    * @see Cpu
@@ -188,7 +188,7 @@ public:
 
   /**
    * @brief Make a process sleep for duration seconds
-   *
+   * 
    * @param duration The number of seconds to sleep
    * @return The CpuAction corresponding to the sleeping
    * @see Cpu
@@ -197,7 +197,7 @@ public:
 
   /**
    * @brief Get the number of cores of the associated Cpu
-   *
+   * 
    * @return The number of cores of the associated Cpu
    * @see Cpu
    */
@@ -205,7 +205,7 @@ public:
 
   /**
    * @brief Get the speed of the associated Cpu
-   *
+   * 
    * @param load [TODO]
    * @return The speed of the associated Cpu
    * @see Cpu
@@ -215,7 +215,7 @@ public:
   /**
    * @brief Get the available speed of the associated Cpu
    * @details [TODO]
-   *
+   * 
    * @return The available speed of the associated Cpu
    * @see Cpu
    */
@@ -223,7 +223,7 @@ public:
 
   /**
    * @brief Get the associated Cpu power peak
-   *
+   * 
    * @return The associated Cpu power peak
    * @see Cpu
    */
@@ -235,7 +235,7 @@ public:
 
   /**
    * @brief Return the storage of corresponding mount point
-   *
+   * 
    * @param storage The mount point
    * @return The corresponding Storage
    */
@@ -243,7 +243,7 @@ public:
 
   /**
    * @brief Get the xbt_dict_t of mount_point: Storage
-   *
+   * 
    * @return The xbt_dict_t of mount_point: Storage
    */
   virtual xbt_dict_t getMountedStorageList();
@@ -257,16 +257,16 @@ public:
 
   /**
    * @brief Open a file
-   *
+   * 
    * @param fullpath The full path to the file
-   *
+   * 
    * @return The StorageAction corresponding to the opening
    */
   virtual ActionPtr open(const char* fullpath);
 
   /**
    * @brief Close a file
-   *
+   * 
    * @param fd The file descriptor to close
    * @return The StorageAction corresponding to the closing
    */
@@ -275,7 +275,7 @@ public:
   /**
    * @brief Unlink a file
    * @details [long description]
-   *
+   * 
    * @param fd [description]
    * @return [description]
    */
@@ -284,7 +284,7 @@ public:
   /**
    * @brief List directory contents of a path
    * @details [long description]
-   *
+   * 
    * @param mount [description]
    * @param path The path to the directory
    * @return The StorageAction corresponding to the ls action
@@ -293,7 +293,7 @@ public:
 
   /**
    * @brief Get the size in bytes of the file
-   *
+   * 
    * @param fd The file descriptor to read
    * @return The size in bytes of the file
    */
@@ -301,7 +301,7 @@ public:
 
   /**
    * @brief Read a file
-   *
+   * 
    * @param fd The file descriptor to read
    * @param size The size in bytes to read
    * @return The StorageAction corresponding to the reading
@@ -310,7 +310,7 @@ public:
 
   /**
    * @brief Write a file
-   *
+   * 
    * @param fd The file descriptor to write
    * @param size The size in bytes to write
    * @return The StorageAction corresponding to the writing
@@ -325,7 +325,7 @@ public:
    *  - the storage name,
    *  - the storage typeId,
    *  - the storage content type
-   *
+   * 
    * @param fd The file descriptor
    * @return An xbt_dynar_t with the file informations
    */
@@ -333,15 +333,15 @@ public:
 
   /**
    * @brief Get the current position of the file descriptor
-   *
+   *  
    * @param fd The file descriptor
    * @return The current position of the file descriptor
    */
   virtual sg_size_t fileTell(surf_file_t fd);
 
   /**
-   * @brief Get the available space of the storage at the mount point
-   *
+   * @brief Get the available space of the storage at the mount point 
+   * 
    * @param name The mount point
    * @return The amount of availble space in bytes
    */
@@ -349,7 +349,7 @@ public:
 
   /**
    * @brief Get the used space of the storage at the mount point
-   *
+   * 
    * @param name The mount point
    * @return The amount of used space in bytes
    */
@@ -358,7 +358,7 @@ public:
   /**
    * @brief Set the position indictator assiociated with the file descriptor to a new position
    * @details [long description]
-   *
+   * 
    * @param fd The file descriptor
    * @param offset The offset from the origin
    * @param origin Position used as a reference for the offset
@@ -398,7 +398,7 @@ public:
 
   /**
    * @brief Get the list of virtual machines on the current Workstation
-   *
+   * 
    * @return The list of VMs
    */
   xbt_dynar_t getVms();
@@ -407,7 +407,7 @@ public:
   /**
    * @brief [brief description]
    * @details [long description]
-   *
+   * 
    * @param params [description]
    */
   void getParams(ws_params_t params);
@@ -415,7 +415,7 @@ public:
   /**
    * @brief [brief description]
    * @details [long description]
-   *
+   * 
    * @param params [description]
    */
   void setParams(ws_params_t params);
@@ -433,7 +433,7 @@ class WorkstationAction : public Action {
 public:
   /**
    * @brief WorkstationAction constructor
-   *
+   * 
    * @param model The WorkstationModel associated to this WorkstationAction
    * @param cost The cost of this WorkstationAction in [TODO]
    * @param failed [description]
@@ -443,7 +443,7 @@ public:
 
   /**
    * @brief WorkstationAction constructor
-   *
+   * 
    * @param model The WorkstationModel associated to this WorkstationAction
    * @param cost The cost of this WorkstationAction in [TODO]
    * @param failed [description]
index 71d2a57..f44c1a1 100644 (file)
@@ -502,11 +502,20 @@ void CpuL07::updateState(tmgr_trace_event_t event_type, double value, double /*d
 void LinkL07::updateState(tmgr_trace_event_t event_type, double value, double date){
   XBT_DEBUG("Updating link %s (%p) with value=%f for date=%g", getName(), this, value, date);
   if (event_type == p_bwEvent) {
-    updateBandwidth(value, date);
+    m_bwCurrent = value;
+    lmm_update_constraint_bound(ptask_maxmin_system, getConstraint(), m_bwCurrent);
     if (tmgr_trace_event_free(event_type))
       p_bwEvent = NULL;
   } else if (event_type == p_latEvent) {
-    updateLatency(value, date);
+    lmm_variable_t var = NULL;
+    WorkstationL07ActionPtr action;
+    lmm_element_t elem = NULL;
+
+    m_latCurrent = value;
+    while ((var = lmm_get_var_from_cnst(ptask_maxmin_system, getConstraint(), &elem))) {
+      action = (WorkstationL07ActionPtr) lmm_variable_id(var);
+      action->updateBound();
+    }
     if (tmgr_trace_event_free(event_type))
       p_latEvent = NULL;
   } else if (event_type == p_stateEvent) {
@@ -573,31 +582,11 @@ double LinkL07::getBandwidth()
   return m_bwCurrent;
 }
 
-void LinkL07::updateBandwidth(double value, double date)
-{
-  m_bwCurrent = value;
-  lmm_update_constraint_bound(ptask_maxmin_system, getConstraint(), m_bwCurrent);
-}
-
 double LinkL07::getLatency()
 {
   return m_latCurrent;
 }
 
-void LinkL07::updateLatency(double value, double date)
-{
-  lmm_variable_t var = NULL;
-  WorkstationL07ActionPtr action;
-  lmm_element_t elem = NULL;
-
-  m_latCurrent = value;
-  while ((var = lmm_get_var_from_cnst(ptask_maxmin_system, getConstraint(), &elem))) {
-    action = (WorkstationL07ActionPtr) lmm_variable_id(var);
-    action->updateBound();
-  }
-}
-
-
 bool LinkL07::isShared()
 {
   return lmm_constraint_is_shared(getConstraint());
index 9bcac9f..360a851 100644 (file)
@@ -164,8 +164,6 @@ public:
   double getBandwidth();
   double getLatency();
   bool isShared();
-  void updateBandwidth(double value, double date=surf_get_clock());
-  void updateLatency(double value, double date=surf_get_clock());
 
   double m_latCurrent;
   tmgr_trace_event_t p_latEvent;
index 74ed341..014b8b8 100644 (file)
@@ -123,10 +123,6 @@ void *mmorecore(struct mdesc *mdp, ssize_t size)
         abort();
       }
 
-#ifdef MADV_MERGEABLE
-      madvise(mapto, mapbytes, MADV_MERGEABLE);
-#endif
-
       if (mdp->top == 0)
         mdp->base = mdp->breakval = mapto;
 
diff --git a/teshsuite/bug-17132/CMakeLists.txt b/teshsuite/bug-17132/CMakeLists.txt
deleted file mode 100644 (file)
index d2d8163..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 2.6)
-
-if(enable_smpi)
-  if(WIN32)
-      set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
-  else()
-      set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
-  endif()
-       
-       
-  set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
-
-  add_executable(bug-17132 ${CMAKE_HOME_DIRECTORY}/teshsuite/bug-17132/bug-17132.c)
-  target_link_libraries(bug-17132 simgrid)
-
-  set(tesh_files
-    ${tesh_files}
-    ${CMAKE_CURRENT_SOURCE_DIR}/bug-17132.tesh
-    PARENT_SCOPE)
-  set(xml_files
-    ${xml_files}
-    ${CMAKE_CURRENT_SOURCE_DIR}/small_platform.xml
-    PARENT_SCOPE)
-  set(teshsuite_src
-    ${teshsuite_src}
-    ${CMAKE_CURRENT_SOURCE_DIR}/bug-17132.c
-    PARENT_SCOPE)
-  set(bin_files
-    ${bin_files}
-    PARENT_SCOPE)
-  set(txt_files
-    ${txt_files}
-    ${CMAKE_CURRENT_SOURCE_DIR}/hostfile.txt
-    ${CMAKE_CURRENT_SOURCE_DIR}/README
-    PARENT_SCOPE)
-    
-endif(enable_smpi)
diff --git a/teshsuite/bug-17132/README b/teshsuite/bug-17132/README
deleted file mode 100644 (file)
index 22e35b9..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-This is the bug #17132 described on gforge [1]. This small SMPI code
-triggers an issue in SURF, which is still to be debugged.
-
-The problem seems to be related to the order of events, as changing it
-(with another platform or another message size or a MPI_barrier in
-between) fixes the problem.
-
-[1] https://gforge.inria.fr/tracker/index.php?func=detail&aid=17132&group_id=12&atid=165
\ No newline at end of file
diff --git a/teshsuite/bug-17132/bug-17132.c b/teshsuite/bug-17132/bug-17132.c
deleted file mode 100644 (file)
index cecb3e4..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-#include "xbt/log.h"
-#include <stdio.h>
-#include <mpi.h>
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(MM_mpi, "Messages for this SMPI test");
-
-int main(int argc, char ** argv)
-{
-  size_t err;
-  size_t M = 8*1024;
-  size_t N = 32*1024;
-
-  MPI_Init(&argc, &argv);
-
-  double *a = malloc(sizeof(double) * M);
-  double *b = malloc(sizeof(double) * N);
-
-  // A broadcast
-  err = MPI_Bcast(a, M, MPI_DOUBLE, 0, MPI_COMM_WORLD);
-  if (err != MPI_SUCCESS) {
-    perror("Error Bcast A\n"); MPI_Finalize(); exit(-1);
-  }
-
-//  Uncommenting this barrier fixes it!
-//  MPI_Barrier(MPI_COMM_WORLD);
-
-  // Another broadcast
-  err = MPI_Bcast(b, N, MPI_DOUBLE, 0, MPI_COMM_WORLD );
-  if (err != MPI_SUCCESS) {
-    perror("Error Bcast B\n"); MPI_Finalize(); exit(-1);
-  }
-
-  // Commenting out this barrier fixes it!!
-  MPI_Barrier(MPI_COMM_WORLD);
-
-  MPI_Finalize();
-  free(a);
-  free(b);
-  return 0;
-}
diff --git a/teshsuite/bug-17132/bug-17132.tesh b/teshsuite/bug-17132/bug-17132.tesh
deleted file mode 100644 (file)
index d167f08..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-$ ../../smpi_script/bin/smpirun -np 16 -platform ${srcdir:=.}/small_platform.xml -hostfile ${srcdir:=.}/hostfile.txt ./bug-17132 --cfg=smpi/cpu_threshold:-1 --log=smpi_kernel.thres:warning
-> You requested to use 16 processes, but there is only 2 processes in your hostfile...
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9'
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI'
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304'
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/cpu_threshold' to '-1'
-> [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s)
-> (some sensible output)
diff --git a/teshsuite/bug-17132/hostfile.txt b/teshsuite/bug-17132/hostfile.txt
deleted file mode 100644 (file)
index 994b3e2..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-host1
-host2
diff --git a/teshsuite/bug-17132/small_platform.xml b/teshsuite/bug-17132/small_platform.xml
deleted file mode 100644 (file)
index a2b420d..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
-<platform version='3'>
- <AS id='AS0' routing='Full'>
-
-  <host id='host1' power='1.0'/>
-  <host id='host2' power='1.0'/>
-  <link id='link' bandwidth='1e+10' latency='1e-09'/>
-
-  <route src='host1' dst='host2' symmetrical="YES">
-       <link_ctn id='link'/>
-  </route>
-
- </AS>
-</platform>
index a0df41e..2606c83 100644 (file)
@@ -1,10 +1,5 @@
 ! expect signal SIGSEGV
 $ ./simix/stack_overflow --cfg=contexts/stack_size:96 ${srcdir:=.}/simix/stack_overflow.xml
 > [Tremblay:master:(0) 0.000000] [test/INFO] Launching our nice bugged recursive function...
-> Access violation detected.
-> This can result from a programming error in your code or, although less likely,
-> from a bug in SimGrid itself.  This can also be the sign of a bug in the OS or
-> in third-party libraries.  Failing hardware can sometimes generate such errors
-> too.
-> Finally, if nothing of the above applies, this can result from a stack overflow.
+> Access violation detected. This can result from a stack overflow.
 > Try to increase stack size with --cfg=contexts/stack_size (current size is 96 KiB).
index 8fa09c5..7def465 100644 (file)
@@ -96,7 +96,7 @@ void test_deref(mc_expression_state_t state) {
 
   Dwarf_Op ops[60];
   ops[0].atom = DW_OP_const8u;
-  ops[0].number = (uintptr_t) &foo;
+  ops[0].number = (Dwarf_Word) &foo;
   ops[1].atom = DW_OP_deref;
   state->stack_size = 0;