Commit 337d4842 authored by Mark Friedrichs's avatar Mark Friedrichs
Browse files

Mods

parent b1ba688f
...@@ -35,9 +35,9 @@ ...@@ -35,9 +35,9 @@
#include "BrookPlatform.h" #include "BrookPlatform.h"
#include "BrookStreamFactory.h" #include "BrookStreamFactory.h"
#include "OpenMMException.h" #include "OpenMMException.h"
#include "gpu/kinvmap_gather.h" #include "kernels/kinvmap_gather.h"
#include "gpu/invmap.h" #include "kernels/invmap.h"
#include "gpu/kforce.h" #include "kernels/kforce.h"
using namespace OpenMM; using namespace OpenMM;
using namespace std; using namespace std;
......
...@@ -36,8 +36,8 @@ ...@@ -36,8 +36,8 @@
#include "BrookStreamImpl.h" #include "BrookStreamImpl.h"
#include "BrookCalcGBSAOBCForceKernel.h" #include "BrookCalcGBSAOBCForceKernel.h"
#include "gpu/kgbsa.h" #include "kernels/kgbsa.h"
#include "gpu/kforce.h" #include "kernels/kforce.h"
#include "math.h" #include "math.h"
using namespace OpenMM; using namespace OpenMM;
......
...@@ -34,8 +34,8 @@ ...@@ -34,8 +34,8 @@
#include "BrookPlatform.h" #include "BrookPlatform.h"
#include "OpenMMException.h" #include "OpenMMException.h"
#include "BrookStreamImpl.h" #include "BrookStreamImpl.h"
#include "gpu/kgbsa.h" #include "kernels/kgbsa.h"
#include "gpu/kforce.h" #include "kernels/kforce.h"
using namespace OpenMM; using namespace OpenMM;
using namespace std; using namespace std;
......
...@@ -34,9 +34,9 @@ ...@@ -34,9 +34,9 @@
#include "BrookPlatform.h" #include "BrookPlatform.h"
#include "OpenMMException.h" #include "OpenMMException.h"
#include "BrookStreamImpl.h" #include "BrookStreamImpl.h"
#include "gpu/kshakeh.h" #include "kernels/kshakeh.h"
#include "gpu/kupdatesd.h" #include "kernels/kupdatesd.h"
#include "gpu/kcommon.h" #include "kernels/kcommon.h"
// use random number generator // use random number generator
...@@ -1480,7 +1480,7 @@ int BrookLangevinDynamics::update( BrookStreamImpl& positionStream, BrookStreamI ...@@ -1480,7 +1480,7 @@ int BrookLangevinDynamics::update( BrookStreamImpl& positionStream, BrookStreamI
// diagnostics // diagnostics
if( (_internalStepCount % 10) == 0 ){ if( (_internalStepCount % 1000) == 0 ){
FILE* log1 = stderr; FILE* log1 = stderr;
float epsilon = 1.0e-01f; float epsilon = 1.0e-01f;
......
...@@ -34,8 +34,8 @@ ...@@ -34,8 +34,8 @@
#include "BrookPlatform.h" #include "BrookPlatform.h"
#include "BrookStreamFactory.h" #include "BrookStreamFactory.h"
#include "OpenMMException.h" #include "OpenMMException.h"
#include "gpu/invmap.h" //#include "kernels/invmap.h"
#include "gpu/kforce.h" #include "kernels/kforce.h"
using namespace OpenMM; using namespace OpenMM;
using namespace std; using namespace std;
......
...@@ -41,9 +41,20 @@ ...@@ -41,9 +41,20 @@
#include <sstream> #include <sstream>
#include <cctype> #include <cctype>
#include <algorithm> #include <algorithm>
//#include "/cygdrive/c/Program\ Files/Amd/AMD\ CAL\ 1.2.1_beta/include/cal.h"
using namespace OpenMM; using namespace OpenMM;
extern "C" void initOpenMMPlugin() {
/*
CALuint numberOfDevices = 0;
// validateCALRuntime()
if( calDeviceGetCount( &numberOfDevices ) == CAL_RESULT_OK && numberOfDevices > 0 ){
Platform::registerPlatform(new BrookPlatform());
}
*/
}
/** /**
* BrookPlatformData constructor * BrookPlatformData constructor
* *
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#include "BrookRandomNumberGenerator.h" #include "BrookRandomNumberGenerator.h"
#include "../../reference/src/SimTKUtilities/SimTKOpenMMUtilities.h" #include "../../reference/src/SimTKUtilities/SimTKOpenMMUtilities.h"
#include "OpenMMException.h" #include "OpenMMException.h"
#include "gpu/kupdatesd.h" #include "kernels/kupdatesd.h"
using namespace OpenMM; using namespace OpenMM;
using namespace std; using namespace std;
...@@ -729,12 +729,12 @@ int BrookRandomNumberGenerator::advanceGVCursor( int numberOfRandomValuesConsume ...@@ -729,12 +729,12 @@ int BrookRandomNumberGenerator::advanceGVCursor( int numberOfRandomValuesConsume
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
static const std::string methodName = "BrookRandomNumberGenerator::advanceGVCursor"; static const std::string methodName = "BrookRandomNumberGenerator::advanceGVCursor";
int printOn = 1; int printOn = 0;
FILE* log; FILE* log;
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
setLog( stderr ); //setLog( stderr );
if( printOn && getLog() ){ if( printOn && getLog() ){
log = getLog(); log = getLog();
} else { } else {
......
...@@ -70,7 +70,7 @@ BrookStreamFactory::BrookStreamFactory( void ){ ...@@ -70,7 +70,7 @@ BrookStreamFactory::BrookStreamFactory( void ){
* *
*/ */
BrookStreamFactory::~BrookStreamFactory( void ){ BrookStreamFactory::~BrookStreamFactory( ){
} }
/** /**
...@@ -291,7 +291,6 @@ StreamImpl* BrookStreamFactory::createStreamImpl( std::string name, int size, St ...@@ -291,7 +291,6 @@ StreamImpl* BrookStreamFactory::createStreamImpl( std::string name, int size, St
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
// stream width hould be based on name & value set in platform; for now only particle stream types // stream width hould be based on name & value set in platform; for now only particle stream types
int streamWidth = getDefaultParticleStreamWidth(); int streamWidth = getDefaultParticleStreamWidth();
......
...@@ -41,8 +41,6 @@ ...@@ -41,8 +41,6 @@
#endif #endif
using namespace OpenMM; using namespace OpenMM;
using namespace std; using namespace std;
...@@ -564,7 +562,7 @@ int BrookStreamInternal::printStreamsToFile( std::string fileName, std::vector<B ...@@ -564,7 +562,7 @@ int BrookStreamInternal::printStreamsToFile( std::string fileName, std::vector<B
delete[] arrays; delete[] arrays;
delete[] widths; delete[] widths;
delete[] indices; delete[] indices;
for( int ii = 0; ii < 4; ii++ ){ for( int ii = 0; ii < streams.size(); ii++ ){
delete[] sums[ii]; delete[] sums[ii];
} }
delete[] sums; delete[] sums;
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
#include "BrookPlatform.h" #include "BrookPlatform.h"
#include "OpenMMException.h" #include "OpenMMException.h"
#include "BrookStreamImpl.h" #include "BrookStreamImpl.h"
#include "gpu/kcom.h" #include "kernels/kcom.h"
using namespace OpenMM; using namespace OpenMM;
using namespace std; using namespace std;
......
...@@ -34,9 +34,9 @@ ...@@ -34,9 +34,9 @@
#include "BrookPlatform.h" #include "BrookPlatform.h"
#include "OpenMMException.h" #include "OpenMMException.h"
#include "BrookStreamImpl.h" #include "BrookStreamImpl.h"
#include "gpu/kshakeh.h" #include "kernels/kshakeh.h"
#include "gpu/kupdatemd.h" #include "kernels/kupdatemd.h"
#include "gpu/kcommon.h" #include "kernels/kcommon.h"
using namespace OpenMM; using namespace OpenMM;
using namespace std; using namespace std;
...@@ -448,6 +448,7 @@ std::string BrookVerletDynamics::getContentsString( int level ) const { ...@@ -448,6 +448,7 @@ std::string BrookVerletDynamics::getContentsString( int level ) const {
return message.str(); return message.str();
} }
/** /**
* Update * Update
* *
...@@ -467,22 +468,25 @@ int BrookVerletDynamics::update( BrookStreamImpl& positionStream, BrookStreamImp ...@@ -467,22 +468,25 @@ int BrookVerletDynamics::update( BrookStreamImpl& positionStream, BrookStreamImp
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
static std::string methodName = "\nBrookVerletDynamics::update"; static std::string methodName = "\nBrookVerletDynamics::update";
static int printOn = 0; static int printOn = 1;
FILE* log; FILE* log;
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
_internalStepCount++; _internalStepCount++;
setLog( stderr ); //setLog( stderr );
printOn = (printOn && getLog()) ? printOn : 0; if( printOn && getLog() ){
log = getLog();;
} else {
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();
if( showAux ){ if( showAux ){
showAux = 0; showAux = 0;
...@@ -680,7 +684,7 @@ setLog( stderr ); ...@@ -680,7 +684,7 @@ setLog( stderr );
// diagnostics // diagnostics
if( (_internalStepCount % 10000) == 0 ){ if( (_internalStepCount % 100) == 0 ){
FILE* log1 = stderr; FILE* log1 = stderr;
float epsilon = 1.0e-01f; float epsilon = 1.0e-01f;
...@@ -698,9 +702,12 @@ setLog( stderr ); ...@@ -698,9 +702,12 @@ setLog( stderr );
// Shake violations // Shake violations
std::string violationString; std::string violationString;
if( brookShakeAlgorithm.getNumberOfConstraints() > 0 ){
int constraintViolations = brookShakeAlgorithm.checkConstraints( brookStreamInternalPos, violationString, 0.0001f ); int constraintViolations = brookShakeAlgorithm.checkConstraints( brookStreamInternalPos, violationString, 0.0001f );
abort += abs( constraintViolations ); abort += abs( constraintViolations );
} else {
violationString = "Shake not active";
}
// force sums ~ 0? // force sums ~ 0?
std::vector<float> sums; std::vector<float> sums;
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
#include "BrookStreamImpl.h" #include "BrookStreamImpl.h"
#include "OpenMMBrookInterface.h" #include "OpenMMBrookInterface.h"
#include "gpu/kcommon.h" #include "kernels/kcommon.h"
using namespace OpenMM; using namespace OpenMM;
using namespace std; using namespace std;
...@@ -539,15 +539,20 @@ void OpenMMBrookInterface::computeForces( OpenMMContextImpl& context ){ ...@@ -539,15 +539,20 @@ void OpenMMBrookInterface::computeForces( OpenMMContextImpl& context ){
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
//setLog( stderr ); //setLog( stderr );
printOn = (printOn && getLog()) ? printOn : 0;
if( printOn && getLog() ){
log = getLog();
} else {
printOn = 0;
}
BrookStreamImpl* positions = getParticlePositions(); BrookStreamImpl* positions = getParticlePositions();
BrookStreamImpl* forces = getParticleForces(); BrookStreamImpl* forces = getParticleForces();
// info // info
//if( printOn > 1 ){ if( printOn > 1 ){
if( 1 ){ //if( 1 ){
printForcesToFile( context ); printForcesToFile( context );
} }
...@@ -562,7 +567,6 @@ void OpenMMBrookInterface::computeForces( OpenMMContextImpl& context ){ ...@@ -562,7 +567,6 @@ void OpenMMBrookInterface::computeForces( OpenMMContextImpl& context ){
// bonded forces // bonded forces
if( printOn ){ if( printOn ){
log = getLog();
(void) fprintf( log, "%s done nonbonded: bonded=%d completed=%d\n", methodName.c_str(), (void) fprintf( log, "%s done nonbonded: bonded=%d completed=%d\n", methodName.c_str(),
_brookBonded.isActive(), _brookBonded.isSetupCompleted() ); _brookBonded.isActive(), _brookBonded.isSetupCompleted() );
(void) fflush( log ); (void) fflush( log );
...@@ -636,7 +640,7 @@ void OpenMMBrookInterface::printForcesToFile( OpenMMContextImpl& context ){ ...@@ -636,7 +640,7 @@ void OpenMMBrookInterface::printForcesToFile( OpenMMContextImpl& context ){
// first step only? // first step only?
if( step > 0 ){ if( step > 1 ){
return; return;
} }
...@@ -695,14 +699,12 @@ void OpenMMBrookInterface::printForcesToFile( OpenMMContextImpl& context ){ ...@@ -695,14 +699,12 @@ void OpenMMBrookInterface::printForcesToFile( OpenMMContextImpl& context ){
if( _brookGbsa.isActive() ){ if( _brookGbsa.isActive() ){
forces->fillWithValue( &zero ); forces->fillWithValue( &zero );
_brookGbsa.computeForces( *positions, *forces ); _brookGbsa.computeForces( *positions, *forces );
std::string fileName = fileNameBase + "Obc.txt"; std::string fileName = fileNameBase + "Obc.txt";
BrookStreamInternal::printStreamsToFile( fileName, streams ); BrookStreamInternal::printStreamsToFile( fileName, streams );
} }
forces->fillWithValue( &zero );
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
...@@ -710,6 +712,8 @@ void OpenMMBrookInterface::printForcesToFile( OpenMMContextImpl& context ){ ...@@ -710,6 +712,8 @@ void OpenMMBrookInterface::printForcesToFile( OpenMMContextImpl& context ){
if( 1 ){ if( 1 ){
forces->fillWithValue( &zero );
if( _brookNonBonded.isActive() ){ if( _brookNonBonded.isActive() ){
_brookNonBonded.computeForces( *positions, *forces ); _brookNonBonded.computeForces( *positions, *forces );
} }
...@@ -726,8 +730,6 @@ void OpenMMBrookInterface::printForcesToFile( OpenMMContextImpl& context ){ ...@@ -726,8 +730,6 @@ void OpenMMBrookInterface::printForcesToFile( OpenMMContextImpl& context ){
BrookStreamInternal::printStreamsToFile( fileName, streams ); BrookStreamInternal::printStreamsToFile( fileName, streams );
} }
(void) fprintf( stderr, "%s done computeForces\n", methodName.c_str() );
(void) fflush( stderr );
forces->fillWithValue( &zero ); forces->fillWithValue( &zero );
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
......
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