Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "sync" #30

Merged
merged 1 commit into from
Jan 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 15 additions & 38 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
BasedOnStyle: LLVM
AlignEscapedNewlines: DontAlign
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
AlignConsecutiveStructMembers: true
AlignConsecutiveDeclarations: false
AlignConsecutiveMacros: true
AlignAfterOpenBracket: true
AlignOperands: true
Expand All @@ -21,13 +20,13 @@ AlwaysBreakAfterReturnType: None
PenaltyReturnTypeOnItsOwnLine: 100
PenaltyBreakAssignment: 100
PenaltyExcessCharacter: 10
ColumnLimit: 80
ColumnLimit: 85
AlwaysBreakBeforeMultilineStrings: false
BinPackArguments: true
BinPackParameters: true
BreakBeforeBraces: Custom
BraceWrapping:
AfterClass: false
AfterClass: true
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
Expand Down Expand Up @@ -59,36 +58,7 @@ SpaceInEmptyParentheses: false
SpaceBeforeParens: ControlStatementsExceptForEachMacros
SpaceBeforeAssignmentOperators: true
SpaceAfterCStyleCast: false
SortIncludes: false
ForEachMacros: ['FOR_EACH_ENTITY',
'kh_foreach',
'kh_foreach_key',
'kh_foreach_value',
'ucp_unpacked_address_for_each',
'ucs_array_for_each',
'UCS_BITMAP_FOR_EACH_BIT',
'ucs_for_each_bit',
'ucs_for_each_submask',
'ucs_hlist_for_each',
'ucs_hlist_for_each_extract',
'ucs_hlist_for_each_extract_if',
'ucs_list_for_each',
'ucs_list_for_each_safe',
'ucs_memory_type_for_each',
'UCS_PP_FOREACH',
'UCS_PP_FOREACH_SEP',
'ucs_profile_for_each_location',
'ucs_ptr_array_for_each',
'ucs_ptr_array_locked_for_each',
'ucs_queue_for_each',
'ucs_queue_for_each_extract',
'ucs_queue_for_each_safe',
'ucs_timerq_for_each_expired',
'UCT_IB_IFACE_VERBS_FOREACH_RXWQE',
'UCT_RC_VERBS_IFACE_FOREACH_TXWQE',
'UCS_INIT_ONCE',
'UCS_TEST_F',
'UCX_PERF_TEST_FOREACH']
ForEachMacros: ["ucs_for_each_submask"]

# CPP
Standard: Cpp11
Expand All @@ -103,6 +73,7 @@ FixNamespaceComments: true
NamespaceIndentation: None
UseTab: Never
ReflowComments: true
SortIncludes: true
IncludeCategories:
- Regex: '^"'
Priority: 1
Expand All @@ -114,7 +85,13 @@ SpacesInAngles: false
SpacesBeforeTrailingComments: 1
SpaceAfterTemplateKeyword: false
SpacesInContainerLiterals: false
---
# Java
Language: Java
DisableFormat: true

# Issues:
# 1.
# Pointer alignment + declaration alignment:
# long_type_name var;
# void * ptr;
# Instead of:
#void *ptr;

...
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,3 @@ GTAGS
*.swp
compile_commands.json
.idea/
.externalToolBuilders
.classpath
.vscode
1 change: 0 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ SUBDIRS += $(UCG_SUBDIR)
endif

SUBDIRS += \
src/tools/vfs \
src/tools/info \
src/tools/perf \
src/tools/profile \
Expand Down
3 changes: 1 addition & 2 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@

## Current
### Features: TBD
#### UCX Core
- Added ucp_tag_msg_recv_nbx routine.
#### UCX Core TBD
#### UCX Java (API Preview) TBD
### Bugfixes: TBD

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public class UcpConstants {
static long UCP_FEATURE_AMO64;
static long UCP_FEATURE_WAKEUP;
static long UCP_FEATURE_STREAM;
static long UCP_FEATURE_AM;

/**
* UCP worker parameters field mask.
Expand Down
102 changes: 20 additions & 82 deletions bindings/java/src/main/java/org/openucx/jucx/ucp/UcpEndpoint.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@
import java.io.Closeable;
import java.nio.ByteBuffer;

import static org.openucx.jucx.ucs.UcsConstants.MEMORY_TYPE.UCS_MEMORY_TYPE_UNKNOWN;

public class UcpEndpoint extends UcxNativeStruct implements Closeable {
private String paramsString;
private final String paramsString;
// Keep a reference to errorHandler to prevent it from GC and have valid ref
// from JNI error handler.
private UcpEndpointErrorHandler errorHandler;
private final UcpEndpointErrorHandler errorHandler;

@Override
public String toString() {
Expand Down Expand Up @@ -83,15 +81,9 @@ public UcpRequest putNonBlocking(ByteBuffer src, long remoteAddress, UcpRemoteKe
public UcpRequest putNonBlocking(long localAddress, long size,
long remoteAddress, UcpRemoteKey remoteKey,
UcxCallback callback) {
return putNonBlocking(localAddress, size, remoteAddress, remoteKey, callback,
UCS_MEMORY_TYPE_UNKNOWN);
}

public UcpRequest putNonBlocking(long localAddress, long size,
long remoteAddress, UcpRemoteKey remoteKey,
UcxCallback callback, int memoryType) {
return putNonBlockingNative(getNativeId(), localAddress,
size, remoteAddress, remoteKey.getNativeId(), callback, memoryType);
size, remoteAddress, remoteKey.getNativeId(), callback);
}

/**
Expand Down Expand Up @@ -144,16 +136,8 @@ public UcpRequest getNonBlocking(long remoteAddress, UcpRemoteKey remoteKey,
public UcpRequest getNonBlocking(long remoteAddress, UcpRemoteKey remoteKey,
long localAddress, long size, UcxCallback callback) {

return getNonBlocking(remoteAddress, remoteKey, localAddress, size, callback,
UCS_MEMORY_TYPE_UNKNOWN);
}

public UcpRequest getNonBlocking(long remoteAddress, UcpRemoteKey remoteKey,
long localAddress, long size, UcxCallback callback,
int memoryType) {

return getNonBlockingNative(getNativeId(), remoteAddress, remoteKey.getNativeId(),
localAddress, size, callback, memoryType);
localAddress, size, callback);
}

/**
Expand Down Expand Up @@ -208,13 +192,7 @@ public UcpRequest sendTaggedNonBlocking(ByteBuffer sendBuffer, long tag, UcxCall

public UcpRequest sendTaggedNonBlocking(long localAddress, long size,
long tag, UcxCallback callback) {
return sendTaggedNonBlocking(localAddress, size, tag, callback, UCS_MEMORY_TYPE_UNKNOWN);
}

public UcpRequest sendTaggedNonBlocking(long localAddress, long size,
long tag, UcxCallback callback, int memoryType) {
return sendTaggedNonBlockingNative(getNativeId(), localAddress, size, tag, callback,
memoryType);
return sendTaggedNonBlockingNative(getNativeId(), localAddress, size, tag, callback);
}

/**
Expand All @@ -229,17 +207,11 @@ public UcpRequest sendTaggedNonBlocking(ByteBuffer sendBuffer, UcxCallback callb
* Iov version of non blocking send operaation
*/
public UcpRequest sendTaggedNonBlocking(long[] localAddresses, long[] sizes,
long tag, UcxCallback callback, int memoryType) {
long tag, UcxCallback callback) {
UcxParams.checkArraySizes(localAddresses, sizes);

return sendTaggedIovNonBlockingNative(getNativeId(), localAddresses, sizes,
tag, callback, memoryType);
}

public UcpRequest sendTaggedNonBlocking(long[] localAddresses, long[] sizes,
long tag, UcxCallback callback) {

return sendTaggedNonBlocking(localAddresses, sizes, tag, callback, UCS_MEMORY_TYPE_UNKNOWN);
tag, callback);
}

/**
Expand All @@ -250,27 +222,14 @@ public UcpRequest sendTaggedNonBlocking(long[] localAddresses, long[] sizes,
* completion of the send operation.
*/
public UcpRequest sendStreamNonBlocking(long localAddress, long size, UcxCallback callback) {
return sendStreamNonBlocking(localAddress, size, callback, UCS_MEMORY_TYPE_UNKNOWN);
}

public UcpRequest sendStreamNonBlocking(long localAddress, long size, UcxCallback callback,
int memoryType) {
return sendStreamNonBlockingNative(getNativeId(), localAddress, size, callback, memoryType);
return sendStreamNonBlockingNative(getNativeId(), localAddress, size, callback);
}

public UcpRequest sendStreamNonBlocking(long[] localAddresses, long[] sizes,
UcxCallback callback) {
UcxParams.checkArraySizes(localAddresses, sizes);

return sendStreamNonBlocking(localAddresses, sizes, callback, UCS_MEMORY_TYPE_UNKNOWN);
}

public UcpRequest sendStreamNonBlocking(long[] localAddresses, long[] sizes,
UcxCallback callback, int memoryType) {
UcxParams.checkArraySizes(localAddresses, sizes);

return sendStreamIovNonBlockingNative(getNativeId(), localAddresses, sizes, callback,
memoryType);
return sendStreamIovNonBlockingNative(getNativeId(), localAddresses, sizes, callback);
}

public UcpRequest sendStreamNonBlocking(ByteBuffer buffer, UcxCallback callback) {
Expand All @@ -285,30 +244,17 @@ public UcpRequest sendStreamNonBlocking(ByteBuffer buffer, UcxCallback callback)
* the UCP library will invoke the call-back when data is in the receive buffer
* and ready for application access.
*/
public UcpRequest recvStreamNonBlocking(long localAddress, long size, long flags,
UcxCallback callback, int memoryType) {
return recvStreamNonBlockingNative(getNativeId(), localAddress, size, flags, callback,
memoryType);
}

public UcpRequest recvStreamNonBlocking(long localAddress, long size, long flags,
UcxCallback callback) {
return recvStreamNonBlocking(localAddress, size, flags, callback, UCS_MEMORY_TYPE_UNKNOWN);
return recvStreamNonBlockingNative(getNativeId(), localAddress, size, flags, callback);
}

public UcpRequest recvStreamNonBlocking(long[] localAddresses, long[] sizes, long flags,
UcxCallback callback, int memoryType) {
UcxCallback callback) {
UcxParams.checkArraySizes(localAddresses, sizes);

return recvStreamIovNonBlockingNative(getNativeId(), localAddresses, sizes, flags,
callback, memoryType);
}

public UcpRequest recvStreamNonBlocking(long[] localAddresses, long[] sizes, long flags,
UcxCallback callback) {

return recvStreamNonBlocking(localAddresses, sizes, flags, callback,
UCS_MEMORY_TYPE_UNKNOWN);
callback);
}

public UcpRequest recvStreamNonBlocking(ByteBuffer buffer, long flags, UcxCallback callback) {
Expand Down Expand Up @@ -351,53 +297,45 @@ public UcpRequest closeNonBlockingFlush() {

private static native UcpRequest putNonBlockingNative(long enpointId, long localAddress,
long size, long remoteAddr,
long ucpRkeyId, UcxCallback callback,
int memoryType);
long ucpRkeyId, UcxCallback callback);

private static native void putNonBlockingImplicitNative(long enpointId, long localAddress,
long size, long remoteAddr,
long ucpRkeyId);

private static native UcpRequest getNonBlockingNative(long enpointId, long remoteAddress,
long ucpRkeyId, long localAddress,
long size, UcxCallback callback,
int memoryType);
long size, UcxCallback callback);

private static native void getNonBlockingImplicitNative(long enpointId, long remoteAddress,
long ucpRkeyId, long localAddress,
long size);

private static native UcpRequest sendTaggedNonBlockingNative(long enpointId, long localAddress,
long size, long tag,
UcxCallback callback,
int memoryType);
UcxCallback callback);

private static native UcpRequest sendTaggedIovNonBlockingNative(long enpointId,
long[] localAddresses,
long[] sizes, long tag,
UcxCallback callback,
int memoryType);
UcxCallback callback);

private static native UcpRequest sendStreamNonBlockingNative(long enpointId, long localAddress,
long size, UcxCallback callback,
int memoryType);
long size, UcxCallback callback);

private static native UcpRequest sendStreamIovNonBlockingNative(long enpointId,
long[] localAddresses,
long[] sizes,
UcxCallback callback,
int memoryType);
UcxCallback callback);

private static native UcpRequest recvStreamNonBlockingNative(long enpointId, long localAddress,
long size, long flags,
UcxCallback callback,
int memoryType);
UcxCallback callback);

private static native UcpRequest recvStreamIovNonBlockingNative(long enpointId,
long[] localAddresses,
long[] sizes, long flags,
UcxCallback callback,
int memoryType);
UcxCallback callback);

private static native UcpRequest flushNonBlockingNative(long enpointId, UcxCallback callback);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,6 @@ public UcpParams requestTagFeature() {
return this;
}

/**
* Request Active Message support feature.
*/
public UcpParams requestAmFeature() {
this.fieldMask |= UcpConstants.UCP_PARAM_FIELD_FEATURES;
this.features |= UcpConstants.UCP_FEATURE_AM;
return this;
}

/**
* Request remote memory access support.
*/
Expand Down
10 changes: 0 additions & 10 deletions bindings/java/src/main/java/org/openucx/jucx/ucp/UcpRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import org.openucx.jucx.UcxCallback;
import org.openucx.jucx.UcxNativeStruct;
import org.openucx.jucx.ucs.UcsConstants;

import java.io.Closeable;
import java.nio.ByteBuffer;
Expand All @@ -22,8 +21,6 @@ public class UcpRequest extends UcxNativeStruct implements Closeable {

private long senderTag;

private int status = UcsConstants.STATUS.UCS_INPROGRESS;

private UcpRequest(long nativeId) {
setNativeId(nativeId);
}
Expand Down Expand Up @@ -55,13 +52,6 @@ public boolean isCompleted() {
return (getNativeId() == null) || isCompletedNative(getNativeId());
}

/**
* @return status of the current request
*/
public int getStatus() {
return status;
}

/**
* This routine releases the non-blocking request back to the library, regardless
* of its current state. Communications operations associated with this request
Expand Down
Loading