AMPI #952: update ROMIO to MPICH2-1.4.1p1
[charm.git] / src / libs / ck-libs / ampi / romio / mpi-io / get_group.c
blob747318f49bd6209902058448e572184a14f93354
1 /* -*- Mode: C; c-basic-offset:4 ; -*- */
2 /*
4 * Copyright (C) 1997 University of Chicago.
5 * See COPYRIGHT notice in top-level directory.
6 */
8 #include "mpioimpl.h"
10 #ifdef HAVE_WEAK_SYMBOLS
12 #if defined(HAVE_PRAGMA_WEAK)
13 #pragma weak MPI_File_get_group = PMPI_File_get_group
14 #elif defined(HAVE_PRAGMA_HP_SEC_DEF)
15 #pragma _HP_SECONDARY_DEF PMPI_File_get_group MPI_File_get_group
16 #elif defined(HAVE_PRAGMA_CRI_DUP)
17 #pragma _CRI duplicate MPI_File_get_group as PMPI_File_get_group
18 /* end of weak pragmas */
19 #endif
21 /* Include mapping from MPI->PMPI */
22 #define MPIO_BUILD_PROFILING
23 #include "mpioprof.h"
24 #endif
26 /*@
27 MPI_File_get_group - Returns the group of processes that
28 opened the file
30 Input Parameters:
31 . fh - file handle (handle)
33 Output Parameters:
34 . group - group that opened the file (handle)
36 .N fortran
37 @*/
38 int MPI_File_get_group(MPI_File mpi_fh, MPI_Group *group)
40 int error_code;
41 ADIO_File fh;
42 static char myname[] = "MPI_FILE_GET_GROUP";
44 MPIU_THREAD_CS_ENTER(ALLFUNC,);
46 fh = MPIO_File_resolve(mpi_fh);
48 /* --BEGIN ERROR HANDLING-- */
49 MPIO_CHECK_FILE_HANDLE(fh, myname, error_code);
50 /* --END ERROR HANDLING-- */
53 /* note: this will return the group of processes that called open, but
54 * with deferred open this might not be the group of processes that
55 * actually opened the file from the file system's perspective
57 error_code = MPI_Comm_group(fh->comm, group);
59 fn_exit:
60 MPIU_THREAD_CS_EXIT(ALLFUNC,);
61 return error_code;