cgg-bern / AlgoHex

GNU Affero General Public License v3.0
16 stars 5 forks source link

Time elapsed in example #19

Open mottelet opened 1 month ago

mottelet commented 1 month ago

Hello,

I have succeeded building algoHex and I have the following output/elapsed time for the proposed example in the build instructions (./Build/bin/HexMeshing -i ../demo/HexMeshing/cylinder.ovm -o /path/to/cylinder_hex.ovm). Soes it seem ok ? How can I visualize cylinder_hex.ovm once the computations are done ?

#####Hexmesh volume / tetmesh voluem: 9288.21/9315.11 0.997112
Total time                                      268413 ms, n =     1
├ Field generation                               55435 ms, n =     3
│ ├ SpH Projection                                1293 ms, n =    81
│ ├ Linear system setup                           7337 ms, n =    81
│ │ ├ Smoothness term                             4667 ms, n =    81
│ │ ├ Normal constraints                           573 ms, n =    81
│ │ ├ Full constraints                               2 ms, n =    81
│ │ ├ Local linearisation                         1984 ms, n =    80
│ │ ╰ (unaccounted)                                109 ms
│ ├ Linear system solve                          46309 ms, n =    81
│ ╰ (unaccounted)                                  494 ms
├ Singular graph extraction                        858 ms, n =     1
│ ├ Refine singular region                         671 ms, n =     1
│ ├ Interpolate for cell quaternions                56 ms, n =     1
│ ├ Extract singular edges                         130 ms, n =     1
│ ╰ (unaccounted)                                    0 ms
├ Locally hexmeshable field generation           35135 ms, n =     1
│ ├ Singular graph repair                         1245 ms, n =    32
│ ├ Singularity relocation                       21065 ms, n =    32
│ │ ├ Split edges                                 1824 ms, n =    32
│ │ ├ Collapse edges                              3456 ms, n =    32
│ │ ├ Swap edges                                  7743 ms, n =    32
│ │ ├ Smooth singular graph                       7148 ms, n =    32
│ │ ├ Split for field alignment DOF                445 ms, n =    32
│ │ ╰ (unaccounted)                                447 ms
│ ├ Check for termination                         4322 ms, n =     1
│ ├ Optimize field locally                        7882 ms, n =    32
│ ├ Optimize field with alignment                 1244 ms, n =     2
│ ├ Save mesh for visualization                     69 ms, n =    33
│ ╰ (unaccounted)                                 -694 ms
├ Post remeshing                                 45208 ms, n =     1
├ FrameField Integrability Optimization          76498 ms, n =     6
├ FrameField Dual Integrability Optimization         0 ms, n =     0
├ Parameterization                               46363 ms, n =     2
├ Hexmesh extraction                              7688 ms, n =     1
╰ (unaccounted)                                   1224 ms
save json data file into 

 Closed: Mon Jun 17 10:31:39 2024
otaolafranc commented 1 month ago

Yes, this is a correct ouput, you can visualize the output using openFlipper https://gitlab.vci.rwth-aachen.de:9000/OpenFlipper-Free/OpenFlipper-Free which supports the ovm output format. the mesh output (cylinder_hex.ovm) should look like this (if everything went smoothly, I have faced problems where algoHex was compiled, but the output was not correct): image

mottelet commented 1 month ago

I looks like this in Scilab:

Screenshot 2024-06-17 at 11 16 50 Screenshot 2024-06-17 at 11 13 49
mheistermann commented 1 month ago

For reference, here's some timing output from my M1 MacBook Pro (built with default settings, i.e., clang in Release mode):

Total time                                       60485 ms, n =     1
├ Field generation                                3201 ms, n =     3
│ ├ SpH Projection                                 539 ms, n =    81
│ ├ Linear system setup                           1247 ms, n =    81
│ │ ├ Smoothness term                              813 ms, n =    81
│ │ ├ Normal constraints                            83 ms, n =    81
│ │ ├ Full constraints                               0 ms, n =    81
│ │ ├ Local linearisation                          340 ms, n =    80
│ │ ╰ (unaccounted)                                 10 ms
│ ├ Linear system solve                           1371 ms, n =    81
│ ╰ (unaccounted)                                   42 ms
├ Singular graph extraction                       1217 ms, n =     1
│ ├ Refine singular region                         324 ms, n =     1
│ ├ Interpolate for cell quaternions               867 ms, n =     1
│ ├ Extract singular edges                          25 ms, n =     1
│ ╰ (unaccounted)                                    0 ms
├ Locally hexmeshable field generation           10760 ms, n =     1
│ ├ Singular graph repair                          320 ms, n =    32
│ ├ Singularity relocation                        6874 ms, n =    32
│ │ ├ Split edges                                  516 ms, n =    32
│ │ ├ Collapse edges                              1054 ms, n =    32
│ │ ├ Swap edges                                  2360 ms, n =    32
│ │ ├ Smooth singular graph                       2620 ms, n =    32
│ │ ├ Split for field alignment DOF                158 ms, n =    32
│ │ ╰ (unaccounted)                                165 ms
│ ├ Check for termination                         1927 ms, n =     1
│ ├ Optimize field locally                        1458 ms, n =    32
│ ├ Optimize field with alignment                  186 ms, n =     2
│ ├ Save mesh for visualization                     14 ms, n =    33
│ ╰ (unaccounted)                                  -19 ms
├ Post remeshing                                 15377 ms, n =     1
├ FrameField Integrability Optimization          13912 ms, n =     6
├ FrameField Dual Integrability Optimization         0 ms, n =     0
├ Parameterization                               11073 ms, n =     2
├ Hexmesh extraction                              4525 ms, n =     1
╰ (unaccounted)                                    416 ms
mottelet commented 1 month ago

Thanks. Does the code uses multithreading ?

S.

mheistermann commented 1 month ago

There is a bit of multithreading in some places using OpenMP, more may be in the ipopt solve depending on backends used. The build that produced the numbers above did not have OpenMP enabled.

What kind of hardware are you running on, and what compiler are you using? Note that a non-release build (e.g. CMAKE_BUILD_TYPE empty or Debug) is significantly slower. For single-configuration cmake generators (e.g. makefiles), Release is default, but if you're using something like MSVC, you may have to manually select a release build in the GUI.

If it helps I can run this on a x86_64 desktop system to get some more easily comparable numbers.

mottelet commented 1 month ago

In the logs I saw that IPopt used mumps, although I had to build it with the coin-hsl library (otherwise AlgoHex does not build). I have compiled AlgoHex on a Linux (CentOS) server with 2 AMD EPYC 7552 48-Core Processor with gcc.

S.

mheistermann commented 1 month ago

Hi! I ran it on the most comparable server we have, with 2 EPYC 7742. For reproducibility, I built it using the Dockerfile in the dev/dockerfile-without-gurobi branch.

#####Hexmesh volume / tetmesh voluem: 9286.71/9314.11 0.997058
Total time                                       88865 ms, n =     1
├ Field generation                                7214 ms, n =     3
│ ├ SpH Projection                                  49 ms, n =    81
│ ├ Linear system setup                           3015 ms, n =    81
│ │ ├ Smoothness term                             1904 ms, n =    81
│ │ ├ Normal constraints                           210 ms, n =    81
│ │ ├ Full constraints                               0 ms, n =    81
│ │ ├ Local linearisation                          875 ms, n =    80
│ │ ╰ (unaccounted)                                 23 ms
│ ├ Linear system solve                           3877 ms, n =    81
│ ╰ (unaccounted)                                  271 ms
├ Singular graph extraction                        588 ms, n =     1
│ ├ Refine singular region                         504 ms, n =     1
│ ├ Interpolate for cell quaternions                25 ms, n =     1
│ ├ Extract singular edges                          58 ms, n =     1
│ ╰ (unaccounted)                                    0 ms
├ Locally hexmeshable field generation           14829 ms, n =     1
│ ├ Singular graph repair                          462 ms, n =    32
│ ├ Singularity relocation                        8865 ms, n =    32
│ │ ├ Split edges                                  754 ms, n =    32
│ │ ├ Collapse edges                              1468 ms, n =    32
│ │ ├ Swap edges                                  2971 ms, n =    32
│ │ ├ Smooth singular graph                       3289 ms, n =    32
│ │ ├ Split for field alignment DOF                211 ms, n =    32
│ │ ╰ (unaccounted)                                170 ms
│ ├ Check for termination                         2330 ms, n =     1
│ ├ Optimize field locally                        2883 ms, n =    32
│ ├ Optimize field with alignment                  382 ms, n =     2
│ ├ Save mesh for visualization                     23 ms, n =    33
│ ╰ (unaccounted)                                 -118 ms
├ Post remeshing                                 19540 ms, n =     1
├ FrameField Integrability Optimization          25712 ms, n =     6
├ FrameField Dual Integrability Optimization         0 ms, n =     0
├ Parameterization                               17018 ms, n =     2
├ Hexmesh extraction                              3262 ms, n =     1
╰ (unaccounted)                                    699 ms

Output from /usr/bin/time -v (information on parallelism):

    Command being timed: "/usr/local/bin/HexMeshing -i /app/demo/HexMeshing/cylinder.ovm"
    User time (seconds): 1795.91
    System time (seconds): 57.68
    Percent of CPU this job got: 2071%
    Elapsed (wall clock) time (h:mm:ss or m:ss): 1:29.48
    Average shared text size (kbytes): 0
    Average unshared data size (kbytes): 0
    Average stack size (kbytes): 0
    Average total size (kbytes): 0
    Maximum resident set size (kbytes): 657108
    Average resident set size (kbytes): 0
    Major (requiring I/O) page faults: 0
    Minor (reclaiming a frame) page faults: 464244
    Voluntary context switches: 2522
    Involuntary context switches: 8954505
    Swaps: 0
    File system inputs: 0
    File system outputs: 3544
    Socket messages sent: 0
    Socket messages received: 0
    Signals delivered: 0
    Page size (bytes): 4096
    Exit status: 0
mottelet commented 1 month ago

Here's what I got just now:

#####Hexmesh volume / tetmesh voluem: 9288.21/9315.11 0.997112
Total time                                      311114 ms, n =     1
├ Field generation                               70001 ms, n =     3
│ ├ SpH Projection                                1967 ms, n =    81
│ ├ Linear system setup                           7641 ms, n =    81
│ │ ├ Smoothness term                             4876 ms, n =    81
│ │ ├ Normal constraints                           582 ms, n =    81
│ │ ├ Full constraints                               2 ms, n =    81
│ │ ├ Local linearisation                         2106 ms, n =    80
│ │ ╰ (unaccounted)                                 74 ms
│ ├ Linear system solve                          59991 ms, n =    81
│ ╰ (unaccounted)                                  401 ms
├ Singular graph extraction                       1207 ms, n =     1
│ ├ Refine singular region                         990 ms, n =     1
│ ├ Interpolate for cell quaternions                56 ms, n =     1
│ ├ Extract singular edges                         160 ms, n =     1
│ ╰ (unaccounted)                                    0 ms
├ Locally hexmeshable field generation           58354 ms, n =     1
│ ├ Singular graph repair                         2395 ms, n =    32
│ ├ Singularity relocation                       31850 ms, n =    32
│ │ ├ Split edges                                 2668 ms, n =    32
│ │ ├ Collapse edges                              4780 ms, n =    32
│ │ ├ Swap edges                                 11869 ms, n =    32
│ │ ├ Smooth singular graph                      11049 ms, n =    32
│ │ ├ Split for field alignment DOF                756 ms, n =    32
│ │ ╰ (unaccounted)                                725 ms
│ ├ Check for termination                         6620 ms, n =     1
│ ├ Optimize field locally                       16293 ms, n =    32
│ ├ Optimize field with alignment                 1215 ms, n =     2
│ ├ Save mesh for visualization                    112 ms, n =    33
│ ╰ (unaccounted)                                 -133 ms
├ Post remeshing                                 63788 ms, n =     1
├ FrameField Integrability Optimization          62949 ms, n =     6
├ FrameField Dual Integrability Optimization         0 ms, n =     0
├ Parameterization                               45502 ms, n =     2
├ Hexmesh extraction                              7346 ms, n =     1
╰ (unaccounted)                                   1965 ms
save json data file into 

 Closed: Tue Jun 18 15:26:33 2024

    Command being timed: "./Build/bin/HexMeshing -i ../demo/HexMeshing/cylinder.ovm -o ./cylinder-hex.ovm"
    User time (seconds): 5889.53
    System time (seconds): 17.64
    Percent of CPU this job got: 1894%
    Elapsed (wall clock) time (h:mm:ss or m:ss): 5:11.85
    Average shared text size (kbytes): 0
    Average unshared data size (kbytes): 0
    Average stack size (kbytes): 0
    Average total size (kbytes): 0
    Maximum resident set size (kbytes): 775736
    Average resident set size (kbytes): 0
    Major (requiring I/O) page faults: 0
    Minor (reclaiming a frame) page faults: 614154
    Voluntary context switches: 473543
    Involuntary context switches: 119049
    Swaps: 0
    File system inputs: 0
    File system outputs: 3656
    Socket messages sent: 0
    Socket messages received: 0
    Signals delivered: 0
    Page size (bytes): 4096
    Exit status: 0