Skip to content

Commit eba26b7

Browse files
enable 32-bit build support
1 parent 938635e commit eba26b7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+305
-265
lines changed

include/ofi_atom.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ typedef atomic_long ofi_atomic_int64_t;
7373
#endif
7474

7575
#define OFI_ATOMIC_DEFINE(radix) \
76-
typedef struct { \
77-
ofi_atomic_int##radix##_t val; \
78-
ATOMIC_DEF_INIT; \
79-
} ofi_atomic##radix##_t; \
76+
typedef struct { \
77+
ofi_atomic_int##radix##_t val __attribute__((aligned((radix)/8))); \
78+
ATOMIC_DEF_INIT; \
79+
} ofi_atomic##radix##_t; \
8080
\
8181
static inline \
8282
int##radix##_t ofi_atomic_inc##radix(ofi_atomic##radix##_t *atomic) \

include/ofi_cma.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,14 @@ static inline int cma_copy(struct iovec *local, unsigned long local_cnt,
6464
if (!total)
6565
return FI_SUCCESS;
6666

67-
ofi_consume_iov(local, &local_cnt, (size_t) ret);
68-
ofi_consume_iov(remote, &remote_cnt, (size_t) ret);
67+
size_t local_size = local_cnt;
68+
size_t remote_size = remote_cnt;
69+
70+
ofi_consume_iov(local, &local_size, (size_t)ret);
71+
ofi_consume_iov(remote, &remote_size, (size_t)ret);
72+
73+
local_cnt = local_size;
74+
remote_cnt = remote_size;
6975
}
7076
}
7177

include/ofi_mem.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,9 +278,9 @@ static inline void smr_freestack_init(struct smr_freestack *fs, size_t elem_coun
278278
fs->entry_base_offset =
279279
((char*) &fs->entry_next[0] - (char*) fs) +
280280
fs->size * sizeof(fs->top);
281-
next_aligned_addr = ofi_get_aligned_size((( (uint64_t) fs) +
281+
next_aligned_addr = ofi_get_aligned_size((( (uintptr_t) fs) +
282282
fs->entry_base_offset), SMR_ALIGN_BOUNDARY);
283-
fs->entry_base_offset = next_aligned_addr - ((uint64_t) fs);
283+
fs->entry_base_offset = next_aligned_addr - ((uintptr_t) fs);
284284
for (i = elem_count - 1; i >= 0; i--)
285285
smr_freestack_push_by_index(fs, i);
286286
}

include/ofi_mr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ void ofi_mr_get_iov_from_dmabuf(struct iovec *iov,
346346

347347
for (i = 0; i < count; i++) {
348348
iov[i].iov_base = (void *) (
349-
(uintptr_t) dmabuf[i].base_addr + dmabuf[i].offset);
349+
(char *) dmabuf[i].base_addr + dmabuf[i].offset);
350350
iov[i].iov_len = dmabuf[i].len;
351351
}
352352
}

prov/hook/hook_hmem/src/hook_hmem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ static int hook_hmem_add_region(struct hook_hmem_domain *domain,
8181
attr.access = FI_SEND | FI_RECV | FI_READ | FI_WRITE |
8282
FI_REMOTE_READ | FI_REMOTE_WRITE;
8383
attr.offset = 0;
84-
attr.requested_key = (uint64_t) *hmem_desc;
84+
attr.requested_key = (uintptr_t) *hmem_desc;
8585
attr.iface = iface;
8686
attr.device.reserved = device;
8787

prov/hook/trace/src/hook_trace.c

Lines changed: 37 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include "ofi_prov.h"
3434
#include "ofi_iov.h"
3535
#include <config.h>
36+
#include <inttypes.h>
3637

3738
#include <rdma/fi_profile.h>
3839
struct hook_trace_ep {
@@ -205,7 +206,7 @@ static void hook_trace_prof_init(void *context)
205206
if (!(ret)) { \
206207
if ((flags)) \
207208
FI_TRACE((fabric)->hprov, FI_LOG_EP_CTRL, \
208-
"ep/pep %p flags 0x%lx\n", \
209+
"ep/pep %p flags 0x%" PRIx64 "\n", \
209210
(void *)(ep), (uint64_t)(flags)); \
210211
else \
211212
FI_TRACE((fabric)->hprov, FI_LOG_EP_CTRL, \
@@ -221,35 +222,36 @@ static void hook_trace_prof_init(void *context)
221222
#define TRACE_EP_MSG(ret, ep, buf, len, addr, data, flags, context) \
222223
if (!(ret)) { \
223224
FI_TRACE((ep)->domain->fabric->hprov, FI_LOG_EP_DATA, \
224-
"buf %p len %zu addr %zu data %lu " \
225-
"flags 0x%zx ctx %p\n", \
226-
buf, len, addr, (uint64_t)data, \
227-
(uint64_t)flags, context); \
225+
"buf %p len %zu addr %" PRIuPTR " data 0x%" PRIx64 " " \
226+
"flags 0x%" PRIxPTR " ctx %p\n", \
227+
(void *)(buf), (size_t)(len), (uintptr_t)(addr), (uint64_t)(data), \
228+
(uintptr_t)flags, (void *)(context)); \
228229
}
229230

230231
#define TRACE_EP_RMA(ret, ep, buf, len, addr, raddr, data, flags, key, context) \
231232
if (!(ret)) { \
232233
FI_TRACE((ep)->domain->fabric->hprov, FI_LOG_EP_DATA, \
233-
"buf %p len %zu addr %zu raddr %lu data %lu " \
234-
"flags 0x%zx key 0x%zx ctx %p\n", \
235-
buf, len, addr, (uint64_t)raddr, (uint64_t)data, \
236-
(uint64_t)flags, (uint64_t)key, context); \
234+
"buf %p len %zu addr %" PRIuPTR " raddr %" PRIu64 " data %" PRIu64 " " \
235+
"flags 0x%" PRIxPTR " key 0x%" PRIxPTR " ctx %p\n", \
236+
(void *)(buf), (size_t)(len), (uintptr_t)(addr), (uint64_t)(raddr), \
237+
(uint64_t)(data), (uintptr_t)(flags), (uintptr_t)(key), (void *)(context)); \
237238
}
238239

239240
#define TRACE_EP_TAGGED(ret, ep, buf, len, addr, data, flags, tag, ignore, context) \
240241
if (!(ret)) { \
241242
FI_TRACE((ep)->domain->fabric->hprov, FI_LOG_EP_DATA, \
242-
"buf %p len %zu addr %zu data %lu " \
243-
"flags 0x%zx tag 0x%lx ignore 0x%zx ctx %p\n", \
244-
buf, len, addr, (uint64_t)data, (uint64_t)flags, \
245-
(uint64_t)tag, (uint64_t)ignore, context); \
243+
"buf %p len %zu addr %" PRIuPTR " data %" PRIu64 " " \
244+
"flags 0x%" PRIxPTR " tag 0x%" PRIxPTR " ignore 0x%" PRIxPTR " ctx %p\n", \
245+
(void *)(buf), (size_t)(len), (uintptr_t)(addr), (uint64_t)(data), \
246+
(uintptr_t)(flags), (uintptr_t)tag, (uintptr_t)ignore, (void *)(context)); \
246247
}
247248

248249
#define TRACE_MR_ATTR(ret, buf, size, dom, mr, len, flags, attr) \
249250
if (!(ret)) { \
250-
FI_TRACE(dom->fabric->hprov, FI_LOG_DOMAIN, \
251-
"mr %p len %lu flags 0x%lx\n%s", mr, (len), (flags), \
252-
fi_tostr_r(buf, size, (void *)attr, FI_TYPE_MR_ATTR)); \
251+
FI_TRACE(dom->fabric->hprov, FI_LOG_DOMAIN, \
252+
"mr %p len %zu flags 0x%" PRIx64 "\n%s", (void *)(mr), (size_t)(len), \
253+
(uint64_t)(flags), fi_tostr_r(buf, size, (void *)attr, \
254+
FI_TYPE_MR_ATTR)); \
253255
}
254256

255257
#define TRACE_ENDPOINT(buf, len, dom, name, ep, context, info) \
@@ -300,12 +302,12 @@ trace_cq_msg_entry(const struct fi_provider *prov, const char *func,
300302
for (i = 0; i < count; i++) {
301303
if (entry[i].flags & FI_RECV) {
302304
fi_log(prov, FI_LOG_TRACE, FI_LOG_CQ, func, line,
303-
"ctx %p flags 0x%lx len %zu\n",
304-
entry[i].op_context, entry[i].flags, entry[i].len);
305+
"ctx %p flags 0x%" PRIx64 " len %zu\n",
306+
entry[i].op_context, (uint64_t)entry[i].flags, entry[i].len);
305307
} else {
306308
fi_log(prov, FI_LOG_TRACE, FI_LOG_CQ, func, line,
307-
"ctx %p flags 0x%lx\n",
308-
entry[i].op_context, entry[i].flags);
309+
"ctx %p flags 0x%" PRIx64 "\n",
310+
entry[i].op_context, (uint64_t)entry[i].flags);
309311
}
310312
}
311313
}
@@ -320,14 +322,14 @@ trace_cq_data_entry(const struct fi_provider *prov, const char *func,
320322
for (i = 0; i < count; i++) {
321323
if (entry[i].flags & FI_RECV) {
322324
fi_log(prov, FI_LOG_TRACE, FI_LOG_CQ, func, line,
323-
"ctx %p flags 0x%lx len %zu buf %p, data %lu\n",
324-
entry[i].op_context, entry[i].flags,
325+
"ctx %p flags 0x%" PRIx64 " len %zu buf %p, data %" PRIu64 "\n",
326+
entry[i].op_context, (uint64_t)entry[i].flags,
325327
entry[i].len, entry[i].buf,
326-
(entry[i].flags & FI_REMOTE_CQ_DATA) ? entry[i].data : 0);
328+
(entry[i].flags & FI_REMOTE_CQ_DATA) ? (uint64_t)entry[i].data : 0);
327329
} else {
328330
fi_log(prov, FI_LOG_TRACE, FI_LOG_CQ, func, line,
329-
"ctx %p flags 0x%lx\n",
330-
entry[i].op_context, entry[i].flags);
331+
"ctx %p flags 0x%" PRIx64 "\n",
332+
entry[i].op_context, (uint64_t)entry[i].flags);
331333
}
332334
}
333335
}
@@ -342,15 +344,15 @@ trace_cq_tagged_entry(const struct fi_provider *prov, const char *func,
342344
for (i = 0; i < count; i++) {
343345
if (entry[i].flags & FI_RECV) {
344346
fi_log(prov, FI_LOG_TRACE, FI_LOG_CQ, func, line,
345-
"ctx %p flags 0x%lx len %zu buf %p, data %lu tag 0x%lx\n",
346-
entry[i].op_context, entry[i].flags,
347+
"ctx %p flags 0x%" PRIx64 " len %zu buf %p, data %" PRIu64 " tag 0x%" PRIx64 "\n",
348+
entry[i].op_context, (uint64_t)entry[i].flags,
347349
entry[i].len, entry[i].buf,
348-
(entry[i].flags & FI_REMOTE_CQ_DATA) ? entry[i].data : 0,
349-
entry[i].tag);
350+
(uint64_t)(entry[i].flags & FI_REMOTE_CQ_DATA) ? entry[i].data : 0,
351+
(uint64_t)entry[i].tag);
350352
} else {
351353
fi_log(prov, FI_LOG_TRACE, FI_LOG_CQ, func, line,
352-
"ctx %p flags 0x%lx\n",
353-
entry[i].op_context, entry[i].flags);
354+
"ctx %p flags 0x%" PRIx64 "\n",
355+
entry[i].op_context, (uint64_t)entry[i].flags);
354356
}
355357
}
356358
}
@@ -387,16 +389,16 @@ trace_cq_err(struct hook_cq *cq, const char *func, int line,
387389
if (entry->flags & FI_RECV) {
388390
fi_log(cq->domain->fabric->hprov, FI_LOG_TRACE, FI_LOG_CQ,
389391
func, line,
390-
"ctx %p flags 0x%lx, len %zu buf %p data %lu tag 0x%lx "
392+
"ctx %p flags 0x%" PRIx64 ", len %zu buf %p data 0x%" PRIx64 " tag 0x%" PRIx64 " "
391393
"olen %zu err %d (%s) prov_errno %d (%s)\n",
392-
entry->op_context, entry->flags, entry->len, entry->buf,
393-
entry->data, entry->tag, entry->olen,
394+
entry->op_context, (uint64_t)entry->flags, entry->len, entry->buf,
395+
(uint64_t)entry->data, (uint64_t)entry->tag, entry->olen,
394396
entry->err, fi_strerror(entry->err),
395397
entry->prov_errno, err_buf);
396398
} else {
397399
fi_log(cq->domain->fabric->hprov, FI_LOG_TRACE, FI_LOG_CQ,
398400
func, line,
399-
"ctx %p flags 0x%lx, data %lu tag 0x%lx "
401+
"ctx %p flags 0x%" PRIx64 ", data %" PRIu64 " tag 0x%" PRIx64 " "
400402
"olen %zu err %d (%s) prov_errno %d (%s)\n",
401403
entry->op_context, entry->flags,
402404
entry->data, entry->tag, entry->olen,

prov/lnx/include/lnx.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ int lnx_create_mr(const struct iovec *iov, fi_addr_t addr,
358358

359359
rc = ofi_mr_cache_search(&lnx_dom->ld_mr_cache, &info, mre);
360360
if (rc) {
361-
ofi_hmem_dev_unregister(attr.iface, (uint64_t)attr.hmem_data);
361+
ofi_hmem_dev_unregister(attr.iface, (uintptr_t)attr.hmem_data);
362362
return rc;
363363
}
364364

prov/lnx/src/lnx_av.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ lnx_av_lookup_addr(struct lnx_peer_table *peer_tbl, fi_addr_t addr)
7474

7575
if (!entry)
7676
FI_WARN(&lnx_prov, FI_LOG_CORE,
77-
"Invalid fi_addr %#lx\n", addr);
77+
"Invalid fi_addr %#" PRIx64 "\n", addr);
7878

7979
return entry;
8080
}

prov/lnx/src/lnx_domain.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ static void lnx_addr_del_region(struct ofi_mr_cache *cache,
497497
{
498498
struct ofi_mr *mr = (struct ofi_mr *)entry->data;
499499

500-
ofi_hmem_dev_unregister(mr->iface, (uint64_t) mr->hmem_data);
500+
ofi_hmem_dev_unregister(mr->iface, (uintptr_t) mr->hmem_data);
501501
}
502502

503503
/*

prov/lnx/src/lnx_ep.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,7 @@ static void lnx_close_ep_ctx(struct local_prov_ep *ep, size_t fclass)
901901
rc = fi_close(&ep_ctx[i]->fid);
902902
if (rc)
903903
FI_WARN(&lnx_prov, FI_LOG_CORE,
904-
"Failed to close ep context %lu with %d\n",
904+
"Failed to close ep context %zu with %d\n",
905905
fclass, rc);
906906
}
907907
}

0 commit comments

Comments
 (0)