00001 #include "ampi.h"
00002
00003 #include <string.h>
00004 #include <vector>
00005 using std::vector;
00006
00007 FLINKAGE {
00008 #define mpi_send FTN_NAME( MPI_SEND , mpi_send )
00009 #define mpi_recv FTN_NAME( MPI_RECV , mpi_recv )
00010 #define mpi_mrecv FTN_NAME( MPI_MRECV , mpi_mrecv )
00011 #define mpi_get_count FTN_NAME( MPI_GET_COUNT , mpi_get_count )
00012 #define mpi_isend FTN_NAME( MPI_ISEND , mpi_isend )
00013 #define mpi_bsend FTN_NAME( MPI_BSEND , mpi_bsend )
00014 #define mpi_rsend FTN_NAME( MPI_RSEND , mpi_rsend )
00015 #define mpi_ibsend FTN_NAME( MPI_IBSEND , mpi_ibsend )
00016 #define mpi_irsend FTN_NAME( MPI_IRSEND , mpi_irsend )
00017 #define mpi_ssend FTN_NAME( MPI_SSEND , mpi_ssend )
00018 #define mpi_issend FTN_NAME( MPI_ISSEND , mpi_issend )
00019 #define mpi_irecv FTN_NAME( MPI_IRECV , mpi_irecv )
00020 #define mpi_imrecv FTN_NAME( MPI_IMRECV , mpi_imrecv )
00021 #define mpi_buffer_attach FTN_NAME( MPI_BUFFER_ATTACH , mpi_buffer_attach )
00022 #define mpi_buffer_detach FTN_NAME( MPI_BUFFER_DETACH , mpi_buffer_detach )
00023 #define mpi_wait FTN_NAME( MPI_WAIT , mpi_wait )
00024 #define mpi_test FTN_NAME( MPI_TEST , mpi_test )
00025 #define mpi_waitany FTN_NAME( MPI_WAITANY , mpi_waitany )
00026 #define mpi_testany FTN_NAME( MPI_TESTANY , mpi_testany )
00027 #define mpi_waitall FTN_NAME( MPI_WAITALL , mpi_waitall )
00028 #define mpi_testall FTN_NAME( MPI_TESTALL , mpi_testall )
00029 #define mpi_waitsome FTN_NAME( MPI_WAITSOME , mpi_waitsome )
00030 #define mpi_testsome FTN_NAME( MPI_TESTSOME , mpi_testsome )
00031 #define mpi_request_get_status FTN_NAME(MPI_REQUEST_GET_STATUS , mpi_request_get_status)
00032 #define mpi_request_free FTN_NAME(MPI_REQUEST_FREE , mpi_request_free)
00033 #define mpi_grequest_start FTN_NAME(MPI_GREQUEST_START , mpi_grequest_start)
00034 #define mpi_grequest_complete FTN_NAME(MPI_GREQUEST_COMPLETE , mpi_grequest_complete)
00035 #define mpi_cancel FTN_NAME(MPI_CANCEL, mpi_cancel)
00036 #define mpi_test_cancelled FTN_NAME(MPI_TEST_CANCELLED, mpi_test_cancelled)
00037 #define mpi_status_set_cancelled FTN_NAME( MPI_STATUS_SET_CANCELLED , mpi_status_set_cancelled )
00038 #define mpi_iprobe FTN_NAME( MPI_IPROBE , mpi_iprobe )
00039 #define mpi_probe FTN_NAME( MPI_PROBE , mpi_probe )
00040 #define mpi_improbe FTN_NAME( MPI_IMPROBE , mpi_improbe )
00041 #define mpi_mprobe FTN_NAME( MPI_MPROBE , mpi_mprobe )
00042 #define mpi_send_init FTN_NAME( MPI_SEND_INIT , mpi_send_init )
00043 #define mpi_rsend_init FTN_NAME( MPI_RSEND_INIT , mpi_rsend_init )
00044 #define mpi_bsend_init FTN_NAME( MPI_BSEND_INIT , mpi_bsend_init )
00045 #define mpi_recv_init FTN_NAME( MPI_RECV_INIT , mpi_recv_init )
00046 #define mpi_start FTN_NAME( MPI_START , mpi_start )
00047 #define mpi_startall FTN_NAME( MPI_STARTALL , mpi_startall )
00048 #define mpi_sendrecv FTN_NAME( MPI_SENDRECV , mpi_sendrecv )
00049 #define mpi_sendrecv_replace FTN_NAME( MPI_SENDRECV_REPLACE , mpi_sendrecv_replace )
00050 #define mpi_type_contiguous FTN_NAME( MPI_TYPE_CONTIGUOUS , mpi_type_contiguous )
00051 #define mpi_type_vector FTN_NAME( MPI_TYPE_VECTOR , mpi_type_vector )
00052 #define mpi_type_hvector FTN_NAME( MPI_TYPE_HVECTOR , mpi_type_hvector )
00053 #define mpi_type_create_hvector FTN_NAME( MPI_TYPE_CREATE_HVECTOR , mpi_type_create_hvector )
00054 #define mpi_type_indexed FTN_NAME( MPI_TYPE_INDEXED , mpi_type_indexed )
00055 #define mpi_type_create_hindexed FTN_NAME( MPI_TYPE_CREATE_HINDEXED , mpi_type_create_hindexed )
00056 #define mpi_type_hindexed FTN_NAME( MPI_TYPE_HINDEXED , mpi_type_hindexed )
00057 #define mpi_type_create_indexed_block FTN_NAME( MPI_TYPE_CREATE_INDEXED_BLOCK , mpi_type_create_indexed_block )
00058 #define mpi_type_create_hindexed_block FTN_NAME( MPI_TYPE_CREATE_HINDEXED_BLOCK , mpi_type_create_hindexed_block )
00059 #define mpi_type_create_struct FTN_NAME( MPI_TYPE_CREATE_STRUCT , mpi_type_create_struct )
00060 #define mpi_type_struct FTN_NAME( MPI_TYPE_STRUCT , mpi_type_struct )
00061 #define mpi_type_commit FTN_NAME( MPI_TYPE_COMMIT , mpi_type_commit )
00062 #define mpi_type_free FTN_NAME( MPI_TYPE_FREE , mpi_type_free )
00063 #define mpi_type_create_darray FTN_NAME( MPI_TYPE_CREATE_DARRAY , mpi_type_create_darray )
00064 #define mpi_type_create_subarray FTN_NAME( MPI_TYPE_CREATE_SUBARRAY , mpi_type_create_subarray )
00065 #define mpi_type_get_extent FTN_NAME( MPI_TYPE_GET_EXTENT , mpi_type_get_extent )
00066 #define mpi_type_get_extent_x FTN_NAME( MPI_TYPE_GET_EXTENT_X , mpi_type_get_extent_x )
00067 #define mpi_type_extent FTN_NAME( MPI_TYPE_EXTENT , mpi_type_extent )
00068 #define mpi_type_get_true_extent FTN_NAME( MPI_TYPE_GET_TRUE_EXTENT , mpi_get_true_extent )
00069 #define mpi_type_get_true_extent_x FTN_NAME( MPI_TYPE_GET_TRUE_EXTENT_X , mpi_get_true_extent_x )
00070 #define mpi_type_size FTN_NAME( MPI_TYPE_SIZE , mpi_type_size )
00071 #define mpi_type_size_x FTN_NAME( MPI_TYPE_SIZE_X , mpi_type_size_x )
00072 #define mpi_type_lb FTN_NAME( MPI_TYPE_LB , mpi_type_lb )
00073 #define mpi_type_ub FTN_NAME( MPI_TYPE_UB , mpi_type_ub )
00074
00075 #define mpi_type_get_name FTN_NAME( MPI_TYPE_GET_NAME , mpi_type_get_name )
00076 #define mpi_type_create_resized FTN_NAME( MPI_TYPE_CREATE_RESIZED, mpi_type_create_resized )
00077 #define mpi_type_dup FTN_NAME( MPI_TYPE_DUP, mpi_type_dup )
00078 #define mpi_type_set_attr FTN_NAME( MPI_TYPE_SET_ATTR, mpi_type_set_attr )
00079 #define mpi_type_get_attr FTN_NAME( MPI_TYPE_GET_ATTR, mpi_type_get_attr )
00080 #define mpi_type_delete_attr FTN_NAME( MPI_TYPE_DELETE_ATTR, mpi_type_delete_attr )
00081 #define mpi_type_create_keyval FTN_NAME( MPI_TYPE_CREATE_KEYVAL, mpi_type_create_keyval )
00082 #define mpi_type_free_keyval FTN_NAME( MPI_TYPE_FREE_KEYVAL, mpi_type_free_keyval )
00083 #define mpi_get_address FTN_NAME( MPI_GET_ADDRESS , mpi_get_address )
00084 #define mpi_address FTN_NAME( MPI_ADDRESS , mpi_address )
00085 #define mpi_status_set_elements FTN_NAME( MPI_STATUS_SET_ELEMENTS , mpi_status_set_elements )
00086 #define mpi_status_set_elements_x FTN_NAME( MPI_STATUS_SET_ELEMENTS_X , mpi_status_set_elements_x )
00087 #define mpi_get_elements FTN_NAME( MPI_GET_ELEMENTS , mpi_get_elements )
00088 #define mpi_get_elements_x FTN_NAME( MPI_GET_ELEMENTS_X , mpi_get_elements_x )
00089 #define mpi_pack FTN_NAME( MPI_PACK , mpi_pack )
00090 #define mpi_unpack FTN_NAME( MPI_UNPACK , mpi_unpack )
00091 #define mpi_pack_size FTN_NAME( MPI_PACK_SIZE , mpi_pack_size )
00092 #define mpi_aint_add FTN_NAME( MPI_AINT_ADD , mpi_aint_add )
00093 #define mpi_aint_diff FTN_NAME( MPI_AINT_DIFF , mpi_aint_diff )
00094
00095 #define mpi_barrier FTN_NAME( MPI_BARRIER , mpi_barrier )
00096 #define mpi_ibarrier FTN_NAME( MPI_IBARRIER , mpi_ibarrier )
00097 #define mpi_bcast FTN_NAME( MPI_BCAST , mpi_bcast )
00098 #define mpi_ibcast FTN_NAME( MPI_IBCAST , mpi_ibcast )
00099 #define mpi_gather FTN_NAME( MPI_GATHER , mpi_gather )
00100 #define mpi_igather FTN_NAME( MPI_IGATHER , mpi_igather )
00101 #define mpi_gatherv FTN_NAME( MPI_GATHERV , mpi_gatherv )
00102 #define mpi_igatherv FTN_NAME( MPI_IGATHERV , mpi_igatherv )
00103 #define mpi_scatter FTN_NAME( MPI_SCATTER , mpi_scatter )
00104 #define mpi_iscatter FTN_NAME( MPI_ISCATTER , mpi_iscatter )
00105 #define mpi_scatterv FTN_NAME( MPI_SCATTERV , mpi_scatterv )
00106 #define mpi_iscatterv FTN_NAME( MPI_ISCATTERV , mpi_iscatterv )
00107 #define mpi_allgather FTN_NAME( MPI_ALLGATHER , mpi_allgather )
00108 #define mpi_iallgather FTN_NAME( MPI_IALLGATHER , mpi_iallgather )
00109 #define mpi_allgatherv FTN_NAME( MPI_ALLGATHERV , mpi_allgatherv )
00110 #define mpi_iallgatherv FTN_NAME( MPI_IALLGATHERV , mpi_iallgatherv )
00111 #define mpi_alltoall FTN_NAME( MPI_ALLTOALL , mpi_alltoall )
00112 #define mpi_ialltoall FTN_NAME( MPI_IALLTOALL , mpi_ialltoall )
00113 #define mpi_alltoallv FTN_NAME( MPI_ALLTOALLV , mpi_alltoallv )
00114 #define mpi_ialltoallv FTN_NAME( MPI_IALLTOALLV , mpi_ialltoallv )
00115 #define mpi_alltoallw FTN_NAME( MPI_ALLTOALLW , mpi_alltoallw )
00116 #define mpi_ialltoallw FTN_NAME( MPI_IALLTOALLW , mpi_ialltoallw )
00117 #define mpi_reduce FTN_NAME( MPI_REDUCE , mpi_reduce )
00118 #define mpi_ireduce FTN_NAME( MPI_IREDUCE , mpi_ireduce )
00119 #define mpi_allreduce FTN_NAME( MPI_ALLREDUCE , mpi_allreduce )
00120 #define mpi_iallreduce FTN_NAME( MPI_IALLREDUCE , mpi_iallreduce )
00121 #define mpi_reduce_local FTN_NAME( MPI_REDUCE_LOCAL , mpi_reduce_local )
00122 #define mpi_reduce_scatter_block FTN_NAME( MPI_REDUCE_SCATTER_BLOCK , mpi_reduce_scatter_block )
00123 #define mpi_ireduce_scatter_block FTN_NAME( MPI_IREDUCE_SCATTER_BLOCK , mpi_ireduce_scatter_block )
00124 #define mpi_reduce_scatter FTN_NAME( MPI_REDUCE_SCATTER , mpi_reduce_scatter )
00125 #define mpi_ireduce_scatter FTN_NAME( MPI_IREDUCE_SCATTER , mpi_ireduce_scatter )
00126 #define mpi_scan FTN_NAME( MPI_SCAN , mpi_scan )
00127 #define mpi_iscan FTN_NAME( MPI_ISCAN , mpi_iscan )
00128 #define mpi_exscan FTN_NAME( MPI_EXSCAN , mpi_exscan )
00129 #define mpi_iexscan FTN_NAME( MPI_IEXSCAN , mpi_iexscan )
00130 #define mpi_neighbor_alltoall FTN_NAME( MPI_NEIGHBOR_ALLTOALL , mpi_neighbor_alltoall )
00131 #define mpi_ineighbor_alltoall FTN_NAME( MPI_INEIGHBOR_ALLTOALL , mpi_ineighbor_alltoall )
00132 #define mpi_neighbor_alltoallv FTN_NAME( MPI_NEIGHBOR_ALLTOALLV , mpi_neighbor_alltoallv )
00133 #define mpi_ineighbor_alltoallv FTN_NAME( MPI_INEIGHBOR_ALLTOALLV , mpi_ineighbor_alltoallv )
00134 #define mpi_neighbor_alltoallw FTN_NAME( MPI_NEIGHBOR_ALLTOALLW , mpi_neighbor_alltoallw )
00135 #define mpi_ineighbor_alltoallw FTN_NAME( MPI_INEIGHBOR_ALLTOALLW , mpi_ineighbor_alltoallw )
00136 #define mpi_neighbor_allgather FTN_NAME( MPI_NEIGHBOR_ALLGATHER , mpi_neighbor_allgather )
00137 #define mpi_ineighbor_allgather FTN_NAME( MPI_INEIGHBOR_ALLGATHER , mpi_ineighbor_allgather )
00138 #define mpi_neighbor_allgatherv FTN_NAME( MPI_NEIGHBOR_ALLGATHERV , mpi_neighbor_allgatherv )
00139 #define mpi_ineighbor_allgatherv FTN_NAME( MPI_INEIGHBOR_ALLGATHERV , mpi_ineighbor_allgatherv )
00140 #define mpi_op_create FTN_NAME( MPI_OP_CREATE , mpi_op_create )
00141 #define mpi_op_free FTN_NAME( MPI_OP_FREE , mpi_op_free )
00142 #define mpi_op_commutative FTN_NAME( MPI_OP_COMMUTATIVE , mpi_op_commutative )
00143
00144 #define mpi_group_size FTN_NAME( MPI_GROUP_SIZE, mpi_group_size)
00145 #define mpi_group_rank FTN_NAME( MPI_GROUP_RANK, mpi_group_rank)
00146 #define mpi_group_translate_ranks FTN_NAME(MPI_GROUP_TRANSLATE_RANKS, mpi_group_translate_ranks)
00147 #define mpi_group_compare FTN_NAME(MPI_GROUP_COMPARE, mpi_group_compare)
00148 #define mpi_comm_group FTN_NAME( MPI_COMM_GROUP, mpi_comm_group)
00149 #define mpi_group_union FTN_NAME(MPI_GROUP_UNION, mpi_group_union)
00150 #define mpi_group_intersection FTN_NAME(MPI_GROUP_INTERSECTION, mpi_group_intersection)
00151 #define mpi_group_difference FTN_NAME(MPI_GROUP_DIFFERENCE, mpi_group_difference)
00152 #define mpi_group_incl FTN_NAME(MPI_GROUP_INCL, mpi_group_incl)
00153 #define mpi_group_excl FTN_NAME(MPI_GROUP_EXCL, mpi_group_excl)
00154 #define mpi_group_range_incl FTN_NAME(MPI_GROUP_RANGE_INCL, mpi_group_range_incl)
00155 #define mpi_group_range_excl FTN_NAME(MPI_GROUP_RANGE_EXCL, mpi_group_range_excl)
00156 #define mpi_group_free FTN_NAME(MPI_GROUP_FREE, mpi_group_free)
00157
00158 #define mpi_intercomm_create FTN_NAME ( MPI_INTERCOMM_CREATE , mpi_intercomm_create )
00159 #define mpi_intercomm_merge FTN_NAME ( MPI_INTERCOMM_MERGE , mpi_intercomm_merge )
00160
00161 #define mpi_comm_create FTN_NAME(MPI_COMM_CREATE, mpi_comm_create)
00162 #define mpi_comm_create_group FTN_NAME(MPI_COMM_CREATE_GROUP, mpi_comm_create_group)
00163 #define mpi_comm_rank FTN_NAME( MPI_COMM_RANK , mpi_comm_rank )
00164 #define mpi_comm_size FTN_NAME( MPI_COMM_SIZE , mpi_comm_size )
00165 #define mpi_comm_dup FTN_NAME( MPI_COMM_DUP , mpi_comm_dup )
00166 #define mpi_comm_idup FTN_NAME( MPI_COMM_IDUP , mpi_comm_idup )
00167 #define mpi_comm_dup_with_info FTN_NAME( MPI_COMM_DUP_WITH_INFO , mpi_comm_dup_with_info )
00168 #define mpi_comm_idup_with_info FTN_NAME( MPI_COMM_IDUP_WITH_INFO , mpi_comm_idup_with_info )
00169 #define mpi_comm_split FTN_NAME( MPI_COMM_SPLIT , mpi_comm_split )
00170 #define mpi_comm_split_type FTN_NAME( MPI_COMM_SPLIT_TYPE , mpi_comm_split_type )
00171 #define mpi_comm_free FTN_NAME( MPI_COMM_FREE , mpi_comm_free )
00172 #define mpi_comm_test_inter FTN_NAME( MPI_COMM_TEST_INTER , mpi_comm_test_inter )
00173 #define mpi_comm_remote_size FTN_NAME ( MPI_COMM_REMOTE_SIZE , mpi_comm_remote_size )
00174 #define mpi_comm_remote_group FTN_NAME ( MPI_COMM_REMOTE_GROUP , mpi_comm_remote_group )
00175
00176 #define mpi_comm_get_name FTN_NAME ( MPI_COMM_GET_NAME , mpi_comm_get_name )
00177 #define mpi_comm_set_info FTN_NAME ( MPI_COMM_SET_INFO , mpi_comm_set_info )
00178 #define mpi_comm_get_info FTN_NAME ( MPI_COMM_GET_INFO , mpi_comm_get_info )
00179 #define mpi_comm_call_errhandler FTN_NAME( MPI_COMM_CALL_ERRHANDLER , mpi_comm_call_errhandler )
00180 #define mpi_comm_create_errhandler FTN_NAME( MPI_COMM_CREATE_ERRHANDLER , mpi_comm_create_errhandler )
00181 #define mpi_comm_set_errhandler FTN_NAME( MPI_COMM_SET_ERRHANDLER , mpi_comm_set_errhandler )
00182 #define mpi_comm_get_errhandler FTN_NAME( MPI_COMM_GET_ERRHANDLER , mpi_comm_get_errhandler )
00183 #define mpi_comm_free_errhandler FTN_NAME( MPI_COMM_FREE_ERRHANDLER , mpi_comm_free_errhandler )
00184 #define mpi_comm_create_keyval FTN_NAME ( MPI_COMM_CREATE_KEYVAL , mpi_comm_create_keyval )
00185 #define mpi_comm_free_keyval FTN_NAME ( MPI_COMM_FREE_KEYVAL , mpi_comm_free_keyval )
00186 #define mpi_comm_set_attr FTN_NAME ( MPI_COMM_SET_ATTR , mpi_comm_set_attr )
00187 #define mpi_comm_get_attr FTN_NAME ( MPI_COMM_GET_ATTR , mpi_comm_get_attr )
00188 #define mpi_comm_delete_attr FTN_NAME ( MPI_COMM_DELETE_ATTR , mpi_comm_delete_attr )
00189
00190 #define mpi_keyval_create FTN_NAME ( MPI_KEYVAL_CREATE , mpi_keyval_create )
00191 #define mpi_keyval_free FTN_NAME ( MPI_KEYVAL_FREE , mpi_keyval_free )
00192 #define mpi_attr_put FTN_NAME ( MPI_ATTR_PUT , mpi_attr_put )
00193 #define mpi_attr_get FTN_NAME ( MPI_ATTR_GET , mpi_attr_get )
00194 #define mpi_attr_delete FTN_NAME ( MPI_ATTR_DELETE , mpi_attr_delete )
00195
00196 #define mpi_cart_create FTN_NAME ( MPI_CART_CREATE , mpi_cart_create )
00197 #define mpi_graph_create FTN_NAME ( MPI_GRAPH_CREATE , mpi_graph_create )
00198 #define mpi_dist_graph_create_adjacent FTN_NAME ( MPI_DIST_GRAPH_CREATE_ADJACENT, mpi_dist_graph_create_adjacent )
00199 #define mpi_dist_graph_create FTN_NAME ( MPI_DIST_GRAPH_CREATE, mpi_dist_graph_create )
00200 #define mpi_topo_test FTN_NAME ( MPI_TOPO_TEST , mpi_topo_test )
00201 #define mpi_cart_map FTN_NAME ( MPI_CART_MAP , mpi_cart_map )
00202 #define mpi_graph_map FTN_NAME ( MPI_GRAPH_MAP , mpi_graph_map )
00203 #define mpi_cartdim_get FTN_NAME ( MPI_CARTDIM_GET , mpi_cartdim_get )
00204 #define mpi_cart_get FTN_NAME ( MPI_CART_GET , mpi_cart_get )
00205 #define mpi_cart_rank FTN_NAME ( MPI_CART_RANK , mpi_cart_rank )
00206 #define mpi_cart_coords FTN_NAME ( MPI_CART_COORDS , mpi_cart_coords )
00207 #define mpi_cart_shift FTN_NAME ( MPI_CART_SHIFT , mpi_cart_shift )
00208 #define mpi_graphdims_get FTN_NAME ( MPI_GRAPHDIMS_GET , mpi_graphdims_get )
00209 #define mpi_graph_get FTN_NAME ( MPI_GRAPH_GET , mpi_graph_get )
00210 #define mpi_graph_neighbors_count FTN_NAME ( MPI_GRAPH_NEIGHBORS_COUNT , mpi_graph_neighbors_count )
00211 #define mpi_graph_neighbors FTN_NAME ( MPI_GRAPH_NEIGHBORS , mpi_graph_neighbors )
00212 #define mpi_dist_graph_neighbors FTN_NAME ( MPI_DIST_GRAPH_NEIGHBORS , mpi_dist_graph_neighbors )
00213 #define mpi_dist_graph_neighbors_count FTN_NAME ( MPI_DIST_GRAPH_NEIGHBORS_COUNT , mpi_dist_graph_neighbors_count )
00214 #define mpi_dims_create FTN_NAME ( MPI_DIMS_CREATE , mpi_dims_create )
00215 #define mpi_cart_sub FTN_NAME ( MPI_CART_SUB , mpi_cart_sub )
00216
00217 #define mpi_get_version FTN_NAME ( MPI_GET_VERSION , mpi_get_version )
00218 #define mpi_get_library_version FTN_NAME ( MPI_GET_LIBRARY_VERSION , mpi_get_library_version )
00219 #define mpi_get_processor_name FTN_NAME ( MPI_GET_PROCESSOR_NAME , mpi_get_processor_name )
00220 #define mpi_errhandler_create FTN_NAME( MPI_ERRHANDLER_CREATE , mpi_errhandler_create )
00221 #define mpi_errhandler_set FTN_NAME( MPI_ERRHANDLER_SET , mpi_errhandler_set )
00222 #define mpi_errhandler_get FTN_NAME( MPI_ERRHANDLER_GET , mpi_errhandler_get )
00223 #define mpi_errhandler_free FTN_NAME( MPI_ERRHANDLER_FREE , mpi_errhandler_free )
00224 #define mpi_add_error_code FTN_NAME( MPI_ADD_ERROR_CODE , mpi_add_error_code )
00225 #define mpi_add_error_class FTN_NAME( MPI_ADD_ERROR_CLASS , mpi_add_error_class )
00226
00227 #define mpi_error_class FTN_NAME( MPI_ERROR_CLASS , mpi_error_class )
00228 #define mpi_error_string FTN_NAME( MPI_ERROR_STRING , mpi_error_string )
00229 #define mpi_wtime FTN_NAME( MPI_WTIME , mpi_wtime )
00230 #define mpi_wtick FTN_NAME( MPI_WTICK , mpi_wtick )
00231 #define mpi_is_thread_main FTN_NAME( MPI_IS_THREAD_MAIN , mpi_is_thread_main )
00232 #define mpi_query_thread FTN_NAME( MPI_QUERY_THREAD , mpi_query_thread )
00233 #define mpi_init_thread FTN_NAME( MPI_INIT_THREAD , mpi_init_thread )
00234 #define mpi_init FTN_NAME( MPI_INIT , mpi_init )
00235 #define mpi_initialized FTN_NAME( MPI_INITIALIZED , mpi_initialized )
00236 #define mpi_finalize FTN_NAME( MPI_FINALIZE , mpi_finalize )
00237 #define mpi_finalized FTN_NAME( MPI_FINALIZED , mpi_finalized )
00238 #define mpi_abort FTN_NAME( MPI_ABORT , mpi_abort )
00239
00240
00241 #define mpi_type_get_envelope FTN_NAME ( MPI_TYPE_GET_ENVELOPE , mpi_type_get_envelope )
00242 #define mpi_type_get_contents FTN_NAME ( MPI_TYPE_GET_CONTENTS , mpi_type_get_contents )
00243
00244 #define mpi_win_create FTN_NAME ( MPI_WIN_CREATE , mpi_win_create )
00245 #define mpi_win_free FTN_NAME ( MPI_WIN_FREE , mpi_win_free )
00246 #define mpi_win_create_errhandler FTN_NAME ( MPI_WIN_CREATE_ERRHANDLER , mpi_win_create_errhandler )
00247 #define mpi_win_call_errhandler FTN_NAME ( MPI_WIN_CALL_ERRHANDLER , mpi_win_call_errhandler )
00248 #define mpi_win_get_errhandler FTN_NAME ( MPI_WIN_GET_ERRHANDLER , mpi_win_get_errhandler )
00249 #define mpi_win_set_errhandler FTN_NAME ( MPI_WIN_SET_ERRHANDLER , mpi_win_set_errhandler )
00250 #define mpi_win_create_keyval FTN_NAME ( MPI_WIN_CREATE_KEYVAL , mpi_win_create_keyval )
00251 #define mpi_win_free_keyval FTN_NAME ( MPI_WIN_FREE_KEYVAL , mpi_win_free_keyval )
00252 #define mpi_win_delete_attr FTN_NAME ( MPI_WIN_DELETE_ATTR , mpi_win_delete_attr )
00253 #define mpi_win_get_attr FTN_NAME ( MPI_WIN_GET_ATTR , mpi_win_get_attr )
00254 #define mpi_win_set_attr FTN_NAME ( MPI_WIN_SET_ATTR , mpi_win_set_attr )
00255 #define mpi_win_get_group FTN_NAME ( MPI_WIN_GET_GROUP , mpi_win_get_group )
00256
00257 #define mpi_win_get_name FTN_NAME ( MPI_WIN_GET_NAME , mpi_win_get_name )
00258 #define mpi_win_set_info FTN_NAME ( MPI_WIN_SET_INFO , mpi_win_set_info )
00259 #define mpi_win_get_info FTN_NAME ( MPI_WIN_GET_INFO , mpi_win_get_info )
00260 #define mpi_win_fence FTN_NAME ( MPI_WIN_FENCE , mpi_win_fence )
00261 #define mpi_win_lock FTN_NAME ( MPI_WIN_LOCK , mpi_win_lock )
00262 #define mpi_win_unlock FTN_NAME ( MPI_WIN_UNLOCK , mpi_win_unlock )
00263 #define mpi_win_post FTN_NAME ( MPI_WIN_POST , mpi_win_post )
00264 #define mpi_win_wait FTN_NAME ( MPI_WIN_WAIT , mpi_win_wait )
00265 #define mpi_win_start FTN_NAME ( MPI_WIN_START , mpi_win_start )
00266 #define mpi_win_complete FTN_NAME ( MPI_WIN_COMPLETE , mpi_win_complete )
00267 #define mpi_win_test FTN_NAME ( MPI_WIN_TEST , mpi_win_test )
00268 #define mpi_alloc_mem FTN_NAME ( MPI_ALLOC_MEM , mpi_alloc_mem )
00269 #define mpi_free_mem FTN_NAME ( MPI_FREE_MEM , mpi_free_mem )
00270 #define mpi_put FTN_NAME ( MPI_PUT , mpi_put )
00271 #define mpi_get FTN_NAME ( MPI_GET , mpi_get )
00272 #define mpi_accumulate FTN_NAME ( MPI_ACCUMULATE , mpi_accumulate )
00273 #define mpi_get_accumulate FTN_NAME ( MPI_GET_ACCUMULATE , mpi_get_accumulate )
00274 #define mpi_rput FTN_NAME ( MPI_RPUT , mpi_rput )
00275 #define mpi_rget FTN_NAME ( MPI_RGET , mpi_rget )
00276 #define mpi_raccumulate FTN_NAME ( MPI_RACCUMULATE , mpi_raccumulate )
00277 #define mpi_rget_accumulate FTN_NAME ( MPI_RGET_ACCUMULATE , mpi_rget_accumulate )
00278 #define mpi_fetch_and_op FTN_NAME ( MPI_FETCH_AND_OP , mpi_fetch_and_op )
00279 #define mpi_compare_and_swap FTN_NAME ( MPI_COMPARE_AND_SWAP , mpi_compare_and_swap )
00280
00281 #define mpi_info_create FTN_NAME ( MPI_INFO_CREATE , mpi_info_create )
00282
00283
00284
00285
00286 #define mpi_info_get_nkeys FTN_NAME ( MPI_INFO_GET_NKEYS , mpi_info_get_nkeys )
00287 #define mpi_info_get_nthkey FTN_NAME ( MPI_INFO_GET_NTHKEYS , mpi_info_get_nthkey )
00288 #define mpi_info_dup FTN_NAME ( MPI_INFO_DUP , mpi_info_dup )
00289 #define mpi_info_free FTN_NAME ( MPI_INFO_FREE , mpi_info_free )
00290
00291 #define mpi_pcontrol FTN_NAME ( MPI_PCONTROL , mpi_pcontrol )
00292
00293
00294
00295 #define ampif_comm_set_name FTN_NAME ( AMPIF_COMM_SET_NAME , ampif_comm_set_name )
00296 #define ampif_type_set_name FTN_NAME ( AMPIF_TYPE_SET_NAME , ampif_type_set_name )
00297 #define ampif_win_set_name FTN_NAME ( AMPIF_WIN_SET_NAME , ampif_win_set_name )
00298 #define ampif_info_set FTN_NAME ( AMPIF_INFO_SET , ampif_info_set )
00299 #define ampif_info_delete FTN_NAME ( AMPIF_INFO_DELETE , ampif_info_delete )
00300 #define ampif_info_get FTN_NAME ( AMPIF_INFO_GET , ampif_info_get )
00301 #define ampif_info_get_valuelen FTN_NAME ( AMPIF_INFO_GET_VALUELEN , ampif_info_get_valuelen )
00302 #define ampif_add_error_string FTN_NAME ( AMPIF_ADD_ERROR_STRING , ampif_add_error_string )
00303 #define ampif_print FTN_NAME( AMPIF_PRINT , ampif_print )
00304
00305
00306 #define ampi_migrate FTN_NAME( AMPI_MIGRATE , ampi_migrate )
00307 #define ampi_load_start_measure FTN_NAME( AMPI_LOAD_START_MEASURE, ampi_load_start_measure )
00308 #define ampi_load_stop_measure FTN_NAME( AMPI_LOAD_STOP_MEASURE, ampi_load_stop_measure )
00309 #define ampi_load_reset_measure FTN_NAME( AMPI_LOAD_RESET_MEASURE, ampi_load_reset_measure )
00310 #define ampi_load_set_value FTN_NAME( AMPI_SET_LOAD_VALUE, ampi_load_set_value )
00311 #define ampi_evacuate FTN_NAME ( AMPI_EVACUATE , ampi_evacuate )
00312 #define ampi_migrate_to_pe FTN_NAME( AMPI_MIGRATE_TO_PE , ampi_migrate_to_pe )
00313 #define ampi_set_migratable FTN_NAME ( AMPI_SET_MIGRATABLE , ampi_set_migratable )
00314 #define ampi_init_universe FTN_NAME( AMPI_INIT_UNIVERSE , ampi_init_universe )
00315 #define ampi_register_main FTN_NAME( AMPI_REGISTER_MAIN , ampi_register_main )
00316 #define ampi_register_pup FTN_NAME( AMPI_REGISTER_PUP , ampi_register_pup )
00317 #define ampi_register_about_to_migrate FTN_NAME ( AMPI_REGISTER_ABOUT_TO_MIGRATE , ampi_register_about_to_migrate )
00318 #define ampi_register_just_migrated FTN_NAME ( AMPI_REGISTER_JUST_MIGRATED , ampi_register_just_migrated )
00319 #define ampi_type_is_contiguous FTN_NAME ( AMPI_TYPE_IS_CONTIGUOUS , ampi_type_is_contiguous )
00320 #define ampi_get_pup_data FTN_NAME ( AMPI_GET_PUP_DATA , ampi_get_pup_data )
00321 #define ampi_iget FTN_NAME ( AMPI_IGET , ampi_iget )
00322 #define ampi_iget_wait FTN_NAME ( AMPI_IGET_WAIT , ampi_iget_wait )
00323 #define ampi_iget_data FTN_NAME ( AMPI_IGET_DATA , ampi_iget_data )
00324 #define ampi_iget_free FTN_NAME ( AMPI_IGET_FREE , ampi_iget_free )
00325 #define ampi_alltoall_medium FTN_NAME( AMPI_ALLTOALL_MEDIUM , ampi_alltoall_medium )
00326 #define ampi_alltoall_long FTN_NAME( AMPI_ALLTOALL_LONG , ampi_alltoall_long )
00327 #define ampi_yield FTN_NAME ( AMPI_YIELD , ampi_yield )
00328 #define ampi_suspend FTN_NAME ( AMPI_SUSPEND , ampi_suspend )
00329 #define ampi_resume FTN_NAME ( AMPI_RESUME, ampi_resume )
00330
00331 #define ampi_install_idle_timer FTN_NAME( AMPI_INSTALL_IDLE_TIMER , ampi_install_idle_timer )
00332 #define ampi_uninstall_idle_timer FTN_NAME( AMPI_UNINSTALL_IDLE_TIMER , ampi_uninstall_idle_timer )
00333 #define ampi_trace_begin FTN_NAME( AMPI_TRACE_BEGIN , ampi_trace_begin )
00334 #define ampi_trace_end FTN_NAME( AMPI_TRACE_END , ampi_trace_end )
00335
00336
00337 #define ampi_command_argument_count FTN_NAME( AMPI_COMMAND_ARGUMENT_COUNT , ampi_command_argument_count )
00338 #define ampi_get_command_argument FTN_NAME( AMPI_GET_COMMAND_ARGUMENT , ampi_get_command_argument )
00339
00340 #if CMK_BIGSIM_CHARM
00341 #define ampi_set_start_event FTN_NAME( AMPI_SET_START_EVENT , ampi_set_start_event )
00342 #define ampi_set_end_event FTN_NAME( AMPI_SET_END_EVENT , ampi_set_end_event )
00343 #define begintracebigsim FTN_NAME (BEGINTRACEBIGSIM , begintracebigsim)
00344 #define endtracebigsim FTN_NAME (ENDTRACEBIGSIM , endtracebigsim)
00345 #endif
00346
00347 #if CMK_CUDA
00348 #define ampi_gpu_invoke_wr FTN_NAME ( AMPI_GPU_INVOKE_WR , ampi_gpu_invoke_wr )
00349 #define ampi_gpu_iinvoke_wr FTN_NAME ( AMPI_GPU_IINVOKE_WR , ampi_gpu_iinvoke_wr )
00350 #endif
00351
00352 #define REDUCERF(caps, nocaps) \
00353 void FTN_NAME(caps, nocaps)(void *iv, void *iov, int *len, MPI_Datatype *dt){ \
00354 caps(iv, iov, len, dt); \
00355 }
00356
00357
00358
00359 static void ampif_str_f2c(char* dst, const char* src, int len) noexcept {
00360 memcpy(dst, src, len);
00361 dst[len] = '\0';
00362 }
00363
00364
00365 static void ampif_str_c2f(char* dst, const char* src, int max_len) noexcept {
00366 strncpy(dst, src, max_len);
00367 for(int i=strlen(src); i<max_len; i++)
00368 dst[i] = ' ';
00369 }
00370
00371 static MPI_Status* handle_MPI_STATUS_IGNORE(int *sts) noexcept {
00372 if (sts[0]==-9 && sts[1]==-9 && sts[2]==-9 && sts[3]==-9 &&
00373 sts[4]==-9 && sts[5]==-9 && sts[6]==-9 && sts[7]==-9) {
00374 return MPI_STATUS_IGNORE;
00375 } else {
00376 return (MPI_Status *)sts;
00377 }
00378 }
00379
00380 static MPI_Status* handle_MPI_STATUSES_IGNORE(int *sts) noexcept {
00381 if (sts[0]==-9 && sts[1]==-9 && sts[2]==-9 && sts[3]==-9 &&
00382 sts[4]==-9 && sts[5]==-9 && sts[6]==-9 && sts[7]==-9) {
00383 return MPI_STATUSES_IGNORE;
00384 } else {
00385 return (MPI_Status *)sts;
00386 }
00387 }
00388
00389 static void handle_MPI_IN_PLACE_f(void* inbuf, void* outbuf) noexcept {
00390 if (inbuf == NULL) inbuf = MPI_IN_PLACE;
00391 if (outbuf == NULL) outbuf = MPI_IN_PLACE;
00392 }
00393
00394 void mpi_is_thread_main(int *flag, int *ierr) noexcept
00395 {
00396 *ierr = MPI_Is_thread_main(flag);
00397 }
00398
00399 void mpi_query_thread(int *provided, int *ierr) noexcept
00400 {
00401 *ierr = MPI_Query_thread(provided);
00402 }
00403
00404 void mpi_init_thread(int *required, int *provided, int *ierr) noexcept
00405 {
00406 *ierr = MPI_Init_thread(NULL, NULL, *required, provided);
00407 }
00408
00409 void mpi_init(int *ierr) noexcept
00410 {
00411 *ierr = MPI_Init(NULL,NULL);
00412 }
00413
00414 void mpi_initialized(int *isInit, int* ierr) noexcept
00415 {
00416 *ierr = MPI_Initialized(isInit);
00417 }
00418
00419 void mpi_finalized(int *isFinalized, int* ierr) noexcept
00420 {
00421 *ierr = MPI_Finalized(isFinalized);
00422 }
00423
00424 void mpi_comm_rank(int *comm, int *rank, int *ierr) noexcept
00425 {
00426 *ierr = MPI_Comm_rank(*comm, rank);
00427 }
00428
00429 void mpi_comm_size(int *comm, int *size, int *ierr) noexcept
00430 {
00431 *ierr = MPI_Comm_size(*comm, size);
00432 }
00433
00434 void mpi_finalize(int *ierr) noexcept
00435 {
00436 *ierr = MPI_Finalize();
00437 }
00438
00439 void mpi_send(void *msg, int *count, int *type, int *dest,
00440 int *tag, int *comm, int *ierr) noexcept
00441 {
00442 *ierr = MPI_Send(msg, *count, *type, *dest, *tag, *comm);
00443 }
00444
00445 void mpi_recv(void *msg, int *count, int *type, int *src,
00446 int *tag, int *comm, int *status, int *ierr) noexcept
00447 {
00448 MPI_Status* s = handle_MPI_STATUS_IGNORE(status);
00449 *ierr = MPI_Recv(msg, *count, *type, *src, *tag, *comm, s);
00450 }
00451
00452 void mpi_bsend(void *msg, int *count, int *type, int *dest,
00453 int *tag, int *comm, int *ierr) noexcept
00454 {
00455 *ierr = MPI_Bsend(msg, *count, *type, *dest, *tag, *comm);
00456 }
00457
00458 void mpi_buffer_attach(void *buffer, int *size, int *ierr) noexcept
00459 {
00460 *ierr = MPI_Buffer_attach(buffer, *size);
00461 }
00462
00463 void mpi_buffer_detach(void *buffer, int *size, int *ierr) noexcept
00464 {
00465 *ierr = MPI_Buffer_detach(buffer, size);
00466 }
00467
00468 void mpi_rsend(void *msg, int *count, int *type, int *dest,
00469 int *tag, int *comm, int *ierr) noexcept
00470 {
00471 *ierr = MPI_Rsend(msg, *count, *type, *dest, *tag, *comm);
00472 }
00473
00474 void mpi_ssend(void *msg, int *count, int *type, int *dest,
00475 int *tag, int *comm, int *ierr) noexcept
00476 {
00477 *ierr = MPI_Ssend(msg, *count, *type, *dest, *tag, *comm);
00478 }
00479
00480 void mpi_issend(void *buf, int *count, int *datatype, int *dest,
00481 int *tag, int *comm, int *request, int *ierr) noexcept
00482 {
00483 *ierr = MPI_Issend(buf, *count, *datatype, *dest, *tag, *comm, (MPI_Request *)request);
00484 }
00485
00486 void mpi_probe(int *src, int *tag, int *comm, int *status, int *ierr) noexcept
00487 {
00488 MPI_Status* s = handle_MPI_STATUS_IGNORE(status);
00489 *ierr = MPI_Probe(*src, *tag, *comm, s);
00490 }
00491
00492 void mpi_iprobe(int *src, int *tag, int *comm, int *flag, int *status, int *ierr) noexcept
00493 {
00494 MPI_Status* s = handle_MPI_STATUS_IGNORE(status);
00495 *ierr = MPI_Iprobe(*src, *tag, *comm, flag, s);
00496 }
00497
00498 void mpi_mprobe(int *src, int *tag, int *comm, int *message, int *status, int *ierr) noexcept
00499 {
00500 MPI_Status* s = handle_MPI_STATUS_IGNORE(status);
00501 *ierr = MPI_Mprobe(*src, *tag, *comm, message, s);
00502 }
00503
00504 void mpi_improbe(int *src, int *tag, int *comm, int *flag, int *message, int* status, int *ierr) noexcept
00505 {
00506 MPI_Status* s = handle_MPI_STATUS_IGNORE(status);
00507 *ierr = MPI_Improbe(*src, *tag, *comm, flag, message, s);
00508 }
00509
00510 void mpi_sendrecv(void *sndbuf, int *sndcount, int *sndtype,
00511 int *dest, int *sndtag, void *rcvbuf,
00512 int *rcvcount, int *rcvtype, int *src,
00513 int *rcvtag, int *comm, int *status, int *ierr) noexcept
00514 {
00515 MPI_Status* s = handle_MPI_STATUS_IGNORE(status);
00516 *ierr = MPI_Sendrecv(sndbuf, *sndcount, *sndtype, *dest, *sndtag,
00517 rcvbuf, *rcvcount, *rcvtype, *src, *rcvtag,
00518 *comm, s);
00519 }
00520
00521 void mpi_sendrecv_replace(void *buf, int* count, int* datatype,
00522 int* dest, int* sendtag, int* source, int* recvtag,
00523 int* comm, int* status, int *ierr) noexcept
00524 {
00525 MPI_Status* s = handle_MPI_STATUS_IGNORE(status);
00526 *ierr = MPI_Sendrecv_replace(buf, *count, *datatype, *dest, *sendtag,
00527 *source, *recvtag, *comm, s);
00528 }
00529
00530 void mpi_barrier(int *comm, int *ierr) noexcept
00531 {
00532 *ierr = MPI_Barrier(*comm);
00533 }
00534
00535 void mpi_ibarrier(int *comm, int *request, int *ierr) noexcept
00536 {
00537 *ierr = MPI_Ibarrier(*comm, request);
00538 }
00539
00540 void mpi_bcast(void *buf, int *count, int *type, int *root, int *comm, int *ierr) noexcept
00541 {
00542 *ierr = MPI_Bcast(buf, *count, *type, *root, *comm);
00543 }
00544
00545 void mpi_ibcast(void *buf, int *count, int *type, int *root, int *comm,
00546 int *request, int *ierr) noexcept
00547 {
00548 *ierr = MPI_Ibcast(buf, *count, *type, *root, *comm, request);
00549 }
00550
00551 void mpi_reduce(void *inbuf, void *outbuf, int *count, int *type,
00552 int *op, int *root, int *comm, int *ierr) noexcept
00553 {
00554 handle_MPI_IN_PLACE_f(inbuf, outbuf);
00555 *ierr = MPI_Reduce(inbuf, outbuf, *count, *type, *op, *root, *comm);
00556 }
00557
00558 void mpi_allreduce(void *inbuf,void *outbuf,int *count,int *type,
00559 int *op, int *comm, int *ierr) noexcept
00560 {
00561 handle_MPI_IN_PLACE_f(inbuf, outbuf);
00562 *ierr = MPI_Allreduce(inbuf, outbuf, *count, *type, *op, *comm);
00563 }
00564
00565 double mpi_wtime() noexcept
00566 {
00567 return MPI_Wtime();
00568 }
00569
00570 double mpi_wtick() noexcept
00571 {
00572 return MPI_Wtick();
00573 }
00574
00575 void mpi_start(int *reqnum, int *ierr) noexcept
00576 {
00577 *ierr = MPI_Start((MPI_Request*) reqnum);
00578 }
00579
00580 void mpi_startall(int *count, int *reqnum, int *ierr) noexcept
00581 {
00582 *ierr = MPI_Startall(*count, (MPI_Request*) reqnum);
00583 }
00584
00585 void mpi_waitall(int *count, int *request, int *status, int *ierr) noexcept
00586 {
00587 MPI_Status* s = handle_MPI_STATUSES_IGNORE(status);
00588 *ierr = MPI_Waitall(*count, (MPI_Request*) request, s);
00589 }
00590
00591 void mpi_waitany(int *count, int *request, int *index, int *status, int *ierr) noexcept
00592 {
00593 MPI_Status* s = handle_MPI_STATUS_IGNORE(status);
00594 *ierr = MPI_Waitany(*count, (MPI_Request*) request, index, s);
00595 if (*index != MPI_UNDEFINED)
00596 (*index)++;
00597 }
00598
00599 void mpi_wait(int *request, int *status, int *ierr) noexcept
00600 {
00601 MPI_Status* s = handle_MPI_STATUS_IGNORE(status);
00602 *ierr = MPI_Wait((MPI_Request*) request, s);
00603 }
00604
00605 void mpi_testall(int *count, int *request, int *flag, int *status, int *ierr) noexcept
00606 {
00607 MPI_Status* s = handle_MPI_STATUSES_IGNORE(status);
00608 *ierr = MPI_Testall(*count, (MPI_Request*) request, flag, s);
00609 }
00610
00611 void mpi_waitsome(int *incount, int *array_of_requests, int *outcount, int *array_of_indices,
00612 int *array_of_statuses, int *ierr) noexcept
00613 {
00614 MPI_Status* s = handle_MPI_STATUSES_IGNORE(array_of_statuses);
00615 *ierr = MPI_Waitsome(*incount, (MPI_Request *)array_of_requests, outcount, array_of_indices, s);
00616 if (*outcount != MPI_UNDEFINED) {
00617 for (int i = 0; i < *outcount; ++i) {
00618 array_of_indices[i]++;
00619 }
00620 }
00621 }
00622
00623 void mpi_testsome(int *incount, int *array_of_requests, int *outcount, int *array_of_indices,
00624 int *array_of_statuses, int *ierr) noexcept
00625 {
00626 MPI_Status* s = handle_MPI_STATUSES_IGNORE(array_of_statuses);
00627 *ierr = MPI_Testsome(*incount, (MPI_Request *)array_of_requests, outcount, array_of_indices, s);
00628 if (*outcount != MPI_UNDEFINED) {
00629 for (int i = 0; i < *outcount; ++i) {
00630 array_of_indices[i]++;
00631 }
00632 }
00633 }
00634
00635 void mpi_testany(int *count, int *request, int *index, int *flag, int *status, int *ierr) noexcept
00636 {
00637 MPI_Status* s = handle_MPI_STATUS_IGNORE(status);
00638 *ierr = MPI_Testany(*count, (MPI_Request*) request, index, flag, s);
00639 if (*index != MPI_UNDEFINED)
00640 (*index)++;
00641 }
00642
00643 void mpi_test(int *request, int *flag, int *status, int *ierr) noexcept
00644 {
00645 MPI_Status* s = handle_MPI_STATUS_IGNORE(status);
00646 *ierr = MPI_Test((MPI_Request*) request, flag, s);
00647 }
00648
00649 void mpi_request_get_status(int *request, int *flag, int *status, int *ierr) noexcept
00650 {
00651 MPI_Status* s = handle_MPI_STATUS_IGNORE(status);
00652 *ierr = MPI_Request_get_status(*((MPI_Request*)request), flag, s);
00653 }
00654
00655 void mpi_request_free(int *request, int *ierr) noexcept
00656 {
00657 *ierr = MPI_Request_free((MPI_Request *)request);
00658 }
00659
00660 void mpi_grequest_start(int (*query_fn)(void*,MPI_Status*), int (*free_fn)(void*),
00661 int (*cancel_fn)(void*,int), void *extra_state, int *request, int *ierr) noexcept
00662 {
00663 *ierr = MPI_Grequest_start(query_fn, free_fn, cancel_fn, extra_state, request);
00664 }
00665
00666 void mpi_grequest_complete(int *request, int *ierr) noexcept
00667 {
00668 *ierr = MPI_Grequest_complete(*request);
00669 }
00670
00671 void mpi_cancel(int *request, int *ierr) noexcept
00672 {
00673 *ierr = MPI_Cancel((MPI_Request *)request);
00674 }
00675
00676 void mpi_test_cancelled(int *status, int *flag, int *ierr) noexcept
00677 {
00678 MPI_Status* s = handle_MPI_STATUS_IGNORE(status);
00679 *ierr = MPI_Test_cancelled(s, flag);
00680 }
00681
00682 void mpi_status_set_cancelled(int *status, int *flag, int *ierr) noexcept
00683 {
00684 MPI_Status* s = handle_MPI_STATUS_IGNORE(status);
00685 *ierr = MPI_Status_set_cancelled(s, *flag);
00686 }
00687
00688 void mpi_recv_init(void *buf, int *count, int *type, int *srcpe,
00689 int *tag, int *comm, int *req, int *ierr) noexcept
00690 {
00691 *ierr = MPI_Recv_init(buf,*count,*type,*srcpe,*tag,*comm,(MPI_Request*)req);
00692 }
00693
00694 void mpi_send_init(void *buf, int *count, int *type, int *destpe,
00695 int *tag, int *comm, int *req, int *ierr) noexcept
00696 {
00697 *ierr = MPI_Send_init(buf,*count,*type,*destpe,*tag,*comm,(MPI_Request*)req);
00698 }
00699
00700 void mpi_rsend_init(void *buf, int *count, int *type, int *destpe,
00701 int *tag, int *comm, int *req, int *ierr) noexcept
00702 {
00703 *ierr = MPI_Rsend_init(buf,*count,*type,*destpe,*tag,*comm,(MPI_Request*)req);
00704 }
00705
00706 void mpi_bsend_init(void *buf, int *count, int *type, int *destpe,
00707 int *tag, int *comm, int *req, int *ierr) noexcept
00708 {
00709 *ierr = MPI_Bsend_init(buf,*count,*type,*destpe,*tag,*comm,(MPI_Request*)req);
00710 }
00711
00712 void mpi_type_contiguous(int *count, int *oldtype, int *newtype, int *ierr) noexcept
00713 {
00714 *ierr = MPI_Type_contiguous(*count, *oldtype, newtype);
00715 }
00716
00717 void mpi_type_vector(int *count, int *blocklength, int *stride,
00718 int *oldtype, int* newtype, int *ierr) noexcept
00719 {
00720 *ierr = MPI_Type_vector(*count, *blocklength, *stride, *oldtype, newtype);
00721 }
00722
00723 void mpi_type_create_hvector(int *count, int *blocklength, int *stride,
00724 int* oldtype, int* newtype, int* ierr) noexcept
00725 {
00726 *ierr = MPI_Type_create_hvector(*count, *blocklength, *stride, *oldtype, newtype);
00727 }
00728
00729 void mpi_type_hvector(int *count, int *blocklength, int *stride,
00730 int* oldtype, int* newtype, int* ierr) noexcept
00731 {
00732 *ierr = MPI_Type_hvector(*count, *blocklength, *stride, *oldtype, newtype);
00733 }
00734
00735 void mpi_type_indexed(int *count, int* arrBlength, int* arrDisp,
00736 int* oldtype, int* newtype, int* ierr) noexcept
00737 {
00738 *ierr = MPI_Type_indexed(*count, arrBlength, arrDisp, *oldtype, newtype);
00739 }
00740
00741 void mpi_type_create_hindexed(int* count, int* arrBlength, MPI_Aint* arrDisp,
00742 int* oldtype, int* newtype, int* ierr) noexcept
00743 {
00744 *ierr = MPI_Type_create_hindexed(*count, arrBlength, arrDisp, *oldtype, newtype);
00745 }
00746
00747 void mpi_type_hindexed(int* count, int* arrBlength, MPI_Aint* arrDisp,
00748 int* oldtype, int* newtype, int* ierr) noexcept
00749 {
00750 *ierr = MPI_Type_hindexed(*count, arrBlength, arrDisp, *oldtype, newtype);
00751 }
00752
00753 void mpi_type_create_indexed_block(int* count, int* Blength, int* arr,
00754 int* oldtype, int* newtype, int* ierr) noexcept
00755 {
00756 *ierr = MPI_Type_create_indexed_block(*count, *Blength, arr, *oldtype, newtype);
00757 }
00758
00759 void mpi_type_create_hindexed_block(int* count, int* Blength, MPI_Aint* arr,
00760 int* oldtype, int* newtype, int* ierr) noexcept
00761 {
00762 *ierr = MPI_Type_create_hindexed_block(*count, *Blength, arr, *oldtype, newtype);
00763 }
00764
00765 void mpi_type_create_struct(int* count, int* arrBlength, MPI_Aint* arrDisp,
00766 int* oldtype, int* newtype, int* ierr) noexcept
00767 {
00768 *ierr = MPI_Type_create_struct(*count, arrBlength, arrDisp, oldtype, newtype);
00769 }
00770
00771 void mpi_type_struct(int* count, int* arrBlength, MPI_Aint* arrDisp,
00772 int* oldtype, int* newtype, int* ierr) noexcept
00773 {
00774 *ierr = MPI_Type_struct(*count, arrBlength, arrDisp, oldtype, newtype);
00775 }
00776
00777 void mpi_type_create_resized(int* oldtype, MPI_Aint* lb, MPI_Aint* extent, int* newtype, int* ierr) noexcept
00778 {
00779 *ierr = MPI_Type_create_resized(*oldtype, *lb, *extent, newtype);
00780 }
00781
00782 void mpi_type_dup(int* oldtype, int* newtype, int* ierr) noexcept
00783 {
00784 *ierr = MPI_Type_dup(*oldtype, newtype);
00785 }
00786
00787 void mpi_type_commit(int *type, int *ierr) noexcept
00788 {
00789 *ierr = MPI_Type_commit(type);
00790 }
00791
00792 void mpi_type_free(int *type, int *ierr) noexcept
00793 {
00794 *ierr = MPI_Type_free(type);
00795 }
00796
00797 void mpi_type_create_darray(int *size, int *rank, int *ndims, int *array_of_gsizes,
00798 int *array_of_distribs, int *array_of_dargs, int *array_of_psizes, int *order,
00799 int *oldtype, int *newtype, int *ierr) noexcept
00800 {
00801 *ierr = MPI_Type_create_darray(*size, *rank, *ndims, array_of_gsizes,
00802 array_of_distribs, array_of_dargs, array_of_psizes, *order,
00803 (MPI_Datatype)*oldtype, (MPI_Datatype*)newtype);
00804 }
00805
00806 void mpi_type_create_subarray(int *ndims, int *array_of_sizes, int *array_of_subsizes,
00807 int *array_of_starts, int *order, int *oldtype, int *newtype, int *ierr) noexcept
00808 {
00809 *ierr = MPI_Type_create_subarray(*ndims, array_of_sizes, array_of_subsizes,
00810 array_of_starts, *order, (MPI_Datatype)*oldtype, (MPI_Datatype*)newtype);
00811 }
00812
00813
00814 void mpi_type_get_extent(int* type, MPI_Aint* lb, MPI_Aint* extent, int* ierr) noexcept
00815 {
00816 *ierr = MPI_Type_get_extent(*type, lb, extent);
00817 }
00818
00819 void mpi_type_get_extent_x(int* type, MPI_Count* lb, MPI_Count* extent, int* ierr) noexcept
00820 {
00821 *ierr = MPI_Type_get_extent_x(*type, lb, extent);
00822 }
00823
00824 void mpi_type_extent(int* type, MPI_Aint* extent, int* ierr) noexcept
00825 {
00826 *ierr = MPI_Type_extent(*type, extent);
00827 }
00828
00829 void mpi_type_get_true_extent(int* datatype, MPI_Aint* true_lb, MPI_Aint* true_extent, int* ierr) noexcept
00830 {
00831 *ierr = MPI_Type_get_true_extent(*datatype, true_lb, true_extent);
00832 }
00833
00834 void mpi_type_get_true_extent_x(int* datatype, MPI_Count* true_lb, MPI_Count* true_extent, int* ierr) noexcept
00835 {
00836 *ierr = MPI_Type_get_true_extent_x(*datatype, true_lb, true_extent);
00837 }
00838
00839 void mpi_type_size(int* type, int* size, int* ierr) noexcept
00840 {
00841 *ierr = MPI_Type_size(*type, size);
00842 }
00843
00844 void mpi_type_size_x(int* type, MPI_Count* size, int* ierr) noexcept
00845 {
00846 *ierr = MPI_Type_size_x(*type, size);
00847 }
00848
00849 void mpi_type_lb(int* datatype, MPI_Aint* displacement, int* ierr) noexcept
00850 {
00851 *ierr = MPI_Type_lb(*datatype, displacement);
00852 }
00853
00854 void mpi_type_ub(int* datatype, MPI_Aint* displacement, int* ierr) noexcept
00855 {
00856 *ierr = MPI_Type_ub(*datatype, displacement);
00857 }
00858
00859 void ampif_type_set_name(int* datatype, const char* name, int *nlen, int* ierr) noexcept
00860 {
00861 char tmpName[MPI_MAX_OBJECT_NAME];
00862 ampif_str_f2c(tmpName, name, *nlen);
00863
00864 *ierr = MPI_Type_set_name(*datatype, tmpName);
00865 }
00866
00867 void mpi_type_get_name(int* datatype, char* name, int* resultlen, int* ierr) noexcept
00868 {
00869 char tmpName[MPI_MAX_OBJECT_NAME];
00870
00871 *ierr = MPI_Type_get_name(*datatype, tmpName, resultlen);
00872
00873 if (*ierr == MPI_SUCCESS)
00874 ampif_str_c2f(name, tmpName, MPI_MAX_OBJECT_NAME);
00875 }
00876
00877 void mpi_type_set_attr(int *datatype, int *type_keyval, void *attribute_val, int *ierr) noexcept
00878 {
00879 *ierr = MPI_Type_set_attr(*datatype, *type_keyval, attribute_val);
00880 }
00881
00882 void mpi_type_get_attr(int *datatype, int *type_keyval, void *attribute_val, int *flag, int *ierr) noexcept
00883 {
00884 *ierr = MPI_Type_get_attr(*datatype, *type_keyval, attribute_val, flag);
00885 }
00886
00887 void mpi_type_delete_attr(int *datatype, int *type_keyval, int *ierr) noexcept
00888 {
00889 *ierr = MPI_Type_delete_attr(*datatype, *type_keyval);
00890 }
00891
00892 void mpi_type_create_keyval(int (*type_copy_attr_fn)(int,int,void*,void*,void*,int*),
00893 int (*type_delete_attr_function)(int,int,void*,void*),
00894 int *type_keyval, void *extra_state, int *ierr) noexcept
00895 {
00896 *ierr = MPI_Type_create_keyval(type_copy_attr_fn, type_delete_attr_function,
00897 type_keyval, extra_state);
00898 }
00899
00900 void mpi_type_free_keyval(int *type_keyval, int *ierr) noexcept
00901 {
00902 *ierr = MPI_Type_free_keyval(type_keyval);
00903 }
00904
00905 void mpi_get_address(const void* location, MPI_Aint *address, int* ierr) noexcept
00906 {
00907 *ierr = MPI_Get_address(location, address);
00908 }
00909
00910 void mpi_address(void* location, MPI_Aint *address, int* ierr) noexcept
00911 {
00912 *ierr = MPI_Address(location, address);
00913 }
00914
00915 void mpi_status_set_elements(int *status, int* datatype, int *count, int* ierr) noexcept
00916 {
00917 MPI_Status* s = handle_MPI_STATUS_IGNORE(status);
00918 *ierr = MPI_Status_set_elements(s, *datatype, *count);
00919 }
00920
00921 void mpi_status_set_elements_x(int *status, int* datatype, MPI_Count *count, int* ierr) noexcept
00922 {
00923 MPI_Status* s = handle_MPI_STATUS_IGNORE(status);
00924 *ierr = MPI_Status_set_elements_x(s, *datatype, *count);
00925 }
00926
00927 void mpi_get_elements(int *status, int* datatype, int *count, int* ierr) noexcept
00928 {
00929 MPI_Status* s = handle_MPI_STATUS_IGNORE(status);
00930 *ierr = MPI_Get_elements(s, *datatype, count);
00931 }
00932
00933 void mpi_get_elements_x(int *status, int* datatype, MPI_Count *count, int* ierr) noexcept
00934 {
00935 MPI_Status* s = handle_MPI_STATUS_IGNORE(status);
00936 *ierr = MPI_Get_elements_x(s, *datatype, count);
00937 }
00938
00939 void mpi_pack(void *inbuf, int *incount, int *datatype, void *outbuf,
00940 int *outsize, int *position, int *comm, int *ierr) noexcept
00941 {
00942 *ierr = MPI_Pack(inbuf, *incount, (MPI_Datatype)*datatype, outbuf,
00943 *outsize, position, *comm);
00944 }
00945
00946 void mpi_unpack(void *inbuf, int *insize, int *position, void *outbuf,
00947 int *outcount, int *datatype, int *comm, int *ierr) noexcept
00948 {
00949 *ierr = MPI_Unpack(inbuf, *insize, position, outbuf, *outcount,
00950 (MPI_Datatype) *datatype, (MPI_Comm) *comm);
00951 }
00952
00953 void mpi_pack_size(int *incount, int *datatype, int *comm, int *size, int *ierr) noexcept
00954 {
00955 *ierr = MPI_Pack_size(*incount, (MPI_Datatype) *datatype, *comm, size);
00956 }
00957
00958 MPI_Aint mpi_aint_add(MPI_Aint *addr, MPI_Aint *disp) noexcept
00959 {
00960 return MPI_Aint_add(*addr, *disp);
00961 }
00962
00963 MPI_Aint mpi_aint_diff(MPI_Aint *addr1, MPI_Aint *addr2) noexcept
00964 {
00965 return MPI_Aint_diff(*addr1, *addr2);
00966 }
00967
00968 void mpi_isend(void *buf, int *count, int *datatype, int *dest,
00969 int *tag, int *comm, int *request, int *ierr) noexcept
00970 {
00971 *ierr = MPI_Isend(buf, *count, *datatype, *dest, *tag, *comm, (MPI_Request *)request);
00972 }
00973
00974 void mpi_ibsend(void *buf, int *count, int *datatype, int *dest,
00975 int *tag, int *comm, int *request, int *ierr) noexcept
00976 {
00977 *ierr = MPI_Ibsend(buf, *count, *datatype, *dest, *tag, *comm, (MPI_Request *)request);
00978 }
00979
00980 void mpi_irsend(void *buf, int *count, int *datatype, int *dest,
00981 int *tag, int *comm, int *request, int *ierr) noexcept
00982 {
00983 *ierr = MPI_Irsend(buf, *count, *datatype, *dest, *tag, *comm, (MPI_Request *)request);
00984 }
00985
00986 void mpi_irecv(void *buf, int *count, int *datatype, int *src,
00987 int *tag, int *comm, int *request, int *ierr) noexcept
00988 {
00989 *ierr = MPI_Irecv(buf, *count, *datatype, *src, *tag, *comm, (MPI_Request *)request);
00990 }
00991
00992 void mpi_mrecv(void *buf, int *count, int *datatype, int *message,
00993 int *status, int *ierr) noexcept
00994 {
00995 *ierr = MPI_Mrecv(buf, *count, *datatype, message, (MPI_Status*) status);
00996 }
00997
00998 void mpi_imrecv(void *buf, int *count, int *datatype, int *message,
00999 int *request, int *ierr) noexcept
01000 {
01001 *ierr = MPI_Imrecv(buf, *count, *datatype, message, (MPI_Request*) request);
01002 }
01003
01004 void mpi_allgatherv(void *sendbuf, int *sendcount, int *sendtype,
01005 void *recvbuf, int *recvcounts, int *displs,
01006 int *recvtype, int *comm, int *ierr) noexcept
01007 {
01008 handle_MPI_IN_PLACE_f(sendbuf, recvbuf);
01009 *ierr = MPI_Allgatherv(sendbuf, *sendcount, *sendtype, recvbuf, recvcounts,
01010 displs, *recvtype, *comm);
01011 }
01012
01013 void mpi_iallgatherv(void *sendbuf, int *sendcount, int *sendtype,
01014 void *recvbuf, int *recvcounts, int *displs,
01015 int *recvtype, int *comm, int *request, int *ierr) noexcept
01016 {
01017 handle_MPI_IN_PLACE_f(sendbuf, recvbuf);
01018 *ierr = MPI_Iallgatherv(sendbuf, *sendcount, *sendtype, recvbuf, recvcounts,
01019 displs, *recvtype, *comm, request);
01020 }
01021
01022 void mpi_allgather(void *sendbuf, int *sendcount, int *sendtype,
01023 void *recvbuf, int *recvcount, int *recvtype,
01024 int *comm, int *ierr) noexcept
01025 {
01026 handle_MPI_IN_PLACE_f(sendbuf, recvbuf);
01027 *ierr = MPI_Allgather(sendbuf, *sendcount, *sendtype, recvbuf, *recvcount,
01028 *recvtype, *comm);
01029 }
01030
01031 void mpi_gatherv(void *sendbuf, int *sendcount, int *sendtype,
01032 void *recvbuf, int *recvcounts, int *displs,
01033 int *recvtype, int *root, int *comm, int *ierr) noexcept
01034 {
01035 handle_MPI_IN_PLACE_f(sendbuf, recvbuf);
01036 *ierr = MPI_Gatherv(sendbuf, *sendcount, *sendtype, recvbuf, recvcounts,
01037 displs, *recvtype, *root, *comm);
01038 }
01039
01040 void mpi_igatherv(void *sendbuf, int *sendcount, int *sendtype,
01041 void *recvbuf, int *recvcounts, int *displs,
01042 int *recvtype, int *root, int *comm, int *request, int *ierr) noexcept
01043 {
01044 handle_MPI_IN_PLACE_f(sendbuf, recvbuf);
01045 *ierr = MPI_Igatherv(sendbuf, *sendcount, *sendtype, recvbuf, recvcounts,
01046 displs, *recvtype, *root, *comm, request);
01047 }
01048
01049 void mpi_gather(void *sendbuf, int *sendcount, int *sendtype,
01050 void *recvbuf, int *recvcount, int *recvtype,
01051 int *root, int *comm, int *ierr) noexcept
01052 {
01053 handle_MPI_IN_PLACE_f(sendbuf, recvbuf);
01054 *ierr = MPI_Gather(sendbuf, *sendcount, *sendtype, recvbuf, *recvcount,
01055 *recvtype, *root, *comm);
01056 }
01057
01058 void mpi_igather(void *sendbuf, int *sendcount, int *sendtype,
01059 void *recvbuf, int *recvcount, int *recvtype,
01060 int *root, int *comm, int *request, int *ierr) noexcept
01061 {
01062 handle_MPI_IN_PLACE_f(sendbuf, recvbuf);
01063 *ierr = MPI_Igather(sendbuf, *sendcount, *sendtype, recvbuf, *recvcount,
01064 *recvtype, *root, *comm, request);
01065 }
01066
01067 void mpi_scatterv(void *sendbuf, int *sendcounts, int *displs, int *sendtype,
01068 void *recvbuf, int *recvcount, int *recvtype, int *root, int *comm, int *ierr) noexcept
01069 {
01070 handle_MPI_IN_PLACE_f(sendbuf, recvbuf);
01071 *ierr = MPI_Scatterv(sendbuf, sendcounts, displs, *sendtype, recvbuf, *recvcount,
01072 *recvtype, *root, *comm);
01073 }
01074
01075 void mpi_iscatterv(void *sendbuf, int *sendcounts, int *displs, int *sendtype,
01076 void *recvbuf, int *recvcount, int *recvtype, int *root, int *comm,
01077 int *request, int *ierr) noexcept
01078 {
01079 handle_MPI_IN_PLACE_f(sendbuf, recvbuf);
01080 *ierr = MPI_Iscatterv(sendbuf, sendcounts, displs, *sendtype, recvbuf, *recvcount,
01081 *recvtype, *root, *comm, request);
01082 }
01083
01084 void mpi_scatter(void *sendbuf, int *sendcount, int *sendtype,
01085 void *recvbuf, int *recvcount, int *recvtype,
01086 int *root, int *comm, int *ierr) noexcept
01087 {
01088 handle_MPI_IN_PLACE_f(sendbuf, recvbuf);
01089 *ierr = MPI_Scatter(sendbuf, *sendcount, *sendtype, recvbuf, *recvcount,
01090 *recvtype, *root, *comm);
01091 }
01092
01093 void mpi_iscatter(void *sendbuf, int *sendcount, int *sendtype,
01094 void *recvbuf, int *recvcount, int *recvtype,
01095 int *root, int *comm, int *request, int *ierr) noexcept
01096 {
01097 handle_MPI_IN_PLACE_f(sendbuf, recvbuf);
01098 *ierr = MPI_Iscatter(sendbuf, *sendcount, *sendtype, recvbuf, *recvcount,
01099 *recvtype, *root, *comm, request);
01100 }
01101
01102 void mpi_alltoallv(void *sendbuf, int *sendcounts, int *sdispls,
01103 int *sendtype, void *recvbuf, int *recvcounts,
01104 int *rdispls, int *recvtype, int *comm, int *ierr) noexcept
01105 {
01106 handle_MPI_IN_PLACE_f(sendbuf, recvbuf);
01107 *ierr = MPI_Alltoallv(sendbuf, sendcounts, sdispls, *sendtype, recvbuf,
01108 recvcounts, rdispls, *recvtype, *comm);
01109 }
01110
01111 void mpi_ialltoallv(void *sendbuf, int *sendcounts, int *sdispls,
01112 int *sendtype, void *recvbuf, int *recvcounts,
01113 int *rdispls, int *recvtype, int *comm, int *request, int *ierr) noexcept
01114 {
01115 handle_MPI_IN_PLACE_f(sendbuf, recvbuf);
01116 *ierr = MPI_Ialltoallv(sendbuf, sendcounts, sdispls, *sendtype, recvbuf,
01117 recvcounts, rdispls, *recvtype, *comm, request);
01118 }
01119
01120 void mpi_alltoallw(void *sendbuf, int *sendcounts, int *sdispls,
01121 int *sendtypes, void *recvbuf, int *recvcounts, int *rdispls,
01122 int *recvtypes, int *comm, int *ierr) noexcept
01123 {
01124 handle_MPI_IN_PLACE_f(sendbuf, recvbuf);
01125 *ierr = MPI_Alltoallw(sendbuf, sendcounts, sdispls, sendtypes,
01126 recvbuf, recvcounts, rdispls, recvtypes, *comm);
01127 }
01128
01129 void mpi_ialltoallw(void *sendbuf, int *sendcounts, int *sdispls,
01130 int *sendtypes, void *recvbuf, int *recvcounts, int *rdispls,
01131 int *recvtypes, int *comm, int *request, int *ierr) noexcept
01132 {
01133 handle_MPI_IN_PLACE_f(sendbuf, recvbuf);
01134 *ierr = MPI_Ialltoallw(sendbuf, sendcounts, sdispls, sendtypes,
01135 recvbuf, recvcounts, rdispls, recvtypes,
01136 *comm, request);
01137 }
01138
01139 void mpi_alltoall(void *sendbuf, int *sendcount, int *sendtype,
01140 void *recvbuf, int *recvcount, int *recvtype,
01141 int *comm, int *ierr) noexcept
01142 {
01143 handle_MPI_IN_PLACE_f(sendbuf, recvbuf);
01144 *ierr = MPI_Alltoall(sendbuf, *sendcount, *sendtype, recvbuf, *recvcount,
01145 *recvtype, *comm);
01146 }
01147
01148 void mpi_iallgather(void *sendbuf, int* sendcount, int* sendtype,
01149 void *recvbuf, int* recvcount, int* recvtype,
01150 int* comm, int* request, int* ierr) noexcept
01151 {
01152 handle_MPI_IN_PLACE_f(sendbuf, recvbuf);
01153 *ierr = MPI_Iallgather(sendbuf, *sendcount, *sendtype, recvbuf, *recvcount,
01154 *recvtype, *comm, (MPI_Request *)request);
01155
01156 }
01157
01158 void mpi_ialltoall(void *sendbuf, int* sendcount, int* sendtype,
01159 void *recvbuf, int* recvcount, int* recvtype,
01160 int* comm, int *request, int* ierr) noexcept
01161 {
01162 handle_MPI_IN_PLACE_f(sendbuf, recvbuf);
01163 *ierr = MPI_Ialltoall(sendbuf, *sendcount, *sendtype,
01164 recvbuf, *recvcount, *recvtype,
01165 *comm, (MPI_Request *)request);
01166 }
01167
01168 void mpi_ireduce(void *sendbuf, void *recvbuf, int* count, int* type,
01169 int* op, int* root, int* comm, int *request, int* ierr) noexcept
01170 {
01171 handle_MPI_IN_PLACE_f(sendbuf, recvbuf);
01172 *ierr = MPI_Ireduce(sendbuf, recvbuf, *count, *type,
01173 *op, *root, *comm, (MPI_Request*) request);
01174 }
01175
01176 void mpi_iallreduce(void *inbuf, void *outbuf, int* count, int* type,
01177 int* op, int* comm, int *request, int* ierr) noexcept
01178 {
01179 handle_MPI_IN_PLACE_f(inbuf, outbuf);
01180 *ierr = MPI_Iallreduce(inbuf, outbuf, *count, *type,
01181 *op, *comm, (MPI_Request*) request);
01182 }
01183
01184 void mpi_reduce_local(void *inbuf, void *outbuf, int *count, int *type,
01185 int *op, int *ierr) noexcept
01186 {
01187 *ierr = MPI_Reduce_local(inbuf, outbuf, *count, *type, *op);
01188 }
01189
01190 void mpi_reduce_scatter_block(void* sendbuf, void* recvbuf, int *count,
01191 int *type, int *op, int *comm, int *ierr) noexcept
01192 {
01193 handle_MPI_IN_PLACE_f(sendbuf, recvbuf);
01194 *ierr = MPI_Reduce_scatter_block(sendbuf, recvbuf, *count, *type, *op, *comm);
01195 }
01196
01197 void mpi_ireduce_scatter_block(void* sendbuf, void* recvbuf, int *count,
01198 int *type, int *op, int *comm, int* request, int *ierr) noexcept
01199 {
01200 handle_MPI_IN_PLACE_f(sendbuf, recvbuf);
01201 *ierr = MPI_Ireduce_scatter_block(sendbuf, recvbuf, *count, *type, *op, *comm, request);
01202 }
01203
01204 void mpi_reduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts,
01205 int* datatype, int* op, int* comm, int* ierr) noexcept
01206 {
01207 handle_MPI_IN_PLACE_f(sendbuf, recvbuf);
01208 *ierr = MPI_Reduce_scatter(sendbuf, recvbuf, recvcounts,
01209 *datatype, *op, *comm);
01210 }
01211
01212 void mpi_ireduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts,
01213 int* datatype, int* op, int* comm, int* request, int* ierr) noexcept
01214 {
01215 handle_MPI_IN_PLACE_f(sendbuf, recvbuf);
01216 *ierr = MPI_Ireduce_scatter(sendbuf, recvbuf, recvcounts,
01217 *datatype, *op, *comm, request);
01218 }
01219
01220 void mpi_scan(void* sendbuf, void* recvbuf, int* count, int* datatype, int* op, int* comm, int* ierr) noexcept
01221 {
01222 handle_MPI_IN_PLACE_f(sendbuf,recvbuf);
01223 *ierr = MPI_Scan(sendbuf,recvbuf,*count,*datatype,*op,*comm );
01224 }
01225
01226 void mpi_iscan(void* sendbuf, void* recvbuf, int* count, int* datatype, int* op, int* comm, int* request, int* ierr) noexcept
01227 {
01228 handle_MPI_IN_PLACE_f(sendbuf,recvbuf);
01229 *ierr = MPI_Iscan(sendbuf,recvbuf,*count,*datatype,*op,*comm,request);
01230 }
01231
01232 void mpi_exscan(void* sendbuf, void* recvbuf, int* count, int* datatype, int* op, int* comm, int* ierr) noexcept
01233 {
01234 handle_MPI_IN_PLACE_f(sendbuf, recvbuf);
01235 *ierr = MPI_Exscan(sendbuf,recvbuf,*count,*datatype,*op,*comm);
01236 }
01237
01238 void mpi_iexscan(void* sendbuf, void* recvbuf, int* count, int* datatype, int* op, int* comm, int* request, int* ierr) noexcept
01239 {
01240 handle_MPI_IN_PLACE_f(sendbuf, recvbuf);
01241 *ierr = MPI_Iexscan(sendbuf,recvbuf,*count,*datatype,*op,*comm,request);
01242 }
01243
01244 void mpi_neighbor_alltoall(void* sendbuf, int *sendcount, int *sendtype,
01245 void *recvbuf, int *recvcount, int *recvtype,
01246 int *comm, int *ierr) noexcept
01247 {
01248 *ierr = MPI_Neighbor_alltoall(sendbuf, *sendcount, *sendtype, recvbuf,
01249 *recvcount, *recvtype, *comm);
01250 }
01251
01252 void mpi_ineighbor_alltoall(void* sendbuf, int *sendcount, int *sendtype,
01253 void *recvbuf, int *recvcount, int *recvtype,
01254 int *comm, int *request, int *ierr) noexcept
01255 {
01256 *ierr = MPI_Ineighbor_alltoall(sendbuf, *sendcount, *sendtype, recvbuf,
01257 *recvcount, *recvtype, *comm, request);
01258 }
01259
01260 void mpi_neighbor_alltoallv(void* sendbuf, int *sendcounts, int *sdispls,
01261 int *sendtype, void *recvbuf, int *recvcounts,
01262 int *rdispls, int *recvtype, int *comm,
01263 int *ierr) noexcept
01264 {
01265 *ierr = MPI_Neighbor_alltoallv(sendbuf, sendcounts, sdispls, *sendtype,
01266 recvbuf, recvcounts, rdispls, *recvtype,
01267 *comm);
01268 }
01269
01270 void mpi_ineighbor_alltoallv(void* sendbuf, int *sendcounts, int *sdispls,
01271 int *sendtype, void *recvbuf, int *recvcounts,
01272 int *rdispls, int *recvtype, int *comm,
01273 int *request, int *ierr) noexcept
01274 {
01275 *ierr = MPI_Ineighbor_alltoallv(sendbuf, sendcounts, sdispls, *sendtype,
01276 recvbuf, recvcounts, rdispls, *recvtype,
01277 *comm, request);
01278 }
01279
01280 void mpi_neighbor_alltoallw(void* sendbuf, int *sendcounts, MPI_Aint *sdispls,
01281 int *sendtypes, void *recvbuf, int *recvcounts,
01282 MPI_Aint *rdispls, int *recvtypes, int *comm,
01283 int *ierr) noexcept
01284 {
01285 *ierr = MPI_Neighbor_alltoallw(sendbuf, sendcounts, sdispls, sendtypes,
01286 recvbuf, recvcounts, rdispls, recvtypes,
01287 *comm);
01288 }
01289
01290 void mpi_ineighbor_alltoallw(void* sendbuf, int *sendcounts, MPI_Aint *sdispls,
01291 int *sendtypes, void *recvbuf, int *recvcounts,
01292 MPI_Aint *rdispls, int *recvtypes, int *comm,
01293 int *request, int *ierr) noexcept
01294 {
01295 *ierr = MPI_Ineighbor_alltoallw(sendbuf, sendcounts, sdispls, sendtypes,
01296 recvbuf, recvcounts, rdispls, recvtypes,
01297 *comm, request);
01298 }
01299
01300 void mpi_neighbor_allgather(void* sendbuf, int *sendcount, int *sendtype,
01301 void *recvbuf, int *recvcount, int *recvtype,
01302 int *comm, int *ierr) noexcept
01303 {
01304 *ierr = MPI_Neighbor_allgather(sendbuf, *sendcount, *sendtype, recvbuf,
01305 *recvcount, *recvtype, *comm);
01306 }
01307
01308 void mpi_ineighbor_allgather(void* sendbuf, int *sendcount, int *sendtype,
01309 void *recvbuf, int *recvcount, int *recvtype,
01310 int *comm, int *request, int *ierr) noexcept
01311 {
01312 *ierr = MPI_Ineighbor_allgather(sendbuf, *sendcount, *sendtype, recvbuf,
01313 *recvcount, *recvtype, *comm, request);
01314 }
01315
01316 void mpi_neighbor_allgatherv(void* sendbuf, int *sendcount, int *sendtype,
01317 void *recvbuf, int *recvcounts, int *displs,
01318 int *recvtype, int *comm, int *ierr) noexcept
01319 {
01320 *ierr = MPI_Neighbor_allgatherv(sendbuf, *sendcount, *sendtype, recvbuf,
01321 recvcounts, displs, *recvtype, *comm);
01322 }
01323
01324 void mpi_ineighbor_allgatherv(void* sendbuf, int *sendcount, int *sendtype,
01325 void *recvbuf, int *recvcounts, int *displs,
01326 int *recvtype, int *comm, int *request, int *ierr) noexcept
01327 {
01328 *ierr = MPI_Ineighbor_allgatherv(sendbuf, *sendcount, *sendtype, recvbuf,
01329 recvcounts, displs, *recvtype, *comm, request);
01330 }
01331
01332 void mpi_op_create(void* function, int* commute, int* op, int* ierr) noexcept {
01333 *ierr = MPI_Op_create((MPI_User_function *)function, *commute, op);
01334 }
01335
01336 void mpi_op_free(int* op, int* ierr) noexcept {
01337 *ierr = MPI_Op_free(op);
01338 }
01339
01340 void mpi_op_commutative(int* op, int* commute, int* ierr) noexcept {
01341 *ierr = MPI_Op_commutative(*op, commute);
01342 }
01343
01344 void mpi_comm_dup(int *comm, int *newcomm, int *ierr) noexcept
01345 {
01346 *ierr = MPI_Comm_dup(*comm, newcomm);
01347 }
01348
01349 void mpi_comm_idup(int *comm, int *newcomm, int* request, int *ierr) noexcept
01350 {
01351 *ierr = MPI_Comm_idup(*comm, newcomm, request);
01352 }
01353
01354 void mpi_comm_dup_with_info(int *comm, int *info, int *newcomm, int *ierr) noexcept
01355 {
01356 *ierr = MPI_Comm_dup_with_info(*comm, *info, newcomm);
01357 }
01358
01359 void mpi_comm_idup_with_info(int *comm, int *info, int *newcomm, int *request, int *ierr) noexcept
01360 {
01361 *ierr = MPI_Comm_idup_with_info(*comm, *info, newcomm, request);
01362 }
01363
01364 void mpi_comm_split(int* src, int* color, int* key, int *dest, int *ierr) noexcept
01365 {
01366 *ierr = MPI_Comm_split(*src, *color, *key, dest);
01367 }
01368
01369 void mpi_comm_split_type(int* src, int* split_type, int* key, int* info, int* dest, int* ierr) noexcept
01370 {
01371 *ierr = MPI_Comm_split_type(*src, *split_type, *key, *info, dest);
01372 }
01373
01374 void mpi_comm_free(int *comm, int *ierr) noexcept
01375 {
01376 *ierr = MPI_Comm_free(comm);
01377 }
01378
01379 void mpi_comm_test_inter(int* comm, int* flag, int* ierr) noexcept
01380 {
01381 *ierr = MPI_Comm_test_inter(*comm, flag);
01382 }
01383
01384 void mpi_cart_create(int* comm_old, int* ndims, int *dims, int *periods,
01385 int* reorder, int* comm_cart, int* ierr) noexcept
01386 {
01387 *ierr = MPI_Cart_create(*comm_old, *ndims, dims, periods, *reorder, comm_cart);
01388 }
01389
01390 void mpi_graph_create(int* comm_old, int* nnodes, int *index, int *edges,
01391 int* reorder, int* comm_graph, int* ierr) noexcept
01392 {
01393 *ierr = MPI_Graph_create(*comm_old, *nnodes, index, edges, *reorder, comm_graph);
01394 }
01395
01396 void mpi_dist_graph_create_adjacent(int* comm_old, int* indegree, int* sources, int* sourceweights,
01397 int* outdegree, int* destinations, int* destweights, int* info,
01398 int* reorder, int* comm_dist_graph, int* ierr) noexcept
01399 {
01400 *ierr = MPI_Dist_graph_create_adjacent(*comm_old, *indegree, sources, sourceweights, *outdegree,
01401 destinations, destweights, *info, *reorder, comm_dist_graph);
01402 }
01403
01404 void mpi_dist_graph_create(int* comm_old, int* n, int* sources, int* degrees,
01405 int* destinations, int* weights, int* info, int* reorder,
01406 int* comm_dist_graph, int* ierr) noexcept
01407 {
01408 *ierr = MPI_Dist_graph_create(*comm_old, *n, sources, degrees, destinations,
01409 weights, *info, *reorder, comm_dist_graph);
01410 }
01411
01412 void mpi_topo_test(int* comm, int *status, int* ierr) noexcept
01413 {
01414 *ierr = MPI_Topo_test(*comm, status);
01415 }
01416
01417 void mpi_cart_map(int* comm, int* ndims, int *dims, int *periods,
01418 int *newrank, int* ierr) noexcept
01419 {
01420 *ierr = MPI_Cart_map(*comm, *ndims, dims, periods, newrank);
01421 }
01422
01423 void mpi_graph_map(int* comm, int* nnodes, int *index, int *edges,
01424 int *newrank, int* ierr) noexcept
01425 {
01426 *ierr = MPI_Graph_map(*comm, *nnodes, index, edges, newrank);
01427 }
01428
01429 void mpi_cartdim_get(int* comm, int *ndims, int* ierr) noexcept
01430 {
01431 *ierr = MPI_Cartdim_get(*comm, ndims);
01432 }
01433
01434 void mpi_cart_get(int* comm, int* maxdims, int *dims, int *periods,
01435 int *coords, int* ierr) noexcept
01436 {
01437 *ierr = MPI_Cart_get(*comm, *maxdims, dims, periods, coords);
01438 }
01439
01440 void mpi_cart_rank(int* comm, int *coords, int *rank, int* ierr) noexcept
01441 {
01442 *ierr = MPI_Cart_rank(*comm, coords, rank);
01443 }
01444
01445 void mpi_cart_coords(int* comm, int* rank, int* maxdims, int *coords, int* ierr) noexcept
01446 {
01447 *ierr = MPI_Cart_coords(*comm, *rank, *maxdims, coords);
01448 }
01449
01450 void mpi_cart_shift(int* comm, int* direction, int* disp, int *rank_source,
01451 int *rank_dest, int* ierr) noexcept
01452 {
01453 *ierr = MPI_Cart_shift(*comm, *direction, *disp, rank_source, rank_dest);
01454 }
01455
01456 void mpi_graphdims_get(int* comm, int *nnodes, int *nedges, int* ierr) noexcept
01457 {
01458 *ierr = MPI_Graphdims_get(*comm, nnodes, nedges);
01459 }
01460
01461 void mpi_graph_get(int* comm, int *maxindex, int *maxedges, int *index,
01462 int *edges, int* ierr) noexcept
01463 {
01464 *ierr = MPI_Graph_get(*comm, *maxindex, *maxedges, index, edges);
01465 }
01466
01467 void mpi_graph_neighbors_count(int* comm, int *rank, int *nneighbors, int* ierr) noexcept
01468 {
01469 *ierr = MPI_Graph_neighbors_count(*comm, *rank, nneighbors);
01470 }
01471
01472 void mpi_graph_neighbors(int* comm, int *rank, int *maxneighbors,
01473 int *neighbors, int* ierr) noexcept
01474 {
01475 *ierr = MPI_Graph_neighbors(*comm, *rank, *maxneighbors, neighbors);
01476 }
01477
01478 void mpi_dist_graph_neighbors_count(int* comm_dist_graph, int* indegree, int* outdegree,
01479 int* weighted, int* ierr) noexcept
01480 {
01481 *ierr = MPI_Dist_graph_neighbors_count(*comm_dist_graph, indegree, outdegree, weighted);
01482 }
01483
01484 void mpi_dist_graph_neighbors(int* comm_dist_graph, int* maxindegree, int* sources,
01485 int* sourceweights, int* maxoutdegree,
01486 int* destinations, int* destweights, int* ierr) noexcept
01487 {
01488 *ierr = MPI_Dist_graph_neighbors(*comm_dist_graph, *maxindegree, sources,
01489 sourceweights, *maxoutdegree, destinations, destweights);
01490 }
01491
01492 void mpi_dims_create(int *nnodes, int *ndims, int *dims, int* ierr) noexcept
01493 {
01494 *ierr = MPI_Dims_create(*nnodes, *ndims, dims);
01495 }
01496
01497 void mpi_cart_sub(int* comm, int *remain_dims, int* newcomm, int* ierr) noexcept
01498 {
01499 *ierr = MPI_Cart_sub(*comm, remain_dims, newcomm);
01500 }
01501
01502 void mpi_get_version(int *version, int *subversion, int *ierr) noexcept
01503 {
01504 *ierr = MPI_Get_version(version, subversion);
01505 }
01506
01507 void mpi_get_library_version(char* name, int *resultlen, int *ierr) noexcept
01508 {
01509 char tmpName[MPI_MAX_LIBRARY_VERSION_STRING];
01510
01511 *ierr = MPI_Get_library_version(tmpName, resultlen);
01512
01513 if (*ierr == MPI_SUCCESS)
01514 ampif_str_c2f(name, tmpName, MPI_MAX_LIBRARY_VERSION_STRING);
01515 }
01516
01517 void mpi_get_processor_name(char* name, int *resultlen, int *ierr) noexcept
01518 {
01519 char tmpName[MPI_MAX_PROCESSOR_NAME];
01520
01521 *ierr = MPI_Get_processor_name(tmpName, resultlen);
01522
01523 if (*ierr == MPI_SUCCESS)
01524 ampif_str_c2f(name, tmpName, MPI_MAX_PROCESSOR_NAME);
01525 }
01526
01527 void mpi_comm_create_errhandler(void (*function)(MPI_Comm*,int*,...), int *errhandler, int *ierr) noexcept
01528 {
01529 *ierr = MPI_Comm_create_errhandler(function, errhandler);
01530 }
01531
01532 void mpi_comm_set_errhandler(int* comm, int* errhandler, int *ierr) noexcept
01533 {
01534 *ierr = MPI_Comm_set_errhandler(*comm, *errhandler);
01535 }
01536
01537 void mpi_comm_get_errhandler(int* comm, int *errhandler, int *ierr) noexcept
01538 {
01539 *ierr = MPI_Comm_get_errhandler(*comm, errhandler);
01540 }
01541
01542 void mpi_comm_free_errhandler(int *errhandler, int *ierr) noexcept
01543 {
01544 *ierr = MPI_Comm_free_errhandler(errhandler);
01545 }
01546
01547 void mpi_errhandler_create(void (*function)(MPI_Comm*,int*,...), int *errhandler, int *ierr) noexcept
01548 {
01549 *ierr = MPI_Errhandler_create(function, errhandler);
01550 }
01551
01552 void mpi_errhandler_set(int* comm, int* errhandler, int *ierr) noexcept
01553 {
01554 *ierr = MPI_Errhandler_set(*comm, *errhandler);
01555 }
01556
01557 void mpi_errhandler_get(int* comm, int *errhandler, int *ierr) noexcept
01558 {
01559 *ierr = MPI_Errhandler_get(*comm, errhandler);
01560 }
01561
01562 void mpi_errhandler_free(int *errhandler, int *ierr) noexcept
01563 {
01564 *ierr = MPI_Errhandler_free(errhandler);
01565 }
01566
01567 void mpi_add_error_code(int *errorclass, int *errorcode, int *ierr) noexcept
01568 {
01569 *ierr = MPI_Add_error_code(*errorcode, errorcode);
01570 }
01571
01572 void mpi_add_error_class(int *errorclass, int *ierr) noexcept
01573 {
01574 *ierr = MPI_Add_error_class(errorclass);
01575 }
01576
01577 void ampif_add_error_string(int *errorcode, const char *errorstring, int* elen, int *ierr) noexcept
01578 {
01579 char tmpErrorstring[MPI_MAX_ERROR_STRING];
01580 ampif_str_f2c(tmpErrorstring, errorstring, *elen);
01581
01582 *ierr = MPI_Add_error_string(*errorcode, tmpErrorstring);
01583 }
01584
01585 void mpi_error_class(int* errorcode, int *errorclass, int *ierr) noexcept
01586 {
01587 *ierr = MPI_Error_class(*errorcode, errorclass);
01588 }
01589
01590 void mpi_error_string(int* errorcode, char *string, int *resultlen, int *ierr) noexcept
01591 {
01592 char tmpString[MPI_MAX_ERROR_STRING];
01593
01594 *ierr = MPI_Error_string(*errorcode, tmpString, resultlen);
01595
01596 if (*ierr == MPI_SUCCESS)
01597 ampif_str_c2f(string, tmpString, MPI_MAX_ERROR_STRING);
01598 }
01599
01600 void mpi_group_size(int* group, int* size, int* ierror) noexcept
01601 {
01602 *ierror = MPI_Group_size(*group, size);
01603 }
01604
01605 void mpi_group_rank(int* group, int* rank, int* ierror) noexcept
01606 {
01607 *ierror = MPI_Group_rank(*group, rank);
01608 }
01609
01610 void mpi_group_translate_ranks(int* group1, int* n, int* ranks1, int* group2, int* ranks2, int* ierror) noexcept
01611 {
01612 *ierror = MPI_Group_translate_ranks(*group1, *n, ranks1, *group2, ranks2);
01613 }
01614
01615 void mpi_group_compare(int* group1, int* group2, int* result, int* ierror) noexcept
01616 {
01617 *ierror = MPI_Group_compare(*group1, *group2, result);
01618 }
01619
01620 void mpi_comm_group(int* comm, int* group, int* ierror) noexcept
01621 {
01622 *ierror = MPI_Comm_group(*comm, group);
01623 }
01624
01625 void mpi_group_union(int* group1, int* group2, int* newgroup, int* ierror) noexcept
01626 {
01627 *ierror = MPI_Group_union(*group1, *group2, newgroup);
01628 }
01629
01630 void mpi_group_intersection(int* group1, int* group2, int* newgroup, int* ierror) noexcept
01631 {
01632 *ierror = MPI_Group_intersection(*group1, *group2, newgroup);
01633 }
01634
01635 void mpi_group_difference(int* group1, int* group2, int* newgroup, int* ierror) noexcept
01636 {
01637 *ierror = MPI_Group_difference(*group1, *group2, newgroup);
01638 }
01639
01640 void mpi_group_incl(int* group, int* n, int* ranks, int* newgroup, int* ierror) noexcept
01641 {
01642 *ierror = MPI_Group_incl(*group, *n, ranks, newgroup);
01643 }
01644
01645 void mpi_group_excl(int* group, int* n, int* ranks, int* newgroup, int* ierror) noexcept
01646 {
01647 *ierror = MPI_Group_excl(*group, *n, ranks, newgroup);
01648 }
01649
01650 void mpi_group_range_incl(int* group, int* n, int ranges[][3], int* newgroup, int* ierror) noexcept
01651 {
01652 *ierror = MPI_Group_range_incl(*group, *n, ranges, newgroup);
01653 }
01654
01655 void mpi_group_range_excl(int* group,int* n, int ranges[][3], int* newgroup, int* ierror) noexcept
01656 {
01657 *ierror = MPI_Group_range_excl(*group, *n, ranges, newgroup);
01658 }
01659
01660 void mpi_group_free(int* group, int* ierror) noexcept
01661 {
01662 *ierror = MPI_Group_free(group);
01663 }
01664
01665 void mpi_comm_create(int* comm, int* group, int* newcomm, int* ierror) noexcept
01666 {
01667 *ierror = MPI_Comm_create(*comm, *group, newcomm);
01668 }
01669
01670 void mpi_comm_create_group(int* comm, int* group, int* tag, int* newcomm, int *ierror) noexcept
01671 {
01672 *ierror = MPI_Comm_create_group(*comm, *group, *tag, newcomm);
01673 }
01674
01675 void mpi_abort(int *comm, int *errorcode, int *ierr) noexcept
01676 {
01677 *ierr = MPI_Abort(*comm, *errorcode);
01678 }
01679
01680 void mpi_get_count(int *sts, int *dtype, int *cnt, int *ierr) noexcept
01681 {
01682 MPI_Status* s = handle_MPI_STATUS_IGNORE(sts);
01683 *ierr = MPI_Get_count(s, *dtype, cnt);
01684 }
01685
01686 void mpi_comm_remote_size(int *comm, int *size, int *ierr) noexcept
01687 {
01688 *ierr = MPI_Comm_remote_size(*comm, size);
01689 }
01690
01691 void mpi_comm_remote_group(int *comm, int *group, int *ierr) noexcept
01692 {
01693 *ierr = MPI_Comm_remote_group(*comm, group);
01694 }
01695
01696 void mpi_intercomm_create(int *local_comm, int *local_leader, int *peer_comm, int *remote_leader,
01697 int *tag, int *newintercomm, int *ierr) noexcept
01698 {
01699 *ierr = MPI_Intercomm_create(*local_comm, *local_leader, *peer_comm, *remote_leader,
01700 *tag, newintercomm);
01701 }
01702
01703 void mpi_intercomm_merge(int *intercomm, int *high, int *newintracomm, int *ierr) noexcept
01704 {
01705 *ierr = MPI_Intercomm_merge(*intercomm, *high, newintracomm);
01706 }
01707
01708 void ampif_comm_set_name(int *comm, const char *comm_name, int* nlen, int *ierr) noexcept
01709 {
01710 char tmpName[MPI_MAX_OBJECT_NAME];
01711 ampif_str_f2c(tmpName, comm_name, *nlen);
01712
01713 *ierr = MPI_Comm_set_name(*comm, tmpName);
01714 }
01715
01716 void mpi_comm_get_name(int *comm, char *comm_name, int *resultlen, int *ierr) noexcept
01717 {
01718 char tmpName[MPI_MAX_OBJECT_NAME];
01719
01720 *ierr = MPI_Comm_get_name(*comm, tmpName, resultlen);
01721
01722 if (*ierr == MPI_SUCCESS)
01723 ampif_str_c2f(comm_name, tmpName, MPI_MAX_OBJECT_NAME);
01724 }
01725
01726 void mpi_comm_set_info(int *comm, int *info, int *ierr) noexcept
01727 {
01728 *ierr = MPI_Comm_set_info(*comm, *info);
01729 }
01730
01731 void mpi_comm_get_info(int *comm, int *info, int *ierr) noexcept
01732 {
01733 *ierr = MPI_Comm_get_info(*comm, info);
01734 }
01735
01736 void mpi_comm_create_keyval(MPI_Comm_copy_attr_function *copy_fn,
01737 MPI_Comm_delete_attr_function *delete_fn, int *keyval,
01738 void* extra_state, int *ierr) noexcept
01739 {
01740 *ierr = MPI_Comm_create_keyval(copy_fn, delete_fn, keyval, extra_state);
01741 }
01742
01743 void mpi_comm_free_keyval(int *keyval, int *ierr) noexcept
01744 {
01745 *ierr = MPI_Comm_free_keyval(keyval);
01746 }
01747
01748 void mpi_comm_set_attr(int *comm, int *keyval, void* attribute_val, int *ierr) noexcept
01749 {
01750 *ierr = MPI_Comm_set_attr(*comm, *keyval, attribute_val);
01751 }
01752
01753 void mpi_comm_get_attr(int *comm, int *keyval, void *attribute_val, int *flag, int *ierr) noexcept
01754 {
01755 *ierr = MPI_Comm_get_attr(*comm, *keyval, attribute_val, flag);
01756 }
01757
01758 void mpi_comm_delete_attr(int *comm, int *keyval, int *ierr) noexcept
01759 {
01760 *ierr = MPI_Comm_delete_attr(*comm, *keyval);
01761 }
01762
01763 void mpi_keyval_create(MPI_Copy_function *copy_fn, MPI_Delete_function *delete_fn,
01764 int *keyval, void* extra_state, int *ierr) noexcept
01765 {
01766 *ierr = MPI_Keyval_create(copy_fn, delete_fn, keyval, extra_state);
01767 }
01768
01769 void mpi_keyval_free(int *keyval, int *ierr) noexcept
01770 {
01771 *ierr = MPI_Keyval_free(keyval);
01772 }
01773
01774 void mpi_attr_put(int *comm, int *keyval, void* attribute_val, int *ierr) noexcept
01775 {
01776 *ierr = MPI_Attr_put(*comm, *keyval, attribute_val);
01777 }
01778
01779 void mpi_attr_get(int *comm, int *keyval, void *attribute_val, int *flag, int *ierr) noexcept
01780 {
01781 *ierr = MPI_Attr_get(*comm, *keyval, attribute_val, flag);
01782 }
01783
01784 void mpi_attr_delete(int *comm, int *keyval, int *ierr) noexcept
01785 {
01786 *ierr = MPI_Attr_delete(*comm, *keyval);
01787 }
01788
01789 void mpi_type_get_envelope(int *datatype, int *num_integers, int *num_addresses,
01790 int *num_datatypes, int *combiner, int *ierr) noexcept
01791 {
01792 *ierr = MPI_Type_get_envelope(*datatype, num_integers, num_addresses, num_datatypes, combiner);
01793 }
01794
01795 void mpi_type_get_contents(int *datatype, int *max_integers, int *max_addresses,
01796 int *max_datatypes, int array_of_integers[], MPI_Aint array_of_addresses[],
01797 int array_of_datatypes[], int *ierr) noexcept
01798 {
01799 *ierr = MPI_Type_get_contents(*datatype, *max_integers, *max_addresses, *max_datatypes,
01800 array_of_integers, array_of_addresses, array_of_datatypes);
01801 }
01802
01803 void mpi_win_create(void *base, MPI_Aint *size, int *disp_unit,
01804 int *info, int *comm, MPI_Win *newwin, int *ierr) noexcept
01805 {
01806 *ierr = MPI_Win_create(base, *size, *disp_unit, *info, *comm, newwin);
01807 }
01808
01809 void mpi_win_free(int *win, int *ierr) noexcept
01810 {
01811 *ierr = MPI_Win_free(win);
01812 }
01813
01814 void mpi_win_create_errhandler(MPI_Win_errhandler_function *win_errhandler_fn,
01815 int *errhandler, int *ierr) noexcept
01816 {
01817 *ierr = MPI_Win_create_errhandler(win_errhandler_fn, errhandler);
01818 }
01819
01820 void mpi_win_call_errhandler(MPI_Win *win, int *errcode, int *ierr) noexcept
01821 {
01822 *ierr = MPI_Win_call_errhandler(*win, *errcode);
01823 }
01824
01825 void mpi_win_get_errhandler(MPI_Win *win, int *errhandler, int *ierr) noexcept
01826 {
01827 *ierr = MPI_Win_get_errhandler(*win, errhandler);
01828 }
01829
01830 void mpi_win_set_errhandler(MPI_Win *win, int *errhandler, int *ierr) noexcept
01831 {
01832 *ierr = MPI_Win_set_errhandler(*win, *errhandler);
01833 }
01834
01835 void mpi_win_create_keyval(MPI_Win_copy_attr_function *copy_fn,
01836 MPI_Win_delete_attr_function *delete_fn,
01837 int *keyval, void *extra_state, int *ierr) noexcept
01838 {
01839 *ierr = MPI_Win_create_keyval(copy_fn, delete_fn, keyval, extra_state);
01840 }
01841
01842 void mpi_win_free_keyval(int *keyval, int *ierr) noexcept
01843 {
01844 *ierr = MPI_Win_free_keyval(keyval);
01845 }
01846
01847 void mpi_win_delete_attr(int *win, int *key, int *ierr) noexcept
01848 {
01849 *ierr = MPI_Win_delete_attr(*win, *key);
01850 }
01851
01852 void mpi_win_get_attr(int *win, int *win_keyval, void *attribute_val, int *flag,
01853 int *ierr) noexcept
01854 {
01855 *ierr = MPI_Win_get_attr(*win, *win_keyval, attribute_val, flag);
01856 }
01857
01858 void mpi_win_set_attr(int *win, int *win_keyval, void *attribute_val, int *ierr) noexcept
01859 {
01860 *ierr = MPI_Win_set_attr(*win, *win_keyval, attribute_val);
01861 }
01862
01863 void mpi_win_get_group(int *win, int *group, int *ierr) noexcept
01864 {
01865 *ierr = MPI_Win_get_group(*win, group);
01866 }
01867
01868 void ampif_win_set_name(int *win, const char *name, int* nlen, int *ierr) noexcept
01869 {
01870 char tmpName[MPI_MAX_OBJECT_NAME];
01871 ampif_str_f2c(tmpName, name, *nlen);
01872
01873 *ierr = MPI_Win_set_name(*win, tmpName);
01874 }
01875
01876 void mpi_win_get_name(int *win, char *name, int *length, int *ierr) noexcept
01877 {
01878 char tmpName[MPI_MAX_OBJECT_NAME];
01879
01880 *ierr = MPI_Win_get_name(*win, tmpName, length);
01881
01882 if (*ierr == MPI_SUCCESS)
01883 ampif_str_c2f(name, tmpName, MPI_MAX_OBJECT_NAME);
01884 }
01885
01886 void mpi_win_set_info(int *win, int *info, int *ierr) noexcept
01887 {
01888 *ierr = MPI_Win_set_info(*win, *info);
01889 }
01890
01891 void mpi_win_get_info(int *win, int *info, int *ierr) noexcept
01892 {
01893 *ierr = MPI_Win_get_info(*win, info);
01894 }
01895
01896 void mpi_win_fence(int *assertion, int *win, int *ierr) noexcept
01897 {
01898 *ierr = MPI_Win_fence(*assertion, *win);
01899 }
01900
01901 void mpi_win_lock(int *lock_type, int *rank, int *assert, int *win, int *ierr) noexcept
01902 {
01903 *ierr = MPI_Win_lock(*lock_type, *rank, *assert, *win);
01904 }
01905
01906 void mpi_win_unlock(int *rank, int *win, int *ierr) noexcept
01907 {
01908 *ierr = MPI_Win_unlock(*rank, *win);
01909 }
01910
01911 void mpi_win_post(int *group, int *assertion, int *win, int *ierr) noexcept
01912 {
01913 *ierr = MPI_Win_post(*group, *assertion, *win);
01914 }
01915
01916 void mpi_win_wait(int *win, int *ierr) noexcept
01917 {
01918 *ierr = MPI_Win_wait(*win);
01919 }
01920
01921 void mpi_win_start(int *group, int *assertion, int *win, int *ierr) noexcept
01922 {
01923 *ierr = MPI_Win_start(*group, *assertion, *win);
01924 }
01925
01926 void mpi_win_complete(int *win, int *ierr) noexcept
01927 {
01928 *ierr = MPI_Win_complete(*win);
01929 }
01930
01931 void mpi_win_test(int *win, int *flag, int *ierr) noexcept
01932 {
01933 *ierr = MPI_Win_test(*win,flag);
01934 }
01935
01936 void mpi_alloc_mem(MPI_Aint *size, int *info, void *baseptr, int *ierr) noexcept
01937 {
01938 *ierr = MPI_Alloc_mem(*size, *info, baseptr);
01939 }
01940
01941 void mpi_free_mem(void *base, int *ierr) noexcept
01942 {
01943 *ierr = MPI_Free_mem(base);
01944 }
01945
01946 void mpi_put(void *orgaddr, int *orgcnt, int *orgtype, int *rank,
01947 MPI_Aint *targdisp, int *targcnt, int *targtype, int *win, int *ierr) noexcept
01948 {
01949 *ierr = MPI_Put(orgaddr, *orgcnt, *orgtype, *rank, *targdisp, *targcnt, *targtype, *win);
01950 }
01951
01952 void mpi_get(void *orgaddr, int *orgcnt, int *orgtype, int *rank,
01953 MPI_Aint *targdisp, int *targcnt, int *targtype, int *win, int *ierr) noexcept
01954 {
01955 *ierr = MPI_Get(orgaddr, *orgcnt, *orgtype, *rank, *targdisp, *targcnt, *targtype, *win);
01956 }
01957
01958 void mpi_accumulate(void *orgaddr, int *orgcnt, int *orgtype, int *rank,
01959 MPI_Aint *targdisp, int *targcnt, int *targtype,
01960 int *op, int *win, int *ierr) noexcept
01961 {
01962 *ierr = MPI_Accumulate(orgaddr, *orgcnt, *orgtype, *rank, *targdisp, *targcnt, *targtype, *op, *win);
01963 }
01964
01965 void mpi_get_accumulate(void *orgaddr, int *orgcnt, int *orgtype, void *resaddr,
01966 int *rescnt, int *restype, int *rank,
01967 MPI_Aint *targdisp, int *targcnt, int *targtype,
01968 int *op, int *win, int *ierr) noexcept
01969 {
01970 *ierr = MPI_Get_accumulate(orgaddr, *orgcnt, *orgtype, resaddr, *rescnt, *restype,
01971 *rank, *targdisp, *targcnt, *targtype, *op, *win);
01972 }
01973
01974 void mpi_rput(void *orgaddr, int *orgcnt, int *orgtype, int *rank,
01975 MPI_Aint *targdisp, int *targcnt, int *targtype, int *win,
01976 int *request, int *ierr) noexcept
01977 {
01978 *ierr = MPI_Rput(orgaddr, *orgcnt, *orgtype, *rank, *targdisp,
01979 *targcnt, *targtype, *win, request);
01980 }
01981
01982 void mpi_rget(void *orgaddr, int *orgcnt, int *orgtype, int *rank,
01983 MPI_Aint *targdisp, int *targcnt, int *targtype, int *win,
01984 int *request, int *ierr) noexcept
01985 {
01986 *ierr = MPI_Rget(orgaddr, *orgcnt, *orgtype, *rank, *targdisp,
01987 *targcnt, *targtype, *win, request);
01988 }
01989
01990 void mpi_raccumulate(void *orgaddr, int *orgcnt, int *orgtype, int *rank,
01991 MPI_Aint *targdisp, int *targcnt, int *targtype,
01992 int *op, int *win, int *request, int *ierr) noexcept
01993 {
01994 *ierr = MPI_Raccumulate(orgaddr, *orgcnt, *orgtype, *rank, *targdisp,
01995 *targcnt, *targtype, *op, *win, request);
01996 }
01997
01998 void mpi_rget_accumulate(void *orgaddr, int *orgcnt, int *orgtype, void *resaddr,
01999 int *rescnt, int *restype, int *rank,
02000 MPI_Aint *targdisp, int *targcnt, int *targtype,
02001 int *op, int *win, int *request, int *ierr) noexcept
02002 {
02003 *ierr = MPI_Rget_accumulate(orgaddr, *orgcnt, *orgtype, resaddr, *rescnt, *restype,
02004 *rank, *targdisp, *targcnt, *targtype, *op, *win, request);
02005 }
02006
02007 void mpi_fetch_and_op(void *orgaddr, void *resaddr, int *type, int *rank,
02008 MPI_Aint *targdisp, int *op, int *win, int *ierr) noexcept
02009 {
02010 *ierr = MPI_Fetch_and_op(orgaddr, resaddr, *type, *rank, *targdisp, *op, *win);
02011 }
02012
02013 void mpi_compare_and_swap(void *orgaddr, void *compaddr, void *resaddr,
02014 int *type, int *rank, MPI_Aint *targdisp,
02015 MPI_Win *win, int *ierr) noexcept
02016 {
02017 *ierr = MPI_Compare_and_swap(orgaddr, compaddr, resaddr, *type, *rank, *targdisp, *win);
02018 }
02019
02020 void mpi_info_create(int* info, int* ierr) noexcept
02021 {
02022 *ierr = MPI_Info_create(info);
02023 }
02024
02025 void ampif_info_set(int* info, const char *key, const char *value,
02026 int *klen, int *vlen, int *ierr) noexcept
02027 {
02028 char tmpKey[MPI_MAX_INFO_KEY];
02029 ampif_str_f2c(tmpKey, key, *klen);
02030
02031 char tmpValue[MPI_MAX_INFO_VAL];
02032 ampif_str_f2c(tmpValue, value, *vlen);
02033
02034 *ierr = MPI_Info_set(*info, tmpKey, tmpValue);
02035 }
02036
02037 void ampif_info_delete(int* info, const char* key, int* klen, int* ierr) noexcept
02038 {
02039 char tmpKey[MPI_MAX_INFO_KEY];
02040 ampif_str_f2c(tmpKey, key, *klen);
02041
02042 *ierr = MPI_Info_delete(*info, tmpKey);
02043 }
02044
02045 void ampif_info_get(int* info, const char *key, int* valuelen, char *value, int *flag,
02046 int* klen, int* ierr) noexcept
02047 {
02048 char tmpKey[MPI_MAX_INFO_KEY];
02049 ampif_str_f2c(tmpKey, key, *klen);
02050
02051 vector<char> tmpValue(*valuelen);
02052
02053 *ierr = MPI_Info_get(*info, tmpKey, *valuelen, tmpValue.data(), flag);
02054
02055 if (*ierr == MPI_SUCCESS)
02056 ampif_str_c2f(value, tmpValue.data(), *valuelen);
02057 }
02058
02059 void ampif_info_get_valuelen(int* info, const char *key, int *valuelen, int *flag,
02060 int *klen, int* ierr) noexcept
02061 {
02062 char tmpKey[MPI_MAX_INFO_KEY];
02063 ampif_str_f2c(tmpKey, key, *klen);
02064
02065 *ierr = MPI_Info_get_valuelen(*info, tmpKey, valuelen, flag);
02066 }
02067
02068 void mpi_info_get_nkeys(int* info, int *nkeys, int* ierr) noexcept
02069 {
02070 *ierr = MPI_Info_get_nkeys(*info, nkeys);
02071 }
02072
02073 void mpi_info_get_nthkey(int* info, int *n, char *key, int* ierr) noexcept
02074 {
02075 char tmpKey[MPI_MAX_INFO_KEY];
02076
02077 *ierr = MPI_Info_get_nthkey(*info, *n, tmpKey);
02078
02079 if (*ierr == MPI_SUCCESS)
02080 ampif_str_c2f(key, tmpKey, MPI_MAX_INFO_KEY);
02081 }
02082
02083 void mpi_info_dup(int* info, int* newinfo, int* ierr) noexcept
02084 {
02085 *ierr = MPI_Info_dup(*info, newinfo);
02086 }
02087
02088 void mpi_info_free(int* info, int* ierr) noexcept
02089 {
02090 *ierr = MPI_Info_free(info);
02091 }
02092
02093 void mpi_pcontrol(int *level) noexcept
02094 {
02095 MPI_Pcontrol(*level);
02096 }
02097
02098
02099 void ampi_migrate(int *hints, int *ierr) noexcept
02100 {
02101 *ierr = AMPI_Migrate(*hints);
02102 }
02103
02104 void ampi_load_start_measure(int *ierr) noexcept
02105 {
02106 *ierr = AMPI_Load_start_measure();
02107 }
02108
02109 void ampi_load_stop_measure(int *ierr) noexcept
02110 {
02111 *ierr = AMPI_Load_stop_measure();
02112 }
02113
02114 void ampi_load_reset_measure(int *ierr) noexcept
02115 {
02116 *ierr = AMPI_Load_reset_measure();
02117 }
02118
02119 void ampi_load_set_value(double *value, int *ierr) noexcept
02120 {
02121 *ierr = AMPI_Load_set_value(*value);
02122 }
02123
02124 #if CMK_FAULT_EVAC
02125 void ampi_evacuate(int *ierr) noexcept
02126 {
02127 *ierr = AMPI_Evacuate();
02128 }
02129 #endif
02130
02131 void ampi_migrate_to_pe(int *dest, int *ierr) noexcept
02132 {
02133 *ierr = AMPI_Migrate_to_pe(*dest);
02134 }
02135
02136 void ampi_set_migratable(int *mig, int *ierr) noexcept
02137 {
02138 *ierr = AMPI_Set_migratable(*mig);
02139 }
02140
02141 void ampi_register_main(MPI_MainFn fn, const char *name, int *ierr) noexcept
02142 {
02143 *ierr = AMPI_Register_main(fn, name);
02144 }
02145
02146 void ampi_register_pup(MPI_PupFn fn, void *data, int *idx, int *ierr) noexcept
02147 {
02148 *ierr = AMPI_Register_pup(fn, data, idx);
02149 }
02150
02151 void ampi_register_about_to_migrate(MPI_MigrateFn fn, int *ierr) noexcept
02152 {
02153 *ierr = AMPI_Register_about_to_migrate(fn);
02154 }
02155
02156 void ampi_register_just_migrated(MPI_MigrateFn fn, int *ierr) noexcept
02157 {
02158 *ierr = AMPI_Register_just_migrated(fn);
02159 }
02160
02161 void ampi_type_is_contiguous(int *datatype, int *flag, int *ierr) noexcept
02162 {
02163 *ierr = AMPI_Type_is_contiguous(*datatype, flag);
02164 }
02165
02166 void ampi_get_pup_data(int *idx, void *data, int *ierr) noexcept
02167 {
02168 *ierr = AMPI_Get_pup_data(*idx, data);
02169 }
02170
02171 void ampi_iget(MPI_Aint *orgdisp, int *orgcnt, int *orgtype, int *rank,
02172 MPI_Aint *targdisp, int *targcnt, int *targtype, int *win,
02173 int *request, int *ierr) noexcept
02174 {
02175 *ierr = AMPI_Iget(*orgdisp, *orgcnt, *orgtype, *rank, *targdisp, *targcnt,
02176 *targtype, *win, request);
02177 }
02178
02179 void ampi_iget_wait(int *request, int *status, int *win, int *ierr) noexcept
02180 {
02181 *ierr = AMPI_Iget_wait(request, (MPI_Status*)status, *win);
02182 }
02183
02184 void ampi_iget_free(int *request, int *status, int *win, int *ierr) noexcept
02185 {
02186 *ierr = AMPI_Iget_free(request, (MPI_Status*)status, *win);
02187 }
02188
02189 void ampi_iget_data(void *data, int *status, int *ierr) noexcept
02190 {
02191 *ierr = AMPI_Iget_data(data, *((MPI_Status*)status));
02192 }
02193
02194 void ampi_alltoall_medium(void *data, int *sendcount, int *sendtype,
02195 void *recvbuf, int *recvcount, int *recvtype,
02196 int *comm, int *ierr) noexcept
02197 {
02198 *ierr = AMPI_Alltoall_medium(data, *sendcount, *sendtype, recvbuf,
02199 *recvcount, *recvtype, *comm);
02200 }
02201
02202 void ampi_alltoall_long(void *data, int *sendcount, int *sendtype,
02203 void *recvbuf, int *recvcount, int *recvtype,
02204 int *comm, int *ierr) noexcept
02205 {
02206 *ierr = AMPI_Alltoall_long(data, *sendcount, *sendtype, recvbuf,
02207 *recvcount, *recvtype, *comm);
02208 }
02209
02210 void ampi_yield(int *ierr) noexcept
02211 {
02212 *ierr = AMPI_Yield();
02213 }
02214
02215 void ampi_suspend(int *ierr) noexcept
02216 {
02217 *ierr = AMPI_Suspend();
02218 }
02219
02220 void ampi_resume(int *dest, int *comm, int *ierr) noexcept
02221 {
02222 *ierr = AMPI_Resume(*dest, *comm);
02223 }
02224
02225 void ampif_print(const char *str, int *len, int *ierr) noexcept
02226 {
02227 char tmpStr[MPI_MAX_ERROR_STRING];
02228 ampif_str_f2c(tmpStr, str, *len);
02229
02230 *ierr = AMPI_Print(tmpStr);
02231 }
02232
02233 void ampi_trace_begin(int *ierr) noexcept
02234 {
02235 *ierr = AMPI_Trace_begin();
02236 }
02237
02238 void ampi_trace_end(int *ierr) noexcept
02239 {
02240 *ierr = AMPI_Trace_end();
02241 }
02242
02243 #if CMK_BIGSIM_CHARM
02244 void ampi_set_start_event(int *comm, int *ierr) {
02245 *ierr = AMPI_Set_start_event(*comm);
02246 }
02247
02248 void ampi_set_end_event(int *ierr) {
02249 *ierr = AMPI_Set_end_event();
02250 }
02251
02252 void begintracebigsim(char* msg){
02253 beginTraceBigSim(msg);
02254 }
02255
02256 void endtracebigsim(char* msg, char* param){
02257 endTraceBigSim(msg, param);
02258 }
02259 #endif
02260
02261 #if CMK_CUDA
02262 void ampi_gpu_iinvoke_wr(int *to_call, int *request, int *ierr) noexcept {
02263 *ierr = AMPI_GPU_Iinvoke_wr((hapiWorkRequest *)to_call, request);
02264 }
02265
02266 void ampi_gpu_invoke_wr(int *to_call, int *ierr) noexcept {
02267 *ierr = AMPI_GPU_Invoke_wr((hapiWorkRequest *)to_call);
02268 }
02269 #endif
02270
02271
02272
02273
02274
02275
02276
02277 void ampi_command_argument_count(int *count) noexcept {
02278 *count = AMPI_Get_argc()-1;
02279 }
02280
02281 void ampi_get_command_argument(int *c, char *str, int *len, int *ierr) noexcept
02282 {
02283 char **argv = AMPI_Get_argv();
02284 int nc = AMPI_Get_argc()-1;
02285 int arglen = strlen(argv[*c]);
02286
02287 if (*c >= 0 && *c <= nc) {
02288 if (arglen <= *len) {
02289 memcpy(str, argv[*c], arglen);
02290 for (int j=arglen; j<*len; j++) str[j] = ' ';
02291 *ierr = 0;
02292 } else {
02293 memcpy(str, argv[*c], *len);
02294 *ierr = -1;
02295 }
02296 }
02297 else {
02298 memset(str, ' ', *len);
02299 *ierr = 1;
02300 }
02301 }
02302
02303 void ampi_init_universe(int *unicomm, int *ierr) noexcept
02304 {
02305 *ierr = AMPI_Init_universe(unicomm);
02306 }
02307
02308 }
02309