freepooma-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [pooma-dev] how does one do a reduce


From: James Crotinger
Subject: RE: [pooma-dev] how does one do a reduce
Date: Thu, 29 Mar 2001 16:06:10 -0800

To answer the simple question first, Tulip is the old name for Cheetah, which is the messaging layer that r2 sits on top of. Tulip was supposed to be renamed for the 2.3 release, but apparently that didn't happen.

Now, for reductions. The implementation is in Tulip/ReduceOverContexts.h. This is used in DynamicLayout.cmpl.cpp, for example, to globally check the dirty flag, etc. Here is an example:

typedef ReduceOverContexts<int, OpAddAssign> GlobalSum_t;

// Do a global reduction on the initialized and dirty flags

int globalInitialized;
GlobalSum_t(int(initialized())).broadcast(globalInitialized);

Where initialized() returns the local value of the initialized field of the layout.

We probably could wrap this basic functionality in a template function. Something like

#include "Tulip/ReduceOverContexts.h"

namespace Pooma {

  template <class T, class ReductionOp>
  reduce(T &globalVal, const T &localVal, ReductionOp)
  {
    typedef ReduceOverContexts<T, ReductionOp> Reducer_t; 
    Reducer_t(localVal).broadcast(globalVal);
  }
}

I haven't tested this, and it's been almost a year since I messed with any of this code, but I think something like this would make reductions a bit easier. I'd also like one the just does a global AND or OR of local bools.

        Jim

---------------------------------------------------
James A. Crotinger
Software Research Scientist
Proximation, LLC

 -----Original Message-----
From:   Steve Nolen [mailto:address@hidden]
Sent:   Thursday, March 29, 2001 4:38 PM
To:     Pooma
Subject:        [pooma-dev] how does one do a reduce


i want to do a reduction operation over all the contexts looking for a
single double.  in r1 it was as simple as

reduce( TotalVal, LocalVal, OpAddAssign() );

how does this work in r2?  what is tulip?

-steve


reply via email to

[Prev in Thread] Current Thread [Next in Thread]