Commit 68f8c7aa authored by Rob Latham's avatar Rob Latham
Browse files

promote more types to larger versions



The ongoing march towards 64-bit clean continues.  Address areas where large
product of two ints might have overflowed.

Ref: #1767
Signed-off-by: Pavan Balaji's avatarPavan Balaji <balaji@anl.gov>
parent 5e67e482
......@@ -2850,7 +2850,7 @@ int MPID_Comm_revoke(MPID_Comm *comm, int is_remote);
Communication
@*/
int MPID_Send( const void *buf, int count, MPI_Datatype datatype,
int MPID_Send( const void *buf, MPI_Aint count, MPI_Datatype datatype,
int dest, int tag, MPID_Comm *comm, int context_offset,
MPID_Request **request );
......@@ -2900,7 +2900,7 @@ int MPID_Rsend( const void *buf, int count, MPI_Datatype datatype,
Communication
@*/
int MPID_Ssend( const void *buf, int count, MPI_Datatype datatype,
int MPID_Ssend( const void *buf, MPI_Aint count, MPI_Datatype datatype,
int dest, int tag, MPID_Comm *comm, int context_offset,
MPID_Request **request );
......@@ -2955,7 +2955,7 @@ int MPID_tBsend( const void *buf, int count, MPI_Datatype datatype,
Communication
@*/
int MPID_Isend( const void *buf, int count, MPI_Datatype datatype,
int MPID_Isend( const void *buf, MPI_Aint count, MPI_Datatype datatype,
int dest, int tag, MPID_Comm *comm, int context_offset,
MPID_Request **request );
......@@ -3015,7 +3015,7 @@ int MPID_Issend( const void *buf, int count, MPI_Datatype datatype,
Communication
@*/
int MPID_Recv( void *buf, int count, MPI_Datatype datatype,
int MPID_Recv( void *buf, MPI_Aint count, MPI_Datatype datatype,
int source, int tag, MPID_Comm *comm, int context_offset,
MPI_Status *status, MPID_Request **request );
......@@ -3035,7 +3035,7 @@ int MPID_Recv( void *buf, int count, MPI_Datatype datatype,
Communication
@*/
int MPID_Irecv( void *buf, int count, MPI_Datatype datatype,
int MPID_Irecv( void *buf, MPI_Aint count, MPI_Datatype datatype,
int source, int tag, MPID_Comm *comm, int context_offset,
MPID_Request **request );
......@@ -3905,20 +3905,20 @@ int MPID_VCR_Get_lpid(MPID_VCR vcr, int * lpid_ptr);
other internal operations. They are wrappers around MPID send/recv
functions. They do sends/receives by setting the context offset to
MPID_CONTEXT_INTRA(INTER)_COLL. */
int MPIR_Localcopy(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype);
int MPIR_Localcopy(const void *sendbuf, MPI_Aint sendcount, MPI_Datatype sendtype,
void *recvbuf, MPI_Aint recvcount, MPI_Datatype recvtype);
int MPIC_Wait(MPID_Request * request_ptr, mpir_errflag_t *errflag);
int MPIC_Probe(int source, int tag, MPI_Comm comm, MPI_Status *status);
/* FT versions of te MPIC_ functions */
int MPIC_Send(const void *buf, int count, MPI_Datatype datatype, int dest, int tag,
int MPIC_Send(const void *buf, MPI_Aint count, MPI_Datatype datatype, int dest, int tag,
MPID_Comm *comm_ptr, mpir_errflag_t *errflag);
int MPIC_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag,
int MPIC_Recv(void *buf, MPI_Aint count, MPI_Datatype datatype, int source, int tag,
MPID_Comm *comm_ptr, MPI_Status *status, mpir_errflag_t *errflag);
int MPIC_Ssend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag,
int MPIC_Ssend(const void *buf, MPI_Aint count, MPI_Datatype datatype, int dest, int tag,
MPID_Comm *comm_ptr, mpir_errflag_t *errflag);
int MPIC_Sendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
int dest, int sendtag, void *recvbuf, int recvcount,
int MPIC_Sendrecv(const void *sendbuf, MPI_Aint sendcount, MPI_Datatype sendtype,
int dest, int sendtag, void *recvbuf, MPI_Aint recvcount,
MPI_Datatype recvtype, int source, int recvtag,
MPID_Comm *comm_ptr, MPI_Status *status, mpir_errflag_t *errflag);
int MPIC_Sendrecv_replace(void *buf, int count, MPI_Datatype datatype,
......@@ -4474,7 +4474,7 @@ int MPIR_Type_indexed_impl(int count, const int blocklens[], const int indices[]
void MPIR_Type_free_impl(MPI_Datatype *datatype);
int MPIR_Type_vector_impl(int count, int blocklength, int stride, MPI_Datatype old_type, MPI_Datatype *newtype_p);
int MPIR_Type_struct_impl(int count, const int blocklens[], const MPI_Aint indices[], const MPI_Datatype old_types[], MPI_Datatype *newtype);
int MPIR_Pack_impl(const void *inbuf, int incount, MPI_Datatype datatype, void *outbuf, MPI_Aint outcount, MPI_Aint *position);
int MPIR_Pack_impl(const void *inbuf, MPI_Aint incount, MPI_Datatype datatype, void *outbuf, MPI_Aint outcount, MPI_Aint *position);
void MPIR_Pack_size_impl(int incount, MPI_Datatype datatype, MPI_Aint *size);
int MPIR_Unpack_impl(const void *inbuf, MPI_Aint insize, MPI_Aint *position,
void *outbuf, int outcount, MPI_Datatype datatype);
......
......@@ -92,10 +92,12 @@ int MPIR_Gather_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
int comm_size, rank;
int mpi_errno = MPI_SUCCESS;
int mpi_errno_ret = MPI_SUCCESS;
int curr_cnt=0, relative_rank, nbytes, is_homogeneous;
int mask, sendtype_size, recvtype_size, src, dst, relative_src;
int relative_rank, is_homogeneous;
int mask, src, dst, relative_src;
MPI_Aint curr_cnt=0, nbytes, sendtype_size, recvtype_size;
int recvblks;
int tmp_buf_size, missing;
int missing;
MPI_Aint tmp_buf_size;
void *tmp_buf=NULL;
MPI_Status status;
MPI_Aint extent=0; /* Datatype extent */
......@@ -230,8 +232,11 @@ int MPIR_Gather_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
}
}
else if (nbytes < MPIR_CVAR_GATHER_VSMALL_MSG_SIZE) {
mpi_errno = MPIC_Recv(tmp_buf, recvblks * nbytes, MPI_BYTE,
src, MPIR_GATHER_TAG, comm_ptr, &status, errflag);
/* small transfer size case. cast ok */
MPIU_Assert(recvblks*nbytes == (int)(recvblks*nbytes));
mpi_errno = MPIC_Recv(tmp_buf, (int)(recvblks * nbytes),
MPI_BYTE, src, MPIR_GATHER_TAG,
comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
......@@ -267,7 +272,7 @@ int MPIR_Gather_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
}
else /* Intermediate nodes store in temporary buffer */
{
int offset;
MPI_Aint offset;
/* Estimate the amount of data that is going to come in */
recvblks = mask;
......@@ -505,7 +510,8 @@ int MPIR_Gather_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
int rank, local_size, remote_size, mpi_errno=MPI_SUCCESS;
int mpi_errno_ret = MPI_SUCCESS;
int i, nbytes, sendtype_size, recvtype_size;
int i;
MPI_Aint nbytes, sendtype_size, recvtype_size;
MPI_Status status;
MPI_Aint extent, true_extent, true_lb = 0;
void *tmp_buf=NULL;
......@@ -825,7 +831,7 @@ int MPI_Gather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
/* catch common aliasing cases */
if (recvbuf != MPI_IN_PLACE && sendtype == recvtype && sendcount == recvcount && sendcount != 0) {
int recvtype_size;
MPI_Aint recvtype_size;
MPID_Datatype_get_size_macro(recvtype, recvtype_size);
MPIR_ERRTEST_ALIAS_COLL(sendbuf, ((char *)recvbuf) + comm_ptr->rank*recvcount*recvtype_size,mpi_errno);
}
......
......@@ -47,8 +47,8 @@ int MPIC_Probe(int source, int tag, MPI_Comm comm, MPI_Status *status)
#define FUNCNAME MPIR_Localcopy
#undef FCNAME
#define FCNAME "MPIR_Localcopy"
int MPIR_Localcopy(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype)
int MPIR_Localcopy(const void *sendbuf, MPI_Aint sendcount, MPI_Datatype sendtype,
void *recvbuf, MPI_Aint recvcount, MPI_Datatype recvtype)
{
int mpi_errno = MPI_SUCCESS;
int sendtype_iscontig, recvtype_iscontig;
......@@ -268,7 +268,7 @@ int MPIC_Wait(MPID_Request * request_ptr, mpir_errflag_t *errflag)
#define FUNCNAME MPIC_Send
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPIC_Send(const void *buf, int count, MPI_Datatype datatype, int dest, int tag,
int MPIC_Send(const void *buf, MPI_Aint count, MPI_Datatype datatype, int dest, int tag,
MPID_Comm *comm_ptr, mpir_errflag_t *errflag)
{
int mpi_errno = MPI_SUCCESS;
......@@ -326,7 +326,7 @@ int MPIC_Send(const void *buf, int count, MPI_Datatype datatype, int dest, int t
#define FUNCNAME MPIC_Recv
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPIC_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag,
int MPIC_Recv(void *buf, MPI_Aint count, MPI_Datatype datatype, int source, int tag,
MPID_Comm *comm_ptr, MPI_Status *status, mpir_errflag_t *errflag)
{
int mpi_errno = MPI_SUCCESS;
......@@ -384,7 +384,7 @@ int MPIC_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag,
#define FUNCNAME MPIC_Ssend
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPIC_Ssend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag,
int MPIC_Ssend(const void *buf, MPI_Aint count, MPI_Datatype datatype, int dest, int tag,
MPID_Comm *comm_ptr, mpir_errflag_t *errflag)
{
int mpi_errno = MPI_SUCCESS;
......@@ -442,8 +442,8 @@ int MPIC_Ssend(const void *buf, int count, MPI_Datatype datatype, int dest, int
#define FUNCNAME MPIC_Sendrecv
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPIC_Sendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
int dest, int sendtag, void *recvbuf, int recvcount,
int MPIC_Sendrecv(const void *sendbuf, MPI_Aint sendcount, MPI_Datatype sendtype,
int dest, int sendtag, void *recvbuf, MPI_Aint recvcount,
MPI_Datatype recvtype, int source, int recvtag,
MPID_Comm *comm_ptr, MPI_Status *status, mpir_errflag_t *errflag)
{
......
......@@ -31,7 +31,7 @@ int MPI_Pack(const void *inbuf, int incount, MPI_Datatype datatype, void *outbuf
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPIR_Pack_impl(const void *inbuf,
int incount,
MPI_Aint incount,
MPI_Datatype datatype,
void *outbuf,
MPI_Aint outsize,
......
......@@ -706,35 +706,35 @@ typedef struct MPIDI_Comm_ops
/* Overriding calls in case of matching-capable interfaces */
int (*recv_posted)(struct MPIDI_VC *vc, struct MPID_Request *req);
int (*send)(struct MPIDI_VC *vc, const void *buf, int count, MPI_Datatype datatype,
int (*send)(struct MPIDI_VC *vc, const void *buf, MPI_Aint count, MPI_Datatype datatype,
int dest, int tag, MPID_Comm *comm, int context_offset,
struct MPID_Request **request);
int (*rsend)(struct MPIDI_VC *vc, const void *buf, int count, MPI_Datatype datatype,
int dest, int tag, MPID_Comm *comm, int context_offset,
int (*rsend)(struct MPIDI_VC *vc, const void *buf, MPI_Aint count, MPI_Datatype datatype,
int dest, int tag, MPID_Comm *comm, MPI_Aint context_offset,
struct MPID_Request **request);
int (*ssend)(struct MPIDI_VC *vc, const void *buf, int count, MPI_Datatype datatype,
int (*ssend)(struct MPIDI_VC *vc, const void *buf, MPI_Aint count, MPI_Datatype datatype,
int dest, int tag, MPID_Comm *comm, int context_offset,
struct MPID_Request **request );
int (*isend)(struct MPIDI_VC *vc, const void *buf, int count, MPI_Datatype datatype,
int (*isend)(struct MPIDI_VC *vc, const void *buf, MPI_Aint count, MPI_Datatype datatype,
int dest, int tag, MPID_Comm *comm, int context_offset,
struct MPID_Request **request );
int (*irsend)(struct MPIDI_VC *vc, const void *buf, int count, MPI_Datatype datatype,
int (*irsend)(struct MPIDI_VC *vc, const void *buf, MPI_Aint count, MPI_Datatype datatype,
int dest, int tag, MPID_Comm *comm, int context_offset,
struct MPID_Request **request );
int (*issend)(struct MPIDI_VC *vc, const void *buf, int count, MPI_Datatype datatype,
int (*issend)(struct MPIDI_VC *vc, const void *buf, MPI_Aint count, MPI_Datatype datatype,
int dest, int tag, MPID_Comm *comm, int context_offset,
struct MPID_Request **request );
int (*send_init)(struct MPIDI_VC *vc, const void *buf, int count, MPI_Datatype datatype,
int (*send_init)(struct MPIDI_VC *vc, const void *buf, MPI_Aint count, MPI_Datatype datatype,
int dest, int tag, MPID_Comm *comm, int context_offset,
struct MPID_Request **request );
int (*bsend_init)(struct MPIDI_VC *vc, const void *buf, int count, MPI_Datatype datatype,
int dest, int tag, MPID_Comm *comm, int context_offset,
struct MPID_Request **request);
int (*rsend_init)(struct MPIDI_VC *vc, const void *buf, int count, MPI_Datatype datatype,
int (*rsend_init)(struct MPIDI_VC *vc, const void *buf, MPI_Aint count, MPI_Datatype datatype,
int dest, int tag, MPID_Comm *comm, int context_offset,
struct MPID_Request **request );
int (*ssend_init)(struct MPIDI_VC *vc, const void *buf, int count, MPI_Datatype datatype,
int (*ssend_init)(struct MPIDI_VC *vc, const void *buf, MPI_Aint count, MPI_Datatype datatype,
int dest, int tag, MPID_Comm *comm, int context_offset,
struct MPID_Request **request );
int (*startall)(struct MPIDI_VC *vc, int count, struct MPID_Request *requests[]);
......@@ -803,7 +803,7 @@ typedef struct MPIDI_VC
/* rendezvous function pointers. Called to send a rendevous
message or when one is matched */
int (* rndvSend_fn)( struct MPID_Request **sreq_p, const void * buf, int count,
int (* rndvSend_fn)( struct MPID_Request **sreq_p, const void * buf, MPI_Aint count,
MPI_Datatype datatype, int dt_contig, MPIDI_msg_sz_t data_sz,
MPI_Aint dt_true_lb, int rank, int tag,
struct MPID_Comm * comm, int context_offset );
......@@ -1082,7 +1082,7 @@ const char * MPIDI_VC_GetStateString(int);
/* Prototypes for internal device routines */
int MPIDI_Isend_self(const void *, int, MPI_Datatype, int, int, MPID_Comm *,
int MPIDI_Isend_self(const void *, MPI_Aint, MPI_Datatype, int, int, MPID_Comm *,
int, int, MPID_Request **);
/*--------------------------
......@@ -1578,7 +1578,7 @@ MPID_Request * MPIDI_CH3U_Recvq_FDU_matchonly(int source, int tag, int context_i
int *foundp);
MPID_Request * MPIDI_CH3U_Recvq_FDU_or_AEP(int source, int tag,
int context_id, MPID_Comm *comm, void *user_buf,
int user_count, MPI_Datatype datatype, int * foundp);
MPI_Aint user_count, MPI_Datatype datatype, int * foundp);
int MPIDI_CH3U_Recvq_DP(MPID_Request * rreq);
MPID_Request * MPIDI_CH3U_Recvq_FDP_or_AEU(MPIDI_Message_match * match,
int * found);
......@@ -1593,9 +1593,9 @@ int MPIDI_CH3U_Request_load_recv_iov(MPID_Request * const rreq);
int MPIDI_CH3U_Request_unpack_uebuf(MPID_Request * rreq);
int MPIDI_CH3U_Request_unpack_srbuf(MPID_Request * rreq);
void MPIDI_CH3U_Buffer_copy(const void * const sbuf, int scount,
void MPIDI_CH3U_Buffer_copy(const void * const sbuf, MPI_Aint scount,
MPI_Datatype sdt, int * smpi_errno,
void * const rbuf, int rcount, MPI_Datatype rdt,
void * const rbuf, MPI_Aint rcount, MPI_Datatype rdt,
MPIDI_msg_sz_t * rdata_sz, int * rmpi_errno);
int MPIDI_CH3U_Post_data_receive(int found, MPID_Request ** rreqp);
int MPIDI_CH3U_Post_data_receive_found(MPID_Request * rreqp);
......@@ -1920,7 +1920,7 @@ int MPIDI_CH3_PktPrint_EagerSyncAck( FILE *fp, MPIDI_CH3_Pkt_t *pkt );
/* Routines to create packets (used in implementing MPI communications */
int MPIDI_CH3_EagerNoncontigSend( MPID_Request **, MPIDI_CH3_Pkt_type_t,
const void *, int,
const void *, MPI_Aint,
MPI_Datatype, MPIDI_msg_sz_t, int, int, MPID_Comm *,
int );
int MPIDI_CH3_EagerContigSend( MPID_Request **, MPIDI_CH3_Pkt_type_t,
......@@ -1948,7 +1948,7 @@ int MPIDI_CH3_SendNoncontig_iov( struct MPIDI_VC *vc, struct MPID_Request *sreq,
/* Routines to ack packets, called in the receive routines when a
message is matched */
int MPIDI_CH3_EagerSyncAck( MPIDI_VC_t *, MPID_Request * );
int MPIDI_CH3_RecvFromSelf( MPID_Request *, void *, int, MPI_Datatype );
int MPIDI_CH3_RecvFromSelf( MPID_Request *, void *, MPI_Aint, MPI_Datatype );
int MPIDI_CH3_RecvRndv( MPIDI_VC_t *, MPID_Request * );
/* Handler routines to continuing after an IOV is processed (assigned to the
......
......@@ -364,7 +364,7 @@ typedef struct MPIDI_Request {
/* user_buf, user_count, and datatype needed to process
rendezvous messages. */
void *user_buf;
int user_count;
MPI_Aint user_count;
MPI_Datatype datatype;
int drop_data;
......
......@@ -33,8 +33,8 @@ Used indirectly by mpid_irecv, mpid_recv (through MPIDI_CH3_RecvFromSelf) and
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
void MPIDI_CH3U_Buffer_copy(
const void * const sbuf, int scount, MPI_Datatype sdt, int * smpi_errno,
void * const rbuf, int rcount, MPI_Datatype rdt, MPIDI_msg_sz_t * rsz,
const void * const sbuf, MPI_Aint scount, MPI_Datatype sdt, int * smpi_errno,
void * const rbuf, MPI_Aint rcount, MPI_Datatype rdt, MPIDI_msg_sz_t * rsz,
int * rmpi_errno)
{
int sdt_contig;
......@@ -226,7 +226,7 @@ void MPIDI_CH3U_Buffer_copy(
* This routine is called by mpid_recv and mpid_irecv when a request
* matches a send-to-self message
*/
int MPIDI_CH3_RecvFromSelf( MPID_Request *rreq, void *buf, int count,
int MPIDI_CH3_RecvFromSelf( MPID_Request *rreq, void *buf, MPI_Aint count,
MPI_Datatype datatype )
{
MPID_Request * const sreq = rreq->partner_request;
......
......@@ -80,7 +80,7 @@ int MPIDI_CH3_SendNoncontig_iov( MPIDI_VC_t *vc, MPID_Request *sreq,
/* MPIDI_CH3_EagerNoncontigSend - Eagerly send noncontiguous data */
int MPIDI_CH3_EagerNoncontigSend( MPID_Request **sreq_p,
MPIDI_CH3_Pkt_type_t reqtype,
const void * buf, int count,
const void * buf, MPI_Aint count,
MPI_Datatype datatype, MPIDI_msg_sz_t data_sz,
int rank,
int tag, MPID_Comm * comm,
......
......@@ -498,7 +498,7 @@ lock_exit:
#define FCNAME MPIDI_QUOTE(FUNCNAME)
MPID_Request * MPIDI_CH3U_Recvq_FDU_or_AEP(int source, int tag,
int context_id, MPID_Comm *comm, void *user_buf,
int user_count, MPI_Datatype datatype, int * foundp)
MPI_Aint user_count, MPI_Datatype datatype, int * foundp)
{
int mpi_errno = MPI_SUCCESS;
int found = FALSE;
......
......@@ -10,7 +10,7 @@
#define FUNCNAME MPID_Irecv
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
int MPID_Irecv(void * buf, int count, MPI_Datatype datatype, int rank, int tag,
int MPID_Irecv(void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int tag,
MPID_Comm * comm, int context_offset,
MPID_Request ** request)
{
......
......@@ -27,7 +27,7 @@
#define FUNCNAME MPID_Isend
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
int MPID_Isend(const void * buf, int count, MPI_Datatype datatype, int rank,
int MPID_Isend(const void * buf, MPI_Aint count, MPI_Datatype datatype, int rank,
int tag, MPID_Comm * comm, int context_offset,
MPID_Request ** request)
{
......
......@@ -10,7 +10,7 @@
#define FUNCNAME MPID_Recv
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
int MPID_Recv(void * buf, int count, MPI_Datatype datatype, int rank, int tag,
int MPID_Recv(void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int tag,
MPID_Comm * comm, int context_offset,
MPI_Status * status, MPID_Request ** request)
{
......
......@@ -15,7 +15,7 @@
#define FUNCNAME MPID_Send
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
int MPID_Send(const void * buf, int count, MPI_Datatype datatype, int rank,
int MPID_Send(const void * buf, MPI_Aint count, MPI_Datatype datatype, int rank,
int tag, MPID_Comm * comm, int context_offset,
MPID_Request ** request)
{
......
......@@ -15,7 +15,7 @@
#define FUNCNAME MPID_Ssend
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
int MPID_Ssend(const void * buf, int count, MPI_Datatype datatype, int rank, int tag, MPID_Comm * comm, int context_offset,
int MPID_Ssend(const void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int tag, MPID_Comm * comm, int context_offset,
MPID_Request ** request)
{
MPIDI_msg_sz_t data_sz;
......
......@@ -16,7 +16,7 @@
#define FUNCNAME MPIDI_Isend_self
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
int MPIDI_Isend_self(const void * buf, int count, MPI_Datatype datatype, int rank, int tag, MPID_Comm * comm, int context_offset,
int MPIDI_Isend_self(const void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int tag, MPID_Comm * comm, int context_offset,
int type, MPID_Request ** request)
{
MPIDI_Message_match match;
......
......@@ -321,7 +321,9 @@ int PREPEND_PREFIX(Segment_blkidx_m2m)(DLOOP_Offset *blocks_p,
struct PREPEND_PREFIX(m2m_params) *paramp = v_paramp;
DLOOP_Handle_get_size_macro(el_type, el_size);
DBG_SEGMENT(printf( "blkidx m2m: elsize = %d, count = %d, blocklen = %d\n", (int)el_size, (int)count, (int)blocklen ));
DBG_SEGMENT( printf("blkidx m2m: elsize = %ld, count = %ld, blocklen = %ld,"
" blocks_left = %ld\n",
el_size, count, blocklen, blocks_left ));
while (blocks_left) {
char *src, *dest;
......@@ -335,11 +337,10 @@ int PREPEND_PREFIX(Segment_blkidx_m2m)(DLOOP_Offset *blocks_p,
rel_off + offsetarray[curblock]);
cbufp = (char*) paramp->userbuf + rel_off + offsetarray[curblock];
/* Type-cast blocklen to a large type for comparison, but once
* we confirm that it is smaller than the blocks_left, we can
* safely type-cast blocks_left to a smaller type */
if ((DLOOP_Offset) blocklen > blocks_left)
blocklen = (DLOOP_Count) blocks_left;
/* there was some casting going on here at one time but now all types
* are promoted ot big values */
if ( blocklen > blocks_left)
blocklen = blocks_left;
if (paramp->direction == DLOOP_M2M_TO_USERBUF) {
src = paramp->streambuf;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment