Skip to content

Commit 8f5234f

Browse files
nitbhatevan-charmworks
authored andcommitted
OFI: Change return type of registerDirectMemory to void (#3467)
This commit fixes the ofi autobuild crashes seen on Stampede2. Previously, registerDirectMemory was defined to return a fid_mr struct pointer but did not return any argument. This caused a mysterious crash with SIGSEGV on Stampede2 with gcc 9.1.0. This commit changes the return type to void, which is the correct return type for that function, and this in turn fixes the crash.
1 parent 208575d commit 8f5234f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/arch/ofi/machine-onesided.C

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
struct fid_mr* registerDirectMemory(void *info, const void *addr, int size) {
1+
void registerDirectMemory(void *info, const void *addr, int size) {
22
CmiOfiRdmaPtr_t *rdmaInfo = (CmiOfiRdmaPtr_t *)info;
33
uint64_t requested_key = 0;
4-
int ret;
4+
int err;
55

66
if(FI_MR_SCALABLE == context.mr_mode) {
77
requested_key = __sync_fetch_and_add(&(context.mr_counter), 1);
88
}
9-
ret = fi_mr_reg(context.domain,
9+
err = fi_mr_reg(context.domain,
1010
addr,
1111
size,
1212
FI_REMOTE_READ | FI_REMOTE_WRITE | FI_READ | FI_WRITE,
@@ -15,7 +15,7 @@ struct fid_mr* registerDirectMemory(void *info, const void *addr, int size) {
1515
0ULL,
1616
&(rdmaInfo->mr),
1717
NULL);
18-
if (ret) {
18+
if (err) {
1919
CmiAbort("registerDirectMemory: fi_mr_reg failed!\n");
2020
}
2121
rdmaInfo->key = fi_mr_key(rdmaInfo->mr);
@@ -320,12 +320,12 @@ void LrtsIssueRput(NcpyOperationInfo *ncpyOpInfo) {
320320
// Method invoked to deregister memory handle
321321
void LrtsDeregisterMem(const void *ptr, void *info, int pe, unsigned short int mode){
322322
CmiOfiRdmaPtr_t *rdmaSrc = (CmiOfiRdmaPtr_t *)info;
323-
int ret;
323+
int err;
324324

325325
if(mode != CMK_BUFFER_NOREG && rdmaSrc->mr) {
326326
// Deregister the buffer
327-
ret = fi_close((struct fid *)rdmaSrc->mr);
328-
if(ret)
327+
err = fi_close((struct fid *)rdmaSrc->mr);
328+
if(err)
329329
CmiAbort("LrtsDeregisterMem: fi_close(mr) failed!\n");
330330
}
331331
}

0 commit comments

Comments
 (0)