Lines Matching refs:PetscCall
30 …PetscCall(PetscOptionsBool("-compare_is", "Compare ISs and PetscSections?", FILENAME, options->com… in ProcessOptions()
31 …PetscCall(PetscOptionsBool("-compare_dm", "Compare DMs?", FILENAME, options->compare_dm, &options-… in ProcessOptions()
32 …PetscCall(PetscStrncpy(options->partitioning, MATPARTITIONINGPARMETIS, sizeof(options->partitionin… in ProcessOptions()
33 …PetscCall(PetscOptionsString("-partitioning", "The mat partitioning type to test", "None", options… in ProcessOptions()
34 …PetscCall(PetscOptionsBool("-repartition", "Partition again after the first partition?", FILENAME,… in ProcessOptions()
36 PetscCall(PetscStrncpy(options->repartitioning, MATPARTITIONINGPARMETIS, 64)); in ProcessOptions()
37 …PetscCall(PetscOptionsString("-repartitioning", "The mat partitioning type to test (second partiti… in ProcessOptions()
41 …PetscCall(PetscOptionsBool("-tpweight", "Use target partition weights", FILENAME, options->tpw, &o… in ProcessOptions()
58 PetscCall(DMCreate(comm, dm)); in CreateMesh()
59 PetscCall(DMSetType(*dm, DMPLEX)); in CreateMesh()
60 PetscCall(DMPlexDistributeSetDefault(*dm, PETSC_FALSE)); in CreateMesh()
61 PetscCall(DMSetFromOptions(*dm)); in CreateMesh()
62 PetscCall(DMViewFromOptions(*dm, NULL, "-dm_view")); in CreateMesh()
82 PetscCall(PetscInitialize(&argc, &argv, NULL, help)); in main()
85 PetscCall(ProcessOptions(comm, &user)); in main()
86 PetscCall(CreateMesh(comm, &user, &dm1)); in main()
87 PetscCall(CreateMesh(comm, &user, &dm2)); in main()
92 PetscCall(PetscSectionCreate(comm, &tpws)); in main()
93 PetscCall(PetscSectionSetChart(tpws, 0, size)); in main()
96 PetscCall(PetscSectionSetDof(tpws, i, tdof)); in main()
99 …PetscCall(PetscStrncmp(user.partitioning, PETSCPARTITIONERPTSCOTCH, sizeof(PETSCPARTITIONERPTSCOTC… in main()
101 PetscCall(PetscSectionSetDof(tpws, 0, 0)); in main()
103 PetscCall(PetscSectionSetUp(tpws)); in main()
107 PetscCall(ScotchResetRandomSeed()); in main()
108 PetscCall(DMPlexGetPartitioner(dm1, &part1)); in main()
109 PetscCall(PetscObjectSetOptionsPrefix((PetscObject)part1, "p1_")); in main()
110 PetscCall(PetscPartitionerSetType(part1, user.partitioning)); in main()
111 PetscCall(PetscPartitionerSetFromOptions(part1)); in main()
112 PetscCall(PetscSectionCreate(comm, &s1)); in main()
113 PetscCall(PetscPartitionerDMPlexPartition(part1, dm1, tpws, s1, &is1)); in main()
116 PetscCall(ScotchResetRandomSeed()); in main()
117 PetscCall(DMPlexGetPartitioner(dm2, &part2)); in main()
118 PetscCall(PetscObjectSetOptionsPrefix((PetscObject)part2, "p2_")); in main()
119 PetscCall(PetscPartitionerSetType(part2, PETSCPARTITIONERMATPARTITIONING)); in main()
120 PetscCall(PetscPartitionerMatPartitioningGetMatPartitioning(part2, &mp)); in main()
121 PetscCall(MatPartitioningSetType(mp, user.partitioning)); in main()
122 PetscCall(PetscPartitionerSetFromOptions(part2)); in main()
123 PetscCall(PetscSectionCreate(comm, &s2)); in main()
124 PetscCall(PetscPartitionerDMPlexPartition(part2, dm2, tpws, s2, &is2)); in main()
126 PetscCall(ISOnComm(is1, comm, PETSC_USE_POINTER, &is1g)); in main()
127 PetscCall(ISOnComm(is2, comm, PETSC_USE_POINTER, &is2g)); in main()
128 PetscCall(ISViewFromOptions(is1g, NULL, "-seq_is1_view")); in main()
129 PetscCall(ISViewFromOptions(is2g, NULL, "-seq_is2_view")); in main()
132 PetscCall(ISEqualUnsorted(is1g, is2g, &flg)); in main()
133 …if (!flg) PetscCall(PetscPrintf(comm, "ISs are not equal with type %s with size %d.\n", user.parti… in main()
135 PetscCall(ISDestroy(&is1g)); in main()
136 PetscCall(ISDestroy(&is2g)); in main()
139 PetscCall(PetscSectionViewFromOptions(s1, NULL, "-seq_s1_view")); in main()
140 PetscCall(PetscSectionViewFromOptions(s2, NULL, "-seq_s2_view")); in main()
142 PetscCall(PetscSectionCompare(s1, s2, &flg)); in main()
143 …if (!flg) PetscCall(PetscPrintf(comm, "PetscSections are not equal with %s with size %d.\n", user.… in main()
147 PetscCall(ScotchResetRandomSeed()); in main()
148 PetscCall(DMPlexDistribute(dm1, 0, NULL, &dmdist1)); in main()
149 PetscCall(ScotchResetRandomSeed()); in main()
150 PetscCall(DMPlexDistribute(dm2, 0, NULL, &dmdist2)); in main()
153 PetscCall(PetscSectionDestroy(&tpws)); in main()
154 PetscCall(PetscSectionDestroy(&s1)); in main()
155 PetscCall(PetscSectionDestroy(&s2)); in main()
156 PetscCall(ISDestroy(&is1)); in main()
157 PetscCall(ISDestroy(&is2)); in main()
158 PetscCall(DMDestroy(&dm1)); in main()
159 PetscCall(DMDestroy(&dm2)); in main()
164 PetscCall(DMViewFromOptions(dmdist1, NULL, "-dm_dist1_view")); in main()
165 PetscCall(DMViewFromOptions(dmdist2, NULL, "-dm_dist2_view")); in main()
169 PetscCall(DMPlexEqual(dmdist1, dmdist2, &flg)); in main()
170 …if (!flg) PetscCall(PetscPrintf(comm, "Distributed DMs are not equal %s with size %d.\n", user.par… in main()
177 PetscCall(PetscSectionCreate(comm, &tpws)); in main()
178 PetscCall(PetscSectionSetChart(tpws, 0, size)); in main()
181 PetscCall(PetscSectionSetDof(tpws, i, tdof)); in main()
183 PetscCall(PetscSectionSetUp(tpws)); in main()
187 PetscCall(ScotchResetRandomSeed()); in main()
188 PetscCall(DMPlexGetPartitioner(dmdist1, &part1)); in main()
189 PetscCall(PetscObjectSetOptionsPrefix((PetscObject)part1, "dp1_")); in main()
190 PetscCall(PetscPartitionerSetType(part1, user.repartitioning)); in main()
191 PetscCall(PetscPartitionerSetFromOptions(part1)); in main()
192 PetscCall(PetscSectionCreate(comm, &s1)); in main()
193 PetscCall(PetscPartitionerDMPlexPartition(part1, dmdist1, tpws, s1, &is1)); in main()
196 PetscCall(ScotchResetRandomSeed()); in main()
197 PetscCall(DMPlexGetPartitioner(dmdist2, &part2)); in main()
198 PetscCall(PetscObjectSetOptionsPrefix((PetscObject)part2, "dp2_")); in main()
199 PetscCall(PetscPartitionerSetType(part2, PETSCPARTITIONERMATPARTITIONING)); in main()
200 PetscCall(PetscPartitionerMatPartitioningGetMatPartitioning(part2, &mp)); in main()
201 PetscCall(MatPartitioningSetType(mp, user.repartitioning)); in main()
202 PetscCall(PetscPartitionerSetFromOptions(part2)); in main()
203 PetscCall(PetscSectionCreate(comm, &s2)); in main()
204 PetscCall(PetscPartitionerDMPlexPartition(part2, dmdist2, tpws, s2, &is2)); in main()
207 PetscCall(ISOnComm(is1, comm, PETSC_USE_POINTER, &is1g)); in main()
208 PetscCall(ISOnComm(is2, comm, PETSC_USE_POINTER, &is2g)); in main()
209 PetscCall(ISViewFromOptions(is1g, NULL, "-dist_is1_view")); in main()
210 PetscCall(ISViewFromOptions(is2g, NULL, "-dist_is2_view")); in main()
212 PetscCall(ISEqualUnsorted(is1g, is2g, &flg)); in main()
213 …if (!flg) PetscCall(PetscPrintf(comm, "Distributed ISs are not equal, with %s with size %d.\n", us… in main()
215 PetscCall(ISDestroy(&is1g)); in main()
216 PetscCall(ISDestroy(&is2g)); in main()
219 PetscCall(PetscSectionViewFromOptions(s1, NULL, "-dist_s1_view")); in main()
220 PetscCall(PetscSectionViewFromOptions(s2, NULL, "-dist_s2_view")); in main()
222 PetscCall(PetscSectionCompare(s1, s2, &flg)); in main()
223 …if (!flg) PetscCall(PetscPrintf(comm, "Distributed PetscSections are not equal, with %s with size … in main()
227 PetscCall(ScotchResetRandomSeed()); in main()
228 PetscCall(DMPlexDistribute(dmdist1, 0, NULL, &dm1)); in main()
229 PetscCall(ScotchResetRandomSeed()); in main()
230 PetscCall(DMPlexDistribute(dmdist2, 0, NULL, &dm2)); in main()
233 PetscCall(DMPlexIsInterpolated(dm1, &interp)); in main()
235 PetscCall(DMPlexEqual(dm1, dm2, &flg)); in main()
236 …if (!flg) PetscCall(PetscPrintf(comm, "Redistributed DMs are not equal, with %s with size %d.\n", … in main()
240 PetscCall(PetscSectionDestroy(&tpws)); in main()
241 PetscCall(PetscSectionDestroy(&s1)); in main()
242 PetscCall(PetscSectionDestroy(&s2)); in main()
243 PetscCall(ISDestroy(&is1)); in main()
244 PetscCall(ISDestroy(&is2)); in main()
245 PetscCall(DMDestroy(&dm1)); in main()
246 PetscCall(DMDestroy(&dm2)); in main()
247 PetscCall(DMDestroy(&dmdist1)); in main()
248 PetscCall(DMDestroy(&dmdist2)); in main()
249 PetscCall(PetscFinalize()); in main()