source: src/mpix/comm/comm_group_failed.c @ 928f3d

3.1.x3.2.x
Last change on this file since 928f3d was 928f3d, checked in by Darius Buntinas <buntinas@…>, 6 years ago

[svn-r9398] added files that were missing from manual merge r9394

  • Property mode set to 100644
File size: 3.2 KB
Line 
1/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
2/*
3 *
4 *  (C) 2011 by Argonne National Laboratory.
5 *      See COPYRIGHT in top-level directory.
6 */
7
8#include "mpiimpl.h"
9#include "mpicomm.h"
10
11/* -- Begin Profiling Symbol Block for routine MPIX_Comm_group_failed */
12#if defined(HAVE_PRAGMA_WEAK)
13#pragma weak MPIX_Comm_group_failed = PMPIX_Comm_group_failed
14#elif defined(HAVE_PRAGMA_HP_SEC_DEF)
15#pragma _HP_SECONDARY_DEF PMPIX_Comm_group_failed  MPIX_Comm_group_failed
16#elif defined(HAVE_PRAGMA_CRI_DUP)
17#pragma _CRI duplicate MPIX_Comm_group_failed as PMPIX_Comm_group_failed
18#endif
19/* -- End Profiling Symbol Block */
20
21/* Define MPICH_MPI_FROM_PMPI if weak symbols are not supported to build
22   the MPI routines */
23#ifndef MPICH_MPI_FROM_PMPI
24#undef MPIX_Comm_group_failed
25#define MPIX_Comm_group_failed PMPIX_Comm_group_failed
26
27#endif
28
29#undef FUNCNAME
30#define FUNCNAME MPIX_Comm_group_failed
31#undef FCNAME
32#define FCNAME MPIU_QUOTE(FUNCNAME)
33/*@
34
35MPIX_Comm_group_failed - Accesses the group associated with given communicator
36
37Input Parameter:
38. comm - Communicator (handle)
39
40Output Parameter:
41. group - Group of failed processes communicator (handle)
42
43Notes:
44.N COMMNULL
45
46.N ThreadSafe
47
48.N Fortran
49
50.N Errors
51.N MPI_SUCCESS
52.N MPI_ERR_COMM
53@*/
54int MPIX_Comm_group_failed(MPI_Comm comm, MPI_Group *failed_group)
55{
56    int mpi_errno = MPI_SUCCESS;
57    MPID_Comm *comm_ptr = NULL;
58    MPID_Group *failed_group_ptr;
59    MPID_MPI_STATE_DECL(MPID_STATE_MPIX_COMM_GROUP_FAILED);
60
61    MPIR_ERRTEST_INITIALIZED_ORDIE();
62   
63    MPIU_THREAD_CS_ENTER(ALLFUNC,);
64    MPID_MPI_FUNC_ENTER(MPID_STATE_MPIX_COMM_GROUP_FAILED);
65   
66    /* Validate parameters, especially handles needing to be converted */
67#   ifdef HAVE_ERROR_CHECKING
68    {
69        MPID_BEGIN_ERROR_CHECKS;
70        {
71            MPIR_ERRTEST_COMM(comm, mpi_errno);
72            if (mpi_errno != MPI_SUCCESS) goto fn_fail;
73        }
74        MPID_END_ERROR_CHECKS;
75    }
76   
77#   endif /* HAVE_ERROR_CHECKING */
78
79    /* Convert MPI object handles to object pointers */
80    MPID_Comm_get_ptr( comm, comm_ptr );
81   
82    /* Validate parameters and objects (post conversion) */
83#   ifdef HAVE_ERROR_CHECKING
84    {
85        MPID_BEGIN_ERROR_CHECKS;
86        {
87            /* Validate comm_ptr */
88            MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
89            /* If comm_ptr is not valid, it will be reset to null */
90            if (mpi_errno) goto fn_fail;
91        }
92        MPID_END_ERROR_CHECKS;
93    }
94#   endif /* HAVE_ERROR_CHECKING */
95
96    /* ... body of routine ...  */
97   
98    mpi_errno = MPID_Comm_group_failed(comm_ptr, &failed_group_ptr);
99    if (mpi_errno) goto fn_fail;
100
101    MPIU_OBJ_PUBLISH_HANDLE(*failed_group, failed_group_ptr->handle);
102
103    /* ... end of body of routine ... */
104
105  fn_exit:
106    MPID_MPI_FUNC_EXIT(MPID_STATE_MPIX_COMM_GROUP_FAILED);
107    MPIU_THREAD_CS_EXIT(ALLFUNC,);
108    return mpi_errno;
109
110  fn_fail:
111    /* --BEGIN ERROR HANDLING-- */
112#   ifdef HAVE_ERROR_CHECKING
113    {
114        mpi_errno = MPIR_Err_create_code(
115            mpi_errno, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_OTHER, "**mpi_comm_group_failed",
116            "**mpi_comm_group_failed %C %p", comm, failed_group);
117    }
118#   endif
119    mpi_errno = MPIR_Err_return_comm( comm_ptr, FCNAME, mpi_errno );
120    goto fn_exit;
121    /* --END ERROR HANDLING-- */
122}
123
Note: See TracBrowser for help on using the repository browser.