"openmmapi/vscode:/vscode.git/clone" did not exist on "6717a85cc4255c7e3985d5cfdb022fbc9106830f"
Commit e391509f authored by Michael Sherman's avatar Michael Sherman
Browse files

Fix some MSVC compiler warnings and a bug in the MSVC case for getDefaultPluginsDirectory().

parent bf2a390b
......@@ -199,15 +199,15 @@ vector<string> Platform::loadPluginsFromDirectory(string directory) {
const string& Platform::getDefaultPluginsDirectory() {
char* dir = getenv("OPENMM_PLUGIN_DIR");
static string directory;
#ifdef _MSC_VER
if (dir != NULL)
return string(dir);
return directory = dir;
dir = getenv("PROGRAMFILES");
if (dir == NULL)
return "C:\\\\Program Files\\OpenMM\\lib\\plugins";
return string(dir)+"\\OpenMM\\lib\\plugins";
return directory = "C:\\\\Program Files\\OpenMM\\lib\\plugins";
return directory = (string(dir)+"\\OpenMM\\lib\\plugins");
#else
static string directory;
if (dir == NULL)
directory = "/usr/local/openmm/lib/plugins";
directory = string(dir);
......
......@@ -310,16 +310,16 @@ void CudaCalcNonbondedForceKernel::initialize(const System& system, const Nonbon
double my = boxVectors[1][1]/force.getCutoffDistance();
double mz = boxVectors[2][2]/force.getCutoffDistance();
double pi = 3.1415926535897932385;
int kmaxx = std::ceil(-(mx/pi)*std::log(ewaldErrorTol));
int kmaxy = std::ceil(-(my/pi)*std::log(ewaldErrorTol));
int kmaxz = std::ceil(-(mz/pi)*std::log(ewaldErrorTol));
int kmaxx = (int)std::ceil(-(mx/pi)*std::log(ewaldErrorTol));
int kmaxy = (int)std::ceil(-(my/pi)*std::log(ewaldErrorTol));
int kmaxz = (int)std::ceil(-(mz/pi)*std::log(ewaldErrorTol));
if (kmaxx%2 == 0)
kmaxx++;
if (kmaxy%2 == 0)
kmaxy++;
if (kmaxz%2 == 0)
kmaxz++;
gpuSetEwaldParameters(gpu, alpha, kmaxx, kmaxy, kmaxz);
gpuSetEwaldParameters(gpu, (float)alpha, kmaxx, kmaxy, kmaxz);
method = EWALD;
}
data.nonbondedMethod = method;
......@@ -572,7 +572,7 @@ void CudaIntegrateVariableVerletStepKernel::execute(OpenMMContextImpl& context,
gpuSetConstants(gpu);
prevErrorTol = errorTol;
}
float maxStepSize = maxTime-data.time;
float maxStepSize = (float)(maxTime-data.time);
kSelectVerletStepSize(gpu, maxStepSize);
kVerletUpdatePart1(gpu);
kApplyFirstShake(gpu);
......
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