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,511d9a7626ec9335 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post01.iad.highwinds-media.com!API-DIGITAL.COM-a2kHrUvQQWlmc!not-for-mail Date: Wed, 02 Feb 2011 20:02:12 -0600 From: "Marc A. Criley" User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: ANNOUNCE: Magpie 0.10 Utilities for multi-core execution References: <42787132-70a9-4629-b5dc-af580896e3b1@q40g2000prh.googlegroups.com> In-Reply-To: <42787132-70a9-4629-b5dc-af580896e3b1@q40g2000prh.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <95fca$4d4a0cae$433a4eec$25475@API-DIGITAL.COM> X-Complaints-To: abuse@usenetserver.com Organization: UseNetServer.com X-Trace: 95fca4d4a0caee69feb4925475 Xref: g2news1.google.com comp.lang.ada:16831 Date: 2011-02-02T20:02:12-06:00 List-Id: On 01/28/2011 08:25 PM, Shark8 wrote: > Brad, Marc, > What is the difference between Magpie and Paraffin? Magpie provides two generic functions and a generic procedure. They're designed to operate on a container of data that is indexed or keyed by values of a discrete type. E.g. an integer indexed array, or a vector. The generic functions retrieve a value from the container, apply an application-supplied function to it, then combine ("reduce") each result with a running total, until all values have been processed, and the final value of the running total is returned as the generic function's value. The generic procedure repeatedly invokes an application-supplied procedure, accompanying each invocation with an index value. There is no value returned, the supplied procedure is simply repeatedly invoked, presumably progressing through each element of the container, and it is responsible for managing its results. The technique I got from Brad's article had to do with partitioning the range of index/keys amongst application-designated CPU cores. One of the functions simply evenly splits the range across the number of cores and kicks off the execution of each task associated with a core. The other function, and the procedure, initially split the range evenly, but if one of the core tasks finishes early, it advertises that it is available to take on more work. When one of the other tasks notices this, it stops, splits its remaining work, and both resume execution. There's more detail about all this in the README, along with a couple examples, including a Magpie version of Jakob Sparre Andersen's Mandelbrot set generator. Marc