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.
|