---
name: "fi_av_set"
section: "3"
platform: "linux"
package: "libfabric"
version: "2.7.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/fi_av_set"
---

# fi\_av\_set(3)

Address vector set operations

## NAME

fi\_av\_set - Address vector set operations

- fi\_av\_set / fi\_close

  Open or close an address vector set

- fi\_av\_set\_union

  Perform a set union operation on two AV sets

- fi\_av\_set\_intersect

  Perform a set intersect operation on two AV sets

- fi\_av\_set\_diff

  Perform a set difference operation on two AV sets

- fi\_av\_set\_insert

  Add an address to an AV set

- fi\_av\_set\_remove

  Remove an address from an AV set

- fi\_av\_set\_addr

  Obtain a collective address for current addresses in an AV set

## SYNOPSIS

-

  ```
  #include <rdma/fi_collective.h>
  int fi_av_set(struct fid_av *av, struct fi_av_set_attr *attr,
        struct fid_av_set **set, void * context);
  int fi_av_set_union(struct fid_av_set *dst, const struct fid_av_set *src);
  int fi_av_set_intersect(struct fid_av_set *dst, const struct fid_av_set *src);
  int fi_av_set_diff(struct fid_av_set *dst, const struct fid_av_set *src);
  int fi_av_set_insert(struct fid_av_set *set, fi_addr_t addr);
  int fi_av_set_remove(struct fid_av_set *set, fi_addr_t addr);
  int fi_av_set_addr(struct fid_av_set *set, fi_addr_t *coll_addr);
  int fi_close(struct fid *av_set);
  ```

## ARGUMENTS

- *av*

  Address vector

- *set*

  Address vector set

- *dst*

  Address vector set updated by set operation

- *src*

  Address vector set providing input to a set operation

- *attr*

  Address vector set attributes

- *context*

  User specified context associated with the address vector set

- *flags*

  Additional flags to apply to the operation.

- *addr*

  Destination address to insert to remove from AV set.

- *coll\_addr*

  Address identifying collective group.

## DESCRIPTION

An address vector set (AV set) represents an ordered subset of addresses of an address vector. AV sets are used to identify the participants in a collective operation. Endpoints use the fi\_join\_collective() operation to associate itself with an AV set. The join collective operation provides an fi\_addr that is used when communicating with a collective group.

The creation and manipulation of an AV set is a local operation. No fabric traffic is exchanged between peers. As a result, each peer is responsible for creating matching AV sets as part of their collective membership definition. See [fi\_collective(3)](/fi_collective/3.md) for a discussion of membership models.

### fi\_av\_set

The fi\_av\_set call creates a new AV set. The initial properties of the AV set are specified through the struct fi\_av\_set\_attr parameter. This structure is defined below, and allows including a subset of addresses in the AV set as part of AV set creation. Addresses may be added or removed from an AV set using the AV set interfaces defined below.

### fi\_av\_set\_attr

-

  ```
  struct fi_av_set_attr {
      size_t count;
      fi_addr_t start_addr;
      fi_addr_t end_addr;
      uint64_t stride;
      size_t comm_key_size;
      uint8_t *comm_key;
      uint64_t flags;
  };
  ```

- *count*

  Indicates the expected the number of members that will be a part of the AV set. The provider uses this to optimize resource allocations. If count is 0, the provider will select a size based on available system configuration data or underlying limitations.

- *start\_addr / end\_addr*

  The starting and ending addresses, inclusive, to include as part of the AV set. The use of start and end address require that the associated AV have been created as type FI\_AV\_TABLE. Valid addresses in the AV which fall within the specified range and which meet other requirements (such as stride) will be added as initial members to the AV set. The start\_addr and end\_addr must be set to FI\_ADDR\_NOTAVAIL if creating an empty AV set, a communication key is being provided, or the AV is of type FI\_AV\_MAP.

The number of addresses between start\_addr and end\_addr must be less than or equal to the specified count value.

- *stride*

  The number of entries between successive addresses included in the AV set. The AV set will include all addresses from start\_addr + stride x i, for increasing, non-negative, integer values of i, up to end\_addr. A stride of 1 indicates that all addresses between start\_addr and end\_addr should be added to the AV set. Stride should be set to 0 unless the start\_addr and end\_addr fields are valid.

- *comm\_key\_size*

  The length of the communication key in bytes. This field should be 0 if a communication key is not available.

- *comm\_key*

  If supported by the fabric, this represents a key associated with the AV set. The communication key is used by applications that directly manage collective membership through a fabric management agent or resource manager. The key is used to convey that results of the membership setup to the underlying provider. The use and format of a communication key is fabric provider specific.

- *flags*

  Flags may be used to configure the AV set, including restricting which collective operations the AV set needs to support. See the flags section for a list of flags that may be specified when creating the AV set.

### fi\_av\_set\_union

The AV set union call adds all addresses in the source AV set that are not in the destination AV set to the destination AV set. Where ordering matters, the newly inserted addresses are placed at the end of the AV set.

### fi\_av\_set\_intersect

The AV set intersect call remove all addresses from the destination AV set that are not also members of the source AV set. The order of the addresses in the destination AV set is unchanged.

### fi\_av\_set\_diff

The AV set difference call removes all address from the destination AV set that are also members of the source AV set. The order of the addresses in the destination AV set is unchanged.

### fi\_av\_set\_insert

The AV set insert call appends the specified address to the end of the AV set.

### fi\_av\_set\_remove

The AV set remove call removes the specified address from the given AV set. The order of the remaining addresses in the AV set is unchanged.

### fi\_av\_set\_addr

Returns an address that may be used to communicate with all current members of an AV set. This is a local operation only that does not involve network communication. The returned address may be used as input into fi\_join\_collective. Note that attempting to use the address returned from fi\_av\_set\_addr (e.g. passing it to fi\_join\_collective) while simultaneously modifying the addresses stored in an AV set results in undefined behavior.

### fi\_close

Closes an AV set and releases all resources associated with it. Any operations active at the time an AV set is closed will be aborted, with the result of the collective undefined.

## FLAGS

The following flags may be specified as part of AV set creation.

- *FI\_UNIVERSE*

  When set, then the AV set will be created containing all addresses stored in the corresponding AV.

- *FI\_BARRIER\_SET*

  If set, the AV set will be configured to support barrier operations.

- *FI\_BROADCAST\_SET*

  If set, the AV set will be configured to support broadcast operations.

- *FI\_ALLTOALL\_SET*

  If set, the AV set will be configured to support all to all operations.

- *FI\_ALLREDUCE\_SET*

  If set, the AV set will be configured to support all reduce operations.

- *FI\_ALLGATHER\_SET*

  If set, the AV set will be configured to support all gather operations.

- *FI\_REDUCE\_SCATTER\_SET*

  If set, the AV set will be configured to support reduce scatter operations.

- *FI\_REDUCE\_SET*

  If set, the AV set will be configured to support reduce operations.

- *FI\_SCATTER\_SET*

  If set, the AV set will be configured to support scatter operations.

- *FI\_GATHER\_SET*

  If set, the AV set will be configured to support gather operations.

## NOTES

Developers who are familiar with MPI will find that AV sets are similar to MPI groups, and may act as a direct mapping in some, but not all, situations.

By default an AV set will be created to support all collective operations supported by the underlying provider (see fi\_query\_collective). Users may reduce resource requirements by specifying only those collection operations needed by the AV set through the use of creation flags: FI\_BARRIER\_SET, FI\_BROADCAST\_SET, etc. If no such flags are specified, the AV set will be configured to support any that are supported. It is an error for a user to request an unsupported collective.

## RETURN VALUES

Returns 0 on success. On error, a negative value corresponding to fabric errno is returned. Fabric errno values are defined in rdma/fi\_errno.h.

## SEE ALSO

[fi\_av(3)](/fi_av/3.md), [fi\_collective(3)](/fi_collective/3.md)

## AUTHORS

OpenFabrics.
