Date: Mon, 17 Aug 2015 23:51:56 +0300 From: Solar Designer <solar@...nwall.com> To: john-dev@...ts.openwall.com Subject: Re: Sybase-PROP (Re: FMT_OMP_BAD) On Mon, Aug 17, 2015 at 03:29:58PM -0500, JimF wrote: > I am surprised that it worked at all, with the static's the way they were. Why, it's multiple threads writing the same data to the same locations. It's just that reads and writes from/to "First" needed the corresponding memory barriers. On x86, not much can go wrong: https://en.wikipedia.org/wiki/Memory_ordering#In_symmetric_multiprocessing_.28SMP.29_microprocessor_systems but regardless of the architecture's memory ordering guarantees, compiler-level memory barriers are required. > As for me not seeing a problem with OMP scaling, I wonder if my build was > actually producing invalid results, possibly not detecting thread > interference and not accounting for it. To me, it sounds like this was > happening on on super, thus your scaling was looking very poor. x86 provides the same strict memory ordering guarantees on both systems. super may have experienced more of a performance impact due to it being dual-socket. However, I am still surprised things didn't stabilize quickly, since this is normally initialization code only. I would have expected all threads to eventually see !First, and skip all the writes. Perhaps on your machine they did, but on super they did not. > >In other words, you're getting slightly worse OpenMP scaling now than > >before? But overall better speeds, due to improved single-thread speed? > > The slowdown is really within expectations, Of course. I didn't imply otherwise. > since the faster you go, the further away from 'ideal' you expect to get. I think not for that reason in this case. Rather, it's because you're running 2 threads/core. I think the code changed in a way that it exploits more parallelism per thread, leaving less resources idle when running 1 thread and thus less to be gained with SMT. Alexander
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.