使用 MPI,您如何等待线程完成?
例如:
for (int i = localstart; i < localend; i++)
{
// do stuff that is computationally intensive
}
// I need to wait for all other threads to finish here
if (rank == 0) do_something();
使用 MPI,您如何等待线程完成?
例如:
for (int i = localstart; i < localend; i++)
{
// do stuff that is computationally intensive
}
// I need to wait for all other threads to finish here
if (rank == 0) do_something();