XBT_PUBLIC_DATA(xbt_cfg_t) simgrid_config;
XBT_PUBLIC_DATA(int) _sg_cfg_init_status;
XBT_PUBLIC_DATA(int) _sg_cfg_exit_asap;
-XBT_PUBLIC(int) sg_cfg_is_default_value(const char* name);
-XBT_PUBLIC(int) sg_cfg_get_int(const char* name);
-XBT_PUBLIC(double) sg_cfg_get_double(const char* name);
-XBT_PUBLIC(char*) sg_cfg_get_string(const char* name);
-XBT_PUBLIC(int) sg_cfg_get_boolean(const char* name);
XBT_PUBLIC(void) sg_config_init(int *argc, char **argv);
XBT_PUBLIC(void) sg_config_finalize(void);
TRACE_init();
/* open the trace file(s) */
- const char* format = sg_cfg_get_string(OPT_TRACING_FORMAT);
+ const char* format = xbt_cfg_get_string(OPT_TRACING_FORMAT);
XBT_DEBUG("Tracing format %s\n", format);
if(!strcmp(format, "Paje")){
TRACE_paje_init();
xbt_dict_free(&created_categories);
/* close the trace files */
- const char* format = sg_cfg_get_string(OPT_TRACING_FORMAT);
+ const char* format = xbt_cfg_get_string(OPT_TRACING_FORMAT);
XBT_DEBUG("Tracing format %s\n", format);
if(!strcmp(format, "Paje")){
TRACE_paje_end();
std::unique_ptr<simgrid::mc::Process> process(new simgrid::mc::Process(pid, socket));
// TODO, automatic detection of the config from the process
process->privatized(
- sg_cfg_get_boolean("smpi/privatize_global_variables"));
+ xbt_cfg_get_boolean("smpi/privatize_global_variables"));
modelChecker_ = std::unique_ptr<ModelChecker>(
new simgrid::mc::ModelChecker(std::move(process)));
xbt_assert(mc_model_checker == nullptr);
simgrid::mc::Session* session;
}
-}
\ No newline at end of file
+}
XBT_DEBUG("ADD MSG LEVELS");
MSG_STORAGE_LEVEL = xbt_lib_add_level(storage_lib, (void_f_pvoid_t) __MSG_storage_destroy);
MSG_FILE_LEVEL = xbt_lib_add_level(file_lib, (void_f_pvoid_t) __MSG_file_destroy);
- if(sg_cfg_get_boolean("clean_atexit")) atexit(MSG_exit);
+ if(xbt_cfg_get_boolean("clean_atexit")) atexit(MSG_exit);
}
/** \ingroup msg_simulation
model_description[0].name ? model_description[0].name : "n/a");
for (int i = 1; model_description[i].name; i++)
p += sprintf(p, ", %s", model_description[i].name);
- sprintf(p,
- ".\n (use 'help' as a value to see the long description of each %s)",
- name);
+ sprintf(p, ".\n (use 'help' as a value to see the long description of each %s)", name);
}
/* create the config set, register what should be and parse the command line*/
const char *dflt_ctx_fact = "thread";
{
char *p = description +
- sprintf(description,
- "Context factory to use in SIMIX. Possible values: %s",
- dflt_ctx_fact);
+ sprintf(description, "Context factory to use in SIMIX. Possible values: %s", dflt_ctx_fact);
#if HAVE_UCONTEXT_CONTEXTS
dflt_ctx_fact = "ucontext";
p += sprintf(p, ", %s", dflt_ctx_fact);
xbt_cfg_free(&simgrid_config);
_sg_cfg_init_status = 0;
}
-
-int sg_cfg_is_default_value(const char *name)
-{
- return xbt_cfg_is_default_value(name);
-}
-
-int sg_cfg_get_int(const char* name)
-{
- return xbt_cfg_get_int(name);
-}
-
-double sg_cfg_get_double(const char* name)
-{
- return xbt_cfg_get_double(name);
-}
-
-char* sg_cfg_get_string(const char* name)
-{
- return xbt_cfg_get_string(name);
-}
-
-int sg_cfg_get_boolean(const char* name)
-{
- return xbt_cfg_get_boolean(name);
-}
-
simix_timers = xbt_heap_new(8, &free);
}
- if (sg_cfg_get_boolean("clean_atexit"))
+ if (xbt_cfg_get_boolean("clean_atexit"))
atexit(SIMIX_clean);
#if HAVE_MC
static double smpi_os(double size)
{
if (!smpi_os_values) {
- smpi_os_values = parse_factor(sg_cfg_get_string("smpi/os"));
+ smpi_os_values = parse_factor(xbt_cfg_get_string("smpi/os"));
smpi_register_static(smpi_os_values, xbt_dynar_free_voidp);
}
unsigned int iter = 0;
static double smpi_ois(double size)
{
if (!smpi_ois_values) {
- smpi_ois_values = parse_factor(sg_cfg_get_string("smpi/ois"));
+ smpi_ois_values = parse_factor(xbt_cfg_get_string("smpi/ois"));
smpi_register_static(smpi_ois_values, xbt_dynar_free_voidp);
}
unsigned int iter = 0;
static double smpi_or(double size)
{
if (!smpi_or_values) {
- smpi_or_values = parse_factor(sg_cfg_get_string("smpi/or"));
+ smpi_or_values = parse_factor(xbt_cfg_get_string("smpi/or"));
smpi_register_static(smpi_or_values, xbt_dynar_free_voidp);
}
unsigned int iter = 0;
if (request->flags & RECV) {
print_request("New recv", request);
- int async_small_thresh = sg_cfg_get_int("smpi/async_small_thresh");
+ int async_small_thresh = xbt_cfg_get_int("smpi/async_small_thresh");
xbt_mutex_t mut = smpi_process_mailboxes_mutex();
if (async_small_thresh != 0 ||request->flags & RMA)
XBT_DEBUG("sending size of %zu : sleep %f ", request->size, smpi_os(request->size));
}
- int async_small_thresh = sg_cfg_get_int("smpi/async_small_thresh");
+ int async_small_thresh = xbt_cfg_get_int("smpi/async_small_thresh");
xbt_mutex_t mut=smpi_process_remote_mailboxes_mutex(receiver);
void* buf = request->buf;
if ( (! (request->flags & SSEND)) &&
- (static_cast<int>(request->size) < sg_cfg_get_int("smpi/send_is_detached_thresh"))) {
+ (static_cast<int>(request->size) < xbt_cfg_get_int("smpi/send_is_detached_thresh"))) {
void *oldbuf = NULL;
request->detached = 1;
XBT_DEBUG("Send request %p is detached", request);
print_request("New iprobe", request);
// We have to test both mailboxes as we don't know if we will receive one one or another
- if (sg_cfg_get_int("smpi/async_small_thresh")>0){
+ if (xbt_cfg_get_int("smpi/async_small_thresh")>0){
mailbox = smpi_process_mailbox_small();
XBT_DEBUG("trying to probe the perm recv mailbox");
request->action = simcall_comm_iprobe(mailbox, 0, request->src, request->tag, &match_recv, (void*)request);
xbt_die("Aborting.");
}
// Simulate the benchmarked computation unless disabled via command-line argument
- if (sg_cfg_get_boolean("smpi/simulate_computation")) {
+ if (xbt_cfg_get_boolean("smpi/simulate_computation")) {
smpi_execute(xbt_os_timer_elapsed(timer));
}
void *smpi_shared_malloc(size_t size, const char *file, int line)
{
void* mem;
- if (sg_cfg_get_boolean("smpi/use_shared_malloc")){
+ if (xbt_cfg_get_boolean("smpi/use_shared_malloc")){
int fd;
smpi_source_location loc(file, line);
auto res = allocs.insert(std::make_pair(loc, shared_data_t()));
{
char loc[PTR_STRLEN];
- if (sg_cfg_get_boolean("smpi/use_shared_malloc")){
+ if (xbt_cfg_get_boolean("smpi/use_shared_malloc")){
snprintf(loc, PTR_STRLEN, "%p", ptr);
auto meta = allocs_metadata.find(ptr);
if (meta == allocs_metadata.end()) {
char *name_list = NULL;
int selector_on=0;
if(name==NULL){//no argument provided, use active selector's algorithm
- name=(char*)sg_cfg_get_string("smpi/coll_selector");
+ name=(char*)xbt_cfg_get_string("smpi/coll_selector");
selector_on=1;
}
for (int i = 0; table[i].name; i++)
static void smpi_check_options(){
//check correctness of MPI parameters
- xbt_assert(sg_cfg_get_int("smpi/async_small_thresh") <= sg_cfg_get_int("smpi/send_is_detached_thresh"));
+ xbt_assert(xbt_cfg_get_int("smpi/async_small_thresh") <= xbt_cfg_get_int("smpi/send_is_detached_thresh"));
- if (sg_cfg_is_default_value("smpi/running_power")) {
+ if (xbt_cfg_is_default_value("smpi/running_power")) {
XBT_INFO("You did not set the power of the host running the simulation. "
"The timings will certainly not be accurate. "
"Use the option \"--cfg=smpi/running_power:<flops>\" to set its value."
}
static void smpi_init_options(){
- int gather_id = find_coll_description(mpi_coll_gather_description, sg_cfg_get_string("smpi/gather"),"gather");
+ int gather_id = find_coll_description(mpi_coll_gather_description, xbt_cfg_get_string("smpi/gather"),"gather");
mpi_coll_gather_fun = (int (*)(void *, int, MPI_Datatype, void *, int, MPI_Datatype, int, MPI_Comm))
mpi_coll_gather_description[gather_id].coll;
int allgather_id = find_coll_description(mpi_coll_allgather_description,
- sg_cfg_get_string("smpi/allgather"),"allgather");
+ xbt_cfg_get_string("smpi/allgather"),"allgather");
mpi_coll_allgather_fun = (int (*)(void *, int, MPI_Datatype, void *, int, MPI_Datatype, MPI_Comm))
mpi_coll_allgather_description[allgather_id].coll;
int allgatherv_id = find_coll_description(mpi_coll_allgatherv_description,
- sg_cfg_get_string("smpi/allgatherv"),"allgatherv");
+ xbt_cfg_get_string("smpi/allgatherv"),"allgatherv");
mpi_coll_allgatherv_fun = (int (*)(void *, int, MPI_Datatype, void *, int *, int *, MPI_Datatype, MPI_Comm))
mpi_coll_allgatherv_description[allgatherv_id].coll;
int allreduce_id = find_coll_description(mpi_coll_allreduce_description,
- sg_cfg_get_string("smpi/allreduce"),"allreduce");
+ xbt_cfg_get_string("smpi/allreduce"),"allreduce");
mpi_coll_allreduce_fun = (int (*)(void *sbuf, void *rbuf, int rcount, MPI_Datatype dtype, MPI_Op op, MPI_Comm comm))
mpi_coll_allreduce_description[allreduce_id].coll;
int alltoall_id = find_coll_description(mpi_coll_alltoall_description,
- sg_cfg_get_string("smpi/alltoall"),"alltoall");
+ xbt_cfg_get_string("smpi/alltoall"),"alltoall");
mpi_coll_alltoall_fun = (int (*)(void *, int, MPI_Datatype, void *, int, MPI_Datatype, MPI_Comm))
mpi_coll_alltoall_description[alltoall_id].coll;
int alltoallv_id = find_coll_description(mpi_coll_alltoallv_description,
- sg_cfg_get_string("smpi/alltoallv"),"alltoallv");
+ xbt_cfg_get_string("smpi/alltoallv"),"alltoallv");
mpi_coll_alltoallv_fun = (int (*)(void *, int *, int *, MPI_Datatype, void *, int *, int *, MPI_Datatype, MPI_Comm))
mpi_coll_alltoallv_description[alltoallv_id].coll;
- int bcast_id = find_coll_description(mpi_coll_bcast_description, sg_cfg_get_string("smpi/bcast"),"bcast");
+ int bcast_id = find_coll_description(mpi_coll_bcast_description, xbt_cfg_get_string("smpi/bcast"),"bcast");
mpi_coll_bcast_fun = (int (*)(void *buf, int count, MPI_Datatype datatype, int root, MPI_Comm com))
mpi_coll_bcast_description[bcast_id].coll;
- int reduce_id = find_coll_description(mpi_coll_reduce_description, sg_cfg_get_string("smpi/reduce"),"reduce");
+ int reduce_id = find_coll_description(mpi_coll_reduce_description, xbt_cfg_get_string("smpi/reduce"),"reduce");
mpi_coll_reduce_fun = (int (*)(void *buf, void *rbuf, int count, MPI_Datatype datatype, MPI_Op op, int root,
MPI_Comm comm)) mpi_coll_reduce_description[reduce_id].coll;
int reduce_scatter_id =
find_coll_description(mpi_coll_reduce_scatter_description,
- sg_cfg_get_string("smpi/reduce_scatter"),"reduce_scatter");
+ xbt_cfg_get_string("smpi/reduce_scatter"),"reduce_scatter");
mpi_coll_reduce_scatter_fun = (int (*)(void *sbuf, void *rbuf, int *rcounts,MPI_Datatype dtype, MPI_Op op,
MPI_Comm comm)) mpi_coll_reduce_scatter_description[reduce_scatter_id].coll;
- int scatter_id = find_coll_description(mpi_coll_scatter_description, sg_cfg_get_string("smpi/scatter"),"scatter");
+ int scatter_id = find_coll_description(mpi_coll_scatter_description, xbt_cfg_get_string("smpi/scatter"),"scatter");
mpi_coll_scatter_fun = (int (*)(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf,
int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm))
mpi_coll_scatter_description[scatter_id].coll;
- int barrier_id = find_coll_description(mpi_coll_barrier_description, sg_cfg_get_string("smpi/barrier"),"barrier");
+ int barrier_id = find_coll_description(mpi_coll_barrier_description, xbt_cfg_get_string("smpi/barrier"),"barrier");
mpi_coll_barrier_fun = (int (*)(MPI_Comm comm)) mpi_coll_barrier_description[barrier_id].coll;
- smpi_cpu_threshold = sg_cfg_get_double("smpi/cpu_threshold");
- smpi_running_power = sg_cfg_get_double("smpi/running_power");
- smpi_privatize_global_variables = sg_cfg_get_boolean("smpi/privatize_global_variables");
+ smpi_cpu_threshold = xbt_cfg_get_double("smpi/cpu_threshold");
+ smpi_running_power = xbt_cfg_get_double("smpi/running_power");
+ smpi_privatize_global_variables = xbt_cfg_get_boolean("smpi/privatize_global_variables");
if (smpi_cpu_threshold < 0)
smpi_cpu_threshold = DBL_MAX;
}
SIMIX_run();
xbt_os_walltimer_stop(global_timer);
- if (sg_cfg_get_boolean("smpi/display_timing")){
+ if (xbt_cfg_get_boolean("smpi/display_timing")){
double global_time = xbt_os_timer_elapsed(global_timer);
XBT_INFO("Simulated time: %g seconds. \n\n"
"The simulation took %g seconds (after parsing and platform setup)\n"
haveGap_=false;
active_nodes=NULL;
- const char* IB_factors_string=sg_cfg_get_string("smpi/IB_penalty_factors");
+ const char* IB_factors_string=xbt_cfg_get_string("smpi/IB_penalty_factors");
xbt_dynar_t radical_elements = xbt_str_split(IB_factors_string, ";");
surf_parse_assert(xbt_dynar_length(radical_elements)==3,
double NetworkSmpiModel::bandwidthFactor(double size)
{
if (!smpi_bw_factor)
- smpi_bw_factor =
- parse_factor(sg_cfg_get_string("smpi/bw_factor"));
+ smpi_bw_factor = parse_factor(xbt_cfg_get_string("smpi/bw_factor"));
unsigned int iter = 0;
s_smpi_factor_t fact;
double NetworkSmpiModel::latencyFactor(double size)
{
if (!smpi_lat_factor)
- smpi_lat_factor =
- parse_factor(sg_cfg_get_string("smpi/lat_factor"));
+ smpi_lat_factor = parse_factor(xbt_cfg_get_string("smpi/lat_factor"));
unsigned int iter = 0;
s_smpi_factor_t fact;
int i;
int cutpath = 0;
TRY { // We don't want to have an exception while checking how to deal with the one we already have, do we?
- cutpath = sg_cfg_get_boolean("exception/cutpath");
+ cutpath = xbt_cfg_get_boolean("exception/cutpath");
} CATCH_ANONYMOUS { }
fprintf(stderr, "\n");