This PR uses a thread pool to parallelize force and energy calculations, giving a considerable speedup for programs where these are the limiting factor.
To use, simply run morpho with -wX where X is the number of worker threads to use.
Note that there is an outstanding (and tricky) issue to resolve with clock(): it reports the CPU time not the wall time. For now, use an external timing utility. There seems to be a lack of platform independent solutions to report wall time at the right level of granularity.
This PR uses a thread pool to parallelize force and energy calculations, giving a considerable speedup for programs where these are the limiting factor.
To use, simply run morpho with -wX where X is the number of worker threads to use.
Note that there is an outstanding (and tricky) issue to resolve with clock(): it reports the CPU time not the wall time. For now, use an external timing utility. There seems to be a lack of platform independent solutions to report wall time at the right level of granularity.