Comments (3)
The problem actually had nothing to do with the "-g" flag or OpenMP or multithreading (whew). Instead the problem occurred when compiled using optimizations (using the the -O1, -O2, or -O3 compiler flags) with GCC.
I removed these flags from the compiler options (currently located in the "setup_gcc.sh" files). This enabled me to go back to using OpenMP, but it still resulted in performance that was roughly 4x slower than before.
For now, using the CLANG compiler instead of GCC seems to totally fix this problem. (The resulting binaries seem to be about 20% faster too.)
Incidentally, I ran valgrind on "filter_mrc" using"
valgrind --tool=memcheck --leak-check=yes --show-reachable=yes --num-callers=20 --track-fds=yes filter_mrc ...
and it did not find any errors. So that does not appear to be the source of the problem. I'll keep playing with valgrind's other tools to see if I can track this down.
It's possible there is a bug in the code, but it also could be a compiler glitch. (It would not be the first time I encountered one in gcc.) For now, I'm going to paper-over this problem by moving to CLANG.
from visfd.
More thorough checking with other valgrind tools failed to discover any problems. Perhaps this is copping out, but I'm leaning towards calling this a bug in GCC optimization. (Again, it would not be the first glitch I've run into with GCC. The old pre-3.0 compilers were a nightmare.) Either way, it would be nice if this code worked on all compilers. If I have time, I'll try tinkering with the code in "ClusterConnected()" to try and coax this code into behaving nicely with GCC. For now, use CLANG.
from visfd.
Since upgrading my compiler from gcc version 7.5 to gcc 9.3, this problem seems to have mysteriously corrected itself.
(Incidentally, the function where the problem occurred has been renamed from "ClusterConnected()" to "LabelConnected()". I don't know if the change in the compiler, or small changes in the code since 2019 could have fixed the problem, or whether I really have fixed the problem.)
from visfd.
Related Issues (15)
- masking is broken HOT 1
- poor signal-to-noise near mask or image boundaries
- [Feature Request] improve signal-to-noise of surface geometry near edges HOT 1
- PoissonRecon generated surfaces are sometimes wrong when using -must-link constraints HOT 1
- warning: incompatible with old versions of GCC
- blob detection stopped working on 2021-10-18 HOT 1
- The "-must-link" argument stopped working on 2021-10-18 HOT 2
- tensor-voting is slow HOT 3
- blob-detection is slow for large blobs HOT 3
- -auto-thresh and -supervised fail if there are a large number of negative controls on both sides of the accepted data HOT 1
- avoid using the "-Ofast" compiler flag HOT 1
- voxelize_mesh.py consumes too much time and memory HOT 2
- [Feature Request] add "must-not-link" constraints
- [Feature Request] add a tutorial HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from visfd.