Skip to content

Commit 6d63e62

Browse files
committed
jucx-binding: Fix tag exchange sometimes failing; Update dependencies
1 parent 4aa60f4 commit 6d63e62

File tree

23 files changed

+282
-150
lines changed

23 files changed

+282
-150
lines changed

.gitignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,25 @@ gradle-app.setting
111111
**/build/
112112

113113
# End of https://www.toptal.com/developers/gitignore/api/intellij+all,gradle
114+
115+
### VisualStudioCode ###
116+
.vscode/*
117+
!.vscode/tasks.json
118+
!.vscode/launch.json
119+
!.vscode/extensions.json
120+
*.code-workspace
121+
122+
# Local History for Visual Studio Code
123+
.history/
124+
125+
### VisualStudioCode Patch ###
126+
# Ignore all local history of files
127+
.history
128+
.ionide
129+
130+
# End of https://www.toptal.com/developers/gitignore/api/visualstudiocode
131+
132+
**/.project
133+
**/.classpath
134+
**/.settings/
135+
**/bin/

.travis.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,21 @@ jobs:
1414
- ./gradlew build
1515
- stage: release
1616
script:
17-
- ./gradlew provider:shadowJar provider:distZip
17+
- ./gradlew clean
1818
- ./gradlew publish -Dgpr.user=${GPR_USER} -Dgpr.token=${GPR_TOKEN} -Drelease=true
19-
20-
before_deploy:
21-
- export LIB_JAR_FILE=$(ls build/provider/libs/*all.jar)
22-
- export DIST_ZIP_FILE=$(ls build/example/distributions/*.zip)
19+
- ./gradlew provider:shadowJar example:distZip -Drelease=true
20+
- export PUBLISH=true
2321

2422
deploy:
2523
provider: releases
2624
token: ${ACCESS_TOKEN}
2725
file:
28-
- ${LIB_JAR_FILE}
29-
- ${DIST_ZIP_FILE}
30-
cleanup: false
26+
- build/provider/libs/hadronio-${TRAVIS_TAG}-all.jar
27+
- build/example/distributions/hadronio-${TRAVIS_TAG}.zip
28+
skip_cleanup: true
3129
overwrite: true
3230
on:
3331
repo: hhu-bsinfo/hadroNIO
3432
branch: master
35-
tags: true
33+
tags: true
34+
condition: ${PUBLISH} = true

README.md

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ This is a research project by the [Operating Systems group](https://www.cs.hhu.d
3030

3131
## Build instructions
3232

33-
hadroNIO is compatible with all Java version, starting from Java 8. To build hadroNIO, **UCX 1.10.1** needs to be installed on your system. See the [OpenUCX GitHub Repository](https://github.com/openucx/ucx) for information on how to build and install UCX.
33+
hadroNIO is compatible with all Java version, starting from Java 8.
3434

3535
Execute the following commands to clone this repository and build a portable JAR-file, containing hadroNIO and all its dependencies:
3636

@@ -44,11 +44,12 @@ The JAR-file should now be located at `build/provider/libs/hadronio-0.1.0-SNAPSH
4444

4545
### Known issues
4646

47-
- It is currently not possible to build hadroNIO with Java versions newer than Java 15, due to to Gradle 6 not supporting Java 16 or higher. This issue will be dealt with in the future, by upgrading to a newer Gradle version, once the Gradle plugin [com.palantir.git-version](https://plugins.gradle.org/plugin/com.palantir.git-version) supports [Gradle 7](https://github.com/palantir/gradle-git-version/issues/353).
4847
- Building hadroNIO with a Java version higher than 8, but then running it with Java 8 JVM results in a `java.lang.NoSuchMethodError`, regarding the class `java.nio.ByteBuffer`. This happens, because the `ByteBuffer` overrides methode of its super class `Buffer` in Java 9+, while it relies on the implementations provided by `Buffer` in Java 8. If you come across this error, make sure to both build an run hadroNIO using Java 8, or use a newer version of Java altogether.
4948

5049
## Run instructions
5150

51+
To run hadroNIO, **UCX 1.11.0** needs to be installed on your system. See the [OpenUCX GitHub Repository](https://github.com/openucx/ucx) for information on how to build and install UCX.
52+
5253
To accelerate an existing Java application (e.g. `application.jar`), the hadroNIO JAR-file needs to be included in the classpath. Additionally, the property `java.nio.channels.spi.SelectorProvider` must be set to `de.hhu.bsinfo.hadronio.HadronioProvider`:
5354
```shell
5455
java -cp path/to/hadronio-0.1.0-SNAPSHOT-all.jar -Djava.nio.channels.spi.SelectorProvider=de.hhu.bsinfo.hadronio.HadronioProvider -jar application.jar
@@ -126,6 +127,38 @@ The following properties are supported:
126127
- `de.hhu.bsinfo.hadronio.Configuration.FLUSH_INTERVAL_SIZE`: Set the interval in which channels should be flushed (Default: `1024`). Every time, the set amount of messages has been sent, the channel will stop signalling `OP_WRITE`, until it has received an automatic acknowledgment message from the receiving side. This is done to prevent a receiver from being overloaded by too many messages. The default value did work fine in our tests, and there should be no need to alter it.
127128
- `de.hhu.bsinfo.hadronio.Configuration.USE_WORKER_POLL_THREAD`: Use a separate thread to poll the UCX worker (Default: `false`). Enabling this feature should improve throughput at the cost of higher latencies, when using blocking socket channels. It is still *highly experimental* and should not be activated at the moment.
128129

130+
## Include in other projects
131+
132+
It is possible to use hadroNIO in other Gradle projects. The latest releases are available from the GitHub Package Registry.
133+
To include hadroNIO into your project, use the following code in your `build.gradle`:
134+
135+
```
136+
repositories {
137+
maven {
138+
name = "GitHubPackages hadroNIO"
139+
url = "https://maven.pkg.github.com/hhu-bsinfo/hadronio"
140+
credentials {
141+
username = project.findProperty("gpr.user")
142+
password = project.findProperty("gpr.token")
143+
}
144+
}
145+
}
146+
147+
dependencies {
148+
implementation 'de.hhu.bsinfo:hadronio:0.1.0'
149+
}
150+
```
151+
152+
Use a file called `gradle.properties` to set `gpr.user` to your GitHub username and `gpr.token` to a Personal Access Token with `read:packages` enabled. See the [GitHub Docs](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-gradle-registry) for more information on the GitHub Package Registry.
153+
154+
To enable hadroNIO from within your application, use the following code:
155+
156+
```
157+
System.setProperty("java.nio.channels.spi.SelectorProvider", "de.hhu.bsinfo.hadronio.HadronioProvider");
158+
```
159+
160+
The configuration values can be set with similary calls. This way, hadroNIO will be included in your project and properties do not have to be set manually, each time the application is started.
161+
129162
## Architecture
130163

131164
To transparently accelerate existing NIO applications, hadroNIO needs to fully substitute the involved classes, including `SocketChannel`, `ServerSocketChannel`, `Selector` and `SelectionKey`.

api/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ repositories {
1616
}
1717

1818
dependencies {
19-
implementation 'org.agrona:agrona:1.10.0'
20-
implementation 'org.slf4j:slf4j-api:1.7.31'
19+
implementation 'org.agrona:agrona:1.12.0'
20+
implementation 'org.slf4j:slf4j-api:1.7.32'
2121

2222
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.2'
23-
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
23+
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.2'
2424
}
2525

2626
test {

api/src/main/java/de/hhu/bsinfo/hadronio/SendCallback.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package de.hhu.bsinfo.hadronio;
22

33
import de.hhu.bsinfo.hadronio.util.RingBuffer;
4-
import de.hhu.bsinfo.hadronio.util.TagUtil;
54
import org.slf4j.Logger;
65
import org.slf4j.LoggerFactory;
76

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ subprojects {
2121
}
2222

2323
wrapper {
24-
gradleVersion = "6.9"
24+
gradleVersion = "7.2"
2525
}

example/build.gradle

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,8 @@ compileJava {
1212
options.encoding = 'UTF-8'
1313
}
1414

15-
application {
16-
applicationName = 'hadronio'
17-
mainClassName = 'de.hhu.bsinfo.hadronio.Application'
18-
}
15+
application.setApplicationName("hadronio")
16+
application.getMainClass().set("de.hhu.bsinfo.hadronio.Application")
1917

2018
repositories {
2119
mavenCentral()
@@ -28,7 +26,7 @@ dependencies {
2826
implementation 'info.picocli:picocli:4.6.1'
2927

3028
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.2'
31-
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
29+
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.2'
3230
}
3331

3432
test {

example/src/main/java/de/hhu/bsinfo/hadronio/Application.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package de.hhu.bsinfo.hadronio;
22

33
import de.hhu.bsinfo.hadronio.benchmark.Benchmark;
4-
import de.hhu.bsinfo.hadronio.benchmark.throughput.ThroughputBenchmark;
54
import de.hhu.bsinfo.hadronio.counter.CounterDemo;
65
import de.hhu.bsinfo.hadronio.util.InetSocketAddressConverter;
76
import picocli.CommandLine;

example/src/main/java/de/hhu/bsinfo/hadronio/benchmark/Benchmark.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,8 @@
22

33
import de.hhu.bsinfo.hadronio.benchmark.latency.LatencyBenchmark;
44
import de.hhu.bsinfo.hadronio.benchmark.throughput.ThroughputBenchmark;
5-
import de.hhu.bsinfo.hadronio.counter.CounterDemo;
6-
import de.hhu.bsinfo.hadronio.util.InetSocketAddressConverter;
75
import picocli.CommandLine;
86

9-
import java.net.InetSocketAddress;
10-
117
@CommandLine.Command(
128
name = "benchmark",
139
description = "Benchmarks for hadroNIO",

example/src/main/java/de/hhu/bsinfo/hadronio/benchmark/latency/LatencyBenchmark.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import java.nio.channels.Selector;
1515
import java.nio.channels.ServerSocketChannel;
1616
import java.nio.channels.SocketChannel;
17-
import java.nio.charset.StandardCharsets;
1817

1918
@CommandLine.Command(
2019
name = "latency",

0 commit comments

Comments
 (0)