Skip to content

Commit aee88a9

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 6e5a2ad commit aee88a9

File tree

10 files changed

+35
-33
lines changed

10 files changed

+35
-33
lines changed

src/include/mpir_comm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ struct MPIR_Comm {
183183
} single;
184184
struct {
185185
struct MPIR_Stream **local_streams;
186-
MPI_Aint *vci_displs; /* comm size + 1 */
186+
int *vci_displs; /* comm size + 1: an index to vci_table and can only go up to comm_size */
187187
int *vci_table; /* comm size */
188188
} multiplex;
189189
} stream_comm;

src/mpid/ch4/include/mpidpre.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ typedef struct MPIDIG_req_async {
168168
MPI_Aint in_data_sz;
169169
MPI_Aint offset;
170170
struct iovec *iov_ptr; /* used with MPIDIG_RECV_IOV */
171-
int iov_num; /* used with MPIDIG_RECV_IOV */
171+
MPI_Aint iov_num; /* used with MPIDIG_RECV_IOV */
172172
struct iovec iov_one; /* used with MPIDIG_RECV_CONTIG */
173173
MPIDIG_recv_data_copy_cb data_copy_cb; /* called in recv_init/recv_type_init for async
174174
* 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); \
@@ -647,7 +647,8 @@ MPL_STATIC_INLINE_PREFIX bool MPIDI_OFI_has_cq_buffered(int vci)
647647

648648
MPL_STATIC_INLINE_PREFIX int MPIDI_OFI_progress_do_queue(int vci)
649649
{
650-
int mpi_errno = MPI_SUCCESS, ret = 0;
650+
int mpi_errno = MPI_SUCCESS;
651+
ssize_t ret = 0;
651652
struct fi_cq_tagged_entry cq_entry;
652653
MPIR_FUNC_ENTER;
653654

src/mpid/ch4/src/ch4_coll_impl.h

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

@@ -801,8 +801,8 @@ MPL_STATIC_INLINE_PREFIX int MPIDI_Allreduce_intra_composition_delta(const void
801801
&chunk_size_floor, &chunk_size_ceil);
802802

803803
for (iter = 0; iter < num_chunks; iter++) {
804-
int chunk_count = (iter == 0) ? chunk_size_floor : chunk_size_ceil;
805-
int per_leader_count = chunk_count / num_leads;
804+
MPI_Aint chunk_count = (iter == 0) ? chunk_size_floor : chunk_size_ceil;
805+
MPI_Aint per_leader_count = chunk_count / num_leads;
806806
if (my_leader_rank == (num_leads - 1)) {
807807
/* If chunk_count is not perfectly divisible by num_leaders. The last leader gets the
808808
* leftover count as well */
@@ -850,9 +850,9 @@ MPL_STATIC_INLINE_PREFIX int MPIDI_Allreduce_intra_composition_delta(const void
850850
* from shm_buffer of every leader into shm_buffer of leader 0 */
851851
if (MPIDI_COMM(comm_ptr, intra_node_leads_comm) != NULL) {
852852

853-
int j;
853+
MPI_Aint j;
854854
MPI_Aint cache_tile_size, cache_chunk_count;
855-
int leader_offset = my_leader_rank * (chunk_count / num_leads) * extent;
855+
MPI_Aint leader_offset = my_leader_rank * (chunk_count / num_leads) * extent;
856856
cache_tile_size = MPIR_CVAR_ALLREDUCE_CACHE_PER_LEADER;
857857
MPI_Aint cache_chunk_size_floor = 0, cache_chunk_size_ceil = 0;
858858

@@ -1141,10 +1141,10 @@ MPL_STATIC_INLINE_PREFIX int MPIDI_Reduce_intra_composition_gamma(const void *se
11411141
* the data for ranks sitting on other nodes into a shared memory buffer. Next each rank participates
11421142
* as a leader in inter-node Alltoall */
11431143
MPL_STATIC_INLINE_PREFIX int MPIDI_Alltoall_intra_composition_alpha(const void *sendbuf,
1144-
int sendcount,
1144+
MPI_Aint sendcount,
11451145
MPI_Datatype sendtype,
11461146
void *recvbuf,
1147-
int recvcount,
1147+
MPI_Aint recvcount,
11481148
MPI_Datatype recvtype,
11491149
MPIR_Comm * comm_ptr,
11501150
int coll_attr)
@@ -1340,19 +1340,19 @@ MPL_STATIC_INLINE_PREFIX int MPIDI_Alltoallw_intra_composition_alpha(const void
13401340
}
13411341

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

13571357
if (sendcount < 1 && sendbuf != MPI_IN_PLACE)
13581358
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/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_genqi_shmem_types.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ typedef union MPIDU_genq_shmem_queue {
4747
} MPIDU_genq_shmem_queue_u;
4848

4949
typedef struct MPIDU_genqi_shmem_pool {
50-
uintptr_t cell_size;
51-
uintptr_t cell_alloc_size;
52-
uintptr_t cells_per_free_queue;
53-
uintptr_t num_proc;
54-
uintptr_t num_free_queue;
55-
uintptr_t slab_size;
50+
int cell_size;
51+
int cell_alloc_size;
52+
int cells_per_free_queue;
53+
int num_proc;
54+
int num_free_queue;
55+
int slab_size;
5656
int rank;
5757

5858
void *slab;

src/mpl/src/str/mpl_arg_serial.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88

99
int MPL_args_serialize(int argc, char **argv, int *len, void **serialized_buf)
1010
{
11-
int buf_size, offset, tmp;
11+
int buf_size, offset;
12+
size_t tmp;
1213
char *buf;
1314
int i;
1415

0 commit comments

Comments
 (0)