Skip to content

Commit

Permalink
Added upper guard to qdp_dispatch.h
Browse files Browse the repository at this point in the history
  • Loading branch information
bjoo committed Jan 15, 2015
1 parent 0aa5ee2 commit 0670402
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/qdp_dispatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ void dispatch_to_threads(int numSiteTable, Arg a, void (*func)(int,int,int, Arg*
threads_num = omp_get_num_threads();
myId = omp_get_thread_num();
low = numSiteTable*myId/threads_num;
high = numSiteTable*(myId+1)/threads_num;
int hi = numSiteTable*(myId+1)/threads_num;
high = ( hi > numSiteTable ) ? numSiteTable : hi;

func(low, high, myId, &a);
}
Expand Down

0 comments on commit 0670402

Please sign in to comment.