}
}
-SG_BEGIN_DECL()
-
+extern "C" {
typedef simgrid::jedule::Jedule *jedule_t;
-
-SG_END_DECL()
+}
#endif
#endif /* JEDULE_HPP_ */
-/* Copyright (c) 2010-2012, 2014-2016. The SimGrid Team.
+/* Copyright (c) 2010-2012, 2014-2017. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
}
}
-SG_BEGIN_DECL()
-
+extern "C" {
typedef simgrid::jedule::Event * jed_event_t;
-
-SG_END_DECL()
+}
#endif
-/* Copyright (c) 2010-2012, 2014-2016. The SimGrid Team.
+/* Copyright (c) 2010-2012, 2014-2017. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
}
}
-SG_BEGIN_DECL()
+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);
-
-SG_END_DECL()
+}
#endif
#endif
/* end of eclipse-mandated pimple */
-SG_BEGIN_DECL()
+extern "C" {
int JAVA_HOST_LEVEL = -1;
JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_energyInit() {
sg_host_energy_plugin_init();
}
-
-SG_END_DECL()
+} // extern "C"
/** Run a Java org.simgrid.msg.Process
*
#include <simgrid/msg.h>
#include <unordered_map>
-SG_BEGIN_DECL()
+extern "C" {
/* Shut up some errors in eclipse online compiler. I wish such a pimple wouldn't be needed */
#ifndef JNIEXPORT
JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_createEnvironment(JNIEnv * env, jclass cls, jstring jplatformFile);
JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Msg_environmentGetRoutingRoot(JNIEnv * env, jclass cls);
JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_deployApplication(JNIEnv * env, jclass cls, jstring jdeploymentFile);
-
-SG_END_DECL()
+}
#endif
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
-SG_BEGIN_DECL()
+extern "C" {
static jmethodID jas_method_As_constructor;
static jfieldID jas_field_As_bind;
}
return jtable;
}
-
-SG_END_DECL()
+}
#include <jni.h>
#include "simgrid/msg.h"
-SG_BEGIN_DECL()
+extern "C" {
/* Shut up some errors in eclipse online compiler. I wish such a pimple wouldn't be needed */
#ifndef JNIEXPORT
JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_As_getSons(JNIEnv* env, jobject jnetzone);
JNIEXPORT jobject JNICALL Java_org_simgrid_msg_As_getProperty(JNIEnv *env, jobject jhost, jobject jname);
JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_As_getHosts(JNIEnv* env, jobject jnetzone);
-
-SG_END_DECL()
+}
#endif
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
-SG_BEGIN_DECL()
+extern "C" {
static jfieldID jcomm_field_Comm_bind;
static jfieldID jcomm_field_Comm_finished;
xbt_dynar_free(&dyn);
return rank;
}
-
-SG_END_DECL()
+}
#include "jmsg_file.h"
#include "jxbt_utilities.hpp"
-SG_BEGIN_DECL()
+extern "C" {
void jfile_bind(JNIEnv *env, jobject jfile, msg_file_t fd) {
env->SetLongField(jfile, jfile_field_bind, reinterpret_cast<std::intptr_t>(fd));
MSG_file_close(file);
jfile_bind(env, jfile, nullptr);
}
-
-SG_END_DECL()
+}
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
-SG_BEGIN_DECL()
+extern "C" {
static jmethodID jhost_method_Host_constructor;
static jfieldID jhost_field_Host_bind;
msg_host_t host = jhost_get_native(env, jhost);
return MSG_host_get_power_peak_at(host, pstate);
}
-
-SG_END_DECL()
+}
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
-SG_BEGIN_DECL()
+extern "C" {
jfieldID jprocess_field_Process_bind;
jfieldID jprocess_field_Process_host;
JNIEXPORT jint JNICALL Java_org_simgrid_msg_Process_getCount(JNIEnv * env, jclass cls) {
return (jint) MSG_process_get_number();
}
-
-SG_END_DECL()
+}
#include "jmsg_rngstream.h"
#include "jxbt_utilities.hpp"
-SG_BEGIN_DECL()
+extern "C" {
jfieldID jrngstream_bind;
return (jint)RngStream_RandInt(rngstream, (int)i, (int)j);
}
-
-SG_END_DECL()
+}
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
-SG_BEGIN_DECL()
+extern "C" {
static jmethodID jstorage_method_Storage_constructor;
static jfieldID jstorage_field_Storage_bind;
xbt_dynar_free(&table);
return jtable;
}
-
-SG_END_DECL()
+}
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
-SG_BEGIN_DECL()
+extern "C" {
static jfieldID jsynchro_field_Mutex_bind;
sem = (msg_sem_t)(uintptr_t)env->GetLongField(obj, jsynchro_field_Semaphore_bind);
MSG_sem_destroy(sem);
}
-
-SG_END_DECL()
+}
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
-SG_BEGIN_DECL()
+extern "C" {
static jmethodID jtask_method_Comm_constructor;
return (jint) rv;
}
-
-SG_END_DECL()
+}
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
-SG_BEGIN_DECL()
+extern "C" {
extern int JAVA_HOST_LEVEL;
static jfieldID jvm_field_bind;
return static_cast<jobject>(host->extension(JAVA_HOST_LEVEL));
}
-SG_END_DECL()
+}
// Define a new category
XBT_LOG_NEW_DEFAULT_CATEGORY (jtrace, "TRACE for Java(TM)");
-SG_BEGIN_DECL()
+extern "C" {
JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_hostStateDeclare(JNIEnv * env, jclass cls, jstring js)
{
JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkSrcDstVariableSubWithTime(JNIEnv *env, jclass cls, jdouble,
jstring, jstring, jstring, jdouble)
*/
-
-SG_END_DECL()
+}
#include <cstdlib> /* abort */
-SG_BEGIN_DECL()
+extern "C" {
jclass jxbt_get_class(JNIEnv * env, const char *name)
{
{
jxbt_throw_by_name(env, "org/simgrid/msg/TaskCancelledException", details);
}
-
-SG_END_DECL()
+}
#include <stdint.h>
#include <string>
-SG_BEGIN_DECL()
+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);
-
-SG_END_DECL()
+}
#endif
#include <cstddef>
#include <vector>
-SG_BEGIN_DECL()
+extern "C" {
// Methods used to parse and store the values for timing injections in smpi
typedef struct s_smpi_factor *smpi_os_factor_t;
size_t factor=0;
std::vector<double> values;
} s_smpi_factor_t;
-
-SG_END_DECL()
+}
XBT_PUBLIC(std::vector<s_smpi_factor_t>) parse_factor(const char *smpi_coef_string);
return (fabs(value1 - value2) < precision);
}
-SG_BEGIN_DECL()
+extern "C" {
/** @{ @ingroup SURF_lmm */
/**
XBT_PUBLIC(double func_vegas_fpi) (lmm_variable_t var, double x);
/** @} */
-SG_END_DECL()
+}
#endif
} // namespace simgrid::instr
typedef simgrid::instr::Container* container_t;
-SG_BEGIN_DECL()
+extern "C" {
extern XBT_PRIVATE std::set<std::string> created_categories;
extern XBT_PRIVATE std::set<std::string> declared_marks;
*/
typedef enum { instr_fmt_paje, instr_fmt_TI } instr_fmt_type_t;
extern instr_fmt_type_t instr_fmt_type;
-
-SG_END_DECL()
+}
void LogContainerTypeDefinition(simgrid::instr::Type* type);
void LogVariableTypeDefinition(simgrid::instr::Type* type);
#include "src/instr/instr_private.hpp"
#include <string>
-SG_BEGIN_DECL()
+extern "C" {
XBT_PRIVATE void TRACE_internal_smpi_set_category(const char* category);
XBT_PRIVATE const char* TRACE_internal_smpi_get_category();
}
} smpi_trace_call_location_t;
-
-SG_END_DECL()
+}
#endif
typedef simgrid::kernel::context::ContextFactory *smx_context_factory_t;
-SG_BEGIN_DECL()
-
+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();
-
-SG_END_DECL()
+}
XBT_PRIVATE simgrid::simix::ActorCodeFactory& SIMIX_get_actor_code_factory(const char *name);
-/* Copyright (c) 2013-2016. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2013-2017. The SimGrid Team. All rights reserved. */
/* 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. */
}
} // namespace
-SG_BEGIN_DECL()
+extern "C" {
XBT_PRIVATE xbt_node_t new_xbt_graph_node(xbt_graph_t graph, const char* name, xbt_dict_t nodes);
XBT_PRIVATE xbt_edge_t new_xbt_graph_edge(xbt_graph_t graph, xbt_node_t s, xbt_node_t d, xbt_dict_t edges);
-SG_END_DECL()
+}
#endif /* SIMGRID_ROUTING_GENERIC_HPP_ */
#include "src/mc/mc_state.hpp"
#include "src/mc/checker/Checker.hpp"
-SG_BEGIN_DECL()
-
-SG_END_DECL()
-
namespace simgrid {
namespace mc {
}
}
-SG_BEGIN_DECL()
+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);
-
-SG_END_DECL()
+}
#endif
}
}
-SG_BEGIN_DECL()
+extern "C" {
/********************************* MC Global **********************************/
#define MC_VERBOSE 1
/********************************** Miscellaneous **********************************/
-
-SG_END_DECL()
+}
namespace simgrid {
namespace mc {
}
}
-SG_BEGIN_DECL()
-
/** Whether the MC record mode is enabled
*
* The behaviour is not changed. The only real difference is that
// **** Data conversion
-SG_END_DECL()
-
#endif
* MCed code.
*/
-SG_BEGIN_DECL()
+extern "C" {
/** Get the issuer of a simcall (`req->issuer`)
*
XBT_PRIVATE int MC_smpi_process_count(void);
XBT_PRIVATE unsigned long MC_smx_get_maxpid(void);
-
-SG_END_DECL()
+}
#endif
#include "src/mc/mc_forward.hpp"
#include "src/mc/mc_unw.hpp"
-SG_BEGIN_DECL()
+extern "C" {
// ***** Snapshot region
void* res;
return *(void**) MC_region_read(region, &res, addr, sizeof(void*));
}
-
-SG_END_DECL()
+}
#endif
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_action, msg, "MSG actions for trace driven simulation");
-SG_BEGIN_DECL()
+extern "C" {
void MSG_action_init()
{
return res;
}
-
-SG_END_DECL()
+}
#include "src/msg/msg_private.hpp"
-SG_BEGIN_DECL()
+extern "C" {
/** \ingroup msg_simulation
* \brief An application deployer.
{
SIMIX_process_set_function(host_id, function_name, arguments, -1, -1);
}
-
-SG_END_DECL()
+}
#include <lualib.h>
#endif
-SG_BEGIN_DECL()
+extern "C" {
/********************************* MSG **************************************/
for (auto const& host : hosts)
xbt_dynar_push(whereto, &host);
}
-
-SG_END_DECL()
+}
XBT_LOG_NEW_CATEGORY(msg, "All MSG categories");
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_kernel, msg, "Logging specific to MSG (kernel)");
-SG_BEGIN_DECL()
+extern "C" {
MSG_Global_t msg_global = nullptr;
static void MSG_exit();
{
return msg_global->sent_msg;
}
-
-SG_END_DECL()
+}
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_gos, msg, "Logging specific to MSG (gos)");
-SG_BEGIN_DECL()
+extern "C" {
/** \ingroup msg_task_usage
* \brief Executes a task and waits for its termination.
{
return task->category;
}
-
-SG_END_DECL()
+}
simgrid::xbt::Extension<simgrid::s4u::Host, simgrid::MsgHostExt> simgrid::MsgHostExt::EXTENSION_ID;
-SG_BEGIN_DECL()
+extern "C" {
int sg_storage_max_file_descriptors = 1024;
return contents;
}
-
-SG_END_DECL()
+}
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_io, msg, "Logging specific to MSG (io)");
-SG_BEGIN_DECL()
+extern "C" {
/** @addtogroup msg_file
* (#msg_file_t) and the functions for managing it.
xbt_assert((storage != nullptr), "Invalid parameters");
return storage->getHost()->getCname();
}
-
-SG_END_DECL()
+}
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_mailbox, msg, "Logging specific to MSG (mailbox)");
-SG_BEGIN_DECL()
+extern "C" {
/** \ingroup msg_mailbox_management
* \brief Set the mailbox to receive in asynchronous mode
mailbox->setReceiver(simgrid::s4u::Actor::self());
XBT_VERB("%s mailbox set to receive eagerly for myself\n",alias);
}
-
-SG_END_DECL()
+}
} s_MSG_Global_t;
typedef s_MSG_Global_t* MSG_Global_t;
-SG_BEGIN_DECL()
+extern "C" {
XBT_PUBLIC_DATA(MSG_Global_t) msg_global;
XBT_PRIVATE void TRACE_msg_process_resume(msg_process_t process);
XBT_PRIVATE void TRACE_msg_process_sleep_in(msg_process_t process); //called from msg/gos.c
XBT_PRIVATE void TRACE_msg_process_sleep_out(msg_process_t process);
-
-SG_END_DECL()
+}
inline void simdata_task::setUsed()
{
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_process, msg, "Logging specific to MSG (process)");
-SG_BEGIN_DECL()
+extern "C" {
/** @addtogroup m_process_management
*
xbt_free(argv);
return res;
}
-
-SG_END_DECL()
+}
msg_process_t MSG_process_create_from_stdfunc(const char* name, std::function<void()> code, void* data, msg_host_t host,
std::map<std::string, std::string>* properties)
return process->ciface();
}
-SG_BEGIN_DECL()
+extern "C" {
/* Become a process in the simulation
*
{
intrusive_ptr_release(process);
}
-
-SG_END_DECL()
+}
#include "msg_private.hpp"
#include "src/simix/smx_private.hpp"
-SG_BEGIN_DECL()
+extern "C" {
/** @addtogroup m_task_management
*
if (task->simdata->compute)
simcall_execution_set_bound(task->simdata->compute, task->simdata->bound);
}
-
-SG_END_DECL()
+}
#include "simgrid/host.h"
#include "simgrid/simix.hpp"
-SG_BEGIN_DECL()
+extern "C" {
struct dirty_page {
double prev_clock;
{
simgrid::simix::kernelImmediate([vm, bound]() { vm->pimpl_vm_->setBound(bound); });
}
-
-SG_END_DECL()
+}
}
}
-SG_BEGIN_DECL()
+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);
-SG_END_DECL()
+}
#endif
typedef simgrid::simix::ActorImpl* smx_actor_t;
-SG_BEGIN_DECL()
+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,
XBT_PRIVATE void SIMIX_process_auto_restart_set(smx_actor_t process, int auto_restart);
extern void (*SMPI_switch_data_segment)(int dest);
-
-SG_END_DECL()
+}
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>
-SG_BEGIN_DECL()
+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);
-
-SG_END_DECL()
+}
/* Defines the marshal/unmarshal functions for each type of parameters.
*
}
}
-SG_BEGIN_DECL()
+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(simgrid::kernel::activity::ExecImplPtr exec);
XBT_PRIVATE void SIMIX_set_category(smx_activity_t synchro, const char *category);
-
-SG_END_DECL()
+}
XBT_PRIVATE boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>
SIMIX_execution_start(smx_actor_t issuer, const char* name, double flops_amount, double priority, double bound);
}
}
-SG_BEGIN_DECL()
+extern "C" {
XBT_PUBLIC_DATA(std::unique_ptr<simgrid::simix::Global>) simix_global;
e.value = val; \
_smx_throw_issuer->exception = std::make_exception_ptr(e); \
} else ((void)0)
-
-SG_END_DECL()
+}
#endif
#include <unordered_map>
#include <vector>
-SG_BEGIN_DECL()
+extern "C" {
#define PERSISTENT 0x1
#define NON_PERSISTENT 0x2
extern XBT_PRIVATE smpi_privatization_region_t smpi_privatization_regions;
extern XBT_PRIVATE int smpi_loaded_page;
extern XBT_PRIVATE int smpi_universe_size;
-
-SG_END_DECL()
+}
/**
* Get the address of the beginning of the memory page where addr is located.
int node_num;
};
-SG_BEGIN_DECL()
+extern "C" {
XBT_PUBLIC(void) ns3_initialize(const char* TcpProtocol);
XBT_PUBLIC(void)
XBT_PUBLIC(void*) ns3_add_router(const char* id);
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);
-
-SG_END_DECL()
+}
#endif
}
/* **************************** Public interface *************************** */
-SG_BEGIN_DECL()
+extern "C" {
/** \ingroup plugin_energy
* \brief Enable host energy plugin
double cpu_load = lmm_constraint_get_usage(host->pimpl_cpu->constraint()) / host->getSpeed();
return host->extension<HostEnergy>()->getCurrentWattsValue(cpu_load);
}
-
-SG_END_DECL()
+}
}
/* **************************** Public interface *************************** */
-SG_BEGIN_DECL()
+extern "C" {
/** \ingroup plugin_load
* \brief Initializes the HostLoad plugin
host->extension<HostLoad>()->reset();
}
-
-SG_END_DECL()
+}
#define NO_MAX_DURATION -1.0
-SG_BEGIN_DECL()
+extern "C" {
extern XBT_PRIVATE const char *surf_action_state_names[6];
/* 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);
-
-SG_END_DECL()
+}
#endif
#include "xbt/sysdep.h"
#include <vector>
-SG_BEGIN_DECL()
+extern "C" {
/* Iterator within a trace */
typedef struct tmgr_trace_event {
XBT_PUBLIC(tmgr_trace_t) tmgr_trace_new_from_file(std::string filename);
XBT_PUBLIC(tmgr_trace_t) tmgr_trace_new_from_string(std::string id, std::string input, double periodicity);
-
-SG_END_DECL()
+}
namespace simgrid {
/** @brief Modeling of the availability profile (due to an external load) or the churn
#include <xbt/signal.hpp>
-SG_BEGIN_DECL()
+extern "C" {
/* Module management functions */
XBT_PUBLIC(void) sg_platf_init();;
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 */
-
-SG_END_DECL()
+}
#endif
#include <string>
#include <vector>
-SG_BEGIN_DECL()
+extern "C" {
#include "src/surf/xml/simgrid_dtd.h"
#ifndef YY_TYPEDEF_YY_SIZE_T
XBT_PUBLIC(int) surf_parse_lex_destroy();
XBT_PUBLIC(void) routing_route_free(sg_platf_route_cbarg_t route);
-
-SG_END_DECL()
+}
namespace simgrid {
namespace surf {
XBT_PRIVATE std::unordered_map<std::string, std::string> trace_connect_list_link_bw;
XBT_PRIVATE std::unordered_map<std::string, std::string> trace_connect_list_link_lat;
-SG_BEGIN_DECL()
+extern "C" {
void sg_platf_trace_connect(TraceConnectCreationArgs* trace_connect)
{
xbt_assert(traces_set_list.find(trace_connect->trace) != traces_set_list.end(),
surf_parse_error(std::string("Parse error in ") + file);
}
}
-
-SG_END_DECL()
+}
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_parse, surf, "Logging specific to the SURF parsing module");
-SG_BEGIN_DECL()
+extern "C" {
int ETag_surfxml_include_state();
{
return surf_parse_lex();
}
-
-SG_END_DECL()
+}