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

SCM Repository

[diderot] View of /branches/lamont/test/stabalize_global/stabalize.diderot
ViewVC logotype

View of /branches/lamont/test/stabalize_global/stabalize.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3085 - (download) (annotate)
Tue Mar 17 14:33:42 2015 UTC (6 years, 6 months ago) by lamonts
File size: 1013 byte(s)
Adding a test for stabalizing in the global function
 /*! \file stabalize.test 
 *
 * \author Lamont Samuels
 *
 * Test Stabalizing in the Global Reductions
 */

/*
 * COPYRIGHT (c) 2015 The Diderot Project (http://diderot-language.cs.uchicago.edu)
 * All rights reserved.
 */
int nNumbers = 10;
int steps = 0; 

strand Reduction (int i) {
    int id = i; 
    real stable = 0; 
    real active = 1; 
    output real lsteps = 0.0; 
    update {  
    	if(id == 2 || id == 3 || id == 4 && steps == 1) {
    		stable = 1; 
    		active = 0; 
    		stabilize;
    	}else if(id == 5 || id == 6 || id == 7 && steps == 2) {
    		stable = 1; 
    		active = 0; 
    		stabilize; 
    	} 
        if(id == 1){
         	print("Steps =", steps, "\n"); 
        }
    }
} 


global { 
  steps = steps + 1; 
  real activeL = sum { R.active | R in Reduction.all};
  real stableL = sum { R.stable | R in Reduction.stable};
  print("Acitve = ", activeL, " Stable=", stableL, "\n"); 
  if (steps > 5){
     stabilize; 
  }
} 




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


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