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
d7aa33fe
Commit
d7aa33fe
authored
Aug 05, 2010
by
Mark Friedrichs
Browse files
Fixed bug in setting Cuda device
parent
ac8cb97f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
plugins/amoeba/platforms/cuda/tests/AmoebaTinkerParameterFile.cpp
...amoeba/platforms/cuda/tests/AmoebaTinkerParameterFile.cpp
+8
-7
No files found.
plugins/amoeba/platforms/cuda/tests/AmoebaTinkerParameterFile.cpp
View file @
d7aa33fe
...
...
@@ -3027,9 +3027,10 @@ static int readAmoebaSurfaceParameters( FILE* filePtr, MapStringInt& forceMap, c
//static const unsigned int maxPrint = MAX_PRINT;
static
const
unsigned
int
maxPrint
=
15
;
unsigned
int
arraySize
=
static_cast
<
unsigned
int
>
(
sasaForce
->
getNumParticles
());
(
void
)
fprintf
(
log
,
"%s: %u sample of AmoebaSASAForce parameters in %s units; probe radius=%10.4f
\n
"
,
methodName
.
c_str
(),
arraySize
,
//(void) fprintf( log, "%s: %u sample of AmoebaSASAForce parameters in %s units; probe radius=%10.4f\n",
//methodName.c_str(), arraySize, (useOpenMMUnits ? "OpenMM" : "Amoeba"),
(
void
)
fprintf
(
log
,
"%s: %u sample of AmoebaSASAForce parameters; probe radius=%10.4f
\n
"
,
methodName
.
c_str
(),
arraySize
,
sasaForce
->
getProbeRadius
()
);
for
(
unsigned
int
ii
=
0
;
ii
<
arraySize
;
ii
++
){
...
...
@@ -4505,17 +4506,17 @@ Context* createContext( const std::string& amoebaTinkerParameterFileName, MapStr
Platform
&
platform
=
Platform
::
getPlatformByName
(
"Cuda"
);
map
<
string
,
string
>
properties
;
if
(
getenv
(
"CudaDevice"
)
||
cudaDevice
>
-
1
){
std
::
string
cudaDevice
;
std
::
string
cudaDevice
Str
;
if
(
getenv
(
"CudaDevice"
)
){
cudaDevice
=
getenv
(
"CudaDevice"
);
cudaDevice
Str
=
getenv
(
"CudaDevice"
);
}
else
{
std
::
stringstream
cudaDeviceStrStr
;
cudaDeviceStrStr
<<
cudaDevice
;
cudaDevice
=
cudaDeviceStrStr
.
str
();
cudaDevice
Str
=
cudaDeviceStrStr
.
str
();
}
properties
[
"CudaDevice"
]
=
cudaDevice
;
properties
[
"CudaDevice"
]
=
cudaDevice
Str
;
if
(
log
){
(
void
)
fprintf
(
log
,
"Setting Cuda device to %s.
\n
"
,
cudaDevice
.
c_str
()
);
(
void
)
fprintf
(
log
,
"Setting Cuda device to %s.
\n
"
,
cudaDevice
Str
.
c_str
()
);
}
}
Context
*
context
=
new
Context
(
*
system
,
*
integrator
,
platform
,
properties
);
...
...
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