source: src/mpix/comm/comm_reenable_anysource.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.3 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
10/* -- Begin Profiling Symbol Block for routine MPIX_Comm_group_failed */
11#if defined(HAVE_PRAGMA_WEAK)
12#pragma weak MPIX_Comm_group_failed = PMPIX_Comm_group_failed
13#elif defined(HAVE_PRAGMA_HP_SEC_DEF)
14#pragma _HP_SECONDARY_DEF PMPIX_Comm_group_failed  MPIX_Comm_group_failed
15#elif defined(HAVE_PRAGMA_CRI_DUP)
16#pragma _CRI duplicate MPIX_Comm_group_failed as PMPIX_Comm_group_failed
17#endif
18/* -- End Profiling Symbol Block */
19
20/* Define MPICH_MPI_FROM_PMPI if weak symbols are not supported to build
21   the MPI routines */
22#ifndef MPICH_MPI_FROM_PMPI
23#undef MPIX_Comm_group_failed
24#define MPIX_Comm_group_failed PMPIX_Comm_group_failed
25
26#endif
27
28#undef FUNCNAME
29#define FUNCNAME MPIX_Comm_reenable_anysource
30#undef FCNAME
31#define FCNAME MPIU_QUOTE(FUNCNAME)
32/*@
33
34MPIX_Comm_reenable_anysource - Re-enable the ability to post receives using MPI_ANY_SOURCE on the communicator
35
36Input Parameter:
37. comm - Communicator (handle)
38
39Output Parameter:
40. failed_group - Group of failed processes communicator (handle)
41
42Notes:
43.N COMMNULL
44
45.N ThreadSafe
46
47.N Fortran
48
49.N Errors
50.N MPI_SUCCESS
51.N MPI_ERR_COMM
52@*/
53int MPIX_Comm_reenable_anysource(MPI_Comm comm, MPI_Group *failed_group)
54{
55    int mpi_errno = MPI_SUCCESS;
56    MPID_Comm *comm_ptr = NULL;
57    MPID_Group *failed_group_ptr;
58    MPIDI_STATE_DECL(MPID_STATE_MPIX_COMM_REENABLE_ANYSOURCE);
59
60    MPIR_ERRTEST_INITIALIZED_ORDIE();
61   
62    MPIU_THREAD_CS_ENTER(ALLFUNC,);
63    MPIDI_FUNC_ENTER(MPID_STATE_MPIX_COMM_REENABLE_ANYSOURCE);
64
65    /* Validate parameters, especially handles needing to be converted */
66#   ifdef HAVE_ERROR_CHECKING
67    {
68        MPID_BEGIN_ERROR_CHECKS;
69        {
70            MPIR_ERRTEST_COMM(comm, mpi_errno);
71            if (mpi_errno != MPI_SUCCESS) goto fn_fail;
72        }
73        MPID_END_ERROR_CHECKS;
74    }
75   
76#   endif /* HAVE_ERROR_CHECKING */
77
78    /* Convert MPI object handles to object pointers */
79    MPID_Comm_get_ptr( comm, comm_ptr );
80   
81    /* Validate parameters and objects (post conversion) */
82#   ifdef HAVE_ERROR_CHECKING
83    {
84        MPID_BEGIN_ERROR_CHECKS;
85        {
86            /* Validate comm_ptr */
87            MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
88            /* If comm_ptr is not valid, it will be reset to null */
89            if (mpi_errno) goto fn_fail;
90        }
91        MPID_END_ERROR_CHECKS;
92    }
93#   endif /* HAVE_ERROR_CHECKING */
94
95    /* ... body of routine ...  */
96   
97    mpi_errno = MPID_Comm_reenable_anysource(comm_ptr, &failed_group_ptr);
98    if (mpi_errno) goto fn_fail;
99
100    MPIU_OBJ_PUBLISH_HANDLE(*failed_group, failed_group_ptr->handle);
101
102    /* ... end of body of routine ... */
103
104 fn_exit:
105    MPIDI_FUNC_EXIT(MPID_STATE_MPIX_COMM_REENABLE_ANYSOURCE);
106    MPIU_THREAD_CS_EXIT(ALLFUNC,);
107    return mpi_errno;
108 fn_fail:
109    /* --BEGIN ERROR HANDLING-- */
110#   ifdef HAVE_ERROR_CHECKING
111    {
112        mpi_errno = MPIR_Err_create_code(
113            mpi_errno, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_OTHER, "**mpi_comm_reenable_anysource",
114            "**mpi_comm_reenable_anysource %C %p", comm, failed_group);
115    }
116#   endif
117    mpi_errno = MPIR_Err_return_comm( comm_ptr, FCNAME, mpi_errno );
118    goto fn_exit;
119    /* --END ERROR HANDLING-- */
120}
Note: See TracBrowser for help on using the repository browser.