--- /dev/null
+/*
+ * Parallel processing
+ */
+
+#ifndef PARALLEL_H
+#define PARALLEL_H
+
+#ifdef NPROCESSORS
+# define NSECTIONS NPROCESSORS
+#else
+# define NSECTIONS 1
+#endif
+
+/* 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); \
+ (v)++)
+
+#define nsections NSECTIONS
+
+typedef void Computation(const struct Vertices *vertices,
+ int section, void *secdata, void *gendata);
+
+void inparallel(const struct Vertices *vertices,
+ Computation *separately,
+ Computation *combine,
+ size_t secdatasz, void *gendata);
+
+#endif /*PARALLEL_H*/