* 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.
_ _____ _ _
__ _____ _ __ ___(_) ___ _ __ |___ / / / |
\ \ / / _ \ '__/ __| |/ _ \| '_ \ |_ \ | | |
--- /dev/null
+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"
+
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
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";
;
}
-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;
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) {
}
}
-// TODO, MC_automaton_new_propositional_symbol
-
void *MC_snapshot(void)
{
return simcall_mc_snapshot();
message.data = value;
MC_client_send_message(&message, sizeof(message));
}
-
-}
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);
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());
#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 {
// ***** Type
-typedef int e_mc_type_type;
-
namespace simgrid {
namespace mc {
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 */
// ***** 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 {
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;
bool executable() const
{
- return this->flags & MC_OBJECT_INFO_EXECUTABLE;
+ return this->flags & simgrid::mc::ObjectInformation::Executable;
}
bool privatized() const
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;
};