aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@gmail.com>2012-07-25 22:23:52 +0200
committerErik Schnetter <schnetter@gmail.com>2012-07-25 22:23:52 +0200
commit1508ed7af7c48b3d3d47ecb1e4a37a81f93b4cab (patch)
tree4b33121d8c681612e262eac7ef9263693dcf5b11
parenta58279ba24f717e37a300319b1ef7c14675e36ac (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.c10
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);