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=unavailable autolearn_force=no version=3.4.4 Path: Xl.tags.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail NNTP-Posting-Date: Sat, 20 Dec 2014 10:49:48 -0600 From: Dennis Lee Bieber Newsgroups: comp.lang.ada Subject: Re: =?ISO-8859-1?Q?GNAT=A0and_Tasklets?= Date: Sat, 20 Dec 2014 11:49:54 -0500 Organization: IISS Elusive Unicorn Message-ID: <4s9b9ah19vch9lshchrbi3vndv0ktan5i4@4ax.com> References: <8277a521-7317-4839-b0b6-97f8155be1a4@googlegroups.com> <9e1d2b9f-1b97-4679-8eec-5ba75f3c357c@googlegroups.com> <478c81f9-5233-4ae1-a3eb-e67c4dbd0da1@googlegroups.com> <1r2ziulc78imb$.ad6zx5upic6s$.dlg@40tude.net> X-Newsreader: Forte Agent 6.00/32.1186 X-No-Archive: YES MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 108.68.177.133 X-Trace: sv3-k9N8hqGy+rsz6HeM4eCcnwIy16y7RYtxJUY6j7jt2pneOm56oLRwpeZK36T22XYeaPAbSK046djeDNX!ejkUpswpyEwAIY0uOp9xS219WeXFT3amuBPMK+AOluk+1X/FuO8QZFzgnNqxvW4OIw1Im1oiboM4!iQtMcKX39Y0pSfm2ndJjbiyRJ20r X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2807 Xref: number.nntp.giganews.com comp.lang.ada:191483 Date: 2014-12-20T11:49:54-05:00 List-Id: On Fri, 19 Dec 2014 11:35:05 -0700, Brad Moore declaimed the following: > >I haven't listed all the semantics but for the questions you ask, >each arm of the parallel block is a separate thread of execution (which >we have been calling a tasklet). > >Each tasklet starts off with its own local declaration of Total, >initialized to 0, which is the Identity value for the reduction. > >So, for the top Total, you end up with {Top_}Total := 1 + A + B; There is no way I would ever interpret /that/ result... I'd actually expect an optimizing compiler to see that the result of incrementing Total is thrown away by the next statement in the block. >for the bottom Total, you end up with {Bottom_}Total := C + D; > >Then during the reduction phase, those two results get reduced using the >reduction operation, which in this case is "+". > >So the end result is Total = 1 + A + B + C + D; > So your reduction phase becomes the equivalent of a summing operation... par_sum( 1, A + B, C + D ) {of course, to do this right requires deferred evaluation of the parameters} What if you want the result to be a product? -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/