comp.lang.ada
 help / color / mirror / Atom feed
* ANN: Paraffin 4.2, Parallelism Generics
@ 2013-05-05 17:18 Brad Moore
  2013-06-05 15:39 ` volkert.barr
  0 siblings, 1 reply; 4+ messages in thread
From: Brad Moore @ 2013-05-05 17:18 UTC (permalink / raw)


This is a minor update to the Paraffin release 4.1 that was released a 
couple days ago.

This release (4.2) is geared towards getting the Ravenscar version of 
the FFT (Fast Fourier Transform) paraffinalia app to work on Windows, 
and other targets where synchronous barriers are implemented by
protected types.

To achieve this, a new package, called 
Parallel.Simple_Synchronous_Barriers was introduced.

This package provides the services of a barrier when only two tasks
need to wait on the barrier, and is implemented using Ada's suspension
objects, rather than a protected type.

The issue is that on Windows, Ada.Synchronous_Barriers is implemented
by a protected object in GNAT. Ravenscar disallows protected objects
to be declared at a nested level, which is needed by the FFT app.
Since only two tasks ever need to wait on a barrier in the FFT
algorithm, a specialized implementation of a barrier can be constructed
using Ada's suspension objects.

This specialized barrier satisfies the Ravenscar restrictions, but also
is lighter weight, and was deemed worthwhile for use for the 
non-ravenscar version of fft.

As a result of this change, the project file test_ravenscar_fft_linux
was renamed to test_ravenscar_fft, since it should now be portable to
all targets.

The latest stable release and older releases may be downloaded from;

  https://sourceforge.net/projects/paraffin/files/

For those who want the current development versions of the source they
can download using git (http://git-scm.com/) by issuing the following
commands;

  mkdir sandbox
  cd sandbox
  git clone git://git.code.sf.net/p/paraffin/code paraffin-code



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ANN: Paraffin 4.2, Parallelism Generics
  2013-05-05 17:18 ANN: Paraffin 4.2, Parallelism Generics Brad Moore
@ 2013-06-05 15:39 ` volkert.barr
  2013-06-06 14:38   ` Brad Moore
  0 siblings, 1 reply; 4+ messages in thread
From: volkert.barr @ 2013-06-05 15:39 UTC (permalink / raw)


Dear Brad,

i tried to compile the Praffin 4.2 test-projects and got this compile error:

parallel.ads:50:06: must use private with clause for preelaborated unit "Multiprocessors"

Compiler: GNAT GPL 2013 / x86_64-darwin

Any hints?

BW,
Volkert



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ANN: Paraffin 4.2, Parallelism Generics
  2013-06-05 15:39 ` volkert.barr
@ 2013-06-06 14:38   ` Brad Moore
  2013-06-07  9:19     ` volkert.barr
  0 siblings, 1 reply; 4+ messages in thread
From: Brad Moore @ 2013-06-06 14:38 UTC (permalink / raw)


On 05/06/2013 9:39 AM, volkert.barr@googlemail.com wrote:
> Dear Brad,
>
> i tried to compile the Praffin 4.2 test-projects and got this compile error:
>
> parallel.ads:50:06: must use private with clause for preelaborated unit "Multiprocessors"
>
> Compiler: GNAT GPL 2013 / x86_64-darwin
>
> Any hints?
>
> BW,
> Volkert
>

Yes, I suspect you have just downloaded the new GNAT 2013, as I have.

I am seeing the same issue. The 2012 GNAT did not complain and compiled 
the code, but the code actually should not have compiled. The 2013 GNAT 
is detecting the problem.

The problem is because the package spec, parallel.ads has the 
Remote_Types pragma, but it also with's the package 
System.Multiprocessors, which is not a Remote_Types, Shared_Passive, or 
Pure package. A Remote_Types package spec can only depend on one of the 
above types of package specs.

To fix the problem, delete (or comment out) the Remote Types pragma in 
parallel.ads.

Your code should then compile.

I was a bit mystified when I first saw the error message.

I then remembered an AI 
http://www.ada-auth.org/cgi-bin/cvsweb.cgi/ai05s/ai05-0206-1.txt?rev=1.6

Which was one I was particularly involved with, where the rules were 
relaxed so that a Remote_Types package spec could depend on a 
preelaborated packages so long as the with clause that mentions the 
preelaborated package is a private with clause.

The error message is suggesting that the with for System.Multiprocessors 
should be changed to be a private with, but that
wouldn't work, because the public part of parallel.ads uses declarations 
from System.Multiprocessors.

Hopefully Adacore will improve the error message for GNAT 2014, but it 
is reporting an actual error in the code. It is not a compiler bug.
Ideally the error message would mention that the Remote_Types pragma is 
triggering the error.

I also found another set of problems in the code. The 2013 compiler is 
now checking that the aliased keyword must be present on parameters of 
overriding subprograms if it was specified on a parameter of the 
interface. It wasn't doing that in 2012.

I have checked in the changes onto sourceforge, which you can retrieve
using git, but I have not yet created a new bugfix release, which I will 
do as soon as I get a chance.

Thanks for reporting the error.

Brad

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ANN: Paraffin 4.2, Parallelism Generics
  2013-06-06 14:38   ` Brad Moore
@ 2013-06-07  9:19     ` volkert.barr
  0 siblings, 0 replies; 4+ messages in thread
From: volkert.barr @ 2013-06-07  9:19 UTC (permalink / raw)


Brad, thank you for the explanation. It compiles fine now ...

BW,
Volkert

> Yes, I suspect you have just downloaded the new GNAT 2013, as I have.
> 
> 
> 
> I am seeing the same issue. The 2012 GNAT did not complain and compiled 
> 
> the code, but the code actually should not have compiled. The 2013 GNAT 
> 
> is detecting the problem.
> 
> 
> 
> The problem is because the package spec, parallel.ads has the 
> 
> Remote_Types pragma, but it also with's the package 
> 
> System.Multiprocessors, which is not a Remote_Types, Shared_Passive, or 
> 
> Pure package. A Remote_Types package spec can only depend on one of the 
> 
> above types of package specs.
> 
> 
> 
> To fix the problem, delete (or comment out) the Remote Types pragma in 
> 
> parallel.ads.
> 
> 
> 
> Your code should then compile.
> 
> 
> 
> I was a bit mystified when I first saw the error message.
> 
> 
> 
> I then remembered an AI 
> 
> http://www.ada-auth.org/cgi-bin/cvsweb.cgi/ai05s/ai05-0206-1.txt?rev=1.6
> 
> 
> 
> Which was one I was particularly involved with, where the rules were 
> 
> relaxed so that a Remote_Types package spec could depend on a 
> 
> preelaborated packages so long as the with clause that mentions the 
> 
> preelaborated package is a private with clause.
> 
> 
> 
> The error message is suggesting that the with for System.Multiprocessors 
> 
> should be changed to be a private with, but that
> 
> wouldn't work, because the public part of parallel.ads uses declarations 
> 
> from System.Multiprocessors.
> 
> 
> 
> Hopefully Adacore will improve the error message for GNAT 2014, but it 
> 
> is reporting an actual error in the code. It is not a compiler bug.
> 
> Ideally the error message would mention that the Remote_Types pragma is 
> 
> triggering the error.
> 
> 
> 
> I also found another set of problems in the code. The 2013 compiler is 
> 
> now checking that the aliased keyword must be present on parameters of 
> 
> overriding subprograms if it was specified on a parameter of the 
> 
> interface. It wasn't doing that in 2012.
> 
> 
> 
> I have checked in the changes onto sourceforge, which you can retrieve
> 
> using git, but I have not yet created a new bugfix release, which I will 
> 
> do as soon as I get a chance.
> 
> 
> 
> Thanks for reporting the error.
> 
> 
> 
> Brad

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-06-07  9:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-05 17:18 ANN: Paraffin 4.2, Parallelism Generics Brad Moore
2013-06-05 15:39 ` volkert.barr
2013-06-06 14:38   ` Brad Moore
2013-06-07  9:19     ` volkert.barr

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