#include <string.h>
#include "simgrid/simdag.h"
-#if HAVE_JEDULE
+#if SIMGRID_HAVE_JEDULE
#include "simgrid/jedule/jedule_sd_binding.h"
#endif
XBT_INFO("Simulation Time: %f", SD_get_clock());
XBT_INFO("------------------- Produce the trace file---------------------------");
XBT_INFO("Producing a jedule output (if active) of the run into %s", tracefilename?tracefilename:"minmin_test.jed");
-#if HAVE_JEDULE
+#if SIMGRID_HAVE_JEDULE
jedule_sd_dump(tracefilename);
#endif
free(tracefilename);
#include "jedule_events.hpp"
#include "jedule_platform.hpp"
-#if HAVE_JEDULE
+#if SIMGRID_HAVE_JEDULE
XBT_ATTRIB_UNUSED static std::unordered_map <const char *, jed_container_t> host2_simgrid_parent_container;
XBT_ATTRIB_UNUSED static std::unordered_map <std::string, jed_container_t> container_name2container;
#include "jedule_platform.hpp"
-#if HAVE_JEDULE
+#if SIMGRID_HAVE_JEDULE
namespace simgrid {
namespace jedule{
#include <unordered_map>
#include <vector>
#include <string>
-#if HAVE_JEDULE
+#if SIMGRID_HAVE_JEDULE
namespace simgrid {
namespace jedule{
#include "simgrid_config.h"
#include "simgrid/simdag.h"
-#if HAVE_JEDULE
+#if SIMGRID_HAVE_JEDULE
SG_BEGIN_DECL()
XBT_PUBLIC(void) jedule_log_sd_event(SD_task_t task);
XBT_PUBLIC(void) jedule_sd_init(void);
#include <stdbool.h>
-#include <simgrid_config.h> /* HAVE_MC ? */
+#include <simgrid_config.h> /* SIMGRID_HAVE_MC ? */
#include <xbt/base.h>
XBT_PUBLIC(int) MC_random(int min, int max);
-#if HAVE_MC
+#if SIMGRID_HAVE_MC
/* Internal variable used to check if we're running under the MC
*
#define nanosleep(x, y) smpi_nanosleep(x, y)
#define clock_gettime(x, y) smpi_clock_gettime(x, y)
#endif
-#if HAVE_MC
+#if SIMGRID_HAVE_MC
#undef assert
#define assert(x) MC_assert(x)
#endif
#include <cstdarg>
#include <stdlib.h>
-#if HAVE_MC
+#if SIMGRID_HAVE_MC
#include <stdexcept>
#include <cstddef>
namespace simgrid {
namespace xbt {
-#if HAVE_MC
+#if SIMGRID_HAVE_MC
/** POD structure representation of a string
*/
#ifndef MC_MC_H
#define MC_MC_H
-#include <src/internal_config.h>
+#include <simgrid/modelchecker.h> /* our public interface (and definition of SIMGRID_HAVE_MC) */
#include <simgrid/simix.h>
-#include <simgrid/modelchecker.h> /* our public interface (and definition of HAVE_MC) */
+#include <src/internal_config.h>
#if HAVE_UCONTEXT_H
#include <ucontext.h> /* context relative declarations */
#endif
#include "xbt/asserts.h"
#include "simgrid/jedule/jedule.hpp"
-#if HAVE_JEDULE
+#if SIMGRID_HAVE_JEDULE
namespace simgrid{
namespace jedule {
#include "simgrid/s4u/NetZone.hpp"
#include "xbt/asserts.h"
-#if HAVE_JEDULE
+#if SIMGRID_HAVE_JEDULE
namespace simgrid{
namespace jedule{
#include "xbt/dynar.h"
#include <algorithm>
-#if HAVE_JEDULE
+#if SIMGRID_HAVE_JEDULE
namespace simgrid {
namespace jedule {
#include "simgrid/s4u/Engine.hpp"
#include "simgrid/s4u/NetZone.hpp"
-#if HAVE_JEDULE
+#if SIMGRID_HAVE_JEDULE
XBT_LOG_NEW_CATEGORY(jedule, "Logging specific to Jedule");
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(jed_sd, jedule, "Logging specific to Jedule SD binding");
e_smx_comm_type_t type; /* Type of the communication (SIMIX_COMM_SEND or SIMIX_COMM_RECEIVE) */
smx_mailbox_t mbox = nullptr; /* Rendez-vous where the comm is queued */
-#if HAVE_MC
+#if SIMGRID_HAVE_MC
smx_mailbox_t mbox_cpy = nullptr; /* Copy of the rendez-vous where the comm is queued, MC needs it for DPOR
(comm.mbox set to nullptr when the communication is removed from the mailbox
(used as garbage collector)) */
void ContextFactory::declare_context(void* context, std::size_t size)
{
-#if HAVE_MC
+#if SIMGRID_HAVE_MC
/* Store the address of the stack in heap to compare it apart of heap comparison */
if(MC_is_active())
MC_ignore_heap(context, size);
sysv_maestro_context = this;
}
-#if HAVE_MC
+#if SIMGRID_HAVE_MC
if (MC_is_active() && has_code()) {
MC_register_stack_area(this->stack_, process,
&(this->uc_), smx_context_usable_stack_size);
#include "src/kernel/activity/SynchroSleep.hpp"
#include "src/kernel/activity/SynchroExec.hpp"
-#if HAVE_MC
+#if SIMGRID_HAVE_MC
#include "src/mc/mc_request.h"
#include "src/mc/Process.hpp"
#include "src/mc/ModelChecker.hpp"
int MC_random(int min, int max)
{
-#if HAVE_MC
+#if SIMGRID_HAVE_MC
xbt_assert(mc_model_checker == nullptr);
/* TODO, if the MC is disabled we do not really need to make a simcall for
* this :) */
void wait_for_requests(void)
{
-#if HAVE_MC
+#if SIMGRID_HAVE_MC
xbt_assert(mc_model_checker == nullptr);
#endif
SIMIX_simcall_handle(req, 0);
}
}
-#if HAVE_MC
+#if SIMGRID_HAVE_MC
xbt_dynar_reset(simix_global->actors_vector);
for (std::pair<aid_t, smx_actor_t> kv : simix_global->process_list) {
xbt_dynar_push_as(simix_global->actors_vector, smx_actor_t, kv.second);
simgrid::kernel::activity::Comm *act =
static_cast<simgrid::kernel::activity::Comm*>(simcall_comm_wait__get__comm(req));
-#if HAVE_MC
+#if SIMGRID_HAVE_MC
// Fetch from MCed memory:
// HACK, type puning
if (mc_model_checker != nullptr) {
simgrid::kernel::activity::Comm *act =
static_cast<simgrid::kernel::activity::Comm*>(simcall_comm_wait__get__comm(req));
-#if HAVE_MC
+#if SIMGRID_HAVE_MC
s_xbt_dynar_t comms_buffer;
size_t buffer_size = 0;
if (mc_model_checker != nullptr) {
#endif
for (index = 0; index < comms->used; ++index) {
-#if HAVE_MC
+#if SIMGRID_HAVE_MC
// Fetch act from MCed memory:
// HACK, type puning
simgrid::mc::Remote<simgrid::kernel::activity::Comm> temp_comm;
case SIMCALL_MUTEX_LOCK: {
smx_mutex_t mutex = simcall_mutex_lock__get__mutex(req);
-#if HAVE_MC
+#if SIMGRID_HAVE_MC
simgrid::mc::Remote<simgrid::simix::Mutex> temp_mutex;
if (mc_model_checker != nullptr) {
mc_model_checker->process().read(temp_mutex.getBuffer(), remote(mutex));
if(mutex->owner == nullptr)
return true;
-#if HAVE_MC
+#if SIMGRID_HAVE_MC
else if (mc_model_checker != nullptr) {
simgrid::mc::Process& modelchecked = mc_model_checker->process();
// TODO, *(mutex->owner) :/
#include <simgrid/sg_config.h>
-#if HAVE_MC
+#if SIMGRID_HAVE_MC
#include "src/mc/mc_safety.h"
#include "src/mc/mc_private.h"
#endif
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_config, mc,
"Configuration of MC");
-#if HAVE_MC
+#if SIMGRID_HAVE_MC
namespace simgrid {
namespace mc {
/* Configuration support */
}
#endif
-#if !HAVE_MC
+#if !SIMGRID_HAVE_MC
#define _sg_do_model_check 0
#endif
_sg_mc_timeout = xbt_cfg_get_boolean(name);
}
-#if HAVE_MC
+#if SIMGRID_HAVE_MC
int _sg_do_model_check = 0;
int _sg_do_model_check_record = 0;
int _sg_mc_checkpoint = 0;
#include "src/simix/ActorImpl.hpp"
-#if HAVE_MC
+#if SIMGRID_HAVE_MC
#include <libunwind.h>
#include "src/mc/mc_comm_pattern.h"
#include "src/mc/mc_request.h"
}
}
-#if HAVE_MC
+#if SIMGRID_HAVE_MC
/* Liveness */
#include "src/mc/mc_base.h"
#include "src/mc/Transition.hpp"
-#if HAVE_MC
+#if SIMGRID_HAVE_MC
#include "src/mc/mc_request.h"
#include "src/mc/mc_private.h"
#include "src/mc/mc_state.h"
return res;
}
-#if HAVE_MC
+#if SIMGRID_HAVE_MC
std::string traceToString(simgrid::mc::RecordTrace const& trace)
{
SG_BEGIN_DECL()
-#if HAVE_MC
+#if SIMGRID_HAVE_MC
void MC_ignore(void* addr, std::size_t size);
#endif
#include "simgrid/s4u/NetZone.hpp"
#include "src/msg/msg_private.h"
-#if HAVE_LUA
+#if SIMGRID_HAVE_LUA
#include <lua.h>
#include <lauxlib.h>
#include <lualib.h>
simgrid::s4u::Engine::instance()->loadPlatform(platform_file);
XBT_DEBUG("Host number: %zu, link number: %d", sg_host_count(), sg_link_count());
-#if HAVE_JEDULE
+#if SIMGRID_HAVE_JEDULE
jedule_sd_init();
#endif
XBT_VERB("Starting simulation...");
void SD_exit()
{
TRACE_end();
-#if HAVE_JEDULE
+#if SIMGRID_HAVE_JEDULE
jedule_sd_exit();
#endif
delete sd_global;
task->start_time = task->surf_action->getStartTime();
if (new_state == SD_DONE){
task->finish_time = task->surf_action->getFinishTime();
-#if HAVE_JEDULE
+#if SIMGRID_HAVE_JEDULE
jedule_log_sd_event(task);
#endif
} else
#ifndef SIMDAG_PRIVATE_HPP
#define SIMDAG_PRIVATE_HPP
-#if HAVE_JEDULE
+#if SIMGRID_HAVE_JEDULE
#include "simgrid/jedule/jedule_sd_binding.h"
#endif
MC_record_path = nullptr;
}
-#if HAVE_MC
+#if SIMGRID_HAVE_MC
extern int _sg_do_model_check_record;
static void _sg_cfg_cb_model_check_record(const char *name) {
_sg_do_model_check_record = xbt_cfg_get_boolean(name);
xbt_cfg_register_string("model-check/replay", nullptr, _sg_cfg_cb_model_check_replay,
"Model-check path to replay (as reported by SimGrid when a violation is reported)");
-#if HAVE_MC
+#if SIMGRID_HAVE_MC
/* do model-checking-record */
xbt_cfg_register_boolean("model-check/record", "no", _sg_cfg_cb_model_check_record, "Record the model-checking paths");
#include "smx_private.h"
#include "xbt/xbt_os_thread.h"
-#if HAVE_MC
+#if SIMGRID_HAVE_MC
#include "src/mc/mc_private.h"
#endif
#include <xbt/base.h>
#include "smx_private.h"
-#if HAVE_MC
+#if SIMGRID_HAVE_MC
#include "src/mc/mc_forward.hpp"
#endif
#endif
size_t size = smx_context_stack_size + smx_context_guard_size;
-#if HAVE_MC
- /* Cannot use posix_memalign when HAVE_MC. Align stack by hand, and save the
+#if SIMGRID_HAVE_MC
+ /* Cannot use posix_memalign when SIMGRID_HAVE_MC. Align stack by hand, and save the
* pointer returned by xbt_malloc0. */
char *alloc = (char*)xbt_malloc0(size + xbt_pagesize);
stack = alloc - ((uintptr_t)alloc & (xbt_pagesize - 1)) + xbt_pagesize;
XBT_WARN("Failed to remove page protection: %s", strerror(errno));
/* try to pursue anyway */
}
-#if HAVE_MC
+#if SIMGRID_HAVE_MC
/* Retrieve the saved pointer. See SIMIX_context_stack_new above. */
stack = *((void **)stack - 1);
#endif
#include "src/kernel/activity/SynchroIo.hpp"
#include "src/kernel/activity/SynchroRaw.hpp"
-#if HAVE_MC
+#if SIMGRID_HAVE_MC
#include "src/mc/mc_private.h"
#include "src/mc/remote/Client.hpp"
#include "src/mc/remote/mc_protocol.h"
*/
void SIMIX_global_init(int *argc, char **argv)
{
-#if HAVE_MC
+#if SIMGRID_HAVE_MC
// The communication initialization is done ASAP.
// We need to communicate initialization of the different layers to the model-checker.
simgrid::mc::Client::initialize();
xbt_os_mutex_destroy(simix_global->mutex);
simix_global->mutex = nullptr;
-#if HAVE_MC
+#if SIMGRID_HAVE_MC
xbt_dynar_free(&simix_global->actors_vector);
#endif
if (remove_matching)
deque->erase(it);
comm->ref();
-#if HAVE_MC
+#if SIMGRID_HAVE_MC
comm->mbox_cpy = comm->mbox;
#endif
comm->mbox = nullptr;
xbt_dynar_t process_to_run = nullptr;
xbt_dynar_t process_that_ran = nullptr;
std::map<aid_t, smx_actor_t> process_list;
-#if HAVE_MC
+#if SIMGRID_HAVE_MC
/* MCer cannot read the std::map above in the remote process, so we copy the info it needs in a dynar.
* FIXME: This is supposed to be a temporary hack.
* A better solution would be to change the split between MCer and MCed, where the responsibility
int Datatype::keyval_id_=0;
Datatype::Datatype(int size,MPI_Aint lb, MPI_Aint ub, int flags) : name_(nullptr), size_(size), lb_(lb), ub_(ub), flags_(flags), refcount_(1){
-#if HAVE_MC
+#if SIMGRID_HAVE_MC
if(MC_is_active())
MC_ignore(&(refcount_), sizeof(refcount_));
#endif
//for predefined types, so in_use = 0.
Datatype::Datatype(char* name, int size,MPI_Aint lb, MPI_Aint ub, int flags) : name_(name), size_(size), lb_(lb), ub_(ub), flags_(flags), refcount_(0){
-#if HAVE_MC
+#if SIMGRID_HAVE_MC
if(MC_is_active())
MC_ignore(&(refcount_), sizeof(refcount_));
#endif
refcount_++;
-#if HAVE_MC
+#if SIMGRID_HAVE_MC
if(MC_is_active())
MC_ignore(&(refcount_), sizeof(refcount_));
#endif
if (datatype->refcount_ == 0 && !(datatype->flags_ & DT_FLAG_PREDEFINED))
delete datatype;
-#if HAVE_MC
+#if SIMGRID_HAVE_MC
if(MC_is_active())
MC_ignore(&(datatype->refcount_), sizeof(datatype->refcount_));
#endif
xbt_die("Please activate SMPI support in cmake to use the IB network model.");
}
#endif
-#if !HAVE_NS3
+#if !SIMGRID_HAVE_NS3
void surf_network_model_init_NS3() {
xbt_die("Please activate NS3 support in cmake and install the dependencies to use the NS3 network model.");
}
std::printf("This program was linked against %s (git: %s), found in %s.\n",
SIMGRID_VERSION_STRING, SIMGRID_GIT_VERSION, SIMGRID_INSTALL_PREFIX);
-#if HAVE_MC
+#if SIMGRID_HAVE_MC
std::printf(" Model-checking support compiled in.\n");
#else
std::printf(" Model-checking support disabled at compilation.\n");
#endif
-#if HAVE_NS3
+#if SIMGRID_HAVE_NS3
std::printf(" NS3 support compiled in.\n");
#else
std::printf(" NS3 support disabled at compilation.\n");
#endif
-#if HAVE_JEDULE
+#if SIMGRID_HAVE_JEDULE
std::printf(" Jedule support compiled in.\n");
#else
std::printf(" Jedule support disabled at compilation.\n");
#endif
-#if HAVE_LUA
+#if SIMGRID_HAVE_LUA
std::printf(" Lua support compiled in.\n");
#else
std::printf(" Lua support disabled at compilation.\n");
#endif
-#if HAVE_MALLOCATOR
+#if SIMGRID_HAVE_MALLOCATOR
std::printf(" Mallocator support compiled in.\n");
#else
std::printf(" Mallocator support disabled at compilation.\n");
#include "src/surf/xml/platf_private.hpp"
-#if HAVE_LUA
+#if SIMGRID_HAVE_LUA
extern "C" {
#include "src/bindings/lua/simgrid_lua.h"
/* This function acts as a main in the parsing area. */
void parse_platform_file(const char *file)
{
-#if HAVE_LUA
+#if SIMGRID_HAVE_LUA
int len = (file == nullptr ? 0 : strlen(file));
int is_lua = (file != nullptr && len > 3 && file[len - 3] == 'l' && file[len - 2] == 'u' && file[len - 1] == 'a');
#endif
sg_platf_init();
-#if HAVE_LUA
+#if SIMGRID_HAVE_LUA
/* Check if file extension is "lua". If so, we will use
* the lua bindings to parse the platform file (since it is
* written in lua). If not, we will use the (old?) XML parser
#include "xbt/str.h"
#include "xbt/module.h" /* xbt_binary_name */
#include "src/xbt_modinter.h" /* backtrace initialization headers */
-#if HAVE_MC
+#if SIMGRID_HAVE_MC
#define UNW_LOCAL_ONLY
#include <libunwind.h>
#endif
}
}
-#if HAVE_MC
+#if SIMGRID_HAVE_MC
int xbt_libunwind_backtrace(void** bt, int size){
for (int i = 0; i < size; i++)
bt[i] = nullptr;
/* The following categories are only defined in libsimgrid */
/* bindings */
-#if HAVE_LUA
+#if SIMGRID_HAVE_LUA
XBT_LOG_CONNECT(lua);
XBT_LOG_CONNECT(lua_host);
XBT_LOG_CONNECT(lua_platf);
XBT_LOG_CONNECT(instr_TI_trace);
/* jedule */
-#if HAVE_JEDULE
+#if SIMGRID_HAVE_JEDULE
XBT_LOG_CONNECT(jedule);
XBT_LOG_CONNECT(jed_sd);
#endif
/* mc */
-#if HAVE_MC
+#if SIMGRID_HAVE_MC
XBT_LOG_CONNECT(mc);
XBT_LOG_CONNECT(mc_checkpoint);
XBT_LOG_CONNECT(mc_comm_determinism);
XBT_LOG_CONNECT(surf_lagrange_dichotomy);
XBT_LOG_CONNECT(surf_maxmin);
XBT_LOG_CONNECT(surf_network);
-#if HAVE_NS3
+#if SIMGRID_HAVE_NS3
XBT_LOG_CONNECT(ns3);
#endif
XBT_LOG_CONNECT(surf_parse);
/** used by the module to know if it's time to activate the mallocators yet */
static inline int xbt_mallocator_is_active(void) {
-#if HAVE_MALLOCATOR
+#if SIMGRID_HAVE_MALLOCATOR
return initialization_done && !MC_is_active();
#else
return 0;
}
/* Override the malloc-like functions if MC is activated at compile time */
-#if HAVE_MC
+#if SIMGRID_HAVE_MC
/* ***** Temporary allocator
*
mfree(mdp, p);
UNLOCK(mdp);
}
-#endif /* HAVE_MC */
+#endif /* SIMGRID_HAVE_MC */
namespace simgrid {
namespace xbt {
-#if HAVE_MC
+#if SIMGRID_HAVE_MC
const char string::NUL = '\0';
xbt_dynar_free(&xbt_cmdline);
xbt_log_postexit();
free(xbt_binary_name);
-#if HAVE_MC
+#if SIMGRID_HAVE_MC
mmalloc_postexit();
#endif
}