Hi all,
I have a question about the loop in parallel code.
for (i=0; i<MAX; i++)
{
// some sequential code
// parallel code
// some sequential code
}
In the above code, I want the outer loop to be dominated only by rank-0
process. For that purpose, I add a condition like
if (rank==0)
{
for (i=0; i<MAX; i++)
{
// some sequential code A
// parallel code B
// some sequential code C
}
}
However, the above code will keep other process outside the loop so the
parallel code B will not run parallelly. Anyone have idea for that issue?
Thanks in advance.
|