LAM/MPI logo

LAM/MPI General User's Mailing List Archives

  |   Home   |   Download   |   Documentation   |   FAQ   |   all just in this list

From: Wa-Kun Lam (rexchaos_at_[hidden])
Date: 2003-09-26 00:08:39


Yes. I want A and C to be run sequentially and B parallely. Actually, B
is fftw and the original code is a little bit complicated. I try the
following code but it seems something wrong.

for (i = 0; i < MAX; ++i)
{
  if (rank == 0)
  {
    // some sequential code A
  }
  
  // parallel fftw here

  if (rank == 0)
  {
    // some sequential code B
  }

  // parallel fftw here
  
  if (rank == 0)
  {
    // some sequential code C
  }

}

Someone also suggests the following code

if (rank == 0)
{
  for (i = 0; i < MAX; ++i)
  {
    if (rank == 0)
    {
      // some sequential code A
    }
    // parallel code B
    if (rank == 0)
    {
      // some sequential code C
    }
  }
}
else { // parallel code B
}

I am not sure if it's ok.