---
name: "hwloc_topology_export_synthetic"
section: "3"
platform: "linux"
package: "hwloc"
version: "2.15.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/hwlocality_syntheticexport"
---

# hwloc\_topology\_export\_synthetic(3)

Exporting Topologies to Synthetic

Part of [hwlocality\_syntheticexport(3)](/hwlocality_syntheticexport/3.md).

## NAME

hwlocality\_syntheticexport - Exporting Topologies to Synthetic

## SYNOPSIS

### Enumerations

enum **hwloc\_topology\_export\_synthetic\_flags\_e** { **HWLOC\_TOPOLOGY\_EXPORT\_SYNTHETIC\_FLAG\_NO\_EXTENDED\_TYPES**, **HWLOC\_TOPOLOGY\_EXPORT\_SYNTHETIC\_FLAG\_NO\_ATTRS**, **HWLOC\_TOPOLOGY\_EXPORT\_SYNTHETIC\_FLAG\_V1**, **HWLOC\_TOPOLOGY\_EXPORT\_SYNTHETIC\_FLAG\_IGNORE\_MEMORY** }\

### Functions

int **hwloc\_topology\_export\_synthetic** (**hwloc\_topology\_t** topology, char \*buffer, size\_t buflen, unsigned long flags)\

## Detailed Description

## Enumeration Type Documentation

### enum hwloc\_topology\_export\_synthetic\_flags\_e

Flags for exporting synthetic topologies. Flags to be given as a OR'ed set to **hwloc\_topology\_export\_synthetic()**.

**Enumerator**

- ***HWLOC\_TOPOLOGY\_EXPORT\_SYNTHETIC\_FLAG\_NO\_EXTENDED\_TYPES***

  Export extended types such as L2dcache as basic types such as Cache. This is required if loading the synthetic description with hwloc \< 1.9.

- ***HWLOC\_TOPOLOGY\_EXPORT\_SYNTHETIC\_FLAG\_NO\_ATTRS***

  Do not export level attributes. Ignore level attributes such as memory/cache sizes or PU indexes. This is required if loading the synthetic description with hwloc \< 1.10.

- ***HWLOC\_TOPOLOGY\_EXPORT\_SYNTHETIC\_FLAG\_V1***

  Export the memory hierarchy as expected in hwloc 1.x. Instead of attaching memory children to levels, export single NUMA node child as normal intermediate levels, when possible. This is required if loading the synthetic description with hwloc 1.x. However this may fail if some objects have multiple local NUMA nodes.

- ***HWLOC\_TOPOLOGY\_EXPORT\_SYNTHETIC\_FLAG\_IGNORE\_MEMORY***

  Do not export memory information. Only export the actual hierarchy of normal CPU-side objects and ignore where memory is attached. This is useful for when the hierarchy of CPUs is what really matters, but it behaves as if there was a single machine-wide NUMA node.

## Function Documentation

### int hwloc\_topology\_export\_synthetic (hwloc\_topology\_t topology, char \* buffer, size\_t buflen, unsigned long flags)

Export the topology as a synthetic string. At most buflen characters will be written in buffer, including the terminating \\0.

This exported string may be given back to **hwloc\_topology\_set\_synthetic()**.

flags is a OR'ed set of **hwloc\_topology\_export\_synthetic\_flags\_e**.

**Returns**

The number of characters that were written, not including the terminating \\0.

\-1 if the topology could not be exported, for instance if it is not symmetric.

**Note**

I/O and Misc children are ignored, the synthetic string only describes normal children.

A 1024-byte buffer should be large enough for exporting topologies in the vast majority of cases.

## Author

Generated automatically by Doxygen for Hardware Locality (hwloc) from the source code.
