1 /* -*- Mode: C; c-basic-offset:4 ; -*- */
2 /*
3 * Copyright (c) 2004-2014 The University of Tennessee and The University
4 * of Tennessee Research Foundation. All rights
5 * reserved.
6 * Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
7 * Copyright (c) 2013 Cisco Systems, Inc. All rights reserved.
8 * Copyright (c) 2017 Research Organization for Information Science
9 * and Technology (RIST). All rights reserved.
10 * $COPYRIGHT$
11 *
12 * Additional copyrights may follow
13 *
14 * $HEADER$
15 */
16 #ifndef OPAL_CONVERTOR_INTERNAL_HAS_BEEN_INCLUDED
17 #define OPAL_CONVERTOR_INTERNAL_HAS_BEEN_INCLUDED
18
19 #include "opal_config.h"
20
21 #include "opal/datatype/opal_convertor.h"
22
23 BEGIN_C_DECLS
24
25 typedef int32_t (*conversion_fct_t)( opal_convertor_t* pConvertor, uint32_t count,
26 const void* from, size_t from_len, ptrdiff_t from_extent,
27 void* to, size_t to_length, ptrdiff_t to_extent,
28 ptrdiff_t *advance );
29
30 typedef struct opal_convertor_master_t {
31 struct opal_convertor_master_t* next;
32 uint32_t remote_arch;
33 uint32_t flags;
34 uint32_t hetero_mask;
35 const size_t remote_sizes[OPAL_DATATYPE_MAX_PREDEFINED];
36 conversion_fct_t* pFunctions; /**< the convertor functions pointer */
37 } opal_convertor_master_t;
38
39 /*
40 * Find or create a new master convertor based on a specific architecture. The master
41 * convertor hold all informations related to a defined architecture, such as the sizes
42 * of the predefined data-types, the conversion functions, ...
43 */
44 opal_convertor_master_t* opal_convertor_find_or_create_master( uint32_t remote_arch );
45
46 /*
47 * Destroy all pending master convertors. This function is usually called when we
48 * shutdown the data-type engine, once all convertors have been destroyed.
49 */
50 void opal_convertor_destroy_masters( void );
51
52
53 #if OPAL_ENABLE_DEBUG
54 extern bool opal_pack_debug;
55 extern bool opal_unpack_debug;
56 #endif /* OPAL_ENABLE_DEBUG */
57
58 END_C_DECLS
59
60 #endif /* OPAL_CONVERTOR_INTERNAL_HAS_BEEN_INCLUDED */