"vscode:/vscode.git/clone" did not exist on "53690fef7d5995b219b647bc35945f81deee10ef"
Commit d6132ea0 authored by Mark Friedrichs's avatar Mark Friedrichs
Browse files

Mods

parent ce8d2142
...@@ -1073,10 +1073,11 @@ int BrookBonded::_loadInvMaps( int nbondeds, int nparticles, int *particles, int ...@@ -1073,10 +1073,11 @@ int BrookBonded::_loadInvMaps( int nbondeds, int nparticles, int *particles, int
static const std::string methodName = "BrookBonded::_loadInvMaps"; static const std::string methodName = "BrookBonded::_loadInvMaps";
static int printOn = 0; static int printOn = 0;
double dangleValue = 0.0; double dangleValue = 0.0;
FILE* log = NULL;
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
printOn = (printOn && getLog()) ? 1 : 0; printOn = (printOn && getLog()) ? printOn : 0;
// get particle stream size // get particle stream size
...@@ -1121,10 +1122,11 @@ int BrookBonded::_loadInvMaps( int nbondeds, int nparticles, int *particles, int ...@@ -1121,10 +1122,11 @@ int BrookBonded::_loadInvMaps( int nbondeds, int nparticles, int *particles, int
} }
if( printOn ){ if( printOn ){
(void) fprintf( getLog(), "%s force stream strms=%d nbondeds=%d max counts=[%d %d %d %d] strSz&Wd=%d %d\n", methodName.c_str(), getNumberOfForceStreams(), log = getLog();
(void) fprintf( log, "%s force stream strms=%d nbondeds=%d max counts=[%d %d %d %d] strSz&Wd=%d %d\n", methodName.c_str(), getNumberOfForceStreams(),
nbondeds, getMaxInverseMapStreamCount(0), getMaxInverseMapStreamCount(1), getMaxInverseMapStreamCount(2), getMaxInverseMapStreamCount(3), nbondeds, getMaxInverseMapStreamCount(0), getMaxInverseMapStreamCount(1), getMaxInverseMapStreamCount(2), getMaxInverseMapStreamCount(3),
particleStreamSize, particleStreamWidth ); particleStreamSize, particleStreamWidth );
(void) fflush( getLog() ); (void) fflush( log );
} }
// load data // load data
...@@ -1134,18 +1136,17 @@ int BrookBonded::_loadInvMaps( int nbondeds, int nparticles, int *particles, int ...@@ -1134,18 +1136,17 @@ int BrookBonded::_loadInvMaps( int nbondeds, int nparticles, int *particles, int
block[jj] = -1.0f; block[jj] = -1.0f;
} }
(void) fprintf( stderr, "%s _gpuCalcInvMap %d getInverseMapStreamCount=%d\n", methodName.c_str(), ii, getInverseMapStreamCount( ii ) ); (void) fflush( getLog() ); //(void) fprintf( stderr, "%s _gpuCalcInvMap %d getInverseMapStreamCount=%d\n", methodName.c_str(), ii, getInverseMapStreamCount( ii ) ); (void) fflush( log );
_gpuCalcInvMap( ii, 4, nbondeds, nparticles, particles, getMaxInverseMapStreamCount( ii ), counts, invmaps, &(_inverseMapStreamCount[ii]) ); _gpuCalcInvMap( ii, 4, nbondeds, nparticles, particles, getMaxInverseMapStreamCount( ii ), counts, invmaps, &(_inverseMapStreamCount[ii]) );
_gpuPrintInvMaps( _inverseMapStreamCount[ii], nparticles, counts, invmaps, stderr ); //_gpuPrintInvMaps( _inverseMapStreamCount[ii], nparticles, counts, invmaps, stderr );
_validateInverseMapStreamCount( ii, _inverseMapStreamCount[ii] ); _validateInverseMapStreamCount( ii, _inverseMapStreamCount[ii] );
for( int jj = 0; jj < _inverseMapStreamCount[ii]; jj++ ){ for( int jj = 0; jj < _inverseMapStreamCount[ii]; jj++ ){
_inverseStreamMaps[ii][jj]->loadFromArray( invmaps[jj] ); _inverseStreamMaps[ii][jj]->loadFromArray( invmaps[jj] );
//if( printOn ){ if( printOn ){
if( 1 ){
FILE* log = stderr; FILE* log = stderr;
(void) fprintf( log, "%s inverseMap stream strms=%d count=%d index=%d %d InverseMapStreamCount[ii]=%d max=%d\n", (void) fprintf( log, "%s inverseMap stream strms=%d count=%d index=%d %d InverseMapStreamCount[ii]=%d max=%d\n",
methodName.c_str(), getNumberOfForceStreams(), _inverseMapStreamCount[ii], ii, jj, methodName.c_str(), getNumberOfForceStreams(), _inverseMapStreamCount[ii], ii, jj,
...@@ -1175,8 +1176,8 @@ _gpuPrintInvMaps( _inverseMapStreamCount[ii], nparticles, counts, invmaps, stder ...@@ -1175,8 +1176,8 @@ _gpuPrintInvMaps( _inverseMapStreamCount[ii], nparticles, counts, invmaps, stder
// diagnostics // diagnostics
if( printOn ){ if( printOn ){
(void) fprintf( getLog(), "%s done\n", methodName.c_str() ); (void) fprintf( log, "%s done\n", methodName.c_str() );
(void) fflush( getLog() ); (void) fflush( log );
} }
// free memory // free memory
...@@ -1587,13 +1588,20 @@ int BrookBonded::_gpuCalcInvMap( int posflag, int niparticles, int nints, int np ...@@ -1587,13 +1588,20 @@ int BrookBonded::_gpuCalcInvMap( int posflag, int niparticles, int nints, int np
//char value[MAX_LINE_CHARS]; //char value[MAX_LINE_CHARS];
static const char* Set = "Set"; static const char* Set = "Set";
static const char* NotSet = "Not set"; static const char* NotSet = "Not set";
static const int printOn = 0; int printOn = 0;
FILE* log;
int particleRange[2] = { 90000000, -90000000 }; int particleRange[2] = { 90000000, -90000000 };
int mapnumRange[2] = { 90000000, -90000000 }; int mapnumRange[2] = { 90000000, -90000000 };
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
if( printOn && getLog() ){
log = getLog();
} else {
printOn = 0;
}
memset( counts, 0, sizeof( int )*nparticles ); memset( counts, 0, sizeof( int )*nparticles );
for( i = 0; i < nmaps; i++ ){ for( i = 0; i < nmaps; i++ ){
...@@ -1608,9 +1616,9 @@ int BrookBonded::_gpuCalcInvMap( int posflag, int niparticles, int nints, int np ...@@ -1608,9 +1616,9 @@ int BrookBonded::_gpuCalcInvMap( int posflag, int niparticles, int nints, int np
//Now note down the positions where each particle occurs //Now note down the positions where each particle occurs
if( printOn && getLog() ){ if( printOn ){
(void) fprintf( getLog(), "%s: pos=%d ni=%d nints=%d nparticles=%d nmaps=<%d>\n", methodName.c_str(), posflag, niparticles, nints, nparticles, nmaps ); (void) fprintf( log, "%s: pos=%d ni=%d nints=%d nparticles=%d nmaps=<%d>\n", methodName.c_str(), posflag, niparticles, nints, nparticles, nmaps );
(void) fflush( getLog() ); (void) fflush( log );
} }
for( i = 0; i < nints; i++ ){ for( i = 0; i < nints; i++ ){
...@@ -1622,18 +1630,19 @@ int BrookBonded::_gpuCalcInvMap( int posflag, int niparticles, int nints, int np ...@@ -1622,18 +1630,19 @@ int BrookBonded::_gpuCalcInvMap( int posflag, int niparticles, int nints, int np
continue; continue;
} }
if( particle < particleRange[0] ){ if( particle < particleRange[0] ){
particleRange[0] = particle; particleRange[0] = particle;
} }
if( particle > particleRange[1] ){ if( particle > particleRange[1] ){
particleRange[1] = particle; particleRange[1] = particle;
} }
//Check to make sure we're inside the limits //Check to make sure we're inside the limits
if ( counts[particle] > nmaps * 4 ){ if ( counts[particle] > nmaps * 4 ){
if( printOn && getLog() ){ if( printOn ){
(void) fprintf( getLog(), "%s Particle %d has too many proper torsions (%d, max %d)\n", (void) fprintf( log, "%s Particle %d has too many proper torsions (%d, max %d)\n",
methodName.c_str(), particle, counts[particle], nmaps*4 ); methodName.c_str(), particle, counts[particle], nmaps*4 );
(void) fflush( getLog() ); (void) fflush( log );
} }
std::stringstream message; std::stringstream message;
message << methodName << " Particle " << particle << " has too many proper torsions; valid range:(" << counts[particle] << ", " << nmaps*4 << ")"; message << methodName << " Particle " << particle << " has too many proper torsions; valid range:(" << counts[particle] << ", " << nmaps*4 << ")";
...@@ -1659,9 +1668,9 @@ if( particle > particleRange[1] ){ ...@@ -1659,9 +1668,9 @@ if( particle > particleRange[1] ){
case 2: invmaps[mapnum][particle].z = (float) i; break; case 2: invmaps[mapnum][particle].z = (float) i; break;
case 3: invmaps[mapnum][particle].w = (float) i; break; case 3: invmaps[mapnum][particle].w = (float) i; break;
default: default:
if( printOn && getLog() ){ if( printOn ){
(void) fprintf( getLog(), "mapcomp %d invalid -- impossible!\n", mapcomp ); (void) fprintf( log, "mapcomp %d invalid -- impossible!\n", mapcomp );
(void) fflush( getLog() ); (void) fflush( log );
} }
std::stringstream message; std::stringstream message;
message << methodName << " mapcomp " << mapcomp << " invalid -- actually impossible!"; message << methodName << " mapcomp " << mapcomp << " invalid -- actually impossible!";
...@@ -1671,12 +1680,12 @@ if( particle > particleRange[1] ){ ...@@ -1671,12 +1680,12 @@ if( particle > particleRange[1] ){
counts[particle]++; counts[particle]++;
if( mapnum < mapnumRange[0] ){ if( mapnum < mapnumRange[0] ){
mapnumRange[0] = mapnum; mapnumRange[0] = mapnum;
} }
if( mapnum > mapnumRange[1] ){ if( mapnum > mapnumRange[1] ){
mapnumRange[1] = mapnum; mapnumRange[1] = mapnum;
} }
//fprintf( gpu->log, "%d particle=%d mapcomp=%d counts[]=%d mapnum=%d\n", i, particle, mapcomp, counts[particle], mapnum ); //fprintf( gpu->log, "%d particle=%d mapcomp=%d counts[]=%d mapnum=%d\n", i, particle, mapcomp, counts[particle], mapnum );
...@@ -1684,11 +1693,11 @@ if( mapnum > mapnumRange[1] ){ ...@@ -1684,11 +1693,11 @@ if( mapnum > mapnumRange[1] ){
(*nimaps)++; (*nimaps)++;
if( printOn && getLog() ){ if( printOn ){
(void) fprintf( getLog(), "%s mnmaps=%d Ranges: particle [%d %d] mapnum [%d %d]\n", (void) fprintf( log, "%s mnmaps=%d Ranges: particle [%d %d] mapnum [%d %d]\n",
methodName.c_str(), *nimaps, particleRange[0], particleRange[1], mapnumRange[0], mapnumRange[1] ); methodName.c_str(), *nimaps, particleRange[0], particleRange[1], mapnumRange[0], mapnumRange[1] );
(void) fflush( getLog() ); (void) fflush( log );
} }
return DefaultReturnValue; return DefaultReturnValue;
} }
...@@ -1830,6 +1839,7 @@ void BrookBonded::computeForces( BrookStreamImpl& positionStream, BrookStreamImp ...@@ -1830,6 +1839,7 @@ void BrookBonded::computeForces( BrookStreamImpl& positionStream, BrookStreamImp
static const std::string methodName = "BrookBonded::computeForces"; static const std::string methodName = "BrookBonded::computeForces";
static int printOn = 0; static int printOn = 0;
FILE* log;
static const int I_Stream = 0; static const int I_Stream = 0;
static const int J_Stream = 1; static const int J_Stream = 1;
...@@ -1878,7 +1888,7 @@ void BrookBonded::computeForces( BrookStreamImpl& positionStream, BrookStreamImp ...@@ -1878,7 +1888,7 @@ void BrookBonded::computeForces( BrookStreamImpl& positionStream, BrookStreamImp
// diagnostics // diagnostics
if( printOn ){ if( printOn ){
FILE* log = getLog(); log = getLog();
//FILE* log = stderr; //FILE* log = stderr;
int countPrintInvMap[4] = { 3, 5, 2, 4 }; int countPrintInvMap[4] = { 3, 5, 2, 4 };
...@@ -2025,12 +2035,9 @@ void BrookBonded::computeForces( BrookStreamImpl& positionStream, BrookStreamImp ...@@ -2025,12 +2035,9 @@ void BrookBonded::computeForces( BrookStreamImpl& positionStream, BrookStreamImp
// diagnostics // diagnostics
if( printOn ){ if( printOn ){
(void) fprintf( log, "%s Post 3_4/3_5 forces\n", methodName.c_str() );
FILE* log = getLog() ? getLog() : stderr;
(void) fprintf( log, "\nPost 3_4/3_5 && NB forces" );
BrookStreamInternal* brookStreamInternalF = forceStream.getBrookStreamImpl(); BrookStreamInternal* brookStreamInternalF = forceStream.getBrookStreamImpl();
brookStreamInternalF->printToFile( log ); brookStreamInternalF->printToFile( log );
} }
if( getInverseMapStreamCount( J_Stream ) == 1 && getInverseMapStreamCount( L_Stream ) == 1 ){ if( getInverseMapStreamCount( J_Stream ) == 1 && getInverseMapStreamCount( L_Stream ) == 1 ){
...@@ -2095,20 +2102,9 @@ void BrookBonded::computeForces( BrookStreamImpl& positionStream, BrookStreamImp ...@@ -2095,20 +2102,9 @@ void BrookBonded::computeForces( BrookStreamImpl& positionStream, BrookStreamImp
// diagnostics // diagnostics
if( printOn ){ if( printOn ){
(void) fprintf( log, "%s Final forces", methodName.c_str() );
FILE* log = getLog() ? getLog() : stderr;
(void) fprintf( log, "\nFinal NB & bonded forces" );
BrookStreamInternal* brookStreamInternalF = forceStream.getBrookStreamImpl(); BrookStreamInternal* brookStreamInternalF = forceStream.getBrookStreamImpl();
brookStreamInternalF->printToFile( log ); brookStreamInternalF->printToFile( log );
/*
void* dataV = brookStreamInternalF->getData(1);
float* data = (float*) dataV;
(void) fprintf( getLog(), "\nFinal NB & bonded forces RAW\n" );
for( int ii = 0; ii < _brookNonBonded->getNumberOfParticles()*3; ii += 3 ){
(void) fprintf( getLog(), "%d [%.6e %.6e %.6e]\n", ii, data[ii], data[ii+1], data[ii+2] );
}
*/
} }
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
......
...@@ -128,11 +128,16 @@ void BrookCalcGBSAOBCForceKernel::initialize( const System& system, const GBSAOB ...@@ -128,11 +128,16 @@ void BrookCalcGBSAOBCForceKernel::initialize( const System& system, const GBSAOB
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
static const std::string methodName = "BrookCalcGBSAOBCForceKernel::initialize"; static const std::string methodName = "BrookCalcGBSAOBCForceKernel::initialize";
const int PrintOn = 0; int printOn = 0;
FILE* log;
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
FILE* log = getLog(); if( printOn && getLog() ){
log = getLog();
} else {
printOn = 0;
}
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
...@@ -159,7 +164,7 @@ void BrookCalcGBSAOBCForceKernel::initialize( const System& system, const GBSAOB ...@@ -159,7 +164,7 @@ void BrookCalcGBSAOBCForceKernel::initialize( const System& system, const GBSAOB
_openMMBrookInterface.setTriggerForceKernel( this ); _openMMBrookInterface.setTriggerForceKernel( this );
_openMMBrookInterface.setTriggerEnergyKernel( this ); _openMMBrookInterface.setTriggerEnergyKernel( this );
if( log && PrintOn ){ if( printOn ){
std::string contents = brookGbsa.getContentsString( ); std::string contents = brookGbsa.getContentsString( );
(void) fprintf( log, "%s brookGbsa::contents\n%s", methodName.c_str(), contents.c_str() ); (void) fprintf( log, "%s brookGbsa::contents\n%s", methodName.c_str(), contents.c_str() );
(void) fflush( log ); (void) fflush( log );
......
...@@ -126,11 +126,16 @@ void BrookCalcHarmonicBondForceKernel::initialize( const System& system, const H ...@@ -126,11 +126,16 @@ 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; int printOn = 0;
FILE* log;
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
FILE* log = getLog(); if( printOn && getLog() ){
log = getLog();
} else {
printOn = 0;
}
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
...@@ -164,7 +169,7 @@ void BrookCalcHarmonicBondForceKernel::initialize( const System& system, const H ...@@ -164,7 +169,7 @@ void BrookCalcHarmonicBondForceKernel::initialize( const System& system, const H
_openMMBrookInterface.setTriggerForceKernel( this ); _openMMBrookInterface.setTriggerForceKernel( this );
_openMMBrookInterface.setTriggerEnergyKernel( this ); _openMMBrookInterface.setTriggerEnergyKernel( this );
if( PrintOn && log ){ if( printOn ){
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 );
......
...@@ -446,7 +446,7 @@ int BrookGbsa::calculateBornRadii( const Stream& positions ){ ...@@ -446,7 +446,7 @@ int BrookGbsa::calculateBornRadii( const Stream& positions ){
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
static const std::string methodName = "BrookGbsa::calculateBornRadii"; static const std::string methodName = "BrookGbsa::calculateBornRadii";
static const int PrintOn = 0; static const int printOn = 0;
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
...@@ -490,7 +490,7 @@ int BrookGbsa::calculateBornRadii( const Stream& positions ){ ...@@ -490,7 +490,7 @@ int BrookGbsa::calculateBornRadii( const Stream& positions ){
// diagnostics // diagnostics
if( PrintOn && getLog() ){ if( printOn && getLog() ){
(void) fprintf( getLog(), "\n%s: atms=%d\n", methodName.c_str(), numberOfParticles ); (void) fprintf( getLog(), "\n%s: atms=%d\n", methodName.c_str(), numberOfParticles );
for( int ii = 0; ii < numberOfParticles; ii++ ){ for( int ii = 0; ii < numberOfParticles; ii++ ){
...@@ -925,12 +925,20 @@ void BrookGbsa::computeForces( BrookStreamImpl& positionStream, BrookStreamImpl& ...@@ -925,12 +925,20 @@ void BrookGbsa::computeForces( BrookStreamImpl& positionStream, BrookStreamImpl&
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
static const std::string methodName = "BrookGbsa::executeForces"; static const std::string methodName = "BrookGbsa::executeForces";
static const int PrintOn = 0; int printOn = 0;
FILE* log;
float mergeNonObcForces = 1.0f; float mergeNonObcForces = 1.0f;
float kcalMolTokJNM = -0.4184f; float kcalMolTokJNM = -0.4184f;
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
//setLog( stderr );
if( printOn && getLog() ){
log = getLog();
} else {
printOn = 0;
}
float includeAceTerm = (float) (includeAce()); float includeAceTerm = (float) (includeAce());
BrookFloatStreamInternal** gbsaForceStreams = getForceStreams(); BrookFloatStreamInternal** gbsaForceStreams = getForceStreams();
...@@ -949,9 +957,8 @@ void BrookGbsa::computeForces( BrookStreamImpl& positionStream, BrookStreamImpl& ...@@ -949,9 +957,8 @@ void BrookGbsa::computeForces( BrookStreamImpl& positionStream, BrookStreamImpl&
// diagnostics // diagnostics
if( PrintOn && getLog() ){ if( printOn ){
(void) fprintf( log, "\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(),
getParticleSizeCeiling(), getParticleSizeCeiling(),
getDuplicationFactor(), getDuplicationFactor(),
...@@ -959,14 +966,14 @@ void BrookGbsa::computeForces( BrookStreamImpl& positionStream, BrookStreamImpl& ...@@ -959,14 +966,14 @@ void BrookGbsa::computeForces( BrookStreamImpl& positionStream, BrookStreamImpl&
getPartialForceStreamWidth( ) ); getPartialForceStreamWidth( ) );
BrookStreamInternal* brookStreamInternalF = positionStream.getBrookStreamImpl(); BrookStreamInternal* brookStreamInternalF = positionStream.getBrookStreamImpl();
(void) fprintf( getLog(), "\nPositionStream\n" ); (void) fprintf( log, "\nPositionStream\n" );
brookStreamInternalF->printToFile( getLog() ); brookStreamInternalF->printToFile( log );
(void) fprintf( getLog(), "\nRadii\n" ); (void) fprintf( log, "\nRadii\n" );
getObcParticleRadii()->printToFile( getLog() ); getObcParticleRadii()->printToFile( log );
(void) fprintf( getLog(), "\nObcScaledParticleRadii\n" ); (void) fprintf( log, "\nObcScaledParticleRadii\n" );
getObcScaledParticleRadii()->printToFile( getLog() ); getObcScaledParticleRadii()->printToFile( log );
} }
...@@ -990,9 +997,9 @@ void BrookGbsa::computeForces( BrookStreamImpl& positionStream, BrookStreamImpl& ...@@ -990,9 +997,9 @@ void BrookGbsa::computeForces( BrookStreamImpl& positionStream, BrookStreamImpl&
// diagnostics // diagnostics
if( 0 && PrintOn && getLog() ){ if( 0 && printOn ){
(void) fprintf( getLog(), "\n%s Post kPostCalculateBornRadii_nobranch: atms=%d ceil=%d dup=%d particleStrW=%3d prtlF=%3d diel=%.3f %.3f ACE=%.1f\n", (void) fprintf( log, "\n%s Post kPostCalculateBornRadii_nobranch: atms=%d ceil=%d dup=%d particleStrW=%3d prtlF=%3d diel=%.3f %.3f ACE=%.1f\n",
methodName.c_str(), getNumberOfParticles(), methodName.c_str(), getNumberOfParticles(),
getParticleSizeCeiling(), getParticleSizeCeiling(),
getDuplicationFactor(), getDuplicationFactor(),
...@@ -1000,20 +1007,20 @@ void BrookGbsa::computeForces( BrookStreamImpl& positionStream, BrookStreamImpl& ...@@ -1000,20 +1007,20 @@ void BrookGbsa::computeForces( BrookStreamImpl& positionStream, BrookStreamImpl&
getPartialForceStreamWidth( ) ); getPartialForceStreamWidth( ) );
BrookStreamInternal* brookStreamInternalF = positionStream.getBrookStreamImpl(); BrookStreamInternal* brookStreamInternalF = positionStream.getBrookStreamImpl();
(void) fprintf( getLog(), "\nPositionStream\n" ); (void) fprintf( log, "\nPositionStream\n" );
brookStreamInternalF->printToFile( getLog() ); brookStreamInternalF->printToFile( log );
(void) fprintf( getLog(), "\nInput\n" ); (void) fprintf( log, "\nInput\n" );
gbsaForceStreams[0]->printToFile( getLog() ); gbsaForceStreams[0]->printToFile( log );
(void) fprintf( getLog(), "\nObcParticleRadii\n" ); (void) fprintf( log, "\nObcParticleRadii\n" );
getObcParticleRadii()->printToFile( getLog() ); getObcParticleRadii()->printToFile( log );
(void) fprintf( getLog(), "\nBornR\n" ); (void) fprintf( log, "\nBornR\n" );
getObcBornRadii()->printToFile( getLog() ); getObcBornRadii()->printToFile( log );
(void) fprintf( getLog(), "\nObcChain\n" ); (void) fprintf( log, "\nObcChain\n" );
getObcChain()->printToFile( getLog() ); getObcChain()->printToFile( log );
} }
...@@ -1042,9 +1049,9 @@ void BrookGbsa::computeForces( BrookStreamImpl& positionStream, BrookStreamImpl& ...@@ -1042,9 +1049,9 @@ void BrookGbsa::computeForces( BrookStreamImpl& positionStream, BrookStreamImpl&
// diagnostics // diagnostics
if( PrintOn && getLog() ){ if( printOn ){
(void) fprintf( getLog(), "\nPost kObcLoop1: atms=%d ceil=%d dup=%d particleStrW=%3d prtlF=%3d diel=%.3f %.3f ACE=%.1f\n", (void) fprintf( log, "\nPost kObcLoop1: atms=%d ceil=%d dup=%d particleStrW=%3d prtlF=%3d diel=%.3f %.3f ACE=%.1f\n",
getNumberOfParticles(), getNumberOfParticles(),
getParticleSizeCeiling(), getParticleSizeCeiling(),
getDuplicationFactor(), getDuplicationFactor(),
...@@ -1054,19 +1061,19 @@ void BrookGbsa::computeForces( BrookStreamImpl& positionStream, BrookStreamImpl& ...@@ -1054,19 +1061,19 @@ void BrookGbsa::computeForces( BrookStreamImpl& positionStream, BrookStreamImpl&
getSolventDielectric(), includeAceTerm ); getSolventDielectric(), includeAceTerm );
BrookStreamInternal* brookStreamInternalPos = positionStream.getBrookStreamImpl(); BrookStreamInternal* brookStreamInternalPos = positionStream.getBrookStreamImpl();
(void) fprintf( getLog(), "\nPost kObcLoop1 PositionStream\n" ); (void) fprintf( log, "\nPost kObcLoop1 PositionStream\n" );
brookStreamInternalPos->printToFile( getLog() ); brookStreamInternalPos->printToFile( log );
(void) fprintf( getLog(), "\nPost kObcLoop1 BornR\n" ); (void) fprintf( log, "\nPost kObcLoop1 BornR\n" );
getObcBornRadii()->printToFile( getLog() ); getObcBornRadii()->printToFile( log );
(void) fprintf( getLog(), "\nPost kObcLoop1 ParticleR\n" ); (void) fprintf( log, "\nPost kObcLoop1 ParticleR\n" );
getObcParticleRadii()->printToFile( getLog() ); getObcParticleRadii()->printToFile( log );
(void) fprintf( getLog(), "\nPost kObcLoop1 ForceStreams output\n" ); (void) fprintf( log, "\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 ); (void) fprintf( log, "\nPost kObcLoop1 ForceStream %d output\n", ii );
gbsaForceStreams[ii]->printToFile( getLog() ); gbsaForceStreams[ii]->printToFile( log );
} }
} }
...@@ -1095,9 +1102,9 @@ void BrookGbsa::computeForces( BrookStreamImpl& positionStream, BrookStreamImpl& ...@@ -1095,9 +1102,9 @@ void BrookGbsa::computeForces( BrookStreamImpl& positionStream, BrookStreamImpl&
// diagnostics // diagnostics
if( PrintOn && getLog()){ if( printOn ){
(void) fprintf( getLog(), "\nPost kPostObcLoop1_nobranch: dup=%d aStrW=%d pStrW=%d no.atms=%3d ceil=%3d Unroll=%1d\n", (void) fprintf( log, "\nPost kPostObcLoop1_nobranch: dup=%d aStrW=%d pStrW=%d no.atms=%3d ceil=%3d Unroll=%1d\n",
getDuplicationFactor(), getDuplicationFactor(),
getParticleStreamWidth( ), getParticleStreamWidth( ),
getPartialForceStreamWidth( ), getPartialForceStreamWidth( ),
...@@ -1105,27 +1112,27 @@ void BrookGbsa::computeForces( BrookStreamImpl& positionStream, BrookStreamImpl& ...@@ -1105,27 +1112,27 @@ void BrookGbsa::computeForces( BrookStreamImpl& positionStream, BrookStreamImpl&
getParticleSizeCeiling(), getParticleSizeCeiling(),
getInnerLoopUnroll() ); getInnerLoopUnroll() );
(void) fprintf( getLog(), "\nPost kPostObcLoop1_nobranch: ForceStreams\n" ); (void) fprintf( log, "\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 ); (void) fprintf( log, "\nPost kPostObcLoop1_nobranch: %d ForceStreams\n", ii );
gbsaForceStreams[ii]->printToFile( getLog() ); gbsaForceStreams[ii]->printToFile( log );
} }
(void) fprintf( getLog(), "\nPost kPostObcLoop1_nobranch: ObcChain\n" ); (void) fprintf( log, "\nPost kPostObcLoop1_nobranch: ObcChain\n" );
getObcChain()->printToFile( getLog() ); getObcChain()->printToFile( log );
(void) fprintf( getLog(), "\nPost kPostObcLoop1_nobranch: BornR\n" ); (void) fprintf( log, "\nPost kPostObcLoop1_nobranch: BornR\n" );
getObcBornRadii()->printToFile( getLog() ); getObcBornRadii()->printToFile( log );
// output // output
(void) fprintf( getLog(), "\nPost kPostObcLoop1_nobranch: ObcIntermediateForce output\n" ); (void) fprintf( log, "\nPost kPostObcLoop1_nobranch: ObcIntermediateForce output\n" );
getObcIntermediateForce()->printToFile( getLog() ); getObcIntermediateForce()->printToFile( log );
// output // output
(void) fprintf( getLog(), "\nPost kPostObcLoop1_nobranch: ObcBornRadii2 output\n" ); (void) fprintf( log, "\nPost kPostObcLoop1_nobranch: ObcBornRadii2 output\n" );
getObcBornRadii2()->printToFile( getLog() ); getObcBornRadii2()->printToFile( log );
} }
...@@ -1151,9 +1158,9 @@ void BrookGbsa::computeForces( BrookStreamImpl& positionStream, BrookStreamImpl& ...@@ -1151,9 +1158,9 @@ void BrookGbsa::computeForces( BrookStreamImpl& positionStream, BrookStreamImpl&
// diagnostics // diagnostics
if( PrintOn && getLog() ){ if( printOn ){
(void) fprintf( getLog(), "\nPost kObcLoop2: no.atms=%5d ceil=%3d dup=%3d strW=%3d pStrW=%3d\n", (void) fprintf( log, "\nPost kObcLoop2: no.atms=%5d ceil=%3d dup=%3d strW=%3d pStrW=%3d\n",
getNumberOfParticles(), getNumberOfParticles(),
getParticleSizeCeiling(), getParticleSizeCeiling(),
getDuplicationFactor(), getDuplicationFactor(),
...@@ -1161,18 +1168,18 @@ void BrookGbsa::computeForces( BrookStreamImpl& positionStream, BrookStreamImpl& ...@@ -1161,18 +1168,18 @@ void BrookGbsa::computeForces( BrookStreamImpl& positionStream, BrookStreamImpl&
getPartialForceStreamWidth( ) ); getPartialForceStreamWidth( ) );
BrookStreamInternal* brookStreamInternalPos = positionStream.getBrookStreamImpl(); BrookStreamInternal* brookStreamInternalPos = positionStream.getBrookStreamImpl();
(void) fprintf( getLog(), "\nPost kObcLoop2: PositionStream\n" ); (void) fprintf( log, "\nPost kObcLoop2: PositionStream\n" );
brookStreamInternalPos->printToFile( getLog() ); brookStreamInternalPos->printToFile( log );
(void) fprintf( getLog(), "\nPost kObcLoop2: ObcScaledParticleRadii\n" ); (void) fprintf( log, "\nPost kObcLoop2: ObcScaledParticleRadii\n" );
getObcScaledParticleRadii()->printToFile( getLog() ); getObcScaledParticleRadii()->printToFile( log );
(void) fprintf( getLog(), "\nPost kObcLoop2: ObcBornRadii2\n" ); (void) fprintf( log, "\nPost kObcLoop2: ObcBornRadii2\n" );
getObcBornRadii2()->printToFile( getLog() ); getObcBornRadii2()->printToFile( log );
(void) fprintf( getLog(), "\nPost kObcLoop2: ForceStreams\n" ); (void) fprintf( log, "\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( log );
} }
} }
...@@ -1206,9 +1213,9 @@ void BrookGbsa::computeForces( BrookStreamImpl& positionStream, BrookStreamImpl& ...@@ -1206,9 +1213,9 @@ void BrookGbsa::computeForces( BrookStreamImpl& positionStream, BrookStreamImpl&
// diagnostics // diagnostics
if( PrintOn && getLog() ){ if( printOn ){
(void) fprintf( getLog(), "\nPost kPostObcLoop2_nobranch: atms=%d ceil=%d dup=%d particleStrW=%3d prtlF=%3d diel=%.3f %.3f ACE=%.1f\n", (void) fprintf( log, "\nPost kPostObcLoop2_nobranch: atms=%d ceil=%d dup=%d particleStrW=%3d prtlF=%3d diel=%.3f %.3f ACE=%.1f\n",
getNumberOfParticles(), getNumberOfParticles(),
getParticleSizeCeiling(), getParticleSizeCeiling(),
getDuplicationFactor(), getDuplicationFactor(),
...@@ -1217,21 +1224,21 @@ void BrookGbsa::computeForces( BrookStreamImpl& positionStream, BrookStreamImpl& ...@@ -1217,21 +1224,21 @@ void BrookGbsa::computeForces( BrookStreamImpl& positionStream, BrookStreamImpl&
getSoluteDielectric(), getSoluteDielectric(),
getSolventDielectric(), includeAceTerm ); getSolventDielectric(), includeAceTerm );
(void) fprintf( getLog(), "\nPost kPostObcLoop2_nobranch: PartialForceStreams\n" ); (void) fprintf( log, "\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 ); (void) fprintf( log, "\nPost kPostObcLoop2_nobranch: PartialForceStreams %d\n", ii );
gbsaForceStreams[ii]->printToFile( getLog() ); gbsaForceStreams[ii]->printToFile( log );
} }
BrookStreamInternal* brookStreamInternalF = forceStream.getBrookStreamImpl(); BrookStreamInternal* brookStreamInternalF = forceStream.getBrookStreamImpl();
(void) fprintf( getLog(), "\nPost kPostObcLoop2_nobranch: ForceStream\n" ); (void) fprintf( log, "\nPost kPostObcLoop2_nobranch: ForceStream\n" );
brookStreamInternalF->printToFile( getLog() ); brookStreamInternalF->printToFile( log );
(void) fprintf( getLog(), "\nPost kPostObcLoop2_nobranch: Chain\n" ); (void) fprintf( log, "\nPost kPostObcLoop2_nobranch: Chain\n" );
getObcChain()->printToFile( getLog() ); getObcChain()->printToFile( log );
(void) fprintf( getLog(), "\nPost kPostObcLoop2_nobranch: BornR\n" ); (void) fprintf( log, "\nPost kPostObcLoop2_nobranch: BornR\n" );
getObcBornRadii()->printToFile( getLog() ); getObcBornRadii()->printToFile( log );
} }
......
...@@ -123,13 +123,13 @@ void BrookIntegrateLangevinStepKernel::initialize( const System& system, const L ...@@ -123,13 +123,13 @@ void BrookIntegrateLangevinStepKernel::initialize( const System& system, const L
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
int printOn = 1; int printOn = 0;
static const std::string methodName = "BrookIntegrateLangevinStepKernel::initialize"; static const std::string methodName = "BrookIntegrateLangevinStepKernel::initialize";
FILE* log = NULL; FILE* log = NULL;
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
setLog( stderr ); //setLog( stderr );
printOn = (printOn && getLog()) ? printOn : 0; printOn = (printOn && getLog()) ? printOn : 0;
if( printOn ){ if( printOn ){
......
...@@ -950,19 +950,19 @@ int BrookLangevinDynamics::update( BrookStreamImpl& positionStream, BrookStreamI ...@@ -950,19 +950,19 @@ int BrookLangevinDynamics::update( BrookStreamImpl& positionStream, BrookStreamI
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
static const std::string methodName = "\nBrookLangevinDynamics::update"; static const std::string methodName = "\nBrookLangevinDynamics::update";
int printOn = 1; int printOn = 0;
FILE* log; FILE* log;
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
_internalStepCount++; _internalStepCount++;
setLog( stderr ); //setLog( stderr );
printOn = (printOn && getLog()) ? printOn : 0; printOn = (printOn && getLog()) ? printOn : 0;
const BrookOpenMMFloat* derivedParameters = getDerivedParameters(); const BrookOpenMMFloat* derivedParameters = getDerivedParameters();
if( (0 || printOn) ){ if( printOn ){
log = getLog(); log = getLog();
static int showAux = 1; static int showAux = 1;
...@@ -1031,8 +1031,6 @@ setLog( stderr ); ...@@ -1031,8 +1031,6 @@ setLog( stderr );
} }
//StreamImpl& positionStreamImpl = positionStream.getImpl();
//const BrookStreamImpl brookPositions = dynamic_cast<BrookStreamImpl&> (positionStreamImpl);
BrookStreamInternal* brookStreamInternalPos = positionStream.getBrookStreamImpl(); BrookStreamInternal* brookStreamInternalPos = positionStream.getBrookStreamImpl();
(void) fprintf( log, "\nPositionStream %d\n", _internalStepCount ); (void) fprintf( log, "\nPositionStream %d\n", _internalStepCount );
brookStreamInternalPos->printToFile( log ); brookStreamInternalPos->printToFile( log );
...@@ -1082,7 +1080,7 @@ setLog( stderr ); ...@@ -1082,7 +1080,7 @@ setLog( stderr );
// first Shake gather // first Shake gather
kshakeh_update1_fix1( kshakeh_update1_fix1(
(float) getLangevinDynamicsParticleStreamWidth(), (float) brookShakeAlgorithm.getShakeConstraintStreamWidth(),
brookShakeAlgorithm.getShakeInverseMapStream()->getBrookStream(), brookShakeAlgorithm.getShakeInverseMapStream()->getBrookStream(),
getXPrimeStream()->getBrookStream(), getXPrimeStream()->getBrookStream(),
brookShakeAlgorithm.getShakeXCons0Stream()->getBrookStream(), brookShakeAlgorithm.getShakeXCons0Stream()->getBrookStream(),
...@@ -1093,8 +1091,8 @@ setLog( stderr ); ...@@ -1093,8 +1091,8 @@ setLog( stderr );
if( 0 && printOn ){ if( 0 && printOn ){
(void) fprintf( log, "\n%s Post kshakeh_update2_fix1: particleStrW=%3d", (void) fprintf( log, "\n%s Post kshakeh_update2_fix1: ShakeConstraintStreamWidth=%3d",
methodName.c_str(), getLangevinDynamicsParticleStreamWidth() ); methodName.c_str(), brookShakeAlgorithm.getShakeConstraintStreamWidth() );
if( _internalStepCount == 1 ){ if( _internalStepCount == 1 ){
(void) fprintf( log, "\nShakeInverseMapStream %d\n" ); (void) fprintf( log, "\nShakeInverseMapStream %d\n" );
...@@ -1204,7 +1202,7 @@ setLog( stderr ); ...@@ -1204,7 +1202,7 @@ setLog( stderr );
// second Shake gather // second Shake gather
kshakeh_update2_fix1( kshakeh_update2_fix1(
(float) getLangevinDynamicsParticleStreamWidth(), (float) brookShakeAlgorithm.getShakeConstraintStreamWidth(),
brookShakeAlgorithm.getShakeInverseMapStream()->getBrookStream(), brookShakeAlgorithm.getShakeInverseMapStream()->getBrookStream(),
positionStream.getBrookStream(), positionStream.getBrookStream(),
getXPrimeStream()->getBrookStream(), getXPrimeStream()->getBrookStream(),
...@@ -1217,12 +1215,12 @@ setLog( stderr ); ...@@ -1217,12 +1215,12 @@ setLog( stderr );
// diagnostics // diagnostics
if( printOn ){ if( printOn ){
(void) fprintf( log, "\n%s step=%d Post kshakeh_update2_fix1: particleStrW=%3d rngStrW=%3d rngOff=%5d " (void) fprintf( log, "\n%s step=%d Post kshakeh_update2_fix1: ShakeConstraintStreamWidth=%3d rngStrW=%3d rngOff=%5d "
"Sd2pc[]=[%12.5e %12.5e]\n", methodName.c_str(), _internalStepCount, "Sd2pc[]=[%12.5e %12.5e]\n", methodName.c_str(), _internalStepCount,
getLangevinDynamicsParticleStreamWidth(), brookShakeAlgorithm.getShakeConstraintStreamWidth(),
brookRandomNumberGenerator.getRandomNumberStreamWidth(), brookRandomNumberGenerator.getRandomNumberStreamWidth(),
brookRandomNumberGenerator.getRvStreamOffset(), brookRandomNumberGenerator.getRvStreamOffset(),
derivedParameters[Sd2pc1], derivedParameters[Sd2pc2] ); derivedParameters[Sd2pc1], derivedParameters[Sd2pc2] );
BrookStreamInternal* brookStreamInternalPos = positionStream.getBrookStreamImpl(); BrookStreamInternal* brookStreamInternalPos = positionStream.getBrookStreamImpl();
brookShakeAlgorithm.checkConstraints( brookStreamInternalPos, log, 0.0001f ); brookShakeAlgorithm.checkConstraints( brookStreamInternalPos, log, 0.0001f );
......
...@@ -1285,8 +1285,6 @@ void BrookNonBonded::computeForces( BrookStreamImpl& positionStream, BrookStream ...@@ -1285,8 +1285,6 @@ void BrookNonBonded::computeForces( BrookStreamImpl& positionStream, BrookStream
FILE* log; FILE* log;
// static const int debug = 1;
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
printOn = (printOn && getLog()) ? printOn : 0; printOn = (printOn && getLog()) ? printOn : 0;
...@@ -1327,9 +1325,9 @@ nonbondedForceStreams[3]->fillWithValue( &zerof ); ...@@ -1327,9 +1325,9 @@ nonbondedForceStreams[3]->fillWithValue( &zerof );
// diagnostics // diagnostics
//if( 1 && printOn ){ if( printOn ){
static int step = 0; //static int step = 0;
if( step++ < 1 ){ //if( step++ < 1 ){
//FILE* log = getLog(); //FILE* log = getLog();
FILE* log = stderr; FILE* log = stderr;
(void) fprintf( log, "%s\n", methodName.c_str() ); (void) fflush( log ); (void) fprintf( log, "%s\n", methodName.c_str() ); (void) fflush( log );
......
...@@ -362,13 +362,20 @@ int BrookRandomNumberGenerator::_loadRandomNumberStreamsKiss( void ){ ...@@ -362,13 +362,20 @@ 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; int printOn = 0;
FILE* log;
static const int reseed = 10000; static const int reseed = 10000;
static std::string methodName = "\nBrookRandomNumberGenerator::_loadRandomNumberStreamsKiss"; static std::string methodName = "\nBrookRandomNumberGenerator::_loadRandomNumberStreamsKiss";
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
if( printOn && getLog() ){
log = getLog();
} else {
printOn = 0;
}
// periodically reset seeds // periodically reset seeds
if( !stateInitialized || !(stateInitialized % reseed) ){ if( !stateInitialized || !(stateInitialized % reseed) ){
...@@ -378,10 +385,10 @@ int BrookRandomNumberGenerator::_loadRandomNumberStreamsKiss( void ){ ...@@ -378,10 +385,10 @@ int BrookRandomNumberGenerator::_loadRandomNumberStreamsKiss( void ){
state[2] = rand(); state[2] = rand();
state[3] = rand(); state[3] = rand();
if( PrintOn && getLog() ){ if( printOn ){
(void) fprintf( getLog(), "%s reset state seeds stateInitialized=%d reseed=%d [%u %u %u %u]\n", (void) fprintf( log, "%s reset state seeds stateInitialized=%d reseed=%d [%u %u %u %u]\n",
methodName.c_str(), 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( log );
} }
/* /*
...@@ -398,13 +405,13 @@ state[3] = 27587; ...@@ -398,13 +405,13 @@ state[3] = 27587;
float* loadBuffer = _getLoadBuffer(); float* loadBuffer = _getLoadBuffer();
if( PrintOn && getLog() ){ if( printOn ){
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(), "%s: count=%.1f ttl=%.3e no./count=%.1f %d %d\n", methodName.c_str(), (void) fprintf( log, "%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( log );
} }
for( int jj = 0; jj < getNumberOfRandomNumberStreams(); jj++ ){ for( int jj = 0; jj < getNumberOfRandomNumberStreams(); jj++ ){
...@@ -418,9 +425,9 @@ state[3] = 27587; ...@@ -418,9 +425,9 @@ state[3] = 27587;
getRandomNumberStream( jj )->loadFromArray( loadBuffer ); getRandomNumberStream( jj )->loadFromArray( loadBuffer );
} }
if( PrintOn && getLog() ){ if( printOn ){
(void) fprintf( getLog(), "%s: stats\n%s\n", methodName.c_str(), getStatisticsString().c_str() ); (void) fprintf( log, "%s: stats\n%s\n", methodName.c_str(), getStatisticsString().c_str() );
(void) fflush( getLog() ); (void) fflush( log );
} }
return DefaultReturnValue; return DefaultReturnValue;
...@@ -439,7 +446,8 @@ int BrookRandomNumberGenerator::_loadRandomNumberStreamsMersenne( void ){ ...@@ -439,7 +446,8 @@ int BrookRandomNumberGenerator::_loadRandomNumberStreamsMersenne( void ){
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
static const std::string methodName = "\nBrookRandomNumberGenerator::_loadRandomNumberStreamsMersenne"; static const std::string methodName = "\nBrookRandomNumberGenerator::_loadRandomNumberStreamsMersenne";
static int PrintOn = 0; int printOn = 0;
FILE* log;
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
...@@ -456,9 +464,9 @@ int BrookRandomNumberGenerator::_loadRandomNumberStreamsMersenne( void ){ ...@@ -456,9 +464,9 @@ int BrookRandomNumberGenerator::_loadRandomNumberStreamsMersenne( void ){
getRandomNumberStream( jj )->loadFromArray( loadBuffer ); getRandomNumberStream( jj )->loadFromArray( loadBuffer );
} }
if( PrintOn && getLog() ){ if( printOn ){
(void) fprintf( getLog(), "%s: stats\n%s\n", methodName.c_str(), getStatisticsString().c_str() ); (void) fprintf( log, "%s: stats\n%s\n", methodName.c_str(), getStatisticsString().c_str() );
(void) fflush( getLog() ); (void) fflush( log );
} }
return DefaultReturnValue; return DefaultReturnValue;
...@@ -676,10 +684,17 @@ int BrookRandomNumberGenerator::advanceGVCursor( int numberOfRandomValuesConsume ...@@ -676,10 +684,17 @@ int BrookRandomNumberGenerator::advanceGVCursor( int numberOfRandomValuesConsume
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
static const std::string methodName = "BrookRandomNumberGenerator::advanceGVCursor"; static const std::string methodName = "BrookRandomNumberGenerator::advanceGVCursor";
static const int PrintOn = 0; int printOn = 0;
FILE* log;
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
if( printOn && getLog() ){
log = getLog();
} else {
printOn = 0;
}
int rvStreamSize = getRandomNumberStreamSize(); int rvStreamSize = getRandomNumberStreamSize();
// use 2 random values per sd // use 2 random values per sd
...@@ -726,9 +741,9 @@ int BrookRandomNumberGenerator::advanceGVCursor( int numberOfRandomValuesConsume ...@@ -726,9 +741,9 @@ int BrookRandomNumberGenerator::advanceGVCursor( int numberOfRandomValuesConsume
_rvStreamIndex = 0; _rvStreamIndex = 0;
} }
if( PrintOn && getLog() ){ if( printOn ){
(void) fprintf( getLog(), "%s StrmIdx=%d action=%s\n", methodName, _rvStreamIndex, action ); (void) fprintf( log, "%s StrmIdx=%d action=%s\n", methodName, _rvStreamIndex, action );
(void) fflush( getLog() ); (void) fflush( log );
} }
} }
...@@ -1023,7 +1038,7 @@ std::string BrookRandomNumberGenerator::getContentsString( int level ) const { ...@@ -1023,7 +1038,7 @@ std::string BrookRandomNumberGenerator::getContentsString( int level ) const {
(void) LOCAL_SPRINTF( value, "%d", getMaxShuffles() ); (void) LOCAL_SPRINTF( value, "%d", getMaxShuffles() );
message << _getLine( tab, "Max number of rv stream shuffles:", value ); message << _getLine( tab, "Max number of rv stream shuffles:", value );
message << _getLine( tab, "Log:", (getLog() ? Set : NotSet) ); message << _getLine( tab, "Log:", (getLog() ? Set : NotSet) );
message << _getLine( tab, "Shuffle:", (_getShuffleStream() ? Set : NotSet) ); message << _getLine( tab, "Shuffle:", (_getShuffleStream() ? Set : NotSet) );
......
...@@ -560,7 +560,7 @@ int BrookShakeAlgorithm::_setShakeStreams( const std::vector<double>& masses, co ...@@ -560,7 +560,7 @@ int BrookShakeAlgorithm::_setShakeStreams( const std::vector<double>& masses, co
BrookOpenMMFloat* inverseMap = new BrookOpenMMFloat[2*shakeParticleStreamSize]; BrookOpenMMFloat* inverseMap = new BrookOpenMMFloat[2*shakeParticleStreamSize];
for( int ii = 0; ii < shakeParticleStreamSize*2; ii++ ){ for( int ii = 0; ii < shakeParticleStreamSize*2; ii++ ){
inverseMap[ii] = -1; inverseMap[ii] = static_cast<BrookOpenMMFloat>(-1.0);
} }
// build inverse map // build inverse map
...@@ -568,7 +568,7 @@ int BrookShakeAlgorithm::_setShakeStreams( const std::vector<double>& masses, co ...@@ -568,7 +568,7 @@ int BrookShakeAlgorithm::_setShakeStreams( const std::vector<double>& masses, co
for( int ii = 0; ii < shakeConstraintStreamSize; ii++ ){ for( int ii = 0; ii < shakeConstraintStreamSize; ii++ ){
int ii4 = ii << 2; int ii4 = ii << 2;
for( int jj = 0; jj < 4; jj++ ){ for( int jj = 0; jj < 4; jj++ ){
if( particleIndices[ii4+jj] != -1 ){ if( particleIndices[ii4+jj] > -1.0f ){
int particleIndex = (int) (particleIndices[ii4+jj] + 0.001); int particleIndex = (int) (particleIndices[ii4+jj] + 0.001);
inverseMap[particleIndex*2] = (float) ii; inverseMap[particleIndex*2] = (float) ii;
inverseMap[particleIndex*2+1] = (float) jj; inverseMap[particleIndex*2+1] = (float) jj;
......
...@@ -467,19 +467,19 @@ int BrookVerletDynamics::update( BrookStreamImpl& positionStream, BrookStreamImp ...@@ -467,19 +467,19 @@ int BrookVerletDynamics::update( BrookStreamImpl& positionStream, BrookStreamImp
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
static std::string methodName = "\nBrookVerletDynamics::update"; static std::string methodName = "\nBrookVerletDynamics::update";
static int printOn = 1; static int printOn = 0;
FILE* log; FILE* log;
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
_internalStepCount++; _internalStepCount++;
setLog( stderr ); //setLog( stderr );
printOn = (printOn && getLog()) ? printOn : 0; printOn = (printOn && getLog()) ? printOn : 0;
BrookStreamImpl& forceStream = const_cast<BrookStreamImpl&> (forceStreamC); BrookStreamImpl& forceStream = const_cast<BrookStreamImpl&> (forceStreamC);
if( (1 || printOn) ){ if( printOn ){
static int showAux = 1; static int showAux = 1;
log = getLog(); log = getLog();
...@@ -598,7 +598,7 @@ setLog( stderr ); ...@@ -598,7 +598,7 @@ setLog( stderr );
// Shake gather // Shake gather
kshakeh_update1_fix1( kshakeh_update1_fix1(
(float) getVerletDynamicsParticleStreamWidth(), (float) brookShakeAlgorithm.getShakeConstraintStreamWidth(),
brookShakeAlgorithm.getShakeInverseMapStream()->getBrookStream(), brookShakeAlgorithm.getShakeInverseMapStream()->getBrookStream(),
getXPrimeStream()->getBrookStream(), getXPrimeStream()->getBrookStream(),
brookShakeAlgorithm.getShakeXCons0Stream()->getBrookStream(), brookShakeAlgorithm.getShakeXCons0Stream()->getBrookStream(),
...@@ -608,10 +608,10 @@ setLog( stderr ); ...@@ -608,10 +608,10 @@ setLog( stderr );
getXPrimeStream()->getBrookStream() ); getXPrimeStream()->getBrookStream() );
//positionStream.getBrookStream() ); //positionStream.getBrookStream() );
if( 0 && printOn ){ if( printOn ){
(void) fprintf( log, "\n%s Post kshakeh_update2_fix1: particleStrW=%3d", (void) fprintf( log, "\n%s Post kshakeh_update1_fix1: step=%d ShakeConstraintStreamWidth=%3d",
methodName.c_str(), getVerletDynamicsParticleStreamWidth() ); methodName.c_str(), _internalStepCount, brookShakeAlgorithm.getShakeConstraintStreamWidth() );
(void) fprintf( log, "\nShakeInverseMapStream %d\n", _internalStepCount ); (void) fprintf( log, "\nShakeInverseMapStream %d\n", _internalStepCount );
brookShakeAlgorithm.getShakeInverseMapStream()->printToFile( log ); brookShakeAlgorithm.getShakeInverseMapStream()->printToFile( log );
...@@ -652,9 +652,10 @@ setLog( stderr ); ...@@ -652,9 +652,10 @@ setLog( stderr );
methodName.c_str(), _internalStepCount, inverseStepSize ); methodName.c_str(), _internalStepCount, inverseStepSize );
BrookStreamInternal* brookStreamInternalPos = positionStream.getBrookStreamImpl(); BrookStreamInternal* brookStreamInternalPos = positionStream.getBrookStreamImpl();
brookShakeAlgorithm.checkConstraints( brookStreamInternalPos, log, 0.0001f );
(void) fprintf( log, "\nPositionStream %d\n", _internalStepCount ); (void) fprintf( log, "\nPositionStream %d\n", _internalStepCount );
brookStreamInternalPos->printToFile( log ); brookStreamInternalPos->printToFile( log );
(void) fprintf( log, "\nXPrimeStream %d\n", _internalStepCount ); (void) fprintf( log, "\nXPrimeStream %d\n", _internalStepCount );
getXPrimeStream()->printToFile( log ); getXPrimeStream()->printToFile( log );
......
...@@ -538,11 +538,7 @@ void OpenMMBrookInterface::computeForces( OpenMMContextImpl& context ){ ...@@ -538,11 +538,7 @@ void OpenMMBrookInterface::computeForces( OpenMMContextImpl& context ){
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
(void) fprintf( stderr, "%s done nonbonded & bonded=%d completed=%d\n", methodName.c_str(), //setLog( stderr );
_brookBonded.isActive(), _brookBonded.isSetupCompleted() );
(void) fflush( stderr );
setLog( stderr );
printOn = (printOn && getLog()) ? printOn : 0; printOn = (printOn && getLog()) ? printOn : 0;
BrookStreamImpl* positions = getParticlePositions(); BrookStreamImpl* positions = getParticlePositions();
...@@ -550,15 +546,10 @@ setLog( stderr ); ...@@ -550,15 +546,10 @@ setLog( stderr );
// info // info
//if( printOn > 1 ){ if( printOn > 1 ){
if( 0 ){
printForcesToFile( context ); printForcesToFile( context );
} }
(void) fprintf( stderr, "%s x1 done nonbonded & bonded=%d completed=%d\n", methodName.c_str(),
_brookBonded.isActive(), _brookBonded.isSetupCompleted() );
(void) fflush( stderr );
// nonbonded forces // nonbonded forces
if( _brookNonBonded.isActive() ){ if( _brookNonBonded.isActive() ){
...@@ -587,16 +578,11 @@ setLog( stderr ); ...@@ -587,16 +578,11 @@ setLog( stderr );
getParticleStreamWidth(), getParticleStreamSize() ); getParticleStreamWidth(), getParticleStreamSize() );
} }
(void) fprintf( stderr, "%s done nonbonded & bonded=%d completed=%d\n", methodName.c_str(),
_brookBonded.isActive(), _brookBonded.isSetupCompleted() );
(void) fflush( stderr );
_brookBonded.computeForces( *positions, *forces ); _brookBonded.computeForces( *positions, *forces );
// diagnostics // diagnostics
if( printOn ){ if( printOn ){
FILE* log = stderr;
static int step = 0; static int step = 0;
static const int stopStep = 10; static const int stopStep = 10;
(void) fprintf( log, "%s done bonded computeForces\n", methodName.c_str() ); (void) fprintf( log, "%s done bonded computeForces\n", methodName.c_str() );
...@@ -621,16 +607,12 @@ setLog( stderr ); ...@@ -621,16 +607,12 @@ setLog( stderr );
} }
// GBSA OBC forces // GBSA OBC forces
if( _brookGbsa.isActive() ){ if( _brookGbsa.isActive() ){
_brookGbsa.computeForces( *positions, *forces ); _brookGbsa.computeForces( *positions, *forces );
} }
(void) fprintf( stderr, "%s done computeForces\n", methodName.c_str() );
(void) fflush( stderr );
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
} }
......
...@@ -203,22 +203,23 @@ kernel void kshakeh_update1_fix1( ...@@ -203,22 +203,23 @@ kernel void kshakeh_update1_fix1(
float3 cposq3[][], //ditto for h3 float3 cposq3[][], //ditto for h3
out float3 oposq<> //updated deltas out float3 oposq<> //updated deltas
){ ){
float2 atom; float2 atom;
atom.y = round( (invmap.x - fmod( invmap.x, strwidth ))/strwidth ); atom.y = round( (invmap.x - fmod( invmap.x, strwidth ))/strwidth );
atom.x = invmap.x - atom.y * strwidth; atom.x = invmap.x - atom.y * strwidth;
// oposq = posq; // oposq = posq;
if ( invmap.y < 0 ){ if( invmap.y < 0 ){
oposq = posqp; oposq = posqp;
} else if ( invmap.y < 0.5f ){ } else if( invmap.y < 0.5f ){
oposq += cposq0[ atom ]; oposq = cposq0[ atom ];
} else if ( invmap.y < 1.5f ){ } else if( invmap.y < 1.5f ){
oposq += cposq1[ atom ]; oposq = cposq1[ atom ];
} else if ( invmap.y < 2.5f ){ } else if( invmap.y < 2.5f ){
oposq += cposq2[ atom ]; oposq = cposq2[ atom ];
} else if ( invmap.y < 3.5f ){ } else if( invmap.y < 3.5f ){
oposq += cposq3[ atom ]; oposq = cposq3[ atom ];
} }
} }
......
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