Skip to content
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
7 changes: 5 additions & 2 deletions src/realm/gasnetex/gasnetex_internal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3375,14 +3375,17 @@ namespace Realm {
}
}

if(gex_wrapper_handle.gex_ep_bind_segment(ep, segment, 0 /*flags*/) != 0) {
// TODO: destroy the segment and ep we created?
return false;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a warning message here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why, so application can just disable it? Enabling gasnet warnings when debugging this is enough for now I think.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enabling gasnet warnings when debugging this is enough for now I think.

We do not have warnings if bind segment is failed.

}

assert(ep_index == eps.size());
eps.push_back(ep);

assert(ep_index == xmitsrcs.size());
xmitsrcs.push_back(new XmitSrc(this, ep_index));

gex_wrapper_handle.gex_ep_bind_segment(ep, segment, 0 /*flags*/);

uintptr_t base_as_uint = reinterpret_cast<uintptr_t>(base);
segments_by_addr.push_back(
{base_as_uint, base_as_uint + size, ep_index, segment, memtype, memextra});
Expand Down
18 changes: 9 additions & 9 deletions src/realm/gasnetex/gasnetex_wrapper/gasnetex_wrapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -138,19 +138,19 @@ namespace Realm {
static_cast<gex_MK_t>(kind), flags);
}

static void gex_ep_bind_segment(gex_ep_opaque_t ep, gex_segment_opaque_t segment,
gex_flags_t flags)
static int gex_ep_bind_segment(gex_ep_opaque_t ep, gex_segment_opaque_t segment,
gex_flags_t flags)
{
gex_System_SetVerboseErrors(1);
gex_EP_BindSegment(static_cast<gex_EP_t>(ep), static_cast<gex_Segment_t>(segment),
flags);
int rc = gex_EP_BindSegment(static_cast<gex_EP_t>(ep),
static_cast<gex_Segment_t>(segment), flags);
if(rc != GASNET_OK) {
return rc;
}
if(gex_EP_QuerySegment(static_cast<gex_EP_t>(ep)) !=
static_cast<gex_Segment_t>(segment)) {
fprintf(stderr, "failed to bind segment");
fflush(stderr);
abort();
return -1;
}
gex_System_SetVerboseErrors(0);
return 0;
}

static void gex_query_shared_peers(gex_rank_t *num_shared_ranks,
Expand Down
4 changes: 2 additions & 2 deletions src/realm/gasnetex/gasnetex_wrapper/gasnetex_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ typedef struct gex_wrapper_handle_s {
gex_client_opaque_t client, gex_addr_opaque_t address,
uintptr_t length, gex_mk_opaque_t kind, gex_flags_t flags);

void (*gex_ep_bind_segment)(gex_ep_opaque_t ep, gex_segment_opaque_t segment,
gex_flags_t flags);
int (*gex_ep_bind_segment)(gex_ep_opaque_t ep, gex_segment_opaque_t segment,
gex_flags_t flags);

void (*gex_query_shared_peers)(gex_rank_t *num_shared_ranks, gex_rank_t **shared_ranks);

Expand Down
Loading