Lines Matching refs:rootdata
172 PetscInt *rootdata, *leafdata; in main() local
175 PetscCall(PetscMalloc2(nrootsalloc, &rootdata, nleavesalloc, &leafdata)); in main()
177 for (i = 0; i < nrootsalloc; i++) rootdata[i] = -1; in main()
178 for (i = 0; i < nroots; i++) rootdata[i * stride] = 100 * (rank + 1) + i; in main()
183 PetscCall(PetscSFRegisterPersistent(sf, MPIU_INT, rootdata, leafdata)); in main()
185 PetscCall(PetscSFBcastBegin(sf, MPIU_INT, rootdata, leafdata, MPI_REPLACE)); in main()
186 PetscCall(PetscSFBcastEnd(sf, MPIU_INT, rootdata, leafdata, MPI_REPLACE)); in main()
188 PetscCall(PetscSFDeregisterPersistent(sf, MPIU_INT, rootdata, leafdata)); in main()
190 PetscCall(PetscIntView(nrootsalloc, rootdata, PETSC_VIEWER_STDOUT_WORLD)); in main()
193 PetscCall(PetscFree2(rootdata, leafdata)); in main()
199 char *rootdata, *leafdata; in main() local
200 PetscCall(PetscMalloc2(nrootsalloc, &rootdata, nleavesalloc, &leafdata)); in main()
202 for (i = 0; i < nrootsalloc; i++) rootdata[i] = '*'; in main()
203 …for (i = 0; i < nroots; i++) rootdata[i * stride] = (char)('A' + rank * 3 + i); /* rank is very sm… in main()
207 PetscCall(PetscSFBcastBegin(sf, MPI_CHAR, rootdata, leafdata, MPI_REPLACE)); in main()
208 PetscCall(PetscSFBcastEnd(sf, MPI_CHAR, rootdata, leafdata, MPI_REPLACE)); in main()
215 PetscCall(PetscSNPrintf(buf + len, 256 - len, "%5c", rootdata[i])); in main()
232 PetscCall(PetscFree2(rootdata, leafdata)); in main()
236 PetscInt *rootdata, *leafdata; in main() local
239 PetscCall(PetscMalloc2(nrootsalloc, &rootdata, nleavesalloc, &leafdata)); in main()
241 for (i = 0; i < nrootsalloc; i++) rootdata[i] = -1; in main()
242 for (i = 0; i < nroots; i++) rootdata[i * stride] = 100 * (rank + 1) + i; in main()
248 PetscCall(PetscSFBcastBegin(sf, MPIU_INT, rootdata, leafdata, mop)); in main()
249 PetscCall(PetscSFBcastEnd(sf, MPIU_INT, rootdata, leafdata, mop)); in main()
251 PetscCall(PetscIntView(nrootsalloc, rootdata, PETSC_VIEWER_STDOUT_WORLD)); in main()
254 PetscCall(PetscFree2(rootdata, leafdata)); in main()
258 PetscInt *rootdata, *leafdata; in main() local
259 PetscCall(PetscMalloc2(nrootsalloc, &rootdata, nleavesalloc, &leafdata)); in main()
261 for (i = 0; i < nrootsalloc; i++) rootdata[i] = -1; in main()
262 for (i = 0; i < nroots; i++) rootdata[i * stride] = 100 * (rank + 1) + i; in main()
267 PetscCall(PetscIntView(nrootsalloc, rootdata, PETSC_VIEWER_STDOUT_WORLD)); in main()
270 PetscCall(PetscSFReduceBegin(sf, MPIU_INT, leafdata, rootdata, mop)); in main()
271 PetscCall(PetscSFReduceEnd(sf, MPIU_INT, leafdata, rootdata, mop)); in main()
275 PetscCall(PetscIntView(nrootsalloc, rootdata, PETSC_VIEWER_STDOUT_WORLD)); in main()
276 PetscCall(PetscFree2(rootdata, leafdata)); in main()
282 signed char *rootdata, *leafdata; in main() local
283 PetscCall(PetscMalloc2(nrootsalloc, &rootdata, nleavesalloc, &leafdata)); in main()
285 for (i = 0; i < nrootsalloc; i++) rootdata[i] = -1; in main()
286 for (i = 0; i < nroots; i++) rootdata[i * stride] = (signed char)(10 * (rank + 1) + i); in main()
296 PetscCall(PetscSNPrintf(buf + len, 256 - len, "%5d", rootdata[i])); in main()
305 PetscCall(PetscSFReduceBegin(sf, MPI_SIGNED_CHAR, leafdata, rootdata, mop)); in main()
306 PetscCall(PetscSFReduceEnd(sf, MPI_SIGNED_CHAR, leafdata, rootdata, mop)); in main()
324 PetscCall(PetscSNPrintf(buf + len, 256 - len, "%5d", rootdata[i])); in main()
330 PetscCall(PetscFree2(rootdata, leafdata)); in main()
336 unsigned char *rootdata, *leafdata; in main() local
337 PetscCall(PetscMalloc2(nrootsalloc, &rootdata, nleavesalloc, &leafdata)); in main()
339 for (i = 0; i < nrootsalloc; i++) rootdata[i] = 0; in main()
340 for (i = 0; i < nroots; i++) rootdata[i * stride] = (unsigned char)(10 * (rank + 1) + i); in main()
350 PetscCall(PetscSNPrintf(buf + len, 256 - len, "%5u", rootdata[i])); in main()
359 PetscCall(PetscSFReduceBegin(sf, MPI_UNSIGNED_CHAR, leafdata, rootdata, mop)); in main()
360 PetscCall(PetscSFReduceEnd(sf, MPI_UNSIGNED_CHAR, leafdata, rootdata, mop)); in main()
378 PetscCall(PetscSNPrintf(buf + len, 256 - len, "%5u", rootdata[i])); in main()
384 PetscCall(PetscFree2(rootdata, leafdata)); in main()
397 PetscInt *leafdata, *leafupdate, *rootdata; in main() local
398 …etscCall(PetscMalloc3(nleavesalloc, &leafdata, nleavesalloc, &leafupdate, nrootsalloc, &rootdata)); in main()
401 for (i = 0; i < nrootsalloc; i++) rootdata[i] = -1; in main()
402 for (i = 0; i < nroots; i++) rootdata[i * stride] = 0; in main()
403 PetscCall(PetscSFFetchAndOpBegin(sf, MPIU_INT, rootdata, leafdata, leafupdate, mop)); in main()
404 PetscCall(PetscSFFetchAndOpEnd(sf, MPIU_INT, rootdata, leafdata, leafupdate, mop)); in main()
406 PetscCall(PetscIntView(nrootsalloc, rootdata, PETSC_VIEWER_STDOUT_WORLD)); in main()
409 PetscCall(PetscFree3(leafdata, leafupdate, rootdata)); in main()