Mercurial > hg > Applications > Grep
annotate regexParser/cerium/CeriumMain.cc @ 268:0e423d9f9647
remove error (remain 1 warning(no use variable))
author | Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 29 Jan 2016 16:06:11 +0900 |
parents | e51cac73e42a |
children | 6640b0d5bf13 |
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" | |
8 | |
9 extern void task_init(); | |
10 void TMend(TaskManager *); | |
11 static double st_time; | |
12 static double ed_time; | |
13 const char* usr_help_str = ""; | |
14 | |
15 static double | |
16 getTime() { | |
17 struct timeval tv; | |
18 gettimeofday(&tv, NULL); | |
19 return tv.tv_sec + (double)tv.tv_usec*1e-6; | |
20 } | |
21 | |
22 int | |
23 TMmain(TaskManager *manager, int argc, char *argv[]) | |
24 { | |
25 char *filename = 0; | |
26 Search s = grep(argc,argv,true); | |
268
0e423d9f9647
remove error (remain 1 warning(no use variable))
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
266
diff
changeset
|
27 |
266 | 28 FileMapReduce *fmp = new FileMapReduce(manager,TASK_EXEC,TASK_EXEC_DATA_PARALLEL,TASK_PRINT); |
29 filename = fmp->init(argc, argv); | |
30 fmp->w->global = (void*)s.tg; | |
31 if (filename < 0) { | |
32 return -1; | |
33 } | |
34 fmp->division_out_size = sizeof(void*)*3; // *Result,*blockBegin,*blockEnd | |
35 task_init(); | |
36 st_time = getTime(); | |
37 fmp->run_start(manager, filename); | |
38 manager->set_TMend(TMend); | |
39 return 0; | |
40 } | |
41 | |
42 void | |
43 TMend(TaskManager *manager) | |
44 { | |
45 ed_time = getTime(); | |
46 printf("Time: %0.6f\n",ed_time-st_time); | |
47 } | |
48 | |
49 /* end */ |