From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,5164ccc41905b2d0 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.68.210.15 with SMTP id mq15mr9127091pbc.2.1363060712410; Mon, 11 Mar 2013 20:58:32 -0700 (PDT) MIME-Version: 1.0 Path: q9ni11986pba.1!nntp.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!weretis.net!feeder1.news.weretis.net!feeder4.news.weretis.net!nuzba.szn.dk!news.jacob-sparre.dk!munin.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Ada and OpenMP Date: Fri, 8 Mar 2013 17:40:21 -0600 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <87k3pjht79.fsf@ludovic-brenta.org> <3e01ac49-4427-4f50-8577-8edab7e539a6@googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1362786024 11031 69.95.181.76 (8 Mar 2013 23:40:24 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Fri, 8 Mar 2013 23:40:24 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Received-Bytes: 2877 Date: 2013-03-08T17:40:21-06:00 List-Id: "Rego, P." wrote in message news:f6fff4ba-e9a1-4335-a4a0-cb9d60152ad9@googlegroups.com... >> On Thursday, March 7, 2013 4:42:59 PM UTC-7, Randy Brukardt wrote: > >> Ada is about doing things right, and that should be true even for >> implementation-defined stuff. And we *need* people to figure out good >> ways >> of doing these things (for instance, a "parallel" classification for >> functions would be very helpful). The sloppy way helps little. > > Got your point. > Would you have a suggestion on how I could a loop such as > "parallelization" like > > pragma OMP(Parallel_For) > for I in 1 .. MAX loop > A(I) := A(I) + 1 > end loop; > > but without using pragmas? (1) Use a compiler that does this automatically (apparently GNAT does this in some circumstances). (2) Use a library like Paraffin; a bit less convinient but it will work on any Ada compiler for any target. Some of the Ada 2012 features may make such a library more convinient to write (I haven't been keeping up with Brad's work on this). (3) Use a compiler with an appropriate extension for parallel loops. One possibility would be something like: for I in 1 .. MAX loop in parallel A(I) := A(I) + 1 end loop; This of course ties you to a particular implementation, or to wait for Ada 202x. Of course, so does a pragma, and it's much less likely to be standardized. So I suggest (1) or (2). Randy.