Index: cctk_Reduction.h =================================================================== RCS file: /cactusdevcvs/Cactus/src/include/cctk_Reduction.h,v retrieving revision 1.23 diff -d -r1.23 cctk_Reduction.h 13a14,29 > /* Known reduction operations. These values are subject to change > without notice. */ > > #define CCTK_REDUCE_SUM 1001 > #define CCTK_REDUCE_PROD 1002 > #define CCTK_REDUCE_MAX 1003 > #define CCTK_REDUCE_MIN 1004 > #define CCTK_REDUCE_LAND 1005 > #define CCTK_REDUCE_LOR 1006 > #define CCTK_REDUCE_LXOR 1007 > #define CCTK_REDUCE_BAND 1008 > #define CCTK_REDUCE_BOR 1009 > #define CCTK_REDUCE_BXOR 1010 > #define CCTK_REDUCE_MINLOC 1011 > #define CCTK_REDUCE_MAXLOC 1012 > 36,46c52,65 < #define REDUCTION_LOCAL_ARRAY_OPERATOR_REGISTER_ARGLIST \ < int N_dims, \ < int operator_handle, \ < int param_table_handle, \ < int N_input_arrays, \ < const CCTK_INT input_array_dims[], \ < const CCTK_INT input_array_type_codes[], \ < const void *const input_arrays[], \ < int M_output_numbers, \ < const CCTK_INT output_number_type_codes[], \ < void *const output_numbers[] --- > #define LOCAL_REDUCE_LOCAL_ARRAYS_REGISTER_ARGLIST \ > int local_reduce_handle,\ > int param_table_handle,\ > int repeat_count,\ > int N_input_arrays,\ > int input_rank,\ > const CCTK_INT input_array_dims[],\ > const CCTK_INT input_array_type_codes[],\ > const CCTK_POINTER_TO_CONST input_arrays[],\ > int M_output_arrays,\ > int output_rank,\ > const CCTK_INT output_array_dims[],\ > const CCTK_INT output_array_type_codes[],\ > const CCTK_POINTER output_arrays[] 48,57c67,96 < #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, \ < const CCTK_INT input_array_variable_indices[], \ < int M_output_values, \ < const CCTK_INT output_value_type_codes[], \ < void* const output_values[] --- > #define REDUCE_LOCAL_ARRAYS_REGISTER_ARGLIST \ > const cGH *cctkGH,\ > int dest_proc,\ > int local_reduce_handle,\ > int param_table_handle,\ > int repeat_count,\ > int N_input_arrays,\ > int input_rank,\ > const CCTK_INT input_array_dims[],\ > const CCTK_INT input_array_type_codes[],\ > const CCTK_POINTER_TO_CONST input_arrays[],\ > int M_output_arrays,\ > int output_rank,\ > const CCTK_INT output_array_dims[],\ > const CCTK_INT output_array_type_codes[],\ > const CCTK_POINTER output_arrays[] > > #define REDUCE_GRID_ARRAYS_REGISTER_ARGLIST \ > const cGH *cctkGH,\ > int dest_proc,\ > int local_reduce_handle,\ > int param_table_handle,\ > int repeat_count,\ > int N_input_arrays,\ > const CCTK_INT input_array_variable_indices[],\ > int M_output_arrays,\ > int output_rank,\ > const CCTK_INT output_array_dims[],\ > const CCTK_INT output_array_type_codes[],\ > const CCTK_POINTER output_arrays[] 59,72d97 < #define REDUCTION_ARRAYS_GLOBALLY_OPERATOR_REGISTER_ARGLIST \ < const cGH *GH, \ < int dest_proc, \ < int local_reduce_handle, \ < int param_table_handle, \ < int N_input_arrays, \ < const void *const input_arrays[], \ < int N_dims,\ < const CCTK_INT input_array_dims[], \ < const CCTK_INT input_array_type_codes[], \ < int M_output_values, \ < const CCTK_INT output_value_type_codes[], \ < void* const output_values[] < 77a103,362 > /********************************************************/ > /* LocalReduceLocalArrays definitions */ > /********************************************************/ > > /* This is the type for the local reduce local array operators. */ > typedef int cLocalReduceLocalArraysOperator( > /* Handle for the local reduction operator */ > int local_reduce_handle, > /* Handle for a table containing optional parameters */ > int param_table_handle, > /* Repeat count */ > int repeat_count, > /* Number of input arrays */ > int N_input_arrays, > /* Rank (number of "dimensions") of the input arrays */ > int input_rank, > /* Dimensions (sizes) of the input arrays */ > const CCTK_INT input_array_dims[/* input_rank */], > /* Type codes of the input arrays */ > const CCTK_INT input_array_type_codes[/* N_input_arrays */], > /* Pointers to the input arrays */ > const CCTK_POINTER_TO_CONST input_arrays[/* N_input_arrays */], > /* Number of output arrays */ > int M_output_arrays, > /* Rank (number of "dimensions") of the output arrays */ > int output_rank, > /* Dimensions (sizes) of the output arrays */ > const CCTK_INT output_array_dims[/* output_rank */], > /* Type codes of the output arrays */ > const CCTK_INT output_array_type_codes[/* M_output_arrays */], > /* Pointers to the output arrays */ > const CCTK_POINTER output_arrays[/* M_output_arrays */]); > > > /* A finalisation routine. A pointer to such a routine is returned > from a local reduction operator. The routine is the called later > by the global reduction operator. */ > > typedef void cReduceFinalise( > /* Handle for a table containing optional parameters */ > int param_table_handle, > /* Repeat count */ > int repeat_count, > /* Number of output arrays */ > int M_output_arrays, > /* Rank (number of "dimensions") of the output arrays */ > int output_rank, > /* Dimensions (sizes) of the output arrays */ > const CCTK_INT output_array_dims[/* output_rank */], > /* Type codes of the output arrays */ > const CCTK_INT output_array_type_codes[/* M_output_arrays */], > /* Pointers to the output arrays */ > const CCTK_POINTER output_arrays[/* M_output_arrays */]); > > /* Reduce a local array (an array that is not a grid array) locally > (on the same processor). */ > int CCTK_LocalReduceLocalArrays( > /* Handle for the local reduction operator */ > int local_reduce_handle, > /* Handle for a table containing optional parameters */ > int param_table_handle, > /* Repeat count */ > int repeat_count, > /* Number of input arrays */ > int N_input_arrays, > /* Rank (number of "dimensions") of the input arrays */ > int input_rank, > /* Dimensions (sizes) of the input arrays */ > const CCTK_INT input_array_dims[/* input_rank */], > /* Type codes of the input arrays */ > const CCTK_INT input_array_type_codes[/* N_input_arrays */], > /* Pointers to the input arrays */ > const CCTK_POINTER_TO_CONST input_arrays[/* N_input_arrays */], > /* Number of output arrays */ > int M_output_arrays, > /* Rank (number of "dimensions") of the output arrays */ > int output_rank, > /* Dimensions (sizes) of the output arrays */ > const CCTK_INT output_array_dims[/* output_rank */], > /* Type codes of the output arrays */ > const CCTK_INT output_array_type_codes[/* M_output_arrays */], > /* Pointers to the output arrays */ > const CCTK_POINTER output_arrays[/* M_output_arrays */]); > > int CCTK_LocalReduceLocalArraysHandle(const char *reduction); > > #define CCTK_RegisterLocalReduceLocalArraysOperator(a,b) \ > CCTKi_RegisterLocalReduceLocalArraysOperator(CCTK_THORNSTRING,a,b) > > int CCTKi_RegisterLocalReduceLocalArraysOperator(const char *thorn, > cLocalReduceLocalArraysOperator operatorGV, > const char *name); > > const char *CCTK_LocalReduceLocalArraysOperatorImplementation(int handle); > > const char *CCTK_LocalReduceLocalArraysOperator (int handle); > int CCTK_NumLocalReduceLocalArraysOperators(void); > > > /********************************************************/ > /* ReduceLocalArrays definitions */ > /********************************************************/ > > /* This is the type for the reduce local array operators */ > typedef int cReduceLocalArraysOperator( > /* Pointer to the grid hierarchy */ > const cGH *cctkGH, > /* Destination processor, or -1 to make the result available to all > processors */ > int dest_proc, > /* Handle for the local reduction operator */ > int local_reduce_handle, > /* Handle for a table containing optional parameters */ > int param_table_handle, > /* Repeat count */ > int repeat_count, > /* Number of input arrays */ > int N_input_arrays, > /* Rank (number of "dimensions") of the input arrays */ > int input_rank, > /* Dimensions (sizes) of the input arrays */ > const CCTK_INT input_array_dims[/* input_rank */], > /* Type codes of the input arrays */ > const CCTK_INT input_array_type_codes[/* N_input_arrays */], > /* Pointers to the input arrays */ > const CCTK_POINTER_TO_CONST input_arrays[/* N_input_arrays */], > /* Number of output arrays */ > int M_output_arrays, > /* Rank (number of "dimensions") of the output arrays */ > int output_rank, > /* Dimensions (sizes) of the output arrays */ > const CCTK_INT output_array_dims[/* output_rank */], > /* Type codes of the output arrays */ > const CCTK_INT output_array_type_codes[/* M_output_arrays */], > /* Pointers to the output arrays */ > const CCTK_POINTER output_arrays[/* M_output_arrays */]); > > > /* Reduces local arrays (an array that is no a grid array) globally > (over all processors). This routine must be called on all > processors synchronously. */ > > int CCTK_ReduceLocalArrays( > /* Pointer to the grid hierarchy */ > const cGH *cctkGH, > /* Destination processor, or -1 to make the result available to all > processors */ > int dest_proc, > /* Handle for the local reduction operator */ > int local_reduce_handle, > /* Handle for a table containing optional parameters */ > int param_table_handle, > /* Repeat count */ > int repeat_count, > /* Number of input arrays */ > int N_input_arrays, > /* Rank (number of "dimensions") of the input arrays */ > int input_rank, > /* Dimensions (sizes) of the input arrays */ > const CCTK_INT input_array_dims[/* input_rank */], > /* Type codes of the input arrays */ > const CCTK_INT input_array_type_codes[/* N_input_arrays */], > /* Pointers to the input arrays */ > const CCTK_POINTER_TO_CONST input_arrays[/* N_input_arrays */], > /* Number of output arrays */ > int M_output_arrays, > /* Rank (number of "dimensions") of the output arrays */ > int output_rank, > /* Dimensions (sizes) of the output arrays */ > const CCTK_INT output_array_dims[/* output_rank */], > /* Type codes of the output arrays */ > const CCTK_INT output_array_type_codes[/* M_output_arrays */], > /* Pointers to the output arrays */ > const CCTK_POINTER output_arrays[/* M_output_arrays */]); > > #define CCTK_RegisterReduceLocalArraysOperator(a) \ > CCTKi_RegisterReduceLocalArraysOperator(CCTK_THORNSTRING,a) > > int CCTKi_RegisterReduceLocalArraysOperator(const char *thorn, > cReduceLocalArraysOperator operatorGV); > > const char *CCTK_ReduceLocalArraysOperatorImplementation(void); > > int CCTK_NumReduceLocalArraysOperators(void); > > /********************************************************/ > /* ReduceGridArrays definitions */ > /********************************************************/ > > /* This is the type for the reduce grid array operators. */ > typedef int cReduceGridArraysOperator( > /* Pointer to the grid hierarchy */ > const cGH *cctkGH, > /* Destination processor, or -1 to make the result available to all > processors */ > int dest_proc, > /* Handle for the local reduction operator */ > int local_reduce_handle, > /* Handle for a table containing optional parameters */ > int param_table_handle, > /* Repeat count */ > int repeat_count, > /* Number of input arrays */ > int N_input_arrays, > /* Variable indices of the input arrays */ > const CCTK_INT input_array_variable_indices[], > /* Number of output arrays */ > int M_output_arrays, > /* Rank (number of "dimensions") of the output arrays */ > int output_rank, > /* Dimensions (sizes) of the output arrays */ > const CCTK_INT output_array_dims[/* output_rank */], > /* Type codes of the output arrays */ > const CCTK_INT output_array_type_codes[/* M_output_arrays */], > /* Pointers to the output arrays */ > const CCTK_POINTER output_arrays[/* M_output_arrays */]); > > /* Reduce grid arrays (grid functions) globally (over all processors). > This routine must be called on all processors synchronously. */ > int CCTK_ReduceGridArrays( > /* Pointer to the grid hierarchy */ > const cGH *cctkGH, > /* Destination processor, or -1 to make the result available to all > processors */ > int dest_proc, > /* Handle for the local reduction operator */ > int local_reduce_handle, > /* Handle for a table containing optional parameters */ > int param_table_handle, > /* Repeat count */ > int repeat_count, > /* Number of input arrays */ > int N_input_arrays, > /* Variable indices of the input arrays */ > const CCTK_INT input_array_variable_indices[], > /* Number of output arrays */ > int M_output_arrays, > /* Rank (number of "dimensions") of the output arrays */ > int output_rank, > /* Dimensions (sizes) of the output arrays */ > const CCTK_INT output_array_dims[/* output_rank */], > /* Type codes of the output arrays */ > const CCTK_INT output_array_type_codes[/* M_output_arrays */], > /* Pointers to the output arrays */ > const CCTK_POINTER output_arrays[/* M_output_arrays */]); > > #define CCTK_RegisterReduceGridArraysOperator(a) \ > CCTKi_RegisterReduceGridArraysOperator(CCTK_THORNSTRING,a) > > int CCTKi_RegisterReduceGridArraysOperator(const char *thorn, > cReduceGridArraysOperator operatorGV); > > const char *CCTK_ReduceGridArraysOperatorImplementation(void); > > int CCTK_NumReduceGridArraysOperators(void); > > /********************************************************/ > /* Old Interface definitions */ > /********************************************************/ > 87,121d371 < /* prototype for local array reduction operator routine */ < typedef int (*cLocalArrayReduceOperator) (int N_dims, int operator_handle, < int param_table_handle, int N_input_arrays, < const CCTK_INT input_array_dims[], < const CCTK_INT input_array_type_codes[], < const void *const input_arrays[], < int M_output_numbers, < const CCTK_INT output_number_type_codes[], < void *const output_numbers[]); < < /* 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, < const CCTK_INT input_array_variable_indices[], < int M_output_values, < const CCTK_INT output_value_type_codes[], < void* const output_values[]); < < /* prototype for global array reduction operator routine */ < typedef int (*cReduceArraysGloballyOperator) (const cGH *GH, < int dest_proc, < int local_reduce_handle, < int param_table_handle, < int N_input_arrays, < const void * const input_arrays[], < int input_dims, < const CCTK_INT input_array_dims[], < const CCTK_INT input_array_type_codes[], < int M_output_values, < const CCTK_INT output_value_type_codes[], < void* const output_values[]); < 151,223d400 < /* new local array reduction API */ < int CCTK_ReduceLocalArrays(int N_dims, < int local_reduce_handle, < int param_table_handle, < int N_input_arrays, < const CCTK_INT input_array_sizes[], < const CCTK_INT input_array_type_codes[], < const void *const input_arrays[], < int M_output_values, < const CCTK_INT output_value_type_codes[], < void *const output_values[]); < < int CCTK_LocalArrayReductionHandle(const char *reduction); < < #define CCTK_RegisterLocalArrayReductionOperator(a,b) \ < CCTKi_RegisterLocalArrayReductionOperator(CCTK_THORNSTRING,a,b) < < int CCTKi_RegisterLocalArrayReductionOperator(const char *thorn, < cLocalArrayReduceOperator operatorGV, < const char *name); < < int CCTK_RegisterReductionLocalArrayOperator( < int (*function)(REDUCTION_LOCAL_ARRAY_OPERATOR_REGISTER_ARGLIST), < const char *name); < < const char *CCTK_LocalArrayReduceOperatorImplementation(int handle); < < const char *CCTK_LocalArrayReduceOperator (int handle); < 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, < const CCTK_INT input_array_variable_indices[], < int M_output_values, < const CCTK_INT output_value_type_codes[], < void* const output_values[]); < < #define CCTK_RegisterGridArrayReductionOperator(a) \ < CCTKi_RegisterGridArrayReductionOperator(CCTK_THORNSTRING,a) < < int CCTKi_RegisterGridArrayReductionOperator(const char *thorn, cGridArrayReduceOperator < operatorGV); < < const char *CCTK_GridArrayReductionOperator(void); < int CCTK_NumGridArrayReductionOperators(void); < < /* new pointwise reduction API */ < int CCTK_ReduceArraysGlobally(const cGH *GH, < int dest_proc, < int local_reduce_handle, < int param_table_handle, < int N_input_arrays, < const void * const input_arrays[], < int input_dims, < const CCTK_INT input_array_dims[], < const CCTK_INT input_array_type_codes[], < int M_output_values, < const CCTK_INT output_value_type_codes[], < void* const output_values[]); < < #define CCTK_RegisterReduceArraysGloballyOperator(a) \ < CCTKi_RegisterReduceArraysGloballyOperator(CCTK_THORNSTRING,a) < < int CCTKi_RegisterReduceArraysGloballyOperator(const char *thorn, cReduceArraysGloballyOperator < operatorGV); < < const char *CCTK_ReductionArraysGloballyOperator(void); < int CCTK_NumReductionArraysGloballyOperators(void); < 263d439 <