Lines Matching refs:dat

34   PetscSF_Allgatherv *dat = (PetscSF_Allgatherv *)sf->data;  in PetscSFSetUp_Allgatherv()  local
47 PetscCall(PetscMalloc1(size, &dat->recvcounts)); in PetscSFSetUp_Allgatherv()
48 PetscCall(PetscMalloc1(size, &dat->displs)); in PetscSFSetUp_Allgatherv()
52 PetscCall(PetscMPIIntCast(range[i], &dat->displs[i])); in PetscSFSetUp_Allgatherv()
53 PetscCall(PetscMPIIntCast(range[i + 1] - range[i], &dat->recvcounts[i])); in PetscSFSetUp_Allgatherv()
64 dat->bcast_pattern = PETSC_TRUE; in PetscSFSetUp_Allgatherv()
66 dat->bcast_root = sf->nroots > 0 ? rank : -1; in PetscSFSetUp_Allgatherv()
67 PetscCallMPI(MPIU_Allreduce(MPI_IN_PLACE, &dat->bcast_root, 1, MPI_INT, MPI_MAX, comm)); in PetscSFSetUp_Allgatherv()
76 PetscSF_Allgatherv *dat = (PetscSF_Allgatherv *)sf->data; in PetscSFReset_Allgatherv() local
77 PetscSFLink link = dat->avail, next; in PetscSFReset_Allgatherv()
80 PetscCall(PetscFree(dat->iranks)); in PetscSFReset_Allgatherv()
81 PetscCall(PetscFree(dat->ioffset)); in PetscSFReset_Allgatherv()
82 PetscCall(PetscFree(dat->irootloc)); in PetscSFReset_Allgatherv()
83 PetscCall(PetscFree(dat->recvcounts)); in PetscSFReset_Allgatherv()
84 PetscCall(PetscFree(dat->displs)); in PetscSFReset_Allgatherv()
85 …PetscCheck(!dat->inuse, PetscObjectComm((PetscObject)sf), PETSC_ERR_ARG_WRONGSTATE, "Outstanding o… in PetscSFReset_Allgatherv()
90 dat->avail = NULL; in PetscSFReset_Allgatherv()
109 PetscSF_Allgatherv *dat = (PetscSF_Allgatherv *)sf->data; in PetscSFBcastBegin_Allgatherv() local
120 …if (dat->bcast_pattern && rank == dat->bcast_root) PetscCall((*link->Memcpy)(link, link->leafmtype… in PetscSFBcastBegin_Allgatherv()
124 …if (dat->bcast_pattern) PetscCallMPI(MPIU_Ibcast(leafbuf, nleaves, unit, dat->bcast_root, comm, re… in PetscSFBcastBegin_Allgatherv()
125 …else PetscCallMPI(MPIU_Iallgatherv(rootbuf, sendcount, unit, leafbuf, dat->recvcounts, dat->displs… in PetscSFBcastBegin_Allgatherv()
132 PetscSF_Allgatherv *dat = (PetscSF_Allgatherv *)sf->data; in PetscSFReduceBegin_Allgatherv() local
152 if (dat->bcast_pattern) { in PetscSFReduceBegin_Allgatherv()
176 PetscCallMPI(MPIU_Reduce(leafbuf, rootbuf, nleavesi, baseunit, op, dat->bcast_root, comm)); in PetscSFReduceBegin_Allgatherv()
178 … PetscCallMPI(MPIU_Ireduce(leafbuf, rootbuf, nleavesi, baseunit, op, dat->bcast_root, comm, req)); in PetscSFReduceBegin_Allgatherv()
182 PetscCall(PetscMPIIntCast(dat->rootbuflen[PETSCSF_REMOTE], &recvcount)); in PetscSFReduceBegin_Allgatherv()
189 …catterv(link->leafbuf_alloc[PETSCSF_REMOTE][link->leafmtype_mpi], dat->recvcounts, dat->displs, un… in PetscSFReduceBegin_Allgatherv()
221 PetscSF_Allgatherv *dat = (PetscSF_Allgatherv *)sf->data; in PetscSFBcastToZero_Allgatherv() local
233 …PetscCallMPI(MPIU_Igatherv(rootbuf, sendcount, unit, leafbuf, dat->recvcounts, dat->displs, unit, … in PetscSFBcastToZero_Allgatherv()
359 PetscSF_Allgatherv *dat = (PetscSF_Allgatherv *)sf->data; in PetscSFGetLeafRanks_Allgatherv() local
374 if (!dat->iranks) { in PetscSFGetLeafRanks_Allgatherv()
375 PetscCall(PetscMalloc1(size, &dat->iranks)); in PetscSFGetLeafRanks_Allgatherv()
376 dat->iranks[0] = rank; in PetscSFGetLeafRanks_Allgatherv()
379 dat->iranks[j++] = i; in PetscSFGetLeafRanks_Allgatherv()
382 *iranks = dat->iranks; /* dat->iranks was init'ed to NULL by PetscNew */ in PetscSFGetLeafRanks_Allgatherv()
386 if (!dat->ioffset) { in PetscSFGetLeafRanks_Allgatherv()
387 PetscCall(PetscMalloc1(size + 1, &dat->ioffset)); in PetscSFGetLeafRanks_Allgatherv()
388 for (PetscMPIInt i = 0; i <= size; i++) dat->ioffset[i] = i * sf->nroots; in PetscSFGetLeafRanks_Allgatherv()
390 *ioffset = dat->ioffset; in PetscSFGetLeafRanks_Allgatherv()
394 if (!dat->irootloc) { in PetscSFGetLeafRanks_Allgatherv()
395 PetscCall(PetscMalloc1(sf->nleaves, &dat->irootloc)); in PetscSFGetLeafRanks_Allgatherv()
397 for (PetscInt j = 0; j < sf->nroots; j++) dat->irootloc[i * sf->nroots + j] = j; in PetscSFGetLeafRanks_Allgatherv()
400 *irootloc = dat->irootloc; in PetscSFGetLeafRanks_Allgatherv()
433 PetscSF_Allgatherv *dat = (PetscSF_Allgatherv *)sf->data; in PetscSFCreate_Allgatherv() local
454 PetscCall(PetscNew(&dat)); in PetscSFCreate_Allgatherv()
455 dat->bcast_root = -1; in PetscSFCreate_Allgatherv()
456 sf->data = (void *)dat; in PetscSFCreate_Allgatherv()