Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Apple Clang release on macOS.
C++23 support is required in both the compiler and its standard library.
`configure` checks `std::string::contains`, `std::string::resize_and_overwrite`
and `std::stringstream::view`. Do not lower the language standard to work around
an old toolchain. Dependencies include Boost, ViennaRNA (>= 2.4.14), zlib,
an old toolchain. Dependencies include Boost, ViennaRNA (>= 2.7.0), zlib,
pkg-config and Autotools; OpenMP is used by the default multithreaded build.
[conda-build-env.yml](conda-build-env.yml) supplies library/build dependencies,
but does not select the C++ compiler. Use the platform setup in CI when needed.
Expand Down Expand Up @@ -150,8 +150,15 @@ Example::isComplete() const
comparison helpers from [general.h](src/IntaRNA/general.h). Internal energies
use hundredths of kcal/mol; do not mix them with kcal/mol or Boltzmann values.
- Preserve ownership and lifetimes when introducing RAII or non-owning views.
Retain synchronization around shared state and ViennaRNA calls; existing
accessibility calculations require serialization for thread safety.
Retain synchronization around shared ViennaRNA state: parameter/compound
setup, constraints and preparation use `VrnaHandler::getSetupMutex()`.
Prepared window accessibility computations can run concurrently with an
OpenMP-enabled ViennaRNA build; global MFE/PF calls remain serialized.
Complete parameter loading before workers start and preserve the mandatory
ViennaRNA logger lock. Retain full-call serialization for RNAlib builds
without OpenMP; this is a build-configuration boundary, not support for old
ViennaRNA releases. Consult `doc/analysis/vienna-accessibility-thread-safety.md`
before changing these boundaries.
- For recurrence or predictor changes, extend the relevant regression tests
and short-sequence oracles (`PredictorTinyOracle_test.cpp` and
`PredictorSeedOracle_test.cpp`). For optimizations, compare correctness first,
Expand Down
51 changes: 51 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@

## Technical changes and Optimizations

- require ViennaRNA >= 2.7.0 and its logger/prepared-window APIs at configure
time; install the logger lock for every supported version (PR #267)

- fix ViennaRNA parameter-cache races and enable parallel prepared window
accessibility; retain serialization for global MFE/PF and non-OpenMP
ViennaRNA builds, with a source audit and concurrency regressions (issue #265)
- keep the concurrency regression compatible with Apple Clang's standard
library using explicitly joined std::thread workers (PR #267)

- add an API overview, IntaRNA Doxygen styling, and automated documentation
builds and GitHub Pages publishing alongside the user guide (issue #22)

Expand Down Expand Up @@ -129,6 +138,48 @@ energies, restricted partition sums, and trackers.
################################################################################
################################################################################

261015 Alexander Mitrofanov
* configure.ac, conda-build-env.yml :
* require ViennaRNA >= 2.7.0, the first release with vrna_log_lock_set()
* check header version and link the logger/prepared-window APIs during
configure, including builds using --disable-pkg-config
* IntaRNA/VrnaHandler, IntaRNA/AccessibilityVrna :
* install the logger lock unconditionally for supported ViennaRNA releases
and remove obsolete version guards; retain full-call serialization for
RNAlib builds without OpenMP
* README.md, AGENTS.md, doc/analysis/vienna-accessibility-thread-safety.md :
* align the dependency and synchronization contract; distinguish historical
2.4.14 source evidence from the supported range and recorded runtime tests
+ record minimum-version, release/debug and dependency-probe validation
* addresses review of https://github.com/BackofenLab/IntaRNA/pull/267

261014 Alexander Mitrofanov
* tests/AccessibilityVrna_test.cpp :
* replace std::jthread, unavailable in the macOS CI standard library, with
std::thread and exception-safe joins before inspecting worker results
* fixes the Apple Clang regression build in PR #267
* tests/runAccessibilityThreads.sh :
* avoid empty-array expansion with nounset for older macOS Bash versions

261014 Alexander Mitrofanov
* IntaRNA/VrnaHandler, IntaRNA/AccessibilityVrna,
IntaRNA/InteractionEnergyVrna, bin/IntaRNA :
* serialize shared parameter/compound setup, constraints and preparation
through one exception-safe mutex, including native-thread library callers
* run prepared window probability recurrences concurrently with OpenMP
ViennaRNA; retain the conservative fallback for other builds
* protect global MFE/PF compatibility state, remove worker-side global model
resets, and install a separate logger lock for ViennaRNA >= 2.7
* tests/AccessibilityVrna_test.cpp, tests/runAccessibilityThreads.sh,
tests/Makefile.am :
+ compare serial/native-thread/OpenMP ED, ES and ensemble energies with
varied models; compare CLI accessibilities/predictions with SHAPE D/W
* doc/analysis/vienna-accessibility-thread-safety.md,
doc/analysis/vrna-window-threads.cpp, doc/Makefile.am, README.md, AGENTS.md :
+ trace IntaRNA and ViennaRNA shared/owned state, provide an independent
race reproducer and document supported concurrency boundaries
* resolves https://github.com/BackofenLab/IntaRNA/issues/265

261007 Alexander Mitrofanov
* doc/doxygen.cfg, doc/doxygen/* :
+ introduce the API main page with component links, prediction flow,
Expand Down
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,10 @@ dependencies:
- libboost_system
- libboost_iostreams
- libboost_serialization
- [Vienna RNA package](http://www.tbi.univie.ac.at/RNA/) version >= 2.4.14
- [Vienna RNA package](http://www.tbi.univie.ac.at/RNA/) version >= 2.7.0,
providing the logger locking API required for concurrent accessibility
calculations. Configure checks the version and required APIs, including
when `--disable-pkg-config` is used.
- `pkg-config` for detailed version checks of dependencies
- if [cloning from github](#instgithub): GNU autotools (automake, autoconf, ..)

Expand Down Expand Up @@ -457,6 +460,16 @@ The maximal number of threads to be used can be specified using the `--threads`
If `--threads=k != 1`, than *k* predictions are processed in parallel. A value of
`0` requests the maximally available number of threads for this machine.

ViennaRNA accessibility calculations for independent sequences run concurrently
when ViennaRNA was built with OpenMP support. IntaRNA serializes parameter and
constraint setup to protect ViennaRNA's shared caches; builds without ViennaRNA
OpenMP support retain serial accessibility calculation. IntaRNA installs a
separate ViennaRNA logger lock during handler initialization for every
supported version. Global intramolecular MFE/partition-function calls remain
serialized. See the
[thread-safety audit](doc/analysis/vienna-accessibility-thread-safety.md) for the
call sequence, source evidence, standalone reproducer and validation.

When using parallelization, you should have the following in mind:

- The memory consumption will be multiplied by the number of threads,
Expand Down
2 changes: 1 addition & 1 deletion conda-build-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependencies:
- pkgconfig
- zlib
- boost-cpp
- viennarna>=2.4.14
- viennarna>=2.7.0
- cxx-compiler
- make
- binutils
41 changes: 32 additions & 9 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ AC_INIT([IntaRNA], [3.4.1], [], [intaRNA], [http://www.bioinf.uni-freiburg.de] )

# minimal required version of the boost library
BOOST_REQUIRED_VERSION=1.50.0
# minimal required version of the Vienna RNA library
VRNA_REQUIRED_VERSION=2.4.14
# minimal Vienna RNA version providing the logger locking API
VRNA_REQUIRED_VERSION=2.7.0
# minimal required version of python interpreter (to install intarnapvalue)
PYTHON_REQUIRED_VERSION=3.6

Expand Down Expand Up @@ -443,19 +443,41 @@ AS_IF([test x"$HAVE_PKG_CONFIG" = x"yes"], [
])

AS_IF([test "$RNANOTFOUND" = "0"], [
AC_MSG_CHECKING([for compilation with Vienna RNA package headers])
AC_MSG_CHECKING([for ViennaRNA >= $VRNA_REQUIRED_VERSION with logger locking and prepared window folding])
OLD_CPPFLAGS=$CPPFLAGS
OLD_CXXFLAGS=$CXXFLAGS
OLD_LDFLAGS=$LDFLAGS
AC_LANG_PUSH([C])
intarna_saved_vrna_LIBS=$LIBS
AC_LANG_PUSH([C++])
CPPFLAGS="$CPPFLAGS $AM_CXXFLAGS"
LDFLAGS="$LDFLAGS $AM_LDFLAGS"
AS_IF([test "x$HAVE_PKG_CONFIG" = "xyes"], [
CPPFLAGS="$CPPFLAGS $VRNA_CFLAGS"
LDFLAGS="$LDFLAGS $VRNA_LIBS"
LIBS="$VRNA_LIBS $LIBS"
], [
LIBS="-lRNA $LIBS"
])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[#include <ViennaRNA/model.h>]],[[vrna_md_t tmp; vrna_md_copy(&tmp,&tmp);]])],
# Check headers even without pkg-config, and link the APIs used for concurrency.
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[
extern "C" {
#include <ViennaRNA/vrna_config.h>
#if VRNA_VERSION_MAJOR < 2 || (VRNA_VERSION_MAJOR == 2 && VRNA_VERSION_MINOR < 7)
#error ViennaRNA 2.7.0 or newer is required
#endif
#include <ViennaRNA/model.h>
#include <ViennaRNA/fold_compound.h>
#include <ViennaRNA/partfunc/local.h>
#include <ViennaRNA/utils/log.h>
}
]], [[
vrna_md_t model;
vrna_md_set_default(&model);
vrna_log_lock_set(NULL, NULL);
vrna_fold_compound_t *fc = vrna_fold_compound("GCGC", &model, VRNA_OPTION_PF | VRNA_OPTION_WINDOW);
vrna_fold_compound_prepare(fc, VRNA_OPTION_PF | VRNA_OPTION_WINDOW);
vrna_probs_window(fc, 4, VRNA_PROBS_WINDOW_UP, NULL, NULL);
vrna_fold_compound_free(fc);
]])],
[
AC_MSG_RESULT([yes])
RNANOTFOUND=0;
Expand All @@ -467,9 +489,10 @@ AS_IF([test "$RNANOTFOUND" = "0"], [
RNANOTFOUND=1;
]
)
AC_LANG_POP([C])
AC_LANG_POP([C++])
CPPFLAGS=$OLD_CPPFLAGS
LDFLAGS=$OLD_LDFLAGS
LIBS=$intarna_saved_vrna_LIBS
])

# error output if ViennaRNA not found
Expand Down
Loading
Loading