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

Mods

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