1
1

- Fix up some file name prefix rule issues

- Remove some debugging statements
- Fix use of ompi_comm_[rank|size]

This commit was SVN r2352.
Этот коммит содержится в:
Jeff Squyres 2004-08-28 09:29:06 +00:00
родитель c704267665
Коммит 271a241af4
3 изменённых файлов: 15 добавлений и 26 удалений

Просмотреть файл

@ -11,7 +11,7 @@ headers = \
noinst_LTLIBRARIES = libmca_topo_unity.la
libmca_topo_unity_la_SOURCES = \
$(headers) \
cart_map.c \
graph_map.c \
topo_unity_cart_map.c \
topo_unity_graph_map.c \
topo_unity.c \
topo_unity_component.c

Просмотреть файл

@ -1,8 +1,11 @@
/*
* $HEADER$
*/
#include "mca/topo/unity/src/topo_unity.h"
#include "communicator/communicator.h"
/*
* function - mca_topo_unity_cart_map
*
@ -23,11 +26,11 @@ int mca_topo_unity_cart_map (MPI_Comm comm,
int ndims,
int *dims,
int *periods,
int *newrank){
int *newrank)
{
int nprocs;
int rank;
int size;
int errcode;
int i;
int *p;
@ -37,7 +40,6 @@ int mca_topo_unity_cart_map (MPI_Comm comm,
nprocs = 1;
for (i = 0, p = dims; i < ndims; ++i, ++p) {
if (*p <= 0) {
printf ("the dimensions are wrong\n");
return MPI_ERR_DIMS;
}
nprocs *= *p;
@ -45,27 +47,14 @@ int mca_topo_unity_cart_map (MPI_Comm comm,
/*
* Check that number of processes <= size of communicator.
*/
#if 0
errcode = ompi_comm_size (comm, &size);
#endif
if (errcode != MPI_SUCCESS) {
return errcode;
}
size = ompi_comm_size(comm);
if (nprocs > size) {
printf ("the dimensions are wrong\n");
return MPI_ERR_DIMS;
}
/*
* Compute my new rank.
*/
#if 0
errcode = ompi_comm_rank (comm, &rank);
#endif
if (errcode != MPI_SUCCESS) {
printf ("failed to get a comm rank\n");
return errcode;
}
rank = ompi_comm_rank(comm);
*newrank = ((rank < 0) || (rank >= nprocs)) ? MPI_UNDEFINED : rank;
return MPI_SUCCESS;

Просмотреть файл

@ -1,8 +1,11 @@
/*
* $HEADER$
*/
#include "mca/topo/unity/src/topo_unity.h"
#include "communicator/communicator.h"
/*
* function - mca_topo_unity_graph_map
*
@ -22,16 +25,13 @@ int mca_topo_unity_graph_map (MPI_Comm comm,
int nnodes,
int *index,
int *edges,
int *newrank){
int *newrank)
{
int errcode;
int myrank;
#if 0
errcode = ompi_comm_rank (comm, &myrank);
#endif
myrank = ompi_comm_rank(comm);
if (OMPI_SUCCESS != errcode) {
printf ("failed to get a comm rank\n");
return OMPI_ERROR;
}