Commit beb589ad authored by Jason Swails's avatar Jason Swails
Browse files

Merge branch 'master' of github.com:/pandegroup/openmm into feature/cuda-docker

parents 1448e1f0 ec5f7a18
......@@ -28,7 +28,7 @@ install:
- "set PATH=C:\\fftw;%PATH%"
# Download and install some OpenMM build dependencies (doxygen, swig)
- choco install -y doxygen.portable swig > null
- choco install -y doxygen.install swig > null
# Download OpenCL Headers and build the ICD loader
- ps: "[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12;"
......
Vagrant.configure("2") do |config|
config.vm.box = "gusztavvargadr/windows10ee"
config.vm.box = "gusztavvargadr/windows-10"
config.vm.provision :shell, path: "prepare.ps1"
config.vm.provider :virtualbox do |vb|
......
......@@ -2,8 +2,8 @@ cd C:\Users\vagrant
# Install CUDA.
wget https://developer.nvidia.com/compute/cuda/9.2/Prod2/network_installers/cuda_9.2.148_win10_network -UseBasicParsing -OutFile cuda_9.2.148_win10_network.exe
.\cuda_9.2.148_win10_network.exe -s nvcc_9.2 cudart_9.2 cufft_9.2 cufft_dev_9.2 nvrtc_9.2 nvrtc_dev_9.2 | Out-Null
wget https://developer.nvidia.com/compute/cuda/10.1/Prod/network_installers/cuda_10.1.168_win10_network.exe -UseBasicParsing -OutFile cuda_10.1.168_win10_network.exe
.\cuda_10.1.168_win10_network.exe -s nvcc_10.1 cudart_10.1 cufft_10.1 cufft_dev_10.1 nvrtc_10.1 nvrtc_dev_10.1 | Out-Null
# Install AMD APP SDK.
......@@ -14,10 +14,11 @@ wget https://s3.amazonaws.com/omnia-ci/AMD-APP-SDK-v2.9-1.599.381-GA-Full-window
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Windows-x86_64.exe -UseBasicParsing -OutFile Miniconda3-latest-Windows-x86_64.exe
.\Miniconda3-latest-Windows-x86_64.exe /S /D=C:\Miniconda3 | Out-Null
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\Miniconda3;C:\Miniconda3\Scripts;C:\Miniconda3\Library\bin", [EnvironmentVariableTarget]::User)
# Install software with conda.
&"C:\Miniconda3\Scripts\conda.exe" config --add channels omnia --add channels conda-forge
& "C:\Miniconda3\Scripts\conda.exe" config --add channels omnia --add channels conda-forge
& "C:\Miniconda3\Scripts\conda.exe" install -y fftw3f==3.3.4=vc14_2 jinja2 lxml sphinx sphinxcontrib-autodoc_doxygen sphinxcontrib-lunrsearch conda-build anaconda-client
& "C:\Miniconda3\Scripts\pip.exe" install sphinxcontrib.bibtex
......
......@@ -93,7 +93,7 @@ FOREACH(EX_ROOT ${F_EXAMPLES})
INSTALL(FILES ${EX_ROOT}.f90 DESTINATION examples)
ENDFOREACH(EX_ROOT ${F_EXAMPLES})
INSTALL(FILES simulateAmber.py simulatePdb.py simulateGromacs.py benchmark.py argon-chemical-potential.py input.inpcrd input.prmtop input.pdb input.gro input.top 5dfr_minimized.pdb 5dfr_solv-cube_equil.pdb
INSTALL(FILES simulateAmber.py simulatePdb.py simulateGromacs.py benchmark.py argon-chemical-potential.py input.inpcrd input.prmtop input.pdb input.gro input.top 5dfr_minimized.pdb 5dfr_solv-cube_equil.pdb apoa1.pdb
DESTINATION examples)
INSTALL(FILES VisualStudio/HelloArgon.vcproj
......
......@@ -20,6 +20,16 @@ PyObject *copyVVec3ToList(std::vector<Vec3> vVec3) {
return pyList;
}
int isNumpyAvailable() {
static bool initialized = false;
static bool available = false;
if (!initialized) {
initialized = true;
available = (_import_array() >= 0);
}
return available;
}
} // namespace OpenMM
%}
......
......@@ -156,13 +156,49 @@ OpenMM::Vec3 Py_SequenceToVec3(PyObject* obj, int& status) {
%fragment("Py_SequenceToVecDouble", "header", fragment="Py_StripOpenMMUnits") {
int Py_SequenceToVecDouble(PyObject* obj, std::vector<double>& out) {
PyObject* stripped = NULL;
PyObject* stripped = Py_StripOpenMMUnits(obj);
PyObject* item = NULL;
PyObject* item1 = NULL;
PyObject* iterator = NULL;
stripped = Py_StripOpenMMUnits(obj);
iterator = PyObject_GetIter(stripped);
if (isNumpyAvailable()) {
if (PyArray_Check(stripped) && PyArray_ISCARRAY_RO(stripped) && PyArray_NDIM(stripped) == 1) {
int type = PyArray_TYPE(stripped);
int length = PyArray_SIZE(stripped);
void* data = PyArray_DATA((PyArrayObject*) stripped);
if (type == NPY_DOUBLE) {
out.resize(length);
memcpy(&out[0], data, sizeof(double)*length);
Py_DECREF(stripped);
return SWIG_OK;
}
if (type == NPY_FLOAT) {
out.resize(length);
float* floatData = (float*) data;
for (int i = 0; i < length; i++)
out[i] = floatData[i];
Py_DECREF(stripped);
return SWIG_OK;
}
if (type == NPY_INT32) {
out.resize(length);
int* intData = (int*) data;
for (int i = 0; i < length; i++)
out[i] = intData[i];
Py_DECREF(stripped);
return SWIG_OK;
}
if (type == NPY_INT64) {
out.resize(length);
long long* longData = (long long*) data;
for (int i = 0; i < length; i++)
out[i] = longData[i];
Py_DECREF(stripped);
return SWIG_OK;
}
}
}
PyObject* iterator = PyObject_GetIter(stripped);
if (iterator == NULL) {
Py_DECREF(stripped);
return SWIG_ERROR;
......@@ -194,16 +230,6 @@ int Py_SequenceToVecDouble(PyObject* obj, std::vector<double>& out) {
}
%fragment("Py_SequenceToVecVec3", "header", fragment="Py_SequenceToVec3") {
int isNumpyAvailable() {
static bool initialized = false;
static bool available = false;
if (!initialized) {
initialized = true;
available = (_import_array() >= 0);
}
return available;
}
int Py_SequenceToVecVec3(PyObject* obj, std::vector<Vec3>& out) {
PyObject* stripped = Py_StripOpenMMUnits(obj); // new reference
if (isNumpyAvailable()) {
......
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