1
1
openmpi/orte/mca/sds/cnos/sds_cnos_module.c
Brian Barrett 93ddb4bf73 * some fixups for the cnos components
This commit was SVN r6637.
2005-07-28 00:11:09 +00:00

99 строки
2.6 KiB
C

/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*
*/
#include "orte_config.h"
#include <catamount/cnos_mpi_os.h>
#include "include/orte_constants.h"
#include "mca/sds/sds.h"
#include "mca/sds/base/base.h"
#include "mca/sds/cnos/sds_cnos.h"
#include "util/proc_info.h"
#include "mca/ns/base/base.h"
#include "mca/errmgr/base/base.h"
orte_sds_base_module_t sds_cnos_module = {
orte_sds_base_contact_universe,
orte_sds_cnos_set_name,
orte_sds_cnos_finalize,
};
int
orte_sds_cnos_contact_universe(void)
{
orte_process_info.seed = false;
/* since we are seed, ensure that all replica info is NULL'd */
if (NULL != orte_process_info.ns_replica_uri) {
free(orte_process_info.ns_replica_uri);
orte_process_info.ns_replica_uri = NULL;
}
if (NULL != orte_process_info.ns_replica) {
free(orte_process_info.ns_replica);
orte_process_info.ns_replica = NULL;
}
if (NULL != orte_process_info.gpr_replica_uri) {
free(orte_process_info.gpr_replica_uri);
orte_process_info.gpr_replica_uri = NULL;
}
if (NULL != orte_process_info.gpr_replica) {
free(orte_process_info.gpr_replica);
orte_process_info.gpr_replica = NULL;
}
return OMPI_SUCCESS;
}
int
orte_sds_cnos_set_name(void)
{
int rc;
orte_cellid_t cellid;
orte_jobid_t jobid;
orte_vpid_t vpid;
/* Get our process information
*
* we're going to make up the cellid and jobid. find our vpid,
* assuming range starts at 0
*/
cellid = 0;
jobid = 1; /* not 0, since it has special meaning */
vpid = (orte_vpid_t) cnos_get_rank();
if (ORTE_SUCCESS != (rc = orte_ns.create_process_name(&(orte_process_info.my_name),
cellid,
jobid,
vpid))) {
ORTE_ERROR_LOG(rc);
return rc;
}
orte_process_info.vpid_start = (orte_vpid_t) 0;
orte_process_info.num_procs = (size_t) cnos_get_size();
return ORTE_SUCCESS;
}
int
orte_sds_cnos_finalize(void)
{
return ORTE_SUCCESS;
}