Lines Matching refs:comm

27 PetscErrorCode PetscCommBuildTwoSidedSetType(MPI_Comm comm, PetscBuildTwoSidedType twosided)  in PetscCommBuildTwoSidedSetType()  argument
34 PetscCallMPI(MPIU_Allreduce(b1, b2, 2, MPI_INT, MPI_MAX, comm)); in PetscCommBuildTwoSidedSetType()
35 …PetscCheck(-b2[0] == b2[1], comm, PETSC_ERR_ARG_WRONG, "Enum value must be same on all processes"); in PetscCommBuildTwoSidedSetType()
54 PetscErrorCode PetscCommBuildTwoSidedGetType(MPI_Comm comm, PetscBuildTwoSidedType *twosided) in PetscCommBuildTwoSidedGetType() argument
61 PetscCallMPI(MPI_Comm_size(comm, &size)); in PetscCommBuildTwoSidedGetType()
73 static PetscErrorCode PetscCommBuildTwoSided_Ibarrier(MPI_Comm comm, PetscMPIInt count, MPI_Datatyp… in PetscCommBuildTwoSided_Ibarrier() argument
83 PetscCall(PetscCommDuplicate(comm, &comm, &tag)); in PetscCommBuildTwoSided_Ibarrier()
85 PetscCheck(lb == 0, comm, PETSC_ERR_SUP, "Datatype with nonzero lower bound %ld", (long)lb); in PetscCommBuildTwoSided_Ibarrier()
88 …ssend((void *)(tdata + count * unitbytes * i), count, dtype, toranks[i], tag, comm, sendreqs + i)); in PetscCommBuildTwoSided_Ibarrier()
100 PetscCallMPI(MPI_Iprobe(MPI_ANY_SOURCE, tag, comm, &flag, &status)); in PetscCommBuildTwoSided_Ibarrier()
107 PetscCallMPI(MPI_Recv(buf, count, dtype, status.MPI_SOURCE, tag, comm, MPI_STATUS_IGNORE)); in PetscCommBuildTwoSided_Ibarrier()
115 PetscCallMPI(MPI_Ibarrier(comm, &barrier)); in PetscCommBuildTwoSided_Ibarrier()
128 PetscCall(PetscCommDestroy(&comm)); in PetscCommBuildTwoSided_Ibarrier()
133 static PetscErrorCode PetscCommBuildTwoSided_Allreduce(MPI_Comm comm, PetscMPIInt count, MPI_Dataty… in PetscCommBuildTwoSided_Allreduce() argument
143 PetscCallMPI(MPI_Comm_size(comm, &size)); in PetscCommBuildTwoSided_Allreduce()
144 PetscCallMPI(MPI_Comm_rank(comm, &rank)); in PetscCommBuildTwoSided_Allreduce()
145 PetscCall(PetscCommDuplicate(comm, &comm, &tag)); in PetscCommBuildTwoSided_Allreduce()
146 PetscCallMPI(MPI_Comm_get_attr(comm, Petsc_Counter_keyval, &counter, &flg)); in PetscCommBuildTwoSided_Allreduce()
156 PetscCallMPI(MPIU_Allreduce(MPI_IN_PLACE, iflags, size, MPI_INT, MPI_SUM, comm)); in PetscCommBuildTwoSided_Allreduce()
159 PetscCheck(lb == 0, comm, PETSC_ERR_SUP, "Datatype with nonzero lower bound %ld", (long)lb); in PetscCommBuildTwoSided_Allreduce()
164 …Irecv((void *)(fdata + count * unitbytes * i), count, dtype, MPI_ANY_SOURCE, tag, comm, reqs + i)); in PetscCommBuildTwoSided_Allreduce()
165 …Isend((void *)(tdata + count * unitbytes * i), count, dtype, toranks[i], tag, comm, sendreqs + i)); in PetscCommBuildTwoSided_Allreduce()
170 PetscCall(PetscCommDestroy(&comm)); in PetscCommBuildTwoSided_Allreduce()
179 static PetscErrorCode PetscCommBuildTwoSided_RedScatter(MPI_Comm comm, PetscMPIInt count, MPI_Datat… in PetscCommBuildTwoSided_RedScatter() argument
189 PetscCallMPI(MPI_Comm_size(comm, &size)); in PetscCommBuildTwoSided_RedScatter()
190 PetscCall(PetscCommDuplicate(comm, &comm, &tag)); in PetscCommBuildTwoSided_RedScatter()
191 PetscCallMPI(MPI_Comm_get_attr(comm, Petsc_Counter_keyval, &counter, &flg)); in PetscCommBuildTwoSided_RedScatter()
201 PetscCallMPI(MPI_Reduce_scatter_block(iflags, &nrecvs, 1, MPI_INT, MPI_SUM, comm)); in PetscCommBuildTwoSided_RedScatter()
203 PetscCheck(lb == 0, comm, PETSC_ERR_SUP, "Datatype with nonzero lower bound %ld", (long)lb); in PetscCommBuildTwoSided_RedScatter()
208 …Irecv((void *)(fdata + count * unitbytes * i), count, dtype, MPI_ANY_SOURCE, tag, comm, reqs + i)); in PetscCommBuildTwoSided_RedScatter()
209 …Isend((void *)(tdata + count * unitbytes * i), count, dtype, toranks[i], tag, comm, sendreqs + i)); in PetscCommBuildTwoSided_RedScatter()
214 PetscCall(PetscCommDestroy(&comm)); in PetscCommBuildTwoSided_RedScatter()
255 PetscErrorCode PetscCommBuildTwoSided(MPI_Comm comm, PetscMPIInt count, MPI_Datatype dtype, PetscMP… in PetscCommBuildTwoSided() argument
261 PetscCall(PetscLogEventSync(PETSC_BuildTwoSided, comm)); in PetscCommBuildTwoSided()
263 PetscCall(PetscCommBuildTwoSidedGetType(comm, &buildtype)); in PetscCommBuildTwoSided()
267 …PetscCall(PetscCommBuildTwoSided_Ibarrier(comm, count, dtype, nto, toranks, todata, nfrom, fromran… in PetscCommBuildTwoSided()
270 … SETERRQ(comm, PETSC_ERR_PLIB, "MPI implementation does not provide MPI_Ibarrier (part of MPI-3)"); in PetscCommBuildTwoSided()
273 …PetscCall(PetscCommBuildTwoSided_Allreduce(comm, count, dtype, nto, toranks, todata, nfrom, fromra… in PetscCommBuildTwoSided()
277 …PetscCall(PetscCommBuildTwoSided_RedScatter(comm, count, dtype, nto, toranks, todata, nfrom, fromr… in PetscCommBuildTwoSided()
280 …SETERRQ(comm, PETSC_ERR_PLIB, "MPI implementation does not provide MPI_Reduce_scatter_block (part … in PetscCommBuildTwoSided()
283 SETERRQ(comm, PETSC_ERR_PLIB, "Unknown method for building two-sided communication"); in PetscCommBuildTwoSided()
289 static PetscErrorCode PetscCommBuildTwoSidedFReq_Reference(MPI_Comm comm, PetscMPIInt count, MPI_Da… in PetscCommBuildTwoSidedFReq_Reference() argument
297 if (ntags > 0) PetscCall(PetscCommDuplicate(comm, &comm, &tag[0])); in PetscCommBuildTwoSidedFReq_Reference()
298 for (i = 1; i < ntags; i++) PetscCall(PetscCommGetNewTag(comm, &tag[i])); in PetscCommBuildTwoSidedFReq_Reference()
301 …PetscCall(PetscCommBuildTwoSided(comm, count, dtype, nto, toranks, todata, nfrom, fromranks, fromd… in PetscCommBuildTwoSidedFReq_Reference()
307 PetscCheck(lb == 0, comm, PETSC_ERR_SUP, "Datatype with nonzero lower bound %ld", (long)lb); in PetscCommBuildTwoSidedFReq_Reference()
311 …PetscCall((*send)(comm, tag, i, toranks[i], ((char *)todata) + count * unitbytes * i, sendreq + i … in PetscCommBuildTwoSidedFReq_Reference()
317 PetscCall((*recv)(comm, tag, (*fromranks)[i], header, recvreq + i * ntags, ctx)); in PetscCommBuildTwoSidedFReq_Reference()
320 PetscCall(PetscCommDestroy(&comm)); in PetscCommBuildTwoSidedFReq_Reference()
328 static PetscErrorCode PetscCommBuildTwoSidedFReq_Ibarrier(MPI_Comm comm, PetscMPIInt count, MPI_Dat… in PetscCommBuildTwoSidedFReq_Ibarrier() argument
338 PetscCall(PetscCommDuplicate(comm, &comm, &tag)); in PetscCommBuildTwoSidedFReq_Ibarrier()
340 for (i = 0; i < ntags; i++) PetscCall(PetscCommGetNewTag(comm, &tags[i])); in PetscCommBuildTwoSidedFReq_Ibarrier()
342 PetscCheck(lb == 0, comm, PETSC_ERR_SUP, "Datatype with nonzero lower bound %ld", (long)lb); in PetscCommBuildTwoSidedFReq_Ibarrier()
347 …ssend((void *)(tdata + count * unitbytes * i), count, dtype, toranks[i], tag, comm, sendreqs + i)); in PetscCommBuildTwoSidedFReq_Ibarrier()
353 …PetscCall((*send)(comm, tags, i, toranks[i], tdata + count * unitbytes * i, usendreqs + i * ntags,… in PetscCommBuildTwoSidedFReq_Ibarrier()
368 PetscCallMPI(MPI_Iprobe(MPI_ANY_SOURCE, tag, comm, &flag, &status)); in PetscCommBuildTwoSidedFReq_Ibarrier()
375 PetscCallMPI(MPI_Recv(buf, count, dtype, status.MPI_SOURCE, tag, comm, MPI_STATUS_IGNORE)); in PetscCommBuildTwoSidedFReq_Ibarrier()
378 PetscCall((*recv)(comm, tags, status.MPI_SOURCE, buf, req, ctx)); in PetscCommBuildTwoSidedFReq_Ibarrier()
386 PetscCallMPI(MPI_Ibarrier(comm, &barrier)); in PetscCommBuildTwoSidedFReq_Ibarrier()
403 PetscCall(PetscCommDestroy(&comm)); in PetscCommBuildTwoSidedFReq_Ibarrier()
440 PetscErrorCode PetscCommBuildTwoSidedF(MPI_Comm comm, PetscMPIInt count, MPI_Datatype dtype, PetscM… in PetscCommBuildTwoSidedF() argument
445 …PetscCall(PetscCommBuildTwoSidedFReq(comm, count, dtype, nto, toranks, todata, nfrom, fromranks, f… in PetscCommBuildTwoSidedF()
487 PetscErrorCode PetscCommBuildTwoSidedFReq(MPI_Comm comm, PetscMPIInt count, MPI_Datatype dtype, Pet… in PetscCommBuildTwoSidedFReq() argument
495 PetscCallMPI(MPI_Comm_size(comm, &size)); in PetscCommBuildTwoSidedFReq()
496 …for (i = 0; i < nto; i++) PetscCheck(toranks[i] >= 0 && size > toranks[i], comm, PETSC_ERR_ARG_OUT… in PetscCommBuildTwoSidedFReq()
497 PetscCall(PetscLogEventSync(PETSC_BuildTwoSidedF, comm)); in PetscCommBuildTwoSidedFReq()
499 PetscCall(PetscCommBuildTwoSidedGetType(comm, &buildtype)); in PetscCommBuildTwoSidedFReq()
506 … SETERRQ(comm, PETSC_ERR_PLIB, "MPI implementation does not provide MPI_Ibarrier (part of MPI-3)"); in PetscCommBuildTwoSidedFReq()
513 SETERRQ(comm, PETSC_ERR_PLIB, "Unknown method for building two-sided communication"); in PetscCommBuildTwoSidedFReq()
515 …PetscCall((*f)(comm, count, dtype, nto, toranks, todata, nfrom, fromranks, fromdata, ntags, toreqs… in PetscCommBuildTwoSidedFReq()