Commit 7ca8cee8 authored by Darius Buntinas's avatar Darius Buntinas
Browse files

[svn-r4707] converted all uses of memcpy to the macro MPIU_Memcpy

parent df67b2e5
......@@ -105,6 +105,14 @@
/* FIXME: ... to do ... */
#include "mpitypedefs.h"
/* This is the default implementation of MPIU_Memcpy. We define this
before including mpidpre.h so that it can be used when a device or
channel can use it if it's overriding MPIU_Memcpy. */
static inline void MPIUI_Memcpy(void * restrict dst, const void * restrict src, size_t len)
{
memcpy(dst, src, len);
}
/* Include definitions from the device which must exist before items in this
file (mpiimpl.h) can be defined. mpidpre.h must be included before any
files that allow the device to override or extend any terms; this includes
......@@ -113,6 +121,20 @@
#include "mpidpre.h"
/* ------------------------------------------------------------------------- */
/* Overriding memcpy:
Devices and channels can override the default implementation of
MPIU_Memcpy by defining the MPIU_Memcpy macro. The implementation
can call MPIUI_Memcpy for the default memcpy implementation.
Note that MPIU_Memcpy and MPIUI_Memcpy return void rather than a
pointer to the destination buffer. This is different from C89
memcpy.
*/
#ifndef MPIU_Memcpy
#define MPIU_Memcpy(dst, src, len) MPIUI_Memcpy(dst, src, len)
#endif
#define memcpy(a, b, c) Error_use_MPIU_Memcpy
#include "mpiimplthread.h"
/* #include "mpiu_monitors.h" */
......
......@@ -443,7 +443,7 @@ rect_queue *q;
q->r = (rect *) realloc( q->r, sizeof( rect ) * q->size * 2 );
/* get a bigger queue */
if (q->tail < q->head) {
memcpy( q->r + q->size, q->r, q->tail * sizeof( rect ) );
MPIU_Memcpy( q->r + q->size, q->r, q->tail * sizeof( rect ) );
/* copy over any data that needs to be moved */
q->tail += q->size;
}
......
......@@ -680,7 +680,7 @@ rect_queue *q;
q->r = (rect *) realloc(q->r, sizeof(rect) * q->size * 2);
if (q->tail < q->head) {
memcpy(q->r + q->size, q->r, q->tail * sizeof(rect));
MPIU_Memcpy(q->r + q->size, q->r, q->tail * sizeof(rect));
q->tail += q->size;
}
......
......@@ -1216,7 +1216,7 @@ int newItem;
fprintf( stderr, "Ran out of memory packing pixels.\n" );
return 1;
} else {
memcpy( tmp, listPtr->list, sizeof(int) * listPtr->size / 2 );
MPIU_Memcpy( tmp, listPtr->list, sizeof(int) * listPtr->size / 2 );
free( listPtr->list );
listPtr->list = tmp;
}
......
......@@ -822,7 +822,7 @@ void CLOG_Buffer_save_cargoevt( CLOG_Buffer_t *buffer,
cargoevt->etype = etype;
if ( bytes )
memcpy( cargoevt->bytes, bytes, sizeof(CLOG_Str_Bytes_t) );
MPIU_Memcpy( cargoevt->bytes, bytes, sizeof(CLOG_Str_Bytes_t) );
blkdata->ptr = cargoevt->end;
}
......@@ -904,7 +904,7 @@ void CLOG_Buffer_save_commevt( CLOG_Buffer_t *buffer,
commevt->icomm = icomm;
commevt->rank = comm_rank;
commevt->wrank = world_rank;
memcpy( commevt->gcomm, guid, CLOG_UUID_SIZE );
MPIU_Memcpy( commevt->gcomm, guid, CLOG_UUID_SIZE );
blkdata->ptr = commevt->end;
}
else if ( buffer->status == CLOG_UNINIT ) {
......
......@@ -448,7 +448,7 @@ void CLOG_Cache_put_rec( CLOG_Cache_t *cache, const CLOG_Rec_Header_t *hdr )
/* Save the CLOG record into the CLOG_BlockData_t */
reclen = CLOG_Rec_size( hdr->rectype );
memcpy( blkdata->ptr, hdr, reclen );
MPIU_Memcpy( blkdata->ptr, hdr, reclen );
blkdata->ptr += reclen;
}
......
......@@ -354,7 +354,7 @@ CLOG_CommSet_add_intercomm( CLOG_CommSet_t *commset,
copy the content of input intracommIDs pointer to a local buffer.
*/
orig_intracommIDs = &intracommIDs_val;
memcpy( orig_intracommIDs, intracommIDs, sizeof(CLOG_CommIDs_t) );
MPIU_Memcpy( orig_intracommIDs, intracommIDs, sizeof(CLOG_CommIDs_t) );
/* Set the next available table entry in CLOG_CommSet_t with intercomm */
intercommIDs = CLOG_CommSet_get_new_IDs( commset, 3 );
......@@ -572,7 +572,7 @@ void CLOG_CommSet_merge( CLOG_CommSet_t *commset )
*/
if ( comm_world_rank == 0 )
memcpy( recv_table, commset->table, recv_table_size );
MPIU_Memcpy( recv_table, commset->table, recv_table_size );
PMPI_Bcast( recv_table, recv_table_size, MPI_CHAR, 0, MPI_COMM_WORLD );
/* Make local_IDs in CLOG_CommSet_t's table[] to globally unique integers */
......@@ -655,11 +655,11 @@ int CLOG_CommSet_write( const CLOG_CommSet_t *commset, int fd,
/* Save the CLOG_CommIDs_t[] in the order the entries were created */
for ( idx = 0; idx < commset->count; idx++ ) {
commIDs = &( commset->table[idx] );
memcpy( ptr, commIDs->global_ID, CLOG_UUID_SIZE );
MPIU_Memcpy( ptr, commIDs->global_ID, CLOG_UUID_SIZE );
ptr += CLOG_UUID_SIZE;
memcpy( ptr, &(commIDs->local_ID), sizeof(CLOG_CommLID_t) );
MPIU_Memcpy( ptr, &(commIDs->local_ID), sizeof(CLOG_CommLID_t) );
ptr += sizeof(CLOG_CommLID_t);
memcpy( ptr, &(commIDs->kind), sizeof(CLOG_int32_t) );
MPIU_Memcpy( ptr, &(commIDs->kind), sizeof(CLOG_int32_t) );
ptr += sizeof(CLOG_int32_t);
}
......
......@@ -282,7 +282,7 @@ void CLOG_Merger_save_rec( CLOG_Merger_t *merger, const CLOG_Rec_Header_t *hdr )
/* CLOG_Rec_print( hdr, stdout ); */
/* Save the CLOG record into the sorted buffer */
reclen = CLOG_Rec_size( hdr->rectype );
memcpy( sorted_blk->ptr, hdr, reclen );
MPIU_Memcpy( sorted_blk->ptr, hdr, reclen );
sorted_blk->ptr += reclen;
}
......
......@@ -82,18 +82,18 @@ void CLOG_Uuid_generate( CLOG_Uuid_t uuid )
PMPI_Get_processor_name( processor_name, &namelen );
ptr = &uuid[0];
memcpy( ptr, &random_number, sizeof(CLOG_int32_t) );
MPIU_Memcpy( ptr, &random_number, sizeof(CLOG_int32_t) );
ptr += sizeof(CLOG_int32_t);
memcpy( ptr, &time, sizeof(double) );
MPIU_Memcpy( ptr, &time, sizeof(double) );
ptr += sizeof(double);
if ( namelen < CLOG_UUID_NAME_SIZE ) {
memcpy( ptr, processor_name, namelen );
MPIU_Memcpy( ptr, processor_name, namelen );
/* pad the rest of uuid with 0 */
ptr += namelen;
memcpy( ptr, CLOG_UUID_NULL_NAME, CLOG_UUID_NAME_SIZE-namelen );
MPIU_Memcpy( ptr, CLOG_UUID_NULL_NAME, CLOG_UUID_NAME_SIZE-namelen );
}
else /* if ( namelen >= CLOG_UUID_NAME_SIZE ) */
memcpy( ptr, processor_name, CLOG_UUID_NAME_SIZE );
MPIU_Memcpy( ptr, processor_name, CLOG_UUID_NAME_SIZE );
}
/*
......@@ -108,11 +108,11 @@ void CLOG_Uuid_sprint( CLOG_Uuid_t uuid, char *str )
char *ptr;
ptr = &uuid[0];
memcpy( &random_number, ptr, sizeof(CLOG_int32_t) );
MPIU_Memcpy( &random_number, ptr, sizeof(CLOG_int32_t) );
ptr += sizeof(CLOG_int32_t);
memcpy( &time, ptr, sizeof(double) );
MPIU_Memcpy( &time, ptr, sizeof(double) );
ptr += sizeof(double);
memcpy( &name, ptr, CLOG_UUID_NAME_SIZE );
MPIU_Memcpy( &name, ptr, CLOG_UUID_NAME_SIZE );
sprintf( str, i32fmt"-%f-%s", random_number, time, name );
}
......@@ -131,7 +131,7 @@ int CLOG_Uuid_compare( const void *obj1, const void *obj2 )
void CLOG_Uuid_copy( const CLOG_Uuid_t src_uuid, CLOG_Uuid_t dest_uuid )
{
memcpy( dest_uuid, src_uuid, CLOG_UUID_SIZE );
MPIU_Memcpy( dest_uuid, src_uuid, CLOG_UUID_SIZE );
}
void CLOG_Uuid_swap_bytes( CLOG_Uuid_t uuid )
......
......@@ -920,7 +920,7 @@ int MPE_Log_pack( MPE_LOG_BYTES bytebuf, int *position,
CLOG_Util_swap_bytes( vptr, sizeof( CLOG_int16_t ) , 1 );
#endif
vptr = (void *)( (char *) vptr + sizeof( CLOG_int16_t ) );
memcpy( vptr, data, count );
MPIU_Memcpy( vptr, data, count );
*position += tot_sz;
return MPE_LOG_OK;
}
......@@ -928,7 +928,7 @@ int MPE_Log_pack( MPE_LOG_BYTES bytebuf, int *position,
case 'h': /* INT2 */
tot_sz = count * 2;
if ( *position + tot_sz <= sizeof( MPE_LOG_BYTES ) ) {
memcpy( vptr, data, tot_sz );
MPIU_Memcpy( vptr, data, tot_sz );
#if !defined( WORDS_BIGENDIAN )
CLOG_Util_swap_bytes( vptr, 2 , count );
#endif
......@@ -941,7 +941,7 @@ int MPE_Log_pack( MPE_LOG_BYTES bytebuf, int *position,
case 'e': /* FLT4 */
tot_sz = count * 4;
if ( *position + tot_sz <= sizeof( MPE_LOG_BYTES ) ) {
memcpy( vptr, data, tot_sz );
MPIU_Memcpy( vptr, data, tot_sz );
#if !defined( WORDS_BIGENDIAN )
CLOG_Util_swap_bytes( vptr, 4, count );
#endif
......@@ -954,7 +954,7 @@ int MPE_Log_pack( MPE_LOG_BYTES bytebuf, int *position,
case 'E': /* FLT8 */
tot_sz = count * 8;
if ( *position + tot_sz <= sizeof( MPE_LOG_BYTES ) ) {
memcpy( vptr, data, tot_sz );
MPIU_Memcpy( vptr, data, tot_sz );
#if !defined( WORDS_BIGENDIAN )
CLOG_Util_swap_bytes( vptr, 8, count );
#endif
......
......@@ -369,7 +369,7 @@ int PMPI_Scatter( void *sendbuf, int sendcnt, MPI_Datatype sendtype,
int root, MPI_Comm comm )
{
if ( sendbuf != recvbuf )
memcpy( recvbuf, sendbuf, sendcnt*sendtype );
MPIU_Memcpy( recvbuf, sendbuf, sendcnt*sendtype );
return MPI_SUCCESS;
}
......@@ -378,7 +378,7 @@ int PMPI_Gather( void *sendbuf, int sendcnt, MPI_Datatype sendtype,
int root, MPI_Comm comm )
{
if ( sendbuf != recvbuf )
memcpy( recvbuf, sendbuf, sendcnt*sendtype );
MPIU_Memcpy( recvbuf, sendbuf, sendcnt*sendtype );
return MPI_SUCCESS;
}
......@@ -386,7 +386,7 @@ int PMPI_Scan( void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
MPI_Op op, MPI_Comm comm )
{
if ( sendbuf != recvbuf )
memcpy( recvbuf, sendbuf, count*datatype );
MPIU_Memcpy( recvbuf, sendbuf, count*datatype );
return MPI_SUCCESS;
}
......@@ -394,6 +394,6 @@ int PMPI_Allreduce( void *sendbuf, void *recvbuf, int count,
MPI_Datatype datatype, MPI_Op op, MPI_Comm comm )
{
if ( sendbuf != recvbuf )
memcpy( recvbuf, sendbuf, count*datatype );
MPIU_Memcpy( recvbuf, sendbuf, count*datatype );
return MPI_SUCCESS;
}
......@@ -612,7 +612,7 @@ int RLOG_GetFileHeader(RLOG_IOStruct *pInput, RLOG_FILE_HEADER *pHeader)
{
if (pInput == NULL)
return -1;
memcpy(pHeader, &pInput->header, sizeof(RLOG_FILE_HEADER));
MPIU_Memcpy(pHeader, &pInput->header, sizeof(RLOG_FILE_HEADER));
return 0;
}
......
......@@ -44,7 +44,7 @@ static RLOG_BOOL PackQuadChar(char *str, int *length, char *base, int *pos, cons
if (*pos + (int)strlen(str) > max)
return RLOG_FALSE;
*length = strlen(str);
memcpy(&base[*pos], str, *length);
MPIU_Memcpy(&base[*pos], str, *length);
*pos += *length;
return RLOG_TRUE;
}
......
......@@ -650,7 +650,7 @@ int TRACE_Get_next_category( const TRACE_file fp,
if ( legend_len > 0 ) {
if ( *legend_pos >= legend_max )
return 21;
memcpy( &(legend_base[ *legend_pos ]), type->legend,
MPIU_Memcpy( &(legend_base[ *legend_pos ]), type->legend,
sizeof( char ) * legend_len );
*num_legend = legend_len;
*legend_pos += *num_legend;
......@@ -664,7 +664,7 @@ int TRACE_Get_next_category( const TRACE_file fp,
if ( label_len > 0 ) {
if ( *label_pos >= label_max )
return 23;
memcpy( &(label_base[ *label_pos ]), type->label,
MPIU_Memcpy( &(label_base[ *label_pos ]), type->label,
sizeof( char ) * label_len );
*num_label = label_len;
*label_pos += *num_label;
......@@ -676,7 +676,7 @@ int TRACE_Get_next_category( const TRACE_file fp,
if ( type->num_methods > 0 ) {
if ( *method_pos >= method_max )
return 25;
memcpy( &(method_base[ *method_pos ]), type->methods,
MPIU_Memcpy( &(method_base[ *method_pos ]), type->methods,
sizeof( int ) * type->num_methods );
*num_methods = type->num_methods;
*method_pos += *num_methods;
......@@ -843,7 +843,7 @@ int TRACE_Get_next_ycoordmap( TRACE_file fp,
if ( *coordmap_pos >= coordmap_max )
return 63;
memcpy( &(coordmap_base[ *coordmap_pos ]), ymap->elems,
MPIU_Memcpy( &(coordmap_base[ *coordmap_pos ]), ymap->elems,
sizeof( int ) * ymap->num_rows * ymap->num_columns );
*coordmap_sz = ymap->num_rows * ymap->num_columns;
*coordmap_pos += *coordmap_sz;
......@@ -853,7 +853,7 @@ int TRACE_Get_next_ycoordmap( TRACE_file fp,
if ( ymap->num_methods > 0 ) {
if ( *method_pos >= method_max )
return 65;
memcpy( &(method_base[ *method_pos ]), ymap->methods,
MPIU_Memcpy( &(method_base[ *method_pos ]), ymap->methods,
sizeof( int ) * ymap->num_methods );
*num_methods = ymap->num_methods;
*method_pos += *num_methods;
......@@ -973,7 +973,7 @@ int TRACE_Peek_next_primitive( const TRACE_file fp,
if ( *num_bytes > 0 ) {
prime->num_info = *num_bytes;
prime->info = (char *) malloc( prime->num_info * sizeof(char) );
memcpy( prime->info, infovals, prime->num_info );
MPIU_Memcpy( prime->info, infovals, prime->num_info );
#if ! defined( WORDS_BIGENDIAN )
bswp_byteswap( 2, sizeof( int ), prime->info );
#endif
......@@ -1015,7 +1015,7 @@ int TRACE_Get_next_primitive( const TRACE_file fp,
if ( prime->num_info > 0 ) {
if ( *byte_pos >= byte_max )
return 31;
memcpy( &(byte_base[ *byte_pos ]), prime->info,
MPIU_Memcpy( &(byte_base[ *byte_pos ]), prime->info,
sizeof( char ) * prime->num_info );
*num_bytes = prime->num_info;
*byte_pos += *num_bytes;
......@@ -1025,7 +1025,7 @@ int TRACE_Get_next_primitive( const TRACE_file fp,
if ( *tcoord_pos >= tcoord_max )
return 33;
memcpy( &(tcoord_base[ *tcoord_pos ]), prime->tcoords,
MPIU_Memcpy( &(tcoord_base[ *tcoord_pos ]), prime->tcoords,
sizeof( double ) * prime->num_tcoords );
*num_tcoords = prime->num_tcoords;
*tcoord_pos += *num_tcoords;
......@@ -1034,7 +1034,7 @@ int TRACE_Get_next_primitive( const TRACE_file fp,
if ( *ycoord_pos >= ycoord_max )
return 35;
memcpy( &(ycoord_base[ *ycoord_pos ]), prime->ycoords,
MPIU_Memcpy( &(ycoord_base[ *ycoord_pos ]), prime->ycoords,
sizeof( int ) * prime->num_ycoords );
*num_ycoords = prime->num_ycoords;
*ycoord_pos += *num_ycoords;
......@@ -1118,7 +1118,7 @@ int TRACE_Peek_next_composite( const TRACE_file fp,
if ( *num_bytes > 0 ) {
cmplx->num_info = *num_bytes;
cmplx->info = (char *) malloc( cmplx->num_info * sizeof(char) );
memcpy( cmplx->info, infovals, cmplx->num_info );
MPIU_Memcpy( cmplx->info, infovals, cmplx->num_info );
#if ! defined( WORDS_BIGENDIAN )
bswp_byteswap( 2, sizeof( int ), cmplx->info );
#endif
......@@ -1163,7 +1163,7 @@ int TRACE_Get_next_composite( const TRACE_file fp,
if ( cmplx->num_info > 0 ) {
if ( *byte_pos >= byte_max )
return 41;
memcpy( &(byte_base[ *byte_pos ]), cmplx->info,
MPIU_Memcpy( &(byte_base[ *byte_pos ]), cmplx->info,
sizeof( char ) * cmplx->num_info );
*num_bytes = cmplx->num_info;
*byte_pos += *num_bytes;
......
......@@ -94,7 +94,7 @@ if (size > 4) record is:
v->len = (sizeof(MPE_Log_VFIELD) / sizeof(int)) + (n-1);\
b->len += v->len;\
v->dtype = MPE_Log_INT;\
memcpy(v->other,i,n*sizeof(int) ); \
MPIU_Memcpy(v->other,i,n*sizeof(int) ); \
MPE_Log_i += v->len; }
#define MPE_Log_ADDSTRING(b,v,str) \
......@@ -105,7 +105,7 @@ if (size > 4) record is:
v->len = (sizeof(MPE_Log_VFIELD) / sizeof(int)) + ln4 - 1;\
b->len += v->len;\
v->dtype = MPE_Log_CHAR;\
memcpy( v->other, str, ln );\
MPIU_Memcpy( v->other, str, ln );\
MPE_Log_i += v->len;}
#define MPE_Log_ZEROTIME(b) { double x=0; MOVEDBL( &b->time, &x); }
......@@ -126,7 +126,7 @@ if (size > 4) record is:
newRecHdr=(MPE_Log_HEADER *)(newLogBlk+1); \
/* go to after the block header */ \
} \
memcpy (newRecHdr, readRecHdr, readRecHdr->len*sizeof(int)); \
MPIU_Memcpy (newRecHdr, readRecHdr, readRecHdr->len*sizeof(int)); \
/* copy record */ \
newLogBlk->size += readRecHdr->len; /* update block length */ \
newRecHdr = (MPE_Log_HEADER*)((int*)newRecHdr+readRecHdr->len); \
......
......@@ -30,7 +30,7 @@ static FILE *debug_file;
#endif
/* need to put doubles at non-aligned locations */
#define MOVEDBL( dest, src ) {memcpy( dest, src, sizeof( double ) );}
#define MOVEDBL( dest, src ) {MPIU_Memcpy( dest, src, sizeof( double ) );}
MPE_Log_BLOCK *MPE_Log_GetBuf (void)
/* get another block of memory (or the first block) */
......
......@@ -147,18 +147,18 @@ static void MPE_Log_Output( inBuffer, outBuffer, mesgtag, srcs, fp, parent )
fflush( debug_file );
#endif
}
memcpy( outBuffer->p, inBuffer->p, recLen*sizeof(int) );
MPIU_Memcpy( outBuffer->p, inBuffer->p, recLen*sizeof(int) );
/* copy data from inBuffer to outBuffer */
outBuffer->p += recLen;
}
else { /* if process 0 */
/* Repack the buffer */
if (recHdr->event != MPE_Log_EVENT_SYNC) {
memcpy( recordBuf, inBuffer->p, sizeof(MPE_Log_HEADER) );
MPIU_Memcpy( recordBuf, inBuffer->p, sizeof(MPE_Log_HEADER) );
/* copy header to temp area */
((MPE_Log_HEADER *)recordBuf)->len--;
/* cut out the procid that was inserted */
memcpy( recordBuf + MPE_Log_HEADERSIZE, inBuffer->p +
MPIU_Memcpy( recordBuf + MPE_Log_HEADERSIZE, inBuffer->p +
MPE_Log_HEADERSIZE + 1,
(recHdr->len - MPE_Log_HEADERSIZE) * sizeof(int) );
/* copy the log entry data to the temp area */
......@@ -291,13 +291,13 @@ fprintf( stderr, "[%d] reloading %d\n", MPE_Log_procid, h->event );
if (readHdr->event <= MAX_HEADER_EVT && readHdr->event >= MIN_HEADER_EVT)
/* Reserved header events have all times set to zero */
MPE_Log_ZEROTIME(readHdr);
memcpy( writePtr, readPtr, sizeof(MPE_Log_HEADER) );
MPIU_Memcpy( writePtr, readPtr, sizeof(MPE_Log_HEADER) );
/* copy header */
((MPE_Log_HEADER *)writePtr)->len = readHdr->len + 1;
/* increase record length by 1 */
writePtr[MPE_Log_HEADERSIZE] = MPE_Log_procid;
/* insert procid */
memcpy( writePtr + MPE_Log_HEADERSIZE + 1, readPtr + MPE_Log_HEADERSIZE,
MPIU_Memcpy( writePtr + MPE_Log_HEADERSIZE + 1, readPtr + MPE_Log_HEADERSIZE,
(readHdr->len - MPE_Log_HEADERSIZE) * sizeof(int) );
/* copy all the fields */
/* Increment the lengths (writePtr includes the procid) */
......
......@@ -184,8 +184,8 @@ int MPER_Err_setmsg();
#define MPI_Errhandler_f2c(errhandler) (MPI_Errhandler)(errhandler)
#endif
#ifndef HAVE_MPI_STATUS_F2C
#define MPI_Status_f2c(f_status,c_status) memcpy(c_status,f_status,sizeof(MPI_Status))
#define MPI_Status_c2f(c_status,f_status) memcpy(f_status,c_status,sizeof(MPI_Status))
#define MPI_Status_f2c(f_status,c_status) MPIU_Memcpy(c_status,f_status,sizeof(MPI_Status))
#define MPI_Status_c2f(c_status,f_status) MPIU_Memcpy(f_status,c_status,sizeof(MPI_Status))
#endif
#ifdef F77_NAME_UPPER
......
......@@ -224,7 +224,7 @@ int MPIR_Localcopy(void *sendbuf, int sendcount, MPI_Datatype sendtype,
if (sendtype_iscontig && recvtype_iscontig)
{
memcpy(((char *) recvbuf + recvtype_true_lb),
MPIU_Memcpy(((char *) recvbuf + recvtype_true_lb),
((char *) sendbuf + sendtype_true_lb),
copy_sz);
}
......
......@@ -507,7 +507,7 @@ int MPIR_Get_contextid( MPID_Comm *comm_ptr, MPIR_Context_id_t *context_id )
if (initialize_context_mask) {
MPIR_Init_contextid();
}
memcpy( local_mask, context_mask, MPIR_MAX_CONTEXT_MASK * sizeof(int) );
MPIU_Memcpy( local_mask, context_mask, MPIR_MAX_CONTEXT_MASK * sizeof(int) );
/* Note that this is the unthreaded version */
MPIU_THREADPRIV_GET;
......@@ -596,7 +596,7 @@ int MPIR_Get_contextid( MPID_Comm *comm_ptr, MPIR_Context_id_t *context_id )
"In in-use, set lowestContextId to %d", lowestContextId );
}
else {
memcpy( local_mask, context_mask, MPIR_MAX_CONTEXT_MASK * sizeof(int) );
MPIU_Memcpy( local_mask, context_mask, MPIR_MAX_CONTEXT_MASK * sizeof(int) );
mask_in_use = 1;
own_mask = 1;
lowestContextId = comm_ptr->context_id;
......
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