Java wrappers for the Hardware Locality (hwloc) library
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
javadoc
lib
src/main
.gitignore
LICENSE
README.md
pom.xml

README.md

jhwloc: Java Hardware Locality library

jhwloc is a Java wrapper for the Portable Hardware Locality (hwloc) library available at:

http://www.open-mpi.org/projects/hwloc

Getting Started

Prerequisites

  • Make sure you have Java Develpment Kit (JDK) version 1.7 or above

    • JAVA_HOME environmental variable must be set accordingly
  • Make sure you have a working Apache Maven distribution version 3 or above

  • Make sure you have a working hwloc distribution version 2.0 or above

Installation

In order to download, compile, build and install the jhwloc library in your Maven local repository (by default ~/.m2), just execute the following commands:

git clone https://github.com/rreye/jhwloc.git
cd jhwloc
mvn install

Usage

In order to use the jhwloc library in your projects, add the following dependency section to your pom.xml:

<dependencies>
...
  <dependency>
   <groupId>es.udc.gac</groupId>
   <artifactId>jhwloc</artifactId>
   <version>1.0</version> <!-- or latest version -->
  </dependency>
...
</dependencies>

Running the examples

You can test your installation running some of the examples included in jhwloc:

java -cp /path/to/jhwloc/lib/jhwloc-1.0.jar -Djava.library.path=/path/to/jhwloc/lib es.udc.gac.jhwloc.examples.HelloWorld

If your native hwloc library (i.e. libhwloc.so) is not installed in a standard location (e.g. /usr/lib64), you need to set LD_LIBRARY_PATH environmental variable to the directory containing it (i.e. $HWLOC_HOME/lib). For instance, if hwloc is installed at /opt/hwloc (i.e. HWLOC_HOME=/opt/hwloc):

export LD_LIBRARY_PATH=$HWLOC_HOME/lib:$LD_LIBRARY_PATH
java -cp /path/to/jhwloc/lib/jhwloc-1.0.jar -Djava.library.path=/path/to/jhwloc/lib es.udc.gac.jhwloc.examples.HelloWorld

Projects using jhwloc

Authors

License

This library is distributed as free software and is publicly available under the GPLv3 license (see the LICENSE file for more details)