-#define SMPI_SAMPLE_LOOP(loop_init, loop_end, loop_iter, global, iters, thres)\
- int SMPI_ITER_NAME(__LINE__)=0;\
- {loop_init;\
- while(loop_end){\
- SMPI_ITER_NAME(__LINE__)++;\
- loop_iter;\
- }} \
- for(loop_init; \
- loop_end ? (smpi_sample_1(global, __FILE__, __LINE__, iters, thres), (smpi_sample_2(global, __FILE__, __LINE__, SMPI_ITER_NAME(__LINE__)))) :\
- smpi_sample_exit(global, __FILE__, __LINE__, SMPI_ITER_NAME(__LINE__));\
- smpi_sample_3(global, __FILE__, __LINE__),loop_iter)
-#define SMPI_SAMPLE_LOCAL(loop_init, loop_end, loop_iter, iters, thres) SMPI_SAMPLE_LOOP(loop_init, loop_end, loop_iter, 0, iters, thres)
-#define SMPI_SAMPLE_GLOBAL(loop_init, loop_end, loop_iter,iters, thres) SMPI_SAMPLE_LOOP(loop_init, loop_end, loop_iter, 1, iters, thres)
+#define SMPI_SAMPLE_LOOP(loop_init, loop_end, loop_iter, global, iters, thres) \
+ int SMPI_ITER_NAME(__LINE__) = 0; \
+ { \
+ loop_init; \
+ while (loop_end) { \
+ SMPI_ITER_NAME(__LINE__)++; \
+ (loop_iter); \
+ } \
+ } \
+ for (loop_init; (loop_end) ? (smpi_sample_1((global), __FILE__, __LINE__, (iters), (thres)), \
+ (smpi_sample_2((global), __FILE__, __LINE__, SMPI_ITER_NAME(__LINE__)))) \
+ : smpi_sample_exit((global), __FILE__, __LINE__, SMPI_ITER_NAME(__LINE__)); \
+ smpi_sample_3((global), __FILE__, __LINE__), (loop_iter))
+#define SMPI_SAMPLE_LOCAL(loop_init, loop_end, loop_iter, iters, thres) \
+ SMPI_SAMPLE_LOOP(loop_init, (loop_end), (loop_iter), 0, (iters), (thres))
+#define SMPI_SAMPLE_GLOBAL(loop_init, loop_end, loop_iter, iters, thres) \
+ SMPI_SAMPLE_LOOP(loop_init, (loop_end), (loop_iter), 1, (iters), (thres))