-#include "src/simix/SynchroExec.hpp"
-#include "src/simix/SynchroComm.hpp"
-#include "src/simix/SynchroSleep.hpp"
-#include "src/simix/SynchroIo.hpp"
-#include "src/simix/SynchroRaw.hpp"
+#include "src/kernel/activity/SynchroExec.hpp"
+#include "src/kernel/activity/SynchroComm.hpp"
+#include "src/kernel/activity/SynchroSleep.hpp"
+#include "src/kernel/activity/SynchroIo.hpp"
+#include "src/kernel/activity/SynchroRaw.hpp"
- s_smx_timer() {}
- s_smx_timer(double date, simgrid::xbt::Task<void()> callback)
- : date(date), callback(std::move(callback)) {}
+ s_smx_timer()=default;
+ s_smx_timer(double date, simgrid::xbt::Task<void()> callback) : date(date), callback(std::move(callback)) {}
"Try to increase stack size with --cfg=contexts/stack_size (current size is %d KiB).\n",
smx_context_stack_size / 1024);
if (XBT_LOG_ISENABLED(simix_kernel, xbt_log_priority_debug)) {
"Try to increase stack size with --cfg=contexts/stack_size (current size is %d KiB).\n",
smx_context_stack_size / 1024);
if (XBT_LOG_ISENABLED(simix_kernel, xbt_log_priority_debug)) {
- fprintf(stderr,
- "siginfo = {si_signo = %d, si_errno = %d, si_code = %d, si_addr = %p}\n",
+ fprintf(stderr, "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) {
siginfo->si_signo, siginfo->si_errno, siginfo->si_code, siginfo->si_addr);
}
} else if (siginfo->si_signo == SIGSEGV) {
* Install signal handler for SIGSEGV. Check that nobody has already installed
* its own handler. For example, the Java VM does this.
*/
* Install signal handler for SIGSEGV. Check that nobody has already installed
* its own handler. For example, the Java VM does this.
*/
{
stack_t stack, old_stack;
stack.ss_sp = sigsegv_stack;
{
stack_t stack, old_stack;
stack.ss_sp = sigsegv_stack;
}
if ((old_action.sa_flags & SA_SIGINFO) || old_action.sa_handler != SIG_DFL) {
XBT_DEBUG("A signal handler was already installed for SIGSEGV (%p). Restore it.",
}
if ((old_action.sa_flags & SA_SIGINFO) || old_action.sa_handler != SIG_DFL) {
XBT_DEBUG("A signal handler was already installed for SIGSEGV (%p). Restore it.",
- simgrid::simix::Process proc;
- simix_global->process_to_run = xbt_dynar_new(sizeof(smx_process_t), nullptr);
- simix_global->process_that_ran = xbt_dynar_new(sizeof(smx_process_t), nullptr);
+ simgrid::simix::ActorImpl proc;
+ simix_global->process_to_run = xbt_dynar_new(sizeof(smx_actor_t), nullptr);
+ simix_global->process_that_ran = xbt_dynar_new(sizeof(smx_actor_t), nullptr);
simix_global->process_list = xbt_swag_new(xbt_swag_offset(proc, process_hookup));
simix_global->process_to_destroy = xbt_swag_new(xbt_swag_offset(proc, destroy_hookup));
simix_global->maestro_process = nullptr;
simix_global->process_list = xbt_swag_new(xbt_swag_offset(proc, process_hookup));
simix_global->process_to_destroy = xbt_swag_new(xbt_swag_offset(proc, destroy_hookup));
simix_global->maestro_process = nullptr;
XBT_CRITICAL(" ");
XBT_CRITICAL("The time is still 0, and you still have processes ready to run.");
XBT_CRITICAL("It seems that you forgot to run the simulation that you setup.");
XBT_CRITICAL(" ");
XBT_CRITICAL("The time is still 0, and you still have processes ready to run.");
XBT_CRITICAL("It seems that you forgot to run the simulation that you setup.");
{
if(MC_is_active() || MC_record_replay_is_active()){
return MC_process_clock_get(SIMIX_process_self());
{
if(MC_is_active() || MC_record_replay_is_active()){
return MC_process_clock_get(SIMIX_process_self());
- xbt_dynar_foreach(all_existing_models, iter, model) {
- XBT_DEBUG("Handling process whose action failed");
+ for(auto model : *all_existing_models) {
+ XBT_DEBUG("Handling the processes whose action failed (if any)");
while ((action = surf_model_extract_failed_action_set(model))) {
XBT_DEBUG(" Handling Action %p",action);
while ((action = surf_model_extract_failed_action_set(model))) {
XBT_DEBUG(" Handling Action %p",action);
while ((action = surf_model_extract_done_action_set(model))) {
XBT_DEBUG(" Handling Action %p",action);
if (action->getData() == nullptr)
XBT_DEBUG("probably vcpu's action %p, skip", action);
else
while ((action = surf_model_extract_done_action_set(model))) {
XBT_DEBUG(" Handling Action %p",action);
if (action->getData() == nullptr)
XBT_DEBUG("probably vcpu's action %p, skip", action);
else
- XBT_DEBUG("New Sub-Schedule Round; size(queue)=%lu",
- xbt_dynar_length(simix_global->process_to_run));
+ XBT_DEBUG("New Sub-Schedule Round; size(queue)=%lu", xbt_dynar_length(simix_global->process_to_run));
XBT_DEBUG("Calling surf_solve");
time = surf_solve(time);
XBT_DEBUG("Moving time ahead : %g", time);
XBT_DEBUG("Calling surf_solve");
time = surf_solve(time);
XBT_DEBUG("Moving time ahead : %g", time);
- char *hostname = nullptr;
- unsigned int iter;
- xbt_dynar_foreach(host_that_restart,iter,hostname) {
- XBT_INFO("Restart processes on host: %s",hostname);
- SIMIX_host_autorestart(sg_host_by_name(hostname));
+ for (auto host: host_that_restart) {
+ XBT_INFO("Restart processes on host: %s", sg_host_get_name(host));
+ SIMIX_host_autorestart(host);
/* Clean processes to destroy */
SIMIX_process_empty_trash();
XBT_DEBUG("### time %f, empty %d", time, xbt_dynar_is_empty(simix_global->process_to_run));
/* Clean processes to destroy */
SIMIX_process_empty_trash();
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_dynar_is_empty(simix_global->process_to_run) &&
+ xbt_swag_size(simix_global->process_list) != 0)
+ simgrid::simix::onDeadlock();
+
+ } while (time > -1.0 || !xbt_dynar_is_empty(simix_global->process_to_run));
- * This function registers a function to be called when a
- * process is killed. The function has to call the SIMIX_process_kill().
+ * This function registers a function to be called when a process is killed. The function has to call the
+ * SIMIX_process_kill().
int nbprocess = xbt_swag_size(simix_global->process_list);
XBT_INFO("%d processes are still running, waiting for something.", nbprocess);
/* List the process and their state */
int nbprocess = xbt_swag_size(simix_global->process_list);
XBT_INFO("%d processes are still running, waiting for something.", nbprocess);
/* List the process and their state */
xbt_swag_foreach(process, simix_global->process_list) {
if (process->waiting_synchro) {
const char* synchro_description = "unknown";
xbt_swag_foreach(process, simix_global->process_list) {
if (process->waiting_synchro) {
const char* synchro_description = "unknown";