Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] View of /branches/lamont/test/sum-reduction/sum-reduction.diderot
ViewVC logotype

View of /branches/lamont/test/sum-reduction/sum-reduction.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2538 - (download) (annotate)
Fri Jan 31 02:39:45 2014 UTC (5 years, 5 months ago) by lamonts
File size: 631 byte(s)
Fixed parallel global reduction issue
/*! \file sum-reduction.test 
 *
 * \author Lamont Samuels
 *
 * This example tests the sum global reductions. 
 */

/*
 * COPYRIGHT (c) 2014 The Diderot Project (http://diderot-language.cs.uchicago.edu)
 * All rights reserved.
 */
input int nNumbers;
real gSum = 0; 
int steps = 0; 
 
strand Reduction (int i, real number) {
    real num = number; 
    int id = i; 
    output real sum =0.0; 
    update {  
        if(steps >= 1) {
            sum = gSum;  
            stabilize;
         }
    }
} 



global {   
  gSum = sum{S.num | S in Reduction.all}; 
  steps+=1; 
} 

initially { Reduction(vi,vi) | vi in 1..nNumbers}; 


root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0