ok so for the forall we can write costume way to combine the results.

Take for example a matrix multiplication

1)

for i in arow do
        for j in bcol do
            for k in acol do
                c(i,j) += a(i,k)*b(k,j);

and
2)

forall i in arow do
        forall j in bcol do
            forall k in acol do
                c(i,j) += a(i,k)*b(k,j);


What I believe is ..

1st is a serial code( no big deal)

2nd is a parallel code .. it creates i*j*k number of thread internally,
each thread does the arithmetic( and return, I say it returns because my
program terminates without threads being hanged), isn't here reduction
required. When I run the parallel code ( with forall ) it takes same time.
There is no much difference.



from next time I will be sending to [email protected]. (
let me know If not)






On Mon, Mar 17, 2014 at 9:01 AM, Brad Chamberlain <[email protected]> wrote:

>  It looks like you accidentally sent this to the mailing list owner alias
> rather than the mailing list itself (?).
>
>  The short answer is that a reduce uses a forall loop, but collapses the
> result down to a singleton whereas the forall has no reduction step.  But
> the parallelism induced by either to sweep over the values in question
> should be the same.  The reduction part of the reduction step is known to
> be implemented suboptimally.
>
>  -Brad
>
>  ------------------------------
> *From:* Bibek Ghimire [[email protected]]
> *Sent:* Monday, March 17, 2014 6:59 AM
> *To:* [email protected]
> *Subject:* diference between forall and reduce in chapel
>
>   Hey all,
>            Can anyone tell me the difference that is there between reduce
> and forall in chapel. My theory is they are both the same.
>
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Chapel-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-users

Reply via email to