Commit df76e34d authored by Mark Friedrichs's avatar Mark Friedrichs
Browse files

Max number of torsion-torsion grids increased to 12

parent b9c09b79
......@@ -50,8 +50,8 @@ using namespace std;
* -------------------------------------------------------------------------- */
static void computeAmoebaLocalForces( AmoebaCudaData& data ) {
amoebaGpuContext gpu = data.getAmoebaGpu();
amoebaGpuContext gpu = data.getAmoebaGpu();
if( 0 && data.getLog() ){
(void) fprintf( data.getLog(), "computeAmoebaLocalForces\n" ); (void) fflush( data.getLog() );
}
......@@ -755,7 +755,9 @@ void CudaCalcAmoebaTorsionTorsionForceKernel::initialize(const System& system, c
AmoebaTorsionTorsionForceImpl::reorderGrid( grid, reorderedGrid );
reorder = 1;
if( data.getLog() ){
(void) fprintf( data.getLog(), "CudaCalcAmoebaTorsionTorsionForceKernel::initialize: reordering torsion-torsion grid %d.\n", gridIndex );
(void) fprintf( data.getLog(), "CudaCalcAmoebaTorsionTorsionForceKernel Reordered torsion-torsion grid %4d [%u %u] %12.3f %12.3f [%u %u] %12.3f %12.3f.\n",
gridIndex, static_cast<unsigned int>(grid.size()), static_cast<unsigned int>(grid[0].size()), grid[0][0][0], grid[0][1][0],
static_cast<unsigned int>(reorderedGrid.size() ), static_cast<unsigned int>(reorderedGrid[0].size() ), reorderedGrid[0][0][0], reorderedGrid[0][1][0] );
}
}
for (unsigned int ii = 0; ii < grid.size(); ii++) {
......@@ -765,9 +767,11 @@ void CudaCalcAmoebaTorsionTorsionForceKernel::initialize(const System& system, c
floatGrids[gridIndex][ii][jj].resize( grid[ii][jj].size() );
if( reorder ){
for( unsigned int kk = 0; kk < grid[ii][jj].size(); kk++) {
floatGrids[gridIndex][ii][jj][kk] = static_cast<float>(reorderedGrid[ii][jj][kk]);
}
} else {
for( unsigned int kk = 0; kk < grid[ii][jj].size(); kk++) {
floatGrids[gridIndex][ii][jj][kk] = static_cast<float>(grid[ii][jj][kk]);
......@@ -1121,7 +1125,6 @@ static void computeAmoebaVdwForce( AmoebaCudaData& data ) {
data.initializeGpu();
// Vdw14_7F
kCalculateAmoebaVdw14_7Forces(gpu, data.getUseVdwNeighborList());
}
......
......@@ -1170,6 +1170,11 @@ void gpuSetAmoebaTorsionTorsionGrids(amoebaGpuContext amoebaGpu, const std::vect
unsigned int torsionTorsionGrids = floatGrids.size(); // number of grids
unsigned int totalGridEntries = 0; // total number of entries over all grids
// used to allocate single memory buffer for grids
if( floatGrids.size() > AMOEBA_MAX_TORSION_TORSION_GRIDS ){
std::stringstream message;
message << "Number of slots for TorsionTorsionGrids is too small -- should be increased to at least " << floatGrids.size();
throw OpenMM::OpenMMException( message.str() );
}
// 4 (grids) * (25 *25 grid)*(2 +4 a1, a2, f, f1,f2, f12) = 15000
......@@ -1178,9 +1183,11 @@ void gpuSetAmoebaTorsionTorsionGrids(amoebaGpuContext amoebaGpu, const std::vect
for (unsigned int ii = 0; ii < floatGrids.size(); ii++) {
unsigned int lastIndex = floatGrids[ii][0].size()-1;
float range = floatGrids[ii][0][lastIndex][1] - floatGrids[ii][0][0][1];
amoebaGpu->amoebaSim.amoebaTorTorGridOffset[ii] = (totalGridEntries/4);
amoebaGpu->amoebaSim.amoebaTorTorGridBegin[ii] = floatGrids[ii][0][0][0];
amoebaGpu->amoebaSim.amoebaTorTorGridDelta[ii] = 360.0f/static_cast<float>(floatGrids[ii].size()-1);
amoebaGpu->amoebaSim.amoebaTorTorGridDelta[ii] = range/static_cast<float>(floatGrids[ii].size()-1);
amoebaGpu->amoebaSim.amoebaTorTorGridNy[ii] = floatGrids[ii].size();
for (unsigned int jj = 0; jj < floatGrids[ii].size(); jj++) {
......
......@@ -48,6 +48,7 @@ enum CudaAmoebaNonbondedMethod
};
static const int AMOEBA_PME_ORDER = 5;
static const int AMOEBA_MAX_TORSION_TORSION_GRIDS = 12;
struct cudaAmoebaGmxSimulation {
......@@ -120,10 +121,10 @@ struct cudaAmoebaGmxSimulation {
unsigned int amoebaTorsionTorsion_offset; // Offset to end of torsion torsions
// grids
int amoebaTorTorGridOffset[4]; // grid offset
int amoebaTorTorGridNy[4]; // 25
float amoebaTorTorGridBegin[4]; // -180.0
float amoebaTorTorGridDelta[4]; // 15.0
int amoebaTorTorGridOffset[AMOEBA_MAX_TORSION_TORSION_GRIDS]; // grid offset
int amoebaTorTorGridNy[AMOEBA_MAX_TORSION_TORSION_GRIDS]; // 25
float amoebaTorTorGridBegin[AMOEBA_MAX_TORSION_TORSION_GRIDS]; // -180.0
float amoebaTorTorGridDelta[AMOEBA_MAX_TORSION_TORSION_GRIDS]; // 15.0
float4* pAmoebaTorsionTorsionGrids; // torsion torsion grids
unsigned int amoebaUreyBradleys; // Number of UB ixns
......
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