You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I played with the current QCDLoop git master (2.0.4 as of 2020.01.07 20:27 UTC), making sure that I have "-DENABLE_FORTRAN_WRAPPER=ON".
While trying the "examples/fortran_test.f", I get a runtime warning saying that the Fortran "wrapper is not thread-safe".
Could you, please, be more specific why?
According to the GNU Fortran Compiler "Thread-safety of the runtime library" docs chapter, there should be no big problems (well, one might want to add "-frecursive" when compiling Fortran code).
At the same time, there appears also another runtime message saying that one should "consider developing object-oriented code", which seems to suggest that the provided C++ wrapper is thread-safe.
However, in this case I would expect that all C / C++ source code files are compiled and linked (i.e. object files, shared libraries and executables) with use of the gcc / g++ "-pthread" flag (at least on Linux). This does not seem to be the case (i.e. you do not use this flag at all).
The native c++ interface of the QCDLoop library is thread-safe only when the caching algorithms are switched off. It is particularly important to highlight that the fortran wrapper is not thread-safe by construction.
Could you, please, be more specific how do you achieve the thread safety of the C++ wrapper (and then why the Fortran wrapper, which is also written in C, is not thread-safe)?
The text was updated successfully, but these errors were encountered:
The code in C++ uses internal states, so concurrent calls can be achieved by using techniques like:
creating a single class instance per thread
using openmp with critical regions
However, we do not have any lock/mutex statements in the code, that's why we say that the fortran interface (which is based on a unique class instance) is not thread-safe or friendly.
I believe the compiler flags you are referring are suitable for particular implementations where you delegate the class allocation to external threads, but they do not control the internals states of this library. However, this may require some extra investigation.
I played with the current QCDLoop git master (2.0.4 as of 2020.01.07 20:27 UTC), making sure that I have "
-DENABLE_FORTRAN_WRAPPER=ON
".While trying the "examples/fortran_test.f", I get a runtime warning saying that the Fortran "wrapper is not thread-safe".
Could you, please, be more specific why?
According to the GNU Fortran Compiler "Thread-safety of the runtime library" docs chapter, there should be no big problems (well, one might want to add "
-frecursive
" when compiling Fortran code).At the same time, there appears also another runtime message saying that one should "consider developing object-oriented code", which seems to suggest that the provided C++ wrapper is thread-safe.
However, in this case I would expect that all C / C++ source code files are compiled and linked (i.e. object files, shared libraries and executables) with use of the gcc / g++ "
-pthread
" flag (at least on Linux). This does not seem to be the case (i.e. you do not use this flag at all).The https://arxiv.org/pdf/1605.03181.pdf paper says (on page 9):
Could you, please, be more specific how do you achieve the thread safety of the C++ wrapper (and then why the Fortran wrapper, which is also written in C, is not thread-safe)?
The text was updated successfully, but these errors were encountered: