comp.lang.ada
 help / color / mirror / Atom feed
From: Chris M Moore <zmower@ntlworld.com>
Subject: Re: Poor performance after upgrate to xubuntu 17.10
Date: Sat, 21 Oct 2017 20:58:59 +0100
Date: 2017-10-21T20:58:59+01:00	[thread overview]
Message-ID: <6GNGB.8746$pB6.5265@fx46.am4> (raw)
In-Reply-To: <498648ad-7a60-4847-b272-772383d197d0@googlegroups.com>

On 21/10/2017 11:41, Charly wrote:
> Hi,
> 
> some months ago I started a new thread about performance for the new gnat-gpl-2017 compiler and a got some usefull helps so I will try it again.
> 
> When I upgrate to new Software/Hardware I use a litte performance test program
> that solves Rubics Tangle (https://www.jaapsch.net/puzzles/tangle.htm) with an
> ada program, using a requested nubmer of tasks or no task at all.
> The source code can be found here: https://github.com/CharlyGH/tangle.
> 
> Today I upgrated from xubuntu 17.04 to 17.10 an got the folling problem:
> 
> Let Tn be the runtime for using n tasks, T0 for no tasks.
> For all previous versions I got the expected result
> Tn = T0/n for all 1 <= n <= min(number of cores, 100)
> The limit of 100 occures, because each task uses another tile/orientation
> to start with and there are 25 tiles and 4 orientations so 100 combinations
> to start with. But this limit lies in distant future :-).
> 
> Now after switching to xubuntu 17.10 I got the following strange results:
> 
> 
> $ for n in  0 1 2 4 8 ; do ./tangle -t $n; echo "----------------"; done
> using:  0 tasks
> duration 2569 ms
> ----------------
> using:  1 tasks
> duration 2571 ms
> ----------------
> using:  2 tasks
> duration 2229 ms
> ----------------
> using:  4 tasks
> duration 3101 ms
> ----------------
> using:  8 tasks
> duration 2545 ms
> ----------------
> $
> 
> The time is almost constant with a maximum for n = 4.
> This strange result including the maximum at 4 is reproducible.
> 
> The value for n = 0 or 1 is the almost same as for the previous version of xubuntu.
> 
> When the program is running, n cores are busy at 100 %, as expected.
> 
> Booting the old Linux Kernel 4.10 had no effect.
> 
> My Hardware
> AMD FX(tm)-8350 Eight-Core Processor
> 
> 
> Sincerly
> Charly
> 

I had a little look at your code.  The main part is

       declare

          Worker : Ta_Parallel.Processes
            (1 .. Ta_Types_Pkg.Proc_Id_Type(Task_Count));

       begin

          Ta_Parallel.Initialize(Verbose_Level);

          for Idx in Worker'Range loop

             Worker (Idx).Start (Idx);

          end loop;

          for Idx in Worker'Range loop

             Worker (Idx).Wait (Res);

          end loop;

       end;

The problem here is the Wait line.  After you start the tasks you then 
wait for each one to complete *in order*.  So you are at the mercy of 
the scheduling algorithm in how it schedules the first task.  Maybe when 
N=4 it starts 1, 2 3, 4 but completes 4, 3, 2, 1!

When you exit the block all tasks will have completed so you don't 
really need the Wait.

Chris

-- 
sig pending (since 1995)


  reply	other threads:[~2017-10-21 19:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-21 10:41 Poor performance after upgrate to xubuntu 17.10 Charly
2017-10-21 19:58 ` Chris M Moore [this message]
2017-10-22 20:31   ` Charly
2017-10-22 22:04 ` Robert Eachus
2017-10-23  6:11   ` Luke A. Guest
2017-10-23  8:00     ` Mark Lorenzen
2017-10-25 18:56   ` Charly
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox