Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
adf78fa5
Commit
adf78fa5
authored
Jul 26, 2013
by
peastman
Browse files
Merge pull request #78 from peastman/master
Include process ID in temporary file names to avoid collisions
parents
80e35034
71b66a9b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
platforms/cuda/src/CudaContext.cpp
platforms/cuda/src/CudaContext.cpp
+8
-0
No files found.
platforms/cuda/src/CudaContext.cpp
View file @
adf78fa5
...
...
@@ -48,6 +48,9 @@
#include <sstream>
#include <typeinfo>
#include <cudaProfiler.h>
#ifndef WIN32
#include <unistd.h>
#endif
#define CHECK_RESULT(result) CHECK_RESULT2(result, errorMessage);
...
...
@@ -398,6 +401,11 @@ CUmodule CudaContext::createModule(const string source, const map<string, string
stringstream
tempFileName
;
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
outputFile
=
(
tempDir
+
tempFileName
.
str
()
+
".ptx"
);
string
logFile
=
(
tempDir
+
tempFileName
.
str
()
+
".log"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment