Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.3.3 - English

Change language to:
Français - 日本語 - Português

Please note that the recommended version of Scilab is 2025.0.0. This page might be outdated.
However, this page did not exist in the previous stable version.

Scilab help >> PVM parallel Toolbox > pvm_reduce

pvm_reduce

Performs a reduce operation over members of the specified group

Calling Sequence

[buff, info] = pvm_reduce(func, buff, msgtag, group, rootginst)

Arguments

func : string, defines the operation performed on the global

data. Should be : Max, Min, Sum or Pro.

buff : scalar, local scilab variable. On return, the data array on

the root will be overwritten with the result of the reduce operation over the group.

msgtag : integer, message tag supplied by the user. msgtag

should be >= 0. It allows the user's program to distinguish between different kinds of messages.

group

string, group name of an existing group.

rootginst : integer, instance number of group member who gets the

result.

info : integer, status code returned by the routine. Values

less than zero indicate an error.

Description

pvm_reduce performs global operations such as max, min, sum or product over all the tasks in a group. All group members call pvm_reduce with their local data, and the result of the reduction operation appears on the user specified root task root. The root task is identified by its instance number in the group.

Max and Min are implemented for scalar datatypes (double, complex). For complex values the minimum [maximum] is that complex pair with the minimum [maximum] modulus. Sum and Product are implemented for scalar datatypes.

Note: pvm_reduce does not block. If a task calls pvm_reduce and then leaves the group before the root has called pvm_reduce an error may occur.

See Also

  • pvm_bcast — broacasts a message to all members of a group
  • pvm_barrier — blocks the calling process until all processes in a group have called it.
  • pvm_send — immediately sends (or multicast) data.
  • pvm_getinst — returns the instance number in a group of a PVM process.
  • pvm_gsize — returns the number of members presently in the named group.
  • pvm_joingroup — enrolls the calling process in a named group.
  • pvm_lvgroup — Unenrolls the calling process from a named group.
<< pvm_recv PVM parallel Toolbox pvm_sci2f77 >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Wed Oct 05 12:10:04 CEST 2011