This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/34517] INCOROUT: C++ OpenMP lastprivate



------- Comment #2 from jakub at gcc dot gnu dot org  2007-12-18 11:39 -------
IMHO it can validly print 7, 14, 21 or 28.  See OpenMP 2.5, section 2.5.2:
"The method of scheduling the structured blocks among threads in the team is
implementation defined."
Also, data sharing clause is sections construct clause rather than section
directive clause, so no matter how many section directives you have, the
constructor/destructor will be called as many times as there are threads in the
team.  GCC schedules the first not yet processed #pragma omp section block
to the first available thread, doesn't do assign different blocks to different
threads no matter whether they are available or not.  So, if e.g. one
(typically master) thread is available some time before all other threads and
there isn't
really any significant work to do in the block, so it finishes almost
instantly,
it might very well win the next section block as well, because other threads
are
still being set up.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34517


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]