OpenMPI 0.1.1

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

opal_datatype_checksum.h
1 /* -*- Mode: C; c-basic-offset:4 ; -*- */
2 /*
3 * Copyright (c) 2004-2009 The University of Tennessee and The University
4 * of Tennessee Research Foundation. All rights
5 * reserved.
6 * Copyright (c) 2004-2006 The Regents of the University of California.
7 * All rights reserved.
8 * Copyright (c) 2009 IBM Corporation. All rights reserved.
9 * Copyright (c) 2009 Los Alamos National Security, LLC. All rights
10 * reserved.
11 * Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
12 * $COPYRIGHT$
13 *
14 * Additional copyrights may follow
15 *
16 * $HEADER$
17 */
18
19 #ifndef DATATYPE_CHECKSUM_H_HAS_BEEN_INCLUDED
20 #define DATATYPE_CHECKSUM_H_HAS_BEEN_INCLUDED
21
22
23 #include "opal/datatype/opal_datatype_memcpy.h"
24 #include "opal/util/crc.h"
25
26 #if defined(CHECKSUM)
27
28 #if defined (OPAL_CSUM_DST)
29 #define MEMCPY_CSUM( DST, SRC, BLENGTH, CONVERTOR ) \
30 do { \
31 (CONVERTOR)->checksum += OPAL_CSUM_BCOPY_PARTIAL( (SRC), (DST), (BLENGTH), (BLENGTH), &(CONVERTOR)->csum_ui1, &(CONVERTOR)->csum_ui2 ); \
32 } while (0)
33
34 #else /* if OPAL_CSUM_DST */
35
36 #define MEMCPY_CSUM( DST, SRC, BLENGTH, CONVERTOR ) \
37 do { \
38 (CONVERTOR)->checksum += OPAL_CSUM_BCOPY_PARTIAL( (SRC), (DST), (BLENGTH), (BLENGTH), &(CONVERTOR)->csum_ui1, &(CONVERTOR)->csum_ui2 ); \
39 } while (0)
40 #endif /* if OPAL_CSUM_DST */
41
42 #define COMPUTE_CSUM( SRC, BLENGTH, CONVERTOR ) \
43 do { \
44 (CONVERTOR)->checksum += OPAL_CSUM_PARTIAL( (SRC), (BLENGTH), &(CONVERTOR)->csum_ui1, &(CONVERTOR)->csum_ui2 ); \
45 } while (0)
46
47 #else /* if CHECKSUM */
48
49 #define MEMCPY_CSUM( DST, SRC, BLENGTH, CONVERTOR ) \
50 MEMCPY( (DST), (SRC), (BLENGTH) )
51
52 #define COMPUTE_CSUM( SRC, BLENGTH, CONVERTOR )
53
54 #endif /* if CHECKSUM */
55 #endif /* DATATYPE_CHECKSUM_H_HAS_BEEN_INCLUDED */