https://github.com/c0mm4nd/go-hwloc
Golang binding for hwloc
https://github.com/c0mm4nd/go-hwloc
golang hardware-locality hwloc netloc
Last synced: 3 months ago
JSON representation
Golang binding for hwloc
- Host: GitHub
- URL: https://github.com/c0mm4nd/go-hwloc
- Owner: c0mm4nd
- License: mit
- Created: 2019-12-30T07:44:03.000Z (over 6 years ago)
- Default Branch: dev
- Last Pushed: 2024-02-29T17:33:24.000Z (over 2 years ago)
- Last Synced: 2024-11-29T17:49:48.537Z (over 1 year ago)
- Topics: golang, hardware-locality, hwloc, netloc
- Language: Go
- Homepage:
- Size: 3.26 MB
- Stars: 2
- Watchers: 2
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-hwloc
[](https://travis-ci.com/c0mm4nd/go-hwloc)
[](https://godoc.org/github.com/c0mm4nd/go-hwloc)
## Introduction
Golang binding for static hwloc
## Ready
Install hwloc from your system package manager or compile from the source in https://github.com/open-mpi/hwloc
For example:
```bash
# Static Build
git clone https://github.com/open-mpi/hwloc && cd hwloc
./autogen.sh
./configure --enable-static --disable-shared LDFLAGS="-static"
make LDFLAGS=-all-static
sudo make install
sudo ldconfig /usr/local/lib
```
## Usage
```go
import hwloc "github.com/c0mm4nd/go-hwloc"
```
## Extra
- Q: Why not assemble hwloc into go lib?
A: hwloc is a very powerful and platform-based native library, so comparing to provide a simple version, I prefer to let developers compile it by their own hands or the binary for their platform.
- Q: Why build fails when using bazel?
A: Bazel compiling project within a sandbox, which disallow linker find the "external" library, hwloc, so you should write `BUILD.bazel` and `WORKSPACE` for hwloc before using this go binding lib. Actually, it is what tensorflow does, and you can learn from [their practice](https://github.com/tensorflow/tensorflow/tree/master/third_party/hwloc)
# Hwloc
## Introduction
The Hardware Locality (hwloc) software project aims at easing the process of
discovering hardware resources in parallel architectures. It offers
command-line tools and a C API for consulting these resources, their locality,
attributes, and interconnection. hwloc primarily aims at helping
high-performance computing (HPC) applications, but is also applicable to any
project seeking to exploit code and/or data locality on modern computing
platforms.
hwloc is actually made of two subprojects distributed together:
* The original hwloc project for describing the internals of computing nodes.
It is described in details starting at section Hardware Locality (hwloc)
Introduction.
* The network-oriented companion called netloc (Network Locality), described
in details starting with section Network Locality (netloc).
See also the Related pages tab above for links to other sections.
Netloc may be disabled, but the original hwloc cannot. Both hwloc and netloc
APIs are documented after these sections.