[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Parallel APL Questions

From: Andrew
Subject: Parallel APL Questions
Date: Fri, 7 Feb 2020 17:35:30 +0000

Good evening

This is my first post to this mailing list.  It is a mainly some questions, not a bug report, so I hope it is appropriate to post it here.  Apologies if not.  (And apologies also for a rather long and rambling e-mail!)

I recently learned of Gnu APL and, having had some experience of APL on IBM mainframes in the 1980s, I was curious to know how it would work on a couple of my computers, and to use it to compare performance of two virtualised and emulated environments.

Firstly, I installed it on Ubuntu 18.04.3 running under VMWare Fusion on a 2.3GHz 8-core Intel i9.  This is the latest SVN version, built using CORE_COUNT-WANTED=syl on ./configure (not make parallels, which gave me a problem with autoconf).  I then used ⎕syl[26;2] to set the number of cores.

Using ⎕ai to obtain the compute time, I tried using 1 and 4 cores for brute force prime number counting, using this _expression_: r←⍴(1=+⌿0=r∘.∣r)/r←1↓⍳n

Although I could see, on the system monitor, that 4 cores were being used, the execution time with n=10000 actually took longer for the 4 core case, typically 15-20% more time than the 1 core case.

However, I then tried it in a very different environment: Ubuntu 18.04.3 again, but running in an emulated IBM S/390 mainframe (using the Hercules S/370 emulator running in Ubuntu in VMWare on a 3.5 GHz 6-core Xeon).  For n=5000, this gave the opposite result: the 4 core case was approx. 45% quicker.

Directly comparing these two environments (one “simply” virtualized, the other emulated and virtualized) is not meaningful.  It is to be expected that the emulated one will be very substantially slower.  The more interesting point is, perhaps, that on the i9, using more cores actually slows it down whereas, in the emulated environment, which is effectively a *much* slower processor, using multiple cores does yield a modest speed-up.

I am not sure which components of the _expression_ (if any) would be parallelized by Gnu APL.  So my questions are:

1.  Is it plausible that, on a reasonably modern CPU (the i9), using multiple cores would slow down execution of this _expression_?
2.  Which of the operators in the _expression_ above would Gnu APL actually parallelize? 
3.  Are there any configuration changes that I could make to adjust the way in which parallelization is done?

One other comment:

Before I realised that the svn version is more recent, I used the apl-1.8.tar.gz version of the code that is available on the Gnu mirror.  This seems to have a minor error in Parallel.hh: two occurrences of & in the definition of PRINT_LOCKED, which cause a compilation error.  They appear to have been removed in the svn version.

Any comments or answers would be appreciated.  Thank you for taking the time to read my e-mail.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]