Commit c3e1acf8 authored by Christopher Bruns's avatar Christopher Bruns
Browse files

Changed several brookPlatform copy statements to references in brook kernel files

Commented out static platform variable, which may have caused initialization problems
Some of the Brook tests now succeed on my computer for the first time.
parent ff7874d7
...@@ -66,7 +66,7 @@ BrookCalcGBSAOBCForceKernel::BrookCalcGBSAOBCForceKernel( std::string name, cons ...@@ -66,7 +66,7 @@ BrookCalcGBSAOBCForceKernel::BrookCalcGBSAOBCForceKernel( std::string name, cons
_numberOfParticles = 0; _numberOfParticles = 0;
_log = NULL; _log = NULL;
const BrookPlatform brookPlatform = dynamic_cast<const BrookPlatform&> (platform); const BrookPlatform& brookPlatform = dynamic_cast<const BrookPlatform&> (platform);
if( brookPlatform.getLog() != NULL ){ if( brookPlatform.getLog() != NULL ){
setLog( brookPlatform.getLog() ); setLog( brookPlatform.getLog() );
} }
......
...@@ -62,7 +62,7 @@ BrookCalcHarmonicAngleForceKernel::BrookCalcHarmonicAngleForceKernel( std::strin ...@@ -62,7 +62,7 @@ BrookCalcHarmonicAngleForceKernel::BrookCalcHarmonicAngleForceKernel( std::strin
_brookBondParameters = NULL; _brookBondParameters = NULL;
_log = NULL; _log = NULL;
const BrookPlatform brookPlatform = dynamic_cast<const BrookPlatform&> (platform); const BrookPlatform& brookPlatform = dynamic_cast<const BrookPlatform&> (platform);
if( brookPlatform.getLog() != NULL ){ if( brookPlatform.getLog() != NULL ){
setLog( brookPlatform.getLog() ); setLog( brookPlatform.getLog() );
} }
......
...@@ -62,7 +62,7 @@ BrookCalcHarmonicBondForceKernel::BrookCalcHarmonicBondForceKernel( std::string ...@@ -62,7 +62,7 @@ BrookCalcHarmonicBondForceKernel::BrookCalcHarmonicBondForceKernel( std::string
_brookBondParameters = NULL; _brookBondParameters = NULL;
_log = NULL; _log = NULL;
const BrookPlatform brookPlatform = dynamic_cast<const BrookPlatform&> (platform); const BrookPlatform& brookPlatform = dynamic_cast<const BrookPlatform&> (platform);
if( brookPlatform.getLog() != NULL ){ if( brookPlatform.getLog() != NULL ){
setLog( brookPlatform.getLog() ); setLog( brookPlatform.getLog() );
} }
......
...@@ -69,7 +69,7 @@ BrookCalcNonbondedForceKernel::BrookCalcNonbondedForceKernel( std::string name, ...@@ -69,7 +69,7 @@ BrookCalcNonbondedForceKernel::BrookCalcNonbondedForceKernel( std::string name,
_brookBondParameters = NULL; _brookBondParameters = NULL;
_log = NULL; _log = NULL;
const BrookPlatform brookPlatform = dynamic_cast<const BrookPlatform&> (platform); const BrookPlatform& brookPlatform = dynamic_cast<const BrookPlatform&> (platform);
if( brookPlatform.getLog() != NULL ){ if( brookPlatform.getLog() != NULL ){
setLog( brookPlatform.getLog() ); setLog( brookPlatform.getLog() );
} }
......
...@@ -63,7 +63,7 @@ BrookCalcPeriodicTorsionForceKernel::BrookCalcPeriodicTorsionForceKernel( std::s ...@@ -63,7 +63,7 @@ BrookCalcPeriodicTorsionForceKernel::BrookCalcPeriodicTorsionForceKernel( std::s
_log = NULL; _log = NULL;
_openMMBrookInterface.setNumberOfParticles( system.getNumParticles() ); _openMMBrookInterface.setNumberOfParticles( system.getNumParticles() );
const BrookPlatform brookPlatform = dynamic_cast<const BrookPlatform&> (platform); const BrookPlatform& brookPlatform = dynamic_cast<const BrookPlatform&> (platform);
if( brookPlatform.getLog() != NULL ){ if( brookPlatform.getLog() != NULL ){
setLog( brookPlatform.getLog() ); setLog( brookPlatform.getLog() );
} }
......
...@@ -63,7 +63,7 @@ BrookCalcRBTorsionForceKernel::BrookCalcRBTorsionForceKernel( std::string name, ...@@ -63,7 +63,7 @@ BrookCalcRBTorsionForceKernel::BrookCalcRBTorsionForceKernel( std::string name,
_log = NULL; _log = NULL;
_openMMBrookInterface.setNumberOfParticles( system.getNumParticles() ); _openMMBrookInterface.setNumberOfParticles( system.getNumParticles() );
const BrookPlatform brookPlatform = dynamic_cast<const BrookPlatform&> (platform); const BrookPlatform& brookPlatform = dynamic_cast<const BrookPlatform&> (platform);
if( brookPlatform.getLog() != NULL ){ if( brookPlatform.getLog() != NULL ){
setLog( brookPlatform.getLog() ); setLog( brookPlatform.getLog() );
} }
......
...@@ -313,7 +313,7 @@ void BrookCommon::_getParticleStreamDimensions( const Platform& platform ){ ...@@ -313,7 +313,7 @@ void BrookCommon::_getParticleStreamDimensions( const Platform& platform ){
// get particle stream size // get particle stream size
const BrookPlatform brookPlatform = dynamic_cast<const BrookPlatform&> (platform); const BrookPlatform& brookPlatform = dynamic_cast<const BrookPlatform&> (platform);
const BrookStreamFactory& brookStreamFactory = dynamic_cast<const BrookStreamFactory&> (platform.getDefaultStreamFactory() ); const BrookStreamFactory& brookStreamFactory = dynamic_cast<const BrookStreamFactory&> (platform.getDefaultStreamFactory() );
_particleStreamWidth = brookStreamFactory.getDefaultParticleStreamWidth(); _particleStreamWidth = brookStreamFactory.getDefaultParticleStreamWidth();
_particleStreamSize = brookPlatform.getStreamSize( getNumberOfParticles(), _particleStreamWidth, NULL ); _particleStreamSize = brookPlatform.getStreamSize( getNumberOfParticles(), _particleStreamWidth, NULL );
......
...@@ -63,7 +63,7 @@ BrookInitializeForcesKernel::BrookInitializeForcesKernel( std::string name, cons ...@@ -63,7 +63,7 @@ BrookInitializeForcesKernel::BrookInitializeForcesKernel( std::string name, cons
_numberOfParticles = 0; _numberOfParticles = 0;
_log = NULL; _log = NULL;
const BrookPlatform brookPlatform = dynamic_cast<const BrookPlatform&> (platform); const BrookPlatform& brookPlatform = dynamic_cast<const BrookPlatform&> (platform);
if( brookPlatform.getLog() != NULL ){ if( brookPlatform.getLog() != NULL ){
setLog( brookPlatform.getLog() ); setLog( brookPlatform.getLog() );
} }
......
...@@ -60,7 +60,7 @@ BrookIntegrateLangevinStepKernel::BrookIntegrateLangevinStepKernel( std::string ...@@ -60,7 +60,7 @@ BrookIntegrateLangevinStepKernel::BrookIntegrateLangevinStepKernel( std::string
_brookRandomNumberGenerator = NULL; _brookRandomNumberGenerator = NULL;
_log = NULL; _log = NULL;
const BrookPlatform brookPlatform = dynamic_cast<const BrookPlatform&> (platform); const BrookPlatform& brookPlatform = dynamic_cast<const BrookPlatform&> (platform);
if( brookPlatform.getLog() != NULL ){ if( brookPlatform.getLog() != NULL ){
setLog( brookPlatform.getLog() ); setLog( brookPlatform.getLog() );
} }
......
...@@ -58,7 +58,7 @@ BrookIntegrateVerletStepKernel::BrookIntegrateVerletStepKernel( std::string name ...@@ -58,7 +58,7 @@ BrookIntegrateVerletStepKernel::BrookIntegrateVerletStepKernel( std::string name
_brookVerletDynamics = NULL; _brookVerletDynamics = NULL;
_brookShakeAlgorithm = NULL; _brookShakeAlgorithm = NULL;
const BrookPlatform brookPlatform = dynamic_cast<const BrookPlatform&> (platform); const BrookPlatform& brookPlatform = dynamic_cast<const BrookPlatform&> (platform);
if( brookPlatform.getLog() != NULL ){ if( brookPlatform.getLog() != NULL ){
setLog( brookPlatform.getLog() ); setLog( brookPlatform.getLog() );
} else { } else {
......
...@@ -815,7 +815,7 @@ int BrookLangevinDynamics::setup( const std::vector<double>& masses, const Platf ...@@ -815,7 +815,7 @@ int BrookLangevinDynamics::setup( const std::vector<double>& masses, const Platf
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
const BrookPlatform brookPlatform = dynamic_cast<const BrookPlatform&> (platform); const BrookPlatform& brookPlatform = dynamic_cast<const BrookPlatform&> (platform);
setLog( brookPlatform.getLog() ); setLog( brookPlatform.getLog() );
int numberOfParticles = (int) masses.size(); int numberOfParticles = (int) masses.size();
......
...@@ -190,7 +190,7 @@ BrookPlatform* registerBrookPlatform( void ){ ...@@ -190,7 +190,7 @@ BrookPlatform* registerBrookPlatform( void ){
return platform; return platform;
} }
BrookPlatform* staticPlatform = registerBrookPlatform( ); // BrookPlatform* staticPlatform = registerBrookPlatform( );
/** /**
* BrookPlatform constructor * BrookPlatform constructor
......
...@@ -942,7 +942,7 @@ int BrookRandomNumberGenerator::_initializeStreamSizes( int numberOfParticles, c ...@@ -942,7 +942,7 @@ int BrookRandomNumberGenerator::_initializeStreamSizes( int numberOfParticles, c
// get randomNumber stream dimensions // get randomNumber stream dimensions
const BrookPlatform brookPlatform = dynamic_cast<const BrookPlatform&> (platform); const BrookPlatform& brookPlatform = dynamic_cast<const BrookPlatform&> (platform);
const BrookStreamFactory& brookStreamFactory = dynamic_cast<const BrookStreamFactory&> (platform.getDefaultStreamFactory() ); const BrookStreamFactory& brookStreamFactory = dynamic_cast<const BrookStreamFactory&> (platform.getDefaultStreamFactory() );
_randomNumberStreamWidth = brookStreamFactory.getDefaultRandomNumberStreamWidth(); _randomNumberStreamWidth = brookStreamFactory.getDefaultRandomNumberStreamWidth();
_randomNumberStreamSize = brookStreamFactory.getDefaultRandomNumberStreamSize(); _randomNumberStreamSize = brookStreamFactory.getDefaultRandomNumberStreamSize();
...@@ -1023,7 +1023,7 @@ int BrookRandomNumberGenerator::setup( int numberOfParticles, const Platform& pl ...@@ -1023,7 +1023,7 @@ int BrookRandomNumberGenerator::setup( int numberOfParticles, const Platform& pl
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
const BrookPlatform brookPlatform = dynamic_cast<const BrookPlatform&> (platform); const BrookPlatform& brookPlatform = dynamic_cast<const BrookPlatform&> (platform);
setLog( brookPlatform.getLog() ); setLog( brookPlatform.getLog() );
// set stream sizes and then create streams // set stream sizes and then create streams
......
...@@ -60,7 +60,7 @@ BrookRemoveCMMotionKernel::BrookRemoveCMMotionKernel( std::string name, const Pl ...@@ -60,7 +60,7 @@ BrookRemoveCMMotionKernel::BrookRemoveCMMotionKernel( std::string name, const Pl
_log = NULL; _log = NULL;
_brookVelocityCenterOfMassRemoval = NULL; _brookVelocityCenterOfMassRemoval = NULL;
const BrookPlatform brookPlatform = dynamic_cast<const BrookPlatform&> (platform); const BrookPlatform& brookPlatform = dynamic_cast<const BrookPlatform&> (platform);
if( brookPlatform.getLog() != NULL ){ if( brookPlatform.getLog() != NULL ){
setLog( brookPlatform.getLog() ); setLog( brookPlatform.getLog() );
} }
......
...@@ -354,7 +354,7 @@ int BrookVelocityCenterOfMassRemoval::setup( const std::vector<double>& masses, ...@@ -354,7 +354,7 @@ int BrookVelocityCenterOfMassRemoval::setup( const std::vector<double>& masses,
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
const BrookPlatform brookPlatform = dynamic_cast<const BrookPlatform&> (platform); const BrookPlatform& brookPlatform = dynamic_cast<const BrookPlatform&> (platform);
setLog( brookPlatform.getLog() ); setLog( brookPlatform.getLog() );
int numberOfParticles = (int) masses.size(); int numberOfParticles = (int) masses.size();
......
...@@ -373,7 +373,7 @@ int BrookVerletDynamics::setup( const std::vector<double>& masses, const Platfor ...@@ -373,7 +373,7 @@ int BrookVerletDynamics::setup( const std::vector<double>& masses, const Platfor
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
const BrookPlatform brookPlatform = dynamic_cast<const BrookPlatform&> (platform); const BrookPlatform& brookPlatform = dynamic_cast<const BrookPlatform&> (platform);
setLog( brookPlatform.getLog() ); setLog( brookPlatform.getLog() );
int numberOfParticles = (int) masses.size(); int numberOfParticles = (int) masses.size();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment