Change the syntax of SMPI_SAMPLE_* macros.
To handle the end of the computing loop when sampling is still on, we need to wrap it.
This replaces this syntax
for(k = 1; k <= np; k++) { SMPI_SAMPLE_GLOBAL(0.25 * np, 0.03) {
where the macro had no idea of the loop conditions
by this
SMPI_SAMPLE_GLOBAL(k = 1, k <= np, k++, 0.25 * np, 0.03,
{...}
)
syntax, where the body of loop is itself a parameter. This is not perfect, and may change soon. But now we can exit gracefully the sampling whenever the upper loop exits.