Skip to content

Types

Enumerations, type aliases, structures and macros of the public API. Declarations that only serve the library's internal group machinery (job bookkeeping types) are omitted.


Enumerations

LcclDataType

Element data types for collective buffers.

Value Description
kLcclInt8 8-bit signed integer.
kLcclChar Alias for kLcclInt8.
kLcclUint8 8-bit unsigned integer.
kLcclInt32 32-bit signed integer.
kLcclInt Alias for kLcclInt32.
kLcclUint32 32-bit unsigned integer.
kLcclInt64 64-bit signed integer.
kLcclUint64 64-bit unsigned integer.
kLcclFloat16 16-bit IEEE 754 half-precision float.
kLcclHalf Alias for kLcclFloat16.
kLcclFloat32 32-bit IEEE 754 single-precision float.
kLcclFloat Alias for kLcclFloat32.
kLcclFloat64 64-bit IEEE 754 double-precision float.
kLcclDouble Alias for kLcclFloat64.
kLcclBfloat16 16-bit brain float (bfloat16).
kLcclNumTypes Number of data types; not a valid value.

LcclRedOp

Reduction operation selector for collective calls.

Value Description
kLcclSum Element-wise sum.
kLcclProd Element-wise product.
kLcclMax Element-wise maximum.
kLcclMin Element-wise minimum.
kLcclAvg Element-wise average.
kLcclNumOps Number of built-in ops; not a valid value.
kLcclMaxRedOp Upper bound of the enumeration; not a valid value.

LcclResult

Return codes for all LCCL API functions: kLcclSuccess (0) is success, kLcclInProgress is not an error but means that nonblocking work has not finished yet, and every other value is a failure. Every code, with its value, message, cause and resolution, is listed in Error codes.

Codes are partitioned into ranges by subsystem so a stray return value pinpoints both the failing layer and the specific failure mode.

  • 0x00000: general
  • 0x10000: communicator
  • 0x20000: socket
  • 0x30000: bootstrap
  • 0x40000: memory / allocation
  • 0x50000: topology / graph / XML
  • 0x60000: net plugin
  • 0x70000: transport
  • 0x80000: proxy
  • 0x90000: group
  • 0xA0000: enqueue / kernel-plan
  • 0xB0000: kernel / device

Type aliases

LcclComm

Opaque handle to a communicator; points to LcclCommSt.

1
typedef struct LcclCommSt* LcclComm;

Structures

LcclConfig

User-supplied communicator configuration.

Field Type Description
size size_t Must equal sizeof(LcclConfig); used for ABI version checks.
magic unsigned int Must equal 0xcafebeef; validated by the library on creation.
blocking int Nonblocking if 0. Communicator creation, LcclCommFinalize(), and the submission of a group that needs connections can return early with kLcclInProgress.
min_num_chnl int Minimum number of channels to allocate (LCCL_CONFIG_UNDEF_INT = default).
max_num_chnl int Maximum number of channels to allocate (LCCL_CONFIG_UNDEF_INT = default).
net_name const char * Name of the network backend to use (NULL = auto-select).

Must be initialized with LCCL_CONFIG_INITIALIZER before setting any fields. Fields left at their UNDEF sentinel values inherit library defaults. For the default values, the value checks and the environment variables that override these fields, see Communicators.


LcclUniqueId

Opaque bootstrap rendezvous identifier shared by all ranks before communicator init.

Field Type Description
internal char[128] Opaque payload (LCCL_UNIQUE_ID_BYTES = 128 bytes); do not interpret directly.

The leading bytes encode the bootstrap root's socket address and a random magic number; the remainder is padding.


Macros

LCCL_CONFIG_INITIALIZER

Static initializer for LcclConfig. Assign this to an LcclConfig variable before modifying individual fields. A config not initialized with this macro is rejected with kLcclInvalidArgument.


LCCL_CONFIG_UNDEF_INT, LCCL_CONFIG_UNDEF_PTR

Sentinels for unset integer (INT_MIN) and pointer (nullptr) fields of LcclConfig. A field left at its sentinel inherits the library default.


LCCL_UNIQUE_ID_BYTES

Size of the opaque LcclUniqueId payload in bytes (128).


Helpers

LcclDataTypeToString

Returns a human-readable string for an LcclDataType value.

1
const char * LcclDataTypeToString(LcclDataType type);
Parameter Direction Description
type in Data type to convert.

Returns — Pointer to a static string representation.


LcclGetErrorToString

Returns a string for each error code.

1
const char * LcclGetErrorToString(LcclResult error);
Parameter Direction Description
error in LcclResult code

Returns — Pointer to a static string (const char *).


LcclRedOpToString

Returns a human-readable string for an LcclRedOp value.

1
const char * LcclRedOpToString(LcclRedOp red_op);
Parameter Direction Description
red_op in Operation type to convert.

Returns — Pointer to a static string representation.


LcclTypeSize

Returns the size in bytes of an LcclDataType element.

1
int LcclTypeSize(LcclDataType type);
Parameter Direction Description
type in Data type to query.

Returns — Size in bytes, or -1 for unknown types.