Skip to content

Add MDS adapt option to capVol test #454

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 10 commits into
base: develop
Choose a base branch
from
Draft

Conversation

bobpaw
Copy link
Collaborator

@bobpaw bobpaw commented Sep 13, 2024

Add MDS adapt option to capVol test

  • Add -m flag to convert mesh to MDS during adapt and back to CRE afterward.
  • Use ma::adapt instead of ma::adaptVerbose.
  • Use default ma::Input.
  • Add new cap.* tests that run with MDS.

TODO

  • Tests are taking longer because I'm using ma::adapt instead of ma::adaptVerbose.

Comparison:

test case adapt adaptVerbose adapt+pre-fix
capVolCube 1884.35 sec 149.71 sec 333.62 sec
capVolCubeMds 191.51 sec 27.05 sec 87.63 sec
capVolWing 5963.82 sec 203.11 sec 454.72 sec
capVolWingMds 821.70 sec 56.86 sec 40.10 sec

@bobpaw bobpaw force-pushed the apw/capVol_mds_adapt branch from 5792912 to 537b4e3 Compare November 4, 2024 16:40
@bobpaw bobpaw force-pushed the apw/capVol_mds_adapt branch 2 times, most recently from 3d9c856 to d377593 Compare June 17, 2025 05:10
@bobpaw
Copy link
Collaborator Author

bobpaw commented Jun 19, 2025

Running into problem with empty parts after --fixLargeAngles. Likely related to #198.

@bobpaw
Copy link
Collaborator Author

bobpaw commented Jun 19, 2025

This occurred with the capVol wing case with METIS on 4 procs.

Log for mpirun -np 4 ./capVol -gm 3 wing_surf_only.cre out.cre

Initalization of MetricInterpolation ...
Initalization of MetricInterpolation ...
Threads : 1
Threads : 1
Initalization of MetricInterpolation ...
Initalization of MetricInterpolation ...
Threads : 1Threads : 1

Expiration Date = 2025-8-26
Expiration Date = 2025-8-26
Expiration Date = 2025-8-26
Expiration Date = 2025-8-26
Number of Breps = 1
Number of Breps = 1
Number of Breps = 1
Number of Breps = 1
Loading Data Timer : cpu = 5.924e-03s wall = 7.67e-02s
Loading Data Timer : cpu = 5.807e-03s wall = 7.67e-02s
Loading Data Timer : cpu = 6.076e-03s wall = 7.67e-02s
Loading Data Timer : cpu = 8.435e-03s wall = 7.68e-02s
GenerateNMesh : Num Threads = 1
Number of sources : 12
Generating isotropic proxy
For iteration:0 marked cells:0 out of:1331
Max source number:12
Average source number:2.7408
Sizing Field Timing : cpu = 1.133e-02s wall = 3.69e-01s
Meshing edge 1
Meshing edge 2
Meshing edge 3
Meshing edge 4
Meshing edge 5
Meshing edge 6
Meshing edge 7
Meshing edge 8
Meshing edge 9
Meshing edge 10
Meshing edge 11
Meshing edge 12
Meshing face 1
Meshing face 2
Meshing face 3
Meshing face 4
Meshing face 5
Meshing face 6
Faces Mesher : cpu = 2.343e-02s wall = 2.84e-02s
Meshing region 1
Missing edges:0 over:2010
Iter=0 npoin=672 nelem=2037
Iter=1 npoin=673 nelem=2314
Iter=2 npoin=673 nelem=2314
Iter=0 npoin=673 nelem=2314 nface=1340
Iter=1 npoin=1119 nelem=4466 nface=2356
Iter=2 npoin=1121 nelem=4479 nface=1982
Iter=3 npoin=1153 nelem=4686 nface=1004
Iter=4 npoin=1409 nelem=6245 nface=1472
Iter=5 npoin=1413 nelem=6283 nface=1200
Iter=6 npoin=1449 nelem=6499 nface=636
Iter=7 npoin=1583 nelem=7305 nface=844
Iter=8 npoin=1590 nelem=7348 nface=644
Iter=9 npoin=1615 nelem=7497 nface=374
Iter=10 npoin=1664 nelem=7801 nface=396
Iter=11 npoin=1671 nelem=7847 nface=280
Iter=12 npoin=1682 nelem=7915 nface=188
Iter=13 npoin=1695 nelem=7996 nface=142
Iter=14 npoin=1696 nelem=8014 nface=96
Iter=15 npoin=1697 nelem=8025 nface=44
Iter=16 npoin=1697 nelem=8025 nface=14
Worst quality before optim:2900.75
Average quality before optim:2.46743
Iter=0
Edges swapped:480 over:10376 tried:8366
Elements swapped:0 over:8025 tried:30372
Points optimized:592 over:1025 tried:1023
Iter=1
Edges swapped:53 over:10376 tried:6144
Elements swapped:0 over:8025 tried:25745
Points optimized:233 over:1025 tried:922
Iter=2
Edges swapped:6 over:10376 tried:2891
Elements swapped:0 over:8025 tried:15572
Points optimized:97 over:1025 tried:711
Average quality after optim:1.37659
Worst quality after optim:1.91675
Regions Mesher : cpu = 6.954e-01s wall = 7.30e-01s
Timing(GenerateNMesh) : cpu = 7.310e-01s wall = 1.13e+00s
mesh verified in 0.036884 seconds
METIS: weights are not supported
METIS: partitioned in 0.003553 seconds
METIS: planned in 0.000735 seconds
METIS: split in 0.011952 seconds
mesh expanded from 1 to 4 parts in 0.003679 seconds
mesh migrated from 1 to 4 in 0.051315 seconds
writeVtuFile into buffers: 0.001556 seconds
writeVtuFile buffers to disk: 0.144549 seconds
vtk files before.vtk written in 0.167789 seconds

MeshAdapt: ma::configure: Based on requested sizefield, MeshAdapt requires at least 5 iterations.
Setting the number of iteration to 6!

MeshAdapt: version 2.0 !
METIS: weights are not supported
METIS: localized graph in 0.000232 seconds
METIS: partitioned in 0.004619 seconds
METIS: remapped in 0.000094 seconds
METIS: scattered in 0.000051 seconds
METIS: planned in 0.000422 seconds
METIS: migrated in 0.026521 seconds
METIS: balanced in 0.037136 seconds

MeshAdapt: iteration 0

MeshAdapt: coarsened 538 edges in 0.230906 seconds
METIS: weights are not supported
METIS: localized graph in 0.000538 seconds
METIS: partitioned in 0.002582 seconds
METIS: remapped in 0.000074 seconds
METIS: scattered in 0.000027 seconds
METIS: planned in 0.000142 seconds
METIS: migrated in 0.011190 seconds
METIS: balanced in 0.017814 seconds

MeshAdapt: refined 1603 edges in 0.032561 seconds

MeshAdapt: snapped in 0.000494 seconds: 0 targets, 0 non-layer snaps

MeshAdapt: iteration 1

MeshAdapt: coarsened 458 edges in 0.401182 seconds
METIS: weights are not supported
METIS: localized graph in 0.002649 seconds
METIS: partitioned in 0.005030 seconds
METIS: remapped in 0.000161 seconds
METIS: scattered in 0.000039 seconds
METIS: planned in 0.000228 seconds
METIS: migrated in 0.025560 seconds
METIS: balanced in 0.041595 seconds

MeshAdapt: refined 4695 edges in 0.089507 seconds

MeshAdapt: snapped in 0.000980 seconds: 0 targets, 0 non-layer snaps

MeshAdapt: iteration 2

MeshAdapt: coarsened 1175 edges in 1.189498 seconds
METIS: weights are not supported
METIS: localized graph in 0.009365 seconds
METIS: partitioned in 0.011108 seconds
METIS: remapped in 0.000358 seconds
METIS: scattered in 0.000066 seconds
METIS: planned in 0.000405 seconds
METIS: migrated in 0.083376 seconds
METIS: balanced in 0.138617 seconds

MeshAdapt: refined 10097 edges in 0.209393 seconds

MeshAdapt: snapped in 0.002037 seconds: 0 targets, 0 non-layer snaps

MeshAdapt: iteration 3

MeshAdapt: coarsened 3976 edges in 2.870489 seconds
METIS: weights are not supported
METIS: localized graph in 0.021831 seconds
METIS: partitioned in 0.021483 seconds
METIS: remapped in 0.000682 seconds
METIS: scattered in 0.000094 seconds
METIS: planned in 0.000864 seconds
METIS: migrated in 0.184952 seconds
METIS: balanced in 0.306471 seconds

MeshAdapt: refined 14780 edges in 0.388254 seconds

MeshAdapt: snapped in 0.003598 seconds: 0 targets, 0 non-layer snaps

MeshAdapt: iteration 4

MeshAdapt: coarsened 7300 edges in 4.476811 seconds
METIS: weights are not supported
METIS: localized graph in 0.025776 seconds
METIS: partitioned in 0.036831 seconds
METIS: remapped in 0.001051 seconds
METIS: scattered in 0.000134 seconds
METIS: planned in 0.001526 seconds
METIS: migrated in 0.236706 seconds
METIS: balanced in 0.409361 seconds

MeshAdapt: refined 15780 edges in 0.435036 seconds

MeshAdapt: snapped in 0.004559 seconds: 0 targets, 0 non-layer snaps

MeshAdapt: iteration 5

MeshAdapt: coarsened 10152 edges in 6.280703 seconds
METIS: weights are not supported
METIS: localized graph in 0.029699 seconds
METIS: partitioned in 0.043759 seconds
METIS: remapped in 0.001136 seconds
METIS: scattered in 0.000149 seconds
METIS: planned in 0.002603 seconds
METIS: migrated in 0.268942 seconds
METIS: balanced in 0.477790 seconds

MeshAdapt: refined 8500 edges in 0.299709 seconds

MeshAdapt: snapped in 0.004292 seconds: 0 targets, 0 non-layer snaps

MeshAdapt: --iter 0 of shape correction loop: #bad elements 166453

MeshAdapt: snapped in 0.005070 seconds: 0 targets, 0 non-layer snaps

MeshAdapt: --fixLargeAngles in 9.376438 seconds: #bad elements 174251

MeshAdapt: --fixShortEdgeElements in 217.924783 seconds: #bad elements 78956
METIS: weights are not supported
METIS: localized graph in 0.071383 seconds
METIS: partitioned in 0.025649 seconds
METIS: remapped in 0.001230 seconds
METIS: scattered in 0.000119 seconds
METIS: planned in 0.000415 seconds
METIS: migrated in 0.592544 seconds
METIS: balanced in 0.900624 seconds

MeshAdapt: --percent change in number of bad elements 0.525656

MeshAdapt: --iter 1 of shape correction loop: #bad elements 78956

MeshAdapt: snapped in 0.003536 seconds: 0 targets, 0 non-layer snaps

MeshAdapt: --fixLargeAngles in 4.660544 seconds: #bad elements 78143

MeshAdapt: --fixShortEdgeElements in 123.399546 seconds: #bad elements 37207
METIS: weights are not supported
METIS: localized graph in 0.041078 seconds
METIS: partitioned in 0.014809 seconds
METIS: remapped in 0.000719 seconds
METIS: scattered in 0.000078 seconds
METIS: planned in 0.000419 seconds
METIS: migrated in 0.358449 seconds
METIS: balanced in 0.537830 seconds

MeshAdapt: --percent change in number of bad elements 0.528763

MeshAdapt: --iter 2 of shape correction loop: #bad elements 37207

MeshAdapt: snapped in 0.002259 seconds: 0 targets, 0 non-layer snaps

MeshAdapt: --fixLargeAngles in 2.428371 seconds: #bad elements 35320
APF warning: 1 empty parts
APF warning: 1 empty parts
APF warning: 1 empty parts

MeshAdapt: --fixShortEdgeElements in 71.502453 seconds: #bad elements 16995
METIS: weights are not supported
owned_xadj.size() > 1 failed at /users/woodra/lore/projects/capstone/core-capstone/metis/apfMETISbalancer.cc + 37

===================================================================================
= BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES
= PID 2952076 RUNNING AT trouble.scorec.rpi.edu
= EXIT CODE: 134
= CLEANING UP REMAINING PROCESSES
= YOU CAN IGNORE THE BELOW CLEANUP MESSAGES

YOUR APPLICATION TERMINATED WITH THE EXIT STRING: Aborted (signal 6)
This typically refers to a problem with your application.
Please see the FAQ page for debugging suggestions

@bobpaw
Copy link
Collaborator Author

bobpaw commented Jun 23, 2025

Metis balancing for meshes with empty parts is fixed in #499

@bobpaw bobpaw force-pushed the apw/capVol_mds_adapt branch from cd5cb4b to 18c73b8 Compare June 24, 2025 00:03
bobpaw added 10 commits June 24, 2025 13:18
- Add -m option to convert mesh database to MDS during adaptation. This
  option speeds up adaptation.
- This tests the conversion capability.

Signed-off-by: Aiden Woodruff <[email protected]>
- Replace writeCre with cs.save_file.
- Replace ma::adaptVerbose with ma::adapt (the production version).
- Remove ma::Input arguments which are just reinforcing the defaults.
  - If the defaults chagne we shouldn't force using the old ones.
- Don't delete old mesh model before adapting.
- Change CapstoneModule name.
- Reorder mds mesh after conversion.

Signed-off-by: Aiden Woodruff <[email protected]>
- Disable verify() for non-volume meshes.

Signed-off-by: Aiden Woodruff <[email protected]>
Signed-off-by: Aiden Woodruff <[email protected]>
- gmi_cap.h: add gmi_cap_probe and gmi_cap_load_some functions.
- wrap headers and functions requiring C++ into #ifdef __cplusplus.
- remove using namespace declarations.
- add import with gmodel.
- gmi_cap.cc: add using namespace CreateMG.
- add Geometry namespace to enums (i.e. VERTEX, EDGE, FACE, REGION).
- add gmodel to struct cap_model.
- use reinterpret_cast instead of C-style casts.
- (gmi_cap_start): handle initialization of static
  capstonemodule.
- (gmi_cap_stop): destruct static capstone module.
- (create_cre): uncomment function.
- (gmi_cap_probe): add short overload to just get mesh names.
- add long overload to get model and mesh contents.
- (gmi_register_cap): register create_cre for gmi_load.
- (owned_import): uncomment function.
- (gmi_cap_load): call gmi_cap_load_some with all mesh names.
- (gmi_cap_load_some): add new function to only load specific mesh
  names.
- (gmi_import_cap): add overload to use current geometry.
- replace PCU_ALWAYS_ASSERT with if statement and gmi_fail.
- test/capLoadSome.cc: add utility to test gmi_cap_load_some.
- test/capProbe.cc: add utility to test gmi_cap_probe.
- test/CMakeLists.txt: add capLoadSome and capProbe.

Signed-off-by: Aiden Woodruff <[email protected]>
- gmi_cap/CMakeLists.txt: update link libraries.
- gmi_cap/gmi_cap.h: add function documentation.
- add doxygen group

Signed-off-by: Aiden Woodruff <[email protected]>
- apf_cap/CMakeLists.txt:
- apf_cap/apfCAP.h: move MeshCAP definition to apfCAP.cc.
- add function documentation.
- (hasCAP): new function.
- add copyright notice.
- fix #include guard name.
- remove namespace using declarations.
- forward declare arguments.
- remove unnecessary #includes.
- (createMesh): rename to createCapMesh.
    - similar to loadMdsMesh, etc
- (createCapMesh): add overload using existing gmi_model.
- (getCapNative): add function to replace MeshCAP::getMesh
  functionality.
- test/cap*: replace createMesh with createCapMesh.
- update #includes now that apf_cap doesn't have anything.
- remove using namespace CreateMG::*.
- prefer MDBI/GDBI to long names.
- apf_cap/apfCAP.cc: reorganize #includes.
- add using namespace CreateMG and alias commonly used CreateMG::Mesh
  (which would also conflict with apf::Mesh).
- (hasCAP): add definition.
- (MeshCAP): add class definition from apfCAP.h
- add ownership of mesh database interface in case we use the gmi_model
  createCapMesh.
- (MeshCAP::MeshCAP): use Capstone get_dimension.
- add MeshMG:: namespace where needed.
- light reformatting.
- (createMesh): remove unused function (with non-existent capMesh* type).
- (castEntity): remove unused function.

Signed-off-by: Aiden Woodruff <[email protected]>
- gmi_cap/gmi_cap.h: add gmi_cap_write.
- gmi_cap/gmi_cap.cc (gmi_cap_write): add function to write native
  capstone CRE file.
- apf_cap/apfCAP.h: add createCapMesh with no mesh name to load first
  Capstone mesh model.
- remove trailing whitespace.
- add generateCapMesh to generate meshes.
- add makeEmptyCapMesh for copying.
- add disownCapModel like disownMdsModel.
- apf_cap/apfCAP.cc: add AppProcessor for Functions.
- (MeshCAP): add setupAdjacencies helper and model ownership boolean.
- (MeshCAP::setupAdjacencies): always setup complete adjacencies.
- (MeshCAP::MeshCAP): use setupAdjacencies.
- (MeshCAP::~MeshCAP): only destroy model if owned.
- add new CreateCapMesh, makeEmptyMesh, generateCapMesh, disownCapModel
  function definitions.
- test/capVol: reorganize #includes.
- use exceptions and add new Args class.
- add extensive help text with raw string literal.
- refactor main into functions.
- add before/after vtk flags.
- add flag to force splitter/balancer.
- test/testing.cmake: reduce capVol test cases without new flag.

Signed-off-by: Aiden Woodruff <[email protected]>
- test/capVolSizeFields.h (CylBoundaryLayer): use ma::getBoundingBox
  which does PCU::Max.

Signed-off-by: Aiden Woodruff <[email protected]>
- test/testing.cmake: add parallel capVol cases.

Signed-off-by: Aiden Woodruff <[email protected]>
@bobpaw bobpaw force-pushed the apw/capVol_mds_adapt branch from 18c73b8 to d92206b Compare June 24, 2025 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant