GithubHelp home page GithubHelp logo

Comments (3)

jewettaij avatar jewettaij commented on August 16, 2024

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.

jewettaij avatar jewettaij commented on August 16, 2024

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.

jewettaij avatar jewettaij commented on August 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.