Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge pull request #59 from fabienchaix/master
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Sat, 6 Feb 2016 00:02:36 +0000 (01:02 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Sat, 6 Feb 2016 00:02:36 +0000 (01:02 +0100)
Splitting the LMM constraint element_set into enabled_element_set and disabled_element_set

110 files changed:
.gitignore
CMakeLists.txt
ChangeLog
doc/doxygen/tracing.doc
examples/msg/actions/actions.c
examples/msg/bittorrent/CMakeLists.txt
examples/msg/bittorrent/bittorrent_platfgen.c [deleted file]
examples/platforms/conf/gridpp_grid_2004.xml [deleted file]
examples/platforms/conf/lcg_sept2004_grid.xml [deleted file]
examples/platforms/conf/transform_optorsim_platform.pl
examples/platforms/generation_scripts/generate_g5k_platform.pl [deleted file]
examples/platforms/generation_scripts/generate_g5k_platform_cabinets.pl [deleted file]
examples/simdag/dax/CMakeLists.txt
examples/simdag/dax/generate_forkjoin.pl [deleted file]
examples/simdag/dax/generate_strassen.pl [deleted file]
examples/simdag/dot/dot_test.c
examples/simdag/dot/dot_test2.c
examples/simdag/dot/ptg_test.c
examples/simdag/dot/simulate_dot.c
examples/simdag/dot/test_simdag_dotload.tesh
examples/smpi/mc/bugged1_liveness.c
examples/smpi/mc/non_deterministic.tesh
examples/smpi/mc/only_send_deterministic.c
examples/smpi/mc/only_send_deterministic.tesh
include/simgrid/jedule/jedule_events.h
include/simgrid/jedule/jedule_output.h
include/simgrid/jedule/jedule_platform.h
include/simgrid/platf.h
include/simgrid/platf_generator.h [deleted file]
include/simgrid/simdag.h
include/simgrid/simix.h
include/simgrid_config.h.in
include/smpi/smpi.h
include/smpi/smpi_cocci.h [deleted file]
src/include/surf/random_mgr.h [deleted file]
src/instr/instr_config.cpp
src/instr/jedule/jedule_events.cpp [moved from src/instr/jedule/jedule_events.c with 100% similarity]
src/instr/jedule/jedule_output.cpp [moved from src/instr/jedule/jedule_output.c with 99% similarity]
src/instr/jedule/jedule_platform.cpp [moved from src/instr/jedule/jedule_platform.c with 93% similarity]
src/instr/jedule/jedule_sd_binding.cpp [moved from src/instr/jedule/jedule_sd_binding.c with 100% similarity]
src/msg/msg_synchro.cpp
src/simdag/sd_dotloader.cpp
src/simgrid/host.cpp
src/simgrid/sg_config.c
src/simix/BoostContext.cpp
src/simix/BoostContext.hpp
src/simix/RawContext.cpp
src/simix/UContext.cpp
src/simix/libsmx.cpp
src/simix/popping_accessors.h
src/simix/popping_bodies.cpp
src/simix/popping_enum.h
src/simix/popping_generated.cpp
src/simix/simcalls.in
src/simix/smx_context.cpp
src/simix/smx_process.cpp
src/simix/smx_synchro_private.h
src/smpi/fixsrc.pl [deleted file]
src/smpi/myprintloc.cocci [deleted file]
src/smpi/patch_source.sh [deleted file]
src/smpi/private.h
src/smpi/replace_globals.cocci [deleted file]
src/smpi/replace_static.cocci [deleted file]
src/smpi/smpi_base.c
src/smpi/smpi_global.c
src/surf/cpu_interface.cpp
src/surf/cpu_ti.cpp
src/surf/cpu_ti.hpp
src/surf/host_ptask_L07.cpp
src/surf/maxmin.cpp
src/surf/network_constant.cpp
src/surf/platf_generator.c [deleted file]
src/surf/platf_generator_private.h [deleted file]
src/surf/random_mgr.c [deleted file]
src/surf/storage_n11.cpp
src/surf/surf_interface.cpp
src/surf/surf_interface.hpp
src/surf/surf_private.h
src/surf/surf_routing.cpp
src/surf/surfxml_parse.c
src/surf/surfxml_parseplatf.cpp
src/surf/surfxml_private.h [new file with mode: 0644]
src/surf/trace_mgr.cpp
src/surf/trace_mgr.hpp
src/xbt/config.c
src/xbt/log.c
src/xbt/xbt_main.c
src/xbt/xbt_os_synchro.c
src/xbt/xbt_os_thread.c
src/xbt/xbt_sg_stubs.c
teshsuite/java/semaphore/CMakeLists.txt [new file with mode: 0644]
teshsuite/java/semaphore/SemaphoreGC.java [new file with mode: 0644]
teshsuite/java/semaphore/semaphore_gc.tesh [new file with mode: 0644]
teshsuite/java/sleep_host_off/CMakeLists.txt
teshsuite/java/sleep_host_off/Main.java [deleted file]
teshsuite/java/sleep_host_off/SleepHostOff.java
teshsuite/java/sleep_host_off/sleep_host_off.tesh
teshsuite/smpi/mpich3-test/coll/allgatherv4.c
teshsuite/smpi/mpich3-test/coll/allgatherv4_manual.c
teshsuite/smpi/mpich3-test/coll/allred.c
teshsuite/smpi/mpich3-test/util/mtest_manual.c
tools/cmake/DefinePackages.cmake
tools/cmake/MakeExe.cmake
tools/cmake/MakeLib.cmake
tools/cmake/PrintArgs.cmake
tools/cmake/Tests.cmake
tools/cmake/scripts/generate_memcheck_tests.pl
tools/cmake/src/internal_config.h.in
tools/tesh/CMakeLists.txt
tools/tesh/colorize.pl [deleted file]

index 7227b38..f2c89f3 100644 (file)
@@ -275,6 +275,7 @@ src/replay/replay
 src/testall
 teshsuite/bug-17132/bug-17132
 teshsuite/datadesc_usage.out
+teshsuite/java/semaphore/java_semaphore_gc_compiled
 teshsuite/java/sleep_host_off/java_sleep_host_off_compiled
 teshsuite/mc/dwarf/dwarf
 teshsuite/mc/dwarf_expression/dwarf-expression
index 3747faf..be8918f 100644 (file)
@@ -214,7 +214,7 @@ IF(CMAKE_SYSTEM_PROCESSOR MATCHES ".86|AMD64|amd64")
   if (MSVC)
     message(STATUS "Disable fast raw contextes on Microsoft Visual.")
   else()
-    set(HAVE_RAWCTX 1)
+    set(HAVE_RAW_CONTEXTS 1)
   endif()
 
 ENDIF()
@@ -267,15 +267,15 @@ if(Boost_FOUND AND Boost_CONTEXT_FOUND)
   # We should use feature detection for this instead:
   if (Boost_VERSION LESS 105600)
     message("Found Boost.Context API v1")
-    set(HAVE_BOOST_CONTEXT 1)
+    set(HAVE_BOOST_CONTEXTS 1)
   else()
     message("Found Boost.Context API v2")
-    set(HAVE_BOOST_CONTEXT 2)
+    set(HAVE_BOOST_CONTEXTS 2)
   endif()
 else()
   message ("   boost        : found.")
   message ("   boost-context: missing. Install libboost-context-dev for this optional feature.")
-  set(HAVE_BOOST_CONTEXT 0)
+  set(HAVE_BOOST_CONTEXTS 0)
 endif()
 
 # Checks for header libraries functions.
@@ -383,8 +383,8 @@ if(WIN32) # Those files are not detected despite being present
   set(HAVE_MAKECONTEXT 1)
 endif()
 
-set(CONTEXT_UCONTEXT 0)
-set(CONTEXT_THREADS 0)
+set(HAVE_UCONTEXT_CONTEXTS 0)
+set(HAVE_THREAD_CONTEXTS 0)
 
 if(enable_jedule)
   set(HAVE_JEDULE 1)
@@ -626,12 +626,12 @@ endif()
 #If can have both context
 
 if(HAVE_UCONTEXT)
-  set(CONTEXT_UCONTEXT 1)
+  set(HAVE_UCONTEXT_CONTEXTS 1)
   message("-- Support for ucontext factory")
 endif()
 
 if(HAVE_PTHREAD)
-  set(CONTEXT_THREADS 1)
+  set(HAVE_THREAD_CONTEXTS 1)
   message("-- Support for thread context factory")
 endif()
 
index b1d4706..679c590 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,19 @@
 SimGrid (3.13) UNRELEASED; urgency=low
 
  The Easter Trim Release.
+
+ Backwards Compatibility breaks
+   - The option "model-check/sparse-checkpoint" was renamed to
+     "model-check/sparse_checkpoint" as we attempt to unify our naming
+     schemes.
+   - The option smpi/async_small_thres was renamed to smpi/async_small_thresh
+     as we attempt to unify our naming schemes. 
+   - The option smpi/send_is_detached_thres was renamed to
+     smpi/send_is_detached_thresh as we attempt to unify our naming schemes.
+   - We removed support for writing your simulation in Lua; you can use
+     the Java bindings.
+    
  
  S4U
  * s4u::Host is now the prefered public interface to the Host features.
@@ -16,19 +29,10 @@ SimGrid (3.13) UNRELEASED; urgency=low
     the lambda or closure passed as a parameter will run in kernel mode.
    Every callbacks should be rewritten to that interface at some point.
    
- MC
- * BC breaks:
-   - The option "model-check/sparse-checkpoint" was renamed to
-     "model-check/sparse_checkpoint" as we attempt to unify our naming
-     schemes.
-
  Surf
  * Reorganizing and cleaning the internals all around the place.
 
  SMPI
- * BC breaks:
-   - The option smpi/async_small_thres was renamed to smpi/async_small_thresh
-     as we attempt to unify our naming schemes -> smpi/send_is_detached_thresh
  * Remove old default barrier/bcast buggy algorithms (see #18407)
  * Various bugfixes to handle more codes
 
index b4b203e..7c11bda 100644 (file)
@@ -143,17 +143,6 @@ tracing/filename
 \endverbatim
   If you do not provide this parameter, the trace file will be named simgrid.trace.
 
-\li <b>\c
-tracing/onelink_only
-</b>:
-  By default, the tracing system uses all routes in the platform file
-  to re-create a "graph" of the platform and register it in the trace file.
-  This option let the user tell the tracing system to use only the routes
-  that are composed with just one link.
-\verbatim
---cfg=tracing/onelink_only:yes
-\endverbatim
-
 \li <b>\c
 tracing/smpi
 </b>:
@@ -201,6 +190,38 @@ exchanged in the trace, both in the links and on the states. For collective, siz
 --cfg=tracing/smpi/display_sizes:yes
 \endverbatim
 
+\li <b>\c
+tracing/smpi/sleeping
+</b>:
+TODO
+\verbatim
+TODO
+\endverbatim
+
+\li <b>\c
+tracing/smpi/format
+</b>:
+TODO
+\verbatim
+TODO
+\endverbatim
+
+\li <b>\c
+tracing/smpi/format/ti_one_file
+</b>:
+TODO
+\verbatim
+TODO
+\endverbatim
+
+\li <b>\c
+tracing/msg/vm
+</b>:
+TODO
+\verbatim
+TODO
+\endverbatim
+
 \li <b>\c
 tracing/msg/process
 </b>:
@@ -237,6 +258,22 @@ traced as usual.
 --cfg=tracing/onelink_only:yes
 \endverbatim
 
+\li <b>\c
+tracing/disable_link
+</b>:
+TODO
+\verbatim
+TODO
+\endverbatim
+
+\li <b>\c
+tracing/disable_power
+</b>:
+TODO
+\verbatim
+TODO
+\endverbatim
+
 \li <b>\c
 tracing/disable_destroy
 </b>:
@@ -274,6 +311,30 @@ Use this to add the contents of a file to the top of the trace file as comment.
 --cfg=tracing/comment_file:textual_file.txt
 \endverbatim
 
+\li <b>\c
+tracing/precision
+</b>:
+TODO
+\verbatim
+TODO
+\endverbatim
+
+\li <b>\c
+tracing/platform
+</b>:
+TODO
+\verbatim
+TODO
+\endverbatim
+
+\li <b>\c
+tracing/platform/topology
+</b>:
+TODO
+\verbatim
+TODO
+\endverbatim
+
 \li <b>\c
 viva/categorized
 </b>:
index bd5a62a..e43c1d4 100644 (file)
@@ -230,8 +230,8 @@ static void action_barrier(const char *const *action)
 
   processes_arrived_sofar--;
   if (!processes_arrived_sofar) {
-    simcall_cond_destroy(cond);
-    simcall_mutex_destroy(mutex);
+    SIMIX_cond_destroy(cond);
+    SIMIX_mutex_destroy(mutex);
     mutex = NULL;
   }
 }
index f4c0b9c..fdba1af 100644 (file)
@@ -2,12 +2,9 @@ set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
 
 add_executable(bittorrent
   "bittorrent.c" "messages.c" "peer.c" "tracker.c" "connection.c")
-add_executable(bittorrent_platfgen
-  "bittorrent_platfgen.c" "messages.c" "peer.c" "tracker.c" "connection.c")
 
 ### Add definitions for compile
 target_link_libraries(bittorrent simgrid )
-target_link_libraries(bittorrent_platfgen simgrid )
 
 set(tesh_files
   ${tesh_files}
@@ -22,7 +19,6 @@ set(xml_files
 set(examples_src
   ${examples_src}
   ${CMAKE_CURRENT_SOURCE_DIR}/bittorrent.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/bittorrent_platfgen.c
   ${CMAKE_CURRENT_SOURCE_DIR}/bittorrent.h
   ${CMAKE_CURRENT_SOURCE_DIR}/connection.c
   ${CMAKE_CURRENT_SOURCE_DIR}/connection.h
diff --git a/examples/msg/bittorrent/bittorrent_platfgen.c b/examples/msg/bittorrent/bittorrent_platfgen.c
deleted file mode 100644 (file)
index 16c0e65..0000000
+++ /dev/null
@@ -1,154 +0,0 @@
-/* Copyright (c) 2012-2015. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include "bittorrent.h"
-#include "peer.h"
-#include "tracker.h"
-#include <simgrid/msg.h>
-#include <simgrid/platf_generator.h>
-/**
- * Bittorrent example launcher, using a generated platform
- */
-
-static RngStream rng_stream;
-
-void promoter(context_node_t node);
-void labeler(context_edge_t edge);
-void create_environment(int node_count);
-void dispatch_jobs(double tracker_deadline, double peer_deadline,
-                   double seed_percentage);
-
-void promoter(context_node_t node)
-{
-  s_sg_platf_host_cbarg_t host_parameters;
-
-  if (node->degree == 1) {
-    //We promote only the leaf; as we use a star topology, all the nodes
-    //will be promoted except the first one, which will be a router with
-    //every hosts connected on.
-    host_parameters.id = NULL;
-
-    //Power from 3,000,000 to 10,000,000
-    host_parameters.speed_peak = xbt_dynar_new(sizeof(double), NULL);
-    xbt_dynar_push_as(host_parameters.speed_peak, double,
-               7000000 * RngStream_RandU01(rng_stream) + 3000000.0);
-    host_parameters.core_amount = 1;
-    host_parameters.speed_scale = 1;
-    host_parameters.speed_trace = NULL;
-    host_parameters.initiallyOn = 1;
-    host_parameters.state_trace = NULL;
-    host_parameters.coord = NULL;
-    host_parameters.properties = NULL;
-
-    platf_graph_promote_to_host(node, &host_parameters);
-  }
-}
-
-void labeler(context_edge_t edge)
-{
-
-  s_sg_platf_link_cbarg_t link_parameters;
-  link_parameters.id = NULL;
-
-  //bandwidth from 3,000,000 to 10,000,000
-  link_parameters.bandwidth = 7000000 * RngStream_RandU01(rng_stream) + 3000000;
-  link_parameters.bandwidth_trace = NULL;
-
-  //Latency from 0ms to 100ms
-  link_parameters.latency = RngStream_RandU01(rng_stream) / 10.0;
-  link_parameters.latency_trace = NULL;
-  link_parameters.initiallyOn = 1;
-  link_parameters.state_trace = NULL;
-  link_parameters.policy = SURF_LINK_SHARED;
-  link_parameters.properties = NULL;
-
-  platf_graph_link_label(edge, &link_parameters);
-}
-
-void create_environment(int node_count)
-{
-
-  platf_graph_uniform(node_count);
-
-  //every nodes are connected to the first one
-  platf_graph_interconnect_star();
-  //No need to check if the graph is connected, the star topology implies it.
-
-  //register promoter and labeler
-  platf_graph_promoter(promoter);
-  platf_graph_labeler(labeler);
-
-  //promoting and labeling
-  platf_do_promote();
-  platf_do_label();
-
-  //Put the platform into the simulator
-  platf_generate();
-}
-
-void dispatch_jobs(double tracker_deadline, double peer_deadline,
-                   double seed_percentage)
-{
-
-  xbt_dynar_t available_nodes = MSG_hosts_as_dynar();
-  msg_host_t host;
-  unsigned int i;
-
-  char **arguments_tracker;
-  char **arguments_peer;
-
-  unsigned int seed_count =
-      (seed_percentage / 100.0) * xbt_dynar_length(available_nodes);
-
-  xbt_dynar_foreach(available_nodes, i, host) {
-    if (i == 0) {
-      //The fisrt node is the tracker
-      arguments_tracker = xbt_malloc0(sizeof(char *) * 2);
-      arguments_tracker[0] = xbt_strdup("tracker");
-      arguments_tracker[1] = bprintf("%f", tracker_deadline);
-      MSG_process_create_with_arguments("tracker", tracker, NULL, host, 2,
-                                        arguments_tracker);
-    } else {
-      //Other nodes are peers
-      int argument_size;
-      arguments_peer = xbt_malloc0(sizeof(char *) * 4);
-      arguments_peer[0] = xbt_strdup("peer");
-      arguments_peer[1] = bprintf("%d", i);
-      arguments_peer[2] = bprintf("%f", peer_deadline);
-
-      //The first peers will be seeders
-      if (seed_count > 0) {
-        seed_count--;
-        arguments_peer[3] = xbt_strdup("1");
-        argument_size = 4;
-      } else {
-        //Other ars leechers
-        arguments_peer[3] = NULL;
-        argument_size = 3;
-      }
-      MSG_process_create_with_arguments("peer", peer, NULL, host,
-                                        argument_size, arguments_peer);
-    }
-  }
-}
-
-int main(int argc, char *argv[])
-{
-  MSG_init(&argc, argv);
-
-  rng_stream = RngStream_CreateStream(NULL);
-
-  //Maybe these parameters should be set from the command line...
-  //create_environment(<node_count>)
-  create_environment(20);
-
-  //dispatch_jobs(<tracker_deadline>, <peer_deadline>, <seed_percentage>)
-  dispatch_jobs(2000, 2000, 10);
-
-  MSG_main();
-
-  return 0;
-}
diff --git a/examples/platforms/conf/gridpp_grid_2004.xml b/examples/platforms/conf/gridpp_grid_2004.xml
deleted file mode 100644 (file)
index af2d582..0000000
+++ /dev/null
@@ -1,244 +0,0 @@
-<!-- This platform was automatically converted from the OptorSim platform.
-
-  As such, it only contains information of the cluster interconnexion,
-  not on the caracteristics of each cluster. In a sense, it describes
-  the network of a National Research and Education Network (NREN), but
-  not of a computational platform.
-  
-  We hope that you find it useful anyway. I you know how to complete
-  this information with data on the cluster configurations, please
-  drop us a mail so that we can add this information. -->
-
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
-<platform version="3">
-<AS  id="AS0"  routing="Floyd">
-<!--0 WC_Gla-->
-<!--1 WC_Edi-->
-<!--2 WC_Manc-->
-<!--3 WC_Leeds-->
-<!--4 WC_Reading-->
-<!--5 WC_London-->
-<!--6 WC_Bristol-->
-<!--7 WC_Portsmouth-->
-<!--8 Gla_router-->
-<!--9 Edi_router-->
-<!--10 NorMAN-->
-<!--11 YHMAN-->
-<!--12 EastNet-->
-<!--13 LMN-->
-<!--14 SWAN_BWEMAN-->
-<!--15 TVN-->
-<!--16 MidMAN-->
-<!--17 NNW_router-->
-<!--18 Glasgow-->
-<!--19 Edi-->
-<!--20 Durham-->
-<!--21 Sheffield-->
-<!--22 Cam-->
-<!--23 UCL-->
-<!--24 IC-->
-<!--25 QMW-->
-<!--26 Brunel-->
-<!--27 RHNBC-->
-<!--28 Bristol-->
-<!--29 RAL-->
-<!--30 Oxford-->
-<!--31 B_ham-->
-<!--32 L_pool-->
-<!--33 Manc-->
-<!--34 Lanc-->
-<!--35 CERN-->
-       <host id="WC_Edi" power="1f"/>
-       <host id="WC_Manc" power="1f"/>
-       <host id="Gla_router" power="1f"/>
-       <host id="Glasgow" power="20Mf"/>
-       <host id="Edi" power="25.6Mf"/>
-       <host id="Durham" power="4.134Mf"/>
-       <host id="Sheffield" power="49.64Mf"/>
-       <host id="Cam" power="1.32Mf"/>
-       <host id="UCL" power="22.5Mf"/>
-       <host id="IC" power="440Mf"/>
-       <host id="QMW" power="44Mf"/>
-       <host id="Brunel" power="85.68Mf"/>
-       <host id="RHNBC" power="7.2Mf"/>
-       <host id="Bristol" power="60Mf"/>
-       <host id="RAL" power="556.956Mf"/>
-       <host id="Oxford" power="156.56Mf"/>
-       <host id="B_ham" power="13.5Mf"/>
-       <host id="L_pool" power="308.07Mf"/>
-       <host id="Manc" power="22.5Mf"/>
-       <host id="Lanc" power="204.8Mf"/>
-       <host id="CERN" power="1f"/>
-
-       <router id="WC_Gla"/>
-       <router id="WC_Leeds"/>
-       <router id="WC_Reading"/>
-       <router id="WC_London"/>
-       <router id="WC_Bristol"/>
-       <router id="WC_Portsmouth"/>
-       <router id="Edi_router"/>
-       <router id="NorMAN"/>
-       <router id="YHMAN"/>
-       <router id="EastNet"/>
-       <router id="LMN"/>
-       <router id="SWAN_BWEMAN"/>
-       <router id="TVN"/>
-       <router id="MidMAN"/>
-       <router id="NNW_router"/>
-
-       <link id="link0" bandwidth="10kBps"/>
-       <link id="link1" bandwidth="10kBps"/>
-       <link id="link2" bandwidth="1kBps"/>
-       <link id="link3" bandwidth="10kBps"/>
-       <link id="link4" bandwidth="1kBps"/>
-       <link id="link5" bandwidth="10kBps"/>
-       <link id="link6" bandwidth="10kBps"/>
-       <link id="link7" bandwidth="1kBps"/>
-       <link id="link8" bandwidth="1kBps"/>
-       <link id="link9" bandwidth="10kBps"/>
-       <link id="link10" bandwidth="622Bps"/>
-       <link id="link11" bandwidth="1kBps"/>
-       <link id="link12" bandwidth="10kBps"/>
-       <link id="link13" bandwidth="10kBps"/>
-       <link id="link14" bandwidth="622Bps"/>
-       <link id="link15" bandwidth="10kBps"/>
-       <link id="link16" bandwidth="1kBps"/>
-       <link id="link17" bandwidth="1kBps"/>
-       <link id="link18" bandwidth="10kBps"/>
-       <link id="link19" bandwidth="622Bps"/>
-       <link id="link20" bandwidth="2.5kBps"/>
-       <link id="link21" bandwidth="1kBps"/>
-       <link id="link22" bandwidth="1kBps"/>
-       <link id="link23" bandwidth="155Bps"/>
-       <link id="link24" bandwidth="155Bps"/>
-       <link id="link25" bandwidth="155Bps"/>
-       <link id="link26" bandwidth="155Bps"/>
-       <link id="link27" bandwidth="155Bps"/>
-       <link id="link28" bandwidth="155Bps"/>
-       <link id="link29" bandwidth="155Bps"/>
-       <link id="link30" bandwidth="155Bps"/>
-       <link id="link31" bandwidth="622Bps"/>
-       <link id="link32" bandwidth="622Bps"/>
-       <link id="link33" bandwidth="622Bps"/>
-       <link id="link34" bandwidth="622Bps"/>
-       <link id="link35" bandwidth="155Bps"/>
-       <link id="link36" bandwidth="1kBps"/>
-       <link id="link37" bandwidth="155Bps"/>
-
-       <route src="WC_Gla" dst="WC_Gla">
-               <link_ctn id="link0"/>
-       </route>
-       <route src="WC_Gla" dst="WC_Edi">
-               <link_ctn id="link1"/>
-       </route>
-       <route src="WC_Gla" dst="WC_Portsmouth">
-               <link_ctn id="link2"/>
-       </route>
-       <route src="WC_Edi" dst="WC_Manc">
-               <link_ctn id="link3"/>
-       </route>
-       <route src="WC_Edi" dst="Gla_router">
-               <link_ctn id="link4"/>
-       </route>
-       <route src="WC_Manc" dst="WC_Manc">
-               <link_ctn id="link5"/>
-       </route>
-       <route src="WC_Manc" dst="WC_Leeds">
-               <link_ctn id="link6"/>
-       </route>
-       <route src="WC_Manc" dst="TVN">
-               <link_ctn id="link7"/>
-       </route>
-       <route src="WC_Manc" dst="MidMAN">
-               <link_ctn id="link8"/>
-       </route>
-       <route src="WC_Leeds" dst="WC_Reading">
-               <link_ctn id="link9"/>
-       </route>
-       <route src="WC_Leeds" dst="Edi_router">
-               <link_ctn id="link10"/>
-       </route>
-       <route src="WC_Leeds" dst="NorMAN">
-               <link_ctn id="link11"/>
-       </route>
-       <route src="WC_Reading" dst="WC_Reading">
-               <link_ctn id="link12"/>
-       </route>
-       <route src="WC_Reading" dst="WC_London">
-               <link_ctn id="link13"/>
-       </route>
-       <route src="WC_Reading" dst="SWAN_BWEMAN">
-               <link_ctn id="link14"/>
-       </route>
-       <route src="WC_London" dst="WC_Bristol">
-               <link_ctn id="link15"/>
-       </route>
-       <route src="WC_London" dst="YHMAN">
-               <link_ctn id="link16"/>
-       </route>
-       <route src="WC_London" dst="EastNet">
-               <link_ctn id="link17"/>
-       </route>
-       <route src="WC_Bristol" dst="WC_Bristol">
-               <link_ctn id="link18"/>
-       </route>
-       <route src="WC_Bristol" dst="LMN">
-               <link_ctn id="link19"/>
-       </route>
-       <route src="WC_Portsmouth" dst="Lanc">
-               <link_ctn id="link20"/>
-       </route>
-       <route src="Gla_router" dst="NNW_router">
-               <link_ctn id="link21"/>
-       </route>
-       <route src="Edi_router" dst="Glasgow">
-               <link_ctn id="link22"/>
-       </route>
-       <route src="NorMAN" dst="Edi">
-               <link_ctn id="link23"/>
-       </route>
-       <route src="YHMAN" dst="Durham">
-               <link_ctn id="link24"/>
-       </route>
-       <route src="EastNet" dst="Sheffield">
-               <link_ctn id="link25"/>
-       </route>
-       <route src="LMN" dst="Cam">
-               <link_ctn id="link26"/>
-       </route>
-       <route src="LMN" dst="UCL">
-               <link_ctn id="link27"/>
-       </route>
-       <route src="LMN" dst="IC">
-               <link_ctn id="link28"/>
-       </route>
-       <route src="LMN" dst="QMW">
-               <link_ctn id="link29"/>
-       </route>
-       <route src="LMN" dst="Brunel">
-               <link_ctn id="link30"/>
-       </route>
-       <route src="SWAN_BWEMAN" dst="RHNBC">
-               <link_ctn id="link31"/>
-       </route>
-       <route src="TVN" dst="Bristol">
-               <link_ctn id="link32"/>
-       </route>
-       <route src="TVN" dst="RAL">
-               <link_ctn id="link33"/>
-       </route>
-       <route src="MidMAN" dst="Oxford">
-               <link_ctn id="link34"/>
-       </route>
-       <route src="NNW_router" dst="B_ham">
-               <link_ctn id="link35"/>
-       </route>
-       <route src="NNW_router" dst="L_pool">
-               <link_ctn id="link36"/>
-       </route>
-       <route src="NNW_router" dst="Manc">
-               <link_ctn id="link37"/>
-       </route>
-</AS>
-</platform> 
diff --git a/examples/platforms/conf/lcg_sept2004_grid.xml b/examples/platforms/conf/lcg_sept2004_grid.xml
deleted file mode 100644 (file)
index fced84a..0000000
+++ /dev/null
@@ -1,618 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
-<platform version="3">
-<AS  id="AS0"  routing="Floyd">
-       <host id="0" power="1.47Tf"/>
-       <host id="1" power="1.82Gf"/>
-       <host id="2" power="1f"/>
-       <host id="4" power="593.46Gf"/>
-       <host id="5" power="560Mf"/>
-       <host id="6" power="560Mf"/>
-       <host id="7" power="560Mf"/>
-       <host id="8" power="96Mf"/>
-       <host id="9" power="7.68Gf"/>
-       <host id="10" power="910Mf"/>
-       <host id="12" power="250Mf"/>
-       <host id="13" power="448Mf"/>
-       <host id="15" power="12.5Mf"/>
-       <host id="16" power="12.5Mf"/>
-       <host id="18" power="78Mf"/>
-       <host id="20" power="560Mf"/>
-       <host id="23" power="60Mf"/>
-       <host id="24" power="154.524Gf"/>
-       <host id="25" power="60Mf"/>
-       <host id="26" power="60Mf"/>
-       <host id="27" power="60Mf"/>
-       <host id="28" power="60Mf"/>
-       <host id="29" power="60Mf"/>
-       <host id="30" power="60Mf"/>
-       <host id="31" power="1f"/>
-       <host id="32" power="2.1Gf"/>
-       <host id="33" power="21Gf"/>
-       <host id="35" power="442Mf"/>
-       <host id="36" power="6.5Gf"/>
-       <host id="38" power="300Mf"/>
-       <host id="39" power="1.2Gf"/>
-       <host id="42" power="540Mf"/>
-       <host id="43" power="390Mf"/>
-       <host id="44" power="208Mf"/>
-       <host id="45" power="600Mf"/>
-       <host id="49" power="44.352Gf"/>
-       <host id="50" power="4.564Gf"/>
-       <host id="52" power="78.522Gf"/>
-       <host id="54" power="9.2Gf"/>
-       <host id="56" power="142.476Gf"/>
-       <host id="57" power="448Mf"/>
-       <host id="59" power="3.78Gf"/>
-       <host id="60" power="250Mf"/>
-       <host id="61" power="650Mf"/>
-       <host id="64" power="9.2Gf"/>
-       <host id="65" power="250Mf"/>
-       <host id="66" power="250Mf"/>
-       <host id="67" power="592Mf"/>
-       <host id="68" power="250Mf"/>
-       <host id="69" power="250Mf"/>
-       <host id="70" power="250Mf"/>
-       <host id="71" power="4Mf"/>
-       <host id="72" power="250Mf"/>
-       <host id="73" power="250Mf"/>
-       <host id="74" power="1f"/>
-       <host id="75" power="53.6Gf"/>
-       <host id="77" power="14.248Gf"/>
-       <host id="79" power="24Mf"/>
-       <host id="82" power="240Mf"/>
-       <host id="83" power="2.56Gf"/>
-       <host id="86" power="2.28Gf"/>
-       <host id="89" power="20Mf"/>
-       <host id="93" power="250Mf"/>
-       <host id="95" power="8.636Gf"/>
-       <host id="97" power="250Mf"/>
-       <host id="98" power="250Mf"/>
-       <host id="99" power="28.098Gf"/>
-       <host id="100" power="250Mf"/>
-
-       <router id="3"/>
-       <router id="11"/>
-       <router id="14"/>
-       <router id="17"/>
-       <router id="19"/>
-       <router id="21"/>
-       <router id="22"/>
-       <router id="34"/>
-       <router id="37"/>
-       <router id="40"/>
-       <router id="41"/>
-       <router id="46"/>
-       <router id="47"/>
-       <router id="48"/>
-       <router id="51"/>
-       <router id="53"/>
-       <router id="55"/>
-       <router id="58"/>
-       <router id="62"/>
-       <router id="63"/>
-       <router id="76"/>
-       <router id="78"/>
-       <router id="80"/>
-       <router id="81"/>
-       <router id="84"/>
-       <router id="85"/>
-       <router id="87"/>
-       <router id="88"/>
-       <router id="90"/>
-       <router id="91"/>
-       <router id="92"/>
-       <router id="94"/>
-       <router id="96"/>
-
-       <link id="link0" bandwidth="1kBps"/>
-       <link id="link1" bandwidth="10kBps"/>
-       <link id="link2" bandwidth="10kBps"/>
-       <link id="link3" bandwidth="155Bps"/>
-       <link id="link4" bandwidth="10kBps"/>
-       <link id="link5" bandwidth="10kBps"/>
-       <link id="link6" bandwidth="10kBps"/>
-       <link id="link7" bandwidth="155Bps"/>
-       <link id="link8" bandwidth="155Bps"/>
-       <link id="link9" bandwidth="155Bps"/>
-       <link id="link10" bandwidth="155Bps"/>
-       <link id="link11" bandwidth="155Bps"/>
-       <link id="link12" bandwidth="155Bps"/>
-       <link id="link13" bandwidth="155Bps"/>
-       <link id="link14" bandwidth="155Bps"/>
-       <link id="link15" bandwidth="10kBps"/>
-       <link id="link16" bandwidth="10kBps"/>
-       <link id="link17" bandwidth="155Bps"/>
-       <link id="link18" bandwidth="155Bps"/>
-       <link id="link19" bandwidth="155Bps"/>
-       <link id="link20" bandwidth="155Bps"/>
-       <link id="link21" bandwidth="155Bps"/>
-       <link id="link22" bandwidth="622Bps"/>
-       <link id="link23" bandwidth="622Bps"/>
-       <link id="link24" bandwidth="155Bps"/>
-       <link id="link25" bandwidth="10kBps"/>
-       <link id="link26" bandwidth="2.5kBps"/>
-       <link id="link27" bandwidth="155Bps"/>
-       <link id="link28" bandwidth="2.5kBps"/>
-       <link id="link29" bandwidth="1kBps"/>
-       <link id="link30" bandwidth="10kBps"/>
-       <link id="link31" bandwidth="10kBps"/>
-       <link id="link32" bandwidth="155Bps"/>
-       <link id="link33" bandwidth="1kBps"/>
-       <link id="link34" bandwidth="155Bps"/>
-       <link id="link35" bandwidth="155Bps"/>
-       <link id="link36" bandwidth="155Bps"/>
-       <link id="link37" bandwidth="155Bps"/>
-       <link id="link38" bandwidth="155Bps"/>
-       <link id="link39" bandwidth="155Bps"/>
-       <link id="link40" bandwidth="1kBps"/>
-       <link id="link41" bandwidth="1kBps"/>
-       <link id="link42" bandwidth="10kBps"/>
-       <link id="link43" bandwidth="2.5kBps"/>
-       <link id="link44" bandwidth="10kBps"/>
-       <link id="link45" bandwidth="155Bps"/>
-       <link id="link46" bandwidth="155Bps"/>
-       <link id="link47" bandwidth="2.5kBps"/>
-       <link id="link48" bandwidth="155Bps"/>
-       <link id="link49" bandwidth="155Bps"/>
-       <link id="link50" bandwidth="10kBps"/>
-       <link id="link51" bandwidth="155Bps"/>
-       <link id="link52" bandwidth="10kBps"/>
-       <link id="link53" bandwidth="155Bps"/>
-       <link id="link54" bandwidth="155Bps"/>
-       <link id="link55" bandwidth="155Bps"/>
-       <link id="link56" bandwidth="155Bps"/>
-       <link id="link57" bandwidth="2.5kBps"/>
-       <link id="link58" bandwidth="1kBps"/>
-       <link id="link59" bandwidth="10kBps"/>
-       <link id="link60" bandwidth="2.5kBps"/>
-       <link id="link61" bandwidth="2.5kBps"/>
-       <link id="link62" bandwidth="155Bps"/>
-       <link id="link63" bandwidth="10kBps"/>
-       <link id="link64" bandwidth="10kBps"/>
-       <link id="link65" bandwidth="1kBps"/>
-       <link id="link66" bandwidth="155Bps"/>
-       <link id="link67" bandwidth="10kBps"/>
-       <link id="link68" bandwidth="10kBps"/>
-       <link id="link69" bandwidth="1kBps"/>
-       <link id="link70" bandwidth="10kBps"/>
-       <link id="link71" bandwidth="1kBps"/>
-       <link id="link72" bandwidth="10kBps"/>
-       <link id="link73" bandwidth="622Bps"/>
-       <link id="link74" bandwidth="1kBps"/>
-       <link id="link75" bandwidth="1kBps"/>
-       <link id="link76" bandwidth="1kBps"/>
-       <link id="link77" bandwidth="10kBps"/>
-       <link id="link78" bandwidth="155Bps"/>
-       <link id="link79" bandwidth="155Bps"/>
-       <link id="link80" bandwidth="155Bps"/>
-       <link id="link81" bandwidth="155Bps"/>
-       <link id="link82" bandwidth="155Bps"/>
-       <link id="link83" bandwidth="155Bps"/>
-       <link id="link84" bandwidth="155Bps"/>
-       <link id="link85" bandwidth="155Bps"/>
-       <link id="link86" bandwidth="155Bps"/>
-       <link id="link87" bandwidth="155Bps"/>
-       <link id="link88" bandwidth="155Bps"/>
-       <link id="link89" bandwidth="2.5kBps"/>
-       <link id="link90" bandwidth="10kBps"/>
-       <link id="link91" bandwidth="3kBps"/>
-       <link id="link92" bandwidth="3kBps"/>
-       <link id="link93" bandwidth="10kBps"/>
-       <link id="link94" bandwidth="10kBps"/>
-       <link id="link95" bandwidth="622Bps"/>
-       <link id="link96" bandwidth="622Bps"/>
-       <link id="link97" bandwidth="1kBps"/>
-       <link id="link98" bandwidth="3kBps"/>
-       <link id="link99" bandwidth="3kBps"/>
-       <link id="link100" bandwidth="10kBps"/>
-       <link id="link101" bandwidth="2.5kBps"/>
-       <link id="link102" bandwidth="155Bps"/>
-       <link id="link103" bandwidth="10kBps"/>
-       <link id="link104" bandwidth="10kBps"/>
-       <link id="link105" bandwidth="155Bps"/>
-       <link id="link106" bandwidth="155Bps"/>
-       <link id="link107" bandwidth="10kBps"/>
-       <link id="link108" bandwidth="10kBps"/>
-       <link id="link109" bandwidth="10kBps"/>
-       <link id="link110" bandwidth="155Bps"/>
-       <link id="link111" bandwidth="10kBps"/>
-       <link id="link112" bandwidth="10kBps"/>
-       <link id="link113" bandwidth="3kBps"/>
-       <link id="link114" bandwidth="155Bps"/>
-       <link id="link115" bandwidth="3kBps"/>
-       <link id="link116" bandwidth="10kBps"/>
-       <link id="link117" bandwidth="622Bps"/>
-       <link id="link118" bandwidth="155Bps"/>
-       <link id="link119" bandwidth="33Bps"/>
-       <link id="link120" bandwidth="1kBps"/>
-       <link id="link121" bandwidth="622Bps"/>
-       <link id="link122" bandwidth="155Bps"/>
-       <link id="link123" bandwidth="155Bps"/>
-       <link id="link124" bandwidth="155Bps"/>
-       <link id="link125" bandwidth="155Bps"/>
-       <link id="link126" bandwidth="622Bps"/>
-
-       <route src="0" dst="2">
-               <link_ctn id="link0"/>
-       </route>
-       <route src="0" dst="31">
-               <link_ctn id="link1"/>
-       </route>
-       <route src="0" dst="74">
-               <link_ctn id="link2"/>
-       </route>
-       <route src="1" dst="2">
-               <link_ctn id="link3"/>
-       </route>
-       <route src="2" dst="2">
-               <link_ctn id="link4"/>
-       </route>
-       <route src="2" dst="16">
-               <link_ctn id="link5"/>
-       </route>
-       <route src="2" dst="57">
-               <link_ctn id="link6"/>
-       </route>
-       <route src="3" dst="3">
-               <link_ctn id="link7"/>
-       </route>
-       <route src="3" dst="4">
-               <link_ctn id="link8"/>
-       </route>
-       <route src="3" dst="5">
-               <link_ctn id="link9"/>
-       </route>
-       <route src="3" dst="6">
-               <link_ctn id="link10"/>
-       </route>
-       <route src="3" dst="7">
-               <link_ctn id="link11"/>
-       </route>
-       <route src="3" dst="8">
-               <link_ctn id="link12"/>
-       </route>
-       <route src="3" dst="9">
-               <link_ctn id="link13"/>
-       </route>
-       <route src="3" dst="10">
-               <link_ctn id="link14"/>
-       </route>
-       <route src="3" dst="20">
-               <link_ctn id="link15"/>
-       </route>
-       <route src="3" dst="61">
-               <link_ctn id="link16"/>
-       </route>
-       <route src="11" dst="11">
-               <link_ctn id="link17"/>
-       </route>
-       <route src="11" dst="12">
-               <link_ctn id="link18"/>
-       </route>
-       <route src="11" dst="30">
-               <link_ctn id="link19"/>
-       </route>
-       <route src="14" dst="14">
-               <link_ctn id="link20"/>
-       </route>
-       <route src="14" dst="15">
-               <link_ctn id="link21"/>
-       </route>
-       <route src="14" dst="20">
-               <link_ctn id="link22"/>
-       </route>
-       <route src="14" dst="45">
-               <link_ctn id="link23"/>
-       </route>
-       <route src="17" dst="17">
-               <link_ctn id="link24"/>
-       </route>
-       <route src="17" dst="18">
-               <link_ctn id="link25"/>
-       </route>
-       <route src="17" dst="20">
-               <link_ctn id="link26"/>
-       </route>
-       <route src="19" dst="19">
-               <link_ctn id="link27"/>
-       </route>
-       <route src="19" dst="33">
-               <link_ctn id="link28"/>
-       </route>
-       <route src="21" dst="21">
-               <link_ctn id="link29"/>
-       </route>
-       <route src="21" dst="30">
-               <link_ctn id="link30"/>
-       </route>
-       <route src="21" dst="57">
-               <link_ctn id="link31"/>
-       </route>
-       <route src="22" dst="22">
-               <link_ctn id="link32"/>
-       </route>
-       <route src="22" dst="23">
-               <link_ctn id="link33"/>
-       </route>
-       <route src="22" dst="24">
-               <link_ctn id="link34"/>
-       </route>
-       <route src="22" dst="25">
-               <link_ctn id="link35"/>
-       </route>
-       <route src="22" dst="26">
-               <link_ctn id="link36"/>
-       </route>
-       <route src="22" dst="27">
-               <link_ctn id="link37"/>
-       </route>
-       <route src="22" dst="28">
-               <link_ctn id="link38"/>
-       </route>
-       <route src="22" dst="29">
-               <link_ctn id="link39"/>
-       </route>
-       <route src="31" dst="31">
-               <link_ctn id="link40"/>
-       </route>
-       <route src="31" dst="32">
-               <link_ctn id="link41"/>
-       </route>
-       <route src="31" dst="45">
-               <link_ctn id="link42"/>
-       </route>
-       <route src="31" dst="57">
-               <link_ctn id="link43"/>
-       </route>
-       <route src="31" dst="73">
-               <link_ctn id="link44"/>
-       </route>
-       <route src="34" dst="34">
-               <link_ctn id="link45"/>
-       </route>
-       <route src="34" dst="35">
-               <link_ctn id="link46"/>
-       </route>
-       <route src="34" dst="36">
-               <link_ctn id="link47"/>
-       </route>
-       <route src="37" dst="37">
-               <link_ctn id="link48"/>
-       </route>
-       <route src="37" dst="38">
-               <link_ctn id="link49"/>
-       </route>
-       <route src="37" dst="39">
-               <link_ctn id="link50"/>
-       </route>
-       <route src="40" dst="40">
-               <link_ctn id="link51"/>
-       </route>
-       <route src="40" dst="45">
-               <link_ctn id="link52"/>
-       </route>
-       <route src="41" dst="41">
-               <link_ctn id="link53"/>
-       </route>
-       <route src="41" dst="42">
-               <link_ctn id="link54"/>
-       </route>
-       <route src="41" dst="43">
-               <link_ctn id="link55"/>
-       </route>
-       <route src="41" dst="44">
-               <link_ctn id="link56"/>
-       </route>
-       <route src="46" dst="46">
-               <link_ctn id="link57"/>
-       </route>
-       <route src="46" dst="56">
-               <link_ctn id="link58"/>
-       </route>
-       <route src="46" dst="57">
-               <link_ctn id="link59"/>
-       </route>
-       <route src="46" dst="75">
-               <link_ctn id="link60"/>
-       </route>
-       <route src="46" dst="79">
-               <link_ctn id="link61"/>
-       </route>
-       <route src="46" dst="95">
-               <link_ctn id="link62"/>
-       </route>
-       <route src="47" dst="47">
-               <link_ctn id="link63"/>
-       </route>
-       <route src="47" dst="54">
-               <link_ctn id="link64"/>
-       </route>
-       <route src="48" dst="48">
-               <link_ctn id="link65"/>
-       </route>
-       <route src="48" dst="49">
-               <link_ctn id="link66"/>
-       </route>
-       <route src="48" dst="50">
-               <link_ctn id="link67"/>
-       </route>
-       <route src="48" dst="54">
-               <link_ctn id="link68"/>
-       </route>
-       <route src="51" dst="51">
-               <link_ctn id="link69"/>
-       </route>
-       <route src="51" dst="52">
-               <link_ctn id="link70"/>
-       </route>
-       <route src="53" dst="53">
-               <link_ctn id="link71"/>
-       </route>
-       <route src="53" dst="54">
-               <link_ctn id="link72"/>
-       </route>
-       <route src="55" dst="55">
-               <link_ctn id="link73"/>
-       </route>
-       <route src="58" dst="58">
-               <link_ctn id="link74"/>
-       </route>
-       <route src="58" dst="59">
-               <link_ctn id="link75"/>
-       </route>
-       <route src="58" dst="60">
-               <link_ctn id="link76"/>
-       </route>
-       <route src="58" dst="61">
-               <link_ctn id="link77"/>
-       </route>
-       <route src="62" dst="62">
-               <link_ctn id="link78"/>
-       </route>
-       <route src="62" dst="65">
-               <link_ctn id="link79"/>
-       </route>
-       <route src="62" dst="66">
-               <link_ctn id="link80"/>
-       </route>
-       <route src="62" dst="67">
-               <link_ctn id="link81"/>
-       </route>
-       <route src="62" dst="68">
-               <link_ctn id="link82"/>
-       </route>
-       <route src="62" dst="69">
-               <link_ctn id="link83"/>
-       </route>
-       <route src="62" dst="70">
-               <link_ctn id="link84"/>
-       </route>
-       <route src="62" dst="71">
-               <link_ctn id="link85"/>
-       </route>
-       <route src="62" dst="72">
-               <link_ctn id="link86"/>
-       </route>
-       <route src="63" dst="63">
-               <link_ctn id="link87"/>
-       </route>
-       <route src="63" dst="64">
-               <link_ctn id="link88"/>
-       </route>
-       <route src="74" dst="74">
-               <link_ctn id="link89"/>
-       </route>
-       <route src="74" dst="75">
-               <link_ctn id="link90"/>
-       </route>
-       <route src="74" dst="80">
-               <link_ctn id="link91"/>
-       </route>
-       <route src="74" dst="83">
-               <link_ctn id="link92"/>
-       </route>
-       <route src="74" dst="89">
-               <link_ctn id="link93"/>
-       </route>
-       <route src="74" dst="90">
-               <link_ctn id="link94"/>
-       </route>
-       <route src="74" dst="95">
-               <link_ctn id="link95"/>
-       </route>
-       <route src="74" dst="99">
-               <link_ctn id="link96"/>
-       </route>
-       <route src="76" dst="76">
-               <link_ctn id="link97"/>
-       </route>
-       <route src="76" dst="77">
-               <link_ctn id="link98"/>
-       </route>
-       <route src="76" dst="80">
-               <link_ctn id="link99"/>
-       </route>
-       <route src="76" dst="90">
-               <link_ctn id="link100"/>
-       </route>
-       <route src="76" dst="93">
-               <link_ctn id="link101"/>
-       </route>
-       <route src="78" dst="78">
-               <link_ctn id="link102"/>
-       </route>
-       <route src="78" dst="79">
-               <link_ctn id="link103"/>
-       </route>
-       <route src="80" dst="80">
-               <link_ctn id="link104"/>
-       </route>
-       <route src="81" dst="81">
-               <link_ctn id="link105"/>
-       </route>
-       <route src="81" dst="82">
-               <link_ctn id="link106"/>
-       </route>
-       <route src="81" dst="83">
-               <link_ctn id="link107"/>
-       </route>
-       <route src="84" dst="84">
-               <link_ctn id="link108"/>
-       </route>
-       <route src="84" dst="86">
-               <link_ctn id="link109"/>
-       </route>
-       <route src="85" dst="85">
-               <link_ctn id="link110"/>
-       </route>
-       <route src="85" dst="86">
-               <link_ctn id="link111"/>
-       </route>
-       <route src="87" dst="87">
-               <link_ctn id="link112"/>
-       </route>
-       <route src="87" dst="89">
-               <link_ctn id="link113"/>
-       </route>
-       <route src="88" dst="88">
-               <link_ctn id="link114"/>
-       </route>
-       <route src="88" dst="89">
-               <link_ctn id="link115"/>
-       </route>
-       <route src="90" dst="90">
-               <link_ctn id="link116"/>
-       </route>
-       <route src="90" dst="91">
-               <link_ctn id="link117"/>
-       </route>
-       <route src="90" dst="95">
-               <link_ctn id="link118"/>
-       </route>
-       <route src="91" dst="93">
-               <link_ctn id="link119"/>
-       </route>
-       <route src="92" dst="92">
-               <link_ctn id="link120"/>
-       </route>
-       <route src="92" dst="93">
-               <link_ctn id="link121"/>
-       </route>
-       <route src="94" dst="94">
-               <link_ctn id="link122"/>
-       </route>
-       <route src="94" dst="95">
-               <link_ctn id="link123"/>
-       </route>
-       <route src="96" dst="96">
-               <link_ctn id="link124"/>
-       </route>
-       <route src="96" dst="97">
-               <link_ctn id="link125"/>
-       </route>
-       <route src="96" dst="98">
-               <link_ctn id="link126"/>
-       </route>
-</AS>
-</platform> 
index d2db4d9..7f9e93f 100644 (file)
@@ -1,6 +1,6 @@
 #!/usr/bin/env perl
 
-# Copyright (c) 2011, 2014. The SimGrid Team.
+# Copyright (c) 2011, 2014, 2016. The SimGrid Team.
 # All rights reserved.
 
 # This program is free software; you can redistribute it and/or modify it
@@ -17,10 +17,21 @@ my($conf_file)=$ARGV[0];
 
 open FILE, $conf_file or die "Unable to open $conf_file";
 
+print "<!-- This platform was automatically converted from the OptorSim platform.\n";
+print "\n";
+print "  OptorSim files only describes information of the cluster interconnexion.\n";
+print "  In a sense, it reflects the topology of a National Research and Education\n";
+print "  Network (NREN), but not of a full-fledged computational platform.\n";
+print "  The caracteristics of each cluster have been artificially added.\n";
+print "\n";
+print "  We hope that you find it useful anyway. If you know how to complete\n";
+print "  this information with data on the cluster configurations, please\n";
+print "  drop us a mail so that we can add this information. -->\n\n";
+
 print "<?xml version='1.0'?>\n";
 print "<!DOCTYPE platform SYSTEM \"http://simgrid.gforge.inria.fr/simgrid.dtd\">\n";
 print "<platform version=\"3\">\n";
-print "<AS  id=\"AS0\"  routing=\"Floyd\">\n";
+print "<AS id=\"AS0\" routing=\"Floyd\">\n";
 
 my $line;
 my @tokens;
@@ -39,134 +50,130 @@ my @routes = ();
 my @routes_router = ();
 my @routes_cluster = ();
 my $nb_host;
-while(defined($line=<FILE>))
-{
-       
-if($line =~ /^#(.*)\)(.*)$/)
-{
+while(defined($line=<FILE>)){
+    if($line =~ /^#(.*)\)(.*)$/)
+    {
        print "<!--$1 $2-->\n";
        push @list_of_name, $2;
-}
-elsif($line =~ /^([0-9]*) ([0-9]*) ([0-9]*) (.*)$/)
-{
+    }
+    elsif($line =~ /^([0-9]*) ([0-9]*) ([0-9]*) (.*)$/)
+    {
        if($1 == "0"){
-               push @is_router, 1;
-               if(@list_of_name){
-                       push @routers, "\t\t<router id=\"$list_of_name[$src]\"/>\n";
-               }
-               else{
-                       push @routers, "\t\t<router id=\"router$src\"/>\n";
-               }
+           push @is_router, 1;
+           if(@list_of_name){
+               push @routers, "    <router id=\"$list_of_name[$src]\"/>\n";
+           }
+           else{
+               push @routers, "    <router id=\"router$src\"/>\n";
+           }
        }
        else{
-               push @is_router, 0;
-               $nb_host = $1;
-               if(@list_of_name){
-                       push @hosts, "\t<cluster id=\"$list_of_name[$src]\" prefix=\"$list_of_name[$src]-\" suffix=\"\"\n";
-                       push @hosts, "\t         radical=\"1-$nb_host\" power=\"1000000000\"    bw=\"125000000\"     lat=\"5E-5\"\n";
-                       push @hosts, "\t         router_id=\"$list_of_name[$src]-router\"/>\n";
-               }
-               else{
-                       push @hosts, "\t<cluster id=\"cluster$src\" prefix=\"$list_of_name[$src]-\" suffix=\"\"\n";
-                       push @hosts, "\t         radical=\"1-$nb_host\" power=\"1000000000\"    bw=\"125000000\"     lat=\"5E-5\"\n";
-                       push @hosts, "\t         router_id=\"cluster$src-router\"/>\n";
-               }
+           push @is_router, 0;
+           $nb_host = $1;
+           if(@list_of_name){
+               push @hosts, "  <cluster id=\"$list_of_name[$src]\" prefix=\"$list_of_name[$src]-\" suffix=\"\"\n";
+               push @hosts, "           radical=\"1-$nb_host\" power=\"1000000000\" bw=\"125000000\" lat=\"5E-5\"\n";
+               push @hosts, "           router_id=\"$list_of_name[$src]-router\"/>\n";
+           }
+           else{
+               push @hosts, "  <cluster id=\"cluster$src\" prefix=\"$src-\" suffix=\"\"\n";
+               push @hosts, "           radical=\"1-$nb_host\" power=\"1000000000\" bw=\"125000000\" lat=\"5E-5\"\n";
+               push @hosts, "           router_id=\"cluster$src-router\"/>\n";
+           }
        }               
        my $table = $4;
        @tokens = split(/ /,$table);
        foreach $token (@tokens) {
-               if($src >= $dst){
-                       if($token != "0") #if there is a link between src and dst
-                       {       
-                               #Create a link                          
-                               if($1 == "0"){ 
-                                       push @links_router, "\t\t<link id=\"link$num_link\" bandwidth=\"$token\"/>\n";
-                               }
-                               else{
-                                       push @links, "\t<link id=\"link$num_link\" bandwidth=\"$token\"/>\n";
-                               }
-
-                               #Create the route between router and router
-                               if($is_router[$src] && $is_router[$dst]) 
-                               {
-                                       if(@list_of_name){
-                                               push @routes_router, "\t\t<route src=\"$list_of_name[$src]\" dst=\"$list_of_name[$dst]\">\n";
-                                       }
-                                       else{
-                                               push @routes_router, "\t\t<route src=\"router$src\" dst=\"router$dst\">\n";
-                                       }
-                                       push @routes_router, "\t\t\t<link_ctn id=\"link$num_link\"/>\n";
-                                       push @routes_router, "\t\t</route>\n";
-                               }
-
-                               #Create the route between cluster and cluster
-                               elsif(!$is_router[$src] && !$is_router[$dst]) 
-                               {
-                                       if(@list_of_name){
-                                       push @routes_cluster, "\t\t<ASroute src=\"$list_of_name[$src]\" dst=\"$list_of_name[$dst]\"\n";
-                                       push @routes_cluster, "\t\t     gw_src=\"$list_of_name[$src]-router\" gw_dst=\"$list_of_name[$dst]-router\">\n";
-                                       }
-                                       else{
-                                       push @routes_cluster, "\t\t<ASroute src=\"cluster$src\" dst=\"cluster$dst\"\n";
-                                       push @routes_cluster, "\t\t    gw_src=\"cluster$src-router\" dst=\"cluster$dst-router\">\n";
-                                       }
-                                       push @routes_cluster, "\t\t\t<link_ctn id=\"link$num_link\"/>\n";
-                                       push @routes_cluster, "\t\t</ASroute>\n";
-                               }                               
-                               else
-                               {
-                                       push @routes, "\t<ASroute ";
-                                       if(@list_of_name){
-                                               if($is_router[$src])    #router
-                                                       {push @routes, "src=\"AS_intern\" gw_src=\"$list_of_name[$src]\"\n";}
-                                               else                    #cluster
-                                                       {push @routes, "src=\"$list_of_name[$src]\" gw_src=\"$list_of_name[$src]-router\"\n";}
-
-
-                                               if($is_router[$dst])    #router
-                                                       {push @routes, "\t\tdst=\"AS_intern\" gw_dst=\"$list_of_name[$dst]\">\n";}
-                                               else                    #cluster
-                                                       {push @routes, "\t\tdst=\"$list_of_name[$dst]\" gw_dst=\"$list_of_name[$dst]-router\">\n";}
-                                       }
-                                       else{
-                                               if($is_router[$src])    #router
-                                                       {push @routes, "src=\"AS_intern\" gw_src=\"router$src\"\n";}
-                                               else                    #cluster
-                                                       {push @routes, "src=\"cluster$src\" gw_src=\"cluster$src-router\"\n";}
-
-
-                                               if($is_router[$dst])    #router
-                                                       {push @routes, "\t\tdst=\"AS_intern\" gw_dst=\"router$dst\">\n";}
-                                               else                    #cluster
-                                                       {push @routes, "\t\tdst=\"cluster$dst\" gw_dst=\"cluster$dst-router\">\n";}
-                                       }
-                                       push @routes, "\t\t<link_ctn id=\"link$num_link\"/>\n";
-                                       push @routes, "\t</ASroute>\n";
-
-                               }
-
-                               $num_link++;    
+           if($src >= $dst){
+               if($token != "0") #if there is a link between src and dst
+               {       
+                   #Create a link                              
+                   if($1 == "0"){ 
+                       push @links_router, "    <link id=\"link$num_link\" bandwidth=\"$token\"/>\n";
+                   }
+                   else{
+                       push @links, "  <link id=\"link$num_link\" bandwidth=\"$token\"/>\n";
+                   }
+                   
+                   #Create the route between router and router
+                   if($is_router[$src] && $is_router[$dst]) 
+                   {
+                       if(@list_of_name){
+                           push @routes_router, "    <route src=\"$list_of_name[$src]\" dst=\"$list_of_name[$dst]\">";
+                       }
+                       else{
+                           push @routes_router, "    <route src=\"router$src\" dst=\"router$dst\">";
+                       }
+                       push @routes_router, " <link_ctn id=\"link$num_link\"/>";
+                       push @routes_router, " </route>\n";
+                   }
+                   
+                   #Create the route between cluster and cluster
+                   elsif(!$is_router[$src] && !$is_router[$dst]) 
+                   {
+                       if(@list_of_name){
+                           push @routes_cluster, "    <ASroute src=\"$list_of_name[$src]\" dst=\"$list_of_name[$dst]\"";
+                           push @routes_cluster, " gw_src=\"$list_of_name[$src]-router\" gw_dst=\"$list_of_name[$dst]-router\">\n";
+                       }
+                       else{
+                           push @routes_cluster, "    <ASroute src=\"cluster$src\" dst=\"cluster$dst\"";
+                           push @routes_cluster, " gw_src=\"cluster$src-router\" dst=\"cluster$dst-router\">\n";
+                       }
+                       push @routes_cluster, "      <link_ctn id=\"link$num_link\"/>\n";
+                       push @routes_cluster, "    </ASroute>\n";
+                   }                           
+                   else
+                   {
+                       push @routes, "  <ASroute ";
+                       if(@list_of_name){
+                           if($is_router[$src])        #router
+                           {push @routes, "src=\"AS_intern\" gw_src=\"$list_of_name[$src]\" ";}
+                           else                        #cluster
+                           {push @routes, "src=\"$list_of_name[$src]\" gw_src=\"$list_of_name[$src]-router\" ";}
+                           
+                           
+                           if($is_router[$dst])        #router
+                           {push @routes, "dst=\"AS_intern\" gw_dst=\"$list_of_name[$dst]\">\n";}
+                           else                        #cluster
+                           {push @routes, "dst=\"$list_of_name[$dst]\" gw_dst=\"$list_of_name[$dst]-router\">\n";}
                        }
+                       else{
+                           if($is_router[$src])        #router
+                           {push @routes, "src=\"AS_intern\" gw_src=\"router$src\" ";}
+                           else                        #cluster
+                           {push @routes, "src=\"cluster$src\" gw_src=\"cluster$src-router\" ";}
+                           
+                           
+                           if($is_router[$dst])        #router
+                           {push @routes, "dst=\"AS_intern\" gw_dst=\"router$dst\">\n";}
+                           else                        #cluster
+                           {push @routes, "dst=\"cluster$dst\" gw_dst=\"cluster$dst-router\">\n";}
+                       }
+                       push @routes, "    <link_ctn id=\"link$num_link\"/>\n";
+                       push @routes, "  </ASroute>\n";
+                       
+                   }
+                   
+                   $num_link++;        
                }
-               $dst++;
+           }
+           $dst++;
        }
        $src++;
        $dst = 0;
-}
-else
-{
-die;
-}
-       
-       
+    }
+    else
+    {
+       die;
+    }
 }
 close(FILE);
 
-print "\t<AS  id=\"AS_intern\"  routing=\"Floyd\">\n";
+print "  <AS id=\"AS_intern\" routing=\"Floyd\">\n";
 print @routers;
 print @links_router;
 print @routes_router;
-print "\t</AS>\n";
+print "  </AS>\n";
 print "\n";    
 print @hosts;
 print @routes_cluster;
@@ -175,9 +182,6 @@ print "\n";
 print @links;
 print "\n";
 print @routes;
-print "\n";
-
 print "</AS>\n";
 print "</platform>";
-
 print " \n";
diff --git a/examples/platforms/generation_scripts/generate_g5k_platform.pl b/examples/platforms/generation_scripts/generate_g5k_platform.pl
deleted file mode 100755 (executable)
index 048143f..0000000
+++ /dev/null
@@ -1,216 +0,0 @@
-#!/usr/bin/env perl
-
-# Copyright (c) 2011, 2014. The SimGrid Team.
-# All rights reserved.
-
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the license (GNU LGPL) which comes with this package.
-
-use strict;
-use warnings;
-use Switch;
-my $toversion=3;
-
-if($#ARGV!=1) {
-    die "Usage: ./generate_g5k_platform.pl g5k_username g5k_password\n";
-}
-
-print "<?xml version='1.0'?>\n";
-print "<!DOCTYPE platform SYSTEM \"http://simgrid.gforge.inria.fr/simgrid.dtd\">\n";
-print "<platform version=\"$toversion\">\n";
-print "\t<AS id=\"AS_grid5000\" routing=\"Floyd\" >\n";
-
-`rm -rf temp_g5k`;
-`mkdir -p temp_g5k`;
-chdir("./temp_g5k");
-`wget https://api.grid5000.fr/2.0/grid5000/sites --http-user="$ARGV[0]" --http-password="$ARGV[1]" --no-check-certificate --quiet`;
-
-open SITES_LIGNE, 'sites' or die "Unable to open sites $!\n";
-my $line = "";
-my $site = "";
-my $cluster = "";
-my $nodes = "";
-my @AS_route = ();
-
-print "\t\t<AS id=\"AS_interne\" routing=\"Floyd\">\n";
-printf "\t\t\t<router id=\"lille\"/>\n";
-printf "\t\t\t<router id=\"paris\"/>\n";
-printf "\t\t\t<router id=\"nancy\"/>\n";
-printf "\t\t\t<router id=\"rennes\"/>\n";
-printf "\t\t\t<router id=\"lyon\"/>\n";
-printf "\t\t\t<router id=\"bordeaux\"/>\n";
-printf "\t\t\t<router id=\"grenoble\"/>\n";
-printf "\t\t\t<router id=\"marseille\"/>\n";
-printf "\t\t\t<router id=\"toulouse\"/>\n";
-printf "\t\t\t<router id=\"sophia\"/>\n";
-#printf "\t\t\t<router id=\"luxembourg\">\n";
-print "\n";
-printf "\t\t\t<link id=\"Lille_Paris\"        bandwidth=\"1.25E9\" latency=\"1.0E-4\"/>\n";
-printf "\t\t\t<link id=\"Paris_Nancy\"        bandwidth=\"1.25E9\" latency=\"1.0E-4\"/>\n";
-printf "\t\t\t<link id=\"Paris_Rennes\"       bandwidth=\"1.25E9\" latency=\"1.0E-4\"/>\n";
-printf "\t\t\t<link id=\"Paris_Lyon\"         bandwidth=\"1.25E9\" latency=\"1.0E-4\"/>\n";
-printf "\t\t\t<link id=\"Bordeaux_Lyon\"      bandwidth=\"1.25E9\" latency=\"1.0E-4\"/>\n";
-printf "\t\t\t<link id=\"Lyon_Grenoble\"      bandwidth=\"1.25E9\" latency=\"1.0E-4\"/>\n";
-printf "\t\t\t<link id=\"Lyon_Marseille\"     bandwidth=\"1.25E9\" latency=\"1.0E-4\"/>\n";
-printf "\t\t\t<link id=\"Marseille_Sophia\"   bandwidth=\"1.25E9\" latency=\"1.0E-4\"/>\n";
-printf "\t\t\t<link id=\"Marseille_Toulouse\" bandwidth=\"1.25E9\" latency=\"1.0E-4\"/>\n";
-#printf "\t\t<link id=\"Luxemburg_Nancy\"    bandwidth=\"1.25E9\" latency=\"1.0E-4\"/>\n";
-print "\n";
-
-print "\t\t<route src=\"lille\"     dst=\"paris\"     ><link_ctn id=\"Lille_Paris\"/></route>\n";
-print "\t\t<route src=\"paris\"     dst=\"nancy\"     ><link_ctn id=\"Paris_Nancy\"/></route>\n";
-print "\t\t<route src=\"paris\"     dst=\"rennes\"    ><link_ctn id=\"Paris_Rennes\"/></route>\n";
-print "\t\t<route src=\"paris\"     dst=\"lyon\"      ><link_ctn id=\"Paris_Lyon\"/></route>\n";
-print "\t\t<route src=\"bordeaux\"  dst=\"lyon\"      ><link_ctn id=\"Bordeaux_Lyon\"/></route>\n";
-print "\t\t<route src=\"lyon\"      dst=\"grenoble\"  ><link_ctn id=\"Lyon_Grenoble\"/></route>\n";
-print "\t\t<route src=\"lyon\"      dst=\"marseille\" ><link_ctn id=\"Lyon_Marseille\"/></route>\n";
-print "\t\t<route src=\"marseille\" dst=\"sophia\"    ><link_ctn id=\"Marseille_Sophia\"/></route>\n";
-print "\t\t<route src=\"marseille\" dst=\"toulouse\"  ><link_ctn id=\"Marseille_Toulouse\"/></route>\n";
-#print "\t\t<route src=\"Luxemburg\" dst=\"Nancy\"     ><link_ctn id=\"Luxemburg_Nancy\"/></route>\n";
-print "\t\t</AS>\n";    
-
-while(defined($line=<SITES_LIGNE>))
-{
-       if($line =~ /"uid": "(.*)",/){
-               $site = $1;
-               print "\t\t<AS id=\"AS_$site\" routing=\"RuleBased\" >\n";
-               `wget https://api.grid5000.fr/2.0/grid5000/sites/$site/clusters --http-user="$ARGV[0]" --http-password="$ARGV[1]" --no-check-certificate --quiet`;
-               open CLUSTERS_LIGNE, 'clusters' or die "Unable to open clusters $!\n";
-               while(defined($line=<CLUSTERS_LIGNE>))
-               {
-                       if($line =~ /"uid": "(.*)",/){
-                               $cluster = $1;
-                               print "\t\t\t<cluster id=\"AS_$cluster\" prefix=\"$cluster-\" suffix=\".$site.grid5000.fr\"\n";
-                               `wget https://api.grid5000.fr/2.0/grid5000/sites/$site/clusters/$cluster/nodes --http-user="$ARGV[0]" --http-password="$ARGV[1]" --no-check-certificate --quiet`;
-                               open NODES_LIGNE, 'nodes' or die "Unable to open nodes $!\n";
-                               while(defined($line=<NODES_LIGNE>))
-                               {
-                                       if($line =~ /"total": (.*),/){
-                                               print "\t\t\t\tradical=\"1-$1\" power=\"";
-                                               &get_gflops($cluster);
-                                               print "\" bw=\"1.25E8\" lat=\"1.0E-4\""."\n";
-                                               print "\t\t\t\tbb_bw=\"1.25E9\" bb_lat=\"1.0E-4\"></cluster>\n";
-                                       }
-                               }
-                               print "\t\t\t<link   id=\"link_$cluster\" bandwidth=\"1.25E9\" latency=\"1.0E-4\"/>\n\n";
-                               close NODES_LIGNE;
-                               `rm nodes`;
-                       }
-               }
-               close CLUSTERS_LIGNE;
-               `rm clusters`;
-               
-               print "\t\t\t<AS id=\"gw_AS_$site\" routing=\"Full\">\n";
-               print "\t\t\t\t<router id=\"gw_$site\"/>\n";
-               print "\t\t\t</AS>\n";
-               print "\t\t\t<link   id=\"link_gw_$site\" bandwidth=\"1.25E9\" latency=\"1.0E-4\"/>\n";
-               print "\n";
-               
-               print "\t\t\t<ASroute src=\"^AS_(.*)\$\" dst=\"^AS_(.*)\$\"\n";
-               print "\t\t\t\tgw_src=\"\$1src-AS_\$1src_router.$site.grid5000.fr\"\n";
-               print "\t\t\t\tgw_dst=\"\$1dst-AS_\$1dst_router.$site.grid5000.fr\"\n";
-               print "\t\t\t\tsymmetrical=\"YES\">\n";
-               print "\t\t\t\t\t<link_ctn id=\"link_\$1src\"/>\n";
-               print "\t\t\t\t\t<link_ctn id=\"link_\$1dst\"/>\n";
-               print "\t\t\t</ASroute>\n\n"; 
-
-               print "\t\t\t<ASroute src=\"^AS_(.*)\$\" dst=\"^gw_AS_(.*)\$\"\n";
-               print "\t\t\t\tgw_src=\"\$1src-AS_\$1src_router.$site.grid5000.fr\"\n";
-               print "\t\t\t\tgw_dst=\"gw_\$1dst\"\n";
-               print "\t\t\t\tsymmetrical=\"NO\">\n";
-               print "\t\t\t\t\t<link_ctn id=\"link_\$1src\"/>\n";
-               print "\t\t\t</ASroute>\n\n"; 
-               
-               print "\t\t\t<ASroute src=\"^gw_AS_(.*)\$\" dst=\"^AS_(.*)\$\"\n";
-               print "\t\t\t\tgw_src=\"gw_\$1src\"\n";
-               print "\t\t\t\tgw_dst=\"\$1dst-AS_\$1dst_router.$site.grid5000.fr\"\n";
-               print "\t\t\t\tsymmetrical=\"NO\">\n";
-               print "\t\t\t\t\t<link_ctn id=\"link_\$1dst\"/>\n";
-               print "\t\t\t</ASroute>\n\n"; 
-               
-               print "\t\t</AS>\n";
-               
-               push @AS_route, $site;
-       }
-}
-
-while(@AS_route)
-{
-       $site = pop @AS_route;
-       print "\t\t<ASroute src=\"AS_$site\" dst=\"AS_interne\" gw_src=\"gw_$site\"";
-       if( $site =~ /^orsay$/ )
-       {
-               print " gw_dst=\"paris\"";
-       }
-       else
-       {
-               print " gw_dst=\"$site\"";
-       }
-       print " symmetrical=\"YES\">\n";
-       print "\t\t\t<link_ctn id=\"link_gw_$site\"/>\n";
-       print "\t\t</ASroute>\n";
-       
-#      print "\t\t<ASroute src=\"AS_interne\" dst=\"AS_$site\" gw_dst=\"gw_$site\"";
-#      if( $site =~ /^orsay$/ )
-#      {
-#              print " gw_src=\"paris\"";
-#      }
-#      else
-#      {
-#              print " gw_src=\"$site\"";
-#      }
-#      print " symmetrical=\"NO\">\n";
-#      print "\t\t\t<link_ctn id=\"link_gw_$site\"/>\n";
-#      print "\t\t</ASroute>\n";
-}
-
-print "\t</AS>\n";
-print "</platform>\n";
-`rm sites`;
-close SITES_LIGNE;
-
-
-sub get_gflops {
-       switch ($_[0]) {
-               #Bordeaux
-               case "bordeplage" { print "5.2297E9" }
-               case "bordereau"  { print "8.8925E9" }
-               case "borderline" { print "13.357E9" }
-               #Lille
-               case "chicon"     { print "8.9618E9" }
-               case "chimint"    { print "23.531E9" }
-               case "chinqchint" { print "22.270E9" }
-               case "chirloute"  { print "24.473E9" }
-               #Grenoble
-               case "adonis"     { print "23.681E9" }
-               case "edel"       { print "23.492E9" }
-               case "genepi"     { print "21.175E9" }
-               #Lyon
-               case "capricorne" { print "4.7233E9" }
-               case "sagittaire" { print "5.6693E9" }
-               #Nancy
-               case "graphene"   { print "16.673E9" }
-               case "griffon"    { print "20.678E9" }
-               #Orsay
-               case "gdx"        { print "4.7153E9" }
-               case "netgdx"     { print "4.7144E9" }
-               #Rennes
-               case "paradent"   { print "21.496E9" }
-               case "paramount"  { print "12.910E9" }
-               case "parapide"   { print "30.130E9" }
-               case "parapluie"  { print "27.391E9" }
-               #Sophia
-               case "helios"     { print "7.7318E9" }
-               case "sol"        { print "8.9388E9" }
-               case "suno"       { print "23.530E9" }
-               #Toulouse
-               case "pastel"     { print "9.5674E9" }
-               case "violette"   { print "5.1143E9" }
-               #Reims
-               case "stremi"     { print "TODO" }
-               #Luxembourg
-               case "granduc"    { print "TODO" }
-
-               default:          { print "TODO" }
-       }
-}
diff --git a/examples/platforms/generation_scripts/generate_g5k_platform_cabinets.pl b/examples/platforms/generation_scripts/generate_g5k_platform_cabinets.pl
deleted file mode 100755 (executable)
index 9f3818e..0000000
+++ /dev/null
@@ -1,351 +0,0 @@
-#!/usr/bin/env perl
-
-# Copyright (c) 2011, 2014. The SimGrid Team.
-# All rights reserved.
-
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the license (GNU LGPL) which comes with this package.
-
-use strict;
-use warnings;
-use Switch;
-
-my $site="";
-my $cluster="";
-my $toversion=3;
-my $line;
-my $uid="";
-my $i=0;
-my @AS_route = ();
-
-if($#ARGV!=1) {
-    die "Usage: ./generate_g5k_platform.pl g5k_username g5k_password\n";
-}
-
-print "<?xml version='1.0'?>\n";
-print "<!DOCTYPE platform SYSTEM \"http://simgrid.gforge.inria.fr/simgrid.dtd\">\n";
-print "<platform version=\"$toversion\">\n";
-print "\t<AS id=\"AS_grid5000\" routing=\"Floyd\" >\n";
-
-print "\t\t<AS id=\"AS_interne\" routing=\"Floyd\">\n";
-printf "\t\t\t<router id=\"lille\"/>\n";
-printf "\t\t\t<router id=\"paris\"/>\n";
-printf "\t\t\t<router id=\"nancy\"/>\n";
-printf "\t\t\t<router id=\"rennes\"/>\n";
-printf "\t\t\t<router id=\"lyon\"/>\n";
-printf "\t\t\t<router id=\"bordeaux\"/>\n";
-printf "\t\t\t<router id=\"grenoble\"/>\n";
-printf "\t\t\t<router id=\"marseille\"/>\n";
-printf "\t\t\t<router id=\"toulouse\"/>\n";
-printf "\t\t\t<router id=\"sophia\"/>\n";
-#printf "\t\t\t<router id=\"luxembourg\">\n";
-print "\n";
-printf "\t\t\t<link id=\"Lille_Paris\"        bandwidth=\"1.25E9\" latency=\"1.0E-4\"/>\n";
-printf "\t\t\t<link id=\"Paris_Nancy\"        bandwidth=\"1.25E9\" latency=\"1.0E-4\"/>\n";
-printf "\t\t\t<link id=\"Paris_Rennes\"       bandwidth=\"1.25E9\" latency=\"1.0E-4\"/>\n";
-printf "\t\t\t<link id=\"Paris_Lyon\"         bandwidth=\"1.25E9\" latency=\"1.0E-4\"/>\n";
-printf "\t\t\t<link id=\"Bordeaux_Lyon\"      bandwidth=\"1.25E9\" latency=\"1.0E-4\"/>\n";
-printf "\t\t\t<link id=\"Lyon_Grenoble\"      bandwidth=\"1.25E9\" latency=\"1.0E-4\"/>\n";
-printf "\t\t\t<link id=\"Lyon_Marseille\"     bandwidth=\"1.25E9\" latency=\"1.0E-4\"/>\n";
-printf "\t\t\t<link id=\"Marseille_Sophia\"   bandwidth=\"1.25E9\" latency=\"1.0E-4\"/>\n";
-printf "\t\t\t<link id=\"Marseille_Toulouse\" bandwidth=\"1.25E9\" latency=\"1.0E-4\"/>\n";
-#printf "\t\t<link id=\"Luxemburg_Nancy\"    bandwidth=\"1.25E9\" latency=\"1.0E-4\"/>\n";
-print "\n";
-
-print "\t\t<route src=\"lille\"     dst=\"paris\"     ><link_ctn id=\"Lille_Paris\"/></route>\n";
-print "\t\t<route src=\"paris\"     dst=\"nancy\"     ><link_ctn id=\"Paris_Nancy\"/></route>\n";
-print "\t\t<route src=\"paris\"     dst=\"rennes\"    ><link_ctn id=\"Paris_Rennes\"/></route>\n";
-print "\t\t<route src=\"paris\"     dst=\"lyon\"      ><link_ctn id=\"Paris_Lyon\"/></route>\n";
-print "\t\t<route src=\"bordeaux\"  dst=\"lyon\"      ><link_ctn id=\"Bordeaux_Lyon\"/></route>\n";
-print "\t\t<route src=\"lyon\"      dst=\"grenoble\"  ><link_ctn id=\"Lyon_Grenoble\"/></route>\n";
-print "\t\t<route src=\"lyon\"      dst=\"marseille\" ><link_ctn id=\"Lyon_Marseille\"/></route>\n";
-print "\t\t<route src=\"marseille\" dst=\"sophia\"    ><link_ctn id=\"Marseille_Sophia\"/></route>\n";
-print "\t\t<route src=\"marseille\" dst=\"toulouse\"  ><link_ctn id=\"Marseille_Toulouse\"/></route>\n";
-#print "\t\t<route src=\"Luxemburg\" dst=\"Nancy\"     ><link_ctn id=\"Luxemburg_Nancy\"/></route>\n";
-print "\t\t</AS>\n"; 
-  
-`wget https://api.grid5000.fr/2.0/grid5000/sites --http-user="$ARGV[0]" --http-password="$ARGV[1]" --no-check-certificate --quiet`;
-open SITES_LIGNE, 'sites' or die "Unable to open sites $!\n";
-while(defined($line=<SITES_LIGNE>))
-{
-       if($line =~ /"uid": "(.*)",/){
-               $site = $1;
-               print "\t\t<AS id=\"AS_$site\" routing=\"RuleBased\" >\n";
-       
-               `wget https://api.grid5000.fr/2.0/grid5000/sites/$site/clusters --http-user="$ARGV[0]" --http-password="$ARGV[1]" --no-check-certificate --quiet`;
-               open CLUSTERS_LIGNE, 'clusters' or die "Unable to open clusters $!\n";
-               while(defined($line=<CLUSTERS_LIGNE>))
-               {
-                       if($line =~ /"uid": "(.*)",/){
-                               $cluster = $1;
-                               &get_switch($site, $cluster);                   
-                       }
-               }
-
-               close CLUSTERS_LIGNE;
-               `rm clusters`;
-               
-               print "\t\t\t<AS id=\"gw_AS_$site\" routing=\"Full\">\n";
-               print "\t\t\t\t<router id=\"gw_$site\"/>\n";
-               print "\t\t\t</AS>\n";
-               print "\t\t\t<link   id=\"link_gw_$site\" bandwidth=\"1.25E9\" latency=\"1.0E-4\"/>\n";
-               print "\n";
-               
-               print "\t\t\t<ASroute src=\"^AS_(.*)\$\" dst=\"^AS_(.*)\$\"\n";
-               print "\t\t\t\tgw_src=\"\$1src-AS_\$1src_router.$site.grid5000.fr\"\n";
-               print "\t\t\t\tgw_dst=\"\$1dst-AS_\$1dst_router.$site.grid5000.fr\"\n";
-               print "\t\t\t\tsymmetrical=\"YES\">\n";
-               print "\t\t\t\t\t<link_ctn id=\"link_\$1src\"/>\n";
-               print "\t\t\t\t\t<link_ctn id=\"link_\$1dst\"/>\n";
-               print "\t\t\t</ASroute>\n\n"; 
-
-               print "\t\t\t<ASroute src=\"^AS_(.*)\$\" dst=\"^gw_AS_(.*)\$\"\n";
-               print "\t\t\t\tgw_src=\"\$1src-AS_\$1src_router.$site.grid5000.fr\"\n";
-               print "\t\t\t\tgw_dst=\"gw_\$1dst\"\n";
-               print "\t\t\t\tsymmetrical=\"NO\">\n";
-               print "\t\t\t\t\t<link_ctn id=\"link_\$1src\"/>\n";
-               print "\t\t\t</ASroute>\n\n"; 
-               
-               print "\t\t\t<ASroute src=\"^gw_AS_(.*)\$\" dst=\"^AS_(.*)\$\"\n";
-               print "\t\t\t\tgw_src=\"gw_\$1src\"\n";
-               print "\t\t\t\tgw_dst=\"\$1dst-AS_\$1dst_router.$site.grid5000.fr\"\n";
-               print "\t\t\t\tsymmetrical=\"NO\">\n";
-               print "\t\t\t\t\t<link_ctn id=\"link_\$1dst\"/>\n";
-               print "\t\t\t</ASroute>\n\n"; 
-
-               print "\t\t</AS>\n";
-               
-               push @AS_route, $site;
-       }
-}
-close SITES_LIGNE;
-`rm sites`;
-
-printf "\n";
-
-while(@AS_route)
-{
-       $site = pop @AS_route;
-       print "\t\t<ASroute src=\"AS_$site\" dst=\"AS_interne\" gw_src=\"gw_$site\"";
-       if( $site =~ /^orsay$/ )
-       {
-               print " gw_dst=\"paris\"";
-       }
-       else
-       {
-               print " gw_dst=\"$site\"";
-       }
-       print " symmetrical=\"YES\">\n";
-       print "\t\t\t<link_ctn id=\"link_gw_$site\"/>\n";
-       print "\t\t</ASroute>\n";
-}
-
-print "\t</AS>\n";
-print "</platform>\n";
-
-sub get_switch {
-       my $total;
-       my $switch="";
-       my @switch_list=();
-
-       my @host=();
-       my @host_switch=();
-       $site="$_[0]";
-       $cluster="$_[1]";
-       `wget https://api.grid5000.fr/2.0/grid5000/sites/$site/clusters/$cluster/nodes --http-user="$ARGV[0]" --http-password="$ARGV[1]" --no-check-certificate --quiet`;
-       open NODES_LIGNE, 'nodes' or die "Unable to open nodes $!\n";
-       while(defined($line=<NODES_LIGNE>))
-       {
-               if($line =~ /"uid": "(.*)",/)
-               {
-                       $uid = $1;
-                       push(@host, $1);        
-               }
-               if($line =~ /"total": (.*),/){
-                       $total = $1;
-               }
-               if($line =~ /"switch": "(.*)",/ && !$switch)
-               {
-                       $switch = "$1"; 
-                       push(@host_switch, $1);
-               }
-               if( $uid && $switch )
-               {
-                       push(@switch_list, $switch);    
-                       $uid="";        
-                       $switch="";     
-               }
-       }
-       close NODES_LIGNE;
-       `rm nodes`;
-
-       my %count;
-       my @uniq_array = grep { ++$count{$_} < 2 } @switch_list;
-       @uniq_array = sort (@uniq_array);
-       if(@switch_list && @uniq_array != 1){
-
-               if(@switch_list != @host){
-                       printf "Take care \@host != of \@switch_list\n";
-               }               
-               
-               print "\t\t\t<AS id=\"AS_$cluster\" routing=\"RuleBased\" >\n";
-
-               my @num=();
-               my $radical;
-               foreach(@uniq_array){
-                       $switch = $_;
-                       $i=0;
-                       @num=();
-                       foreach(@host_switch){
-                               if($_ =~ $switch){
-                                       if($host[$i] =~ /$cluster-(.*)/){
-                                               push(@num, $1);
-                                       }       
-                               }
-                               $i++;
-                       }
-       
-                       my $deb;
-                       my $fin;
-                       @num=sort {$a <=> $b} (@num);
-                       $radical = "";
-       
-                       $i=0;
-                       foreach(@num){  
-                               if($i == 0){
-                               $deb = $num[$i];
-                               $fin = $num[$i];
-                               }
-                               else{
-                                       if($num[$i] == ($num[$i-1]+1) )
-                                       {
-                                               $fin = $num[$i];
-                                               if(@num == ($i+1)){
-                                                       if($deb != $fin)
-                                                       {
-                                                               if(!($radical =~ /^$/))
-                                                               {
-                                                                       $radical = $radical.";";
-                                                               }
-                                                               $radical = $radical.$deb."-".$fin;
-                                                               $deb = $num[$i];
-                                                               $fin = $num[$i];
-                                                       }
-                                                       else
-                                                       {
-                                                               $radical=$radical.";".$num[$i];
-                                                       }                               
-                                               }
-                                       }
-                                       else
-                                       {
-                                               if($deb != $fin)
-                                               {
-                                                       if(!($radical =~ /^$/))
-                                                       {
-                                                               $radical = $radical.",";
-                                                       }
-                                                       $radical = $radical.$deb."-".$fin;
-                                                       $deb = $num[$i];
-                                                       $fin = $num[$i];
-                                               }
-                                               else
-                                               {
-                                                       $radical=$radical.",".$num[$i];
-                                               }
-                       
-                                       }
-                               }
-                               $i++;
-                       }
-                       print "\t\t\t\t<cluster id=\"AS_$switch\" prefix=\"$cluster-\" suffix=\".$site.grid5000.fr\"\n";
-                       print "\t\t\t\t\tradical=\"$radical\" power=\"";
-                       &get_gflops($cluster);
-                       print "\" bw=\"1.25E8\" lat=\"1.0E-4\""."\n";
-                       print "\t\t\t\t\tbb_bw=\"1.25E9\" bb_lat=\"1.0E-4\"></cluster>\n";
-               }
-               
-               print "\n\t\t\t\t<AS id=\"gw_AS_$cluster\" routing=\"Full\">\n";
-               print "\t\t\t\t\t<router id=\"".$cluster."-AS_".$cluster."_router.".$site.".grid5000.fr\"/>\n";
-               print "\t\t\t\t</AS>\n";
-               
-               print "\t\t\t\t<link id=\"switch-$cluster\" bandwidth=\"1250000000\" latency=\"5E-4\"/>\n\n";
-       
-       print "\t\t\t\t<ASroute src=\"^AS_(.*)\$\" dst=\"^AS_(.*)\$\"\n";
-               print "\t\t\t\t gw_src=\"$cluster-AS_\$1src_router.$site.grid5000.fr\"\n";
-               print "\t\t\t\t gw_dst=\"$cluster-AS_\$1dst_router.$site.grid5000.fr\">\n";
-               print "\t\t\t\t\t<link_ctn id=\"switch-$cluster\"/>\n";
-       print "\t\t\t\t</ASroute>\n";
-       
-       print "\t\t\t\t<ASroute src=\"^AS_(.*)\$\" dst=\"^gw_AS_(.*)\$\"\n";
-               print "\t\t\t\t gw_src=\"$cluster-AS_\$1src_router.$site.grid5000.fr\"\n";
-               print "\t\t\t\t gw_dst=\"".$cluster."-AS_".$cluster."_router.".$site.".grid5000.fr\">\n";
-               print "\t\t\t\t\t<link_ctn id=\"switch-$cluster\"/>\n";
-       print "\t\t\t\t</ASroute>\n";
-       
-       print "\t\t\t\t<ASroute src=\"^gw_AS_(.*)\$\" dst=\"^AS_(.*)\$\"\n";
-               print "\t\t\t\t gw_src=\"".$cluster."-AS_".$cluster."_router.".$site.".grid5000.fr\"\n";
-               print "\t\t\t\t gw_dst=\"$cluster-AS_\$1dst_router.$site.grid5000.fr\">\n";
-               print "\t\t\t\t\t<link_ctn id=\"switch-$cluster\"/>\n";
-       print "\t\t\t\t</ASroute>\n";
-       
-       
-               print "\t\t\t</AS>\n";
-               
-                       
-       }
-       else{
-               print "\t\t\t<cluster id=\"AS_$cluster\" prefix=\"$cluster-\" suffix=\".$site.grid5000.fr\"\n";
-               print "\t\t\t\tradical=\"1-$total\" power=\"";
-               &get_gflops($cluster);
-               print "\" bw=\"1.25E8\" lat=\"1.0E-4\""."\n";
-               print "\t\t\t\tbb_bw=\"1.25E9\" bb_lat=\"1.0E-4\"></cluster>\n";
-       }
-       print "\t\t\t<link   id=\"link_$cluster\" bandwidth=\"1.25E9\" latency=\"1.0E-4\"/>\n\n";
-}
-
-
-sub get_gflops {
-       switch ($_[0]) {
-               #Bordeaux
-               case "bordeplage" { print "5.2297E9" }
-               case "bordereau"  { print "8.8925E9" }
-               case "borderline" { print "13.357E9" }
-               #Lille
-               case "chicon"     { print "8.9618E9" }
-               case "chimint"    { print "23.531E9" }
-               case "chinqchint" { print "22.270E9" }
-               case "chirloute"  { print "24.473E9" }
-               #Grenoble
-               case "adonis"     { print "23.681E9" }
-               case "edel"       { print "23.492E9" }
-               case "genepi"     { print "21.175E9" }
-               #Lyon
-               case "capricorne" { print "4.7233E9" }
-               case "sagittaire" { print "5.6693E9" }
-               #Nancy
-               case "graphene"   { print "16.673E9" }
-               case "griffon"    { print "20.678E9" }
-               #Orsay
-               case "gdx"        { print "4.7153E9" }
-               case "netgdx"     { print "4.7144E9" }
-               #Rennes
-               case "paradent"   { print "21.496E9" }
-               case "paramount"  { print "12.910E9" }
-               case "parapide"   { print "30.130E9" }
-               case "parapluie"  { print "27.391E9" }
-               #Sophia
-               case "helios"     { print "7.7318E9" }
-               case "sol"        { print "8.9388E9" }
-               case "suno"       { print "23.530E9" }
-               #Toulouse
-               case "pastel"     { print "9.5674E9" }
-               case "violette"   { print "5.1143E9" }
-               #Reims
-               case "stremi"     { print "TODO" }
-               #Luxembourg
-               case "granduc"    { print "TODO" }
-
-               default:          { print "TODO" }
-       }
-}
index 56c3b75..490a0c9 100644 (file)
@@ -27,12 +27,6 @@ set(examples_src
   ${CMAKE_CURRENT_SOURCE_DIR}/dax_test.c
   PARENT_SCOPE
   )
-set(bin_files
-  ${bin_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/generate_forkjoin.pl
-  ${CMAKE_CURRENT_SOURCE_DIR}/generate_strassen.pl
-  PARENT_SCOPE
-  )
 set(txt_files
   ${txt_files}
   PARENT_SCOPE
diff --git a/examples/simdag/dax/generate_forkjoin.pl b/examples/simdag/dax/generate_forkjoin.pl
deleted file mode 100755 (executable)
index 545ccf9..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-#! /usr/bin/env perl
-
-# Copyright (c) 2009, 2014. The SimGrid Team.
-# All rights reserved.
-
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the license (GNU LGPL) which comes with this package.
-
-use strict;
-
-my $node_count = int($ARGV[0]) || die "Usage: $0 node_count level_count\n";
-my $level_count = int($ARGV[1]) || die "Usage: $0 node_count level_count\n";
-
-print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
-print "<!-- generated: ".(localtime())." -->\n";
-print "<adag xmlns=\"http://pegasus.isi.edu/schema/DAX\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://pegasus.isi.edu/schema/DAX http://pegasus.isi.edu/schema/dax-2.1.xsd\" version=\"2.1\" count=\"1\" index=\"0\" name=\"test\" jobCount=\"25\" fileCount=\"0\" childCount=\"20\">\n";
-
-for (my $level=1;$level<=$level_count;$level++) {
-    for (my $i=1;$i<=$node_count;$i++) {
-       print "<job id=\"node$i\" namespace=\"ForkJoin\" name=\"level$level\" version=\"1.0\" runtime=\"10\">\n";
-       print "  <uses file=\"n${i}_l${level}_in\" link=\"input\" register=\"true\" transfer=\"true\" optional=\"false\" type=\"data\" size=\"1000\"/>\n";
-       print "  <uses file=\"n${i}_l${level}_out\" link=\"output\" register=\"true\" transfer=\"true\" optional=\"false\" type=\"data\" size=\"1000\"/>\n";
-       print "</job>\n";
-    }
-
-    if ($level<$level_count) {
-       print "<job id=\"join$level\" namespace=\"ForkJoin\" name=\"join\" version=\"1.0\" runtime=\"10\">\n";
-       for (my $i=1;$i<=$node_count;$i++) {
-           print "  <uses file=\"n${i}_l${level}_out\" link=\"input\" register=\"true\" transfer=\"true\" optional=\"false\" type=\"data\" size=\"1000\"/>\n";
-           print "  <uses file=\"n${i}_l".(${level}+1)."_in\" link=\"output\" register=\"true\" transfer=\"true\" optional=\"false\" type=\"data\" size=\"1000\"/>\n";
-       }
-       print "</job>\n";
-    }
-}
-
-print "</adag>\n";
diff --git a/examples/simdag/dax/generate_strassen.pl b/examples/simdag/dax/generate_strassen.pl
deleted file mode 100755 (executable)
index 060f899..0000000
+++ /dev/null
@@ -1,219 +0,0 @@
-#! /usr/bin/env perl
-
-# Copyright (c) 2009, 2014. The SimGrid Team.
-# All rights reserved.
-
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the license (GNU LGPL) which comes with this package.
-
-use strict;
-
-sub job {
-    print "<job id=\"$_[0]\" namespace=\"$_[1]\" name=\"$_[2]\" version=\"1.0\" runtime=\"$_[3]\">\n";
-}
-sub file {
-    print "  <uses file=\"$_[0]\" link=\"$_[1]\" register=\"true\" transfer=\"true\" optional=\"false\" type=\"data\" size=\"$_[2]\"/>\n";
-}
-sub strassen {
-    my $matSize=shift;
-    my $max_level=shift||1;
-    my $level=shift||1;
-    my $A = shift||"A";
-    my $B = shift||"B";
-
-    if ($level<$max_level) {
-      die "Recursive Strassen don't work yet\n";
-    }
-    
-    my $sizeAdd=$matSize*$matSize/4;
-    my $sizeMult=$matSize*$matSize*$matSize/8;
-    my $sizeBlock=$sizeAdd;
-
-    # T1 = A11 + A22
-    job("T1","Strassen","l$level",$sizeAdd);
-    file("${A}11l$level","input",$sizeBlock);
-    file("${A}22l$level","input",$sizeBlock);
-    file("T1l$level","output",$sizeBlock);
-    print("</job>\n");
-
-    # T2 = A21 + A22
-    job("T2","Strassen","l$level",$sizeAdd);
-    file("${A}21l$level","input",$sizeBlock);
-    file("${A}22l$level","input",$sizeBlock);
-    file("T2l$level","output",$sizeBlock);
-    print("</job>\n");
-
-    # T3 = A11 + A12
-    job("T3","Strassen","l$level",$sizeAdd);
-    file("${A}11l$level","input",$sizeBlock);
-    file("${A}12l$level","input",$sizeBlock);
-    file("T3l$level","output",$sizeBlock);
-    print("</job>\n");
-
-    # T4 = A21 − A11
-    job("T4","Strassen","l$level",$sizeAdd);
-    file("${A}21l$level","input",$sizeBlock);
-    file("${A}11l$level","input",$sizeBlock);
-    file("T4l$level","output",$sizeBlock);
-    print("</job>\n");
-
-    # T5 = A12 − A22
-    job("T5","Strassen","l$level",$sizeAdd);
-    file("${A}12l$level","input",$sizeBlock);
-    file("${A}22l$level","input",$sizeBlock);
-    file("T5l$level","output",$sizeBlock);
-    print("</job>\n");
-    
-    # T6 = B11 + B22
-    job("T6","Strassen","l$level",$sizeAdd);
-    file("${B}11l$level","input",$sizeBlock);
-    file("${B}22l$level","input",$sizeBlock);
-    file("T6l$level","output",$sizeBlock);
-    print("</job>\n");
-    
-    # T7 = B12 − B22
-    job("T7","Strassen","l$level",$sizeAdd);
-    file("${B}12l$level","input",$sizeBlock);
-    file("${B}22l$level","input",$sizeBlock);
-    file("T7l$level","output",$sizeBlock);
-    print("</job>\n");
-    
-    # T8 = B21 − B11
-    job("T8","Strassen","l$level",$sizeAdd);
-    file("${B}21l$level","input",$sizeBlock);
-    file("${B}11l$level","input",$sizeBlock);
-    file("T8l$level","output",$sizeBlock);
-    print("</job>\n");
-         
-    # T9 = B11 + B12
-    job("T9","Strassen","l$level",$sizeAdd);
-    file("${B}11l$level","input",$sizeBlock);
-    file("${B}12l$level","input",$sizeBlock);
-    file("T9l$level","output",$sizeBlock);
-    print("</job>\n");
-    
-    # T10 = B21 + B22
-    job("T10","Strassen","l$level",$sizeAdd);
-    file("${B}21l$level","input",$sizeBlock);
-    file("${B}22l$level","input",$sizeBlock);
-    file("T10l$level","output",$sizeBlock);
-    print("</job>\n");
-
-    # Q1 = T1 × T6
-    if ($level<$max_level) {
-       strassen($sizeBlock,$max_level,$level+1,"T1_","T6_");
-    } else {
-       job("Q1","Strassen","l$level",$sizeMult);
-       file("T1l$level","input",$sizeBlock);
-       file("T6l$level","input",$sizeBlock);
-       file("Q1l$level","output",$sizeBlock);
-       print("</job>\n");
-    }
-
-    # Q2 = T2 × B11
-    if ($level<$max_level) {
-       strassen($sizeBlock,$max_level,$level+1,"T2_","B11_");
-    } else {
-       job("Q2","Strassen","l$level",$sizeMult);
-       file("T2l$level","input",$sizeBlock);
-       file("${B}11l$level","input",$sizeBlock);
-       file("Q2l$level","output",$sizeBlock);
-       print("</job>\n");
-    }
-
-    # Q3 = A11 × T7         
-    if ($level<$max_level) {
-       strassen($sizeBlock,$max_level,$level+1,"A11_","T7_");
-    } else {
-       job("Q3","Strassen","l$level",$sizeMult);
-       file("${A}11l$level","input",$sizeBlock);
-       file("T7l$level","input",$sizeBlock);
-       file("Q3l$level","output",$sizeBlock);
-       print("</job>\n");
-    }
-    
-    # Q4 = A22 × T8
-    if ($level<$max_level) {
-       strassen($sizeBlock,$max_level,$level+1,"A22_","T8_");
-    } else {
-       job("Q4","Strassen","l$level",$sizeMult);
-       file("${A}22l$level","input",$sizeBlock);
-       file("T8l$level","input",$sizeBlock);
-       file("Q4l$level","output",$sizeBlock);
-       print("</job>\n");
-    }
-    
-    # Q5 = T3 × B22
-    if ($level<$max_level) {
-       strassen($sizeBlock,$max_level,$level+1,"T3_","B22_");
-    } else {
-       job("Q5","Strassen","l$level",$sizeMult);
-       file("T3l$level","input",$sizeBlock);
-       file("${B}22l$level","input",$sizeBlock);
-       file("Q5l$level","output",$sizeBlock);
-       print("</job>\n");
-    }
-    
-    # Q6 = T4 × T9
-    if ($level<$max_level) {
-       strassen($sizeBlock,$max_level,$level+1,"T4_","T9_");
-    } else {
-       job("Q6","Strassen","l$level",$sizeMult);
-       file("T4l$level","input",$sizeBlock);
-       file("T9l$level","input",$sizeBlock);
-       file("Q6l$level","output",$sizeBlock);
-       print("</job>\n");
-    }
-    
-    # Q7 = T5 × T10
-    if ($level<$max_level) {
-       strassen($sizeBlock,$max_level,$level+1,"T5_","T10_");
-    } else {
-       job("Q7","Strassen","l$level",$sizeMult);
-       file("T5l$level","input",$sizeBlock);
-       file("T10l$level","input",$sizeBlock);
-       file("Q7l$level","output",$sizeBlock);
-       print("</job>\n");
-    }
-    
-    # C11 = Q1 + Q4 − Q5 + Q7
-    job("Q11","Strassen","l$level",$sizeAdd*3);
-    file("Q1l$level","input",$sizeBlock);
-    file("Q4l$level","input",$sizeBlock);
-    file("Q5l$level","input",$sizeBlock);
-    file("Q7l$level","input",$sizeBlock);
-    file("C11l$level","output",$sizeBlock);
-    print("</job>\n");
-
-    # C12 = Q3 + Q5
-    job("C12","Strassen","l$level",$sizeAdd);
-    file("Q3l$level","input",$sizeBlock);
-    file("Q5l$level","input",$sizeBlock);
-    file("C12l$level","output",$sizeBlock);
-    print("</job>\n");
-    
-    # C21 = Q2 + Q4
-    job("C21","Strassen","l$level",$sizeAdd);
-    file("Q2l$level","input",$sizeBlock);
-    file("Q4l$level","input",$sizeBlock);
-    file("C21l$level","output",$sizeBlock);
-    print("</job>\n");
-
-    # C22 = Q1 − Q2 + Q3 + Q6
-    job("C22","Strassen","l$level",$sizeMult);
-    file("Q1l$level","input",$sizeBlock);
-    file("Q2l$level","input",$sizeBlock);
-    file("Q3l$level","input",$sizeBlock);
-    file("Q6l$level","input",$sizeBlock);
-    file("C22l$level","output",$sizeBlock);
-    print("</job>\n");          
-}
-
-print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
-print "<!-- generated: ".(localtime())." -->\n";
-print "<adag xmlns=\"http://pegasus.isi.edu/schema/DAX\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://pegasus.isi.edu/schema/DAX http://pegasus.isi.edu/schema/dax-2.1.xsd\" version=\"2.1\" count=\"1\" index=\"0\" name=\"test\" jobCount=\"25\" fileCount=\"0\" childCount=\"20\">\n";
-
-strassen(2000);
-
-print "</adag>\n";
-
index d06e646..37f4684 100644 (file)
@@ -14,8 +14,7 @@
 #include <string.h>
 #include <libgen.h>
 
-XBT_LOG_NEW_DEFAULT_CATEGORY(test,
-                             "Logging specific to this SimDag example");
+XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Logging specific to this SimDag example");
 
 int main(int argc, char **argv)
 {
@@ -27,11 +26,8 @@ int main(int argc, char **argv)
   SD_init(&argc, argv);
 
   /* Check our arguments */
-  if (argc < 3) {
-    XBT_INFO("Usage: %s platform_file dot_file [trace_file]", argv[0]);
-    XBT_INFO("example: %s ../2clusters.xml dag.dot dag.mytrace", argv[0]);
-    exit(1);
-  }
+  xbt_assert(argc > 2, "Usage: %s platform_file dot_file [trace_file]"
+             "example: %s ../2clusters.xml dag.dot dag.mytrace", argv[0], argv[0]);
 
   /* creation of the environment */
   SD_create_environment(argv[1]);
@@ -45,20 +41,13 @@ int main(int argc, char **argv)
   }
 
   char *tracefilename;
-  if (argc == 3) {
-    char *last = strrchr(argv[2], '.');
-
-    tracefilename =
-        bprintf("%.*s.trace",
-                (int) (last == NULL ? strlen(argv[2]) : last - argv[2]),
-                argv[2]);
-  } else {
+  char *last = strrchr(argv[2], '.');
+  tracefilename = bprintf("%.*s.trace", (int) (last == NULL ? strlen(argv[2]) : last - argv[2]),argv[2]);
+  if (argc == 4) 
     tracefilename = xbt_strdup(argv[3]);
-  }
 
   /* Display all the tasks */
-  XBT_INFO
-      ("------------------- Display all tasks of the loaded DAG ---------------------------");
+  XBT_INFO("------------------- Display all tasks of the loaded DAG ---------------------------");
   xbt_dynar_foreach(dot, cursor, task) {
     SD_task_dump(task);
   }
@@ -85,12 +74,10 @@ int main(int argc, char **argv)
     }
   }
 
-  XBT_INFO
-      ("------------------- Run the schedule ---------------------------");
+  XBT_INFO("------------------- Run the schedule ---------------------------");
   SD_simulate(-1);
 
-  XBT_INFO
-      ("------------------- Produce the trace file---------------------------");
+  XBT_INFO("------------------- Produce the trace file---------------------------");
   XBT_INFO("Producing the trace of the run into %s", basename(tracefilename));
   FILE *out = fopen(tracefilename, "w");
   xbt_assert(out, "Cannot write to %s", tracefilename);
@@ -102,22 +89,16 @@ int main(int argc, char **argv)
     switch (kind) {
     case SD_TASK_COMP_SEQ:
       fprintf(out, "[%f->%f] %s compute %f flops # %s\n",
-          SD_task_get_start_time(task),
-          SD_task_get_finish_time(task),
-          sg_host_get_name(wsl[0]), SD_task_get_amount(task),
-          SD_task_get_name(task));
+          SD_task_get_start_time(task), SD_task_get_finish_time(task),
+          sg_host_get_name(wsl[0]), SD_task_get_amount(task), SD_task_get_name(task));
       break;
     case SD_TASK_COMM_E2E:
       fprintf(out, "[%f -> %f] %s -> %s transfer of %.0f bytes # %s\n",
-          SD_task_get_start_time(task),
-          SD_task_get_finish_time(task),
-          sg_host_get_name(wsl[0]),
-          sg_host_get_name(wsl[1]), SD_task_get_amount(task),
-          SD_task_get_name(task));
+          SD_task_get_start_time(task), SD_task_get_finish_time(task),
+          sg_host_get_name(wsl[0]), sg_host_get_name(wsl[1]), SD_task_get_amount(task), SD_task_get_name(task));
       break;
     default:
-      xbt_die("Task %s is of unknown kind %d", SD_task_get_name(task),
-              SD_task_get_kind(task));
+      xbt_die("Task %s is of unknown kind %d", SD_task_get_name(task), SD_task_get_kind(task));
     }
     SD_task_destroy(task);
   }
index 47f327a..38b7095 100644 (file)
@@ -1,6 +1,6 @@
 /* simple test trying to load a DOT file.                                   */
 
-/* Copyright (c) 2010-2015. The SimGrid Team.
+/* Copyright (c) 2010-2016. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -13,8 +13,7 @@
 #include "xbt/ex.h"
 #include <string.h>
 
-XBT_LOG_NEW_DEFAULT_CATEGORY(test,
-                             "Logging specific to this SimDag example");
+XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Logging specific to this SimDag example");
 
 int main(int argc, char **argv)
 {
@@ -26,27 +25,21 @@ int main(int argc, char **argv)
   SD_init(&argc, argv);
 
   /* Check our arguments */
-  if (argc < 2) {
-    XBT_INFO("Usage: %s dot_file", argv[0]);
-    exit(1);
-  }
+  xbt_assert(argc > 1, "Usage: %s dot_file", argv[0]);
 
   /* load the DOT file */
   dot = SD_dotload(argv[1]);
 
   /* Display all the tasks */
-  XBT_INFO
-      ("------------------- Display all tasks of the loaded DAG ---------------------------");
+  XBT_INFO("------------------- Display all tasks of the loaded DAG ---------------------------");
   xbt_dynar_foreach(dot, cursor, task) {
       SD_task_dump(task);
     }
 
-  XBT_INFO
-      ("--------------------- Transform the dynar into an array ---------------------------");
+  XBT_INFO("--------------------- Transform the dynar into an array ---------------------------");
   cursor=0;
   dot_as_array = (SD_task_t*) xbt_dynar_to_array(dot);
-  XBT_INFO
-      ("----------------------------- dump tasks again ------------------------------------");
+  XBT_INFO("----------------------------- dump tasks again ------------------------------------");
   while ((task=dot_as_array[cursor++])){
     SD_task_dump(task);
   }
index 19c6de9..a313557 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2015. The SimGrid Team.
+/* Copyright (c) 2013-2016. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -12,8 +12,7 @@
 #include <string.h>
 #include <libgen.h>
 
-XBT_LOG_NEW_DEFAULT_CATEGORY(test,
-                             "Logging specific to this SimDag example");
+XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Logging specific to this SimDag example");
 
 /* simple test trying to load a Parallel Task Graph (PTG) as a DOT file.    */
 int main(int argc, char **argv){
@@ -25,11 +24,7 @@ int main(int argc, char **argv){
   SD_init(&argc, argv);
 
   /* Check our arguments */
-  if (argc < 2) {
-    XBT_INFO("Usage: %s platform_file dot_file ", argv[0]);
-    XBT_INFO("example: %s ../2clusters.xml ptg.dot", argv[0]);
-    exit(1);
-  }
+  xbt_assert (argc > 1,"Usage: %s platform_file dot_file example: %s ../2clusters.xml ptg.dot", argv[0], argv[0]);
 
   /* creation of the environment */
   SD_create_environment(argv[1]);
@@ -42,8 +37,7 @@ int main(int argc, char **argv){
   }
 
   /* Display all the tasks */
-  XBT_INFO
-      ("------------------- Display all tasks of the loaded DAG ---------------------------");
+  XBT_INFO("------------------- Display all tasks of the loaded DAG ---------------------------");
   xbt_dynar_foreach(dot, cursor, task) {
     SD_task_dump(task);
   }
@@ -66,8 +60,7 @@ int main(int argc, char **argv){
     }
   }
 
-  XBT_INFO
-      ("------------------- Run the schedule ---------------------------");
+  XBT_INFO("------------------- Run the schedule ---------------------------");
   SD_simulate(-1);
   XBT_INFO("Makespan: %f", SD_get_clock());
   xbt_dynar_foreach(dot, cursor, task) {
index c0fbe0c..efcf24b 100644 (file)
@@ -1,6 +1,6 @@
 /* simple test trying to load a DOT file.                                   */
 
-/* Copyright (c) 2010-2015. The SimGrid Team.
+/* Copyright (c) 2010-2016. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -14,8 +14,7 @@
 #include <string.h>
 #include <libgen.h>
 
-XBT_LOG_NEW_DEFAULT_CATEGORY(test,
-    "Logging specific to this SimDag example");
+XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Logging specific to this SimDag example");
 
 int main(int argc, char **argv)
 {
@@ -27,11 +26,8 @@ int main(int argc, char **argv)
   SD_init(&argc, argv);
 
   /* Check our arguments */
-  if (argc < 3) {
-    XBT_INFO("Usage: %s platform_file dot_file [trace_file]", argv[0]);
-    XBT_INFO("example: %s ../2clusters.xml dag.dot dag.mytrace", argv[0]);
-    exit(1);
-  }
+  xbt_assert(argc > 2, "Usage: %s platform_file dot_file [trace_file]"
+             "example: %s ../2clusters.xml dag.dot dag.mytrace", argv[0], argv[0]);
 
   /* creation of the environment */
   SD_create_environment(argv[1]);
@@ -45,20 +41,14 @@ int main(int argc, char **argv)
   }
 
   char *tracefilename;
-  if (argc == 3) {
-    char *last = strrchr(argv[2], '.');
-
-    tracefilename =
-        bprintf("%.*s.trace",
-            (int) (last == NULL ? strlen(argv[2]) : last - argv[2]),
-            argv[2]);
-  } else {
+  char *last = strrchr(argv[2], '.');
+  tracefilename = bprintf("%.*s.trace", (int) (last == NULL ? strlen(argv[2]) : last - argv[2]),argv[2]);
+  if (argc == 4) 
     tracefilename = xbt_strdup(argv[3]);
-  }
+  
 
   /* Display all the tasks */
-  XBT_INFO
-  ("------------------- Display all tasks of the loaded DAG ---------------------------");
+  XBT_INFO("------------------- Display all tasks of the loaded DAG ---------------------------");
   xbt_dynar_foreach(dot, cursor, task) {
     SD_task_dump(task);
   }
@@ -71,12 +61,10 @@ int main(int argc, char **argv)
   fprintf(dotout, "}\n");
   fclose(dotout);
 
-  XBT_INFO
-  ("------------------- Run the schedule ---------------------------");
+  XBT_INFO("------------------- Run the schedule ---------------------------");
   SD_simulate(-1);
 
-  XBT_INFO
-  ("------------------- Produce the trace file---------------------------");
+  XBT_INFO("------------------- Produce the trace file---------------------------");
   XBT_INFO("Producing the trace of the run into %s", basename(tracefilename));
   FILE *out = fopen(tracefilename, "w");
   xbt_assert(out, "Cannot write to %s", tracefilename);
@@ -88,22 +76,16 @@ int main(int argc, char **argv)
     switch (kind) {
     case SD_TASK_COMP_SEQ:
       fprintf(out, "[%f->%f] %s compute %f flops # %s\n",
-          SD_task_get_start_time(task),
-          SD_task_get_finish_time(task),
-          sg_host_get_name(wsl[0]), SD_task_get_amount(task),
-          SD_task_get_name(task));
+          SD_task_get_start_time(task), SD_task_get_finish_time(task),
+          sg_host_get_name(wsl[0]), SD_task_get_amount(task), SD_task_get_name(task));
       break;
     case SD_TASK_COMM_E2E:
       fprintf(out, "[%f -> %f] %s -> %s transfer of %.0f bytes # %s\n",
-          SD_task_get_start_time(task),
-          SD_task_get_finish_time(task),
-          sg_host_get_name(wsl[0]),
-          sg_host_get_name(wsl[1]), SD_task_get_amount(task),
-          SD_task_get_name(task));
+          SD_task_get_start_time(task), SD_task_get_finish_time(task),
+          sg_host_get_name(wsl[0]), sg_host_get_name(wsl[1]), SD_task_get_amount(task), SD_task_get_name(task));
       break;
     default:
-      xbt_die("Task %s is of unknown kind %d", SD_task_get_name(task),
-          SD_task_get_kind(task));
+      xbt_die("Task %s is of unknown kind %d", SD_task_get_name(task), SD_task_get_kind(task));
     }
     SD_task_destroy(task);
   }
index b26135f..6d76697 100644 (file)
@@ -463,4 +463,95 @@ $ $SG_TEST_EXENV ./dot_test --log=no_loc ${srcdir:=.}/../2clusters.xml ${srcdir:
 > [0.000000] [sd_daxparse/WARNING] the task 5 is in a cycle
 > [0.000000] [sd_daxparse/WARNING] the task 6 is in a cycle
 > [0.000000] [sd_dotparse/ERROR] The DOT described in dag_with_cycle.dot is not a DAG. It contains a cycle.
-> [0.000000] [test/CRITICAL] No dot loaded. Do you have a cycle in your graph?
\ No newline at end of file
+> [0.000000] [test/CRITICAL] No dot loaded. Do you have a cycle in your graph?
+
+$ $SG_TEST_EXENV ./ptg_test --log=no_loc ${srcdir:=.}/../2clusters.xml ${srcdir:=.}/ptg.dot
+> [0.000000] [xbt_cfg/INFO] Switching to the L07 model to handle parallel tasks.
+> [0.000000] [test/INFO] ------------------- Display all tasks of the loaded DAG ---------------------------
+> [0.000000] [sd_task/INFO] Displaying task root
+> [0.000000] [sd_task/INFO]   - state: schedulable not runnable
+> [0.000000] [sd_task/INFO]   - kind: parallel computation following Amdahl's law
+> [0.000000] [sd_task/INFO]   - amount: 0
+> [0.000000] [sd_task/INFO]   - alpha: 0.00
+> [0.000000] [sd_task/INFO]   - Dependencies to satisfy: 0
+> [0.000000] [sd_task/INFO]   - post-dependencies:
+> [0.000000] [sd_task/INFO]     root->c1
+> [0.000000] [sd_task/INFO]     root->c2
+> [0.000000] [sd_task/INFO] Displaying task c1
+> [0.000000] [sd_task/INFO]   - state: not scheduled not runnable
+> [0.000000] [sd_task/INFO]   - kind: parallel computation following Amdahl's law
+> [0.000000] [sd_task/INFO]   - amount: 1000000000
+> [0.000000] [sd_task/INFO]   - alpha: 0.20
+> [0.000000] [sd_task/INFO]   - Dependencies to satisfy: 1
+> [0.000000] [sd_task/INFO]   - pre-dependencies:
+> [0.000000] [sd_task/INFO]     root->c1
+> [0.000000] [sd_task/INFO]   - post-dependencies:
+> [0.000000] [sd_task/INFO]     c1->c3
+> [0.000000] [sd_task/INFO] Displaying task c2
+> [0.000000] [sd_task/INFO]   - state: not scheduled not runnable
+> [0.000000] [sd_task/INFO]   - kind: parallel computation following Amdahl's law
+> [0.000000] [sd_task/INFO]   - amount: 5000000000
+> [0.000000] [sd_task/INFO]   - alpha: 0.50
+> [0.000000] [sd_task/INFO]   - Dependencies to satisfy: 1
+> [0.000000] [sd_task/INFO]   - pre-dependencies:
+> [0.000000] [sd_task/INFO]     root->c2
+> [0.000000] [sd_task/INFO]   - post-dependencies:
+> [0.000000] [sd_task/INFO]     c3
+> [0.000000] [sd_task/INFO] Displaying task c3
+> [0.000000] [sd_task/INFO]   - state: not scheduled not runnable
+> [0.000000] [sd_task/INFO]   - kind: parallel computation following Amdahl's law
+> [0.000000] [sd_task/INFO]   - amount: 2000000000
+> [0.000000] [sd_task/INFO]   - alpha: 0.00
+> [0.000000] [sd_task/INFO]   - Dependencies to satisfy: 2
+> [0.000000] [sd_task/INFO]   - pre-dependencies:
+> [0.000000] [sd_task/INFO]     c1->c3
+> [0.000000] [sd_task/INFO]     c2
+> [0.000000] [sd_task/INFO]   - post-dependencies:
+> [0.000000] [sd_task/INFO]     c3->end
+> [0.000000] [sd_task/INFO] Displaying task c1->c3
+> [0.000000] [sd_task/INFO]   - state: not scheduled not runnable
+> [0.000000] [sd_task/INFO]   - kind: MxN data redistribution assuming 1D block distribution
+> [0.000000] [sd_task/INFO]   - amount: 500000000
+> [0.000000] [sd_task/INFO]   - Dependencies to satisfy: 1
+> [0.000000] [sd_task/INFO]   - pre-dependencies:
+> [0.000000] [sd_task/INFO]     c1
+> [0.000000] [sd_task/INFO]   - post-dependencies:
+> [0.000000] [sd_task/INFO]     c3
+> [0.000000] [sd_task/INFO] Displaying task c3->end
+> [0.000000] [sd_task/INFO]   - state: not scheduled not runnable
+> [0.000000] [sd_task/INFO]   - kind: MxN data redistribution assuming 1D block distribution
+> [0.000000] [sd_task/INFO]   - amount: 200000000
+> [0.000000] [sd_task/INFO]   - Dependencies to satisfy: 1
+> [0.000000] [sd_task/INFO]   - pre-dependencies:
+> [0.000000] [sd_task/INFO]     c3
+> [0.000000] [sd_task/INFO]   - post-dependencies:
+> [0.000000] [sd_task/INFO]     end
+> [0.000000] [sd_task/INFO] Displaying task root->c1
+> [0.000000] [sd_task/INFO]   - state: not scheduled not runnable
+> [0.000000] [sd_task/INFO]   - kind: MxN data redistribution assuming 1D block distribution
+> [0.000000] [sd_task/INFO]   - amount: 200000000
+> [0.000000] [sd_task/INFO]   - Dependencies to satisfy: 1
+> [0.000000] [sd_task/INFO]   - pre-dependencies:
+> [0.000000] [sd_task/INFO]     root
+> [0.000000] [sd_task/INFO]   - post-dependencies:
+> [0.000000] [sd_task/INFO]     c1
+> [0.000000] [sd_task/INFO] Displaying task root->c2
+> [0.000000] [sd_task/INFO]   - state: not scheduled not runnable
+> [0.000000] [sd_task/INFO]   - kind: MxN data redistribution assuming 1D block distribution
+> [0.000000] [sd_task/INFO]   - amount: 100000000
+> [0.000000] [sd_task/INFO]   - Dependencies to satisfy: 1
+> [0.000000] [sd_task/INFO]   - pre-dependencies:
+> [0.000000] [sd_task/INFO]     root
+> [0.000000] [sd_task/INFO]   - post-dependencies:
+> [0.000000] [sd_task/INFO]     c2
+> [0.000000] [sd_task/INFO] Displaying task end
+> [0.000000] [sd_task/INFO]   - state: not scheduled not runnable
+> [0.000000] [sd_task/INFO]   - kind: parallel computation following Amdahl's law
+> [0.000000] [sd_task/INFO]   - amount: 0
+> [0.000000] [sd_task/INFO]   - alpha: 0.00
+> [0.000000] [sd_task/INFO]   - Dependencies to satisfy: 1
+> [0.000000] [sd_task/INFO]   - pre-dependencies:
+> [0.000000] [sd_task/INFO]     c3->end
+> [0.000000] [test/INFO] ------------------- Schedule tasks ---------------------------
+> [0.000000] [test/INFO] ------------------- Run the schedule ---------------------------
+> [3.290271] [test/INFO] Makespan: 3.290271
index b0f36ce..fb41816 100644 (file)
@@ -11,7 +11,7 @@
 /******************************************************************************/
 
 /* Run :
-  /usr/bin/time -f "clock:%e user:%U sys:%S swapped:%W exitval:%x max:%Mk" "$@" ../../../smpi_script/bin/smpirun -hostfile hostfile_bugged1_liveness -platform ../../platforms/cluster.xml --cfg=contexts/factory:ucontext --cfg=model-check/reduction:none --cfg=model-check/property:promela_bugged1_liveness --cfg=smpi/send_is_detached_thres:0 --cfg=contexts/stack_size:128 --cfg=model-check/visited:100000 --cfg=model-check/max_depth:100000 ./bugged1_liveness */
+  /usr/bin/time -f "clock:%e user:%U sys:%S swapped:%W exitval:%x max:%Mk" "$@" ../../../smpi_script/bin/smpirun -hostfile hostfile_bugged1_liveness -platform ../../platforms/cluster.xml --cfg=contexts/factory:ucontext --cfg=model-check/reduction:none --cfg=model-check/property:promela_bugged1_liveness --cfg=smpi/send_is_detached_thresh:0 --cfg=contexts/stack_size:128 --cfg=model-check/visited:100000 --cfg=model-check/max_depth:100000 ./bugged1_liveness */
 
 #include <stdio.h>
 #include <mpi.h>
index a5d8e62..04f1b35 100644 (file)
@@ -1,7 +1,7 @@
 #! ./tesh
 
 ! timeout 60
-$ ../../../smpi_script/bin/smpirun -wrapper ${bindir:=.}/../../../bin/simgrid-mc -hostfile ${srcdir:=.}/hostfile_non_deterministic  -platform ${srcdir:=.}/../../platforms/cluster.xml --log=xbt_cfg.thresh:warning --cfg=model-check/communications_determinism:1 --cfg=smpi/send_is_detached_thres:0 --cfg=smpi/running_power:1e9 ./smpi_non_deterministic
+$ ../../../smpi_script/bin/smpirun -wrapper ${bindir:=.}/../../../bin/simgrid-mc -hostfile ${srcdir:=.}/hostfile_non_deterministic  -platform ${srcdir:=.}/../../platforms/cluster.xml --log=xbt_cfg.thresh:warning --cfg=model-check/communications_determinism:1 --cfg=smpi/send_is_detached_thresh:0 --cfg=smpi/running_power:1e9 ./smpi_non_deterministic
 > [0.000000] [mc_global/INFO] Check communication determinism
 > [0.000000] [mc_comm_determinism/INFO] The communications pattern of the process 1 is different! (Different communication : 1)
 > [0.000000] [mc_comm_determinism/INFO] ****************************************************
index fa4215f..a554e56 100644 (file)
@@ -1,4 +1,4 @@
-/* ../../../smpi_script/bin/smpirun -hostfile hostfile_send_deterministic -platform ../../platforms/cluster.xml -np 3 --cfg=smpi/send_is_detached_thres:0 gdb\ --args\ ./send_deterministic */
+/* ../../../smpi_script/bin/smpirun -hostfile hostfile_send_deterministic -platform ../../platforms/cluster.xml -np 3 --cfg=smpi/send_is_detached_thresh:0 gdb\ --args\ ./send_deterministic */
 
 /* Copyright (c) 2009-2015. The SimGrid Team.
  * All rights reserved.                                                     */
index daab716..c7993f4 100644 (file)
@@ -1,7 +1,7 @@
 #! ./tesh
 
 ! timeout 60
-$ ../../../smpi_script/bin/smpirun -wrapper "${bindir:=.}/../../../bin/simgrid-mc" --log=xbt_cfg.thresh:warning -hostfile ${srcdir:=.}/hostfile_only_send_deterministic  -platform ${srcdir:=.}/../../platforms/cluster.xml --cfg=model-check/communications_determinism:1 --cfg=smpi/send_is_detached_thres:0 --cfg=smpi/running_power:1e9 ./smpi_only_send_deterministic
+$ ../../../smpi_script/bin/smpirun -wrapper "${bindir:=.}/../../../bin/simgrid-mc" --log=xbt_cfg.thresh:warning -hostfile ${srcdir:=.}/hostfile_only_send_deterministic  -platform ${srcdir:=.}/../../platforms/cluster.xml --cfg=model-check/communications_determinism:1 --cfg=smpi/send_is_detached_thresh:0 --cfg=smpi/running_power:1e9 ./smpi_only_send_deterministic
 > [0.000000] [mc_comm_determinism/INFO] Check communication determinism
 > [0.000000] [mc_global/INFO] ******************************************************
 > [0.000000] [mc_global/INFO] **** Only-send-deterministic communication pattern ****
index d3132c5..1e6a87b 100644 (file)
@@ -17,6 +17,8 @@
 
 #ifdef HAVE_JEDULE
 
+SG_BEGIN_DECL()
+
 struct jed_event {
   int event_id;
   char *name;
@@ -42,6 +44,8 @@ void jed_event_add_characteristic(jed_event_t event, char *characteristic);
 
 void jed_event_add_info(jed_event_t event, char *key, char *value);
 
+SG_END_DECL()
+
 #endif
 
 #endif /* JEDULE_EVENTS_H_ */
index 60ae564..6a4a148 100644 (file)
@@ -16,6 +16,8 @@
 
 #ifdef HAVE_JEDULE
 
+SG_BEGIN_DECL()
+
 extern xbt_dynar_t jedule_event_list;
 
 void jedule_init_output(void);
@@ -27,6 +29,8 @@ void jedule_store_event(jed_event_t event);
 void write_jedule_output(FILE *file, jedule_t jedule,
     xbt_dynar_t event_list, xbt_dict_t meta_info_dict);
 
+SG_END_DECL()
+
 #endif
 
 #endif /* JEDULE_OUTPUT_H_ */
index aac8597..f74ddf6 100644 (file)
@@ -14,6 +14,8 @@
 
 #ifdef HAVE_JEDULE
 
+SG_BEGIN_DECL()
+
 typedef struct jed_simgrid_container s_jed_simgrid_container_t,
     *jed_simgrid_container_t;
 
@@ -90,6 +92,8 @@ void jed_simgrid_get_resource_selection_by_hosts(xbt_dynar_t subset_list,
 
 */
 
+SG_END_DECL()
+
 #endif
 
 
index 5b57f6b..522a075 100644 (file)
@@ -68,7 +68,6 @@ XBT_PUBLIC(void) sg_platf_new_bypassRoute (sg_platf_route_cbarg_t bypassroute);
 XBT_PUBLIC(void) sg_platf_new_bypassASroute (sg_platf_route_cbarg_t bypassASroute); // Add an bypassASroute
 
 XBT_PUBLIC(void) sg_platf_new_trace(sg_platf_trace_cbarg_t trace);
-XBT_PUBLIC(void) sg_platf_trace_connect(sg_platf_trace_connect_cbarg_t trace_connect);
 
 XBT_PUBLIC(void) sg_platf_new_storage(sg_platf_storage_cbarg_t storage); // Add a storage to the currently described AS
 XBT_PUBLIC(void) sg_platf_new_mstorage(sg_platf_mstorage_cbarg_t mstorage);
diff --git a/include/simgrid/platf_generator.h b/include/simgrid/platf_generator.h
deleted file mode 100644 (file)
index fbe912c..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-
-/* platf_generator.h - Public interface to the SimGrid platforms generator  */
-
-/* Copyright (c) 2004-2014. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#ifndef SG_PLATF_GEN_H
-#define SG_PLATF_GEN_H
-
-#include "xbt.h"
-#include "xbt/graph.h" //Only for platf_graph_get()
-#include "platf.h"
-
-typedef enum {
-  ROUTER,
-  HOST,
-  CLUSTER
-} e_platf_node_kind;
-
-typedef struct s_context_node_t {
-  unsigned long id;
-  double x, y;
-  int degree;
-  e_platf_node_kind kind;
-  int connect_checked;
-  union {
-    s_sg_platf_host_cbarg_t host_parameters;
-    s_sg_platf_cluster_cbarg_t cluster_parameters;
-    char* router_id;
-  };
-} s_context_node_t, *context_node_t;
-
-typedef struct s_context_edge_t {
-  unsigned long id;
-  double length;
-  int labeled;
-  s_sg_platf_link_cbarg_t link_parameters;
-} s_context_edge_t, *context_edge_t;
-
-typedef void (*platf_promoter_cb_t) (context_node_t);
-typedef void (*platf_labeler_cb_t) (context_edge_t);
-
-XBT_PUBLIC(void) platf_random_seed(unsigned long seed[6]);
-
-XBT_PUBLIC(void) platf_graph_uniform(unsigned long node_count);
-XBT_PUBLIC(void) platf_graph_heavytailed(unsigned long node_count);
-
-XBT_PUBLIC(void) platf_graph_interconnect_star(void);
-XBT_PUBLIC(void) platf_graph_interconnect_line(void);
-XBT_PUBLIC(void) platf_graph_interconnect_ring(void);
-XBT_PUBLIC(void) platf_graph_interconnect_clique(void);
-XBT_PUBLIC(void) platf_graph_interconnect_uniform(double alpha);
-XBT_PUBLIC(void) platf_graph_interconnect_exponential(double alpha);
-XBT_PUBLIC(void) platf_graph_interconnect_zegura(double alpha, double beta, double r);
-XBT_PUBLIC(void) platf_graph_interconnect_waxman(double alpha, double beta);
-XBT_PUBLIC(void) platf_graph_interconnect_barabasi(void);
-
-XBT_PUBLIC(int) platf_graph_is_connected(void);
-
-XBT_PUBLIC(void) platf_graph_clear_links(void);
-
-XBT_PUBLIC(void) platf_graph_promote_to_host(context_node_t node, sg_platf_host_cbarg_t parameters);
-XBT_PUBLIC(void) platf_graph_promote_to_cluster(context_node_t node, sg_platf_cluster_cbarg_t parameters);
-
-XBT_PUBLIC(void) platf_graph_link_label(context_edge_t edge, sg_platf_link_cbarg_t parameters);
-
-XBT_PUBLIC(void) platf_graph_promoter(platf_promoter_cb_t promoter_callback);
-XBT_PUBLIC(void) platf_graph_labeler(platf_labeler_cb_t labeler_callback);
-
-XBT_PUBLIC(void) platf_do_promote(void);
-XBT_PUBLIC(void) platf_do_label(void);
-
-XBT_PUBLIC(void) platf_generate(void);
-
-// WARNING : Only for debbugging ; should be removed when platform
-// generation works correctly
-XBT_PUBLIC(xbt_graph_t) platf_graph_get(void);
-
-#endif              /* SG_PLATF_GEN_H */
-
index 0fcdfbd..dffd6f7 100644 (file)
@@ -106,17 +106,14 @@ XBT_PUBLIC(const char*) SD_storage_get_host(SD_storage_t storage);
  *
  *  This section describes the functions for managing the tasks.
  *
- *  A task is some <em>working amount</em> that can be executed
- *  in parallel on several workstations. A task may depend on other
- *  tasks, this means that the task cannot start until the other tasks are done.
- *  Each task has a <em>\ref e_SD_task_state_t "state"</em> indicating whether
- *  the task is scheduled, running, done, etc.
+ *  A task is some <em>working amount</em> that can be executed in parallel on several hosts. A task may depend on other
+ *  tasks, this means that the task cannot start until the other tasks are done. Each task has a
+ *  <em>\ref e_SD_task_state_t "state"</em> indicating whether the task is scheduled, running, done, etc.
  *
  *  @see SD_task_t, SD_task_dependency_management
  *  @{
  */
-XBT_PUBLIC(SD_task_t) SD_task_create(const char *name, void *data,
-                                     double amount);
+XBT_PUBLIC(SD_task_t) SD_task_create(const char *name, void *data, double amount);
 XBT_PUBLIC(void *) SD_task_get_data(SD_task_t task);
 XBT_PUBLIC(void) SD_task_set_data(SD_task_t task, void *data);
 XBT_PUBLIC(e_SD_task_state_t) SD_task_get_state(SD_task_t task);
@@ -130,46 +127,29 @@ XBT_PUBLIC(double) SD_task_get_amount(SD_task_t task);
 XBT_PUBLIC(void) SD_task_set_amount(SD_task_t task, double amount);
 XBT_PUBLIC(double) SD_task_get_alpha(SD_task_t task);
 XBT_PUBLIC(double) SD_task_get_remaining_amount(SD_task_t task);
-XBT_PUBLIC(double) SD_task_get_execution_time(SD_task_t task,
-                                              int workstation_nb,
-                                              const sg_host_t *
-                                              workstation_list,
-                                              const double *flops_amount,
-                                              const double *bytes_amount);
+XBT_PUBLIC(double) SD_task_get_execution_time(SD_task_t task, int workstation_nb, const sg_host_t *workstation_list,
+                                              const double *flops_amount, const double *bytes_amount);
 XBT_PUBLIC(e_SD_task_kind_t) SD_task_get_kind(SD_task_t task);
-XBT_PUBLIC(void) SD_task_schedule(SD_task_t task, int workstation_nb,
-                                  const sg_host_t *
-                                  workstation_list,
-                                  const double *flops_amount,
-                                  const double *bytes_amount,
-                                  double rate);
+XBT_PUBLIC(void) SD_task_schedule(SD_task_t task, int workstation_nb, const sg_host_t *workstation_list,
+                                  const double *flops_amount, const double *bytes_amount, double rate);
 XBT_PUBLIC(void) SD_task_unschedule(SD_task_t task);
 XBT_PUBLIC(double) SD_task_get_start_time(SD_task_t task);
 XBT_PUBLIC(double) SD_task_get_finish_time(SD_task_t task);
 XBT_PUBLIC(xbt_dynar_t) SD_task_get_parents(SD_task_t task);
 XBT_PUBLIC(xbt_dynar_t) SD_task_get_children(SD_task_t task);
 XBT_PUBLIC(int) SD_task_get_workstation_count(SD_task_t task);
-XBT_PUBLIC(sg_host_t *) SD_task_get_workstation_list(SD_task_t
-                                                            task);
+XBT_PUBLIC(sg_host_t *) SD_task_get_workstation_list(SD_task_t task);
 XBT_PUBLIC(void) SD_task_destroy(SD_task_t task);
 XBT_PUBLIC(void) SD_task_dump(SD_task_t task);
 XBT_PUBLIC(void) SD_task_dotty(SD_task_t task, void *out_FILE);
 
-XBT_PUBLIC(SD_task_t) SD_task_create_comp_seq(const char *name, void *data,
-                                              double amount);
-XBT_PUBLIC(SD_task_t) SD_task_create_comp_par_amdahl(const char *name,
-                                                     void *data,
-                                                     double amount,
-                                                     double alpha);
-XBT_PUBLIC(SD_task_t) SD_task_create_comm_e2e(const char *name, void *data,
-                                              double amount);
-XBT_PUBLIC(SD_task_t) SD_task_create_comm_par_mxn_1d_block(const char *name,
-                                                           void *data,
-                                                           double amount);
+XBT_PUBLIC(SD_task_t) SD_task_create_comp_seq(const char *name, void *data, double amount);
+XBT_PUBLIC(SD_task_t) SD_task_create_comp_par_amdahl(const char *name, void *data, double amount, double alpha);
+XBT_PUBLIC(SD_task_t) SD_task_create_comm_e2e(const char *name, void *data, double amount);
+XBT_PUBLIC(SD_task_t) SD_task_create_comm_par_mxn_1d_block(const char *name, void *data, double amount);
 
 XBT_PUBLIC(void) SD_task_distribute_comp_amdahl(SD_task_t task, int ws_count);
-XBT_PUBLIC(void) SD_task_schedulev(SD_task_t task, int count,
-                                   const sg_host_t * list);
+XBT_PUBLIC(void) SD_task_schedulev(SD_task_t task, int count, const sg_host_t * list);
 XBT_PUBLIC(void) SD_task_schedulel(SD_task_t task, int count, ...);
 
 
@@ -177,11 +157,7 @@ XBT_PUBLIC(void) SD_task_schedulel(SD_task_t task, int count, ...);
  *
  *  For example, create a pure computation task (no comm) like this:
  *
- *  SD_task_schedule(task, my_workstation_nb,
- *                   my_workstation_list,
- *                   my_flops_amount,
- *                   SD_TASK_SCHED_NO_COST,
- *                   my_rate);
+ *  SD_task_schedule(task, my_host_count, my_host_list, my_flops_amount, SD_TASK_SCHED_NO_COST, my_rate);
  */
 #define SD_SCHED_NO_COST NULL
 
@@ -196,13 +172,10 @@ XBT_PUBLIC(void) SD_task_schedulel(SD_task_t task, int count, ...);
  *  @see SD_task_management
  *  @{
  */
-XBT_PUBLIC(void) SD_task_dependency_add(const char *name, void *data,
-                                        SD_task_t src, SD_task_t dst);
+XBT_PUBLIC(void) SD_task_dependency_add(const char *name, void *data, SD_task_t src, SD_task_t dst);
 XBT_PUBLIC(void) SD_task_dependency_remove(SD_task_t src, SD_task_t dst);
-XBT_PUBLIC(const char *) SD_task_dependency_get_name(SD_task_t src,
-                                                     SD_task_t dst);
-XBT_PUBLIC(void *) SD_task_dependency_get_data(SD_task_t src,
-                                               SD_task_t dst);
+XBT_PUBLIC(const char *) SD_task_dependency_get_name(SD_task_t src, SD_task_t dst);
+XBT_PUBLIC(void *) SD_task_dependency_get_data(SD_task_t src, SD_task_t dst);
 XBT_PUBLIC(int) SD_task_dependency_exists(SD_task_t src, SD_task_t dst);
 /** @} */
 
@@ -211,8 +184,7 @@ XBT_PUBLIC(int) SD_task_dependency_exists(SD_task_t src, SD_task_t dst);
 /** @defgroup SD_simulation Simulation
  *  @brief Functions for creating the environment and launching the simulation
  *
- *  This section describes the functions for initializing SimDag, launching
- *  the simulation and exiting SimDag.
+ *  This section describes the functions for initializing SimDag, launching the simulation and exiting SimDag.
  *
  *  @{
  */
@@ -230,6 +202,38 @@ XBT_PUBLIC(xbt_dynar_t) SD_dotload_with_sched(const char *filename);
 
 /** @} */
 
+/* Support some backward compatibility */
+#define SD_workstation_t sg_host_t
+
+#define SD_link_get_name sg_link_name
+#define SD_link_get_current_latency sg_link_latency
+#define SD_link_get_current_bandwidth sg_link_bandwidth
+
+#define SD_route_get_current_latency SD_route_get_latency
+#define SD_route_get_current_bandwidth SD_route_get_bandwidth
+
+#define SD_workstation_get_list sg_host_list
+#define SD_workstation_get_number sg_host_count
+
+#define SD_workstation_get_name sg_host_get_name
+#define SD_workstation_get_by_name sg_host_by_name
+#define SD_workstation_dump sg_host_dump
+#define SD_workstation_get_data sg_host_user
+#define SD_workstation_set_data sg_host_user_set
+#define SD_workstation_get_properties sg_host_get_properties
+#define SD_workstation_get_property_value sg_host_get_property_value
+#define SD_workstation_get_power sg_host_speed
+#define SD_workstation_get_available_power sg_host_get_available_speed
+
+#define SD_workstation_get_mounted_storage_list sg_host_get_mounted_storage_list
+// Lost functions
+//SD_workstation_get_access_mode
+//SD_workstation_set_access_mode
+//SD_workstation_get_current_task
+//SD_route_get_communication_time => SG_route_get_latency() + amount / SD_route_get_bandwidth()
+//SD_workstation_get_computation_time => amount / sg_host_speed()
+//TRACE_sd_set_task_category
+
 SG_END_DECL()
 
 #include "simgrid/instr.h"
index d931d13..bd12391 100644 (file)
@@ -410,13 +410,13 @@ XBT_PUBLIC(void) simcall_set_category(smx_synchro_t synchro, const char *categor
 
 /************************** Synchro simcalls **********************************/
 XBT_PUBLIC(smx_mutex_t) simcall_mutex_init(void);
-XBT_PUBLIC(void) simcall_mutex_destroy(smx_mutex_t mutex);
+XBT_PUBLIC(void) SIMIX_mutex_destroy(smx_mutex_t mutex);
 XBT_PUBLIC(void) simcall_mutex_lock(smx_mutex_t mutex);
 XBT_PUBLIC(int) simcall_mutex_trylock(smx_mutex_t mutex);
 XBT_PUBLIC(void) simcall_mutex_unlock(smx_mutex_t mutex);
 
 XBT_PUBLIC(smx_cond_t) simcall_cond_init(void);
-XBT_PUBLIC(void) simcall_cond_destroy(smx_cond_t cond);
+XBT_PUBLIC(void) SIMIX_cond_destroy(smx_cond_t cond);
 XBT_PUBLIC(void) simcall_cond_signal(smx_cond_t cond);
 XBT_PUBLIC(void) simcall_cond_wait(smx_cond_t cond, smx_mutex_t mutex);
 XBT_PUBLIC(void) simcall_cond_wait_timeout(smx_cond_t cond,
@@ -425,7 +425,7 @@ XBT_PUBLIC(void) simcall_cond_wait_timeout(smx_cond_t cond,
 XBT_PUBLIC(void) simcall_cond_broadcast(smx_cond_t cond);
 
 XBT_PUBLIC(smx_sem_t) simcall_sem_init(int capacity);
-XBT_PUBLIC(void) simcall_sem_destroy(smx_sem_t sem);
+XBT_PUBLIC(void) SIMIX_sem_destroy(smx_sem_t sem);
 XBT_PUBLIC(void) simcall_sem_release(smx_sem_t sem);
 XBT_PUBLIC(int) simcall_sem_would_block(smx_sem_t sem);
 XBT_PUBLIC(void) simcall_sem_acquire(smx_sem_t sem);
index 1ee0a15..279ba46 100644 (file)
@@ -76,7 +76,7 @@
 #define MALLOCATOR_COMPILED_IN @MALLOCATOR_IS_WANTED@
 
 /* Define if xbt contexts are based on our threads implementation or not */
-#cmakedefine CONTEXT_THREADS @CONTEXT_THREADS@
+#cmakedefine HAVE_THREAD_CONTEXTS @HAVE_THREAD_CONTEXTS@
 
 /* Jedule output  */
 #cmakedefine HAVE_JEDULE @HAVE_JEDULE@
index 4e9160e..180258a 100644 (file)
@@ -898,8 +898,62 @@ XBT_PUBLIC(void) SMPI_app_instance_register(const char *name, xbt_main_func_t co
 XBT_PUBLIC(void) SMPI_init(void);
 XBT_PUBLIC(void) SMPI_finalize(void);
 
-
-
+/* Manual global privatization fallback */
+XBT_PUBLIC(void) smpi_register_static(void* arg, void_f_pvoid_t free_fn);
+XBT_PUBLIC(void) smpi_free_static(void);
+
+#define SMPI_VARINIT_GLOBAL(name,type)                          \
+type *name = NULL;                                              \
+static void __attribute__((constructor)) __preinit_##name(void) { \
+   if(!name)                                                    \
+      name = (type*)calloc(smpi_global_size(), sizeof(type));   \
+}                                                               \
+static void __attribute__((destructor)) __postfini_##name(void) { \
+   free(name);                                                  \
+   name = NULL;                                                 \
+}
+
+#define SMPI_VARINIT_GLOBAL_AND_SET(name,type,expr)             \
+type *name = NULL;                                              \
+static void __attribute__((constructor)) __preinit_##name(void) { \
+   size_t size = smpi_global_size();                            \
+   size_t i;                                                    \
+   type value = expr;                                           \
+   if(!name) {                                                  \
+      name = (type*)malloc(size * sizeof(type));                \
+      for(i = 0; i < size; i++) {                               \
+         name[i] = value;                                       \
+      }                                                         \
+   }                                                            \
+}                                                               \
+static void __attribute__((destructor)) __postfini_##name(void) { \
+   free(name);                                                  \
+   name = NULL;                                                 \
+}
+
+#define SMPI_VARGET_GLOBAL(name) name[smpi_process_index()]
+
+#define SMPI_VARINIT_STATIC(name,type)                      \
+static type *name = NULL;                                   \
+if(!name) {                                                 \
+   name = (type*)calloc(smpi_global_size(), sizeof(type));  \
+   smpi_register_static(name, xbt_free_f);                  \
+}
+
+#define SMPI_VARINIT_STATIC_AND_SET(name,type,expr) \
+static type *name = NULL;                           \
+if(!name) {                                         \
+   size_t size = smpi_global_size();                \
+   size_t i;                                        \
+   type value = expr;                               \
+   name = (type*)malloc(size * sizeof(type));       \
+   for(i = 0; i < size; i++) {                      \
+      name[i] = value;                              \
+   }                                                \
+   smpi_register_static(name, xbt_free_f);          \
+}
+
+#define SMPI_VARGET_STATIC(name) name[smpi_process_index()]
 
 SG_END_DECL()
 #endif
diff --git a/include/smpi/smpi_cocci.h b/include/smpi/smpi_cocci.h
deleted file mode 100644 (file)
index f938a9b..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/* Copyright (c) 2011-2014. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#ifndef SMPI_COCCI_H
-#define SMPI_COCCI_H
-
-#include <xbt/misc.h>
-
-/* Macros used by coccinelle-generated code */
-
-#define SMPI_VARINIT_GLOBAL(name,type)                          \
-type *name = NULL;                                              \
-static void __attribute__((constructor)) __preinit_##name(void) { \
-   if(!name)                                                    \
-      name = (type*)calloc(smpi_global_size(), sizeof(type));   \
-}                                                               \
-static void __attribute__((destructor)) __postfini_##name(void) { \
-   free(name);                                                  \
-   name = NULL;                                                 \
-}
-
-#define SMPI_VARINIT_GLOBAL_AND_SET(name,type,expr)             \
-type *name = NULL;                                              \
-static void __attribute__((constructor)) __preinit_##name(void) { \
-   size_t size = smpi_global_size();                            \
-   size_t i;                                                    \
-   type value = expr;                                           \
-   if(!name) {                                                  \
-      name = (type*)malloc(size * sizeof(type));                \
-      for(i = 0; i < size; i++) {                               \
-         name[i] = value;                                       \
-      }                                                         \
-   }                                                            \
-}                                                               \
-static void __attribute__((destructor)) __postfini_##name(void) { \
-   free(name);                                                  \
-   name = NULL;                                                 \
-}
-
-#define SMPI_VARGET_GLOBAL(name) name[smpi_process_index()]
-
-/* The following handle local static variables */
-/** @brief Make sure that the passed pointer is freed on process exit.
- *
- * This function is rather internal, mainly used for the
- * privatization of global variables through coccinelle.
- */
-XBT_PUBLIC(void) smpi_register_static(void* arg, void_f_pvoid_t free_fn);
-
-XBT_PUBLIC(void) smpi_free_static(void);
-
-#define SMPI_VARINIT_STATIC(name,type)                      \
-static type *name = NULL;                                   \
-if(!name) {                                                 \
-   name = (type*)calloc(smpi_global_size(), sizeof(type));  \
-   smpi_register_static(name, xbt_free_f);                  \
-}
-
-#define SMPI_VARINIT_STATIC_AND_SET(name,type,expr) \
-static type *name = NULL;                           \
-if(!name) {                                         \
-   size_t size = smpi_global_size();                \
-   size_t i;                                        \
-   type value = expr;                               \
-   name = (type*)malloc(size * sizeof(type));       \
-   for(i = 0; i < size; i++) {                      \
-      name[i] = value;                              \
-   }                                                \
-   smpi_register_static(name, xbt_free_f);          \
-}
-
-#define SMPI_VARGET_STATIC(name) name[smpi_process_index()]
-
-#endif
diff --git a/src/include/surf/random_mgr.h b/src/include/surf/random_mgr.h
deleted file mode 100644 (file)
index 19b4a15..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Copyright (c) 2007-2014. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#ifndef _SURF_RMGR_H
-#define _SURF_RMGR_H
-
-#include "xbt/heap.h"
-#include "xbt/dict.h"
-
-SG_BEGIN_DECL()
-
-typedef enum { NONE, DRAND48, RAND, RNGSTREAM } e_random_generator_t;
-
-typedef struct random_data_desc {
-  long int seed;
-  double max, min;
-  double mean, std;             /* note: mean and standard deviation are normalized */
-  e_random_generator_t generator;
-} s_random_data_t, *random_data_t;
-
-XBT_PUBLIC_DATA(xbt_dict_t) random_data_list;
-
-XBT_PUBLIC(double) random_generate(random_data_t random);
-XBT_PUBLIC(random_data_t) random_new(e_random_generator_t generator,
-                                     long int seed,
-                                     double min, double max, double mean,
-                                     double stdDeviation);
-
-SG_END_DECL()
-#endif                          /* _SURF_RMGR_H */
index 82033ac..73bfa4d 100644 (file)
 XBT_LOG_NEW_CATEGORY(instr, "Logging the behavior of the tracing system (used for Visualization/Analysis of simulations)");
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_config, instr, "Configuration");
 
-#define OPT_TRACING               "tracing"
-#define OPT_TRACING_PLATFORM      "tracing/platform"
-#define OPT_TRACING_TOPOLOGY      "tracing/platform/topology"
-#define OPT_TRACING_SMPI          "tracing/smpi"
-#define OPT_TRACING_SMPI_GROUP    "tracing/smpi/group"
-#define OPT_TRACING_SMPI_COMPUTING "tracing/smpi/computing"
-#define OPT_TRACING_SMPI_SLEEPING "tracing/smpi/sleeping"
-#define OPT_TRACING_SMPI_INTERNALS "tracing/smpi/internals"
-#define OPT_TRACING_DISPLAY_SIZES  "tracing/smpi/display_sizes"
-#define OPT_TRACING_FORMAT        "tracing/smpi/format"
-#define OPT_TRACING_FORMAT_TI_ONEFILE "tracing/smpi/format/ti_one_file"
-#define OPT_TRACING_CATEGORIZED   "tracing/categorized"
-#define OPT_TRACING_UNCATEGORIZED "tracing/uncategorized"
-#define OPT_TRACING_MSG_PROCESS   "tracing/msg/process"
-#define OPT_TRACING_MSG_VM        "tracing/msg/vm"
-#define OPT_TRACING_FILENAME      "tracing/filename"
-#define OPT_TRACING_BUFFER        "tracing/buffer"
-#define OPT_TRACING_ONELINK_ONLY  "tracing/onelink_only"
-#define OPT_TRACING_DISABLE_DESTROY "tracing/disable_destroy"
-#define OPT_TRACING_BASIC         "tracing/basic"
-#define OPT_TRACING_COMMENT       "tracing/comment"
-#define OPT_TRACING_COMMENT_FILE  "tracing/comment_file"
-#define OPT_VIVA_UNCAT_CONF      "viva/uncategorized"
-#define OPT_VIVA_CAT_CONF        "viva/categorized"
-#define OPT_TRACING_DISABLE_LINK        "tracing/disable_link"
-#define OPT_TRACING_DISABLE_POWER       "tracing/disable_power"
-#define OPT_TRACING_PRECISION     "tracing/precision"
+#define OPT_TRACING_BASIC                "tracing/basic"
+#define OPT_TRACING_BUFFER               "tracing/buffer"
+#define OPT_TRACING_CATEGORIZED          "tracing/categorized"
+#define OPT_TRACING_COMMENT_FILE         "tracing/comment_file"
+#define OPT_TRACING_COMMENT              "tracing/comment"
+#define OPT_TRACING_DISABLE_DESTROY      "tracing/disable_destroy"
+#define OPT_TRACING_DISABLE_LINK         "tracing/disable_link"
+#define OPT_TRACING_DISABLE_POWER        "tracing/disable_power"
+#define OPT_TRACING_DISPLAY_SIZES        "tracing/smpi/display_sizes"
+#define OPT_TRACING_FILENAME             "tracing/filename"
+#define OPT_TRACING_FORMAT_TI_ONEFILE    "tracing/smpi/format/ti_one_file"
+#define OPT_TRACING_FORMAT               "tracing/smpi/format"
+#define OPT_TRACING_MSG_PROCESS          "tracing/msg/process"
+#define OPT_TRACING_MSG_VM               "tracing/msg/vm"
+#define OPT_TRACING_ONELINK_ONLY         "tracing/onelink_only"
+#define OPT_TRACING_PLATFORM             "tracing/platform"
+#define OPT_TRACING_PRECISION            "tracing/precision"
+#define OPT_TRACING_SMPI_COMPUTING       "tracing/smpi/computing"
+#define OPT_TRACING_SMPI_GROUP           "tracing/smpi/group"
+#define OPT_TRACING_SMPI_INTERNALS       "tracing/smpi/internals"
+#define OPT_TRACING_SMPI_SLEEPING        "tracing/smpi/sleeping"
+#define OPT_TRACING_SMPI                 "tracing/smpi"
+#define OPT_TRACING_TOPOLOGY             "tracing/platform/topology"
+#define OPT_TRACING                      "tracing"
+#define OPT_TRACING_UNCATEGORIZED        "tracing/uncategorized"
+#define OPT_VIVA_CAT_CONF                "viva/categorized"
+#define OPT_VIVA_UNCAT_CONF              "viva/uncategorized"
 
 static int trace_enabled = 0;
 static int trace_platform;
similarity index 99%
rename from src/instr/jedule/jedule_output.c
rename to src/instr/jedule/jedule_output.cpp
index b8195cd..1bac445 100644 (file)
@@ -78,7 +78,7 @@ static void get_hierarchy_string(jed_simgrid_container_t container,
     xbt_dynar_t hier_list;
     unsigned int iter;
     int number;
-    int length;
+    unsigned int length;
     
     outbuf[0] = '\0';
     hier_list = xbt_dynar_new(sizeof(int), NULL);
@@ -127,7 +127,7 @@ static void print_container(jed_simgrid_container_t container) {
 }
 
 static void print_resources(jed_simgrid_container_t resource_parent) {
-  int res_nb;
+  unsigned int res_nb;
   unsigned int i;
   char *res_name;
     char resid[1024];
similarity index 93%
rename from src/instr/jedule/jedule_platform.c
rename to src/instr/jedule/jedule_platform.cpp
index 08fd7e7..312b06f 100644 (file)
@@ -153,8 +153,8 @@ static void add_subsets_to(xbt_dynar_t subset_list, xbt_dynar_t hostgroup,
   xbt_dynar_foreach(hostgroup, iter, host_name) {
     jed_simgrid_container_t parent;
     xbt_assert( host_name != NULL );
-    parent = xbt_dict_get(host2_simgrid_parent_container, host_name);
-    id_str = xbt_dict_get(parent->name2id, host_name);
+    parent = (jed_simgrid_container_t)xbt_dict_get(host2_simgrid_parent_container, host_name);
+    id_str = (char*)xbt_dict_get(parent->name2id, host_name);
     xbt_dynar_push(id_list, &id_str);
   }
 
@@ -215,15 +215,12 @@ void jed_simgrid_get_resource_selection_by_hosts(xbt_dynar_t subset_list,
   //  group by parent container
 
   xbt_dynar_foreach(host_names, iter, host_name) {
-    jed_simgrid_container_t parent;
-    xbt_dynar_t hostgroup;
-
     //printf("checking %s \n", host_name);
 
-    parent = xbt_dict_get(host2_simgrid_parent_container, host_name);
+    jed_simgrid_container_t parent = (jed_simgrid_container_t)xbt_dict_get(host2_simgrid_parent_container, host_name);
     xbt_assert( parent != NULL );
 
-    hostgroup = xbt_dict_get_or_null (parent2hostgroup, parent->name);
+    xbt_dynar_t hostgroup = (xbt_dynar_t)xbt_dict_get_or_null (parent2hostgroup, parent->name);
     if( hostgroup == NULL ) {
       hostgroup = xbt_dynar_new(sizeof(char*), NULL);
       xbt_dict_set(parent2hostgroup, parent->name, hostgroup, NULL);
@@ -239,7 +236,7 @@ void jed_simgrid_get_resource_selection_by_hosts(xbt_dynar_t subset_list,
     jed_simgrid_container_t parent;
 
     xbt_dict_foreach(parent2hostgroup,cursor,parent_name,hostgroup) {
-      parent = xbt_dict_get(container_name2container, parent_name);
+      parent = (jed_simgrid_container_t)xbt_dict_get(container_name2container, parent_name);
       // printf("subset parent >>> %s\n", parent->name);
       add_subsets_to(subset_list, hostgroup, parent);
     }
index 70f1383..6547de0 100644 (file)
@@ -54,7 +54,7 @@ void MSG_sem_get_capacity(msg_sem_t sem) {
 }
 
 void MSG_sem_destroy(msg_sem_t sem) {
-  simcall_sem_destroy(sem);
+  SIMIX_sem_destroy(sem);
 }
 /** @brief returns a boolean indicating if this semaphore would block at this very specific time
  *
index 9333294..352125e 100644 (file)
@@ -6,11 +6,9 @@
 
 #include "src/simdag/simdag_private.h"
 #include "simgrid/simdag.h"
-#include "xbt/misc.h"
 #include "xbt/log.h"
 #include <stdbool.h>
 #include <string.h>
-#include <libgen.h>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(sd_dotparse, sd, "Parsing DOT files");
 
@@ -21,8 +19,6 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(sd_dotparse, sd, "Parsing DOT files");
 #elif HAVE_AGRAPH_H
 #include <graphviz/agraph.h>
 #define agnxtnode(dot, node)    agnxtnode(node)
-#define agfstin(dot, node)      agfstin(node)
-#define agnxtin(dot, edge)      agnxtin(edge)
 #define agfstout(dot, node)     agfstout(node)
 #define agnxtout(dot, edge)     agnxtout(edge)
 #endif
@@ -32,97 +28,31 @@ typedef enum {
   parallel
 } seq_par_t;
 
-xbt_dynar_t SD_dotload_generic(const char * filename, seq_par_t seq_or_par);
+xbt_dynar_t SD_dotload_generic(const char * filename, seq_par_t seq_or_par, bool schedule);
 
-static xbt_dynar_t result;
-static xbt_dict_t jobs;
-static xbt_dict_t computers;
-static Agraph_t *dag_dot;
-static bool schedule = true;
 
 static void dot_task_p_free(void *task) {
-  SD_task_t *t = (SD_task_t *)task;
-  SD_task_destroy(*t);
+  SD_task_destroy(*(SD_task_t *)task);
 }
 
 /** @brief loads a DOT file describing a DAG
  * 
- * See http://www.graphviz.org/doc/info/lang.html
- * for more details.
- * To obtain information about transfers and tasks, two attributes are
- * required : size on task (execution time in Flop) and size on edge
- * (the amount of data transfer in bit).
- * if they aren't here, there choose to be equal to zero.
+ * See http://www.graphviz.org/doc/info/lang.html  for more details.
+ * The size attribute of a node describes:
+ *   - for a compute task: the amount of flops to execute
+ *   - for a communication task : the amount of bytes to transfer
+ * If this attribute is ommited, the default value is zero.
  */
 xbt_dynar_t SD_dotload(const char *filename) {
-  computers = xbt_dict_new_homogeneous(NULL);
-  schedule = false;
-  SD_dotload_generic(filename, sequential);
-  xbt_dynar_t computer = NULL;
-  xbt_dict_cursor_t dict_cursor;
-  char *computer_name;
-  xbt_dict_foreach(computers,dict_cursor,computer_name,computer){
-    xbt_dynar_free(&computer);
-  }
-  xbt_dict_free(&computers);
-  return result;
+  return SD_dotload_generic(filename, sequential, false);
 }
 
-xbt_dynar_t SD_dotload_with_sched(const char *filename) {
-  computers = xbt_dict_new_homogeneous(NULL);
-  SD_dotload_generic(filename, sequential);
-
-  if(schedule){
-    xbt_dynar_t computer = NULL;
-    xbt_dict_cursor_t dict_cursor;
-    char *computer_name;
-    const sg_host_t *workstations = sg_host_list ();
-    xbt_dict_foreach(computers,dict_cursor,computer_name,computer){
-      int count_computer = atoi(computer_name);
-      unsigned int count=0;
-      SD_task_t task;
-      SD_task_t task_previous = NULL;
-      xbt_dynar_foreach(computer,count,task){
-        /* add dependency between the previous and the task to avoid
-         * parallel execution */
-        if(task != NULL ){
-          if(task_previous != NULL &&
-             !SD_task_dependency_exists(task_previous, task))
-            SD_task_dependency_add(NULL, NULL, task_previous, task);
-          SD_task_schedulel(task, 1, workstations[count_computer]);
-          task_previous = task;
-        }
-      }
-      xbt_dynar_free(&computer);
-    }
-    xbt_dict_free(&computers);
-    if(acyclic_graph_detail(result))
-      return result;
-    else
-      XBT_WARN("There is at least one cycle in the provided task graph");
-  }else{
-    XBT_WARN("The scheduling is ignored");
-  }
-  xbt_dynar_t computer = NULL;
-  xbt_dict_cursor_t dict_cursor;
-  char *computer_name;
-  xbt_dict_foreach(computers,dict_cursor,computer_name,computer){
-    xbt_dynar_free(&computer);
-  }
-  xbt_dict_free(&computers);
-  xbt_dynar_free(&result);
-  return NULL;
+xbt_dynar_t SD_PTG_dotload(const char * filename) {
+  return SD_dotload_generic(filename, parallel, false);
 }
 
-xbt_dynar_t SD_PTG_dotload(const char * filename) {
-  xbt_dynar_t result = SD_dotload_generic(filename, parallel);
-  if (!acyclic_graph_detail(result)) {
-    XBT_ERROR("The DOT described in %s is not a DAG. It contains a cycle.",
-              basename((char*)filename));
-    xbt_dynar_free(&result);
-    /* (result == NULL) here */
-  }
-  return result;
+xbt_dynar_t SD_dotload_with_sched(const char *filename) {
+  return SD_dotload_generic(filename, sequential, true);
 }
 
 #ifdef HAVE_CGRAPH_H
@@ -134,55 +64,51 @@ static int edge_compare(const void *a, const void *b)
 }
 #endif
 
-xbt_dynar_t SD_dotload_generic(const char * filename, seq_par_t seq_or_par){
+xbt_dynar_t SD_dotload_generic(const char * filename, seq_par_t seq_or_par, bool schedule){
   xbt_assert(filename, "Unable to use a null file descriptor\n");
   unsigned int i;
-  result = xbt_dynar_new(sizeof(SD_task_t), dot_task_p_free);
-  jobs = xbt_dict_new_homogeneous(NULL);
+  SD_task_t root, end, task;
+  xbt_dict_t computers;
+  xbt_dynar_t computer = NULL;
+  char *computer_name;
+  xbt_dict_cursor_t dict_cursor;
+  bool schedule_success = true;
+
+  xbt_dynar_t result = xbt_dynar_new(sizeof(SD_task_t), dot_task_p_free);
+  xbt_dict_t jobs = xbt_dict_new_homogeneous(NULL);
+
   FILE *in_file = fopen(filename, "r");
   if (in_file == NULL)
     xbt_die("Failed to open file: %s", filename);
-  dag_dot = agread(in_file, NIL(Agdisc_t *));
-  SD_task_t root, end, task;
-  /*
-   * Create all the nodes
-   */
+
+  Agraph_t * dag_dot = agread(in_file, NIL(Agdisc_t *));
+
+  if (schedule)
+    computers = xbt_dict_new_homogeneous(NULL);
+
+  /* Create all the nodes */
   Agnode_t *node = NULL;
   for (node = agfstnode(dag_dot); node; node = agnxtnode(dag_dot, node)) {
-
     char *name = agnameof(node);
     double amount = atof(agget(node, (char *) "size"));
     double alpha = 0.0;
 
-    if (seq_or_par == sequential){
-      XBT_DEBUG("See <job id=%s amount =%.0f>", name, amount);
-    } else {
-      if (!strcmp(agget(node, (char *) "alpha"), "")){
-        alpha = atof(agget(node, (char *) "alpha"));
-        if (alpha == -1.){
-          XBT_DEBUG("negative alpha value provided. Set to 0.");
-          alpha = 0.0 ;
-        }
-      } else {
-        XBT_DEBUG("no alpha value provided. Set to 0");
-        alpha = 0.0 ;
-      }
-
-      XBT_DEBUG("See <job id=%s amount =%.0f alpha = %.3f>",
-          name, amount, alpha);
-    }
-
     if (!(task = (SD_task_t)xbt_dict_get_or_null(jobs, name))) {
       if (seq_or_par == sequential){
+        XBT_DEBUG("See <job id=%s amount =%.0f>", name, amount);
         task = SD_task_create_comp_seq(name, NULL , amount);
       } else {
+        alpha = atof(agget(node, (char *) "alpha"));
+        XBT_DEBUG("See <job id=%s amount =%.0f alpha = %.3f>", name, amount, alpha);
         task = SD_task_create_comp_par_amdahl(name, NULL , amount, alpha);
       }
+
       xbt_dict_set(jobs, name, task, NULL);
+
       if (!strcmp(name, "root")){
-      /* by design the root task is always SCHEDULABLE */
-      SD_task_set_state(task, SD_SCHEDULABLE);
-      /* Put it at the beginning of the dynar */
+        /* by design the root task is always SCHEDULABLE */
+        SD_task_set_state(task, SD_SCHEDULABLE);
+        /* Put it at the beginning of the dynar */
         xbt_dynar_insert_at(result, 0, &task);
       } else {
         if (!strcmp(name, "end")){
@@ -195,21 +121,17 @@ xbt_dynar_t SD_dotload_generic(const char * filename, seq_par_t seq_or_par){
       }
 
       if((seq_or_par == sequential) &&
-          (schedule ||
-              XBT_LOG_ISENABLED(sd_dotparse, xbt_log_priority_verbose))){
-        /* try to take the information to schedule the task only if all is
-         * right*/
+        ((schedule && schedule_success) || XBT_LOG_ISENABLED(sd_dotparse, xbt_log_priority_verbose))){
+        /* try to take the information to schedule the task only if all is right*/
         int performer, order;
         char *char_performer = agget(node, (char *) "performer");
         char *char_order = agget(node, (char *) "order");
         /* performer is the computer which execute the task */
-        performer =
-            ((!char_performer || !strcmp(char_performer,"")) ? -1:atoi(char_performer));
+        performer = ((!char_performer || !strcmp(char_performer,"")) ? -1:atoi(char_performer));
         /* order is giving the task order on one computer */
         order = ((!char_order || !strcmp(char_order, ""))? -1:atoi(char_order));
 
-        XBT_DEBUG ("Task '%s' is scheduled on workstation '%d' in position '%d'",
-                    task->name, performer, order);
+        XBT_DEBUG ("Task '%s' is scheduled on workstation '%d' in position '%d'", task->name, performer, order);
         xbt_dynar_t computer = NULL;
         if(performer != -1 && order != -1){
           /* required parameters are given */
@@ -225,10 +147,9 @@ xbt_dynar_t SD_dotload_generic(const char * filename, seq_par_t seq_or_par){
               task_test = (SD_task_t *)xbt_dynar_get_ptr(computer,order);
             if(task_test != NULL && *task_test != NULL && *task_test != task){
               /* the user gives the same order to several tasks */
-              schedule = false;
+              schedule_success = false;
               XBT_VERB("The task %s starts on the computer %s at the position : %s like the task %s",
-                     (*task_test)->name, char_performer, char_order,
-                     task->name);
+                     (*task_test)->name, char_performer, char_order, task->name);
             }else{
               /* the parameter seems to be ok */
               xbt_dynar_set_as(computer, order, SD_task_t, task);
@@ -236,15 +157,14 @@ xbt_dynar_t SD_dotload_generic(const char * filename, seq_par_t seq_or_par){
           }else{
             /* the platform has not enough processors to schedule the DAG like
              * the user wants*/
-            schedule = false;
+            schedule_success = false;
             XBT_VERB("The schedule is ignored, there are not enough computers");
           }
         }
         else {
           /* one of required parameters is not given */
-          schedule = false;
-          XBT_VERB("The schedule is ignored, the task %s is not correctly scheduled",
-              task->name);
+          schedule_success = false;
+          XBT_VERB("The schedule is ignored, the task %s is not correctly scheduled", task->name);
         }
       }
     } else {
@@ -252,10 +172,7 @@ xbt_dynar_t SD_dotload_generic(const char * filename, seq_par_t seq_or_par){
     }
   }
 
-  /*
-   * Check if 'root' and 'end' nodes have been explicitly declared.
-   * If not, create them.
-   */
+  /*Check if 'root' and 'end' nodes have been explicitly declared.  If not, create them. */
   if (!(root = (SD_task_t)xbt_dict_get_or_null(jobs, "root"))){
     if (seq_or_par == sequential)
       root = SD_task_create_comp_seq("root", NULL, 0);
@@ -264,7 +181,7 @@ xbt_dynar_t SD_dotload_generic(const char * filename, seq_par_t seq_or_par){
     /* by design the root task is always SCHEDULABLE */
     SD_task_set_state(root, SD_SCHEDULABLE);
     /* Put it at the beginning of the dynar */
-      xbt_dynar_insert_at(result, 0, &root);
+    xbt_dynar_insert_at(result, 0, &root);
   }
 
   if (!(end = (SD_task_t)xbt_dict_get_or_null(jobs, "end"))){
@@ -272,12 +189,9 @@ xbt_dynar_t SD_dotload_generic(const char * filename, seq_par_t seq_or_par){
       end = SD_task_create_comp_seq("end", NULL, 0);
     else
       end = SD_task_create_comp_par_amdahl("end", NULL, 0, 0);
-    /* Should be inserted later in the dynar */
   }
 
-  /*
-   * Create edges
-   */
+  /* Create edges */
   xbt_dynar_t edges = xbt_dynar_new(sizeof(Agedge_t*), NULL);
   for (node = agfstnode(dag_dot); node; node = agnxtnode(dag_dot, node)) {
     unsigned cursor;
@@ -286,10 +200,9 @@ xbt_dynar_t SD_dotload_generic(const char * filename, seq_par_t seq_or_par){
     for (edge = agfstout(dag_dot, node); edge; edge = agnxtout(dag_dot, edge))
       xbt_dynar_push_as(edges, Agedge_t *, edge);
 #ifdef HAVE_CGRAPH_H
-    /* Hack: circumvent a bug in libcgraph, where the edges are not always given
-     * back in creation order.  We sort them again, according to their sequence
-     * id.  The problem appears to be solved (i.e.: I did not test it) in
-     * graphviz' mercurial repository by the following changeset:
+    /* Hack: circumvent a bug in libcgraph, where the edges are not always given back in creation order.  We sort them
+     * again, according to their sequence id.  The problem appears to be solved (i.e.: I did not test it) in graphviz'
+     * mercurial repository by the following changeset:
      *    changeset:   8431:d5f1fb7e8103
      *    user:        Emden Gansner <erg@research.att.com>
      *    date:        Tue Oct 11 12:38:58 2011 -0400
@@ -331,25 +244,21 @@ xbt_dynar_t SD_dotload_generic(const char * filename, seq_par_t seq_or_par){
   }
   xbt_dynar_free(&edges);
 
-  /* all compute and transfer tasks have been created, put the "end" node at
-   * the end of dynar
-   */
-  XBT_DEBUG("All tasks have been created, put %s at the end of the dynar",
-      end->name);
+  /* all compute and transfer tasks have been created, put the "end" node at the end of dynar */
+  XBT_DEBUG("All tasks have been created, put %s at the end of the dynar", end->name);
   xbt_dynar_push(result, &end);
 
   /* Connect entry tasks to 'root', and exit tasks to 'end'*/
-
   xbt_dynar_foreach (result, i, task){
     if (task == root || task == end)
       continue;
     if (xbt_dynar_is_empty(task->tasks_before)) {
-      XBT_DEBUG("file '%s' has no source. Add dependency from 'root'",
-          task->name);
+      XBT_DEBUG("file '%s' has no source. Add dependency from 'root'", task->name);
       SD_task_dependency_add(NULL, NULL, root, task);
-    } else if (xbt_dynar_is_empty(task->tasks_after)) {
-      XBT_DEBUG("file '%s' has no destination. Add dependency to 'end'",
-          task->name);
+    }
+
+    if (xbt_dynar_is_empty(task->tasks_after)) {
+      XBT_DEBUG("file '%s' has no destination. Add dependency to 'end'", task->name);
       SD_task_dependency_add(NULL, NULL, task, end);
     }
   }
@@ -358,11 +267,43 @@ xbt_dynar_t SD_dotload_generic(const char * filename, seq_par_t seq_or_par){
   xbt_dict_free(&jobs);
   fclose(in_file);
 
+  if(schedule){
+    if (schedule_success) {
+      const sg_host_t *workstations = sg_host_list ();
+      xbt_dict_foreach(computers,dict_cursor,computer_name,computer){
+        int count_computer = atoi(computer_name);
+        unsigned int count=0;
+        SD_task_t task;
+        SD_task_t task_previous = NULL;
+        xbt_dynar_foreach(computer,count,task){
+          /* add dependency between the previous and the task to avoid parallel execution */
+          if(task != NULL ){
+            if(task_previous != NULL && !SD_task_dependency_exists(task_previous, task))
+              SD_task_dependency_add(NULL, NULL, task_previous, task);
+
+            SD_task_schedulel(task, 1, workstations[count_computer]);
+            task_previous = task;
+          }
+        }
+        xbt_dynar_free(&computer);
+      }
+      xbt_dict_free(&computers);
+    } else {
+      XBT_WARN("The scheduling is ignored");
+      xbt_dict_foreach(computers,dict_cursor,computer_name,computer){
+        xbt_dynar_free(&computer);
+      }
+
+      xbt_dict_free(&computers);
+      xbt_dynar_free(&result);
+      result = NULL;
+    }
+  }
+
   if (!acyclic_graph_detail(result)) {
-    XBT_ERROR("The DOT described in %s is not a DAG. It contains a cycle.",
-              basename((char*)filename));
+    XBT_ERROR("The DOT described in %s is not a DAG. It contains a cycle.", basename((char*)filename));
     xbt_dynar_free(&result);
-    /* (result == NULL) here */
+    result = NULL;
   }
   return result;
 }
index 94def06..031e452 100644 (file)
@@ -61,15 +61,15 @@ sg_host_t sg_host_by_name_or_create(const char *name)
 
 xbt_dynar_t sg_hosts_as_dynar(void)
 {
-       xbt_dynar_t res = xbt_dynar_new(sizeof(sg_host_t),NULL);
+  xbt_dynar_t res = xbt_dynar_new(sizeof(sg_host_t),NULL);
 
   xbt_dict_cursor_t cursor = nullptr;
   const char* name = nullptr;
   simgrid::s4u::Host* host = nullptr;
-       xbt_dict_foreach(host_list, cursor, name, host)
-               if(routing_get_network_element_type(name) == SURF_NETWORK_ELEMENT_HOST)
-                       xbt_dynar_push(res, &host);
-       return res;
+  xbt_dict_foreach(host_list, cursor, name, host)
+    if(routing_get_network_element_type(name) == SURF_NETWORK_ELEMENT_HOST)
+       xbt_dynar_push(res, &host);
+  return res;
 }
 
 // ========= Layering madness ==============*
index 760acb6..8adf5ce 100644 (file)
@@ -711,11 +711,11 @@ void sg_config_init(int *argc, char **argv)
         sprintf(description,
                 "Context factory to use in SIMIX. Possible values: %s",
                 dflt_ctx_fact);
-#ifdef CONTEXT_UCONTEXT
+#ifdef HAVE_UCONTEXT_CONTEXTS
       dflt_ctx_fact = "ucontext";
       p += sprintf(p, ", %s", dflt_ctx_fact);
 #endif
-#ifdef HAVE_RAWCTX
+#ifdef HAVE_RAW_CONTEXTS
       dflt_ctx_fact = "raw";
       p += sprintf(p, ", %s", dflt_ctx_fact);
 #endif
@@ -836,10 +836,10 @@ void sg_config_init(int *argc, char **argv)
                      xbt_cfgelm_int, 1, 1, NULL, NULL);
     xbt_cfg_setdefault_int(_sg_cfg_set, "smpi/async_small_thresh", 0);
 
-    xbt_cfg_register(&_sg_cfg_set, "smpi/send_is_detached_thres",
+    xbt_cfg_register(&_sg_cfg_set, "smpi/send_is_detached_thresh",
                      "Threshold of message size where MPI_Send stops behaving like MPI_Isend and becomes MPI_Ssend",
                      xbt_cfgelm_int, 1, 1, NULL, NULL);
-    xbt_cfg_setdefault_int(_sg_cfg_set, "smpi/send_is_detached_thres", 65536);
+    xbt_cfg_setdefault_int(_sg_cfg_set, "smpi/send_is_detached_thresh", 65536);
 
     xbt_cfg_register(&_sg_cfg_set, "smpi/privatize_global_variables",
                      "Boolean indicating whether we should privatize global variable at runtime.",
index debd695..3b4e63f 100644 (file)
@@ -38,7 +38,7 @@ public:
   void resume();
 };
 
-#ifdef CONTEXT_THREADS
+#ifdef HAVE_THREAD_CONTEXTS
 class BoostParallelContext : public BoostContext {
 public:
   BoostParallelContext(std::function<void()> code,
@@ -66,7 +66,7 @@ BoostContextFactory::BoostContextFactory()
 {
   BoostContext::parallel_ = SIMIX_context_is_parallel();
   if (BoostContext::parallel_) {
-#ifndef CONTEXT_THREADS
+#ifndef HAVE_THREAD_CONTEXTS
     xbt_die("No thread support for parallel context execution");
 #else
     int nthreads = SIMIX_context_get_nthreads();
@@ -81,7 +81,7 @@ BoostContextFactory::BoostContextFactory()
 
 BoostContextFactory::~BoostContextFactory()
 {
-#ifdef CONTEXT_THREADS
+#ifdef HAVE_THREAD_CONTEXTS
   if (BoostContext::parmap_) {
     xbt_parmap_destroy(BoostContext::parmap_);
     BoostContext::parmap_ = nullptr;
@@ -95,7 +95,7 @@ smx_context_t BoostContextFactory::create_context(std::function<void()>  code,
 {
   BoostContext* context = nullptr;
   if (BoostContext::parallel_)
-#ifdef CONTEXT_THREADS
+#ifdef HAVE_THREAD_CONTEXTS
     context = this->new_context<BoostParallelContext>(
       std::move(code), cleanup_func, process);
 #else
@@ -109,7 +109,7 @@ smx_context_t BoostContextFactory::create_context(std::function<void()>  code,
 
 void BoostContextFactory::run_all()
 {
-#ifdef CONTEXT_THREADS
+#ifdef HAVE_THREAD_CONTEXTS
   if (BoostContext::parallel_) {
     BoostContext::threads_working_ = 0;
     xbt_parmap_apply(BoostContext::parmap_,
@@ -161,7 +161,7 @@ BoostContext::BoostContext(std::function<void()> code,
                       smx_context_usable_stack_size,
                       smx_ctx_boost_wrapper);
   } else {
-    #if HAVE_BOOST_CONTEXT == 1
+    #if HAVE_BOOST_CONTEXTS == 1
     this->fc_ = new boost::context::fcontext_t();
     #endif
     if (BoostContext::maestro_context_ == nullptr)
@@ -171,7 +171,7 @@ BoostContext::BoostContext(std::function<void()> code,
 
 BoostContext::~BoostContext()
 {
-#if HAVE_BOOST_CONTEXT == 1
+#if HAVE_BOOST_CONTEXTS == 1
   if (!this->stack_)
     delete this->fc_;
 #endif
@@ -185,7 +185,7 @@ BoostContext::~BoostContext()
 void BoostContext::resume()
 {
   SIMIX_context_set_current(this);
-#if HAVE_BOOST_CONTEXT == 1
+#if HAVE_BOOST_CONTEXTS == 1
   boost::context::jump_fcontext(
     maestro_context_->fc_, this->fc_,
     (intptr_t) this);
@@ -215,7 +215,7 @@ void BoostSerialContext::suspend()
       maestro_context_);
   }
   SIMIX_context_set_current((smx_context_t) next_context);
-  #if HAVE_BOOST_CONTEXT == 1
+  #if HAVE_BOOST_CONTEXTS == 1
   boost::context::jump_fcontext(
     this->fc_, next_context->fc_, (intptr_t) next_context);
   #else
@@ -232,7 +232,7 @@ void BoostSerialContext::stop()
 
 // BoostParallelContext
 
-#ifdef CONTEXT_THREADS
+#ifdef HAVE_THREAD_CONTEXTS
 
 void BoostParallelContext::suspend()
 {
@@ -252,7 +252,7 @@ void BoostParallelContext::suspend()
   }
 
   SIMIX_context_set_current((smx_context_t) next_context);
-#if HAVE_BOOST_CONTEXT == 1
+#if HAVE_BOOST_CONTEXTS == 1
   boost::context::jump_fcontext(
     this->fc_, next_context->fc_, (intptr_t)next_context);
 #else
@@ -277,7 +277,7 @@ void BoostParallelContext::resume()
   workers_context_[worker_id] = worker_context;
 
   SIMIX_context_set_current(this);
-#if HAVE_BOOST_CONTEXT == 1
+#if HAVE_BOOST_CONTEXTS == 1
   boost::context::jump_fcontext(
     worker_context->fc_, this->fc_, (intptr_t) this);
 #else
index c2df0d1..62b6066 100644 (file)
@@ -36,7 +36,7 @@ protected: // static
   static unsigned long process_index_;
   static BoostContext* maestro_context_;
 protected:
-#if HAVE_BOOST_CONTEXT == 1
+#if HAVE_BOOST_CONTEXTS == 1
   boost::context::fcontext_t* fc_ = nullptr;
 #else
   boost::context::fcontext_t fc_;
index 98c07e8..9cbb2df 100644 (file)
@@ -82,7 +82,7 @@ ContextFactory* raw_factory()
 
 // ***** Loads of static stuff
 
-#ifdef CONTEXT_THREADS
+#ifdef HAVE_THREAD_CONTEXTS
 static xbt_parmap_t raw_parmap;
 static simgrid::simix::RawContext** raw_workers_context;    /* space to save the worker context in each thread */
 static unsigned long raw_threads_working;     /* number of threads that have started their work */
@@ -128,7 +128,7 @@ __asm__ (
    ".text\n"
    ".globl _raw_makecontext\n"
    "_raw_makecontext:\n"
-#elif defined(_WIN32)
+#elif defined(_XBT_WIN32)
    ".text\n"
    ".globl raw_makecontext\n"
    "raw_makecontext:\n"
@@ -164,7 +164,7 @@ __asm__ (
    ".text\n"
    ".globl _raw_swapcontext\n"
    "_raw_swapcontext:\n"
-#elif defined(_WIN32)
+#elif defined(_XBT_WIN32)
    ".text\n"
    ".globl raw_swapcontext\n"
    "raw_swapcontext:\n"
@@ -204,7 +204,7 @@ __asm__ (
 );
 #elif PROCESSOR_i686
 __asm__ (
-#if defined(APPLE) || defined(_WIN32)
+#if defined(APPLE) || defined(_XBT_WIN32)
    ".text\n"
    ".globl _raw_makecontext\n"
    "_raw_makecontext:\n"
@@ -231,7 +231,7 @@ __asm__ (
 );
 
 __asm__ (
-#if defined(APPLE) || defined(_WIN32)
+#if defined(APPLE) || defined(_XBT_WIN32)
    ".text\n"
    ".globl _raw_swapcontext\n"
    "_raw_swapcontext:\n"
@@ -259,7 +259,7 @@ __asm__ (
 
 
 /* If you implement raw contexts for other processors, don't forget to
-   update the definition of HAVE_RAWCTX in tools/cmake/CompleteInFiles.cmake */
+   update the definition of HAVE_RAW_CONTEXTS in tools/cmake/CompleteInFiles.cmake */
 
 raw_stack_t raw_makecontext(void* malloced_stack, int stack_size,
                             rawctx_entry_point_t entry_point, void* arg) {
@@ -285,7 +285,7 @@ RawContextFactory::RawContextFactory()
 #endif
   raw_context_parallel = SIMIX_context_is_parallel();
   if (raw_context_parallel) {
-#ifdef CONTEXT_THREADS
+#ifdef HAVE_THREAD_CONTEXTS
     int nthreads = SIMIX_context_get_nthreads();
     xbt_os_thread_key_create(&raw_worker_id_key);
     // TODO, lazily init
@@ -304,7 +304,7 @@ RawContextFactory::RawContextFactory()
 
 RawContextFactory::~RawContextFactory()
 {
-#ifdef CONTEXT_THREADS
+#ifdef HAVE_THREAD_CONTEXTS
   if (raw_parmap)
     xbt_parmap_destroy(raw_parmap);
   xbt_free(raw_workers_context);
@@ -379,7 +379,7 @@ void RawContextFactory::run_all_serial()
 
 void RawContextFactory::run_all_parallel()
 {
-#ifdef CONTEXT_THREADS
+#ifdef HAVE_THREAD_CONTEXTS
   raw_threads_working = 0;
   if (raw_parmap == nullptr)
     raw_parmap = xbt_parmap_new(
@@ -427,7 +427,7 @@ void RawContext::suspend_serial()
 
 void RawContext::suspend_parallel()
 {
-#ifdef CONTEXT_THREADS
+#ifdef HAVE_THREAD_CONTEXTS
   /* determine the next context */
   smx_process_t next_work = (smx_process_t) xbt_parmap_next(raw_parmap);
   RawContext* next_context = nullptr;
@@ -468,7 +468,7 @@ void RawContext::resume_serial()
 
 void RawContext::resume_parallel()
 {
-#ifdef CONTEXT_THREADS
+#ifdef HAVE_THREAD_CONTEXTS
   unsigned long worker_id = __sync_fetch_and_add(&raw_threads_working, 1);
   xbt_os_thread_set_specific(raw_worker_id_key, (void*)(uintptr_t) worker_id);
   RawContext* worker_context = (RawContext*) SIMIX_context_self();
index 5b793c5..33532bb 100644 (file)
@@ -65,7 +65,7 @@ namespace simix {
 }
 }
 
-#ifdef CONTEXT_THREADS
+#ifdef HAVE_THREAD_CONTEXTS
 static xbt_parmap_t sysv_parmap;
 static simgrid::simix::ParallelUContext** sysv_workers_context;   /* space to save the worker's context in each thread */
 static unsigned long sysv_threads_working;     /* number of threads that have started their work */
@@ -137,7 +137,7 @@ UContextFactory::UContextFactory() : ContextFactory("UContextFactory")
 {
   if (SIMIX_context_is_parallel()) {
     sysv_parallel = true;
-#ifdef CONTEXT_THREADS  /* To use parallel ucontexts a thread pool is needed */
+#ifdef HAVE_THREAD_CONTEXTS  /* To use parallel ucontexts a thread pool is needed */
     int nthreads = SIMIX_context_get_nthreads();
     sysv_parmap = nullptr;
     sysv_workers_context = xbt_new(ParallelUContext*, nthreads);
@@ -153,7 +153,7 @@ UContextFactory::UContextFactory() : ContextFactory("UContextFactory")
 
 UContextFactory::~UContextFactory()
 {
-#ifdef CONTEXT_THREADS
+#ifdef HAVE_THREAD_CONTEXTS
   if (sysv_parmap)
     xbt_parmap_destroy(sysv_parmap);
   xbt_free(sysv_workers_context);
@@ -167,7 +167,7 @@ UContextFactory::~UContextFactory()
 void UContextFactory::run_all()
 {
   if (sysv_parallel) {
-    #ifdef CONTEXT_THREADS
+    #ifdef HAVE_THREAD_CONTEXTS
       sysv_threads_working = 0;
       // Parmap_apply ensures that every working thread get an index in the
       // process_to_run array (through an atomic fetch_and_add),
@@ -306,7 +306,7 @@ void ParallelUContext::stop()
 /** Run one particular simulated process on the current thread. */
 void ParallelUContext::resume()
 {
-#ifdef CONTEXT_THREADS
+#ifdef HAVE_THREAD_CONTEXTS
   // What is my containing body?
   unsigned long worker_id = __sync_fetch_and_add(&sysv_threads_working, 1);
   // Store the number of my containing body in os-thread-specific area :
@@ -347,7 +347,7 @@ void ParallelUContext::resume()
  */
 void ParallelUContext::suspend()
 {
-#ifdef CONTEXT_THREADS
+#ifdef HAVE_THREAD_CONTEXTS
   /* determine the next context */
   // Get the next soul to embody now:
   smx_process_t next_work = (smx_process_t) xbt_parmap_next(sysv_parmap);
index baa0062..901f49f 100644 (file)
@@ -1031,15 +1031,6 @@ smx_mutex_t simcall_mutex_init(void)
   return simcall_BODY_mutex_init();
 }
 
-/**
- * \ingroup simix_synchro_management
- *
- */
-void simcall_mutex_destroy(smx_mutex_t mutex)
-{
-  simcall_BODY_mutex_destroy(mutex);
-}
-
 /**
  * \ingroup simix_synchro_management
  *
@@ -1076,15 +1067,6 @@ smx_cond_t simcall_cond_init(void)
   return simcall_BODY_cond_init();
 }
 
-/**
- * \ingroup simix_synchro_management
- *
- */
-void simcall_cond_destroy(smx_cond_t cond)
-{
-  simcall_BODY_cond_destroy(cond);
-}
-
 /**
  * \ingroup simix_synchro_management
  *
@@ -1133,15 +1115,6 @@ smx_sem_t simcall_sem_init(int capacity)
   return simcall_BODY_sem_init(capacity);
 }
 
-/**
- * \ingroup simix_synchro_management
- *
- */
-void simcall_sem_destroy(smx_sem_t sem)
-{
-  simcall_BODY_sem_destroy(sem);
-}
-
 /**
  * \ingroup simix_synchro_management
  *
index 981ded3..cdd7775 100644 (file)
@@ -941,13 +941,6 @@ static inline void simcall_mutex_init__set__result(smx_simcall_t simcall, void*
     simcall->result.dp = result;
 }
 
-static inline smx_mutex_t simcall_mutex_destroy__get__mutex(smx_simcall_t simcall) {
-  return (smx_mutex_t) simcall->args[0].dp;
-}
-static inline void simcall_mutex_destroy__set__mutex(smx_simcall_t simcall, void* arg) {
-    simcall->args[0].dp = arg;
-}
-
 static inline smx_mutex_t simcall_mutex_lock__get__mutex(smx_simcall_t simcall) {
   return (smx_mutex_t) simcall->args[0].dp;
 }
@@ -982,13 +975,6 @@ static inline void simcall_cond_init__set__result(smx_simcall_t simcall, void* r
     simcall->result.dp = result;
 }
 
-static inline smx_cond_t simcall_cond_destroy__get__cond(smx_simcall_t simcall) {
-  return (smx_cond_t) simcall->args[0].dp;
-}
-static inline void simcall_cond_destroy__set__cond(smx_simcall_t simcall, void* arg) {
-    simcall->args[0].dp = arg;
-}
-
 static inline smx_cond_t simcall_cond_signal__get__cond(smx_simcall_t simcall) {
   return (smx_cond_t) simcall->args[0].dp;
 }
@@ -1048,13 +1034,6 @@ static inline void simcall_sem_init__set__result(smx_simcall_t simcall, void* re
     simcall->result.dp = result;
 }
 
-static inline smx_sem_t simcall_sem_destroy__get__sem(smx_simcall_t simcall) {
-  return (smx_sem_t) simcall->args[0].dp;
-}
-static inline void simcall_sem_destroy__set__sem(smx_simcall_t simcall, void* arg) {
-    simcall->args[0].dp = arg;
-}
-
 static inline smx_sem_t simcall_sem_release__get__sem(smx_simcall_t simcall) {
   return (smx_sem_t) simcall->args[0].dp;
 }
index b6c206a..8f7a880 100644 (file)
@@ -1158,27 +1158,6 @@ inline static smx_mutex_t simcall_BODY_mutex_init() {
     return (smx_mutex_t) self->simcall.result.dp;
   }
   
-inline static void simcall_BODY_mutex_destroy(smx_mutex_t mutex) {
-    smx_process_t self = SIMIX_process_self();
-
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) SIMIX_mutex_destroy(mutex);
-    /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
-
-    self->simcall.call = SIMCALL_MUTEX_DESTROY;
-    memset(&self->simcall.result, 0, sizeof(self->simcall.result));
-    memset(self->simcall.args, 0, sizeof(self->simcall.args));
-    self->simcall.args[0].dp = (void*) mutex;
-    if (self != simix_global->maestro_process) {
-      XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
-                SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
-      SIMIX_process_yield(self);
-    } else {
-      SIMIX_simcall_handle(&self->simcall, 0);
-    }    
-    
-  }
-  
 inline static void simcall_BODY_mutex_lock(smx_mutex_t mutex) {
     smx_process_t self = SIMIX_process_self();
 
@@ -1263,27 +1242,6 @@ inline static smx_cond_t simcall_BODY_cond_init() {
     return (smx_cond_t) self->simcall.result.dp;
   }
   
-inline static void simcall_BODY_cond_destroy(smx_cond_t cond) {
-    smx_process_t self = SIMIX_process_self();
-
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) SIMIX_cond_destroy(cond);
-    /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
-
-    self->simcall.call = SIMCALL_COND_DESTROY;
-    memset(&self->simcall.result, 0, sizeof(self->simcall.result));
-    memset(self->simcall.args, 0, sizeof(self->simcall.args));
-    self->simcall.args[0].dp = (void*) cond;
-    if (self != simix_global->maestro_process) {
-      XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
-                SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
-      SIMIX_process_yield(self);
-    } else {
-      SIMIX_simcall_handle(&self->simcall, 0);
-    }    
-    
-  }
-  
 inline static void simcall_BODY_cond_signal(smx_cond_t cond) {
     smx_process_t self = SIMIX_process_self();
 
@@ -1392,27 +1350,6 @@ inline static smx_sem_t simcall_BODY_sem_init(unsigned int capacity) {
     return (smx_sem_t) self->simcall.result.dp;
   }
   
-inline static void simcall_BODY_sem_destroy(smx_sem_t sem) {
-    smx_process_t self = SIMIX_process_self();
-
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) SIMIX_sem_destroy(sem);
-    /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
-
-    self->simcall.call = SIMCALL_SEM_DESTROY;
-    memset(&self->simcall.result, 0, sizeof(self->simcall.result));
-    memset(self->simcall.args, 0, sizeof(self->simcall.args));
-    self->simcall.args[0].dp = (void*) sem;
-    if (self != simix_global->maestro_process) {
-      XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
-                SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
-      SIMIX_process_yield(self);
-    } else {
-      SIMIX_simcall_handle(&self->simcall, 0);
-    }    
-    
-  }
-  
 inline static void simcall_BODY_sem_release(smx_sem_t sem) {
     smx_process_t self = SIMIX_process_self();
 
index 9c0b346..a523f45 100644 (file)
@@ -69,18 +69,15 @@ typedef enum {
   SIMCALL_COMM_GET_SRC_PROC,
   SIMCALL_COMM_GET_DST_PROC,
   SIMCALL_MUTEX_INIT,
-  SIMCALL_MUTEX_DESTROY,
   SIMCALL_MUTEX_LOCK,
   SIMCALL_MUTEX_TRYLOCK,
   SIMCALL_MUTEX_UNLOCK,
   SIMCALL_COND_INIT,
-  SIMCALL_COND_DESTROY,
   SIMCALL_COND_SIGNAL,
   SIMCALL_COND_WAIT,
   SIMCALL_COND_WAIT_TIMEOUT,
   SIMCALL_COND_BROADCAST,
   SIMCALL_SEM_INIT,
-  SIMCALL_SEM_DESTROY,
   SIMCALL_SEM_RELEASE,
   SIMCALL_SEM_WOULD_BLOCK,
   SIMCALL_SEM_ACQUIRE,
index 9b9b802..418256c 100644 (file)
@@ -74,18 +74,15 @@ const char* simcall_names[] = {
   "SIMCALL_COMM_GET_SRC_PROC",
   "SIMCALL_COMM_GET_DST_PROC",
   "SIMCALL_MUTEX_INIT",
-  "SIMCALL_MUTEX_DESTROY",
   "SIMCALL_MUTEX_LOCK",
   "SIMCALL_MUTEX_TRYLOCK",
   "SIMCALL_MUTEX_UNLOCK",
   "SIMCALL_COND_INIT",
-  "SIMCALL_COND_DESTROY",
   "SIMCALL_COND_SIGNAL",
   "SIMCALL_COND_WAIT",
   "SIMCALL_COND_WAIT_TIMEOUT",
   "SIMCALL_COND_BROADCAST",
   "SIMCALL_SEM_INIT",
-  "SIMCALL_SEM_DESTROY",
   "SIMCALL_SEM_RELEASE",
   "SIMCALL_SEM_WOULD_BLOCK",
   "SIMCALL_SEM_ACQUIRE",
@@ -375,11 +372,6 @@ case SIMCALL_MUTEX_INIT:
       SIMIX_simcall_answer(simcall);
       break;  
 
-case SIMCALL_MUTEX_DESTROY:
-       SIMIX_mutex_destroy((smx_mutex_t) simcall->args[0].dp);
-      SIMIX_simcall_answer(simcall);
-      break;  
-
 case SIMCALL_MUTEX_LOCK:
        simcall_HANDLER_mutex_lock(simcall , (smx_mutex_t) simcall->args[0].dp);
        break;  
@@ -399,11 +391,6 @@ case SIMCALL_COND_INIT:
       SIMIX_simcall_answer(simcall);
       break;  
 
-case SIMCALL_COND_DESTROY:
-       SIMIX_cond_destroy((smx_cond_t) simcall->args[0].dp);
-      SIMIX_simcall_answer(simcall);
-      break;  
-
 case SIMCALL_COND_SIGNAL:
        SIMIX_cond_signal((smx_cond_t) simcall->args[0].dp);
       SIMIX_simcall_answer(simcall);
@@ -427,11 +414,6 @@ case SIMCALL_SEM_INIT:
       SIMIX_simcall_answer(simcall);
       break;  
 
-case SIMCALL_SEM_DESTROY:
-       SIMIX_sem_destroy((smx_sem_t) simcall->args[0].dp);
-      SIMIX_simcall_answer(simcall);
-      break;  
-
 case SIMCALL_SEM_RELEASE:
        simcall_HANDLER_sem_release(simcall , (smx_sem_t) simcall->args[0].dp);
       SIMIX_simcall_answer(simcall);
index 60b8c72..43299df 100644 (file)
@@ -103,20 +103,17 @@ Func - comm_get_src_proc (void*, smx_process_t) (comm, void*, smx_synchro_t)
 Func - comm_get_dst_proc (void*, smx_process_t) (comm, void*, smx_synchro_t)
 
 Func H mutex_init (void*, smx_mutex_t)
-Proc - mutex_destroy (void) (mutex, void*, smx_mutex_t)
 Blck H mutex_lock (void) (mutex, void*, smx_mutex_t)
 Func H mutex_trylock (int) (mutex, void*, smx_mutex_t)
 Proc H mutex_unlock (void) (mutex, void*, smx_mutex_t)
 
 Func - cond_init (void*, smx_cond_t)
-Proc - cond_destroy (void) (cond, void*, smx_cond_t)
 Proc - cond_signal (void) (cond, void*, smx_cond_t)
 Blck H cond_wait (void) (cond, void*, smx_cond_t) (mutex, void*, smx_mutex_t)
 Blck H cond_wait_timeout (void) (cond, void*, smx_cond_t) (mutex, void*, smx_mutex_t) (timeout, double)
 Proc - cond_broadcast (void) (cond, void*, smx_cond_t)
 
 Func - sem_init (void*, smx_sem_t) (capacity, unsigned int)
-Proc - sem_destroy (void) (sem, void*, smx_sem_t)
 Proc H sem_release (void) (sem, void*, smx_sem_t)
 Func H sem_would_block (int) (sem, void*, smx_sem_t)
 Blck H sem_acquire (void) (sem, void*, smx_sem_t)
index 4a9c6ae..a07051b 100644 (file)
@@ -17,7 +17,7 @@
 #include "simgrid/modelchecker.h"
 
 
-#ifdef _WIN32
+#ifdef _XBT_WIN32
 #include <windows.h>
 #include <malloc.h>
 #else
@@ -56,7 +56,7 @@ static e_xbt_parmap_mode_t smx_parallel_synchronization_mode = XBT_PARMAP_DEFAUL
  */
 void SIMIX_context_mod_init(void)
 {
-#if defined(CONTEXT_THREADS) && !defined(HAVE_THREAD_LOCAL_STORAGE)
+#if defined(HAVE_THREAD_CONTEXTS) && !defined(HAVE_THREAD_LOCAL_STORAGE)
   /* the __thread storage class is not available on this platform:
    * use getspecific/setspecific instead to store the current context in each thread */
   xbt_os_thread_key_create(&smx_current_context_key);
@@ -66,37 +66,37 @@ void SIMIX_context_mod_init(void)
     if (simgrid::simix::factory_initializer)
       simix_global->context_factory = simgrid::simix::factory_initializer();
     else { /* use the factory specified by --cfg=contexts/factory:value */
-#if defined(CONTEXT_THREADS)
+#if defined(HAVE_THREAD_CONTEXTS)
       if (!strcmp(smx_context_factory_name, "thread"))
         simix_global->context_factory = simgrid::simix::thread_factory();
 #else
       if (0);
 #endif
-#ifdef CONTEXT_UCONTEXT
+#ifdef HAVE_UCONTEXT_CONTEXTS
       else if (!strcmp(smx_context_factory_name, "ucontext"))
         simix_global->context_factory = simgrid::simix::sysv_factory();
 #endif
-#ifdef HAVE_RAWCTX
+#ifdef HAVE_RAW_CONTEXTS
       else if (!strcmp(smx_context_factory_name, "raw"))
         simix_global->context_factory = simgrid::simix::raw_factory();
 #endif
-#ifdef HAVE_BOOST_CONTEXT
+#ifdef HAVE_BOOST_CONTEXTS
       else if (!strcmp(smx_context_factory_name, "boost"))
         simix_global->context_factory = simgrid::simix::boost_factory();
 #endif
       else {
         XBT_ERROR("Invalid context factory specified. Valid factories on this machine:");
-#ifdef HAVE_RAWCTX
+#ifdef HAVE_RAW_CONTEXTS
         XBT_ERROR("  raw: high performance context factory implemented specifically for SimGrid");
 #else
         XBT_ERROR("  (raw contexts were disabled at compilation time on this machine -- check configure logs for details)");
 #endif
-#ifdef CONTEXT_UCONTEXT
+#ifdef HAVE_UCONTEXT_CONTEXTS
         XBT_ERROR("  ucontext: classical system V contexts (implemented with makecontext, swapcontext and friends)");
 #else
         XBT_ERROR("  (ucontext was disabled at compilation time on this machine -- check configure logs for details)");
 #endif
-#ifdef HAVE_BOOST_CONTEXT
+#ifdef HAVE_BOOST_CONTEXTS
         XBT_ERROR("  boost: this uses the boost libraries context implementation");
 #else
         XBT_ERROR("  (boost was disabled at compilation time on this machine -- check configure logs for details. Did you install the libboost-context-dev package?)");
@@ -238,7 +238,7 @@ void SIMIX_context_set_nthreads(int nb_threads) {
   }   
   
   if (nb_threads > 1) {
-#ifndef CONTEXT_THREADS
+#ifndef HAVE_THREAD_CONTEXTS
     THROWF(arg_error, 0, "The thread factory cannot be run in parallel");
 #endif
   }
index 6078923..9ced079 100644 (file)
@@ -155,7 +155,6 @@ void SIMIX_create_maestro_process()
   maestro->context = SIMIX_context_new(NULL, 0, NULL, NULL, maestro);
   maestro->simcall.issuer = maestro;
   simix_global->maestro_process = maestro;
-  return;
 }
 /**
  * \brief Stops a process.
index d6da804..9cf2592 100644 (file)
@@ -32,16 +32,13 @@ XBT_PRIVATE void SIMIX_synchro_stop_waiting(smx_process_t process, smx_simcall_t
 XBT_PRIVATE void SIMIX_synchro_destroy(smx_synchro_t synchro);
 
 XBT_PRIVATE smx_mutex_t SIMIX_mutex_init(void);
-XBT_PRIVATE void SIMIX_mutex_destroy(smx_mutex_t mutex);
 XBT_PRIVATE int SIMIX_mutex_trylock(smx_mutex_t mutex, smx_process_t issuer);
 XBT_PRIVATE void SIMIX_mutex_unlock(smx_mutex_t mutex, smx_process_t issuer);
 
 XBT_PRIVATE smx_cond_t SIMIX_cond_init(void);
-XBT_PRIVATE void SIMIX_cond_destroy(smx_cond_t cond);
 XBT_PRIVATE void SIMIX_cond_broadcast(smx_cond_t cond);
 XBT_PRIVATE void SIMIX_cond_signal(smx_cond_t cond);
 
-XBT_PRIVATE void SIMIX_sem_destroy(smx_sem_t sem);
 XBT_PRIVATE XBT_PRIVATE smx_sem_t SIMIX_sem_init(unsigned int value);
 XBT_PRIVATE void SIMIX_sem_release(smx_sem_t sem);
 XBT_PRIVATE int SIMIX_sem_would_block(smx_sem_t sem);
diff --git a/src/smpi/fixsrc.pl b/src/smpi/fixsrc.pl
deleted file mode 100755 (executable)
index 8844d20..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/usr/bin/env perl
-
-# Copyright (c) 2011, 2014. The SimGrid Team.
-# All rights reserved.
-
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the license (GNU LGPL) which comes with this package.
-
-# Add include for mandatory header file
-print "#include <smpi_cocci.h>\n";
-
-# FIXME: here we make the assumption that people don't do things like put
-# multiple statements on the same line after a declaration, but separated by
-# semicolons. It's a reasonable assumption for the time being, but technically
-# it could cause problems for some code.
-
-OUTER: while ($line = <STDIN>) {
-    if ($line =~ /SMPI_VARINIT/) {
-        do {
-            chomp $line;         # kill carriage return
-            $line =~ s/\s+/ /g;  # remove excessive whitespace added by spatch
-            while ($line =~ s/(SMPI_VARINIT[A-Z0-9_]*?\(.*?\))//) {
-                print "$1\n";
-            } 
-
-            # if varinit continues on to next line
-            if ($line =~ /SMPI_VARINIT/) {
-                # should only happen for bad code...
-                if (!($nextline = <STDIN>)) {
-                    last OUTER;
-                }
-                $line .= $nextline;
-
-            }
-        } while ($line =~ /SMPI_VARINIT/);
-    } else {
-        print $line;
-    }
-}
diff --git a/src/smpi/myprintloc.cocci b/src/smpi/myprintloc.cocci
deleted file mode 100644 (file)
index bea1b79..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-
-@r@
-/* Matching a declaration, ie rewriting site candidate 
-   Disqualify the candidate
-   ----------------- */
-type T;
-position p1;
-identifier id;
-@@
-
-T id@p1;
-
-
-
-
-@funcdecl@
-# Matching a /function/ declaration. 
-# Disqualify the candidate
-#-----------------
-type T;
-position r.p1;
-identifier id;
-@@
- T id@p1(...) {...}
-
-
-
-
-@funcproto@
-# Matching a function prototype w/o body. 
-# Disqualify the candidate
-#-----------------
-type T;
-position r.p1;
-identifier id;
-@@
- T id@p1(...);
-
-@localdeclaration@
-# Matching a declaration at the top level of a function. 
-# Disqualify the candidate
-#-----------------
-type T1,T2;
-position r.p1;
-identifier id1,id2;
-@@
-
-T1 id1(...) {
-  ...
-  T2 id2@p1;
-  ...
-}
-
-@localinnerdeclaration@
-# The next rule is there to make sure that we are not speaking of a
-# local variable declared in an inner block. I don't like it at all:
-# It is redundent and gives false negative on the foreach macros that
-# get often declared in the code. Example in examples/gras/spawn.c:
-# 
-# int server() {
-#   ...
-#   xbt_dynar_foreach(chunk->primes,cursor,data) {
-#     char number[100];
-#     ...
-#   }
-#   ...
-# } 
-#
-# Do I really need to complicate this rule further to add every macro
-# that we use in our C, or can it be merged with the previous one by
-# saying something like "in a function, at whatever level of nesting"?
-
-type T1,T2;
-position r.p1;
-identifier id1,id2;
-expression e1,e2,e3;
-@@
-
-T1 id1(...) {
-  ...
-( 
-  for (e1;e2;e3) { ... T2 id2@p1; ... }
-| 
-  for (;e2;e3) { ... T2 id2@p1; ... }
-| 
-  for (e1;;e3) { ... T2 id2@p1; ... }
-| 
-  for (e1;e2;) { ... T2 id2@p1; ... }
-| 
-  for (e1;;) { ... T2 id2@p1; ... }
-| 
-  for (;e2;) { ... T2 id2@p1; ... }
-| 
-  for (;;e3) { ... T2 id2@p1; ... }
-| 
-  for (;;) { ... T2 id2@p1; ... }
-| 
-  while (e1) { ... T2 id2@p1; ... }
-| 
-  do { ... T2 id2@p1; ... } while (e1);
-)
-  ...
-}
-
-
-
-@script:python depends on r 
-                          && !funcdecl 
-                         && !funcproto 
-                         && !localdeclaration 
-                         && !localinnerdeclaration@
-
-# This rule is only a debugging rule, to print the sites where the
-# change must be applied
-
-p1 << r.p1;
-T  << r.T;
-id << r.id;
-@@
-
-c1 = cocci.combine(id,p1)
-print "1. symbol %s of type \"%s\" at %s:%s" % (id,T,c1.location.line,c1.location.column)
diff --git a/src/smpi/patch_source.sh b/src/smpi/patch_source.sh
deleted file mode 100755 (executable)
index 38fd745..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/bash
-
-# Copyright (c) 2011, 2014. The SimGrid Team.
-# All rights reserved.
-
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the license (GNU LGPL) which comes with this package.
-
-INFILE="$1"
-OUTFILE="$2"
-SPFILE="replace_globals.cocci"
-TMPFILE=`mktemp ${OUTFILE}.XXXX`
-
-trap "rm -f ${TMPFILE}" EXIT
-spatch -sp_file ${SPFILE} ${INFILE} -o ${TMPFILE} >/dev/null 2>/dev/null
-./fixsrc.pl < ${TMPFILE} > ${OUTFILE}
index 6f65720..44528e6 100644 (file)
@@ -15,7 +15,6 @@
 #include "simgrid/simix.h"
 #include "src/include/smpi/smpi_interface.h"
 #include "smpi/smpi.h"
-#include "smpi/smpi_cocci.h"
 #include "src/instr/instr_private.h"
 
 SG_BEGIN_DECL()
diff --git a/src/smpi/replace_globals.cocci b/src/smpi/replace_globals.cocci
deleted file mode 100644 (file)
index 00a6ca5..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-// FIXME: seems like cocci has problems manipulating the declarations, at least
-// when there is more than one on the same line. We already need perl to split
-// up the declarations after the fact, is there another tool we can use to patch
-// up and match the declarations? In that case we could consider dropping cocci,
-// or just using it to alter global variable accesses.
-//
-// FIXME: problems
-//   - array declarations not properly matched...can fix, but then can't have
-//   multiple declarations on one line
-//   - does not match array initializers
-//   - probably won't fix structure declarations with initialization either
-
-// Function prototype looks like variable dec, but has parentheses
-@funcproto@
-type T;
-identifier func;
-position p;
-@@
-T@p func(...);
-
-// define a local variable declaration as one at some level of nesting
-@localvardecl@
-type T;
-identifier var;
-position p;
-expression E;
-@@
-<...
-( // default case
-T@p
-var
-;
-| // variable has initializer
-T@p
-var = E
-;
-)
-...>
-
-// define a global variable declaration as one that is neither a function
-// prototype nor a local variable declaration
-@globalvardecl@
-type T;
-identifier var;
-position p != { funcproto.p, localvardecl.p };
-expression value;
-// expression size;
-@@
-( // default case
-T@p 
-- var
-+ *var = SMPI_VARINIT_GLOBAL(var, T)
-;
-| // variable has initializer (not a struct or array)
-T@p
-- var = value 
-+ *var = SMPI_VARINIT_GLOBAL_AND_SET(var, T, value)
-;
-//| // array of specified size
-//T@p // FIXME: matches, but complains if more than one decl on a line...
-//- var[size]
-//+ *var[size] = SMPI_VARINIT_GLOBAL_ARRAY(T, size)
-//;
-//| // array of specified size with initializer
-//T@p // FIXME: how to match initializer?
-//- var[size] = { ... }
-//+ *var[] = SMPI_VARINIT_GLOBAL_ARRAY_AND_SET(T, size, { ... })
-//;
-//| // array without specified size, but with initializer
-//T@p // FIXME: how to match initializer? how to figure out size?
-//- var[] = { ... }
-//+ *var[] = SMPI_VARINIT_GLOBAL_ARRAY_AND_SET(T, size, { ... }) // size = ?
-//;
-//| struct with initializer?
-)
-
-// rewrite access to global variables based on name, but avoid the declaration
-// and local variables that might have the same name
-@rewriteglobalaccess@
-type T;
-local idexpression lvar;
-identifier globalvardecl.var;
-@@
-<...
-( // local variable
-lvar
-| // rewrite access
-+SMPI_VARGET_GLOBAL(
-var
-+)
-)
-...>
-
-// define a local static variable declaration as one at some level of nesting
-// starting with the word static (exceptions?)
-@staticvardecl@
-type T;
-identifier func, var;
-expression value;
-@@
-func(...) {
-...
-( // default case
-static T
-- var
-+ *var = SMPI_VARINIT_STATIC(T, var)
-;
-| // variable has initializer (not a struct or array)
-T
-- var = value 
-+ *var = SMPI_VARINIT_STATIC_AND_SET(var, T, value)
-;
-)
-...
-}
-
-// 
-@rewritestaticaccess@
-type T;
-identifier staticvardecl.func, staticvardecl.var;
-@@
-func(...) {
-<...
-( // declaration
-T
-var
-;
-| // rewrite access
-+SMPI_VARGET_STATIC(
-var
-+)
-)
-...>
-}
diff --git a/src/smpi/replace_static.cocci b/src/smpi/replace_static.cocci
deleted file mode 100644 (file)
index cda1de2..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-// FIXME: why can't I just define a static local vardecl the same way as a
-// normal local vardecl?
-
-// Function prototype looks like variable dec, but has parentheses
-@funcproto@
-type T;
-identifier func;
-position p;
-@@
-T@p func(...);
-
-// Define a local variable as one whose declaration is encased in brackets
-@localvardecl@
-type T;
-identifier var;
-position p;
-expression E;
-@@
-{
-<...
-(
-T@p
-var
-;
-|
-T@p
-var = E
-;
-)
-...>
-}
-
-// global variable is one whose declaration is neither local nor a function
-// prototype
-@globalvardecl@
-type T;
-identifier var;
-position p != { localvardecl.p, funcproto.p };
-expression value;
-// expression size;
-@@
-(
-T@p var;
-|
-T@p var = value;
-)
-
-// local static decl is a nonglobal static decl...
-@localstaticvardecl@
-type T;
-identifier var;
-position p != globalvardecl.p;
-expression value;
-@@
-(
-static T@p
-- var
-+ *var = SMPI_VARINIT_STATIC(var, T)
-;
-|
-static T@p
-- var = value
-+ *var = SMPI_VARINIT_STATIC_AND_SET(var, T, value)
-;
-)
-
-// FIXME: add varaccess...
index 21a8356..568168b 100644 (file)
@@ -460,7 +460,7 @@ void smpi_mpi_start(MPI_Request request)
     }
 
     void* buf = request->buf;
-    if ( (! (request->flags & SSEND)) && (request->size < sg_cfg_get_int("smpi/send_is_detached_thres"))) {
+    if ( (! (request->flags & SSEND)) && (request->size < sg_cfg_get_int("smpi/send_is_detached_thresh"))) {
       void *oldbuf = NULL;
       request->detached = 1;
       XBT_DEBUG("Send request %p is detached", request);
index 7b47526..692d2eb 100644 (file)
@@ -411,7 +411,7 @@ static void smpi_check_options(){
   //check correctness of MPI parameters
 
    xbt_assert(sg_cfg_get_int("smpi/async_small_thresh") <=
-              sg_cfg_get_int("smpi/send_is_detached_thres"));
+              sg_cfg_get_int("smpi/send_is_detached_thresh"));
 
    if (sg_cfg_is_default_value("smpi/running_power")) {
      XBT_INFO("You did not set the power of the host running the simulation.  "
index 475e236..a857298 100644 (file)
@@ -185,6 +185,8 @@ Cpu::~Cpu()
   }
   if (p_constraintCoreId)
     xbt_free(p_constraintCoreId);
+  if (p_speedPeakList)
+    xbt_dynar_free(&p_speedPeakList);
 }
 
 double Cpu::getCurrentPowerPeak()
index 63701e2..a59737b 100644 (file)
@@ -36,11 +36,11 @@ CpuTiTrace::CpuTiTrace(tmgr_trace_t speedTrace)
   double time = 0;
   int i = 0;
   p_timePoints = (double*) xbt_malloc0(sizeof(double) *
-                  (xbt_dynar_length(speedTrace->s_list.event_list) + 1));
+                  (xbt_dynar_length(speedTrace->event_list) + 1));
   p_integral = (double*) xbt_malloc0(sizeof(double) *
-                  (xbt_dynar_length(speedTrace->s_list.event_list) + 1));
-  m_nbPoints = xbt_dynar_length(speedTrace->s_list.event_list) + 1;
-  xbt_dynar_foreach(speedTrace->s_list.event_list, cpt, val) {
+                  (xbt_dynar_length(speedTrace->event_list) + 1));
+  m_nbPoints = xbt_dynar_length(speedTrace->event_list) + 1;
+  xbt_dynar_foreach(speedTrace->event_list, cpt, val) {
     p_timePoints[i] = time;
     p_integral[i] = integral;
     integral += val.delta * val.value;
@@ -302,7 +302,7 @@ double CpuTiTgmr::getPowerScale(double a)
   reduced_a = a - floor(a / m_lastTime) * m_lastTime;
   point = p_trace->binarySearch(p_trace->p_timePoints, reduced_a, 0,
                                 p_trace->m_nbPoints - 1);
-  xbt_dynar_get_cpy(p_speedTrace->s_list.event_list, point, &val);
+  xbt_dynar_get_cpy(p_speedTrace->event_list, point, &val);
   return val.value;
 }
 
@@ -330,8 +330,8 @@ CpuTiTgmr::CpuTiTgmr(tmgr_trace_t speedTrace, double value)
   }
 
   /* only one point available, fixed trace */
-  if (xbt_dynar_length(speedTrace->s_list.event_list) == 1) {
-    xbt_dynar_get_cpy(speedTrace->s_list.event_list, 0, &val);
+  if (xbt_dynar_length(speedTrace->event_list) == 1) {
+    xbt_dynar_get_cpy(speedTrace->event_list, 0, &val);
     m_type = TRACE_FIXED;
     m_value = val.value;
     return;
@@ -341,7 +341,7 @@ CpuTiTgmr::CpuTiTgmr(tmgr_trace_t speedTrace, double value)
   p_speedTrace = speedTrace;
 
   /* count the total time of trace file */
-  xbt_dynar_foreach(speedTrace->s_list.event_list, cpt, val) {
+  xbt_dynar_foreach(speedTrace->event_list, cpt, val) {
     total_time += val.delta;
   }
   p_trace = new CpuTiTrace(speedTrace);
@@ -499,21 +499,7 @@ void CpuTiModel::addTraces()
     xbt_assert(cpu, "Host %s undefined", elm);
     xbt_assert(trace, "Trace %s undefined", trace_name);
 
-    XBT_DEBUG("Add speed trace: %s to CPU(%s)", trace_name, elm);
-    if (cpu->p_availTrace)
-      delete cpu->p_availTrace;
-
-    cpu->p_availTrace = new CpuTiTgmr(trace, cpu->m_speedScale);
-
-    /* add a fake trace event if periodicity == 0 */
-    if (trace && xbt_dynar_length(trace->s_list.event_list) > 1) {
-      s_tmgr_event_t val;
-      xbt_dynar_get_cpy(trace->s_list.event_list,
-                        xbt_dynar_length(trace->s_list.event_list) - 1, &val);
-      if (val.delta == 0) {
-        cpu->set_speed_trace(tmgr_empty_trace_new());
-      }
-    }
+    cpu->set_speed_trace(trace);
   }
 }
 
@@ -539,11 +525,11 @@ CpuTi::CpuTi(CpuTiModel *model, simgrid::s4u::Host *host, xbt_dynar_t speedPeak,
   if (stateTrace)
     p_stateEvent = future_evt_set->add_trace(stateTrace, 0.0, this);
 
-  if (speedTrace && xbt_dynar_length(speedTrace->s_list.event_list) > 1) {
+  if (speedTrace && xbt_dynar_length(speedTrace->event_list) > 1) {
        s_tmgr_event_t val;
     // add a fake trace event if periodicity == 0
-    xbt_dynar_get_cpy(speedTrace->s_list.event_list,
-                      xbt_dynar_length(speedTrace->s_list.event_list) - 1, &val);
+    xbt_dynar_get_cpy(speedTrace->event_list,
+                      xbt_dynar_length(speedTrace->event_list) - 1, &val);
     if (val.delta == 0) {
       p_speedEvent =
           future_evt_set->add_trace(tmgr_empty_trace_new(), p_availTrace->m_lastTime, this);
@@ -557,6 +543,23 @@ CpuTi::~CpuTi()
   delete p_availTrace;
   delete p_actionSet;
 }
+void CpuTi::set_speed_trace(tmgr_trace_t trace)
+{
+  if (p_availTrace)
+    delete p_availTrace;
+
+  p_availTrace = new CpuTiTgmr(trace, m_speedScale);
+
+  /* add a fake trace event if periodicity == 0 */
+  if (trace && xbt_dynar_length(trace->event_list) > 1) {
+    s_tmgr_event_t val;
+    xbt_dynar_get_cpy(trace->event_list,
+                      xbt_dynar_length(trace->event_list) - 1, &val);
+    if (val.delta == 0) {
+      p_speedEvent = future_evt_set->add_trace(tmgr_empty_trace_new(), 0.0, this);
+    }
+  }
+}
 
 void CpuTi::updateState(tmgr_trace_iterator_t event_type,
                         double value, double date)
@@ -576,8 +579,8 @@ void CpuTi::updateState(tmgr_trace_iterator_t event_type,
     modified(true);
 
     speedTrace = p_availTrace->p_speedTrace;
-    xbt_dynar_get_cpy(speedTrace->s_list.event_list,
-                      xbt_dynar_length(speedTrace->s_list.event_list) - 1, &val);
+    xbt_dynar_get_cpy(speedTrace->event_list,
+                      xbt_dynar_length(speedTrace->event_list) - 1, &val);
     /* free old trace */
     delete p_availTrace;
     m_speedScale = val.value;
index 9c46c46..a9820c4 100644 (file)
@@ -118,6 +118,8 @@ public:
         int initiallyOn, tmgr_trace_t stateTrace) ;
   ~CpuTi();
 
+  void set_speed_trace(tmgr_trace_t trace);
+
   void updateState(tmgr_trace_iterator_t event_type, double value, double date) override;
   void updateActionsFinishTime(double now);
   bool isUsed() override;
index 9197c4d..298496a 100644 (file)
@@ -202,10 +202,9 @@ L07Action::L07Action(Model *model, int host_nb,
   int nb_used_host = 0; /* Only the hosts with something to compute (>0 flops) are counted) */
   double latency = 0.0;
 
-
   this->p_netcardList->reserve(host_nb);
   for (int i = 0; i<host_nb; i++)
-         this->p_netcardList->push_back(host_list[i]->pimpl_netcard);
+    this->p_netcardList->push_back(host_list[i]->pimpl_netcard);
 
   /* Compute the number of affected resources... */
   if(bytes_amount != NULL) {
@@ -213,20 +212,17 @@ L07Action::L07Action(Model *model, int host_nb,
 
     for (int i = 0; i < host_nb; i++) {
       for (int j = 0; j < host_nb; j++) {
-        xbt_dynar_t route=NULL;
 
         if (bytes_amount[i * host_nb + j] > 0) {
           double lat=0.0;
-          unsigned int cpt;
-          void *_link;
-          LinkL07 *link;
+          xbt_dynar_t route=NULL;
 
-          routing_platf->getRouteAndLatency((*this->p_netcardList)[i], (*this->p_netcardList)[j],
-                                                        &route, &lat);
+          routing_platf->getRouteAndLatency((*p_netcardList)[i], (*p_netcardList)[j], &route, &lat);
           latency = MAX(latency, lat);
 
+          void *_link;
           xbt_dynar_foreach(route, cpt, _link) {
-            link = static_cast<LinkL07*>(_link);
+            LinkL07 *link = static_cast<LinkL07*>(_link);
             xbt_dict_set(ptask_parallel_task_link_set, link->getName(), link, NULL);
           }
         }
@@ -261,15 +257,15 @@ L07Action::L07Action(Model *model, int host_nb,
   if(bytes_amount != NULL) {
     for (int i = 0; i < host_nb; i++) {
       for (int j = 0; j < host_nb; j++) {
-        void *_link;
 
         xbt_dynar_t route=NULL;
         if (bytes_amount[i * host_nb + j] == 0.0)
           continue;
 
-        routing_platf->getRouteAndLatency((*this->p_netcardList)[i], (*this->p_netcardList)[j],
+        routing_platf->getRouteAndLatency((*p_netcardList)[i], (*p_netcardList)[j],
                                                     &route, NULL);
 
+        void *_link;
         xbt_dynar_foreach(route, cpt, _link) {
           LinkL07 *link = static_cast<LinkL07*>(_link);
           lmm_expand_add(model->getMaxminSystem(), link->getConstraint(),
@@ -283,6 +279,7 @@ L07Action::L07Action(Model *model, int host_nb,
     this->setCost(1.0);
     this->setRemains(0.0);
   }
+  xbt_free(host_list);
 }
 
 Action *NetworkL07Model::communicate(NetCard *src, NetCard *dst,
@@ -551,6 +548,7 @@ void LinkL07::updateLatency(double value, double date)
  **********/
 
 L07Action::~L07Action(){
+  delete p_netcardList;
   free(p_communicationAmount);
   free(p_computationAmount);
 }
@@ -594,7 +592,7 @@ int L07Action::unref()
   m_refcount--;
   if (!m_refcount) {
     if (action_hook.is_linked())
-         p_stateSet->erase(p_stateSet->iterator_to(*this));
+      p_stateSet->erase(p_stateSet->iterator_to(*this));
     if (getVariable())
       lmm_variable_free(getModel()->getMaxminSystem(), getVariable());
     delete this;
index fc470a5..902e48f 100644 (file)
@@ -1166,7 +1166,7 @@ XBT_INLINE lmm_constraint_t lmm_get_next_active_constraint(lmm_system_t
 }
 
 #ifdef HAVE_LATENCY_BOUND_TRACKING
-XBT_INLINE int lmm_is_variable_limited_by_latency(lmm_variable_t var)
+XBT_PUBLIC(int) lmm_is_variable_limited_by_latency(lmm_variable_t var)
 {
   return (double_equals(var->bound, var->value, var->bound*sg_maxmin_precision));
 }
index 876546d..71ceece 100644 (file)
@@ -5,18 +5,11 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "network_constant.hpp"
-#include "surf/random_mgr.h"
 
 #include "host_interface.hpp"
 #include "src/surf/platform.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_network);
-static int host_number_int = 0;
-
-static void netcste_parse_nolink(sg_platf_link_cbarg_t link){
-       xbt_die("There is no link in the Constant network model. "
-                       "Please remove any link from your platform (and switch to routing='None')");
-}
 
 /*********
  * Model *
@@ -25,16 +18,14 @@ void surf_network_model_init_Constant()
 {
   xbt_assert(surf_network_model == NULL);
   surf_network_model = new simgrid::surf::NetworkConstantModel();
+  xbt_dynar_push(all_existing_models, &surf_network_model);
 
   routing_model_create(NULL);
 
-  simgrid::s4u::Host::onCreation.connect([](simgrid::s4u::Host&) {
-    host_number_int++;
+  simgrid::surf::on_link.connect([](sg_platf_link_cbarg_t link){
+      xbt_die("There is no link in the Constant network model. "
+          "Please remove any link from your platform (and switch to routing='None')");
   });
-  simgrid::surf::on_link.connect(netcste_parse_nolink);
-
-  simgrid::surf::Model *model = surf_network_model;
-  xbt_dynar_push(all_existing_models, &model);
 }
 
 namespace simgrid {
diff --git a/src/surf/platf_generator.c b/src/surf/platf_generator.c
deleted file mode 100644 (file)
index 65c9a3d..0000000
+++ /dev/null
@@ -1,743 +0,0 @@
-/* Copyright (c) 2012, 2014-2015. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include "simgrid/platf_generator.h"
-#include "platf_generator_private.h"
-#include "xbt.h"
-#include "xbt/RngStream.h"
-#include "surf/simgrid_dtd.h"
-#include "surf_private.h"
-#include <math.h>
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(platf_generator, surf, "Platform Generator");
-
-static xbt_graph_t platform_graph = NULL;
-static xbt_dynar_t promoter_dynar = NULL;
-static xbt_dynar_t labeler_dynar = NULL;
-
-static RngStream rng_stream = NULL;
-
-static unsigned long last_link_id = 0;
-
-xbt_graph_t platf_graph_get(void) {
-  // We need some debug, so let's add this function
-  // WARNING : should be removed when it becomes useless
-  return platform_graph;
-}
-
-/**
- * \brief Set the seed of the platform generator RngStream
- *
- * This RngStream is used to generate all the random values needed to
- * generate the platform
- *
- * \param seed A array of six integer; if NULL, the default seed will be used.
- */
-void platf_random_seed(unsigned long seed[6]) {
-
-  if(rng_stream == NULL) {
-    //stream not created yet, we do it now
-    rng_stream = RngStream_CreateStream(NULL);
-  }
-  if(seed != NULL) {
-    RngStream_SetSeed(rng_stream, seed);
-  }
-}
-
-/**
- * \brief Initialize the platform generator
- *
- * This function create the graph and add node_count nodes to it
- * \param node_count The number of nodes of the platform
- */
-void platf_graph_init(unsigned long node_count) {
-  unsigned long i;
-  platform_graph = xbt_graph_new_graph(FALSE, NULL);
-  if(rng_stream == NULL) {
-    rng_stream = RngStream_CreateStream(NULL);
-  }
-
-  for(i=0 ; i<node_count ; i++) {
-    context_node_t node_data = NULL;
-    node_data = xbt_new0(s_context_node_t, 1);
-    node_data->id = i+1;
-    node_data->x = 0;
-    node_data->y = 0;
-    node_data->degree = 0;
-    node_data->kind = ROUTER;
-    node_data->connect_checked = FALSE;
-    xbt_graph_new_node(platform_graph, (void*) node_data);
-  }
-
-  last_link_id = 0;
-
-}
-
-/**
- * \brief Connect two nodes
- * \param node1 The first node to connect
- * \param node2 The second node to connect
- */
-void platf_node_connect(xbt_node_t node1, xbt_node_t node2) {
-  context_node_t node1_data;
-  context_node_t node2_data;
-  node1_data = (context_node_t) xbt_graph_node_get_data(node1);
-  node2_data = (context_node_t) xbt_graph_node_get_data(node2);
-  node1_data->degree++;
-  node2_data->degree++;
-
-  context_edge_t edge_data = NULL;
-  edge_data = xbt_new0(s_context_edge_t, 1);
-  edge_data->id = ++last_link_id;
-  edge_data->length = platf_node_distance(node1, node2);
-  edge_data->labeled = FALSE;
-  xbt_graph_new_edge(platform_graph, node1, node2, (void*)edge_data);
-}
-
-/**
- * \brief Compute the distance between two nodes
- * \param node1 The first node
- * \param node2 The second node
- * \return The distance between node1 and node2
- */
-double platf_node_distance(xbt_node_t node1, xbt_node_t node2) {
-  context_node_t node1_data;
-  context_node_t node2_data;
-  double delta_x;
-  double delta_y;
-  double distance;
-  node1_data = (context_node_t) xbt_graph_node_get_data(node1);
-  node2_data = (context_node_t) xbt_graph_node_get_data(node2);
-  delta_x = node1_data->x - node2_data->x;
-  delta_y = node1_data->y - node2_data->y;
-  distance = sqrt(delta_x*delta_x + delta_y*delta_y);
-  return distance;
-}
-
-/**
- * \brief Initialize the platform, placing nodes uniformly on the unit square
- * \param node_count The number of node
- */
-void platf_graph_uniform(unsigned long node_count) {
-  xbt_dynar_t dynar_nodes = NULL;
-  xbt_node_t graph_node = NULL;
-  context_node_t node_data = NULL;
-  unsigned int i;
-  platf_graph_init(node_count);
-  dynar_nodes = xbt_graph_get_nodes(platform_graph);
-  xbt_dynar_foreach(dynar_nodes, i, graph_node) {
-    node_data = (context_node_t) xbt_graph_node_get_data(graph_node);
-    node_data->x = RngStream_RandU01(rng_stream);
-    node_data->y = RngStream_RandU01(rng_stream);
-  }
-}
-
-/**
- * \brief Initialize the platform, placing nodes in little clusters on the unit square
- * \param node_count The number of node
- */
-void platf_graph_heavytailed(unsigned long node_count) {
-  xbt_dynar_t dynar_nodes = NULL;
-  xbt_node_t graph_node = NULL;
-  context_node_t node_data = NULL;
-  unsigned int i;
-  platf_graph_init(node_count);
-  dynar_nodes = xbt_graph_get_nodes(platform_graph);
-  xbt_dynar_foreach(dynar_nodes, i, graph_node) {
-    node_data = (context_node_t) xbt_graph_node_get_data(graph_node);
-    node_data->x = random_pareto(0, 1, 1.0/*K*/, 10e9/*P*/, 1.0/*alpha*/);
-    node_data->y = random_pareto(0, 1, 1.0/*K*/, 10e9/*P*/, 1.0/*alpha*/);
-  }
-}
-
-/**
- * \brief Creates a simple topology where all nodes are connected to the first one in a star fashion
- */
-void platf_graph_interconnect_star(void) {
-  xbt_dynar_t dynar_nodes = NULL;
-  xbt_node_t graph_node = NULL;
-  xbt_node_t first_node = NULL;
-  unsigned int i;
-
-  dynar_nodes = xbt_graph_get_nodes(platform_graph);
-  xbt_dynar_foreach(dynar_nodes, i, graph_node) {
-    if(i==0) {
-      //Ok, we get the first node, let's keep it somewhere...
-      first_node = graph_node;
-    } else {
-      //All the other nodes are connected to the first one
-      platf_node_connect(graph_node, first_node);
-    }
-  }
-}
-
-/**
- * \brief Creates a simple topology where all nodes are connected in line
- */
-void platf_graph_interconnect_line(void) {
-  xbt_dynar_t dynar_nodes = NULL;
-  xbt_node_t graph_node = NULL;
-  xbt_node_t old_node = NULL;
-  unsigned int i;
-
-  dynar_nodes = xbt_graph_get_nodes(platform_graph);
-  xbt_dynar_foreach(dynar_nodes, i, graph_node) {
-    if(old_node != NULL) {
-      platf_node_connect(graph_node, old_node);
-    }
-    old_node = graph_node;
-  }
-}
-
-/**
- * \brief Create a simple topology where all nodes are connected along a ring
- */
-void platf_graph_interconnect_ring(void) {
-  xbt_dynar_t dynar_nodes = NULL;
-  xbt_node_t graph_node = NULL;
-  xbt_node_t old_node = NULL;
-  xbt_node_t first_node = NULL;
-  unsigned int i;
-
-  dynar_nodes = xbt_graph_get_nodes(platform_graph);
-  xbt_dynar_foreach(dynar_nodes, i, graph_node) {
-    if(i == 0) {
-      // this is the first node, let's keep it somewhere
-      first_node = graph_node;
-    } else {
-      //connect each node to the previous one
-      platf_node_connect(graph_node, old_node);
-    }
-    old_node = graph_node;
-  }
-  //we still have to connect the first and the last node together
-  platf_node_connect(first_node, graph_node);
-}
-
-/**
- * \brief Create a simple topology where all nodes are connected to each other, in a clique manner
- */
-void platf_graph_interconnect_clique(void) {
-  xbt_dynar_t dynar_nodes = NULL;
-  xbt_node_t first_node = NULL;
-  xbt_node_t second_node = NULL;
-  unsigned int i,j;
-
-  dynar_nodes = xbt_graph_get_nodes(platform_graph);
-  xbt_dynar_foreach(dynar_nodes, i, first_node) {
-    xbt_dynar_foreach(dynar_nodes, j, second_node) {
-      if(j>=i)
-        break;
-      platf_node_connect(first_node, second_node);
-    }
-  }
-}
-
-/**
- * \brief Creates a topology where the probability to connect two nodes is uniform (unrealistic, but simple)
- * \param alpha Probability for two nodes to get connected
- */
-void platf_graph_interconnect_uniform(double alpha) {
-  xbt_dynar_t dynar_nodes = NULL;
-  xbt_node_t first_node = NULL;
-  xbt_node_t second_node = NULL;
-  unsigned int i,j;
-
-  dynar_nodes = xbt_graph_get_nodes(platform_graph);
-  xbt_dynar_foreach(dynar_nodes, i, first_node) {
-    xbt_dynar_foreach(dynar_nodes, j, second_node) {
-      if(j>=i)
-        break;
-      if(RngStream_RandU01(rng_stream) < alpha) {
-        platf_node_connect(first_node, second_node);
-      }
-    }
-  }
-}
-
-/**
- * \brief Create a topology where the probability follows an exponential law
- * \param alpha Number of edges increases with alpha
- */
-void platf_graph_interconnect_exponential(double alpha) {
-  xbt_dynar_t dynar_nodes = NULL;
-  xbt_node_t first_node = NULL;
-  xbt_node_t second_node = NULL;
-  unsigned int i,j;
-  double L = sqrt(2.0); /*  L = c*sqrt(2); c=side of placement square */
-  dynar_nodes = xbt_graph_get_nodes(platform_graph);
-  xbt_dynar_foreach(dynar_nodes, i, first_node) {
-    xbt_dynar_foreach(dynar_nodes, j, second_node) {
-      if(j>=i)
-        break;
-      double d = platf_node_distance(first_node, second_node);
-      if(RngStream_RandU01(rng_stream) < alpha*exp(-d/(L-d))) {
-        platf_node_connect(first_node, second_node);
-      }
-    }
-  }
-}
-
-/**
- * \brief Create a topology where the probability follows the model of Waxman
- *
- * see Waxman, Routing of Multipoint Connections, IEEE J. on Selected Areas in Comm., 1988
- *
- * \param alpha Number of edges increases with alpha
- * \param beta Edge length heterogeneity increases with beta
- */
-void platf_graph_interconnect_waxman(double alpha, double beta) {
-  xbt_dynar_t dynar_nodes = NULL;
-  xbt_node_t first_node = NULL;
-  xbt_node_t second_node = NULL;
-  unsigned int i,j;
-  double L = sqrt(2.0); /*  L = c*sqrt(2); c=side of placement square */
-  dynar_nodes = xbt_graph_get_nodes(platform_graph);
-  xbt_dynar_foreach(dynar_nodes, i, first_node) {
-    xbt_dynar_foreach(dynar_nodes, j, second_node) {
-      if(j>=i)
-        break;
-      double d = platf_node_distance(first_node, second_node);
-      if(RngStream_RandU01(rng_stream) < alpha*exp(-d/(L*beta))) {
-        platf_node_connect(first_node, second_node);
-      }
-    }
-  }
-}
-
-/**
- * \brief Create a topology where the probability follows the model of Zegura
- * see Zegura, Calvert, Donahoo, A quantitative comparison of graph-based models
- * for Internet topology, IEEE/ACM Transactions on Networking, 1997.
- *
- * \param alpha Probability of connexion for short edges
- * \param beta Probability of connexion for long edges
- * \param r Limit between long and short edges (between 0 and sqrt(2) since nodes are placed on the unit square)
- */
-void platf_graph_interconnect_zegura(double alpha, double beta, double r) {
-  xbt_dynar_t dynar_nodes = NULL;
-  xbt_node_t first_node = NULL;
-  xbt_node_t second_node = NULL;
-  unsigned int i,j;
-  dynar_nodes = xbt_graph_get_nodes(platform_graph);
-  xbt_dynar_foreach(dynar_nodes, i, first_node) {
-    xbt_dynar_foreach(dynar_nodes, j, second_node) {
-      if(j>=i)
-        break;
-      double d = platf_node_distance(first_node, second_node);
-      double proba = d < r ? alpha : beta;
-      if(RngStream_RandU01(rng_stream) < proba) {
-        platf_node_connect(first_node, second_node);
-      }
-    }
-  }
-}
-
-/**
- * \brief Create a topology constructed according to the Barabasi-Albert algorithm (follows power laws)
- * see Barabasi and Albert, Emergence of scaling in random networks, Science 1999, num 59, p509­-512.
- */
-void platf_graph_interconnect_barabasi(void) {
-  xbt_dynar_t dynar_nodes = NULL;
-  xbt_node_t first_node = NULL;
-  xbt_node_t second_node = NULL;
-  context_node_t node_data = NULL;
-  unsigned int i,j;
-  unsigned long sum = 0;
-  dynar_nodes = xbt_graph_get_nodes(platform_graph);
-  xbt_dynar_foreach(dynar_nodes, i, first_node) {
-    xbt_dynar_foreach(dynar_nodes, j, second_node) {
-      if(j>=i)
-        break;
-      node_data = xbt_graph_node_get_data(second_node);
-      if(sum==0 || RngStream_RandU01(rng_stream) < ((double)(node_data->degree)/ (double)sum)) {
-        platf_node_connect(first_node, second_node);
-        sum += 2;
-      }
-    }
-  }
-}
-
-/**
- * \brief Check if the produced graph is connected
- *
- * You should check if the produced graph is connected before doing anything
- * on it. You probably don't want any isolated node or group of nodes...
- *
- * \return TRUE if the graph is connected, FALSE otherwise
- */
-int platf_graph_is_connected(void) {
-  xbt_dynar_t dynar_nodes = NULL;
-  xbt_dynar_t connected_nodes = NULL;
-  xbt_dynar_t outgoing_edges = NULL;
-  xbt_node_t graph_node = NULL;
-  context_node_t node_data = NULL;
-  xbt_edge_t outedge = NULL;
-  unsigned long iterator;
-  unsigned int i;
-  dynar_nodes = xbt_graph_get_nodes(platform_graph);
-  connected_nodes = xbt_dynar_new(sizeof(xbt_node_t), NULL);
-
-  //Let's just check if every nodes are connected to something
-  xbt_dynar_foreach(dynar_nodes, i, graph_node) {
-    node_data = xbt_graph_node_get_data(graph_node);
-    if(node_data->degree==0) {
-      return FALSE;
-    }
-  }
-
-  //We still need a real check
-  //Initialize the connected node array with the first node
-  xbt_dynar_get_cpy(dynar_nodes, 0, &graph_node);
-  node_data = xbt_graph_node_get_data(graph_node);
-  node_data->connect_checked = TRUE;
-  xbt_dynar_push(connected_nodes, &graph_node);
-  iterator = 0;
-  do {
-    //Get the next node
-    xbt_dynar_get_cpy(connected_nodes, iterator, &graph_node);
-
-    //add all the linked nodes to the connected node array
-    outgoing_edges = xbt_graph_node_get_outedges(graph_node);
-    xbt_dynar_foreach(outgoing_edges, i, outedge) {
-      xbt_node_t src = xbt_graph_edge_get_source(outedge);
-      xbt_node_t dst = xbt_graph_edge_get_target(outedge);
-      node_data = xbt_graph_node_get_data(src);
-      if(!node_data->connect_checked) {
-        xbt_dynar_push(connected_nodes, &src);
-        node_data->connect_checked = TRUE;
-      }
-      node_data = xbt_graph_node_get_data(dst);
-      if(!node_data->connect_checked) {
-        xbt_dynar_push(connected_nodes, &dst);
-        node_data->connect_checked = TRUE;
-      }
-    }
-  } while(++iterator < xbt_dynar_length(connected_nodes));
-
-  // The graph is connected if the connected node array has the same length
-  // as the graph node array
-  return xbt_dynar_length(connected_nodes) == xbt_dynar_length(dynar_nodes);
-}
-
-
-/**
- * \brief Remove the links in the created topology
- *
- * This is useful when the created topology is not connected, and you want
- * to generate a new one.
- */
-void platf_graph_clear_links(void) {
-  xbt_dynar_t dynar_nodes = NULL;
-  xbt_dynar_t dynar_edges = NULL;
-  xbt_dynar_t dynar_edges_cpy = NULL;
-  xbt_node_t graph_node = NULL;
-  xbt_edge_t graph_edge = NULL;
-  context_node_t node_data = NULL;
-  unsigned int i;
-
-  //The graph edge dynar will be modified directly, so we work on a copy of it
-  dynar_edges = xbt_graph_get_edges(platform_graph);
-  dynar_edges_cpy = xbt_dynar_new(sizeof(xbt_edge_t), NULL);
-  xbt_dynar_foreach(dynar_edges, i, graph_edge) {
-    xbt_dynar_push_as(dynar_edges_cpy, xbt_edge_t, graph_edge);
-  }
-  //Delete edges from the graph
-  xbt_dynar_foreach(dynar_edges_cpy, i, graph_edge) {
-    xbt_graph_free_edge(platform_graph, graph_edge, xbt_free_f);
-  }
-  //remove the dynar copy
-  xbt_dynar_free(&dynar_edges_cpy);
-
-  //All the nodes will be of degree 0, unchecked from connectedness
-  dynar_nodes = xbt_graph_get_nodes(platform_graph);
-  xbt_dynar_foreach(dynar_nodes, i, graph_node) {
-    node_data = xbt_graph_node_get_data(graph_node);
-    node_data->degree = 0;
-    node_data->connect_checked = FALSE;
-  }
-}
-
-/**
- * \brief Promote a node to a host
- *
- * This function should be called in callbacks registered with the
- * platf_graph_promoter function.
- *
- * \param node The node to promote
- * \param parameters The parameters needed to build the host
- */
-void platf_graph_promote_to_host(context_node_t node, sg_platf_host_cbarg_t parameters) {
-  node->kind = HOST;
-  memcpy(&(node->host_parameters), parameters, sizeof(s_sg_platf_host_cbarg_t));
-}
-
-/**
- * \brief Promote a node to a cluster
- *
- * This function should be called in callbacks registered with the
- * platf_graph_promoter function.
- *
- * \param node The node to promote
- * \param parameters The parameters needed to build the cluster
- */
-void platf_graph_promote_to_cluster(context_node_t node, sg_platf_cluster_cbarg_t parameters) {
-  node->kind = CLUSTER;
-  memcpy(&(node->cluster_parameters), parameters, sizeof(s_sg_platf_cluster_cbarg_t));
-}
-
-/**
- * \brief Set the parameters of a network link.
- *
- * This function should be called in callbacks registered with the
- * platf_graph_labeler function.
- *
- * \param edge The edge to modify
- * \param parameters The parameters of the network link
- */
-void platf_graph_link_label(context_edge_t edge, sg_platf_link_cbarg_t parameters) {
-  memcpy(&(edge->link_parameters), parameters, sizeof(s_sg_platf_link_cbarg_t));
-  edge->labeled = TRUE;
-}
-
-/**
- * \brief Register a callback to promote nodes
- *
- * The best way to promote nodes into host or cluster is to write a function
- * which takes one parameter, a #context_node_t, make every needed test on
- * it, and call platf_graph_promote_to_host or platf_graph_promote_to_cluster
- * if needed. Then, register the function with this one.
- * You can register several callbacks: the first registered function will be
- * called first. If the node have not been promoted yet, the second function
- * will be called, and so on...
- *
- * \param promoter_callback The callback function
- */
-void platf_graph_promoter(platf_promoter_cb_t promoter_callback) {
-  if(promoter_dynar == NULL) {
-    promoter_dynar = xbt_dynar_new(sizeof(platf_promoter_cb_t), NULL);
-  }
-  xbt_dynar_push(promoter_dynar, &promoter_callback);
-}
-
-/**
- * \brief Register a callback to label links
- *
- * Like the node promotion, it is better, to set links, to write a function
- * which take one parameter, a #context_edge_t, make every needed test on
- * it, and call platf_graph_link_label if needed.
- * You can register several callbacks: the first registered function will be
- * called first. If the link have not been labeled yet, the second function
- * will be called, and so on... All the links must have been labeled after
- * all the calls.
- *
- * \param labeler_callback The callback function
- */
-void platf_graph_labeler(platf_labeler_cb_t labeler_callback) {
-  if(labeler_dynar == NULL) {
-    labeler_dynar = xbt_dynar_new(sizeof(void*), NULL);
-  }
-  xbt_dynar_push(labeler_dynar, &labeler_callback);
-}
-
-/**
- * \brief Call the registered promoters on all nodes
- *
- * The promoters are called on all nodes, in the order of their registration
- * If some nodes are not promoted, they will be routers
- */
-void platf_do_promote(void) {
-  platf_promoter_cb_t promoter_callback;
-  xbt_node_t graph_node = NULL;
-  xbt_dynar_t dynar_nodes = NULL;
-  context_node_t node = NULL;
-  unsigned int i, j;
-  dynar_nodes = xbt_graph_get_nodes(platform_graph);
-  xbt_dynar_foreach(dynar_nodes, i, graph_node) {
-    node = (context_node_t) xbt_graph_node_get_data(graph_node);
-    xbt_dynar_foreach(promoter_dynar, j, promoter_callback) {
-      if(node->kind != ROUTER)
-        break;
-      promoter_callback(node);
-    }
-  }
-}
-
-/**
- * \brief Call the registered labelers on all links
- */
-void platf_do_label(void) {
-  platf_labeler_cb_t labeler_callback;
-  xbt_edge_t graph_edge = NULL;
-  xbt_dynar_t dynar_edges = NULL;
-  context_edge_t edge = NULL;
-  unsigned int i, j;
-  dynar_edges = xbt_graph_get_edges(platform_graph);
-  xbt_dynar_foreach(dynar_edges, i, graph_edge) {
-    edge = (context_edge_t) xbt_graph_edge_get_data(graph_edge);
-    xbt_dynar_foreach(labeler_dynar, j, labeler_callback) {
-      if(edge->labeled)
-        break;
-      labeler_callback(edge);
-    }
-    if(!edge->labeled) {
-      XBT_ERROR("All links of the generated platform are not labeled.");
-      xbt_die("Please check your generation parameters.");
-    }
-  }
-}
-
-/**
- * \brief putting into SURF the generated platform
- *
- * This function should be called when the generation is over and the platform
- * is ready to be put in place in SURF. All the init function, like MSG_init,
- * must have been called before, or this function will not do anything.
- * After that function, it should be possible to list all the available hosts
- * with the provided functions.
- */
-void platf_generate(void) {
-
-  xbt_dynar_t nodes = NULL;
-  xbt_node_t graph_node = NULL;
-  context_node_t node_data = NULL;
-  xbt_dynar_t edges = NULL;
-  xbt_edge_t graph_edge = NULL;
-  context_edge_t edge_data = NULL;
-  unsigned int i;
-
-  unsigned int last_host = 0;
-  unsigned int last_router = 0;
-  unsigned int last_cluster = 0;
-
-  sg_platf_host_cbarg_t host_parameters;
-  sg_platf_cluster_cbarg_t cluster_parameters;
-  sg_platf_link_cbarg_t link_parameters;
-  s_sg_platf_router_cbarg_t router_parameters = SG_PLATF_ROUTER_INITIALIZER; /* This one is not a pointer! */
-  s_sg_platf_route_cbarg_t route_parameters   = SG_PLATF_ROUTE_INITIALIZER; /* neither this one! */
-
-  router_parameters.coord = NULL;
-  route_parameters.symmetrical = FALSE;
-  route_parameters.src = NULL;
-  route_parameters.dst = NULL;
-  route_parameters.gw_dst = NULL;
-  route_parameters.gw_src = NULL;
-  route_parameters.link_list = NULL;
-
-  nodes = xbt_graph_get_nodes(platform_graph);
-  edges = xbt_graph_get_edges(platform_graph);
-
-  sg_platf_begin();
-  surf_parse_init_callbacks();
-  routing_register_callbacks();
-
-  s_sg_platf_AS_cbarg_t AS = SG_PLATF_AS_INITIALIZER;
-  AS.id = "random platform";
-  AS.routing = A_surfxml_AS_routing_Floyd;
-  sg_platf_new_AS_begin(&AS);
-
-  //Generate hosts, clusters and routers
-  xbt_dynar_foreach(nodes, i, graph_node) {
-    node_data = xbt_graph_node_get_data(graph_node);
-    switch(node_data->kind) {
-      case HOST:
-        host_parameters = &node_data->host_parameters;
-        last_host++;
-        if(host_parameters->id == NULL) {
-          host_parameters->id = bprintf("host-%d", last_host);
-        }
-        sg_platf_new_host(host_parameters);
-        break;
-      case CLUSTER:
-        cluster_parameters = &node_data->cluster_parameters;
-        last_cluster++;
-        if(cluster_parameters->prefix == NULL) {
-          cluster_parameters->prefix = "host-";
-        }
-        if(cluster_parameters->suffix == NULL) {
-          cluster_parameters->suffix = bprintf(".cluster-%d", last_cluster);
-        }
-        if(cluster_parameters->id == NULL) {
-          cluster_parameters->id = bprintf("cluster-%d", last_cluster);
-        }
-        sg_platf_new_cluster(cluster_parameters);
-        break;
-      case ROUTER:
-        node_data->router_id = bprintf("router-%d", ++last_router);
-        router_parameters.id = node_data->router_id;
-        sg_platf_new_router(&router_parameters);
-        break;
-    }
-  }
-
-  //Generate links and routes
-  xbt_dynar_foreach(edges, i, graph_edge) {
-    xbt_node_t src = xbt_graph_edge_get_source(graph_edge);
-    xbt_node_t dst = xbt_graph_edge_get_target(graph_edge);
-    context_node_t src_data = xbt_graph_node_get_data(src);
-    context_node_t dst_data = xbt_graph_node_get_data(dst);
-    edge_data = xbt_graph_edge_get_data(graph_edge);
-    const char* temp = NULL;
-
-    //Add a link to the platform
-    link_parameters = &edge_data->link_parameters;
-    if(link_parameters->id == NULL) {
-      link_parameters->id = bprintf("link-%ld", edge_data->id);
-    }
-    sg_platf_new_link(link_parameters);
-
-    //Add a route matching this link
-    switch(src_data->kind) {
-      case ROUTER:
-        route_parameters.src = src_data->router_id;
-        break;
-      case CLUSTER:
-        route_parameters.src = src_data->cluster_parameters.id;
-        break;
-      case HOST:
-        route_parameters.src = src_data->host_parameters.id;
-        break;
-    }
-    switch(dst_data->kind) {
-      case ROUTER:
-        route_parameters.dst = dst_data->router_id;
-        break;
-      case CLUSTER:
-        route_parameters.dst = dst_data->cluster_parameters.id;
-        break;
-      case HOST:
-        route_parameters.dst = dst_data->host_parameters.id;
-        break;
-    }
-    sg_platf_route_begin(&route_parameters);
-    sg_platf_route_add_link(link_parameters->id, &route_parameters);
-    sg_platf_route_end(&route_parameters);
-
-    //Create the symmertical route
-    temp = route_parameters.dst;
-    route_parameters.dst = route_parameters.src;
-    route_parameters.src = temp;
-    sg_platf_route_begin(&route_parameters);
-    sg_platf_route_add_link(link_parameters->id, &route_parameters);
-    sg_platf_route_end(&route_parameters);
-  }
-
-  sg_platf_new_AS_end();
-  sg_platf_end();
-}
-
-/* Functions used to generate interesting random values */
-
-double random_pareto(double min, double max, double K, double P, double ALPHA) {
-  double x = RngStream_RandU01(rng_stream);
-  double den = pow(1.0 - x + x*pow(K/P, ALPHA), 1.0/ALPHA);
-  double res = (1/den);
-  res += min - 1; // pareto is on [1, infinity) by default
-  if (res>max) {
-    return max;
-  }
-  return res;
-}
diff --git a/src/surf/platf_generator_private.h b/src/surf/platf_generator_private.h
deleted file mode 100644 (file)
index ea57365..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Copyright (c) 2012, 2014. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#ifndef SG_PLATF_GEN_PRIVATE_H
-#define SG_PLATF_GEN_PRIVATE_H
-
-#include <xbt/base.h>
-
-#include "xbt/graph.h"
-#include "simgrid/platf.h"
-
-XBT_PRIVATE void platf_graph_init(unsigned long node_count);
-
-XBT_PRIVATE void platf_node_connect(xbt_node_t node1, xbt_node_t node2);
-
-XBT_PRIVATE double platf_node_distance(xbt_node_t node1, xbt_node_t node2);
-
-XBT_PRIVATE double random_pareto(double min, double max, double K, double P, double ALPHA);
-
-#endif      /* SG_PLATF_GEN_PRIVATE_H */
diff --git a/src/surf/random_mgr.c b/src/surf/random_mgr.c
deleted file mode 100644 (file)
index 39fe6e2..0000000
+++ /dev/null
@@ -1,290 +0,0 @@
-/* Copyright (c) 2007-2014. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include "surf/random_mgr.h"
-#include "xbt/sysdep.h"
-#include "src/internal_config.h" /*_XBT_WIN32*/
-#include <math.h>
-#include <stdlib.h>
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(random, surf, "Random part of surf");
-
-#ifdef _XBT_WIN32
-
-static unsigned int _seed = 2147483647;
-
-#ifdef __VISUALC__
-typedef unsigned __int64 uint64_t;
-typedef unsigned int uint32_t;
-#endif
-
-struct drand48_data {
-  unsigned short int __x[3];    /* Current state.  */
-  unsigned short int __old_x[3];        /* Old state.  */
-  unsigned short int __c;       /* Additive const. in congruential formula.  */
-  unsigned short int __init;    /* Flag for initializing.  */
-  unsigned long long int __a;   /* Factor in congruential formula.  */
-};
-
-static struct drand48_data __libc_drand48_data = { 0 };
-
-union ieee754_double {
-  double d;
-
-  /* This is the IEEE 754 double-precision format.  */
-  struct {
-    /* Together these comprise the mantissa.  */
-    unsigned int mantissa1:32;
-    unsigned int mantissa0:20;
-    unsigned int exponent:11;
-    unsigned int negative:1;
-    /* Little endian.  */
-  } ieee;
-
-  /* This format makes it easier to see if a NaN is a signalling NaN.  */
-  struct {
-    /* Together these comprise the mantissa.  */
-    unsigned int mantissa1:32;
-    unsigned int mantissa0:19;
-    unsigned int quiet_nan:1;
-    unsigned int exponent:11;
-    unsigned int negative:1;
-
-  } ieee_nan;
-};
-
-#define IEEE754_DOUBLE_BIAS  0x3ff   /* Added to exponent.  */
-
-double drand48(void);
-
-int
-_drand48_iterate(unsigned short int xsubi[3], struct drand48_data *buffer);
-
-int
-_erand48_r(unsigned short int xsubi[3], struct drand48_data *buffer,
-           double *result);
-
-
-int
-_erand48_r(unsigned short int xsubi[3], struct drand48_data *buffer,
-           double *result)
-{
-  union ieee754_double temp;
-
-  /* Compute next state.  */
-  if (_drand48_iterate(xsubi, buffer) < 0)
-    return -1;
-
-  /* Construct a positive double with the 48 random bits distributed over
-     its fractional part so the resulting FP number is [0.0,1.0).  */
-
-  temp.ieee.negative = 0;
-  temp.ieee.exponent = IEEE754_DOUBLE_BIAS;
-  temp.ieee.mantissa0 = (xsubi[2] << 4) | (xsubi[1] >> 12);
-  temp.ieee.mantissa1 = ((xsubi[1] & 0xfff) << 20) | (xsubi[0] << 4);
-
-  /* Please note the lower 4 bits of mantissa1 are always 0.  */
-  *result = temp.d - 1.0;
-
-  return 0;
-}
-
-int _drand48_iterate(unsigned short int xsubi[3],
-                     struct drand48_data *buffer)
-{
-  uint64_t X;
-  uint64_t result;
-
-  /* Initialize buffer, if not yet done.  */
-
-  if (buffer->__init == 0) {
-    buffer->__a = 0x5deece66dull;
-    buffer->__c = 0xb;
-    buffer->__init = 1;
-  }
-
-  /* Do the real work.  We choose a data type which contains at least
-     48 bits.  Because we compute the modulus it does not care how
-     many bits really are computed.  */
-
-  X = (uint64_t) xsubi[2] << 32 | (uint32_t) xsubi[1] << 16 | xsubi[0];
-
-  result = X * buffer->__a + buffer->__c;
-
-
-  xsubi[0] = result & 0xffff;
-  xsubi[1] = (result >> 16) & 0xffff;
-  xsubi[2] = (result >> 32) & 0xffff;
-
-  return 0;
-}
-
-double _drand48(void);
-void _srand(unsigned int seed);
-int _rand(void);
-int _rand_r(unsigned int *pseed);
-
-double _drand48(void)
-{
-  double result;
-
-  (void) _erand48_r(__libc_drand48_data.__x, &__libc_drand48_data,
-                    &result);
-
-  return result;
-}
-
-void _srand(unsigned int seed)
-{
-  _seed = seed;
-}
-
-int _rand(void)
-{
-  const long a = 16807;
-  const long m = 2147483647;
-  const long q = 127773;        /* (m/a) */
-  const long r = 2836;          /* (m%a) */
-
-  long lo, k, s;
-
-  s = (long) _seed;
-
-  k = (long) (s / q);
-
-  lo = (s - q * k);
-
-  s = a * lo - r * k;
-
-  if (s <= 0)
-    s += m;
-
-  _seed = (int) (s & RAND_MAX);
-
-  return _seed;
-}
-
-int _rand_r(unsigned int *pseed)
-{
-  const long a = 16807;
-  const long m = 2147483647;
-  const long q = 127773;        /* (m/a) */
-  const long r = 2836;          /* (m%a) */
-
-  long lo, k, s;
-
-  s = (long) *pseed;
-
-  k = (long) (s / q);
-
-  lo = (s - q * k);
-
-  s = a * lo - r * k;
-
-  if (s <= 0)
-    s += m;
-
-  return (int) (s & RAND_MAX);
-
-}
-
-
-#define rand_r _rand_r
-#define drand48 _drand48
-
-#endif
-
-static double custom_random(e_random_generator_t generator, long int *seed)
-{
-  switch (generator) {
-
-  case DRAND48:
-    return drand48();
-  case RAND:
-    return (double) rand_r((unsigned int *) seed) / RAND_MAX;
-  case RNGSTREAM :
-    XBT_INFO("Seen RNGSTREAM");
-    return 0.0;
-  default:
-    return drand48();
-  }
-}
-
-/* Generate numbers between min and max with a given mean and standard deviation */
-double random_generate(random_data_t random)
-{
-  double a, b;
-  double alpha, beta, gamma;
-  double U1, U2, V, W, X;
-
-  if (random == NULL)
-    return 0.0f;
-
-  if (random->std == 0)
-    return random->mean * (random->max - random->min) + random->min;
-
-  a = random->mean * (random->mean * (1 - random->mean) /
-                      (random->std * random->std) - 1);
-  b = (1 -
-       random->mean) * (random->mean * (1 -
-                                        random->mean) / (random->std *
-                                                         random->std) - 1);
-
-  alpha = a + b;
-  if (a <= 1. || b <= 1.)
-    beta = ((1. / a) > (1. / b)) ? (1. / a) : (1. / b);
-  else
-    beta = sqrt((alpha - 2.) / (2. * a * b - alpha));
-  gamma = a + 1. / beta;
-
-  do {
-    /* Random generation for the Beta distribution based on
-     *   R. C. H. Cheng (1978). Generating beta variates with nonintegral shape parameters. _Communications of the ACM_, *21*, 317-322.
-     *   It is good for speed because it does not call math functions many times and respect the 4 given constraints
-     */
-    U1 = custom_random(random->generator, &(random->seed));
-    U2 = custom_random(random->generator, &(random->seed));
-
-    V = beta * log(U1 / (1 - U1));
-    W = a * exp(V);
-  } while (alpha * log(alpha / (b + W)) + gamma * V - log(4) <
-           log(U1 * U1 * U2));
-
-  X = W / (b + W);
-
-  return X * (random->max - random->min) + random->min;
-}
-
-random_data_t random_new(e_random_generator_t generator, long int seed,
-                         double min, double max, double mean, double std)
-{
-  random_data_t random = xbt_new0(s_random_data_t, 1);
-
-  random->generator = generator;
-  random->seed = seed;
-  random->min = min;
-  random->max = max;
-
-  /* Check user stupidities */
-  if (max < min)
-    THROWF(arg_error, 0, "random->max < random->min (%f < %f)", max, min);
-  if (mean < min)
-    THROWF(arg_error, 0, "random->mean < random->min (%f < %f)", mean,
-           min);
-  if (mean > max)
-    THROWF(arg_error, 0, "random->mean > random->max (%f > %f)", mean,
-           max);
-
-  /* normalize the mean and standard deviation before storing */
-  random->mean = (mean - min) / (max - min);
-  random->std = std / (max - min);
-
-  if (random->mean * (1 - random->mean) < random->std * random->std)
-    THROWF(arg_error, 0, "Invalid mean and standard deviation (%f and %f)",
-           random->mean, random->std);
-
-  return random;
-}
index c21c670..16aa43f 100644 (file)
@@ -114,9 +114,9 @@ Storage *StorageN11Model::createStorage(const char* id, const char* type_id,
   return storage;
 }
 
-double StorageN11Model::shareResources(double now)
+double StorageN11Model::shareResources(double /*now*/)
 {
-  XBT_DEBUG("storage_share_resources %f", now);
+  XBT_DEBUG("storage_share_resources");
   unsigned int i, j;
   Storage *storage;
   void *_write_action;
index a6a1831..2a86c80 100644 (file)
@@ -130,7 +130,7 @@ s_surf_model_description_t surf_storage_model_description[] = {
   {NULL, NULL,  NULL}      /* this array must be NULL terminated */
 };
 
-#ifdef CONTEXT_THREADS
+#ifdef HAVE_THREAD_CONTEXTS
 static xbt_parmap_t surf_parmap = NULL; /* parallel map on models */
 #endif
 
@@ -373,7 +373,7 @@ void surf_exit(void)
     future_evt_set = nullptr;
   }
 
-#ifdef CONTEXT_THREADS
+#ifdef HAVE_THREAD_CONTEXTS
   xbt_parmap_destroy(surf_parmap);
 #endif
 
index 85fc8e0..e2cfb09 100644 (file)
@@ -73,7 +73,6 @@ enum heap_action_type{
  *********/
 /* For the trace and trace:connect tag (store their content till the end of the parsing) */
 XBT_PUBLIC_DATA(xbt_dict_t) traces_set_list;
-XBT_PUBLIC_DATA(xbt_dict_t) trace_connect_list_host_avail;
 XBT_PUBLIC_DATA(xbt_dict_t) trace_connect_list_host_speed;
 XBT_PUBLIC_DATA(xbt_dict_t) trace_connect_list_link_avail;
 XBT_PUBLIC_DATA(xbt_dict_t) trace_connect_list_link_bw;
index aaa141e..b1600e5 100644 (file)
@@ -13,7 +13,6 @@
 #include "surf/maxmin.h"
 #include "xbt/log.h"
 #include "surf/surfxml_parse.h"
-#include "surf/random_mgr.h"
 #include "src/surf/trace_mgr.hpp"
 #include "src/instr/instr_private.h"
 #include "surf/surfxml_parse_values.h"
index 7ce56b2..033bcf4 100644 (file)
@@ -213,44 +213,6 @@ void sg_platf_new_trace(sg_platf_trace_cbarg_t trace)
   xbt_dict_set(traces_set_list, trace->id, (void *) tmgr_trace, NULL);
 }
 
-void sg_platf_trace_connect(sg_platf_trace_connect_cbarg_t trace_connect)
-{
-  xbt_assert(xbt_dict_get_or_null(traces_set_list, trace_connect->trace),
-              "Cannot connect trace %s to %s: trace unknown",
-              trace_connect->trace,
-              trace_connect->element);
-
-  switch (trace_connect->kind) {
-  case SURF_TRACE_CONNECT_KIND_HOST_AVAIL:
-    xbt_dict_set(trace_connect_list_host_avail,
-        trace_connect->trace,
-        xbt_strdup(trace_connect->element), NULL);
-    break;
-  case SURF_TRACE_CONNECT_KIND_POWER:
-    xbt_dict_set(trace_connect_list_host_speed, trace_connect->trace,
-        xbt_strdup(trace_connect->element), NULL);
-    break;
-  case SURF_TRACE_CONNECT_KIND_LINK_AVAIL:
-    xbt_dict_set(trace_connect_list_link_avail,
-        trace_connect->trace,
-        xbt_strdup(trace_connect->element), NULL);
-    break;
-  case SURF_TRACE_CONNECT_KIND_BANDWIDTH:
-    xbt_dict_set(trace_connect_list_link_bw,
-        trace_connect->trace,
-        xbt_strdup(trace_connect->element), NULL);
-    break;
-  case SURF_TRACE_CONNECT_KIND_LATENCY:
-    xbt_dict_set(trace_connect_list_link_lat, trace_connect->trace,
-        xbt_strdup(trace_connect->element), NULL);
-    break;
-  default:
-       surf_parse_error("Cannot connect trace %s to %s: kind of trace unknown",
-        trace_connect->trace, trace_connect->element);
-    break;
-  }
-}
-
 /**
  * \brief Make a new routing component to the platform
  *
index 50c47f4..596a5b9 100644 (file)
 #include "xbt/str.h"
 #include "xbt/file.h"
 #include "xbt/dict.h"
-#include "surf/surfxml_parse.h"
 #include "src/surf/surf_private.h"
-#include "surf/random_mgr.h"
 #include "simgrid/sg_config.h"
+#include "surfxml_private.h"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_parse, surf,
                                 "Logging specific to the SURF parsing module");
@@ -1062,32 +1061,10 @@ int_f_void_t surf_parse = _surf_parse;
  */
 
 double parse_cpu_speed(const char *str_speed)
-{
-  double speed = 0.0;
-  const char *p, *q;
-  char *generator;
-  random_data_t random = NULL;
-  /* randomness is inserted like this: power="$rand(my_random)" */
-  if (((p = strstr(str_speed, "$rand(")) != NULL)
-      && ((q = strstr(str_speed, ")")) != NULL)) {
-    if (p < q) {
-      generator = xbt_malloc(q - (p + 6) + 1);
-      memcpy(generator, p + 6, q - (p + 6));
-      generator[q - (p + 6)] = '\0';
-      random = xbt_dict_get_or_null(random_data_list, generator);
-      xbt_assert(random, "Random generator %s undefined", generator);
-      speed = random_generate(random);
-    }
-  } else {
-    speed = surf_parse_get_speed(str_speed);
-  }
-  return speed;
+{ // FIXME deadcode
+  return surf_parse_get_speed(str_speed);
 }
 
-double random_min, random_max, random_mean, random_std_deviation;
-e_random_generator_t random_generator;
-char *random_id;
-
 xbt_dict_t get_as_router_properties(const char* name)
 {
   return xbt_lib_get_or_null(as_router_lib, name, ROUTING_PROP_ASR_LEVEL);
index 7ab9cb9..5a9ea0e 100644 (file)
@@ -9,9 +9,9 @@
 #include "xbt/str.h"
 #include "xbt/dict.h"
 #include "simgrid/platf.h"
-#include "surf/surfxml_parse.h"
 #include "src/surf/cpu_interface.hpp"
 #include "src/surf/surf_private.h"
+#include "src/surf/surfxml_private.h"
 
 #ifdef HAVE_LUA
 extern "C" {
@@ -70,6 +70,45 @@ xbt_dict_t trace_connect_list_link_avail = NULL;
 xbt_dict_t trace_connect_list_link_bw = NULL;
 xbt_dict_t trace_connect_list_link_lat = NULL;
 
+void sg_platf_trace_connect(sg_platf_trace_connect_cbarg_t trace_connect)
+{
+  xbt_assert(xbt_dict_get_or_null(traces_set_list, trace_connect->trace),
+              "Cannot connect trace %s to %s: trace unknown",
+              trace_connect->trace,
+              trace_connect->element);
+
+  switch (trace_connect->kind) {
+  case SURF_TRACE_CONNECT_KIND_HOST_AVAIL:
+    xbt_dict_set(trace_connect_list_host_avail,
+        trace_connect->trace,
+        xbt_strdup(trace_connect->element), NULL);
+    break;
+  case SURF_TRACE_CONNECT_KIND_POWER:
+    xbt_dict_set(trace_connect_list_host_speed, trace_connect->trace,
+        xbt_strdup(trace_connect->element), NULL);
+    break;
+  case SURF_TRACE_CONNECT_KIND_LINK_AVAIL:
+    xbt_dict_set(trace_connect_list_link_avail,
+        trace_connect->trace,
+        xbt_strdup(trace_connect->element), NULL);
+    break;
+  case SURF_TRACE_CONNECT_KIND_BANDWIDTH:
+    xbt_dict_set(trace_connect_list_link_bw,
+        trace_connect->trace,
+        xbt_strdup(trace_connect->element), NULL);
+    break;
+  case SURF_TRACE_CONNECT_KIND_LATENCY:
+    xbt_dict_set(trace_connect_list_link_lat, trace_connect->trace,
+        xbt_strdup(trace_connect->element), NULL);
+    break;
+  default:
+  surf_parse_error("Cannot connect trace %s to %s: kind of trace unknown",
+        trace_connect->trace, trace_connect->element);
+    break;
+  }
+}
+
+
 /* ***************************************** */
 
 static int after_config_done;
@@ -160,7 +199,6 @@ void parse_platform_file(const char *file)
     xbt_dict_free(&trace_connect_list_link_bw);
     xbt_dict_free(&trace_connect_list_link_lat);
     xbt_dict_free(&traces_set_list);
-    xbt_dict_free(&random_data_list);
     xbt_dynar_free(&surfxml_bufferstack_stack);
 
     surf_parse_close();
diff --git a/src/surf/surfxml_private.h b/src/surf/surfxml_private.h
new file mode 100644 (file)
index 0000000..dc69ca1
--- /dev/null
@@ -0,0 +1,17 @@
+/* Copyright (c) 2016. The SimGrid Team. All rights reserved.               */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#ifndef SRC_SURF_SURFXML_PRIVATE_H_
+#define SRC_SURF_SURFXML_PRIVATE_H_
+
+#include "surf/surfxml_parse.h"
+
+SG_BEGIN_DECL()
+
+void sg_platf_trace_connect(sg_platf_trace_connect_cbarg_t trace_connect);
+
+SG_END_DECL()
+
+#endif /* SRC_SURF_SURFXML_PRIVATE_H_ */
index 1b7b8fe..cc0eedd 100644 (file)
@@ -25,7 +25,7 @@ simgrid::trace_mgr::future_evt_set::~future_evt_set()
   xbt_heap_free(p_heap);
 }
 
-
+#if 0 /* probabilistic dead code. Should be reimplemented, not killed (please) */
 /**
  * \brief Create a #tmgr_trace_t from probabilist generators
  *
@@ -239,6 +239,7 @@ double tmgr_event_generator_next_value(probabilist_event_generator_t generator)
 
   return generator->next_value;
 }
+#endif /* probabilistic dead code */
 
 tmgr_trace_t tmgr_trace_new_from_string(const char *id, const char *input,
                                         double periodicity)
@@ -263,8 +264,7 @@ tmgr_trace_t tmgr_trace_new_from_string(const char *id, const char *input,
               "Invalid periodicity %g (must be positive)", periodicity);
 
   trace = xbt_new0(s_tmgr_trace_t, 1);
-  trace->type = e_trace_list;
-  trace->s_list.event_list = xbt_dynar_new(sizeof(s_tmgr_event_t), NULL);
+  trace->event_list = xbt_dynar_new(sizeof(s_tmgr_event_t), NULL);
 
   list = xbt_str_split(input, "\n\r");
 
@@ -292,11 +292,11 @@ tmgr_trace_t tmgr_trace_new_from_string(const char *id, const char *input,
         s_tmgr_event_t first_event;
         first_event.delta=event.delta;
         first_event.value=-1.0;
-        xbt_dynar_push(trace->s_list.event_list, &first_event);
+        xbt_dynar_push(trace->event_list, &first_event);
       }
     }
-    xbt_dynar_push(trace->s_list.event_list, &event);
-    last_event = (tmgr_event_t)xbt_dynar_get_ptr(trace->s_list.event_list, xbt_dynar_length(trace->s_list.event_list) - 1);
+    xbt_dynar_push(trace->event_list, &event);
+    last_event = (tmgr_event_t)xbt_dynar_get_ptr(trace->event_list, xbt_dynar_length(trace->event_list) - 1);
   }
   if (last_event)
     last_event->delta = periodicity;
@@ -343,12 +343,11 @@ tmgr_trace_t tmgr_empty_trace_new(void)
   s_tmgr_event_t event;
 
   trace = xbt_new0(s_tmgr_trace_t, 1);
-  trace->type = e_trace_list;
-  trace->s_list.event_list = xbt_dynar_new(sizeof(s_tmgr_event_t), NULL);
+  trace->event_list = xbt_dynar_new(sizeof(s_tmgr_event_t), NULL);
 
   event.delta = 0.0;
   event.value = 0.0;
-  xbt_dynar_push(trace->s_list.event_list, &event);
+  xbt_dynar_push(trace->event_list, &event);
 
   return trace;
 }
@@ -358,14 +357,7 @@ void tmgr_trace_free(tmgr_trace_t trace)
   if (!trace)
     return;
 
-  switch(trace->type) {
-    case e_trace_list:
-      xbt_dynar_free(&(trace->s_list.event_list));
-      break;
-    case e_trace_probabilist:
-      THROW_UNIMPLEMENTED;
-      break;
-  }
+  xbt_dynar_free(&(trace->event_list));
   free(trace);
 }
 
@@ -380,10 +372,8 @@ tmgr_trace_iterator_t simgrid::trace_mgr::future_evt_set::add_trace(
   trace_iterator->idx = 0;
   trace_iterator->resource = resource;
 
-  if(trace->type == e_trace_list) {
-    xbt_assert((trace_iterator->idx < xbt_dynar_length(trace->s_list.event_list)),
-              "You're referring to an event that does not exist!");
-  }
+  xbt_assert((trace_iterator->idx < xbt_dynar_length(trace->event_list)),
+      "Your trace should have at least one event!");
 
   xbt_heap_push(p_heap, trace_iterator, start_time);
 
@@ -414,42 +404,19 @@ tmgr_trace_iterator_t simgrid::trace_mgr::future_evt_set::pop_leq(
   tmgr_trace_t trace = trace_iterator->trace;
   *resource = trace_iterator->resource;
 
-  if (trace->type == e_trace_list) {
-
-      tmgr_event_t event = (tmgr_event_t)xbt_dynar_get_ptr(trace->s_list.event_list, trace_iterator->idx);
+  tmgr_event_t event = (tmgr_event_t)xbt_dynar_get_ptr(trace->event_list, trace_iterator->idx);
 
-      *value = event->value;
+  *value = event->value;
 
-      if (trace_iterator->idx < xbt_dynar_length(trace->s_list.event_list) - 1) {
-        xbt_heap_push(p_heap, trace_iterator, event_date + event->delta);
-        trace_iterator->idx++;
-      } else if (event->delta > 0) {        /* Last element, checking for periodicity */
-        xbt_heap_push(p_heap, trace_iterator, event_date + event->delta);
-        trace_iterator->idx = 1; /* not 0 as the first event is a placeholder to handle when events really start */
-      } else {                      /* We don't need this trace_event anymore */
-        trace_iterator->free_me = 1;
-      }
-
-  } else if (trace->type == e_trace_probabilist) { //FIXME : not tested yet
-      double event_delta;
-      if(trace->s_probabilist.is_state_trace) {
-        *value = (double) trace->s_probabilist.next_event;
-        if(trace->s_probabilist.next_event == 0) {
-          event_delta = tmgr_event_generator_next_value(trace->s_probabilist.event_generator[0]);
-          trace->s_probabilist.next_event = 1;
-        } else {
-          event_delta = tmgr_event_generator_next_value(trace->s_probabilist.event_generator[1]);
-          trace->s_probabilist.next_event = 0;
-        }
-      } else {
-        event_delta = tmgr_event_generator_next_value(trace->s_probabilist.event_generator[0]);
-        *value = tmgr_event_generator_next_value(trace->s_probabilist.event_generator[1]);
-      }
-      xbt_heap_push(p_heap, trace_iterator, event_date + event_delta);
-      XBT_DEBUG("Generating a new event at date %f, with value %f", event_date + event_delta, *value);
-
-  } else
-    THROW_IMPOSSIBLE;
+  if (trace_iterator->idx < xbt_dynar_length(trace->event_list) - 1) {
+    xbt_heap_push(p_heap, trace_iterator, event_date + event->delta);
+    trace_iterator->idx++;
+  } else if (event->delta > 0) {        /* Last element, checking for periodicity */
+    xbt_heap_push(p_heap, trace_iterator, event_date + event->delta);
+    trace_iterator->idx = 1; /* not 0 as the first event is a placeholder to handle when events really start */
+  } else {                      /* We don't need this trace_event anymore */
+    trace_iterator->free_me = 1;
+  }
 
   return trace_iterator;
 }
index ee06f3b..a53be9e 100644 (file)
@@ -54,17 +54,7 @@ typedef struct probabilist_event_generator {
 } s_probabilist_event_generator_t;
 
 typedef struct tmgr_trace {
-  enum e_trace_type type;
-  union {
-    struct {
-      xbt_dynar_t event_list;
-    } s_list;
-    struct {
-      probabilist_event_generator_t event_generator[2];
-      int is_state_trace;
-      int next_event;
-    } s_probabilist;
-  };
+  xbt_dynar_t event_list;
 } s_tmgr_trace_t;
 
 /* Iterator within a trace */
@@ -95,9 +85,33 @@ SG_END_DECL()
 
 #ifdef __cplusplus
 namespace simgrid {
+/** @brief Modeling of the resource variations, such as those due to an external load
+ *
+ * There is 3 main concepts in this module:
+ * - #trace: a set of dated values, ie a list of pair <timestamp, value>
+ * - #trace_iterator: links a given trace to a given simgrid resource. A Cpu for example has 2 iterators: state (ie, is it ON/OFF) and speed, while a link has 3 iterators: state, bandwidth and latency.
+ * - #future_evt_set: makes it easy to find the next occuring event of all traces
+ */
   namespace trace_mgr {
 
-/* Future Event Set (collection of iterators over the traces)
+/** @brief A trace_iterator links a trace to a resource */
+XBT_PUBLIC_CLASS trace_iterator {
+
+};
+
+/** @brief A trace is a set of timed values, encoding the value that a variable takes at what time *
+ *
+ * It is useful to model dynamic platforms, where an external load that makes the resource availability change over time.
+ * To model that, you have to set several traces per resource: one for the on/off state and one for each numerical value (computational speed, bandwidt and latency).
+ */
+XBT_PUBLIC_CLASS trace {
+public:
+  /**  Creates an empty trace */
+  trace() {}
+  virtual ~trace() {}
+};
+
+/** @brief Future Event Set (collection of iterators over the traces)
  * That's useful to quickly know which is the next occurring event in a set of traces. */
 XBT_PUBLIC_CLASS future_evt_set {
 public:
index 0798011..642a6a9 100644 (file)
@@ -212,8 +212,7 @@ void xbt_cfgelm_free(void *data)
  *  @param cb_rm callback function called when a value is removed
  */
 
-void
-xbt_cfg_register(xbt_cfg_t * cfg,
+void xbt_cfg_register(xbt_cfg_t * cfg,
                  const char *name, const char *desc,
                  e_xbt_cfgelm_type_t type, int min,
                  int max, xbt_cfg_cb_t cb_set, xbt_cfg_cb_t cb_rm)
@@ -465,7 +464,8 @@ static xbt_cfgelm_t xbt_cfgelm_get(xbt_cfg_t cfg,
   if (!res) {
     xbt_cfg_help(cfg);
     THROWF(not_found_error, 0,
-           "No registered variable '%s' in this config set", name);
+           "No registered variable '%s' in this config set. It is possible that this "\
+           "configuration option has been renamed; please read the file ChangeLog carefully!", name);
   }
 
   xbt_assert(type == xbt_cfgelm_any || res->type == type,
index 6592d41..d1ff4f4 100644 (file)
@@ -695,8 +695,6 @@ static void xbt_log_connect_categories(void)
 
   /* surf */
   XBT_LOG_CONNECT(surf);
-  XBT_LOG_CONNECT(platf_generator);
-  XBT_LOG_CONNECT(random);
   XBT_LOG_CONNECT(surf_config);
   XBT_LOG_CONNECT(surf_cpu);
   XBT_LOG_CONNECT(surf_cpu_cas);
index 9c718df..7c6795f 100644 (file)
@@ -90,7 +90,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason,
 
 static void xbt_preinit(void) {
   unsigned int seed = 2147483647;
-#ifndef WIN32
+#ifndef _XBT_WIN32
   xbt_pagesize = sysconf(_SC_PAGESIZE);
 #else
   SYSTEM_INFO si;
@@ -115,7 +115,7 @@ static void xbt_preinit(void) {
   xbt_dict_preinit();
    
   srand(seed);
-#ifndef _WIN32
+#ifndef _XBT_WIN32
   srand48(seed);
 #endif
   atexit(xbt_postexit);
index db8e2ac..fd52a4d 100644 (file)
@@ -45,7 +45,7 @@ void xbt_mutex_release(xbt_mutex_t mutex)
 
 void xbt_mutex_destroy(xbt_mutex_t mutex)
 {
-  simcall_mutex_destroy((smx_mutex_t) mutex);
+  SIMIX_mutex_destroy((smx_mutex_t) mutex);
 }
 
 /***** condition related functions *****/
@@ -80,7 +80,7 @@ void xbt_cond_broadcast(xbt_cond_t cond)
 
 void xbt_cond_destroy(xbt_cond_t cond)
 {
-  simcall_cond_destroy((smx_cond_t) cond);
+  SIMIX_cond_destroy((smx_cond_t) cond);
 }
 
 /***** barrier related functions *****/
index f7ed95e..095a28c 100644 (file)
@@ -1,6 +1,6 @@
 /* xbt_os_thread -- portability layer over the pthread API                  */
 /* Used in RL to get win/lin portability, and in SG when CONTEXT_THREAD     */
-/* in SG, when using CONTEXT_UCONTEXT, xbt_os_thread_stub is used instead   */
+/* in SG, when using HAVE_UCONTEXT_CONTEXTS, xbt_os_thread_stub is used instead   */
 
 /* Copyright (c) 2007-2015. The SimGrid Team.
  * All rights reserved.                                                     */
@@ -291,14 +291,10 @@ void xbt_os_thread_exit(int *retval)
 
 xbt_os_thread_t xbt_os_thread_self(void)
 {
-  xbt_os_thread_t res;
-
   if (!thread_mod_inited)
     return NULL;
 
-  res = pthread_getspecific(xbt_self_thread_key);
-
-  return res;
+  return pthread_getspecific(xbt_self_thread_key);
 }
 
 void xbt_os_thread_key_create(xbt_os_thread_key_t* key) {
@@ -1303,8 +1299,7 @@ void xbt_os_thread_set_extra_data(void *data)
 
 void *xbt_os_thread_get_extra_data(void)
 {
-  xbt_os_thread_t self = xbt_os_thread_self();
-  return self? self->extra_data : NULL;
+  return xbt_os_thread_self()->extra_data;
 }
 
 xbt_os_rmutex_t xbt_os_rmutex_init(void)
index 5935010..cfb2fea 100644 (file)
@@ -18,9 +18,9 @@
 #include "src/xbt_modinter.h"
 #include "xbt/sysdep.h"
 #include "xbt/xbt_os_thread.h"
-#include "src/portable.h"           /* CONTEXT_THREADS */
+#include "src/portable.h"           /* HAVE_THREAD_CONTEXTS */
 
-#ifndef CONTEXT_THREADS
+#ifndef HAVE_THREAD_CONTEXTS
 #ifndef WIN32
 #ifdef HAVE_PTHREAD
 /* xbt_threads is loaded in libsimgrid when they are used to implement the xbt_context.
diff --git a/teshsuite/java/semaphore/CMakeLists.txt b/teshsuite/java/semaphore/CMakeLists.txt
new file mode 100644 (file)
index 0000000..e86706b
--- /dev/null
@@ -0,0 +1,40 @@
+set(example java_semaphore_gc)
+set(sources
+  ${CMAKE_CURRENT_SOURCE_DIR}/SemaphoreGC.java
+  )
+
+if(enable_java)
+  add_custom_command(
+    COMMENT "Building ${example}..."
+    OUTPUT ${example}_compiled
+    DEPENDS ${sources} simgrid-java_jar ${SIMGRID_JAR}
+    COMMAND ${JAVA_COMPILE} -classpath ${SIMGRID_JAR}
+                             -d ${CMAKE_CURRENT_BINARY_DIR}/.. ${sources}
+    COMMAND ${CMAKE_COMMAND} -E remove ${example}_compiled
+    COMMAND ${CMAKE_COMMAND} -E touch ${example}_compiled
+  )
+  add_custom_target(${example} ALL DEPENDS ${example}_compiled)
+endif()
+
+set(tesh_files
+  ${tesh_files}
+  ${CMAKE_CURRENT_SOURCE_DIR}/semaphore_gc.tesh
+  PARENT_SCOPE
+  )
+set(xml_files
+  ${xml_files}
+  PARENT_SCOPE
+  )
+set(examples_src
+  ${examples_src}
+  ${sources}
+  PARENT_SCOPE
+  )
+set(bin_files
+  ${bin_files}
+  PARENT_SCOPE
+  )
+set(txt_files
+  ${txt_files}
+  PARENT_SCOPE
+  )
diff --git a/teshsuite/java/semaphore/SemaphoreGC.java b/teshsuite/java/semaphore/SemaphoreGC.java
new file mode 100644 (file)
index 0000000..ec1b6aa
--- /dev/null
@@ -0,0 +1,56 @@
+/* Copyright (c) 2016. The SimGrid Team. All rights reserved.               */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+/* This test ensures that the used semaphores are not garbage-collected while we still use it.
+ * This was reported as bug #19893 on gforge.
+ */
+
+package semaphore;
+
+import org.simgrid.msg.*;
+import org.simgrid.msg.Process;
+import org.simgrid.trace.Trace;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+
+class SemCreator extends Process {
+       Semaphore sem; 
+
+       SemCreator(Host h, String n){
+               super(h, n);
+       }
+
+       public void main(String[] args) throws MsgException{
+               int j; 
+               Msg.info("Creating 50 new Semaphores, yielding and triggering a GC after each");
+               for(j = 1; j <= 50; j++) {
+                       sem = new Semaphore(0);
+                       waitFor(10); 
+                       System.gc();
+               }
+               Msg.info("It worked, we survived. The test is passed.");
+       }
+}
+
+
+public class SemaphoreGC {
+       public static void main(String[] args) throws Exception {
+
+               Msg.init(args);
+               if (args.length < 1) {
+                       Msg.info("Usage: java -cp simgrid.jar:. semaphore.SemaphoreGC <deployment.xml>");
+                       System.exit(1);                 
+               }
+               Msg.createEnvironment(args[0]);
+
+               Host[] hosts = Host.all();
+               new SemCreator(hosts[0], "SemCreator").start();
+
+               Msg.run();
+       }
+
+}
diff --git a/teshsuite/java/semaphore/semaphore_gc.tesh b/teshsuite/java/semaphore/semaphore_gc.tesh
new file mode 100644 (file)
index 0000000..f55f053
--- /dev/null
@@ -0,0 +1,5 @@
+$ java -classpath ${classpath:=.} semaphore.SemaphoreGC ${srcdir:=.}/../../examples/platforms/small_platform.xml "--log=root.fmt:[%10.4r]%e(%i:%P@%h)%e%m%n"
+> [    0.0000] (0:maestro@) Using regular java threads.
+> [    0.0000] (1:SemCreator@Fafard) Creating 50 new Semaphores, yielding and triggering a GC after each
+> [ 1500.0000] (1:SemCreator@Fafard) It worked, we survived. The test is passed.
+> [ 1500.0000] (0:maestro@) MSG_main finished; Cleaning up the simulation...
index 18c2174..90ba170 100644 (file)
@@ -1,6 +1,5 @@
 set(example java_sleep_host_off)
 set(sources
-  ${CMAKE_CURRENT_SOURCE_DIR}/Main.java
   ${CMAKE_CURRENT_SOURCE_DIR}/SleepHostOff.java
   )
 
diff --git a/teshsuite/java/sleep_host_off/Main.java b/teshsuite/java/sleep_host_off/Main.java
deleted file mode 100644 (file)
index 3cc4cea..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-package sleep_host_off;
-
-import org.simgrid.msg.Host;
-import org.simgrid.msg.HostNotFoundException;
-import org.simgrid.msg.Msg;
-import org.simgrid.msg.NativeException;
-
-public class Main {
-
-    public static void main(String[] args) throws NativeException {
-       /* Init. internal values */
-        Msg.init(args);
-
-        if (args.length < 2) {
-            Msg.info("Usage  : Main platform_file.xml dployment_file.xml");
-            System.exit(1);
-        }
-
-       /* construct the platform and deploy the application */
-        Msg.createEnvironment(args[0]);
-        Msg.deployApplication(args[1]);
-
-        try {
-            Msg.run();
-        } catch (Exception e){
-            System.out.println("Bye bye the program crashes !");
-        }
-
-    }
-}
index 1d60cad..cebf7af 100644 (file)
@@ -14,42 +14,63 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Random;
 
-public class SleepHostOff extends Process{
-  public static Host jupiter = null;
-
-  public SleepHostOff(Host host, String name, String[]args) {
-    super(host,name,args);
-  }
-
-  public void main(String[] strings) throws MsgException {
-
-    try {
-      jupiter = Host.getByName("Jupiter");
-    } catch (HostNotFoundException e) {
-      e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
-    }
-
-    Msg.info("**** **** **** ***** ***** Test Sleep ***** ***** **** **** ****");
-    Msg.info("Test sleep: Create a process on Jupiter, the process simply make periodic sleep, turn off Jupiter");
-    new Process(jupiter, "sleep", null) {
-      public void main(String[] args) {
-        while (true) {
-          Msg.info("I'm not dead");
-          try {
-            Process.sleep(10);
-          } catch (HostFailureException e) {
-            Msg.info("catch HostException: "+e.getLocalizedMessage());
-            break; //Break is needed to finalize the endless loop 
-          }
-        }
-      }
-    }.start();
-
-    Process.sleep(20);
-    Msg.info("Stop Jupiter");
-    jupiter.off();
-    Msg.info("Jupiter has been stopped");
-    Process.sleep(300);
-    Msg.info("Test sleep seems ok, cool !(number of Process : " + Process.getCount() + ", it should be 1 (i.e. the Test one))\n");
-  }
+class Sleeper extends Process {
+       public Sleeper(Host host, String name, String[] args) {
+               super(host,name,args);
+       }
+       public void main(String[] args) {
+               while (true) {
+                       Msg.info("I'm not dead");
+                       try {
+                               Process.sleep(10);
+                       } catch (HostFailureException e) {
+                               Msg.info("catch HostException: "+e.getLocalizedMessage());
+                               break; //Break is needed to finalize the endless loop 
+                       }
+               }
+       }       
+}
+
+class TestRunner extends Process {
+
+       public TestRunner(Host host, String name, String[] args) {
+               super(host,name,args);
+       }
+
+       public void main(String[] strings) throws MsgException {
+               Host host = Host.all()[1];
+
+
+               Msg.info("**** **** **** ***** ***** Test Sleep ***** ***** **** **** ****");
+               Msg.info("Test sleep: Create a process on "+host.getName()+" that simply make periodic sleep, turn off "+host.getName());
+               new Sleeper(host, "Sleeper", null).start();
+
+               waitFor(0.02);
+               Msg.info("Stop "+host.getName());
+               host.off();
+               Msg.info(host.getName()+" has been stopped");
+               waitFor(0.3);
+               Msg.info("Test sleep seems ok, cool! (number of Process : " + Process.getCount() + ", it should be 1 (i.e. the Test one))");
+       }
+}
+
+public class SleepHostOff {
+
+       public static void main(String[] args) throws Exception {
+               /* Init. internal values */
+               Msg.init(args);
+
+               if (args.length < 1) {
+                       Msg.info("Usage: java -cp simgrid.jar:. sleep_host_off.SleepHostOff <platform.xml>");
+                       System.exit(1);
+               }
+
+               /* construct the platform and deploy the application */
+               Msg.createEnvironment(args[0]);
+
+               Host[] hosts = Host.all();
+               new TestRunner(hosts[0], "TestRunner", null).start();
+
+               Msg.run();
+       }
 }
index 5e77e17..c371d7f 100644 (file)
@@ -1,13 +1,12 @@
-$ java -classpath ${classpath:=.} sleep_host_off.Main ${srcdir:=.}/../../examples/platforms/small_platform.xml ${srcdir:=.}/sleep_host_off/sleep_host_off_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ java -classpath ${classpath:=.} sleep_host_off.SleepHostOff ${srcdir:=.}/../../examples/platforms/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (0:maestro@) Using regular java threads.
-> [  0.000000] (1:sleep_host_off.SleepHostOff@Tremblay) **** **** **** ***** ***** Test Sleep ***** ***** **** **** ****
-> [  0.000000] (1:sleep_host_off.SleepHostOff@Tremblay) Test sleep: Create a process on Jupiter, the process simply make periodic sleep, turn off Jupiter
-> [  0.000000] (2:sleep@Jupiter) I'm not dead
-> [  0.010000] (2:sleep@Jupiter) I'm not dead
-> [  0.020000] (1:sleep_host_off.SleepHostOff@Tremblay) Stop Jupiter
-> [  0.020000] (2:sleep@Jupiter) I'm not dead
-> [  0.020000] (2:sleep@Jupiter) catch HostException: Host Failure (null)
-> [  0.020000] (1:sleep_host_off.SleepHostOff@Tremblay) Jupiter has been stopped
-> [  0.320000] (1:sleep_host_off.SleepHostOff@Tremblay) Test sleep seems ok, cool !(number of Process : 1, it should be 1 (i.e. the Test one))
->
+> [  0.000000] (1:TestRunner@Fafard) **** **** **** ***** ***** Test Sleep ***** ***** **** **** ****
+> [  0.000000] (1:TestRunner@Fafard) Test sleep: Create a process on Tremblay that simply make periodic sleep, turn off Tremblay
+> [  0.000000] (2:Sleeper@Tremblay) I'm not dead
+> [  0.010000] (2:Sleeper@Tremblay) I'm not dead
+> [  0.020000] (1:TestRunner@Fafard) Stop Tremblay
+> [  0.020000] (2:Sleeper@Tremblay) I'm not dead
+> [  0.020000] (2:Sleeper@Tremblay) catch HostException: Host Failure (null)
+> [  0.020000] (1:TestRunner@Fafard) Tremblay has been stopped
+> [  0.320000] (1:TestRunner@Fafard) Test sleep seems ok, cool! (number of Process : 1, it should be 1 (i.e. the Test one))
 > [  0.320000] (0:maestro@) MSG_main finished; Cleaning up the simulation...
index 2af91af..39ad856 100644 (file)
@@ -4,10 +4,8 @@
  *  (C) 2003 by Argonne National Laboratory.
  *      See COPYRIGHT in top-level directory.
  */
-
 #include "mpi.h"
 #include "mpitest.h"
-#include "smpi_cocci.h"
 #include <stdio.h>
 #include <stdlib.h>
 #ifdef HAVE_SYS_TIME_H
 #include <time.h>
 #include <math.h>
 #include <assert.h>
-
 /* FIXME: What is this test supposed to accomplish? */
-
 #define START_BUF (1)
 #define LARGE_BUF (256 * 1024)
-
 /* FIXME: MAX_BUF is too large */
 #define MAX_BUF   (32 * 1024 * 1024)
 #define LOOPS 10
-
-SMPI_VARINIT_GLOBAL(sbuf, char*);
-SMPI_VARINIT_GLOBAL(rbuf, char*);
-SMPI_VARINIT_GLOBAL(recvcounts, int*);
-SMPI_VARINIT_GLOBAL(displs, int*);
-SMPI_VARINIT_GLOBAL_AND_SET(errs, int, 0);
-
+char *sbuf, *rbuf;
+int *recvcounts, *displs;
+int errs = 0;
 /* #define dprintf printf */
 #define dprintf(...)
-
 typedef enum {
     REGULAR,
     BCAST,
@@ -43,46 +33,43 @@ typedef enum {
     LINEAR_DECREASE,
     BELL_CURVE
 } test_t;
-
 void comm_tests(MPI_Comm comm);
-double run_test(long long msg_size, MPI_Comm comm, test_t test_type, double * max_time);
-
-int main(int argc, char ** argv)
+double run_test(long long msg_size, MPI_Comm comm, test_t test_type, double *max_time);
+int main(int argc, char **argv)
 {
     int comm_size, comm_rank;
     MPI_Comm comm;
-
     MTest_Init(&argc, &argv);
     MPI_Comm_size(MPI_COMM_WORLD, &comm_size);
     MPI_Comm_rank(MPI_COMM_WORLD, &comm_rank);
-
+    if (comm_size < 3) {
+        fprintf(stderr, "At least 3 processes required\n");
+        MPI_Abort(MPI_COMM_WORLD, 1);
+    }
     if (LARGE_BUF * comm_size > MAX_BUF)
         goto fn_exit;
-
-    SMPI_VARGET_GLOBAL(sbuf) = (void *) calloc(MAX_BUF, 1);
-    SMPI_VARGET_GLOBAL(rbuf) = (void *) calloc(MAX_BUF, 1);
-
+    sbuf = (void *) calloc(MAX_BUF, 1);
+    rbuf = (void *) calloc(MAX_BUF, 1);
     srand(time(NULL));
-
-    SMPI_VARGET_GLOBAL(recvcounts) = (void *) malloc(comm_size * sizeof(int));
-    SMPI_VARGET_GLOBAL(displs) = (void *) malloc(comm_size * sizeof(int));
-    if (!SMPI_VARGET_GLOBAL(recvcounts) || !SMPI_VARGET_GLOBAL(displs) || !SMPI_VARGET_GLOBAL(sbuf) || !SMPI_VARGET_GLOBAL(rbuf)) {
+    recvcounts = (void *) malloc(comm_size * sizeof(int));
+    displs = (void *) malloc(comm_size * sizeof(int));
+    if (!recvcounts || !displs || !sbuf || !rbuf) {
         fprintf(stderr, "Unable to allocate memory:\n");
-       if (!SMPI_VARGET_GLOBAL(sbuf)) fprintf(stderr,"\tsbuf of %d bytes\n", MAX_BUF );
-       if (!SMPI_VARGET_GLOBAL(rbuf)) fprintf(stderr,"\trbuf of %d bytes\n", MAX_BUF );
-       if (!SMPI_VARGET_GLOBAL(recvcounts)) fprintf(stderr,"\trecvcounts of %zd bytes\n", comm_size * sizeof(int) );
-       if (!SMPI_VARGET_GLOBAL(displs)) fprintf(stderr,"\tdispls of %zd bytes\n", comm_size * sizeof(int) );
+        if (!sbuf)
+            fprintf(stderr, "\tsbuf of %d bytes\n", MAX_BUF);
+        if (!rbuf)
+            fprintf(stderr, "\trbuf of %d bytes\n", MAX_BUF);
+        if (!recvcounts)
+            fprintf(stderr, "\trecvcounts of %zd bytes\n", comm_size * sizeof(int));
+        if (!displs)
+            fprintf(stderr, "\tdispls of %zd bytes\n", comm_size * sizeof(int));
         fflush(stderr);
         MPI_Abort(MPI_COMM_WORLD, -1);
-        exit(-1);
     }
-
     if (!comm_rank) {
         dprintf("Message Range: (%d, %d); System size: %d\n", START_BUF, LARGE_BUF, comm_size);
         fflush(stdout);
     }
-
-
     /* COMM_WORLD tests */
     if (!comm_rank) {
         dprintf("\n\n==========================================================\n");
@@ -90,7 +77,6 @@ int main(int argc, char ** argv)
         dprintf("==========================================================\n");
     }
     comm_tests(MPI_COMM_WORLD);
-
     /* non-COMM_WORLD tests */
     if (!comm_rank) {
         dprintf("\n\n==========================================================\n");
@@ -101,7 +87,6 @@ int main(int argc, char ** argv)
     if (comm_rank < comm_size - 1)
         comm_tests(comm);
     MPI_Comm_free(&comm);
-
     /* Randomized communicator tests */
     if (!comm_rank) {
         dprintf("\n\n==========================================================\n");
@@ -111,65 +96,53 @@ int main(int argc, char ** argv)
     MPI_Comm_split(MPI_COMM_WORLD, 0, rand(), &comm);
     comm_tests(comm);
     MPI_Comm_free(&comm);
-
-    free(SMPI_VARGET_GLOBAL(sbuf));
-    free(SMPI_VARGET_GLOBAL(rbuf));
-    free(SMPI_VARGET_GLOBAL(recvcounts));
-    free(SMPI_VARGET_GLOBAL(displs));
-
-fn_exit:
-    MTest_Finalize(SMPI_VARGET_GLOBAL(errs));
+    free(sbuf);
+    free(rbuf);
+    free(recvcounts);
+    free(displs);
+  fn_exit:
+    MTest_Finalize(errs);
     MPI_Finalize();
-
     return 0;
 }
-
 void comm_tests(MPI_Comm comm)
 {
     int comm_size, comm_rank;
     double rtime = rtime;       /* stop warning about unused variable */
&n