Skip to content

Commit 6bb68f5

Browse files
committed
64-to-32 cleanups
A partial start at resolving the many places where we potentially store 64 bits worth of data in a 32 bit integer
1 parent d73abc9 commit 6bb68f5

File tree

9 files changed

+29
-28
lines changed

9 files changed

+29
-28
lines changed

src/mpid/ch4/include/mpidpre.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ typedef struct MPIDIG_req_async {
161161
MPI_Aint in_data_sz;
162162
MPI_Aint offset;
163163
struct iovec *iov_ptr; /* used with MPIDIG_RECV_IOV */
164-
int iov_num; /* used with MPIDIG_RECV_IOV */
164+
MPI_Aint iov_num; /* used with MPIDIG_RECV_IOV */
165165
struct iovec iov_one; /* used with MPIDIG_RECV_CONTIG */
166166
MPIDIG_recv_data_copy_cb data_copy_cb; /* called in recv_init/recv_type_init for async
167167
* data copying */

src/mpid/ch4/netmod/ofi/ofi_am_events.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ MPL_STATIC_INLINE_PREFIX int do_long_am_recv_iov(struct iovec *iov, MPI_Aint iov
260260
int mpi_errno = MPI_SUCCESS;
261261
MPIDI_OFI_AM_RREQ_HDR(rreq, lmt_type) = MPIDI_OFI_AM_LMT_IOV;
262262
MPI_Aint rem, curr_len;
263-
int num_reads;
263+
MPI_Aint num_reads;
264264

265265
/* set lmt counter */
266266
MPIDI_OFI_AM_RREQ_HDR(rreq, lmt_u.lmt_cntr) = 0;
@@ -363,7 +363,7 @@ MPL_STATIC_INLINE_PREFIX int do_long_am_recv(MPI_Aint in_data_sz, MPIR_Request *
363363
MPIDI_OFI_lmt_msg_payload_t * lmt_msg)
364364
{
365365
int mpi_errno = MPI_SUCCESS;
366-
int num_iov = MPIDIG_get_recv_iov_count(rreq);
366+
MPI_Aint num_iov = MPIDIG_get_recv_iov_count(rreq);
367367
if (num_iov > 1 && in_data_sz / num_iov < MPIR_CVAR_CH4_IOV_DENSITY_MIN) {
368368
/* noncontig data with mostly tiny segments */
369369
mpi_errno = do_long_am_recv_unpack(in_data_sz, rreq, lmt_msg);

src/mpid/ch4/netmod/ofi/ofi_impl.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ int MPIDI_OFI_handle_cq_error(int vci, int nic, ssize_t ret);
8585
"**ofid_"#STR, \
8686
"**ofid_"#STR" %s %s", \
8787
MPIDI_OFI_DEFAULT_NIC_NAME, \
88-
fi_strerror(-_ret)); \
88+
fi_strerror(-(int)_ret)); \
8989
} while (0)
9090

9191
#define MPIDI_OFI_CALL_RETRY(FUNC,vci_,STR) \
@@ -101,7 +101,7 @@ int MPIDI_OFI_handle_cq_error(int vci, int nic, ssize_t ret);
101101
"**ofid_"#STR, \
102102
"**ofid_"#STR" %s %s", \
103103
MPIDI_OFI_DEFAULT_NIC_NAME, \
104-
fi_strerror(-_ret)); \
104+
fi_strerror(-(int)_ret)); \
105105
if (_retry > 0) { \
106106
_retry--; \
107107
MPIR_ERR_CHKANDJUMP(_retry == 0, mpi_errno, MPIX_ERR_EAGAIN, "**eagain"); \
@@ -143,7 +143,7 @@ int MPIDI_OFI_handle_cq_error(int vci, int nic, ssize_t ret);
143143
"**ofid_"#STR, \
144144
"**ofid_"#STR" %s %s", \
145145
MPIDI_OFI_DEFAULT_NIC_NAME, \
146-
fi_strerror(-_ret)); \
146+
fi_strerror(-(int)_ret)); \
147147
mpi_errno = MPIDI_OFI_progress_do_queue(vci_); \
148148
if (mpi_errno != MPI_SUCCESS) \
149149
MPIR_ERR_CHECK(mpi_errno); \
@@ -642,7 +642,8 @@ MPL_STATIC_INLINE_PREFIX bool MPIDI_OFI_has_cq_buffered(int vci)
642642

643643
MPL_STATIC_INLINE_PREFIX int MPIDI_OFI_progress_do_queue(int vci)
644644
{
645-
int mpi_errno = MPI_SUCCESS, ret = 0;
645+
int mpi_errno = MPI_SUCCESS;
646+
ssize_t ret = 0;
646647
struct fi_cq_tagged_entry cq_entry;
647648
MPIR_FUNC_ENTER;
648649

src/mpid/ch4/src/ch4_coll_impl.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ MPL_STATIC_INLINE_PREFIX int MPIDI_Allreduce_intra_composition_delta(const void
748748
MPI_Aint lb, true_extent, extent;
749749
int num_offsets = MPIR_CVAR_ALLREDUCE_LOCAL_COPY_OFFSETS;
750750
int local_copy_rank = MPIR_Comm_rank(comm_ptr->node_comm);
751-
int local_copy_offset = 0;
751+
MPI_Aint local_copy_offset = 0;
752752
int local_copy_group = 0;
753753
int shm_size_per_lead = MPIR_CVAR_ALLREDUCE_SHM_PER_LEADER;
754754

@@ -804,8 +804,8 @@ MPL_STATIC_INLINE_PREFIX int MPIDI_Allreduce_intra_composition_delta(const void
804804
&chunk_size_floor, &chunk_size_ceil);
805805

806806
for (iter = 0; iter < num_chunks; iter++) {
807-
int chunk_count = (iter == 0) ? chunk_size_floor : chunk_size_ceil;
808-
int per_leader_count = chunk_count / num_leads;
807+
MPI_Aint chunk_count = (iter == 0) ? chunk_size_floor : chunk_size_ceil;
808+
MPI_Aint per_leader_count = chunk_count / num_leads;
809809
if (my_leader_rank == (num_leads - 1)) {
810810
/* If chunk_count is not perfectly divisible by num_leaders. The last leader gets the
811811
* leftover count as well */
@@ -853,9 +853,9 @@ MPL_STATIC_INLINE_PREFIX int MPIDI_Allreduce_intra_composition_delta(const void
853853
* from shm_buffer of every leader into shm_buffer of leader 0 */
854854
if (MPIDI_COMM(comm_ptr, intra_node_leads_comm) != NULL) {
855855

856-
int j;
856+
MPI_Aint j;
857857
MPI_Aint cache_tile_size, cache_chunk_count;
858-
int leader_offset = my_leader_rank * (chunk_count / num_leads) * extent;
858+
MPI_Aint leader_offset = my_leader_rank * (chunk_count / num_leads) * extent;
859859
cache_tile_size = MPIR_CVAR_ALLREDUCE_CACHE_PER_LEADER;
860860
MPI_Aint cache_chunk_size_floor = 0, cache_chunk_size_ceil = 0;
861861

@@ -1144,10 +1144,10 @@ MPL_STATIC_INLINE_PREFIX int MPIDI_Reduce_intra_composition_gamma(const void *se
11441144
* the data for ranks sitting on other nodes into a shared memory buffer. Next each rank participates
11451145
* as a leader in inter-node Alltoall */
11461146
MPL_STATIC_INLINE_PREFIX int MPIDI_Alltoall_intra_composition_alpha(const void *sendbuf,
1147-
int sendcount,
1147+
MPI_Aint sendcount,
11481148
MPI_Datatype sendtype,
11491149
void *recvbuf,
1150-
int recvcount,
1150+
MPI_Aint recvcount,
11511151
MPI_Datatype recvtype,
11521152
MPIR_Comm * comm_ptr,
11531153
int coll_attr)
@@ -1343,19 +1343,19 @@ MPL_STATIC_INLINE_PREFIX int MPIDI_Alltoallw_intra_composition_alpha(const void
13431343
}
13441344

13451345
MPL_STATIC_INLINE_PREFIX int MPIDI_Allgather_intra_composition_alpha(const void *sendbuf,
1346-
int sendcount,
1346+
MPI_Aint sendcount,
13471347
MPI_Datatype sendtype,
13481348
void *recvbuf,
1349-
int recvcount,
1349+
MPI_Aint recvcount,
13501350
MPI_Datatype recvtype,
13511351
MPIR_Comm * comm_ptr,
13521352
int coll_attr)
13531353
{
13541354
int mpi_errno = MPI_SUCCESS;
13551355
int node_comm_size = MPIR_Comm_size(comm_ptr->node_comm);
13561356
int my_node_comm_rank = MPIR_Comm_rank(comm_ptr->node_comm);
1357-
MPI_Aint type_size, extent, true_extent, lb;
1358-
int is_contig, offset;
1357+
MPI_Aint type_size, extent, true_extent, lb, offset;
1358+
int is_contig;
13591359

13601360
if (sendcount < 1 && sendbuf != MPI_IN_PLACE)
13611361
goto fn_exit;

src/mpid/ch4/src/ch4_types.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,9 @@ typedef struct MPIDIG_acc_req_msg_t {
165165
int src_rank;
166166
uint64_t win_id;
167167
MPIR_Request *req_ptr;
168-
int origin_count;
168+
MPI_Aint origin_count;
169169
MPI_Datatype origin_datatype;
170-
int target_count;
170+
MPI_Aint target_count;
171171
MPI_Datatype target_datatype;
172172
MPI_Op op;
173173
MPI_Aint target_disp;

src/mpid/ch4/src/ch4_vci.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
vci_src = MPIR_PT2PT_ATTR_SRC_VCI(attr); \
2828
vci_dst = MPIR_PT2PT_ATTR_DST_VCI(attr); \
2929
} else { \
30-
int src_displ = (comm)->stream_comm.multiplex.vci_displs[src_rank]; \
31-
int dst_displ = (comm)->stream_comm.multiplex.vci_displs[dst_rank]; \
30+
MPI_Aint src_displ = (comm)->stream_comm.multiplex.vci_displs[src_rank]; \
31+
MPI_Aint dst_displ = (comm)->stream_comm.multiplex.vci_displs[dst_rank]; \
3232
vci_src = (comm)->stream_comm.multiplex.vci_table[src_displ]; \
3333
vci_dst = (comm)->stream_comm.multiplex.vci_table[dst_displ]; \
3434
} \

src/mpid/ch4/src/mpidig_recv_utils.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ MPL_STATIC_INLINE_PREFIX void MPIDIG_get_recv_buffer(void **p_data, MPI_Aint * p
189189
}
190190

191191
/* Sometime the transport just need info to make algorithm choice */
192-
MPL_STATIC_INLINE_PREFIX int MPIDIG_get_recv_iov_count(MPIR_Request * rreq)
192+
MPL_STATIC_INLINE_PREFIX MPI_Aint MPIDIG_get_recv_iov_count(MPIR_Request * rreq)
193193
{
194194
MPIDIG_rreq_async_t *p = &(MPIDIG_REQUEST(rreq, req->recv_async));
195195
if (p->recv_type == MPIDIG_RECV_DATATYPE) {
@@ -253,12 +253,12 @@ MPL_STATIC_INLINE_PREFIX void MPIDIG_recv_copy(void *in_data, MPIR_Request * rre
253253
} else {
254254
/* noncontig case */
255255
struct iovec *iov = p->iov_ptr;
256-
int iov_len = p->iov_num;
256+
MPI_Aint iov_len = p->iov_num;
257257

258258
int done = 0;
259-
int rem = in_data_sz;
259+
MPI_Aint rem = in_data_sz;
260260
for (int i = 0; i < iov_len && rem > 0; i++) {
261-
int curr_len = MPL_MIN(rem, iov[i].iov_len);
261+
MPI_Aint curr_len = MPL_MIN(rem, iov[i].iov_len);
262262
MPIR_Typerep_copy(iov[i].iov_base, (char *) in_data + done, curr_len,
263263
MPIR_TYPEREP_FLAG_NONE);
264264
rem -= curr_len;

src/mpid/ch4/src/mpidig_rma.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ MPL_STATIC_INLINE_PREFIX int MPIDIG_do_get_accumulate(const void *origin_addr,
497497

498498
MPIR_T_PVAR_TIMER_END(RMA, rma_amhdr_set);
499499

500-
int am_hdr_max_size;
500+
MPI_Aint am_hdr_max_size;
501501
#ifndef MPIDI_CH4_DIRECT_NETMOD
502502
int is_local = MPIDI_rank_is_local(target_rank, win->comm_ptr);
503503
am_hdr_max_size = is_local ? MPIDI_SHM_am_hdr_max_sz() : MPIDI_NM_am_hdr_max_sz();

src/mpid/common/genq/mpidu_genq_shmem_pool.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ static inline int MPIDU_genq_shmem_pool_cell_alloc(MPIDU_genq_shmem_pool_t pool,
4040
MPIR_ERR_CHECK(rc);
4141
}
4242

43-
int idx = block_idx * pool_obj->num_free_queue + free_queue_idx;
43+
unsigned long idx = block_idx * pool_obj->num_free_queue + free_queue_idx;
4444

4545
rc = MPIDU_genq_shmem_queue_dequeue(pool, &pool_obj->free_queues[idx], cell);
4646
MPIR_ERR_CHECK(rc);

0 commit comments

Comments
 (0)