1
1
openmpi/src/mpi/interface/c/comm_set_name.c

48 строки
902 B
C
Исходник Обычный вид История

2003-11-22 19:36:58 +03:00
/*
* $HEADER$
2003-11-22 19:36:58 +03:00
*/
#include "lam_config.h"
2003-11-22 19:36:58 +03:00
#include <string.h>
#include "mpi.h"
#include "mpi/interface/c/bindings.h"
#include "lam/util/strncpy.h"
#include "lam/communicator.h"
#include "lam/totalview.h"
2003-11-22 19:36:58 +03:00
#if LAM_WANT_MPI_PROFILING && LAM_HAVE_WEAK_SYMBOLS
#pragma weak PMPI_Comm_set_name = MPI_Comm_set_name
#endif
2003-11-22 19:36:58 +03:00
2003-11-22 19:36:58 +03:00
int
MPI_Comm_set_name(MPI_Comm comm, char *name)
{
if (comm == MPI_COMM_NULL) {
/* -- Invoke error function -- */
}
if (name == NULL) {
/* -- Invoke error function -- */
}
/* -- Thread safety entrance -- */
/* Copy in the name */
lam_strncpy(comm->c_name, name, MPI_MAX_OBJECT_NAME);
2003-11-22 19:36:58 +03:00
comm->c_name[MPI_MAX_OBJECT_NAME - 1] = 0;
/* -- Tracing information for new communicator name -- */
2003-11-22 19:36:58 +03:00
/* Force TotalView DLL to take note of this name setting */
++lam_tv_comm_sequence_number;
2003-11-22 19:36:58 +03:00
/* -- Thread safety exit -- */
return MPI_SUCCESS;
}