#include "mc/mc.h"
#include "smx_private.h"
#include "src/mc/mc_replay.h"
+#include "src/plugins/vm/VirtualMachineImpl.hpp"
#include "src/surf/HostImpl.hpp"
-#include "src/surf/VirtualMachineImpl.hpp"
#include "xbt/sysdep.h"
#include <xbt/ex.hpp>
smx_actor_t process = nullptr;
xbt_swag_foreach(process, host->process_list) {
SIMIX_process_kill(process, issuer);
- XBT_DEBUG("Killing %s on %s by %s",
- process->name.c_str(), sg_host_get_name(process->host),
- issuer->name.c_str());
+ XBT_DEBUG("Killing %s@%s on behalf of %s", process->name.c_str(), sg_host_get_name(process->host),
+ issuer->name.c_str());
}
}
} else {
return exec;
}
-smx_activity_t SIMIX_execution_parallel_start(const char *name, int host_nb, sg_host_t *host_list, double *flops_amount,
- double *bytes_amount, double amount, double rate){
+smx_activity_t SIMIX_execution_parallel_start(const char* name, int host_nb, sg_host_t* host_list, double* flops_amount,
+ double* bytes_amount, double amount, double rate, double timeout)
+{
/* alloc structures and initialize */
simgrid::kernel::activity::Exec *exec = new simgrid::kernel::activity::Exec(name, nullptr);
if (!MC_is_active() && !MC_record_replay_is_active()) {
exec->surf_exec = surf_host_model->executeParallelTask(host_nb, host_list_cpy, flops_amount, bytes_amount, rate);
exec->surf_exec->setData(exec);
+ if (timeout > 0) {
+ exec->timeoutDetector = host_list[0]->pimpl_cpu->sleep(timeout);
+ exec->timeoutDetector->setData(exec);
+ }
}
XBT_DEBUG("Create parallel execute synchro %p", exec);
SMX_EXCEPTION(simcall->issuer, cancel_error, 0, "Canceled");
break;
+ case SIMIX_TIMEOUT:
+ XBT_DEBUG("SIMIX_execution_finished: execution timeouted");
+ SMX_EXCEPTION(simcall->issuer, timeout_error, 0, "Timeouted");
+ break;
+
default:
xbt_die("Internal error in SIMIX_execution_finish: unexpected synchro state %d",
(int)exec->state);