Skip to content
Snippets Groups Projects
Commit f44e6353 authored by Pilar Cossio's avatar Pilar Cossio
Browse files

Merge branch 'devel_drohr' of gitta.rzg.mpg.de:BioEM into devel_drohr

parents e8789e71 e82f8845
No related branches found
No related tags found
No related merge requests found
...@@ -417,6 +417,7 @@ int bioem::run() ...@@ -417,6 +417,7 @@ int bioem::run()
MPI_Reduce(tmp1, tmp3, RefMap.ntotRefMap, MY_MPI_FLOAT, MPI_SUM, 0, MPI_COMM_WORLD); MPI_Reduce(tmp1, tmp3, RefMap.ntotRefMap, MY_MPI_FLOAT, MPI_SUM, 0, MPI_COMM_WORLD);
//Find MaxProb //Find MaxProb
MPI_Status mpistatus;
{ {
int* tmpi1 = new int[RefMap.ntotRefMap]; int* tmpi1 = new int[RefMap.ntotRefMap];
int* tmpi2 = new int[RefMap.ntotRefMap]; int* tmpi2 = new int[RefMap.ntotRefMap];
...@@ -436,7 +437,7 @@ int bioem::run() ...@@ -436,7 +437,7 @@ int bioem::run()
{ {
if (mpi_rank == 0) 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]) else if (mpi_rank == tmpi2[i])
{ {
......
...@@ -310,6 +310,27 @@ int bioem_cuda::selectCudaDevice() ...@@ -310,6 +310,27 @@ int bioem_cuda::selectCudaDevice()
bestDeviceSpeed = deviceSpeed; 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); cudaGetDeviceProperties(&deviceProp ,bestDevice);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment