Commit e82f8845 authored by David Rohr's avatar David Rohr

give mpi_recv a dummy status for stupid intel mpi..., add option to specify CUDA device

parent 45f96086
......@@ -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])
{
......
......@@ -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);
......
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