1 /*
2 * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
3 * University Research and Technology
4 * Corporation. All rights reserved.
5 * Copyright (c) 2004-2005 The University of Tennessee and The University
6 * of Tennessee Research Foundation. All rights
7 * reserved.
8 * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
9 * University of Stuttgart. All rights reserved.
10 * Copyright (c) 2004-2005 The Regents of the University of California.
11 * All rights reserved.
12 * Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
13 * Copyright (c) 2009 University of Houston. All rights reserved.
14 * Copyright (c) 2012 Oak Ridge National Labs. All rights reserved.
15 * Copyright (c) 2015 Research Organization for Information Science
16 * and Technology (RIST). All rights reserved.
17 * $COPYRIGHT$
18 *
19 * Additional copyrights may follow
20 *
21 * $HEADER$
22 */
23 #include "ompi_config.h"
24 #include <stdio.h>
25
26 #include "ompi/mpi/c/bindings.h"
27 #include "ompi/runtime/params.h"
28 #include "ompi/group/group.h"
29 #include "ompi/errhandler/errhandler.h"
30 #include "ompi/communicator/communicator.h"
31 #include "ompi/proc/proc.h"
32
33 #if OMPI_BUILD_MPI_PROFILING
34 #if OPAL_HAVE_WEAK_SYMBOLS
35 #pragma weak MPI_Group_compare = PMPI_Group_compare
36 #endif
37 #define MPI_Group_compare PMPI_Group_compare
38 #endif
39
40 static const char FUNC_NAME[] = "MPI_Group_compare";
41
42
43 int MPI_Group_compare(MPI_Group group1, MPI_Group group2, int *result) {
44 int return_value = MPI_SUCCESS;
45
46 /* check for errors */
47 if( MPI_PARAM_CHECK ) {
48 OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
49
50 if( ( MPI_GROUP_NULL == group1 ) || ( MPI_GROUP_NULL == group2 ) ||
51 (NULL == group1) || (NULL==group2) ){
52 return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_GROUP,
53 FUNC_NAME);
54 } else if (NULL == result) {
55 return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
56 FUNC_NAME);
57 }
58 }
59
60 OPAL_CR_NOOP_PROGRESS();
61
62 return_value = ompi_group_compare((ompi_group_t *)group1, (ompi_group_t *)group2, result);
63
64 return return_value;
65 }