Mercurial > hg > Game > Cerium
view example/word_count/main.cc @ 2051:b79a250b4f99 draft
FileMapReduce (no compile error)
author | masa |
---|---|
date | Thu, 28 Jan 2016 17:23:45 +0900 |
parents | 674ac7887dae |
children | 030b8efcf357 |
line wrap: on
line source
#include <stdio.h> #include <sys/time.h> #include "TaskManager.h" #include "SchedTask.h" #include "Func.h" #include "FileMapReduce.h" /* ;TODO * PS3でCPU数が2以上の時に、あまりが計算されてない */ extern void task_init(); void TMend(TaskManager *); static double st_time; static double ed_time; const char* usr_help_str = ""; static double getTime() { struct timeval tv; gettimeofday(&tv, NULL); return tv.tv_sec + (double)tv.tv_usec*1e-6; } int TMmain(TaskManager *manager, int argc, char *argv[]) { char *filename = 0; FileMapReduce *fmp = new FileMapReduce(manager,TASK_EXEC,TASK_EXEC_DATA_PARALLEL,TASK_PRINT); filename = fmp->init(argc, argv); if (filename < 0) { return -1; } task_init(); st_time = getTime(); fmp->run_start(manager, filename); // fmp->start(); manager->set_TMend(TMend); return 0; } void TMend(TaskManager *manager) { ed_time = getTime(); printf("Time: %0.6f\n",ed_time-st_time); } /* end */