Ejemplo n.º 1
0
orte_node_rank_t orte_get_proc_node_rank(orte_process_name_t *proc)
{
    orte_proc_t *proct;
    orte_node_rank_t noderank;
    int rc;
    opal_list_t myvals;
    opal_value_t *kv;

    if (ORTE_PROC_IS_DAEMON || ORTE_PROC_IS_HNP) {
        /* look it up on our arrays */
        if (NULL == (proct = orte_get_proc_object(proc))) {
            ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND);
            return ORTE_NODE_RANK_INVALID;
        }
        return proct->node_rank;
    }

    /* if we are an app, get the value from the modex db */
    OBJ_CONSTRUCT(&myvals, opal_list_t);
    if (ORTE_SUCCESS != (rc = opal_dstore.fetch(opal_dstore_internal,
                                                (opal_identifier_t*)proc,
                                                OPAL_DSTORE_NODERANK,
                                                &myvals))) {
        ORTE_ERROR_LOG(rc);
        OPAL_LIST_DESTRUCT(&myvals);
        return ORTE_NODE_RANK_INVALID;
    }
    kv = (opal_value_t*)opal_list_get_first(&myvals);
    noderank = kv->data.uint16;
    OPAL_LIST_DESTRUCT(&myvals);
    return noderank;
}
Ejemplo n.º 2
0
static int external_close(void)
{
    OPAL_LIST_DESTRUCT(&mca_pmix_pmix2x_component.jobids);
    OPAL_LIST_DESTRUCT(&mca_pmix_pmix2x_component.events);
    OPAL_LIST_DESTRUCT(&mca_pmix_pmix2x_component.dmdx);
    return OPAL_SUCCESS;
}
Ejemplo n.º 3
0
static int external_close(void)
{
    OPAL_LIST_DESTRUCT(&mca_pmix_pmix2x_component.jobids);
    OPAL_LIST_DESTRUCT(&mca_pmix_pmix2x_component.single_events);
    OPAL_LIST_DESTRUCT(&mca_pmix_pmix2x_component.multi_events);
    OPAL_LIST_DESTRUCT(&mca_pmix_pmix2x_component.default_events);
    OPAL_LIST_DESTRUCT(&mca_pmix_pmix2x_component.cache);
    return OPAL_SUCCESS;
}
Ejemplo n.º 4
0
static int finalize(void)
{
    /* cleanup the proc state machine */
    OPAL_LIST_DESTRUCT(&orte_proc_states);
    /* cleanup the job state machine */
    OPAL_LIST_DESTRUCT(&orte_job_states);

    return ORTE_SUCCESS;
}
Ejemplo n.º 5
0
static int pmix_native_close(void)
{
    if (NULL != mca_pmix_native_component.uri) {
        free(mca_pmix_native_component.uri);
    }
    OPAL_LIST_DESTRUCT(&mca_pmix_native_component.send_queue);
    OPAL_LIST_DESTRUCT(&mca_pmix_native_component.posted_recvs);
    return OPAL_SUCCESS;
}
Ejemplo n.º 6
0
int vprotocol_pessimist_event_logger_connect(int el_rank, ompi_communicator_t **el_comm)
{
    int rc;
    char *port;
    int rank;
    vprotocol_pessimist_clock_t connect_info[2];
    opal_list_t results;
    opal_pmix_pdata_t *pdat;

    OBJ_CONSTRUCT(&results, opal_list_t);
    pdat = OBJ_NEW(opal_pmix_pdata_t);
    opal_asprintf(&pdat->value.key, VPROTOCOL_EVENT_LOGGER_NAME_FMT, el_rank);
    opal_list_append(&results, &pdat->super);

    rc = opal_pmix.lookup(&results, NULL);
    if (OPAL_SUCCESS != rc ||
        OPAL_STRING != pdat->value.type ||
        NULL == pdat->value.data.string) {
        OPAL_LIST_DESTRUCT(&results);
        return OMPI_ERR_NOT_FOUND;
    }
    port = strdup(pdat->value.data.string);
    OPAL_LIST_DESTRUCT(&results);
    V_OUTPUT_VERBOSE(45, "Found port < %s >", port);

    rc = ompi_dpm_connect_accept(MPI_COMM_SELF, 0, port, true, el_comm);
    if(OMPI_SUCCESS != rc) {
        OMPI_ERROR_LOG(rc);
    }

    /* Send Rank, receive max buffer size and max_clock back */
    rank = ompi_comm_rank(&ompi_mpi_comm_world.comm);
    rc = mca_pml_v.host_pml.pml_send(&rank, 1, MPI_INTEGER, 0,
                                     VPROTOCOL_PESSIMIST_EVENTLOG_NEW_CLIENT_CMD,
                                     MCA_PML_BASE_SEND_STANDARD,
                                     mca_vprotocol_pessimist.el_comm);
    if(OPAL_UNLIKELY(MPI_SUCCESS != rc))
        OMPI_ERRHANDLER_INVOKE(mca_vprotocol_pessimist.el_comm, rc,
                               __FILE__ ": failed sending event logger handshake");
    rc = mca_pml_v.host_pml.pml_recv(&connect_info, 2, MPI_UNSIGNED_LONG_LONG,
                                     0, VPROTOCOL_PESSIMIST_EVENTLOG_NEW_CLIENT_CMD,
                                     mca_vprotocol_pessimist.el_comm, MPI_STATUS_IGNORE);
    if(OPAL_UNLIKELY(MPI_SUCCESS != rc))                                  \
        OMPI_ERRHANDLER_INVOKE(mca_vprotocol_pessimist.el_comm, rc,       \
                               __FILE__ ": failed receiving event logger handshake");

    return rc;
}
Ejemplo n.º 7
0
static void imdes(orcm_pvsn_image_t *p)
{
    if (NULL != p->name) {
        free(p->name);
    }
    OPAL_LIST_DESTRUCT(&p->attributes);
}
static void peer_des(mca_oob_usock_peer_t *peer)
{
    if (0 <= peer->sd) {
        CLOSE_THE_SOCKET(peer->sd);
    }
    OPAL_LIST_DESTRUCT(&peer->send_queue);
}
Ejemplo n.º 9
0
static void queue_des(orcm_queue_t *q)
{
    if (NULL != q->name) {
        free(q->name);
    }
    OPAL_LIST_DESTRUCT(&q->sessions);
}
Ejemplo n.º 10
0
static void sess_des(orcm_session_t *s)
{
    if (NULL != s->alloc) {
        OBJ_RELEASE(s->alloc);
    }
    OPAL_LIST_DESTRUCT(&s->steps);
}
Ejemplo n.º 11
0
static int cray_get(const opal_process_name_t *id, const char *key, opal_value_t **kv)
{
    int rc;
    opal_list_t vals;

    opal_output_verbose(2, opal_pmix_base_framework.framework_output,
                        "%s pmix:cray getting value for proc %s key %s",
                        OPAL_NAME_PRINT(OPAL_PROC_MY_NAME),
                        OPAL_NAME_PRINT(*id), key);

    OBJ_CONSTRUCT(&vals, opal_list_t);
    rc = opal_pmix_base_fetch(id, key, &vals);
    if (OPAL_SUCCESS == rc) {
        *kv = (opal_value_t*)opal_list_remove_first(&vals);
        return OPAL_SUCCESS;
    } else {
        opal_output_verbose(2, opal_pmix_base_framework.framework_output,
                "%s pmix:cray fetch from dstore failed: %d",
                OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), rc);
    }
    OPAL_LIST_DESTRUCT(&vals);

    return rc;

}
Ejemplo n.º 12
0
static void qdes(opal_pmix_query_t *p)
{
    if (NULL != p->keys) {
        opal_argv_free(p->keys);
    }
    OPAL_LIST_DESTRUCT(&p->qualifiers);
}
Ejemplo n.º 13
0
static void wkstep_des(orcm_workflow_step_t *p)
{
    OPAL_LIST_DESTRUCT(&p->attributes);
    if (NULL != p->analytic) {
        free(p->analytic);
    }
}
Ejemplo n.º 14
0
static void orte_node_destruct(orte_node_t* node)
{
    int i;
    orte_proc_t *proc;

    if (NULL != node->name) {
        free(node->name);
        node->name = 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);
    
    /* do NOT destroy the topology */

    /* release the attributes */
    OPAL_LIST_DESTRUCT(&node->attributes);
}
Ejemplo n.º 15
0
static int orte_schizo_base_close(void)
{
    /* cleanup globals */
    OPAL_LIST_DESTRUCT(&orte_schizo_base.active_modules);

    return mca_base_framework_components_close(&orte_schizo_base_framework, NULL);
}
Ejemplo n.º 16
0
static void orte_app_context_destructor(orte_app_context_t* app_context)
{
    int i;
    orte_proc_t *proc;

    if (NULL != app_context->app) {
        free (app_context->app);
        app_context->app = NULL;
    }
    
    for (i=0; i < app_context->procs.size; i++) {
        if (NULL != (proc = (orte_proc_t*)opal_pointer_array_get_item(&app_context->procs, i))) {
            OBJ_RELEASE(proc);
        }
    }
    OBJ_DESTRUCT(&app_context->procs);

    /* argv and env lists created by util/argv copy functions */
    if (NULL != app_context->argv) {
        opal_argv_free(app_context->argv);
        app_context->argv = NULL;
    }
    
    if (NULL != app_context->env) {
        opal_argv_free(app_context->env);
        app_context->env = NULL;
    }
    
    if (NULL != app_context->cwd) {
        free (app_context->cwd);
        app_context->cwd = NULL;
    }
    
    OPAL_LIST_DESTRUCT(&app_context->attributes);
}
Ejemplo n.º 17
0
/**
 * Finalize the module
 */
static void finalize(void)
{
    /* cancel the recv */
    orte_rml.recv_cancel(ORTE_NAME_WILDCARD, ORTE_RML_TAG_XCAST);

    OPAL_LIST_DESTRUCT(&tracker);
    return;
}
static int rte_orte_close(void)
{
    opal_mutex_lock(&mca_rte_orte_component.lock);
    OPAL_LIST_DESTRUCT(&mca_rte_orte_component.modx_reqs);
    OBJ_DESTRUCT(&mca_rte_orte_component.lock);

    return OMPI_SUCCESS;
}
Ejemplo n.º 19
0
static int orcm_analytics_base_close(void)
{
    orcm_analytics_base_comm_stop();

    /* destruct the base objects */
    OPAL_LIST_DESTRUCT(&orcm_analytics_base.workflows);

    return mca_base_framework_components_close(&orcm_analytics_base_framework,
                                               NULL);
}
Ejemplo n.º 20
0
static void wk_des(orcm_workflow_t *p)
{
    if (NULL != p->ev_base) {
        orcm_stop_progress_thread(p->name, true);
    }
    if (NULL != p->name) {
        free(p->name);
    }
    OPAL_LIST_DESTRUCT(&p->steps);
}
Ejemplo n.º 21
0
static int orcm_evgen_base_close(void)
{
    if (NULL != orcm_evgen_evbase) {
        opal_progress_thread_finalize("evgen");
    }

    OPAL_LIST_DESTRUCT(&orcm_evgen_base.actives);

    /* Close all remaining available components */
    return mca_base_framework_components_close(&orcm_evgen_base_framework, NULL);
}
Ejemplo n.º 22
0
static void peer_des(mca_oob_tcp_peer_t *peer)
{
    if (peer->send_ev_active) {
        opal_event_del(&peer->send_event);
    }
    if (peer->recv_ev_active) {
        opal_event_del(&peer->recv_event);
    }
    if (peer->timer_ev_active) {
        opal_event_del(&peer->timer_event);
    }
    if (0 <= peer->sd) {
        opal_output_verbose(2, orte_oob_base_framework.framework_output,
                            "%s CLOSING SOCKET %d",
                            ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
                            peer->sd);
        CLOSE_THE_SOCKET(peer->sd);
    }
    OPAL_LIST_DESTRUCT(&peer->addrs);
    OPAL_LIST_DESTRUCT(&peer->send_queue);
}
Ejemplo n.º 23
0
static int orcm_scd_base_close(void)
{
    int i;
    hwloc_topology_t t;
    orcm_node_t *node;

    /* stop the thread */
    opal_progress_thread_finalize("scd");

    /* deconstruct the base objects */
    OPAL_LIST_DESTRUCT(&orcm_scd_base.states);
    OPAL_LIST_DESTRUCT(&orcm_scd_base.rmstates);
    OPAL_LIST_DESTRUCT(&orcm_scd_base.queues);
    OPAL_LIST_DESTRUCT(&orcm_scd_base.tracking);

    for (i = 0; i < orcm_scd_base.topologies.size; i++) {
        if (NULL != (t = (hwloc_topology_t)opal_pointer_array_get_item(&orcm_scd_base.topologies, i))) {
            hwloc_topology_destroy(t);
        }
    }
    OBJ_DESTRUCT(&orcm_scd_base.topologies);

    for (i = 0; i < orcm_scd_base.nodes.size; i++) {
        if (NULL != (node = (orcm_node_t*)opal_pointer_array_get_item(&orcm_scd_base.nodes, i))) {
            OBJ_RELEASE(node);
        }
    }
    OBJ_DESTRUCT(&orcm_scd_base.nodes);

    /* give the selected plugin a chance to finalize */
    if (NULL != orcm_scd_base.module->finalize) {
        orcm_scd_base.module->finalize();
    }

    /* finalize the resource management service */
    scd_base_rm_finalize();

    return mca_base_framework_components_close(&orcm_scd_base_framework, NULL);
}
Ejemplo n.º 24
0
char* orte_get_proc_hostname(orte_process_name_t *proc)
{
    orte_proc_t *proct;
    char *hostname;
    int rc;
    opal_list_t myvals;
    opal_value_t *kv;

    /* don't bother error logging any not-found situations
     * as the layer above us will have something to say
     * about it */
    if (ORTE_PROC_IS_DAEMON || ORTE_PROC_IS_HNP) {
        /* look it up on our arrays */
        if (NULL == (proct = orte_get_proc_object(proc))) {
            return NULL;
        }
        if (NULL == proct->node || NULL == proct->node->name) {
            return NULL;
        }
        return proct->node->name;
    }

    /* if we are an app, get the data from the modex db */
    OBJ_CONSTRUCT(&myvals, opal_list_t);
    if (ORTE_SUCCESS != (rc = opal_dstore.fetch(opal_dstore_internal,
                                                (opal_identifier_t*)proc,
                                                OPAL_DSTORE_HOSTNAME,
                                                &myvals))) {
        OPAL_LIST_DESTRUCT(&myvals);
        return NULL;
    }
    kv = (opal_value_t*)opal_list_get_first(&myvals);
    hostname = kv->data.string;
    /* protect the data */
    kv->data.string = NULL;
    OPAL_LIST_DESTRUCT(&myvals);
    /* user is responsible for releasing the data */
    return hostname;
}
Ejemplo n.º 25
0
static void myerr(pmix_status_t status,
                  pmix_proc_t procs[], size_t nprocs,
                  pmix_info_t info[], size_t ninfo)
{
    int rc;
    opal_list_t plist, ilist;
    opal_namelist_t *nm;
    opal_value_t *iptr;
    volatile int cond = 1;
    size_t n;

    /* convert the incoming status */
    rc = pmix1_convert_rc(status);

    /* convert the array of procs */
    OBJ_CONSTRUCT(&plist, opal_list_t);
    for (n=0; n < nprocs; n++) {
        nm = OBJ_NEW(opal_namelist_t);
        nm->name.jobid = strtoul(procs[n].nspace, NULL, 10);
        nm->name.vpid = procs[n].rank;
        opal_list_append(&plist, &nm->super);
    }

    /* convert the array of info */
    OBJ_CONSTRUCT(&ilist, opal_list_t);
    for (n=0; n < ninfo; n++) {
        iptr = OBJ_NEW(opal_value_t);
        iptr->key = strdup(info[n].key);
        pmix1_value_unload(iptr, &info[n].value);
        opal_list_append(&plist, &iptr->super);
    }

    /* call the base errhandler */
    opal_pmix_base_errhandler(rc, &plist, &ilist, completion_handler, (void *)&cond);
    PMIX_WAIT_FOR_COMPLETION(cond);

    OPAL_LIST_DESTRUCT(&plist);
    OPAL_LIST_DESTRUCT(&ilist);
}
Ejemplo n.º 26
0
char* orte_get_proc_hostname(orte_process_name_t *proc)
{
    orte_proc_t *proct;
    char *hostname;
    int rc;
    opal_list_t myvals;
    opal_value_t *kv;

    if (ORTE_PROC_IS_DAEMON || ORTE_PROC_IS_HNP) {
        /* look it up on our arrays */
        if (NULL == (proct = orte_get_proc_object(proc))) {
            ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND);
            return NULL;
        }
        if (NULL == proct->node || NULL == proct->node->name) {
            ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND);
            return NULL;
        }
        return proct->node->name;
    }

    /* if we are an app, get the data from the modex db */
    OBJ_CONSTRUCT(&myvals, opal_list_t);
    if (ORTE_SUCCESS != (rc = opal_dstore.fetch(opal_dstore_internal,
                                                (opal_identifier_t*)proc,
                                                OPAL_DSTORE_HOSTNAME,
                                                &myvals))) {
        ORTE_ERROR_LOG(rc);
        OPAL_LIST_DESTRUCT(&myvals);
        return NULL;
    }
    kv = (opal_value_t*)opal_list_get_first(&myvals);
    hostname = kv->data.string;
    /* protect the data */
    kv->data.string = NULL;
    OPAL_LIST_DESTRUCT(&myvals);
    /* user is responsible for releasing the data */
    return hostname;
}
Ejemplo n.º 27
0
static void apdes(opal_pmix_app_t *p)
{
    if (NULL != p->cmd) {
	free(p->cmd);
    }
    if (NULL != p->argv) {
	opal_argv_free(p->argv);
    }
    if (NULL != p->env) {
	opal_argv_free(p->env);
    }
    OPAL_LIST_DESTRUCT(&p->info);
}
Ejemplo n.º 28
0
static void orte_proc_destruct(orte_proc_t* proc)
{
    if (NULL != proc->node) {
        OBJ_RELEASE(proc->node);
        proc->node = NULL;
    }
    
    if (NULL != proc->rml_uri) {
        free(proc->rml_uri);
        proc->rml_uri = NULL;
    }

    OPAL_LIST_DESTRUCT(&proc->attributes);
}
Ejemplo n.º 29
0
static int orte_errmgr_base_close(void)
{
    /* Close selected component */
    if (NULL != orte_errmgr.finalize) {
        orte_errmgr.finalize();
    }

    /* always leave a default set of fn pointers */
    orte_errmgr = orte_errmgr_default_fns;

    /* destruct the callback list */
    OPAL_LIST_DESTRUCT(&orte_errmgr_base.error_cbacks);

    return mca_base_framework_components_close(&orte_errmgr_base_framework, NULL);
}
Ejemplo n.º 30
0
static void query_status(int fd, short args, void *cbdata)
{
    orcm_pvsn_caddy_t *caddy = (orcm_pvsn_caddy_t*)cbdata;
    int rc=ORCM_ERR_NOT_SUPPORTED;
    opal_list_t images;

    OBJ_CONSTRUCT(&images, opal_list_t);
    if (NULL != orcm_pvsn_base.active.get_status) {
        rc = orcm_pvsn_base.active.get_status(caddy->nodes, &images);
    }

    if (NULL != caddy->query_cbfunc) {
        caddy->query_cbfunc(rc, &images, caddy->cbdata);
    }
    OPAL_LIST_DESTRUCT(&images);
    OBJ_RELEASE(caddy);
}