Lines Matching refs:pshmcomm

67 PetscErrorCode PetscShmCommGet(MPI_Comm globcomm, PetscShmComm *pshmcomm)  in PetscShmCommGet()  argument
75 PetscAssertPointer(pshmcomm, 2); in PetscShmCommGet()
101 PetscCallMPI(MPI_Comm_get_attr(globcomm, Petsc_ShmComm_keyval, pshmcomm, &flg)); in PetscShmCommGet()
104 PetscCall(PetscNew(pshmcomm)); in PetscShmCommGet()
105 (*pshmcomm)->globcomm = globcomm; in PetscShmCommGet()
107 …PetscCallMPI(MPI_Comm_split_type(globcomm, MPI_COMM_TYPE_SHARED, 0, MPI_INFO_NULL, &(*pshmcomm)->s… in PetscShmCommGet()
109 PetscCallMPI(MPI_Comm_size((*pshmcomm)->shmcomm, &(*pshmcomm)->shmsize)); in PetscShmCommGet()
111 PetscCallMPI(MPI_Comm_group((*pshmcomm)->shmcomm, &shmgroup)); in PetscShmCommGet()
112 PetscCall(PetscMalloc1((*pshmcomm)->shmsize, &shmranks)); in PetscShmCommGet()
113 PetscCall(PetscMalloc1((*pshmcomm)->shmsize, &(*pshmcomm)->globranks)); in PetscShmCommGet()
114 for (i = 0; i < (*pshmcomm)->shmsize; i++) shmranks[i] = i; in PetscShmCommGet()
115 …PetscCallMPI(MPI_Group_translate_ranks(shmgroup, (*pshmcomm)->shmsize, shmranks, globgroup, (*pshm… in PetscShmCommGet()
120 …for (i = 0; i < (*pshmcomm)->shmsize; i++) PetscCall(PetscInfo(NULL, "Shared memory rank %d global… in PetscShmCommGet()
121 PetscCallMPI(MPI_Comm_set_attr(globcomm, Petsc_ShmComm_keyval, *pshmcomm)); in PetscShmCommGet()
147 PetscErrorCode PetscShmCommGlobalToLocal(PetscShmComm pshmcomm, PetscMPIInt grank, PetscMPIInt *lra… in PetscShmCommGlobalToLocal() argument
153 PetscAssertPointer(pshmcomm, 1); in PetscShmCommGlobalToLocal()
156 if (grank < pshmcomm->globranks[0]) PetscFunctionReturn(PETSC_SUCCESS); in PetscShmCommGlobalToLocal()
157 if (grank > pshmcomm->globranks[pshmcomm->shmsize - 1]) PetscFunctionReturn(PETSC_SUCCESS); in PetscShmCommGlobalToLocal()
161 high = pshmcomm->shmsize; in PetscShmCommGlobalToLocal()
164 if (pshmcomm->globranks[t] > grank) high = t; in PetscShmCommGlobalToLocal()
168 if (pshmcomm->globranks[i] > grank) PetscFunctionReturn(PETSC_SUCCESS); in PetscShmCommGlobalToLocal()
169 if (pshmcomm->globranks[i] == grank) { in PetscShmCommGlobalToLocal()
191 PetscErrorCode PetscShmCommLocalToGlobal(PetscShmComm pshmcomm, PetscMPIInt lrank, PetscMPIInt *gra… in PetscShmCommLocalToGlobal() argument
194 PetscAssertPointer(pshmcomm, 1); in PetscShmCommLocalToGlobal()
196 …PetscCheck(lrank >= 0 && lrank < pshmcomm->shmsize, PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "No… in PetscShmCommLocalToGlobal()
197 *grank = pshmcomm->globranks[lrank]; in PetscShmCommLocalToGlobal()
214 PetscErrorCode PetscShmCommGetMpiShmComm(PetscShmComm pshmcomm, MPI_Comm *comm) in PetscShmCommGetMpiShmComm() argument
217 PetscAssertPointer(pshmcomm, 1); in PetscShmCommGetMpiShmComm()
219 *comm = pshmcomm->shmcomm; in PetscShmCommGetMpiShmComm()