On 2019/06/13 16:04, Jonathan Thornburg wrote: > [[speedups from OpenMP]] > In message <https://marc.info/?l=openbsd-ports&m=155992865732530&w=1>, > j () bitminer ! ca wrote > [[about openmp]] > > For long calculations, I have seen 2 cores with OpenMP take half the time > > as one core with/without. So yes, it works. But Amdahl's Law applies. > > If a calculation is long, and 20% is serial, and 80% parallelizable, > > then the runtimes will be 100%, 60%, 46% and 40% at 1, 2, 3 and 4 cores. > > The difference between 3 and 4 cores is not much. If 100% takes 4 hours, > > then the difference between 1 and 2 cores is significant. > > I replied: > > I have a code which typically gets a speedup of ~6 using OpenMP on > > 8 cores and ~12 on 16 cores. Using OpenMP the code runs for anywhere > > from a few days to a few weeks, so the OpenMP speedup is very significant. > > > > The code is ~100K lines of C++, developed on OpenBSD, running on a > > Linux supercomputer. I added OpenMP support in 2015, so it's all guarded > > with an #ifdef which is disabled on OpenBSD. (Debugging the OpenMP > > directly on the supercomputer was slightly painful; fortunately this > > code's use of OpenMP is very simple, with only 3 parallel loops and > > one per-thread data structure in the entire code.) > > On Thu, Jun 13, 2019 at 11:18:44PM +0100, Stuart Henderson replied: > > It's really performance _on OpenBSD_ that is of interest when deciding > > whether it's worth the ongoing maintenance to go down this path here :) > > Being able to develop/debug OpenMP code on OpenBSD would be very > useful to me, even if the performance boost were modest.
At the moment, it's unclear to me (maybe it was mentioned in the thread but if so I missed it) what the status of OpenMP is on OpenBSD. Whether it's any faster *at all*, whether it works reliably, etc. > The distinction > here is between > (a) no OpenMP support at all, so all OpenMP code has to be stubbed out > on OpenBSD with #ifdef NOT_DEFINED or dummy routines, vs > (b) OpenMP works and lets me develop/debug on my OpenBSD laptop/desktop > before I ship the code off to the (Linux) supercomputer for big runs. or (c) it's enabled and detected and doesn't really work properly. I don't think it's too much to ask for more information about what we can expect to see with it enabled before we go committing diffs in support of it around the tree .. > > (a) is the current status (where I can only test/debug the OpenMP parts > of my code remotely). > > (b) would be a significantly nicer software development environment > than (a) *even if* the actual performance boost were only modest > (say a factor of 2 on things that only run for a few minutes on a > dual-core machine), because it would allow testing/debugging of the > OpenMP parts of my code locally, in a nice OpenBSD environment fully > under my control.