Hi Lee,

This is our fault -- we need to turn on an extra internal pass (a
fusion pass) to support programs like yours.

Without changing your compiler, you can make this program work in one
of two ways:

1. Compile the attached FuseAll.java ("javac FuseAll.java") and run
strc like this:
strc -optfile FuseAll EdgeFind.str

2. Run strc like this (lower performance):
strc -dynamicRatesEverywhere EdgeFind.str

What is going on is that our compiler backend expects the static
subgraphs (i.e., neighboring nodes with static I/O rates) to be fused
into a single filter.  In your example, it expects FloatSource +
EveryOther to be fused together.  We can automate this fusion in our
next release, but I wanted to send you these command-line solutions as
soon as possible.

Please let me know if you run into any other problems,

best,
-Bill

On Wed, Mar 5, 2008 at 6:35 PM, Lee Barford <[EMAIL PROTECTED]> wrote:
> Here's an example of a filter that pushes less often but it pops:
>
>  void->void pipeline EdgeFind {
>     add FloatSource();
>     add EveryOther();
>     add FloatPrinter();
>  }
>
>  float->float filter EveryOther() {
>     float time = 0;
>     work push [0,1] pop 1 {
>         pop();
>         time = time + 1;
>         if( (int)(time)/2*2 == (int)(time) ) {
>            push(time);
>         }
>     }
>  }
>
>  void->float filter FloatSource() {
>     float t = 0;
>     work push 1 {
>         push(t);
>         t++;
>     }
>  }
>
>  float->void filter FloatPrinter() {
>   work pop 1 {
>     println(pop());
>   }
>  }
>
>
>  It runs fine with --library, but compiling to C results in a seg fault:
>
>  [EMAIL PROTECTED]:~/source/mine/StreaMitTests/EdgeFind$ strc --library
>  EdgeFind.str | head -n 10
>  2.0
>  4.0
>  6.0
>  8.0
>  10.0
>  12.0
>  14.0
>  16.0
>  18.0
>  20.0
>  [EMAIL PROTECTED]:~/source/mine/StreaMitTests/EdgeFind$ strc EdgeFind.str; 
> ./a.out
>  Starting Kopi2SIR... done.
>  Entry to Cluster Backend (uniprocessor)
>  Running Constant Prop and Unroll... done.
>  Running Constant Field Propagation... done.
>  Estimating Code size of Filters... done.
>  Estimating Code size of Filters... done.
>  1
>
>  Compiling static sub-graph 0 (TopLevel0_FloatSource__3_4)...
>  Running Partitioning... target number of threads: 1
>
>  Compiling static sub-graph 1 (TopLevel1_FloatPrinter__10_6)...
>  Running Partitioning... target number of threads: 1
>  Done Partitioning...
>  Generating cluster code...
>  Done generating cluster code.
>  g++ -O3 -I/home/barford/source/others/streamit-src-2.1.1/library/cluster
>  -c -o combined_threads.o combined_threads.cpp
>  g++ -O3 -o a.out combined_threads.o
>  -L/home/barford/source/others/streamit-src-2.1.1/library/cluster
>  -lpthread -lcluster -lstdc++
>  Segmentation fault (core dumped)
>  [EMAIL PROTECTED]:~/source/mine/StreaMitTests/EdgeFind$ uname -a
>  Linux ely 2.6.22-14-generic #1 SMP Tue Feb 12 07:42:25 UTC 2008 i686 
> GNU/Linux
>  [EMAIL PROTECTED]:~/source/mine/StreaMitTests/EdgeFind$ javac -version
>  javac 1.5.0_13
>  [EMAIL PROTECTED]:~/source/mine/StreaMitTests/EdgeFind$ gcc --version
>  gcc (GCC) 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)
>
>  Now I've read the stern warning in the "Language Specification" about
>  getting the peek & pop rate expression correct. But the above filter
>  does appear to pop once and push between 0 and 1 times.
>
>  Any suggestions?
>
>  --Lee Barford
>
>  _______________________________________________
>  StreamIt-users mailing list
>  [email protected]
>  https://lists.csail.mit.edu/mailman/listinfo/streamit-users
>
import at.dms.kjc.sir.*;

/**
 * Fuse as much as possible.
 */
public class FuseAll {

    public static SIRStream manualPartition(SIRStream str) {
        return at.dms.kjc.sir.lowering.fusion.FuseAll.fuse(str, false);
    }
}
_______________________________________________
StreamIt-users mailing list
[email protected]
https://lists.csail.mit.edu/mailman/listinfo/streamit-users

Reply via email to