From 273f840b0cbfdf3ce198781ad3c7ea195eac7135 Mon Sep 17 00:00:00 2001 From: genaud Date: Mon, 22 Mar 2010 23:03:53 +0000 Subject: [PATCH] added MPI_Get_processor_name() git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7300 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- include/smpi/smpi.h | 2 ++ src/smpi/smpi_mpi.c | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/include/smpi/smpi.h b/include/smpi/smpi.h index 016e9ececd..842aeba393 100644 --- a/include/smpi/smpi.h +++ b/include/smpi/smpi.h @@ -157,6 +157,8 @@ XBT_PUBLIC(int) MPI_Group_range_excl(MPI_Group group, int n, int ranges[][3], MP XBT_PUBLIC(int) MPI_Comm_rank(MPI_Comm comm, int* rank); XBT_PUBLIC(int) MPI_Comm_size(MPI_Comm comm, int* size); +XBT_PUBLIC(int) MPI_Get_processor_name(char *name, int *resultlen); + XBT_PUBLIC(int) MPI_Comm_group(MPI_Comm comm, MPI_Group* group); XBT_PUBLIC(int) MPI_Comm_compare(MPI_Comm comm1, MPI_Comm comm2, int* result); XBT_PUBLIC(int) MPI_Comm_dup(MPI_Comm comm, MPI_Comm* newcomm); diff --git a/src/smpi/smpi_mpi.c b/src/smpi/smpi_mpi.c index ecead73cb7..7bb89d2505 100644 --- a/src/smpi/smpi_mpi.c +++ b/src/smpi/smpi_mpi.c @@ -1067,3 +1067,16 @@ int MPI_Alltoallv(void* sendbuf, int* sendcounts, int* senddisps, MPI_Datatype s smpi_bench_begin(rank, "Alltoallv"); return retval; } + + +int MPI_Get_processor_name( char *name, int *resultlen ) { + int retval = MPI_SUCCESS; + smpi_bench_end(-1, NULL); + strcpy( name , SIMIX_host_get_name(SIMIX_host_self())); + name[MPI_MAX_PROCESSOR_NAME-1]='\0'; + *resultlen= strlen(name) > MPI_MAX_PROCESSOR_NAME ? MPI_MAX_PROCESSOR_NAME : strlen(name); + + smpi_bench_begin(-1, NULL); + return retval; +} + -- 2.20.1