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

SCM Repository

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

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

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

revision 1844, Sat Apr 14 12:11:31 2012 UTC revision 2708, Sat Sep 20 18:46:49 2014 UTC
# Line 5  Line 5 
5      bool        printOutputFlg = false; //! true if output is in text format      bool        printOutputFlg = false; //! true if output is in text format
6    
7    // create the world    // create the world
8      @PREFIX@World_t *wrld = @PREFIX@Init();      @PREFIX@World_t *wrld = @PREFIX@New();
9      if (wrld == 0) {      if (wrld == 0) {
10          fprintf(stderr, "unable to create world\n");          fprintf(stderr, "unable to create world\n");
11          exit (1);          exit (1);
12      }      }
13    
14    // handle command-line options    // handle command-line options
15        {
16      Diderot_Options_t *opts = Diderot_OptNew ();      Diderot_Options_t *opts = Diderot_OptNew ();
17      Diderot_uint_t np = wrld->sched->numWorkers;      Diderot_uint_t np = wrld->sched->numWorkers;
18            @PREFIX@Inputs_t inputs;
19            InitDefaults (&inputs);
20      Diderot_OptAddFlag (opts, "verbose", "enable runtime-system messages", &(wrld->verboseFlg));      Diderot_OptAddFlag (opts, "verbose", "enable runtime-system messages", &(wrld->verboseFlg));
21      Diderot_OptAddFlag (opts, "timing", "enable execution timing", &timingFlg);      Diderot_OptAddFlag (opts, "timing", "enable execution timing", &timingFlg);
22      Diderot_OptAddFlag (opts, "text", "enable text output", &printOutputFlg);      Diderot_OptAddFlag (opts, "text", "enable text output", &printOutputFlg);
23      Diderot_OptAddUInt (opts, "np", "specify number of worker threads", &np, true);      Diderot_OptAddUInt (opts, "np", "specify number of worker threads", &np, true);
24      RegisterGlobalOpts (wrld, opts);          RegisterGlobalOpts (&inputs, opts);
25      Diderot_OptProcess (opts, argc, argv);      Diderot_OptProcess (opts, argc, argv);
26      Diderot_OptFree (opts);      Diderot_OptFree (opts);
27      wrld->sched->numWorkers = np;      wrld->sched->numWorkers = np;
28            InitInputs (wrld, &inputs);
29        }
30    
31      // initialize scheduler stuff
32        if (wrld->verboseFlg)
33            fprintf (stderr, "initializing world ...\n");
34        if (@PREFIX@Init (wrld)) {
35            fprintf(stderr, "Error initializing world:\n%s\n", biffMsgStrGet(wrld->errors));
36            exit(1);
37        }
38    
39    // run the generated global initialization code    // run the generated global initialization code
40      if (wrld->verboseFlg)      if (wrld->verboseFlg)
41          fprintf (stderr, "initializing globals ...\n");          fprintf (stderr, "initializing globals ...\n");
42      @PREFIX@Initially (wrld);      if (@PREFIX@Initially (wrld)) {
43            fprintf(stderr, "Error in global initialization:\n%s\n", biffMsgStrGet(wrld->errors));
44            exit(1);
45        }
46    
47      if (wrld->verboseFlg)      if (wrld->verboseFlg)
48          fprintf(stderr, "run with %d strands ...\n", wrld->numStrands);          fprintf(stderr, "run with %d strands ...\n", wrld->numStrands);

Legend:
Removed from v.1844  
changed lines
  Added in v.2708

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