Commit 1ce7d813 authored by Mark Friedrichs's avatar Mark Friedrichs
Browse files

Mods

parent 495a43c6
...@@ -736,7 +736,10 @@ int BrookBonded::_addRBTorsions( int *nbondeds, int *particles, float *params[], ...@@ -736,7 +736,10 @@ int BrookBonded::_addRBTorsions( int *nbondeds, int *particles, float *params[],
(*nbondeds)++; (*nbondeds)++;
} }
index = 0; // note -- we are starting w/ index c1 not c0 -- c0 is not used
// to calculate the forces!
index = 1;
PARAMS( ibonded, 0, 0 ) = (BrookOpenMMFloat) rbParameters[index++]; PARAMS( ibonded, 0, 0 ) = (BrookOpenMMFloat) rbParameters[index++];
PARAMS( ibonded, 0, 1 ) = (BrookOpenMMFloat) rbParameters[index++]; PARAMS( ibonded, 0, 1 ) = (BrookOpenMMFloat) rbParameters[index++];
PARAMS( ibonded, 0, 2 ) = (BrookOpenMMFloat) rbParameters[index++]; PARAMS( ibonded, 0, 2 ) = (BrookOpenMMFloat) rbParameters[index++];
...@@ -746,7 +749,7 @@ int BrookBonded::_addRBTorsions( int *nbondeds, int *particles, float *params[], ...@@ -746,7 +749,7 @@ int BrookBonded::_addRBTorsions( int *nbondeds, int *particles, float *params[],
if( debug && getLog() ){ if( debug && getLog() ){
(void) fprintf( getLog(), " %d [%d %d %d %d] %.3e %.3e %.3e %.3e\n", ibonded, i, j, k, l, (void) fprintf( getLog(), " %d [%d %d %d %d] %.3e %.3e %.3e %.3e\n", ibonded, i, j, k, l,
rbParameters[0], rbParameters[1], rbParameters[0], rbParameters[1],
rbParameters[2], rbParameters[3], rbParameters[4] ); rbParameters[2], rbParameters[3], rbParameters[4], rbParameters[5] );
} }
} }
...@@ -1200,7 +1203,7 @@ int BrookBonded::setup( int numberOfParticles, ...@@ -1200,7 +1203,7 @@ int BrookBonded::setup( int numberOfParticles,
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
static const std::string methodName = "BrookBonded::setup"; static const std::string methodName = "BrookBonded::setup";
static const int PrintOn = 1; static const int PrintOn = 0;
double dangleValue = 0.0; double dangleValue = 0.0;
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
...@@ -1991,7 +1994,17 @@ void BrookBonded::computeForces( BrookStreamImpl& positionStream, BrookStreamImp ...@@ -1991,7 +1994,17 @@ void BrookBonded::computeForces( BrookStreamImpl& positionStream, BrookStreamImp
} }
if( getInverseMapStreamCount( J_Stream ) == 5 && getInverseMapStreamCount( L_Stream ) == 2 ){ if( getInverseMapStreamCount( J_Stream ) == 1 && getInverseMapStreamCount( L_Stream ) == 1 ){
kinvmap_gather1_1( width,
inverseStreamMaps[J_Stream][0]->getBrookStream(),
bondedForceStreams[J_Stream]->getBrookStream(),
inverseStreamMaps[L_Stream][0]->getBrookStream(),
bondedForceStreams[L_Stream]->getBrookStream(),
forceStream.getBrookStream(), forceStream.getBrookStream() );
} else if( getInverseMapStreamCount( J_Stream ) == 5 && getInverseMapStreamCount( L_Stream ) == 2 ){
kinvmap_gather5_2( width, kinvmap_gather5_2( width,
inverseStreamMaps[J_Stream][0]->getBrookStream(), inverseStreamMaps[J_Stream][0]->getBrookStream(),
inverseStreamMaps[J_Stream][1]->getBrookStream(), inverseStreamMaps[J_Stream][1]->getBrookStream(),
......
...@@ -349,7 +349,7 @@ int BrookBrownianDynamics::updateParameters( double temperature, double friction ...@@ -349,7 +349,7 @@ int BrookBrownianDynamics::updateParameters( double temperature, double friction
static int showUpdate = 1; static int showUpdate = 1;
static int maxShowUpdate = 3; static int maxShowUpdate = 3;
static const char* methodName = "\nBrookBrownianDynamics::updateParameters"; static const std::string methodName = "\nBrookBrownianDynamics::updateParameters";
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
...@@ -393,12 +393,10 @@ int BrookBrownianDynamics::update( Stream& positions, Stream& velocities, ...@@ -393,12 +393,10 @@ int BrookBrownianDynamics::update( Stream& positions, Stream& velocities,
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
// unused Shake parameter
float omega = 1.0f; float omega = 1.0f;
float one = 1.0f; float one = 1.0f;
static const char* methodName = "\nBrookBrownianDynamics::update"; static const std::string methodName = "\nBrookBrownianDynamics::update";
static const int PrintOn = 0; static const int PrintOn = 0;
......
...@@ -126,6 +126,7 @@ void BrookCalcHarmonicBondForceKernel::initialize( const System& system, const H ...@@ -126,6 +126,7 @@ void BrookCalcHarmonicBondForceKernel::initialize( const System& system, const H
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
static const std::string methodName = "BrookCalcHarmonicBondForceKernel::initialize"; static const std::string methodName = "BrookCalcHarmonicBondForceKernel::initialize";
static const int PrintOn = 0;
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
...@@ -133,8 +134,6 @@ void BrookCalcHarmonicBondForceKernel::initialize( const System& system, const H ...@@ -133,8 +134,6 @@ void BrookCalcHarmonicBondForceKernel::initialize( const System& system, const H
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
//(void) fprintf( getLog(), "%s\n", methodName.c_str() ); (void) fflush( getLog() );
// create _brookBondParameters object containing particle indices/parameters // create _brookBondParameters object containing particle indices/parameters
int numberOfBonds = force.getNumBonds(); int numberOfBonds = force.getNumBonds();
...@@ -165,7 +164,7 @@ void BrookCalcHarmonicBondForceKernel::initialize( const System& system, const H ...@@ -165,7 +164,7 @@ void BrookCalcHarmonicBondForceKernel::initialize( const System& system, const H
_openMMBrookInterface.setTriggerForceKernel( this ); _openMMBrookInterface.setTriggerForceKernel( this );
_openMMBrookInterface.setTriggerEnergyKernel( this ); _openMMBrookInterface.setTriggerEnergyKernel( this );
if( log ){ if( PrintOn && log ){
std::string contents = _brookBondParameters->getContentsString( ); std::string contents = _brookBondParameters->getContentsString( );
(void) fprintf( log, "%s contents\n%s", methodName.c_str(), contents.c_str() ); (void) fprintf( log, "%s contents\n%s", methodName.c_str(), contents.c_str() );
(void) fflush( log ); (void) fflush( log );
......
...@@ -173,6 +173,6 @@ index = 0; ...@@ -173,6 +173,6 @@ index = 0;
energy += _masses[ii]*(velocity[index]*velocity[index] + velocity[index + 1]*velocity[index + 1] + velocity[index + 2]*velocity[index + 2]); energy += _masses[ii]*(velocity[index]*velocity[index] + velocity[index + 1]*velocity[index + 1] + velocity[index + 2]*velocity[index + 2]);
} }
printf( " KQ=%12.5e\n", 0.5*energy ); //printf( " KQ=%12.5e\n", 0.5*energy );
return 0.5*energy; return 0.5*energy;
} }
...@@ -150,6 +150,7 @@ void BrookCalcRBTorsionForceKernel::initialize( const System& system, const RBTo ...@@ -150,6 +150,7 @@ void BrookCalcRBTorsionForceKernel::initialize( const System& system, const RBTo
double parameters[NumberOfParametersInBond]; double parameters[NumberOfParametersInBond];
force.getTorsionParameters( ii, particle1, particle2, particle3, particle4, c0, c1, c2, c3, c4, c5 ); force.getTorsionParameters( ii, particle1, particle2, particle3, particle4, c0, c1, c2, c3, c4, c5 );
particles[0] = particle1; particles[0] = particle1;
particles[1] = particle2; particles[1] = particle2;
particles[2] = particle3; particles[2] = particle3;
...@@ -170,7 +171,7 @@ void BrookCalcRBTorsionForceKernel::initialize( const System& system, const RBTo ...@@ -170,7 +171,7 @@ void BrookCalcRBTorsionForceKernel::initialize( const System& system, const RBTo
if( log ){ if( log ){
std::string contents = _brookBondParameters->getContentsString( ); std::string contents = _brookBondParameters->getContentsString( );
(void) fprintf( log, "%s brookGbsa::contents\n%s", methodName.c_str(), contents.c_str() ); (void) fprintf( log, "%s contents\n%s", methodName.c_str(), contents.c_str() );
(void) fflush( log ); (void) fflush( log );
} }
......
...@@ -81,8 +81,7 @@ BrookGbsa::BrookGbsa( ){ ...@@ -81,8 +81,7 @@ BrookGbsa::BrookGbsa( ){
} }
_bornRadiiInitialized = 0; _bornRadiiInitialized = 0;
_cpuObc = NULL; //_cpuObc = NULL;
_charges = NULL;
} }
...@@ -107,9 +106,7 @@ BrookGbsa::~BrookGbsa( ){ ...@@ -107,9 +106,7 @@ BrookGbsa::~BrookGbsa( ){
delete _gbsaForceStreams[ii]; delete _gbsaForceStreams[ii];
} }
delete _cpuObc; //delete _cpuObc;
delete[] _charges;
} }
...@@ -443,7 +440,7 @@ int BrookGbsa::haveBornRadiiBeenInitialized( void ) const { ...@@ -443,7 +440,7 @@ int BrookGbsa::haveBornRadiiBeenInitialized( void ) const {
* @return calculate Born radii * @return calculate Born radii
* *
*/ */
/*
int BrookGbsa::calculateBornRadii( const Stream& positions ){ int BrookGbsa::calculateBornRadii( const Stream& positions ){
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
...@@ -517,7 +514,7 @@ int BrookGbsa::calculateBornRadii( const Stream& positions ){ ...@@ -517,7 +514,7 @@ int BrookGbsa::calculateBornRadii( const Stream& positions ){
return DefaultReturnValue; return DefaultReturnValue;
} }
*/
/** /**
* Initialize stream dimensions * Initialize stream dimensions
* *
...@@ -528,11 +525,11 @@ int BrookGbsa::calculateBornRadii( const Stream& positions ){ ...@@ -528,11 +525,11 @@ int BrookGbsa::calculateBornRadii( const Stream& positions ){
* *
*/ */
int BrookGbsa::initializeStreamSizes( int numberOfParticles, const Platform& platform ){ int BrookGbsa::_initializeStreamSizes( int numberOfParticles, const Platform& platform ){
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
static const std::string methodName = "BrookGbsa::initializeStreamSizes"; static const std::string methodName = "BrookGbsa::_initializeStreamSizes";
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
...@@ -572,11 +569,11 @@ int BrookGbsa::initializeStreamSizes( int numberOfParticles, const Platform& pla ...@@ -572,11 +569,11 @@ int BrookGbsa::initializeStreamSizes( int numberOfParticles, const Platform& pla
* *
*/ */
int BrookGbsa::initializeStreams( const Platform& platform ){ int BrookGbsa::_initializeStreams( const Platform& platform ){
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
static const std::string methodName = "BrookGbsa::initializeStreams"; static const std::string methodName = "BrookGbsa::_initializeStreams";
static const double dangleValue = 0.0; static const double dangleValue = 0.0;
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
...@@ -672,8 +669,8 @@ int BrookGbsa::setup( const std::vector<std::vector<double> >& vectorOfParticleP ...@@ -672,8 +669,8 @@ int BrookGbsa::setup( const std::vector<std::vector<double> >& vectorOfParticleP
// initialize stream sizes and then Brook streams // initialize stream sizes and then Brook streams
initializeStreamSizes( numberOfParticles, platform ); _initializeStreamSizes( numberOfParticles, platform );
initializeStreams( platform ); _initializeStreams( platform );
int particleStreamSize = getGbsaParticleStreamSize(); int particleStreamSize = getGbsaParticleStreamSize();
BrookOpenMMFloat* radiiAndCharge = new BrookOpenMMFloat[particleStreamSize*2]; BrookOpenMMFloat* radiiAndCharge = new BrookOpenMMFloat[particleStreamSize*2];
...@@ -681,8 +678,6 @@ int BrookGbsa::setup( const std::vector<std::vector<double> >& vectorOfParticleP ...@@ -681,8 +678,6 @@ int BrookGbsa::setup( const std::vector<std::vector<double> >& vectorOfParticleP
memset( radiiAndCharge, 0, particleStreamSize*2*sizeof( BrookOpenMMFloat ) ); memset( radiiAndCharge, 0, particleStreamSize*2*sizeof( BrookOpenMMFloat ) );
memset( scaledRadiiAndOffset, 0, particleStreamSize*2*sizeof( BrookOpenMMFloat ) ); memset( scaledRadiiAndOffset, 0, particleStreamSize*2*sizeof( BrookOpenMMFloat ) );
_charges = new RealOpenMM[particleStreamSize];
// used by CpuObc to calculate initial Born radii // used by CpuObc to calculate initial Born radii
vector<RealOpenMM> particleRadii(numberOfParticles); vector<RealOpenMM> particleRadii(numberOfParticles);
...@@ -719,7 +714,6 @@ int BrookGbsa::setup( const std::vector<std::vector<double> >& vectorOfParticleP ...@@ -719,7 +714,6 @@ int BrookGbsa::setup( const std::vector<std::vector<double> >& vectorOfParticleP
particleRadii[vectorIndex] = static_cast<RealOpenMM> (radius); particleRadii[vectorIndex] = static_cast<RealOpenMM> (radius);
scaleFactors[vectorIndex] = static_cast<RealOpenMM> (scalingFactor); scaleFactors[vectorIndex] = static_cast<RealOpenMM> (scalingFactor);
_charges[vectorIndex] = static_cast<RealOpenMM> (charge);
radiiAndCharge[streamIndex] = static_cast<BrookOpenMMFloat> (radius); radiiAndCharge[streamIndex] = static_cast<BrookOpenMMFloat> (radius);
radiiAndCharge[streamIndex+1] = static_cast<BrookOpenMMFloat> (charge); radiiAndCharge[streamIndex+1] = static_cast<BrookOpenMMFloat> (charge);
...@@ -758,8 +752,8 @@ int BrookGbsa::setup( const std::vector<std::vector<double> >& vectorOfParticleP ...@@ -758,8 +752,8 @@ int BrookGbsa::setup( const std::vector<std::vector<double> >& vectorOfParticleP
obcParameters->setSolventDielectric( static_cast<RealOpenMM>(solventDielectric) ); obcParameters->setSolventDielectric( static_cast<RealOpenMM>(solventDielectric) );
obcParameters->setSoluteDielectric( static_cast<RealOpenMM>(soluteDielectric) ); obcParameters->setSoluteDielectric( static_cast<RealOpenMM>(soluteDielectric) );
_cpuObc = new CpuObc(obcParameters); //_cpuObc = new CpuObc(obcParameters);
_cpuObc->setIncludeAceApproximation( true ); //_cpuObc->setIncludeAceApproximation( true );
return DefaultReturnValue; return DefaultReturnValue;
} }
...@@ -774,11 +768,11 @@ int BrookGbsa::setup( const std::vector<std::vector<double> >& vectorOfParticleP ...@@ -774,11 +768,11 @@ int BrookGbsa::setup( const std::vector<std::vector<double> >& vectorOfParticleP
* *
* */ * */
int BrookGbsa::initializePartialForceStreamSize( int particleStreamSize, int particleStreamWidth ){ int BrookGbsa::_initializePartialForceStreamSize( int particleStreamSize, int particleStreamWidth ){
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
static const std::string methodName = "BrookGbsa::initializePartialForceStreamSize"; static const std::string methodName = "BrookGbsa::_initializePartialForceStreamSize";
//static const int debug = 1; //static const int debug = 1;
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
...@@ -842,6 +836,12 @@ std::string BrookGbsa::getContentsString( int level ) const { ...@@ -842,6 +836,12 @@ std::string BrookGbsa::getContentsString( int level ) const {
(void) LOCAL_SPRINTF( value, "%d", getNumberOfParticles() ); (void) LOCAL_SPRINTF( value, "%d", getNumberOfParticles() );
message << _getLine( tab, "Number of particles:", value ); message << _getLine( tab, "Number of particles:", value );
(void) LOCAL_SPRINTF( value, "%d", includeAce() );
message << _getLine( tab, "ACE included:", value );
(void) LOCAL_SPRINTF( value, "%.5f", getDielectricOffset() );
message << _getLine( tab, "Dielectric offset:", value );
(void) LOCAL_SPRINTF( value, "%d", getNumberOfForceStreams() ); (void) LOCAL_SPRINTF( value, "%d", getNumberOfForceStreams() );
message << _getLine( tab, "Number of force streams:", value ); message << _getLine( tab, "Number of force streams:", value );
...@@ -866,6 +866,15 @@ std::string BrookGbsa::getContentsString( int level ) const { ...@@ -866,6 +866,15 @@ std::string BrookGbsa::getContentsString( int level ) const {
(void) LOCAL_SPRINTF( value, "%d", getParticleStreamSize() ); (void) LOCAL_SPRINTF( value, "%d", getParticleStreamSize() );
message << _getLine( tab, "Particle stream size:", value ); message << _getLine( tab, "Particle stream size:", value );
(void) LOCAL_SPRINTF( value, "%d", getGbsaParticleStreamWidth() );
message << _getLine( tab, "Gbsa stream width:", value );
(void) LOCAL_SPRINTF( value, "%d", getGbsaParticleStreamHeight() );
message << _getLine( tab, "Gbsa stream height:", value );
(void) LOCAL_SPRINTF( value, "%d", getGbsaParticleStreamSize() );
message << _getLine( tab, "Gbsa stream size:", value );
(void) LOCAL_SPRINTF( value, "%d", getPartialForceStreamWidth() ); (void) LOCAL_SPRINTF( value, "%d", getPartialForceStreamWidth() );
message << _getLine( tab, "Partial force stream width:", value ); message << _getLine( tab, "Partial force stream width:", value );
...@@ -875,6 +884,7 @@ std::string BrookGbsa::getContentsString( int level ) const { ...@@ -875,6 +884,7 @@ std::string BrookGbsa::getContentsString( int level ) const {
(void) LOCAL_SPRINTF( value, "%d", getPartialForceStreamSize() ); (void) LOCAL_SPRINTF( value, "%d", getPartialForceStreamSize() );
message << _getLine( tab, "Partial force stream size:", value ); message << _getLine( tab, "Partial force stream size:", value );
message << _getLine( tab, "Log:", (getLog() ? Set : NotSet) ); message << _getLine( tab, "Log:", (getLog() ? Set : NotSet) );
for( int ii = 0; ii < LastStreamIndex; ii++ ){ for( int ii = 0; ii < LastStreamIndex; ii++ ){
...@@ -914,7 +924,7 @@ void BrookGbsa::computeForces( BrookStreamImpl& positionStream, BrookStreamImpl& ...@@ -914,7 +924,7 @@ void BrookGbsa::computeForces( BrookStreamImpl& positionStream, BrookStreamImpl&
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
static const std::string methodName = "BrookGbsa::executeForces"; static const std::string methodName = "BrookGbsa::executeForces";
static const int PrintOn = 1; static const int PrintOn = 0;
float mergeNonObcForces = 1.0f; float mergeNonObcForces = 1.0f;
float kcalMolTokJNM = -0.4184f; float kcalMolTokJNM = -0.4184f;
...@@ -925,8 +935,6 @@ void BrookGbsa::computeForces( BrookStreamImpl& positionStream, BrookStreamImpl& ...@@ -925,8 +935,6 @@ void BrookGbsa::computeForces( BrookStreamImpl& positionStream, BrookStreamImpl&
// calculate Born radii // calculate Born radii
(void) fprintf( getLog(), "\nPost kCalculateBornRadii: obcParticleRadiiWithDielectricOffset & obcScaledParticleRadii not set correctly!!!!!\n" );
kCalculateBornRadii( (float) getNumberOfParticles(), kCalculateBornRadii( (float) getNumberOfParticles(),
(float) getParticleSizeCeiling(), (float) getParticleSizeCeiling(),
(float) getDuplicationFactor(), (float) getDuplicationFactor(),
...@@ -940,7 +948,7 @@ void BrookGbsa::computeForces( BrookStreamImpl& positionStream, BrookStreamImpl& ...@@ -940,7 +948,7 @@ void BrookGbsa::computeForces( BrookStreamImpl& positionStream, BrookStreamImpl&
// diagnostics // diagnostics
if( 0 && PrintOn && getLog() ){ if( PrintOn && getLog() ){
(void) fprintf( getLog(), "\n%s Post kCalculateBornRadii: atms=%d ceil=%d dup=%d particleStrW=%3d prtlF=%3d diel=%.3f %.3f ACE=%.1f\n", (void) fprintf( getLog(), "\n%s Post kCalculateBornRadii: atms=%d ceil=%d dup=%d particleStrW=%3d prtlF=%3d diel=%.3f %.3f ACE=%.1f\n",
methodName.c_str(), getNumberOfParticles(), methodName.c_str(), getNumberOfParticles(),
...@@ -1010,7 +1018,7 @@ void BrookGbsa::computeForces( BrookStreamImpl& positionStream, BrookStreamImpl& ...@@ -1010,7 +1018,7 @@ void BrookGbsa::computeForces( BrookStreamImpl& positionStream, BrookStreamImpl&
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
// seecond major loop // first major OBC loop
kObcLoop1( (float) getNumberOfParticles(), kObcLoop1( (float) getNumberOfParticles(),
(float) getParticleSizeCeiling(), (float) getParticleSizeCeiling(),
...@@ -1020,12 +1028,9 @@ void BrookGbsa::computeForces( BrookStreamImpl& positionStream, BrookStreamImpl& ...@@ -1020,12 +1028,9 @@ void BrookGbsa::computeForces( BrookStreamImpl& positionStream, BrookStreamImpl&
getSoluteDielectric(), getSoluteDielectric(),
getSolventDielectric(), getSolventDielectric(),
includeAceTerm, includeAceTerm,
positionStream.getBrookStream(), positionStream.getBrookStream(),
getObcBornRadii()->getBrookStream(), getObcBornRadii()->getBrookStream(),
getObcParticleRadii()->getBrookStream(), getObcParticleRadii()->getBrookStream(),
gbsaForceStreams[0]->getBrookStream(), gbsaForceStreams[0]->getBrookStream(),
gbsaForceStreams[1]->getBrookStream(), gbsaForceStreams[1]->getBrookStream(),
gbsaForceStreams[2]->getBrookStream(), gbsaForceStreams[2]->getBrookStream(),
...@@ -1036,7 +1041,7 @@ void BrookGbsa::computeForces( BrookStreamImpl& positionStream, BrookStreamImpl& ...@@ -1036,7 +1041,7 @@ void BrookGbsa::computeForces( BrookStreamImpl& positionStream, BrookStreamImpl&
// diagnostics // diagnostics
if( 1 && PrintOn && getLog() ){ if( PrintOn && getLog() ){
(void) fprintf( getLog(), "\nPost kObcLoop1: atms=%d ceil=%d dup=%d particleStrW=%3d prtlF=%3d diel=%.3f %.3f ACE=%.1f\n", (void) fprintf( getLog(), "\nPost kObcLoop1: atms=%d ceil=%d dup=%d particleStrW=%3d prtlF=%3d diel=%.3f %.3f ACE=%.1f\n",
getNumberOfParticles(), getNumberOfParticles(),
...@@ -1048,17 +1053,18 @@ void BrookGbsa::computeForces( BrookStreamImpl& positionStream, BrookStreamImpl& ...@@ -1048,17 +1053,18 @@ void BrookGbsa::computeForces( BrookStreamImpl& positionStream, BrookStreamImpl&
getSolventDielectric(), includeAceTerm ); getSolventDielectric(), includeAceTerm );
BrookStreamInternal* brookStreamInternalPos = positionStream.getBrookStreamImpl(); BrookStreamInternal* brookStreamInternalPos = positionStream.getBrookStreamImpl();
(void) fprintf( getLog(), "\nPositionStream\n" ); (void) fprintf( getLog(), "\nPost kObcLoop1 PositionStream\n" );
brookStreamInternalPos->printToFile( getLog() ); brookStreamInternalPos->printToFile( getLog() );
(void) fprintf( getLog(), "\nBornR\n" ); (void) fprintf( getLog(), "\nPost kObcLoop1 BornR\n" );
getObcBornRadii()->printToFile( getLog() ); getObcBornRadii()->printToFile( getLog() );
(void) fprintf( getLog(), "\nParticleR\n" ); (void) fprintf( getLog(), "\nPost kObcLoop1 ParticleR\n" );
getObcParticleRadii()->printToFile( getLog() ); getObcParticleRadii()->printToFile( getLog() );
(void) fprintf( getLog(), "\nForceStreams output\n" ); (void) fprintf( getLog(), "\nPost kObcLoop1 ForceStreams output\n" );
for( int ii = 0; ii < 4; ii++ ){ for( int ii = 0; ii < 4; ii++ ){
(void) fprintf( getLog(), "\nPost kObcLoop1 ForceStream %d output\n", ii );
gbsaForceStreams[ii]->printToFile( getLog() ); gbsaForceStreams[ii]->printToFile( getLog() );
} }
...@@ -1098,34 +1104,33 @@ void BrookGbsa::computeForces( BrookStreamImpl& positionStream, BrookStreamImpl& ...@@ -1098,34 +1104,33 @@ void BrookGbsa::computeForces( BrookStreamImpl& positionStream, BrookStreamImpl&
getParticleSizeCeiling(), getParticleSizeCeiling(),
getInnerLoopUnroll() ); getInnerLoopUnroll() );
(void) fprintf( getLog(), "\nForceStreams\n" ); (void) fprintf( getLog(), "\nPost kPostObcLoop1_nobranch: ForceStreams\n" );
for( int ii = 0; ii < 4; ii++ ){ for( int ii = 0; ii < 4; ii++ ){
(void) fprintf( getLog(), "\nPost kPostObcLoop1_nobranch: %d ForceStreams\n", ii );
gbsaForceStreams[ii]->printToFile( getLog() ); gbsaForceStreams[ii]->printToFile( getLog() );
} }
(void) fprintf( getLog(), "\nObcChain\n" ); (void) fprintf( getLog(), "\nPost kPostObcLoop1_nobranch: ObcChain\n" );
getObcChain()->printToFile( getLog() ); getObcChain()->printToFile( getLog() );
(void) fprintf( getLog(), "\nBornR\n" ); (void) fprintf( getLog(), "\nPost kPostObcLoop1_nobranch: BornR\n" );
getObcBornRadii()->printToFile( getLog() ); getObcBornRadii()->printToFile( getLog() );
// output // output
(void) fprintf( getLog(), "\nObcIntermediateForce output\n" ); (void) fprintf( getLog(), "\nPost kPostObcLoop1_nobranch: ObcIntermediateForce output\n" );
getObcIntermediateForce()->printToFile( getLog() ); getObcIntermediateForce()->printToFile( getLog() );
// output // output
(void) fprintf( getLog(), "\nObcBornRadii2 output\n" ); (void) fprintf( getLog(), "\nPost kPostObcLoop1_nobranch: ObcBornRadii2 output\n" );
getObcBornRadii2()->printToFile( getLog() ); getObcBornRadii2()->printToFile( getLog() );
} }
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
// second major loop // second major OBC loop
(void) fprintf( getLog(), "\nkObcLoop2 messed up see /home/friedrim/src/openmmWork/trunk/OpenMM/platforms/brook/src/gpu/kObcBaseD2.br\n" );
kObcLoop2( (float) getNumberOfParticles(), kObcLoop2( (float) getNumberOfParticles(),
(float) getParticleSizeCeiling(), (float) getParticleSizeCeiling(),
...@@ -1135,7 +1140,6 @@ void BrookGbsa::computeForces( BrookStreamImpl& positionStream, BrookStreamImpl& ...@@ -1135,7 +1140,6 @@ void BrookGbsa::computeForces( BrookStreamImpl& positionStream, BrookStreamImpl&
positionStream.getBrookStream(), positionStream.getBrookStream(),
getObcScaledParticleRadii()->getBrookStream(), getObcScaledParticleRadii()->getBrookStream(),
getObcBornRadii2()->getBrookStream(), getObcBornRadii2()->getBrookStream(),
getObcBornRadii2()->getBrookStream(),
gbsaForceStreams[0]->getBrookStream(), gbsaForceStreams[0]->getBrookStream(),
gbsaForceStreams[1]->getBrookStream(), gbsaForceStreams[1]->getBrookStream(),
gbsaForceStreams[2]->getBrookStream(), gbsaForceStreams[2]->getBrookStream(),
...@@ -1156,16 +1160,16 @@ void BrookGbsa::computeForces( BrookStreamImpl& positionStream, BrookStreamImpl& ...@@ -1156,16 +1160,16 @@ void BrookGbsa::computeForces( BrookStreamImpl& positionStream, BrookStreamImpl&
getPartialForceStreamWidth( ) ); getPartialForceStreamWidth( ) );
BrookStreamInternal* brookStreamInternalPos = positionStream.getBrookStreamImpl(); BrookStreamInternal* brookStreamInternalPos = positionStream.getBrookStreamImpl();
(void) fprintf( getLog(), "\nPositionStream\n" ); (void) fprintf( getLog(), "\nPost kObcLoop2: PositionStream\n" );
brookStreamInternalPos->printToFile( getLog() ); brookStreamInternalPos->printToFile( getLog() );
(void) fprintf( getLog(), "\nObcScaledParticleRadii\n" ); (void) fprintf( getLog(), "\nPost kObcLoop2: ObcScaledParticleRadii\n" );
getObcScaledParticleRadii()->printToFile( getLog() ); getObcScaledParticleRadii()->printToFile( getLog() );
(void) fprintf( getLog(), "\ngetObcBornRadii2\n" ); (void) fprintf( getLog(), "\nPost kObcLoop2: ObcBornRadii2\n" );
getObcBornRadii2()->printToFile( getLog() ); getObcBornRadii2()->printToFile( getLog() );
(void) fprintf( getLog(), "\nForceStreams\n" ); (void) fprintf( getLog(), "\nPost kObcLoop2: ForceStreams\n" );
for( int ii = 0; ii < 4; ii++ ){ for( int ii = 0; ii < 4; ii++ ){
gbsaForceStreams[ii]->printToFile( getLog() ); gbsaForceStreams[ii]->printToFile( getLog() );
} }
...@@ -1212,19 +1216,20 @@ void BrookGbsa::computeForces( BrookStreamImpl& positionStream, BrookStreamImpl& ...@@ -1212,19 +1216,20 @@ void BrookGbsa::computeForces( BrookStreamImpl& positionStream, BrookStreamImpl&
getSoluteDielectric(), getSoluteDielectric(),
getSolventDielectric(), includeAceTerm ); getSolventDielectric(), includeAceTerm );
(void) fprintf( getLog(), "\nPartialForceStreams\n" ); (void) fprintf( getLog(), "\nPost kPostObcLoop2_nobranch: PartialForceStreams\n" );
for( int ii = 0; ii < 4; ii++ ){ for( int ii = 0; ii < 4; ii++ ){
(void) fprintf( getLog(), "\nPost kPostObcLoop2_nobranch: PartialForceStreams %d\n", ii );
gbsaForceStreams[ii]->printToFile( getLog() ); gbsaForceStreams[ii]->printToFile( getLog() );
} }
BrookStreamInternal* brookStreamInternalF = forceStream.getBrookStreamImpl(); BrookStreamInternal* brookStreamInternalF = forceStream.getBrookStreamImpl();
(void) fprintf( getLog(), "\nForceStream\n" ); (void) fprintf( getLog(), "\nPost kPostObcLoop2_nobranch: ForceStream\n" );
brookStreamInternalF->printToFile( getLog() ); brookStreamInternalF->printToFile( getLog() );
(void) fprintf( getLog(), "\nChain\n" ); (void) fprintf( getLog(), "\nPost kPostObcLoop2_nobranch: Chain\n" );
getObcChain()->printToFile( getLog() ); getObcChain()->printToFile( getLog() );
(void) fprintf( getLog(), "\nBornR\n" ); (void) fprintf( getLog(), "\nPost kPostObcLoop2_nobranch: BornR\n" );
getObcBornRadii()->printToFile( getLog() ); getObcBornRadii()->printToFile( getLog() );
} }
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
* -------------------------------------------------------------------------- */ * -------------------------------------------------------------------------- */
#include <vector> #include <vector>
#include <set>
#include "BrookStreamImpl.h" #include "BrookStreamImpl.h"
#include "BrookPlatform.h" #include "BrookPlatform.h"
...@@ -307,7 +306,7 @@ class BrookGbsa : public BrookCommon { ...@@ -307,7 +306,7 @@ class BrookGbsa : public BrookCommon {
* *
*/ */
int calculateBornRadii( const Stream& positions ); // int calculateBornRadii( const Stream& positions );
/* /*
* Setup of Gbsa parameters * Setup of Gbsa parameters
...@@ -337,19 +336,6 @@ class BrookGbsa : public BrookCommon { ...@@ -337,19 +336,6 @@ class BrookGbsa : public BrookCommon {
std::string getContentsString( int level = 0 ) const; std::string getContentsString( int level = 0 ) const;
/*
* Calculate energy
*
* @param particlePositions particle positions
* @return energy
*
* @throw OpenMMException if _cpuObc or charges are not set
*
* */
double getEnergy( const Stream& particlePositions );
/** /**
* Compute forces * Compute forces
* *
...@@ -421,13 +407,10 @@ class BrookGbsa : public BrookCommon { ...@@ -421,13 +407,10 @@ class BrookGbsa : public BrookCommon {
int _bornRadiiInitialized; int _bornRadiiInitialized;
// particle charges // CpuObc reference -- was used to calculate initial Born radii
// no longer used -- to be removed?
RealOpenMM* _charges;
// CpuObc reference
CpuObc* _cpuObc; // CpuObc* _cpuObc;
/* /*
* Setup of stream dimensions * Setup of stream dimensions
...@@ -439,7 +422,7 @@ class BrookGbsa : public BrookCommon { ...@@ -439,7 +422,7 @@ class BrookGbsa : public BrookCommon {
* *
* */ * */
int initializeStreamSizes( int particleStreamSize, int particleStreamWidth ); int _initializeStreamSizes( int particleStreamSize, int particleStreamWidth );
/** /**
* Initialize stream dimensions * Initialize stream dimensions
...@@ -451,7 +434,7 @@ class BrookGbsa : public BrookCommon { ...@@ -451,7 +434,7 @@ class BrookGbsa : public BrookCommon {
* *
*/ */
int initializeStreamSizes( int numberOfParticles, const Platform& platform ); int _initializeStreamSizes( int numberOfParticles, const Platform& platform );
/** /**
* Initialize stream dimensions and streams * Initialize stream dimensions and streams
...@@ -462,7 +445,7 @@ class BrookGbsa : public BrookCommon { ...@@ -462,7 +445,7 @@ class BrookGbsa : public BrookCommon {
* *
*/ */
int initializeStreams( const Platform& platform ); int _initializeStreams( const Platform& platform );
/* /*
* Setup of stream dimensions for partial force streams * Setup of stream dimensions for partial force streams
...@@ -474,7 +457,7 @@ class BrookGbsa : public BrookCommon { ...@@ -474,7 +457,7 @@ class BrookGbsa : public BrookCommon {
* *
* */ * */
int initializePartialForceStreamSize( int particleStreamSize, int particleStreamWidth ); int _initializePartialForceStreamSize( int particleStreamSize, int particleStreamWidth );
}; };
......
...@@ -123,7 +123,7 @@ void BrookIntegrateLangevinStepKernel::initialize( const System& system, const L ...@@ -123,7 +123,7 @@ void BrookIntegrateLangevinStepKernel::initialize( const System& system, const L
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
static const int printOn = 1; static const int printOn = 0;
static const std::string methodName = "BrookIntegrateLangevinStepKernel::initialize"; static const std::string methodName = "BrookIntegrateLangevinStepKernel::initialize";
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
......
...@@ -231,7 +231,7 @@ int BrookLangevinDynamics::_updateDerivedParameters( void ){ ...@@ -231,7 +231,7 @@ int BrookLangevinDynamics::_updateDerivedParameters( void ){
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
static const char* methodName = "\nBrookLangevinDynamics::_updateDerivedParameters"; static const std::string methodName = "\nBrookLangevinDynamics::_updateDerivedParameters";
static const BrookOpenMMFloat zero = 0.0; static const BrookOpenMMFloat zero = 0.0;
static const BrookOpenMMFloat one = 1.0; static const BrookOpenMMFloat one = 1.0;
...@@ -324,7 +324,7 @@ int BrookLangevinDynamics::updateParameters( double temperature, double friction ...@@ -324,7 +324,7 @@ int BrookLangevinDynamics::updateParameters( double temperature, double friction
static int showUpdate = 1; static int showUpdate = 1;
static int maxShowUpdate = 3; static int maxShowUpdate = 3;
static const char* methodName = "\nBrookLangevinDynamics::updateParameters"; static const std::string methodName = "\nBrookLangevinDynamics::updateParameters";
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
...@@ -369,7 +369,7 @@ int BrookLangevinDynamics::update( BrookStreamImpl& positionStream, BrookStreamI ...@@ -369,7 +369,7 @@ int BrookLangevinDynamics::update( BrookStreamImpl& positionStream, BrookStreamI
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
static const char* methodName = "\nBrookLangevinDynamics::update"; static const std::string methodName = "\nBrookLangevinDynamics::update";
static const int PrintOn = 0; static const int PrintOn = 0;
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
...@@ -671,7 +671,7 @@ const BrookOpenMMFloat* BrookLangevinDynamics::getDerivedParameters( void ) cons ...@@ -671,7 +671,7 @@ const BrookOpenMMFloat* BrookLangevinDynamics::getDerivedParameters( void ) cons
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
// static const char* methodName = "\nBrookLangevinDynamics::getDerivedParameters"; // static const std::string methodName = "\nBrookLangevinDynamics::getDerivedParameters";
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
......
...@@ -66,8 +66,8 @@ BrookRandomNumberGenerator::BrookRandomNumberGenerator( ){ ...@@ -66,8 +66,8 @@ BrookRandomNumberGenerator::BrookRandomNumberGenerator( ){
_rvStreamIndex = 0; _rvStreamIndex = 0;
_rvStreamOffset = 0; _rvStreamOffset = 0;
_numberOfShuffles = 0; _numberOfShuffles = 0;
_maxShuffles = 0; //_maxShuffles = 0;
//_maxShuffles = 100; _maxShuffles = 100;
_loadBuffer = NULL; _loadBuffer = NULL;
_shuffleIndices = NULL; _shuffleIndices = NULL;
...@@ -79,10 +79,9 @@ BrookRandomNumberGenerator::BrookRandomNumberGenerator( ){ ...@@ -79,10 +79,9 @@ BrookRandomNumberGenerator::BrookRandomNumberGenerator( ){
// set randomNumber seed // set randomNumber seed
_randomNumberSeed = 1393; _randomNumberSeed = 1393;
_randomNumberGenerator = Mersenne; //_randomNumberGenerator = Mersenne;
_randomNumberGenerator = Kiss; _randomNumberGenerator = Kiss;
//_randomNumberSeed = randomNumberSeed ? randomNumberSeed : 1393;
//SimTKOpenMMUtilities::setRandomNumberSeed( randomNumberSeed ); //SimTKOpenMMUtilities::setRandomNumberSeed( randomNumberSeed );
} }
...@@ -191,7 +190,7 @@ BrookOpenMMFloat BrookRandomNumberGenerator::_generateGromacsRandomNumber( unsig ...@@ -191,7 +190,7 @@ BrookOpenMMFloat BrookRandomNumberGenerator::_generateGromacsRandomNumber( unsig
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
// static const char* methodName = "\nBrookRandomNumberGenerator::_generateGromacsRandomNumber"; // static const std::string methodName = "\nBrookRandomNumberGenerator::_generateGromacsRandomNumber";
int irand; int irand;
...@@ -248,7 +247,7 @@ void BrookRandomNumberGenerator::_generateRandomsKiss( float* randomV1, float* r ...@@ -248,7 +247,7 @@ void BrookRandomNumberGenerator::_generateRandomsKiss( float* randomV1, float* r
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
// static const char* methodName = "\nBrookRandomNumberGenerator::_generateRandomsKiss"; // static const std::string methodName = "\nBrookRandomNumberGenerator::_generateRandomsKiss";
unsigned int carry = 0; unsigned int carry = 0;
...@@ -363,9 +362,10 @@ int BrookRandomNumberGenerator::_loadRandomNumberStreamsKiss( void ){ ...@@ -363,9 +362,10 @@ int BrookRandomNumberGenerator::_loadRandomNumberStreamsKiss( void ){
static unsigned int state[4]; static unsigned int state[4];
static int stateInitialized = 0; static int stateInitialized = 0;
static int PrintOn = 0;
static const int reseed = 10000; static const int reseed = 10000;
// static const char* methodName = "\nBrookRandomNumberGenerator::_loadRandomNumberStreamsKiss"; static std::string methodName = "\nBrookRandomNumberGenerator::_loadRandomNumberStreamsKiss";
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
...@@ -378,9 +378,9 @@ int BrookRandomNumberGenerator::_loadRandomNumberStreamsKiss( void ){ ...@@ -378,9 +378,9 @@ int BrookRandomNumberGenerator::_loadRandomNumberStreamsKiss( void ){
state[2] = rand(); state[2] = rand();
state[3] = rand(); state[3] = rand();
if( getLog() ){ if( PrintOn && getLog() ){
(void) fprintf( getLog(), "LoadGVStreamsKiss: reset state seeds stateInitialized=%d reseed=%d [%u %u %u %u]\n", (void) fprintf( getLog(), "%s reset state seeds stateInitialized=%d reseed=%d [%u %u %u %u]\n",
stateInitialized, reseed, state[0], state[1], state[2], state[3] ); methodName.c_str(), stateInitialized, reseed, state[0], state[1], state[2], state[3] );
(void) fflush( getLog() ); (void) fflush( getLog() );
} }
...@@ -398,11 +398,11 @@ state[3] = 27587; ...@@ -398,11 +398,11 @@ state[3] = 27587;
float* loadBuffer = _getLoadBuffer(); float* loadBuffer = _getLoadBuffer();
if( getLog() ){ if( PrintOn && getLog() ){
static float count = 0.0f; static float count = 0.0f;
float block = (float) (3*getRandomNumberStreamSize() ); float block = (float) (3*getRandomNumberStreamSize() );
count += 1.0f; count += 1.0f;
(void) fprintf( getLog(), "LoadGVStreamsKiss: count=%.1f ttl=%.3e no./count=%.1f %d %d\n", (void) fprintf( getLog(), "%s: count=%.1f ttl=%.3e no./count=%.1f %d %d\n", methodName.c_str(),
count, block*count, block, getRandomNumberStreamSize(), getNumberOfRandomNumberStreams() ); count, block*count, block, getRandomNumberStreamSize(), getNumberOfRandomNumberStreams() );
(void) fflush( getLog() ); (void) fflush( getLog() );
} }
...@@ -418,8 +418,8 @@ state[3] = 27587; ...@@ -418,8 +418,8 @@ state[3] = 27587;
getRandomNumberStream( jj )->loadFromArray( loadBuffer ); getRandomNumberStream( jj )->loadFromArray( loadBuffer );
} }
if( getLog() ){ if( PrintOn && getLog() ){
(void) fprintf( getLog(), "LoadGVStreamsKiss: stats\n%s\n", getStatisticsString().c_str() ); (void) fprintf( getLog(), "%s: stats\n%s\n", methodName.c_str(), getStatisticsString().c_str() );
(void) fflush( getLog() ); (void) fflush( getLog() );
} }
...@@ -438,7 +438,8 @@ int BrookRandomNumberGenerator::_loadRandomNumberStreamsMersenne( void ){ ...@@ -438,7 +438,8 @@ int BrookRandomNumberGenerator::_loadRandomNumberStreamsMersenne( void ){
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
// static const char* methodName = "\nBrookRandomNumberGenerator::_loadRandomNumberStreamsMersenne"; static const std::string methodName = "\nBrookRandomNumberGenerator::_loadRandomNumberStreamsMersenne";
static int PrintOn = 0;
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
...@@ -455,8 +456,8 @@ int BrookRandomNumberGenerator::_loadRandomNumberStreamsMersenne( void ){ ...@@ -455,8 +456,8 @@ int BrookRandomNumberGenerator::_loadRandomNumberStreamsMersenne( void ){
getRandomNumberStream( jj )->loadFromArray( loadBuffer ); getRandomNumberStream( jj )->loadFromArray( loadBuffer );
} }
if( getLog() ){ if( PrintOn && getLog() ){
(void) fprintf( getLog(), "_loadRandomNumberStreamsMersenne: stats\n%s\n", getStatisticsString().c_str() ); (void) fprintf( getLog(), "%s: stats\n%s\n", methodName.c_str(), getStatisticsString().c_str() );
(void) fflush( getLog() ); (void) fflush( getLog() );
} }
...@@ -476,17 +477,15 @@ int BrookRandomNumberGenerator::_loadGVStreamsOriginal( void ){ ...@@ -476,17 +477,15 @@ int BrookRandomNumberGenerator::_loadGVStreamsOriginal( void ){
unsigned long int jran; unsigned long int jran;
// static const char* methodName = "\nBrookRandomNumberGenerator::_loadGVStreamsOriginal"; // static const std::string methodName = "\nBrookRandomNumberGenerator::_loadGVStreamsOriginal";
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
float* loadBuffer = _getLoadBuffer(); float* loadBuffer = _getLoadBuffer();
jran = getRandomNumberSeed(); jran = getRandomNumberSeed();
for( int jj = 0; jj < getNumberOfRandomNumberStreams(); jj++ ){ for( int jj = 0; jj < getNumberOfRandomNumberStreams(); jj++ ){
for( int ii = 0; ii < 3*getRandomNumberStreamSize(); ii++ ){ for( int ii = 0; ii < 3*getRandomNumberStreamSize(); ii++ ){
//loadBuffer[i] = sdp->fgauss( &jran );
loadBuffer[ii] = _generateGromacsRandomNumber( &jran ); loadBuffer[ii] = _generateGromacsRandomNumber( &jran );
} }
getRandomNumberStream( jj )->loadFromArray( loadBuffer ); getRandomNumberStream( jj )->loadFromArray( loadBuffer );
...@@ -510,7 +509,7 @@ float* BrookRandomNumberGenerator::_getLoadBuffer( void ){ ...@@ -510,7 +509,7 @@ float* BrookRandomNumberGenerator::_getLoadBuffer( void ){
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
static const char* methodName = "\nBrookRandomNumberGenerator::_getLoadBuffer"; static const std::string methodName = "\nBrookRandomNumberGenerator::_getLoadBuffer";
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
...@@ -542,7 +541,7 @@ int* BrookRandomNumberGenerator::_getShuffleIndices( int size ){ ...@@ -542,7 +541,7 @@ int* BrookRandomNumberGenerator::_getShuffleIndices( int size ){
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
static const char* methodName = "\nBrookRandomNumberGenerator::_getShuffleIndices"; static const std::string methodName = "\nBrookRandomNumberGenerator::_getShuffleIndices";
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
...@@ -587,7 +586,7 @@ int BrookRandomNumberGenerator::_loadGVShuffle( void ){ ...@@ -587,7 +586,7 @@ int BrookRandomNumberGenerator::_loadGVShuffle( void ){
const int np = sizeof(p) / sizeof(p[0]); const int np = sizeof(p) / sizeof(p[0]);
const int pmax = p[np-1]; const int pmax = p[np-1];
// static const char* methodName = "\nBrookRandomNumberGenerator::loadGVShuffle"; // static const std::string methodName = "\nBrookRandomNumberGenerator::loadGVShuffle";
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
...@@ -641,7 +640,7 @@ int BrookRandomNumberGenerator::_shuffleGVStreams( void ){ ...@@ -641,7 +640,7 @@ int BrookRandomNumberGenerator::_shuffleGVStreams( void ){
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
// static const char* methodName = "\nBrookRandomNumberGenerator::_shuffleGVStreams"; // static const std::string methodName = "\nBrookRandomNumberGenerator::_shuffleGVStreams";
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
...@@ -676,7 +675,7 @@ int BrookRandomNumberGenerator::advanceGVCursor( int numberOfRandomValuesConsume ...@@ -676,7 +675,7 @@ int BrookRandomNumberGenerator::advanceGVCursor( int numberOfRandomValuesConsume
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
static const char* methodName = "BrookRandomNumberGenerator::advanceGVCursor"; static const std::string methodName = "BrookRandomNumberGenerator::advanceGVCursor";
static const int PrintOn = 0; static const int PrintOn = 0;
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
...@@ -773,7 +772,7 @@ BrookFloatStreamInternal* BrookRandomNumberGenerator::getRandomNumberStream( int ...@@ -773,7 +772,7 @@ BrookFloatStreamInternal* BrookRandomNumberGenerator::getRandomNumberStream( int
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
static const char* methodName = "\nBrookRandomNumberGenerator::getRandomNumberStream"; static const std::string methodName = "\nBrookRandomNumberGenerator::getRandomNumberStream";
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
...@@ -897,7 +896,6 @@ int BrookRandomNumberGenerator::_initializeStreams( const Platform& platform ){ ...@@ -897,7 +896,6 @@ int BrookRandomNumberGenerator::_initializeStreams( const Platform& platform ){
randomNumberStreamSize, randomNumberStreamWidth, randomNumberStreamSize, randomNumberStreamWidth,
BrookStreamInternal::Float, dangleValue ); BrookStreamInternal::Float, dangleValue );
// insure number of random number streams is > 0 // insure number of random number streams is > 0
// delete if already allocated and then initialize // delete if already allocated and then initialize
......
...@@ -147,7 +147,7 @@ int BrookVelocityCenterOfMassRemoval::removeVelocityCenterOfMass( BrookStreamImp ...@@ -147,7 +147,7 @@ int BrookVelocityCenterOfMassRemoval::removeVelocityCenterOfMass( BrookStreamImp
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
static const char* methodName = "BrookVelocityCenterOfMassRemoval::removeVelocityCenterOfMass"; static const std::string methodName = "BrookVelocityCenterOfMassRemoval::removeVelocityCenterOfMass";
static const int debug = 0; static const int debug = 0;
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
...@@ -229,7 +229,7 @@ int BrookVelocityCenterOfMassRemoval::getVelocityCenterOfMass( BrookStreamImpl& ...@@ -229,7 +229,7 @@ int BrookVelocityCenterOfMassRemoval::getVelocityCenterOfMass( BrookStreamImpl&
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
// static const char* methodName = "\nBrookVelocityCenterOfMassRemoval::getVelocityCenterOfMass"; // static const std::string methodName = "\nBrookVelocityCenterOfMassRemoval::getVelocityCenterOfMass";
BrookOpenMMFloat zero = (BrookOpenMMFloat) 0.0; BrookOpenMMFloat zero = (BrookOpenMMFloat) 0.0;
......
...@@ -140,7 +140,7 @@ int BrookVerletDynamics::updateParameters( double stepSize ){ ...@@ -140,7 +140,7 @@ int BrookVerletDynamics::updateParameters( double stepSize ){
static int showUpdate = 1; static int showUpdate = 1;
static int maxShowUpdate = 3; static int maxShowUpdate = 3;
static const char* methodName = "\nBrookVerletDynamics::updateParameters"; static const std::string methodName = "\nBrookVerletDynamics::updateParameters";
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
......
...@@ -578,6 +578,157 @@ kernel void kforce14_CDLJ( ...@@ -578,6 +578,157 @@ kernel void kforce14_CDLJ(
fj = -fi; fj = -fi;
} }
kernel void kAcosV( float x<>, out float acosVal<> ){
float x2, x3, x5, x7, x9, x11, x13, x15, x17, x19;
float pi2 = 1.57079632679489661923f;
float coefficient3 = 1.0f/6.0f;
float coefficient5 = 3.0f/40.0f;
float coefficient7 = 5.0f/112.0f;
float coefficient9 = 35.0f/1152.0f;
float coefficient11 = 63.0f/2816.0f;
float coefficient13 = 231.0f/13312.0f;
float coefficient15 = 143.0f/10240.0f;
float coefficient17 = 6435.0f/557056.0f;
float coefficient19 = 12155.0f/1245184.0f;
// ---------------------------------------------------------------------------------------
x2 = x*x;
x3 = x*x2;
x5 = x3*x2;
x7 = x5*x2;
x9 = x7*x2;
x11 = x9*x2;
x13 = x11*x2;
x15 = x13*x2;
x17 = x15*x2;
x19 = x17*x2;
acosVal = x19*coefficient19;
acosVal += x17*coefficient17;
acosVal += x15*coefficient15;
acosVal += x13*coefficient13;
acosVal += x11*coefficient11;
acosVal += x9*coefficient9;
acosVal += x7*coefficient7;
acosVal += x5*coefficient5;
acosVal += x3*coefficient3 + x;
acosVal = pi2 - acosVal;
}
kernel void kAcosTanV( float xIn<>, out float acosVal<> ){
const float c1 = 48.70107004404898384f;
const float c2 = 49.5326263772254345f;
const float c3 = 9.40604244231624f;
const float c4 = 48.70107004404996166f;
const float c5 = 65.7663163908956299f;
const float c6 = 21.587934067020262f;
const float tantwelfthpi = 0.26794919243112270647255365849413f;
const float tansixthpi = 0.57735026918962576450914878050196f;
const float sixthpi = 0.52359877559829887307710723054658f;
const float halfpi = 1.5707963267948966192313216916398f;
float x2, y, x;
float sign, complement, region;
// ---------------------------------------------------------------------------------------
complement = 0.0f;
region = 0.0f;
x = xIn;
y = rsqrt( (1.0f + x)*(1.0f - x) );
x *= y;
if( x < 0.0f ){
x = -x;
sign = -1.0f;
} else {
sign = 1.0f;
}
if( x > 1.0f ){
x = 1.0f/x;
complement = 1.0f;
} else {
complement = 0.0f;
}
if( x > tantwelfthpi ){
x = (x-tansixthpi)/(1.0f + tansixthpi*x);
region = sixthpi;
} else {
region = 0.0f;
}
x2 = x*x;
y = (x*(c1 + x2*(c2 + x2*c3))/(c4 + x2*(c5 + x2*(c6 + x2))));
y += region;
y = (complement > 0.0f) ? (halfpi- y) : y;
acosVal = halfpi - sign*y;
}
kernel void kAcos( float xIn, out float acosVal<> ){
const float c1 = 48.70107004404898384f;
const float c2 = 49.5326263772254345f;
const float c3 = 9.40604244231624f;
const float c4 = 48.70107004404996166f;
const float c5 = 65.7663163908956299f;
const float c6 = 21.587934067020262f;
const float tantwelfthpi = 0.26794919243112270647255365849413f;
const float tansixthpi = 0.57735026918962576450914878050196f;
const float sixthpi = 0.52359877559829887307710723054658f;
const float halfpi = 1.5707963267948966192313216916398f;
float x2, y, x;
float sign, complement, region;
// ---------------------------------------------------------------------------------------
// acos(x) = atan(x/sqrt(1-x**2))
x = xIn;
y = rsqrt( (1.0f + x)*(1.0f - x) );
x *= y;
if( x < 0.0f ){
x = -x;
sign = -1.0f;
} else {
sign = 1.0f;
}
if( x > 1.0f ){
x = 1.0f/x;
complement = 1.0f;
} else {
complement = 0.0f;
}
if( x > tantwelfthpi ){
x = (x - tansixthpi)/(1.0f + tansixthpi*x);
region = sixthpi;
} else {
region = 0.0f;
}
x2 = x*x;
y = (x*(c1 + x2*(c2 + x2*c3))/(c4 + x2*(c5 + x2*(c6 + x2))));
y += region;
y = (complement > 0.0f) ? (halfpi- y) : y;
acosVal = halfpi - sign*y;
}
kernel void kbonded_CDLJ ( kernel void kbonded_CDLJ (
float epsfac, float epsfac,
float xstrwidth, float xstrwidth,
...@@ -594,8 +745,7 @@ kernel void kbonded_CDLJ ( ...@@ -594,8 +745,7 @@ kernel void kbonded_CDLJ (
out float3 fj<>, out float3 fj<>,
out float3 fk<>, out float3 fk<>,
out float3 fl<> out float3 fl<>
) ){
{
float3 rij, rkj, rkl, ril; float3 rij, rkj, rkl, ril;
float2 ai, aj, ak, al; float2 ai, aj, ak, al;
...@@ -622,42 +772,46 @@ kernel void kbonded_CDLJ ( ...@@ -622,42 +772,46 @@ kernel void kbonded_CDLJ (
float3 posqi, posqj, posqk, posql; float3 posqi, posqj, posqk, posql;
float sig, eps; float sig, eps;
// i-coordinates
ai.y = round( (atoms.x - fmod( atoms.x, xstrwidth ))/xstrwidth ); ai.y = round( (atoms.x - fmod( atoms.x, xstrwidth ))/xstrwidth );
ai.x = atoms.x - ai.y * xstrwidth; ai.x = atoms.x - ai.y * xstrwidth;
posqi = posq[ ai ]; posqi = posq[ ai ];
if ( atoms.y > -0.5f ) { // j-coordinates
if ( atoms.y > -0.5f ) {
aj.y = round( (atoms.y - fmod( atoms.y, xstrwidth ))/xstrwidth ); aj.y = round( (atoms.y - fmod( atoms.y, xstrwidth ))/xstrwidth );
aj.x = atoms.y - aj.y * xstrwidth; aj.x = atoms.y - aj.y * xstrwidth;
posqj = posq[ aj ]; posqj = posq[ aj ];
} else {
posqj = float3( 0.0f, 1.0f, 0.0f );
} }
else
posqj = float4( 0.0f, 0.0f, 1.0f, 0.0f );
if ( atoms.z > -0.5f ) { // k-coordinates
if ( atoms.z > -0.5f ) {
ak.y = round( (atoms.z - fmod( atoms.z, xstrwidth ))/xstrwidth ); ak.y = round( (atoms.z - fmod( atoms.z, xstrwidth ))/xstrwidth );
ak.x = atoms.z - ak.y * xstrwidth; ak.x = atoms.z - ak.y * xstrwidth;
posqk = posq[ ak ]; posqk = posq[ ak ];
} else {
posqk = float3( 1.0f, 1.0f, 0.0f );
} }
else
posqk = float4( 0.0f, 1.0f, 1.0f, 0.0f ); // l-coordinates
if ( atoms.w > -0.5f ) { if ( atoms.w > -0.5f ) {
al.y = round( (atoms.w - fmod( atoms.w, xstrwidth ))/xstrwidth ); al.y = round( (atoms.w - fmod( atoms.w, xstrwidth ))/xstrwidth );
al.x = atoms.w - al.y * xstrwidth; al.x = atoms.w - al.y * xstrwidth;
posql = posq[ al ]; posql = posq[ al ];
} else { } else {
posql = float4( 1.0f, 1.0f, 1.0f, 0.0f ); posql = float3( 1.0f, 1.0f, 1.0f );
} }
rij = posqi.xyz - posqj.xyz; rij = posqi - posqj;
rkj = posqk.xyz - posqj.xyz; rkj = posqk - posqj;
rkl = posqk.xyz - posql.xyz; rkl = posqk - posql;
ril = posqi.xyz - posql.xyz; ril = posqi - posql;
invlij = rsqrt( dot( rij, rij ) ); invlij = rsqrt( dot( rij, rij ) );
invlkj = rsqrt( dot( rkj, rkj ) ); invlkj = rsqrt( dot( rkj, rkj ) );
...@@ -667,35 +821,31 @@ kernel void kbonded_CDLJ ( ...@@ -667,35 +821,31 @@ kernel void kbonded_CDLJ (
ukj = rkj * invlkj; ukj = rkj * invlkj;
ukl = rkl * invlkl; ukl = rkl * invlkl;
rij_d_ukj = dot( rij, ukj ); rij_d_ukj = dot( rij, ukj );
ukj_d_rkl = dot( ukj, rkl ); ukj_d_rkl = dot( ukj, rkl );
m = cross( uij, ukj ); m = cross( uij, ukj );
n = cross( ukj, ukl ); n = cross( ukj, ukl );
costheta1 = clamp( rij_d_ukj * invlij, -1.0f, 1.0f ); costheta1 = clamp( rij_d_ukj * invlij, -1.0f, 1.0f );
theta1 = acos( costheta1 ); //theta1 = acos( costheta1 );
invsintheta1 = rsqrt( 1.0f - costheta1 * costheta1 ); kAcos( costheta1, theta1 );
invsintheta1 = rsqrt( (1.0f - costheta1) * (1.0f + costheta1) );
costheta2 = clamp( ukj_d_rkl * invlkl, -1.0f, 1.0f ); costheta2 = clamp( ukj_d_rkl * invlkl, -1.0f, 1.0f );
theta2 = acos( costheta2 ); //theta2 = acos( costheta2 );
invsintheta2 = rsqrt( 1.0f - costheta2 * costheta2 ); kAcos( costheta2, theta2 );
invsintheta2 = rsqrt( (1.0f - costheta2) * (1.0f + costheta2) );
cos_phi = clamp( dot(m,n) * invsintheta1 * invsintheta2, -1.0f, 1.0f ); cos_phi = clamp( dot(m,n) * invsintheta1 * invsintheta2, -1.0f, 1.0f );
sgnphi = sign( dot(rij, n) ); sgnphi = sign( dot(rij, n) );
phi = sgnphi * acos( cos_phi ); phi = sgnphi * acos( cos_phi );
mdphi = parm1.w * phi - parm1.z; mdphi = parm1.w * phi - parm1.z;
ddphi = -parm1.y * parm1.w * sin( mdphi ); ddphi = -parm1.y * parm1.w * sin( mdphi );
cos_phi = -cos_phi; cos_phi = -cos_phi;
sin_phi = -sgnphi*sqrt( clamp( 1.0f - cos_phi * cos_phi, 0.0f, 1.0f) ); sin_phi = -sgnphi*sqrt( (1.0f - cos_phi) * (1.0f + cos_phi) );
ddphi_rb = 5.0f * parm1.x; ddphi_rb = 5.0f * parm1.x;
ddphi_rb = 4.0f * parm0.w + ddphi_rb * cos_phi; ddphi_rb = 4.0f * parm0.w + ddphi_rb * cos_phi;
...@@ -704,13 +854,17 @@ kernel void kbonded_CDLJ ( ...@@ -704,13 +854,17 @@ kernel void kbonded_CDLJ (
ddphi_rb = parm0.x + ddphi_rb * cos_phi; ddphi_rb = parm0.x + ddphi_rb * cos_phi;
ddphi_rb = -ddphi_rb * sin_phi; ddphi_rb = -ddphi_rb * sin_phi;
ddphi += ddphi_rb; ddphi += ddphi_rb;
/*
fi = float3( cos_phi, sgnphi, ddphi_rb );
fj = float3( sin_phi, parm1.x, parm0.w );
fk = float3( parm0.z, parm0.y, parm0.x );
fl = float3( ddphi, 0.0f, 0.0f );
*/
fi = (-ddphi * invlij * invsintheta1 * invsintheta1 ) * m; fi = (-ddphi * invlij * invsintheta1 * invsintheta1 ) * m;
fl = ( ddphi * invlkl * invsintheta2 * invsintheta2 ) * n; fl = ( ddphi * invlkl * invsintheta2 * invsintheta2 ) * n;
u = rij_d_ukj * invlkj * fi; u = rij_d_ukj * invlkj * fi;
v = ukj_d_rkl * invlkj * fl; v = ukj_d_rkl * invlkj * fl;
s = u - v; s = u - v;
...@@ -719,9 +873,6 @@ kernel void kbonded_CDLJ ( ...@@ -719,9 +873,6 @@ kernel void kbonded_CDLJ (
fk = -(s + fl); fk = -(s + fl);
fs = -parm2.y * ( theta1 - parm2.x ); fs = -parm2.y * ( theta1 - parm2.x );
st = fs * invsintheta1; st = fs * invsintheta1;
st = clamp( st, -100000.0f, 100000.0f ); st = clamp( st, -100000.0f, 100000.0f );
...@@ -762,17 +913,15 @@ kernel void kbonded_CDLJ ( ...@@ -762,17 +913,15 @@ kernel void kbonded_CDLJ (
fi += fi_bond; fi += fi_bond;
fj += -fi_bond; fj += -fi_bond;
fi_bond = parm3.w * ( 1.0f - parm3.z * invlkj ) * rkj; fi_bond = parm3.w * ( 1.0f - parm3.z * invlkj ) * rkj;
fj += fi_bond; fj += fi_bond;
fk += -fi_bond; fk += -fi_bond;
fi_bond = -parm4.y * ( 1.0f - parm4.x * invlkl ) * rkl; fi_bond = -parm4.y * ( 1.0f - parm4.x * invlkl ) * rkl;
fk += fi_bond; fk += fi_bond;
fl += -fi_bond; fl += -fi_bond;
if ( parm4.z > -0.5f ) { if( parm4.z > -0.5f ){
r2 = dot( ril, ril ); r2 = dot( ril, ril );
fs = scalar_force_single_CDLJ( charge, epsfac, parm4.z, parm4.w, r2, nbparams ); fs = scalar_force_single_CDLJ( charge, epsfac, parm4.z, parm4.w, r2, nbparams );
fi_pair = fs * ril; fi_pair = fs * ril;
......
...@@ -828,15 +828,10 @@ kernel void kPostObcLoop1_nobranch( ...@@ -828,15 +828,10 @@ kernel void kPostObcLoop1_nobranch(
for( i = 0.0f; i < repfac; i += 1.0f ){ for( i = 0.0f; i < repfac; i += 1.0f ){
// qIndex = floor( forceIndex/iUnroll );
qIndex = round( (forceIndex - fmod( forceIndex, iUnroll))/iUnroll ); qIndex = round( (forceIndex - fmod( forceIndex, iUnroll))/iUnroll );
qOff = forceIndex - iUnroll*qIndex; qOff = forceIndex - iUnroll*qIndex;
// pindex.y = floor( qIndex/ pStreamWidth );
pindex.y = round( (qIndex - fmod( qIndex, pStreamWidth ))/pStreamWidth ); pindex.y = round( (qIndex - fmod( qIndex, pStreamWidth ))/pStreamWidth );
// pindex.x = qIndex - pindex.y*pStreamWidth + qOff;
pindex.x = qIndex - pindex.y*pStreamWidth; pindex.x = qIndex - pindex.y*pStreamWidth;
o1 = pstream1[ pindex ]; o1 = pstream1[ pindex ];
...@@ -1140,7 +1135,7 @@ kernel void loop2InternalNoSum( float3 d1, float3 d2, float3 d3, float3 d4, floa ...@@ -1140,7 +1135,7 @@ kernel void loop2InternalNoSum( float3 d1, float3 d2, float3 d3, float3 d4, floa
//1376 FLOPS //1376 FLOPS
kernel void kObcLoop2( float numberOfAtoms, float roundedUpAtoms, float duplicationFactor, kernel void kObcLoop2( float numberOfAtoms, float roundedUpAtoms, float duplicationFactor,
float streamWidth, float fstreamWidth, float3 posq[][], float streamWidth, float fstreamWidth, float3 posq[][],
float scaledAtomicRadii[][], float bornForceFactor[][], float2 scaledAtomicRadii[][], float bornForceFactor[][],
out float4 bornForce1<>, out float4 bornForce2<>, out float4 bornForce1<>, out float4 bornForce2<>,
out float4 bornForce3<>, out float4 bornForce4<> ){ out float4 bornForce3<>, out float4 bornForce4<> ){
...@@ -1221,7 +1216,6 @@ kernel void kObcLoop2( float numberOfAtoms, float roundedUpAtoms, float duplicat ...@@ -1221,7 +1216,6 @@ kernel void kObcLoop2( float numberOfAtoms, float roundedUpAtoms, float duplicat
i1pos = posq[ iAtom ]; i1pos = posq[ iAtom ];
i1BornForceFactor = bornForceFactor[ iAtom ]; i1BornForceFactor = bornForceFactor[ iAtom ];
//i1AtomicRadii = atomicRadii[ iAtom ];
i1AtomicRadii = scaledAtomicRadii[ iAtom ].y; i1AtomicRadii = scaledAtomicRadii[ iAtom ].y;
i1ScaledAtomicRadii = scaledAtomicRadii[ iAtom ].x; i1ScaledAtomicRadii = scaledAtomicRadii[ iAtom ].x;
bornForce1 = float4( 0.0f, 0.0f, 0.0f, 0.0f ); bornForce1 = float4( 0.0f, 0.0f, 0.0f, 0.0f );
...@@ -1231,7 +1225,6 @@ kernel void kObcLoop2( float numberOfAtoms, float roundedUpAtoms, float duplicat ...@@ -1231,7 +1225,6 @@ kernel void kObcLoop2( float numberOfAtoms, float roundedUpAtoms, float duplicat
iAtom.x += 1; iAtom.x += 1;
i2pos = posq[ iAtom ]; i2pos = posq[ iAtom ];
i2BornForceFactor = bornForceFactor[ iAtom ]; i2BornForceFactor = bornForceFactor[ iAtom ];
//i2AtomicRadii = atomicRadii[ iAtom ];
i2AtomicRadii = scaledAtomicRadii[ iAtom ].y; i2AtomicRadii = scaledAtomicRadii[ iAtom ].y;
i2ScaledAtomicRadii = scaledAtomicRadii[ iAtom ].x; i2ScaledAtomicRadii = scaledAtomicRadii[ iAtom ].x;
bornForce2 = float4( 0.0f, 0.0f, 0.0f, 0.0f ); bornForce2 = float4( 0.0f, 0.0f, 0.0f, 0.0f );
...@@ -1241,7 +1234,6 @@ kernel void kObcLoop2( float numberOfAtoms, float roundedUpAtoms, float duplicat ...@@ -1241,7 +1234,6 @@ kernel void kObcLoop2( float numberOfAtoms, float roundedUpAtoms, float duplicat
iAtom.x += 1; iAtom.x += 1;
i3pos = posq[ iAtom ]; i3pos = posq[ iAtom ];
i3BornForceFactor = bornForceFactor[ iAtom ]; i3BornForceFactor = bornForceFactor[ iAtom ];
//i3AtomicRadii = atomicRadii[ iAtom ];
i3AtomicRadii = scaledAtomicRadii[ iAtom ].y; i3AtomicRadii = scaledAtomicRadii[ iAtom ].y;
i3ScaledAtomicRadii = scaledAtomicRadii[ iAtom ].x; i3ScaledAtomicRadii = scaledAtomicRadii[ iAtom ].x;
bornForce3 = float4( 0.0f, 0.0f, 0.0f, 0.0f ); bornForce3 = float4( 0.0f, 0.0f, 0.0f, 0.0f );
...@@ -1251,24 +1243,22 @@ kernel void kObcLoop2( float numberOfAtoms, float roundedUpAtoms, float duplicat ...@@ -1251,24 +1243,22 @@ kernel void kObcLoop2( float numberOfAtoms, float roundedUpAtoms, float duplicat
iAtom.x += 1; iAtom.x += 1;
i4pos = posq[ iAtom ]; i4pos = posq[ iAtom ];
i4BornForceFactor = bornForceFactor[ iAtom ]; i4BornForceFactor = bornForceFactor[ iAtom ];
//i4AtomicRadii = atomicRadii[ iAtom ];
i4AtomicRadii = scaledAtomicRadii[ iAtom ].y; i4AtomicRadii = scaledAtomicRadii[ iAtom ].y;
i4ScaledAtomicRadii = scaledAtomicRadii[ iAtom ].x; i4ScaledAtomicRadii = scaledAtomicRadii[ iAtom ].x;
bornForce4 = float4( 0.0f, 0.0f, 0.0f, 0.0f ); bornForce4 = float4( 0.0f, 0.0f, 0.0f, 0.0f );
// create float4 for main vars // create float4 for main vars
//iBornForceFactor = float4( i1BornForceFactor, i2BornForceFactor, i3BornForceFactor, i4BornForceFactor );
iAtomicRadii = float4( i1AtomicRadii, i2AtomicRadii, i3AtomicRadii, i4AtomicRadii ); iAtomicRadii = float4( i1AtomicRadii, i2AtomicRadii, i3AtomicRadii, i4AtomicRadii );
iScaledAtomicRadii = float4( i1ScaledAtomicRadii, i2ScaledAtomicRadii, i3ScaledAtomicRadii, i4ScaledAtomicRadii ); iScaledAtomicRadii = float4( i1ScaledAtomicRadii, i2ScaledAtomicRadii, i3ScaledAtomicRadii, i4ScaledAtomicRadii );
// inner loop indices setup // inner loop indices setup
//changed the following instruction for rounding issues on some ASICs //changed the following instruction for rounding issues on some ASICs
//whichRep = floor( forceIndex / roundedUpAtoms ); //whichRep = floor( forceIndex / roundedUpAtoms );
tmp = fmod(forceIndex, roundedUpAtoms); tmp = fmod(forceIndex, roundedUpAtoms);
whichRep = round((forceIndex - tmp)/roundedUpAtoms); whichRep = round((forceIndex - tmp)/roundedUpAtoms);
//jBlock = 1 + floor( numberOfAtoms/(duplicationFactor*streamWidth ) );
jBlock = 1 + round( (numberOfAtoms-fmod( numberOfAtoms, (duplicationFactor*streamWidth) )) / (duplicationFactor*streamWidth) ); jBlock = 1 + round( (numberOfAtoms-fmod( numberOfAtoms, (duplicationFactor*streamWidth) )) / (duplicationFactor*streamWidth) );
jStart = whichRep*jBlock; jStart = whichRep*jBlock;
...@@ -1314,7 +1304,6 @@ kernel void kObcLoop2( float numberOfAtoms, float roundedUpAtoms, float duplicat ...@@ -1314,7 +1304,6 @@ kernel void kObcLoop2( float numberOfAtoms, float roundedUpAtoms, float duplicat
jAtom.x += 1.0f; jAtom.x += 1.0f;
//jBornForceFactor = float4( j1BornForceFactor, j2BornForceFactor, j3BornForceFactor, j4BornForceFactor );
jAtomicRadii = float4( j1AtomicRadii, j2AtomicRadii, j3AtomicRadii, j4AtomicRadii ); jAtomicRadii = float4( j1AtomicRadii, j2AtomicRadii, j3AtomicRadii, j4AtomicRadii );
jScaledAtomicRadii = float4( j1ScaledAtomicRadii, j2ScaledAtomicRadii, j3ScaledAtomicRadii, j4ScaledAtomicRadii ); jScaledAtomicRadii = float4( j1ScaledAtomicRadii, j2ScaledAtomicRadii, j3ScaledAtomicRadii, j4ScaledAtomicRadii );
......
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