Merge pull request #108 from RosettaCommons/aleaverfay/improved_singleton
Changing the way singletons are declared for the sake of thread safety.
Singleton class X must now do the following:
1) using CRTP, derive publicly from utility::SingletonBase< X >
2) define a private, static function X * create_singleton_instance();
3) declare class utility::SingletonBase< X > to be a friend so that it
(and no one else) can call create_singleton_instance()
4) include the following code block to define two static variables in X.cc:
namespace utility {
using my::namespace::X;
#if defined MULTI_THREADED && defined CXX11
template <> std::mutex utility::SingletonBase< X > ::singleton_mutex_;
template <> std::atomic< X * > utility::SingletonBase< X >::instance_( 0 );
#else
template <> X * utility::SingletonBase< X >::instance_( 0 );
#endif
}
The SingletonBase class defines the static X * get_instance() function and handles
the instantiation of the instance in a thread-safe manner. The instance_ pointer
belongs to the base class.
This commit leaves loud messages about some awful abuse of global data through
singletons. Look for "WARNING WARNING WARNING! THREAD UNSAFE!" messages.
Singletons, with certain explicit exceptions (the JobDistributor, the ResourceManager)
should not hold job-specific data.
Changing the InterchainPotential so that it no longer derives from core::scoring::EnvPairPotential, since it shares literally nothing with that class. This means that the data that EnvPairPotential loads in from the rosetta_database no longer gets loaded in twice, and thus causes a large number of cosmetic integration test changes.
The match_1n9l integration test has continued to show the amino-acid-order instability that I thought I had gotten rid of, so I went and found yet another std::set< ResidueTypeCOP > in the enzyme design code that I've now eliminated. Hopefully that bug is now gone.
notify author
notify list [rosetta-logs@googlegroups.com]
Adding a colinearity check to the dihedral derivative evalation to fix
the nonideal_rtmin release_debug integration test.
Commenting out a Tracer output message from make_exemplar.cc before
the call to devel::init to fix the make_exemplar release_debug integration
test.
notify author
notify list [rosetta-logs@googlegroups.com]
Merge pull request #111 from RosettaCommons/roccomoretti/transform_fix
Fix Transform mover bug.
An uninitialized variable was messing up conformer placement in ligand docking Transform.
Also, add tracer output of grid failures in the Transform mover.
Integration test changes in tests using the Transform mover (hts_io, ligand_dock_grid, kinemage_grid_output) expected.
notify author
notify list [rosetta-logs@googlegroups.com]
Merge pull request #107 from RosettaCommons/aleaverfay/fix_matcher_his_hisd_integration_test_problem
aleaverfay/fix matcher his hisd integration test problem
notify author
notify list [rosetta-logs@googlegroups.com]
Merge pull request #112 from RosettaCommons/aleaverfay/lrec_any_neighbors_for_residue
Merging master and branch aleaverfay/lrec_any_neighbors_for_residue
Several changes to the code in response to performance degradations
following the pointer-rewrite merge.
1) the LREnergyContainer now has an extra virtual method "any_neighbors_for_residue"
which allows it to avoid creating iterators for residues with no neighbors; thus the
disulfide energy doesn't spend nearly as much time allocating and deallocating
iterators for non-disulfide bonded residues (most of them).
2) Inlining more accessors in Residue and Conformation.
3) Avoiding reference-count increments by replacing accessors that returned MyClassOP
and MyClassCOPs with MyClass & and MyClass const &s.
4) Adding raw-pointer variants of the performance-critical AtomTree functions which
otherwise resulted in some rather surprising and dramatic code slowdowns and an
explanation why raw pointers are used in these functions instead of smart pointers
since raw pointers are heavily frowned upon.
Also, the minimization performance benchmarks are not doing what they seem to be advertising;
they're mostly running the deriv check code. They're not really making sure that dfpmin didn't
get slower. It also looks like one of the interaction graph benchmarks is failing.
notify author
notify list [rosetta-logs@googlegroups.com]