Skip to content

Commit

Permalink
#47 don't close listener after connect, also add the hadronio settings
Browse files Browse the repository at this point in the history
where stream is used during establish connection and tag is used
afterwards
  • Loading branch information
subes committed Mar 4, 2023
1 parent 83e1bb5 commit 13eea99
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,10 @@ public void open() throws IOException {
}
}
//only allow one connection
finalizer.ucpListener.close();
finalizer.ucpListener = null;
if (type.shouldCloseUcpListenerAfterAccept()) {
finalizer.ucpListener.close();
finalizer.ucpListener = null;
}
finalizer.ucpEndpoint = finalizer.ucpWorker
.newEndpoint(newUcpEndpointParams().setConnectionRequest(connRequest.get()));
establishConnection();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,6 @@ UcpRequest establishConnectionRecvNonBlocking(JucxSynchronousChannel channel, lo

void progress(JucxSynchronousChannel channel, UcpRequest request) throws Exception;

boolean shouldCloseUcpListenerAfterAccept();

}
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,62 @@ public void progress(final JucxSynchronousChannel channel, final UcpRequest requ
//somehow tag send/receive does not work without progressRequest blocking loop
channel.getUcpWorker().progressRequest(request);
}
},
HADRONIO {
@Override
public UcpRequest establishConnectionSendNonBlocking(final JucxSynchronousChannel channel, final long address,
final int length, final ErrorUcxCallback callback) {
return STREAM.establishConnectionSendNonBlocking(channel, address, length, callback);
}

@Override
public UcpRequest establishConnectionRecvNonBlocking(final JucxSynchronousChannel channel, final long address,
final int length, final ErrorUcxCallback callback) {
return STREAM.establishConnectionRecvNonBlocking(channel, address, length, callback);
}

@Override
public UcpRequest sendNonBlocking(final JucxSynchronousChannel channel, final long address, final int length,
final ErrorUcxCallback callback) {
return TAG.sendNonBlocking(channel, address, length, callback);
}

@Override
public UcpRequest recvNonBlocking(final JucxSynchronousChannel channel, final long address, final int length,
final ErrorUcxCallback callback) {
return TAG.recvNonBlocking(channel, address, length, callback);
}

@Override
public void configureContextParams(final UcpParams params) {
params.requestWakeupFeature().requestTagFeature().requestStreamFeature().setMtWorkersShared(true);
}

@Override
public void configureWorkerParams(final UcpWorkerParams params) {
params.requestWakeupTagSend().requestWakeupTagRecv();
}

@Override
public void configureMemMapParams(final UcpMemMapParams params) {}

@Override
public void configureEndpointParams(final UcpEndpointParams params) {
params.setPeerErrorHandlingMode();
}

@Override
public void progress(final JucxSynchronousChannel channel, final UcpRequest request) throws Exception {
TAG.progress(channel, request);
}
};

public static final JucxTransportType DEFAULT = STREAM;

@Override
public boolean shouldCloseUcpListenerAfterAccept() {
//Soft-RoCe does not work when closing listener after accepting a client endpoint, the close just hangs
return false;
}

}

0 comments on commit 13eea99

Please sign in to comment.