/*** SURF Globals **************************/
/*******************************************/
XBT_PUBLIC_DATA(xbt_cfg_t) _surf_cfg_set;
+XBT_PUBLIC(int) surf_cfg_get_int(char* name);
+XBT_PUBLIC(double) surf_cfg_get_double(char* name);
+XBT_PUBLIC(char*) surf_cfg_get_string(char* name);
+XBT_PUBLIC(void) surf_cfg_get_peer(const char *name, char **peer, int *port);
+XBT_PUBLIC(xbt_dynar_t) surf_cfg_get_dynar(char* name);
/** \ingroup SURF_simulation
* \brief Initialize SURF
"Cannot (re)start a non-finished communication");
if(request->flags & RECV) {
print_request("New recv", request);
- if (request->size < xbt_cfg_get_int(_surf_cfg_set, "smpi/async_small_thres"))
+ if (request->size < surf_cfg_get_int("smpi/async_small_thres"))
mailbox = smpi_process_mailbox_small();
else
mailbox = smpi_process_mailbox();
/* return;*/
/* }*/
print_request("New send", request);
- if (request->size < xbt_cfg_get_int(_surf_cfg_set, "smpi/async_small_thres")) { // eager mode
+ if (request->size < surf_cfg_get_int("smpi/async_small_thres")) { // eager mode
mailbox = smpi_process_remote_mailbox_small(receiver);
}else{
XBT_DEBUG("Send request %p is not in the permanent receive mailbox (buf: %p)",request,request->buf);
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 (xbt_cfg_get_int(_surf_cfg_set, "smpi/async_small_thres")>0){
+ if (surf_cfg_get_int("smpi/async_small_thres")>0){
mailbox = smpi_process_mailbox_small();
XBT_DEBUG("trying to probe the perm recv mailbox");
request->action = simcall_comm_iprobe(mailbox, request->src, request->tag, &match_recv, (void*)request);
static void smpi_execute(double duration)
{
/* FIXME: a global variable would be less expensive to consult than a call to xbt_cfg_get_double() right on the critical path */
- if (duration >= xbt_cfg_get_double(_surf_cfg_set, "smpi/cpu_threshold")) {
+ if (duration >= surf_cfg_get_double("smpi/cpu_threshold")) {
XBT_DEBUG("Sleep for %f to handle real computation time", duration);
smpi_execute_flops(duration *
- xbt_cfg_get_double(_surf_cfg_set,
- "smpi/running_power"));
+ surf_cfg_get_double("smpi/running_power"));
} else {
XBT_DEBUG("Real computation took %f while option smpi/cpu_threshold is set to %f => ignore it",
- duration, xbt_cfg_get_double(_surf_cfg_set, "smpi/cpu_threshold"));
+ duration, surf_cfg_get_double("smpi/cpu_threshold"));
}
}
else
SIMIX_run();
- if (xbt_cfg_get_int(_surf_cfg_set, "smpi/display_timing"))
+ if (surf_cfg_get_int("smpi/display_timing"))
XBT_INFO("Simulation time: %g seconds.", SIMIX_get_clock());
smpi_global_destroy();
{
if (!smpi_bw_factor)
smpi_bw_factor =
- parse_factor(xbt_cfg_get_string(_surf_cfg_set, "smpi/bw_factor"));
+ parse_factor(surf_cfg_get_string("smpi/bw_factor"));
unsigned int iter = 0;
s_smpi_factor_t fact;
{
if (!smpi_lat_factor)
smpi_lat_factor =
- parse_factor(xbt_cfg_get_string(_surf_cfg_set, "smpi/lat_factor"));
+ parse_factor(surf_cfg_get_string("smpi/lat_factor"));
unsigned int iter = 0;
s_smpi_factor_t fact;
};
#endif /* #ifdef _XBT_WIN32 */
+int surf_cfg_get_int(char* name)
+{
+ return xbt_cfg_get_int(_surf_cfg_set,name);
+}
+double surf_cfg_get_double(char* name)
+{
+ return xbt_cfg_get_double(_surf_cfg_set,name);
+}
+char* surf_cfg_get_string(char* name)
+{
+ return xbt_cfg_get_string(_surf_cfg_set,name);
+}
+void surf_cfg_get_peer(const char *name, char **peer, int *port)
+{
+ xbt_cfg_get_peer(_surf_cfg_set,name, peer, port);
+}
+xbt_dynar_t surf_cfg_get_dynar(char* name)
+{
+ return xbt_cfg_get_dynar(_surf_cfg_set,name);
+}
/*
* Returns the initial path. On Windows the initial path is
* the current directory for the current process in the other
history = tmgr_history_new();
surf_config_init(argc, argv);
+
surf_action_init();
if (MC_is_active())
MC_memory_init();