int main(int argc, char** argv){ int n; if (argc > 1) n = atoi(argv[1]); else n = 40; if (cilk_io_init()) { fprintf(stderr,"cilk_io_init failed\n"); exit(1); } int socketID; long j; int i; int arr[NUM_SERVERS]; int* sockIDs = initReduce(); my_timer_t t; TIMER_START(t); // Currently it only works if cilk_read/writes are within a cilk_spawn cilk_spawn distPfib(n, sockIDs, &j); TIMER_STOP(t); printf("computed distFib of %d\treturned: %lu\ttime: %4f\n", n, j, TIMER_EVAL(t)); return 0; }
t_job *CreateJob(uint16_t id, bool combiner, char *resultadoFinal) { t_job *job = malloc(sizeof(t_job)); job->id = id; job->combiner = combiner; job->resultFile = strdup(resultadoFinal); job->files = list_create(); job->partialReduces = list_create(); job->finalReduce = initReduce(); job->maps = list_create(); job->mapsDone = 0; return job; }
int main(int argc, char** argv){ int n; if (argc > 1) n = atoi(argv[1]); else n = 40; int socketID; long j; int i; int arr[NUM_SERVERS]; int* sockIDs = initReduce(); my_timer_t t; TIMER_START(t); //j = distPfib(n, sockIDs, 0); j = distPfib(n, sockIDs); TIMER_STOP(t); printf("computed distFib of %d\treturned: %lu\ttime: %4f\n", n, j, TIMER_EVAL(t)); return 0; }