Mercurial > hg > Game > Cerium
view TaskManager/ManyCore/FileMapReduce.h @ 2054:2e7a6f40672f draft
add param(4) in FileMapReduce.cc
author | masa |
---|---|
date | Fri, 29 Jan 2016 15:56:28 +0900 |
parents | 030b8efcf357 |
children | c62fbe66f549 |
line wrap: on
line source
#include <sys/types.h> #include "TaskManager.h" #include "SchedTask.h" #include "HTask.h" class FileMapReduce; typedef struct mapReduce { struct mapReduce *self; FileMapReduce *fmp; long fd; long read_filesize; CPU_TYPE read_cpu; long size; // remaining file size long division_size; // for each word count task long division_out_size; long task_num; // task count long remain_task; // remaining task count long task_blocks; // spawn task one at a time long task_spawned; unsigned long long *o_data; long pad; char *file_mmap; long file_size; HTaskPtr t_print; void* global; // generale user data } MapReduce, *MapReducePtr; // Read Type enum { MY_MMAP, MY_READ, BLOCKED_READ, BLOCKED_MMAP, }; #define DATA_NUM 16 #define ADD_NUM 26 #define DATA_ID 0 typedef struct { caddr_t file_mmap; off_t size; } st_mmap_t; class FileMapReduce { public: /* constructor */ FileMapReduce(TaskManager *manager,int TASK_EXEC,int TASK_EXEC_DATA_PARALLEL,int TASK_PRINT); ~FileMapReduce(); /* User API */ void run_start(TaskManager *manager, const char *filename); void run_tasks(SchedTask *manager, MapReduce *w, int task_count, HTaskPtr t_read, HTaskPtr t_next, int size); char* init(int argc, char **argv); private: void my_read(const char *filename, MapReduce *w, TaskManager *manager); void my_mmap(const char *filename, MapReduce *w); void task_init(void); /* variable */ int all; int use_task_array; int use_task_creater ; int use_compat ; int array_task_num ; int spe_num ; int read_type ; int t_exec_num ; CPU_TYPE spe_cpu ; int TASK_EXEC; int TASK_EXEC_DATA_PARALLEL; int TASK_PRINT; public: CPU_TYPE read_spe_cpu; int blocks; int division; // in Kbyte int division_out_size; int use_iterate; int task_exec_id; int task_print_id; const char *fmp_help_str; };