Commit adf78fa5 authored by peastman's avatar peastman
Browse files

Merge pull request #78 from peastman/master

Include process ID in temporary file names to avoid collisions
parents 80e35034 71b66a9b
...@@ -48,6 +48,9 @@ ...@@ -48,6 +48,9 @@
#include <sstream> #include <sstream>
#include <typeinfo> #include <typeinfo>
#include <cudaProfiler.h> #include <cudaProfiler.h>
#ifndef WIN32
#include <unistd.h>
#endif
#define CHECK_RESULT(result) CHECK_RESULT2(result, errorMessage); #define CHECK_RESULT(result) CHECK_RESULT2(result, errorMessage);
...@@ -398,6 +401,11 @@ CUmodule CudaContext::createModule(const string source, const map<string, string ...@@ -398,6 +401,11 @@ CUmodule CudaContext::createModule(const string source, const map<string, string
stringstream tempFileName; stringstream tempFileName;
tempFileName << "openmmTempKernel" << this; // Include a pointer to this context as part of the filename to avoid collisions. tempFileName << "openmmTempKernel" << this; // Include a pointer to this context as part of the filename to avoid collisions.
#ifdef WIN32
tempFileName << "_" << GetCurrentProcessId();
#else
tempFileName << "_" << getpid();
#endif
string inputFile = (tempDir+tempFileName.str()+".cu"); string inputFile = (tempDir+tempFileName.str()+".cu");
string outputFile = (tempDir+tempFileName.str()+".ptx"); string outputFile = (tempDir+tempFileName.str()+".ptx");
string logFile = (tempDir+tempFileName.str()+".log"); string logFile = (tempDir+tempFileName.str()+".log");
......
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