XBT_LOG_NEW_CATEGORY(simix, "All SIMIX categories");
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_kernel, simix,
"Logging specific to SIMIX (kernel)");
XBT_LOG_NEW_CATEGORY(simix, "All SIMIX categories");
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_kernel, simix,
"Logging specific to SIMIX (kernel)");
-static void* SIMIX_action_mallocator_new_f(void);
-static void SIMIX_action_mallocator_free_f(void* action);
-static void SIMIX_action_mallocator_reset_f(void* action);
+static void* SIMIX_synchro_mallocator_new_f(void);
+static void SIMIX_synchro_mallocator_free_f(void* synchro);
+static void SIMIX_synchro_mallocator_reset_f(void* synchro);
static void _XBT_CALL segvhandler(int signum, siginfo_t *siginfo, void *context)
{
if (siginfo->si_signo == SIGSEGV && siginfo->si_code == SEGV_ACCERR) {
static void _XBT_CALL segvhandler(int signum, siginfo_t *siginfo, void *context)
{
if (siginfo->si_signo == SIGSEGV && siginfo->si_code == SEGV_ACCERR) {
"siginfo = {si_signo = %d, si_errno = %d, si_code = %d, si_addr = %p}\n",
siginfo->si_signo, siginfo->si_errno, siginfo->si_code, siginfo->si_addr);
}
"siginfo = {si_signo = %d, si_errno = %d, si_code = %d, si_addr = %p}\n",
siginfo->si_signo, siginfo->si_errno, siginfo->si_code, siginfo->si_addr);
}
+ } else if (siginfo->si_signo == SIGSEGV) {
+ fprintf(stderr, "Segmentation fault.\n");
+#ifdef HAVE_SMPI
+ if (smpi_enabled() && !smpi_privatize_global_variables) {
+ fprintf(stderr,
+ "Try to enable SMPI variable privatization with --cfg=smpi/privatize_global_variables:yes.\n");
+ }
+#endif
/********************************* SIMIX **************************************/
XBT_INLINE double SIMIX_timer_next(void)
/********************************* SIMIX **************************************/
XBT_INLINE double SIMIX_timer_next(void)
simix_global->create_process_function = SIMIX_process_create;
simix_global->kill_process_function = SIMIX_process_kill;
simix_global->cleanup_process_function = SIMIX_process_cleanup;
simix_global->create_process_function = SIMIX_process_create;
simix_global->kill_process_function = SIMIX_process_kill;
simix_global->cleanup_process_function = SIMIX_process_cleanup;
- simix_global->action_mallocator = xbt_mallocator_new(65536,
- SIMIX_action_mallocator_new_f, SIMIX_action_mallocator_free_f,
- SIMIX_action_mallocator_reset_f);
+ simix_global->synchro_mallocator = xbt_mallocator_new(65536,
+ SIMIX_synchro_mallocator_new_f, SIMIX_synchro_mallocator_free_f,
+ SIMIX_synchro_mallocator_reset_f);
simix_global->autorestart = SIMIX_host_restart_processes;
surf_init(argc, argv); /* Initialize SURF structures */
simix_global->autorestart = SIMIX_host_restart_processes;
surf_init(argc, argv); /* Initialize SURF structures */
/* Prepare to display some more info when dying on Ctrl-C pressing */
signal(SIGINT, inthandler);
/* Prepare to display some more info when dying on Ctrl-C pressing */
signal(SIGINT, inthandler);
/* register a function to be called by SURF after the environment creation */
sg_platf_init();
sg_platf_postparse_add_cb(SIMIX_post_create_environment);
/* register a function to be called by SURF after the environment creation */
sg_platf_init();
sg_platf_postparse_add_cb(SIMIX_post_create_environment);
xbt_dynar_three_way_partition(simix_global->process_that_ran, process_syscall_color);
/* answer sequentially and in a fixed arbitrary order all the simcalls that were issued during that sub-round */
xbt_dynar_three_way_partition(simix_global->process_that_ran, process_syscall_color);
/* answer sequentially and in a fixed arbitrary order all the simcalls that were issued during that sub-round */
* - because the communication failed or were canceled after startup. In this case, it's called from the function
* we are in, by the chunk:
* set = model->states.failed_action_set;
* - because the communication failed or were canceled after startup. In this case, it's called from the function
* we are in, by the chunk:
* set = model->states.failed_action_set;
* This order is also fixed because it depends of the order in which the surf actions were
* added to the system, and only maestro can add stuff this way, through simcalls.
* This order is also fixed because it depends of the order in which the surf actions were
* added to the system, and only maestro can add stuff this way, through simcalls.
* and the argument is very similar to the previous one.
* So, in any case, the orders of calls to SIMIX_comm_finish() do not depend on the order in which user processes are executed.
* So, in any cases, the orders of processes within process_to_run do not depend on the order in which user processes were executed previously.
* and the argument is very similar to the previous one.
* So, in any case, the orders of calls to SIMIX_comm_finish() do not depend on the order in which user processes are executed.
* So, in any cases, the orders of processes within process_to_run do not depend on the order in which user processes were executed previously.
xbt_dynar_foreach(simix_global->process_that_ran, iter, process) {
if (process->simcall.call != SIMCALL_NONE) {
xbt_dynar_foreach(simix_global->process_that_ran, iter, process) {
if (process->simcall.call != SIMCALL_NONE) {
/* Wake up all processes waiting for a Surf action to finish */
xbt_dynar_foreach(model_list, iter, model) {
while ((action = surf_model_extract_failed_action_set(model)))
/* Wake up all processes waiting for a Surf action to finish */
xbt_dynar_foreach(model_list, iter, model) {
while ((action = surf_model_extract_failed_action_set(model)))
while ((action = surf_model_extract_done_action_set(model)))
if (surf_action_get_data(action) == NULL)
XBT_DEBUG("probably vcpu's action %p, skip", action);
else
while ((action = surf_model_extract_done_action_set(model)))
if (surf_action_get_data(action) == NULL)
XBT_DEBUG("probably vcpu's action %p, skip", action);
else
XBT_DEBUG("### time %f, empty %d", time, xbt_dynar_is_empty(simix_global->process_to_run));
XBT_DEBUG("### time %f, empty %d", time, xbt_dynar_is_empty(simix_global->process_to_run));
} while (time != -1.0 || !xbt_dynar_is_empty(simix_global->process_to_run));
if (xbt_swag_size(simix_global->process_list) != 0) {
} while (time != -1.0 || !xbt_dynar_is_empty(simix_global->process_to_run));
if (xbt_swag_size(simix_global->process_list) != 0) {
("Legend of the following listing: \"Process <pid> (<name>@<host>): <status>\"");
xbt_swag_foreach(process, simix_global->process_list) {
("Legend of the following listing: \"Process <pid> (<name>@<host>): <status>\"");
xbt_swag_foreach(process, simix_global->process_list) {
- /* **************************************/
- /* TUTORIAL: New API */
- case SIMIX_ACTION_NEW_API:
- action_description = "NEW API";
- /* **************************************/
process->pid, process->name, sg_host_name(process->smx_host),
process->pid, process->name, sg_host_name(process->smx_host),
- action_description, process->waiting_action,
- process->waiting_action->name, (int)process->waiting_action->state);
+ synchro_description, process->waiting_synchro,
+ process->waiting_synchro->name, (int)process->waiting_synchro->state);
}
else {
XBT_INFO("Process %lu (%s@%s)", process->pid, process->name, sg_host_name(process->smx_host));
}
else {
XBT_INFO("Process %lu (%s@%s)", process->pid, process->name, sg_host_name(process->smx_host));
-static void* SIMIX_action_mallocator_new_f(void) {
- smx_action_t action = xbt_new(s_smx_action_t, 1);
- action->simcalls = xbt_fifo_new();
- return action;
+static void* SIMIX_synchro_mallocator_new_f(void) {
+ smx_synchro_t synchro = xbt_new(s_smx_synchro_t, 1);
+ synchro->simcalls = xbt_fifo_new();
+ return synchro;
-static void SIMIX_action_mallocator_free_f(void* action) {
- xbt_fifo_free(((smx_action_t) action)->simcalls);
- xbt_free(action);
+static void SIMIX_synchro_mallocator_free_f(void* synchro) {
+ xbt_fifo_free(((smx_synchro_t) synchro)->simcalls);
+ xbt_free(synchro);
- memset(action, 0, sizeof(s_smx_action_t));
- ((smx_action_t) action)->simcalls = fifo;
+ memset(synchro, 0, sizeof(s_smx_synchro_t));
+ ((smx_synchro_t) synchro)->simcalls = fifo;
return SIMIX_asr_get_properties(name);
}
xbt_dict_t SIMIX_asr_get_properties(const char *name)
{
return xbt_lib_get_or_null(as_router_lib, name, ROUTING_PROP_ASR_LEVEL);
}
return SIMIX_asr_get_properties(name);
}
xbt_dict_t SIMIX_asr_get_properties(const char *name)
{
return xbt_lib_get_or_null(as_router_lib, name, ROUTING_PROP_ASR_LEVEL);
}