static void orte_node_destruct(orte_node_t* node) { int i; opal_node_stats_t *stats; orte_proc_t *proc; if (NULL != node->name) { free(node->name); node->name = NULL; } if (NULL != node->serial_number) { free(node->serial_number); node->serial_number = NULL; } if (NULL != node->alias) { opal_argv_free(node->alias); node->alias = NULL; } if (NULL != node->daemon) { node->daemon->node = NULL; OBJ_RELEASE(node->daemon); node->daemon = NULL; } for (i=0; i < node->procs->size; i++) { if (NULL != (proc = (orte_proc_t*)opal_pointer_array_get_item(node->procs, i))) { opal_pointer_array_set_item(node->procs, i, NULL); OBJ_RELEASE(proc); } } OBJ_RELEASE(node->procs); /* we release the topology elsewhere */ if (NULL != node->username) { free(node->username); node->username = NULL; } /* do NOT destroy the topology */ while (NULL != (stats = (opal_node_stats_t*)opal_ring_buffer_pop(&node->stats))) { OBJ_RELEASE(stats); } OBJ_DESTRUCT(&node->stats); }
static void orte_node_destruct(orte_node_t* node) { int i; opal_node_stats_t *stats; if (NULL != node->name) { free(node->name); node->name = NULL; } if (NULL != node->alias) { opal_argv_free(node->alias); node->alias = NULL; } if (NULL != node->daemon) { node->daemon->node = NULL; OBJ_RELEASE(node->daemon); node->daemon = NULL; } for (i=0; i < node->procs->size; i++) { if (NULL != node->procs->addr[i]) { ((orte_proc_t*)(node->procs->addr[i]))->node = NULL; OBJ_RELEASE(node->procs->addr[i]); node->procs->addr[i] = NULL; } } OBJ_RELEASE(node->procs); if (NULL != node->cpu_set) { free(node->cpu_set); node->cpu_set = NULL; } if (NULL != node->username) { free(node->username); node->username = NULL; } /* do NOT destroy the topology */ while (NULL != (stats = (opal_node_stats_t*)opal_ring_buffer_pop(&node->stats))) { OBJ_RELEASE(stats); } OBJ_DESTRUCT(&node->stats); }
static void orte_proc_destruct(orte_proc_t* proc) { opal_pstats_t *stats; /* do NOT free the nodename field as this is * simply a pointer to a field in the * associated node object - the node object * will free it */ #if OPAL_HAVE_HWLOC if (NULL != proc->cpu_bitmap) { free(proc->cpu_bitmap); } #endif if (NULL != proc->node) { OBJ_RELEASE(proc->node); proc->node = NULL; } if (NULL != proc->rml_uri) { free(proc->rml_uri); proc->rml_uri = NULL; } while (NULL != (stats = (opal_pstats_t*)opal_ring_buffer_pop(&proc->stats))) { OBJ_RELEASE(stats); } OBJ_DESTRUCT(&proc->stats); #if OPAL_ENABLE_FT_CR == 1 if (NULL != proc->ckpt_snapshot_ref) { free(proc->ckpt_snapshot_ref); proc->ckpt_snapshot_ref = NULL; } if (NULL != proc->ckpt_snapshot_loc) { free(proc->ckpt_snapshot_loc); proc->ckpt_snapshot_loc = NULL; } #endif }