Unwanted output while meshing a Sphere with mshr
See report at https://bitbucket.org/fenics-project/dolfin/issues/690.
Comments (10)
-
-
I've filed a CGAL bug here.
As a workaround, since all the output from CGAL goes to
std::cerr
, one could just pipe that somewhere else, e.g.,python create_mesh.py 2> /dev/null
-
Not sure if the CGAL guys consider this a bug. The problem with turning off the output is that it since the meshing often takes time, the program appears to hang. For a fix in CGAL to be usefull, we need to be able set the stream (not only control the verbosity), so we can send it through the dolfin streams. It should, however, be possible to fix this in mshr, by turning of the output from CGAL and, while the mesh is being genereted, output from a separate thread through the dolfin streams. The "outputting thread" could query the triangulation object where the mesh is being generated for eg. the number of cells, so the user can see that the mesh generation is progressing. (This would also avoid the performance penalty that the outputting from the same thread represents)
-
They do have
set_verbosity(...)
in other places, so I thought they might add it there. If you have anything to say (-> output streams), it's probably best done over there. -
Ah, good point. I'll take a look and see if we can fix it on our side now.
-
Work on outputting to dolfin streams from a separate thread. Seems to work, but needs some polishing. Ref issue
#52.→ <<cset 7ee86f69c190>>
-
Minor polishing of output. Ref issue
#52.→ <<cset 08677746f862>>
-
Use a std::timexd_mutex instead of sleep. Allows to return immediately when the mesh generation is done. Ref issue
#52.→ <<cset b34f761b745b>>
-
- changed status to resolved
I have pushed a fix for this now. In order to be responsive during the (possibly) time consuming mesh generation a separate thread queries the triangulation and outputs the current number of cells and vertices. I have looked into the CGAL code and believe this is thread safe. Please reopen or register a new issue if you experience any problems with this.
The progress during mesh generation is reported with log level PROGRESS which means it is turned off by default.
(As a nice side effect, I have experienced ~10% speed up since the debug output from CGAL that used to be enabled is pretty expensive to compute)
-
Thumbs up!
- Log in to comment
I agree, it annoying. I'll try to find a solution that uses the dolfin streams.