Fixed fetching items from global job list.

parent 4763f0bf
......@@ -32,6 +32,7 @@ int main(int argc, char **argv)
if(role == 0) {
int ntasks = master_init();
printf("Number of tasks: %d\n", ntasks);
// Benchmark
double wct, ust, syt;
......@@ -54,13 +55,14 @@ int main(int argc, char **argv)
}
unit_work_t *get_next_work_item(void) {
if( test_current_item + (test_stride-1) < LIST_SIZE )
if( test_current_item + test_stride >= LIST_SIZE )
return NULL;
return &test_list[test_current_item+test_stride];
unit_work_t *tmp = &test_list[test_current_item+test_stride];
test_current_item += test_stride;
return tmp;
}
void process_results(unit_result_t result) {
// Fill in with whatever is relevant to process the results returned by the
// slave.
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment