diff options
author | Erik Schnetter <schnetter@gmail.com> | 2012-07-25 22:23:52 +0200 |
---|---|---|
committer | Erik Schnetter <schnetter@gmail.com> | 2012-07-25 22:23:52 +0200 |
commit | 1508ed7af7c48b3d3d47ecb1e4a37a81f93b4cab (patch) | |
tree | 4b33121d8c681612e262eac7ef9263693dcf5b11 | |
parent | a58279ba24f717e37a300319b1ef7c14675e36ac (diff) |
LoopControl: Modify code to please PGI compiler
Declare local variable outside of "#pragma for".
Also improve some error messages.
-rw-r--r-- | Carpet/LoopControl/src/loopcontrol.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Carpet/LoopControl/src/loopcontrol.c b/Carpet/LoopControl/src/loopcontrol.c index 1331e6b35..32be143ab 100644 --- a/Carpet/LoopControl/src/loopcontrol.c +++ b/Carpet/LoopControl/src/loopcontrol.c @@ -746,12 +746,14 @@ lc_control_init (lc_control_t * restrict const lc, if (lc_inthreads == -1 || lc_jnthreads == -1 || lc_knthreads == -1) { CCTK_VWarn (CCTK_WARN_ABORT, __LINE__, __FILE__, CCTK_THORNSTRING, - "Illegal thread topology [%d,%d,%d]x[1,1,1] specified", + "Loop %s: Illegal thread topology [%d,%d,%d]x[1,1,1] specified", + lm->name, (int)lc_inthreads, (int)lc_jnthreads, (int)lc_knthreads); } if (lc_inthreads * lc_jnthreads * lc_knthreads != ls->num_threads) { CCTK_VWarn (CCTK_WARN_ABORT, __LINE__, __FILE__, CCTK_THORNSTRING, - "Specified thread topology [%d,%d,%d]x[1,1,1] is not compatible with the number of threads %d", + "Loop %s: Specified thread topology [%d,%d,%d]x[1,1,1] is not compatible with the number of threads %d", + lm->name, (int)lc_inthreads, (int)lc_jnthreads, (int)lc_knthreads, ls->num_threads); } @@ -1076,8 +1078,10 @@ lc_control_finish (lc_control_t * restrict const lc) if (do_selftest) { /* Assert that exactly the specified points have been set */ static int failure = 0; + int k; /* PGI doesn't allow declaring k in the loop */ #pragma omp for - for (int k=0; k<lc->klsh; ++k) { + // for (int k=0; k<lc->klsh; ++k) { + for (k=0; k<lc->klsh; ++k) { for (int j=0; j<lc->jlsh; ++j) { for (int i=0; i<lc->ilsh; ++i) { int const ind3d = i + lc->ilsh * (j + lc->jlsh * k); |