Skip to content

Commit

Permalink
omp start but std::vec not thread safe
Browse files Browse the repository at this point in the history
  • Loading branch information
Srinath Vadlamani committed Apr 1, 2015
1 parent e38891c commit 770b790
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions codingTests/cplusplus/testVec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@ int main(){
#ifdef USE_TAU
TAU_START("std::vector.push_back loop");
#endif
#pragma omp parallel for
for (int i = 0; i < N; ++i)
#pragma omp parallel
{
#pragma omp for
for (int i = 0; i < N; ++i)
{
v1.push_back(float(i));
}

}
#ifdef USE_TAU
TAU_STOP("std::vector.push_back loop");
#endif
Expand Down

0 comments on commit 770b790

Please sign in to comment.