fi_av_set(3)
π fi_av_set β address vector set operations, bestie β¨
okay so this page is the whole fi_av_set friend group π«Ά β creating sets, mashing sets together, yeeting addresses out of sets, all of it. here's who's who, no cap:
fi_av_set/fi_closeβ open or close an address vector set πfi_av_set_unionβ perform a set union operation on two AV setsfi_av_set_intersectβ perform a set intersect operation on two AV setsfi_av_set_diffβ perform a set difference operation on two AV setsfi_av_set_insertβ add an address to an AV setfi_av_set_removeβ remove an address from an AV setfi_av_set_addrβ obtain a collective address for current addresses in an AV set
this is from the Libfabric programmer's manual, the fi_av_set page β keep that in your notes π
β¨ 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β the address vector, your main character here πsetβ the address vector setdstβ the address vector set that gets updated by the set operation (she's the one being changed, slay)srcβ the address vector set providing input to a set operationattrβ address vector set attributescontextβ user specified context associated with the address vector setflagsβ additional flags to apply to the operationaddrβ destination address to insert to remove from AV setcoll_addrβ address identifying collective group
π¦ DESCRIPTION π¦
An address vector set (AV set) represents an ordered subset of addresses of an address vector, periodt. 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, none, zero, zip π. As a result, each peer is responsible for creating matching AV sets as part of their collective membership definition. See fi_collective(3) 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. Ifcountis0, the provider will select a size based on available system configuration data or underlying limitations. iykyk β¨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 typeFI_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. Thestart_addrandend_addrmust be set toFI_ADDR_NOTAVAILif creating an empty AV set, a communication key is being provided, or the AV is of typeFI_AV_MAP.
fr fr, the number of addresses betweenstart_addrandend_addrmust be less than or equal to the specifiedcountvalue. don't play with that π
strideβ the number of entries between successive addresses included in the AV set. The AV set will include all addresses fromstart_addr + stride x i, for increasing, non-negative, integer values ofi, up toend_addr. A stride of1indicates that all addresses betweenstart_addrandend_addrshould be added to the AV set. Stride should be set to0unless thestart_addrandend_addrfields are valid.comm_key_sizeβ the length of the communication key in bytes. This field should be0if 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 (so like, ask your provider, not me π§).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. queen behavior π
π 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.
π important: attempting to use the address returned fromfi_av_set_addr(e.g. passing it tofi_join_collective) while simultaneously modifying the addresses stored in an AV set results in undefined behavior. do not do that, bestie. pick one.
π 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. like closing the group chat mid-drama, chaos π
π₯ 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. iykyk π
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. not a vibe check you want to fail π
β¨ 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 π
π AUTHORS π
OpenFabrics.
okay that's the whole page bestie, go build your collective π β signed, sealed, and delivered straight from the Libfabric Programmer's Manual, Libfabric v2.5.1, dated 2024-12-10 π¦β¨π
π¦ where this page comes from
- centos-stream 10: libfabric-devel 2.5.1-1.el10 Β· BSD-2-Clause OR GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms