コード例 #1
0
ファイル: pmix2x_server_north.c プロジェクト: anandhis/ompi
static pmix_status_t server_abort_fn(const pmix_proc_t *p, void *server_object,
                                     int status, const char msg[],
                                     pmix_proc_t procs[], size_t nprocs,
                                     pmix_op_cbfunc_t cbfunc, void *cbdata)
{
    size_t n;
    opal_namelist_t *nm;
    opal_process_name_t proc;
    int rc;
    pmix2x_opalcaddy_t *opalcaddy;

    if (NULL == host_module || NULL == host_module->abort) {
        return PMIX_ERR_NOT_SUPPORTED;
    }

    /* convert the nspace/rank to an opal_process_name_t */
    if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) {
        return pmix2x_convert_opalrc(rc);
    }
    proc.vpid = pmix2x_convert_rank(p->rank);

    opal_output_verbose(3, opal_pmix_base_framework.framework_output,
                        "%s CLIENT %s CALLED ABORT",
                        OPAL_NAME_PRINT(OPAL_PROC_MY_NAME),
                        OPAL_NAME_PRINT(proc));

    /* setup the caddy */
    opalcaddy = OBJ_NEW(pmix2x_opalcaddy_t);
    opalcaddy->opcbfunc = cbfunc;
    opalcaddy->cbdata = cbdata;

    /* convert the array of pmix_proc_t to the list of procs */
    for (n=0; n < nprocs; n++) {
        nm = OBJ_NEW(opal_namelist_t);
        opal_list_append(&opalcaddy->procs, &nm->super);
        if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&nm->name.jobid, procs[n].nspace))) {
            OBJ_RELEASE(opalcaddy);
            return pmix2x_convert_opalrc(rc);
        }
        nm->name.vpid = pmix2x_convert_rank(procs[n].rank);
    }

    /* pass it up */
    rc = host_module->abort(&proc, server_object, status, msg,
                            &opalcaddy->procs, opal_opcbfunc, opalcaddy);
    if (OPAL_SUCCESS != rc) {
        OBJ_RELEASE(opalcaddy);
    }
    return pmix2x_convert_opalrc(rc);
}
コード例 #2
0
static pmix_status_t server_abort_fn(const pmix_proc_t *p, void *server_object,
				     int status, const char msg[],
				     pmix_proc_t procs[], size_t nprocs,
				     pmix_op_cbfunc_t cbfunc, void *cbdata)
{
    size_t n;
    opal_namelist_t *nm;
    opal_process_name_t proc;
    int rc;
    pmix20_opalcaddy_t *opalcaddy;

    if (NULL == host_module || NULL == host_module->abort) {
	return PMIX_ERR_NOT_SUPPORTED;
    }

    /* convert the nspace/rank to an opal_process_name_t */
    if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) {
	return pmix20_convert_opalrc(rc);
    }
    proc.vpid = p->rank;

    /* setup the caddy */
    opalcaddy = OBJ_NEW(pmix20_opalcaddy_t);
    opalcaddy->opcbfunc = cbfunc;
    opalcaddy->cbdata = cbdata;

    /* convert the array of pmix_proc_t to the list of procs */
    for (n=0; n < nprocs; n++) {
	nm = OBJ_NEW(opal_namelist_t);
	opal_list_append(&opalcaddy->procs, &nm->super);
	if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&nm->name.jobid, procs[n].nspace))) {
	    OBJ_RELEASE(opalcaddy);
	    return pmix20_convert_opalrc(rc);
	}
	if (PMIX_RANK_WILDCARD == procs[n].rank) {
	    nm->name.vpid = OPAL_VPID_WILDCARD;
	} else {
	    nm->name.vpid = procs[n].rank;
	}
    }

    /* pass it up */
    rc = host_module->abort(&proc, server_object, status, msg,
			    &opalcaddy->procs, opal_opcbfunc, opalcaddy);
    if (OPAL_SUCCESS != rc) {
	OBJ_RELEASE(opalcaddy);
    }
    return pmix20_convert_opalrc(rc);
}
コード例 #3
0
static pmix_status_t server_client_finalized_fn(const pmix_proc_t *p, void* server_object,
						pmix_op_cbfunc_t cbfunc, void *cbdata)
{
    int rc;
    pmix20_opalcaddy_t *opalcaddy;
    opal_process_name_t proc;

    if (NULL == host_module || NULL == host_module->client_finalized) {
	return PMIX_SUCCESS;
    }

    /* convert the nspace/rank to an opal_process_name_t */
    if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) {
	return pmix20_convert_opalrc(rc);
    }
    proc.vpid = p->rank;

    /* setup the caddy */
    opalcaddy = OBJ_NEW(pmix20_opalcaddy_t);
    opalcaddy->opcbfunc = cbfunc;
    opalcaddy->cbdata = cbdata;

    /* pass it up */
    rc = host_module->client_finalized(&proc, server_object, opal_opcbfunc, opalcaddy);
    if (OPAL_SUCCESS != rc) {
	OBJ_RELEASE(opalcaddy);
    }
    return pmix20_convert_opalrc(rc);
}
コード例 #4
0
ファイル: pmix2x_server_north.c プロジェクト: anandhis/ompi
static pmix_status_t server_client_finalized_fn(const pmix_proc_t *p, void* server_object,
                                                pmix_op_cbfunc_t cbfunc, void *cbdata)
{
    int rc;
    pmix2x_opalcaddy_t *opalcaddy;
    opal_process_name_t proc;

    if (NULL == host_module || NULL == host_module->client_finalized) {
        return PMIX_SUCCESS;
    }

    /* convert the nspace/rank to an opal_process_name_t */
    if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) {
        return pmix2x_convert_opalrc(rc);
    }
    proc.vpid = pmix2x_convert_rank(p->rank);

    /* setup the caddy */
    opalcaddy = OBJ_NEW(pmix2x_opalcaddy_t);
    opalcaddy->opcbfunc = cbfunc;
    opalcaddy->cbdata = cbdata;

    /* pass it up */
    opal_output_verbose(3, opal_pmix_base_framework.framework_output,
                        "%s CLIENT %s FINALIZED",
                        OPAL_NAME_PRINT(OPAL_PROC_MY_NAME),
                        OPAL_NAME_PRINT(proc));
    rc = host_module->client_finalized(&proc, server_object, opal_opcbfunc, opalcaddy);
    if (OPAL_SUCCESS != rc) {
        OBJ_RELEASE(opalcaddy);
    }
    return pmix2x_convert_opalrc(rc);
}
コード例 #5
0
ファイル: ext4x_server_north.c プロジェクト: thananon/ompi
static pmix_status_t server_client_connected_fn(const pmix_proc_t *p, void *server_object,
                                                pmix_op_cbfunc_t cbfunc, void *cbdata)
{
    int rc;
    opal_process_name_t proc;
    ext4x_opalcaddy_t *opalcaddy;

    if (NULL == host_module || NULL == host_module->client_connected) {
        return PMIX_SUCCESS;
    }

    opalcaddy = OBJ_NEW(ext4x_opalcaddy_t);
    opalcaddy->opcbfunc = cbfunc;
    opalcaddy->cbdata = cbdata;

    /* convert the nspace/rank to an opal_process_name_t */
    if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) {
        return ext4x_convert_opalrc(rc);
    }
    proc.vpid = ext4x_convert_rank(p->rank);

    /* pass it up */
    rc = host_module->client_connected(&proc, server_object,
                                       opal_opcbfunc, opalcaddy);
    return ext4x_convert_opalrc(rc);
}
コード例 #6
0
static pmix_status_t server_fencenb_fn(const pmix_proc_t procs[], size_t nprocs,
				       const pmix_info_t info[], size_t ninfo,
				       char *data, size_t ndata,
				       pmix_modex_cbfunc_t cbfunc, void *cbdata)
{
    pmix20_opalcaddy_t *opalcaddy;
    size_t n;
    opal_namelist_t *nm;
    opal_value_t *iptr;
    int rc;

    if (NULL == host_module || NULL == host_module->fence_nb) {
	return PMIX_ERR_NOT_SUPPORTED;
    }

    /* setup the caddy */
    opalcaddy = OBJ_NEW(pmix20_opalcaddy_t);
    opalcaddy->mdxcbfunc = cbfunc;
    opalcaddy->cbdata = cbdata;

    /* convert the array of pmix_proc_t to the list of procs */
    for (n=0; n < nprocs; n++) {
	nm = OBJ_NEW(opal_namelist_t);
	opal_list_append(&opalcaddy->procs, &nm->super);
	if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&nm->name.jobid, procs[n].nspace))) {
	    OBJ_RELEASE(opalcaddy);
	    return pmix20_convert_opalrc(rc);
	}
	if (PMIX_RANK_WILDCARD == procs[n].rank) {
	    nm->name.vpid = OPAL_VPID_WILDCARD;
	} else {
	    nm->name.vpid = procs[n].rank;
	}
    }

    /* convert the array of pmix_info_t to the list of info */
    for (n=0; n < ninfo; n++) {
	iptr = OBJ_NEW(opal_value_t);
	opal_list_append(&opalcaddy->info, &iptr->super);
	iptr->key = strdup(info[n].key);
	if (OPAL_SUCCESS != (rc = pmix20_value_unload(iptr, &info[n].value))) {
	    OBJ_RELEASE(opalcaddy);
	    return pmix20_convert_opalrc(rc);
	}
    }

    /* pass it up */
    rc = host_module->fence_nb(&opalcaddy->procs, &opalcaddy->info,
			       data, ndata, opmdx_response, opalcaddy);
    if (OPAL_SUCCESS != rc) {
	OBJ_RELEASE(opalcaddy);
    }
    return pmix20_convert_opalrc(rc);
}
コード例 #7
0
ファイル: ext4x_server_north.c プロジェクト: thananon/ompi
static pmix_status_t server_fencenb_fn(const pmix_proc_t procs[], size_t nprocs,
                                       const pmix_info_t info[], size_t ninfo,
                                       char *data, size_t ndata,
                                       pmix_modex_cbfunc_t cbfunc, void *cbdata)
{
    ext4x_opalcaddy_t *opalcaddy;
    size_t n;
    opal_namelist_t *nm;
    opal_value_t *iptr;
    int rc;

    opal_output_verbose(3, opal_pmix_base_framework.framework_output,
                        "%s FENCE CALLED", OPAL_NAME_PRINT(OPAL_PROC_MY_NAME));

    if (NULL == host_module || NULL == host_module->fence_nb) {
        return PMIX_ERR_NOT_SUPPORTED;
    }
    /* setup the caddy */
    opalcaddy = OBJ_NEW(ext4x_opalcaddy_t);
    opalcaddy->mdxcbfunc = cbfunc;
    opalcaddy->cbdata = cbdata;

    /* convert the array of pmix_proc_t to the list of procs */
    for (n=0; n < nprocs; n++) {
        nm = OBJ_NEW(opal_namelist_t);
        opal_list_append(&opalcaddy->procs, &nm->super);
        if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&nm->name.jobid, procs[n].nspace))) {
            OBJ_RELEASE(opalcaddy);
            return ext4x_convert_opalrc(rc);
        }
        nm->name.vpid = ext4x_convert_rank(procs[n].rank);
    }

    /* convert the array of pmix_info_t to the list of info */
    for (n=0; n < ninfo; n++) {
        iptr = OBJ_NEW(opal_value_t);
        opal_list_append(&opalcaddy->info, &iptr->super);
        iptr->key = strdup(info[n].key);
        if (OPAL_SUCCESS != (rc = ext4x_value_unload(iptr, &info[n].value))) {
            OBJ_RELEASE(opalcaddy);
            return ext4x_convert_opalrc(rc);
        }
    }

    /* pass it up */
    rc = host_module->fence_nb(&opalcaddy->procs, &opalcaddy->info,
                               data, ndata, opmdx_response, opalcaddy);
    if (OPAL_SUCCESS != rc) {
        OBJ_RELEASE(opalcaddy);
    }
    return ext4x_convert_opalrc(rc);
}
コード例 #8
0
static pmix_status_t server_dmodex_req_fn(const pmix_proc_t *p,
					  const pmix_info_t info[], size_t ninfo,
					  pmix_modex_cbfunc_t cbfunc, void *cbdata)
{
    int rc;
    pmix20_opalcaddy_t *opalcaddy;
    opal_process_name_t proc;
    opal_value_t *iptr;
    size_t n;

    if (NULL == host_module || NULL == host_module->direct_modex) {
	return PMIX_ERR_NOT_SUPPORTED;
    }

    /* convert the nspace/rank to an opal_process_name_t */
    if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) {
	return pmix20_convert_opalrc(rc);
    }
    if (PMIX_RANK_WILDCARD == p->rank) {
	proc.vpid = OPAL_VPID_WILDCARD;
    } else {
	proc.vpid = p->rank;
    }

    /* setup the caddy */
    opalcaddy = OBJ_NEW(pmix20_opalcaddy_t);
    opalcaddy->mdxcbfunc = cbfunc;
    opalcaddy->cbdata = cbdata;

    /* convert the array of pmix_info_t to the list of info */
    for (n=0; n < ninfo; n++) {
	iptr = OBJ_NEW(opal_value_t);
	opal_list_append(&opalcaddy->info, &iptr->super);
	iptr->key = strdup(info[n].key);
	if (OPAL_SUCCESS != (rc = pmix20_value_unload(iptr, &info[n].value))) {
	    OBJ_RELEASE(opalcaddy);
	    return pmix20_convert_opalrc(rc);
	}
    }

    /* pass it up */
    rc = host_module->direct_modex(&proc, &opalcaddy->info, opmdx_response, opalcaddy);
    if (OPAL_SUCCESS != rc && OPAL_ERR_IN_PROCESS != rc) {
	OBJ_RELEASE(opalcaddy);
    }
    if (OPAL_ERR_IN_PROCESS == rc) {
	rc = OPAL_SUCCESS;
    }
    return pmix20_convert_opalrc(rc);
}
コード例 #9
0
ファイル: pmix2x_server_north.c プロジェクト: anandhis/ompi
static pmix_status_t server_publish_fn(const pmix_proc_t *p,
                                       const pmix_info_t info[], size_t ninfo,
                                       pmix_op_cbfunc_t cbfunc, void *cbdata)
{
    int rc;
    size_t n;
    pmix2x_opalcaddy_t *opalcaddy;
    opal_process_name_t proc;
    opal_value_t *oinfo;

    if (NULL == host_module || NULL == host_module->publish) {
        return PMIX_ERR_NOT_SUPPORTED;
    }

   /* convert the nspace/rank to an opal_process_name_t */
    if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) {
        return pmix2x_convert_opalrc(rc);
    }
    proc.vpid = pmix2x_convert_rank(p->rank);

    opal_output_verbose(3, opal_pmix_base_framework.framework_output,
                        "%s CLIENT %s CALLED PUBLISH",
                        OPAL_NAME_PRINT(OPAL_PROC_MY_NAME),
                        OPAL_NAME_PRINT(proc));

    /* setup the caddy */
    opalcaddy = OBJ_NEW(pmix2x_opalcaddy_t);
    opalcaddy->opcbfunc = cbfunc;
    opalcaddy->cbdata = cbdata;

    /* convert the info array */
    for (n=0; n < ninfo; n++) {
        oinfo = OBJ_NEW(opal_value_t);
        opal_list_append(&opalcaddy->info, &oinfo->super);
        oinfo->key = strdup(info[n].key);
        if (OPAL_SUCCESS != (rc = pmix2x_value_unload(oinfo, &info[n].value))) {
            OBJ_RELEASE(opalcaddy);
            return pmix2x_convert_opalrc(rc);
        }
    }

    /* pass it up */
    rc = host_module->publish(&proc, &opalcaddy->info, opal_opcbfunc, opalcaddy);
    if (OPAL_SUCCESS != rc) {
        OBJ_RELEASE(opalcaddy);
    }

    return pmix2x_convert_opalrc(rc);
}
コード例 #10
0
static pmix_status_t server_publish_fn(const pmix_proc_t *p,
				       const pmix_info_t info[], size_t ninfo,
				       pmix_op_cbfunc_t cbfunc, void *cbdata)
{
    int rc;
    size_t n;
    pmix20_opalcaddy_t *opalcaddy;
    opal_process_name_t proc;
    opal_value_t *oinfo;

    if (NULL == host_module || NULL == host_module->publish) {
	return PMIX_ERR_NOT_SUPPORTED;
    }

   /* convert the nspace/rank to an opal_process_name_t */
    if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) {
	return pmix20_convert_opalrc(rc);
    }
    if (PMIX_RANK_WILDCARD == p->rank) {
	proc.vpid = OPAL_VPID_WILDCARD;
    } else {
	proc.vpid = p->rank;
    }

    /* setup the caddy */
    opalcaddy = OBJ_NEW(pmix20_opalcaddy_t);
    opalcaddy->opcbfunc = cbfunc;
    opalcaddy->cbdata = cbdata;

    /* convert the info array */
    for (n=0; n < ninfo; n++) {
	oinfo = OBJ_NEW(opal_value_t);
	opal_list_append(&opalcaddy->info, &oinfo->super);
	oinfo->key = strdup(info[n].key);
	if (OPAL_SUCCESS != (rc = pmix20_value_unload(oinfo, &info[n].value))) {
	    OBJ_RELEASE(opalcaddy);
	    return pmix20_convert_opalrc(rc);
	}
    }

    /* pass it up */
    rc = host_module->publish(&proc, &opalcaddy->info, opal_opcbfunc, opalcaddy);
    if (OPAL_SUCCESS != rc) {
	OBJ_RELEASE(opalcaddy);
    }

    return pmix20_convert_opalrc(rc);
}
コード例 #11
0
ファイル: pmix_ext_server_north.c プロジェクト: AT95/ompi
static pmix_status_t server_client_connected_fn(const pmix_proc_t *p, void *server_object)
{
    int rc;
    opal_process_name_t proc;

    if (NULL == host_module || NULL == host_module->client_connected) {
        return PMIX_SUCCESS;
    }

    /* convert the nspace/rank to an opal_process_name_t */
    if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) {
        return pmix1_convert_opalrc(rc);
    }
    proc.vpid = p->rank;

    /* pass it up */
    rc = host_module->client_connected(&proc, server_object);
    return pmix1_convert_opalrc(rc);
}
コード例 #12
0
ファイル: pmix1_client.c プロジェクト: nasailja/ompi
int pmix1_client_init(void)
{
    opal_process_name_t pname;
    pmix_status_t rc;
    int dbg;

    opal_output_verbose(1, opal_pmix_base_framework.framework_output,
                        "PMIx_client init");

    if (0 < (dbg = opal_output_get_verbosity(opal_pmix_base_framework.framework_output))) {
        asprintf(&dbgvalue, "PMIX_DEBUG=%d", dbg);
        putenv(dbgvalue);
    }
    rc = PMIx_Init(&myproc);
    if (PMIX_SUCCESS == rc) {
        /* store our jobid and rank */
        opal_convert_string_to_jobid(&pname.jobid, myproc.nspace);
        pname.vpid = myproc.rank;
        opal_proc_set_name(&pname);
    }
    return pmix1_convert_rc(rc);
}
コード例 #13
0
ファイル: pmix2x_server_north.c プロジェクト: anandhis/ompi
static pmix_status_t server_dmodex_req_fn(const pmix_proc_t *p,
                                          const pmix_info_t info[], size_t ninfo,
                                          pmix_modex_cbfunc_t cbfunc, void *cbdata)
{
    int rc;
    pmix2x_opalcaddy_t *opalcaddy;
    opal_process_name_t proc;
    opal_value_t *iptr;
    size_t n;
    opal_pmix2x_dmx_trkr_t *dmdx;

    if (NULL == host_module || NULL == host_module->direct_modex) {
        return PMIX_ERR_NOT_SUPPORTED;
    }

    /* convert the nspace/rank to an opal_process_name_t */
    if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) {
        return pmix2x_convert_opalrc(rc);
    }
    proc.vpid = pmix2x_convert_rank(p->rank);

    opal_output_verbose(3, opal_pmix_base_framework.framework_output,
                        "%s CLIENT %s CALLED DMODX",
                        OPAL_NAME_PRINT(OPAL_PROC_MY_NAME),
                        OPAL_NAME_PRINT(proc));

    /* setup the caddy */
    opalcaddy = OBJ_NEW(pmix2x_opalcaddy_t);
    opalcaddy->mdxcbfunc = cbfunc;
    opalcaddy->cbdata = cbdata;

    /* this function should only get called if we are in an async modex.
     * If we are also collecting data, then the fence_nb will eventually
     * complete and return all the required data down to the pmix
     * server beneath us. Thus, we only need to track the dmodex_req
     * and ensure that the release gets called once the data has
     * arrived - this will trigger the pmix server to tell the
     * client that the data is available */
    if (opal_pmix_base_async_modex && opal_pmix_collect_all_data) {
        OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock);
        dmdx = OBJ_NEW(opal_pmix2x_dmx_trkr_t);
        dmdx->cbfunc = cbfunc;
        dmdx->cbdata = cbdata;
        opal_list_append(&mca_pmix_pmix2x_component.dmdx, &dmdx->super);
        OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock);
        return PMIX_SUCCESS;
    }

    /* convert the array of pmix_info_t to the list of info */
    for (n=0; n < ninfo; n++) {
        iptr = OBJ_NEW(opal_value_t);
        opal_list_append(&opalcaddy->info, &iptr->super);
        iptr->key = strdup(info[n].key);
        if (OPAL_SUCCESS != (rc = pmix2x_value_unload(iptr, &info[n].value))) {
            OBJ_RELEASE(opalcaddy);
            return pmix2x_convert_opalrc(rc);
        }
    }

    /* pass it up */
    rc = host_module->direct_modex(&proc, &opalcaddy->info, opmdx_response, opalcaddy);
    if (OPAL_SUCCESS != rc && OPAL_ERR_IN_PROCESS != rc) {
        OBJ_RELEASE(opalcaddy);
    }
    if (OPAL_ERR_IN_PROCESS == rc) {
        rc = OPAL_SUCCESS;
    }
    return pmix2x_convert_opalrc(rc);
}