/* cancel non-blocking communications */
smx_synchro_t synchro = static_cast<smx_synchro_t>(xbt_fifo_pop(process->comms));
while (synchro != nullptr) {
- simgrid::simix::Comm *comm = static_cast<simgrid::simix::Comm*>(synchro);
+ simgrid::kernel::activity::Comm *comm = static_cast<simgrid::kernel::activity::Comm*>(synchro);
/* make sure no one will finish the comm after this process is destroyed,
* because src_proc or dst_proc would be an invalid pointer */
/* Initiliaze data segment to default value */
SIMIX_segment_index_set(process, -1);
- if (parent_process != nullptr) {
- process->ppid = SIMIX_process_get_PID(parent_process);
- /* SMPI process have their own data segment and
- each other inherit from their father */
+ if (parent_process != nullptr) {
+ process->ppid = parent_process->pid;
+ /* SMPI process have their own data segment and each other inherit from their father */
#if HAVE_SMPI
- if(smpi_privatize_global_variables){
- if( parent_process->pid != 0){
+ if( smpi_privatize_global_variables) {
+ if (parent_process->pid != 0) {
SIMIX_segment_index_set(process, parent_process->segment_index);
} else {
SIMIX_segment_index_set(process, process->pid - 1);
/* Initiliaze data segment to default value */
SIMIX_segment_index_set(process, -1);
if (parent_process != nullptr) {
- process->ppid = SIMIX_process_get_PID(parent_process);
- /* SMPI process have their own data segment and
- each other inherit from their father */
+ process->ppid = parent_process->pid;
+ /* SMPI process have their own data segment and each other inherit from their father */
#if HAVE_SMPI
- if(smpi_privatize_global_variables){
- if(parent_process->pid != 0){
+ if (smpi_privatize_global_variables) {
+ if (parent_process->pid != 0) {
SIMIX_segment_index_set(process, parent_process->segment_index);
} else {
SIMIX_segment_index_set(process, process->pid - 1);
/* destroy the blocking synchro if any */
if (process->waiting_synchro) {
- simgrid::simix::Exec *exec = dynamic_cast<simgrid::simix::Exec*>(process->waiting_synchro);
- simgrid::simix::Comm *comm = dynamic_cast<simgrid::simix::Comm*>(process->waiting_synchro);
- simgrid::simix::Sleep *sleep = dynamic_cast<simgrid::simix::Sleep*>(process->waiting_synchro);
- simgrid::simix::Raw *raw = dynamic_cast<simgrid::simix::Raw*>(process->waiting_synchro);
- simgrid::simix::Io *io = dynamic_cast<simgrid::simix::Io*>(process->waiting_synchro);
+ simgrid::kernel::activity::Exec *exec = dynamic_cast<simgrid::kernel::activity::Exec*>(process->waiting_synchro);
+ simgrid::kernel::activity::Comm *comm = dynamic_cast<simgrid::kernel::activity::Comm*>(process->waiting_synchro);
+ simgrid::kernel::activity::Sleep *sleep = dynamic_cast<simgrid::kernel::activity::Sleep*>(process->waiting_synchro);
+ simgrid::kernel::activity::Raw *raw = dynamic_cast<simgrid::kernel::activity::Raw*>(process->waiting_synchro);
+ simgrid::kernel::activity::Io *io = dynamic_cast<simgrid::kernel::activity::Io*>(process->waiting_synchro);
if (exec != nullptr) {
exec->unref();
/* cancel the blocking synchro if any */
if (process->waiting_synchro) {
- simgrid::simix::Exec *exec = dynamic_cast<simgrid::simix::Exec*>(process->waiting_synchro);
+ simgrid::kernel::activity::Exec *exec = dynamic_cast<simgrid::kernel::activity::Exec*>(process->waiting_synchro);
if (exec != nullptr) {
SIMIX_execution_cancel(process->waiting_synchro);
}
- simgrid::simix::Comm *comm = dynamic_cast<simgrid::simix::Comm*>(process->waiting_synchro);
+ simgrid::kernel::activity::Comm *comm = dynamic_cast<simgrid::kernel::activity::Comm*>(process->waiting_synchro);
if (comm != nullptr) {
xbt_fifo_remove(process->comms, comm);
comm->cancel();
}
- simgrid::simix::Sleep *sleep = dynamic_cast<simgrid::simix::Sleep*>(process->waiting_synchro);
+ simgrid::kernel::activity::Sleep *sleep = dynamic_cast<simgrid::kernel::activity::Sleep*>(process->waiting_synchro);
if (sleep != nullptr) {
SIMIX_process_sleep_destroy(process->waiting_synchro);
if (!xbt_dynar_member(simix_global->process_to_run, &(process)) && process != SIMIX_process_self()) {
}
}
- simgrid::simix::Raw *raw = dynamic_cast<simgrid::simix::Raw*>(process->waiting_synchro);
+ simgrid::kernel::activity::Raw *raw = dynamic_cast<simgrid::kernel::activity::Raw*>(process->waiting_synchro);
if (raw != nullptr) {
SIMIX_synchro_stop_waiting(process, &process->simcall);
}
- simgrid::simix::Io *io = dynamic_cast<simgrid::simix::Io*>(process->waiting_synchro);
+ simgrid::kernel::activity::Io *io = dynamic_cast<simgrid::kernel::activity::Io*>(process->waiting_synchro);
if (io != nullptr) {
SIMIX_io_destroy(process->waiting_synchro);
}
return xbt_swag_size(simix_global->process_list);
}
-int SIMIX_process_get_PID(smx_process_t self){
+int SIMIX_process_get_PID(smx_process_t self)
+{
if (self == nullptr)
return 0;
else
return self->pid;
}
-int SIMIX_process_get_PPID(smx_process_t self){
- if (self == nullptr)
- return 0;
- else
- return self->ppid;
-}
-
void* SIMIX_process_self_get_data()
{
smx_process_t self = SIMIX_process_self();
process->data = data;
}
-sg_host_t SIMIX_process_get_host(smx_process_t process)
-{
- return process->host;
-}
-
/* needs to be public and without simcall because it is called
by exceptions and logging events */
const char* SIMIX_process_self_get_name() {
if (process == nullptr || process == simix_global->maestro_process)
return "maestro";
- return SIMIX_process_get_name(process);
-}
-
-const char* SIMIX_process_get_name(smx_process_t process)
-{
return process->name.c_str();
}
}
static int SIMIX_process_join_finish(smx_process_exit_status_t status, smx_synchro_t synchro){
- simgrid::simix::Sleep *sleep = static_cast<simgrid::simix::Sleep*>(synchro);
+ simgrid::kernel::activity::Sleep *sleep = static_cast<simgrid::kernel::activity::Sleep*>(synchro);
if (sleep->surf_sleep) {
sleep->surf_sleep->cancel();
smx_synchro_t SIMIX_process_join(smx_process_t issuer, smx_process_t process, double timeout)
{
smx_synchro_t res = SIMIX_process_sleep(issuer, timeout);
- static_cast<simgrid::simix::Synchro*>(res)->ref();
+ static_cast<simgrid::kernel::activity::Synchro*>(res)->ref();
SIMIX_process_on_exit(process, (int_f_pvoid_pvoid_t)SIMIX_process_join_finish, res);
return res;
}
if (host->isOff())
THROWF(host_error, 0, "Host %s failed, you cannot call this function", sg_host_get_name(host));
- simgrid::simix::Sleep *synchro = new simgrid::simix::Sleep();
+ simgrid::kernel::activity::Sleep *synchro = new simgrid::kernel::activity::Sleep();
synchro->host = host;
synchro->surf_sleep = surf_host_sleep(host, duration);
synchro->surf_sleep->setData(synchro);
void SIMIX_process_sleep_destroy(smx_synchro_t synchro)
{
XBT_DEBUG("Destroy synchro %p", synchro);
- simgrid::simix::Sleep *sleep = static_cast<simgrid::simix::Sleep*>(synchro);
+ simgrid::kernel::activity::Sleep *sleep = static_cast<simgrid::kernel::activity::Sleep*>(synchro);
if (sleep->surf_sleep) {
sleep->surf_sleep->unref();