[pooma-dev] how does one do a reduce

James Crotinger JimC at proximation.com
Fri Mar 30 00:06:10 UTC 2001


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:drnuke at lanl.gov] 
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sourcerytools.com/pipermail/pooma-dev/attachments/20010329/a03bab88/attachment.html>


More information about the pooma-dev mailing list