Lines Matching refs:sf

6 static PetscErrorCode CheckGraphNotSet(PetscSF sf)  in CheckGraphNotSet()  argument
13 PetscCheck(!sf->graphset, PETSC_COMM_SELF, PETSC_ERR_PLIB, "SF graph is set"); in CheckGraphNotSet()
14 PetscCall(PetscSFGetGraph(sf, &nroots, &nleaves, &ilocal, &iremote)); in CheckGraphNotSet()
19 …PetscCheck(sf->minleaf == PETSC_INT_MAX, PETSC_COMM_SELF, PETSC_ERR_PLIB, "SF minimum leaf is not … in CheckGraphNotSet()
20 …PetscCheck(sf->maxleaf == PETSC_INT_MIN, PETSC_COMM_SELF, PETSC_ERR_PLIB, "SF minimum leaf is not … in CheckGraphNotSet()
24 static PetscErrorCode CheckGraphEmpty(PetscSF sf) in CheckGraphEmpty() argument
32 PetscCall(PetscSFGetGraph(sf, &nroots, &nleaves, &ilocal, &iremote)); in CheckGraphEmpty()
37 PetscCall(PetscSFGetLeafRange(sf, &minleaf, &maxleaf)); in CheckGraphEmpty()
43 static PetscErrorCode CheckRanksNotSet(PetscSF sf) in CheckRanksNotSet() argument
46 PetscCheck(sf->nranks == -1, PETSC_COMM_SELF, PETSC_ERR_PLIB, "SF ranks are set"); in CheckRanksNotSet()
47 PetscCheck(sf->ranks == NULL, PETSC_COMM_SELF, PETSC_ERR_PLIB, "SF ranks are set"); in CheckRanksNotSet()
51 static PetscErrorCode CheckRanksEmpty(PetscSF sf) in CheckRanksEmpty() argument
54 PetscCheck(sf->nranks == 0, PETSC_COMM_SELF, PETSC_ERR_PLIB, "SF ranks not empty"); in CheckRanksEmpty()
60 PetscSF sf, sfDup, sfInv, sfEmbed, sfA, sfB, sfBA; in main() local
68 PetscCall(PetscSFCreate(PETSC_COMM_WORLD, &sf)); in main()
69 PetscCall(CheckGraphNotSet(sf)); in main()
70 PetscCall(PetscSFDestroy(&sf)); in main()
72 PetscCall(PetscSFCreate(PETSC_COMM_WORLD, &sf)); in main()
73 PetscCall(CheckGraphNotSet(sf)); in main()
74 PetscCall(PetscSFReset(sf)); in main()
75 PetscCall(CheckGraphNotSet(sf)); in main()
76 PetscCall(PetscSFDestroy(&sf)); in main()
78 PetscCall(PetscSFCreate(PETSC_COMM_WORLD, &sf)); in main()
79 PetscCall(CheckGraphNotSet(sf)); in main()
80 PetscCall(PetscSFSetType(sf, sftype)); in main()
81 PetscCall(CheckGraphNotSet(sf)); in main()
82 PetscCall(PetscSFDestroy(&sf)); in main()
84 PetscCall(PetscSFCreate(PETSC_COMM_WORLD, &sf)); in main()
85 PetscCall(CheckGraphNotSet(sf)); in main()
86 PetscCall(PetscSFSetType(sf, sftype)); in main()
87 PetscCall(CheckGraphNotSet(sf)); in main()
88 PetscCall(PetscSFReset(sf)); in main()
89 PetscCall(CheckGraphNotSet(sf)); in main()
90 PetscCall(PetscSFDestroy(&sf)); in main()
92 PetscCall(PetscSFCreate(PETSC_COMM_WORLD, &sf)); in main()
93 PetscCall(PetscSFSetGraph(sf, 0, 0, NULL, PETSC_COPY_VALUES, NULL, PETSC_COPY_VALUES)); in main()
94 PetscCall(CheckGraphEmpty(sf)); in main()
95 PetscCall(PetscSFReset(sf)); in main()
96 PetscCall(CheckGraphNotSet(sf)); in main()
97 PetscCall(PetscSFDestroy(&sf)); in main()
99 PetscCall(PetscSFCreate(PETSC_COMM_WORLD, &sf)); in main()
100 PetscCall(PetscSFSetType(sf, sftype)); in main()
101 PetscCall(PetscSFSetGraph(sf, 0, 0, NULL, PETSC_COPY_VALUES, NULL, PETSC_COPY_VALUES)); in main()
102 PetscCall(CheckGraphEmpty(sf)); in main()
103 PetscCall(PetscSFReset(sf)); in main()
104 PetscCall(CheckGraphNotSet(sf)); in main()
105 PetscCall(PetscSFDestroy(&sf)); in main()
108 PetscCall(PetscSFCreate(PETSC_COMM_WORLD, &sf)); in main()
109 PetscCall(CheckRanksNotSet(sf)); in main()
110 PetscCall(PetscSFSetGraph(sf, 0, 0, NULL, PETSC_COPY_VALUES, NULL, PETSC_COPY_VALUES)); in main()
111 PetscCall(CheckRanksNotSet(sf)); in main()
112 PetscCall(PetscSFSetUp(sf)); in main()
113 PetscCall(CheckRanksEmpty(sf)); in main()
114 PetscCall(PetscSFDestroy(&sf)); in main()
117 PetscCall(PetscSFCreate(PETSC_COMM_WORLD, &sf)); in main()
118 PetscCall(PetscSFSetGraph(sf, 0, 0, NULL, PETSC_COPY_VALUES, NULL, PETSC_COPY_VALUES)); in main()
119 PetscCall(PetscSFSetUp(sf)); in main()
120 PetscCall(PetscSFReset(sf)); in main()
121 PetscCall(CheckRanksNotSet(sf)); in main()
122 PetscCall(PetscSFDestroy(&sf)); in main()
125 PetscCall(PetscSFCreate(PETSC_COMM_WORLD, &sf)); in main()
126 PetscCall(PetscSFView(sf, NULL)); in main()
127 PetscCall(PetscSFDestroy(&sf)); in main()
130 PetscCall(PetscSFCreate(PETSC_COMM_WORLD, &sf)); in main()
131 PetscCall(PetscSFSetGraph(sf, 0, 0, NULL, PETSC_COPY_VALUES, NULL, PETSC_COPY_VALUES)); in main()
132 PetscCall(PetscSFView(sf, NULL)); in main()
133 PetscCall(PetscSFDestroy(&sf)); in main()
136 PetscCall(PetscSFCreate(PETSC_COMM_WORLD, &sf)); in main()
137 PetscCall(PetscSFSetType(sf, sftype)); in main()
138 PetscCall(PetscSFView(sf, NULL)); in main()
139 PetscCall(PetscSFDestroy(&sf)); in main()
142 PetscCall(PetscSFCreate(PETSC_COMM_WORLD, &sf)); in main()
143 PetscCall(PetscSFSetType(sf, sftype)); in main()
144 PetscCall(PetscSFSetGraph(sf, 0, 0, NULL, PETSC_COPY_VALUES, NULL, PETSC_COPY_VALUES)); in main()
145 PetscCall(PetscSFView(sf, NULL)); in main()
146 PetscCall(PetscSFDestroy(&sf)); in main()
149 PetscCall(PetscSFCreate(PETSC_COMM_WORLD, &sf)); in main()
150 PetscCall(PetscSFSetGraph(sf, 0, 0, NULL, PETSC_COPY_VALUES, NULL, PETSC_COPY_VALUES)); in main()
151 PetscCall(PetscSFSetType(sf, sftype)); in main()
152 PetscCall(CheckGraphEmpty(sf)); in main()
153 PetscCall(PetscSFReset(sf)); in main()
154 PetscCall(CheckGraphNotSet(sf)); in main()
155 PetscCall(PetscSFDestroy(&sf)); in main()
158 PetscCall(PetscSFCreate(PETSC_COMM_WORLD, &sf)); in main()
159 PetscCall(PetscSFSetType(sf, sftype)); in main()
160 PetscCall(PetscSFSetFromOptions(sf)); in main()
161 PetscCall(PetscSFSetGraph(sf, 0, 0, NULL, PETSC_COPY_VALUES, NULL, PETSC_COPY_VALUES)); in main()
162 PetscCall(PetscSFBcastBegin(sf, MPI_INT, NULL, NULL, MPI_REPLACE)); in main()
163 PetscCall(PetscSFBcastEnd(sf, MPI_INT, NULL, NULL, MPI_REPLACE)); in main()
164 PetscCall(PetscSFDestroy(&sf)); in main()
169 PetscCall(PetscSFCreate(PETSC_COMM_WORLD, &sf)); in main()
170 PetscCall(PetscSFSetType(sf, sftype)); in main()
171 PetscCall(PetscSFSetGraph(sf, 0, 0, NULL, PETSC_COPY_VALUES, NULL, PETSC_COPY_VALUES)); in main()
172 PetscCall(PetscSFSetFromOptions(sf)); in main()
173 PetscCall(PetscSFReduceBegin(sf, MPI_INT, NULL, NULL, MPI_REPLACE)); in main()
174 PetscCall(PetscSFReduceEnd(sf, MPI_INT, NULL, NULL, MPI_REPLACE)); in main()
175 PetscCall(PetscSFReduceBegin(sf, MPI_INT, NULL, NULL, MPI_SUM)); in main()
176 PetscCall(PetscSFReduceEnd(sf, MPI_INT, NULL, NULL, MPI_SUM)); in main()
177 PetscCall(PetscSFDestroy(&sf)); in main()
180 PetscCall(PetscSFCreate(PETSC_COMM_WORLD, &sf)); in main()
181 PetscCall(PetscSFSetType(sf, sftype)); in main()
182 PetscCall(PetscSFSetGraph(sf, 0, 0, NULL, PETSC_COPY_VALUES, NULL, PETSC_COPY_VALUES)); in main()
183 PetscCall(PetscSFSetFromOptions(sf)); in main()
184 PetscCall(PetscSFFetchAndOpBegin(sf, MPI_INT, NULL, NULL, NULL, MPI_SUM)); in main()
185 PetscCall(PetscSFFetchAndOpEnd(sf, MPI_INT, NULL, NULL, NULL, MPI_SUM)); in main()
186 PetscCall(PetscSFDestroy(&sf)); in main()
189 PetscCall(PetscSFCreate(PETSC_COMM_WORLD, &sf)); in main()
190 PetscCall(PetscSFSetType(sf, sftype)); in main()
191 PetscCall(PetscSFSetGraph(sf, 0, 0, NULL, PETSC_COPY_VALUES, NULL, PETSC_COPY_VALUES)); in main()
192 PetscCall(PetscSFSetFromOptions(sf)); in main()
193 PetscCall(PetscSFComputeDegreeBegin(sf, &degree)); in main()
194 PetscCall(PetscSFComputeDegreeEnd(sf, &degree)); in main()
195 PetscCall(PetscSFDestroy(&sf)); in main()
198 PetscCall(PetscSFCreate(PETSC_COMM_WORLD, &sf)); in main()
199 PetscCall(PetscSFSetType(sf, sftype)); in main()
200 PetscCall(PetscSFSetGraph(sf, 0, 0, NULL, PETSC_USE_POINTER, NULL, PETSC_USE_POINTER)); in main()
201 PetscCall(PetscSFSetFromOptions(sf)); in main()
202 PetscCall(PetscSFDuplicate(sf, PETSCSF_DUPLICATE_GRAPH, &sfDup)); in main()
205 PetscCall(PetscSFDestroy(&sf)); in main()
208 PetscCall(PetscSFCreate(PETSC_COMM_WORLD, &sf)); in main()
209 PetscCall(PetscSFSetType(sf, sftype)); in main()
210 PetscCall(PetscSFSetGraph(sf, 0, 0, NULL, PETSC_USE_POINTER, NULL, PETSC_USE_POINTER)); in main()
211 PetscCall(PetscSFSetFromOptions(sf)); in main()
212 PetscCall(PetscSFCreateInverseSF(sf, &sfInv)); in main()
215 PetscCall(PetscSFDestroy(&sf)); in main()
218 PetscCall(PetscSFCreate(PETSC_COMM_WORLD, &sf)); in main()
219 PetscCall(PetscSFSetType(sf, sftype)); in main()
220 PetscCall(PetscSFSetGraph(sf, 0, 0, NULL, PETSC_USE_POINTER, NULL, PETSC_USE_POINTER)); in main()
221 PetscCall(PetscSFSetFromOptions(sf)); in main()
222 PetscCall(PetscSFCreateEmbeddedRootSF(sf, 0, NULL, &sfEmbed)); in main()
225 PetscCall(PetscSFDestroy(&sf)); in main()
228 PetscCall(PetscSFCreate(PETSC_COMM_WORLD, &sf)); in main()
229 PetscCall(PetscSFSetType(sf, sftype)); in main()
230 PetscCall(PetscSFSetGraph(sf, 0, 0, NULL, PETSC_USE_POINTER, NULL, PETSC_USE_POINTER)); in main()
231 PetscCall(PetscSFSetFromOptions(sf)); in main()
232 PetscCall(PetscSFCreateEmbeddedLeafSF(sf, 0, NULL, &sfEmbed)); in main()
235 PetscCall(PetscSFDestroy(&sf)); in main()