to get the list of files to pack.
* Replace XBT with the C++ standard library
-
-* Some XBT datacontainers seem to overlap. Kill some/all of them.
- - replace set with SWAG
XBT_INFO("%s' dragonfly topology:", d->get_cname());
for (int i = 0; i < d->getHostCount(); i++) {
unsigned int coords[4];
- d->rankId_to_coords(i, &coords);
+ d->rankId_to_coords(i, coords);
XBT_INFO(" %d: (%u, %u, %u, %u)", i, coords[0], coords[1], coords[2], coords[3]);
}
}
}
}
-extern "C" {
typedef simgrid::jedule::Jedule *jedule_t;
-}
#endif
#endif /* JEDULE_HPP_ */
}
}
-extern "C" {
typedef simgrid::jedule::Event* jed_event_t;
-}
-
#endif
#endif /* JEDULE_EVENTS_H_ */
}
}
-extern "C" {
typedef simgrid::jedule::Container * jed_container_t;
typedef simgrid::jedule::Subset * jed_subset_t;
void get_resource_selection_by_hosts(std::vector<jed_subset_t>* subset_list, std::vector<sg_host_t> *host_list);
-}
#endif
void generateLinks();
void createLink(const std::string& id, int numlinks, resource::LinkImpl** linkup, resource::LinkImpl** linkdown);
- void rankId_to_coords(int rankId, unsigned int (*coords)[4]);
+ void rankId_to_coords(int rankId, unsigned int coords[4]);
private:
simgrid::s4u::Link::SharingPolicy sharing_policy_;
} // namespace kernel
} // namespace simgrid
-extern "C" {
XBT_PRIVATE xbt_node_t new_xbt_graph_node(xbt_graph_t graph, const char* name,
std::map<std::string, xbt_node_t>* nodes);
XBT_PRIVATE xbt_edge_t new_xbt_graph_edge(xbt_graph_t graph, xbt_node_t s, xbt_node_t d,
std::map<std::string, xbt_edge_t>* edges);
-}
#endif /* SIMGRID_ROUTING_GENERIC_HPP_ */
*
* If these functions manage to unlock some of the processes, then the deadlock will be avoided.
*/
-extern simgrid::xbt::signal<void()> onDeadlock;
+XBT_PUBLIC_DATA simgrid::xbt::signal<void()> onDeadlock;
}
}
/* props */ std::map<std::string, std::string>*,
/* parent_process */ smx_actor_t);
-extern "C" XBT_PUBLIC void SIMIX_function_register_process_create(smx_creation_func_t function);
+XBT_PUBLIC void SIMIX_function_register_process_create(smx_creation_func_t function);
XBT_PUBLIC smx_actor_t simcall_process_create(const char* name, std::function<void()> code, void* data, sg_host_t host,
std::map<std::string, std::string>* properties);
#include <jni.h>
#include <string>
-extern "C" {
-
/* Search a class and throw an exception if not found */
jclass jxbt_get_class(JNIEnv* env, const char* name);
void jxbt_throw_task_cancelled(JNIEnv* env, std::string details);
/** Thrown when looking for a storage from name does not lead to anything */
void jxbt_throw_storage_not_found(JNIEnv* env, std::string invalid_name);
-}
+
#endif
#include "simgrid/msg.h"
#include "simgrid_lua.hpp"
-extern "C" {
-
void sglua_register_host_functions(lua_State* L);
msg_host_t sglua_check_host(lua_State* L, int index);
void sglua_register_platf_functions(lua_State* L);
-}
#define lua_ensure(...) _XBT_IF_ONE_ARG(_lua_ensure_ARG1, _lua_ensure_ARGN, __VA_ARGS__)(__VA_ARGS__)
#define _lua_ensure_ARG1(cond) _lua_ensure_ARGN(cond, "Assertion %s failed", #cond)
#ifndef LUA_UTILS_HPP
#define LUA_UTILS_HPP
-extern "C" {
-
#include <lua.h>
/**
void* sglua_checkudata_debug(lua_State* L, int ud, const char* tname);
const char* sglua_get_spaces(int length);
int sglua_memory_writer(lua_State* L, const void* source, size_t size, void* userdata);
-}
#endif
/* 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 SIMGRID_INSTR_INTERFACE_H
-#define SIMGRID_INSTR_INTERFACE_H
+#ifndef SIMGRID_INSTR_INTERFACE_HPP
+#define SIMGRID_INSTR_INTERFACE_HPP
#include "xbt.h"
-SG_BEGIN_DECL()
-
XBT_PUBLIC int TRACE_start();
XBT_PUBLIC int TRACE_end();
XBT_PUBLIC void TRACE_global_init();
XBT_PUBLIC void TRACE_help(int detailed);
-SG_END_DECL()
-
#endif
static bool trace_configured = false;
static bool trace_active = false;
-instr_fmt_type_t instr_fmt_type = instr_fmt_paje;
+simgrid::instr::TraceFormat simgrid::instr::trace_format = simgrid::instr::TraceFormat::Paje;
static void TRACE_getopts()
{
if (format == "Paje") {
TRACE_paje_start();
} else if (format == "TI") {
- instr_fmt_type = instr_fmt_TI;
+ simgrid::instr::trace_format = simgrid::instr::TraceFormat::Ti;
TRACE_TI_start();
}else{
xbt_die("Unknown trace format :%s ", format.c_str());
XBT_DEBUG("%s: event_type=%u, timestamp=%f", __func__, PAJE_CreateContainer, timestamp);
- if (instr_fmt_type == instr_fmt_paje) {
+ if (trace_format == simgrid::instr::TraceFormat::Paje) {
stream << std::fixed << std::setprecision(TRACE_precision()) << PAJE_CreateContainer << " ";
stream << timestamp << " " << id_ << " " << type_->get_id() << " " << father_->id_ << " \"" << name_ << "\"";
XBT_DEBUG("Dump %s", stream.str().c_str());
fprintf(tracing_file, "%s\n", stream.str().c_str());
- } else if (instr_fmt_type == instr_fmt_TI) {
+ } else if (trace_format == simgrid::instr::TraceFormat::Ti) {
// if we are in the mode with only one file
static FILE* ti_unique_file = nullptr;
XBT_DEBUG("%s: event_type=%u, timestamp=%f", __func__, PAJE_DestroyContainer, timestamp);
- if (instr_fmt_type == instr_fmt_paje) {
+ if (trace_format == simgrid::instr::TraceFormat::Paje) {
stream << std::fixed << std::setprecision(TRACE_precision()) << PAJE_DestroyContainer << " ";
stream << timestamp << " " << type_->get_id() << " " << id_;
XBT_DEBUG("Dump %s", stream.str().c_str());
fprintf(tracing_file, "%s\n", stream.str().c_str());
- } else if (instr_fmt_type == instr_fmt_TI) {
+ } else if (trace_format == simgrid::instr::TraceFormat::Ti) {
if (not xbt_cfg_get_boolean("tracing/smpi/format/ti-one-file") || tracing_files.size() == 1) {
fclose(tracing_files.at(this));
}
namespace simgrid {
namespace instr {
-NewEvent::NewEvent(double timestamp, container_t container, Type* type, EntityValue* val)
- : simgrid::instr::PajeEvent::PajeEvent(container, type, timestamp, PAJE_NewEvent), val(val)
+PajeEvent::PajeEvent(Container* container, Type* type, double timestamp, e_event_type eventType)
+ : container_(container), type_(type), timestamp_(timestamp), eventType_(eventType)
{
- XBT_DEBUG("%s: event_type=%u, timestamp=%f", __func__, eventType_, timestamp_);
- insertIntoBuffer();
-}
-
-LinkEvent::LinkEvent(container_t container, Type* type, e_event_type event_type, container_t endpoint,
- std::string value, std::string key)
- : LinkEvent(container, type, event_type, endpoint, value, key, -1)
-{
-}
-
-LinkEvent::LinkEvent(container_t container, Type* type, e_event_type event_type, container_t endpoint,
- std::string value, std::string key, int size)
- : PajeEvent(container, type, SIMIX_get_clock(), event_type)
- , endpoint_(endpoint)
- , value_(value)
- , key_(key)
- , size_(size)
-{
- XBT_DEBUG("%s: event_type=%u, timestamp=%f, value:%s", __func__, eventType_, timestamp_, value_.c_str());
- insertIntoBuffer();
-}
-
-VariableEvent::VariableEvent(double timestamp, Container* container, Type* type, e_event_type event_type, double value)
- : PajeEvent::PajeEvent(container, type, timestamp, event_type), value(value)
-{
- XBT_DEBUG("%s: event_type=%u, timestamp=%f", __func__, eventType_, timestamp_);
+ XBT_DEBUG("%s: event_type=%u, timestamp=%.*f", __func__, eventType_, TRACE_precision(), timestamp_);
+ if (trace_format == simgrid::instr::TraceFormat::Paje) {
+ stream_ << std::fixed << std::setprecision(TRACE_precision());
+ stream_ << eventType_ << " " << timestamp_ << " " << type_->get_id() << " " << container_->get_id();
+ }
insertIntoBuffer();
-}
-
-StateEvent::StateEvent(Container* container, Type* type, e_event_type event_type, EntityValue* value)
- : StateEvent(container, type, event_type, value, nullptr)
-{
-}
+};
StateEvent::StateEvent(Container* container, Type* type, e_event_type event_type, EntityValue* value, TIData* extra)
: PajeEvent::PajeEvent(container, type, SIMIX_get_clock(), event_type), value(value), extra_(extra)
filename = loc->filename;
linenumber = loc->linenumber;
}
-#else
- filename = "(null)";
- linenumber = -1;
#endif
-
- XBT_DEBUG("%s: event_type=%u, timestamp=%f", __func__, eventType_, timestamp_);
- insertIntoBuffer();
-};
+}
void NewEvent::print()
{
- std::stringstream stream;
- stream << std::fixed << std::setprecision(TRACE_precision());
- XBT_DEBUG("%s: event_type=%u, timestamp=%.*f", __func__, eventType_, TRACE_precision(), timestamp_);
- if (instr_fmt_type != instr_fmt_paje)
+ if (trace_format != simgrid::instr::TraceFormat::Paje)
return;
- stream << eventType_ << " " << timestamp_ << " ";
- stream << getType()->get_id() << " " << getContainer()->get_id() << " " << val->getId();
- XBT_DEBUG("Dump %s", stream.str().c_str());
- fprintf(tracing_file, "%s\n", stream.str().c_str());
+ stream_ << " " << value->getId();
+
+ XBT_DEBUG("Dump %s", stream_.str().c_str());
+ fprintf(tracing_file, "%s\n", stream_.str().c_str());
}
void LinkEvent::print()
{
- std::stringstream stream;
- stream << std::fixed << std::setprecision(TRACE_precision());
- XBT_DEBUG("%s: event_type=%u, timestamp=%.*f", __func__, eventType_, TRACE_precision(), timestamp_);
- if (instr_fmt_type != instr_fmt_paje)
+ if (trace_format != simgrid::instr::TraceFormat::Paje)
return;
- stream << eventType_ << " " << timestamp_ << " " << getType()->get_id() << " " << getContainer()->get_id();
- stream << " " << value_ << " " << endpoint_->get_id() << " " << key_;
+ stream_ << " " << value_ << " " << endpoint_->get_id() << " " << key_;
- if (TRACE_display_sizes()) {
- stream << " " << size_;
- }
- XBT_DEBUG("Dump %s", stream.str().c_str());
- fprintf(tracing_file, "%s\n", stream.str().c_str());
+ if (TRACE_display_sizes())
+ stream_ << " " << size_;
+
+ XBT_DEBUG("Dump %s", stream_.str().c_str());
+ fprintf(tracing_file, "%s\n", stream_.str().c_str());
}
void VariableEvent::print()
{
- std::stringstream stream;
- stream << std::fixed << std::setprecision(TRACE_precision());
- XBT_DEBUG("%s: event_type=%u, timestamp=%.*f", __func__, eventType_, TRACE_precision(), timestamp_);
- if (instr_fmt_type != instr_fmt_paje)
+ if (trace_format != simgrid::instr::TraceFormat::Paje)
return;
- stream << eventType_ << " " << timestamp_ << " ";
- stream << getType()->get_id() << " " << getContainer()->get_id() << " " << value;
- XBT_DEBUG("Dump %s", stream.str().c_str());
- fprintf(tracing_file, "%s\n", stream.str().c_str());
+ stream_ << " " << value;
+
+ XBT_DEBUG("Dump %s", stream_.str().c_str());
+ fprintf(tracing_file, "%s\n", stream_.str().c_str());
}
void StateEvent::print()
{
- std::stringstream stream;
- stream << std::fixed << std::setprecision(TRACE_precision());
- XBT_DEBUG("%s: event_type=%u, timestamp=%.*f", __func__, eventType_, TRACE_precision(), timestamp_);
- if (instr_fmt_type == instr_fmt_paje) {
- stream << eventType_ << " " << timestamp_ << " " << getType()->get_id() << " " << getContainer()->get_id();
+ if (trace_format == simgrid::instr::TraceFormat::Paje) {
if (value != nullptr) // PAJE_PopState Event does not need to have a value
- stream << " " << value->getId();
+ stream_ << " " << value->getId();
if (TRACE_display_sizes())
- stream << " " << ((extra_ != nullptr) ? extra_->display_size() : 0);
+ stream_ << " " << ((extra_ != nullptr) ? extra_->display_size() : 0);
#if HAVE_SMPI
if (xbt_cfg_get_boolean("smpi/trace-call-location")) {
- stream << " \"" << filename << "\" " << linenumber;
+ stream_ << " \"" << filename << "\" " << linenumber;
}
#endif
- XBT_DEBUG("Dump %s", stream.str().c_str());
- fprintf(tracing_file, "%s\n", stream.str().c_str());
- } else if (instr_fmt_type == instr_fmt_TI) {
+ XBT_DEBUG("Dump %s", stream_.str().c_str());
+ fprintf(tracing_file, "%s\n", stream_.str().c_str());
+ } else if (trace_format == simgrid::instr::TraceFormat::Ti) {
if (extra_ == nullptr)
return;
// FIXME: dirty extract "rank-" from the name, as we want the bare process id here
if (getContainer()->get_name().find("rank-") != 0)
- stream << getContainer()->get_name() << " " << extra_->print();
+ stream_ << getContainer()->get_name() << " " << extra_->print();
else
/* Subtract -1 because this is the process id and we transform it to the rank id */
- stream << stoi(getContainer()->get_name().erase(0, 5)) - 1 << " " << extra_->print();
+ stream_ << stoi(getContainer()->get_name().erase(0, 5)) - 1 << " " << extra_->print();
- fprintf(tracing_files.at(getContainer()), "%s\n", stream.str().c_str());
+ fprintf(tracing_files.at(getContainer()), "%s\n", stream_.str().c_str());
} else {
THROW_IMPOSSIBLE;
}
#define INSTR_PAJE_EVENTS_HPP
#include "src/instr/instr_private.hpp"
+#include <sstream>
#include <string>
namespace simgrid {
class PajeEvent {
Container* container_;
Type* type_;
-
protected:
- Type* getType() { return type_; }
Container* getContainer() { return container_; }
public:
double timestamp_;
e_event_type eventType_;
- PajeEvent(Container* container, Type* type, double timestamp, e_event_type eventType)
- : container_(container), type_(type), timestamp_(timestamp), eventType_(eventType){};
+ std::stringstream stream_;
+
+ PajeEvent(Container* container, Type* type, double timestamp, e_event_type eventType);
virtual ~PajeEvent() = default;
virtual void print() = 0;
void insertIntoBuffer();
double value;
public:
- VariableEvent(double timestamp, Container* container, Type* type, e_event_type event_type, double value);
+ VariableEvent(double timestamp, Container* container, Type* type, e_event_type event_type, double value)
+ : PajeEvent::PajeEvent(container, type, timestamp, event_type), value(value)
+ {
+ }
void print() override;
};
class StateEvent : public PajeEvent {
EntityValue* value;
- std::string filename;
- int linenumber = 0;
- TIData* extra_ = nullptr;
+ std::string filename = "(null)";
+ int linenumber = -1;
+ TIData* extra_;
public:
- StateEvent(Container* container, Type* type, e_event_type event_type, EntityValue* value);
StateEvent(Container* container, Type* type, e_event_type event_type, EntityValue* value, TIData* extra);
void print() override;
};
public:
LinkEvent(Container* container, Type* type, e_event_type event_type, Container* sourceContainer, std::string value,
- std::string key);
- LinkEvent(Container* container, Type* type, e_event_type event_type, Container* sourceContainer, std::string value,
- std::string key, int size);
+ std::string key, int size)
+ : PajeEvent(container, type, SIMIX_get_clock(), event_type)
+ , endpoint_(sourceContainer)
+ , value_(value)
+ , key_(key)
+ , size_(size)
+ {
+ }
void print() override;
};
class NewEvent : public PajeEvent {
- EntityValue* val;
+ EntityValue* value;
public:
- NewEvent(double timestamp, Container* container, Type* type, EntityValue* val);
+ NewEvent(double timestamp, Container* container, Type* type, EntityValue* value)
+ : simgrid::instr::PajeEvent::PajeEvent(container, type, timestamp, PAJE_NewEvent), value(value)
+ {
+ }
void print() override;
};
}
void StateType::setEvent(std::string value_name)
{
- events_.push_back(new StateEvent(issuer_, this, PAJE_SetState, getEntityValue(value_name)));
+ events_.push_back(new StateEvent(issuer_, this, PAJE_SetState, getEntityValue(value_name), nullptr));
}
void StateType::pushEvent(std::string value_name, TIData* extra)
void StateType::pushEvent(std::string value_name)
{
- events_.push_back(new StateEvent(issuer_, this, PAJE_PushState, getEntityValue(value_name)));
+ events_.push_back(new StateEvent(issuer_, this, PAJE_PushState, getEntityValue(value_name), nullptr));
}
void StateType::popEvent()
{
- events_.push_back(new StateEvent(issuer_, this, PAJE_PopState, nullptr));
+ events_.push_back(new StateEvent(issuer_, this, PAJE_PopState, nullptr, nullptr));
}
VariableType::VariableType(std::string name, std::string color, Type* father) : Type(name, name, color, father)
void LinkType::endEvent(container_t endContainer, std::string value, std::string key)
{
- new LinkEvent(issuer_, this, PAJE_EndLink, endContainer, value, key);
+ new LinkEvent(issuer_, this, PAJE_EndLink, endContainer, value, key, -1);
}
void Type::logDefinition(e_event_type event_type)
{
- if (instr_fmt_type != instr_fmt_paje)
+ if (trace_format != simgrid::instr::TraceFormat::Paje)
return;
std::stringstream stream;
XBT_DEBUG("%s: event_type=%u, timestamp=%.*f", __func__, event_type, TRACE_precision(), 0.);
void Type::logDefinition(simgrid::instr::Type* source, simgrid::instr::Type* dest)
{
- if (instr_fmt_type != instr_fmt_paje)
+ if (trace_format != simgrid::instr::TraceFormat::Paje)
return;
std::stringstream stream;
XBT_DEBUG("%s: event_type=%u, timestamp=%.*f", __func__, PAJE_DefineLinkType, TRACE_precision(), 0.);
void EntityValue::print()
{
- if (instr_fmt_type != instr_fmt_paje)
+ if (trace_format != simgrid::instr::TraceFormat::Paje)
return;
std::stringstream stream;
XBT_DEBUG("%s: event_type=%u", __func__, PAJE_DefineEntityValue);
#include <xbt/base.h>
-#include "instr/instr_interface.h"
+#include "instr/instr_interface.hpp"
#include "simgrid/instr.h"
#include "simgrid_config.h"
#include "src/instr/instr_paje_containers.hpp"
namespace simgrid {
namespace instr {
+/* Format of TRACING output.
+ * - paje is the regular format, that we all know
+ * - TI is a trick to reuse the tracing functions to generate a time independent trace during the execution. Such
+ * trace can easily be replayed with smpi_replay afterward. This trick should be removed and replaced by some code
+ * using the signal that we will create to cleanup the TRACING
+ */
+enum class TraceFormat { Paje, /*TimeIndependent*/ Ti };
+extern TraceFormat trace_format;
+
class TIData {
std::string name_;
double amount_ = 0;
XBT_PRIVATE std::string instr_pid(s4u_Actor* proc);
-extern "C" {
-
extern XBT_PRIVATE std::set<std::string> created_categories;
extern XBT_PRIVATE std::set<std::string> declared_marks;
extern XBT_PRIVATE std::set<std::string> user_host_variables;
XBT_PRIVATE void dump_comment_file(std::string filename);
XBT_PRIVATE void dump_comment(std::string comment);
-/* Format of TRACING output.
- * - paje is the regular format, that we all know
- * - TI is a trick to reuse the tracing functions to generate a time independent trace during the execution. Such
- * trace can easily be replayed with smpi_replay afterward. This trick should be removed and replaced by some code
- * using the signal that we will create to cleanup the TRACING
- */
-enum instr_fmt_type_t { instr_fmt_paje, instr_fmt_TI };
-extern instr_fmt_type_t instr_fmt_type;
-}
XBT_PRIVATE std::string TRACE_get_comment();
XBT_PRIVATE std::string TRACE_get_comment_file();
XBT_PRIVATE std::string TRACE_get_filename();
XBT_PRIVATE container_t smpi_container(int rank);
-extern "C" {
-
XBT_PRIVATE void TRACE_internal_smpi_set_category(const char* category);
XBT_PRIVATE const char* TRACE_internal_smpi_get_category();
XBT_PRIVATE void TRACE_smpi_computing_init(int rank);
std::to_string(linenumber);
}
};
-}
#endif
/* Now transform the cond wait simcall into a mutex lock one */
smx_simcall_t simcall = &proc.simcall;
- smx_mutex_t mutex;
+ smx_mutex_t simcall_mutex;
if (simcall->call == SIMCALL_COND_WAIT)
- mutex = simcall_cond_wait__get__mutex(simcall);
+ simcall_mutex = simcall_cond_wait__get__mutex(simcall);
else
- mutex = simcall_cond_wait_timeout__get__mutex(simcall);
+ simcall_mutex = simcall_cond_wait_timeout__get__mutex(simcall);
simcall->call = SIMCALL_MUTEX_LOCK;
- simcall_HANDLER_mutex_lock(simcall, mutex);
+ simcall_HANDLER_mutex_lock(simcall, simcall_mutex);
}
XBT_OUT();
}
#ifndef SIMGRID_KERNEL_CONTEXT_CONTEXT_HPP
#define SIMGRID_KERNEL_CONTEXT_CONTEXT_HPP
-#include "instr/instr_interface.h"
+#include "instr/instr_interface.hpp"
#include "src/internal_config.h"
#include "src/simix/smx_network_private.hpp"
typedef simgrid::kernel::context::ContextFactory *smx_context_factory_t;
-extern "C" {
-
XBT_PRIVATE void SIMIX_context_mod_init();
XBT_PRIVATE void SIMIX_context_mod_exit();
XBT_PUBLIC int SIMIX_process_get_maxpid();
XBT_PRIVATE void SIMIX_post_create_environment();
-}
XBT_PRIVATE simgrid::simix::ActorCodeFactory& SIMIX_get_actor_code_factory(const char *name);
#include "ContextUnix.hpp"
#include "mc/mc.h"
-#include "src/mc/mc_ignore.h"
+#include "src/mc/mc_ignore.hpp"
#include "src/simix/ActorImpl.hpp"
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_context);
}
}
-void DragonflyZone::rankId_to_coords(int rankId, unsigned int (*coords)[4])
+void DragonflyZone::rankId_to_coords(int rankId, unsigned int coords[4])
{
// coords : group, chassis, blade, node
- (*coords)[0] = rankId / (num_chassis_per_group_ * num_blades_per_chassis_ * num_nodes_per_blade_);
- rankId = rankId % (num_chassis_per_group_ * num_blades_per_chassis_ * num_nodes_per_blade_);
- (*coords)[1] = rankId / (num_blades_per_chassis_ * num_nodes_per_blade_);
- rankId = rankId % (num_blades_per_chassis_ * num_nodes_per_blade_);
- (*coords)[2] = rankId / num_nodes_per_blade_;
- (*coords)[3] = rankId % num_nodes_per_blade_;
+ coords[0] = rankId / (num_chassis_per_group_ * num_blades_per_chassis_ * num_nodes_per_blade_);
+ rankId = rankId % (num_chassis_per_group_ * num_blades_per_chassis_ * num_nodes_per_blade_);
+ coords[1] = rankId / (num_blades_per_chassis_ * num_nodes_per_blade_);
+ rankId = rankId % (num_blades_per_chassis_ * num_nodes_per_blade_);
+ coords[2] = rankId / num_nodes_per_blade_;
+ coords[3] = rankId % num_nodes_per_blade_;
}
void DragonflyZone::parse_specific_arguments(ClusterCreationArgs* cluster)
}
unsigned int myCoords[4];
- rankId_to_coords(src->id(), &myCoords);
+ rankId_to_coords(src->id(), myCoords);
unsigned int targetCoords[4];
- rankId_to_coords(dst->id(), &targetCoords);
+ rankId_to_coords(dst->id(), targetCoords);
XBT_DEBUG("src : %u group, %u chassis, %u blade, %u node", myCoords[0], myCoords[1], myCoords[2], myCoords[3]);
XBT_DEBUG("dst : %u group, %u chassis, %u blade, %u node", targetCoords[0], targetCoords[1], targetCoords[2],
targetCoords[3]);
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_cluster_torus, surf_route_cluster, "Torus Routing part of surf");
-inline void rankId_to_coords(int rankId, std::vector<unsigned int> dimensions, unsigned int (*coords)[4])
+inline void rankId_to_coords(int rankId, std::vector<unsigned int> dimensions, unsigned int* coords)
{
unsigned int dim_size_product = 1;
unsigned int i = 0;
for (auto const& cur_dim_size : dimensions) {
- (*coords)[i] = (rankId / dim_size_product) % cur_dim_size;
+ coords[i] = (rankId / dim_size_product) % cur_dim_size;
dim_size_product *= cur_dim_size;
i++;
}
* Arrays that hold the coordinates of the current node andthe target; comparing the values at the i-th position of
* both arrays, we can easily assess whether we need to route into this dimension or not.
*/
- unsigned int myCoords[4];
- rankId_to_coords(src->id(), dimensions_, &myCoords);
- unsigned int targetCoords[4];
- rankId_to_coords(dst->id(), dimensions_, &targetCoords);
+ unsigned int myCoords[dimensions_.size()];
+ rankId_to_coords(src->id(), dimensions_, myCoords);
+ unsigned int targetCoords[dimensions_.size()];
+ rankId_to_coords(dst->id(), dimensions_, targetCoords);
/*
* linkOffset describes the offset where the link we want to use is stored(+1 is added because each node has a link
* from itself to itself, which can only be the case if src->m_id == dst->m_id -- see above for this special case)
#include <simgrid/modelchecker.h>
#include "src/mc/ModelChecker.hpp"
-#include "src/mc/mc_ignore.h"
+#include "src/mc/mc_ignore.hpp"
#include "src/mc/mc_private.hpp"
#include "src/mc/mc_record.hpp"
#include "src/mc/remote/Client.hpp"
}
}
-extern "C" {
-
/**
* Type: `xbt_dynar_t<mc_list_comm_pattern_t>`
*/
XBT_PRIVATE void MC_state_copy_incomplete_communications_pattern(simgrid::mc::State* state);
XBT_PRIVATE void MC_state_copy_index_communications_pattern(simgrid::mc::State* state);
-}
#endif
/* 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 SIMGRID_MC_IGNORE_H
-#define SIMGRID_MC_IGNORE_H
+#ifndef SIMGRID_MC_IGNORE_HPP
+#define SIMGRID_MC_IGNORE_HPP
#include "src/internal_config.h"
#if HAVE_UCONTEXT_H
-#include <ucontext.h> /* context relative declarations */
+#include <ucontext.h> /* context relative declarations */
-SG_BEGIN_DECL();
XBT_PUBLIC void MC_register_stack_area(void* stack, smx_actor_t process, ucontext_t* context, size_t size);
-SG_END_DECL();
#endif
}
}
-extern "C" {
-
/********************************* MC Global **********************************/
XBT_PRIVATE void MC_init_dot_output();
#define MC_VERBOSE 1
/********************************** Miscellaneous **********************************/
-}
-
namespace simgrid {
namespace mc {
* MCed code.
*/
-extern "C" {
-
/** Get the issuer of a simcall (`req->issuer`)
*
* In split-process mode, it does the black magic necessary to get an address
XBT_PRIVATE int MC_smpi_process_count(void);
XBT_PRIVATE unsigned long MC_smx_get_maxpid(void);
-}
#endif
#include "src/mc/mc_forward.hpp"
#include "src/mc/mc_unw.hpp"
-extern "C" {
-
// ***** Snapshot region
XBT_PRIVATE void mc_region_restore_sparse(simgrid::mc::RemoteClient* process, mc_mem_region_t reg);
XBT_PRIVATE mc_mem_region_t mc_get_snapshot_region(const void* addr, const simgrid::mc::Snapshot* snapshot,
int process_index);
-}
// ***** MC Snapshot
}
}
-extern "C" {
-
static XBT_ALWAYS_INLINE mc_mem_region_t mc_get_region_hinted(void* addr, simgrid::mc::Snapshot* snapshot,
int process_index, mc_mem_region_t region)
{
}
static const void* mc_snapshot_get_heap_end(simgrid::mc::Snapshot* snapshot);
-}
namespace simgrid {
namespace mc {
}
}
-extern "C" {
-
XBT_PRIVATE void mc_restore_page_snapshot_region(simgrid::mc::RemoteClient* process, void* start_addr,
simgrid::mc::ChunkedData const& pagenos);
void* res;
return *(void**)MC_region_read(region, &res, addr, sizeof(void*));
}
-}
#endif
#include "simgrid/s4u/Engine.hpp"
#include "simgrid/s4u/Host.hpp"
-#include "instr/instr_interface.h"
+#include "instr/instr_interface.hpp"
#include "mc/mc.h"
#include "src/msg/msg_private.hpp"
/* 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 "instr/instr_interface.h"
+#include "instr/instr_interface.hpp"
#include "mc/mc.h"
#include "simgrid/kernel/routing/NetPoint.hpp"
#include "simgrid/kernel/routing/NetZoneImpl.hpp"
#include "simgrid/kernel/resource/Action.hpp"
#include "simgrid/s4u/Engine.hpp"
#include "simgrid/sg_config.hpp"
-#include "src/include/instr/instr_interface.h"
+#include "src/include/instr/instr_interface.hpp"
#include "src/surf/surf_interface.hpp"
XBT_LOG_NEW_CATEGORY(sd, "Logging specific to SimDag");
}
}
-extern "C" {
extern XBT_PRIVATE simgrid::sd::Global *sd_global;
/* Task */
XBT_PRIVATE bool acyclic_graph_detail(xbt_dynar_t dag);
XBT_PRIVATE void uniq_transfer_task_name(SD_task_t task);
XBT_PRIVATE const char *__get_state_name(e_SD_task_state_t state);
-}
#endif
/* sg_config: configuration infrastructure for the simulation world */
#include "simgrid/sg_config.hpp"
-#include "instr/instr_interface.h"
+#include "instr/instr_interface.hpp"
#include "mc/mc.h"
#include "simgrid/instr.h"
#include "src/internal_config.h"
typedef simgrid::kernel::actor::ActorImpl* smx_actor_t;
-extern "C" {
-
XBT_PRIVATE smx_actor_t SIMIX_process_create(const char* name, std::function<void()> code, void* data, sg_host_t host,
std::map<std::string, std::string>* properties,
smx_actor_t parent_process);
XBT_PRIVATE void SIMIX_process_auto_restart_set(smx_actor_t process, int auto_restart);
extern void (*SMPI_switch_data_segment)(simgrid::s4u::ActorPtr actor);
-}
XBT_PRIVATE void SIMIX_process_sleep_destroy(smx_activity_t synchro);
XBT_PRIVATE smx_activity_t SIMIX_process_join(smx_actor_t issuer, smx_actor_t process, double timeout);
#include <boost/intrusive_ptr.hpp>
-extern "C" {
-
/********************************* Simcalls *********************************/
XBT_PUBLIC_DATA const char* simcall_names[]; /* Name of each simcall */
XBT_PRIVATE const char* SIMIX_simcall_name(e_smx_simcall_t kind);
XBT_PRIVATE void SIMIX_run_kernel(std::function<void()> const* code);
XBT_PRIVATE void SIMIX_run_blocking(std::function<void()> const* code);
-}
/* Defines the marshal/unmarshal functions for each type of parameters.
*
}
}
-extern "C" {
XBT_PRIVATE void SIMIX_host_add_auto_restart_process(sg_host_t host, const char* name, std::function<void()> code,
void* data, double kill_time,
std::map<std::string, std::string>* properties, int auto_restart);
XBT_PRIVATE void SIMIX_execution_finish(smx_activity_t synchro);
XBT_PRIVATE void SIMIX_set_category(smx_activity_t synchro, const char* category);
-}
XBT_PRIVATE boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>
SIMIX_execution_start(const char* name, double flops_amount, double priority, double bound, sg_host_t host);
}
}
-extern "C" {
-
XBT_PUBLIC_DATA std::unique_ptr<simgrid::simix::Global> simix_global;
XBT_PUBLIC void SIMIX_clean();
_smx_throw_issuer->exception = std::make_exception_ptr(e); \
} else \
((void)0)
-}
#endif
#include <time.h>
#endif
-extern "C" {
-
#define PERSISTENT 0x1
#define NON_PERSISTENT 0x2
#define SEND 0x4
XBT_PRIVATE void smpi_free_tmp_buffer(void* buf);
XBT_PRIVATE void smpi_free_replay_tmp_buffers();
+extern "C" {
// f77 wrappers
+
void mpi_init_(int* ierr);
void mpi_finalize_(int* ierr);
void mpi_abort_(int* comm, int* errorcode, int* ierr);
XBT_PUBLIC int smpi_getopt_long (int argc, char *const *argv, const char *options, const struct option *long_options, int *opt_index);
XBT_PUBLIC int smpi_getopt (int argc, char *const *argv, const char *options);
-// TODO, make this static and expose it more cleanly
+} // extern "C"
struct s_smpi_privatization_region_t {
void* address;
extern XBT_PRIVATE int smpi_loaded_page;
extern XBT_PRIVATE int smpi_universe_size;
XBT_PRIVATE smpi_privatization_region_t smpi_init_global_memory_segment_process();
-}
/**
* Get the address of the beginning of the memory page where addr is located.
extern std::unordered_map<std::string, double> location2speedup;
/** @brief Returns the last call location (filename, linenumber). Process-specific. */
-extern "C" {
XBT_PUBLIC smpi_trace_call_location_t* smpi_trace_get_call_location();
-}
enum class SmpiPrivStrategies { None = 0, Mmap = 1, Dlopen = 2, Default = Dlopen };
#include <string>
#include <vector>
-extern "C" {
-
// Methods used to parse and store the values for timing injections in smpi
struct s_smpi_factor_t {
size_t factor = 0;
std::vector<double> values;
};
-}
XBT_PUBLIC std::vector<s_smpi_factor_t> parse_factor(std::string smpi_coef_string);
#include <sstream>
#include <vector>
-using simgrid::s4u::Actor;
-
#include <tuple>
// From https://stackoverflow.com/questions/7110301/generic-hash-for-tuples-in-unordered-map-unordered-set
// This is all just to make std::unordered_map work with std::tuple. If we need this in other places,
// this could go into a header file.
-namespace hash_tuple{
- template <typename TT>
- struct hash
- {
- size_t
- operator()(TT const& tt) const
- {
- return std::hash<TT>()(tt);
- }
- };
+namespace hash_tuple {
+template <typename TT> class hash {
+public:
+ size_t operator()(TT const& tt) const { return std::hash<TT>()(tt); }
+};
- template <class T>
- inline void hash_combine(std::size_t& seed, T const& v)
- {
- seed ^= hash_tuple::hash<T>()(v) + 0x9e3779b9 + (seed<<6) + (seed>>2);
- }
+template <class T> inline void hash_combine(std::size_t& seed, T const& v)
+{
+ seed ^= hash_tuple::hash<T>()(v) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
+}
- // Recursive template code derived from Matthieu M.
- template <class Tuple, size_t Index = std::tuple_size<Tuple>::value - 1>
- struct HashValueImpl
- {
- static void apply(size_t& seed, Tuple const& tuple)
- {
- HashValueImpl<Tuple, Index-1>::apply(seed, tuple);
- hash_combine(seed, std::get<Index>(tuple));
- }
- };
+// Recursive template code derived from Matthieu M.
+template <class Tuple, size_t Index = std::tuple_size<Tuple>::value - 1> class HashValueImpl {
+public:
+ static void apply(size_t& seed, Tuple const& tuple)
+ {
+ HashValueImpl<Tuple, Index - 1>::apply(seed, tuple);
+ hash_combine(seed, std::get<Index>(tuple));
+ }
+};
- template <class Tuple>
- struct HashValueImpl<Tuple,0>
- {
- static void apply(size_t& seed, Tuple const& tuple)
- {
- hash_combine(seed, std::get<0>(tuple));
- }
- };
+template <class Tuple> class HashValueImpl<Tuple, 0> {
+public:
+ static void apply(size_t& seed, Tuple const& tuple) { hash_combine(seed, std::get<0>(tuple)); }
+};
- template <typename ... TT>
- struct hash<std::tuple<TT...>>
- {
- size_t
- operator()(std::tuple<TT...> const& tt) const
- {
- size_t seed = 0;
- HashValueImpl<std::tuple<TT...> >::apply(seed, tt);
- return seed;
- }
- };
+template <typename... TT> class hash<std::tuple<TT...>> {
+public:
+ size_t operator()(std::tuple<TT...> const& tt) const
+ {
+ size_t seed = 0;
+ HashValueImpl<std::tuple<TT...>>::apply(seed, tt);
+ return seed;
+ }
+};
}
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_replay,smpi,"Trace Replay with SMPI");
template <class T> class ReplayAction {
protected:
const std::string name;
- RequestStorage* req_storage; // Points to the right storage for this process, nullptr except for Send/Recv/Wait/Test actions.
const int my_proc_id;
T args;
public:
- explicit ReplayAction(std::string name, RequestStorage& storage) : name(name), req_storage(&storage), my_proc_id(simgrid::s4u::this_actor::get_pid()) {}
- explicit ReplayAction(std::string name) : name(name), req_storage(nullptr), my_proc_id(simgrid::s4u::this_actor::get_pid()) {}
+ explicit ReplayAction(std::string name) : name(name), my_proc_id(simgrid::s4u::this_actor::get_pid()) {}
virtual ~ReplayAction() = default;
virtual void execute(simgrid::xbt::ReplayAction& action)
};
class WaitAction : public ReplayAction<WaitTestParser> {
+private:
+ RequestStorage& req_storage;
+
public:
- WaitAction(RequestStorage& storage) : ReplayAction("Wait", storage) {}
+ explicit WaitAction(RequestStorage& storage) : ReplayAction("Wait"), req_storage(storage) {}
void kernel(simgrid::xbt::ReplayAction& action) override
{
std::string s = boost::algorithm::join(action, " ");
- xbt_assert(req_storage->size(), "action wait not preceded by any irecv or isend: %s", s.c_str());
- MPI_Request request = req_storage->find(args.src, args.dst, args.tag);
- req_storage->remove(request);
+ xbt_assert(req_storage.size(), "action wait not preceded by any irecv or isend: %s", s.c_str());
+ MPI_Request request = req_storage.find(args.src, args.dst, args.tag);
+ req_storage.remove(request);
if (request == MPI_REQUEST_NULL) {
/* Assume that the trace is well formed, meaning the comm might have been caught by a MPI_test. Then just
};
class SendAction : public ReplayAction<SendRecvParser> {
+private:
+ RequestStorage& req_storage;
+
public:
- SendAction() = delete;
- explicit SendAction(std::string name, RequestStorage& storage) : ReplayAction(name, storage) {}
+ explicit SendAction(std::string name, RequestStorage& storage) : ReplayAction(name), req_storage(storage) {}
void kernel(simgrid::xbt::ReplayAction& action) override
{
int dst_traced = MPI_COMM_WORLD->group()->actor(args.partner)->get_pid();
Request::send(nullptr, args.size, args.datatype1, args.partner, args.tag, MPI_COMM_WORLD);
} else if (name == "Isend") {
MPI_Request request = Request::isend(nullptr, args.size, args.datatype1, args.partner, args.tag, MPI_COMM_WORLD);
- req_storage->add(request);
+ req_storage.add(request);
} else {
xbt_die("Don't know this action, %s", name.c_str());
}
};
class RecvAction : public ReplayAction<SendRecvParser> {
+private:
+ RequestStorage& req_storage;
+
public:
- RecvAction() = delete;
- explicit RecvAction(std::string name, RequestStorage& storage) : ReplayAction(name, storage) {}
+ explicit RecvAction(std::string name, RequestStorage& storage) : ReplayAction(name), req_storage(storage) {}
void kernel(simgrid::xbt::ReplayAction& action) override
{
int src_traced = MPI_COMM_WORLD->group()->actor(args.partner)->get_pid();
Request::recv(nullptr, args.size, args.datatype1, args.partner, args.tag, MPI_COMM_WORLD, &status);
} else if (name == "Irecv") {
MPI_Request request = Request::irecv(nullptr, args.size, args.datatype1, args.partner, args.tag, MPI_COMM_WORLD);
- req_storage->add(request);
+ req_storage.add(request);
}
TRACE_smpi_comm_out(my_proc_id);
};
class TestAction : public ReplayAction<WaitTestParser> {
+private:
+ RequestStorage& req_storage;
+
public:
- TestAction(RequestStorage& storage) : ReplayAction("Test", storage) {}
+ explicit TestAction(RequestStorage& storage) : ReplayAction("Test"), req_storage(storage) {}
void kernel(simgrid::xbt::ReplayAction& action) override
{
- MPI_Request request = req_storage->find(args.src, args.dst, args.tag);
- req_storage->remove(request);
+ MPI_Request request = req_storage.find(args.src, args.dst, args.tag);
+ req_storage.remove(request);
// if request is null here, this may mean that a previous test has succeeded
// Different times in traced application and replayed version may lead to this
// In this case, ignore the extra calls.
/* push back request in vector to be caught by a subsequent wait. if the test did succeed, the request is now
* nullptr.*/
if (request == MPI_REQUEST_NULL)
- req_storage->addNullRequest(args.src, args.dst, args.tag);
+ req_storage.addNullRequest(args.src, args.dst, args.tag);
else
- req_storage->add(request);
+ req_storage.add(request);
TRACE_smpi_testing_out(my_proc_id);
}
};
class WaitAllAction : public ReplayAction<ActionArgParser> {
+private:
+ RequestStorage& req_storage;
+
public:
- WaitAllAction(RequestStorage& storage) : ReplayAction("waitAll", storage) {}
+ explicit WaitAllAction(RequestStorage& storage) : ReplayAction("waitAll"), req_storage(storage) {}
void kernel(simgrid::xbt::ReplayAction& action) override
{
- const unsigned int count_requests = req_storage->size();
+ const unsigned int count_requests = req_storage.size();
if (count_requests > 0) {
TRACE_smpi_comm_in(my_proc_id, __func__, new simgrid::instr::Pt2PtTIData("waitAll", -1, count_requests, ""));
std::vector<std::pair</*sender*/int,/*recv*/int>> sender_receiver;
std::vector<MPI_Request> reqs;
- req_storage->get_requests(reqs);
+ req_storage.get_requests(reqs);
for (const auto& req : reqs) {
if (req && (req->flags() & RECV)) {
sender_receiver.push_back({req->src(), req->dst()});
}
MPI_Status status[count_requests];
Request::waitall(count_requests, &(reqs.data())[0], status);
- req_storage->get_store().clear();
+ req_storage.get_store().clear();
for (auto& pair : sender_receiver) {
TRACE_smpi_recv(pair.first, pair.second, 0);
};
XBT_PUBLIC void ns3_initialize(std::string TcpProtocol);
-extern "C" {
XBT_PUBLIC void ns3_simulator(double maxSeconds);
XBT_PUBLIC void ns3_add_link(NetPointNs3* src, NetPointNs3* dst, double bw, double lat);
XBT_PUBLIC void ns3_add_cluster(const char* id, double bw, double lat);
-}
class XBT_PRIVATE SgFlow {
public:
namespace dvfs {
class Governor {
+private:
+ simgrid::s4u::Host* const host_;
+
protected:
- simgrid::s4u::Host* const host;
+ simgrid::s4u::Host* get_host() const { return host_; }
public:
double sampling_rate;
- explicit Governor(simgrid::s4u::Host* ptr) : host(ptr) { init(); }
+ explicit Governor(simgrid::s4u::Host* ptr) : host_(ptr) { init(); }
virtual ~Governor() = default;
void init()
{
- const char* local_sampling_rate_config = host->getProperty(property_sampling_rate);
+ const char* local_sampling_rate_config = host_->getProperty(property_sampling_rate);
double global_sampling_rate_config = xbt_cfg_get_double(property_sampling_rate);
if (local_sampling_rate_config != nullptr) {
sampling_rate = std::stod(local_sampling_rate_config);
public:
explicit Performance(simgrid::s4u::Host* ptr) : Governor(ptr) {}
- void update() override { host->setPstate(0); }
+ void update() override { get_host()->setPstate(0); }
std::string getName() override { return "Performance"; }
};
public:
explicit Powersave(simgrid::s4u::Host* ptr) : Governor(ptr) {}
- void update() override { host->setPstate(host->getPstatesCount() - 1); }
+ void update() override { get_host()->setPstate(get_host()->getPstatesCount() - 1); }
std::string getName() override { return "Powersave"; }
};
std::string getName() override { return "OnDemand"; }
void update() override
{
- double load = host->getCoreCount() * sg_host_get_avg_load(host);
- sg_host_load_reset(host); // Only consider the period between two calls to this method!
+ double load = get_host()->getCoreCount() * sg_host_get_avg_load(get_host());
+ sg_host_load_reset(get_host()); // Only consider the period between two calls to this method!
if (load > freq_up_threshold) {
- host->setPstate(0); /* Run at max. performance! */
+ get_host()->setPstate(0); /* Run at max. performance! */
XBT_INFO("Load: %f > threshold: %f --> changed to pstate %i", load, freq_up_threshold, 0);
} else {
/* The actual implementation uses a formula here: (See Kernel file cpufreq_ondemand.c:158)
* So they assume that frequency increases by 100 MHz. We will just use
* lowest_pstate - load*pstatesCount()
*/
- int max_pstate = host->getPstatesCount() - 1;
+ int max_pstate = get_host()->getPstatesCount() - 1;
// Load is now < freq_up_threshold; exclude pstate 0 (the fastest)
// because pstate 0 can only be selected if load > freq_up_threshold
int new_pstate = max_pstate - load * (max_pstate + 1);
- host->setPstate(new_pstate);
+ get_host()->setPstate(new_pstate);
XBT_DEBUG("Load: %f < threshold: %f --> changed to pstate %i", load, freq_up_threshold, new_pstate);
}
virtual std::string getName() override { return "Conservative"; }
virtual void update() override
{
- double load = host->getCoreCount() * sg_host_get_avg_load(host);
- int pstate = host->getPstate();
- sg_host_load_reset(host); // Only consider the period between two calls to this method!
+ double load = get_host()->getCoreCount() * sg_host_get_avg_load(get_host());
+ int pstate = get_host()->getPstate();
+ sg_host_load_reset(get_host()); // Only consider the period between two calls to this method!
if (load > freq_up_threshold) {
if (pstate != 0) {
- host->setPstate(pstate - 1);
+ get_host()->setPstate(pstate - 1);
XBT_INFO("Load: %f > threshold: %f -> increasing performance to pstate %d", load, freq_up_threshold, pstate - 1);
}
else {
XBT_DEBUG("Load: %f > threshold: %f -> but cannot speed up even more, already in highest pstate %d", load, freq_up_threshold, pstate);
}
} else if (load < freq_down_threshold) {
- int max_pstate = host->getPstatesCount() - 1;
+ int max_pstate = get_host()->getPstatesCount() - 1;
if (pstate != max_pstate) { // Are we in the slowest pstate already?
- host->setPstate(pstate + 1);
+ get_host()->setPstate(pstate + 1);
XBT_INFO("Load: %f < threshold: %f -> slowing down to pstate %d", load, freq_down_threshold, pstate + 1);
}
else {
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "surf_interface.hpp"
-#include "instr/instr_interface.h" // TRACE_is_enabled(). FIXME: remove by subscribing tracing to the surf signals
+#include "instr/instr_interface.hpp" // TRACE_is_enabled(). FIXME: remove by subscribing tracing to the surf signals
#include "mc/mc.h"
#include "simgrid/s4u/Engine.hpp"
#include "simgrid/sg_config.hpp"
#include "simgrid/forward.h"
#include "xbt/sysdep.h"
-extern "C" {
-
/* Generic functions common to all models */
XBT_PRIVATE FILE* surf_fopen(const char* name, const char* mode);
/* from surf_instr.c */
void TRACE_surf_host_set_speed(double date, const char* resource, double power);
void TRACE_surf_link_set_bandwidth(double date, const char* resource, double bandwidth);
-}
#endif
#include <xbt/signal.hpp>
-extern "C" {
-
/* Module management functions */
XBT_PUBLIC void sg_platf_init();
XBT_PUBLIC void sg_platf_exit();
XBT_PUBLIC double surf_parse_get_speed(const char* string, const char* entity_kind, std::string name);
XBT_PUBLIC int surf_parse(); /* Entry-point to the parser */
-}
#endif
};
}}}
-extern "C" {
-
/********** Routing **********/
void routing_cluster_add_backbone(simgrid::kernel::resource::LinkImpl* bb);
/*** END of the parsing cruft ***/
XBT_PUBLIC int surf_parse_get_debug();
XBT_PUBLIC void surf_parse_set_debug(int bdebug);
XBT_PUBLIC int surf_parse_lex_destroy();
-}
namespace simgrid {
namespace surf {
/* 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 "instr/instr_interface.h" // TRACE_start(). FIXME: remove by subscribing tracing to the surf signals
+#include "surf/surf.hpp"
+#include "instr/instr_interface.hpp" // TRACE_start(). FIXME: remove by subscribing tracing to the surf signals
#include "src/surf/cpu_interface.hpp"
#include "src/surf/network_interface.hpp"
#include "src/surf/surf_interface.hpp"
#include "src/surf/xml/platf_private.hpp"
-#include "surf/surf.hpp"
#include <vector>
if (enable_smpi_MPICH3_testsuite AND HAVE_RAW_CONTEXTS)
ADD_TEST(test-smpi-mpich3-rma-raw ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/rma ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/rma -tests=testlist -execarg=--cfg=contexts/factory:raw)
SET_TESTS_PROPERTIES(test-smpi-mpich3-rma-raw PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!")
+ if (enable_thread_sanitizer)
+ SET_TESTS_PROPERTIES(test-smpi-mpich3-rma-raw PROPERTIES TIMEOUT 1500)
+ endif()
endif()
foreach(file accfence1 accfence2_am accfence2 accpscw1 allocmem epochtest getfence1 getgroup manyrma3 nullpscw
set(EXTRA_DIST
src/bindings/java/MANIFEST.in
- src/include/instr/instr_interface.h
+ src/include/instr/instr_interface.hpp
src/include/mc/datatypes.h
src/include/mc/mc.h
src/include/simgrid/sg_config.hpp
src/mc/mc_dwarf_tagnames.cpp
src/mc/mc_hash.hpp
src/mc/mc_hash.cpp
- src/mc/mc_ignore.h
+ src/mc/mc_ignore.hpp
src/mc/LocationList.hpp
src/mc/LocationList.cpp
src/mc/mc_record.cpp