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

SCM Repository

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

Diff of /branches/vis12-cl/src/compiler/cl-target/fragments/c-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      char        *devName;               //! specifies index of OpenCL device as a string      char        *devName;               //! specifies index of OpenCL device as a string
8    
9    // create the world    // create the world
# Line 38  Line 38 
38          Diderot_uint_t nw = wrld->nWorkers;          Diderot_uint_t nw = wrld->nWorkers;
39          Diderot_OptAddFlag (opts, "v,verbose", "enable runtime-system messages", &(wrld->verboseFlg));          Diderot_OptAddFlag (opts, "v,verbose", "enable runtime-system messages", &(wrld->verboseFlg));
40          Diderot_OptAddFlag (opts, "t,timing", "enable execution timing", &timingFlg);          Diderot_OptAddFlag (opts, "t,timing", "enable execution timing", &timingFlg);
 //      Diderot_OptAddFlag (opts, "T,text", "enable text output", &printOutputFlg);  
41          Diderot_OptAddString (opts, "d,device", "OpenCL device index", &devName, true);          Diderot_OptAddString (opts, "d,device", "OpenCL device index", &devName, true);
42          Diderot_OptAddUInt (opts, "n,nworkers", "specify number of workers per compute unit", &nw, true);          Diderot_OptAddUInt (opts, "n,nworkers", "specify number of workers per compute unit", &nw, true);
43            Diderot_OptAddUInt (opts, "l,limit", "specify limit on number of super-steps (0 means unlimited)",
44                &stepLimit, true);
45  #ifndef DIDEROT_NO_INPUTS  #ifndef DIDEROT_NO_INPUTS
46        // register options for setting global inputs        // register options for setting global inputs
47          RegisterGlobalOpts (&inputs, opts);          RegisterGlobalOpts (&inputs, opts);
# Line 92  Line 93 
93      if (wrld->verboseFlg)      if (wrld->verboseFlg)
94          fprintf(stderr, "run with %d strands ...\n", wrld->numStrands);          fprintf(stderr, "run with %d strands ...\n", wrld->numStrands);
95    
96      uint32_t nSteps = @PREFIX@Run (wrld, 0);      uint32_t nSteps = @PREFIX@Run (wrld, stepLimit);
97    
98      if (wrld->errors->errNum > 0) {      if (wrld->errors->errNum > 0) {
99          fprintf(stderr, "Error during execution:\n%s\n", biffMsgStrGet(wrld->errors));          fprintf(stderr, "Error during execution:\n%s\n", biffMsgStrGet(wrld->errors));
# Line 105  Line 106 
106          printf ("usr=%f\n", wrld->runTime);          printf ("usr=%f\n", wrld->runTime);
107    
108    // output the final strand states    // output the final strand states
     if (printOutputFlg)  
         PrintOutput (wrld);  
     else  
109          WriteOutput (wrld);          WriteOutput (wrld);
110    
111      @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