Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid
authorMartin Quinson <martin.quinson@loria.fr>
Fri, 24 Jul 2015 14:26:33 +0000 (16:26 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Fri, 24 Jul 2015 14:26:33 +0000 (16:26 +0200)
NEWS
contrib/psg/Makefile [new file with mode: 0644]
contrib/psg/run.sh
contrib/psg/test.sh
src/mc/mc_base.cpp
src/mc/mc_client_api.cpp
src/mc/mc_dwarf.cpp
src/mc/mc_forward.hpp
src/mc/mc_object_info.h

diff --git a/NEWS b/NEWS
index adbde2e..9c9508a 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -9,9 +9,9 @@ __   _____ _ __ ___(_) ___  _ __   |___ / / |___ \
  * Surf internal cleanup: rename workstation into host.
    Option "workstation/model" now reads "host/model"
  * The model checker now runs in a separate process.
- * The mocel checker has support for memory compaction of its snapshots.
- * MC record/replay: a interesting path found by the modelchecker can be replayed
-   outside of the modelchecker.
+ * The model checker has support for memory compaction of its snapshots.
+ * MC record/replay: a interesting path found by the modelchecker can be
+   replayed outside of the modelchecker.
                     _               _____  _ _
 __   _____ _ __ ___(_) ___  _ __   |___ / / / |
 \ \ / / _ \ '__/ __| |/ _ \| '_ \    |_ \ | | |
diff --git a/contrib/psg/Makefile b/contrib/psg/Makefile
new file mode 100644 (file)
index 0000000..43fc9dd
--- /dev/null
@@ -0,0 +1,27 @@
+LIB_JARS= lib.jar
+
+all: compile doc
+
+compile:
+       mkdir -p classes
+       javac -sourcepath src -classpath $(LIB_JARS):../../simgrid.jar -d classes `find -L -name "*.java"`
+
+doc:
+       mkdir -p doc
+       javadoc -sourcepath src -classpath $(LIB_JARS):../../simgrid.jar -d doc psgsim
+
+test:
+       ./test.sh 
+
+clean: 
+       rm -rf classes doc outputs
+       
+# Help Target
+help:
+       @echo "The following are a valid targets for this Makefile:"
+       @echo "................ all (the default if no target is provided)"
+       @echo "................ compile"
+       @echo "................ doc"
+       @echo "................ test"
+       @echo "................ clean"
+       
index ecac88c..baac2ee 100755 (executable)
@@ -6,7 +6,7 @@ else
        eval ulimit -s 128
 fi
 echo '------------- Start execution..';
-java -Xmx1024m -cp lib.jar:classes peersim.Simulator $1
+java -Xmx1024m -cp lib.jar:classes:../../simgrid.jar peersim.Simulator $1
 echo '------------- done -------------';
 exit 0
 
index f5b7f09..7f6d61c 100755 (executable)
@@ -9,19 +9,19 @@ fi
 echo -e "\n";
 echo '------------- Execute the edaggregation example under PSG -------------';
 echo -e "\n";
-java -Xmx1024m -cp lib.jar:classes peersim.Simulator configs/edaggregationPSG.txt
+java -Xmx1024m -cp lib.jar:classes:../../simgrid.jar peersim.Simulator configs/edaggregationPSG.txt
 echo -e "\n";
 echo '------------- Execute the edaggregation example under PS -------------';
 echo -e "\n";
-java -Xmx1024m -cp lib.jar:classes peersim.Simulator configs/edaggregation.txt
+java -Xmx1024m -cp lib.jar:classes:../../simgrid.jar peersim.Simulator configs/edaggregation.txt
 echo -e "\n";
 echo '------------- Execute the chord example under PSG -------------';
 echo -e "\n";
-java -Xmx1024m -cp lib.jar:classes peersim.Simulator configs/chordPSG.txt
+java -Xmx1024m -cp lib.jar:classes:../../simgrid.jar peersim.Simulator configs/chordPSG.txt
 echo -e "\n";
 echo '------------- Execute the chord example under PS -------------';
 echo -e "\n";
-java -Xmx1024m -cp lib.jar:classes peersim.Simulator configs/chord.txt
+java -Xmx1024m -cp lib.jar:classes:../../simgrid.jar peersim.Simulator configs/chord.txt
 echo -e "\n";
 echo '------------- Compare the 2 results PS and PSG -------------';
 echo -e "\n";
index bc0e314..c0f9ab9 100644 (file)
@@ -177,12 +177,6 @@ int MC_request_is_visible(smx_simcall_t req)
       ;
 }
 
-int MC_random(int min, int max)
-{
-  /*FIXME: return mc_current_state->executed_transition->random.value; */
-  return simcall_mc_random(min, max);
-}
-
 static int prng_random(int min, int max)
 {
   unsigned long output_size = ((unsigned long) max - (unsigned long) min) + 1;
index c80d9dd..bdc12a2 100644 (file)
@@ -28,6 +28,17 @@ extern "C" {
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_client_api, mc,
   "Public API for the model-checked application");
 
+}
+
+int MC_random(int min, int max)
+{
+  xbt_assert(mc_mode != MC_MODE_SERVER);
+  /* TODO, if the MC is disabled we do not really need to make a simcall for
+   * this :) */
+  /* FIXME: return mc_current_state->executed_transition->random.value; */
+  return simcall_mc_random(min, max);
+}
+
 void MC_assert(int prop)
 {
   if (MC_is_active() && !prop) {
@@ -36,8 +47,6 @@ void MC_assert(int prop)
   }
 }
 
-// TODO, MC_automaton_new_propositional_symbol
-
 void *MC_snapshot(void)
 {
   return simcall_mc_snapshot();
@@ -98,5 +107,3 @@ void MC_automaton_new_propositional_symbol_pointer(const char *name, int* value)
   message.data = value;
   MC_client_send_message(&message, sizeof(message));
 }
-
-}
index 0b0e2e4..3ac63ab 100644 (file)
@@ -610,14 +610,11 @@ static simgrid::mc::Type MC_dwarf_die_to_type(
   Dwarf_Die * unit, simgrid::mc::Frame* frame,
   const char *ns)
 {
-
   simgrid::mc::Type type;
-  type.type = -1;
+  type.type = dwarf_tag(die);
   type.name = std::string();
   type.element_count = -1;
 
-  type.type = dwarf_tag(die);
-
   // Global Offset
   type.id = dwarf_dieoffset(die);
 
@@ -1141,7 +1138,7 @@ std::shared_ptr<simgrid::mc::ObjectInformation> MC_find_object_info(
   std::shared_ptr<simgrid::mc::ObjectInformation> result =
     std::make_shared<simgrid::mc::ObjectInformation>();
   if (executable)
-    result->flags |= MC_OBJECT_INFO_EXECUTABLE;
+    result->flags |= simgrid::mc::ObjectInformation::Executable;
   result->file_name = name;
   MC_find_object_address(maps, result.get());
   MC_dwarf_get_variables(result.get());
index 932d333..551bee4 100644 (file)
 #define SIMGRID_MC_FORWARD_HPP
 
 #ifndef __has_feature
-  #define __has_feature(x) 0
-#endif
-
-#if __has_feature(cxx_override_control)
-  #define MC_OVERRIDE override
-#else
   #define MC_OVERRIDE
+#else
+  #if __has_feature(cxx_override_control)
+    #define MC_OVERRIDE override
+  #else
+    #define MC_OVERRIDE
+  #endif
 #endif
 
 namespace simgrid {
index c04b917..2ec4e56 100644 (file)
@@ -30,8 +30,6 @@
 
 // ***** Type
 
-typedef int e_mc_type_type;
-
 namespace simgrid {
 namespace mc {
 
@@ -47,7 +45,8 @@ public:
   Type(Type&& type) = default;
   Type& operator=(Type&&) = default;
 
-  e_mc_type_type type;
+  /** The DWARF TAG of the type (e.g. DW_TAG_array_type) */
+  int type;
   Dwarf_Off id; /* Offset in the section (in hexadecimal form) */
   std::string name; /* Name of the type */
   int byte_size; /* Size in bytes */
@@ -89,11 +88,6 @@ public:
 
 // ***** Object info
 
-/** Bit field of options */
-typedef int mc_object_info_flags;
-#define MC_OBJECT_INFO_NONE 0
-#define MC_OBJECT_INFO_EXECUTABLE 1
-
 namespace simgrid {
 namespace mc {
 
@@ -165,7 +159,11 @@ public:
   ObjectInformation(ObjectInformation const&) = delete;
   ObjectInformation& operator=(ObjectInformation const&) = delete;
 
-  mc_object_info_flags flags;
+  // Flag:
+  static const int Executable = 1;
+
+  /** Bitfield of flags */
+  int flags;
   std::string file_name;
   const void* start;
   const void *end;
@@ -190,7 +188,7 @@ public:
 
   bool executable() const
   {
-    return this->flags & MC_OBJECT_INFO_EXECUTABLE;
+    return this->flags & simgrid::mc::ObjectInformation::Executable;
   }
 
   bool privatized() const
@@ -201,7 +199,6 @@ public:
   void* base_address() const;
 
   simgrid::mc::Frame* find_function(const void *ip) const;
-  // TODO, should be simgrid::mc::Variable*
   simgrid::mc::Variable* find_variable(const char* name) const;
 
 };