"...platforms/cuda/tests/TestCudaAmoebaInPlaneAngleForce.cpp" did not exist on "a566a07487053f5eaee59cac0a0938b790697a65"
Commit 51828eaa authored by Peter Eastman's avatar Peter Eastman
Browse files

Merge branch 'master' into qc

parents cf8a03e8 5ed9dd65
......@@ -50,6 +50,8 @@ void OPENMM_EXPORT throwException(const char* file, int line, const std::string&
#define ASSERT_EQUAL(expected, found) {if (!((expected) == (found))) {std::stringstream details; details << "Expected "<<(expected)<<", found "<<(found); throwException(__FILE__, __LINE__, details.str());}};
#define ASSERT_EQUAL_CONTAINERS(expected, found) {if (!((expected) == (found))) {std::stringstream details; details << "Containers not equal"; throwException(__FILE__, __LINE__, details.str());}};
#define ASSERT_EQUAL_TOL(expected, found, tol) {double _scale_ = std::abs(expected) > 1.0 ? std::abs(expected) : 1.0; if (!(std::abs((expected)-(found))/_scale_ <= (tol))) {std::stringstream details; details << "Expected "<<(expected)<<", found "<<(found); throwException(__FILE__, __LINE__, details.str());}};
#define ASSERT_EQUAL_VEC(expected, found, tol) {double _norm_ = std::sqrt((expected).dot(expected)); double _scale_ = _norm_ > 1.0 ? _norm_ : 1.0; if ((std::abs(((expected)[0])-((found)[0]))/_scale_ > (tol)) || (std::abs(((expected)[1])-((found)[1]))/_scale_ > (tol)) || (std::abs(((expected)[2])-((found)[2]))/_scale_ > (tol))) {std::stringstream details; details << " Expected "<<(expected)<<", found "<<(found); throwException(__FILE__, __LINE__, details.str());}};
......
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
......@@ -9,7 +9,9 @@
*/
#if defined(_MSC_VER)
#ifndef M_PI
#define M_PI 3.14159265358979323846264338327950288
#endif
#if _MSC_VER <= 1700 // 1700 is VC11, 1800 is VC12
/***************************
......
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
......@@ -278,3 +278,7 @@ void Context::loadCheckpoint(istream& stream) {
ContextImpl& Context::getImpl() {
return *impl;
}
const vector<vector<int> >& Context::getMolecules() const {
return impl->getMolecules();
}
......@@ -44,9 +44,12 @@
#include <map>
#include <utility>
#include <vector>
#include <string.h>
using namespace OpenMM;
using namespace std;
const static char CHECKPOINT_MAGIC_BYTES[] = "OpenMM Binary Checkpoint\n";
ContextImpl::ContextImpl(Context& owner, const System& system, Integrator& integrator, Platform* platform, const map<string, string>& properties) :
owner(owner), system(system), integrator(integrator), hasInitializedForces(false), hasSetPositions(false), integratorIsDeleted(false),
......@@ -398,6 +401,7 @@ static string readString(istream& stream) {
}
void ContextImpl::createCheckpoint(ostream& stream) {
stream.write(CHECKPOINT_MAGIC_BYTES, sizeof(CHECKPOINT_MAGIC_BYTES)/sizeof(CHECKPOINT_MAGIC_BYTES[0]));
writeString(stream, getPlatform().getName());
int numParticles = getSystem().getNumParticles();
stream.write((char*) &numParticles, sizeof(int));
......@@ -412,6 +416,12 @@ void ContextImpl::createCheckpoint(ostream& stream) {
}
void ContextImpl::loadCheckpoint(istream& stream) {
static const int magiclength = sizeof(CHECKPOINT_MAGIC_BYTES)/sizeof(CHECKPOINT_MAGIC_BYTES[0]);
char magicbytes[magiclength];
stream.read(magicbytes, magiclength);
if (memcmp(magicbytes, CHECKPOINT_MAGIC_BYTES, magiclength) != 0)
throw OpenMMException("loadCheckpoint: Checkpoint header was not correct");
string platformName = readString(stream);
if (platformName != getPlatform().getName())
throw OpenMMException("loadCheckpoint: Checkpoint was created with a different Platform: "+platformName);
......
......@@ -43,6 +43,7 @@
#include <cmath>
#include <sstream>
#include <utility>
#include <algorithm>
using namespace OpenMM;
using namespace std;
......
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
......@@ -35,6 +35,7 @@
#include "openmm/kernels.h"
#include <cmath>
#include <vector>
#include <algorithm>
using namespace OpenMM;
using namespace OpenMM_SFMT;
......
......@@ -35,6 +35,7 @@
#include "openmm/kernels.h"
#include <cmath>
#include <vector>
#include <algorithm>
using namespace OpenMM;
using namespace OpenMM_SFMT;
......
......@@ -39,6 +39,7 @@
#include <cmath>
#include <map>
#include <sstream>
#include <algorithm>
using namespace OpenMM;
using namespace std;
......
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
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