aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschnetter <schnetter@d60812e6-3970-4df4-986e-c251b06effeb>2005-01-29 17:50:28 +0000
committerschnetter <schnetter@d60812e6-3970-4df4-986e-c251b06effeb>2005-01-29 17:50:28 +0000
commit70f222615c22e33a6b6b329cc77e79bae4e1658a (patch)
tree1228f4ebbc69f5078446409c815b6a884a124f97
parentbb7cd90b874b4b55631d7a8c6da536c4e0417223 (diff)
Use CCTK_BYTE instead of CCTK_CHAR
git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGHReduce/trunk@65 d60812e6-3970-4df4-986e-c251b06effeb
-rw-r--r--src/ReduceGA.c47
-rw-r--r--src/Reduction.c4
-rw-r--r--src/ReductionAvg.c2
-rw-r--r--src/ReductionMax.c2
-rw-r--r--src/ReductionMin.c2
-rw-r--r--src/ReductionNorm1.c2
-rw-r--r--src/ReductionNorm2.c2
-rw-r--r--src/ReductionNorm3.c2
-rw-r--r--src/ReductionNorm4.c2
-rw-r--r--src/ReductionNormInf.c2
-rw-r--r--src/ReductionSum.c2
11 files changed, 35 insertions, 34 deletions
diff --git a/src/ReduceGA.c b/src/ReduceGA.c
index b114d67..8c90619 100644
--- a/src/ReduceGA.c
+++ b/src/ReduceGA.c
@@ -8,6 +8,7 @@
@version $Header$
@@*/
+#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -301,35 +302,35 @@ static int ReduceGridArrays (const cGH *GH,
switch (output_value_type_codes[i])
{
/* out values type switches*/
- case CCTK_VARIABLE_CHAR:
- local_outvals = malloc (1 * sizeof (CCTK_CHAR));
+ case CCTK_VARIABLE_BYTE:
+ local_outvals = malloc (1 * sizeof (CCTK_BYTE));
/* outvals[] contains now the local reduction values */
- memcpy ( local_outvals, (CCTK_CHAR *) output_values[i], 1 * sizeof (CCTK_CHAR));
+ memcpy ( local_outvals, (CCTK_BYTE *) output_values[i], 1 * sizeof (CCTK_BYTE));
if (perform_all_reduce)
{
if (global_operation == 1)
- CACTUS_MPI_ERROR (MPI_Allreduce (local_outvals, (CCTK_CHAR *) output_values[i], 1,
- PUGH_MPI_CHAR, MPI_MAX, pughGH->PUGH_COMM_WORLD));
+ CACTUS_MPI_ERROR (MPI_Allreduce (local_outvals, (CCTK_BYTE *) output_values[i], 1,
+ PUGH_MPI_BYTE, MPI_MAX, pughGH->PUGH_COMM_WORLD));
else if (global_operation == 2)
- CACTUS_MPI_ERROR (MPI_Allreduce (local_outvals, (CCTK_CHAR *) output_values[i], 1,
- PUGH_MPI_CHAR, MPI_MIN, pughGH->PUGH_COMM_WORLD));
+ CACTUS_MPI_ERROR (MPI_Allreduce (local_outvals, (CCTK_BYTE *) output_values[i], 1,
+ PUGH_MPI_BYTE, MPI_MIN, pughGH->PUGH_COMM_WORLD));
else if (global_operation == 3)
- CACTUS_MPI_ERROR (MPI_Allreduce (local_outvals, (CCTK_CHAR *) output_values[i], 1,
- PUGH_MPI_CHAR, MPI_SUM, pughGH->PUGH_COMM_WORLD));
+ CACTUS_MPI_ERROR (MPI_Allreduce (local_outvals, (CCTK_BYTE *) output_values[i], 1,
+ PUGH_MPI_BYTE, MPI_SUM, pughGH->PUGH_COMM_WORLD));
}
else
{
if (global_operation == 1)
- CACTUS_MPI_ERROR (MPI_Reduce (local_outvals, (CCTK_CHAR *) output_values[i], 1,
- PUGH_MPI_CHAR, MPI_MAX, dest_proc, pughGH->PUGH_COMM_WORLD));
+ CACTUS_MPI_ERROR (MPI_Reduce (local_outvals, (CCTK_BYTE *) output_values[i], 1,
+ PUGH_MPI_BYTE, MPI_MAX, dest_proc, pughGH->PUGH_COMM_WORLD));
else if (global_operation == 2)
- CACTUS_MPI_ERROR (MPI_Reduce (local_outvals, (CCTK_CHAR *) output_values[i], 1,
- PUGH_MPI_CHAR, MPI_MIN, dest_proc, pughGH->PUGH_COMM_WORLD));
+ CACTUS_MPI_ERROR (MPI_Reduce (local_outvals, (CCTK_BYTE *) output_values[i], 1,
+ PUGH_MPI_BYTE, MPI_MIN, dest_proc, pughGH->PUGH_COMM_WORLD));
else if (global_operation == 3)
- CACTUS_MPI_ERROR (MPI_Reduce (local_outvals, (CCTK_CHAR *) output_values[i], 1,
- PUGH_MPI_CHAR, MPI_SUM, dest_proc, pughGH->PUGH_COMM_WORLD));
+ CACTUS_MPI_ERROR (MPI_Reduce (local_outvals, (CCTK_BYTE *) output_values[i], 1,
+ PUGH_MPI_BYTE, MPI_SUM, dest_proc, pughGH->PUGH_COMM_WORLD));
}
break;
case CCTK_VARIABLE_INT:
@@ -769,8 +770,8 @@ static int ReduceGridArrays (const cGH *GH,
switch (output_value_type_codes[i])
{
/* out values type switches*/
- case CCTK_VARIABLE_CHAR:
- *( (CCTK_CHAR *) output_values[i]) = *( (CCTK_CHAR *) output_values[i]) / num_points;
+ case CCTK_VARIABLE_BYTE:
+ *( (CCTK_BYTE *) output_values[i]) = *( (CCTK_BYTE *) output_values[i]) / num_points;
break;
case CCTK_VARIABLE_INT:
*( (CCTK_INT *) output_values[i]) = *( (CCTK_INT *) output_values[i]) / num_points;
@@ -846,8 +847,8 @@ static int ReduceGridArrays (const cGH *GH,
switch (output_value_type_codes[i])
{
/* out values type switches*/
- case CCTK_VARIABLE_CHAR:
- *( (CCTK_CHAR *) output_values[i]) = sqrt(*( (CCTK_CHAR *) output_values[i]));
+ case CCTK_VARIABLE_BYTE:
+ *( (CCTK_BYTE *) output_values[i]) = sqrt(*( (CCTK_BYTE *) output_values[i]));
break;
case CCTK_VARIABLE_INT:
*( (CCTK_INT *) output_values[i]) = sqrt( *( (CCTK_INT *) output_values[i]));
@@ -935,8 +936,8 @@ static int ReduceGridArrays (const cGH *GH,
switch (output_value_type_codes[i])
{
/* out values type switches*/
- case CCTK_VARIABLE_CHAR:
- *( (CCTK_CHAR *) output_values[i]) = pow(*( (CCTK_CHAR *) output_values[i]), 1.0/3.0);
+ case CCTK_VARIABLE_BYTE:
+ *( (CCTK_BYTE *) output_values[i]) = pow(*( (CCTK_BYTE *) output_values[i]), 1.0/3.0);
break;
case CCTK_VARIABLE_INT:
*( (CCTK_INT *) output_values[i]) = pow(*( (CCTK_INT *) output_values[i]), 1.0/3.0);
@@ -1024,8 +1025,8 @@ static int ReduceGridArrays (const cGH *GH,
switch (output_value_type_codes[i])
{
/* out values type switches*/
- case CCTK_VARIABLE_CHAR:
- *( (CCTK_CHAR *) output_values[i]) = pow(*( (CCTK_CHAR *) output_values[i]), 1.0/4.0);
+ case CCTK_VARIABLE_BYTE:
+ *( (CCTK_BYTE *) output_values[i]) = pow(*( (CCTK_BYTE *) output_values[i]), 1.0/4.0);
break;
case CCTK_VARIABLE_INT:
*( (CCTK_INT *) output_values[i]) = pow(*( (CCTK_INT *) output_values[i]), 1.0/4.0);
diff --git a/src/Reduction.c b/src/Reduction.c
index 1cde5c5..7106dea 100644
--- a/src/Reduction.c
+++ b/src/Reduction.c
@@ -548,9 +548,9 @@ static int copy_real_to_outtype (int num_elems,
retval = 0;
- if (outtype == CCTK_VARIABLE_CHAR)
+ if (outtype == CCTK_VARIABLE_BYTE)
{
- CCTK_BYTE *_outarray = (CCTK_CHAR *) outarray;
+ CCTK_BYTE *_outarray = (CCTK_BYTE *) outarray;
for (i = 0; i < num_elems; i++)
diff --git a/src/ReductionAvg.c b/src/ReductionAvg.c
index f812fad..e0b175e 100644
--- a/src/ReductionAvg.c
+++ b/src/ReductionAvg.c
@@ -235,7 +235,7 @@ static int ReductionAvg (const cGH *GH,
{
switch (intypes[i])
{
- case CCTK_VARIABLE_CHAR:
+ case CCTK_VARIABLE_BYTE:
ITERATE_ARRAY (CCTK_BYTE, num_dims, inarrays[i],
from, to, iterator, points_per_dim,
CCTK_BYTE, outvals, num_outvals, total_outvals);
diff --git a/src/ReductionMax.c b/src/ReductionMax.c
index 55d1291..fc6c8d1 100644
--- a/src/ReductionMax.c
+++ b/src/ReductionMax.c
@@ -236,7 +236,7 @@ static int ReductionMaxVal (const cGH *GH,
{
switch (intypes[i])
{
- case CCTK_VARIABLE_CHAR:
+ case CCTK_VARIABLE_BYTE:
ITERATE_ARRAY (CCTK_BYTE, num_dims, inarrays[i],
from, to, iterator, points_per_dim,
CCTK_BYTE, outvals, num_outvals, total_outvals);
diff --git a/src/ReductionMin.c b/src/ReductionMin.c
index 7269270..e848c1e 100644
--- a/src/ReductionMin.c
+++ b/src/ReductionMin.c
@@ -237,7 +237,7 @@ static int ReductionMinVal (const cGH *GH,
{
switch (intypes[i])
{
- case CCTK_VARIABLE_CHAR:
+ case CCTK_VARIABLE_BYTE:
ITERATE_ARRAY (CCTK_BYTE, num_dims, inarrays[i],
from, to, iterator, points_per_dim,
CCTK_BYTE, outvals, num_outvals, total_outvals);
diff --git a/src/ReductionNorm1.c b/src/ReductionNorm1.c
index 3a0aaf2..cdfb197 100644
--- a/src/ReductionNorm1.c
+++ b/src/ReductionNorm1.c
@@ -237,7 +237,7 @@ static int ReductionNorm1 (const cGH *GH,
{
switch (intypes[i])
{
- case CCTK_VARIABLE_CHAR:
+ case CCTK_VARIABLE_BYTE:
#define REDUCTION_OPERATION(norm1, scalar) norm1 += scalar
ITERATE_ARRAY (CCTK_BYTE, num_dims, inarrays[i],
from, to, iterator, points_per_dim,
diff --git a/src/ReductionNorm2.c b/src/ReductionNorm2.c
index 9cdce78..a93e279 100644
--- a/src/ReductionNorm2.c
+++ b/src/ReductionNorm2.c
@@ -238,7 +238,7 @@ static int ReductionNorm2 (const cGH *GH,
{
switch (intypes[i])
{
- case CCTK_VARIABLE_CHAR:
+ case CCTK_VARIABLE_BYTE:
#define REDUCTION_OPERATION(norm2, scalar) norm2 += SQR (scalar)
ITERATE_ARRAY (CCTK_BYTE, num_dims, inarrays[i],
from, to, iterator, points_per_dim,
diff --git a/src/ReductionNorm3.c b/src/ReductionNorm3.c
index 86191d4..63a8b88 100644
--- a/src/ReductionNorm3.c
+++ b/src/ReductionNorm3.c
@@ -234,7 +234,7 @@ static int ReductionNorm3 (const cGH *GH,
{
switch (intypes[i])
{
- case CCTK_VARIABLE_CHAR:
+ case CCTK_VARIABLE_BYTE:
#define CUBE_ABS(x) ((x) * (x) * (x))
#define REDUCTION_OPERATION(norm3, scalar) norm3 += CUBE_ABS (scalar)
ITERATE_ARRAY (CCTK_BYTE, num_dims, inarrays[i],
diff --git a/src/ReductionNorm4.c b/src/ReductionNorm4.c
index 2bf4a51..a95c345 100644
--- a/src/ReductionNorm4.c
+++ b/src/ReductionNorm4.c
@@ -236,7 +236,7 @@ static int ReductionNorm4 (const cGH *GH,
{
switch (intypes[i])
{
- case CCTK_VARIABLE_CHAR:
+ case CCTK_VARIABLE_BYTE:
#define REDUCTION_OPERATION(norm4, scalar) norm4 += POWER4 (scalar)
ITERATE_ARRAY (CCTK_BYTE, num_dims, inarrays[i],
from, to, iterator, points_per_dim,
diff --git a/src/ReductionNormInf.c b/src/ReductionNormInf.c
index ecfdfff..6b484d3 100644
--- a/src/ReductionNormInf.c
+++ b/src/ReductionNormInf.c
@@ -249,7 +249,7 @@ static int ReductionNormInf (const cGH *GH,
{
switch (intypes[i])
{
- case CCTK_VARIABLE_CHAR:
+ case CCTK_VARIABLE_BYTE:
#define REDUCTION_OPERATION(norm_inf, scalar) norm_inf = MAX(norm_inf,scalar)
ITERATE_ARRAY (CCTK_BYTE, num_dims, inarrays[i],
from, to, iterator, points_per_dim,
diff --git a/src/ReductionSum.c b/src/ReductionSum.c
index 29b2673..62a2881 100644
--- a/src/ReductionSum.c
+++ b/src/ReductionSum.c
@@ -235,7 +235,7 @@ static int ReductionSum (const cGH *GH,
{
switch (intypes[i])
{
- case CCTK_VARIABLE_CHAR:
+ case CCTK_VARIABLE_BYTE:
ITERATE_ARRAY (CCTK_BYTE, num_dims, inarrays[i],
from, to, iterator, points_per_dim,
CCTK_BYTE, outvals, num_outvals, total_outvals);