1 /*
2  * Copyright (C) by Argonne National Laboratory
3  *     See COPYRIGHT in top-level directory
4  */
5 
6 #include "mpiimpl.h"
7 
MPIR_Barrier_allcomm_nb(MPIR_Comm * comm_ptr,MPIR_Errflag_t * errflag)8 int MPIR_Barrier_allcomm_nb(MPIR_Comm * comm_ptr, MPIR_Errflag_t * errflag)
9 {
10     int mpi_errno = MPI_SUCCESS;
11     MPIR_Request *req_ptr = NULL;
12 
13     /* just call the nonblocking version and wait on it */
14     mpi_errno = MPIR_Ibarrier(comm_ptr, &req_ptr);
15     MPIR_ERR_CHECK(mpi_errno);
16 
17     mpi_errno = MPIC_Wait(req_ptr, errflag);
18     MPIR_ERR_CHECK(mpi_errno);
19     MPIR_Request_free(req_ptr);
20 
21   fn_exit:
22     return mpi_errno;
23   fn_fail:
24     goto fn_exit;
25 }
26