|
| 1 | +/* |
| 2 | + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana |
| 3 | + * University Research and Technology |
| 4 | + * Corporation. All rights reserved. |
| 5 | + * Copyright (c) 2004-2005 The University of Tennessee and The University |
| 6 | + * of Tennessee Research Foundation. All rights |
| 7 | + * reserved. |
| 8 | + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, |
| 9 | + * University of Stuttgart. All rights reserved. |
| 10 | + * Copyright (c) 2004-2005 The Regents of the University of California. |
| 11 | + * All rights reserved. |
| 12 | + * Copyright (c) 2018 Research Organization for Information Science |
| 13 | + * and Technology (RIST). All rights reserved. |
| 14 | + * $COPYRIGHT$ |
| 15 | + * |
| 16 | + * Additional copyrights may follow |
| 17 | + * |
| 18 | + * $HEADER$ |
| 19 | + */ |
| 20 | + |
| 21 | + |
| 22 | +#include "ompi_config.h" |
| 23 | + |
| 24 | +#include "ompi/mpi/c/bindings.h" |
| 25 | +#include "ompi/mpi/c/abi.h" |
| 26 | +#include "ompi/mpi/c/abi_converters.h" |
| 27 | + |
| 28 | +/* |
| 29 | + * Comment to circumvent error-msg of weak-check: |
| 30 | + * We do not need #pragma weak in here, as these functions |
| 31 | + * do not have a function for the profiling interface. |
| 32 | + */ |
| 33 | + |
| 34 | +/* |
| 35 | + * Note that these are the back-end functions for MPI_DUP_FN (and |
| 36 | + * friends). They have an ABI_C_* prefix because of weird reasons |
| 37 | + * listed in a lengthy comment in mpi.h. |
| 38 | + * |
| 39 | + * Specifically: |
| 40 | + * |
| 41 | + * MPI_NULL_DELETE_FN -> ABI_C_MPI_NULL_DELETE_FN |
| 42 | + * MPI_NULL_COPY_FN -> ABI_C_MPI_NULL_COPY_FN |
| 43 | + * MPI_DUP_FN -> ABI_C_MPI_DUP_FN |
| 44 | + * |
| 45 | + * MPI_TYPE_NULL_DELETE_FN -> ABI_C_MPI_TYPE_NULL_DELETE_FN |
| 46 | + * MPI_TYPE_NULL_COPY_FN -> ABI_C_MPI_TYPE_NULL_COPY_FN |
| 47 | + * MPI_TYPE_DUP_FN -> ABI_C_MPI_TYPE_DUP_FN |
| 48 | + * |
| 49 | + * MPI_COMM_NULL_DELETE_FN -> ABI_C_MPI_COMM_NULL_DELETE_FN |
| 50 | + * MPI_COMM_NULL_COPY_FN -> ABI_C_MPI_COMM_NULL_COPY_FN |
| 51 | + * MPI_COMM_DUP_FN -> ABI_C_MPI_COMM_DUP_FN |
| 52 | + * |
| 53 | + * MPI_WIN_NULL_DELETE_FN -> ABI_C_MPI_WIN_NULL_DELETE_FN |
| 54 | + * MPI_WIN_NULL_COPY_FN -> ABI_C_MPI_WIN_NULL_COPY_FN |
| 55 | + * MPI_WIN_DUP_FN -> ABI_C_MPI_WIN_DUP_FN |
| 56 | + */ |
| 57 | + |
| 58 | +#if 0 |
| 59 | +int ABI_C_MPI_TYPE_NULL_DELETE_FN( MPI_Datataype_ABI_INTERNAL datatype, int type_keyval, |
| 60 | + void* attribute_val_out, |
| 61 | + void* extra_state ) |
| 62 | +{ |
| 63 | + /* Why not all MPI functions are like this ?? */ |
| 64 | + return MPI_SUCCESS; |
| 65 | +} |
| 66 | + |
| 67 | +int ABI_C_MPI_TYPE_NULL_COPY_FN( MPI_Datataype_ABI_INTERNAL datatype, int type_keyval, |
| 68 | + void* extra_state, |
| 69 | + void* attribute_val_in, |
| 70 | + void* attribute_val_out, |
| 71 | + int* flag ) |
| 72 | +{ |
| 73 | + *flag = 0; |
| 74 | + return MPI_SUCCESS; |
| 75 | +} |
| 76 | + |
| 77 | +int ABI_C_MPI_TYPE_DUP_FN( MPI_Datataype_ABI_INTERNAL datatype, int type_keyval, |
| 78 | + void* extra_state, |
| 79 | + void* attribute_val_in, void* attribute_val_out, |
| 80 | + int* flag ) |
| 81 | +{ |
| 82 | + *flag = 1; |
| 83 | + *(void**)attribute_val_out = attribute_val_in; |
| 84 | + return MPI_SUCCESS; |
| 85 | +} |
| 86 | + |
| 87 | +int ABI_C_MPI_WIN_NULL_DELETE_FN( MPI_Win_ABI_INTERNAL window, int win_keyval, |
| 88 | + void* attribute_val_out, |
| 89 | + void* extra_state ) |
| 90 | +{ |
| 91 | + return MPI_SUCCESS; |
| 92 | +} |
| 93 | + |
| 94 | +int ABI_C_MPI_WIN_NULL_COPY_FN( MPI_Win_ABI_INTERNAL window, int win_keyval, |
| 95 | + void* extra_state, |
| 96 | + void* attribute_val_in, |
| 97 | + void* attribute_val_out, int* flag ) |
| 98 | +{ |
| 99 | + *flag= 0; |
| 100 | + return MPI_SUCCESS; |
| 101 | +} |
| 102 | + |
| 103 | +int ABI_C_MPI_WIN_DUP_FN( MPI_Win_ABI_INTERNAL window, int win_keyval, void* extra_state, |
| 104 | + void* attribute_val_in, void* attribute_val_out, |
| 105 | + int* flag ) |
| 106 | +{ |
| 107 | + *flag = 1; |
| 108 | + *(void**)attribute_val_out = attribute_val_in; |
| 109 | + return MPI_SUCCESS; |
| 110 | +} |
| 111 | + |
| 112 | +#endif |
| 113 | + |
| 114 | +int ABI_C_MPI_COMM_NULL_DELETE_FN( MPI_Comm_ABI_INTERNAL comm, int comm_keyval, |
| 115 | + void* attribute_val_out, |
| 116 | + void* extra_state ) |
| 117 | +{ |
| 118 | + return MPI_SUCCESS; |
| 119 | +} |
| 120 | + |
| 121 | +int ABI_C_MPI_COMM_NULL_COPY_FN( MPI_Comm_ABI_INTERNAL comm, int comm_keyval, |
| 122 | + void* extra_state, |
| 123 | + void* attribute_val_in, |
| 124 | + void* attribute_val_out, int* flag ) |
| 125 | +{ |
| 126 | + *flag= 0; |
| 127 | + return MPI_SUCCESS; |
| 128 | +} |
| 129 | + |
| 130 | +int ABI_C_MPI_COMM_DUP_FN( MPI_Comm_ABI_INTERNAL comm, int comm_keyval, void* extra_state, |
| 131 | + void* attribute_val_in, void* attribute_val_out, |
| 132 | + int* flag ) |
| 133 | +{ |
| 134 | + *flag = 1; |
| 135 | + *(void**)attribute_val_out = attribute_val_in; |
| 136 | + return MPI_SUCCESS; |
| 137 | +} |
0 commit comments