Skip to content

Commit

Permalink
Merge pull request openucx#5968 from petro-rudenko/jucx/fix-benchmark…
Browse files Browse the repository at this point in the history
…-test

JUCX: catch exception on ep close.
  • Loading branch information
yosefe authored Nov 30, 2020
2 parents 26555a2 + e6adf53 commit f1dd81a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,7 @@ protected static void createContextAndWorker() {
}

protected static double getBandwithGbits(long nanoTimeDelta, long size) {
double sizeInGigabits = (double)size * 8.0 / 1e9;
double secondsElapsed = nanoTimeDelta / 1e9;
return sizeInGigabits / secondsElapsed;
return (double)size * 8.0 / nanoTimeDelta;
}

protected static void closeResources() throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ public static void main(String[] args) throws Exception {
for (int i = 0; i < numIterations; i++) {
final int iterNum = i;
UcpRequest getRequest = endpoint.getNonBlocking(remoteAddress, remoteKey,
recvMemory.getAddress(), totalSize,
recvMemory.getAddress(), remoteSize,
new UcxCallback() {
long startTime = System.nanoTime();
final long startTime = System.nanoTime();

@Override
public void onSuccess(UcpRequest request) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,14 @@ public static void main(String[] args) throws Exception {
} catch (ConnectException ignored) {
} catch (Exception ex) {
System.err.println(ex.getMessage());
} finally {
}

try {
UcpRequest closeRequest = endpoint.closeNonBlockingForce();
worker.progressRequest(closeRequest);
resources.push(closeRequest);
worker.progressRequest(closeRequest);
} catch (Exception ignored) {
} finally {
closeResources();
}
}
Expand Down
4 changes: 2 additions & 2 deletions contrib/test_jenkins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1320,7 +1320,7 @@ test_jucx() {
-XX:OnError="cat $WORKSPACE/hs_err_${BUILD_NUMBER}_%p.log" \
-cp "bindings/java/resources/:bindings/java/src/main/native/build-java/*" \
org.openucx.jucx.examples.UcxReadBWBenchmarkReceiver \
s=$server_ip p=$JUCX_TEST_PORT &
s=$server_ip p=$JUCX_TEST_PORT t=1000000 &
java_pid=$!

sleep 10
Expand All @@ -1329,7 +1329,7 @@ test_jucx() {
-XX:OnError="cat $WORKSPACE/hs_err_${BUILD_NUMBER}_%p.log" \
-cp "bindings/java/resources/:bindings/java/src/main/native/build-java/*" \
org.openucx.jucx.examples.UcxReadBWBenchmarkSender \
s=$server_ip p=$JUCX_TEST_PORT t=10000000
s=$server_ip p=$JUCX_TEST_PORT t=1000000
wait $java_pid
done

Expand Down

0 comments on commit f1dd81a

Please sign in to comment.