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
MPIBP-Hummer
BioEM
Commits
e82f8845
Commit
e82f8845
authored
Jul 07, 2014
by
David Rohr
Browse files
give mpi_recv a dummy status for stupid intel mpi..., add option to specify CUDA device
parent
45f96086
Changes
2
Hide whitespace changes
Inline
Side-by-side
bioem.cpp
View file @
e82f8845
...
...
@@ -417,6 +417,7 @@ int bioem::run()
MPI_Reduce
(
tmp1
,
tmp3
,
RefMap
.
ntotRefMap
,
MY_MPI_FLOAT
,
MPI_SUM
,
0
,
MPI_COMM_WORLD
);
//Find MaxProb
MPI_Status
mpistatus
;
{
int
*
tmpi1
=
new
int
[
RefMap
.
ntotRefMap
];
int
*
tmpi2
=
new
int
[
RefMap
.
ntotRefMap
];
...
...
@@ -436,7 +437,7 @@ int bioem::run()
{
if
(
mpi_rank
==
0
)
{
MPI_Recv
(
&
pProb
.
getProbMap
(
i
).
max
,
sizeof
(
pProb
.
getProbMap
(
i
).
max
),
MPI_BYTE
,
tmpi2
[
i
],
i
,
MPI_COMM_WORLD
,
NULL
);
MPI_Recv
(
&
pProb
.
getProbMap
(
i
).
max
,
sizeof
(
pProb
.
getProbMap
(
i
).
max
),
MPI_BYTE
,
tmpi2
[
i
],
i
,
MPI_COMM_WORLD
,
&
mpistatus
);
}
else
if
(
mpi_rank
==
tmpi2
[
i
])
{
...
...
bioem_cuda.cu
View file @
e82f8845
...
...
@@ -310,6 +310,27 @@ int bioem_cuda::selectCudaDevice()
bestDeviceSpeed
=
deviceSpeed
;
}
}
if
(
getenv
(
"GPUDEVICE"
))
{
int
device
=
atoi
(
getenv
(
"GPUDEVICE"
));
if
(
device
>
count
)
{
printf
(
"Invalid CUDA device specified, max device number is %d
\n
"
,
count
);
exit
(
1
);
}
#ifdef WITH_MPI
if
(
device
==
-
1
)
{
device
=
mpi_rank
%
count
;
}
#endif
if
(
device
<
0
)
{
printf
(
"Negative CUDA device specified: %d, invalid!
\n
"
,
device
);
}
bestDevice
=
device
;
}
checkCudaErrors
(
cudaSetDevice
(
bestDevice
));
cudaGetDeviceProperties
(
&
deviceProp
,
bestDevice
);
...
...
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