MPI_COMM_GET_NAME had the compiler-added extra string length parameter
(but didn't use it), but MPI_TYPE_GET_NAME and MPI_WIN_GET_NAME did not. This commit changes all three functions to pass the compile-added string length parameter to clear out the remainder of the string with spaces (i.e., the rest of the string that was not set with the name). This is what was done in LAM/MPI, and apparently what was done in Sun's MPI, because the test that Rolf attached now passes. Fixes trac:274. This commit was SVN r11301. The following Trac tickets were found above: Ticket 274 --> https://svn.open-mpi.org/trac/ompi/ticket/274
Этот коммит содержится в:
родитель
73a7916946
Коммит
fbb484dea2
@ -9,6 +9,7 @@
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -70,8 +71,7 @@ void mpi_comm_get_name_f(MPI_Fint *comm, char *comm_name,
|
||||
|
||||
err = MPI_Comm_get_name(c_comm, c_name, &c_len);
|
||||
if (MPI_SUCCESS == err) {
|
||||
ompi_fortran_string_c2f(c_name, comm_name,
|
||||
OMPI_FINT_2_INT(*resultlen));
|
||||
ompi_fortran_string_c2f(c_name, comm_name, name_len);
|
||||
*resultlen = OMPI_INT_2_FINT(c_len);
|
||||
*ierr = OMPI_INT_2_FINT(MPI_SUCCESS);
|
||||
} else {
|
||||
|
@ -9,6 +9,7 @@
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -295,7 +296,7 @@ PN(void, mpi_type_get_attr, MPI_TYPE_GET_ATTR, (MPI_Fint *type, MPI_Fint *type_k
|
||||
PN(void, mpi_type_get_contents, MPI_TYPE_GET_CONTENTS, (MPI_Fint *mtype, MPI_Fint *max_integers, MPI_Fint *max_addresses, MPI_Fint *max_datatypes, MPI_Fint *array_of_integers, MPI_Fint *array_of_addresses, MPI_Fint *array_of_datatypes, MPI_Fint *ierr));
|
||||
PN(void, mpi_type_get_envelope, MPI_TYPE_GET_ENVELOPE, (MPI_Fint *type, MPI_Fint *num_integers, MPI_Fint *num_addresses, MPI_Fint *num_datatypes, MPI_Fint *combiner, MPI_Fint *ierr));
|
||||
PN(void, mpi_type_get_extent, MPI_TYPE_GET_EXTENT, (MPI_Fint *type, MPI_Aint *lb, MPI_Aint *extent, MPI_Fint *ierr));
|
||||
PN(void, mpi_type_get_name, MPI_TYPE_GET_NAME, (MPI_Fint *type, char *type_name, MPI_Fint *resultlen, MPI_Fint *ierr));
|
||||
PN(void, mpi_type_get_name, MPI_TYPE_GET_NAME, (MPI_Fint *type, char *type_name, MPI_Fint *resultlen, MPI_Fint *ierr, int name_len));
|
||||
PN(void, mpi_type_get_true_extent, MPI_TYPE_GET_TRUE_EXTENT, (MPI_Fint *datatype, MPI_Aint *true_lb, MPI_Aint *true_extent, MPI_Fint *ierr));
|
||||
PN(void, mpi_type_hindexed, MPI_TYPE_HINDEXED, (MPI_Fint *count, MPI_Fint *array_of_blocklengths, MPI_Fint *array_of_displacements, MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr));
|
||||
PN(void, mpi_type_hvector, MPI_TYPE_HVECTOR, (MPI_Fint *count, MPI_Fint *blocklength, MPI_Fint *stride, MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr));
|
||||
@ -327,7 +328,7 @@ PN(void, mpi_win_free_keyval, MPI_WIN_FREE_KEYVAL, (MPI_Fint *win_keyval, MPI_Fi
|
||||
PN(void, mpi_win_get_attr, MPI_WIN_GET_ATTR, (MPI_Fint *win, MPI_Fint *win_keyval, MPI_Aint *attribute_val, MPI_Flogical *flag, MPI_Fint *ierr));
|
||||
PN(void, mpi_win_get_errhandler, MPI_WIN_GET_ERRHANDLER, (MPI_Fint *win, MPI_Fint *errhandler, MPI_Fint *ierr));
|
||||
PN(void, mpi_win_get_group, MPI_WIN_GET_GROUP, (MPI_Fint *win, MPI_Fint *group, MPI_Fint *ierr));
|
||||
PN(void, mpi_win_get_name, MPI_WIN_GET_NAME, (MPI_Fint *win, char *win_name, MPI_Fint *resultlen, MPI_Fint *ierr));
|
||||
PN(void, mpi_win_get_name, MPI_WIN_GET_NAME, (MPI_Fint *win, char *win_name, MPI_Fint *resultlen, MPI_Fint *ierr, int name_len));
|
||||
PN(void, mpi_win_lock, MPI_WIN_LOCK, (MPI_Fint *lock_type, MPI_Fint *rank, MPI_Fint *assert, MPI_Fint *win, MPI_Fint *ierr));
|
||||
PN(void, mpi_win_post, MPI_WIN_POST, (MPI_Fint *group, MPI_Fint *assert, MPI_Fint *win, MPI_Fint *ierr));
|
||||
PN(void, mpi_win_set_attr, MPI_WIN_SET_ATTR, (MPI_Fint *win, MPI_Fint *win_keyval, MPI_Aint *attribute_val, MPI_Fint *ierr));
|
||||
|
@ -9,6 +9,7 @@
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -30,12 +31,12 @@
|
||||
#pragma weak pmpi_type_get_name__ = mpi_type_get_name_f
|
||||
#elif OMPI_PROFILE_LAYER
|
||||
OMPI_GENERATE_F77_BINDINGS (PMPI_TYPE_GET_NAME,
|
||||
pmpi_type_get_name,
|
||||
pmpi_type_get_name_,
|
||||
pmpi_type_get_name__,
|
||||
pmpi_type_get_name_f,
|
||||
(MPI_Fint *type, char *type_name, MPI_Fint *resultlen, MPI_Fint *ierr),
|
||||
(type, type_name, resultlen, ierr) )
|
||||
pmpi_type_get_name,
|
||||
pmpi_type_get_name_,
|
||||
pmpi_type_get_name__,
|
||||
pmpi_type_get_name_f,
|
||||
(MPI_Fint *type, char *type_name, MPI_Fint *resultlen, MPI_Fint *ierr, int name_len),
|
||||
(type, type_name, resultlen, ierr, name_len) )
|
||||
#endif
|
||||
|
||||
#if OMPI_HAVE_WEAK_SYMBOLS
|
||||
@ -47,12 +48,12 @@ OMPI_GENERATE_F77_BINDINGS (PMPI_TYPE_GET_NAME,
|
||||
|
||||
#if ! OMPI_HAVE_WEAK_SYMBOLS && ! OMPI_PROFILE_LAYER
|
||||
OMPI_GENERATE_F77_BINDINGS (MPI_TYPE_GET_NAME,
|
||||
mpi_type_get_name,
|
||||
mpi_type_get_name_,
|
||||
mpi_type_get_name__,
|
||||
mpi_type_get_name_f,
|
||||
(MPI_Fint *type, char *type_name, MPI_Fint *resultlen, MPI_Fint *ierr),
|
||||
(type, type_name, resultlen, ierr) )
|
||||
mpi_type_get_name,
|
||||
mpi_type_get_name_,
|
||||
mpi_type_get_name__,
|
||||
mpi_type_get_name_f,
|
||||
(MPI_Fint *type, char *type_name, MPI_Fint *resultlen, MPI_Fint *ierr, int name_len),
|
||||
(type, type_name, resultlen, ierr, name_len) )
|
||||
#endif
|
||||
|
||||
|
||||
@ -60,7 +61,7 @@ OMPI_GENERATE_F77_BINDINGS (MPI_TYPE_GET_NAME,
|
||||
#include "ompi/mpi/f77/profile/defines.h"
|
||||
#endif
|
||||
|
||||
void mpi_type_get_name_f(MPI_Fint *type, char *type_name, MPI_Fint *resultlen, MPI_Fint *ierr)
|
||||
void mpi_type_get_name_f(MPI_Fint *type, char *type_name, MPI_Fint *resultlen, MPI_Fint *ierr, int name_len)
|
||||
{
|
||||
int err, c_len;
|
||||
MPI_Datatype c_type = MPI_Type_f2c(*type);
|
||||
@ -68,8 +69,7 @@ void mpi_type_get_name_f(MPI_Fint *type, char *type_name, MPI_Fint *resultlen, M
|
||||
|
||||
err = MPI_Type_get_name(c_type, c_name, &c_len);
|
||||
if (MPI_SUCCESS == err) {
|
||||
ompi_fortran_string_c2f(c_name, type_name,
|
||||
OMPI_FINT_2_INT(*resultlen));
|
||||
ompi_fortran_string_c2f(c_name, type_name, name_len);
|
||||
*resultlen = OMPI_INT_2_FINT(c_len);
|
||||
*ierr = OMPI_INT_2_FINT(MPI_SUCCESS);
|
||||
} else {
|
||||
|
@ -9,6 +9,7 @@
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -31,12 +32,12 @@
|
||||
#pragma weak pmpi_win_get_name__ = mpi_win_get_name_f
|
||||
#elif OMPI_PROFILE_LAYER
|
||||
OMPI_GENERATE_F77_BINDINGS (PMPI_WIN_GET_NAME,
|
||||
pmpi_win_get_name,
|
||||
pmpi_win_get_name_,
|
||||
pmpi_win_get_name__,
|
||||
pmpi_win_get_name_f,
|
||||
(MPI_Fint *win, char *win_name, MPI_Fint *resultlen, MPI_Fint *ierr),
|
||||
(win, win_name, resultlen, ierr) )
|
||||
pmpi_win_get_name,
|
||||
pmpi_win_get_name_,
|
||||
pmpi_win_get_name__,
|
||||
pmpi_win_get_name_f,
|
||||
(MPI_Fint *win, char *win_name, MPI_Fint *resultlen, MPI_Fint *ierr, int name_len),
|
||||
(win, win_name, resultlen, ierr, name_len) )
|
||||
#endif
|
||||
|
||||
#if OMPI_HAVE_WEAK_SYMBOLS
|
||||
@ -48,12 +49,12 @@ OMPI_GENERATE_F77_BINDINGS (PMPI_WIN_GET_NAME,
|
||||
|
||||
#if ! OMPI_HAVE_WEAK_SYMBOLS && ! OMPI_PROFILE_LAYER
|
||||
OMPI_GENERATE_F77_BINDINGS (MPI_WIN_GET_NAME,
|
||||
mpi_win_get_name,
|
||||
mpi_win_get_name_,
|
||||
mpi_win_get_name__,
|
||||
mpi_win_get_name_f,
|
||||
(MPI_Fint *win, char *win_name, MPI_Fint *resultlen, MPI_Fint *ierr),
|
||||
(win, win_name, resultlen, ierr) )
|
||||
mpi_win_get_name,
|
||||
mpi_win_get_name_,
|
||||
mpi_win_get_name__,
|
||||
mpi_win_get_name_f,
|
||||
(MPI_Fint *win, char *win_name, MPI_Fint *resultlen, MPI_Fint *ierr, int name_len),
|
||||
(win, win_name, resultlen, ierr, name_len) )
|
||||
#endif
|
||||
|
||||
|
||||
@ -62,7 +63,7 @@ OMPI_GENERATE_F77_BINDINGS (MPI_WIN_GET_NAME,
|
||||
#endif
|
||||
|
||||
void mpi_win_get_name_f(MPI_Fint *win, char *win_name,
|
||||
MPI_Fint *resultlen, MPI_Fint *ierr)
|
||||
MPI_Fint *resultlen, MPI_Fint *ierr, int name_len)
|
||||
{
|
||||
int err, c_len;
|
||||
MPI_Win c_win = MPI_Win_f2c(*win);
|
||||
@ -70,8 +71,7 @@ void mpi_win_get_name_f(MPI_Fint *win, char *win_name,
|
||||
|
||||
err = MPI_Win_get_name(c_win, c_name, &c_len);
|
||||
if (MPI_SUCCESS == err) {
|
||||
ompi_fortran_string_c2f(c_name, win_name,
|
||||
OMPI_FINT_2_INT(*resultlen));
|
||||
ompi_fortran_string_c2f(c_name, win_name, name_len);
|
||||
*resultlen = OMPI_INT_2_FINT(c_len);
|
||||
*ierr = OMPI_INT_2_FINT(MPI_SUCCESS);
|
||||
} else {
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user