aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryye00 <yye00@7daa882c-dc44-4453-834e-278d26b18e6a>2004-09-05 20:44:43 +0000
committeryye00 <yye00@7daa882c-dc44-4453-834e-278d26b18e6a>2004-09-05 20:44:43 +0000
commit1871e8c35d52d772c88e90481378126dee5d9c53 (patch)
treef10770dd760df79490bce1afdcd733fa2a02f3ca
parente9f3f33ab2cad984ce128adfb79cc6f24e8abb91 (diff)
fixing what might cause a problem in the future
git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/LocalReduce/trunk@40 7daa882c-dc44-4453-834e-278d26b18e6a
-rw-r--r--src/local_reductions.h62
1 files changed, 31 insertions, 31 deletions
diff --git a/src/local_reductions.h b/src/local_reductions.h
index 7ed8446..019651a 100644
--- a/src/local_reductions.h
+++ b/src/local_reductions.h
@@ -38,6 +38,16 @@ extern "C" {
{ \
while (iter < max_iter) \
{ \
+ sum_indices = actual_indices[0]; \
+ for (k=N_dims-1;k>0;k--) \
+ { \
+ product = 1; \
+ for (j=k-1;j>=0;j--) \
+ { \
+ product *= actual_iters_per_dim[j]; \
+ } \
+ sum_indices += actual_indices[k]*product; \
+ } \
inval = (out_type) typed_vdata[sum_indices]; \
REDUCTION_OPERATION(*outval,inval); \
num_points++; \
@@ -71,6 +81,12 @@ extern "C" {
return -1; \
} \
} \
+ } \
+ } \
+ else \
+ { \
+ while (iter < max_iter) \
+ { \
sum_indices = actual_indices[0]; \
for (k=N_dims-1;k>0;k--) \
{ \
@@ -81,12 +97,6 @@ extern "C" {
} \
sum_indices += actual_indices[k]*product; \
} \
- } \
- } \
- else \
- { \
- while (iter < max_iter) \
- { \
/* prevent offset from giving segfaults */ \
if (sum_indices >= max_iter) \
{ \
@@ -126,6 +136,15 @@ extern "C" {
return -1; \
} \
} \
+ } \
+ } \
+ } \
+ else if (mask_on == 0) \
+ { \
+ if ( input_array_offset == 0) \
+ { \
+ while (iter < max_iter) \
+ { \
sum_indices = actual_indices[0]; \
for (k=N_dims-1;k>0;k--) \
{ \
@@ -136,15 +155,6 @@ extern "C" {
} \
sum_indices += actual_indices[k]*product; \
} \
- } \
- } \
- } \
- else if (mask_on == 0) \
- { \
- if ( input_array_offset == 0) \
- { \
- while (iter < max_iter) \
- { \
inval = (out_type) typed_vdata[sum_indices]; \
REDUCTION_OPERATION(*outval,inval); \
num_points++; \
@@ -178,6 +188,12 @@ extern "C" {
return -1; \
} \
} \
+ } \
+ } \
+ else \
+ { \
+ while (iter < max_iter) \
+ { \
sum_indices = actual_indices[0]; \
for (k=N_dims-1;k>0;k--) \
{ \
@@ -188,12 +204,6 @@ extern "C" {
} \
sum_indices += actual_indices[k]*product; \
} \
- } \
- } \
- else \
- { \
- while (iter < max_iter) \
- { \
/* prevent offset from giving segfaults */ \
if (sum_indices >= max_iter) \
{ \
@@ -233,16 +243,6 @@ extern "C" {
return -1; \
} \
} \
- sum_indices = actual_indices[0]; \
- for (k=N_dims-1;k>0;k--) \
- { \
- product = 1; \
- for (j=k-1;j>=0;j--) \
- { \
- product *= actual_iters_per_dim[j]; \
- } \
- sum_indices += actual_indices[k]*product; \
- } \
} \
} \
} \