X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=moebius2.git;a=blobdiff_plain;f=parallel.h;h=77025e512202f9a5323146e30abc3ce141bc6d55;hp=19616e43f64b9aeba95b4dc21e973ec571eab7a9;hb=0fdb5046fb643441d6b4077e728769b92a89953e;hpb=e7355cdc61d082bc1d25a4d460736680e8d1dba2 diff --git a/parallel.h b/parallel.h index 19616e4..77025e5 100644 --- a/parallel.h +++ b/parallel.h @@ -14,11 +14,11 @@ /* used anamorphically: section, nsections */ #define OUTER_PERSECTION_BASE(zero,n, sect) \ - ((zero) + sect * (((n)-(zero) + NSECTIONS-1) / NSECTIONS)) -#define OUTER(v,zero,n, precomp) \ - for ((v)= OUTER_PERSECTION_BASE((zero),(n), section); \ - precomp, \ - (v) < OUTER_PERSECTION_BASE((zero),(n), section + 1) && (v) < (n); \ + ((zero) + (sect) * (((n)-(zero) + NSECTIONS-1) / NSECTIONS)) +#define OUTER(v,zero,n, precomp) \ + for ((v)= OUTER_PERSECTION_BASE((zero),(n), (section)); \ + precomp, \ + (v) < OUTER_PERSECTION_BASE((zero),(n), (section) + 1) && (v) < (n); \ (v)++) /* @@ -29,7 +29,7 @@ * - function must not modify anything other than * its return value (for cost computation functions, COST()) or * its designated output (for precomputation functions, PRECOMP()) - * (which latter it may not read) + * and in the latter case it may not read other parts of its output * - function must of course be reentrant */ @@ -49,6 +49,9 @@ void inparallel(const struct Vertices *vertices, * secdatasz, passed as secdata, uninitialised on entry. * After all the copies have finished, `combine' is invoked * nsections times sequentially, with the same sets of arguments. + * inparallel is NOT itself reentrant. */ +void inparallel_barrier(void); + #endif /*PARALLEL_H*/