2003-11-22 19:36:58 +03:00
|
|
|
/*
|
2004-01-07 11:08:59 +03:00
|
|
|
* $HEADER$
|
2003-11-22 19:36:58 +03:00
|
|
|
*/
|
|
|
|
|
2004-01-08 16:42:23 +03:00
|
|
|
#include "lam_config.h"
|
|
|
|
|
2003-11-22 19:36:58 +03:00
|
|
|
#include <string.h>
|
|
|
|
|
2004-01-10 21:09:01 +03:00
|
|
|
#include "mpi.h"
|
2004-01-11 00:32:32 +03:00
|
|
|
#include "mpi/interface/c/bindings.h"
|
2004-01-08 16:42:23 +03:00
|
|
|
#include "lam/util/strncpy.h"
|
2004-01-10 01:09:51 +03:00
|
|
|
#include "lam/communicator.h"
|
|
|
|
#include "lam/totalview.h"
|
2003-11-22 19:36:58 +03:00
|
|
|
|
2004-01-08 16:42:23 +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
|
|
|
|
2004-01-09 11:30:19 +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 */
|
|
|
|
|
2004-01-08 16:42:23 +03:00
|
|
|
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;
|
|
|
|
|
2004-01-07 11:37:02 +03:00
|
|
|
/* -- Tracing information for new communicator name -- */
|
2003-11-22 19:36:58 +03:00
|
|
|
|
|
|
|
/* Force TotalView DLL to take note of this name setting */
|
|
|
|
|
2004-01-07 11:08:59 +03:00
|
|
|
++lam_tv_comm_sequence_number;
|
2003-11-22 19:36:58 +03:00
|
|
|
|
|
|
|
/* -- Thread safety exit -- */
|
|
|
|
|
|
|
|
return MPI_SUCCESS;
|
|
|
|
}
|