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

SCM Repository

[diderot] Annotation of /branches/vis12/src/compiler/c-target/fragments/init.in
ViewVC logotype

Annotation of /branches/vis12/src/compiler/c-target/fragments/init.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1831 - (view) (download)

1 : jhr 1718 //! Create and allocate the program's world
2 :     @PREFIX@World_t *@PREFIX@Init ()
3 :     {
4 :     @PREFIX@World_t *wrld = NEW(@PREFIX@World_t);
5 :     if (wrld == 0)
6 :     return 0;
7 :    
8 :     wrld->name = ProgramName;
9 :     wrld->err = 0;
10 :     wrld->verboseFlg = false;
11 :     wrld->nStrandTys = 1; /* FIXME */
12 :     wrld->strandDesc = &Strand_@STRAND@;
13 : jhr 1806 wrld->globals = NEW(@PREFIX@Globals_t);
14 : jhr 1718
15 : jhr 1806 if (wrld->globals == 0) {
16 :     FREE(wrld);
17 :     return 0;
18 :     }
19 :    
20 : jhr 1829 #ifdef DIDEROT_TARGET_PARALLEL
21 :     wrld->sched = NEW(Diderot_Sched_t);
22 :    
23 :     if ((wrld->sched == 0)
24 : jhr 1831 || Diderot_GetNumCPUs(&(wrld->sched->cpuInfo))
25 : jhr 1829 || (pthread_mutex_init (&(wrld->sched->lock), 0) != 0)
26 :     || (pthread_cond_init (&(wrld->sched->barrier), 0) != 0)
27 :     || (pthread_cond_init (&(wrld->sched->runWait), 0) != 0)) {
28 : jhr 1831 FREE(wrld->globals);
29 :     FREE(wrld->sched);
30 : jhr 1829 FREE(wrld);
31 :     return 0;
32 :     }
33 : jhr 1831 wrld->sched->numWorkers = wrld->sched->cpuInfo.numHWCores;
34 : jhr 1829 #endif
35 :    
36 : jhr 1727 // initialize the input defaults
37 :     InitDefaults (wrld);
38 : jhr 1718
39 : jhr 1727 return wrld;
40 :    
41 : jhr 1718 }

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