[pythran] Re: First test on macOS: Pb with OMPg

  • From: Olivier Borderies <olivier.borderies@xxxxxxxxx>
  • To: pythran@xxxxxxxxxxxxx
  • Date: Mon, 17 Dec 2018 22:59:59 +0100

On Mon, Dec 17, 2018 at 10:28 PM serge guelton <
serge.guelton@xxxxxxxxxxxxxxxxxxx> wrote:

On Wed, Dec 12, 2018 at 12:19:28PM +0100, Olivier Borderies wrote:

    I can reproduce your problems, and after a look at the parallel run,
tehre
    are *a lot* of shared access in the parallel loop, and you're not
    protecting them. All accesses to n_accept, redefinition of new_path
etc are
    done on shared variable...


Thx for the pointer ! Indeed I'm new to omp. I fixed it. Now it does
work on
macOS and Linux. But surprisingly the speedup is much larger in macOS
(laptop
and desktop) than on the Linux VM.
On macOS the speed up from omp (branch omp) is very much in line with
that from
concurrent.futures (branch master) - as expected since each top loop
runs an
entirely separate simulation.
But on Linux, the speed up is far less. No crash, no warning, good
results
though. Since it is a VM I cannot really see the CPU use (and check it
climbs
to 100%). I checked that 'apt list --installed | grep omp' shows
'libgomp1'....
What kind of reason could explain that ??

Inside a VM... how many core did you allocate to the VM?

The VM I picked had 16 cores but for unexplained reasons it would not go
x~16 faster as *it does* on my laptop and desktop (x4 and x8 respectively,
for that number of cores). It's exactly the same code though.. Bizarre...
Is there some special characteristic that a core must have to work well
with omp ?..


If you're ultra-motivated, you could reformat your README to fit into

    http://serge-sans-paille.github.io/pythran-stories/

That would be a nice contribution to the project ;-)


I was planning to do a write-up in the form of a medium article + links.
There are many topics: Pythran (first and foremost), Simulated Annealing
algo, TSP problem, (permutation signature - not yet in code/repo),
parallelism via concurrent futures and OMP (at least it works as expected
on my macOS machines), remote Jupyter with cloud VM (Google and Azure).
So maybe the best way is to make the Pythran part + context into an .md for
you blog, and have the medium article link to it. What do you think ?
The right template would be
https://github.com/serge-sans-paille/pythran-stories/blob/master/content/2018-11-28-prototype-to-fast-c%2B%2B.rst
for example, correct ?

Other related posts: