summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>2004-10-19 20:29:46 +0000
committergoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>2004-10-19 20:29:46 +0000
commit5b3df657c568f67912e34f2114db52528fceb227 (patch)
tree0016f270de335c0531c1dd9ed29a1ce011bece2f
parentabe203f65264325748ec22cbb256b96e3d1911a0 (diff)
Patch from Yaakoub to add a processor-number to reduce to to the
Global reduction api. git-svn-id: http://svn.cactuscode.org/flesh/trunk@3869 17b73243-c579-4c4c-a9d2-2d5706c11dac
-rw-r--r--src/comm/Reduction.c10
-rw-r--r--src/include/cctk_Reduction.h3
2 files changed, 13 insertions, 0 deletions
diff --git a/src/comm/Reduction.c b/src/comm/Reduction.c
index b5eb0716..75c077d4 100644
--- a/src/comm/Reduction.c
+++ b/src/comm/Reduction.c
@@ -82,6 +82,7 @@ void CCTK_FCALL CCTK_FNAME(CCTK_GridArrayReductionParameterHandle)
void CCTK_FCALL CCTK_FNAME(CCTK_ReduceGridArrays)
(int *fortran_return,
const cGH *GH,
+ int dest_proc,
int local_reduce_handle,
int param_table_handle,
int N_input_arrays,
@@ -1470,6 +1471,11 @@ int CCTKi_RegisterGridArrayReductionOperator(const char *thorn,
@vtype cGH *
@vio in
@endvar
+ @var dest_proc
+ @vdesc the number of the processor to which we want to reduce (-1) for all-reduce
+ @vtype int
+ @vio in
+ @endvar
@var local_reduce_handle
@vdesc the handle specifying the reduction operator
@vtype int
@@ -1507,6 +1513,7 @@ int CCTKi_RegisterGridArrayReductionOperator(const char *thorn,
@endvar
@@*/
int CCTK_ReduceGridArrays(const cGH *GH,
+ int dest_proc,
int local_reduce_handle,
int param_table_handle,
int N_input_arrays,
@@ -1527,6 +1534,7 @@ int CCTK_ReduceGridArrays(const cGH *GH,
else
{
retval = GA_reduc (GH,
+ dest_proc,
local_reduce_handle, param_table_handle,
N_input_arrays, input_array_variable_indices,
M_output_values, output_value_type_codes,
@@ -1538,6 +1546,7 @@ int CCTK_ReduceGridArrays(const cGH *GH,
void CCTK_FCALL CCTK_FNAME(CCTK_ReduceGridArrays)
(int *fortranreturn,
const cGH *GH,
+ int dest_proc,
int local_reduce_handle,
int param_table_handle,
int N_input_arrays,
@@ -1558,6 +1567,7 @@ void CCTK_FCALL CCTK_FNAME(CCTK_ReduceGridArrays)
else
{
retval = GA_reduc (GH,
+ dest_proc,
local_reduce_handle, param_table_handle,
N_input_arrays, input_array_variable_indices,
M_output_values, output_value_type_codes,
diff --git a/src/include/cctk_Reduction.h b/src/include/cctk_Reduction.h
index 4f82022e..07744f0e 100644
--- a/src/include/cctk_Reduction.h
+++ b/src/include/cctk_Reduction.h
@@ -47,6 +47,7 @@
#define REDUCTION_GRID_ARRAY_OPERATOR_REGISTER_ARGLIST \
const cGH *GH, \
+ int dest_proc, \
int local_reduce_handle, \
int param_table_handle, \
int N_input_arrays, \
@@ -81,6 +82,7 @@ typedef int (*cLocalArrayReduceOperator) (int N_dims, int operator_handle,
/* prototype for GA reduction operator routine */
typedef int (*cGridArrayReduceOperator) (const cGH *GH,
+ int dest_proc,
int local_reduce_handle,
int param_table_handle,
int N_input_arrays,
@@ -150,6 +152,7 @@ int CCTK_NumLocalArrayReduceOperators(void);
/* new GA reduction API */
int CCTK_ReduceGridArrays(const cGH *GH,
+ int dest_proc,
int local_reduce_handle,
int param_table_handle,
int N_input_arrays,