Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Rob Latham
MPICH-BlueGene
Commits
7ca8cee8
Commit
7ca8cee8
authored
Jun 12, 2009
by
Darius Buntinas
Browse files
[svn-r4707] converted all uses of memcpy to the macro MPIU_Memcpy
parent
df67b2e5
Changes
64
Hide whitespace changes
Inline
Side-by-side
src/include/mpiimpl.h
View file @
7ca8cee8
...
...
@@ -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" */
...
...
src/mpe2/src/graphics/contrib/mandel/pm_genproc.c
View file @
7ca8cee8
...
...
@@ -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
)
{
m
emcpy
(
q
->
r
+
q
->
size
,
q
->
r
,
q
->
tail
*
sizeof
(
rect
)
);
MPIU_M
emcpy
(
q
->
r
+
q
->
size
,
q
->
r
,
q
->
tail
*
sizeof
(
rect
)
);
/* copy over any data that needs to be moved */
q
->
tail
+=
q
->
size
;
}
...
...
src/mpe2/src/graphics/contrib/mandel/pm_genproc_cleanedup.c
View file @
7ca8cee8
...
...
@@ -680,7 +680,7 @@ rect_queue *q;
q
->
r
=
(
rect
*
)
realloc
(
q
->
r
,
sizeof
(
rect
)
*
q
->
size
*
2
);
if
(
q
->
tail
<
q
->
head
)
{
m
emcpy
(
q
->
r
+
q
->
size
,
q
->
r
,
q
->
tail
*
sizeof
(
rect
));
MPIU_M
emcpy
(
q
->
r
+
q
->
size
,
q
->
r
,
q
->
tail
*
sizeof
(
rect
));
q
->
tail
+=
q
->
size
;
}
...
...
src/mpe2/src/graphics/src/mpe_graphics.c
View file @
7ca8cee8
...
...
@@ -1216,7 +1216,7 @@ int newItem;
fprintf
(
stderr
,
"Ran out of memory packing pixels.
\n
"
);
return
1
;
}
else
{
m
emcpy
(
tmp
,
listPtr
->
list
,
sizeof
(
int
)
*
listPtr
->
size
/
2
);
MPIU_M
emcpy
(
tmp
,
listPtr
->
list
,
sizeof
(
int
)
*
listPtr
->
size
/
2
);
free
(
listPtr
->
list
);
listPtr
->
list
=
tmp
;
}
...
...
src/mpe2/src/logging/src/clog_buffer.c
View file @
7ca8cee8
...
...
@@ -822,7 +822,7 @@ void CLOG_Buffer_save_cargoevt( CLOG_Buffer_t *buffer,
cargoevt
->
etype
=
etype
;
if
(
bytes
)
m
emcpy
(
cargoevt
->
bytes
,
bytes
,
sizeof
(
CLOG_Str_Bytes_t
)
);
MPIU_M
emcpy
(
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
;
m
emcpy
(
commevt
->
gcomm
,
guid
,
CLOG_UUID_SIZE
);
MPIU_M
emcpy
(
commevt
->
gcomm
,
guid
,
CLOG_UUID_SIZE
);
blkdata
->
ptr
=
commevt
->
end
;
}
else
if
(
buffer
->
status
==
CLOG_UNINIT
)
{
...
...
src/mpe2/src/logging/src/clog_cache.c
View file @
7ca8cee8
...
...
@@ -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
);
m
emcpy
(
blkdata
->
ptr
,
hdr
,
reclen
);
MPIU_M
emcpy
(
blkdata
->
ptr
,
hdr
,
reclen
);
blkdata
->
ptr
+=
reclen
;
}
...
...
src/mpe2/src/logging/src/clog_commset.c
View file @
7ca8cee8
...
...
@@ -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
;
m
emcpy
(
orig_intracommIDs
,
intracommIDs
,
sizeof
(
CLOG_CommIDs_t
)
);
MPIU_M
emcpy
(
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
)
m
emcpy
(
recv_table
,
commset
->
table
,
recv_table_size
);
MPIU_M
emcpy
(
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
]
);
m
emcpy
(
ptr
,
commIDs
->
global_ID
,
CLOG_UUID_SIZE
);
MPIU_M
emcpy
(
ptr
,
commIDs
->
global_ID
,
CLOG_UUID_SIZE
);
ptr
+=
CLOG_UUID_SIZE
;
m
emcpy
(
ptr
,
&
(
commIDs
->
local_ID
),
sizeof
(
CLOG_CommLID_t
)
);
MPIU_M
emcpy
(
ptr
,
&
(
commIDs
->
local_ID
),
sizeof
(
CLOG_CommLID_t
)
);
ptr
+=
sizeof
(
CLOG_CommLID_t
);
m
emcpy
(
ptr
,
&
(
commIDs
->
kind
),
sizeof
(
CLOG_int32_t
)
);
MPIU_M
emcpy
(
ptr
,
&
(
commIDs
->
kind
),
sizeof
(
CLOG_int32_t
)
);
ptr
+=
sizeof
(
CLOG_int32_t
);
}
...
...
src/mpe2/src/logging/src/clog_merger.c
View file @
7ca8cee8
...
...
@@ -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
);
m
emcpy
(
sorted_blk
->
ptr
,
hdr
,
reclen
);
MPIU_M
emcpy
(
sorted_blk
->
ptr
,
hdr
,
reclen
);
sorted_blk
->
ptr
+=
reclen
;
}
...
...
src/mpe2/src/logging/src/clog_uuid.c
View file @
7ca8cee8
...
...
@@ -82,18 +82,18 @@ void CLOG_Uuid_generate( CLOG_Uuid_t uuid )
PMPI_Get_processor_name
(
processor_name
,
&
namelen
);
ptr
=
&
uuid
[
0
];
m
emcpy
(
ptr
,
&
random_number
,
sizeof
(
CLOG_int32_t
)
);
MPIU_M
emcpy
(
ptr
,
&
random_number
,
sizeof
(
CLOG_int32_t
)
);
ptr
+=
sizeof
(
CLOG_int32_t
);
m
emcpy
(
ptr
,
&
time
,
sizeof
(
double
)
);
MPIU_M
emcpy
(
ptr
,
&
time
,
sizeof
(
double
)
);
ptr
+=
sizeof
(
double
);
if
(
namelen
<
CLOG_UUID_NAME_SIZE
)
{
m
emcpy
(
ptr
,
processor_name
,
namelen
);
MPIU_M
emcpy
(
ptr
,
processor_name
,
namelen
);
/* pad the rest of uuid with 0 */
ptr
+=
namelen
;
m
emcpy
(
ptr
,
CLOG_UUID_NULL_NAME
,
CLOG_UUID_NAME_SIZE
-
namelen
);
MPIU_M
emcpy
(
ptr
,
CLOG_UUID_NULL_NAME
,
CLOG_UUID_NAME_SIZE
-
namelen
);
}
else
/* if ( namelen >= CLOG_UUID_NAME_SIZE ) */
m
emcpy
(
ptr
,
processor_name
,
CLOG_UUID_NAME_SIZE
);
MPIU_M
emcpy
(
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
];
m
emcpy
(
&
random_number
,
ptr
,
sizeof
(
CLOG_int32_t
)
);
MPIU_M
emcpy
(
&
random_number
,
ptr
,
sizeof
(
CLOG_int32_t
)
);
ptr
+=
sizeof
(
CLOG_int32_t
);
m
emcpy
(
&
time
,
ptr
,
sizeof
(
double
)
);
MPIU_M
emcpy
(
&
time
,
ptr
,
sizeof
(
double
)
);
ptr
+=
sizeof
(
double
);
m
emcpy
(
&
name
,
ptr
,
CLOG_UUID_NAME_SIZE
);
MPIU_M
emcpy
(
&
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
)
{
m
emcpy
(
dest_uuid
,
src_uuid
,
CLOG_UUID_SIZE
);
MPIU_M
emcpy
(
dest_uuid
,
src_uuid
,
CLOG_UUID_SIZE
);
}
void
CLOG_Uuid_swap_bytes
(
CLOG_Uuid_t
uuid
)
...
...
src/mpe2/src/logging/src/mpe_log.c
View file @
7ca8cee8
...
...
@@ -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
)
);
m
emcpy
(
vptr
,
data
,
count
);
MPIU_M
emcpy
(
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
)
)
{
m
emcpy
(
vptr
,
data
,
tot_sz
);
MPIU_M
emcpy
(
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
)
)
{
m
emcpy
(
vptr
,
data
,
tot_sz
);
MPIU_M
emcpy
(
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
)
)
{
m
emcpy
(
vptr
,
data
,
tot_sz
);
MPIU_M
emcpy
(
vptr
,
data
,
tot_sz
);
#if !defined( WORDS_BIGENDIAN )
CLOG_Util_swap_bytes
(
vptr
,
8
,
count
);
#endif
...
...
src/mpe2/src/logging/src/mpi_null.c
View file @
7ca8cee8
...
...
@@ -369,7 +369,7 @@ int PMPI_Scatter( void *sendbuf, int sendcnt, MPI_Datatype sendtype,
int
root
,
MPI_Comm
comm
)
{
if
(
sendbuf
!=
recvbuf
)
m
emcpy
(
recvbuf
,
sendbuf
,
sendcnt
*
sendtype
);
MPIU_M
emcpy
(
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
)
m
emcpy
(
recvbuf
,
sendbuf
,
sendcnt
*
sendtype
);
MPIU_M
emcpy
(
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
)
m
emcpy
(
recvbuf
,
sendbuf
,
count
*
datatype
);
MPIU_M
emcpy
(
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
)
m
emcpy
(
recvbuf
,
sendbuf
,
count
*
datatype
);
MPIU_M
emcpy
(
recvbuf
,
sendbuf
,
count
*
datatype
);
return
MPI_SUCCESS
;
}
src/mpe2/src/slog2sdk/trace_rlog/src/rlogutil.c
View file @
7ca8cee8
...
...
@@ -612,7 +612,7 @@ int RLOG_GetFileHeader(RLOG_IOStruct *pInput, RLOG_FILE_HEADER *pHeader)
{
if
(
pInput
==
NULL
)
return
-
1
;
m
emcpy
(
pHeader
,
&
pInput
->
header
,
sizeof
(
RLOG_FILE_HEADER
));
MPIU_M
emcpy
(
pHeader
,
&
pInput
->
header
,
sizeof
(
RLOG_FILE_HEADER
));
return
0
;
}
...
...
src/mpe2/src/slog2sdk/trace_rlog/src/trace_input.c
View file @
7ca8cee8
...
...
@@ -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
);
m
emcpy
(
&
base
[
*
pos
],
str
,
*
length
);
MPIU_M
emcpy
(
&
base
[
*
pos
],
str
,
*
length
);
*
pos
+=
*
length
;
return
RLOG_TRUE
;
}
...
...
src/mpe2/src/slog2sdk/trace_sample/src/trace_impl.c
View file @
7ca8cee8
...
...
@@ -650,7 +650,7 @@ int TRACE_Get_next_category( const TRACE_file fp,
if
(
legend_len
>
0
)
{
if
(
*
legend_pos
>=
legend_max
)
return
21
;
m
emcpy
(
&
(
legend_base
[
*
legend_pos
]),
type
->
legend
,
MPIU_M
emcpy
(
&
(
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
;
m
emcpy
(
&
(
label_base
[
*
label_pos
]),
type
->
label
,
MPIU_M
emcpy
(
&
(
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
;
m
emcpy
(
&
(
method_base
[
*
method_pos
]),
type
->
methods
,
MPIU_M
emcpy
(
&
(
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
;
m
emcpy
(
&
(
coordmap_base
[
*
coordmap_pos
]),
ymap
->
elems
,
MPIU_M
emcpy
(
&
(
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
;
m
emcpy
(
&
(
method_base
[
*
method_pos
]),
ymap
->
methods
,
MPIU_M
emcpy
(
&
(
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
)
);
m
emcpy
(
prime
->
info
,
infovals
,
prime
->
num_info
);
MPIU_M
emcpy
(
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
;
m
emcpy
(
&
(
byte_base
[
*
byte_pos
]),
prime
->
info
,
MPIU_M
emcpy
(
&
(
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
;
m
emcpy
(
&
(
tcoord_base
[
*
tcoord_pos
]),
prime
->
tcoords
,
MPIU_M
emcpy
(
&
(
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
;
m
emcpy
(
&
(
ycoord_base
[
*
ycoord_pos
]),
prime
->
ycoords
,
MPIU_M
emcpy
(
&
(
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
)
);
m
emcpy
(
cmplx
->
info
,
infovals
,
cmplx
->
num_info
);
MPIU_M
emcpy
(
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
;
m
emcpy
(
&
(
byte_base
[
*
byte_pos
]),
cmplx
->
info
,
MPIU_M
emcpy
(
&
(
byte_base
[
*
byte_pos
]),
cmplx
->
info
,
sizeof
(
char
)
*
cmplx
->
num_info
);
*
num_bytes
=
cmplx
->
num_info
;
*
byte_pos
+=
*
num_bytes
;
...
...
src/mpe2/src/unused/include/mpe_log_genproc.h
View file @
7ca8cee8
...
...
@@ -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;\
m
emcpy(v->other,i,n*sizeof(int) ); \
MPIU_M
emcpy(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;\
m
emcpy( v->other, str, ln );\
MPIU_M
emcpy( 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 */
\
} \
m
emcpy (newRecHdr, readRecHdr, readRecHdr->len*sizeof(int)); \
MPIU_M
emcpy (newRecHdr, readRecHdr, readRecHdr->len*sizeof(int)); \
/* copy record */
\
newLogBlk->size += readRecHdr->len;
/* update block length */
\
newRecHdr = (MPE_Log_HEADER*)((int*)newRecHdr+readRecHdr->len); \
...
...
src/mpe2/src/unused/src/mpe_log_genproc.c
View file @
7ca8cee8
...
...
@@ -30,7 +30,7 @@ static FILE *debug_file;
#endif
/* need to put doubles at non-aligned locations */
#define MOVEDBL( dest, src ) {
m
emcpy( dest, src, sizeof( double ) );}
#define MOVEDBL( dest, src ) {
MPIU_M
emcpy( dest, src, sizeof( double ) );}
MPE_Log_BLOCK
*
MPE_Log_GetBuf
(
void
)
/* get another block of memory (or the first block) */
...
...
src/mpe2/src/unused/src/mpe_log_merge.c
View file @
7ca8cee8
...
...
@@ -147,18 +147,18 @@ static void MPE_Log_Output( inBuffer, outBuffer, mesgtag, srcs, fp, parent )
fflush
(
debug_file
);
#endif
}
m
emcpy
(
outBuffer
->
p
,
inBuffer
->
p
,
recLen
*
sizeof
(
int
)
);
MPIU_M
emcpy
(
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
)
{
m
emcpy
(
recordBuf
,
inBuffer
->
p
,
sizeof
(
MPE_Log_HEADER
)
);
MPIU_M
emcpy
(
recordBuf
,
inBuffer
->
p
,
sizeof
(
MPE_Log_HEADER
)
);
/* copy header to temp area */
((
MPE_Log_HEADER
*
)
recordBuf
)
->
len
--
;
/* cut out the procid that was inserted */
m
emcpy
(
recordBuf
+
MPE_Log_HEADERSIZE
,
inBuffer
->
p
+
MPIU_M
emcpy
(
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
);
m
emcpy
(
writePtr
,
readPtr
,
sizeof
(
MPE_Log_HEADER
)
);
MPIU_M
emcpy
(
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 */
m
emcpy
(
writePtr
+
MPE_Log_HEADERSIZE
+
1
,
readPtr
+
MPE_Log_HEADERSIZE
,
MPIU_M
emcpy
(
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) */
...
...
src/mpe2/src/wrappers/src/mpe_proff.c
View file @
7ca8cee8
...
...
@@ -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)
m
emcpy(c_status,f_status,sizeof(MPI_Status))
#define MPI_Status_c2f(c_status,f_status)
m
emcpy(f_status,c_status,sizeof(MPI_Status))
#define MPI_Status_f2c(f_status,c_status)
MPIU_M
emcpy(c_status,f_status,sizeof(MPI_Status))
#define MPI_Status_c2f(c_status,f_status)
MPIU_M
emcpy(f_status,c_status,sizeof(MPI_Status))
#endif
#ifdef F77_NAME_UPPER
...
...
src/mpi/coll/helper_fns.c
View file @
7ca8cee8
...
...
@@ -224,7 +224,7 @@ int MPIR_Localcopy(void *sendbuf, int sendcount, MPI_Datatype sendtype,
if
(
sendtype_iscontig
&&
recvtype_iscontig
)
{
m
emcpy
(((
char
*
)
recvbuf
+
recvtype_true_lb
),
MPIU_M
emcpy
(((
char
*
)
recvbuf
+
recvtype_true_lb
),
((
char
*
)
sendbuf
+
sendtype_true_lb
),
copy_sz
);
}
...
...
src/mpi/comm/commutil.c
View file @
7ca8cee8
...
...
@@ -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
();
}
m
emcpy
(
local_mask
,
context_mask
,
MPIR_MAX_CONTEXT_MASK
*
sizeof
(
int
)
);
MPIU_M
emcpy
(
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
{
m
emcpy
(
local_mask
,
context_mask
,
MPIR_MAX_CONTEXT_MASK
*
sizeof
(
int
)
);
MPIU_M
emcpy
(
local_mask
,
context_mask
,
MPIR_MAX_CONTEXT_MASK
*
sizeof
(
int
)
);
mask_in_use
=
1
;
own_mask
=
1
;
lowestContextId
=
comm_ptr
->
context_id
;
...
...
Prev
1
2
3
4
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment