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

ULFM-2 support and native collectives cleanup #29

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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
9 changes: 3 additions & 6 deletions x10.runtime/src-cpp/x10aux/network.cc
Original file line number Diff line number Diff line change
Expand Up @@ -460,13 +460,10 @@ void *x10aux::coll_enter() {
return fs;
}

void x10aux::coll_handler(void *arg) {
x10::xrx::FinishState* fs = (x10::xrx::FinishState*)arg;
fs->notifyActivityTermination();
}
//used with ULFM, called only when a collective has failed due to a process failure
void x10aux::failed_coll_handler(void *arg) {
void x10aux::coll_handler(void *arg, bool throwDPE) {
x10::xrx::FinishState* fs = (x10::xrx::FinishState*)arg;
if (throwDPE) //triggered only by ULFM when native MPI collectives fail
fs->pushException(x10::lang::DeadPlaceException::_make(x10::lang::String::Lit("[Native] Team contains at least one dead member")));
fs->notifyActivityTermination();
}

Expand Down
4 changes: 1 addition & 3 deletions x10.runtime/src-cpp/x10aux/network.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,10 @@ namespace x10aux {

// teams
void *coll_enter();
void coll_handler(void *arg);
void coll_handler(void *arg, bool throwDPE);
void *coll_enter2(void *arg);
void coll_handler2(x10rt_team t, void *arg);

void failed_coll_handler(void *arg);

void register_place_removed_handler(x10::lang::VoidFun_0_1<x10::lang::Place>* body_fun);
void notify_place_death(unsigned int place);
}
Expand Down
16 changes: 6 additions & 10 deletions x10.runtime/src-java/x10/x10rt/TeamSupport.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,8 @@ public static void nativeScatter(int id, int role, int root, Rail<?> src, int sr
}
}

public static boolean nativeBcast(int id, int role, int root, Rail<?> src, int src_off,
public static void nativeBcast(int id, int role, int root, Rail<?> src, int src_off,
Rail<?> dst, int dst_off, int count) {
boolean success = true;
if (!X10RT.forceSinglePlace) {
int typeCode = getTypeCode(src);
assert getTypeCode(dst) == typeCode : "Incompatible src and dst arrays";
Expand All @@ -153,12 +152,11 @@ public static boolean nativeBcast(int id, int role, int root, Rail<?> src, int s
FinishState fs = ActivityManagement.activityCreationBookkeeping();

try {
success =nativeBcastImpl(id, role, root, srcRaw, src_off, dstRaw, dst_off, count, typeCode, fs);
nativeBcastImpl(id, role, root, srcRaw, src_off, dstRaw, dst_off, count, typeCode, fs);
} catch (UnsatisfiedLinkError e) {
aboutToDie("nativeBcast");
}
}
return success;
}

public static void nativeAllToAll(int id, int role, Rail<?> src, int src_off,
Expand Down Expand Up @@ -199,9 +197,8 @@ public static void nativeReduce(int id, int role, int root, Rail<?> src, int src
}
}

public static boolean nativeAllReduce(int id, int role, Rail<?> src, int src_off,
public static void nativeAllReduce(int id, int role, Rail<?> src, int src_off,
Rail<?> dst, int dst_off, int count, int op) {
boolean success = true;
if (!X10RT.forceSinglePlace) {
int typeCode = getTypeCode(src);
Object srcRaw = typeCode == RED_TYPE_COMPLEX ? copyComplexToNewDouble(src, src_off, count) : src.getBackingArray();
Expand All @@ -212,12 +209,11 @@ public static boolean nativeAllReduce(int id, int role, Rail<?> src, int src_off
FinishState fs = ActivityManagement.activityCreationBookkeeping();

try {
success = nativeAllReduceImpl(id, role, srcRaw, src_off, dstRaw, dst_off, count, op, typeCode, fs);
nativeAllReduceImpl(id, role, srcRaw, src_off, dstRaw, dst_off, count, op, typeCode, fs);
} catch (UnsatisfiedLinkError e) {
aboutToDie("nativeAllReduce");
}
}
return success;
}

public static void nativeIndexOfMax(int id, int role, Rail<?> src,
Expand Down Expand Up @@ -296,7 +292,7 @@ private static native void nativeScatterImpl(int id, int role, int root, Object
Object dstRaw, int dst_off,
int count, int typecode, FinishState fs);

private static native Boolean nativeBcastImpl(int id, int role, int root, Object srcRaw, int src_off,
private static native void nativeBcastImpl(int id, int role, int root, Object srcRaw, int src_off,
Object dstRaw, int dst_off,
int count, int typecode, FinishState fs);

Expand All @@ -308,7 +304,7 @@ private static native void nativeReduceImpl(int id, int role, int root, Object s
Object dstRaw, int dst_off,
int count, int op, int typecode, FinishState fs);

private static native Boolean nativeAllReduceImpl(int id, int role, Object srcRaw, int src_off,
private static native void nativeAllReduceImpl(int id, int role, Object srcRaw, int src_off,
Object dstRaw, int dst_off,
int count, int op, int typecode, FinishState fs);

Expand Down
Loading