## shmem_long_prod_to_all

#### Purpose

Performs a logical OR function across a set of processing elements (PEs).

#### C syntax

    #include <shmem.h>

    void shmem_long_prod_to_all(long *target, long *source, int nreduce, int PE_start, int logPE_stride, int PE_size, long *pWrk, long *pSync);

#### Parameters

INPUT
target
  A symmetric data object array which will receive the result of the reduction operation.
source
  A symmetric data object array of length nreduce elements which is the same type as the target.
nreduce
  Number of elements in the target and source arrays.
PE_start
  The lowest virtual PE number of the active set of PEs.
logPE_stride
  The log (base 2) of the stride between consecutive virtual PE numbers in the active set.
PE_size
  The number of PEs in the active set.
pWrk
  A symmetric work array. The pWrk argument must have the same data type as target. The size of the array must be max(nreduce/2+1,_SHMEM_REDUCE_MIN_WRKDATA_SIZE).
pSync
  A symmetric work array. In C/C++, pSync must be of type long and size _SHMEM_REDUCE_SYNC_SIZE. Every element of this array must be initialized with the value _SHMEM_SYNC_VALUE before any of the PEs in the active set enters the reduction routine the first time.

#### Description

The reduction routines compute one or more reductions across symmetric arrays on multiple processing elements (PEs). A reduction performs an associative binary operation across a set of values. The nreduce argument determines the number of separate reductions to perform. The source array on all PEs in the active set provides one element for each reduction. The results of the reductions are placed in the target array on all PEs in the active set that is defined by the PE_start, logPE_stride, PE_size.

The source and target arrays may be the same array, but they may not be overlapping arrays. Each of these functions assumes that only PEs in the active set call the function. If a PE not in the active set calls the collective function, the behavior is undefined.

The function shmem_long_prod_to_all performs a reduction applying the product function to long values distributed across the PEs.

Before any PE calls the reduction functions, users have to ensure the following conditions exist:

The pWrk and pSync arrays on all PEs in the active set are not still in use from a prior call to a reduction function.

The target array on all PEs in the active set is ready to accept the results of the reduction.

Upon returning from the colletcive function, the following conditions are true:

The target data array is updated.

The values in the pSync array are restored to the original values.

Each of these functions assumes that only PEs in the active set call the function. If a PE not in the active set calls the collective function, the behavior is undefined.

#### C examples

#### Related information

Subroutines: shmem_barrier, shmem_broadcast, shmem_collect, shmem_max, shmem_min, shmem_or, shmem_prod, shmem_sum, shmem_xor

OpenSHMEM API Index