2012-02-22 9 views
0

私の質問は、以下の疑似コードの状況に関するものです。私の状況では、コード全体に対して1つの並列領域を使用することができます。 ifおよびelseステートメントfor、ifとelseを使用した適切なopenmpの実装

for loop 
    { 
     //some code , possible reduction here 
    } 

    if something 
    { 
     for (loop 1) 
     { 
      //some code2, another exasperated reduction here       
     } 
    } 
    else 
    { 
     for (loop 2) 
     { 
      //some code 3 , special function here 
     } 
    } 

    if (another case) 
    { 
    for (for loop 3) 
    { 
     // some code 4, another special function 
    } 
    } 
} 

答えて

1

はい、コード全体で1つの並列領域を使用できます。実行可能なすべての分岐で発生するすべての削減を考慮に入れてください。

関連する問題