Software Archive
Read-only legacy content
17061 Discussions

OpenMP-like flush operation in Cilk+?

Fan_Y_
Beginner
271 Views

Dear everyone, 

Does in Cilk+ exist such operation that invalidates the corresponding cache line so as to force the retrieval from the main memory just like what does OpenMP "flush"? 

Thanks!

Bests,

Fan

0 Kudos
1 Reply
Nick_M_3
New Contributor I
271 Views


Grrk.  That's NOT what OpenMP flush does, I am afraid!  The specification is massively unclear about exactly what it does, but it's general effect is to synchronise the local view of data with the global view of data.  But, if another thread has made a change and not yet used flush, you are very likely to not see that change.  I think that you need to be a lot more precise about what you need and why.

As a general rule, the more synchronisation you use, the slower your program will run and the less you are likely to be 'thinking in parallel'.  Some requirements fundamentally require synchronisation, of course, but it should be avoided unless essential.

0 Kudos
Reply