From: Martin Quinson Date: Fri, 5 May 2017 10:07:59 +0000 (+0200) Subject: prefix all macro defined in public simgrid_config.h with 'SIMGRID_' X-Git-Tag: v3.16~274^2~65 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/ec83ae9a081ffd1d19bfecaf81cb99c32bdf6b83 prefix all macro defined in public simgrid_config.h with 'SIMGRID_' (fix #162) --- diff --git a/examples/simdag/scheduling/sd_scheduling.c b/examples/simdag/scheduling/sd_scheduling.c index 0dcf2877be..a949e7319c 100644 --- a/examples/simdag/scheduling/sd_scheduling.c +++ b/examples/simdag/scheduling/sd_scheduling.c @@ -8,7 +8,7 @@ #include #include "simgrid/simdag.h" -#if HAVE_JEDULE +#if SIMGRID_HAVE_JEDULE #include "simgrid/jedule/jedule_sd_binding.h" #endif @@ -231,7 +231,7 @@ int main(int argc, char **argv) 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); diff --git a/include/simgrid/jedule/jedule.hpp b/include/simgrid/jedule/jedule.hpp index 8d7fd7bee8..43387f2ebb 100644 --- a/include/simgrid/jedule/jedule.hpp +++ b/include/simgrid/jedule/jedule.hpp @@ -12,7 +12,7 @@ #include "jedule_events.hpp" #include "jedule_platform.hpp" -#if HAVE_JEDULE +#if SIMGRID_HAVE_JEDULE XBT_ATTRIB_UNUSED static std::unordered_map host2_simgrid_parent_container; XBT_ATTRIB_UNUSED static std::unordered_map container_name2container; diff --git a/include/simgrid/jedule/jedule_events.hpp b/include/simgrid/jedule/jedule_events.hpp index 0cf00dbfa9..aa1609959d 100644 --- a/include/simgrid/jedule/jedule_events.hpp +++ b/include/simgrid/jedule/jedule_events.hpp @@ -15,7 +15,7 @@ #include "jedule_platform.hpp" -#if HAVE_JEDULE +#if SIMGRID_HAVE_JEDULE namespace simgrid { namespace jedule{ diff --git a/include/simgrid/jedule/jedule_platform.hpp b/include/simgrid/jedule/jedule_platform.hpp index 195ca918ee..caaf67225b 100644 --- a/include/simgrid/jedule/jedule_platform.hpp +++ b/include/simgrid/jedule/jedule_platform.hpp @@ -13,7 +13,7 @@ #include #include #include -#if HAVE_JEDULE +#if SIMGRID_HAVE_JEDULE namespace simgrid { namespace jedule{ diff --git a/include/simgrid/jedule/jedule_sd_binding.h b/include/simgrid/jedule/jedule_sd_binding.h index 9a494b7ed7..909ad6caec 100644 --- a/include/simgrid/jedule/jedule_sd_binding.h +++ b/include/simgrid/jedule/jedule_sd_binding.h @@ -10,7 +10,7 @@ #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); diff --git a/include/simgrid/modelchecker.h b/include/simgrid/modelchecker.h index a09795351b..9a198ecf8c 100644 --- a/include/simgrid/modelchecker.h +++ b/include/simgrid/modelchecker.h @@ -17,7 +17,7 @@ #include -#include /* HAVE_MC ? */ +#include /* SIMGRID_HAVE_MC ? */ #include @@ -25,7 +25,7 @@ SG_BEGIN_DECL() 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 * diff --git a/include/smpi/mpi.h b/include/smpi/mpi.h index 5021574a10..671d22ec89 100644 --- a/include/smpi/mpi.h +++ b/include/smpi/mpi.h @@ -24,7 +24,7 @@ #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 diff --git a/include/xbt/string.hpp b/include/xbt/string.hpp index 0c9221a542..b1638673d9 100644 --- a/include/xbt/string.hpp +++ b/include/xbt/string.hpp @@ -13,7 +13,7 @@ #include #include -#if HAVE_MC +#if SIMGRID_HAVE_MC #include #include @@ -28,7 +28,7 @@ namespace simgrid { namespace xbt { -#if HAVE_MC +#if SIMGRID_HAVE_MC /** POD structure representation of a string */ diff --git a/src/include/mc/mc.h b/src/include/mc/mc.h index 8ca9c1a63d..aadf44dc47 100644 --- a/src/include/mc/mc.h +++ b/src/include/mc/mc.h @@ -6,9 +6,9 @@ #ifndef MC_MC_H #define MC_MC_H -#include +#include /* our public interface (and definition of SIMGRID_HAVE_MC) */ #include -#include /* our public interface (and definition of HAVE_MC) */ +#include #if HAVE_UCONTEXT_H #include /* context relative declarations */ #endif diff --git a/src/instr/jedule/jedule.cpp b/src/instr/jedule/jedule.cpp index ed3d6e51aa..86dbae5e65 100644 --- a/src/instr/jedule/jedule.cpp +++ b/src/instr/jedule/jedule.cpp @@ -7,7 +7,7 @@ #include "xbt/asserts.h" #include "simgrid/jedule/jedule.hpp" -#if HAVE_JEDULE +#if SIMGRID_HAVE_JEDULE namespace simgrid{ namespace jedule { diff --git a/src/instr/jedule/jedule_events.cpp b/src/instr/jedule/jedule_events.cpp index 1b43029c51..b4d48108c5 100644 --- a/src/instr/jedule/jedule_events.cpp +++ b/src/instr/jedule/jedule_events.cpp @@ -11,7 +11,7 @@ #include "simgrid/s4u/NetZone.hpp" #include "xbt/asserts.h" -#if HAVE_JEDULE +#if SIMGRID_HAVE_JEDULE namespace simgrid{ namespace jedule{ diff --git a/src/instr/jedule/jedule_platform.cpp b/src/instr/jedule/jedule_platform.cpp index acc3e9b2c2..29f822934d 100644 --- a/src/instr/jedule/jedule_platform.cpp +++ b/src/instr/jedule/jedule_platform.cpp @@ -11,7 +11,7 @@ #include "xbt/dynar.h" #include -#if HAVE_JEDULE +#if SIMGRID_HAVE_JEDULE namespace simgrid { namespace jedule { diff --git a/src/instr/jedule/jedule_sd_binding.cpp b/src/instr/jedule/jedule_sd_binding.cpp index 782bb6e0e8..24c66fd9ca 100644 --- a/src/instr/jedule/jedule_sd_binding.cpp +++ b/src/instr/jedule/jedule_sd_binding.cpp @@ -11,7 +11,7 @@ #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"); diff --git a/src/kernel/activity/SynchroComm.hpp b/src/kernel/activity/SynchroComm.hpp index 7a56db936f..b114b2567a 100644 --- a/src/kernel/activity/SynchroComm.hpp +++ b/src/kernel/activity/SynchroComm.hpp @@ -34,7 +34,7 @@ namespace activity { 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)) */ diff --git a/src/kernel/context/Context.cpp b/src/kernel/context/Context.cpp index 2288faa8d1..292ff2e1c3 100644 --- a/src/kernel/context/Context.cpp +++ b/src/kernel/context/Context.cpp @@ -47,7 +47,7 @@ Context* ContextFactory::self() 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); diff --git a/src/kernel/context/ContextUnix.cpp b/src/kernel/context/ContextUnix.cpp index 8c51f67a96..f2f99a6d2a 100644 --- a/src/kernel/context/ContextUnix.cpp +++ b/src/kernel/context/ContextUnix.cpp @@ -218,7 +218,7 @@ UContext::UContext(std::function code, 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); diff --git a/src/mc/mc_base.cpp b/src/mc/mc_base.cpp index edcf150249..00fd66ceff 100644 --- a/src/mc/mc_base.cpp +++ b/src/mc/mc_base.cpp @@ -26,7 +26,7 @@ #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" @@ -39,7 +39,7 @@ XBT_LOG_NEW_CATEGORY(mc, "All MC categories"); 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 :) */ @@ -52,7 +52,7 @@ namespace mc { void wait_for_requests(void) { -#if HAVE_MC +#if SIMGRID_HAVE_MC xbt_assert(mc_model_checker == nullptr); #endif @@ -68,7 +68,7 @@ void wait_for_requests(void) SIMIX_simcall_handle(req, 0); } } -#if HAVE_MC +#if SIMGRID_HAVE_MC xbt_dynar_reset(simix_global->actors_vector); for (std::pair kv : simix_global->process_list) { xbt_dynar_push_as(simix_global->actors_vector, smx_actor_t, kv.second); @@ -107,7 +107,7 @@ bool request_is_enabled(smx_simcall_t req) simgrid::kernel::activity::Comm *act = static_cast(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) { @@ -135,7 +135,7 @@ bool request_is_enabled(smx_simcall_t req) simgrid::kernel::activity::Comm *act = static_cast(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) { @@ -158,7 +158,7 @@ bool request_is_enabled(smx_simcall_t req) #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 temp_comm; @@ -178,7 +178,7 @@ bool request_is_enabled(smx_simcall_t req) case SIMCALL_MUTEX_LOCK: { smx_mutex_t mutex = simcall_mutex_lock__get__mutex(req); -#if HAVE_MC +#if SIMGRID_HAVE_MC simgrid::mc::Remote temp_mutex; if (mc_model_checker != nullptr) { mc_model_checker->process().read(temp_mutex.getBuffer(), remote(mutex)); @@ -188,7 +188,7 @@ bool request_is_enabled(smx_simcall_t req) 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) :/ diff --git a/src/mc/mc_config.cpp b/src/mc/mc_config.cpp index 67bebd4e6b..621f502785 100644 --- a/src/mc/mc_config.cpp +++ b/src/mc/mc_config.cpp @@ -13,7 +13,7 @@ #include -#if HAVE_MC +#if SIMGRID_HAVE_MC #include "src/mc/mc_safety.h" #include "src/mc/mc_private.h" #endif @@ -23,7 +23,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_config, mc, "Configuration of MC"); -#if HAVE_MC +#if SIMGRID_HAVE_MC namespace simgrid { namespace mc { /* Configuration support */ @@ -32,7 +32,7 @@ simgrid::mc::ReductionMode reduction_mode = simgrid::mc::ReductionMode::unset; } #endif -#if !HAVE_MC +#if !SIMGRID_HAVE_MC #define _sg_do_model_check 0 #endif @@ -46,7 +46,7 @@ void _mc_cfg_cb_timeout(const char *name) _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; diff --git a/src/mc/mc_global.cpp b/src/mc/mc_global.cpp index 1d4dd5f7c6..3d596ab28f 100644 --- a/src/mc/mc_global.cpp +++ b/src/mc/mc_global.cpp @@ -28,7 +28,7 @@ #include "src/simix/ActorImpl.hpp" -#if HAVE_MC +#if SIMGRID_HAVE_MC #include #include "src/mc/mc_comm_pattern.h" #include "src/mc/mc_request.h" @@ -55,7 +55,7 @@ std::vector processes_time; } } -#if HAVE_MC +#if SIMGRID_HAVE_MC /* Liveness */ diff --git a/src/mc/mc_record.cpp b/src/mc/mc_record.cpp index d2c382c78b..2881f48c28 100644 --- a/src/mc/mc_record.cpp +++ b/src/mc/mc_record.cpp @@ -26,7 +26,7 @@ #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" @@ -103,7 +103,7 @@ RecordTrace parseRecordTrace(const char* data) return res; } -#if HAVE_MC +#if SIMGRID_HAVE_MC std::string traceToString(simgrid::mc::RecordTrace const& trace) { diff --git a/src/mc/remote/Client.hpp b/src/mc/remote/Client.hpp index ead07fe129..79746017b1 100644 --- a/src/mc/remote/Client.hpp +++ b/src/mc/remote/Client.hpp @@ -58,7 +58,7 @@ public: SG_BEGIN_DECL() -#if HAVE_MC +#if SIMGRID_HAVE_MC void MC_ignore(void* addr, std::size_t size); #endif diff --git a/src/msg/msg_environment.cpp b/src/msg/msg_environment.cpp index e50abe085f..a52541bebb 100644 --- a/src/msg/msg_environment.cpp +++ b/src/msg/msg_environment.cpp @@ -7,7 +7,7 @@ #include "simgrid/s4u/NetZone.hpp" #include "src/msg/msg_private.h" -#if HAVE_LUA +#if SIMGRID_HAVE_LUA #include #include #include diff --git a/src/simdag/sd_global.cpp b/src/simdag/sd_global.cpp index 0248689e97..cb9f44a011 100644 --- a/src/simdag/sd_global.cpp +++ b/src/simdag/sd_global.cpp @@ -201,7 +201,7 @@ void SD_create_environment(const char *platform_file) 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..."); @@ -247,7 +247,7 @@ double SD_get_clock() { void SD_exit() { TRACE_end(); -#if HAVE_JEDULE +#if SIMGRID_HAVE_JEDULE jedule_sd_exit(); #endif delete sd_global; diff --git a/src/simdag/sd_task.cpp b/src/simdag/sd_task.cpp index 3cf0a0e469..e6ee5cfe75 100644 --- a/src/simdag/sd_task.cpp +++ b/src/simdag/sd_task.cpp @@ -289,7 +289,7 @@ void SD_task_set_state(SD_task_t task, e_SD_task_state_t new_state) 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 diff --git a/src/simdag/simdag_private.hpp b/src/simdag/simdag_private.hpp index 9cd87ba8e5..58d88e7bd0 100644 --- a/src/simdag/simdag_private.hpp +++ b/src/simdag/simdag_private.hpp @@ -12,7 +12,7 @@ #ifndef SIMDAG_PRIVATE_HPP #define SIMDAG_PRIVATE_HPP -#if HAVE_JEDULE +#if SIMGRID_HAVE_JEDULE #include "simgrid/jedule/jedule_sd_binding.h" #endif diff --git a/src/simgrid/sg_config.cpp b/src/simgrid/sg_config.cpp index 9b99689e4d..f1434efb65 100644 --- a/src/simgrid/sg_config.cpp +++ b/src/simgrid/sg_config.cpp @@ -208,7 +208,7 @@ static void _sg_cfg_cb_model_check_replay(const char *name) { 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); @@ -375,7 +375,7 @@ void sg_config_init(int *argc, char **argv) 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"); diff --git a/src/simix/popping.cpp b/src/simix/popping.cpp index 1314c04c7e..c488326b8e 100644 --- a/src/simix/popping.cpp +++ b/src/simix/popping.cpp @@ -6,7 +6,7 @@ #include "smx_private.h" #include "xbt/xbt_os_thread.h" -#if HAVE_MC +#if SIMGRID_HAVE_MC #include "src/mc/mc_private.h" #endif diff --git a/src/simix/popping_generated.cpp b/src/simix/popping_generated.cpp index 9e477290ff..968e7bc158 100644 --- a/src/simix/popping_generated.cpp +++ b/src/simix/popping_generated.cpp @@ -15,7 +15,7 @@ #include #include "smx_private.h" -#if HAVE_MC +#if SIMGRID_HAVE_MC #include "src/mc/mc_forward.hpp" #endif diff --git a/src/simix/smx_context.cpp b/src/simix/smx_context.cpp index 90a7d13ba0..712ab9cfaa 100644 --- a/src/simix/smx_context.cpp +++ b/src/simix/smx_context.cpp @@ -182,8 +182,8 @@ void *SIMIX_context_stack_new() #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; @@ -237,7 +237,7 @@ void SIMIX_context_stack_delete(void *stack) 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 diff --git a/src/simix/smx_global.cpp b/src/simix/smx_global.cpp index 09313d8aab..c875ed32fd 100644 --- a/src/simix/smx_global.cpp +++ b/src/simix/smx_global.cpp @@ -30,7 +30,7 @@ #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" @@ -191,7 +191,7 @@ void SIMIX_set_maestro(void (*code)(void*), void* data) */ 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(); @@ -302,7 +302,7 @@ void SIMIX_clean() 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 diff --git a/src/simix/smx_network.cpp b/src/simix/smx_network.cpp index 852db10018..2da73fd6c7 100644 --- a/src/simix/smx_network.cpp +++ b/src/simix/smx_network.cpp @@ -59,7 +59,7 @@ _find_matching_comm(boost::circular_buffer_space_optimized* dequ if (remove_matching) deque->erase(it); comm->ref(); -#if HAVE_MC +#if SIMGRID_HAVE_MC comm->mbox_cpy = comm->mbox; #endif comm->mbox = nullptr; diff --git a/src/simix/smx_private.h b/src/simix/smx_private.h index 9ec2107dcc..f600d3544a 100644 --- a/src/simix/smx_private.h +++ b/src/simix/smx_private.h @@ -22,7 +22,7 @@ public: xbt_dynar_t process_to_run = nullptr; xbt_dynar_t process_that_ran = nullptr; std::map 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 diff --git a/src/smpi/smpi_datatype.cpp b/src/smpi/smpi_datatype.cpp index 6dfe3bdf90..9e91d9a482 100644 --- a/src/smpi/smpi_datatype.cpp +++ b/src/smpi/smpi_datatype.cpp @@ -107,7 +107,7 @@ std::unordered_map Datatype::keyvals_; 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 @@ -115,7 +115,7 @@ Datatype::Datatype(int size,MPI_Aint lb, MPI_Aint ub, int flags) : name_(nullptr //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 @@ -170,7 +170,7 @@ void Datatype::ref(){ refcount_++; -#if HAVE_MC +#if SIMGRID_HAVE_MC if(MC_is_active()) MC_ignore(&(refcount_), sizeof(refcount_)); #endif @@ -184,7 +184,7 @@ void Datatype::unref(MPI_Datatype datatype) 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 diff --git a/src/surf/surf_interface.cpp b/src/surf/surf_interface.cpp index 2b1cfbbe5d..2b2fa3ad51 100644 --- a/src/surf/surf_interface.cpp +++ b/src/surf/surf_interface.cpp @@ -77,7 +77,7 @@ void surf_network_model_init_IB() { 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."); } @@ -302,31 +302,31 @@ void sg_version() 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"); diff --git a/src/surf/xml/surfxml_parseplatf.cpp b/src/surf/xml/surfxml_parseplatf.cpp index 5890b6e44a..24892fd61f 100644 --- a/src/surf/xml/surfxml_parseplatf.cpp +++ b/src/surf/xml/surfxml_parseplatf.cpp @@ -15,7 +15,7 @@ #include "src/surf/xml/platf_private.hpp" -#if HAVE_LUA +#if SIMGRID_HAVE_LUA extern "C" { #include "src/bindings/lua/simgrid_lua.h" @@ -131,14 +131,14 @@ void parse_after_config() { /* 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 diff --git a/src/xbt/backtrace_linux.cpp b/src/xbt/backtrace_linux.cpp index cb8ef6d1cb..5e77a4a260 100644 --- a/src/xbt/backtrace_linux.cpp +++ b/src/xbt/backtrace_linux.cpp @@ -24,7 +24,7 @@ #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 #endif @@ -338,7 +338,7 @@ std::vector resolveBacktrace( } } -#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; diff --git a/src/xbt/log.c b/src/xbt/log.c index 9e3da3c0a2..86fd9c345a 100644 --- a/src/xbt/log.c +++ b/src/xbt/log.c @@ -125,7 +125,7 @@ static void xbt_log_connect_categories(void) /* 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); @@ -150,13 +150,13 @@ static void xbt_log_connect_categories(void) 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); @@ -245,7 +245,7 @@ static void xbt_log_connect_categories(void) 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); diff --git a/src/xbt/mallocator.c b/src/xbt/mallocator.c index f898c39e80..408e115d7c 100644 --- a/src/xbt/mallocator.c +++ b/src/xbt/mallocator.c @@ -71,7 +71,7 @@ void xbt_mallocator_initialization_is_done(int protect) /** 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; diff --git a/src/xbt/mmalloc/mm_legacy.c b/src/xbt/mmalloc/mm_legacy.c index dafcbbdda3..a8962f7f4d 100644 --- a/src/xbt/mmalloc/mm_legacy.c +++ b/src/xbt/mmalloc/mm_legacy.c @@ -51,7 +51,7 @@ xbt_mheap_t mmalloc_set_current_heap(xbt_mheap_t new_heap) } /* Override the malloc-like functions if MC is activated at compile time */ -#if HAVE_MC +#if SIMGRID_HAVE_MC /* ***** Temporary allocator * @@ -267,4 +267,4 @@ void free(void *p) mfree(mdp, p); UNLOCK(mdp); } -#endif /* HAVE_MC */ +#endif /* SIMGRID_HAVE_MC */ diff --git a/src/xbt/string.cpp b/src/xbt/string.cpp index f23e4295ff..afc6445cee 100644 --- a/src/xbt/string.cpp +++ b/src/xbt/string.cpp @@ -15,7 +15,7 @@ namespace simgrid { namespace xbt { -#if HAVE_MC +#if SIMGRID_HAVE_MC const char string::NUL = '\0'; diff --git a/src/xbt/xbt_main.cpp b/src/xbt/xbt_main.cpp index f04241769a..9176b29286 100644 --- a/src/xbt/xbt_main.cpp +++ b/src/xbt/xbt_main.cpp @@ -113,7 +113,7 @@ static void xbt_postexit(void) xbt_dynar_free(&xbt_cmdline); xbt_log_postexit(); free(xbt_binary_name); -#if HAVE_MC +#if SIMGRID_HAVE_MC mmalloc_postexit(); #endif }