Mercurial > hg > Applications > Grep
annotate regexParser/cerium/CeriumMain.cc @ 272:5aa9d01926f1
Cerium version no compile errors
author | kono |
---|---|
date | Fri, 29 Jan 2016 20:38:18 +0900 |
parents | 6640b0d5bf13 |
children | 7b4bcc7b5ae6 |
rev | line source |
---|---|
266 | 1 #include <stdio.h> |
2 #include <sys/time.h> | |
3 #include "TaskManager.h" | |
4 #include "SchedTask.h" | |
5 #include "Func.h" | |
6 #include "FileMapReduce.h" | |
7 #include "CeriumGrep.h" | |
272 | 8 #include "subsetConstruction.h" |
9 #include "threadedSearch.h" | |
266 | 10 |
11 extern void task_init(); | |
12 void TMend(TaskManager *); | |
13 static double st_time; | |
14 static double ed_time; | |
15 const char* usr_help_str = ""; | |
16 | |
17 static double | |
18 getTime() { | |
19 struct timeval tv; | |
20 gettimeofday(&tv, NULL); | |
21 return tv.tv_sec + (double)tv.tv_usec*1e-6; | |
22 } | |
23 | |
24 int | |
25 TMmain(TaskManager *manager, int argc, char *argv[]) | |
26 { | |
27 char *filename = 0; | |
271
6640b0d5bf13
remove anystate processing in sequential seqrch
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
268
diff
changeset
|
28 st_time = getTime(); |
266 | 29 Search s = grep(argc,argv,true); |
271
6640b0d5bf13
remove anystate processing in sequential seqrch
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
268
diff
changeset
|
30 createAnyState(s.tg); |
272 | 31 generateTState(s.tg->anyState,s.tg); |
268
0e423d9f9647
remove error (remain 1 warning(no use variable))
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
266
diff
changeset
|
32 |
266 | 33 FileMapReduce *fmp = new FileMapReduce(manager,TASK_EXEC,TASK_EXEC_DATA_PARALLEL,TASK_PRINT); |
34 filename = fmp->init(argc, argv); | |
35 fmp->w->global = (void*)s.tg; | |
36 if (filename < 0) { | |
37 return -1; | |
38 } | |
39 fmp->division_out_size = sizeof(void*)*3; // *Result,*blockBegin,*blockEnd | |
40 task_init(); | |
41 fmp->run_start(manager, filename); | |
42 manager->set_TMend(TMend); | |
43 return 0; | |
44 } | |
45 | |
46 void | |
47 TMend(TaskManager *manager) | |
48 { | |
49 ed_time = getTime(); | |
50 printf("Time: %0.6f\n",ed_time-st_time); | |
51 } | |
52 | |
53 /* end */ |