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

SCM Repository

[diderot] Diff of /branches/vis12-cl/src/compiler/c-target/fragments/seq-main.in
ViewVC logotype

Diff of /branches/vis12-cl/src/compiler/c-target/fragments/seq-main.in

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3177, Mon Mar 30 12:20:18 2015 UTC revision 3178, Mon Mar 30 15:18:21 2015 UTC
# Line 3  Line 3 
3  int main (int argc, const char **argv)  int main (int argc, const char **argv)
4  {  {
5      bool        timingFlg = false;      //! true if timing computation      bool        timingFlg = false;      //! true if timing computation
6      bool        printOutputFlg = false; //! true if output is in text format      uint32_t    stepLimit = 0;          //! limit on number of execution steps (0 means unlimited)
7    
8    // create the world    // create the world
9      @PREFIX@World_t *wrld = @PREFIX@New();      @PREFIX@World_t *wrld = @PREFIX@New();
# Line 23  Line 23 
23          Diderot_Options_t *opts = Diderot_OptNew ();          Diderot_Options_t *opts = Diderot_OptNew ();
24          Diderot_OptAddFlag (opts, "v,verbose", "enable runtime-system messages", &(wrld->verboseFlg));          Diderot_OptAddFlag (opts, "v,verbose", "enable runtime-system messages", &(wrld->verboseFlg));
25          Diderot_OptAddFlag (opts, "t,timing", "enable execution timing", &timingFlg);          Diderot_OptAddFlag (opts, "t,timing", "enable execution timing", &timingFlg);
26  //      Diderot_OptAddFlag (opts, "T,text", "enable text output", &printOutputFlg);          Diderot_OptAddUInt (opts, "l,limit", "specify limit on number of super-steps (0 means unlimited)",
27                &stepLimit, true);
28  #ifndef DIDEROT_NO_INPUTS  #ifndef DIDEROT_NO_INPUTS
29        // register options for setting global inputs        // register options for setting global inputs
30          RegisterGlobalOpts (&inputs, opts);          RegisterGlobalOpts (&inputs, opts);
# Line 60  Line 61 
61      if (wrld->verboseFlg)      if (wrld->verboseFlg)
62          fprintf(stderr, "run with %d strands ...\n", wrld->numStrands);          fprintf(stderr, "run with %d strands ...\n", wrld->numStrands);
63    
64      uint32_t nSteps = @PREFIX@Run (wrld, 0);      uint32_t nSteps = @PREFIX@Run (wrld, stepLimit);
65    
66      if (wrld->errors->errNum > 0) {      if (wrld->errors->errNum > 0) {
67          fprintf(stderr, "Error during execution:\n%s\n", biffMsgStrGet(wrld->errors));          fprintf(stderr, "Error during execution:\n%s\n", biffMsgStrGet(wrld->errors));
# Line 73  Line 74 
74          printf ("usr=%f\n", wrld->runTime);          printf ("usr=%f\n", wrld->runTime);
75    
76    // output the final strand states    // output the final strand states
     if (printOutputFlg)  
         PrintOutput (wrld);  
     else  
77          WriteOutput (wrld);          WriteOutput (wrld);
78    
79      @PREFIX@Shutdown (wrld);      @PREFIX@Shutdown (wrld);

Legend:
Removed from v.3177  
changed lines
  Added in v.3178

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