MPI / openMP:一个进程在等待时是否可能使用其他进程的资源

时间:2018-11-06 15:28:53

标签: c++ mpi openmp

我有一个使用MPI和openMP的C ++程序,其内容如下:

Some_stuff_done_by_all_ranks();
Comm.Barrier(); //wait until stuff is done by all ranks
if (rank==0)
 {
  very_slow_function(); //but efficiently parallelizable with openMP
 }
Comm.Barrier() //All ranks wait until the function is done
Comm.Bcast(result_of_for_loop,0) // Bring the result of very_slow_function() from rank 0 to other ranks
Some_more_stuff_done_by_all_ranks();

当very_slow_funtion()运行时,所有其他MPI进程都在等待其结果,因此基本上所有这些处理器都没有执行任何操作。我想知道等级0是否有办法临时分配分配给其余MPI进程的资源,以便该功能可以更快地运行。

非常感谢

0 个答案:

没有答案