XBT_PUBLIC(void *) simcall_process_get_data(smx_process_t process);
XBT_PUBLIC(void) simcall_process_set_data(smx_process_t process, void *data);
XBT_PUBLIC(void) simcall_process_set_host(smx_process_t process, sg_host_t dest);
-XBT_PUBLIC(int) simcall_process_get_PID(smx_process_t process);
-XBT_PUBLIC(int) simcall_process_get_PPID(smx_process_t process);
XBT_PUBLIC(int) simcall_process_is_suspended(smx_process_t process);
XBT_PUBLIC(xbt_dict_t) simcall_process_get_properties(smx_process_t host);
XBT_PUBLIC(void) simcall_process_set_kill_time(smx_process_t process, double kill_time);
{
/* Do not raise an exception here: this function is called by the logs
* and the exceptions, so it would be called back again and again */
- if (process == nullptr) {
+ if (process == nullptr)
return 0;
- }
- return simcall_process_get_PID(process);
+ return process->pid;
}
/** \ingroup m_process_management
*/
int MSG_process_get_PPID(msg_process_t process)
{
- xbt_assert(process != nullptr, "Invalid parameter: First argument must not be nullptr");
- return simcall_process_get_PPID(process);
+ return process->ppid;
}
/** \ingroup m_process_management
}
int Actor::getPid(){
- return simcall_process_get_PID(pimpl_);
+ return pimpl_->pid;
}
void Actor::setKillTime(double time) {
}
int getPid() {
- return simcall_process_get_PID(SIMIX_process_self());
+ return SIMIX_process_self()->pid;
}
}
return simgrid::simix::kernelImmediate(SIMIX_process_count);
}
-/**
- * \ingroup simix_process_management
- * \brief Return the PID of a #smx_process_t.
- * \param process a SIMIX process
- * \return the PID of this process
- */
-int simcall_process_get_PID(smx_process_t process)
-{
- return SIMIX_process_get_PID(process);
-}
-
-/**
- * \ingroup simix_process_management
- * \brief Return the parent PID of a #smx_process_t.
- * \param process a SIMIX process
- * \return the PID of this process parenrt
- */
-int simcall_process_get_PPID(smx_process_t process)
-{
- return SIMIX_process_get_PPID(process);
-}
-
/**
* \ingroup simix_process_management
* \brief Return the user data of a #smx_process_t.
/* 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);
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();
XBT_PRIVATE smx_synchro_t SIMIX_process_suspend(smx_process_t process, smx_process_t issuer);
XBT_PRIVATE void SIMIX_process_resume(smx_process_t process, smx_process_t issuer);
XBT_PRIVATE int SIMIX_process_get_PID(smx_process_t self);
-XBT_PRIVATE int SIMIX_process_get_PPID(smx_process_t self);
XBT_PRIVATE void* SIMIX_process_get_data(smx_process_t process);
XBT_PRIVATE void SIMIX_process_set_data(smx_process_t process, void *data);
XBT_PRIVATE smx_process_t SIMIX_process_get_by_name(const char* name);
/* If the mutex is not owned by the issuer, that's not good */
if (issuer != this->owner)
- THROWF(mismatch_error, 0, "Cannot release that mutex: it was locked by %s (pid:%d), not by you.",
- this->owner->name.c_str(),SIMIX_process_get_PID(this->owner));
+ THROWF(mismatch_error, 0, "Cannot release that mutex: it was locked by %s (pid:%ld), not by you.",
+ this->owner->name.c_str(),this->owner->pid);
if (xbt_swag_size(this->sleeping) > 0) {
/*process to wake up */
int min_index=INT_MAX;//the minimum index will be the leader
smx_process_t process = nullptr;
xbt_swag_foreach(process, process_list) {
- int index = SIMIX_process_get_PID(process) -1;
+ int index = process->pid -1;
if(smpi_group_rank(smpi_comm_group(comm), index)!=MPI_UNDEFINED){
intra_comm_size++;
i=0;
process = nullptr;
xbt_swag_foreach(process, process_list) {
- int index = SIMIX_process_get_PID(process) -1;
+ int index = process->pid -1;
if(smpi_group_rank(smpi_comm_group(comm), index)!=MPI_UNDEFINED){
smpi_group_set_mapping(group_intra, index, i);
i++;