File: | dm/impls/plex/plexcheckinterface.c |
Warning: | line 241, column 7 Value stored to 'ierr' is never read |
[?] Use j/k keys for keyboard navigation
1 | #include <petsc/private/dmpleximpl.h> /*I "petscdmplex.h" I*/ |
2 | |
3 | /* TODO PetscArrayExchangeBegin/End */ |
4 | /* TODO blocksize */ |
5 | /* TODO move to API ? */ |
6 | static PetscErrorCode ExchangeArrayByRank_Private(PetscObject obj, MPI_Datatype dt, PetscInt nsranks, const PetscMPIInt sranks[], PetscInt ssize[], const void *sarr[], PetscInt nrranks, const PetscMPIInt rranks[], PetscInt *rsize_out[], void **rarr_out[]) |
7 | { |
8 | PetscInt r; |
9 | PetscInt *rsize; |
10 | void **rarr; |
11 | MPI_Request *sreq, *rreq; |
12 | PetscMPIInt tag, unitsize; |
13 | MPI_Comm comm; |
14 | PetscErrorCode ierr; |
15 | |
16 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ; petscstack->line[petscstack->currentsize] = 16; petscstack ->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack ->currentsize++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0) ; ; } while (0); |
17 | ierr = MPI_Type_size(dt, &unitsize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),17,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
18 | ierr = PetscObjectGetComm(obj, &comm);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),18,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
19 | ierr = PetscMalloc2(nrranks, &rsize, nrranks, &rarr)PetscMallocA(2,PETSC_FALSE,19,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,(size_t)(nrranks)*sizeof(**(&rsize)),(&rsize),(size_t )(nrranks)*sizeof(**(&rarr)),(&rarr));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),19,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
20 | ierr = PetscMalloc2(nrranks, &rreq, nsranks, &sreq)PetscMallocA(2,PETSC_FALSE,20,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,(size_t)(nrranks)*sizeof(**(&rreq)),(&rreq),(size_t) (nsranks)*sizeof(**(&sreq)),(&sreq));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),20,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
21 | /* exchange array size */ |
22 | ierr = PetscObjectGetNewTag(obj,&tag);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),22,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
23 | for (r=0; r<nrranks; r++) { |
24 | ierr = MPI_Irecv(&rsize[r], 1, MPIU_INT, rranks[r], tag, comm, &rreq[r])((petsc_irecv_ct++,0) || PetscMPITypeSize((1),(((MPI_Datatype )0x4c000405)),&(petsc_irecv_len)) || MPI_Irecv((&rsize [r]),(1),(((MPI_Datatype)0x4c000405)),(rranks[r]),(tag),(comm ),(&rreq[r])));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),24,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
25 | } |
26 | for (r=0; r<nsranks; r++) { |
27 | ierr = MPI_Isend(&ssize[r], 1, MPIU_INT, sranks[r], tag, comm, &sreq[r])((petsc_isend_ct++,0) || PetscMPITypeSize((1),(((MPI_Datatype )0x4c000405)),&(petsc_isend_len)) || MPI_Isend((&ssize [r]),(1),(((MPI_Datatype)0x4c000405)),(sranks[r]),(tag),(comm ),(&sreq[r])));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),27,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
28 | } |
29 | ierr = MPI_Waitall(nrranks, rreq, MPI_STATUSES_IGNORE)((petsc_wait_all_ct++,petsc_sum_of_waits_ct += (PetscLogDouble ) (nrranks),0) || MPI_Waitall((nrranks),(rreq),((MPI_Status * )1)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),29,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
30 | ierr = MPI_Waitall(nsranks, sreq, MPI_STATUSES_IGNORE)((petsc_wait_all_ct++,petsc_sum_of_waits_ct += (PetscLogDouble ) (nsranks),0) || MPI_Waitall((nsranks),(sreq),((MPI_Status * )1)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),30,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
31 | /* exchange array */ |
32 | ierr = PetscObjectGetNewTag(obj,&tag);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),32,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
33 | for (r=0; r<nrranks; r++) { |
34 | ierr = PetscMalloc(rsize[r]*unitsize, &rarr[r])((*PetscTrMalloc)((rsize[r]*unitsize),PETSC_FALSE,34,__func__ ,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,(void**)(&rarr[r])));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),34,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
35 | ierr = MPI_Irecv(rarr[r], rsize[r], dt, rranks[r], tag, comm, &rreq[r])((petsc_irecv_ct++,0) || PetscMPITypeSize((rsize[r]),(dt),& (petsc_irecv_len)) || MPI_Irecv((rarr[r]),(rsize[r]),(dt),(rranks [r]),(tag),(comm),(&rreq[r])));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),35,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
36 | } |
37 | for (r=0; r<nsranks; r++) { |
38 | ierr = MPI_Isend(sarr[r], ssize[r], dt, sranks[r], tag, comm, &sreq[r])((petsc_isend_ct++,0) || PetscMPITypeSize((ssize[r]),(dt),& (petsc_isend_len)) || MPI_Isend((sarr[r]),(ssize[r]),(dt),(sranks [r]),(tag),(comm),(&sreq[r])));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),38,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
39 | } |
40 | ierr = MPI_Waitall(nrranks, rreq, MPI_STATUSES_IGNORE)((petsc_wait_all_ct++,petsc_sum_of_waits_ct += (PetscLogDouble ) (nrranks),0) || MPI_Waitall((nrranks),(rreq),((MPI_Status * )1)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),40,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
41 | ierr = MPI_Waitall(nsranks, sreq, MPI_STATUSES_IGNORE)((petsc_wait_all_ct++,petsc_sum_of_waits_ct += (PetscLogDouble ) (nsranks),0) || MPI_Waitall((nsranks),(sreq),((MPI_Status * )1)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),41,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
42 | ierr = PetscFree2(rreq, sreq)PetscFreeA(2,42,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,&(rreq),&(sreq));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),42,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
43 | *rsize_out = rsize; |
44 | *rarr_out = rarr; |
45 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); |
46 | } |
47 | |
48 | /* TODO VecExchangeBegin/End */ |
49 | /* TODO move to API ? */ |
50 | static PetscErrorCode ExchangeVecByRank_Private(PetscObject obj, PetscInt nsranks, const PetscMPIInt sranks[], Vec svecs[], PetscInt nrranks, const PetscMPIInt rranks[], Vec *rvecs[]) |
51 | { |
52 | PetscInt r; |
53 | PetscInt *ssize, *rsize; |
54 | PetscScalar **rarr; |
55 | const PetscScalar **sarr; |
56 | Vec *rvecs_; |
57 | MPI_Request *sreq, *rreq; |
58 | PetscErrorCode ierr; |
59 | |
60 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ; petscstack->line[petscstack->currentsize] = 60; petscstack ->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack ->currentsize++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0) ; ; } while (0); |
61 | ierr = PetscMalloc4(nsranks, &ssize, nsranks, &sarr, nrranks, &rreq, nsranks, &sreq)PetscMallocA(4,PETSC_FALSE,61,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,(size_t)(nsranks)*sizeof(**(&ssize)),(&ssize),(size_t )(nsranks)*sizeof(**(&sarr)),(&sarr),(size_t)(nrranks )*sizeof(**(&rreq)),(&rreq),(size_t)(nsranks)*sizeof( **(&sreq)),(&sreq));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),61,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
62 | for (r=0; r<nsranks; r++) { |
63 | ierr = VecGetLocalSize(svecs[r], &ssize[r]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),63,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
64 | ierr = VecGetArrayRead(svecs[r], &sarr[r]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),64,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
65 | } |
66 | ierr = ExchangeArrayByRank_Private(obj, MPIU_SCALAR((MPI_Datatype)0x4c00080b), nsranks, sranks, ssize, (const void**)sarr, nrranks, rranks, &rsize, (void***)&rarr);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),66,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
67 | ierr = PetscMalloc1(nrranks, &rvecs_)PetscMallocA(1,PETSC_FALSE,67,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,(size_t)(nrranks)*sizeof(**(&rvecs_)),(&rvecs_));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),67,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
68 | for (r=0; r<nrranks; r++) { |
69 | /* set array in two steps to mimic PETSC_OWN_POINTER */ |
70 | ierr = VecCreateSeqWithArray(PETSC_COMM_SELF((MPI_Comm)0x44000001), 1, rsize[r], NULL((void*)0), &rvecs_[r]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),70,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
71 | ierr = VecReplaceArray(rvecs_[r], rarr[r]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),71,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
72 | } |
73 | for (r=0; r<nsranks; r++) { |
74 | ierr = VecRestoreArrayRead(svecs[r], &sarr[r]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),74,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
75 | } |
76 | ierr = PetscFree2(rsize, rarr)PetscFreeA(2,76,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,&(rsize),&(rarr));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),76,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
77 | ierr = PetscFree4(ssize, sarr, rreq, sreq)PetscFreeA(4,77,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,&(ssize),&(sarr),&(rreq),&(sreq));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),77,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
78 | *rvecs = rvecs_; |
79 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); |
80 | } |
81 | |
82 | static PetscErrorCode SortByRemote_Private(PetscSF sf, PetscInt *rmine1[], PetscInt *rremote1[]) |
83 | { |
84 | PetscInt nleaves; |
85 | PetscInt nranks; |
86 | const PetscMPIInt *ranks; |
87 | const PetscInt *roffset, *rmine, *rremote; |
88 | PetscInt n, o, r; |
89 | PetscErrorCode ierr; |
90 | |
91 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ; petscstack->line[petscstack->currentsize] = 91; petscstack ->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack ->currentsize++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0) ; ; } while (0); |
92 | ierr = PetscSFGetRootRanks(sf, &nranks, &ranks, &roffset, &rmine, &rremote);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),92,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
93 | nleaves = roffset[nranks]; |
94 | ierr = PetscMalloc2(nleaves, rmine1, nleaves, rremote1)PetscMallocA(2,PETSC_FALSE,94,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,(size_t)(nleaves)*sizeof(**(rmine1)),(rmine1),(size_t)(nleaves )*sizeof(**(rremote1)),(rremote1));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),94,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
95 | for (r=0; r<nranks; r++) { |
96 | /* simultaneously sort rank-wise portions of rmine & rremote by values in rremote |
97 | - to unify order with the other side */ |
98 | o = roffset[r]; |
99 | n = roffset[r+1] - o; |
100 | ierr = PetscArraycpy(&(*rmine1)[o], &rmine[o], n)((sizeof(*(&(*rmine1)[o])) != sizeof(*(&rmine[o]))) || PetscMemcpy(&(*rmine1)[o],&rmine[o],(n)*sizeof(*(& (*rmine1)[o]))));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),100,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
101 | ierr = PetscArraycpy(&(*rremote1)[o], &rremote[o], n)((sizeof(*(&(*rremote1)[o])) != sizeof(*(&rremote[o]) )) || PetscMemcpy(&(*rremote1)[o],&rremote[o],(n)*sizeof (*(&(*rremote1)[o]))));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),101,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
102 | ierr = PetscSortIntWithArray(n, &(*rremote1)[o], &(*rmine1)[o]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),102,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
103 | } |
104 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); |
105 | } |
106 | |
107 | static PetscErrorCode GetRecursiveConeCoordinatesPerRank_Private(DM dm, PetscSF sf, PetscInt rmine[], Vec *coordinatesPerRank[]) |
108 | { |
109 | IS pointsPerRank, conesPerRank; |
110 | PetscInt nranks; |
111 | const PetscMPIInt *ranks; |
112 | const PetscInt *roffset; |
113 | PetscInt n, o, r; |
114 | PetscErrorCode ierr; |
115 | |
116 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ; petscstack->line[petscstack->currentsize] = 116; petscstack ->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack ->currentsize++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0) ; ; } while (0); |
117 | ierr = DMGetCoordinatesLocalSetUp(dm);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),117,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
118 | ierr = PetscSFGetRootRanks(sf, &nranks, &ranks, &roffset, NULL((void*)0), NULL((void*)0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),118,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
119 | ierr = PetscMalloc1(nranks, coordinatesPerRank)PetscMallocA(1,PETSC_FALSE,119,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,(size_t)(nranks)*sizeof(**(coordinatesPerRank)),(coordinatesPerRank ));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),119,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
120 | for (r=0; r<nranks; r++) { |
121 | o = roffset[r]; |
122 | n = roffset[r+1] - o; |
123 | ierr = ISCreateGeneral(PETSC_COMM_SELF((MPI_Comm)0x44000001), n, &rmine[o], PETSC_USE_POINTER, &pointsPerRank);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),123,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
124 | ierr = DMPlexGetConeRecursiveVertices(dm, pointsPerRank, &conesPerRank);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),124,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
125 | ierr = DMGetCoordinatesLocalTuple(dm, conesPerRank, NULL((void*)0), &(*coordinatesPerRank)[r]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),125,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
126 | ierr = ISDestroy(&pointsPerRank);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),126,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
127 | ierr = ISDestroy(&conesPerRank);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),127,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
128 | } |
129 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); |
130 | } |
131 | |
132 | static PetscErrorCode PetscSFComputeMultiRootOriginalNumberingByRank_Private(PetscSF sf, PetscSF imsf, PetscInt *irmine1[]) |
133 | { |
134 | PetscInt *mRootsOrigNumbering; |
135 | PetscInt nileaves, niranks; |
136 | const PetscInt *iroffset, *irmine, *degree; |
137 | PetscInt i, n, o, r; |
138 | PetscErrorCode ierr; |
139 | |
140 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ; petscstack->line[petscstack->currentsize] = 140; petscstack ->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack ->currentsize++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0) ; ; } while (0); |
141 | ierr = PetscSFGetGraph(imsf, NULL((void*)0), &nileaves, NULL((void*)0), NULL((void*)0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),141,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
142 | ierr = PetscSFGetRootRanks(imsf, &niranks, NULL((void*)0), &iroffset, &irmine, NULL((void*)0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),142,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
143 | #if defined(PETSC_USE_DEBUG1) |
144 | if (PetscUnlikely(nileaves != iroffset[niranks])__builtin_expect(!!(nileaves != iroffset[niranks]),0)) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_PLIB,"nileaves != iroffset[niranks])")return PetscError(((MPI_Comm)0x44000001),144,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,77,PETSC_ERROR_INITIAL,"nileaves != iroffset[niranks])"); |
145 | #endif |
146 | ierr = PetscSFComputeDegreeBegin(sf, °ree);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),146,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
147 | ierr = PetscSFComputeDegreeEnd(sf, °ree);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),147,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
148 | ierr = PetscSFComputeMultiRootOriginalNumbering(sf, degree, NULL((void*)0), &mRootsOrigNumbering);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),148,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
149 | ierr = PetscMalloc1(nileaves, irmine1)PetscMallocA(1,PETSC_FALSE,149,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,(size_t)(nileaves)*sizeof(**(irmine1)),(irmine1));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),149,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
150 | for (r=0; r<niranks; r++) { |
151 | o = iroffset[r]; |
152 | n = iroffset[r+1] - o; |
153 | for (i=0; i<n; i++) (*irmine1)[o+i] = mRootsOrigNumbering[irmine[o+i]]; |
154 | } |
155 | ierr = PetscFree(mRootsOrigNumbering)((*PetscTrFree)((void*)(mRootsOrigNumbering),155,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ) || ((mRootsOrigNumbering) = 0,0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),155,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
156 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); |
157 | } |
158 | |
159 | /*@ |
160 | DMPlexCheckConesConformOnInterfaces - Check that points on inter-partition interfaces have conforming order of cone points. |
161 | For example, if there is an edge (rank,index)=(0,2) connecting points cone(0,2)=[(0,0),(0,1)] in this order, and the point SF containts connections 0 <- (1,0), 1 <- (1,1) and 2 <- (1,2), |
162 | then this check would pass if the edge (1,2) has cone(1,2)=[(1,0),(1,1)]. By contrast, if cone(1,2)=[(1,1),(1,0)], then this check would fail. |
163 | |
164 | Input Parameters: |
165 | . dm - The DMPlex object |
166 | |
167 | Note: This is mainly intended for debugging/testing purposes. Does not check cone orientation, for this purpose use DMPlexCheckFaces(). |
168 | |
169 | Developer Note: Interface cones are expanded into vertices and then their coordinates are compared. |
170 | |
171 | Level: developer |
172 | |
173 | .seealso: DMPlexGetCone(), DMPlexGetConeSize(), DMGetPointSF(), DMGetCoordinates(), DMPlexCheckFaces(), DMPlexCheckPointSF(), DMPlexCheckSymmetry(), DMPlexCheckSkeleton() |
174 | @*/ |
175 | PetscErrorCode DMPlexCheckConesConformOnInterfaces(DM dm) |
176 | { |
177 | PetscSF sf; |
178 | PetscInt nleaves, nranks, nroots; |
179 | const PetscInt *mine, *roffset, *rmine, *rremote; |
180 | const PetscSFNode *remote; |
181 | const PetscMPIInt *ranks; |
182 | PetscSF msf, imsf; |
183 | PetscInt nileaves, niranks; |
184 | const PetscMPIInt *iranks; |
185 | const PetscInt *iroffset, *irmine, *irremote; |
186 | PetscInt *rmine1, *rremote1; /* rmine and rremote copies simultaneously sorted by rank and rremote */ |
187 | PetscInt *mine_orig_numbering; |
188 | Vec *sntCoordinatesPerRank; |
189 | Vec *refCoordinatesPerRank; |
190 | Vec *recCoordinatesPerRank=0; |
191 | PetscInt r; |
192 | PetscMPIInt commsize, myrank; |
193 | PetscBool same; |
194 | PetscBool verbose=PETSC_FALSE; |
195 | MPI_Comm comm; |
196 | PetscErrorCode ierr; |
197 | |
198 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ; petscstack->line[petscstack->currentsize] = 198; petscstack ->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack ->currentsize++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0) ; ; } while (0); |
199 | PetscValidHeaderSpecific(dm, DM_CLASSID, 1)do { if (!dm) return PetscError(((MPI_Comm)0x44000001),199,__func__ ,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if ( !PetscCheckPointer(dm,PETSC_OBJECT)) return PetscError(((MPI_Comm )0x44000001),199,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d" ,1); if (((PetscObject)(dm))->classid != DM_CLASSID) { if ( ((PetscObject)(dm))->classid == -1) return PetscError(((MPI_Comm )0x44000001),199,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d" ,1); else return PetscError(((MPI_Comm)0x44000001),199,__func__ ,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d" ,1); } } while (0); |
200 | ierr = PetscObjectGetComm((PetscObject)dm, &comm);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),200,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
201 | ierr = MPI_Comm_rank(comm, &myrank);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),201,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
202 | ierr = MPI_Comm_size(comm, &commsize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),202,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
203 | if (commsize < 2) PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); |
204 | ierr = DMGetPointSF(dm, &sf);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),204,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
205 | if (!sf) PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); |
206 | ierr = PetscSFGetGraph(sf, &nroots, &nleaves, &mine, &remote);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),206,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
207 | if (nroots < 0) PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); |
208 | if (!dm->coordinates && !dm->coordinatesLocal) SETERRQ(PetscObjectComm((PetscObject)dm), PETSC_ERR_ARG_WRONGSTATE, "DM coordinates must be set")return PetscError(PetscObjectComm((PetscObject)dm),208,__func__ ,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,73,PETSC_ERROR_INITIAL,"DM coordinates must be set"); |
209 | ierr = PetscSFSetUp(sf);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),209,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
210 | ierr = PetscSFGetRootRanks(sf, &nranks, &ranks, &roffset, &rmine, &rremote);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),210,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
211 | |
212 | /* Expand sent cones per rank */ |
213 | ierr = SortByRemote_Private(sf, &rmine1, &rremote1);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),213,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
214 | ierr = GetRecursiveConeCoordinatesPerRank_Private(dm, sf, rmine1, &sntCoordinatesPerRank);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),214,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
215 | |
216 | /* Create inverse SF */ |
217 | ierr = PetscSFGetMultiSF(sf,&msf);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),217,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
218 | ierr = PetscSFCreateInverseSF(msf,&imsf);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),218,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
219 | ierr = PetscSFSetUp(imsf);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),219,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
220 | ierr = PetscSFGetGraph(imsf, NULL((void*)0), &nileaves, NULL((void*)0), NULL((void*)0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),220,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
221 | ierr = PetscSFGetRootRanks(imsf, &niranks, &iranks, &iroffset, &irmine, &irremote);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),221,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
222 | |
223 | /* Compute original numbering of multi-roots (referenced points) */ |
224 | ierr = PetscSFComputeMultiRootOriginalNumberingByRank_Private(sf, imsf, &mine_orig_numbering);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),224,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
225 | |
226 | /* Expand coordinates of the referred cones per rank */ |
227 | ierr = GetRecursiveConeCoordinatesPerRank_Private(dm, imsf, mine_orig_numbering, &refCoordinatesPerRank);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),227,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
228 | |
229 | /* Send the coordinates */ |
230 | ierr = ExchangeVecByRank_Private((PetscObject)sf, nranks, ranks, sntCoordinatesPerRank, niranks, iranks, &recCoordinatesPerRank);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),230,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
231 | |
232 | /* verbose output */ |
233 | ierr = PetscOptionsGetBool(((PetscObject)dm)->options, ((PetscObject)dm)->prefix, "-dm_plex_check_cones_conform_on_interfaces_verbose", &verbose, NULL((void*)0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),233,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
234 | if (verbose) { |
235 | PetscViewer v = PETSC_VIEWER_STDOUT_SELFPETSC_VIEWER_STDOUT_(((MPI_Comm)0x44000001)); |
236 | ierr = PetscSequentialPhaseBegin(comm,1);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),236,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
237 | if (!myrank) {ierr = PetscViewerASCIIPrintf(v, "============\nDMPlexCheckConesConformOnInterfaces output\n============\n");} |
238 | ierr = PetscViewerASCIIPrintf(v, "[%d] --------\n", myrank); |
239 | for (r=0; r<nranks; r++) { |
240 | ierr = PetscViewerASCIIPrintf(v, " r=%D ranks[r]=%d sntCoordinatesPerRank[r]:\n", r, ranks[r]); |
241 | ierr = PetscViewerASCIIPushTab(v); |
Value stored to 'ierr' is never read | |
242 | ierr = VecView(sntCoordinatesPerRank[r], v);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),242,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
243 | ierr = PetscViewerASCIIPopTab(v); |
244 | } |
245 | ierr = PetscViewerASCIIPrintf(v, " ----------\n"); |
246 | for (r=0; r<niranks; r++) { |
247 | ierr = PetscViewerASCIIPrintf(v, " r=%D iranks[r]=%d refCoordinatesPerRank[r]:\n", r, iranks[r]); |
248 | ierr = PetscViewerASCIIPushTab(v); |
249 | ierr = VecView(refCoordinatesPerRank[r], v);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),249,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
250 | ierr = PetscViewerASCIIPopTab(v); |
251 | } |
252 | ierr = PetscViewerASCIIPrintf(v, " ----------\n"); |
253 | for (r=0; r<niranks; r++) { |
254 | ierr = PetscViewerASCIIPrintf(v, " r=%D iranks[r]=%d recCoordinatesPerRank[r]:\n", r, iranks[r]); |
255 | ierr = PetscViewerASCIIPushTab(v); |
256 | ierr = VecView(recCoordinatesPerRank[r], v);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),256,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
257 | ierr = PetscViewerASCIIPopTab(v); |
258 | } |
259 | ierr = PetscSequentialPhaseEnd(comm,1);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),259,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
260 | } |
261 | |
262 | /* Compare recCoordinatesPerRank with refCoordinatesPerRank */ |
263 | for (r=0; r<niranks; r++) { |
264 | ierr = VecEqual(refCoordinatesPerRank[r], recCoordinatesPerRank[r], &same);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),264,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
265 | if (!same) SETERRQ1(PETSC_COMM_SELF, PETSC_ERR_PLIB, "interface cones do not conform for remote rank %d", iranks[r])return PetscError(((MPI_Comm)0x44000001),265,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,77,PETSC_ERROR_INITIAL,"interface cones do not conform for remote rank %d" ,iranks[r]); |
266 | } |
267 | |
268 | /* destroy sent stuff */ |
269 | for (r=0; r<nranks; r++) { |
270 | ierr = VecDestroy(&sntCoordinatesPerRank[r]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),270,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
271 | } |
272 | ierr = PetscFree(sntCoordinatesPerRank)((*PetscTrFree)((void*)(sntCoordinatesPerRank),272,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ) || ((sntCoordinatesPerRank) = 0,0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),272,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
273 | ierr = PetscFree2(rmine1, rremote1)PetscFreeA(2,273,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,&(rmine1),&(rremote1));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),273,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
274 | ierr = PetscSFDestroy(&imsf);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),274,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
275 | |
276 | /* destroy referenced stuff */ |
277 | for (r=0; r<niranks; r++) { |
278 | ierr = VecDestroy(&refCoordinatesPerRank[r]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),278,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
279 | } |
280 | ierr = PetscFree(refCoordinatesPerRank)((*PetscTrFree)((void*)(refCoordinatesPerRank),280,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ) || ((refCoordinatesPerRank) = 0,0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),280,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
281 | ierr = PetscFree(mine_orig_numbering)((*PetscTrFree)((void*)(mine_orig_numbering),281,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ) || ((mine_orig_numbering) = 0,0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),281,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
282 | |
283 | /* destroy received stuff */ |
284 | for (r=0; r<niranks; r++) { |
285 | ierr = VecDestroy(&recCoordinatesPerRank[r]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),285,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
286 | } |
287 | ierr = PetscFree(recCoordinatesPerRank)((*PetscTrFree)((void*)(recCoordinatesPerRank),287,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ) || ((recCoordinatesPerRank) = 0,0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),287,__func__,"/sandbox/petsc/petsc.next/src/dm/impls/plex/plexcheckinterface.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
288 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); |
289 | } |