Mercurial > hg > Applications > Grep
annotate regexParser/cerium/CeriumMain.cc @ 277:7b4bcc7b5ae6
nextTState implemented
author | Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 30 Jan 2016 20:44:37 +0900 |
parents | 5aa9d01926f1 |
children | 99d635926ef3 |
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); |
277
7b4bcc7b5ae6
nextTState implemented
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
272
diff
changeset
|
30 |
271
6640b0d5bf13
remove anystate processing in sequential seqrch
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
268
diff
changeset
|
31 createAnyState(s.tg); |
272 | 32 generateTState(s.tg->anyState,s.tg); |
277
7b4bcc7b5ae6
nextTState implemented
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
272
diff
changeset
|
33 // generateTState for startState. It is used in stateMatch. |
7b4bcc7b5ae6
nextTState implemented
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
272
diff
changeset
|
34 generateTState(s.tg->stateList,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
|
35 |
266 | 36 FileMapReduce *fmp = new FileMapReduce(manager,TASK_EXEC,TASK_EXEC_DATA_PARALLEL,TASK_PRINT); |
37 filename = fmp->init(argc, argv); | |
38 fmp->w->global = (void*)s.tg; | |
39 if (filename < 0) { | |
40 return -1; | |
41 } | |
42 fmp->division_out_size = sizeof(void*)*3; // *Result,*blockBegin,*blockEnd | |
43 task_init(); | |
44 fmp->run_start(manager, filename); | |
45 manager->set_TMend(TMend); | |
46 return 0; | |
47 } | |
48 | |
49 void | |
50 TMend(TaskManager *manager) | |
51 { | |
52 ed_time = getTime(); | |
53 printf("Time: %0.6f\n",ed_time-st_time); | |
54 } | |
55 | |
56 /* end */ |