From 1ae543995a64809d31b4792c7cc3791951bf05f4 Mon Sep 17 00:00:00 2001 From: Jake Tronge Date: Mon, 12 Aug 2024 09:49:34 -0600 Subject: [PATCH] Generate interfaces for C with bigcount This adds scripts for generating the C API bindings from template files, while also generating bigcount interfaces for those that require them. The binding script also include initial support for the mpi_f08 Fortran bindings, but doesn't yet make any changes to fortran/use-mpi-f08 Python >=3.6 is required for running these scripts, which is only necessary when the binding files have not already been generated. Users of the distribution tarball should not need to generate these files and thus should not require Python. Co-authored-by: mphinney1100 Co-authored-by: Howard Pritchard Signed-off-by: Jake Tronge --- .gitignore | 11 +- config/ompi_config_files.m4 | 2 +- config/ompi_configure_options.m4 | 21 + config/ompi_fortran_check_ts.m4 | 69 + config/ompi_setup_mpi_fortran.m4 | 65 +- docs/developers/bindings.rst | 146 ++ docs/developers/index.rst | 1 + ompi/include/mpi.h.in | 843 ++++++++++- ompi/mpi/Makefile.am | 9 +- ompi/mpi/bindings/bindings.py | 75 + ompi/mpi/bindings/ompi_bindings/c.py | 377 +++++ ompi/mpi/bindings/ompi_bindings/c_type.py | 1144 +++++++++++++++ ompi/mpi/bindings/ompi_bindings/consts.py | 253 ++++ ompi/mpi/bindings/ompi_bindings/fortran.py | 291 ++++ .../bindings/ompi_bindings/fortran_type.py | 475 ++++++ ompi/mpi/bindings/ompi_bindings/parser.py | 137 ++ ompi/mpi/bindings/ompi_bindings/util.py | 132 ++ ompi/mpi/c/Makefile.am | 1287 +++++++++++------ ompi/mpi/c/{abort.c => abort.c.in} | 12 +- ompi/mpi/c/{accumulate.c => accumulate.c.in} | 15 +- ...add_error_class.c => add_error_class.c.in} | 11 +- .../{add_error_code.c => add_error_code.c.in} | 12 +- ...d_error_string.c => add_error_string.c.in} | 11 +- ompi/mpi/c/{allgather.c => allgather.c.in} | 16 +- .../{allgather_init.c => allgather_init.c.in} | 16 +- ompi/mpi/c/{allgatherv.c => allgatherv.c.in} | 15 +- ...allgatherv_init.c => allgatherv_init.c.in} | 17 +- ompi/mpi/c/{alloc_mem.c => alloc_mem.c.in} | 12 +- ompi/mpi/c/{allreduce.c => allreduce.c.in} | 14 +- .../{allreduce_init.c => allreduce_init.c.in} | 16 +- ompi/mpi/c/{alltoall.c => alltoall.c.in} | 15 +- .../c/{alltoall_init.c => alltoall_init.c.in} | 16 +- ompi/mpi/c/{alltoallv.c => alltoallv.c.in} | 20 +- .../{alltoallv_init.c => alltoallv_init.c.in} | 18 +- ompi/mpi/c/{alltoallw.c => alltoallw.c.in} | 18 +- .../{alltoallw_init.c => alltoallw_init.c.in} | 17 +- .../mpi/c/{attr_delete.c => attr_delete.c.in} | 12 +- ompi/mpi/c/{attr_get.c => attr_get.c.in} | 10 +- ompi/mpi/c/{attr_put.c => attr_put.c.in} | 11 +- ompi/mpi/c/{barrier.c => barrier.c.in} | 12 +- .../c/{barrier_init.c => barrier_init.c.in} | 11 +- ompi/mpi/c/{bcast.c => bcast.c.in} | 13 +- ompi/mpi/c/{bcast_init.c => bcast_init.c.in} | 13 +- ompi/mpi/c/{bsend.c => bsend.c.in} | 11 +- ompi/mpi/c/{bsend_init.c => bsend_init.c.in} | 14 +- .../c/{buffer_attach.c => buffer_attach.c.in} | 12 +- .../c/{buffer_detach.c => buffer_detach.c.in} | 12 +- ompi/mpi/c/{cancel.c => cancel.c.in} | 12 +- .../mpi/c/{cart_coords.c => cart_coords.c.in} | 10 +- .../mpi/c/{cart_create.c => cart_create.c.in} | 13 +- ompi/mpi/c/{cart_get.c => cart_get.c.in} | 12 +- ompi/mpi/c/{cart_map.c => cart_map.c.in} | 13 +- ompi/mpi/c/{cart_rank.c => cart_rank.c.in} | 10 +- ompi/mpi/c/{cart_shift.c => cart_shift.c.in} | 13 +- ompi/mpi/c/{cart_sub.c => cart_sub.c.in} | 12 +- .../mpi/c/{cartdim_get.c => cartdim_get.c.in} | 12 +- ompi/mpi/c/{close_port.c => close_port.c.in} | 12 +- .../mpi/c/{comm_accept.c => comm_accept.c.in} | 13 +- ompi/mpi/c/{comm_c2f.c => comm_c2f.c.in} | 12 +- ...errhandler.c => comm_call_errhandler.c.in} | 13 +- .../c/{comm_compare.c => comm_compare.c.in} | 17 +- .../c/{comm_connect.c => comm_connect.c.in} | 13 +- .../mpi/c/{comm_create.c => comm_create.c.in} | 14 +- ...rhandler.c => comm_create_errhandler.c.in} | 15 +- ...om_group.c => comm_create_from_group.c.in} | 14 +- ..._create_group.c => comm_create_group.c.in} | 12 +- ...reate_keyval.c => comm_create_keyval.c.in} | 16 +- ...mm_delete_attr.c => comm_delete_attr.c.in} | 11 +- ...comm_disconnect.c => comm_disconnect.c.in} | 11 +- ompi/mpi/c/{comm_dup.c => comm_dup.c.in} | 10 +- ...up_with_info.c => comm_dup_with_info.c.in} | 10 +- ompi/mpi/c/{comm_f2c.c => comm_f2c.c.in} | 12 +- ompi/mpi/c/{comm_free.c => comm_free.c.in} | 12 +- ...mm_free_keyval.c => comm_free_keyval.c.in} | 11 +- .../c/{comm_get_attr.c => comm_get_attr.c.in} | 13 +- ..._errhandler.c => comm_get_errhandler.c.in} | 12 +- .../c/{comm_get_info.c => comm_get_info.c.in} | 12 +- .../c/{comm_get_name.c => comm_get_name.c.in} | 11 +- ...comm_get_parent.c => comm_get_parent.c.in} | 11 +- ompi/mpi/c/{comm_group.c => comm_group.c.in} | 13 +- ompi/mpi/c/{comm_idup.c => comm_idup.c.in} | 10 +- ...p_with_info.c => comm_idup_with_info.c.in} | 10 +- ompi/mpi/c/{comm_join.c => comm_join.c.in} | 192 ++- ompi/mpi/c/{comm_rank.c => comm_rank.c.in} | 12 +- ..._remote_group.c => comm_remote_group.c.in} | 12 +- ...mm_remote_size.c => comm_remote_size.c.in} | 13 +- .../c/{comm_set_attr.c => comm_set_attr.c.in} | 11 +- ..._errhandler.c => comm_set_errhandler.c.in} | 12 +- .../c/{comm_set_info.c => comm_set_info.c.in} | 11 +- .../c/{comm_set_name.c => comm_set_name.c.in} | 12 +- ompi/mpi/c/{comm_size.c => comm_size.c.in} | 12 +- ompi/mpi/c/{comm_spawn.c => comm_spawn.c.in} | 15 +- ...wn_multiple.c => comm_spawn_multiple.c.in} | 17 +- ompi/mpi/c/{comm_split.c => comm_split.c.in} | 14 +- ...comm_split_type.c => comm_split_type.c.in} | 16 +- ...comm_test_inter.c => comm_test_inter.c.in} | 18 +- ...mpare_and_swap.c => compare_and_swap.c.in} | 13 +- .../mpi/c/{dims_create.c => dims_create.c.in} | 200 ++- ..._graph_create.c => dist_graph_create.c.in} | 14 +- ...cent.c => dist_graph_create_adjacent.c.in} | 21 +- ..._neighbors.c => dist_graph_neighbors.c.in} | 17 +- ...ount.c => dist_graph_neighbors_count.c.in} | 14 +- .../{errhandler_c2f.c => errhandler_c2f.c.in} | 12 +- .../{errhandler_f2c.c => errhandler_f2c.c.in} | 12 +- ...errhandler_free.c => errhandler_free.c.in} | 11 +- .../mpi/c/{error_class.c => error_class.c.in} | 11 +- .../c/{error_string.c => error_string.c.in} | 12 +- ompi/mpi/c/{exscan.c => exscan.c.in} | 13 +- .../mpi/c/{exscan_init.c => exscan_init.c.in} | 15 +- .../c/{fetch_and_op.c => fetch_and_op.c.in} | 13 +- ompi/mpi/c/{file_c2f.c => file_c2f.c.in} | 12 +- ...errhandler.c => file_call_errhandler.c.in} | 11 +- ompi/mpi/c/{file_close.c => file_close.c.in} | 11 +- ...rhandler.c => file_create_errhandler.c.in} | 14 +- .../mpi/c/{file_delete.c => file_delete.c.in} | 11 +- ompi/mpi/c/{file_f2c.c => file_f2c.c.in} | 12 +- .../{file_get_amode.c => file_get_amode.c.in} | 12 +- ...et_atomicity.c => file_get_atomicity.c.in} | 11 +- ...yte_offset.c => file_get_byte_offset.c.in} | 13 +- ..._errhandler.c => file_get_errhandler.c.in} | 11 +- .../{file_get_group.c => file_get_group.c.in} | 11 +- .../c/{file_get_info.c => file_get_info.c.in} | 11 +- ..._get_position.c => file_get_position.c.in} | 11 +- ...shared.c => file_get_position_shared.c.in} | 11 +- .../c/{file_get_size.c => file_get_size.c.in} | 11 +- ...ype_extent.c => file_get_type_extent.c.in} | 13 +- .../c/{file_get_view.c => file_get_view.c.in} | 15 +- ompi/mpi/c/{file_iread.c => file_iread.c.in} | 13 +- .../{file_iread_all.c => file_iread_all.c.in} | 13 +- .../c/{file_iread_at.c => file_iread_at.c.in} | 13 +- ..._iread_at_all.c => file_iread_at_all.c.in} | 13 +- ..._iread_shared.c => file_iread_shared.c.in} | 13 +- .../mpi/c/{file_iwrite.c => file_iwrite.c.in} | 14 +- ...file_iwrite_all.c => file_iwrite_all.c.in} | 13 +- .../{file_iwrite_at.c => file_iwrite_at.c.in} | 15 +- ...write_at_all.c => file_iwrite_at_all.c.in} | 16 +- ...write_shared.c => file_iwrite_shared.c.in} | 13 +- ompi/mpi/c/{file_open.c => file_open.c.in} | 14 +- ...le_preallocate.c => file_preallocate.c.in} | 11 +- ompi/mpi/c/{file_read.c => file_read.c.in} | 13 +- .../c/{file_read_all.c => file_read_all.c.in} | 13 +- ...d_all_begin.c => file_read_all_begin.c.in} | 14 +- ..._read_all_end.c => file_read_all_end.c.in} | 11 +- .../c/{file_read_at.c => file_read_at.c.in} | 13 +- ...le_read_at_all.c => file_read_at_all.c.in} | 16 +- ...ll_begin.c => file_read_at_all_begin.c.in} | 14 +- ...at_all_end.c => file_read_at_all_end.c.in} | 11 +- ..._read_ordered.c => file_read_ordered.c.in} | 14 +- ...d_begin.c => file_read_ordered_begin.c.in} | 13 +- ...dered_end.c => file_read_ordered_end.c.in} | 11 +- ...le_read_shared.c => file_read_shared.c.in} | 13 +- ompi/mpi/c/{file_seek.c => file_seek.c.in} | 12 +- ...le_seek_shared.c => file_seek_shared.c.in} | 11 +- ...et_atomicity.c => file_set_atomicity.c.in} | 11 +- ..._errhandler.c => file_set_errhandler.c.in} | 11 +- .../c/{file_set_info.c => file_set_info.c.in} | 12 +- .../c/{file_set_size.c => file_set_size.c.in} | 11 +- .../c/{file_set_view.c => file_set_view.c.in} | 14 +- ompi/mpi/c/{file_sync.c => file_sync.c.in} | 11 +- ompi/mpi/c/{file_write.c => file_write.c.in} | 13 +- .../{file_write_all.c => file_write_all.c.in} | 13 +- ..._all_begin.c => file_write_all_begin.c.in} | 14 +- ...rite_all_end.c => file_write_all_end.c.in} | 12 +- .../c/{file_write_at.c => file_write_at.c.in} | 15 +- ..._write_at_all.c => file_write_at_all.c.in} | 15 +- ...l_begin.c => file_write_at_all_begin.c.in} | 14 +- ...t_all_end.c => file_write_at_all_end.c.in} | 11 +- ...rite_ordered.c => file_write_ordered.c.in} | 14 +- ..._begin.c => file_write_ordered_begin.c.in} | 13 +- ...ered_end.c => file_write_ordered_end.c.in} | 11 +- ..._write_shared.c => file_write_shared.c.in} | 13 +- ompi/mpi/c/{finalize.c => finalize.c.in} | 12 +- ompi/mpi/c/{finalized.c => finalized.c.in} | 12 +- ompi/mpi/c/{free_mem.c => free_mem.c.in} | 11 +- ompi/mpi/c/{gather.c => gather.c.in} | 16 +- .../mpi/c/{gather_init.c => gather_init.c.in} | 16 +- ompi/mpi/c/{gatherv.c => gatherv.c.in} | 15 +- .../c/{gatherv_init.c => gatherv_init.c.in} | 17 +- ompi/mpi/c/{get.c => get.c.in} | 18 +- .../{get_accumulate.c => get_accumulate.c.in} | 17 +- .../mpi/c/{get_address.c => get_address.c.in} | 12 +- ompi/mpi/c/{get_count.c => get_count.c.in} | 12 +- .../c/{get_elements.c => get_elements.c.in} | 11 +- .../{get_elements_x.c => get_elements_x.c.in} | 10 +- ...ary_version.c => get_library_version.c.in} | 12 +- ...ocessor_name.c => get_processor_name.c.in} | 12 +- .../mpi/c/{get_version.c => get_version.c.in} | 11 +- .../c/{graph_create.c => graph_create.c.in} | 13 +- ompi/mpi/c/{graph_get.c => graph_get.c.in} | 14 +- ompi/mpi/c/{graph_map.c => graph_map.c.in} | 14 +- ...graph_neighbors.c => graph_neighbors.c.in} | 14 +- ...ors_count.c => graph_neighbors_count.c.in} | 12 +- .../c/{graphdims_get.c => graphdims_get.c.in} | 11 +- ...uest_complete.c => grequest_complete.c.in} | 11 +- .../{grequest_start.c => grequest_start.c.in} | 17 +- ompi/mpi/c/{group_c2f.c => group_c2f.c.in} | 12 +- .../c/{group_compare.c => group_compare.c.in} | 12 +- ...oup_difference.c => group_difference.c.in} | 15 +- ompi/mpi/c/{group_excl.c => group_excl.c.in} | 14 +- ompi/mpi/c/{group_f2c.c => group_f2c.c.in} | 12 +- ompi/mpi/c/{group_free.c => group_free.c.in} | 11 +- ...on_pset.c => group_from_session_pset.c.in} | 11 +- ompi/mpi/c/{group_incl.c => group_incl.c.in} | 11 +- ...intersection.c => group_intersection.c.in} | 14 +- ...oup_range_excl.c => group_range_excl.c.in} | 14 +- ...oup_range_incl.c => group_range_incl.c.in} | 13 +- ompi/mpi/c/{group_rank.c => group_rank.c.in} | 11 +- ompi/mpi/c/{group_size.c => group_size.c.in} | 12 +- ...ate_ranks.c => group_translate_ranks.c.in} | 13 +- .../mpi/c/{group_union.c => group_union.c.in} | 11 +- ompi/mpi/c/{iallgather.c => iallgather.c.in} | 16 +- .../mpi/c/{iallgatherv.c => iallgatherv.c.in} | 16 +- ompi/mpi/c/{iallreduce.c => iallreduce.c.in} | 13 +- ompi/mpi/c/{ialltoall.c => ialltoall.c.in} | 16 +- ompi/mpi/c/{ialltoallv.c => ialltoallv.c.in} | 17 +- ompi/mpi/c/{ialltoallw.c => ialltoallw.c.in} | 17 +- ompi/mpi/c/{ibarrier.c => ibarrier.c.in} | 11 +- ompi/mpi/c/{ibcast.c => ibcast.c.in} | 13 +- ompi/mpi/c/{ibsend.c => ibsend.c.in} | 13 +- ompi/mpi/c/{iexscan.c => iexscan.c.in} | 13 +- ompi/mpi/c/{igather.c => igather.c.in} | 15 +- ompi/mpi/c/{igatherv.c => igatherv.c.in} | 15 +- ompi/mpi/c/{improbe.c => improbe.c.in} | 14 +- ompi/mpi/c/{imrecv.c => imrecv.c.in} | 14 +- ...r_allgather.c => ineighbor_allgather.c.in} | 15 +- ...allgatherv.c => ineighbor_allgatherv.c.in} | 15 +- ...bor_alltoall.c => ineighbor_alltoall.c.in} | 15 +- ...r_alltoallv.c => ineighbor_alltoallv.c.in} | 17 +- ompi/mpi/c/ineighbor_alltoallw.c.in | 144 ++ ompi/mpi/c/{info_c2f.c => info_c2f.c.in} | 12 +- .../mpi/c/{info_create.c => info_create.c.in} | 10 +- ...info_create_env.c => info_create_env.c.in} | 11 +- .../mpi/c/{info_delete.c => info_delete.c.in} | 13 +- ompi/mpi/c/{info_dup.c => info_dup.c.in} | 13 +- ompi/mpi/c/{info_f2c.c => info_f2c.c.in} | 12 +- ompi/mpi/c/{info_free.c => info_free.c.in} | 12 +- ompi/mpi/c/{info_get.c => info_get.c.in} | 13 +- .../{info_get_nkeys.c => info_get_nkeys.c.in} | 11 +- ...info_get_nthkey.c => info_get_nthkey.c.in} | 11 +- ...info_get_string.c => info_get_string.c.in} | 12 +- ..._get_valuelen.c => info_get_valuelen.c.in} | 13 +- ompi/mpi/c/{info_set.c => info_set.c.in} | 11 +- ompi/mpi/c/{init.c => init.c.in} | 12 +- .../mpi/c/{init_thread.c => init_thread.c.in} | 13 +- .../mpi/c/{initialized.c => initialized.c.in} | 12 +- ...tercomm_create.c => intercomm_create.c.in} | 15 +- ...ps.c => intercomm_create_from_groups.c.in} | 15 +- ...intercomm_merge.c => intercomm_merge.c.in} | 13 +- ompi/mpi/c/{iprobe.c => iprobe.c.in} | 11 +- ompi/mpi/c/{irecv.c => irecv.c.in} | 14 +- ompi/mpi/c/{ireduce.c => ireduce.c.in} | 13 +- ...ireduce_scatter.c => ireduce_scatter.c.in} | 13 +- ...ter_block.c => ireduce_scatter_block.c.in} | 15 +- ompi/mpi/c/{irsend.c => irsend.c.in} | 14 +- .../{is_thread_main.c => is_thread_main.c.in} | 11 +- ompi/mpi/c/{iscan.c => iscan.c.in} | 14 +- ompi/mpi/c/{iscatter.c => iscatter.c.in} | 16 +- ompi/mpi/c/{iscatterv.c => iscatterv.c.in} | 16 +- ompi/mpi/c/{isend.c => isend.c.in} | 14 +- ompi/mpi/c/{isendrecv.c => isendrecv.c.in} | 16 +- ...drecv_replace.c => isendrecv_replace.c.in} | 15 +- ompi/mpi/c/{issend.c => issend.c.in} | 14 +- .../c/{keyval_create.c => keyval_create.c.in} | 16 +- .../mpi/c/{keyval_free.c => keyval_free.c.in} | 12 +- .../mpi/c/{lookup_name.c => lookup_name.c.in} | 11 +- .../mpi/c/{message_c2f.c => message_c2f.c.in} | 12 +- .../mpi/c/{message_f2c.c => message_f2c.c.in} | 12 +- ompi/mpi/c/{mprobe.c => mprobe.c.in} | 12 +- ompi/mpi/c/{mrecv.c => mrecv.c.in} | 13 +- ...or_allgather.c => neighbor_allgather.c.in} | 15 +- ...er_init.c => neighbor_allgather_init.c.in} | 15 +- ..._allgatherv.c => neighbor_allgatherv.c.in} | 15 +- ...v_init.c => neighbor_allgatherv_init.c.in} | 17 +- ...hbor_alltoall.c => neighbor_alltoall.c.in} | 15 +- ...all_init.c => neighbor_alltoall_init.c.in} | 15 +- ...or_alltoallv.c => neighbor_alltoallv.c.in} | 17 +- ...lv_init.c => neighbor_alltoallv_init.c.in} | 17 +- ompi/mpi/c/neighbor_alltoallw.c.in | 149 ++ ompi/mpi/c/neighbor_alltoallw_init.c.in | 145 ++ ompi/mpi/c/{op_c2f.c => op_c2f.c.in} | 12 +- .../{op_commutative.c => op_commutative.c.in} | 12 +- ompi/mpi/c/{op_create.c => op_create.c.in} | 11 +- ompi/mpi/c/{op_f2c.c => op_f2c.c.in} | 12 +- ompi/mpi/c/{op_free.c => op_free.c.in} | 12 +- ompi/mpi/c/{open_port.c => open_port.c.in} | 11 +- ompi/mpi/c/{pack.c => pack.c.in} | 13 +- .../c/{pack_external.c => pack_external.c.in} | 16 +- ...xternal_size.c => pack_external_size.c.in} | 13 +- ompi/mpi/c/{pack_size.c => pack_size.c.in} | 12 +- ompi/mpi/c/{parrived.c => parrived.c.in} | 12 +- ompi/mpi/c/{pready.c => pready.c.in} | 12 +- .../mpi/c/{pready_list.c => pready_list.c.in} | 11 +- .../c/{pready_range.c => pready_range.c.in} | 11 +- ompi/mpi/c/{precv_init.c => precv_init.c.in} | 11 +- ompi/mpi/c/{probe.c => probe.c.in} | 11 +- ompi/mpi/c/{psend_init.c => psend_init.c.in} | 12 +- .../c/{publish_name.c => publish_name.c.in} | 13 +- ompi/mpi/c/{put.c => put.c.in} | 15 +- .../c/{query_thread.c => query_thread.c.in} | 11 +- .../mpi/c/{raccumulate.c => raccumulate.c.in} | 14 +- ompi/mpi/c/{recv.c => recv.c.in} | 14 +- ompi/mpi/c/{recv_init.c => recv_init.c.in} | 13 +- ompi/mpi/c/{reduce.c => reduce.c.in} | 13 +- .../mpi/c/{reduce_init.c => reduce_init.c.in} | 16 +- .../c/{reduce_local.c => reduce_local.c.in} | 14 +- .../{reduce_scatter.c => reduce_scatter.c.in} | 13 +- ...tter_block.c => reduce_scatter_block.c.in} | 13 +- ..._init.c => reduce_scatter_block_init.c.in} | 15 +- ...catter_init.c => reduce_scatter_init.c.in} | 13 +- ...gister_datarep.c => register_datarep.c.in} | 19 +- .../mpi/c/{request_c2f.c => request_c2f.c.in} | 12 +- .../mpi/c/{request_f2c.c => request_f2c.c.in} | 12 +- .../c/{request_free.c => request_free.c.in} | 11 +- ...t_get_status.c => request_get_status.c.in} | 13 +- ompi/mpi/c/{rget.c => rget.c.in} | 17 +- ...rget_accumulate.c => rget_accumulate.c.in} | 16 +- ompi/mpi/c/{rput.c => rput.c.in} | 15 +- ompi/mpi/c/{rsend.c => rsend.c.in} | 11 +- ompi/mpi/c/{rsend_init.c => rsend_init.c.in} | 16 +- ompi/mpi/c/{scan.c => scan.c.in} | 14 +- ompi/mpi/c/{scan_init.c => scan_init.c.in} | 15 +- ompi/mpi/c/{scatter.c => scatter.c.in} | 16 +- .../c/{scatter_init.c => scatter_init.c.in} | 15 +- ompi/mpi/c/{scatterv.c => scatterv.c.in} | 16 +- .../c/{scatterv_init.c => scatterv_init.c.in} | 15 +- ompi/mpi/c/{send.c => send.c.in} | 14 +- ompi/mpi/c/{send_init.c => send_init.c.in} | 15 +- ompi/mpi/c/{sendrecv.c => sendrecv.c.in} | 17 +- ...ndrecv_replace.c => sendrecv_replace.c.in} | 16 +- .../mpi/c/{session_c2f.c => session_c2f.c.in} | 12 +- ...handler.c => session_call_errhandler.c.in} | 12 +- ...ndler.c => session_create_errhandler.c.in} | 11 +- .../mpi/c/{session_f2c.c => session_f2c.c.in} | 12 +- ...ssion_finalize.c => session_finalize.c.in} | 11 +- ...rhandler.c => session_get_errhandler.c.in} | 12 +- ...ssion_get_info.c => session_get_info.c.in} | 12 +- ...t_nth_pset.c => session_get_nth_pset.c.in} | 12 +- ...num_psets.c => session_get_num_psets.c.in} | 11 +- ...pset_info.c => session_get_pset_info.c.in} | 12 +- .../c/{session_init.c => session_init.c.in} | 12 +- ...rhandler.c => session_set_errhandler.c.in} | 11 +- ...ssion_set_info.c => session_set_info.c.in} | 12 +- ompi/mpi/c/{ssend.c => ssend.c.in} | 11 +- ompi/mpi/c/{ssend_init.c => ssend_init.c.in} | 16 +- ompi/mpi/c/{start.c => start.c.in} | 11 +- ompi/mpi/c/{startall.c => startall.c.in} | 11 +- ompi/mpi/c/{status_c2f.c => status_c2f.c.in} | 11 +- .../c/{status_c2f08.c => status_c2f08.c.in} | 12 +- .../c/{status_f082c.c => status_f082c.c.in} | 11 +- .../c/{status_f082f.c => status_f082f.c.in} | 11 +- ompi/mpi/c/{status_f2c.c => status_f2c.c.in} | 12 +- .../c/{status_f2f08.c => status_f2f08.c.in} | 11 +- ..._cancelled.c => status_set_cancelled.c.in} | 12 +- ..._elements_x.c => status_set_elements.c.in} | 11 +- ..._elements.c => status_set_elements_x.c.in} | 10 +- ompi/mpi/c/{test.c => test.c.in} | 12 +- .../{test_cancelled.c => test_cancelled.c.in} | 12 +- ompi/mpi/c/{testall.c => testall.c.in} | 13 +- ompi/mpi/c/{testany.c => testany.c.in} | 12 +- ompi/mpi/c/{testsome.c => testsome.c.in} | 16 +- ompi/mpi/c/{topo_test.c => topo_test.c.in} | 11 +- ompi/mpi/c/{type_c2f.c => type_c2f.c.in} | 12 +- .../mpi/c/{type_commit.c => type_commit.c.in} | 11 +- ...type_contiguous.c => type_contiguous.c.in} | 16 +- ...reate_darray.c => type_create_darray.c.in} | 28 +- ...complex.c => type_create_f90_complex.c.in} | 12 +- ...integer.c => type_create_f90_integer.c.in} | 11 +- ...e_f90_real.c => type_create_f90_real.c.in} | 11 +- ...ate_hvector.c => type_create_hvector.c.in} | 20 +- ...block.c => type_create_indexed_block.c.in} | 19 +- ...reate_keyval.c => type_create_keyval.c.in} | 17 +- ...ate_resized.c => type_create_resized.c.in} | 17 +- ...e_subarray.c => type_create_subarray.c.in} | 24 +- ...pe_delete_attr.c => type_delete_attr.c.in} | 11 +- ompi/mpi/c/{type_dup.c => type_dup.c.in} | 14 +- ompi/mpi/c/{type_f2c.c => type_f2c.c.in} | 12 +- ompi/mpi/c/{type_free.c => type_free.c.in} | 12 +- ...pe_free_keyval.c => type_free_keyval.c.in} | 11 +- .../c/{type_get_attr.c => type_get_attr.c.in} | 17 +- ..._get_contents.c => type_get_contents.c.in} | 24 +- ..._get_envelope.c => type_get_envelope.c.in} | 20 +- ...type_get_extent.c => type_get_extent.c.in} | 10 +- ..._get_extent_x.c => type_get_extent_x.c.in} | 11 +- .../c/{type_get_name.c => type_get_name.c.in} | 11 +- ...rue_extent.c => type_get_true_extent.c.in} | 15 +- ...extent_x.c => type_get_true_extent_x.c.in} | 15 +- .../c/{type_indexed.c => type_indexed.c.in} | 18 +- ...type_match_size.c => type_match_size.c.in} | 11 +- .../c/{type_set_attr.c => type_set_attr.c.in} | 15 +- .../c/{type_set_name.c => type_set_name.c.in} | 12 +- ompi/mpi/c/{type_size.c => type_size.c.in} | 10 +- .../mpi/c/{type_size_x.c => type_size_x.c.in} | 11 +- .../mpi/c/{type_vector.c => type_vector.c.in} | 18 +- ompi/mpi/c/{unpack.c => unpack.c.in} | 15 +- ...unpack_external.c => unpack_external.c.in} | 16 +- .../{unpublish_name.c => unpublish_name.c.in} | 13 +- ompi/mpi/c/{wait.c => wait.c.in} | 11 +- ompi/mpi/c/{waitall.c => waitall.c.in} | 13 +- ompi/mpi/c/{waitany.c => waitany.c.in} | 11 +- ompi/mpi/c/{waitsome.c => waitsome.c.in} | 16 +- .../c/{win_allocate.c => win_allocate.c.in} | 13 +- ...cate_shared.c => win_allocate_shared.c.in} | 14 +- ompi/mpi/c/{win_attach.c => win_attach.c.in} | 10 +- ompi/mpi/c/{win_c2f.c => win_c2f.c.in} | 12 +- ..._errhandler.c => win_call_errhandler.c.in} | 11 +- .../c/{win_complete.c => win_complete.c.in} | 11 +- ompi/mpi/c/{win_create.c => win_create.c.in} | 13 +- ...eate_dynamic.c => win_create_dynamic.c.in} | 12 +- ...rrhandler.c => win_create_errhandler.c.in} | 13 +- ...create_keyval.c => win_create_keyval.c.in} | 16 +- ...win_delete_attr.c => win_delete_attr.c.in} | 11 +- ompi/mpi/c/{win_detach.c => win_detach.c.in} | 10 +- ompi/mpi/c/win_f2c.c | 1 - ompi/mpi/c/{win_fence.c => win_fence.c.in} | 12 +- ompi/mpi/c/{win_flush.c => win_flush.c.in} | 11 +- .../c/{win_flush_all.c => win_flush_all.c.in} | 10 +- ...win_flush_local.c => win_flush_local.c.in} | 10 +- ...h_local_all.c => win_flush_local_all.c.in} | 10 +- ompi/mpi/c/{win_free.c => win_free.c.in} | 11 +- ...win_free_keyval.c => win_free_keyval.c.in} | 12 +- .../c/{win_get_attr.c => win_get_attr.c.in} | 14 +- ...t_errhandler.c => win_get_errhandler.c.in} | 11 +- .../c/{win_get_group.c => win_get_group.c.in} | 11 +- .../c/{win_get_info.c => win_get_info.c.in} | 11 +- .../c/{win_get_name.c => win_get_name.c.in} | 12 +- ompi/mpi/c/{win_lock.c => win_lock.c.in} | 11 +- .../c/{win_lock_all.c => win_lock_all.c.in} | 12 +- ompi/mpi/c/{win_post.c => win_post.c.in} | 11 +- .../c/{win_set_attr.c => win_set_attr.c.in} | 12 +- ...t_errhandler.c => win_set_errhandler.c.in} | 11 +- .../c/{win_set_info.c => win_set_info.c.in} | 11 +- .../c/{win_set_name.c => win_set_name.c.in} | 12 +- ...n_shared_query.c => win_shared_query.c.in} | 11 +- ompi/mpi/c/{win_start.c => win_start.c.in} | 12 +- ompi/mpi/c/{win_sync.c => win_sync.c.in} | 10 +- ompi/mpi/c/{win_test.c => win_test.c.in} | 12 +- ompi/mpi/c/{win_unlock.c => win_unlock.c.in} | 11 +- .../{win_unlock_all.c => win_unlock_all.c.in} | 11 +- ompi/mpi/c/{win_wait.c => win_wait.c.in} | 11 +- ompi/mpi/c/{wtime.c => wtime.c.in} | 9 +- ompi/util/count_disp_array.h | 3 +- 441 files changed, 6246 insertions(+), 5365 deletions(-) create mode 100644 config/ompi_fortran_check_ts.m4 create mode 100644 docs/developers/bindings.rst create mode 100644 ompi/mpi/bindings/bindings.py create mode 100644 ompi/mpi/bindings/ompi_bindings/c.py create mode 100644 ompi/mpi/bindings/ompi_bindings/c_type.py create mode 100644 ompi/mpi/bindings/ompi_bindings/consts.py create mode 100644 ompi/mpi/bindings/ompi_bindings/fortran.py create mode 100644 ompi/mpi/bindings/ompi_bindings/fortran_type.py create mode 100644 ompi/mpi/bindings/ompi_bindings/parser.py create mode 100644 ompi/mpi/bindings/ompi_bindings/util.py rename ompi/mpi/c/{abort.c => abort.c.in} (88%) rename ompi/mpi/c/{accumulate.c => accumulate.c.in} (92%) rename ompi/mpi/c/{add_error_class.c => add_error_class.c.in} (89%) rename ompi/mpi/c/{add_error_code.c => add_error_code.c.in} (90%) rename ompi/mpi/c/{add_error_string.c => add_error_string.c.in} (86%) rename ompi/mpi/c/{allgather.c => allgather.c.in} (92%) rename ompi/mpi/c/{allgather_init.c => allgather_init.c.in} (89%) rename ompi/mpi/c/{allgatherv.c => allgatherv.c.in} (93%) rename ompi/mpi/c/{allgatherv_init.c => allgatherv_init.c.in} (90%) rename ompi/mpi/c/{alloc_mem.c => alloc_mem.c.in} (91%) rename ompi/mpi/c/{allreduce.c => allreduce.c.in} (92%) rename ompi/mpi/c/{allreduce_init.c => allreduce_init.c.in} (90%) rename ompi/mpi/c/{alltoall.c => alltoall.c.in} (92%) rename ompi/mpi/c/{alltoall_init.c => alltoall_init.c.in} (89%) rename ompi/mpi/c/{alltoallv.c => alltoallv.c.in} (90%) rename ompi/mpi/c/{alltoallv_init.c => alltoallv_init.c.in} (90%) rename ompi/mpi/c/{alltoallw.c => alltoallw.c.in} (91%) rename ompi/mpi/c/{alltoallw_init.c => alltoallw_init.c.in} (90%) rename ompi/mpi/c/{attr_delete.c => attr_delete.c.in} (86%) rename ompi/mpi/c/{attr_get.c => attr_get.c.in} (86%) rename ompi/mpi/c/{attr_put.c => attr_put.c.in} (86%) rename ompi/mpi/c/{barrier.c => barrier.c.in} (91%) rename ompi/mpi/c/{barrier_init.c => barrier_init.c.in} (86%) rename ompi/mpi/c/{bcast.c => bcast.c.in} (93%) rename ompi/mpi/c/{bcast_init.c => bcast_init.c.in} (88%) rename ompi/mpi/c/{bsend.c => bsend.c.in} (92%) rename ompi/mpi/c/{bsend_init.c => bsend_init.c.in} (89%) rename ompi/mpi/c/{buffer_attach.c => buffer_attach.c.in} (84%) rename ompi/mpi/c/{buffer_detach.c => buffer_detach.c.in} (84%) rename ompi/mpi/c/{cancel.c => cancel.c.in} (89%) rename ompi/mpi/c/{cart_coords.c => cart_coords.c.in} (90%) rename ompi/mpi/c/{cart_create.c => cart_create.c.in} (92%) rename ompi/mpi/c/{cart_get.c => cart_get.c.in} (88%) rename ompi/mpi/c/{cart_map.c => cart_map.c.in} (89%) rename ompi/mpi/c/{cart_rank.c => cart_rank.c.in} (92%) rename ompi/mpi/c/{cart_shift.c => cart_shift.c.in} (88%) rename ompi/mpi/c/{cart_sub.c => cart_sub.c.in} (91%) rename ompi/mpi/c/{cartdim_get.c => cartdim_get.c.in} (89%) rename ompi/mpi/c/{close_port.c => close_port.c.in} (87%) rename ompi/mpi/c/{comm_accept.c => comm_accept.c.in} (92%) rename ompi/mpi/c/{comm_c2f.c => comm_c2f.c.in} (89%) rename ompi/mpi/c/{comm_call_errhandler.c => comm_call_errhandler.c.in} (83%) rename ompi/mpi/c/{comm_compare.c => comm_compare.c.in} (86%) rename ompi/mpi/c/{comm_connect.c => comm_connect.c.in} (92%) rename ompi/mpi/c/{comm_create.c => comm_create.c.in} (89%) rename ompi/mpi/c/{comm_create_errhandler.c => comm_create_errhandler.c.in} (83%) rename ompi/mpi/c/{comm_create_from_group.c => comm_create_from_group.c.in} (87%) rename ompi/mpi/c/{comm_create_group.c => comm_create_group.c.in} (89%) rename ompi/mpi/c/{comm_create_keyval.c => comm_create_keyval.c.in} (81%) rename ompi/mpi/c/{comm_delete_attr.c => comm_delete_attr.c.in} (85%) rename ompi/mpi/c/{comm_disconnect.c => comm_disconnect.c.in} (88%) rename ompi/mpi/c/{comm_dup.c => comm_dup.c.in} (90%) rename ompi/mpi/c/{comm_dup_with_info.c => comm_dup_with_info.c.in} (89%) rename ompi/mpi/c/{comm_f2c.c => comm_f2c.c.in} (88%) rename ompi/mpi/c/{comm_free.c => comm_free.c.in} (88%) rename ompi/mpi/c/{comm_free_keyval.c => comm_free_keyval.c.in} (84%) rename ompi/mpi/c/{comm_get_attr.c => comm_get_attr.c.in} (86%) rename ompi/mpi/c/{comm_get_errhandler.c => comm_get_errhandler.c.in} (88%) rename ompi/mpi/c/{comm_get_info.c => comm_get_info.c.in} (85%) rename ompi/mpi/c/{comm_get_name.c => comm_get_name.c.in} (89%) rename ompi/mpi/c/{comm_get_parent.c => comm_get_parent.c.in} (85%) rename ompi/mpi/c/{comm_group.c => comm_group.c.in} (87%) rename ompi/mpi/c/{comm_idup.c => comm_idup.c.in} (87%) rename ompi/mpi/c/{comm_idup_with_info.c => comm_idup_with_info.c.in} (88%) rename ompi/mpi/c/{comm_join.c => comm_join.c.in} (96%) rename ompi/mpi/c/{comm_rank.c => comm_rank.c.in} (87%) rename ompi/mpi/c/{comm_remote_group.c => comm_remote_group.c.in} (86%) rename ompi/mpi/c/{comm_remote_size.c => comm_remote_size.c.in} (85%) rename ompi/mpi/c/{comm_set_attr.c => comm_set_attr.c.in} (85%) rename ompi/mpi/c/{comm_set_errhandler.c => comm_set_errhandler.c.in} (88%) rename ompi/mpi/c/{comm_set_info.c => comm_set_info.c.in} (81%) rename ompi/mpi/c/{comm_set_name.c => comm_set_name.c.in} (88%) rename ompi/mpi/c/{comm_size.c => comm_size.c.in} (87%) rename ompi/mpi/c/{comm_spawn.c => comm_spawn.c.in} (94%) rename ompi/mpi/c/{comm_spawn_multiple.c => comm_spawn_multiple.c.in} (93%) rename ompi/mpi/c/{comm_split.c => comm_split.c.in} (89%) rename ompi/mpi/c/{comm_split_type.c => comm_split_type.c.in} (92%) rename ompi/mpi/c/{comm_test_inter.c => comm_test_inter.c.in} (79%) rename ompi/mpi/c/{compare_and_swap.c => compare_and_swap.c.in} (84%) rename ompi/mpi/c/{dims_create.c => dims_create.c.in} (94%) rename ompi/mpi/c/{dist_graph_create.c => dist_graph_create.c.in} (89%) rename ompi/mpi/c/{dist_graph_create_adjacent.c => dist_graph_create_adjacent.c.in} (87%) rename ompi/mpi/c/{dist_graph_neighbors.c => dist_graph_neighbors.c.in} (81%) rename ompi/mpi/c/{dist_graph_neighbors_count.c => dist_graph_neighbors_count.c.in} (81%) rename ompi/mpi/c/{errhandler_c2f.c => errhandler_c2f.c.in} (82%) rename ompi/mpi/c/{errhandler_f2c.c => errhandler_f2c.c.in} (89%) rename ompi/mpi/c/{errhandler_free.c => errhandler_free.c.in} (88%) rename ompi/mpi/c/{error_class.c => error_class.c.in} (86%) rename ompi/mpi/c/{error_string.c => error_string.c.in} (88%) rename ompi/mpi/c/{exscan.c => exscan.c.in} (92%) rename ompi/mpi/c/{exscan_init.c => exscan_init.c.in} (87%) rename ompi/mpi/c/{fetch_and_op.c => fetch_and_op.c.in} (86%) rename ompi/mpi/c/{file_c2f.c => file_c2f.c.in} (88%) rename ompi/mpi/c/{file_call_errhandler.c => file_call_errhandler.c.in} (82%) rename ompi/mpi/c/{file_close.c => file_close.c.in} (87%) rename ompi/mpi/c/{file_create_errhandler.c => file_create_errhandler.c.in} (84%) rename ompi/mpi/c/{file_delete.c => file_delete.c.in} (91%) rename ompi/mpi/c/{file_f2c.c => file_f2c.c.in} (87%) rename ompi/mpi/c/{file_get_amode.c => file_get_amode.c.in} (87%) rename ompi/mpi/c/{file_get_atomicity.c => file_get_atomicity.c.in} (86%) rename ompi/mpi/c/{file_get_byte_offset.c => file_get_byte_offset.c.in} (84%) rename ompi/mpi/c/{file_get_errhandler.c => file_get_errhandler.c.in} (88%) rename ompi/mpi/c/{file_get_group.c => file_get_group.c.in} (84%) rename ompi/mpi/c/{file_get_info.c => file_get_info.c.in} (91%) rename ompi/mpi/c/{file_get_position.c => file_get_position.c.in} (86%) rename ompi/mpi/c/{file_get_position_shared.c => file_get_position_shared.c.in} (84%) rename ompi/mpi/c/{file_get_size.c => file_get_size.c.in} (87%) rename ompi/mpi/c/{file_get_type_extent.c => file_get_type_extent.c.in} (85%) rename ompi/mpi/c/{file_get_view.c => file_get_view.c.in} (84%) rename ompi/mpi/c/{file_iread.c => file_iread.c.in} (87%) rename ompi/mpi/c/{file_iread_all.c => file_iread_all.c.in} (88%) rename ompi/mpi/c/{file_iread_at.c => file_iread_at.c.in} (86%) rename ompi/mpi/c/{file_iread_at_all.c => file_iread_at_all.c.in} (87%) rename ompi/mpi/c/{file_iread_shared.c => file_iread_shared.c.in} (86%) rename ompi/mpi/c/{file_iwrite.c => file_iwrite.c.in} (88%) rename ompi/mpi/c/{file_iwrite_all.c => file_iwrite_all.c.in} (88%) rename ompi/mpi/c/{file_iwrite_at.c => file_iwrite_at.c.in} (86%) rename ompi/mpi/c/{file_iwrite_at_all.c => file_iwrite_at_all.c.in} (87%) rename ompi/mpi/c/{file_iwrite_shared.c => file_iwrite_shared.c.in} (86%) rename ompi/mpi/c/{file_open.c => file_open.c.in} (92%) rename ompi/mpi/c/{file_preallocate.c => file_preallocate.c.in} (86%) rename ompi/mpi/c/{file_read.c => file_read.c.in} (87%) rename ompi/mpi/c/{file_read_all.c => file_read_all.c.in} (86%) rename ompi/mpi/c/{file_read_all_begin.c => file_read_all_begin.c.in} (85%) rename ompi/mpi/c/{file_read_all_end.c => file_read_all_end.c.in} (85%) rename ompi/mpi/c/{file_read_at.c => file_read_at.c.in} (85%) rename ompi/mpi/c/{file_read_at_all.c => file_read_at_all.c.in} (84%) rename ompi/mpi/c/{file_read_at_all_begin.c => file_read_at_all_begin.c.in} (84%) rename ompi/mpi/c/{file_read_at_all_end.c => file_read_at_all_end.c.in} (84%) rename ompi/mpi/c/{file_read_ordered.c => file_read_ordered.c.in} (84%) rename ompi/mpi/c/{file_read_ordered_begin.c => file_read_ordered_begin.c.in} (84%) rename ompi/mpi/c/{file_read_ordered_end.c => file_read_ordered_end.c.in} (84%) rename ompi/mpi/c/{file_read_shared.c => file_read_shared.c.in} (85%) rename ompi/mpi/c/{file_seek.c => file_seek.c.in} (88%) rename ompi/mpi/c/{file_seek_shared.c => file_seek_shared.c.in} (86%) rename ompi/mpi/c/{file_set_atomicity.c => file_set_atomicity.c.in} (86%) rename ompi/mpi/c/{file_set_errhandler.c => file_set_errhandler.c.in} (88%) rename ompi/mpi/c/{file_set_info.c => file_set_info.c.in} (90%) rename ompi/mpi/c/{file_set_size.c => file_set_size.c.in} (87%) rename ompi/mpi/c/{file_set_view.c => file_set_view.c.in} (87%) rename ompi/mpi/c/{file_sync.c => file_sync.c.in} (88%) rename ompi/mpi/c/{file_write.c => file_write.c.in} (87%) rename ompi/mpi/c/{file_write_all.c => file_write_all.c.in} (87%) rename ompi/mpi/c/{file_write_all_begin.c => file_write_all_begin.c.in} (86%) rename ompi/mpi/c/{file_write_all_end.c => file_write_all_end.c.in} (86%) rename ompi/mpi/c/{file_write_at.c => file_write_at.c.in} (86%) rename ompi/mpi/c/{file_write_at_all.c => file_write_at_all.c.in} (85%) rename ompi/mpi/c/{file_write_at_all_begin.c => file_write_at_all_begin.c.in} (85%) rename ompi/mpi/c/{file_write_at_all_end.c => file_write_at_all_end.c.in} (85%) rename ompi/mpi/c/{file_write_ordered.c => file_write_ordered.c.in} (86%) rename ompi/mpi/c/{file_write_ordered_begin.c => file_write_ordered_begin.c.in} (85%) rename ompi/mpi/c/{file_write_ordered_end.c => file_write_ordered_end.c.in} (85%) rename ompi/mpi/c/{file_write_shared.c => file_write_shared.c.in} (86%) rename ompi/mpi/c/{finalize.c => finalize.c.in} (86%) rename ompi/mpi/c/{finalized.c => finalized.c.in} (90%) rename ompi/mpi/c/{free_mem.c => free_mem.c.in} (87%) rename ompi/mpi/c/{gather.c => gather.c.in} (95%) rename ompi/mpi/c/{gather_init.c => gather_init.c.in} (94%) rename ompi/mpi/c/{gatherv.c => gatherv.c.in} (95%) rename ompi/mpi/c/{gatherv_init.c => gatherv_init.c.in} (94%) rename ompi/mpi/c/{get.c => get.c.in} (87%) rename ompi/mpi/c/{get_accumulate.c => get_accumulate.c.in} (91%) rename ompi/mpi/c/{get_address.c => get_address.c.in} (84%) rename ompi/mpi/c/{get_count.c => get_count.c.in} (90%) rename ompi/mpi/c/{get_elements.c => get_elements.c.in} (90%) rename ompi/mpi/c/{get_elements_x.c => get_elements_x.c.in} (90%) rename ompi/mpi/c/{get_library_version.c => get_library_version.c.in} (93%) rename ompi/mpi/c/{get_processor_name.c => get_processor_name.c.in} (87%) rename ompi/mpi/c/{get_version.c => get_version.c.in} (91%) rename ompi/mpi/c/{graph_create.c => graph_create.c.in} (92%) rename ompi/mpi/c/{graph_get.c => graph_get.c.in} (88%) rename ompi/mpi/c/{graph_map.c => graph_map.c.in} (89%) rename ompi/mpi/c/{graph_neighbors.c => graph_neighbors.c.in} (88%) rename ompi/mpi/c/{graph_neighbors_count.c => graph_neighbors_count.c.in} (87%) rename ompi/mpi/c/{graphdims_get.c => graphdims_get.c.in} (88%) rename ompi/mpi/c/{grequest_complete.c => grequest_complete.c.in} (85%) rename ompi/mpi/c/{grequest_start.c => grequest_start.c.in} (76%) rename ompi/mpi/c/{group_c2f.c => group_c2f.c.in} (85%) rename ompi/mpi/c/{group_compare.c => group_compare.c.in} (87%) rename ompi/mpi/c/{group_difference.c => group_difference.c.in} (83%) rename ompi/mpi/c/{group_excl.c => group_excl.c.in} (90%) rename ompi/mpi/c/{group_f2c.c => group_f2c.c.in} (87%) rename ompi/mpi/c/{group_free.c => group_free.c.in} (90%) rename ompi/mpi/c/{group_from_session_pset.c => group_from_session_pset.c.in} (79%) rename ompi/mpi/c/{group_incl.c => group_incl.c.in} (90%) rename ompi/mpi/c/{group_intersection.c => group_intersection.c.in} (83%) rename ompi/mpi/c/{group_range_excl.c => group_range_excl.c.in} (91%) rename ompi/mpi/c/{group_range_incl.c => group_range_incl.c.in} (91%) rename ompi/mpi/c/{group_rank.c => group_rank.c.in} (86%) rename ompi/mpi/c/{group_size.c => group_size.c.in} (86%) rename ompi/mpi/c/{group_translate_ranks.c => group_translate_ranks.c.in} (85%) rename ompi/mpi/c/{group_union.c => group_union.c.in} (85%) rename ompi/mpi/c/{iallgather.c => iallgather.c.in} (90%) rename ompi/mpi/c/{iallgatherv.c => iallgatherv.c.in} (91%) rename ompi/mpi/c/{iallreduce.c => iallreduce.c.in} (91%) rename ompi/mpi/c/{ialltoall.c => ialltoall.c.in} (90%) rename ompi/mpi/c/{ialltoallv.c => ialltoallv.c.in} (91%) rename ompi/mpi/c/{ialltoallw.c => ialltoallw.c.in} (90%) rename ompi/mpi/c/{ibarrier.c => ibarrier.c.in} (87%) rename ompi/mpi/c/{ibcast.c => ibcast.c.in} (92%) rename ompi/mpi/c/{ibsend.c => ibsend.c.in} (90%) rename ompi/mpi/c/{iexscan.c => iexscan.c.in} (90%) rename ompi/mpi/c/{igather.c => igather.c.in} (94%) rename ompi/mpi/c/{igatherv.c => igatherv.c.in} (95%) rename ompi/mpi/c/{improbe.c => improbe.c.in} (88%) rename ompi/mpi/c/{imrecv.c => imrecv.c.in} (86%) rename ompi/mpi/c/{ineighbor_allgather.c => ineighbor_allgather.c.in} (90%) rename ompi/mpi/c/{ineighbor_allgatherv.c => ineighbor_allgatherv.c.in} (91%) rename ompi/mpi/c/{ineighbor_alltoall.c => ineighbor_alltoall.c.in} (91%) rename ompi/mpi/c/{ineighbor_alltoallv.c => ineighbor_alltoallv.c.in} (91%) create mode 100644 ompi/mpi/c/ineighbor_alltoallw.c.in rename ompi/mpi/c/{info_c2f.c => info_c2f.c.in} (86%) rename ompi/mpi/c/{info_create.c => info_create.c.in} (88%) rename ompi/mpi/c/{info_create_env.c => info_create_env.c.in} (88%) rename ompi/mpi/c/{info_delete.c => info_delete.c.in} (91%) rename ompi/mpi/c/{info_dup.c => info_dup.c.in} (91%) rename ompi/mpi/c/{info_f2c.c => info_f2c.c.in} (90%) rename ompi/mpi/c/{info_free.c => info_free.c.in} (89%) rename ompi/mpi/c/{info_get.c => info_get.c.in} (92%) rename ompi/mpi/c/{info_get_nkeys.c => info_get_nkeys.c.in} (88%) rename ompi/mpi/c/{info_get_nthkey.c => info_get_nthkey.c.in} (91%) rename ompi/mpi/c/{info_get_string.c => info_get_string.c.in} (91%) rename ompi/mpi/c/{info_get_valuelen.c => info_get_valuelen.c.in} (89%) rename ompi/mpi/c/{info_set.c => info_set.c.in} (93%) rename ompi/mpi/c/{init.c => init.c.in} (92%) rename ompi/mpi/c/{init_thread.c => init_thread.c.in} (92%) rename ompi/mpi/c/{initialized.c => initialized.c.in} (90%) rename ompi/mpi/c/{intercomm_create.c => intercomm_create.c.in} (87%) rename ompi/mpi/c/{intercomm_create_from_groups.c => intercomm_create_from_groups.c.in} (84%) rename ompi/mpi/c/{intercomm_merge.c => intercomm_merge.c.in} (94%) rename ompi/mpi/c/{iprobe.c => iprobe.c.in} (91%) rename ompi/mpi/c/{irecv.c => irecv.c.in} (89%) rename ompi/mpi/c/{ireduce.c => ireduce.c.in} (94%) rename ompi/mpi/c/{ireduce_scatter.c => ireduce_scatter.c.in} (92%) rename ompi/mpi/c/{ireduce_scatter_block.c => ireduce_scatter_block.c.in} (88%) rename ompi/mpi/c/{irsend.c => irsend.c.in} (90%) rename ompi/mpi/c/{is_thread_main.c => is_thread_main.c.in} (84%) rename ompi/mpi/c/{iscan.c => iscan.c.in} (91%) rename ompi/mpi/c/{iscatter.c => iscatter.c.in} (94%) rename ompi/mpi/c/{iscatterv.c => iscatterv.c.in} (95%) rename ompi/mpi/c/{isend.c => isend.c.in} (91%) rename ompi/mpi/c/{isendrecv.c => isendrecv.c.in} (93%) rename ompi/mpi/c/{isendrecv_replace.c => isendrecv_replace.c.in} (95%) rename ompi/mpi/c/{issend.c => issend.c.in} (90%) rename ompi/mpi/c/{keyval_create.c => keyval_create.c.in} (84%) rename ompi/mpi/c/{keyval_free.c => keyval_free.c.in} (85%) rename ompi/mpi/c/{lookup_name.c => lookup_name.c.in} (93%) rename ompi/mpi/c/{message_c2f.c => message_c2f.c.in} (89%) rename ompi/mpi/c/{message_f2c.c => message_f2c.c.in} (87%) rename ompi/mpi/c/{mprobe.c => mprobe.c.in} (90%) rename ompi/mpi/c/{mrecv.c => mrecv.c.in} (89%) rename ompi/mpi/c/{neighbor_allgather.c => neighbor_allgather.c.in} (91%) rename ompi/mpi/c/{neighbor_allgather_init.c => neighbor_allgather_init.c.in} (89%) rename ompi/mpi/c/{neighbor_allgatherv.c => neighbor_allgatherv.c.in} (92%) rename ompi/mpi/c/{neighbor_allgatherv_init.c => neighbor_allgatherv_init.c.in} (90%) rename ompi/mpi/c/{neighbor_alltoall.c => neighbor_alltoall.c.in} (92%) rename ompi/mpi/c/{neighbor_alltoall_init.c => neighbor_alltoall_init.c.in} (90%) rename ompi/mpi/c/{neighbor_alltoallv.c => neighbor_alltoallv.c.in} (92%) rename ompi/mpi/c/{neighbor_alltoallv_init.c => neighbor_alltoallv_init.c.in} (90%) create mode 100644 ompi/mpi/c/neighbor_alltoallw.c.in create mode 100644 ompi/mpi/c/neighbor_alltoallw_init.c.in rename ompi/mpi/c/{op_c2f.c => op_c2f.c.in} (86%) rename ompi/mpi/c/{op_commutative.c => op_commutative.c.in} (86%) rename ompi/mpi/c/{op_create.c => op_create.c.in} (87%) rename ompi/mpi/c/{op_f2c.c => op_f2c.c.in} (88%) rename ompi/mpi/c/{op_free.c => op_free.c.in} (86%) rename ompi/mpi/c/{open_port.c => open_port.c.in} (89%) rename ompi/mpi/c/{pack.c => pack.c.in} (93%) rename ompi/mpi/c/{pack_external.c => pack_external.c.in} (85%) rename ompi/mpi/c/{pack_external_size.c => pack_external_size.c.in} (84%) rename ompi/mpi/c/{pack_size.c => pack_size.c.in} (88%) rename ompi/mpi/c/{parrived.c => parrived.c.in} (88%) rename ompi/mpi/c/{pready.c => pready.c.in} (89%) rename ompi/mpi/c/{pready_list.c => pready_list.c.in} (87%) rename ompi/mpi/c/{pready_range.c => pready_range.c.in} (86%) rename ompi/mpi/c/{precv_init.c => precv_init.c.in} (84%) rename ompi/mpi/c/{probe.c => probe.c.in} (92%) rename ompi/mpi/c/{psend_init.c => psend_init.c.in} (84%) rename ompi/mpi/c/{publish_name.c => publish_name.c.in} (94%) rename ompi/mpi/c/{put.c => put.c.in} (88%) rename ompi/mpi/c/{query_thread.c => query_thread.c.in} (83%) rename ompi/mpi/c/{raccumulate.c => raccumulate.c.in} (92%) rename ompi/mpi/c/{recv.c => recv.c.in} (91%) rename ompi/mpi/c/{recv_init.c => recv_init.c.in} (89%) rename ompi/mpi/c/{reduce.c => reduce.c.in} (94%) rename ompi/mpi/c/{reduce_init.c => reduce_init.c.in} (93%) rename ompi/mpi/c/{reduce_local.c => reduce_local.c.in} (89%) rename ompi/mpi/c/{reduce_scatter.c => reduce_scatter.c.in} (92%) rename ompi/mpi/c/{reduce_scatter_block.c => reduce_scatter_block.c.in} (90%) rename ompi/mpi/c/{reduce_scatter_block_init.c => reduce_scatter_block_init.c.in} (87%) rename ompi/mpi/c/{reduce_scatter_init.c => reduce_scatter_init.c.in} (91%) rename ompi/mpi/c/{register_datarep.c => register_datarep.c.in} (82%) rename ompi/mpi/c/{request_c2f.c => request_c2f.c.in} (89%) rename ompi/mpi/c/{request_f2c.c => request_f2c.c.in} (87%) rename ompi/mpi/c/{request_free.c => request_free.c.in} (86%) rename ompi/mpi/c/{request_get_status.c => request_get_status.c.in} (90%) rename ompi/mpi/c/{rget.c => rget.c.in} (86%) rename ompi/mpi/c/{rget_accumulate.c => rget_accumulate.c.in} (91%) rename ompi/mpi/c/{rput.c => rput.c.in} (87%) rename ompi/mpi/c/{rsend.c => rsend.c.in} (91%) rename ompi/mpi/c/{rsend_init.c => rsend_init.c.in} (89%) rename ompi/mpi/c/{scan.c => scan.c.in} (92%) rename ompi/mpi/c/{scan_init.c => scan_init.c.in} (89%) rename ompi/mpi/c/{scatter.c => scatter.c.in} (94%) rename ompi/mpi/c/{scatter_init.c => scatter_init.c.in} (93%) rename ompi/mpi/c/{scatterv.c => scatterv.c.in} (95%) rename ompi/mpi/c/{scatterv_init.c => scatterv_init.c.in} (94%) rename ompi/mpi/c/{send.c => send.c.in} (91%) rename ompi/mpi/c/{send_init.c => send_init.c.in} (89%) rename ompi/mpi/c/{sendrecv.c => sendrecv.c.in} (91%) rename ompi/mpi/c/{sendrecv_replace.c => sendrecv_replace.c.in} (93%) rename ompi/mpi/c/{session_c2f.c => session_c2f.c.in} (85%) rename ompi/mpi/c/{session_call_errhandler.c => session_call_errhandler.c.in} (81%) rename ompi/mpi/c/{session_create_errhandler.c => session_create_errhandler.c.in} (74%) rename ompi/mpi/c/{session_f2c.c => session_f2c.c.in} (87%) rename ompi/mpi/c/{session_finalize.c => session_finalize.c.in} (74%) rename ompi/mpi/c/{session_get_errhandler.c => session_get_errhandler.c.in} (86%) rename ompi/mpi/c/{session_get_info.c => session_get_info.c.in} (85%) rename ompi/mpi/c/{session_get_nth_pset.c => session_get_nth_pset.c.in} (75%) rename ompi/mpi/c/{session_get_num_psets.c => session_get_num_psets.c.in} (75%) rename ompi/mpi/c/{session_get_pset_info.c => session_get_pset_info.c.in} (83%) rename ompi/mpi/c/{session_init.c => session_init.c.in} (82%) rename ompi/mpi/c/{session_set_errhandler.c => session_set_errhandler.c.in} (86%) rename ompi/mpi/c/{session_set_info.c => session_set_info.c.in} (82%) rename ompi/mpi/c/{ssend.c => ssend.c.in} (91%) rename ompi/mpi/c/{ssend_init.c => ssend_init.c.in} (89%) rename ompi/mpi/c/{start.c => start.c.in} (93%) rename ompi/mpi/c/{startall.c => startall.c.in} (93%) rename ompi/mpi/c/{status_c2f.c => status_c2f.c.in} (93%) rename ompi/mpi/c/{status_c2f08.c => status_c2f08.c.in} (90%) rename ompi/mpi/c/{status_f082c.c => status_f082c.c.in} (90%) rename ompi/mpi/c/{status_f082f.c => status_f082f.c.in} (88%) rename ompi/mpi/c/{status_f2c.c => status_f2c.c.in} (90%) rename ompi/mpi/c/{status_f2f08.c => status_f2f08.c.in} (88%) rename ompi/mpi/c/{status_set_cancelled.c => status_set_cancelled.c.in} (85%) rename ompi/mpi/c/{status_set_elements_x.c => status_set_elements.c.in} (88%) rename ompi/mpi/c/{status_set_elements.c => status_set_elements_x.c.in} (88%) rename ompi/mpi/c/{test.c => test.c.in} (88%) rename ompi/mpi/c/{test_cancelled.c => test_cancelled.c.in} (85%) rename ompi/mpi/c/{testall.c => testall.c.in} (90%) rename ompi/mpi/c/{testany.c => testany.c.in} (90%) rename ompi/mpi/c/{testsome.c => testsome.c.in} (89%) rename ompi/mpi/c/{topo_test.c => topo_test.c.in} (88%) rename ompi/mpi/c/{type_c2f.c => type_c2f.c.in} (88%) rename ompi/mpi/c/{type_commit.c => type_commit.c.in} (86%) rename ompi/mpi/c/{type_contiguous.c => type_contiguous.c.in} (85%) rename ompi/mpi/c/{type_create_darray.c => type_create_darray.c.in} (85%) rename ompi/mpi/c/{type_create_f90_complex.c => type_create_f90_complex.c.in} (93%) rename ompi/mpi/c/{type_create_f90_integer.c => type_create_f90_integer.c.in} (93%) rename ompi/mpi/c/{type_create_f90_real.c => type_create_f90_real.c.in} (94%) rename ompi/mpi/c/{type_create_hvector.c => type_create_hvector.c.in} (83%) rename ompi/mpi/c/{type_create_indexed_block.c => type_create_indexed_block.c.in} (82%) rename ompi/mpi/c/{type_create_keyval.c => type_create_keyval.c.in} (80%) rename ompi/mpi/c/{type_create_resized.c => type_create_resized.c.in} (81%) rename ompi/mpi/c/{type_create_subarray.c => type_create_subarray.c.in} (83%) rename ompi/mpi/c/{type_delete_attr.c => type_delete_attr.c.in} (85%) rename ompi/mpi/c/{type_dup.c => type_dup.c.in} (90%) rename ompi/mpi/c/{type_f2c.c => type_f2c.c.in} (88%) rename ompi/mpi/c/{type_free.c => type_free.c.in} (88%) rename ompi/mpi/c/{type_free_keyval.c => type_free_keyval.c.in} (84%) rename ompi/mpi/c/{type_get_attr.c => type_get_attr.c.in} (85%) rename ompi/mpi/c/{type_get_contents.c => type_get_contents.c.in} (83%) rename ompi/mpi/c/{type_get_envelope.c => type_get_envelope.c.in} (80%) rename ompi/mpi/c/{type_get_extent.c => type_get_extent.c.in} (84%) rename ompi/mpi/c/{type_get_extent_x.c => type_get_extent_x.c.in} (85%) rename ompi/mpi/c/{type_get_name.c => type_get_name.c.in} (88%) rename ompi/mpi/c/{type_get_true_extent.c => type_get_true_extent.c.in} (81%) rename ompi/mpi/c/{type_get_true_extent_x.c => type_get_true_extent_x.c.in} (82%) rename ompi/mpi/c/{type_indexed.c => type_indexed.c.in} (86%) rename ompi/mpi/c/{type_match_size.c => type_match_size.c.in} (87%) rename ompi/mpi/c/{type_set_attr.c => type_set_attr.c.in} (82%) rename ompi/mpi/c/{type_set_name.c => type_set_name.c.in} (87%) rename ompi/mpi/c/{type_size.c => type_size.c.in} (88%) rename ompi/mpi/c/{type_size_x.c => type_size_x.c.in} (87%) rename ompi/mpi/c/{type_vector.c => type_vector.c.in} (85%) rename ompi/mpi/c/{unpack.c => unpack.c.in} (92%) rename ompi/mpi/c/{unpack_external.c => unpack_external.c.in} (84%) rename ompi/mpi/c/{unpublish_name.c => unpublish_name.c.in} (92%) rename ompi/mpi/c/{wait.c => wait.c.in} (91%) rename ompi/mpi/c/{waitall.c => waitall.c.in} (90%) rename ompi/mpi/c/{waitany.c => waitany.c.in} (90%) rename ompi/mpi/c/{waitsome.c => waitsome.c.in} (89%) rename ompi/mpi/c/{win_allocate.c => win_allocate.c.in} (88%) rename ompi/mpi/c/{win_allocate_shared.c => win_allocate_shared.c.in} (87%) rename ompi/mpi/c/{win_attach.c => win_attach.c.in} (86%) rename ompi/mpi/c/{win_c2f.c => win_c2f.c.in} (89%) rename ompi/mpi/c/{win_call_errhandler.c => win_call_errhandler.c.in} (83%) rename ompi/mpi/c/{win_complete.c => win_complete.c.in} (85%) rename ompi/mpi/c/{win_create.c => win_create.c.in} (88%) rename ompi/mpi/c/{win_create_dynamic.c => win_create_dynamic.c.in} (88%) rename ompi/mpi/c/{win_create_errhandler.c => win_create_errhandler.c.in} (84%) rename ompi/mpi/c/{win_create_keyval.c => win_create_keyval.c.in} (81%) rename ompi/mpi/c/{win_delete_attr.c => win_delete_attr.c.in} (84%) rename ompi/mpi/c/{win_detach.c => win_detach.c.in} (87%) rename ompi/mpi/c/{win_fence.c => win_fence.c.in} (88%) rename ompi/mpi/c/{win_flush.c => win_flush.c.in} (87%) rename ompi/mpi/c/{win_flush_all.c => win_flush_all.c.in} (86%) rename ompi/mpi/c/{win_flush_local.c => win_flush_local.c.in} (85%) rename ompi/mpi/c/{win_flush_local_all.c => win_flush_local_all.c.in} (85%) rename ompi/mpi/c/{win_free.c => win_free.c.in} (86%) rename ompi/mpi/c/{win_free_keyval.c => win_free_keyval.c.in} (84%) rename ompi/mpi/c/{win_get_attr.c => win_get_attr.c.in} (86%) rename ompi/mpi/c/{win_get_errhandler.c => win_get_errhandler.c.in} (87%) rename ompi/mpi/c/{win_get_group.c => win_get_group.c.in} (84%) rename ompi/mpi/c/{win_get_info.c => win_get_info.c.in} (85%) rename ompi/mpi/c/{win_get_name.c => win_get_name.c.in} (87%) rename ompi/mpi/c/{win_lock.c => win_lock.c.in} (89%) rename ompi/mpi/c/{win_lock_all.c => win_lock_all.c.in} (86%) rename ompi/mpi/c/{win_post.c => win_post.c.in} (86%) rename ompi/mpi/c/{win_set_attr.c => win_set_attr.c.in} (84%) rename ompi/mpi/c/{win_set_errhandler.c => win_set_errhandler.c.in} (87%) rename ompi/mpi/c/{win_set_info.c => win_set_info.c.in} (80%) rename ompi/mpi/c/{win_set_name.c => win_set_name.c.in} (86%) rename ompi/mpi/c/{win_shared_query.c => win_shared_query.c.in} (81%) rename ompi/mpi/c/{win_start.c => win_start.c.in} (85%) rename ompi/mpi/c/{win_sync.c => win_sync.c.in} (87%) rename ompi/mpi/c/{win_test.c => win_test.c.in} (85%) rename ompi/mpi/c/{win_unlock.c => win_unlock.c.in} (87%) rename ompi/mpi/c/{win_unlock_all.c => win_unlock_all.c.in} (84%) rename ompi/mpi/c/{win_wait.c => win_wait.c.in} (86%) rename ompi/mpi/c/{wtime.c => wtime.c.in} (93%) diff --git a/.gitignore b/.gitignore index 3403a4d1d38..694d6325d53 100644 --- a/.gitignore +++ b/.gitignore @@ -534,9 +534,10 @@ docs/_static docs/_static/css/custom.css docs/_templates -# Common Python virtual environment directory names +# Common Python virtual environment and cache directory names venv py?? +__pycache__/ # Copies of PRRTE RST files (i.e., not source controlled in this tree) docs/prrte-rst-content @@ -546,3 +547,11 @@ docs/schizo-ompi-rst-content # tarballs) docs/html docs/man + +# Generated C Bindings +ompi/mpi/c/generated_*.c + +# Generated Fortran Bindings +ompi/mpi/fortran/use-mpi-f08/*_generated.F90 +ompi/mpi/fortran/use-mpi-f08/base/*_generated.c +ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-interfaces-generated.h diff --git a/config/ompi_config_files.m4 b/config/ompi_config_files.m4 index 119d0ddabaf..dde7f9cd1aa 100644 --- a/config/ompi_config_files.m4 +++ b/config/ompi_config_files.m4 @@ -40,8 +40,8 @@ AC_DEFUN([OMPI_CONFIG_FILES],[ ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr-file-interfaces.h ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr-removed-interfaces.h ompi/mpi/fortran/use-mpi-f08/Makefile - ompi/mpi/fortran/use-mpi-f08/base/Makefile ompi/mpi/fortran/use-mpi-f08/profile/Makefile + ompi/mpi/fortran/use-mpi-f08/base/Makefile ompi/mpi/fortran/use-mpi-f08/bindings/Makefile ompi/mpi/fortran/use-mpi-f08/mod/Makefile ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-interfaces.h diff --git a/config/ompi_configure_options.m4 b/config/ompi_configure_options.m4 index 1ebf01f0dc4..6883e3046d7 100644 --- a/config/ompi_configure_options.m4 +++ b/config/ompi_configure_options.m4 @@ -253,5 +253,26 @@ else fi AM_CONDITIONAL(OMPI_OMPIO_SUPPORT, test "$ompi_want_ompio" = "1") +AC_MSG_CHECKING([if want bigcount support]) +AC_ARG_ENABLE([bigcount], + [AS_HELP_STRING([--enable-bigcount], + [Enable the bigcount API])]) +if test "$enable_bigcount" = "yes" ; then + AC_MSG_RESULT([yes]) + ompi_enable_bigcount=1 +else + AC_MSG_RESULT([no]) + ompi_enable_bigcount=0 +fi +AC_DEFINE_UNQUOTED([OMPI_BIGCOUNT],[$ompi_enable_bigcount], + [Whether we want to compile bigcount API support]) + +# If the binding source files don't exist, then we need Python to generate them +AM_PATH_PYTHON([3.6],,[:]) +binding_file="${srcdir}/ompi/mpi/c/ompi_send.c" +AS_IF([! test -e "$binding_file" && test "$PYTHON" = ":"], + [AC_MSG_ERROR([Open MPI requires Python >=3.6 for generating the bindings. Aborting])]) +AM_CONDITIONAL(OMPI_GENERATE_BINDINGS,[test "$PYTHON" != ":"]) + ])dnl diff --git a/config/ompi_fortran_check_ts.m4 b/config/ompi_fortran_check_ts.m4 new file mode 100644 index 00000000000..1cc9d07a827 --- /dev/null +++ b/config/ompi_fortran_check_ts.m4 @@ -0,0 +1,69 @@ +dnl -*- shell-script -*- +dnl +dnl Copyright (c) 2019 Research Organization for Information Science +dnl and Technology (RIST). All rights reserved. +dnl $COPYRIGHT$ +dnl +dnl Additional copyrights may follow +dnl +dnl $HEADER$ +dnl + +# Check whether or not the C compiler supports ISO_Fortran_binding.h +# Also check whether C and Fortran compiler interoperate. +# +# OMPI_FORTRAN_CHECK_TS([action if found], [action if not found]) +# ---------------------------------------------------- +AC_DEFUN([OMPI_FORTRAN_CHECK_TS],[ + AS_VAR_PUSHDEF([fortran_ts], [ompi_cv_fortran_have_ts]) + + AC_CHECK_HEADERS([ISO_Fortran_binding.h], + [AC_CACHE_CHECK([if Fortran and C compilers support ISO_Fortran_binding.h], fortran_ts, + [mkdir conftest.$$ + cd conftest.$$ + + # Try to compile the C bindings + cat > conftest_c.c << EOF +#include + +int is_contiguous_c(CFI_cdesc_t* x) { + return CFI_is_contiguous(x); +} +EOF + OPAL_LOG_COMMAND([$CC $CCFLAGS -c conftest_c.c], + [cat > conftest.f90 << EOF +module MOD_IS_CONTIGUOUS + +interface + +function is_contiguous(buf) BIND(C, name="is_contiguous_c") + implicit none + type(*), dimension(..) :: buf + integer :: is_contiguous +end function is_contiguous + +end interface + +end module + +program test_is_contiguous + use MOD_IS_CONTIGUOUS + implicit none + integer :: a0, a1(2), a2(2,2), a3(2,2,2) + write (*,*) is_contiguous(a0) + write (*,*) is_contiguous(a1) + write (*,*) is_contiguous(a2) + write (*,*) is_contiguous(a3) +end program +EOF + OPAL_LOG_COMMAND([$FC $FCFLAGS $FCFLAGS_f90 -o conftest conftest.f90 conftest_c.o $LDFLAGS $LIBS], + [AS_VAR_SET(fortran_ts, yes)], + [AS_VAR_SET(fortran_ts, no)])], + [AS_VAR_SET(fortran_ts, no)]) + cd .. + rm -rf conftest.$$])], + [AS_VAR_SET(fortran_ts, no)]) + + AS_VAR_IF(fortran_ts, [yes], [$1], [$2]) + AS_VAR_POPDEF([fortran_ts])dnl +]) diff --git a/config/ompi_setup_mpi_fortran.m4 b/config/ompi_setup_mpi_fortran.m4 index 0fe0b333ebf..442b0fc8ec5 100644 --- a/config/ompi_setup_mpi_fortran.m4 +++ b/config/ompi_setup_mpi_fortran.m4 @@ -449,14 +449,27 @@ end program]])], # If we got all the stuff from above, then also look for the new # F08 syntax that we can use for the use_mpif08 module. - # We need to have ignore TKR functionality to build the mpi_f08 + OMPI_FORTRAN_HAVE_TS=0 + OMPI_MPI_SUBARRAYS_SUPPORTED=.false. + OMPI_MPI_ASYNC_PROTECTS_NONBLOCKING=.false. + AS_IF([test $OMPI_TRY_FORTRAN_BINDINGS -ge $OMPI_FORTRAN_USEMPIF08_BINDINGS], + [OMPI_FORTRAN_CHECK_TS([OMPI_FORTRAN_HAVE_TS=1])]) + + # We need to have ignore TKR or the ISO Fortran bindings functionality to build the mpi_f08 # module - AS_IF([test $OMPI_TRY_FORTRAN_BINDINGS -ge $OMPI_FORTRAN_USEMPIF08_BINDINGS && \ - test $OMPI_FORTRAN_HAVE_IGNORE_TKR -eq 1], - [OMPI_BUILD_FORTRAN_BINDINGS=$OMPI_FORTRAN_USEMPIF08_BINDINGS - OMPI_FORTRAN_F08_PREDECL=$OMPI_FORTRAN_IGNORE_TKR_PREDECL - OMPI_FORTRAN_F08_TYPE=$OMPI_FORTRAN_IGNORE_TKR_TYPE - ]) + AS_IF([test $OMPI_TRY_FORTRAN_BINDINGS -ge $OMPI_FORTRAN_USEMPIF08_BINDINGS], + [AS_IF([test $OMPI_FORTRAN_HAVE_IGNORE_TKR -eq 1], + [OMPI_BUILD_FORTRAN_BINDINGS=$OMPI_FORTRAN_USEMPIF08_BINDINGS + OMPI_FORTRAN_F08_PREDECL=$OMPI_FORTRAN_IGNORE_TKR_PREDECL + OMPI_FORTRAN_F08_TYPE=$OMPI_FORTRAN_IGNORE_TKR_TYPE + ]) + AS_IF([test $OMPI_FORTRAN_HAVE_TS -eq 1], + [OMPI_BUILD_FORTRAN_BINDINGS=$OMPI_FORTRAN_USEMPIF08_BINDINGS + OMPI_MPI_SUBARRAYS_SUPPORTED=.true. + OMPI_MPI_ASYNC_PROTECTS_NONBLOCKING=.true.])]) + + AC_SUBST(OMPI_MPI_SUBARRAYS_SUPPORTED) + AC_SUBST(OMPI_MPI_ASYNC_PROTECTS_NONBLOCKING) # The overall "_BIND_C" variable will be set to 1 if we have all # the necessary forms of BIND(C) @@ -590,8 +603,6 @@ end type test_mpi_handle], ]) OMPI_FORTRAN_NEED_WRAPPER_ROUTINES=1 - OMPI_FORTRAN_F08_PREDECL='!' - OMPI_FORTRAN_F08_TYPE=real OMPI_FORTRAN_HAVE_F08_ASSUMED_RANK=0 AS_IF([test $OMPI_TRY_FORTRAN_BINDINGS -ge $OMPI_FORTRAN_USEMPIF08_BINDINGS && \ test $OMPI_BUILD_FORTRAN_BINDINGS -ge $OMPI_FORTRAN_USEMPIF08_BINDINGS], @@ -599,8 +610,6 @@ end type test_mpi_handle], OMPI_FORTRAN_CHECK_F08_ASSUMED_RANK( [ # If we have assumed rank, we can build the use # mpi_f08 module "better" - OMPI_FORTRAN_F08_PREDECL='!' - OMPI_FORTRAN_F08_TYPE='type(*), dimension(..)' OMPI_FORTRAN_HAVE_F08_ASSUMED_RANK=1]) # Which mpi_f08 implementation are we using? @@ -630,6 +639,12 @@ end type test_mpi_handle], [OMPI_FORTRAN_ELEMENTAL_TYPE=])]) AC_SUBST(OMPI_FORTRAN_ELEMENTAL_TYPE) + OMPI_FORTRAN_HAVE_C_ISO_FORTRAN=0 + AS_IF([test $OMPI_TRY_FORTRAN_BINDINGS -ge $OMPI_FORTRAN_USEMPIF08_BINDINGS && \ + test $OMPI_BUILD_FORTRAN_BINDINGS -ge $OMPI_FORTRAN_USEMPIF08_BINDINGS], + [OMPI_FORTRAN_CHECK_TS([OMPI_FORTRAN_HAVE_TS=1], + [OMPI_FORTRAN_HAVE_TS=0])]) + # Note: the current implementation *only* has wrappers; # there is no optimized implementation for a "good" # compiler. I'm leaving the above logic in place for @@ -652,6 +667,8 @@ end type test_mpi_handle], AS_IF([test $OMPI_MIN_REQUIRED_FORTRAN_BINDINGS -gt $OMPI_BUILD_FORTRAN_BINDINGS], [AC_MSG_ERROR([Cannot build requested Fortran bindings, aborting])]) + dnl AC_CONFIG_FILES([ompi/mpi/fortran/use-mpi-f08/bindings/mpi-f-interfaces-bind.h]) + # ------------------- # mpif.h final setup # ------------------- @@ -792,10 +809,9 @@ end type test_mpi_handle], # This goes into mpifort-wrapper-data.txt AC_SUBST(OMPI_FORTRAN_USEMPIF08_LIB) - # These go into interfaces/mpi-f08-interfaces-[no]bind.h (and - # mpi-f*-interfaces*.h files) - AC_SUBST(OMPI_FORTRAN_F08_PREDECL) - AC_SUBST(OMPI_FORTRAN_F08_TYPE) + # These go into mod/mpi-f08-interfaces.h + AC_SUBST(OMPI_F08_IGNORE_TKR_PREDECL) + AC_SUBST(OMPI_F08_IGNORE_TKR_TYPE) AC_SUBST(OMPI_MPI_PREFIX) AC_SUBST(OMPI_MPI_BIND_PREFIX) @@ -877,6 +893,25 @@ end type test_mpi_handle], # For configure-fortran-output.h AC_SUBST(OMPI_FORTRAN_HAVE_BIND_C) + AM_CONDITIONAL(OMPI_FORTRAN_HAVE_TS, + [test $OMPI_FORTRAN_HAVE_TS -eq 1]) + AC_SUBST(OMPI_FORTRAN_HAVE_TS) + AC_DEFINE_UNQUOTED([OMPI_FORTRAN_HAVE_TS], + [$OMPI_FORTRAN_HAVE_TS], + [For ompi/mpi/fortran/use-mpi-f08/base/ts.*: whether the compiler supports TS 29113 or not]) + + AS_IF([test $OMPI_FORTRAN_HAVE_TS -eq 1], + [OMPI_F08_IGNORE_TKR_TYPE="type(*), dimension(..)" + OMPI_F08_IGNORE_TKR_PREDECL="no attribute required for" + OMPI_F08_BINDINGS_EXTENSION="ts" + OMPI_F08_BINDINGS_TS_SUFFIX="ts"], + [OMPI_F08_IGNORE_TKR_TYPE=$OMPI_FORTRAN_IGNORE_TKR_TYPE + OMPI_F08_IGNORE_TKR_PREDECL=${OMPI_FORTRAN_IGNORE_TKR_PREDECL:1} + OMPI_F08_BINDINGS_EXTENSION="f" + OMPI_F08_BINDINGS_TS_SUFFIX=""]) + AC_SUBST(OMPI_F08_BINDINGS_EXTENSION) + AC_SUBST(OMPI_F08_BINDINGS_TS_SUFFIX) + # Somewhat redundant because ompi/Makefile.am won't traverse into # ompi/mpi/fortran/use-mpi-f08 if it's not to be built, but we # might as well have ompi/mpi/fortran/use-mpi-f08/Makefile.am be diff --git a/docs/developers/bindings.rst b/docs/developers/bindings.rst new file mode 100644 index 00000000000..f747429c3df --- /dev/null +++ b/docs/developers/bindings.rst @@ -0,0 +1,146 @@ +C and Fortran Bindings +====================== + +The C and Fortran (mpi_f08) bindings are generated from Python code in +``ompi/mpi/bindings``. The C code is generated based on a template file for +each function, with a header and a body containing error-checking and +conversion code; the mpi_f08 Fortran bindings are generated from a single +file ``ompi/mpi/fortran/use-mpi-f08/interface.in``. + +The Python code depends on special prototype lines used with both the C and +Fortran bindings. These "prototypes" are designed to be easy to parse and use +specific type constants that can be mapped directly to the expanded +language-specific code, error-handling, and conversion code. + +C Bindings +---------- + +This will walk through adding (or converting) a plain-C binding into a +templated version controlled by the script. + +As an example, for ``MPI_Send`` you might have a C file that looks something +like this: + +.. code-block:: c + + #include "ompi_config.h" + ...other includes... + + int MPI_Send(const void *buf, int count, MPI_Datatype datatype, int dest, + int tag, MPI_Comm comm) + { + ...internal checks... + return internal_mpi_send(buf, count, datatype, dest, tag, comm); + } + +To convert this to a template, you will have to first ensure that only a single +function is defined in the file, removing or abstracting out static functions, +and separating multiple definitions, such as ``MPI_Send`` and ``MPI_Isend``, +into different files. The template should also not include any macro-processing +that attempts to change the name of the function or parameter types; this code +should be generated by the script, or abstracted into header files that can +work easily with multiple functions. + +At this point, the template should look like the example above, with a "header" +section, with simple includes or macros, maybe a static global, and the +function defintion and nothing else. + +The next step is to convert the signature line into the prototype format that +the script expects. For ``MPI_Send``, this should look something like this: + +.. code-block:: c + + PROTOTYPE ERROR_CLASS send(BUFFER buf, COUNT count, DATATYPE type, RANK dest, + TAG tag, COMM comm) + +Notice how the function name is changed, the ``MPI_`` prefix removed and the +rest converted to lowercase, and also how each parameter is simplified into a +``TYPE name`` format, where the ``TYPE`` conforms to an allowed list in +``ompi/mpi/bindings/ompi_bindings/c_type.py``. For newer functions and types, +you may have to extend the ``c_type.py`` file with a new class showing how to +handle the type. + +The final step is to update ``Makefile.am``, adding the template name, in this +case ``send.c.in``, to the ``prototype_sources`` variable, and the generated +file name, ``generated_send.c``, to ``interface_profile_sources``. The +generated file name must be of the form ``generated_${basename}.c``, where +``${basename}`` is the name of the template file stripped of all extensions. + +Fortran Bindings +---------------- + +To add a new Fortran binding, or update an existing one, one will need to +modify the ``ompi/mpi/fortran/use-mpi-f08/interface.json`` file; this JSON file +contains a list of prototype objects, including information about their name +and each parameter passed. Below is an example for ``MPI_Waitall``: + +.. code-block:: + + { + "name": "waitall", + "parameters": [ + { + "type": "SHORTCUT_COUNT", + "name": "count" + }, + { + "type": "REQUEST_ARRAY", + "name": "array_of_requests", + "dep_params": { + "count": "count" + } + }, + { + "type": "STATUS_ARRAY", + "name": "array_of_statuses", + "dep_params": { + "count": "count" + } + } + ] + } + +This object includes two properties: the ``name`` property holding the +subroutine name, converted to lowercase and the ``mpi_`` prefix removed; and +the ``parameters`` property describing all parameters, their types and +dependencies. Some parameters may depend on other types and this is listed in +the ``dep_params`` field. An example of this can be seen with +``array_of_requests`` above, in which ``dep_params`` holds a key-value pair +``"count": "count"``, where the key ``count`` corresponds to a key required by +the ``REQUEST_ARRAY`` type and the value ``count`` to the name of another +parameter. These parameter dependencies are specific to the types used and are +validated by the binding scripts. + +The Fortran binding code not only generates Fortran, but also additional +wrapping C code that calls into the C bindings, making conversions and checking +for Fortran-specific error conditions as necessary. The following files will be +generated by the script: + +* ``ompi/mpi/fortran/use-mpi-f08/api_f08_generated.F90`` +* ``ompi/mpi/fortran/use-mpi-f08/base/api_f08_generated.c`` +* ``ompi/mpi/fortran/use-mpi-f08/base/api_f08_ts_generated.c`` +* ``ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-interfaces-generated.h`` + +The Fortran file ``api_f08_generated.F90`` contains all the internal subroutine +definitions, each of which makes a call into corresponding C functions. Two +different C files are generated: ``api_f08_ts_generated.c`` contains support +for compilers with TS 29113 support, allowing the use of ``CFI_cdesc_t`` types +(see `Fortran 2018`_ for more details); and ``api_f08_generated.c`` for +compilers without TS 29113 support. The internal subroutine names are mapped to +the external interface, including multiple interfaces for the bigcount version +of functions, in ``mpi-f08-interfaces-generated.h``. + +.. _Fortran 2018: https://fortranwiki.org/fortran/show/Fortran+2018 + +If a new type needs to be added, then one will need to extend +``fortran_type.py`` in ``ompi/mpi/bindings/ompi_bindings`` with an additional +type class specifying how to handle the type in the above generated files, +including any required key-value attributes for more complicated types. New +types use a ``Type`` base class with functions that can be implemented by +derived classes, each returning expanded Fortran or C code. + +Other Considerations +-------------------- + +Keep in mind that the generated files will not be deleted with a ``make clean`` +or ``make distclean``; instead use ``make maintainer-clean`` to delete those. diff --git a/docs/developers/index.rst b/docs/developers/index.rst index 0bc31dbd3e8..6e82d253d37 100644 --- a/docs/developers/index.rst +++ b/docs/developers/index.rst @@ -22,3 +22,4 @@ probably don't need to read this section. gnu-autotools sphinx rst-for-markdown-expats.rst + bindings diff --git a/ompi/include/mpi.h.in b/ompi/include/mpi.h.in index 0c26fa08d8f..f3df90ca496 100644 --- a/ompi/include/mpi.h.in +++ b/ompi/include/mpi.h.in @@ -1389,82 +1389,147 @@ OMPI_DECLSPEC extern struct ompi_predefined_datatype_t ompi_mpi_ub; /* * MPI API */ - OMPI_DECLSPEC int MPI_Abort(MPI_Comm comm, int errorcode); OMPI_DECLSPEC int MPI_Accumulate(const void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Op op, MPI_Win win); +OMPI_DECLSPEC int MPI_Accumulate_c(const void *origin_addr, MPI_Count origin_count, MPI_Datatype origin_datatype, + int target_rank, MPI_Aint target_disp, MPI_Count target_count, + MPI_Datatype target_datatype, MPI_Op op, MPI_Win win); OMPI_DECLSPEC int MPI_Add_error_class(int *errorclass); OMPI_DECLSPEC int MPI_Add_error_code(int errorclass, int *errorcode); OMPI_DECLSPEC int MPI_Add_error_string(int errorcode, const char *string); OMPI_DECLSPEC int MPI_Allgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm); +OMPI_DECLSPEC int MPI_Allgather_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, MPI_Count recvcount, + MPI_Datatype recvtype, MPI_Comm comm); OMPI_DECLSPEC int MPI_Iallgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPI_Iallgather_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, MPI_Count recvcount, + MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int MPI_Allgather_init(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm, MPI_Info info, MPI_Request *request); +OMPI_DECLSPEC int MPI_Allgather_init_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, MPI_Count recvcount, MPI_Datatype recvtype, + MPI_Comm comm, MPI_Info info, MPI_Request *request); OMPI_DECLSPEC int MPI_Allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], const int displs[], MPI_Datatype recvtype, MPI_Comm comm); +OMPI_DECLSPEC int MPI_Allgatherv_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint displs[], MPI_Datatype recvtype, + MPI_Comm comm); OMPI_DECLSPEC int MPI_Iallgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], const int displs[], MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPI_Iallgatherv_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint displs[], MPI_Datatype recvtype, + MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int MPI_Allgatherv_init(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], const int displs[], MPI_Datatype recvtype, MPI_Comm comm, MPI_Info info, MPI_Request *request); +OMPI_DECLSPEC int MPI_Allgatherv_init_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint displs[], MPI_Datatype recvtype, + MPI_Comm comm, MPI_Info info, MPI_Request *request); OMPI_DECLSPEC int MPI_Alloc_mem(MPI_Aint size, MPI_Info info, void *baseptr); OMPI_DECLSPEC int MPI_Allreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); +OMPI_DECLSPEC int MPI_Allreduce_c(const void *sendbuf, void *recvbuf, MPI_Count count, MPI_Datatype datatype, + MPI_Op op, MPI_Comm comm); OMPI_DECLSPEC int MPI_Iallreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPI_Iallreduce_c(const void *sendbuf, void *recvbuf, MPI_Count count, MPI_Datatype datatype, + MPI_Op op, MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int MPI_Allreduce_init(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Info info, MPI_Request *request); +OMPI_DECLSPEC int MPI_Allreduce_init_c(const void *sendbuf, void *recvbuf, MPI_Count count, MPI_Datatype datatype, + MPI_Op op, MPI_Comm comm, MPI_Info info, MPI_Request *request); OMPI_DECLSPEC int MPI_Alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm); +OMPI_DECLSPEC int MPI_Alltoall_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, MPI_Count recvcount, + MPI_Datatype recvtype, MPI_Comm comm); OMPI_DECLSPEC int MPI_Ialltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPI_Ialltoall_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, MPI_Count recvcount, MPI_Datatype recvtype, + MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int MPI_Alltoall_init(const void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, - MPI_Comm comm, MPI_Info info, MPI_Request *request); + void *recvbuf, int recvcount, MPI_Datatype recvtype, + MPI_Comm comm, MPI_Info info, MPI_Request *request); +OMPI_DECLSPEC int MPI_Alltoall_init_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, MPI_Count recvcount, MPI_Datatype recvtype, + MPI_Comm comm, MPI_Info info, MPI_Request *request); OMPI_DECLSPEC int MPI_Alltoallv(const void *sendbuf, const int sendcounts[], const int sdispls[], MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], const int rdispls[], MPI_Datatype recvtype, MPI_Comm comm); +OMPI_DECLSPEC int MPI_Alltoallv_c(const void *sendbuf, const MPI_Count sendcounts[], const MPI_Aint sdispls[], MPI_Datatype sendtype, + void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint rdispls[], MPI_Datatype recvtype, + MPI_Comm comm); OMPI_DECLSPEC int MPI_Ialltoallv(const void *sendbuf, const int sendcounts[], const int sdispls[], MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], const int rdispls[], MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPI_Ialltoallv_c(const void *sendbuf, const MPI_Count sendcounts[], const MPI_Aint sdispls[], MPI_Datatype sendtype, + void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint rdispls[], MPI_Datatype recvtype, + MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int MPI_Alltoallv_init(const void *sendbuf, const int sendcounts[], const int sdispls[], MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], const int rdispls[], MPI_Datatype recvtype, MPI_Comm comm, MPI_Info info, MPI_Request *request); +OMPI_DECLSPEC int MPI_Alltoallv_init_c(const void *sendbuf, const MPI_Count sendcounts[], const MPI_Aint sdispls[], MPI_Datatype sendtype, + void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint rdispls[], MPI_Datatype recvtype, + MPI_Comm comm, MPI_Info info, MPI_Request *request); OMPI_DECLSPEC int MPI_Alltoallw(const void *sendbuf, const int sendcounts[], const int sdispls[], const MPI_Datatype sendtypes[], void *recvbuf, const int recvcounts[], const int rdispls[], const MPI_Datatype recvtypes[], MPI_Comm comm); +OMPI_DECLSPEC int MPI_Alltoallw_c(const void *sendbuf, const MPI_Count sendcounts[], const MPI_Aint sdispls[], const MPI_Datatype sendtypes[], + void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint rdispls[], const MPI_Datatype recvtypes[], + MPI_Comm comm); OMPI_DECLSPEC int MPI_Ialltoallw(const void *sendbuf, const int sendcounts[], const int sdispls[], const MPI_Datatype sendtypes[], void *recvbuf, const int recvcounts[], const int rdispls[], const MPI_Datatype recvtypes[], MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPI_Ialltoallw_c(const void *sendbuf, const MPI_Count sendcounts[], const MPI_Aint sdispls[], const MPI_Datatype sendtypes[], + void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint rdispls[], const MPI_Datatype recvtypes[], + MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int MPI_Alltoallw_init(const void *sendbuf, const int sendcounts[], const int sdispls[], const MPI_Datatype sendtypes[], void *recvbuf, const int recvcounts[], const int rdispls[], const MPI_Datatype recvtypes[], MPI_Comm comm, MPI_Info info, MPI_Request *request); +OMPI_DECLSPEC int MPI_Alltoallw_init_c(const void *sendbuf, const MPI_Count sendcounts[], const MPI_Aint sdispls[], const MPI_Datatype sendtypes[], + void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint rdispls[], const MPI_Datatype recvtypes[], + MPI_Comm comm, MPI_Info info, MPI_Request *request); OMPI_DECLSPEC int MPI_Barrier(MPI_Comm comm); OMPI_DECLSPEC int MPI_Ibarrier(MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int MPI_Barrier_init(MPI_Comm comm, MPI_Info info, MPI_Request *request); OMPI_DECLSPEC int MPI_Bcast(void *buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm); +OMPI_DECLSPEC int MPI_Bcast_c(void *buffer, MPI_Count count, MPI_Datatype datatype, + int root, MPI_Comm comm); OMPI_DECLSPEC int MPI_Ibcast(void *buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPI_Ibcast_c(void *buffer, MPI_Count count, MPI_Datatype datatype, + int root, MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int MPI_Bcast_init(void *buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm, MPI_Info info, MPI_Request *request); +OMPI_DECLSPEC int MPI_Bcast_init_c(void *buffer, MPI_Count count, MPI_Datatype datatype, + int root, MPI_Comm comm, MPI_Info info, MPI_Request *request); OMPI_DECLSPEC int MPI_Bsend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm); +OMPI_DECLSPEC int MPI_Bsend_c(const void *buf, MPI_Count count, MPI_Datatype datatype, + int dest, int tag, MPI_Comm comm); OMPI_DECLSPEC int MPI_Bsend_init(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPI_Bsend_init_c(const void *buf, MPI_Count count, MPI_Datatype datatype, + int dest, int tag, MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int MPI_Buffer_attach(void *buffer, int size); +OMPI_DECLSPEC int MPI_Buffer_attach_c(void *buffer, MPI_Count size); OMPI_DECLSPEC int MPI_Buffer_detach(void *buffer, int *size); +OMPI_DECLSPEC int MPI_Buffer_detach_c(void *buffer, MPI_Count *size); OMPI_DECLSPEC int MPI_Cancel(MPI_Request *request); OMPI_DECLSPEC int MPI_Cart_coords(MPI_Comm comm, int rank, int maxdims, int coords[]); OMPI_DECLSPEC int MPI_Cart_create(MPI_Comm old_comm, int ndims, const int dims[], @@ -1563,10 +1628,16 @@ OMPI_DECLSPEC int MPI_Error_class(int errorcode, int *errorclass); OMPI_DECLSPEC int MPI_Error_string(int errorcode, char *string, int *resultlen); OMPI_DECLSPEC int MPI_Exscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); +OMPI_DECLSPEC int MPI_Exscan_c(const void *sendbuf, void *recvbuf, MPI_Count count, MPI_Datatype datatype, + MPI_Op op, MPI_Comm comm); OMPI_DECLSPEC int MPI_Iexscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPI_Iexscan_c(const void *sendbuf, void *recvbuf, MPI_Count count, MPI_Datatype datatype, + MPI_Op op, MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int MPI_Exscan_init(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Info info, MPI_Request *request); +OMPI_DECLSPEC int MPI_Exscan_init_c(const void *sendbuf, void *recvbuf, MPI_Count count, MPI_Datatype datatype, + MPI_Op op, MPI_Comm comm, MPI_Info info, MPI_Request *request); OMPI_DECLSPEC int MPI_Fetch_and_op(const void *origin_addr, void *result_addr, MPI_Datatype datatype, int target_rank, MPI_Aint target_disp, MPI_Op op, MPI_Win win); OMPI_DECLSPEC MPI_Fint MPI_File_c2f(MPI_File file); @@ -1594,71 +1665,127 @@ OMPI_DECLSPEC int MPI_File_get_view(MPI_File fh, MPI_Offset *disp, MPI_Datatype *filetype, char *datarep); OMPI_DECLSPEC int MPI_File_read_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status); +OMPI_DECLSPEC int MPI_File_read_at_c(MPI_File fh, MPI_Offset offset, void *buf, + MPI_Count count, MPI_Datatype datatype, MPI_Status *status); OMPI_DECLSPEC int MPI_File_read_at_all(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status); +OMPI_DECLSPEC int MPI_File_read_at_all_c(MPI_File fh, MPI_Offset offset, void *buf, + MPI_Count count, MPI_Datatype datatype, MPI_Status *status); OMPI_DECLSPEC int MPI_File_write_at(MPI_File fh, MPI_Offset offset, const void *buf, int count, MPI_Datatype datatype, MPI_Status *status); +OMPI_DECLSPEC int MPI_File_write_at_c(MPI_File fh, MPI_Offset offset, const void *buf, + MPI_Count count, MPI_Datatype datatype, MPI_Status *status); OMPI_DECLSPEC int MPI_File_write_at_all(MPI_File fh, MPI_Offset offset, const void *buf, int count, MPI_Datatype datatype, MPI_Status *status); +OMPI_DECLSPEC int MPI_File_write_at_all_c(MPI_File fh, MPI_Offset offset, const void *buf, + MPI_Count count, MPI_Datatype datatype, MPI_Status *status); OMPI_DECLSPEC int MPI_File_iread_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Request *request); +OMPI_DECLSPEC int MPI_File_iread_at_c(MPI_File fh, MPI_Offset offset, void *buf, + MPI_Count count, MPI_Datatype datatype, MPI_Request *request); OMPI_DECLSPEC int MPI_File_iwrite_at(MPI_File fh, MPI_Offset offset, const void *buf, int count, MPI_Datatype datatype, MPI_Request *request); +OMPI_DECLSPEC int MPI_File_iwrite_at_c(MPI_File fh, MPI_Offset offset, const void *buf, + MPI_Count count, MPI_Datatype datatype, MPI_Request *request); OMPI_DECLSPEC int MPI_File_iread_at_all(MPI_File fh, MPI_Offset offset, void *buf, - int count, MPI_Datatype datatype, MPI_Request *request); + int count, MPI_Datatype datatype, MPI_Request *request); +OMPI_DECLSPEC int MPI_File_iread_at_all_c(MPI_File fh, MPI_Offset offset, void *buf, + MPI_Count count, MPI_Datatype datatype, MPI_Request *request); OMPI_DECLSPEC int MPI_File_iwrite_at_all(MPI_File fh, MPI_Offset offset, const void *buf, - int count, MPI_Datatype datatype, MPI_Request *request); + int count, MPI_Datatype datatype, MPI_Request *request); +OMPI_DECLSPEC int MPI_File_iwrite_at_all_c(MPI_File fh, MPI_Offset offset, const void *buf, + MPI_Count count, MPI_Datatype datatype, MPI_Request *request); OMPI_DECLSPEC int MPI_File_read(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status); +OMPI_DECLSPEC int MPI_File_read_c(MPI_File fh, void *buf, MPI_Count count, + MPI_Datatype datatype, MPI_Status *status); OMPI_DECLSPEC int MPI_File_read_all(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status); +OMPI_DECLSPEC int MPI_File_read_all_c(MPI_File fh, void *buf, MPI_Count count, + MPI_Datatype datatype, MPI_Status *status); OMPI_DECLSPEC int MPI_File_write(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, MPI_Status *status); +OMPI_DECLSPEC int MPI_File_write_c(MPI_File fh, const void *buf, MPI_Count count, + MPI_Datatype datatype, MPI_Status *status); OMPI_DECLSPEC int MPI_File_write_all(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, MPI_Status *status); +OMPI_DECLSPEC int MPI_File_write_all_c(MPI_File fh, const void *buf, MPI_Count count, + MPI_Datatype datatype, MPI_Status *status); OMPI_DECLSPEC int MPI_File_iread(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Request *request); +OMPI_DECLSPEC int MPI_File_iread_c(MPI_File fh, void *buf, MPI_Count count, + MPI_Datatype datatype, MPI_Request *request); OMPI_DECLSPEC int MPI_File_iwrite(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, MPI_Request *request); +OMPI_DECLSPEC int MPI_File_iwrite_c(MPI_File fh, const void *buf, MPI_Count count, + MPI_Datatype datatype, MPI_Request *request); OMPI_DECLSPEC int MPI_File_iread_all(MPI_File fh, void *buf, int count, - MPI_Datatype datatype, MPI_Request *request); + MPI_Datatype datatype, MPI_Request *request); +OMPI_DECLSPEC int MPI_File_iread_all_c(MPI_File fh, void *buf, MPI_Count count, + MPI_Datatype datatype, MPI_Request *request); OMPI_DECLSPEC int MPI_File_iwrite_all(MPI_File fh, const void *buf, int count, - MPI_Datatype datatype, MPI_Request *request); + MPI_Datatype datatype, MPI_Request *request); +OMPI_DECLSPEC int MPI_File_iwrite_all_c(MPI_File fh, const void *buf, MPI_Count count, + MPI_Datatype datatype, MPI_Request *request); OMPI_DECLSPEC int MPI_File_seek(MPI_File fh, MPI_Offset offset, int whence); OMPI_DECLSPEC int MPI_File_get_position(MPI_File fh, MPI_Offset *offset); OMPI_DECLSPEC int MPI_File_get_byte_offset(MPI_File fh, MPI_Offset offset, MPI_Offset *disp); OMPI_DECLSPEC int MPI_File_read_shared(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status); +OMPI_DECLSPEC int MPI_File_read_shared_c(MPI_File fh, void *buf, MPI_Count count, + MPI_Datatype datatype, MPI_Status *status); OMPI_DECLSPEC int MPI_File_write_shared(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, MPI_Status *status); +OMPI_DECLSPEC int MPI_File_write_shared_c(MPI_File fh, const void *buf, MPI_Count count, + MPI_Datatype datatype, MPI_Status *status); OMPI_DECLSPEC int MPI_File_iread_shared(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Request *request); +OMPI_DECLSPEC int MPI_File_iread_shared_c(MPI_File fh, void *buf, MPI_Count count, + MPI_Datatype datatype, MPI_Request *request); OMPI_DECLSPEC int MPI_File_iwrite_shared(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, MPI_Request *request); +OMPI_DECLSPEC int MPI_File_iwrite_shared_c(MPI_File fh, const void *buf, MPI_Count count, + MPI_Datatype datatype, MPI_Request *request); OMPI_DECLSPEC int MPI_File_read_ordered(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status); +OMPI_DECLSPEC int MPI_File_read_ordered_c(MPI_File fh, void *buf, MPI_Count count, + MPI_Datatype datatype, MPI_Status *status); OMPI_DECLSPEC int MPI_File_write_ordered(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, MPI_Status *status); +OMPI_DECLSPEC int MPI_File_write_ordered_c(MPI_File fh, const void *buf, MPI_Count count, + MPI_Datatype datatype, MPI_Status *status); OMPI_DECLSPEC int MPI_File_seek_shared(MPI_File fh, MPI_Offset offset, int whence); OMPI_DECLSPEC int MPI_File_get_position_shared(MPI_File fh, MPI_Offset *offset); OMPI_DECLSPEC int MPI_File_read_at_all_begin(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype); +OMPI_DECLSPEC int MPI_File_read_at_all_begin_c(MPI_File fh, MPI_Offset offset, void *buf, + MPI_Count count, MPI_Datatype datatype); OMPI_DECLSPEC int MPI_File_read_at_all_end(MPI_File fh, void *buf, MPI_Status *status); OMPI_DECLSPEC int MPI_File_write_at_all_begin(MPI_File fh, MPI_Offset offset, const void *buf, int count, MPI_Datatype datatype); +OMPI_DECLSPEC int MPI_File_write_at_all_begin_c(MPI_File fh, MPI_Offset offset, const void *buf, + MPI_Count count, MPI_Datatype datatype); OMPI_DECLSPEC int MPI_File_write_at_all_end(MPI_File fh, const void *buf, MPI_Status *status); OMPI_DECLSPEC int MPI_File_read_all_begin(MPI_File fh, void *buf, int count, MPI_Datatype datatype); +OMPI_DECLSPEC int MPI_File_read_all_begin_c(MPI_File fh, void *buf, MPI_Count count, + MPI_Datatype datatype); OMPI_DECLSPEC int MPI_File_read_all_end(MPI_File fh, void *buf, MPI_Status *status); OMPI_DECLSPEC int MPI_File_write_all_begin(MPI_File fh, const void *buf, int count, MPI_Datatype datatype); +OMPI_DECLSPEC int MPI_File_write_all_begin_c(MPI_File fh, const void *buf, MPI_Count count, + MPI_Datatype datatype); OMPI_DECLSPEC int MPI_File_write_all_end(MPI_File fh, const void *buf, MPI_Status *status); OMPI_DECLSPEC int MPI_File_read_ordered_begin(MPI_File fh, void *buf, int count, MPI_Datatype datatype); +OMPI_DECLSPEC int MPI_File_read_ordered_begin_c(MPI_File fh, void *buf, MPI_Count count, + MPI_Datatype datatype); OMPI_DECLSPEC int MPI_File_read_ordered_end(MPI_File fh, void *buf, MPI_Status *status); OMPI_DECLSPEC int MPI_File_write_ordered_begin(MPI_File fh, const void *buf, int count, MPI_Datatype datatype); +OMPI_DECLSPEC int MPI_File_write_ordered_begin_c(MPI_File fh, const void *buf, MPI_Count count, + MPI_Datatype datatype); OMPI_DECLSPEC int MPI_File_write_ordered_end(MPI_File fh, const void *buf, MPI_Status *status); OMPI_DECLSPEC int MPI_File_get_type_extent(MPI_File fh, MPI_Datatype datatype, MPI_Aint *extent); @@ -1671,33 +1798,61 @@ OMPI_DECLSPEC int MPI_Free_mem(void *base); OMPI_DECLSPEC int MPI_Gather(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm); +OMPI_DECLSPEC int MPI_Gather_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, MPI_Count recvcount, MPI_Datatype recvtype, + int root, MPI_Comm comm); OMPI_DECLSPEC int MPI_Igather(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPI_Igather_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, MPI_Count recvcount, MPI_Datatype recvtype, + int root, MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int MPI_Gather_init(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Info info, MPI_Request *request); +OMPI_DECLSPEC int MPI_Gather_init_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, MPI_Count recvcount, MPI_Datatype recvtype, + int root, MPI_Comm comm, MPI_Info info, MPI_Request *request); OMPI_DECLSPEC int MPI_Gatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], const int displs[], MPI_Datatype recvtype, int root, MPI_Comm comm); +OMPI_DECLSPEC int MPI_Gatherv_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint displs[], + MPI_Datatype recvtype, int root, MPI_Comm comm); OMPI_DECLSPEC int MPI_Igatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], const int displs[], MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPI_Igatherv_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint displs[], MPI_Datatype recvtype, + int root, MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int MPI_Gatherv_init(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], const int displs[], MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Info info, MPI_Request *request); +OMPI_DECLSPEC int MPI_Gatherv_init_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint displs[], MPI_Datatype recvtype, + int root, MPI_Comm comm, MPI_Info info, MPI_Request *request); OMPI_DECLSPEC int MPI_Get_address(const void *location, MPI_Aint *address); OMPI_DECLSPEC int MPI_Get_count(const MPI_Status *status, MPI_Datatype datatype, int *count); +OMPI_DECLSPEC int MPI_Get_count_c(const MPI_Status *status, MPI_Datatype datatype, MPI_Count *count); OMPI_DECLSPEC int MPI_Get_elements(const MPI_Status *status, MPI_Datatype datatype, int *count); +OMPI_DECLSPEC int MPI_Get_elements_c(const MPI_Status *status, MPI_Datatype datatype, MPI_Count *count); OMPI_DECLSPEC int MPI_Get_elements_x(const MPI_Status *status, MPI_Datatype datatype, MPI_Count *count); OMPI_DECLSPEC int MPI_Get(void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Win win); +OMPI_DECLSPEC int MPI_Get_c(void *origin_addr, MPI_Count origin_count, + MPI_Datatype origin_datatype, int target_rank, + MPI_Aint target_disp, MPI_Count target_count, + MPI_Datatype target_datatype, MPI_Win win); OMPI_DECLSPEC int MPI_Get_accumulate(const void *origin_addr, int origin_count, MPI_Datatype origin_datatype, void *result_addr, int result_count, MPI_Datatype result_datatype, int target_rank, MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Op op, MPI_Win win); +OMPI_DECLSPEC int MPI_Get_accumulate_c(const void *origin_addr, MPI_Count origin_count, MPI_Datatype origin_datatype, + void *result_addr, MPI_Count result_count, MPI_Datatype result_datatype, + int target_rank, MPI_Aint target_disp, MPI_Count target_count, + MPI_Datatype target_datatype, MPI_Op op, MPI_Win win); OMPI_DECLSPEC int MPI_Get_library_version(char *version, int *resultlen); OMPI_DECLSPEC int MPI_Get_processor_name(char *name, int *resultlen); OMPI_DECLSPEC int MPI_Get_version(int *version, int *subversion); @@ -1774,19 +1929,34 @@ OMPI_DECLSPEC int MPI_Iprobe(int source, int tag, MPI_Comm comm, int *flag, MPI_Status *status); OMPI_DECLSPEC int MPI_Irecv(void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPI_Irecv_c(void *buf, MPI_Count count, MPI_Datatype datatype, int source, + int tag, MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int MPI_Irsend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPI_Irsend_c(const void *buf, MPI_Count count, MPI_Datatype datatype, int dest, + int tag, MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int MPI_Isend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPI_Isend_c(const void *buf, MPI_Count count, MPI_Datatype datatype, int dest, + int tag, MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int MPI_Isendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, int dest, int sendtag, void *recvbuf, int recvcount, MPI_Datatype recvtype, int source, int recvtag, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPI_Isendrecv_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + int dest, int sendtag, void *recvbuf, MPI_Count recvcount, + MPI_Datatype recvtype, int source, int recvtag, + MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int MPI_Isendrecv_replace(void * buf, int count, MPI_Datatype datatype, int dest, int sendtag, int source, int recvtag, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPI_Isendrecv_replace_c(void * buf, MPI_Count count, MPI_Datatype datatype, + int dest, int sendtag, int source, int recvtag, + MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int MPI_Issend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPI_Issend_c(const void *buf, MPI_Count count, MPI_Datatype datatype, int dest, + int tag, MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int MPI_Is_thread_main(int *flag); OMPI_DECLSPEC int MPI_Lookup_name(const char *service_name, MPI_Info info, char *port_name); OMPI_DECLSPEC MPI_Fint MPI_Message_c2f(MPI_Message message); @@ -1796,51 +1966,98 @@ OMPI_DECLSPEC int MPI_Mprobe(int source, int tag, MPI_Comm comm, MPI_Status *status); OMPI_DECLSPEC int MPI_Mrecv(void *buf, int count, MPI_Datatype type, MPI_Message *message, MPI_Status *status); +OMPI_DECLSPEC int MPI_Mrecv_c(void *buf, MPI_Count count, MPI_Datatype type, + MPI_Message *message, MPI_Status *status); OMPI_DECLSPEC int MPI_Neighbor_allgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm); +OMPI_DECLSPEC int MPI_Neighbor_allgather_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, MPI_Count recvcount, MPI_Datatype recvtype, + MPI_Comm comm); OMPI_DECLSPEC int MPI_Ineighbor_allgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPI_Ineighbor_allgather_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, MPI_Count recvcount, MPI_Datatype recvtype, + MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int MPI_Neighbor_allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], const int displs[], MPI_Datatype recvtype, MPI_Comm comm); +OMPI_DECLSPEC int MPI_Neighbor_allgatherv_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint displs[], + MPI_Datatype recvtype, MPI_Comm comm); OMPI_DECLSPEC int MPI_Neighbor_allgather_init(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm, MPI_Info info, MPI_Request *request); +OMPI_DECLSPEC int MPI_Neighbor_allgather_init_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, MPI_Count recvcount, MPI_Datatype recvtype, + MPI_Comm comm, MPI_Info info, MPI_Request *request); OMPI_DECLSPEC int MPI_Ineighbor_allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], const int displs[], MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPI_Ineighbor_allgatherv_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint displs[], MPI_Datatype recvtype, + MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int MPI_Neighbor_allgatherv_init(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], const int displs[], MPI_Datatype recvtype, MPI_Comm comm, MPI_Info info, MPI_Request *request); +OMPI_DECLSPEC int MPI_Neighbor_allgatherv_init_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint displs[], MPI_Datatype recvtype, + MPI_Comm comm, MPI_Info info, MPI_Request *request); OMPI_DECLSPEC int MPI_Neighbor_alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm); +OMPI_DECLSPEC int MPI_Neighbor_alltoall_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, MPI_Count recvcount, MPI_Datatype recvtype, + MPI_Comm comm); OMPI_DECLSPEC int MPI_Ineighbor_alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPI_Ineighbor_alltoall_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, MPI_Count recvcount, MPI_Datatype recvtype, + MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int MPI_Neighbor_alltoall_init(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm, MPI_Info info, MPI_Request *request); +OMPI_DECLSPEC int MPI_Neighbor_alltoall_init_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, MPI_Count recvcount, MPI_Datatype recvtype, + MPI_Comm comm, MPI_Info info, MPI_Request *request); OMPI_DECLSPEC int MPI_Neighbor_alltoallv(const void *sendbuf, const int sendcounts[], const int sdispls[], MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], const int rdispls[], MPI_Datatype recvtype, MPI_Comm comm); +OMPI_DECLSPEC int MPI_Neighbor_alltoallv_c(const void *sendbuf, const MPI_Count sendcounts[], const MPI_Aint sdispls[], MPI_Datatype sendtype, + void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint rdispls[], MPI_Datatype recvtype, + MPI_Comm comm); OMPI_DECLSPEC int MPI_Ineighbor_alltoallv(const void *sendbuf, const int sendcounts[], const int sdispls[], MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], const int rdispls[], MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPI_Ineighbor_alltoallv_c(const void *sendbuf, const MPI_Count sendcounts[], const MPI_Aint sdispls[], MPI_Datatype sendtype, + void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint rdispls[], MPI_Datatype recvtype, + MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int MPI_Neighbor_alltoallv_init(const void *sendbuf, const int sendcounts[], const int sdispls[], MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], const int rdispls[], MPI_Datatype recvtype, MPI_Comm comm, MPI_Info info, MPI_Request *request); +OMPI_DECLSPEC int MPI_Neighbor_alltoallv_init_c(const void *sendbuf, const MPI_Count sendcounts[], const MPI_Aint sdispls[], MPI_Datatype sendtype, + void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint rdispls[], MPI_Datatype recvtype, + MPI_Comm comm, MPI_Info info, MPI_Request *request); OMPI_DECLSPEC int MPI_Neighbor_alltoallw(const void *sendbuf, const int sendcounts[], const MPI_Aint sdispls[], const MPI_Datatype sendtypes[], void *recvbuf, const int recvcounts[], const MPI_Aint rdispls[], const MPI_Datatype recvtypes[], MPI_Comm comm); +OMPI_DECLSPEC int MPI_Neighbor_alltoallw_c(const void *sendbuf, const MPI_Count sendcounts[], const MPI_Aint sdispls[], const MPI_Datatype sendtypes[], + void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint rdispls[], const MPI_Datatype recvtypes[], + MPI_Comm comm); OMPI_DECLSPEC int MPI_Ineighbor_alltoallw(const void *sendbuf, const int sendcounts[], const MPI_Aint sdispls[], const MPI_Datatype sendtypes[], void *recvbuf, const int recvcounts[], const MPI_Aint rdispls[], const MPI_Datatype recvtypes[], MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPI_Ineighbor_alltoallw_c(const void *sendbuf, const MPI_Count sendcounts[], const MPI_Aint sdispls[], const MPI_Datatype sendtypes[], + void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint rdispls[], const MPI_Datatype recvtypes[], + MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int MPI_Neighbor_alltoallw_init(const void *sendbuf, const int sendcounts[], const MPI_Aint sdispls[], const MPI_Datatype sendtypes[], void *recvbuf, const int recvcounts[], const MPI_Aint rdispls[], const MPI_Datatype recvtypes[], MPI_Comm comm, MPI_Info info, MPI_Request *request); +OMPI_DECLSPEC int MPI_Neighbor_alltoallw_init_c(const void *sendbuf, const MPI_Count sendcounts[], const MPI_Aint sdispls[], const MPI_Datatype sendtypes[], + void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint rdispls[], const MPI_Datatype recvtypes[], + MPI_Comm comm, MPI_Info info, MPI_Request *request); OMPI_DECLSPEC MPI_Fint MPI_Op_c2f(MPI_Op op); OMPI_DECLSPEC int MPI_Op_commutative(MPI_Op op, int *commute); OMPI_DECLSPEC int MPI_Op_create(MPI_User_function *function, int commute, MPI_Op *op); @@ -1850,12 +2067,21 @@ OMPI_DECLSPEC int MPI_Op_free(MPI_Op *op); OMPI_DECLSPEC int MPI_Pack_external(const char datarep[], const void *inbuf, int incount, MPI_Datatype datatype, void *outbuf, MPI_Aint outsize, MPI_Aint *position); +OMPI_DECLSPEC int MPI_Pack_external_c(const char datarep[], const void *inbuf, MPI_Count incount, + MPI_Datatype datatype, void *outbuf, + MPI_Aint outsize, MPI_Aint *position); OMPI_DECLSPEC int MPI_Pack_external_size(const char datarep[], int incount, MPI_Datatype datatype, MPI_Aint *size); +OMPI_DECLSPEC int MPI_Pack_external_size_c(const char datarep[], MPI_Count incount, + MPI_Datatype datatype, MPI_Aint *size); OMPI_DECLSPEC int MPI_Pack(const void *inbuf, int incount, MPI_Datatype datatype, void *outbuf, int outsize, int *position, MPI_Comm comm); +OMPI_DECLSPEC int MPI_Pack_c(const void *inbuf, MPI_Count incount, MPI_Datatype datatype, + void *outbuf, MPI_Count outsize, MPI_Count *position, MPI_Comm comm); OMPI_DECLSPEC int MPI_Pack_size(int incount, MPI_Datatype datatype, MPI_Comm comm, int *size); +OMPI_DECLSPEC int MPI_Pack_size_c(MPI_Count incount, MPI_Datatype datatype, MPI_Comm comm, + MPI_Count *size); OMPI_DECLSPEC int MPI_Parrived(MPI_Request request, int partition, int *flag); OMPI_DECLSPEC int MPI_Pcontrol(const int level, ...); OMPI_DECLSPEC int MPI_Pready(int partitions, MPI_Request request); @@ -1874,34 +2100,66 @@ OMPI_DECLSPEC int MPI_Publish_name(const char *service_name, MPI_Info info, OMPI_DECLSPEC int MPI_Put(const void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Win win); +OMPI_DECLSPEC int MPI_Put_c(const void *origin_addr, MPI_Count origin_count, MPI_Datatype origin_datatype, + int target_rank, MPI_Aint target_disp, MPI_Count target_count, + MPI_Datatype target_datatype, MPI_Win win); OMPI_DECLSPEC int MPI_Query_thread(int *provided); OMPI_DECLSPEC int MPI_Raccumulate(const void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Op op, MPI_Win win, MPI_Request *request); +OMPI_DECLSPEC int MPI_Raccumulate_c(const void *origin_addr, MPI_Count origin_count, MPI_Datatype origin_datatype, + int target_rank, MPI_Aint target_disp, MPI_Count target_count, + MPI_Datatype target_datatype, MPI_Op op, MPI_Win win, MPI_Request *request); OMPI_DECLSPEC int MPI_Recv_init(void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPI_Recv_init_c(void *buf, MPI_Count count, MPI_Datatype datatype, int source, + int tag, MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int MPI_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Status *status); +OMPI_DECLSPEC int MPI_Recv_c(void *buf, MPI_Count count, MPI_Datatype datatype, int source, + int tag, MPI_Comm comm, MPI_Status *status); +OMPI_DECLSPEC int MPI_Recv_c(void *buf, MPI_Count count, MPI_Datatype datatype, int source, + int tag, MPI_Comm comm, MPI_Status *status); OMPI_DECLSPEC int MPI_Reduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm); +OMPI_DECLSPEC int MPI_Reduce_c(const void *sendbuf, void *recvbuf, MPI_Count count, MPI_Datatype datatype, + MPI_Op op, int root, MPI_Comm comm); OMPI_DECLSPEC int MPI_Ireduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPI_Ireduce_c(const void *sendbuf, void *recvbuf, MPI_Count count, MPI_Datatype datatype, + MPI_Op op, int root, MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int MPI_Reduce_init(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm, MPI_Info info, MPI_Request *request); +OMPI_DECLSPEC int MPI_Reduce_init_c(const void *sendbuf, void *recvbuf, MPI_Count count, MPI_Datatype datatype, + MPI_Op op, int root, MPI_Comm comm, MPI_Info info, MPI_Request *request); OMPI_DECLSPEC int MPI_Reduce_local(const void *inbuf, void *inoutbuf, int count, MPI_Datatype datatype, MPI_Op op); +OMPI_DECLSPEC int MPI_Reduce_local_c(const void *inbuf, void *inoutbuf, MPI_Count count, + MPI_Datatype datatype, MPI_Op op); OMPI_DECLSPEC int MPI_Reduce_scatter(const void *sendbuf, void *recvbuf, const int recvcounts[], MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); +OMPI_DECLSPEC int MPI_Reduce_scatter_c(const void *sendbuf, void *recvbuf, const MPI_Count recvcounts[], MPI_Datatype datatype, + MPI_Op op, MPI_Comm comm); OMPI_DECLSPEC int MPI_Ireduce_scatter(const void *sendbuf, void *recvbuf, const int recvcounts[], MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPI_Ireduce_scatter_c(const void *sendbuf, void *recvbuf, const MPI_Count recvcounts[], MPI_Datatype datatype, + MPI_Op op, MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int MPI_Reduce_scatter_init(const void *sendbuf, void *recvbuf, const int recvcounts[], MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Info info, MPI_Request *request); +OMPI_DECLSPEC int MPI_Reduce_scatter_init_c(const void *sendbuf, void *recvbuf, const MPI_Count recvcounts[], MPI_Datatype datatype, + MPI_Op op, MPI_Comm comm, MPI_Info info, MPI_Request *request); OMPI_DECLSPEC int MPI_Reduce_scatter_block(const void *sendbuf, void *recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); +OMPI_DECLSPEC int MPI_Reduce_scatter_block_c(const void *sendbuf, void *recvbuf, MPI_Count recvcount, MPI_Datatype datatype, + MPI_Op op, MPI_Comm comm); OMPI_DECLSPEC int MPI_Ireduce_scatter_block(const void *sendbuf, void *recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPI_Ireduce_scatter_block_c(const void *sendbuf, void *recvbuf, MPI_Count recvcount, MPI_Datatype datatype, + MPI_Op op, MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int MPI_Reduce_scatter_block_init(const void *sendbuf, void *recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Info info, MPI_Request *request); +OMPI_DECLSPEC int MPI_Reduce_scatter_block_init_c(const void *sendbuf, void *recvbuf, MPI_Count recvcount, MPI_Datatype datatype, + MPI_Op op, MPI_Comm comm, MPI_Info info, MPI_Request *request); OMPI_DECLSPEC int MPI_Register_datarep(const char *datarep, MPI_Datarep_conversion_function *read_conversion_fn, MPI_Datarep_conversion_function *write_conversion_fn, @@ -1915,55 +2173,107 @@ OMPI_DECLSPEC int MPI_Request_get_status(MPI_Request request, int *flag, OMPI_DECLSPEC int MPI_Rget(void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Win win, MPI_Request *request); +OMPI_DECLSPEC int MPI_Rget_c(void *origin_addr, MPI_Count origin_count, MPI_Datatype origin_datatype, + int target_rank, MPI_Aint target_disp, MPI_Count target_count, MPI_Datatype target_datatype, + MPI_Win win, MPI_Request *request); OMPI_DECLSPEC int MPI_Rget_accumulate(const void *origin_addr, int origin_count, MPI_Datatype origin_datatype, void *result_addr, int result_count, MPI_Datatype result_datatype, int target_rank, MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Op op, MPI_Win win, MPI_Request *request); +OMPI_DECLSPEC int MPI_Rget_accumulate_c(const void *origin_addr, MPI_Count origin_count, MPI_Datatype origin_datatype, + void *result_addr, MPI_Count result_count, MPI_Datatype result_datatype, + int target_rank, MPI_Aint target_disp, MPI_Count target_count, + MPI_Datatype target_datatype, MPI_Op op, + MPI_Win win, MPI_Request *request); OMPI_DECLSPEC int MPI_Rput(const void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp, int target_cout, MPI_Datatype target_datatype, MPI_Win win, MPI_Request *request); +OMPI_DECLSPEC int MPI_Rput_c(const void *origin_addr, MPI_Count origin_count, MPI_Datatype origin_datatype, + int target_rank, MPI_Aint target_disp, int target_cout, + MPI_Datatype target_datatype, MPI_Win win, MPI_Request *request); OMPI_DECLSPEC int MPI_Rsend(const void *ibuf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm); +OMPI_DECLSPEC int MPI_Rsend_c(const void *ibuf, MPI_Count count, MPI_Datatype datatype, int dest, + int tag, MPI_Comm comm); OMPI_DECLSPEC int MPI_Rsend_init(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPI_Rsend_init_c(const void *buf, MPI_Count count, MPI_Datatype datatype, + int dest, int tag, MPI_Comm comm, + MPI_Request *request); OMPI_DECLSPEC int MPI_Scan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); +OMPI_DECLSPEC int MPI_Scan_c(const void *sendbuf, void *recvbuf, MPI_Count count, MPI_Datatype datatype, + MPI_Op op, MPI_Comm comm); OMPI_DECLSPEC int MPI_Iscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPI_Iscan_c(const void *sendbuf, void *recvbuf, MPI_Count count, MPI_Datatype datatype, + MPI_Op op, MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int MPI_Scan_init(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Info info, MPI_Request *request); +OMPI_DECLSPEC int MPI_Scan_init_c(const void *sendbuf, void *recvbuf, MPI_Count count, MPI_Datatype datatype, + MPI_Op op, MPI_Comm comm, MPI_Info info, MPI_Request *request); OMPI_DECLSPEC int MPI_Scatter(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm); +OMPI_DECLSPEC int MPI_Scatter_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, MPI_Count recvcount, MPI_Datatype recvtype, + int root, MPI_Comm comm); OMPI_DECLSPEC int MPI_Iscatter(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPI_Iscatter_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, MPI_Count recvcount, MPI_Datatype recvtype, + int root, MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int MPI_Scatter_init(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Info info, MPI_Request *request); +OMPI_DECLSPEC int MPI_Scatter_init_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, MPI_Count recvcount, MPI_Datatype recvtype, + int root, MPI_Comm comm, MPI_Info info, MPI_Request *request); OMPI_DECLSPEC int MPI_Scatterv(const void *sendbuf, const int sendcounts[], const int displs[], MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm); +OMPI_DECLSPEC int MPI_Scatterv_c(const void *sendbuf, const MPI_Count sendcounts[], const MPI_Aint displs[], MPI_Datatype sendtype, + void *recvbuf, MPI_Count recvcount, MPI_Datatype recvtype, + int root, MPI_Comm comm); OMPI_DECLSPEC int MPI_Iscatterv(const void *sendbuf, const int sendcounts[], const int displs[], MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPI_Iscatterv_c(const void *sendbuf, const MPI_Count sendcounts[], const MPI_Aint displs[], MPI_Datatype sendtype, + void *recvbuf, MPI_Count recvcount, MPI_Datatype recvtype, + int root, MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int MPI_Scatterv_init(const void *sendbuf, const int sendcounts[], const int displs[], MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Info info, MPI_Request *request); +OMPI_DECLSPEC int MPI_Scatterv_init_c(const void *sendbuf, const MPI_Count sendcounts[], const MPI_Aint displs[], MPI_Datatype sendtype, + void *recvbuf, MPI_Count recvcount, MPI_Datatype recvtype, + int root, MPI_Comm comm, MPI_Info info, MPI_Request *request); OMPI_DECLSPEC int MPI_Send_init(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPI_Send_init_c(const void *buf, MPI_Count count, MPI_Datatype datatype, + int dest, int tag, MPI_Comm comm, + MPI_Request *request); OMPI_DECLSPEC int MPI_Send(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm); +OMPI_DECLSPEC int MPI_Send_c(const void *buf, MPI_Count count, MPI_Datatype datatype, int dest, + int tag, MPI_Comm comm); OMPI_DECLSPEC int MPI_Sendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, int dest, int sendtag, void *recvbuf, int recvcount, MPI_Datatype recvtype, int source, int recvtag, MPI_Comm comm, MPI_Status *status); +OMPI_DECLSPEC int MPI_Sendrecv_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + int dest, int sendtag, void *recvbuf, MPI_Count recvcount, + MPI_Datatype recvtype, int source, int recvtag, + MPI_Comm comm, MPI_Status *status); OMPI_DECLSPEC int MPI_Sendrecv_replace(void * buf, int count, MPI_Datatype datatype, int dest, int sendtag, int source, int recvtag, MPI_Comm comm, MPI_Status *status); +OMPI_DECLSPEC int MPI_Sendrecv_replace_c(void * buf, MPI_Count count, MPI_Datatype datatype, + int dest, int sendtag, int source, int recvtag, + MPI_Comm comm, MPI_Status *status); OMPI_DECLSPEC MPI_Fint MPI_Session_c2f (const MPI_Session session); OMPI_DECLSPEC int MPI_Session_call_errhandler(MPI_Session session, int errorcode); OMPI_DECLSPEC int MPI_Session_create_errhandler (MPI_Session_errhandler_function *session_errhandler_fn, @@ -1982,8 +2292,13 @@ OMPI_DECLSPEC int MPI_Session_set_info (MPI_Session session, MPI_Info info); OMPI_DECLSPEC int MPI_Ssend_init(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPI_Ssend_init_c(const void *buf, MPI_Count count, MPI_Datatype datatype, + int dest, int tag, MPI_Comm comm, + MPI_Request *request); OMPI_DECLSPEC int MPI_Ssend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm); +OMPI_DECLSPEC int MPI_Ssend_c(const void *buf, MPI_Count count, MPI_Datatype datatype, int dest, + int tag, MPI_Comm comm); OMPI_DECLSPEC int MPI_Start(MPI_Request *request); OMPI_DECLSPEC int MPI_Startall(int count, MPI_Request array_of_requests[]); OMPI_DECLSPEC int MPI_Status_c2f(const MPI_Status *c_status, MPI_Fint *f_status); @@ -1995,6 +2310,8 @@ OMPI_DECLSPEC int MPI_Status_f2f08(const MPI_Fint *f_status, MPI_F08_status *f0 OMPI_DECLSPEC int MPI_Status_set_cancelled(MPI_Status *status, int flag); OMPI_DECLSPEC int MPI_Status_set_elements(MPI_Status *status, MPI_Datatype datatype, int count); +OMPI_DECLSPEC int MPI_Status_set_elements_c(MPI_Status *status, MPI_Datatype datatype, + MPI_Count count); OMPI_DECLSPEC int MPI_Status_set_elements_x(MPI_Status *status, MPI_Datatype datatype, MPI_Count count); OMPI_DECLSPEC int MPI_Testall(int count, MPI_Request array_of_requests[], int *flag, @@ -2011,6 +2328,8 @@ OMPI_DECLSPEC MPI_Fint MPI_Type_c2f(MPI_Datatype datatype); OMPI_DECLSPEC int MPI_Type_commit(MPI_Datatype *type); OMPI_DECLSPEC int MPI_Type_contiguous(int count, MPI_Datatype oldtype, MPI_Datatype *newtype); +OMPI_DECLSPEC int MPI_Type_contiguous_c(MPI_Count count, MPI_Datatype oldtype, + MPI_Datatype *newtype); OMPI_DECLSPEC int MPI_Type_create_darray(int size, int rank, int ndims, const int gsize_array[], const int distrib_array[], const int darg_array[], const int psize_array[], @@ -2023,13 +2342,24 @@ OMPI_DECLSPEC int MPI_Type_create_hindexed_block(int count, int blocklength, const MPI_Aint array_of_displacements[], MPI_Datatype oldtype, MPI_Datatype *newtype); +OMPI_DECLSPEC int MPI_Type_create_hindexed_block_c(MPI_Count count, MPI_Count blocklength, + const MPI_Aint array_of_displacements[], + MPI_Datatype oldtype, + MPI_Datatype *newtype); OMPI_DECLSPEC int MPI_Type_create_hindexed(int count, const int array_of_blocklengths[], const MPI_Aint array_of_displacements[], MPI_Datatype oldtype, MPI_Datatype *newtype); +OMPI_DECLSPEC int MPI_Type_create_hindexed_c(MPI_Count count, const MPI_Count array_of_blocklengths[], + const MPI_Aint array_of_displacements[], + MPI_Datatype oldtype, + MPI_Datatype *newtype); OMPI_DECLSPEC int MPI_Type_create_hvector(int count, int blocklength, MPI_Aint stride, MPI_Datatype oldtype, MPI_Datatype *newtype); +OMPI_DECLSPEC int MPI_Type_create_hvector_c(MPI_Count count, MPI_Count blocklength, MPI_Aint stride, + MPI_Datatype oldtype, + MPI_Datatype *newtype); OMPI_DECLSPEC int MPI_Type_create_keyval(MPI_Type_copy_attr_function *type_copy_attr_fn, MPI_Type_delete_attr_function *type_delete_attr_fn, int *type_keyval, void *extra_state); @@ -2037,13 +2367,24 @@ OMPI_DECLSPEC int MPI_Type_create_indexed_block(int count, int blocklength, const int array_of_displacements[], MPI_Datatype oldtype, MPI_Datatype *newtype); +OMPI_DECLSPEC int MPI_Type_create_indexed_block_c(MPI_Count count, MPI_Count blocklength, + const MPI_Aint array_of_displacements[], + MPI_Datatype oldtype, + MPI_Datatype *newtype); OMPI_DECLSPEC int MPI_Type_create_struct(int count, const int array_of_block_lengths[], const MPI_Aint array_of_displacements[], const MPI_Datatype array_of_types[], MPI_Datatype *newtype); +OMPI_DECLSPEC int MPI_Type_create_struct_c(MPI_Count count, const MPI_Count array_of_block_lengths[], + const MPI_Aint array_of_displacements[], + const MPI_Datatype array_of_types[], + MPI_Datatype *newtype); OMPI_DECLSPEC int MPI_Type_create_subarray(int ndims, const int size_array[], const int subsize_array[], const int start_array[], int order, MPI_Datatype oldtype, MPI_Datatype *newtype); +OMPI_DECLSPEC int MPI_Type_create_subarray_c(int ndims, const MPI_Count size_array[], const MPI_Count subsize_array[], + const MPI_Count start_array[], int order, + MPI_Datatype oldtype, MPI_Datatype *newtype); OMPI_DECLSPEC int MPI_Type_create_resized(MPI_Datatype oldtype, MPI_Aint lb, MPI_Aint extent, MPI_Datatype *newtype); OMPI_DECLSPEC int MPI_Type_delete_attr(MPI_Datatype type, int type_keyval); @@ -2058,6 +2399,7 @@ OMPI_DECLSPEC int MPI_Type_get_contents(MPI_Datatype mtype, int max_integers, int array_of_integers[], MPI_Aint array_of_addresses[], MPI_Datatype array_of_datatypes[]); +/* TODO: MPI_Type_get_contents_c */ OMPI_DECLSPEC int MPI_Type_get_envelope(MPI_Datatype type, int *num_integers, int *num_addresses, int *num_datatypes, int *combiner); @@ -2074,21 +2416,33 @@ OMPI_DECLSPEC int MPI_Type_get_true_extent_x(MPI_Datatype datatype, MPI_Count * OMPI_DECLSPEC int MPI_Type_indexed(int count, const int array_of_blocklengths[], const int array_of_displacements[], MPI_Datatype oldtype, MPI_Datatype *newtype); +OMPI_DECLSPEC int MPI_Type_indexed_c(MPI_Count count, const MPI_Count array_of_blocklengths[], + const MPI_Aint array_of_displacements[], + MPI_Datatype oldtype, MPI_Datatype *newtype); OMPI_DECLSPEC int MPI_Type_match_size(int typeclass, int size, MPI_Datatype *type); OMPI_DECLSPEC int MPI_Type_set_attr(MPI_Datatype type, int type_keyval, void *attr_val); OMPI_DECLSPEC int MPI_Type_set_name(MPI_Datatype type, const char *type_name); OMPI_DECLSPEC int MPI_Type_size(MPI_Datatype type, int *size); +OMPI_DECLSPEC int MPI_Type_size_c(MPI_Datatype type, MPI_Count *size); OMPI_DECLSPEC int MPI_Type_size_x(MPI_Datatype type, MPI_Count *size); OMPI_DECLSPEC int MPI_Type_vector(int count, int blocklength, int stride, MPI_Datatype oldtype, MPI_Datatype *newtype); +OMPI_DECLSPEC int MPI_Type_vector_c(MPI_Count count, MPI_Count blocklength, MPI_Count stride, + MPI_Datatype oldtype, MPI_Datatype *newtype); OMPI_DECLSPEC int MPI_Unpack(const void *inbuf, int insize, int *position, void *outbuf, int outcount, MPI_Datatype datatype, MPI_Comm comm); +OMPI_DECLSPEC int MPI_Unpack_c(const void *inbuf, MPI_Count insize, MPI_Count *position, + void *outbuf, MPI_Count outcount, MPI_Datatype datatype, + MPI_Comm comm); OMPI_DECLSPEC int MPI_Unpublish_name(const char *service_name, MPI_Info info, const char *port_name); OMPI_DECLSPEC int MPI_Unpack_external (const char datarep[], const void *inbuf, MPI_Aint insize, MPI_Aint *position, void *outbuf, int outcount, MPI_Datatype datatype); +OMPI_DECLSPEC int MPI_Unpack_external_c (const char datarep[], const void *inbuf, MPI_Aint insize, + MPI_Aint *position, void *outbuf, MPI_Count outcount, + MPI_Datatype datatype); OMPI_DECLSPEC int MPI_Waitall(int count, MPI_Request array_of_requests[], MPI_Status *array_of_statuses); OMPI_DECLSPEC int MPI_Waitany(int count, MPI_Request array_of_requests[], @@ -2137,6 +2491,7 @@ OMPI_DECLSPEC int MPI_Win_set_errhandler(MPI_Win win, MPI_Errhandler errhandler OMPI_DECLSPEC int MPI_Win_set_info(MPI_Win win, MPI_Info info); OMPI_DECLSPEC int MPI_Win_set_name(MPI_Win win, const char *win_name); OMPI_DECLSPEC int MPI_Win_shared_query(MPI_Win win, int rank, MPI_Aint *size, int *disp_unit, void *baseptr); +OMPI_DECLSPEC int MPI_Win_shared_query_c(MPI_Win win, int rank, MPI_Aint *size, MPI_Aint *disp_unit, void *baseptr); OMPI_DECLSPEC int MPI_Win_start(MPI_Group group, int mpi_assert, MPI_Win win); OMPI_DECLSPEC int MPI_Win_sync(MPI_Win win); OMPI_DECLSPEC int MPI_Win_test(MPI_Win win, int *flag); @@ -2153,98 +2508,143 @@ OMPI_DECLSPEC int PMPI_Abort(MPI_Comm comm, int errorcode); OMPI_DECLSPEC int PMPI_Accumulate(const void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Op op, MPI_Win win); +OMPI_DECLSPEC int PMPI_Accumulate_c(const void *origin_addr, MPI_Count origin_count, MPI_Datatype origin_datatype, + int target_rank, MPI_Aint target_disp, MPI_Count target_count, + MPI_Datatype target_datatype, MPI_Op op, MPI_Win win); OMPI_DECLSPEC int PMPI_Add_error_class(int *errorclass); OMPI_DECLSPEC int PMPI_Add_error_code(int errorclass, int *errorcode); OMPI_DECLSPEC int PMPI_Add_error_string(int errorcode, const char *string); OMPI_DECLSPEC int PMPI_Allgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Allgather_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, MPI_Count recvcount, + MPI_Datatype recvtype, MPI_Comm comm); OMPI_DECLSPEC int PMPI_Iallgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Iallgather_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, MPI_Count recvcount, + MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int PMPI_Allgather_init(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm, MPI_Info info, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Allgather_init_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, MPI_Count recvcount, MPI_Datatype recvtype, + MPI_Comm comm, MPI_Info info, MPI_Request *request); OMPI_DECLSPEC int PMPI_Allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, const int recvcounts[], - const int displs[], MPI_Datatype recvtype, MPI_Comm comm); + void *recvbuf, const int recvcounts[], const int displs[], MPI_Datatype recvtype, + MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Allgatherv_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint displs[], MPI_Datatype recvtype, + MPI_Comm comm); OMPI_DECLSPEC int PMPI_Iallgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], const int displs[], MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Iallgatherv_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint displs[], MPI_Datatype recvtype, + MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int PMPI_Allgatherv_init(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], const int displs[], MPI_Datatype recvtype, MPI_Comm comm, MPI_Info info, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Allgatherv_init_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint displs[], MPI_Datatype recvtype, + MPI_Comm comm, MPI_Info info, MPI_Request *request); OMPI_DECLSPEC int PMPI_Alloc_mem(MPI_Aint size, MPI_Info info, void *baseptr); -OMPI_DECLSPEC int PMPI_Allreduce(const void *sendbuf, void *recvbuf, int count, - MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Allreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, + MPI_Op op, MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Allreduce_c(const void *sendbuf, void *recvbuf, MPI_Count count, MPI_Datatype datatype, + MPI_Op op, MPI_Comm comm); OMPI_DECLSPEC int PMPI_Iallreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Iallreduce_c(const void *sendbuf, void *recvbuf, MPI_Count count, MPI_Datatype datatype, + MPI_Op op, MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int PMPI_Allreduce_init(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Info info, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Allreduce_init_c(const void *sendbuf, void *recvbuf, MPI_Count count, MPI_Datatype datatype, + MPI_Op op, MPI_Comm comm, MPI_Info info, MPI_Request *request); OMPI_DECLSPEC int PMPI_Alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Alltoall_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, MPI_Count recvcount, + MPI_Datatype recvtype, MPI_Comm comm); OMPI_DECLSPEC int PMPI_Ialltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Ialltoall_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, MPI_Count recvcount, MPI_Datatype recvtype, + MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int PMPI_Alltoall_init(const void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, - MPI_Comm comm, MPI_Info info, MPI_Request *request); + void *recvbuf, int recvcount, MPI_Datatype recvtype, + MPI_Comm comm, MPI_Info info, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Alltoall_init_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, MPI_Count recvcount, MPI_Datatype recvtype, + MPI_Comm comm, MPI_Info info, MPI_Request *request); OMPI_DECLSPEC int PMPI_Alltoallv(const void *sendbuf, const int sendcounts[], const int sdispls[], MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], const int rdispls[], MPI_Datatype recvtype, MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Alltoallv_c(const void *sendbuf, const MPI_Count sendcounts[], const MPI_Aint sdispls[], MPI_Datatype sendtype, + void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint rdispls[], MPI_Datatype recvtype, + MPI_Comm comm); OMPI_DECLSPEC int PMPI_Ialltoallv(const void *sendbuf, const int sendcounts[], const int sdispls[], MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], const int rdispls[], MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Ialltoallv_c(const void *sendbuf, const MPI_Count sendcounts[], const MPI_Aint sdispls[], MPI_Datatype sendtype, + void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint rdispls[], MPI_Datatype recvtype, + MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int PMPI_Alltoallv_init(const void *sendbuf, const int sendcounts[], const int sdispls[], MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], const int rdispls[], MPI_Datatype recvtype, MPI_Comm comm, MPI_Info info, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Alltoallv_init_c(const void *sendbuf, const MPI_Count sendcounts[], const MPI_Aint sdispls[], MPI_Datatype sendtype, + void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint rdispls[], MPI_Datatype recvtype, + MPI_Comm comm, MPI_Info info, MPI_Request *request); OMPI_DECLSPEC int PMPI_Alltoallw(const void *sendbuf, const int sendcounts[], const int sdispls[], const MPI_Datatype sendtypes[], void *recvbuf, const int recvcounts[], const int rdispls[], const MPI_Datatype recvtypes[], MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Alltoallw_c(const void *sendbuf, const MPI_Count sendcounts[], const MPI_Aint sdispls[], const MPI_Datatype sendtypes[], + void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint rdispls[], const MPI_Datatype recvtypes[], + MPI_Comm comm); OMPI_DECLSPEC int PMPI_Ialltoallw(const void *sendbuf, const int sendcounts[], const int sdispls[], const MPI_Datatype sendtypes[], void *recvbuf, const int recvcounts[], const int rdispls[], const MPI_Datatype recvtypes[], MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Ialltoallw_c(const void *sendbuf, const MPI_Count sendcounts[], const MPI_Aint sdispls[], const MPI_Datatype sendtypes[], + void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint rdispls[], const MPI_Datatype recvtypes[], + MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int PMPI_Alltoallw_init(const void *sendbuf, const int sendcounts[], const int sdispls[], const MPI_Datatype sendtypes[], void *recvbuf, const int recvcounts[], const int rdispls[], const MPI_Datatype recvtypes[], MPI_Comm comm, MPI_Info info, MPI_Request *request); -OMPI_DECLSPEC int PMPI_Dist_graph_create(MPI_Comm comm_old, int n, const int nodes[], - const int degrees[], const int targets[], - const int weights[], MPI_Info info, - int reorder, MPI_Comm * newcomm); -OMPI_DECLSPEC int PMPI_Dist_graph_create_adjacent(MPI_Comm comm_old, - int indegree, const int sources[], - const int sourceweights[], - int outdegree, - const int destinations[], - const int destweights[], - MPI_Info info, int reorder, - MPI_Comm *comm_dist_graph); -OMPI_DECLSPEC int PMPI_Dist_graph_neighbors(MPI_Comm comm, int maxindegree, - int sources[], int sourceweights[], - int maxoutdegree, - int destinations[], - int destweights[]); -OMPI_DECLSPEC int PMPI_Dist_graph_neighbors_count(MPI_Comm comm, - int *inneighbors, - int *outneighbors, - int *weighted); +OMPI_DECLSPEC int PMPI_Alltoallw_init_c(const void *sendbuf, const MPI_Count sendcounts[], const MPI_Aint sdispls[], const MPI_Datatype sendtypes[], + void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint rdispls[], const MPI_Datatype recvtypes[], + MPI_Comm comm, MPI_Info info, MPI_Request *request); OMPI_DECLSPEC int PMPI_Barrier(MPI_Comm comm); OMPI_DECLSPEC int PMPI_Ibarrier(MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int PMPI_Barrier_init(MPI_Comm comm, MPI_Info info, MPI_Request *request); OMPI_DECLSPEC int PMPI_Bcast(void *buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Bcast_c(void *buffer, MPI_Count count, MPI_Datatype datatype, + int root, MPI_Comm comm); OMPI_DECLSPEC int PMPI_Ibcast(void *buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Ibcast_c(void *buffer, MPI_Count count, MPI_Datatype datatype, + int root, MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int PMPI_Bcast_init(void *buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm, MPI_Info info, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Bcast_init_c(void *buffer, MPI_Count count, MPI_Datatype datatype, + int root, MPI_Comm comm, MPI_Info info, MPI_Request *request); OMPI_DECLSPEC int PMPI_Bsend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Bsend_c(const void *buf, MPI_Count count, MPI_Datatype datatype, + int dest, int tag, MPI_Comm comm); OMPI_DECLSPEC int PMPI_Bsend_init(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Bsend_init_c(const void *buf, MPI_Count count, MPI_Datatype datatype, + int dest, int tag, MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int PMPI_Buffer_attach(void *buffer, int size); +OMPI_DECLSPEC int PMPI_Buffer_attach_c(void *buffer, MPI_Count size); OMPI_DECLSPEC int PMPI_Buffer_detach(void *buffer, int *size); +OMPI_DECLSPEC int PMPI_Buffer_detach_c(void *buffer, MPI_Count *size); OMPI_DECLSPEC int PMPI_Cancel(MPI_Request *request); OMPI_DECLSPEC int PMPI_Cart_coords(MPI_Comm comm, int rank, int maxdims, int coords[]); OMPI_DECLSPEC int PMPI_Cart_create(MPI_Comm old_comm, int ndims, const int dims[], @@ -2273,7 +2673,7 @@ OMPI_DECLSPEC int PMPI_Comm_create_keyval(MPI_Comm_copy_attr_function *comm_cop int *comm_keyval, void *extra_state); OMPI_DECLSPEC int PMPI_Comm_create_group(MPI_Comm comm, MPI_Group group, int tag, MPI_Comm *newcomm); OMPI_DECLSPEC int PMPI_Comm_create_from_group(MPI_Group group, const char *tag, MPI_Info info, - MPI_Errhandler errhandler, MPI_Comm *newcomm); + MPI_Errhandler errhandler, MPI_Comm *newcomm); OMPI_DECLSPEC int PMPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm *newcomm); OMPI_DECLSPEC int PMPI_Comm_delete_attr(MPI_Comm comm, int comm_keyval); OMPI_DECLSPEC int PMPI_Comm_disconnect(MPI_Comm *comm); @@ -2287,6 +2687,27 @@ OMPI_DECLSPEC int PMPI_Comm_free_keyval(int *comm_keyval); OMPI_DECLSPEC int PMPI_Comm_free(MPI_Comm *comm); OMPI_DECLSPEC int PMPI_Comm_get_attr(MPI_Comm comm, int comm_keyval, void *attribute_val, int *flag); +OMPI_DECLSPEC int PMPI_Dist_graph_create(MPI_Comm comm_old, int n, const int nodes[], + const int degrees[], const int targets[], + const int weights[], MPI_Info info, + int reorder, MPI_Comm * newcomm); +OMPI_DECLSPEC int PMPI_Dist_graph_create_adjacent(MPI_Comm comm_old, + int indegree, const int sources[], + const int sourceweights[], + int outdegree, + const int destinations[], + const int destweights[], + MPI_Info info, int reorder, + MPI_Comm *comm_dist_graph); +OMPI_DECLSPEC int PMPI_Dist_graph_neighbors(MPI_Comm comm, int maxindegree, + int sources[], int sourceweights[], + int maxoutdegree, + int destinations[], + int destweights[]); +OMPI_DECLSPEC int PMPI_Dist_graph_neighbors_count(MPI_Comm comm, + int *inneighbors, + int *outneighbors, + int *weighted); OMPI_DECLSPEC int PMPI_Comm_get_errhandler(MPI_Comm comm, MPI_Errhandler *erhandler); OMPI_DECLSPEC int PMPI_Comm_get_info(MPI_Comm comm, MPI_Info *info_used); OMPI_DECLSPEC int PMPI_Comm_get_name(MPI_Comm comm, char *comm_name, int *resultlen); @@ -2322,10 +2743,16 @@ OMPI_DECLSPEC int PMPI_Error_class(int errorcode, int *errorclass); OMPI_DECLSPEC int PMPI_Error_string(int errorcode, char *string, int *resultlen); OMPI_DECLSPEC int PMPI_Exscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Exscan_c(const void *sendbuf, void *recvbuf, MPI_Count count, MPI_Datatype datatype, + MPI_Op op, MPI_Comm comm); OMPI_DECLSPEC int PMPI_Iexscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Iexscan_c(const void *sendbuf, void *recvbuf, MPI_Count count, MPI_Datatype datatype, + MPI_Op op, MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int PMPI_Exscan_init(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Info info, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Exscan_init_c(const void *sendbuf, void *recvbuf, MPI_Count count, MPI_Datatype datatype, + MPI_Op op, MPI_Comm comm, MPI_Info info, MPI_Request *request); OMPI_DECLSPEC int PMPI_Fetch_and_op(const void *origin_addr, void *result_addr, MPI_Datatype datatype, int target_rank, MPI_Aint target_disp, MPI_Op op, MPI_Win win); OMPI_DECLSPEC MPI_Fint PMPI_File_c2f(MPI_File file); @@ -2353,71 +2780,127 @@ OMPI_DECLSPEC int PMPI_File_get_view(MPI_File fh, MPI_Offset *disp, MPI_Datatype *filetype, char *datarep); OMPI_DECLSPEC int PMPI_File_read_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status); +OMPI_DECLSPEC int PMPI_File_read_at_c(MPI_File fh, MPI_Offset offset, void *buf, + MPI_Count count, MPI_Datatype datatype, MPI_Status *status); OMPI_DECLSPEC int PMPI_File_read_at_all(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status); +OMPI_DECLSPEC int PMPI_File_read_at_all_c(MPI_File fh, MPI_Offset offset, void *buf, + MPI_Count count, MPI_Datatype datatype, MPI_Status *status); OMPI_DECLSPEC int PMPI_File_write_at(MPI_File fh, MPI_Offset offset, const void *buf, int count, MPI_Datatype datatype, MPI_Status *status); +OMPI_DECLSPEC int PMPI_File_write_at_c(MPI_File fh, MPI_Offset offset, const void *buf, + MPI_Count count, MPI_Datatype datatype, MPI_Status *status); OMPI_DECLSPEC int PMPI_File_write_at_all(MPI_File fh, MPI_Offset offset, const void *buf, int count, MPI_Datatype datatype, MPI_Status *status); +OMPI_DECLSPEC int PMPI_File_write_at_all_c(MPI_File fh, MPI_Offset offset, const void *buf, + MPI_Count count, MPI_Datatype datatype, MPI_Status *status); OMPI_DECLSPEC int PMPI_File_iread_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Request *request); +OMPI_DECLSPEC int PMPI_File_iread_at_c(MPI_File fh, MPI_Offset offset, void *buf, + MPI_Count count, MPI_Datatype datatype, MPI_Request *request); OMPI_DECLSPEC int PMPI_File_iwrite_at(MPI_File fh, MPI_Offset offset, const void *buf, int count, MPI_Datatype datatype, MPI_Request *request); +OMPI_DECLSPEC int PMPI_File_iwrite_at_c(MPI_File fh, MPI_Offset offset, const void *buf, + MPI_Count count, MPI_Datatype datatype, MPI_Request *request); OMPI_DECLSPEC int PMPI_File_iread_at_all(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Request *request); +OMPI_DECLSPEC int PMPI_File_iread_at_all_c(MPI_File fh, MPI_Offset offset, void *buf, + MPI_Count count, MPI_Datatype datatype, MPI_Request *request); OMPI_DECLSPEC int PMPI_File_iwrite_at_all(MPI_File fh, MPI_Offset offset, const void *buf, int count, MPI_Datatype datatype, MPI_Request *request); +OMPI_DECLSPEC int PMPI_File_iwrite_at_all_c(MPI_File fh, MPI_Offset offset, const void *buf, + MPI_Count count, MPI_Datatype datatype, MPI_Request *request); OMPI_DECLSPEC int PMPI_File_read(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status); +OMPI_DECLSPEC int PMPI_File_read_c(MPI_File fh, void *buf, MPI_Count count, + MPI_Datatype datatype, MPI_Status *status); OMPI_DECLSPEC int PMPI_File_read_all(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status); +OMPI_DECLSPEC int PMPI_File_read_all_c(MPI_File fh, void *buf, MPI_Count count, + MPI_Datatype datatype, MPI_Status *status); OMPI_DECLSPEC int PMPI_File_write(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, MPI_Status *status); +OMPI_DECLSPEC int PMPI_File_write_c(MPI_File fh, const void *buf, MPI_Count count, + MPI_Datatype datatype, MPI_Status *status); OMPI_DECLSPEC int PMPI_File_write_all(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, MPI_Status *status); +OMPI_DECLSPEC int PMPI_File_write_all_c(MPI_File fh, const void *buf, MPI_Count count, + MPI_Datatype datatype, MPI_Status *status); OMPI_DECLSPEC int PMPI_File_iread(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Request *request); +OMPI_DECLSPEC int PMPI_File_iread_c(MPI_File fh, void *buf, MPI_Count count, + MPI_Datatype datatype, MPI_Request *request); OMPI_DECLSPEC int PMPI_File_iwrite(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, MPI_Request *request); +OMPI_DECLSPEC int PMPI_File_iwrite_c(MPI_File fh, const void *buf, MPI_Count count, + MPI_Datatype datatype, MPI_Request *request); OMPI_DECLSPEC int PMPI_File_iread_all(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Request *request); +OMPI_DECLSPEC int PMPI_File_iread_all_c(MPI_File fh, void *buf, MPI_Count count, + MPI_Datatype datatype, MPI_Request *request); OMPI_DECLSPEC int PMPI_File_iwrite_all(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, MPI_Request *request); +OMPI_DECLSPEC int PMPI_File_iwrite_all_c(MPI_File fh, const void *buf, MPI_Count count, + MPI_Datatype datatype, MPI_Request *request); OMPI_DECLSPEC int PMPI_File_seek(MPI_File fh, MPI_Offset offset, int whence); OMPI_DECLSPEC int PMPI_File_get_position(MPI_File fh, MPI_Offset *offset); OMPI_DECLSPEC int PMPI_File_get_byte_offset(MPI_File fh, MPI_Offset offset, MPI_Offset *disp); OMPI_DECLSPEC int PMPI_File_read_shared(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status); +OMPI_DECLSPEC int PMPI_File_read_shared_c(MPI_File fh, void *buf, MPI_Count count, + MPI_Datatype datatype, MPI_Status *status); OMPI_DECLSPEC int PMPI_File_write_shared(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, MPI_Status *status); +OMPI_DECLSPEC int PMPI_File_write_shared_c(MPI_File fh, const void *buf, MPI_Count count, + MPI_Datatype datatype, MPI_Status *status); OMPI_DECLSPEC int PMPI_File_iread_shared(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Request *request); +OMPI_DECLSPEC int PMPI_File_iread_shared_c(MPI_File fh, void *buf, MPI_Count count, + MPI_Datatype datatype, MPI_Request *request); OMPI_DECLSPEC int PMPI_File_iwrite_shared(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, MPI_Request *request); +OMPI_DECLSPEC int PMPI_File_iwrite_shared_c(MPI_File fh, const void *buf, MPI_Count count, + MPI_Datatype datatype, MPI_Request *request); OMPI_DECLSPEC int PMPI_File_read_ordered(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status); +OMPI_DECLSPEC int PMPI_File_read_ordered_c(MPI_File fh, void *buf, MPI_Count count, + MPI_Datatype datatype, MPI_Status *status); OMPI_DECLSPEC int PMPI_File_write_ordered(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, MPI_Status *status); +OMPI_DECLSPEC int PMPI_File_write_ordered_c(MPI_File fh, const void *buf, MPI_Count count, + MPI_Datatype datatype, MPI_Status *status); OMPI_DECLSPEC int PMPI_File_seek_shared(MPI_File fh, MPI_Offset offset, int whence); OMPI_DECLSPEC int PMPI_File_get_position_shared(MPI_File fh, MPI_Offset *offset); OMPI_DECLSPEC int PMPI_File_read_at_all_begin(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype); +OMPI_DECLSPEC int PMPI_File_read_at_all_begin_c(MPI_File fh, MPI_Offset offset, void *buf, + MPI_Count count, MPI_Datatype datatype); OMPI_DECLSPEC int PMPI_File_read_at_all_end(MPI_File fh, void *buf, MPI_Status *status); OMPI_DECLSPEC int PMPI_File_write_at_all_begin(MPI_File fh, MPI_Offset offset, const void *buf, int count, MPI_Datatype datatype); +OMPI_DECLSPEC int PMPI_File_write_at_all_begin_c(MPI_File fh, MPI_Offset offset, const void *buf, + MPI_Count count, MPI_Datatype datatype); OMPI_DECLSPEC int PMPI_File_write_at_all_end(MPI_File fh, const void *buf, MPI_Status *status); OMPI_DECLSPEC int PMPI_File_read_all_begin(MPI_File fh, void *buf, int count, MPI_Datatype datatype); +OMPI_DECLSPEC int PMPI_File_read_all_begin_c(MPI_File fh, void *buf, MPI_Count count, + MPI_Datatype datatype); OMPI_DECLSPEC int PMPI_File_read_all_end(MPI_File fh, void *buf, MPI_Status *status); OMPI_DECLSPEC int PMPI_File_write_all_begin(MPI_File fh, const void *buf, int count, MPI_Datatype datatype); +OMPI_DECLSPEC int PMPI_File_write_all_begin_c(MPI_File fh, const void *buf, MPI_Count count, + MPI_Datatype datatype); OMPI_DECLSPEC int PMPI_File_write_all_end(MPI_File fh, const void *buf, MPI_Status *status); OMPI_DECLSPEC int PMPI_File_read_ordered_begin(MPI_File fh, void *buf, int count, MPI_Datatype datatype); +OMPI_DECLSPEC int PMPI_File_read_ordered_begin_c(MPI_File fh, void *buf, MPI_Count count, + MPI_Datatype datatype); OMPI_DECLSPEC int PMPI_File_read_ordered_end(MPI_File fh, void *buf, MPI_Status *status); OMPI_DECLSPEC int PMPI_File_write_ordered_begin(MPI_File fh, const void *buf, int count, MPI_Datatype datatype); +OMPI_DECLSPEC int PMPI_File_write_ordered_begin_c(MPI_File fh, const void *buf, MPI_Count count, + MPI_Datatype datatype); OMPI_DECLSPEC int PMPI_File_write_ordered_end(MPI_File fh, const void *buf, MPI_Status *status); OMPI_DECLSPEC int PMPI_File_get_type_extent(MPI_File fh, MPI_Datatype datatype, MPI_Aint *extent); @@ -2430,35 +2913,61 @@ OMPI_DECLSPEC int PMPI_Free_mem(void *base); OMPI_DECLSPEC int PMPI_Gather(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Gather_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, MPI_Count recvcount, MPI_Datatype recvtype, + int root, MPI_Comm comm); OMPI_DECLSPEC int PMPI_Igather(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Igather_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, MPI_Count recvcount, MPI_Datatype recvtype, + int root, MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int PMPI_Gather_init(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Info info, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Gather_init_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, MPI_Count recvcount, MPI_Datatype recvtype, + int root, MPI_Comm comm, MPI_Info info, MPI_Request *request); OMPI_DECLSPEC int PMPI_Gatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], const int displs[], MPI_Datatype recvtype, int root, MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Gatherv_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint displs[], + MPI_Datatype recvtype, int root, MPI_Comm comm); OMPI_DECLSPEC int PMPI_Igatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], const int displs[], MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Igatherv_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint displs[], MPI_Datatype recvtype, + int root, MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int PMPI_Gatherv_init(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], const int displs[], MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Info info, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Gatherv_init_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint displs[], MPI_Datatype recvtype, + int root, MPI_Comm comm, MPI_Info info, MPI_Request *request); OMPI_DECLSPEC int PMPI_Get_address(const void *location, MPI_Aint *address); OMPI_DECLSPEC int PMPI_Get_count(const MPI_Status *status, MPI_Datatype datatype, int *count); -OMPI_DECLSPEC int PMPI_Get_elements(const MPI_Status *status, MPI_Datatype datatype, - int *count); -OMPI_DECLSPEC int PMPI_Get_elements_x(const MPI_Status *status, MPI_Datatype datatype, - MPI_Count *count); +OMPI_DECLSPEC int PMPI_Get_count_c(const MPI_Status *status, MPI_Datatype datatype, MPI_Count *count); +OMPI_DECLSPEC int PMPI_Get_elements(const MPI_Status *status, MPI_Datatype datatype, int *count); +OMPI_DECLSPEC int PMPI_Get_elements_c(const MPI_Status *status, MPI_Datatype datatype, MPI_Count *count); +OMPI_DECLSPEC int PMPI_Get_elements_x(const MPI_Status *status, MPI_Datatype datatype, MPI_Count *count); OMPI_DECLSPEC int PMPI_Get(void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Win win); +OMPI_DECLSPEC int PMPI_Get_c(void *origin_addr, MPI_Count origin_count, + MPI_Datatype origin_datatype, int target_rank, + MPI_Aint target_disp, MPI_Count target_count, + MPI_Datatype target_datatype, MPI_Win win); OMPI_DECLSPEC int PMPI_Get_accumulate(const void *origin_addr, int origin_count, MPI_Datatype origin_datatype, void *result_addr, int result_count, MPI_Datatype result_datatype, int target_rank, MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Op op, MPI_Win win); +OMPI_DECLSPEC int PMPI_Get_accumulate_c(const void *origin_addr, MPI_Count origin_count, MPI_Datatype origin_datatype, + void *result_addr, MPI_Count result_count, MPI_Datatype result_datatype, + int target_rank, MPI_Aint target_disp, MPI_Count target_count, + MPI_Datatype target_datatype, MPI_Op op, MPI_Win win); OMPI_DECLSPEC int PMPI_Get_library_version(char *version, int *resultlen); OMPI_DECLSPEC int PMPI_Get_processor_name(char *name, int *resultlen); OMPI_DECLSPEC int PMPI_Get_version(int *version, int *subversion); @@ -2530,89 +3039,140 @@ OMPI_DECLSPEC int PMPI_Intercomm_create_from_groups (MPI_Group local_group, int int remote_leader, const char *tag, MPI_Info info, MPI_Errhandler errhandler, MPI_Comm *newintercomm); OMPI_DECLSPEC int PMPI_Intercomm_merge(MPI_Comm intercomm, int high, - MPI_Comm *newintercomm); + MPI_Comm *newintracomm); OMPI_DECLSPEC int PMPI_Iprobe(int source, int tag, MPI_Comm comm, int *flag, MPI_Status *status); OMPI_DECLSPEC int PMPI_Irecv(void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Irecv_c(void *buf, MPI_Count count, MPI_Datatype datatype, int source, + int tag, MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int PMPI_Irsend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Irsend_c(const void *buf, MPI_Count count, MPI_Datatype datatype, int dest, + int tag, MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int PMPI_Isend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Isend_c(const void *buf, MPI_Count count, MPI_Datatype datatype, int dest, + int tag, MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int PMPI_Isendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, int dest, int sendtag, void *recvbuf, int recvcount, MPI_Datatype recvtype, int source, int recvtag, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Isendrecv_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + int dest, int sendtag, void *recvbuf, MPI_Count recvcount, + MPI_Datatype recvtype, int source, int recvtag, + MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int PMPI_Isendrecv_replace(void * buf, int count, MPI_Datatype datatype, int dest, int sendtag, int source, int recvtag, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Isendrecv_replace_c(void * buf, MPI_Count count, MPI_Datatype datatype, + int dest, int sendtag, int source, int recvtag, + MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int PMPI_Issend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request); -OMPI_DECLSPEC int PMPI_Precv_init(void* buf, int partitions, MPI_Count count, - MPI_Datatype datatype, int source, int tag, MPI_Comm comm, - MPI_Info info, MPI_Request *request); -OMPI_DECLSPEC int PMPI_Psend_init(const void* buf, int partitions, MPI_Count count, - MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, - MPI_Info info, MPI_Request *request); -OMPI_DECLSPEC int PMPI_Pready(int partitions, MPI_Request request); -OMPI_DECLSPEC int PMPI_Pready_range(int partition_low, int partition_high, - MPI_Request request); -OMPI_DECLSPEC int PMPI_Pready_list(int length, int partition_list[], MPI_Request request); -OMPI_DECLSPEC int PMPI_Parrived(MPI_Request request, int partition, int *flag); +OMPI_DECLSPEC int PMPI_Issend_c(const void *buf, MPI_Count count, MPI_Datatype datatype, int dest, + int tag, MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int PMPI_Is_thread_main(int *flag); OMPI_DECLSPEC int PMPI_Lookup_name(const char *service_name, MPI_Info info, char *port_name); OMPI_DECLSPEC MPI_Fint PMPI_Message_c2f(MPI_Message message); OMPI_DECLSPEC MPI_Message PMPI_Message_f2c(MPI_Fint message); OMPI_DECLSPEC int PMPI_Mprobe(int source, int tag, MPI_Comm comm, - MPI_Message *message, - MPI_Status *status); + MPI_Message *message, + MPI_Status *status); OMPI_DECLSPEC int PMPI_Mrecv(void *buf, int count, MPI_Datatype type, MPI_Message *message, MPI_Status *status); +OMPI_DECLSPEC int PMPI_Mrecv_c(void *buf, MPI_Count count, MPI_Datatype type, + MPI_Message *message, MPI_Status *status); OMPI_DECLSPEC int PMPI_Neighbor_allgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Neighbor_allgather_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, MPI_Count recvcount, MPI_Datatype recvtype, + MPI_Comm comm); OMPI_DECLSPEC int PMPI_Ineighbor_allgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request); -OMPI_DECLSPEC int PMPI_Neighbor_allgather_init(const void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, - MPI_Comm comm, MPI_Info info, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Ineighbor_allgather_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, MPI_Count recvcount, MPI_Datatype recvtype, + MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int PMPI_Neighbor_allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], const int displs[], MPI_Datatype recvtype, MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Neighbor_allgatherv_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint displs[], + MPI_Datatype recvtype, MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Neighbor_allgather_init(const void *sendbuf, int sendcount, MPI_Datatype sendtype, + void *recvbuf, int recvcount, MPI_Datatype recvtype, + MPI_Comm comm, MPI_Info info, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Neighbor_allgather_init_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, MPI_Count recvcount, MPI_Datatype recvtype, + MPI_Comm comm, MPI_Info info, MPI_Request *request); OMPI_DECLSPEC int PMPI_Ineighbor_allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], const int displs[], MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Ineighbor_allgatherv_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint displs[], MPI_Datatype recvtype, + MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int PMPI_Neighbor_allgatherv_init(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], const int displs[], MPI_Datatype recvtype, MPI_Comm comm, MPI_Info info, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Neighbor_allgatherv_init_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint displs[], MPI_Datatype recvtype, + MPI_Comm comm, MPI_Info info, MPI_Request *request); OMPI_DECLSPEC int PMPI_Neighbor_alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Neighbor_alltoall_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, MPI_Count recvcount, MPI_Datatype recvtype, + MPI_Comm comm); OMPI_DECLSPEC int PMPI_Ineighbor_alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Ineighbor_alltoall_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, MPI_Count recvcount, MPI_Datatype recvtype, + MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int PMPI_Neighbor_alltoall_init(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm, MPI_Info info, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Neighbor_alltoall_init_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, MPI_Count recvcount, MPI_Datatype recvtype, + MPI_Comm comm, MPI_Info info, MPI_Request *request); OMPI_DECLSPEC int PMPI_Neighbor_alltoallv(const void *sendbuf, const int sendcounts[], const int sdispls[], MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], const int rdispls[], MPI_Datatype recvtype, MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Neighbor_alltoallv_c(const void *sendbuf, const MPI_Count sendcounts[], const MPI_Aint sdispls[], MPI_Datatype sendtype, + void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint rdispls[], MPI_Datatype recvtype, + MPI_Comm comm); OMPI_DECLSPEC int PMPI_Ineighbor_alltoallv(const void *sendbuf, const int sendcounts[], const int sdispls[], MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], const int rdispls[], MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Ineighbor_alltoallv_c(const void *sendbuf, const MPI_Count sendcounts[], const MPI_Aint sdispls[], MPI_Datatype sendtype, + void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint rdispls[], MPI_Datatype recvtype, + MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int PMPI_Neighbor_alltoallv_init(const void *sendbuf, const int sendcounts[], const int sdispls[], MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], const int rdispls[], MPI_Datatype recvtype, MPI_Comm comm, MPI_Info info, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Neighbor_alltoallv_init_c(const void *sendbuf, const MPI_Count sendcounts[], const MPI_Aint sdispls[], MPI_Datatype sendtype, + void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint rdispls[], MPI_Datatype recvtype, + MPI_Comm comm, MPI_Info info, MPI_Request *request); OMPI_DECLSPEC int PMPI_Neighbor_alltoallw(const void *sendbuf, const int sendcounts[], const MPI_Aint sdispls[], const MPI_Datatype sendtypes[], void *recvbuf, const int recvcounts[], const MPI_Aint rdispls[], const MPI_Datatype recvtypes[], MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Neighbor_alltoallw_c(const void *sendbuf, const MPI_Count sendcounts[], const MPI_Aint sdispls[], const MPI_Datatype sendtypes[], + void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint rdispls[], const MPI_Datatype recvtypes[], + MPI_Comm comm); OMPI_DECLSPEC int PMPI_Ineighbor_alltoallw(const void *sendbuf, const int sendcounts[], const MPI_Aint sdispls[], const MPI_Datatype sendtypes[], void *recvbuf, const int recvcounts[], const MPI_Aint rdispls[], const MPI_Datatype recvtypes[], MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Ineighbor_alltoallw_c(const void *sendbuf, const MPI_Count sendcounts[], const MPI_Aint sdispls[], const MPI_Datatype sendtypes[], + void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint rdispls[], const MPI_Datatype recvtypes[], + MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int PMPI_Neighbor_alltoallw_init(const void *sendbuf, const int sendcounts[], const MPI_Aint sdispls[], const MPI_Datatype sendtypes[], void *recvbuf, const int recvcounts[], const MPI_Aint rdispls[], const MPI_Datatype recvtypes[], MPI_Comm comm, MPI_Info info, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Neighbor_alltoallw_init_c(const void *sendbuf, const MPI_Count sendcounts[], const MPI_Aint sdispls[], const MPI_Datatype sendtypes[], + void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint rdispls[], const MPI_Datatype recvtypes[], + MPI_Comm comm, MPI_Info info, MPI_Request *request); OMPI_DECLSPEC MPI_Fint PMPI_Op_c2f(MPI_Op op); OMPI_DECLSPEC int PMPI_Op_commutative(MPI_Op op, int *commute); OMPI_DECLSPEC int PMPI_Op_create(MPI_User_function *function, int commute, MPI_Op *op); @@ -2622,47 +3182,99 @@ OMPI_DECLSPEC int PMPI_Op_free(MPI_Op *op); OMPI_DECLSPEC int PMPI_Pack_external(const char datarep[], const void *inbuf, int incount, MPI_Datatype datatype, void *outbuf, MPI_Aint outsize, MPI_Aint *position); +OMPI_DECLSPEC int PMPI_Pack_external_c(const char datarep[], const void *inbuf, MPI_Count incount, + MPI_Datatype datatype, void *outbuf, + MPI_Aint outsize, MPI_Aint *position); OMPI_DECLSPEC int PMPI_Pack_external_size(const char datarep[], int incount, MPI_Datatype datatype, MPI_Aint *size); +OMPI_DECLSPEC int PMPI_Pack_external_size_c(const char datarep[], MPI_Count incount, + MPI_Datatype datatype, MPI_Aint *size); OMPI_DECLSPEC int PMPI_Pack(const void *inbuf, int incount, MPI_Datatype datatype, void *outbuf, int outsize, int *position, MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Pack_c(const void *inbuf, MPI_Count incount, MPI_Datatype datatype, + void *outbuf, MPI_Count outsize, MPI_Count *position, MPI_Comm comm); OMPI_DECLSPEC int PMPI_Pack_size(int incount, MPI_Datatype datatype, MPI_Comm comm, int *size); +OMPI_DECLSPEC int PMPI_Pack_size_c(MPI_Count incount, MPI_Datatype datatype, MPI_Comm comm, + MPI_Count *size); +OMPI_DECLSPEC int PMPI_Parrived(MPI_Request request, int partition, int *flag); OMPI_DECLSPEC int PMPI_Pcontrol(const int level, ...); +OMPI_DECLSPEC int PMPI_Pready(int partitions, MPI_Request request); +OMPI_DECLSPEC int PMPI_Pready_range(int partition_low, int partition_high, + MPI_Request request); +OMPI_DECLSPEC int PMPI_Pready_list(int length, int partition_list[], MPI_Request request); +OMPI_DECLSPEC int PMPI_Precv_init(void* buf, int partitions, MPI_Count count, + MPI_Datatype datatype, int source, int tag, MPI_Comm comm, + MPI_Info info, MPI_Request *request); OMPI_DECLSPEC int PMPI_Probe(int source, int tag, MPI_Comm comm, MPI_Status *status); +OMPI_DECLSPEC int PMPI_Psend_init(const void* buf, int partitions, MPI_Count count, + MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, + MPI_Info info, MPI_Request *request); OMPI_DECLSPEC int PMPI_Publish_name(const char *service_name, MPI_Info info, const char *port_name); OMPI_DECLSPEC int PMPI_Put(const void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Win win); +OMPI_DECLSPEC int PMPI_Put_c(const void *origin_addr, MPI_Count origin_count, MPI_Datatype origin_datatype, + int target_rank, MPI_Aint target_disp, MPI_Count target_count, + MPI_Datatype target_datatype, MPI_Win win); OMPI_DECLSPEC int PMPI_Query_thread(int *provided); OMPI_DECLSPEC int PMPI_Raccumulate(const void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Op op, MPI_Win win, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Raccumulate_c(const void *origin_addr, MPI_Count origin_count, MPI_Datatype origin_datatype, + int target_rank, MPI_Aint target_disp, MPI_Count target_count, + MPI_Datatype target_datatype, MPI_Op op, MPI_Win win, MPI_Request *request); OMPI_DECLSPEC int PMPI_Recv_init(void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Recv_init_c(void *buf, MPI_Count count, MPI_Datatype datatype, int source, + int tag, MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int PMPI_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Status *status); +OMPI_DECLSPEC int PMPI_Recv_c(void *buf, MPI_Count count, MPI_Datatype datatype, int source, + int tag, MPI_Comm comm, MPI_Status *status); +OMPI_DECLSPEC int PMPI_Recv_c(void *buf, MPI_Count count, MPI_Datatype datatype, int source, + int tag, MPI_Comm comm, MPI_Status *status); OMPI_DECLSPEC int PMPI_Reduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Reduce_c(const void *sendbuf, void *recvbuf, MPI_Count count, MPI_Datatype datatype, + MPI_Op op, int root, MPI_Comm comm); OMPI_DECLSPEC int PMPI_Ireduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Ireduce_c(const void *sendbuf, void *recvbuf, MPI_Count count, MPI_Datatype datatype, + MPI_Op op, int root, MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int PMPI_Reduce_init(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm, MPI_Info info, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Reduce_init_c(const void *sendbuf, void *recvbuf, MPI_Count count, MPI_Datatype datatype, + MPI_Op op, int root, MPI_Comm comm, MPI_Info info, MPI_Request *request); OMPI_DECLSPEC int PMPI_Reduce_local(const void *inbuf, void *inoutbuf, int count, MPI_Datatype datatype, MPI_Op op); +OMPI_DECLSPEC int PMPI_Reduce_local_c(const void *inbuf, void *inoutbuf, MPI_Count count, + MPI_Datatype datatype, MPI_Op op); OMPI_DECLSPEC int PMPI_Reduce_scatter(const void *sendbuf, void *recvbuf, const int recvcounts[], MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Reduce_scatter_c(const void *sendbuf, void *recvbuf, const MPI_Count recvcounts[], MPI_Datatype datatype, + MPI_Op op, MPI_Comm comm); OMPI_DECLSPEC int PMPI_Ireduce_scatter(const void *sendbuf, void *recvbuf, const int recvcounts[], MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Ireduce_scatter_c(const void *sendbuf, void *recvbuf, const MPI_Count recvcounts[], MPI_Datatype datatype, + MPI_Op op, MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int PMPI_Reduce_scatter_init(const void *sendbuf, void *recvbuf, const int recvcounts[], MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Info info, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Reduce_scatter_init_c(const void *sendbuf, void *recvbuf, const MPI_Count recvcounts[], MPI_Datatype datatype, + MPI_Op op, MPI_Comm comm, MPI_Info info, MPI_Request *request); OMPI_DECLSPEC int PMPI_Reduce_scatter_block(const void *sendbuf, void *recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Reduce_scatter_block_c(const void *sendbuf, void *recvbuf, MPI_Count recvcount, MPI_Datatype datatype, + MPI_Op op, MPI_Comm comm); OMPI_DECLSPEC int PMPI_Ireduce_scatter_block(const void *sendbuf, void *recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Ireduce_scatter_block_c(const void *sendbuf, void *recvbuf, MPI_Count recvcount, MPI_Datatype datatype, + MPI_Op op, MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int PMPI_Reduce_scatter_block_init(const void *sendbuf, void *recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Info info, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Reduce_scatter_block_init_c(const void *sendbuf, void *recvbuf, MPI_Count recvcount, MPI_Datatype datatype, + MPI_Op op, MPI_Comm comm, MPI_Info info, MPI_Request *request); OMPI_DECLSPEC int PMPI_Register_datarep(const char *datarep, MPI_Datarep_conversion_function *read_conversion_fn, MPI_Datarep_conversion_function *write_conversion_fn, @@ -2676,55 +3288,107 @@ OMPI_DECLSPEC int PMPI_Request_get_status(MPI_Request request, int *flag, OMPI_DECLSPEC int PMPI_Rget(void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Win win, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Rget_c(void *origin_addr, MPI_Count origin_count, MPI_Datatype origin_datatype, + int target_rank, MPI_Aint target_disp, MPI_Count target_count, MPI_Datatype target_datatype, + MPI_Win win, MPI_Request *request); OMPI_DECLSPEC int PMPI_Rget_accumulate(const void *origin_addr, int origin_count, MPI_Datatype origin_datatype, void *result_addr, int result_count, MPI_Datatype result_datatype, int target_rank, MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Op op, MPI_Win win, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Rget_accumulate_c(const void *origin_addr, MPI_Count origin_count, MPI_Datatype origin_datatype, + void *result_addr, MPI_Count result_count, MPI_Datatype result_datatype, + int target_rank, MPI_Aint target_disp, MPI_Count target_count, + MPI_Datatype target_datatype, MPI_Op op, + MPI_Win win, MPI_Request *request); OMPI_DECLSPEC int PMPI_Rput(const void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp, int target_cout, MPI_Datatype target_datatype, MPI_Win win, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Rput_c(const void *origin_addr, MPI_Count origin_count, MPI_Datatype origin_datatype, + int target_rank, MPI_Aint target_disp, int target_cout, + MPI_Datatype target_datatype, MPI_Win win, MPI_Request *request); OMPI_DECLSPEC int PMPI_Rsend(const void *ibuf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Rsend_c(const void *ibuf, MPI_Count count, MPI_Datatype datatype, int dest, + int tag, MPI_Comm comm); OMPI_DECLSPEC int PMPI_Rsend_init(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Rsend_init_c(const void *buf, MPI_Count count, MPI_Datatype datatype, + int dest, int tag, MPI_Comm comm, + MPI_Request *request); OMPI_DECLSPEC int PMPI_Scan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Scan_c(const void *sendbuf, void *recvbuf, MPI_Count count, MPI_Datatype datatype, + MPI_Op op, MPI_Comm comm); OMPI_DECLSPEC int PMPI_Iscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Iscan_c(const void *sendbuf, void *recvbuf, MPI_Count count, MPI_Datatype datatype, + MPI_Op op, MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int PMPI_Scan_init(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Info info, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Scan_init_c(const void *sendbuf, void *recvbuf, MPI_Count count, MPI_Datatype datatype, + MPI_Op op, MPI_Comm comm, MPI_Info info, MPI_Request *request); OMPI_DECLSPEC int PMPI_Scatter(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Scatter_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, MPI_Count recvcount, MPI_Datatype recvtype, + int root, MPI_Comm comm); OMPI_DECLSPEC int PMPI_Iscatter(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Iscatter_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, MPI_Count recvcount, MPI_Datatype recvtype, + int root, MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int PMPI_Scatter_init(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Info info, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Scatter_init_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + void *recvbuf, MPI_Count recvcount, MPI_Datatype recvtype, + int root, MPI_Comm comm, MPI_Info info, MPI_Request *request); OMPI_DECLSPEC int PMPI_Scatterv(const void *sendbuf, const int sendcounts[], const int displs[], MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Scatterv_c(const void *sendbuf, const MPI_Count sendcounts[], const MPI_Aint displs[], MPI_Datatype sendtype, + void *recvbuf, MPI_Count recvcount, MPI_Datatype recvtype, + int root, MPI_Comm comm); OMPI_DECLSPEC int PMPI_Iscatterv(const void *sendbuf, const int sendcounts[], const int displs[], MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Iscatterv_c(const void *sendbuf, const MPI_Count sendcounts[], const MPI_Aint displs[], MPI_Datatype sendtype, + void *recvbuf, MPI_Count recvcount, MPI_Datatype recvtype, + int root, MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int PMPI_Scatterv_init(const void *sendbuf, const int sendcounts[], const int displs[], MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Info info, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Scatterv_init_c(const void *sendbuf, const MPI_Count sendcounts[], const MPI_Aint displs[], MPI_Datatype sendtype, + void *recvbuf, MPI_Count recvcount, MPI_Datatype recvtype, + int root, MPI_Comm comm, MPI_Info info, MPI_Request *request); OMPI_DECLSPEC int PMPI_Send_init(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Send_init_c(const void *buf, MPI_Count count, MPI_Datatype datatype, + int dest, int tag, MPI_Comm comm, + MPI_Request *request); OMPI_DECLSPEC int PMPI_Send(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Send_c(const void *buf, MPI_Count count, MPI_Datatype datatype, int dest, + int tag, MPI_Comm comm); OMPI_DECLSPEC int PMPI_Sendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, int dest, int sendtag, void *recvbuf, int recvcount, MPI_Datatype recvtype, int source, int recvtag, MPI_Comm comm, MPI_Status *status); +OMPI_DECLSPEC int PMPI_Sendrecv_c(const void *sendbuf, MPI_Count sendcount, MPI_Datatype sendtype, + int dest, int sendtag, void *recvbuf, MPI_Count recvcount, + MPI_Datatype recvtype, int source, int recvtag, + MPI_Comm comm, MPI_Status *status); OMPI_DECLSPEC int PMPI_Sendrecv_replace(void * buf, int count, MPI_Datatype datatype, int dest, int sendtag, int source, int recvtag, MPI_Comm comm, MPI_Status *status); +OMPI_DECLSPEC int PMPI_Sendrecv_replace_c(void * buf, MPI_Count count, MPI_Datatype datatype, + int dest, int sendtag, int source, int recvtag, + MPI_Comm comm, MPI_Status *status); OMPI_DECLSPEC MPI_Fint PMPI_Session_c2f (const MPI_Session session); OMPI_DECLSPEC int PMPI_Session_call_errhandler(MPI_Session session, int errorcode); OMPI_DECLSPEC int PMPI_Session_create_errhandler (MPI_Session_errhandler_function *session_errhandler_fn, @@ -2736,31 +3400,39 @@ OMPI_DECLSPEC int PMPI_Session_get_num_psets (MPI_Session session, MPI_Info inf OMPI_DECLSPEC int PMPI_Session_get_nth_pset (MPI_Session session, MPI_Info info, int n, int *len, char *pset_name); OMPI_DECLSPEC int PMPI_Session_get_pset_info (MPI_Session session, const char *pset_name, MPI_Info *info_used); OMPI_DECLSPEC int PMPI_Session_init (MPI_Info info, MPI_Errhandler errhandler, - MPI_Session *session); + MPI_Session *session); OMPI_DECLSPEC MPI_Session PMPI_Session_f2c (MPI_Fint session); -OMPI_DECLSPEC int PMPI_Session_set_errhandler(MPI_Session session, MPI_Errhandler erhandler); +OMPI_DECLSPEC int PMPI_Session_set_errhandler(MPI_Session session, MPI_Errhandler errhandler); OMPI_DECLSPEC int PMPI_Session_set_info (MPI_Session session, MPI_Info info); OMPI_DECLSPEC int PMPI_Ssend_init(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Ssend_init_c(const void *buf, MPI_Count count, MPI_Datatype datatype, + int dest, int tag, MPI_Comm comm, + MPI_Request *request); OMPI_DECLSPEC int PMPI_Ssend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Ssend_c(const void *buf, MPI_Count count, MPI_Datatype datatype, int dest, + int tag, MPI_Comm comm); OMPI_DECLSPEC int PMPI_Start(MPI_Request *request); OMPI_DECLSPEC int PMPI_Startall(int count, MPI_Request array_of_requests[]); OMPI_DECLSPEC int PMPI_Status_c2f(const MPI_Status *c_status, MPI_Fint *f_status); OMPI_DECLSPEC int PMPI_Status_c2f08(const MPI_Status *c_status, MPI_F08_status *f08_status); -OMPI_DECLSPEC int PMPI_Status_f082f(const MPI_F08_status *f08_status, MPI_Fint *f_status); OMPI_DECLSPEC int PMPI_Status_f082c(const MPI_F08_status *f08_status, MPI_Status *c_status); +OMPI_DECLSPEC int PMPI_Status_f082f(const MPI_F08_status *f08_status, MPI_Fint *f_status); OMPI_DECLSPEC int PMPI_Status_f2c(const MPI_Fint *f_status, MPI_Status *c_status); OMPI_DECLSPEC int PMPI_Status_f2f08(const MPI_Fint *f_status, MPI_F08_status *f08_status); OMPI_DECLSPEC int PMPI_Status_set_cancelled(MPI_Status *status, int flag); OMPI_DECLSPEC int PMPI_Status_set_elements(MPI_Status *status, MPI_Datatype datatype, int count); +OMPI_DECLSPEC int PMPI_Status_set_elements_c(MPI_Status *status, MPI_Datatype datatype, + MPI_Count count); OMPI_DECLSPEC int PMPI_Status_set_elements_x(MPI_Status *status, MPI_Datatype datatype, MPI_Count count); OMPI_DECLSPEC int PMPI_Testall(int count, MPI_Request array_of_requests[], int *flag, MPI_Status array_of_statuses[]); -OMPI_DECLSPEC int PMPI_Testany(int count, MPI_Request array_of_requests[], int *index, int *flag, MPI_Status *status); +OMPI_DECLSPEC int PMPI_Testany(int count, MPI_Request array_of_requests[], int *index, + int *flag, MPI_Status *status); OMPI_DECLSPEC int PMPI_Test(MPI_Request *request, int *flag, MPI_Status *status); OMPI_DECLSPEC int PMPI_Test_cancelled(const MPI_Status *status, int *flag); OMPI_DECLSPEC int PMPI_Testsome(int incount, MPI_Request array_of_requests[], @@ -2771,6 +3443,8 @@ OMPI_DECLSPEC MPI_Fint PMPI_Type_c2f(MPI_Datatype datatype); OMPI_DECLSPEC int PMPI_Type_commit(MPI_Datatype *type); OMPI_DECLSPEC int PMPI_Type_contiguous(int count, MPI_Datatype oldtype, MPI_Datatype *newtype); +OMPI_DECLSPEC int PMPI_Type_contiguous_c(MPI_Count count, MPI_Datatype oldtype, + MPI_Datatype *newtype); OMPI_DECLSPEC int PMPI_Type_create_darray(int size, int rank, int ndims, const int gsize_array[], const int distrib_array[], const int darg_array[], const int psize_array[], @@ -2779,31 +3453,53 @@ OMPI_DECLSPEC int PMPI_Type_create_darray(int size, int rank, int ndims, OMPI_DECLSPEC int PMPI_Type_create_f90_complex(int p, int r, MPI_Datatype *newtype); OMPI_DECLSPEC int PMPI_Type_create_f90_integer(int r, MPI_Datatype *newtype); OMPI_DECLSPEC int PMPI_Type_create_f90_real(int p, int r, MPI_Datatype *newtype); +OMPI_DECLSPEC int PMPI_Type_create_hindexed_block(int count, int blocklength, + const MPI_Aint array_of_displacements[], + MPI_Datatype oldtype, + MPI_Datatype *newtype); +OMPI_DECLSPEC int PMPI_Type_create_hindexed_block_c(MPI_Count count, MPI_Count blocklength, + const MPI_Aint array_of_displacements[], + MPI_Datatype oldtype, + MPI_Datatype *newtype); OMPI_DECLSPEC int PMPI_Type_create_hindexed(int count, const int array_of_blocklengths[], const MPI_Aint array_of_displacements[], MPI_Datatype oldtype, MPI_Datatype *newtype); +OMPI_DECLSPEC int PMPI_Type_create_hindexed_c(MPI_Count count, const MPI_Count array_of_blocklengths[], + const MPI_Aint array_of_displacements[], + MPI_Datatype oldtype, + MPI_Datatype *newtype); OMPI_DECLSPEC int PMPI_Type_create_hvector(int count, int blocklength, MPI_Aint stride, MPI_Datatype oldtype, MPI_Datatype *newtype); +OMPI_DECLSPEC int PMPI_Type_create_hvector_c(MPI_Count count, MPI_Count blocklength, MPI_Aint stride, + MPI_Datatype oldtype, + MPI_Datatype *newtype); OMPI_DECLSPEC int PMPI_Type_create_keyval(MPI_Type_copy_attr_function *type_copy_attr_fn, MPI_Type_delete_attr_function *type_delete_attr_fn, int *type_keyval, void *extra_state); -OMPI_DECLSPEC int PMPI_Type_create_hindexed_block(int count, int blocklength, - const MPI_Aint array_of_displacements[], - MPI_Datatype oldtype, - MPI_Datatype *newtype); OMPI_DECLSPEC int PMPI_Type_create_indexed_block(int count, int blocklength, const int array_of_displacements[], MPI_Datatype oldtype, MPI_Datatype *newtype); +OMPI_DECLSPEC int PMPI_Type_create_indexed_block_c(MPI_Count count, MPI_Count blocklength, + const MPI_Aint array_of_displacements[], + MPI_Datatype oldtype, + MPI_Datatype *newtype); OMPI_DECLSPEC int PMPI_Type_create_struct(int count, const int array_of_block_lengths[], const MPI_Aint array_of_displacements[], const MPI_Datatype array_of_types[], MPI_Datatype *newtype); +OMPI_DECLSPEC int PMPI_Type_create_struct_c(MPI_Count count, const MPI_Count array_of_block_lengths[], + const MPI_Aint array_of_displacements[], + const MPI_Datatype array_of_types[], + MPI_Datatype *newtype); OMPI_DECLSPEC int PMPI_Type_create_subarray(int ndims, const int size_array[], const int subsize_array[], const int start_array[], int order, MPI_Datatype oldtype, MPI_Datatype *newtype); +OMPI_DECLSPEC int PMPI_Type_create_subarray_c(int ndims, const MPI_Count size_array[], const MPI_Count subsize_array[], + const MPI_Count start_array[], int order, + MPI_Datatype oldtype, MPI_Datatype *newtype); OMPI_DECLSPEC int PMPI_Type_create_resized(MPI_Datatype oldtype, MPI_Aint lb, MPI_Aint extent, MPI_Datatype *newtype); OMPI_DECLSPEC int PMPI_Type_delete_attr(MPI_Datatype type, int type_keyval); @@ -2818,6 +3514,7 @@ OMPI_DECLSPEC int PMPI_Type_get_contents(MPI_Datatype mtype, int max_integers, int array_of_integers[], MPI_Aint array_of_addresses[], MPI_Datatype array_of_datatypes[]); + /* TODO: MPI_Type_get_contents_c */ OMPI_DECLSPEC int PMPI_Type_get_envelope(MPI_Datatype type, int *num_integers, int *num_addresses, int *num_datatypes, int *combiner); @@ -2834,24 +3531,35 @@ OMPI_DECLSPEC int PMPI_Type_get_true_extent_x(MPI_Datatype datatype, MPI_Count OMPI_DECLSPEC int PMPI_Type_indexed(int count, const int array_of_blocklengths[], const int array_of_displacements[], MPI_Datatype oldtype, MPI_Datatype *newtype); +OMPI_DECLSPEC int PMPI_Type_indexed_c(MPI_Count count, const MPI_Count array_of_blocklengths[], + const MPI_Aint array_of_displacements[], + MPI_Datatype oldtype, MPI_Datatype *newtype); OMPI_DECLSPEC int PMPI_Type_match_size(int typeclass, int size, MPI_Datatype *type); OMPI_DECLSPEC int PMPI_Type_set_attr(MPI_Datatype type, int type_keyval, void *attr_val); OMPI_DECLSPEC int PMPI_Type_set_name(MPI_Datatype type, const char *type_name); OMPI_DECLSPEC int PMPI_Type_size(MPI_Datatype type, int *size); +OMPI_DECLSPEC int PMPI_Type_size_c(MPI_Datatype type, MPI_Count *size); OMPI_DECLSPEC int PMPI_Type_size_x(MPI_Datatype type, MPI_Count *size); OMPI_DECLSPEC int PMPI_Type_vector(int count, int blocklength, int stride, MPI_Datatype oldtype, MPI_Datatype *newtype); +OMPI_DECLSPEC int PMPI_Type_vector_c(MPI_Count count, MPI_Count blocklength, MPI_Count stride, + MPI_Datatype oldtype, MPI_Datatype *newtype); OMPI_DECLSPEC int PMPI_Unpack(const void *inbuf, int insize, int *position, void *outbuf, int outcount, MPI_Datatype datatype, MPI_Comm comm); -OMPI_DECLSPEC int PMPI_Unpublish_name(const char *service_name, MPI_Info info, - const char *port_name); +OMPI_DECLSPEC int PMPI_Unpack_c(const void *inbuf, MPI_Count insize, MPI_Count *position, + void *outbuf, MPI_Count outcount, MPI_Datatype datatype, + MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Unpublish_name(const char *service_name, MPI_Info info, const char *port_name); OMPI_DECLSPEC int PMPI_Unpack_external (const char datarep[], const void *inbuf, MPI_Aint insize, MPI_Aint *position, void *outbuf, int outcount, MPI_Datatype datatype); +OMPI_DECLSPEC int PMPI_Unpack_external_c (const char datarep[], const void *inbuf, MPI_Aint insize, + MPI_Aint *position, void *outbuf, MPI_Count outcount, + MPI_Datatype datatype); OMPI_DECLSPEC int PMPI_Waitall(int count, MPI_Request array_of_requests[], - MPI_Status array_of_statuses[]); + MPI_Status *array_of_statuses); OMPI_DECLSPEC int PMPI_Waitany(int count, MPI_Request array_of_requests[], int *index, MPI_Status *status); OMPI_DECLSPEC int PMPI_Wait(MPI_Request *request, MPI_Status *status); @@ -2898,6 +3606,7 @@ OMPI_DECLSPEC int PMPI_Win_set_errhandler(MPI_Win win, MPI_Errhandler errhandle OMPI_DECLSPEC int PMPI_Win_set_info(MPI_Win win, MPI_Info info); OMPI_DECLSPEC int PMPI_Win_set_name(MPI_Win win, const char *win_name); OMPI_DECLSPEC int PMPI_Win_shared_query(MPI_Win win, int rank, MPI_Aint *size, int *disp_unit, void *baseptr); +OMPI_DECLSPEC int PMPI_Win_shared_query_c(MPI_Win win, int rank, MPI_Aint *size, MPI_Aint *disp_unit, void *baseptr); OMPI_DECLSPEC int PMPI_Win_start(MPI_Group group, int mpi_assert, MPI_Win win); OMPI_DECLSPEC int PMPI_Win_sync(MPI_Win win); OMPI_DECLSPEC int PMPI_Win_test(MPI_Win win, int *flag); diff --git a/ompi/mpi/Makefile.am b/ompi/mpi/Makefile.am index 388076307c9..d1da03eb095 100644 --- a/ompi/mpi/Makefile.am +++ b/ompi/mpi/Makefile.am @@ -20,6 +20,13 @@ # EXTRA_DIST = \ - mpi/fortran/configure-fortran-output-bottom.h + mpi/fortran/configure-fortran-output-bottom.h \ + mpi/bindings/bindings.py \ + mpi/bindings/ompi_bindings/consts.py \ + mpi/bindings/ompi_bindings/c.py \ + mpi/bindings/ompi_bindings/c_type.py \ + mpi/bindings/ompi_bindings/fortran.py \ + mpi/bindings/ompi_bindings/fortran_type.py \ + mpi/bindings/ompi_bindings/util.py dist_ompidata_DATA += mpi/help-mpi-api.txt diff --git a/ompi/mpi/bindings/bindings.py b/ompi/mpi/bindings/bindings.py new file mode 100644 index 00000000000..b2bf67f8bdf --- /dev/null +++ b/ompi/mpi/bindings/bindings.py @@ -0,0 +1,75 @@ +# Copyright (c) 2024 Triad National Security, LLC. All rights +# reserved. +# +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +"""Main binding generation script. + +This script is used for generating the bindings for both C and Fortran. See the +scripts in 'ompi_bindings/' for the bulk of the code. +""" +import argparse +import os +import sys + + +def handle_missing_command(args, out): + print('missing subcommand (one of {fortran,c} required)', file=sys.stderr) + sys.exit(1) + + +def main(): + parser = argparse.ArgumentParser(description='generate fortran binding files') + parser.add_argument('--builddir', required=True, help='absolute path to automake builddir (abs_top_builddir)') + parser.add_argument('--output', required=True, help='output file to use') + parser.add_argument('--srcdir', required=True, help='absolute path to automake srcdir (abs_top_srcdir)') + parser.set_defaults(handler=handle_missing_command) + subparsers = parser.add_subparsers() + + # Fortran set up code + parser_fortran = subparsers.add_parser('fortran', help='subcommand for generating Fortran code') + # Handler for generating actual code + subparsers_fortran = parser_fortran.add_subparsers() + parser_code = subparsers_fortran.add_parser('code', help='generate binding code') + parser_code.set_defaults(handler=lambda args, out: fortran.generate_code(args, out)) + parser_code.add_argument('--lang', choices=('fortran', 'c'), + help='language to generate (only for code subparser)') + # Handler for generating the Fortran interface files + parser_interface = subparsers_fortran.add_parser('interface', + help='generate Fortran interface specifications') + parser_interface.set_defaults(handler=lambda args, out: fortran.generate_interface(args, out)) + # The prototype files argument must come last and be specified for both subparsers + for f_subparser in [parser_code, parser_interface]: + f_subparser.add_argument('--prototype-files', nargs='+', help='prototype files to generate code for') + + # C set up code + parser_c = subparsers.add_parser('c', help='subcommand for generating C code') + subparsers_c = parser_c.add_subparsers() + parser_header = subparsers_c.add_parser('header', help='generate header file from template files') + parser_header.add_argument('file', nargs='+', help='list of template source files') + parser_header.add_argument('--external', action='store_true', help='generate external mpi.h header file') + parser_header.add_argument('--srcdir', help='source directory') + parser_header.set_defaults(handler=lambda args, out: c.generate_header(args, out)) + parser_gen = subparsers_c.add_parser('source', help='generate source file from template file') + # parser = argparse.ArgumentParser(description='C ABI binding generation code') + parser_gen.add_argument('type', choices=('ompi', 'standard'), + help='generate the OMPI ABI functions or the standard ABI functions') + parser_gen.add_argument('source_file', help='template file to use for C code generation') + parser_gen.set_defaults(handler=lambda args, out: c.generate_source(args, out)) + args = parser.parse_args() + + # Pull in both generated python files and src files on import + sys.path.insert(0, os.path.join(args.builddir, 'ompi/mpi/bindings')) + sys.path.insert(0, os.path.join(args.srcdir, 'ompi/mpi/bindings')) + from ompi_bindings import c, fortran + from ompi_bindings.util import OutputFile + + with open(args.output, 'w') as f: + args.handler(args, OutputFile(f)) + + +if __name__ == '__main__': + main() diff --git a/ompi/mpi/bindings/ompi_bindings/c.py b/ompi/mpi/bindings/ompi_bindings/c.py new file mode 100644 index 00000000000..1ce9a0cb844 --- /dev/null +++ b/ompi/mpi/bindings/ompi_bindings/c.py @@ -0,0 +1,377 @@ +# Copyright (c) 2024 Triad National Security, LLC. All rights reserved. +# Copyright (c) 2023 Research Organization for Information Science +# and Technology (RIST). All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADERS$ +# +# +"""MPI C Binding Code. + +This file is used for generating C bindings, as well as bigcount interfaces, +from individual *.c.in template files. This also currently includes unused ABI +code, in preparation for the standard ABI. + +TEMPLATE SOURCE FILE ASSUMPTIONS: +* Only one function per file +* Nothing (other than blank lines) after closing '}' +* Function prototype is preceded by PROTOTYPE +* All types in the function prototype are converted to one-word capital types + as defined here (to be later converted to ompi or standard ABI types) +* Functions requiring a bigcount implementation should have type COUNT in + place of MPI_Count or int for each count parameter. Bigcount functions will + be generated automatically for any function that includes a COUNT type. +""" +from abc import ABC, abstractmethod +import argparse +import re +import sys +import os +from ompi_bindings import consts, util +from ompi_bindings.consts import ConvertFuncs, ConvertOMPIToStandard +from ompi_bindings.c_type import Type +from ompi_bindings.parser import SourceTemplate + + +class ABIHeaderBuilder: + """ABI header builder code.""" + + def __init__(self, prototypes, out, external=False): + self.out = out + self.external = external + + if external: + mangle_name = lambda name: name + else: + mangle_name = util.abi_internal_name + + # Build up the list of standard ABI signatures + signatures = [] + for prototype in prototypes: + base_name = util.mpi_fn_name_from_base_fn_name(prototype.name) + signatures.append(prototype.signature(base_name, abi_type='standard', + mangle_name=mangle_name)) + # Profiling prototype + signatures.append(prototype.signature(f'P{base_name}', abi_type='standard', + mangle_name=mangle_name)) + if util.prototype_has_bigcount(prototype): + signatures.append(prototype.signature(f'{base_name}_c', abi_type='standard', + enable_count=True, + mangle_name=mangle_name)) + # Profiling prototype + signatures.append(prototype.signature(f'P{base_name}_c', abi_type='standard', + enable_count=True, + mangle_name=mangle_name)) + self.signatures = signatures + + def mangle_name(self, extname): + """Mangle names, depending on whether building external or internal header.""" + if self.external: + return extname + return util.abi_internal_name(extname) + + def dump(self, *pargs, **kwargs): + self.out.dump(*pargs, **kwargs) + + def dump_lines(self, lines): + lines = util.indent_lines(lines, 4 * ' ', start=1) + for line in lines: + self.dump(line) + + def generate_error_convert_fn(self): + self.dump(f'{consts.INLINE_ATTRS} int {ConvertFuncs.ERROR_CLASS}(int error_class)') + self.dump('{') + lines = [] + lines.append('switch (error_class) {') + for error in consts.ERROR_CLASSES: + lines.append(f'case {self.mangle_name(error)}:') + lines.append(f'return {error};') + lines.append('default:') + lines.append('return error_class;') + lines.append('}') + self.dump_lines(lines) + self.dump('}') + + def generic_convert(self, fn_name, param_name, type_, value_names): + intern_type = self.mangle_name(type_) + self.dump(f'{consts.INLINE_ATTRS} {type_} {fn_name}({intern_type} {param_name})') + self.dump('{') + lines = [] + for i, value_name in enumerate(value_names): + intern_name = self.mangle_name(value_name) + if i == 0: + lines.append('if (%s == %s) {' % (intern_name, param_name)) + else: + lines.append('} else if (%s == %s) {' % (intern_name, param_name)) + lines.append(f'return {value_name};') + lines.append('}') + lines.append(f'return ({type_}) {param_name};') + self.dump_lines(lines) + self.dump('}') + + def generic_convert_reverse(self, fn_name, param_name, type_, value_names): + intern_type = self.mangle_name(type_) + self.dump(f'{consts.INLINE_ATTRS} {intern_type} {fn_name}({type_} {param_name})') + self.dump('{') + lines = [] + for i, value_name in enumerate(value_names): + intern_name = self.mangle_name(value_name) + if i == 0: + lines.append('if (%s == %s) {' % (value_name, param_name)) + else: + lines.append('} else if (%s == %s) {' % (value_name, param_name)) + lines.append(f'return {intern_name};') + lines.append('}') + lines.append(f'return ({intern_type}) {param_name};') + self.dump_lines(lines) + self.dump('}') + + def generate_comm_convert_fn(self): + self.generic_convert(ConvertFuncs.COMM, 'comm', 'MPI_Comm', consts.RESERVED_COMMUNICATORS) + + def generate_comm_convert_fn_intern_to_abi(self): + self.generic_convert_reverse(ConvertOMPIToStandard.COMM, 'comm', 'MPI_Comm', consts.RESERVED_COMMUNICATORS) + + def generate_info_convert_fn(self): + self.generic_convert(ConvertFuncs.INFO, 'info', 'MPI_Info', consts.RESERVED_INFOS) + + def generate_file_convert_fn_intern_to_abi(self): + self.generic_convert_reverse(ConvertFuncs.FILE, 'file', 'MPI_File', consts.RESERVED_FILES) + + def generate_datatype_convert_fn(self): + self.generic_convert(ConvertFuncs.DATATYPE, 'datatype', 'MPI_Datatype', consts.PREDEFINED_DATATYPES) + + def generate_op_convert_fn(self): + self.generic_convert(ConvertFuncs.OP, 'op', 'MPI_Op', consts.COLLECTIVE_OPERATIONS) + + def generate_win_convert_fn(self): + self.generic_convert(ConvertFuncs.WIN, 'win', 'MPI_Win', consts.RESERVED_WINDOWS) + + def generate_pointer_convert_fn(self, type_, fn_name, constants): + abi_type = self.mangle_name(type_) + self.dump(f'{consts.INLINE_ATTRS} void {fn_name}({abi_type} *ptr)') + self.dump('{') + lines = [] + for i, ompi_name in enumerate(constants): + abi_name = self.mangle_name(ompi_name) + if i == 0: + lines.append('if (%s == (%s) *ptr) {' % (ompi_name, type_)) + else: + lines.append('} else if (%s == (%s) *ptr) {' % (ompi_name, type_)) + lines.append(f'*ptr = {abi_name};') + lines.append('}') + self.dump_lines(lines) + self.dump('}') + + def generate_request_convert_fn(self): + self.generate_pointer_convert_fn('MPI_Request', ConvertFuncs.REQUEST, consts.RESERVED_REQUESTS) + + def generate_file_convert_fn(self): + self.generate_pointer_convert_fn('MPI_File', ConvertFuncs.FILE, consts.RESERVED_FILES) + + def generate_status_convert_fn(self): + type_ = 'MPI_Status' + abi_type = self.mangle_name(type_) + self.dump(f'{consts.INLINE_ATTRS} void {ConvertFuncs.STATUS}({abi_type} *out, {type_} *inp)') + self.dump('{') + self.dump(' out->MPI_SOURCE = inp->MPI_SOURCE;') + self.dump(' out->MPI_TAG = inp->MPI_TAG;') + self.dump(f' out->MPI_ERROR = {ConvertFuncs.ERROR_CLASS}(inp->MPI_ERROR);') + # Ignoring the private fields for now + self.dump('}') + + def define(self, type_, name, value): + self.dump(f'#define {name} OMPI_CAST_CONSTANT({type_}, {value})') + + def define_all(self, type_, constants): + for i, const in enumerate(constants): + self.define(self.mangle_name(type_), self.mangle_name(const), i + 1) + self.dump() + + def dump_header(self): + header_guard = '_ABI_INTERNAL_' + self.dump(f'#ifndef {header_guard}') + self.dump(f'#define {header_guard}') + + self.dump('#include "stddef.h"') + self.dump('#include "stdint.h"') + + self.dump(""" +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif +""") + + self.dump(""" +#if defined(c_plusplus) || defined(__cplusplus) +#define OMPI_CAST_CONSTANT(type, value) (static_cast (static_cast (value))) +#else +#define OMPI_CAST_CONSTANT(type, value) ((type) ((void *) value)) +#endif +""") + + for i, err in enumerate(consts.ERROR_CLASSES): + self.dump(f'#define {self.mangle_name(err)} {i + 1}') + self.dump() + + self.define_all('MPI_Datatype', consts.PREDEFINED_DATATYPES) + self.define_all('MPI_Op', COLLECTIVE_OPERATIONS) + self.define_all('MPI_Comm', consts.RESERVED_COMMUNICATORS) + self.define_all('MPI_Request', consts.RESERVED_REQUESTS) + self.define_all('MPI_Win', consts.RESERVED_WINDOWS) + self.define_all('MPI_Info', consts.RESERVED_INFOS) + self.define_all('MPI_File', consts.RESERVED_FILES) + + for name, value in consts.VARIOUS_CONSTANTS.items(): + self.dump(f'#define {self.mangle_name(name)} {value}') + self.dump() + + status_type = self.mangle_name('MPI_Status') + for i, name in enumerate(consts.IGNORED_STATUS_HANDLES): + self.define(f'{status_type} *', self.mangle_name(name), i + 1) + self.dump() + + for i, name in enumerate(consts.COMMUNICATOR_SPLIT_TYPES): + self.dump(f'#define {self.mangle_name(name)} {i}') + self.dump() + + for mpi_type, c_type in consts.C_OPAQUE_TYPES.items(): + self.dump(f'typedef {c_type} {self.mangle_name(mpi_type)};') + self.dump() + + for handle in consts.C_HANDLES: + prefix, suffix = handle.split('_') + name = f'{prefix}_ABI_{suffix}' + self.dump(f'typedef struct {self.mangle_name(name)} *{self.mangle_name(handle)};') + self.dump() + self.dump(""" +struct MPI_Status_ABI { + int MPI_SOURCE; + int MPI_TAG; + int MPI_ERROR; + int mpi_abi_private[5]; +};""") + self.dump(f'typedef struct MPI_Status_ABI {self.mangle_name("MPI_Status")};') + self.dump() + # Function signatures + for sig in self.signatures: + self.dump(f'{sig};') + self.dump('int MPI_Abi_details(int *buflen, char *details, MPI_Info *info);') + self.dump('int MPI_Abi_supported(int *flag);') + self.dump('int MPI_Abi_version(int *abi_major, int *abi_minor);') + if not self.external: + # Now generate the conversion code + self.generate_error_convert_fn() + self.generate_comm_convert_fn() + self.generate_comm_convert_fn_intern_to_abi() + self.generate_info_convert_fn() + self.generate_file_convert_fn() + self.generate_datatype_convert_fn() + self.generate_op_convert_fn() + self.generate_win_convert_fn() + self.generate_request_convert_fn() + self.generate_status_convert_fn() + + self.dump(""" +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif +""") + self.dump(f'#endif /* {header_guard} */') + + +def print_profiling_header(fn_name, out): + """Print the profiling header code.""" + out.dump('#if OMPI_BUILD_MPI_PROFILING') + out.dump('#if OPAL_HAVE_WEAK_SYMBOLS') + out.dump(f'#pragma weak {fn_name} = P{fn_name}') + out.dump('#endif') + out.dump(f'#define {fn_name} P{fn_name}') + out.dump('#endif') + + +def ompi_abi(base_name, template, out): + """Generate the OMPI ABI functions.""" + template.print_header(out) + print_profiling_header(base_name, out) + out.dump(template.prototype.signature(base_name, abi_type='ompi')) + template.print_body(func_name=base_name, out=out) + # Check if we need to generate the bigcount interface + if util.prototype_has_bigcount(template.prototype): + out.dump('#if OMPI_BIGCOUNT') + base_name_c = f'{base_name}_c' + print_profiling_header(base_name_c, out) + out.dump(template.prototype.signature(base_name_c, abi_type='ompi', enable_count=True)) + template.print_body(func_name=base_name_c, out=out) + out.dump('#endif /* OMPI_BIGCOUNT */') + + +ABI_INTERNAL_HEADER = 'ompi/mpi/c/abi.h' + + +def standard_abi(base_name, template, out): + """Generate the standard ABI functions.""" + template.print_header(out) + out.dump(f'#include "{ABI_INTERNAL_HEADER}"') + + # Static internal function (add a random component to avoid conflicts) + internal_name = f'ompi_abi_{template.prototype.name}' + internal_sig = template.prototype.signature(internal_name, abi_type='ompi', + enable_count=True) + out.dump(consts.INLINE_ATTRS, internal_sig) + template.print_body(func_name=base_name, out=out) + + def generate_function(prototype, fn_name, internal_fn, enable_count=False): + """Generate a function for the standard ABI.""" + print_profiling_header(fn_name) + + # Handle type conversions and arguments + params = [param.construct(abi_type='standard') for param in prototype.params] + out.dump(prototype.signature(fn_name, abi_type='standard', enable_count=enable_count)) + out.dump('{') + lines = [] + return_type = prototype.return_type.construct(abi_type='standard') + lines.append(f'{return_type.tmp_type_text()} ret_value;') + for param in params: + if param.init_code: + lines.extend(param.init_code) + pass_args = ', '.join(param.argument for param in params) + lines.append(f'ret_value = {internal_fn}({pass_args});') + for param in params: + if param.final_code: + lines.extend(param.final_code) + lines.extend(return_type.return_code('ret_value')) + + # Indent the lines + lines = util.indent_lines(lines, 4 * ' ', start=1) + for line in lines: + out.dump(line) + out.dump('}') + + generate_function(template.prototype, base_name, internal_name) + if util.prototype_has_bigcount(template.prototype): + base_name_c = f'{base_name}_c' + generate_function(template.prototype, base_name_c, internal_name, + enable_count=True) + + +def generate_header(args, out): + """Generate an ABI header and conversion code.""" + out.dump(f'/* {consts.GENERATED_MESSAGE} */') + prototypes = [SourceTemplate.load(file_, args.srcdir, type_constructor=Type.construct).prototype + for file_ in args.file] + builder = ABIHeaderBuilder(prototypes, out, external=args.external) + builder.dump_header() + + +def generate_source(args, out): + """Generate source file.""" + out.dump(f'/* {consts.GENERATED_MESSAGE} */') + template = SourceTemplate.load(args.source_file, type_constructor=Type.construct) + base_name = util.mpi_fn_name_from_base_fn_name(template.prototype.name) + if args.type == 'ompi': + ompi_abi(base_name, template, out) + else: + standard_abi(base_name, template, out) diff --git a/ompi/mpi/bindings/ompi_bindings/c_type.py b/ompi/mpi/bindings/ompi_bindings/c_type.py new file mode 100644 index 00000000000..e61ba5f8dae --- /dev/null +++ b/ompi/mpi/bindings/ompi_bindings/c_type.py @@ -0,0 +1,1144 @@ +from abc import ABC, abstractmethod +from ompi_bindings.consts import ConvertFuncs, ConvertOMPIToStandard + + +class Type(ABC): + """Type representation.""" + + PARAMS_OMPI_ABI = {} + + PARAMS_STANDARD_ABI = {} + + def __init__(self, type_name, name=None, + mangle_name=lambda name: abi_internal_name(name), + count_param=None, **kwargs): + self.type = type_name + self.name = name + self.count_param = count_param + self.mangle_name = mangle_name + + @staticmethod + def construct(abi_type, type_name, **kwargs): + """Construct the parameter for the given ABI and type.""" + if abi_type == 'ompi': + return Type.PARAMS_OMPI_ABI[type_name](type_name, **kwargs) + elif abi_type == 'standard': + return Type.PARAMS_STANDARD_ABI[type_name](type_name, **kwargs) + else: + raise RuntimeError(f'invalid ABI type {abi_type}') + + @staticmethod + def add_type(type_name, abi_type=('ompi', 'standard')): + """Add a new class corresponding to a type.""" + def wrapper(class_): + if 'ompi' in abi_type: + Type.PARAMS_OMPI_ABI[type_name] = class_ + if 'standard' in abi_type: + Type.PARAMS_STANDARD_ABI[type_name] = class_ + return class_ + return wrapper + + @property + def is_count(self): + """Return True if this parameter is a count (requiring bigcount API).""" + return False + + @property + def init_code(self): + """Return the initialization code needed for an ABI wrapper.""" + return [] + + @property + def final_code(self): + """Return the finalization code needed for an ABI wrapper.""" + return [] + + def return_code(self, name): + """Process a value and then build up a return statement.""" + return [f'return {name};'] + + @property + def argument(self): + """Return the argument text required for passing an argument to a function.""" + return self.name + + @abstractmethod + def type_text(self, enable_count=False): + """Return the source text corresponding to a type definition.""" + + def tmp_type_text(self, enable_count=False): + """Return source text corresponding to a temporary type definition before conversion.""" + return self.type_text(enable_count=enable_count) + + def parameter(self, enable_count=False, **kwargs): + return f'{self.type_text(enable_count=enable_count)} {self.name}' + + +@Type.add_type('ERROR_CLASS') +class TypeErrorClass(Type): + + def type_text(self, enable_count=False): + return 'int' + + def return_code(self, name): + return [f'return {ConvertFuncs.ERROR_CLASS}({name});'] + + +@Type.add_type('BUFFER') +class TypeBuffer(Type): + + def type_text(self, enable_count=False): + return 'const void *' + + +@Type.add_type('BUFFER_OUT') +class TypeBufferOut(Type): + + def type_text(self, enable_count=False): + return f'void *' + + +@Type.add_type('COUNT') +class TypeCount(Type): + + @property + def is_count(self): + return True + + def type_text(self, enable_count=False): + return 'MPI_Count' if enable_count else 'int' + + +@Type.add_type('COUNT_ARRAY') +class TypeCountArray(Type): + """Array of counts (either int or MPI_Count).""" + + @property + def is_count(self): + return True + + def type_text(self, enable_count=False): + return 'MPI_Count *' if enable_count else 'int *' + + def parameter(self, enable_count=False, **kwargs): + count_type = 'MPI_Count' if enable_count else 'int' + return f'const {count_type} {self.name}[]' + + +@Type.add_type('ELEMENT_COUNT') +class ElementCountType(Type): + """Special count type for MPI_Get_element_x""" + + def type_text(self, enable_count=False): + return 'MPI_Count *' + + +@Type.add_type('PARTITIONED_COUNT') +class TypePartitionedCount(Type): + """Count type for partitioned communication functions.""" + + def type_text(self, enable_count=False): + return 'MPI_Count' + + +@Type.add_type('DISP_ARRAY') +class TypeDisplArray(Type): + + @property + def is_count(self): + return True + + def type_text(self, enable_count=False): + return 'MPI_Aint *' if enable_count else 'int *' + + def parameter(self, enable_count=False, **kwargs): + count_type = 'MPI_Aint' if enable_count else 'int' + return f'const {count_type} {self.name}[]' + + +@Type.add_type('INT') +class TypeInt(Type): + + def type_text(self, enable_count=False): + return 'int' + + +@Type.add_type('AINT') +class TypeAint(Type): + + def type_text(self, enable_count=False): + return 'MPI_Aint' + + +@Type.add_type('AINT_OUT') +class TypeAintOut(Type): + + def type_text(self, enable_count=False): + return 'MPI_Aint *' + + +@Type.add_type('INT_OUT') +class TypeIntOut(Type): + + def type_text(self, enable_count=False): + return 'int *' + + def parameter(self, enable_count=False, **kwargs): + if self.count_param is None: + return f'int *{self.name}' + else: + return f'int {self.name}[]' + + +@Type.add_type('INT_ARRAY') +class TypeIntArray(Type): + + def type_text(self, enable_count=False): + return 'const int *' + + def parameter(self, enable_count=False, **kwargs): + return f'const int {self.name}[]' + + +@Type.add_type('RANGE_ARRAY') +class TypeRangeArray(Type): + + def type_text(self, enable_count=False): + return 'int *' + + def parameter(self, enable_count=False, **kwargs): + return f'int {self.name}[][3]' + + +@Type.add_type('OFFSET') +class TypeOffset(Type): + + def type_text(self, enable_count=False): + return 'MPI_Offset' + + +@Type.add_type('OFFSET_OUT') +class TypeOffsetOut(Type): + + def type_text(self, enable_count=False): + return 'MPI_Offset *' + + +@Type.add_type('DOUBLE') +class TypeDouble(Type): + + def type_text(self, enable_count=False): + return 'double' + + +@Type.add_type('ARGV') +class TypeArgv(Type): + + def type_text(self, enable_count=False): + return 'char ***' + + +@Type.add_type('STRING_ARRAY') +class TypeStringArray(Type): + + def type_text(self, enable_count=False): + return 'char **' + + def parameter(self, enable_count=False, **kwargs): + return f'char *{self.name}[]' + + +@Type.add_type('DATATYPE', abi_type=['ompi']) +class TypeDatatype(Type): + + def type_text(self, enable_count=False): + return 'MPI_Datatype' + + +@Type.add_type('DATATYPE_ARRAY', abi_type=['ompi']) +class TypeDatatypeArray(Type): + + def type_text(self, enable_count=False): + return 'MPI_Datatype' + + def parameter(self, enable_count=False, **kwargs): + return f'const {self.type_text(enable_count=enable_count)} {self.name}[]' + + +class StandardABIType(Type): + + @property + def tmpname(self): + return f'{self.name}_tmp' + + @property + def argument(self): + return self.tmpname + + +@Type.add_type('DATATYPE', abi_type=['standard']) +class TypeDatatypeStandard(StandardABIType): + + @property + def init_code(self): + return [f'MPI_Datatype {self.tmpname} = {ConvertFuncs.DATATYPE}({self.name});'] + + def type_text(self, enable_count=False): + return self.mangle_name('MPI_Datatype') + + +@Type.add_type('DATATYPE_OUT', abi_type=['ompi']) +class TypeDatatypeOut(Type): + + def type_text(self, enable_count=False): + return 'MPI_Datatype *' + + +@Type.add_type('DATATYPE_OUT', abi_type=['standard']) +class TypeDatatypeStandard(Type): + + @property + def final_code(self): + return [f'*{self.name} = {ConvertOMPIToStandard.DATATYPE}((MPI_Datatype) *{self.name});'] + + def type_text(self, enable_count=False): + type_name = self.mangle_name('MPI_Datatype') + return f'{type_name} *' + + @property + def argument(self): + return f'(MPI_Datatype *) {self.name}' + + +@Type.add_type('OP', abi_type=['ompi']) +class TypeDatatype(Type): + + def type_text(self, enable_count=False): + return 'MPI_Op' + + +@Type.add_type('OP', abi_type=['standard']) +class TypeDatatype(StandardABIType): + + @property + def init_code(self): + return [f'MPI_Op {self.tmpname} = {ConvertFuncs.OP}({self.name});'] + + def type_text(self, enable_count=False): + return self.mangle_name('MPI_Op') + + +@Type.add_type('OP_OUT', abi_type=['ompi']) +class TypeOpOut(Type): + + def type_text(self, enable_count=False): + return 'MPI_Op *' + + +@Type.add_type('OP_OUT', abi_type=['standard']) +class TypeOpOutStandard(Type): + + @property + def final_code(self): + return [f'*{self.name} = {ConvertOMPIToStandard.OP}((MPI_Op) *{self.name});'] + + def type_text(self, enable_count=False): + type_name = self.mangle_name('MPI_Op') + return f'{type_name} *' + + @property + def argument(self): + return f'(MPI_Op *) {self.name}' + + +@Type.add_type('RANK') +class TypeRank(Type): + + def type_text(self, enable_count=False): + return 'int' + + +@Type.add_type('TAG') +class TypeRank(Type): + + def type_text(self, enable_count=False): + return 'int' + + +@Type.add_type('COMM', abi_type=['ompi']) +class TypeCommunicator(Type): + + def type_text(self, enable_count=False): + return 'MPI_Comm' + + +@Type.add_type('COMM', abi_type=['standard']) +class TypeCommunicatorStandard(StandardABIType): + + @property + def init_code(self): + return [f'MPI_Comm {self.tmpname} = {ConvertFuncs.COMM}({self.name});'] + + def tmp_type_text(self, enable_count=False): + return 'MPI_Comm' + + def return_code(self, name): + return [f'return {ConvertOMPIToStandard.COMM}({name});'] + + def type_text(self, enable_count=False): + return self.mangle_name('MPI_Comm') + + +@Type.add_type('COMM_OUT', abi_type=['ompi']) +class TypeCommunicator(Type): + + def type_text(self, enable_count=False): + return 'MPI_Comm *' + + +@Type.add_type('COMM_OUT', abi_type=['standard']) +class TypeCommunicator(Type): + + @property + def final_code(self): + return [f'*{self.name} = {ConvertOMPIToStandard.COMM}((MPI_Comm) *{self.name});'] + + def type_text(self, enable_count=False): + type_name = self.mangle_name('MPI_Comm') + return f'{type_name} *' + + @property + def argument(self): + return f'(MPI_Comm *) {self.name}' + + +@Type.add_type('WIN', abi_type=['ompi']) +class TypeWindow(Type): + + def type_text(self, enable_count=False): + return 'MPI_Win' + + +@Type.add_type('WIN', abi_type=['standard']) +class TypeWindowStandard(StandardABIType): + + @property + def init_code(self): + return [f'MPI_Win {self.tmpname} = {ConvertFuncs.WIN}({self.name});'] + + def type_text(self, enable_count=False): + return self.mangle_name('MPI_Win') + + +@Type.add_type('WIN_OUT', abi_type=['ompi']) +class TypeWindowOut(Type): + + def type_text(self, enable_count=False): + return 'MPI_Win *' + + +@Type.add_type('WIN_OUT', abi_type=['standard']) +class TypeWindowOutStandard(StandardABIType): + + @property + def final_code(self): + return [f'*{self.name} = {ConvertOMPIToStandard.WIN}((MPI_Win) *{self.name});'] + + def type_text(self, enable_count=False): + type_name = self.mangle_name('MPI_Win') + return f'{type_name} *' + + @property + def argument(self): + return f'(MPI_Win *) {self.name}' + + +@Type.add_type('REQUEST', abi_type=['ompi']) +class TypeRequest(Type): + + def type_text(self, enable_count=False): + return 'MPI_Request' + + +@Type.add_type('REQUEST', abi_type=['standard']) +class TypeRequestStandard(Type): + + def type_text(self, enable_count=False): + return self.mangle_name('MPI_Request') + + @property + def argument(self): + return f'(MPI_Request) {self.name}' + + +@Type.add_type('REQUEST_INOUT', abi_type=['ompi']) +class TypeRequestInOut(Type): + + def type_text(self, enable_count=False): + return 'MPI_Request *' + + +@Type.add_type('REQUEST_INOUT', abi_type=['standard']) +class TypeRequestInOutStandard(Type): + + @property + def final_code(self): + if self.count_param is None: + return [f'{ConvertFuncs.REQUEST}({self.name});'] + else: + return [ + 'for (int i = 0; i < %s; ++i) {' % (self.count_param,), + f'{ConvertFuncs.REQUEST}(&{self.name}[i]);', + '}', + ] + + @property + def argument(self): + return f'(MPI_Request *) {self.name}' + + def type_text(self, enable_count=False): + type_name = self.mangle_name('MPI_Request') + return f'{type_name} *' + + def parameter(self, enable_count=False, **kwargs): + type_name = self.mangle_name('MPI_Request') + if self.count_param is None: + return f'{type_name} *{self.name}' + else: + return f'{type_name} {self.name}[]' + + +@Type.add_type('STATUS', abi_type=['ompi']) +class TypeStatus(Type): + + def type_text(self, enable_count=False): + return 'const MPI_Status *' + + +@Type.add_type('STATUS', abi_type=['standard']) +class TypeStatusStandard(StandardABIType): + + @property + def init_code(self): + # TODO: Need to ensure this is the correct conversion function for MPI_Status + return [f'{ConvertFuncs.STATUS}({self.name}, &{self.tmpname});'] + + def typ_text(self, enable_count=False): + type_name = self.mangle_name('MPI_Status') + return f'const {type_name} *' + + +@Type.add_type('STATUS_OUT', abi_type=['ompi']) +class TypeStatusOut(Type): + + def type_text(self, enable_count=False): + return 'MPI_Status *' + + def parameter(self, enable_count=False, **kwargs): + if self.count_param is None: + return f'MPI_Status *{self.name}' + else: + return f'MPI_Status {self.name}[]' + + +@Type.add_type('STATUS_OUT', abi_type=['standard']) +class TypeStausOutStandard(StandardABIType): + + def if_should_set_status(self): + """Generate the condition to check if the status(es) should be set.""" + condition = ' && '.join(f'{self.mangle_name(const)} != {self.name}' + for const in IGNORED_STATUS_HANDLES) + return 'if (%s) {' % (condition,) + + @property + def status_argument(self): + return f'{self.name}_arg' + + @property + def init_code(self): + code = [f'MPI_Status *{self.status_argument} = NULL;'] + if self.count_param is None: + code.append(f'MPI_Status {self.tmpname};') + else: + code.append(f'MPI_Status *{self.tmpname} = NULL;') + code.append(self.if_should_set_status()) + if self.count_param is not None: + code.append(f'{self.tmpname} = malloc({self.count_param} * sizeof(MPI_Status));') + code.append(f'{self.status_argument} = {self.tmpname};') + else: + code.append(f'{self.status_argument} = &{self.tmpname};') + code.append('} else {') + if self.count_param is not None: + code.append(f'{self.status_argument} = MPI_STATUSES_IGNORE;') + else: + code.append(f'{self.status_argument} = MPI_STATUS_IGNORE;') + code.append('}') + return code + + @property + def final_code(self): + code = [self.if_should_set_status()] + if self.count_param is None: + code.append(f'{ConvertFuncs.STATUS}({self.name}, &{self.tmpname});') + else: + code.extend([ + 'for (int i = 0; i < %s; ++i) {' % (self.count_param,), + f'{ConvertFuncs.STATUS}(&{self.name}[i], &{self.tmpname}[i]);', + '}', + f'free({self.tmpname});', + ]) + code.append('}') + return code + + @property + def argument(self): + return self.status_argument + + def type_text(self, enable_count=False): + type_name = self.mangle_name('MPI_Status') + return f'{type_name} *' + + def parameter(self, enable_count=False, **kwargs): + type_name = self.mangle_name('MPI_Status') + if self.count_param is None: + return f'{type_name} *{self.name}' + else: + return f'{type_name} {self.name}[]' + + +@Type.add_type('F08_STATUS') +class TypeF08Status(Type): + + def type_text(self, enable_count=False): + return 'const MPI_F08_status *' + + +@Type.add_type('F08_STATUS_OUT') +class TypeF08StatusOut(Type): + + def type_text(self, enable_count=False): + return 'MPI_F08_status *' + + +# TODO: For now this just assumes that MPI_Fint doesn't need any conversions +@Type.add_type('FINT') +class TypeFint(Type): + + def type_text(self, enable_count=False): + return 'MPI_Fint' + + +@Type.add_type('FINT_CONST') +class TypeFintRef(Type): + + def type_text(self, enable_count=False): + return 'const MPI_Fint *' + + +@Type.add_type('FINT_OUT') +class TypeFintOut(Type): + + def type_text(self, enable_count=False): + return 'MPI_Fint *' + + +@Type.add_type('STRING') +class TypeString(Type): + + def type_text(self, enable_count=False): + return 'const char *' + + +@Type.add_type('STRING_OUT') +class TypeStringOut(Type): + + def type_text(self, enable_count=False): + return 'char *' + + +@Type.add_type('INFO', abi_type=['ompi']) +class TypeInfo(Type): + + def type_text(self, enable_count=False): + return 'MPI_Info' + + +@Type.add_type('INFO', abi_type=['standard']) +class TypeInfoStandard(StandardABIType): + + @property + def init_code(self): + return [f'MPI_Info {self.tmpname} = {ConvertFuncs.INFO}({self.name});'] + + def type_text(self, enable_count=False): + return self.mangle_name('MPI_Info') + + +@Type.add_type('INFO_OUT', abi_type=['ompi']) +class TypeInfoOut(Type): + + def type_text(self, enable_count=False): + return 'MPI_Info *' + + +@Type.add_type('INFO_OUT', abi_type=['standard']) +class TypeInfoOutStandard(Type): + + @property + def argument(self): + return f'(MPI_Info *) {self.name}' + + def type_text(self, enable_count=False): + type_name = self.mangle_name('MPI_Info') + return f'{type_name} *' + + +@Type.add_type('INFO_ARRAY', abi_type=['ompi']) +class TypeInfoArray(Type): + + def type_text(self, enable_count=False): + return 'const MPI_Info *' + + def parameter(self, enable_count=False, **kwargs): + return f'const MPI_Info {self.name}[]' + + +@Type.add_type('INFO_ARRAY', abi_type=['standard']) +class TypeInfoArray(Type): + + def type_text(self, enable_count=False): + type_name = self.mangle_name('MPI_Info') + return f'const {type_name} *' + + def parameter(self, enable_count=False, **kwargs): + type_name = self.mangle_name('MPI_Info') + return f'const {type_name} {self.name}[]' + + +@Type.add_type('FILE', abi_type=['ompi']) +class TypeFile(Type): + + def type_text(self, enable_count=False): + return 'MPI_File' + + +@Type.add_type('FILE', abi_type=['standard']) +class TypeFileStandard(Type): + + @property + def argument(self): + return f'(MPI_File) {self.name}' + + def type_text(self, enable_count=False): + return self.mangle_name('MPI_File') + + +@Type.add_type('FILE_OUT', abi_type=['ompi']) +class TypeFileOut(Type): + + def type_text(self, enable_count=False): + return 'MPI_File *' + + +@Type.add_type('FILE_OUT', abi_type=['standard']) +class TypeFileOutStandard(Type): + + @property + def argument(self): + return f'(MPI_File *) {self.name}' + + @property + def final_code(self): + return [f'{ConvertFuncs.FILE}({self.name});'] + + def type_text(self, enable_count=False): + type_name = self.mangle_name('MPI_File') + return f'{type_name} *' + + +@Type.add_type('MESSAGE', abi_type=['ompi']) +class TypeMessage(Type): + + def type_text(self, enable_count=False): + return 'MPI_Message' + + +@Type.add_type('MESSAGE', abi_type=['standard']) +class TypeMessageStandard(Type): + + @property + def argument(self): + return f'(MPI_File) {self.name}' + + def type_text(self, enable_count=False): + return self.mangle_name('MPI_Message') + + +@Type.add_type('MESSAGE_OUT', abi_type=['ompi']) +class TypeMessageOut(Type): + + def type_text(self, enable_count=False): + return 'MPI_Message *' + + +@Type.add_type('MESSAGE_OUT', abi_type=['standard']) +class TypeMessageOutStandard(Type): + + @property + def argument(self): + return f'(MPI_Message *) {self.name}' + + def type_text(self, enable_count=False): + type_name = self.mangle_name('MPI_Message') + return f'{type_name} *' + + +@Type.add_type('COMM_ERRHANDLER_FUNCTION', abi_type=['ompi']) +class TypeCommErrhandlerFunction(Type): + + def type_text(self, enable_count=False): + return 'MPI_Comm_errhandler_function *' + + +@Type.add_type('COMM_ERRHANDLER_FUNCTION', abi_type=['standard']) +class TypeCommErrhandlerFunctionStandard(Type): + # TODO: This may require a special function to wrap the calllback + pass + + +@Type.add_type('FILE_ERRHANDLER_FUNCTION', abi_type=['ompi']) +class TypeFileErrhandlerFunction(Type): + + def type_text(self, enable_count=False): + return 'MPI_File_errhandler_function *' + + +@Type.add_type('FILE_ERRHANDLER_FUNCTION', abi_type=['standard']) +class TypeFileErrhandlerFunction(Type): + # TODO: This may require a special function to wrap the callback + pass + + +@Type.add_type('COPY_FUNCTION', abi_type=['ompi']) +class TypeCopyFunction(Type): + + def type_text(self, enable_count=False): + return 'MPI_Copy_function *' + + +@Type.add_type('COPY_FUNCTION', abi_type=['standard']) +class TypeCopyFunctionStandard(Type): + # TODO: This may require a special function to wrap the callback + pass + + +@Type.add_type('DELETE_FUNCTION', abi_type=['ompi']) +class TypeDeleteFunction(Type): + + def type_text(self, enable_count=False): + return 'MPI_Delete_function *' + + +@Type.add_type('DELETE_FUNCTION', abi_type=['standard']) +class TypeDeleteFunctionStandard(Type): + # TODO: This may require a special function to wrap the callback + pass + + +@Type.add_type('USER_FUNCTION', abi_type=['ompi']) +class TypeUserFunction(Type): + + def type_text(self, enable_count=False): + return 'MPI_User_function *' + + +@Type.add_type('USER_FUNCTION', abi_type=['standard']) +class TypeUserFunctionStandard(Type): + # TODO: This may require a special function to wrap the callback + pass + + +@Type.add_type('COMM_COPY_ATTR_FUNCTION', abi_type=['ompi']) +class TypeCommCopyAttrFunction(Type): + + def type_text(self, enable_count=False): + return 'MPI_Comm_copy_attr_function *' + + +@Type.add_type('COMM_COPY_ATTR_FUNCTION', abi_type=['standard']) +class TypeCommCopyAttrFunctionStandard(Type): + # TODO: This may require a special function to wrap the callback + pass + + +@Type.add_type('COMM_DELETE_ATTR_FUNCTION', abi_type=['ompi']) +class TypeCommDeleteAttrFunction(Type): + + def type_text(self, enable_count=False): + return 'MPI_Comm_delete_attr_function *' + + +@Type.add_type('COMM_DELETE_ATTR_FUNCTION', abi_type=['standard']) +class TypeCommDeleteAttrFunctionStandard(Type): + # TODO: This may require a special function to wrap the callback + pass + + +@Type.add_type('GREQUEST_QUERY_FUNCTION', abi_type=['ompi']) +class TypeGrequestQueryFunction(Type): + + def type_text(self, enable_count=False): + return 'MPI_Grequest_query_function *' + + +@Type.add_type('GREQUEST_QUERY_FUNCTION', abi_type=['standard']) +class TypeGrequestQueryFunctionStandard(Type): + # TODO: This may require a special function to wrap the callback + pass + + +@Type.add_type('GREQUEST_FREE_FUNCTION', abi_type=['ompi']) +class TypeGrequestFreeFunction(Type): + + def type_text(self, enable_count=False): + return 'MPI_Grequest_free_function *' + + +@Type.add_type('GREQUEST_FREE_FUNCTION', abi_type=['standard']) +class TypeGrequestFreeFunctionStandard(Type): + # TODO: This may require a special function to wrap the callback + pass + + +@Type.add_type('GREQUEST_CANCEL_FUNCTION', abi_type=['ompi']) +class TypeGrequestCancelFunction(Type): + + def type_text(self, enable_count=False): + return 'MPI_Grequest_cancel_function *' + + +@Type.add_type('GREQUEST_CANCEL_FUNCTION', abi_type=['standard']) +class TypeGrequestCancelFunctionStandard(Type): + # TODO: This may require a special function to wrap the callback + pass + + +@Type.add_type('DATAREP_CONVERSION_FUNCTION', abi_type=['ompi']) +class TypeDatarepConversionFunction(Type): + + def type_text(self, enable_count=False): + return 'MPI_Datarep_conversion_function *' + + +@Type.add_type('DATAREP_CONVERSION_FUNCTION', abi_type=['standard']) +class TypeDatarepConversionFunctionStandard(Type): + # TODO: This may require a special function to wrap the callback + pass + + +@Type.add_type('DATAREP_EXTENT_FUNCTION', abi_type=['ompi']) +class TypeDatarepExtentFunction(Type): + + def type_text(self, enable_count=False): + return 'MPI_Datarep_extent_function *' + + +@Type.add_type('DATAREP_EXTENT_FUNCTION', abi_type=['standard']) +class TypeDatarepExtentFunctionStandard(Type): + # TODO: This may require a special function to wrap the callback + pass + + +@Type.add_type('SESSION_ERRHANDLER_FUNCTION', abi_type=['ompi']) +class TypeSessionErrhandlerFunction(Type): + + def type_text(self, enable_count=False): + return 'MPI_Session_errhandler_function *' + + +@Type.add_type('SESSION_ERRHANDLER_FUNCTION', abi_type=['standard']) +class TypeSessionErrhandlerFunctionStandard(Type): + # TODO: This may require a special function to wrap the callback + pass + + +@Type.add_type('TYPE_COPY_ATTR_FUNCTION', abi_type=['ompi']) +class TypeTypeCopyAttrFunction(Type): + + def type_text(self, enable_count=False): + return 'MPI_Type_copy_attr_function *' + + +@Type.add_type('TYPE_COPY_ATTR_FUNCTION', abi_type=['standard']) +class TypeTypeCopyAttrFunctionStandard(Type): + # TODO: This may require a special function to wrap the callback + pass + + +@Type.add_type('TYPE_DELETE_ATTR_FUNCTION', abi_type=['ompi']) +class TypeTypeDeleteAttrFunction(Type): + + def type_text(self, enable_count=False): + return 'MPI_Type_delete_attr_function *' + + +@Type.add_type('TYPE_DELETE_ATTR_FUNCTION', abi_type=['standard']) +class TypeTypeDeleteAttrFunctionStandard(Type): + # TODO: This may require a special function to wrap the callback + pass + + +@Type.add_type('WIN_ERRHANLDER_FUNCTION', abi_type=['ompi']) +class TypeWinErrhandlerFunction(Type): + + def type_text(self, enable_count=False): + return 'MPI_Win_errhandler_function *' + + +@Type.add_type('WIN_ERRHANDLER_FUNCTION', abi_type=['standard']) +class TypeWinErrhandlerFunctionStandard(Type): + # TODO: This may require a special function to wrap the callback + pass + + +@Type.add_type('WIN_COPY_ATTR_FUNCTION', abi_type=['ompi']) +class TypeWinCopyAttrFunction(Type): + + def type_text(self, enable_count=False): + return 'MPI_Win_copy_attr_function *' + + +@Type.add_type('WIN_COPY_ATTR_FUNCTION', abi_type=['standard']) +class TypeWinCopyAttrFunctionStandard(Type): + # TODO: This may require a special function to wrap the callback + pass + + +@Type.add_type('WIN_DELETE_ATTR_FUNCTION', abi_type=['ompi']) +class TypeWinDeleteAttrFunction(Type): + + def type_text(self, enable_count=False): + return 'MPI_Win_delete_attr_function *' + + +@Type.add_type('WIN_DELETE_ATTR_FUNCTION', abi_type=['standard']) +class TypeWinDeleteAttrFunctionStandard(Type): + # TODO: This may require a special function to wrap the callback + pass + + +@Type.add_type('ERRHANDLER', abi_type=['ompi']) +class TypeErrhandler(Type): + + def type_text(self, enable_count=False): + return 'MPI_Errhandler' + + +@Type.add_type('ERRHANDLER', abi_type=['standard']) +class TypeErrhandlerStandard(Type): + + @property + def argument(self): + return f'(MPI_Errhandler) {self.name}' + + def type_text(self, enable_count=False): + return self.mangle_name('MPI_Errhandler') + + +@Type.add_type('ERRHANDLER_OUT', abi_type=['ompi']) +class TypeErrhandlerOut(Type): + + def type_text(self, enable_count=False): + return 'MPI_Errhandler *' + + +@Type.add_type('ERRHANDLER_OUT', abi_type=['standard']) +class TypeErrhandlerOutStandard(Type): + + @property + def argument(self): + return f'(MPI_Errhandler *) {self.name}' + + def type_text(self, enable_count=False): + type_name = self.mangle_name('MPI_Errhandler') + return f'{MPI_Errhandler} *' + + +@Type.add_type('GROUP', abi_type=['ompi']) +class TypeGroup(Type): + + def type_text(self, enable_count=False): + return 'MPI_Group' + + +@Type.add_type('GROUP', abi_type=['standard']) +class TypeGroupStandard(Type): + + @property + def argument(self): + return f'(MPI_Group) {self.name}' + + def type_text(self, enable_count=False): + return self.mangle_name('MPI_Group') + + +@Type.add_type('GROUP_OUT', abi_type=['ompi']) +class TypeGroupOut(Type): + + def type_text(self, enable_count=False): + return 'MPI_Group *' + + +@Type.add_type('GROUP_OUT', abi_type=['standard']) +class TypeGroupOutStandard(Type): + + @property + def final_code(self): + return [f'*{self.name} = {ConvertOMPIToStandard.GROUP}((MPI_Group) *{self.name});'] + + def type_text(self, enable_count=False): + type_name = self.mangle_name('MPI_Group') + return f'{type_name} *' + + @property + def argument(self): + return f'(MPI_Group *) {self.name}' + + +@Type.add_type('SESSION_OUT', abi_type=['ompi']) +class TypeSessionOut(Type): + + def type_text(self, enable_count=False): + return 'MPI_Session *' + + +@Type.add_type('SESSION_OUT', abi_type=['standard']) +class TypeSessionOutStandard(Type): + + # TODO: This will require some conversion code for the ABI + @property + def argument(self): + return f'(MPI_Session *) {self.name}' + + def type_text(self): + type_name = self.mangle_name('MPI_Session') + return f'{type_name} *' + + +@Type.add_type('SESSION', abi_type=['ompi']) +class TypeSession(Type): + + def type_text(self, enable_count=False): + return 'MPI_Session' + + +@Type.add_type('SESSION', abi_type=['standard']) +class TypeSessionStandard(Type): + + # TODO: This will require some conversion code for the ABI + @property + def argument(self): + return f'(MPI_Session) {self.name}' + + def type_text(self, enable_count=False): + return self.mangle_name('MPI_Session') diff --git a/ompi/mpi/bindings/ompi_bindings/consts.py b/ompi/mpi/bindings/ompi_bindings/consts.py new file mode 100644 index 00000000000..48ef249223f --- /dev/null +++ b/ompi/mpi/bindings/ompi_bindings/consts.py @@ -0,0 +1,253 @@ +# Copyright (c) 2024 Triad National Security, LLC. All rights +# reserved. +# +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# +"""Constants used for generating bindings.""" +import re + +FORTRAN_ERROR_NAME = 'ierror' +C_ERROR_NAME = 'ierr' +C_ERROR_TMP_NAME = 'c_ierr' +GENERATED_MESSAGE = 'THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT BY HAND.' + +# +# C and ABI constants +# +# C type: const int +ERROR_CLASSES = [ + 'MPI_SUCCESS', + 'MPI_ERR_BUFFER', + 'MPI_ERR_COUNT', + 'MPI_ERR_TYPE', + 'MPI_ERR_TAG', + 'MPI_ERR_COMM', + 'MPI_ERR_RANK', + 'MPI_ERR_REQUEST', + 'MPI_ERR_ROOT', + 'MPI_ERR_GROUP', + 'MPI_ERR_OP', + 'MPI_ERR_TOPOLOGY', + 'MPI_ERR_DIMS', + 'MPI_ERR_ARG', + 'MPI_ERR_UNKNOWN', + 'MPI_ERR_TRUNCATE', + 'MPI_ERR_OTHER', + 'MPI_ERR_INTERN', + 'MPI_ERR_PENDING', + 'MPI_ERR_IN_STATUS', + 'MPI_ERR_ACCESS', + 'MPI_ERR_AMODE', + 'MPI_ERR_ASSERT', + 'MPI_ERR_BAD_FILE', + 'MPI_ERR_BASE', + 'MPI_ERR_CONVERSION', + 'MPI_ERR_DISP', + 'MPI_ERR_DUP_DATAREP', + 'MPI_ERR_FILE_EXISTS', + 'MPI_ERR_FILE_IN_USE', + 'MPI_ERR_FILE', + 'MPI_ERR_INFO_KEY', + 'MPI_ERR_INFO_NOKEY', + 'MPI_ERR_INFO_VALUE', + 'MPI_ERR_INFO', + 'MPI_ERR_IO', + 'MPI_ERR_KEYVAL', + 'MPI_ERR_LOCKTYPE', + 'MPI_ERR_NAME', + 'MPI_ERR_NO_MEM', + 'MPI_ERR_NOT_SAME', + 'MPI_ERR_NO_SPACE', + 'MPI_ERR_NO_SUCH_FILE', + 'MPI_ERR_PORT', + 'MPI_ERR_PROC_ABORTED', + 'MPI_ERR_QUOTA', + 'MPI_ERR_READ_ONLY', + 'MPI_ERR_RMA_ATTACH', + 'MPI_ERR_RMA_CONFLICT', + 'MPI_ERR_RMA_RANGE', + 'MPI_ERR_RMA_SHARED', + 'MPI_ERR_RMA_SYNC', + 'MPI_ERR_RMA_FLAVOR', + 'MPI_ERR_SERVICE', + 'MPI_ERR_SESSION', + 'MPI_ERR_SIZE', + 'MPI_ERR_SPAWN', + 'MPI_ERR_UNSUPPORTED_DATAREP', + 'MPI_ERR_UNSUPPORTED_OPERATION', + 'MPI_ERR_WIN', + 'MPI_T_ERR_CANNOT_INIT', + 'MPI_T_ERR_NOT_INITIALIZED', + 'MPI_T_ERR_MEMORY', + 'MPI_T_ERR_INVALID', + 'MPI_T_ERR_INVALID_INDEX', + 'MPI_T_ERR_INVALID_ITEM', + 'MPI_T_ERR_INVALID_SESSION', + 'MPI_T_ERR_INVALID_HANDLE', + 'MPI_T_ERR_INVALID_NAME', + 'MPI_T_ERR_OUT_OF_HANDLES', + 'MPI_T_ERR_OUT_OF_SESSIONS', + 'MPI_T_ERR_CVAR_SET_NOT_NOW', + 'MPI_T_ERR_CVAR_SET_NEVER', + 'MPI_T_ERR_PVAR_NO_WRITE', + 'MPI_T_ERR_PVAR_NO_STARTSTOP', + 'MPI_T_ERR_PVAR_NO_ATOMIC', + 'MPI_ERR_LASTCODE', +] + +PREDEFINED_DATATYPES = [ + 'MPI_CHAR', + 'MPI_SHORT', + 'MPI_INT', + 'MPI_LONG', + 'MPI_LONG_LONG_INT', + 'MPI_LONG_LONG', + 'MPI_SIGNED_CHAR', + 'MPI_UNSIGNED_CHAR', + 'MPI_UNSIGNED_SHORT', + 'MPI_UNSIGNED', + 'MPI_UNSIGNED_LONG', + 'MPI_UNSIGNED_LONG_LONG', + 'MPI_FLOAT', + 'MPI_DOUBLE', + 'MPI_LONG_DOUBLE', + 'MPI_WCHAR', + 'MPI_C_BOOL', + 'MPI_INT8_T', + 'MPI_INT16_T', + 'MPI_INT32_T', + 'MPI_INT64_T', + 'MPI_UINT8_T', + 'MPI_UINT16_T', + 'MPI_UINT32_T', + 'MPI_UINT64_T', + 'MPI_AINT', + 'MPI_COUNT', + 'MPI_OFFSET', + 'MPI_C_COMPLEX', + 'MPI_C_FLOAT_COMPLEX', + 'MPI_C_DOUBLE_COMPLEX', + 'MPI_C_LONG_DOUBLE_COMPLEX', + 'MPI_BYTE', + 'MPI_PACKED', + 'MPI_CXX_BOOL', + 'MPI_CXX_FLOAT_COMPLEX', + 'MPI_CXX_DOUBLE_COMPLEX', + 'MPI_CXX_LONG_DOUBLE_COMPLEX', + 'MPI_FLOAT_INT', + 'MPI_DOUBLE_INT', + 'MPI_LONG_INT', + 'MPI_2INT', + 'MPI_SHORT_INT', + 'MPI_LONG_DOUBLE_INT', +] + +# C type: MPI_Comm +RESERVED_COMMUNICATORS = [ + 'MPI_COMM_NULL', + 'MPI_COMM_WORLD', + 'MPI_COMM_SELF', +] + +COMMUNICATOR_SPLIT_TYPES = [ + 'MPI_COMM_TYPE_SHARED', + 'MPI_COMM_TYPE_HW_UNGUIDED', + 'MPI_COMM_TYPE_HW_GUIDED', +] + +RESERVED_WINDOWS = [ + 'MPI_WIN_NULL', +] + +RESERVED_REQUESTS = [ + 'MPI_REQUEST_NULL', +] + +RESERVED_INFOS = [ + 'MPI_INFO_ENV', + 'MPI_INFO_NULL', +] + +RESERVED_FILES = [ + 'MPI_FILE_NULL', +] + +IGNORED_STATUS_HANDLES = [ + 'MPI_STATUSES_IGNORE', + 'MPI_STATUS_IGNORE', +] + +COLLECTIVE_OPERATIONS = [ + 'MPI_MAX', + 'MPI_MIN', + 'MPI_SUM', + 'MPI_PROD', + 'MPI_MAXLOC', + 'MPI_MINLOC', + 'MPI_BAND', + 'MPI_BOR', + 'MPI_BXOR', + 'MPI_LAND', + 'MPI_LOR', + 'MPI_LXOR', + 'MPI_REPLACE', + 'MPI_NO_OP', +] + +VARIOUS_CONSTANTS = { + # Just setting this to the same as ompi ABI for right now, but will need to + # match the standard ABI value when defined + 'MPI_MAX_LIBRARY_VERSION_STRING': 256, + 'MPI_MAX_PROCESSOR_NAME': 256, +} + +# Types + +C_OPAQUE_TYPES = { + 'MPI_Aint': 'intptr_t', + 'MPI_Offset': 'int64_t', + 'MPI_Count': 'size_t', + # The below type needs to be set externally depending on Fortran compiler + 'MPI_Fint': 'int64_t', +} + +C_HANDLES = [ + 'MPI_Comm', + 'MPI_Datatype', + 'MPI_Errhandler', + 'MPI_File', + 'MPI_Group', + 'MPI_Info', + 'MPI_Message', + 'MPI_Op', + 'MPI_Request', + 'MPI_Session', + 'MPI_Win', +] + +class ConvertFuncs: + """Names of conversion functions (between standard ABI and OMPI ABI).""" + + ERROR_CLASS = 'ompi_convert_intern_error_abi_error' + COMM = 'ompi_convert_abi_comm_intern_comm' + DATATYPE = 'ompi_convert_abi_datatype_intern_datatype' + REQUEST = 'ompi_convert_abi_request_intern_request' + STATUS = 'ompi_convert_intern_status_abi_status' + OP = 'ompi_convert_abi_op_intern_op' + WIN = 'ompi_convert_abi_win_intern_win' + INFO = 'ompi_convert_abi_info_intern_info' + FILE = 'ompi_convert_abi_file_intern_file' + + +class ConvertOMPIToStandard: + """Generated function for converting from OMPI to standard ABI.""" + + COMM = 'ompi_convert_comm_ompi_to_standard' + + +# Inline function attributes +INLINE_ATTRS = '__opal_attribute_always_inline__ static inline' diff --git a/ompi/mpi/bindings/ompi_bindings/fortran.py b/ompi/mpi/bindings/ompi_bindings/fortran.py new file mode 100644 index 00000000000..b4a72a9e945 --- /dev/null +++ b/ompi/mpi/bindings/ompi_bindings/fortran.py @@ -0,0 +1,291 @@ +# Copyright (c) 2024 Triad National Security, LLC. All rights +# reserved. +# +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# +"""Fortran binding generation code. + +This takes as input a *.in file containing a list of prototypes for Fortran +subroutines with generic types. Using this file, it can generate the Fortran +subroutines in one file and the C wraping code in another for all prototypes +listed. +""" +from collections import namedtuple +import json +import re +from ompi_bindings import consts, util +from ompi_bindings.fortran_type import FortranType +from ompi_bindings.parser import SourceTemplate + + +class FortranBinding: + """Class for generating the binding for a single function.""" + + def __init__(self, prototype, out, template=None, bigcount=False): + # Generate bigcount interface version + self.bigcount = bigcount + self.fn_name = template.prototype.name + self.out = out + self.template = template + self.parameters = [] + for param in self.template.prototype.params: + self.parameters.append(param.construct(fn_name=self.fn_name, + bigcount=bigcount)) + + def dump(self, *pargs, **kwargs): + """Write to the output file.""" + self.out.dump(*pargs, **kwargs) + + def _fn_name_suffix(self): + """Return a suffix for function names.""" + return '_c' if self.bigcount else '' + + @property + def c_func_name(self): + """Produce the final C func name from base_name.""" + return f'ompi_{self.fn_name}_wrapper_f08{self._fn_name_suffix()}' + + @property + def inner_call(self): + """Produce the name of the function to call in the body of the C code.""" + return f'PMPI_{self.fn_name.capitalize()}{self._fn_name_suffix()}' + + def _use(self): + """Determine the Fortran use-statements needed.""" + use = {} + for param in self.parameters: + for mod, name in param.use(): + if mod not in use: + use[mod] = set() + use[mod].add(name) + return use + + def _use_stmts(self): + """Return a list of required use statments.""" + use = self._use() + stmts = [] + for mod, names in use.items(): + names = ', '.join(names) + stmts.append(f'use :: {mod}, only: {names}') + return stmts + + def _print_fortran_interface(self): + """Output the C subroutine binding for the Fortran code.""" + name = self.c_func_name + self.dump(' interface') + + # Print the subroutine and parameter list, breaking parameters across lines + subroutine_start = f' subroutine {name}(' + params = [param.name for param in self.parameters] + params.append(consts.FORTRAN_ERROR_NAME) + lines = util.break_param_lines_fortran(start=subroutine_start, params=params, end=') &') + for line in lines: + self.dump(line) + self.dump(f' BIND(C, name="{name}")') + + use_stmts = self._use_stmts() + for stmt in use_stmts: + self.dump(f' {stmt}') + self.dump(' implicit none') + for param in self.parameters: + self.dump(f' {param.declare_cbinding_fortran()}') + self.dump(f' INTEGER, INTENT(OUT) :: {consts.FORTRAN_ERROR_NAME}') + self.dump(f' end subroutine {name}') + self.dump(' end interface') + + def _print_fortran_header(self, is_interface=False): + """Print the header, including use stmts, dummy variable decls, etc.. + + This does not include the subroutine line. + """ + # Use statements + use_stmts = self._use_stmts() + for stmt in use_stmts: + self.dump(f' {stmt}') + self.dump(' implicit none') + # Parameters/dummy variable declarations + for param in self.parameters: + if is_interface: + self.dump_lines(param.interface_predeclare()) + self.dump_lines(param.declare()) + # Add the integer error manually + self.dump(f' INTEGER, OPTIONAL, INTENT(OUT) :: {consts.FORTRAN_ERROR_NAME}') + + def _print_fortran_subroutine(self): + """Output the Fortran subroutine line.""" + sub_name = util.fortran_f08_name(self.fn_name, bigcount=self.bigcount) + params = [param.name for param in self.parameters] + params.append(consts.FORTRAN_ERROR_NAME) + lines = util.break_param_lines_fortran(f'subroutine {sub_name}(', params, ')') + for line in lines: + self.dump(line) + + def _print_fortran_subroutine_end(self): + """Output the Fortran end subroutine line.""" + sub_name = util.fortran_f08_name(self.fn_name, bigcount=self.bigcount) + self.dump(f'end subroutine {sub_name}') + + def dump_lines(self, line_text): + for line in line_text.split('\n'): + line = line.rstrip() + if line: + self.dump(f' {line}') + + def print_f_source(self): + """Output the main MPI Fortran subroutine.""" + self._print_fortran_subroutine() + self._print_fortran_header() + + # Temporaries + self.dump(f' INTEGER :: {consts.C_ERROR_TMP_NAME}') + for param in self.parameters: + self.dump_lines(param.declare_tmp()) + + # Interface for call to C function + self.dump() + self._print_fortran_interface() + self.dump() + + # Call into the C function + call_start = f' call {self.c_func_name}(' + params = [param.argument() for param in self.parameters] + params.append(consts.C_ERROR_TMP_NAME) + lines = util.break_param_lines_fortran(start=call_start, params=params, end=')') + for line in lines: + self.dump(line) + + # Convert error type + self.dump(f' if (present({consts.FORTRAN_ERROR_NAME})) {consts.FORTRAN_ERROR_NAME} = {consts.C_ERROR_TMP_NAME}') + + for param in self.parameters: + self.dump_lines(param.post()) + + self._print_fortran_subroutine_end() + + def print_c_source(self): + """Output the C source and function that the Fortran calls into.""" + if self.template is None: + return + parameters = [param.c_parameter() for param in self.parameters] + # Always append the integer error + parameters.append(f'MPI_Fint *{consts.C_ERROR_NAME}') + parameters = ', '.join(parameters) + # Just put the signature here to silence `-Wmissing-prototypes` + c_func = self.c_func_name + self.dump(f'void {c_func}({parameters});') + self.dump(f'void {c_func}({parameters})') + count_type, disp_type = ('MPI_Count', 'MPI_Aint') if self.bigcount else ('int', 'int') + self.template.print_body(c_func, out=self.out, + replacements={'INNER_CALL': self.inner_call, + 'COUNT_TYPE': count_type, + 'DISP_TYPE': disp_type}) + + def print_interface(self): + """Output just the Fortran interface for this binding.""" + self._print_fortran_subroutine() + self._print_fortran_header(is_interface=True) + self._print_fortran_subroutine_end() + + +def print_f_source_header(out): + """Print the fortran f08 file header.""" + out.dump(f'! {consts.GENERATED_MESSAGE}') + out.dump('#include "ompi/mpi/fortran/configure-fortran-output.h"') + + +def print_profiling_rename_macros(templates, out): + """Print macros for renaming functions for the profiling interface. + + Previously hardcoded in mpi-f08-rename.h. + """ + out.dump('#if OMPI_BUILD_MPI_PROFILING') + for template in templates: + name = util.fortran_f08_name(template.prototype.name) + out.dump(f'#define {name} P{name}') + # Check for bigcount version + if util.prototype_has_bigcount(template.prototype): + bigcount_name = util.fortran_f08_name(template.prototype.name, bigcount=True) + out.dump(f'#define {bigcount_name} P{bigcount_name}') + out.dump('#endif /* OMPI_BUILD_MPI_PROFILING */') + + +def print_c_source_header(out): + """Print the header of the C source file.""" + out.dump(f'/* {consts.GENERATED_MESSAGE} */') + out.dump('#include "ompi_config.h"') + out.dump('#include "mpi.h"') + out.dump('#include "ompi/errhandler/errhandler.h"') + out.dump('#include "ompi/mpi/fortran/mpif-h/status-conversion.h"') + out.dump('#include "ompi/mpi/fortran/base/constants.h"') + out.dump('#include "ompi/mpi/fortran/base/fint_2_int.h"') + out.dump('#include "ompi/request/request.h"') + out.dump('#include "ompi/communicator/communicator.h"') + out.dump('#include "ompi/win/win.h"') + out.dump('#include "ompi/file/file.h"') + out.dump('#include "ompi/errhandler/errhandler.h"') + out.dump('#include "ompi/datatype/ompi_datatype.h"') + out.dump('#include "ts.h"') + out.dump('#include "array.h"') + + +def print_binding(prototype, lang, out, bigcount=False, template=None): + """Print the binding with or without bigcount.""" + binding = FortranBinding(prototype, out=out, bigcount=bigcount, template=template) + if lang == 'fortran': + binding.print_f_source() + else: + binding.print_c_source() + + +def load_function_templates(prototype_files): + """Load the templates from a file list.""" + return [ + SourceTemplate.load(fname, type_constructor=FortranType.construct) + for fname in prototype_files + ] + + +def generate_code(args, out): + """Generate binding code based on arguments.""" + templates = load_function_templates(args.prototype_files) + + if args.lang == 'fortran': + print_f_source_header(out) + out.dump() + print_profiling_rename_macros(templates, out) + out.dump() + else: + print_c_source_header(out) + + for template in templates: + out.dump() + print_binding(template.prototype, args.lang, out, template=template) + if util.prototype_has_bigcount(template.prototype): + out.dump() + out.dump('#if OMPI_BIGCOUNT') + print_binding(template.prototype, args.lang, bigcount=True, out=out, template=template) + out.dump('#endif /* OMPI_BIGCOUNT */') + + +def generate_interface(args, out): + """Generate the Fortran interface files.""" + out.dump(f'! {consts.GENERATED_MESSAGE}') + + templates = load_function_templates(args.prototype_files) + for template in templates: + ext_name = util.ext_api_func_name(template.prototype.name) + out.dump(f'interface {ext_name}') + binding = FortranBinding(template.prototype, template=template, out=out) + binding.print_interface() + if util.prototype_has_bigcount(template.prototype): + out.dump() + binding_c = FortranBinding(template.prototype, out=out, template=template, + bigcount=True) + out.dump('#if OMPI_BIGCOUNT') + binding_c.print_interface() + out.dump('#endif /* OMPI_BIGCOUNT */') + out.dump(f'end interface {ext_name}') diff --git a/ompi/mpi/bindings/ompi_bindings/fortran_type.py b/ompi/mpi/bindings/ompi_bindings/fortran_type.py new file mode 100644 index 00000000000..7a841f988ed --- /dev/null +++ b/ompi/mpi/bindings/ompi_bindings/fortran_type.py @@ -0,0 +1,475 @@ +# Copyright (c) 2024 Triad National Security, LLC. All rights +# reserved. +# +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# +"""Fortran types and corresponding template code. + +All types used in the Fortran bindings are defined here as classes that derive +from the FortranType base class. These are used for generating both Fortran and +supporting C code for the mpi_f08 bindings. +""" +from abc import ABC, abstractmethod +from ompi_bindings import consts, util + + +class FortranType(ABC): + + def __init__(self, name, fn_name, bigcount=False, count_param=None, **kwargs): + self.name = name + self.fn_name = fn_name + # Generate the bigcount interface version? + self.bigcount = bigcount + self.count_param = count_param + self.used_counters = 0 + + TYPES = {} + + @classmethod + def add(cls, type_name): + """Decorator for adding types.""" + def wrapper(class_): + cls.TYPES[type_name] = class_ + return class_ + return wrapper + + @classmethod + def get(cls, type_name): + return cls.TYPES[type_name] + + @classmethod + def construct(cls, type_name, **kwargs): + type_ = cls.TYPES[type_name] + return type_(**kwargs) + + @property + def fn_api_name(self): + """Return the MPI API name to be used in error messages, etc..""" + return util.ext_api_func_name(self.fn_name, bigcount=self.bigcount).upper() + + @property + def tmp_name(self): + """Return a temporary name for use in C.""" + return f'c_{self.name}' + + @property + def tmp_name2(self): + """Return a secondary temporary name for use in C.""" + return f'c_{self.name}2' + + def tmp_counter(self): + """Get a temporary counter variable to be used in a loop.""" + name = f'{self.name}_i_{self.used_counters}' + self.used_counters += 1 + return name + + def interface_predeclare(self): + """Return predeclaration code, if required for the interface.""" + return '' + + @abstractmethod + def declare(self): + """Return a declaration for the type.""" + + def declare_tmp(self): + """Declare temporaries on in the subroutine.""" + return '' + + def declare_cbinding_fortran(self): + """Return the C binding declaration as seen from Fortran.""" + return self.declare() + + def argument(self): + """Return the value to pass as an argument.""" + return self.name + + def use(self): + """Return list of (module, name) for a Fortran use-statement.""" + return [] + + def post(self): + """Return post-processing code to be run after the call.""" + return '' + + @abstractmethod + def c_parameter(self): + """Return the parameter expression to be used in the C function.""" + +# +# Definitions of generic types in Fortran and how these can be converted +# to and from C. +# + +@FortranType.add('BUFFER') +class BufferType(FortranType): + def interface_predeclare(self): + return f'!OMPI_F08_IGNORE_TKR_PREDECL {self.name}' + + def declare(self): + return f'OMPI_F08_IGNORE_TKR_TYPE, INTENT(IN) :: {self.name}' + + def c_parameter(self): + # See fortran/use-mpi-f08/base/ts.h; OMPI_CFI_BUFFER is expanded based + # on whether or not the compiler supports TS 29113. + return f'OMPI_CFI_BUFFER *{self.name}' + + +@FortranType.add('BUFFER_ASYNC') +class BufferAsyncType(BufferType): + def declare(self): + return f'OMPI_F08_IGNORE_TKR_TYPE, INTENT(IN) OMPI_ASYNCHRONOUS :: {self.name}' + + +@FortranType.add('BUFFER_OUT') +class BufferOutType(BufferType): + def declare(self): + return f'OMPI_F08_IGNORE_TKR_TYPE :: {self.name}' + + +@FortranType.add('BUFFER_ASYNC_OUT') +class BufferAsyncOutType(BufferType): + def declare(self): + return f'OMPI_F08_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: {self.name}' + + +@FortranType.add('VBUFFER') +class VBufferType(FortranType): + """Variable buffer type, as used by MPI_*v() functions.""" + def declare(self): + return f'OMPI_F08_IGNORE_TKR_TYPE, INTENT(IN) :: {self.name}' + + def c_parameter(self): + return f'OMPI_CFI_BUFFER *{self.name}' + + +@FortranType.add('VBUFFER_OUT') +class VBufferType(FortranType): + """Variable buffer receive type, as used by MPI_*v() functions.""" + def declare(self): + return f'OMPI_F08_IGNORE_TKR_TYPE :: {self.name}' + + def c_parameter(self): + return f'OMPI_CFI_BUFFER *{self.name}' + + +@FortranType.add('WBUFFER') +class WBufferType(FortranType): + """Variable buffer send type, used with MPI_*w() functions.""" + def declare(self): + return f'OMPI_F08_IGNORE_TKR_TYPE, INTENT(IN) :: {self.name}' + + def c_parameter(self): + return f'OMPI_CFI_BUFFER *{self.name}' + + +@FortranType.add('WBUFFER_OUT') +class WBufferType(FortranType): + """Variable buffer receive type, used with MPI_*w() functions.""" + def declare(self): + return f'OMPI_F08_IGNORE_TKR_TYPE :: {self.name}' + + def c_parameter(self): + return f'OMPI_CFI_BUFFER *{self.name}' + + +@FortranType.add('COUNT') +class CountType(FortranType): + def declare(self): + if self.bigcount: + return f'INTEGER(KIND=MPI_COUNT_KIND), INTENT(IN) :: {self.name}' + else: + return f'INTEGER, INTENT(IN) :: {self.name}' + + def use(self): + return [('mpi_f08_types', 'MPI_COUNT_KIND')] + + def c_parameter(self): + type_ = 'MPI_Count' if self.bigcount else 'MPI_Fint' + return f'{type_} *{self.name}' + + +@FortranType.add('DATATYPE') +class DatatypeType(FortranType): + def declare(self): + return f'TYPE(MPI_Datatype), INTENT(IN) :: {self.name}' + + def declare_cbinding_fortran(self): + return f'INTEGER, INTENT(IN) :: {self.name}' + + def argument(self): + return f'{self.name}%MPI_VAL' + + def use(self): + return [('mpi_f08_types', 'MPI_Datatype')] + + def c_parameter(self): + return f'MPI_Fint *{self.name}' + + +@FortranType.add('DATATYPE_ARRAY') +class DatatypeArrayType(FortranType): + def declare(self): + return f'TYPE(MPI_Datatype), INTENT(IN) :: {self.name}(*)' + + def use(self): + return [('mpi_f08_types', 'MPI_Datatype')] + + def c_parameter(self): + return f'MPI_Fint *{self.name}' + + +@FortranType.add('INT') +class IntType(FortranType): + def declare(self): + return f'INTEGER, INTENT(IN) :: {self.name}' + + def c_parameter(self): + return f'MPI_Fint *{self.name}' + + +@FortranType.add('RANK') +class RankType(IntType): + pass + + +@FortranType.add('TAG') +class TagType(IntType): + pass + + +@FortranType.add('INDEX_OUT') +class IndexOutType(IntType): + def declare(self): + return f'INTEGER, INTENT(OUT) :: {self.name}' + + +@FortranType.add('LOGICAL_OUT') +class LogicalOutType(IntType): + """Logical type. + + NOTE: Since the logical type causes difficulties when passed to C code, + this code uses a temporary integer in Fortran to pass to the C code. On + completion the logical type is set based on C's true/false rules. + """ + + def declare(self): + return f'LOGICAL, INTENT(OUT) :: {self.name}' + + def declare_tmp(self): + return f'INTEGER :: {self.tmp_name} = 0' + + def declare_cbinding_fortran(self): + return f'INTEGER, INTENT(OUT) :: {self.name}' + + def argument(self): + return self.tmp_name + + def post(self): + return f'{self.name} = {self.tmp_name} /= 0' + + def c_parameter(self): + return f'MPI_Fint *{self.name}' + + +@FortranType.add('COMM') +class CommType(FortranType): + def declare(self): + return f'TYPE(MPI_Comm), INTENT(IN) :: {self.name}' + + def declare_cbinding_fortran(self): + return f'INTEGER, INTENT(IN) :: {self.name}' + + def argument(self): + return f'{self.name}%MPI_VAL' + + def use(self): + return [('mpi_f08_types', 'MPI_Comm')] + + def c_parameter(self): + return f'MPI_Fint *{self.name}' + + +@FortranType.add('STATUS_OUT') +class StatusType(FortranType): + def declare(self): + return f'TYPE(MPI_Status), INTENT(OUT) :: {self.name}' + + def use(self): + return [('mpi_f08_types', 'MPI_Status')] + + def c_parameter(self): + # TODO: Is this correct? (I've listed it as TYPE(MPI_Status) in the binding) + return f'MPI_Fint *{self.name}' + + +@FortranType.add('REQUEST_OUT') +class RequestType(FortranType): + def declare(self): + return f'TYPE(MPI_Request), INTENT(OUT) :: {self.name}' + + def declare_cbinding_fortran(self): + return f'INTEGER, INTENT(OUT) :: {self.name}' + + def argument(self): + return f'{self.name}%MPI_VAL' + + def use(self): + return [('mpi_f08_types', 'MPI_Request')] + + def c_parameter(self): + return f'MPI_Fint *{self.name}' + + +@FortranType.add('REQUEST_ARRAY') +class RequestArrayType(FortranType): + def declare(self): + return f'TYPE(MPI_Request), INTENT(INOUT) :: {self.name}({self.count_param})' + + def declare_cbinding_fortran(self): + return f'INTEGER, INTENT(INOUT) :: {self.name}({self.count_param})' + + def argument(self): + return f'{self.name}(:)%MPI_VAL' + + def use(self): + return [('mpi_f08_types', 'MPI_Request')] + + def c_parameter(self): + return f'MPI_Fint *{self.name}' + + +@FortranType.add('STATUS_ARRAY') +class StatusArrayType(FortranType): + def declare(self): + return f'TYPE(MPI_Status), INTENT(OUT) :: {self.name}(*)' + + def use(self): + return [('mpi_f08_types', 'MPI_Status')] + + def c_parameter(self): + return f'MPI_Fint *{self.name}' + + +@FortranType.add('INT_ARRAY') +class IntArray(FortranType): + """Integer array as used for MPI_*v() variable length functions.""" + + def declare(self): + return f'INTEGER, INTENT(IN) :: {self.name}(*)' + + def c_parameter(self): + return f'MPI_Fint *{self.name}' + + +@FortranType.add('COUNT_ARRAY') +class CountArray(IntArray): + """Array of MPI_Count or int.""" + + def declare(self): + kind = '(KIND=MPI_COUNT_KIND)' if self.bigcount else '' + return f'INTEGER{kind}, INTENT(IN) :: {self.name}(*)' + + def use(self): + if self.bigcount: + return [('mpi_f08_types', 'MPI_COUNT_KIND')] + return [] + + def c_parameter(self): + count_type = 'MPI_Count' if self.bigcount else 'MPI_Fint' + return f'{count_type} *{self.name}' + + +@FortranType.add('AINT') +class Disp(FortranType): + """MPI_Aint type.""" + + def declare(self): + return f'INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: {self.name}' + + def use(self): + return [('mpi_f08_types', 'MPI_ADDRESS_KIND')] + + def c_parameter(self): + return f'MPI_Aint *{self.name}' + + +@FortranType.add('DISP') +class Disp(FortranType): + """Displacecment type.""" + + def declare(self): + kind = '(KIND=MPI_ADDRESS_KIND)' if self.bigcount else '' + return f'INTEGER{kind}, INTENT(IN) :: {self.name}' + + def use(self): + if self.bigcount: + return [('mpi_f08_types', 'MPI_ADDRESS_KIND')] + return [] + + def c_parameter(self): + count_type = 'MPI_Aint' if self.bigcount else 'MPI_Fint' + return f'{count_type} *{self.name}' + + +@FortranType.add('DISP_ARRAY') +class DispArray(IntArray): + """Array of MPI_Aint or int.""" + + def declare(self): + kind = '(KIND=MPI_ADDRESS_KIND)' if self.bigcount else '' + return f'INTEGER{kind}, INTENT(IN) :: {self.name}(*)' + + def use(self): + if self.bigcount: + return [('mpi_f08_types', 'MPI_ADDRESS_KIND')] + return [] + + def c_parameter(self): + count_type = 'MPI_Aint' if self.bigcount else 'MPI_Fint' + return f'{count_type} *{self.name}' + + +@FortranType.add('OP') +class Op(FortranType): + """MPI_Op type.""" + + def declare(self): + return f'TYPE(MPI_Op), INTENT(IN) :: {self.name}' + + def use(self): + return [('mpi_f08_types', 'MPI_Op')] + + def c_parameter(self): + return f'MPI_Fint *{self.name}' + + +@FortranType.add('WIN') +class Win(FortranType): + """MPI_Win type.""" + + def declare(self): + return f'TYPE(MPI_Win), INTENT(IN) :: {self.name}' + + def use(self): + return [('mpi_f08_types', 'MPI_Win')] + + def c_parameter(self): + return f'MPI_Fint *{self.name}' + + +@FortranType.add('FILE') +class File(FortranType): + """MPI_File type.""" + + def declare(self): + return f'TYPE(MPI_File), INTENT(IN) :: {self.name}' + + def use(self): + return [('mpi_f08_types', 'MPI_File')] + + def c_parameter(self): + return f'MPI_Fint *{self.name}' diff --git a/ompi/mpi/bindings/ompi_bindings/parser.py b/ompi/mpi/bindings/ompi_bindings/parser.py new file mode 100644 index 00000000000..c8ace55e049 --- /dev/null +++ b/ompi/mpi/bindings/ompi_bindings/parser.py @@ -0,0 +1,137 @@ +"""Source parsing code.""" + +class Parameter: + + def __init__(self, text, type_constructor): + """Parse a parameter.""" + # parameter in the form "TYPE NAME" or "TYPE NAME:COUNT_VAR" + type_name, namecount = text.split() + if ':' in namecount: + name, count_param = namecount.split(':') + else: + name, count_param = namecount, None + self.type_name = type_name + self.name = name + self.count_param = count_param + self.type_constructor = type_constructor + + def construct(self, **kwargs): + """Construct the type parameter for the given ABI.""" + return self.type_constructor(type_name=self.type_name, name=self.name, + count_param=self.count_param, **kwargs) + + +class ReturnType: + """Return type wrapper.""" + + def __init__(self, type_name, type_constructor): + self.type_name = type_name + self.type_constructor = type_constructor + + def construct(self, **kwargs): + """Construct the return type for the given ABI.""" + return self.type_constructor(type_name=self.type_name, **kwargs) + + +class Prototype: + """MPI function prototype.""" + + def __init__(self, name, return_type, params): + self.name = name + self.return_type = return_type + self.params = params + + def signature(self, fn_name, enable_count=False, **kwargs): + """Build a signature with the given name and if count is enabled.""" + params = ', '.join(param.construct(**kwargs).parameter(enable_count=enable_count, **kwargs) + for param in self.params) + if not params: + params = 'void' + return_type_text = self.return_type.construct(**kwargs).type_text(enable_count=enable_count) + return f'{return_type_text} {fn_name}({params})' + + +def validate_body(body): + """Validate the body of a template.""" + # Just do a simple bracket balance test to determine the bounds of the + # function body. All lines after the function body should be blank. There + # are cases where this will break, such as if someone puts code all on one + # line. + bracket_balance = 0 + line_count = 0 + for line in body: + line = line.strip() + if bracket_balance == 0 and line_count > 0 and line: + raise util.BindingError('Extra code found in template; only one function body is allowed') + + update = line.count('{') - line.count('}') + bracket_balance += update + if bracket_balance != 0: + line_count += 1 + + if bracket_balance != 0: + raise util.BindingError('Mismatched brackets found in template') + + +class SourceTemplate: + """Source template for a single API function.""" + + def __init__(self, prototype, header, body): + self.prototype = prototype + self.header = header + self.body = body + + @staticmethod + def load(fname, prefix=None, type_constructor=None): + """Load a template file and return the SourceTemplate.""" + if prefix is not None: + fname = os.path.join(prefix, fname) + with open(fname) as fp: + header = [] + prototype = [] + body = [] + + for line in fp: + line = line.rstrip() + if prototype and line.startswith('PROTOTYPE'): + raise util.BindingError('more than one prototype found in template file') + elif ((prototype and not any(')' in s for s in prototype)) + or line.startswith('PROTOTYPE')): + prototype.append(line) + elif prototype: + # Validate bracket balance + body.append(line) + else: + header.append(line) + + if not prototype: + raise RuntimeError('missing prototype') + # Parse the prototype + prototype = ''.join(prototype) + prototype = prototype[len('PROTOTYPE'):] + i = prototype.index('(') + j = prototype.index(')') + return_type, name = prototype[:i].split() + return_type = ReturnType(return_type, type_constructor=type_constructor) + params = [param.strip() for param in prototype[i + 1:j].split(',') if param.strip()] + params = [Parameter(param, type_constructor=type_constructor) for param in params] + prototype = Prototype(name, return_type, params) + # Ensure the body contains only one function + validate_body(body) + return SourceTemplate(prototype, header, body) + + def print_header(self, out): + """Print the source header.""" + for line in self.header: + out.dump(line) + + def print_body(self, func_name, out, replacements=None): + """Print the body.""" + replacements = {} if replacements is None else replacements + for line in self.body: + # FUNC_NAME is used for error messages + line = line.replace('FUNC_NAME', f'"{func_name}"') + # Replace other parts in the body of the form '@KEY_NAME@' + for key, value in replacements.items(): + line = line.replace(f'@{key}@', value) + out.dump(line) diff --git a/ompi/mpi/bindings/ompi_bindings/util.py b/ompi/mpi/bindings/ompi_bindings/util.py new file mode 100644 index 00000000000..85b631df039 --- /dev/null +++ b/ompi/mpi/bindings/ompi_bindings/util.py @@ -0,0 +1,132 @@ +# Copyright (c) 2024 Triad National Security, LLC. All rights +# reserved. +# +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +"""Utility code for OMPI binding generation.""" +import textwrap + + +class OutputFile: + """Output file of script.""" + + def __init__(self, fp): + self.fp = fp + + def dump(self, *pargs, **kwargs): + print(*pargs, **kwargs, file=self.fp) + + +def prepare_text(text): + """Prepare text to be output, removing extra lines and whitespace.""" + text = textwrap.dedent(text) + lines = text.split('\n') + out_lines = [] + new_lines = 0 + for line in lines: + line = line.rstrip() + # Only allow one blank line + if not line: + new_lines += 1 + else: + new_lines = 0 + if new_lines > 1: + continue + out_lines.append(line) + return '\n'.join(line for line in lines if line.strip()) + + +class BindingError(Exception): + """Thrown when a binding error is encountered.""" + + +def validate_allowed_keys(keys, req_keys, type_name, param_name): + """Validate allowed keys for a type, raising an error on failure.""" + missing_keys = [key for key in req_keys if key not in keys] + invalid_keys = [key for key in keys if key not in req_keys] + init_message = f'Param {param_name} with type {type_name}' + if missing_keys and invalid_keys: + raise BindingError(f'{init_message} has missing keys ({missing_keys}) and invalid keys ({invalid_keys})') + elif missing_keys: + raise BindingError(f'{init_message} has missing keys: {missing_keys}') + elif invalid_keys: + raise BindingError(f'{init_message} has invalid keys: {invalid_keys}') + + +def ext_api_func_name(fn_name, bigcount=False): + """Produce the external MPI API function name.""" + suffix = '_c' if bigcount else '' + return f'MPI_{fn_name.capitalize()}{suffix}' + + +def ext_api_func_name_profile(fn_name, bigcount=False): + """Produce the external PMPI API function name.""" + return f'P{ext_api_func_name(fn_name, bigcount)}' + + +def fortran_f08_name(fn_name, bigcount=False): + """Produce the final f08 name from base_name.""" + suffix = '_c' if bigcount else '' + return f'MPI_{fn_name.capitalize()}_f08{suffix}' + + +def break_param_lines_fortran(start, params, end): + """Break paramters for a fortran call onto multiple lines. + + This is often necessary to avoid going over the max line length of 132 + characters. + """ + assert len(params) > 1, 'expected more than one parameter' + indent = len(start) * ' ' + lines = [f'{start}{params[0]},'] + for param in params[1:-1]: + lines.append(f'{indent}{param},') + last_line = f'{indent}{params[-1]}{end}' + max_len = max(len(line) for line in lines) + max_len = max(max_len, len(last_line)) + result_lines = [] + for line in lines: + spaces = (max_len - len(line) + 1) * ' ' + result_lines.append(f'{line}{spaces}&') + result_lines.append(last_line) + return result_lines + + +def indent_lines(lines, tab, start=0): + """Crude pretty-printing function.""" + new_lines = [] + indent_count = start + for line in lines: + # Closing bracket + if '}' in line: + indent_count -= 1 + + prefix = indent_count * tab + new_lines.append(f'{prefix}{line}') + + # Opening bracket + if '{' in line: + indent_count += 1 + return new_lines + + +def mpi_fn_name_from_base_fn_name(name): + """Convert from a base name to the standard 'MPI_*' name.""" + return f'MPI_{name.capitalize()}' + + +def abi_internal_name(extname): + """Convert from the ABI external name to an internal name. + + Used to avoid conflicts with existing MPI names. + """ + return f'{extname}_ABI_INTERNAL' + + +def prototype_has_bigcount(prototype): + """Should this prototype have a bigcount version?""" + return any(param.type_name in ('COUNT', 'COUNT_ARRAY', 'DISP', 'DISP_ARRAY') + for param in prototype.params) diff --git a/ompi/mpi/c/Makefile.am b/ompi/mpi/c/Makefile.am index 8e7487a31a2..9dac0d114ec 100644 --- a/ompi/mpi/c/Makefile.am +++ b/ompi/mpi/c/Makefile.am @@ -34,6 +34,8 @@ # layer, if weak symbols can't be used to alias the MPI_ namespace # into the PMPI_ namespace. +include $(top_srcdir)/Makefile.ompi-rules + noinst_LTLIBRARIES = libmpi_c.la libmpi_c_profile.la if BUILD_MPI_BINDINGS_LAYER noinst_LTLIBRARIES += libmpi_c_noprofile.la @@ -41,6 +43,436 @@ endif headers = bindings.h +# +# Template/prototype source files used for generating MPI functions +# +prototype_sources = \ + abort.c.in \ + add_error_class.c.in \ + add_error_code.c.in \ + add_error_string.c.in \ + allgather.c.in \ + iallgather.c.in \ + allgather_init.c.in \ + allgatherv.c.in \ + iallgatherv.c.in \ + allgatherv_init.c.in \ + alloc_mem.c.in \ + allreduce_init.c.in \ + alltoall.c.in \ + ialltoall.c.in \ + alltoall_init.c.in \ + ialltoallv.c.in \ + alltoallv_init.c.in \ + alltoallv.c.in \ + alltoallw.c.in \ + ialltoallw.c.in \ + alltoallw_init.c.in \ + attr_delete.c.in \ + attr_get.c.in \ + attr_put.c.in \ + barrier.c.in \ + ibarrier.c.in \ + barrier_init.c.in \ + bcast.c.in \ + ibcast.c.in \ + bcast_init.c.in \ + bsend.c.in \ + bsend_init.c.in \ + buffer_attach.c.in \ + buffer_detach.c.in \ + cancel.c.in \ + cart_coords.c.in \ + cart_create.c.in \ + cartdim_get.c.in \ + cart_get.c.in \ + cart_map.c.in \ + cart_rank.c.in \ + cart_shift.c.in \ + cart_sub.c.in \ + close_port.c.in \ + comm_accept.c.in \ + comm_c2f.c.in \ + comm_call_errhandler.c.in \ + comm_connect.c.in \ + comm_delete_attr.c.in \ + comm_disconnect.c.in \ + comm_dup.c.in \ + comm_dup_with_info.c.in \ + comm_idup.c.in \ + comm_idup_with_info.c.in \ + comm_free_keyval.c.in \ + comm_get_attr.c.in \ + send.c.in \ + isend.c.in \ + scan.c.in \ + recv.c.in \ + irecv.c.in \ + waitsome.c.in \ + accumulate.c.in \ + comm_f2c.c.in \ + wtime.c.in \ + file_open.c.in \ + init.c.in \ + finalize.c.in \ + comm_rank.c.in \ + comm_size.c.in \ + waitall.c.in \ + comm_split.c.in \ + comm_split_type.c.in \ + comm_free.c.in \ + finalized.c.in \ + initialized.c.in \ + allreduce.c.in \ + get_library_version.c.in \ + get_processor_name.c.in \ + win_attach.c.in \ + win_c2f.c.in \ + win_call_errhandler.c.in \ + win_complete.c.in \ + win_delete_attr.c.in \ + win_detach.c.in \ + win_fence.c.in \ + win_flush.c.in \ + win_flush_all.c.in \ + win_flush_local.c.in \ + win_flush_local_all.c.in \ + win_free_keyval.c.in \ + ibsend.c.in \ + info_get.c.in \ + info_get_nkeys.c.in \ + info_get_nthkey.c.in \ + info_get_string.c.in \ + info_get_valuelen.c.in \ + info_set.c.in \ + init_thread.c.in \ + iprobe.c.in \ + file_close.c.in \ + file_delete.c.in \ + free_mem.c.in \ + gather.c.in \ + igather.c.in \ + gather_init.c.in \ + gatherv.c.in \ + igatherv.c.in \ + gatherv_init.c.in \ + neighbor_allgather.c.in \ + ineighbor_allgather.c.in \ + neighbor_allgather_init.c.in \ + neighbor_allgatherv.c.in \ + ineighbor_allgatherv.c.in \ + neighbor_allgatherv_init.c.in \ + neighbor_alltoall.c.in \ + ineighbor_alltoall.c.in \ + neighbor_alltoall_init.c.in \ + neighbor_alltoallv.c.in \ + ineighbor_alltoallv.c.in \ + neighbor_alltoallv_init.c.in\ + keyval_free.c.in \ + op_commutative.c.in \ + pack.c.in \ + pack_size.c.in \ + parrived.c.in \ + pready.c.in \ + pready_list.c.in \ + pready_range.c.in \ + probe.c.in \ + file_f2c.c.in \ + file_c2f.c.in \ + file_get_amode.c.in \ + file_get_atomicity.c.in \ + file_get_errhandler.c.in \ + file_get_info.c.in \ + file_get_position.c.in \ + file_get_position_shared.c.in \ + file_get_size.c.in \ + file_get_type_extent.c.in \ + file_iread.c.in \ + file_iread_all.c.in \ + file_iread_all.c.in \ + file_iread_shared.c.in \ + file_iwrite.c.in \ + file_iwrite_all.c.in \ + file_iwrite_shared.c.in \ + comm_compare.c.in \ + comm_create.c.in \ + comm_create_errhandler.c.in \ + comm_create_from_group.c.in \ + comm_create_keyval.c.in \ + comm_get_errhandler.c.in \ + comm_get_info.c.in \ + comm_get_name.c.in \ + comm_get_parent.c.in \ + comm_group.c.in \ + comm_join.c.in \ + comm_remote_group.c.in \ + comm_remote_size.c.in \ + comm_set_attr.c.in \ + comm_set_info.c.in \ + dist_graph_create.c.in \ + dist_graph_create_adjacent.c.in \ + dist_graph_neighbors.c.in \ + dist_graph_neighbors_count.c.in \ + comm_set_errhandler.c.in \ + comm_set_name.c.in \ + comm_spawn.c.in \ + comm_spawn_multiple.c.in \ + comm_spawn_multiple.c.in \ + comm_test_inter.c.in \ + compare_and_swap.c.in \ + dims_create.c.in \ + errhandler_c2f.c.in \ + errhandler_f2c.c.in \ + errhandler_free.c.in \ + error_class.c.in \ + error_string.c.in \ + exscan.c.in \ + iexscan.c.in \ + exscan_init.c.in \ + fetch_and_op.c.in \ + file_call_errhandler.c.in \ + file_create_errhandler.c.in \ + file_get_byte_offset.c.in \ + file_get_group.c.in \ + file_get_view.c.in \ + file_iread_at.c.in \ + file_iread_at_all.c.in \ + file_iwrite_at.c.in \ + file_iwrite_at_all.c.in \ + file_preallocate.c.in \ + file_read_all_begin.c.in \ + file_read_all.c.in \ + file_read_all_end.c.in \ + file_read_at_all_begin.c.in \ + file_read_at_all.c.in \ + file_read_at_all_end.c.in \ + file_read_at.c.in \ + file_read.c.in \ + file_read_ordered_begin.c.in \ + file_read_ordered.c.in \ + file_read_ordered_end.c.in \ + file_read_shared.c.in \ + file_seek.c.in \ + file_seek_shared.c.in \ + file_set_atomicity.c.in \ + file_set_errhandler.c.in \ + file_set_info.c.in \ + file_set_size.c.in \ + file_set_view.c.in \ + file_sync.c.in \ + file_write_all_begin.c.in \ + file_write_all.c.in \ + file_write_all_end.c.in \ + file_write_at_all_begin.c.in \ + file_write_at_all.c.in \ + file_write_at_all_end.c.in \ + file_write_at.c.in \ + file_write.c.in \ + file_write_ordered_begin.c.in \ + file_write_ordered.c.in \ + file_write_ordered_end.c.in \ + file_write_shared.c.in \ + get_address.c.in \ + get_count.c.in \ + get_elements.c.in \ + get_elements_x.c.in \ + get_accumulate.c.in \ + get_version.c.in \ + graph_create.c.in \ + graph_get.c.in \ + graph_map.c.in \ + graph_neighbors_count.c.in \ + graph_neighbors.c.in \ + graphdims_get.c.in \ + grequest_complete.c.in \ + grequest_start.c.in \ + group_c2f.c.in \ + group_f2c.c.in \ + group_compare.c.in \ + group_difference.c.in \ + group_excl.c.in \ + group_free.c.in \ + group_from_session_pset.c.in \ + group_incl.c.in \ + group_intersection.c.in \ + group_range_excl.c.in \ + group_range_incl.c.in \ + group_rank.c.in \ + group_size.c.in \ + group_translate_ranks.c.in \ + group_union.c.in \ + improbe.c.in \ + imrecv.c.in \ + info_c2f.c.in \ + info_create.c.in \ + info_create_env.c.in \ + info_delete.c.in \ + info_dup.c.in \ + info_free.c.in \ + info_f2c.c.in \ + intercomm_create.c.in \ + intercomm_create_from_groups.c.in \ + intercomm_merge.c.in \ + irsend.c.in \ + is_thread_main.c.in \ + isendrecv.c.in \ + isendrecv_replace.c.in \ + issend.c.in \ + lookup_name.c.in \ + message_f2c.c.in \ + message_c2f.c.in \ + mprobe.c.in \ + mrecv.c.in \ + request_c2f.c.in \ + request_f2c.c.in \ + keyval_create.c.in \ + op_create.c.in \ + op_free.c.in \ + pack_external.c.in \ + pack_external_size.c.in \ + precv_init.c.in \ + psend_init.c.in \ + publish_name.c.in \ + query_thread.c.in \ + raccumulate.c.in \ + recv_init.c.in \ + reduce.c.in \ + ireduce.c.in \ + reduce_init.c.in \ + register_datarep.c.in \ + reduce_local.c.in \ + reduce_scatter.c.in \ + ireduce_scatter.c.in \ + reduce_scatter_init.c.in \ + reduce_scatter_block.c.in \ + ireduce_scatter_block.c.in \ + reduce_scatter_block_init.c.in \ + request_free.c.in \ + request_get_status.c.in \ + rget.c.in \ + rget_accumulate.c.in \ + rput.c.in \ + rsend_init.c.in \ + iscan.c.in \ + scan_init.c.in \ + scatter.c.in \ + iscatter.c.in \ + scatter_init.c.in \ + scatterv.c.in \ + iscatterv.c.in \ + scatterv_init.c.in \ + send_init.c.in \ + sendrecv.c.in \ + sendrecv_replace.c.in \ + session_c2f.c.in \ + session_call_errhandler.c.in \ + session_create_errhandler.c.in \ + session_get_errhandler.c.in \ + session_get_info.c.in \ + session_get_num_psets.c.in \ + session_get_nth_pset.c.in \ + session_get_pset_info.c.in \ + session_init.c.in \ + session_finalize.c.in \ + session_f2c.c.in \ + session_set_errhandler.c.in \ + session_set_info.c.in \ + ssend_init.c.in \ + ssend.c.in \ + start.c.in \ + startall.c.in \ + status_c2f.c.in \ + status_c2f08.c.in \ + status_f082c.c.in \ + status_f082f.c.in \ + status_f2c.c.in \ + status_f2f08.c.in \ + status_set_cancelled.c.in \ + status_set_elements.c.in \ + status_set_elements_x.c.in \ + testall.c.in \ + testany.c.in \ + test.c.in \ + test_cancelled.c.in \ + testsome.c.in \ + topo_test.c.in \ + type_c2f.c.in \ + type_commit.c.in \ + type_contiguous.c.in \ + type_create_darray.c.in \ + type_create_f90_complex.c.in \ + type_create_f90_integer.c.in \ + type_create_f90_real.c.in \ + type_create_hvector.c.in \ + type_create_indexed_block.c.in \ + type_create_keyval.c.in \ + type_create_resized.c.in \ + type_create_subarray.c.in \ + type_delete_attr.c.in \ + type_dup.c.in \ + type_f2c.c.in \ + type_free.c.in \ + type_free_keyval.c.in \ + type_get_attr.c.in \ + type_get_contents.c.in \ + type_get_envelope.c.in \ + type_get_extent.c.in \ + type_get_extent_x.c.in \ + type_get_name.c.in \ + type_get_true_extent.c.in \ + type_get_true_extent_x.c.in \ + type_indexed.c.in \ + type_match_size.c.in \ + type_set_attr.c.in \ + type_set_name.c.in \ + type_size.c.in \ + type_size_x.c.in \ + type_vector.c.in \ + unpack_external.c.in \ + unpack.c.in \ + unpublish_name.c.in \ + wait.c.in \ + waitany.c.in \ + get.c.in \ + put.c.in \ + win_allocate.c.in \ + win_allocate_shared.c.in \ + win_create_errhandler.c.in \ + win_create_keyval.c.in \ + win_create.c.in \ + win_create_dynamic.c.in \ + win_free.c.in \ + win_get_attr.c.in \ + win_get_errhandler.c.in \ + win_get_group.c.in \ + win_get_info.c.in \ + win_get_name.c.in \ + win_lock.c.in \ + win_lock_all.c.in \ + win_post.c.in \ + win_set_attr.c.in \ + win_set_errhandler.c.in \ + win_set_info.c.in \ + win_set_name.c.in \ + win_shared_query.c.in \ + win_sync.c.in \ + win_start.c.in \ + win_test.c.in \ + win_unlock.c.in \ + win_unlock_all.c.in \ + win_wait.c.in + +# neighbor_alltoallw.c.in \ +# ineighbor_alltoallw.c.in \ +# neighbor_alltoallw_init.c.in \ +# pcontrol.c.in \ +# type_create_hindexed.c.in \ +# type_create_hindexed_block.c.in \ +# type_create_struct.c.in + +# Include template files in case someone wants to update them +EXTRA_DIST = $(prototype_sources) + # attr_fn.c contains attribute manipulation functions which do not # profiling implications, and so are always built. libmpi_c_la_SOURCES = \ @@ -57,436 +489,437 @@ ompi_HEADERS = $(headers) endif # -# List of all C files that have profile versions +# List of all C files that have profile versions (generated_*.c files were +# generated from prototype_sources above). # interface_profile_sources = \ - abort.c \ - add_error_class.c \ - add_error_code.c \ - add_error_string.c \ - allgather.c \ - iallgather.c \ - allgather_init.c \ - allgatherv.c \ - iallgatherv.c \ - allgatherv_init.c \ - alloc_mem.c \ - allreduce.c \ - iallreduce.c \ - allreduce_init.c \ - alltoall.c \ - ialltoall.c \ - alltoall_init.c \ - alltoallv.c \ - ialltoallv.c \ - alltoallv_init.c \ - alltoallw.c \ - ialltoallw.c \ - alltoallw_init.c \ - attr_delete.c \ - attr_get.c \ - attr_put.c \ - barrier.c \ - ibarrier.c \ - barrier_init.c \ - bcast.c \ - ibcast.c \ - bcast_init.c \ - bsend.c \ - bsend_init.c \ - buffer_attach.c \ - buffer_detach.c \ - cancel.c \ - cart_coords.c \ - cart_create.c \ - cartdim_get.c \ - cart_get.c \ - cart_map.c \ - cart_rank.c \ - cart_shift.c \ - cart_sub.c \ - close_port.c \ - comm_accept.c \ - comm_c2f.c \ - comm_call_errhandler.c \ - comm_compare.c \ - comm_connect.c \ - comm_create.c \ - comm_create_errhandler.c \ - comm_create_from_group.c \ - comm_create_group.c \ - comm_create_keyval.c \ - comm_delete_attr.c \ - comm_disconnect.c \ - comm_dup.c \ - comm_dup_with_info.c \ - comm_idup.c \ - comm_idup_with_info.c \ - comm_f2c.c \ - comm_free.c \ - comm_free_keyval.c \ - comm_get_attr.c \ - comm_get_errhandler.c \ - comm_get_info.c \ - comm_get_name.c \ - comm_get_parent.c \ - comm_group.c \ - comm_join.c \ - comm_rank.c \ - comm_remote_group.c \ - comm_remote_size.c \ - comm_set_attr.c \ - comm_set_info.c \ - dist_graph_create.c \ - dist_graph_create_adjacent.c \ - dist_graph_neighbors.c \ - dist_graph_neighbors_count.c \ - comm_set_errhandler.c \ - comm_set_name.c \ - comm_size.c \ - comm_spawn.c \ - comm_spawn_multiple.c \ - comm_split.c \ - comm_split_type.c \ - comm_test_inter.c \ - compare_and_swap.c \ - dims_create.c \ - errhandler_c2f.c \ - errhandler_f2c.c \ - errhandler_free.c \ - error_class.c \ - error_string.c \ - exscan.c \ - iexscan.c \ - exscan_init.c \ - fetch_and_op.c \ - file_c2f.c \ - file_call_errhandler.c \ - file_close.c \ - file_create_errhandler.c \ - file_delete.c \ - file_f2c.c \ - file_get_amode.c \ - file_get_atomicity.c \ - file_get_byte_offset.c \ - file_get_errhandler.c \ - file_get_group.c \ - file_get_info.c \ - file_get_position.c \ - file_get_position_shared.c \ - file_get_size.c \ - file_get_type_extent.c \ - file_get_view.c \ - file_iread_at.c \ - file_iread_at_all.c \ - file_iread.c \ - file_iread_all.c \ - file_iread_shared.c \ - file_iwrite_at.c \ - file_iwrite_at_all.c \ - file_iwrite.c \ - file_iwrite_all.c \ - file_iwrite_shared.c \ - file_open.c \ - file_preallocate.c \ - file_read_all_begin.c \ - file_read_all.c \ - file_read_all_end.c \ - file_read_at_all_begin.c \ - file_read_at_all.c \ - file_read_at_all_end.c \ - file_read_at.c \ - file_read.c \ - file_read_ordered_begin.c \ - file_read_ordered.c \ - file_read_ordered_end.c \ - file_read_shared.c \ - file_seek.c \ - file_seek_shared.c \ - file_set_atomicity.c \ - file_set_errhandler.c \ - file_set_info.c \ - file_set_size.c \ - file_set_view.c \ - file_sync.c \ - file_write_all_begin.c \ - file_write_all.c \ - file_write_all_end.c \ - file_write_at_all_begin.c \ - file_write_at_all.c \ - file_write_at_all_end.c \ - file_write_at.c \ - file_write.c \ - file_write_ordered_begin.c \ - file_write_ordered.c \ - file_write_ordered_end.c \ - file_write_shared.c \ - finalize.c \ - finalized.c \ - free_mem.c \ - gather.c \ - igather.c \ - gather_init.c \ - gatherv.c \ - igatherv.c \ - gatherv_init.c \ - get_address.c \ - get_count.c \ - get_elements.c \ - get_elements_x.c \ - get_accumulate.c \ - get_library_version.c \ - get_processor_name.c \ - get_version.c \ - graph_create.c \ - graph_get.c \ - graph_map.c \ - graph_neighbors_count.c \ - graph_neighbors.c \ - graphdims_get.c \ - grequest_complete.c \ - grequest_start.c \ - group_c2f.c \ - group_compare.c \ - group_difference.c \ - group_excl.c \ - group_f2c.c \ - group_free.c \ - group_from_session_pset.c \ - group_incl.c \ - group_intersection.c \ - group_range_excl.c \ - group_range_incl.c \ - group_rank.c \ - group_size.c \ - group_translate_ranks.c \ - group_union.c \ - ibsend.c \ - improbe.c \ - imrecv.c \ - info_c2f.c \ - info_create.c \ - info_create_env.c \ - info_delete.c \ - info_dup.c \ - info_f2c.c \ - info_free.c \ - info_get.c \ - info_get_nkeys.c \ - info_get_nthkey.c \ - info_get_string.c \ - info_get_valuelen.c \ - info_set.c \ - init.c \ - init_thread.c \ - initialized.c \ - intercomm_create.c \ - intercomm_create_from_groups.c \ - intercomm_merge.c \ - iprobe.c \ - irecv.c \ - irsend.c \ - is_thread_main.c \ - isend.c \ - isendrecv.c \ - isendrecv_replace.c \ - issend.c \ - lookup_name.c \ - message_f2c.c \ - message_c2f.c \ - mprobe.c \ - mrecv.c \ - neighbor_allgather.c \ - ineighbor_allgather.c \ - neighbor_allgather_init.c \ - neighbor_allgatherv.c \ - ineighbor_allgatherv.c \ - neighbor_allgatherv_init.c \ - neighbor_alltoall.c \ - ineighbor_alltoall.c \ - neighbor_alltoall_init.c \ - neighbor_alltoallv.c \ - ineighbor_alltoallv.c \ - neighbor_alltoallv_init.c \ + generated_abort.c \ + generated_add_error_class.c \ + generated_add_error_code.c \ + generated_add_error_string.c \ + generated_allgather.c \ + generated_iallgather.c \ + generated_allgather_init.c \ + generated_allgatherv.c \ + generated_iallgatherv.c \ + generated_allgatherv_init.c \ + generated_alloc_mem.c \ + generated_allreduce.c \ + generated_iallreduce.c \ + generated_allreduce_init.c \ + generated_alltoall.c \ + generated_ialltoall.c \ + generated_alltoall_init.c \ + generated_alltoallv.c \ + generated_ialltoallv.c \ + generated_alltoallv_init.c \ + generated_alltoallw.c \ + generated_ialltoallw.c \ + generated_alltoallw_init.c \ + generated_attr_delete.c \ + generated_attr_get.c \ + generated_attr_put.c \ + generated_barrier.c \ + generated_ibarrier.c \ + generated_barrier_init.c \ + generated_bcast.c \ + generated_ibcast.c \ + generated_bcast_init.c \ + generated_bsend.c \ + generated_bsend_init.c \ + generated_buffer_attach.c \ + generated_buffer_detach.c \ + generated_cancel.c \ + generated_cart_coords.c \ + generated_cart_create.c \ + generated_cartdim_get.c \ + generated_cart_get.c \ + generated_cart_map.c \ + generated_cart_rank.c \ + generated_cart_shift.c \ + generated_cart_sub.c \ + generated_close_port.c \ + generated_comm_accept.c \ + generated_comm_c2f.c \ + generated_comm_call_errhandler.c \ + generated_comm_compare.c \ + generated_comm_connect.c \ + generated_comm_create.c \ + generated_comm_create_errhandler.c \ + generated_comm_create_from_group.c \ + generated_comm_create_group.c \ + generated_comm_create_keyval.c \ + generated_comm_delete_attr.c \ + generated_comm_disconnect.c \ + generated_comm_dup.c \ + generated_comm_dup_with_info.c \ + generated_comm_idup.c \ + generated_comm_idup_with_info.c \ + generated_comm_f2c.c \ + generated_comm_free.c \ + generated_comm_free_keyval.c \ + generated_comm_get_attr.c \ + generated_comm_get_errhandler.c \ + generated_comm_get_info.c \ + generated_comm_get_name.c \ + generated_comm_get_parent.c \ + generated_comm_group.c \ + generated_comm_join.c \ + generated_comm_rank.c \ + generated_comm_remote_group.c \ + generated_comm_remote_size.c \ + generated_comm_set_attr.c \ + generated_comm_set_info.c \ + generated_dist_graph_create.c \ + generated_dist_graph_create_adjacent.c \ + generated_dist_graph_neighbors.c \ + generated_dist_graph_neighbors_count.c \ + generated_comm_set_errhandler.c \ + generated_comm_set_name.c \ + generated_comm_size.c \ + generated_comm_spawn.c \ + generated_comm_spawn_multiple.c \ + generated_comm_split.c \ + generated_comm_split_type.c \ + generated_comm_test_inter.c \ + generated_compare_and_swap.c \ + generated_dims_create.c \ + generated_errhandler_c2f.c \ + generated_errhandler_f2c.c \ + generated_errhandler_free.c \ + generated_error_class.c \ + generated_error_string.c \ + generated_exscan.c \ + generated_iexscan.c \ + generated_exscan_init.c \ + generated_fetch_and_op.c \ + generated_file_c2f.c \ + generated_file_call_errhandler.c \ + generated_file_close.c \ + generated_file_create_errhandler.c \ + generated_file_delete.c \ + generated_file_f2c.c \ + generated_file_get_amode.c \ + generated_file_get_atomicity.c \ + generated_file_get_byte_offset.c \ + generated_file_get_errhandler.c \ + generated_file_get_group.c \ + generated_file_get_info.c \ + generated_file_get_position.c \ + generated_file_get_position_shared.c \ + generated_file_get_size.c \ + generated_file_get_type_extent.c \ + generated_file_get_view.c \ + generated_file_iread_at.c \ + generated_file_iread_at_all.c \ + generated_file_iread.c \ + generated_file_iread_all.c \ + generated_file_iread_shared.c \ + generated_file_iwrite_at.c \ + generated_file_iwrite_at_all.c \ + generated_file_iwrite.c \ + generated_file_iwrite_all.c \ + generated_file_iwrite_shared.c \ + generated_file_open.c \ + generated_file_preallocate.c \ + generated_file_read_all_begin.c \ + generated_file_read_all.c \ + generated_file_read_all_end.c \ + generated_file_read_at_all_begin.c \ + generated_file_read_at_all.c \ + generated_file_read_at_all_end.c \ + generated_file_read_at.c \ + generated_file_read.c \ + generated_file_read_ordered_begin.c \ + generated_file_read_ordered.c \ + generated_file_read_ordered_end.c \ + generated_file_read_shared.c \ + generated_file_seek.c \ + generated_file_seek_shared.c \ + generated_file_set_atomicity.c \ + generated_file_set_errhandler.c \ + generated_file_set_info.c \ + generated_file_set_size.c \ + generated_file_set_view.c \ + generated_file_sync.c \ + generated_file_write_all_begin.c \ + generated_file_write_all.c \ + generated_file_write_all_end.c \ + generated_file_write_at_all_begin.c \ + generated_file_write_at_all.c \ + generated_file_write_at_all_end.c \ + generated_file_write_at.c \ + generated_file_write.c \ + generated_file_write_ordered_begin.c \ + generated_file_write_ordered.c \ + generated_file_write_ordered_end.c \ + generated_file_write_shared.c \ + generated_finalize.c \ + generated_finalized.c \ + generated_free_mem.c \ + generated_gather.c \ + generated_igather.c \ + generated_gather_init.c \ + generated_gatherv.c \ + generated_igatherv.c \ + generated_gatherv_init.c \ + generated_get_address.c \ + generated_get_count.c \ + generated_get_elements.c \ + generated_get_elements_x.c \ + generated_get_accumulate.c \ + generated_get_library_version.c \ + generated_get_processor_name.c \ + generated_get_version.c \ + generated_graph_create.c \ + generated_graph_get.c \ + generated_graph_map.c \ + generated_graph_neighbors_count.c \ + generated_graph_neighbors.c \ + generated_graphdims_get.c \ + generated_grequest_complete.c \ + generated_grequest_start.c \ + generated_group_c2f.c \ + generated_group_compare.c \ + generated_group_difference.c \ + generated_group_excl.c \ + generated_group_f2c.c \ + generated_group_free.c \ + generated_group_from_session_pset.c \ + generated_group_incl.c \ + generated_group_intersection.c \ + generated_group_range_excl.c \ + generated_group_range_incl.c \ + generated_group_rank.c \ + generated_group_size.c \ + generated_group_translate_ranks.c \ + generated_group_union.c \ + generated_ibsend.c \ + generated_improbe.c \ + generated_imrecv.c \ + generated_info_c2f.c \ + generated_info_create.c \ + generated_info_create_env.c \ + generated_info_delete.c \ + generated_info_dup.c \ + generated_info_f2c.c \ + generated_info_free.c \ + generated_info_get.c \ + generated_info_get_nkeys.c \ + generated_info_get_nthkey.c \ + generated_info_get_string.c \ + generated_info_get_valuelen.c \ + generated_info_set.c \ + generated_init.c \ + generated_init_thread.c \ + generated_initialized.c \ + generated_intercomm_create.c \ + generated_intercomm_create_from_groups.c \ + generated_intercomm_merge.c \ + generated_iprobe.c \ + generated_irecv.c \ + generated_irsend.c \ + generated_is_thread_main.c \ + generated_isend.c \ + generated_isendrecv.c \ + generated_isendrecv_replace.c \ + generated_issend.c \ + generated_lookup_name.c \ + generated_message_f2c.c \ + generated_message_c2f.c \ + generated_mprobe.c \ + generated_mrecv.c \ + generated_neighbor_allgather.c \ + generated_ineighbor_allgather.c \ + generated_neighbor_allgather_init.c \ + generated_neighbor_allgatherv.c \ + generated_ineighbor_allgatherv.c \ + generated_neighbor_allgatherv_init.c \ + generated_neighbor_alltoall.c \ + generated_ineighbor_alltoall.c \ + generated_neighbor_alltoall_init.c \ + generated_neighbor_alltoallv.c \ + generated_ineighbor_alltoallv.c \ + generated_neighbor_alltoallv_init.c \ neighbor_alltoallw.c \ ineighbor_alltoallw.c \ neighbor_alltoallw_init.c \ - keyval_create.c \ - keyval_free.c \ - op_c2f.c \ - op_commutative.c \ - op_create.c \ - op_f2c.c \ - op_free.c \ - open_port.c \ - pack_external.c \ - pack_external_size.c \ - pack.c \ - pack_size.c \ - parrived.c \ + generated_keyval_create.c \ + generated_keyval_free.c \ + generated_op_c2f.c \ + generated_op_commutative.c \ + generated_op_create.c \ + generated_op_f2c.c \ + generated_op_free.c \ + generated_open_port.c \ + generated_pack_external.c \ + generated_pack_external_size.c \ + generated_pack.c \ + generated_pack_size.c \ + generated_parrived.c \ pcontrol.c \ - pready.c \ - pready_list.c \ - pready_range.c \ - precv_init.c \ - probe.c \ - psend_init.c \ - publish_name.c \ - query_thread.c \ - raccumulate.c \ - recv_init.c \ - recv.c \ - reduce.c \ - ireduce.c \ - reduce_init.c \ - register_datarep.c \ - reduce_local.c \ - reduce_scatter.c \ - ireduce_scatter.c \ - reduce_scatter_init.c \ - reduce_scatter_block.c \ - ireduce_scatter_block.c \ - reduce_scatter_block_init.c \ - request_c2f.c \ - request_f2c.c \ - request_free.c \ - request_get_status.c \ - rget.c \ - rget_accumulate.c \ - rput.c \ - rsend_init.c \ - rsend.c \ - scan.c \ - iscan.c \ - scan_init.c \ - scatter.c \ - iscatter.c \ - scatter_init.c \ - scatterv.c \ - iscatterv.c \ - scatterv_init.c \ - send.c \ - send_init.c \ - sendrecv.c \ - sendrecv_replace.c \ - session_c2f.c \ - session_call_errhandler.c \ - session_create_errhandler.c \ - session_get_errhandler.c \ - session_get_info.c \ - session_get_num_psets.c \ - session_get_nth_pset.c \ - session_get_pset_info.c \ - session_init.c \ - session_f2c.c \ - session_finalize.c \ - session_set_errhandler.c \ - session_set_info.c \ - ssend_init.c \ - ssend.c \ - start.c \ - startall.c \ - status_c2f.c \ - status_c2f08.c \ - status_f082c.c \ - status_f082f.c \ - status_f2c.c \ - status_f2f08.c \ - status_set_cancelled.c \ - status_set_elements.c \ - status_set_elements_x.c \ - testall.c \ - testany.c \ - test.c \ - test_cancelled.c \ - testsome.c \ - topo_test.c \ - type_c2f.c \ - type_commit.c \ - type_contiguous.c \ - type_create_darray.c \ - type_create_f90_complex.c \ - type_create_f90_integer.c \ - type_create_f90_real.c \ + generated_pready.c \ + generated_pready_list.c \ + generated_pready_range.c \ + generated_precv_init.c \ + generated_probe.c \ + generated_psend_init.c \ + generated_publish_name.c \ + generated_query_thread.c \ + generated_raccumulate.c \ + generated_recv_init.c \ + generated_recv.c \ + generated_reduce.c \ + generated_ireduce.c \ + generated_reduce_init.c \ + generated_register_datarep.c \ + generated_reduce_local.c \ + generated_reduce_scatter.c \ + generated_ireduce_scatter.c \ + generated_reduce_scatter_init.c \ + generated_reduce_scatter_block.c \ + generated_ireduce_scatter_block.c \ + generated_reduce_scatter_block_init.c \ + generated_request_c2f.c \ + generated_request_f2c.c \ + generated_request_free.c \ + generated_request_get_status.c \ + generated_rget.c \ + generated_rget_accumulate.c \ + generated_rput.c \ + generated_rsend_init.c \ + generated_rsend.c \ + generated_scan.c \ + generated_iscan.c \ + generated_scan_init.c \ + generated_scatter.c \ + generated_iscatter.c \ + generated_scatter_init.c \ + generated_scatterv.c \ + generated_iscatterv.c \ + generated_scatterv_init.c \ + generated_send_init.c \ + generated_sendrecv.c \ + generated_sendrecv_replace.c \ + generated_session_c2f.c \ + generated_session_call_errhandler.c \ + generated_session_create_errhandler.c \ + generated_session_get_errhandler.c \ + generated_session_get_info.c \ + generated_session_get_num_psets.c \ + generated_session_get_nth_pset.c \ + generated_session_get_pset_info.c \ + generated_session_init.c \ + generated_session_f2c.c \ + generated_session_finalize.c \ + generated_session_set_errhandler.c \ + generated_session_set_info.c \ + generated_ssend_init.c \ + generated_ssend.c \ + generated_start.c \ + generated_startall.c \ + generated_status_c2f.c \ + generated_status_c2f08.c \ + generated_status_f082c.c \ + generated_status_f082f.c \ + generated_status_f2c.c \ + generated_status_f2f08.c \ + generated_status_set_cancelled.c \ + generated_status_set_elements.c \ + generated_status_set_elements_x.c \ + generated_testall.c \ + generated_testany.c \ + generated_test.c \ + generated_test_cancelled.c \ + generated_testsome.c \ + generated_topo_test.c \ + generated_type_c2f.c \ + generated_type_commit.c \ + generated_type_contiguous.c \ + generated_type_create_darray.c \ + generated_type_create_f90_complex.c \ + generated_type_create_f90_integer.c \ + generated_type_create_f90_real.c \ type_create_hindexed.c \ - type_create_hvector.c \ - type_create_indexed_block.c \ + generated_type_create_hvector.c \ + generated_type_create_indexed_block.c \ type_create_hindexed_block.c \ - type_create_keyval.c \ - type_create_resized.c \ + generated_type_create_keyval.c \ + generated_type_create_resized.c \ type_create_struct.c \ - type_create_subarray.c \ - type_delete_attr.c \ - type_dup.c \ - type_f2c.c \ - type_free.c \ - type_free_keyval.c \ - type_get_attr.c \ - type_get_contents.c \ - type_get_envelope.c \ - type_get_extent.c \ - type_get_extent_x.c \ - type_get_name.c \ - type_get_true_extent.c \ - type_get_true_extent_x.c \ - type_indexed.c \ - type_match_size.c \ - type_set_attr.c \ - type_set_name.c \ - type_size.c \ - type_size_x.c \ - type_vector.c \ - unpack_external.c \ - unpack.c \ - unpublish_name.c \ - wait.c \ - waitall.c \ - waitany.c \ - waitsome.c \ - wtime.c \ + generated_type_create_subarray.c \ + generated_type_delete_attr.c \ + generated_type_dup.c \ + generated_type_f2c.c \ + generated_type_free.c \ + generated_type_free_keyval.c \ + generated_type_get_attr.c \ + generated_type_get_contents.c \ + generated_type_get_envelope.c \ + generated_type_get_extent.c \ + generated_type_get_extent_x.c \ + generated_type_get_name.c \ + generated_type_get_true_extent.c \ + generated_type_get_true_extent_x.c \ + generated_type_indexed.c \ + generated_type_match_size.c \ + generated_type_set_attr.c \ + generated_type_set_name.c \ + generated_type_size.c \ + generated_type_size_x.c \ + generated_type_vector.c \ + generated_unpack_external.c \ + generated_unpack.c \ + generated_unpublish_name.c \ + generated_wait.c \ + generated_waitall.c \ + generated_waitany.c \ + generated_waitsome.c \ + generated_wtime.c \ wtick.c \ - accumulate.c \ - get.c \ - put.c \ - win_allocate.c \ - win_allocate_shared.c \ - win_attach.c \ - win_c2f.c \ - win_call_errhandler.c \ - win_complete.c \ - win_create_errhandler.c \ - win_create_keyval.c \ - win_create.c \ - win_create_dynamic.c \ - win_delete_attr.c \ - win_detach.c \ + generated_accumulate.c \ + generated_get.c \ + generated_put.c \ + generated_win_allocate.c \ + generated_win_allocate_shared.c \ + generated_win_attach.c \ + generated_win_c2f.c \ + generated_win_call_errhandler.c \ + generated_win_complete.c \ + generated_win_create_errhandler.c \ + generated_win_create_keyval.c \ + generated_win_create.c \ + generated_win_create_dynamic.c \ + generated_win_delete_attr.c \ + generated_win_detach.c \ win_f2c.c \ - win_fence.c \ - win_flush.c \ - win_flush_all.c \ - win_flush_local.c \ - win_flush_local_all.c \ - win_free_keyval.c \ - win_free.c \ - win_get_attr.c \ - win_get_errhandler.c \ - win_get_group.c \ - win_get_info.c \ - win_get_name.c \ - win_lock.c \ - win_lock_all.c \ - win_post.c \ - win_set_attr.c \ - win_set_errhandler.c \ - win_set_info.c \ - win_set_name.c \ - win_shared_query.c \ - win_sync.c \ - win_start.c \ - win_test.c \ - win_unlock.c \ - win_unlock_all.c \ - win_wait.c + generated_win_fence.c \ + generated_win_flush.c \ + generated_win_flush_all.c \ + generated_win_flush_local.c \ + generated_win_flush_local_all.c \ + generated_win_free_keyval.c \ + generated_win_free.c \ + generated_win_get_attr.c \ + generated_win_get_errhandler.c \ + generated_win_get_group.c \ + generated_win_get_info.c \ + generated_win_get_name.c \ + generated_win_lock.c \ + generated_win_lock_all.c \ + generated_win_post.c \ + generated_win_set_attr.c \ + generated_win_set_errhandler.c \ + generated_win_set_info.c \ + generated_win_set_name.c \ + generated_win_shared_query.c \ + generated_win_sync.c \ + generated_win_start.c \ + generated_win_test.c \ + generated_win_unlock.c \ + generated_win_unlock_all.c \ + generated_send.c \ + generated_win_wait.c # The following functions were removed from the MPI standard, but are # retained for ABI compliance reasons. They are listed independently @@ -509,3 +942,19 @@ libmpi_c_profile_la_CPPFLAGS = -DOMPI_BUILD_MPI_PROFILING=1 libmpi_c_noprofile_la_SOURCES = $(interface_profile_sources) libmpi_c_noprofile_la_CPPFLAGS = -DOMPI_BUILD_MPI_PROFILING=0 + +# ABI generation rules +if OMPI_GENERATE_BINDINGS +generated_%.c: %.c.in + $(OMPI_V_GEN) $(PYTHON) $(top_srcdir)/ompi/mpi/bindings/bindings.py \ + --builddir $(abs_top_builddir) \ + --srcdir $(abs_top_srcdir) \ + --output $@ \ + c \ + source \ + ompi \ + $< + +# Delete generated files on maintainer-clean +MAINTAINERCLEANFILES = generated_*.c +endif diff --git a/ompi/mpi/c/abort.c b/ompi/mpi/c/abort.c.in similarity index 88% rename from ompi/mpi/c/abort.c rename to ompi/mpi/c/abort.c.in index 889fe1738b3..af43118d331 100644 --- a/ompi/mpi/c/abort.c +++ b/ompi/mpi/c/abort.c.in @@ -28,17 +28,7 @@ #include "ompi/memchecker.h" #include "ompi/communicator/communicator.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Abort = PMPI_Abort -#endif -#define MPI_Abort PMPI_Abort -#endif - -static const char FUNC_NAME[] = "MPI_Abort"; - - -int MPI_Abort(MPI_Comm comm, int errorcode) +PROTOTYPE ERROR_CLASS abort(COMM comm, INT errorcode) { MEMCHECKER( memchecker_comm(comm); diff --git a/ompi/mpi/c/accumulate.c b/ompi/mpi/c/accumulate.c.in similarity index 92% rename from ompi/mpi/c/accumulate.c rename to ompi/mpi/c/accumulate.c.in index a1e6bf91365..7a6b39bafd6 100644 --- a/ompi/mpi/c/accumulate.c +++ b/ompi/mpi/c/accumulate.c.in @@ -34,18 +34,9 @@ #include "ompi/datatype/ompi_datatype_internal.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Accumulate = PMPI_Accumulate -#endif -#define MPI_Accumulate PMPI_Accumulate -#endif - -static const char FUNC_NAME[] = "MPI_Accumulate"; - -int MPI_Accumulate(const void *origin_addr, int origin_count, MPI_Datatype origin_datatype, - int target_rank, MPI_Aint target_disp, int target_count, - MPI_Datatype target_datatype, MPI_Op op, MPI_Win win) +PROTOTYPE ERROR_CLASS accumulate(BUFFER origin_addr, COUNT origin_count, DATATYPE origin_datatype, + INT target_rank, AINT target_disp, COUNT target_count, + DATATYPE target_datatype, OP op, WIN win) { int rc; ompi_win_t *ompi_win = (ompi_win_t*) win; diff --git a/ompi/mpi/c/add_error_class.c b/ompi/mpi/c/add_error_class.c.in similarity index 89% rename from ompi/mpi/c/add_error_class.c rename to ompi/mpi/c/add_error_class.c.in index f0756e0ad5f..fe83ca7ab35 100644 --- a/ompi/mpi/c/add_error_class.c +++ b/ompi/mpi/c/add_error_class.c.in @@ -28,17 +28,8 @@ #include "ompi/communicator/communicator.h" #include "ompi/attribute/attribute.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Add_error_class = PMPI_Add_error_class -#endif -#define MPI_Add_error_class PMPI_Add_error_class -#endif -static const char FUNC_NAME[] = "MPI_Add_error_class"; - - -int MPI_Add_error_class(int *errorclass) +PROTOTYPE ERROR_CLASS Add_error_class(INT_OUT errorclass) { int err_class; int rc; diff --git a/ompi/mpi/c/add_error_code.c b/ompi/mpi/c/add_error_code.c.in similarity index 90% rename from ompi/mpi/c/add_error_code.c rename to ompi/mpi/c/add_error_code.c.in index 288926e7f38..d89117c0b5a 100644 --- a/ompi/mpi/c/add_error_code.c +++ b/ompi/mpi/c/add_error_code.c.in @@ -28,17 +28,7 @@ #include "ompi/errhandler/errcode.h" #include "ompi/attribute/attribute.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Add_error_code = PMPI_Add_error_code -#endif -#define MPI_Add_error_code PMPI_Add_error_code -#endif - -static const char FUNC_NAME[] = "MPI_Add_error_code"; - - -int MPI_Add_error_code(int errorclass, int *errorcode) +PROTOTYPE ERROR_CLASS Add_error_code(INT errorclass, INT_OUT errorcode) { int code; int rc; diff --git a/ompi/mpi/c/add_error_string.c b/ompi/mpi/c/add_error_string.c.in similarity index 86% rename from ompi/mpi/c/add_error_string.c rename to ompi/mpi/c/add_error_string.c.in index e367745c308..0894bb42372 100644 --- a/ompi/mpi/c/add_error_string.c +++ b/ompi/mpi/c/add_error_string.c.in @@ -28,17 +28,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/errhandler/errcode.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Add_error_string = PMPI_Add_error_string -#endif -#define MPI_Add_error_string PMPI_Add_error_string -#endif -static const char FUNC_NAME[] = "MPI_Add_error_string"; - - -int MPI_Add_error_string(int errorcode, const char *string) +PROTOTYPE ERROR_CLASS Add_error_string(INT errorcode, STRING string) { int rc; diff --git a/ompi/mpi/c/allgather.c b/ompi/mpi/c/allgather.c.in similarity index 92% rename from ompi/mpi/c/allgather.c rename to ompi/mpi/c/allgather.c.in index 5cd9858d8e6..cf3929a6089 100644 --- a/ompi/mpi/c/allgather.c +++ b/ompi/mpi/c/allgather.c.in @@ -35,19 +35,9 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Allgather = PMPI_Allgather -#endif -#define MPI_Allgather PMPI_Allgather -#endif - -static const char FUNC_NAME[] = "MPI_Allgather"; - - -int MPI_Allgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, - MPI_Comm comm) +PROTOTYPE ERROR_CLASS Allgather(BUFFER sendbuf, INT sendcount, DATATYPE sendtype, + BUFFER_OUT recvbuf, INT recvcount, DATATYPE recvtype, + COMM comm) { int err; diff --git a/ompi/mpi/c/allgather_init.c b/ompi/mpi/c/allgather_init.c.in similarity index 89% rename from ompi/mpi/c/allgather_init.c rename to ompi/mpi/c/allgather_init.c.in index d46c2e77d8d..89d2b97e42c 100644 --- a/ompi/mpi/c/allgather_init.c +++ b/ompi/mpi/c/allgather_init.c.in @@ -35,19 +35,9 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Allgather_init = PMPI_Allgather_init -#endif -#define MPI_Allgather_init PMPI_Allgather_init -#endif - -static const char FUNC_NAME[] = "MPI_Allgather_init"; - - -int MPI_Allgather_init(const void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, - MPI_Comm comm, MPI_Info info, MPI_Request *request) +PROTOTYPE ERROR_CLASS Allgather_init(BUFFER sendbuf, INT sendcount, DATATYPE sendtype, + BUFFER_OUT recvbuf, INT recvcount, DATATYPE recvtype, + COMM comm, INFO info, REQUEST_INOUT request) { int err; diff --git a/ompi/mpi/c/allgatherv.c b/ompi/mpi/c/allgatherv.c.in similarity index 93% rename from ompi/mpi/c/allgatherv.c rename to ompi/mpi/c/allgatherv.c.in index 303cc6baeac..6110091aca0 100644 --- a/ompi/mpi/c/allgatherv.c +++ b/ompi/mpi/c/allgatherv.c.in @@ -35,19 +35,10 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Allgatherv = PMPI_Allgatherv -#endif -#define MPI_Allgatherv PMPI_Allgatherv -#endif - -static const char FUNC_NAME[] = "MPI_Allgatherv"; - -int MPI_Allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, const int recvcounts[], - const int displs[], MPI_Datatype recvtype, MPI_Comm comm) +PROTOTYPE ERROR_CLASS Allgatherv(BUFFER sendbuf, COUNT sendcount, DATATYPE sendtype, + BUFFER_OUT recvbuf, COUNT_ARRAY recvcounts, + DISP_ARRAY displs, DATATYPE recvtype, COMM comm) { int i, size, err; ompi_count_array_t recvcounts_desc; diff --git a/ompi/mpi/c/allgatherv_init.c b/ompi/mpi/c/allgatherv_init.c.in similarity index 90% rename from ompi/mpi/c/allgatherv_init.c rename to ompi/mpi/c/allgatherv_init.c.in index 9049d1a7091..c1b3bb179a6 100644 --- a/ompi/mpi/c/allgatherv_init.c +++ b/ompi/mpi/c/allgatherv_init.c.in @@ -35,20 +35,11 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Allgatherv_init = PMPI_Allgatherv_init -#endif -#define MPI_Allgatherv_init PMPI_Allgatherv_init -#endif -static const char FUNC_NAME[] = "MPI_Allgatherv_init"; - - -int MPI_Allgatherv_init(const void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, const int recvcounts[], const int displs[], - MPI_Datatype recvtype, MPI_Comm comm, - MPI_Info info, MPI_Request *request) +PROTOTYPE ERROR_CLASS Allgatherv_init(BUFFER sendbuf, COUNT sendcount, DATATYPE sendtype, + BUFFER_OUT recvbuf, COUNT_ARRAY recvcounts, DISP_ARRAY displs, + DATATYPE recvtype, COMM comm, + INFO info, REQUEST_INOUT request) { int i, size, err; ompi_count_array_t recvcounts_desc; diff --git a/ompi/mpi/c/alloc_mem.c b/ompi/mpi/c/alloc_mem.c.in similarity index 91% rename from ompi/mpi/c/alloc_mem.c rename to ompi/mpi/c/alloc_mem.c.in index 28942fbbbae..549028fdd5d 100644 --- a/ompi/mpi/c/alloc_mem.c +++ b/ompi/mpi/c/alloc_mem.c.in @@ -34,17 +34,7 @@ #include "ompi/info/info.h" #include "opal/mca/mpool/mpool.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Alloc_mem = PMPI_Alloc_mem -#endif -#define MPI_Alloc_mem PMPI_Alloc_mem -#endif - -static const char FUNC_NAME[] = "MPI_Alloc_mem"; - - -int MPI_Alloc_mem(MPI_Aint size, MPI_Info info, void *baseptr) +PROTOTYPE ERROR_CLASS Alloc_mem(AINT size, INFO info, BUFFER_OUT baseptr) { opal_cstring_t *info_str = NULL; const char *mpool_hints = NULL; diff --git a/ompi/mpi/c/allreduce.c b/ompi/mpi/c/allreduce.c.in similarity index 92% rename from ompi/mpi/c/allreduce.c rename to ompi/mpi/c/allreduce.c.in index 9f2c5023cac..7d4e278bfdf 100644 --- a/ompi/mpi/c/allreduce.c +++ b/ompi/mpi/c/allreduce.c.in @@ -34,18 +34,8 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Allreduce = PMPI_Allreduce -#endif -#define MPI_Allreduce PMPI_Allreduce -#endif - -static const char FUNC_NAME[] = "MPI_Allreduce"; - - -int MPI_Allreduce(const void *sendbuf, void *recvbuf, int count, - MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) +PROTOTYPE ERROR_CLASS allreduce(BUFFER sendbuf, BUFFER_OUT recvbuf, COUNT count, + DATATYPE datatype, OP op, COMM comm) { int err; diff --git a/ompi/mpi/c/allreduce_init.c b/ompi/mpi/c/allreduce_init.c.in similarity index 90% rename from ompi/mpi/c/allreduce_init.c rename to ompi/mpi/c/allreduce_init.c.in index 55bc5570093..5b5bc1aa27f 100644 --- a/ompi/mpi/c/allreduce_init.c +++ b/ompi/mpi/c/allreduce_init.c.in @@ -36,19 +36,9 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Allreduce_init = PMPI_Allreduce_init -#endif -#define MPI_Allreduce_init PMPI_Allreduce_init -#endif - -static const char FUNC_NAME[] = "MPI_Allreduce_init"; - - -int MPI_Allreduce_init(const void *sendbuf, void *recvbuf, int count, - MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, - MPI_Info info, MPI_Request *request) +PROTOTYPE ERROR_CLASS Allreduce_init(BUFFER sendbuf, BUFFER_OUT recvbuf, INT count, + DATATYPE datatype, OP op, COMM comm, + INFO info, REQUEST_INOUT request) { int err; diff --git a/ompi/mpi/c/alltoall.c b/ompi/mpi/c/alltoall.c.in similarity index 92% rename from ompi/mpi/c/alltoall.c rename to ompi/mpi/c/alltoall.c.in index 41bf608c890..50034ab3cda 100644 --- a/ompi/mpi/c/alltoall.c +++ b/ompi/mpi/c/alltoall.c.in @@ -36,19 +36,10 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Alltoall = PMPI_Alltoall -#endif -#define MPI_Alltoall PMPI_Alltoall -#endif - -static const char FUNC_NAME[] = "MPI_Alltoall"; - -int MPI_Alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, - MPI_Comm comm) +PROTOTYPE ERROR_CLASS Alltoall(BUFFER sendbuf, INT sendcount, DATATYPE sendtype, + BUFFER_OUT recvbuf, INT recvcount, DATATYPE recvtype, + COMM comm) { int err; size_t recvtype_size; diff --git a/ompi/mpi/c/alltoall_init.c b/ompi/mpi/c/alltoall_init.c.in similarity index 89% rename from ompi/mpi/c/alltoall_init.c rename to ompi/mpi/c/alltoall_init.c.in index 1a47e7b7cbf..9902676658c 100644 --- a/ompi/mpi/c/alltoall_init.c +++ b/ompi/mpi/c/alltoall_init.c.in @@ -35,19 +35,9 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Alltoall_init = PMPI_Alltoall_init -#endif -#define MPI_Alltoall_init PMPI_Alltoall_init -#endif - -static const char FUNC_NAME[] = "MPI_Alltoall_init"; - - -int MPI_Alltoall_init(const void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, - MPI_Comm comm, MPI_Info info, MPI_Request *request) +PROTOTYPE ERROR_CLASS Alltoall_init(BUFFER sendbuf, INT sendcount, DATATYPE sendtype, + BUFFER_OUT recvbuf, INT recvcount, DATATYPE recvtype, + COMM comm, INFO info, REQUEST_INOUT request) { size_t sendtype_size, recvtype_size; int err; diff --git a/ompi/mpi/c/alltoallv.c b/ompi/mpi/c/alltoallv.c.in similarity index 90% rename from ompi/mpi/c/alltoallv.c rename to ompi/mpi/c/alltoallv.c.in index 99c2629b749..a8cf94b384d 100644 --- a/ompi/mpi/c/alltoallv.c +++ b/ompi/mpi/c/alltoallv.c.in @@ -34,25 +34,16 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Alltoallv = PMPI_Alltoallv -#endif -#define MPI_Alltoallv PMPI_Alltoallv -#endif - -static const char FUNC_NAME[] = "MPI_Alltoallv"; - - -int MPI_Alltoallv(const void *sendbuf, const int sendcounts[], - const int sdispls[], MPI_Datatype sendtype, - void *recvbuf, const int recvcounts[], const int rdispls[], - MPI_Datatype recvtype, MPI_Comm comm) +PROTOTYPE ERROR_CLASS alltoallv(BUFFER sendbuf, COUNT_ARRAY sendcounts, + DISP_ARRAY sdispls, DATATYPE sendtype, + BUFFER_OUT recvbuf, COUNT_ARRAY recvcounts, DISP_ARRAY rdispls, + DATATYPE recvtype, COMM comm) { int i, size, err; ompi_count_array_t sendcounts_desc, recvcounts_desc; ompi_disp_array_t sdispls_desc, rdispls_desc; + size = OMPI_COMM_IS_INTER(comm)?ompi_comm_remote_size(comm):ompi_comm_size(comm); SPC_RECORD(OMPI_SPC_ALLTOALLV, 1); MEMCHECKER( @@ -68,7 +59,6 @@ int MPI_Alltoallv(const void *sendbuf, const int sendcounts[], memchecker_comm(comm); - size = OMPI_COMM_IS_INTER(comm)?ompi_comm_remote_size(comm):ompi_comm_size(comm); for ( i = 0; i < size; i++ ) { if (MPI_IN_PLACE != sendbuf) { /* check if send chunks are defined. */ diff --git a/ompi/mpi/c/alltoallv_init.c b/ompi/mpi/c/alltoallv_init.c.in similarity index 90% rename from ompi/mpi/c/alltoallv_init.c rename to ompi/mpi/c/alltoallv_init.c.in index 192097bac96..ae22ddbc08f 100644 --- a/ompi/mpi/c/alltoallv_init.c +++ b/ompi/mpi/c/alltoallv_init.c.in @@ -34,20 +34,10 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Alltoallv_init = PMPI_Alltoallv_init -#endif -#define MPI_Alltoallv_init PMPI_Alltoallv_init -#endif - -static const char FUNC_NAME[] = "MPI_Alltoallv_init"; - - -int MPI_Alltoallv_init(const void *sendbuf, const int sendcounts[], const int sdispls[], - MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], - const int rdispls[], MPI_Datatype recvtype, MPI_Comm comm, - MPI_Info info, MPI_Request *request) +PROTOTYPE ERROR_CLASS Alltoallv_init(BUFFER sendbuf, COUNT_ARRAY sendcounts, DISP_ARRAY sdispls, + DATATYPE sendtype, BUFFER_OUT recvbuf, COUNT_ARRAY recvcounts, + DISP_ARRAY rdispls, DATATYPE recvtype, COMM comm, + INFO info, REQUEST_INOUT request) { int i, size, err; ompi_count_array_t sendcounts_desc, recvcounts_desc; diff --git a/ompi/mpi/c/alltoallw.c b/ompi/mpi/c/alltoallw.c.in similarity index 91% rename from ompi/mpi/c/alltoallw.c rename to ompi/mpi/c/alltoallw.c.in index 3c4e5f12aac..ccfb782c150 100644 --- a/ompi/mpi/c/alltoallw.c +++ b/ompi/mpi/c/alltoallw.c.in @@ -34,20 +34,10 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Alltoallw = PMPI_Alltoallw -#endif -#define MPI_Alltoallw PMPI_Alltoallw -#endif - -static const char FUNC_NAME[] = "MPI_Alltoallw"; - - -int MPI_Alltoallw(const void *sendbuf, const int sendcounts[], - const int sdispls[], const MPI_Datatype sendtypes[], - void *recvbuf, const int recvcounts[], const int rdispls[], - const MPI_Datatype recvtypes[], MPI_Comm comm) +PROTOTYPE ERROR_CLASS alltoallw(BUFFER sendbuf, COUNT_ARRAY sendcounts, + DISP_ARRAY sdispls, DATATYPE_ARRAY sendtypes, + BUFFER_OUT recvbuf, COUNT_ARRAY recvcounts, DISP_ARRAY rdispls, + DATATYPE_ARRAY recvtypes, COMM comm) { int i, size, err; ompi_count_array_t sendcounts_desc, recvcounts_desc; diff --git a/ompi/mpi/c/alltoallw_init.c b/ompi/mpi/c/alltoallw_init.c.in similarity index 90% rename from ompi/mpi/c/alltoallw_init.c rename to ompi/mpi/c/alltoallw_init.c.in index 56c347656a4..1d53bc4af8a 100644 --- a/ompi/mpi/c/alltoallw_init.c +++ b/ompi/mpi/c/alltoallw_init.c.in @@ -34,20 +34,11 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Alltoallw_init = PMPI_Alltoallw_init -#endif -#define MPI_Alltoallw_init PMPI_Alltoallw_init -#endif -static const char FUNC_NAME[] = "MPI_Alltoallw_init"; - - -int MPI_Alltoallw_init(const void *sendbuf, const int sendcounts[], const int sdispls[], - const MPI_Datatype sendtypes[], void *recvbuf, const int recvcounts[], - const int rdispls[], const MPI_Datatype recvtypes[], MPI_Comm comm, - MPI_Info info, MPI_Request *request) +PROTOTYPE ERROR_CLASS Alltoallw_init(BUFFER sendbuf, COUNT_ARRAY sendcounts, DISP_ARRAY sdispls, + DATATYPE_ARRAY sendtypes, BUFFER_OUT recvbuf, COUNT_ARRAY recvcounts, + DISP_ARRAY rdispls, DATATYPE_ARRAY recvtypes, COMM comm, + INFO info, REQUEST_INOUT request) { int i, size, err; ompi_count_array_t sendcounts_desc, recvcounts_desc; diff --git a/ompi/mpi/c/attr_delete.c b/ompi/mpi/c/attr_delete.c.in similarity index 86% rename from ompi/mpi/c/attr_delete.c rename to ompi/mpi/c/attr_delete.c.in index e412b06ea47..b4839e37809 100644 --- a/ompi/mpi/c/attr_delete.c +++ b/ompi/mpi/c/attr_delete.c.in @@ -29,17 +29,7 @@ #include "ompi/attribute/attribute.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Attr_delete = PMPI_Attr_delete -#endif -#define MPI_Attr_delete PMPI_Attr_delete -#endif - -static const char FUNC_NAME[] = "MPI_Attr_delete"; - - -int MPI_Attr_delete(MPI_Comm comm, int keyval) +PROTOTYPE ERROR_CLASS Attr_delete(COMM comm, INT keyval) { int ret; diff --git a/ompi/mpi/c/attr_get.c b/ompi/mpi/c/attr_get.c.in similarity index 86% rename from ompi/mpi/c/attr_get.c rename to ompi/mpi/c/attr_get.c.in index 3adf3f207a5..63584eb2c0a 100644 --- a/ompi/mpi/c/attr_get.c +++ b/ompi/mpi/c/attr_get.c.in @@ -28,16 +28,8 @@ #include "ompi/attribute/attribute.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Attr_get = PMPI_Attr_get -#endif -#define MPI_Attr_get PMPI_Attr_get -#endif -static const char FUNC_NAME[] = "MPI_Attr_get"; - -int MPI_Attr_get(MPI_Comm comm, int keyval, void *attribute_val, int *flag) +PROTOTYPE ERROR_CLASS Attr_get(COMM comm, INT keyval, BUFFER_OUT attribute_val, INT_OUT flag) { int ret; diff --git a/ompi/mpi/c/attr_put.c b/ompi/mpi/c/attr_put.c.in similarity index 86% rename from ompi/mpi/c/attr_put.c rename to ompi/mpi/c/attr_put.c.in index 653b35d309b..199b26d86d3 100644 --- a/ompi/mpi/c/attr_put.c +++ b/ompi/mpi/c/attr_put.c.in @@ -29,16 +29,7 @@ #include "ompi/attribute/attribute.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Attr_put = PMPI_Attr_put -#endif -#define MPI_Attr_put PMPI_Attr_put -#endif - -static const char FUNC_NAME[] = "MPI_Attr_put"; - -int MPI_Attr_put(MPI_Comm comm, int keyval, void *attribute_val) +PROTOTYPE ERROR_CLASS Attr_put(COMM comm, INT keyval, BUFFER_OUT attribute_val) { int ret; diff --git a/ompi/mpi/c/barrier.c b/ompi/mpi/c/barrier.c.in similarity index 91% rename from ompi/mpi/c/barrier.c rename to ompi/mpi/c/barrier.c.in index 35e629b0524..005abe6f4e0 100644 --- a/ompi/mpi/c/barrier.c +++ b/ompi/mpi/c/barrier.c.in @@ -28,17 +28,7 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Barrier = PMPI_Barrier -#endif -#define MPI_Barrier PMPI_Barrier -#endif - -static const char FUNC_NAME[] = "MPI_Barrier"; - - -int MPI_Barrier(MPI_Comm comm) +PROTOTYPE ERROR_CLASS barrier(COMM comm) { int err = MPI_SUCCESS; diff --git a/ompi/mpi/c/barrier_init.c b/ompi/mpi/c/barrier_init.c.in similarity index 86% rename from ompi/mpi/c/barrier_init.c rename to ompi/mpi/c/barrier_init.c.in index fe0a50a383e..4a39aaee8f8 100644 --- a/ompi/mpi/c/barrier_init.c +++ b/ompi/mpi/c/barrier_init.c.in @@ -29,17 +29,8 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Barrier_init = PMPI_Barrier_init -#endif -#define MPI_Barrier_init PMPI_Barrier_init -#endif -static const char FUNC_NAME[] = "MPI_Barrier_init"; - - -int MPI_Barrier_init(MPI_Comm comm, MPI_Info info, MPI_Request *request) +PROTOTYPE ERROR_CLASS Barrier_init(COMM comm, INFO info, REQUEST_INOUT request) { int err = MPI_SUCCESS; diff --git a/ompi/mpi/c/bcast.c b/ompi/mpi/c/bcast.c.in similarity index 93% rename from ompi/mpi/c/bcast.c rename to ompi/mpi/c/bcast.c.in index b3c128215a8..734721fff51 100644 --- a/ompi/mpi/c/bcast.c +++ b/ompi/mpi/c/bcast.c.in @@ -29,18 +29,9 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Bcast = PMPI_Bcast -#endif -#define MPI_Bcast PMPI_Bcast -#endif - -static const char FUNC_NAME[] = "MPI_Bcast"; - -int MPI_Bcast(void *buffer, int count, MPI_Datatype datatype, - int root, MPI_Comm comm) +PROTOTYPE ERROR_CLASS Bcast(BUFFER_OUT buffer, INT count, DATATYPE datatype, + INT root, COMM comm) { int err; diff --git a/ompi/mpi/c/bcast_init.c b/ompi/mpi/c/bcast_init.c.in similarity index 88% rename from ompi/mpi/c/bcast_init.c rename to ompi/mpi/c/bcast_init.c.in index 8a9791be39e..92ea8173a0a 100644 --- a/ompi/mpi/c/bcast_init.c +++ b/ompi/mpi/c/bcast_init.c.in @@ -23,18 +23,9 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Bcast_init = PMPI_Bcast_init -#endif -#define MPI_Bcast_init PMPI_Bcast_init -#endif -static const char FUNC_NAME[] = "MPI_Bcast_init"; - - -int MPI_Bcast_init(void *buffer, int count, MPI_Datatype datatype, - int root, MPI_Comm comm, MPI_Info info, MPI_Request *request) +PROTOTYPE ERROR_CLASS Bcast_init(BUFFER_OUT buffer, INT count, DATATYPE datatype, + INT root, COMM comm, INFO info, REQUEST_INOUT request) { int err; diff --git a/ompi/mpi/c/bsend.c b/ompi/mpi/c/bsend.c.in similarity index 92% rename from ompi/mpi/c/bsend.c rename to ompi/mpi/c/bsend.c.in index 881a16ce9bf..8ff92671536 100644 --- a/ompi/mpi/c/bsend.c +++ b/ompi/mpi/c/bsend.c.in @@ -34,17 +34,8 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Bsend = PMPI_Bsend -#endif -#define MPI_Bsend PMPI_Bsend -#endif - -static const char FUNC_NAME[] = "MPI_Bsend"; - -int MPI_Bsend(const void *buf, int count, MPI_Datatype type, int dest, int tag, MPI_Comm comm) +PROTOTYPE ERROR_CLASS Bsend(BUFFER buf, INT count, DATATYPE type, INT dest, INT tag, COMM comm) { int rc = MPI_SUCCESS; diff --git a/ompi/mpi/c/bsend_init.c b/ompi/mpi/c/bsend_init.c.in similarity index 89% rename from ompi/mpi/c/bsend_init.c rename to ompi/mpi/c/bsend_init.c.in index 48982dc7357..670fadb6662 100644 --- a/ompi/mpi/c/bsend_init.c +++ b/ompi/mpi/c/bsend_init.c.in @@ -34,18 +34,8 @@ #include "ompi/mca/pml/base/pml_base_bsend.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Bsend_init = PMPI_Bsend_init -#endif -#define MPI_Bsend_init PMPI_Bsend_init -#endif - -static const char FUNC_NAME[] = "MPI_Bsend_init"; - - -int MPI_Bsend_init(const void *buf, int count, MPI_Datatype type, - int dest, int tag, MPI_Comm comm, MPI_Request *request) +PROTOTYPE ERROR_CLASS Bsend_init(BUFFER buf, INT count, DATATYPE type, + INT dest, INT tag, COMM comm, REQUEST_INOUT request) { int rc; diff --git a/ompi/mpi/c/buffer_attach.c b/ompi/mpi/c/buffer_attach.c.in similarity index 84% rename from ompi/mpi/c/buffer_attach.c rename to ompi/mpi/c/buffer_attach.c.in index be9a43adad6..382e3cf68d1 100644 --- a/ompi/mpi/c/buffer_attach.c +++ b/ompi/mpi/c/buffer_attach.c.in @@ -27,17 +27,7 @@ #include "ompi/mca/pml/pml.h" #include "ompi/mca/pml/base/pml_base_bsend.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Buffer_attach = PMPI_Buffer_attach -#endif -#define MPI_Buffer_attach PMPI_Buffer_attach -#endif - -static const char FUNC_NAME[] = "MPI_Buffer_attach"; - - -int MPI_Buffer_attach(void *buffer, int size) +PROTOTYPE ERROR_CLASS Buffer_attach(BUFFER_OUT buffer, INT size) { int ret = OMPI_SUCCESS; diff --git a/ompi/mpi/c/buffer_detach.c b/ompi/mpi/c/buffer_detach.c.in similarity index 84% rename from ompi/mpi/c/buffer_detach.c rename to ompi/mpi/c/buffer_detach.c.in index 9c5cd9e60a2..c0a8eb3a162 100644 --- a/ompi/mpi/c/buffer_detach.c +++ b/ompi/mpi/c/buffer_detach.c.in @@ -27,17 +27,7 @@ #include "ompi/mca/pml/pml.h" #include "ompi/mca/pml/base/pml_base_bsend.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Buffer_detach = PMPI_Buffer_detach -#endif -#define MPI_Buffer_detach PMPI_Buffer_detach -#endif - -static const char FUNC_NAME[] = "MPI_Buffer_detach"; - - -int MPI_Buffer_detach(void *buffer, int *size) +PROTOTYPE ERROR_CLASS Buffer_detach(BUFFER_OUT buffer, INT_OUT size) { int ret = OMPI_SUCCESS; diff --git a/ompi/mpi/c/cancel.c b/ompi/mpi/c/cancel.c.in similarity index 89% rename from ompi/mpi/c/cancel.c rename to ompi/mpi/c/cancel.c.in index c0e356d542c..313c547f58e 100644 --- a/ompi/mpi/c/cancel.c +++ b/ompi/mpi/c/cancel.c.in @@ -30,17 +30,7 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Cancel = PMPI_Cancel -#endif -#define MPI_Cancel PMPI_Cancel -#endif - -static const char FUNC_NAME[] = "MPI_Cancel"; - - -int MPI_Cancel(MPI_Request *request) +PROTOTYPE ERROR_CLASS Cancel(REQUEST_INOUT request) { int rc; diff --git a/ompi/mpi/c/cart_coords.c b/ompi/mpi/c/cart_coords.c.in similarity index 90% rename from ompi/mpi/c/cart_coords.c rename to ompi/mpi/c/cart_coords.c.in index fcc6ca105fb..2389b412c00 100644 --- a/ompi/mpi/c/cart_coords.c +++ b/ompi/mpi/c/cart_coords.c.in @@ -31,16 +31,8 @@ #include "ompi/group/group.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Cart_coords = PMPI_Cart_coords -#endif -#define MPI_Cart_coords PMPI_Cart_coords -#endif -static const char FUNC_NAME[] = "MPI_Cart_coords"; - -int MPI_Cart_coords(MPI_Comm comm, int rank, int maxdims, int coords[]) +PROTOTYPE ERROR_CLASS Cart_coords(COMM comm, INT rank, INT maxdims, INT_OUT coords) { int err; diff --git a/ompi/mpi/c/cart_create.c b/ompi/mpi/c/cart_create.c.in similarity index 92% rename from ompi/mpi/c/cart_create.c rename to ompi/mpi/c/cart_create.c.in index 64f18827959..ba4e496d59c 100644 --- a/ompi/mpi/c/cart_create.c +++ b/ompi/mpi/c/cart_create.c.in @@ -32,18 +32,9 @@ #include "ompi/mca/topo/base/base.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Cart_create = PMPI_Cart_create -#endif -#define MPI_Cart_create PMPI_Cart_create -#endif - -static const char FUNC_NAME[] = "MPI_Cart_create"; - -int MPI_Cart_create(MPI_Comm old_comm, int ndims, const int dims[], - const int periods[], int reorder, MPI_Comm *comm_cart) +PROTOTYPE ERROR_CLASS Cart_create(COMM old_comm, INT ndims, COUNT_ARRAY dims, + COUNT_ARRAY periods, INT reorder, COMM_OUT comm_cart) { mca_topo_base_module_t* topo; int err; diff --git a/ompi/mpi/c/cart_get.c b/ompi/mpi/c/cart_get.c.in similarity index 88% rename from ompi/mpi/c/cart_get.c rename to ompi/mpi/c/cart_get.c.in index 93242234d9a..4db4b59c71c 100644 --- a/ompi/mpi/c/cart_get.c +++ b/ompi/mpi/c/cart_get.c.in @@ -30,17 +30,9 @@ #include "ompi/mca/topo/topo.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Cart_get = PMPI_Cart_get -#endif -#define MPI_Cart_get PMPI_Cart_get -#endif -static const char FUNC_NAME[] = "MPI_Cart_get"; - -int MPI_Cart_get(MPI_Comm comm, int maxdims, int dims[], - int periods[], int coords[]) +PROTOTYPE ERROR_CLASS Cart_get(COMM comm, INT maxdims, INT_OUT dims, + INT_OUT periods, INT_OUT coords) { int err; diff --git a/ompi/mpi/c/cart_map.c b/ompi/mpi/c/cart_map.c.in similarity index 89% rename from ompi/mpi/c/cart_map.c rename to ompi/mpi/c/cart_map.c.in index 62bb04909d2..7a42255771b 100644 --- a/ompi/mpi/c/cart_map.c +++ b/ompi/mpi/c/cart_map.c.in @@ -32,18 +32,9 @@ #include "ompi/mca/topo/topo.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Cart_map = PMPI_Cart_map -#endif -#define MPI_Cart_map PMPI_Cart_map -#endif -static const char FUNC_NAME[] = "MPI_Cart_map"; - - -int MPI_Cart_map(MPI_Comm comm, int ndims, const int dims[], - const int periods[], int *newrank) +PROTOTYPE ERROR_CLASS Cart_map(COMM comm, INT ndims, COUNT_ARRAY dims, + COUNT_ARRAY periods, INT_OUT newrank) { int err = MPI_SUCCESS; diff --git a/ompi/mpi/c/cart_rank.c b/ompi/mpi/c/cart_rank.c.in similarity index 92% rename from ompi/mpi/c/cart_rank.c rename to ompi/mpi/c/cart_rank.c.in index 979dbd22434..fc9383c1c92 100644 --- a/ompi/mpi/c/cart_rank.c +++ b/ompi/mpi/c/cart_rank.c.in @@ -32,16 +32,8 @@ #include "ompi/mca/topo/topo.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Cart_rank = PMPI_Cart_rank -#endif -#define MPI_Cart_rank PMPI_Cart_rank -#endif -static const char FUNC_NAME[] = "MPI_Cart_rank"; - -int MPI_Cart_rank(MPI_Comm comm, const int coords[], int *rank) +PROTOTYPE ERROR_CLASS Cart_rank(COMM comm, COUNT_ARRAY coords, INT_OUT rank) { int i, err; diff --git a/ompi/mpi/c/cart_shift.c b/ompi/mpi/c/cart_shift.c.in similarity index 88% rename from ompi/mpi/c/cart_shift.c rename to ompi/mpi/c/cart_shift.c.in index 99d07693114..b30d9519119 100644 --- a/ompi/mpi/c/cart_shift.c +++ b/ompi/mpi/c/cart_shift.c.in @@ -29,18 +29,9 @@ #include "ompi/mca/topo/topo.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Cart_shift = PMPI_Cart_shift -#endif -#define MPI_Cart_shift PMPI_Cart_shift -#endif -static const char FUNC_NAME[] = "MPI_Cart_shift"; - - -int MPI_Cart_shift(MPI_Comm comm, int direction, int disp, - int *rank_source, int *rank_dest) +PROTOTYPE ERROR_CLASS Cart_shift(COMM comm, INT direction, INT disp, + INT_OUT rank_source, INT_OUT rank_dest) { int err; diff --git a/ompi/mpi/c/cart_sub.c b/ompi/mpi/c/cart_sub.c.in similarity index 91% rename from ompi/mpi/c/cart_sub.c rename to ompi/mpi/c/cart_sub.c.in index 9cf0ea9717c..6330aa1f155 100644 --- a/ompi/mpi/c/cart_sub.c +++ b/ompi/mpi/c/cart_sub.c.in @@ -32,17 +32,7 @@ #include "ompi/mca/topo/topo.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Cart_sub = PMPI_Cart_sub -#endif -#define MPI_Cart_sub PMPI_Cart_sub -#endif - -static const char FUNC_NAME[] = "MPI_Cart_sub"; - - -int MPI_Cart_sub(MPI_Comm comm, const int remain_dims[], MPI_Comm *new_comm) +PROTOTYPE ERROR_CLASS Cart_sub(COMM comm, COUNT_ARRAY remain_dims, COMM_OUT new_comm) { int err; diff --git a/ompi/mpi/c/cartdim_get.c b/ompi/mpi/c/cartdim_get.c.in similarity index 89% rename from ompi/mpi/c/cartdim_get.c rename to ompi/mpi/c/cartdim_get.c.in index 17e1fbaead4..8248b7e2518 100644 --- a/ompi/mpi/c/cartdim_get.c +++ b/ompi/mpi/c/cartdim_get.c.in @@ -29,18 +29,8 @@ #include "ompi/mca/topo/topo.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Cartdim_get = PMPI_Cartdim_get -#endif -#define MPI_Cartdim_get PMPI_Cartdim_get -#endif - -static const char FUNC_NAME[] = "MPI_Cartdim_get"; - - -int MPI_Cartdim_get(MPI_Comm comm, int *ndims) +PROTOTYPE ERROR_CLASS Cartdim_get(COMM comm, INT_OUT ndims) { int err; diff --git a/ompi/mpi/c/close_port.c b/ompi/mpi/c/close_port.c.in similarity index 87% rename from ompi/mpi/c/close_port.c rename to ompi/mpi/c/close_port.c.in index 062d2f0ae51..e2b0be09415 100644 --- a/ompi/mpi/c/close_port.c +++ b/ompi/mpi/c/close_port.c.in @@ -31,17 +31,7 @@ #include "ompi/dpm/dpm.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Close_port = PMPI_Close_port -#endif -#define MPI_Close_port PMPI_Close_port -#endif - -static const char FUNC_NAME[] = "MPI_Close_port"; - - -int MPI_Close_port(const char *port_name) +PROTOTYPE ERROR_CLASS Close_port(STRING port_name) { int ret; diff --git a/ompi/mpi/c/comm_accept.c b/ompi/mpi/c/comm_accept.c.in similarity index 92% rename from ompi/mpi/c/comm_accept.c rename to ompi/mpi/c/comm_accept.c.in index 52ceaf3ea36..975ba5cde87 100644 --- a/ompi/mpi/c/comm_accept.c +++ b/ompi/mpi/c/comm_accept.c.in @@ -37,18 +37,9 @@ #include "ompi/dpm/dpm.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Comm_accept = PMPI_Comm_accept -#endif -#define MPI_Comm_accept PMPI_Comm_accept -#endif - -static const char FUNC_NAME[] = "MPI_Comm_accept"; - -int MPI_Comm_accept(const char *port_name, MPI_Info info, int root, - MPI_Comm comm, MPI_Comm *newcomm) +PROTOTYPE ERROR_CLASS Comm_accept(STRING port_name, INFO info, INT root, + COMM comm, COMM_OUT newcomm) { int rank, rc; bool send_first=false; /* we receive first */ diff --git a/ompi/mpi/c/comm_c2f.c b/ompi/mpi/c/comm_c2f.c.in similarity index 89% rename from ompi/mpi/c/comm_c2f.c rename to ompi/mpi/c/comm_c2f.c.in index 794cc3c90f1..e75711996d7 100644 --- a/ompi/mpi/c/comm_c2f.c +++ b/ompi/mpi/c/comm_c2f.c.in @@ -28,17 +28,7 @@ #include "ompi/mpi/fortran/base/fint_2_int.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Comm_c2f = PMPI_Comm_c2f -#endif -#define MPI_Comm_c2f PMPI_Comm_c2f -#endif - -static const char FUNC_NAME[] = "MPI_Comm_c2f"; - - -MPI_Fint MPI_Comm_c2f(MPI_Comm comm) +PROTOTYPE ERROR_CLASS Comm_c2f(COMM comm) { MEMCHECKER( memchecker_comm(comm); diff --git a/ompi/mpi/c/comm_call_errhandler.c b/ompi/mpi/c/comm_call_errhandler.c.in similarity index 83% rename from ompi/mpi/c/comm_call_errhandler.c rename to ompi/mpi/c/comm_call_errhandler.c.in index b9db6285c16..59b383df748 100644 --- a/ompi/mpi/c/comm_call_errhandler.c +++ b/ompi/mpi/c/comm_call_errhandler.c.in @@ -26,18 +26,7 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Comm_call_errhandler = PMPI_Comm_call_errhandler -#endif -#define MPI_Comm_call_errhandler PMPI_Comm_call_errhandler -#endif - - -static const char FUNC_NAME[] = "MPI_Comm_call_errhandler"; - - -int MPI_Comm_call_errhandler(MPI_Comm comm, int errorcode) +PROTOTYPE ERROR_CLASS Comm_call_errhandler(COMM comm, INT errorcode) { MEMCHECKER( memchecker_comm(comm); diff --git a/ompi/mpi/c/comm_compare.c b/ompi/mpi/c/comm_compare.c.in similarity index 86% rename from ompi/mpi/c/comm_compare.c rename to ompi/mpi/c/comm_compare.c.in index 55d4b0d38d1..4015429379e 100644 --- a/ompi/mpi/c/comm_compare.c +++ b/ompi/mpi/c/comm_compare.c.in @@ -27,18 +27,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Comm_compare = PMPI_Comm_compare -#endif -#define MPI_Comm_compare PMPI_Comm_compare -#endif - -static const char FUNC_NAME[] = "MPI_Comm_compare"; - - -int MPI_Comm_compare(MPI_Comm comm1, MPI_Comm comm2, int *result) { - +PROTOTYPE ERROR_CLASS Comm_compare(COMM comm1, COMM comm2, INT_OUT result) +{ int rc; MEMCHECKER( @@ -49,7 +39,8 @@ int MPI_Comm_compare(MPI_Comm comm1, MPI_Comm comm2, int *result) { if ( MPI_PARAM_CHECK ) { OMPI_ERR_INIT_FINALIZE(FUNC_NAME); - if (ompi_comm_invalid(comm1) || ompi_comm_invalid(comm2)) { + if (ompi_comm_invalid(comm1) || ompi_comm_invalid(comm2)) + { return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_COMM, FUNC_NAME); } diff --git a/ompi/mpi/c/comm_connect.c b/ompi/mpi/c/comm_connect.c.in similarity index 92% rename from ompi/mpi/c/comm_connect.c rename to ompi/mpi/c/comm_connect.c.in index dfd4eacc544..93d8231544a 100644 --- a/ompi/mpi/c/comm_connect.c +++ b/ompi/mpi/c/comm_connect.c.in @@ -37,18 +37,9 @@ #include "ompi/dpm/dpm.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Comm_connect = PMPI_Comm_connect -#endif -#define MPI_Comm_connect PMPI_Comm_connect -#endif - -static const char FUNC_NAME[] = "MPI_Comm_connect"; - -int MPI_Comm_connect(const char *port_name, MPI_Info info, int root, - MPI_Comm comm, MPI_Comm *newcomm) +PROTOTYPE ERROR_CLASS Comm_connect(STRING port_name, INFO info, INT root, + COMM comm, COMM_OUT newcomm) { int rank, rc; bool send_first=true; /* yes, we are the active part in this game */ diff --git a/ompi/mpi/c/comm_create.c b/ompi/mpi/c/comm_create.c.in similarity index 89% rename from ompi/mpi/c/comm_create.c rename to ompi/mpi/c/comm_create.c.in index fc29be5b6ee..1d72c10e072 100644 --- a/ompi/mpi/c/comm_create.c +++ b/ompi/mpi/c/comm_create.c.in @@ -28,18 +28,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Comm_create = PMPI_Comm_create -#endif -#define MPI_Comm_create PMPI_Comm_create -#endif - -static const char FUNC_NAME[] = "MPI_Comm_create"; - - -int MPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm *newcomm) { - +PROTOTYPE ERROR_CLASS Comm_create(COMM comm, GROUP group, COMM_OUT newcomm) +{ int rc; MEMCHECKER( diff --git a/ompi/mpi/c/comm_create_errhandler.c b/ompi/mpi/c/comm_create_errhandler.c.in similarity index 83% rename from ompi/mpi/c/comm_create_errhandler.c rename to ompi/mpi/c/comm_create_errhandler.c.in index 9caf0510300..550769b4c28 100644 --- a/ompi/mpi/c/comm_create_errhandler.c +++ b/ompi/mpi/c/comm_create_errhandler.c.in @@ -29,19 +29,8 @@ #include "ompi/communicator/communicator.h" #include "ompi/errhandler/errhandler.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Comm_create_errhandler = PMPI_Comm_create_errhandler -#endif -#define MPI_Comm_create_errhandler PMPI_Comm_create_errhandler -#endif - - -static const char FUNC_NAME[] = "MPI_Comm_create_errhandler"; - - -int MPI_Comm_create_errhandler(MPI_Comm_errhandler_function *function, - MPI_Errhandler *errhandler) +PROTOTYPE ERROR_CLASS Comm_create_errhandler(COMM_ERRHANDLER_FUNCTION function, + ERRHANDLER_OUT errhandler) { int err = MPI_SUCCESS; diff --git a/ompi/mpi/c/comm_create_from_group.c b/ompi/mpi/c/comm_create_from_group.c.in similarity index 87% rename from ompi/mpi/c/comm_create_from_group.c rename to ompi/mpi/c/comm_create_from_group.c.in index e3347b6f72a..9397dde5714 100644 --- a/ompi/mpi/c/comm_create_from_group.c +++ b/ompi/mpi/c/comm_create_from_group.c.in @@ -33,18 +33,10 @@ #include "ompi/mca/pml/pml.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Comm_create_from_group = PMPI_Comm_create_from_group -#endif -#define MPI_Comm_create_from_group PMPI_Comm_create_from_group -#endif -static const char FUNC_NAME[] = "MPI_Comm_create_from_group"; - - -int MPI_Comm_create_from_group (MPI_Group group, const char *tag, MPI_Info info, MPI_Errhandler errhandler, - MPI_Comm *newcomm) { +PROTOTYPE ERROR_CLASS Comm_create_from_group (GROUP group, STRING tag, INFO info, ERRHANDLER errhandler, + COMM_OUT newcomm) +{ int rc; MEMCHECKER( diff --git a/ompi/mpi/c/comm_create_group.c b/ompi/mpi/c/comm_create_group.c.in similarity index 89% rename from ompi/mpi/c/comm_create_group.c rename to ompi/mpi/c/comm_create_group.c.in index 507812df3d8..7246988d7df 100644 --- a/ompi/mpi/c/comm_create_group.c +++ b/ompi/mpi/c/comm_create_group.c.in @@ -31,17 +31,9 @@ #include "ompi/mca/pml/pml.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Comm_create_group = PMPI_Comm_create_group -#endif -#define MPI_Comm_create_group PMPI_Comm_create_group -#endif - -static const char FUNC_NAME[] = "MPI_Comm_create_group"; - -int MPI_Comm_create_group (MPI_Comm comm, MPI_Group group, int tag, MPI_Comm *newcomm) { +PROTOTYPE ERROR_CLASS Comm_create_group (COMM comm, GROUP group, INT tag, COMM_OUT newcomm) +{ int rc; MEMCHECKER( diff --git a/ompi/mpi/c/comm_create_keyval.c b/ompi/mpi/c/comm_create_keyval.c.in similarity index 81% rename from ompi/mpi/c/comm_create_keyval.c rename to ompi/mpi/c/comm_create_keyval.c.in index f47e19731e0..12fd5537d0b 100644 --- a/ompi/mpi/c/comm_create_keyval.c +++ b/ompi/mpi/c/comm_create_keyval.c.in @@ -29,19 +29,9 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/attribute/attribute.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Comm_create_keyval = PMPI_Comm_create_keyval -#endif -#define MPI_Comm_create_keyval PMPI_Comm_create_keyval -#endif - -static const char FUNC_NAME[] = "MPI_Comm_create_keyval"; - - -int MPI_Comm_create_keyval(MPI_Comm_copy_attr_function *comm_copy_attr_fn, - MPI_Comm_delete_attr_function *comm_delete_attr_fn, - int *comm_keyval, void *extra_state) +PROTOTYPE ERROR_CLASS Comm_create_keyval(COMM_COPY_ATTR_FUNCTION comm_copy_attr_fn, + COMM_DELETE_ATTR_FUNCTION comm_delete_attr_fn, + INT_OUT comm_keyval, BUFFER_OUT extra_state) { int ret; ompi_attribute_fn_ptr_union_t copy_fn; diff --git a/ompi/mpi/c/comm_delete_attr.c b/ompi/mpi/c/comm_delete_attr.c.in similarity index 85% rename from ompi/mpi/c/comm_delete_attr.c rename to ompi/mpi/c/comm_delete_attr.c.in index 19a714def7a..b4aed7ab8f6 100644 --- a/ompi/mpi/c/comm_delete_attr.c +++ b/ompi/mpi/c/comm_delete_attr.c.in @@ -28,17 +28,8 @@ #include "ompi/attribute/attribute.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Comm_delete_attr = PMPI_Comm_delete_attr -#endif -#define MPI_Comm_delete_attr PMPI_Comm_delete_attr -#endif -static const char FUNC_NAME[] = "MPI_Comm_delete_attr"; - - -int MPI_Comm_delete_attr(MPI_Comm comm, int comm_keyval) +PROTOTYPE ERROR_CLASS Comm_delete_attr(COMM comm, INT comm_keyval) { int ret; diff --git a/ompi/mpi/c/comm_disconnect.c b/ompi/mpi/c/comm_disconnect.c.in similarity index 88% rename from ompi/mpi/c/comm_disconnect.c rename to ompi/mpi/c/comm_disconnect.c.in index 7d9b1519ba4..eb143682a84 100644 --- a/ompi/mpi/c/comm_disconnect.c +++ b/ompi/mpi/c/comm_disconnect.c.in @@ -27,21 +27,12 @@ #include "ompi/communicator/communicator.h" #include "ompi/errhandler/errhandler.h" #include "ompi/memchecker.h" - -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Comm_disconnect = PMPI_Comm_disconnect -#endif -#define MPI_Comm_disconnect PMPI_Comm_disconnect -#endif - #include "ompi/dpm/dpm.h" -static const char FUNC_NAME[] = "MPI_Comm_disconnect"; -int MPI_Comm_disconnect(MPI_Comm *comm) +PROTOTYPE ERROR_CLASS Comm_disconnect(COMM_OUT comm) { int ret = MPI_SUCCESS; diff --git a/ompi/mpi/c/comm_dup.c b/ompi/mpi/c/comm_dup.c.in similarity index 90% rename from ompi/mpi/c/comm_dup.c rename to ompi/mpi/c/comm_dup.c.in index 5f747e7c7a0..4fbdced2169 100644 --- a/ompi/mpi/c/comm_dup.c +++ b/ompi/mpi/c/comm_dup.c.in @@ -29,16 +29,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Comm_dup = PMPI_Comm_dup -#endif -#define MPI_Comm_dup PMPI_Comm_dup -#endif - -static const char FUNC_NAME[] = "MPI_Comm_dup"; -int MPI_Comm_dup(MPI_Comm comm, MPI_Comm *newcomm) +PROTOTYPE ERROR_CLASS Comm_dup(COMM comm, COMM_OUT newcomm) { int rc=MPI_SUCCESS; diff --git a/ompi/mpi/c/comm_dup_with_info.c b/ompi/mpi/c/comm_dup_with_info.c.in similarity index 89% rename from ompi/mpi/c/comm_dup_with_info.c rename to ompi/mpi/c/comm_dup_with_info.c.in index 9b2df72134a..a8de7dead18 100644 --- a/ompi/mpi/c/comm_dup_with_info.c +++ b/ompi/mpi/c/comm_dup_with_info.c.in @@ -32,16 +32,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Comm_dup_with_info = PMPI_Comm_dup_with_info -#endif -#define MPI_Comm_dup_with_info PMPI_Comm_dup_with_info -#endif - -static const char FUNC_NAME[] = "MPI_Comm_dup_with_info"; -int MPI_Comm_dup_with_info(MPI_Comm comm, MPI_Info info, MPI_Comm *newcomm) +PROTOTYPE ERROR_CLASS Comm_dup_with_info(COMM comm, INFO info, COMM_OUT newcomm) { int rc; diff --git a/ompi/mpi/c/comm_f2c.c b/ompi/mpi/c/comm_f2c.c.in similarity index 88% rename from ompi/mpi/c/comm_f2c.c rename to ompi/mpi/c/comm_f2c.c.in index a0bd6be2acb..0df53a1e2de 100644 --- a/ompi/mpi/c/comm_f2c.c +++ b/ompi/mpi/c/comm_f2c.c.in @@ -28,17 +28,7 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/mpi/fortran/base/fint_2_int.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Comm_f2c = PMPI_Comm_f2c -#endif -#define MPI_Comm_f2c PMPI_Comm_f2c -#endif - -static const char FUNC_NAME[] = "MPI_Comm_f2c"; - - -MPI_Comm MPI_Comm_f2c(MPI_Fint comm) +PROTOTYPE COMM comm_f2c(FINT comm) { int o_index= OMPI_FINT_2_INT(comm); diff --git a/ompi/mpi/c/comm_free.c b/ompi/mpi/c/comm_free.c.in similarity index 88% rename from ompi/mpi/c/comm_free.c rename to ompi/mpi/c/comm_free.c.in index f190011aabd..640865ade41 100644 --- a/ompi/mpi/c/comm_free.c +++ b/ompi/mpi/c/comm_free.c.in @@ -26,17 +26,7 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Comm_free = PMPI_Comm_free -#endif -#define MPI_Comm_free PMPI_Comm_free -#endif - -static const char FUNC_NAME[] = "MPI_Comm_free"; - - -int MPI_Comm_free(MPI_Comm *comm) +PROTOTYPE ERROR_CLASS comm_free(COMM_OUT comm) { int ret; diff --git a/ompi/mpi/c/comm_free_keyval.c b/ompi/mpi/c/comm_free_keyval.c.in similarity index 84% rename from ompi/mpi/c/comm_free_keyval.c rename to ompi/mpi/c/comm_free_keyval.c.in index 7db43297090..ea075964dd5 100644 --- a/ompi/mpi/c/comm_free_keyval.c +++ b/ompi/mpi/c/comm_free_keyval.c.in @@ -26,17 +26,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/attribute/attribute.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Comm_free_keyval = PMPI_Comm_free_keyval -#endif -#define MPI_Comm_free_keyval PMPI_Comm_free_keyval -#endif -static const char FUNC_NAME[] = "MPI_Comm_free_keyval"; - - -int MPI_Comm_free_keyval(int *comm_keyval) +PROTOTYPE ERROR_CLASS Comm_free_keyval(INT_OUT comm_keyval) { int ret; diff --git a/ompi/mpi/c/comm_get_attr.c b/ompi/mpi/c/comm_get_attr.c.in similarity index 86% rename from ompi/mpi/c/comm_get_attr.c rename to ompi/mpi/c/comm_get_attr.c.in index 93091f5511e..7db2bad7d11 100644 --- a/ompi/mpi/c/comm_get_attr.c +++ b/ompi/mpi/c/comm_get_attr.c.in @@ -28,18 +28,9 @@ #include "ompi/attribute/attribute.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Comm_get_attr = PMPI_Comm_get_attr -#endif -#define MPI_Comm_get_attr PMPI_Comm_get_attr -#endif -static const char FUNC_NAME[] = "MPI_Comm_get_attr"; - - -int MPI_Comm_get_attr(MPI_Comm comm, int comm_keyval, - void *attribute_val, int *flag) +PROTOTYPE ERROR_CLASS Comm_get_attr(COMM comm, INT comm_keyval, + BUFFER_OUT attribute_val, INT_OUT flag) { int ret; diff --git a/ompi/mpi/c/comm_get_errhandler.c b/ompi/mpi/c/comm_get_errhandler.c.in similarity index 88% rename from ompi/mpi/c/comm_get_errhandler.c rename to ompi/mpi/c/comm_get_errhandler.c.in index 288476e1e9b..a6434482318 100644 --- a/ompi/mpi/c/comm_get_errhandler.c +++ b/ompi/mpi/c/comm_get_errhandler.c.in @@ -33,18 +33,8 @@ #include "ompi/memchecker.h" #include "ompi/instance/instance.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Comm_get_errhandler = PMPI_Comm_get_errhandler -#endif -#define MPI_Comm_get_errhandler PMPI_Comm_get_errhandler -#endif - -static const char FUNC_NAME[] = "MPI_Comm_get_errhandler"; - - -int MPI_Comm_get_errhandler(MPI_Comm comm, MPI_Errhandler *errhandler) +PROTOTYPE ERROR_CLASS Comm_get_errhandler(COMM comm, ERRHANDLER_OUT errhandler) { int ret = MPI_SUCCESS; diff --git a/ompi/mpi/c/comm_get_info.c b/ompi/mpi/c/comm_get_info.c.in similarity index 85% rename from ompi/mpi/c/comm_get_info.c rename to ompi/mpi/c/comm_get_info.c.in index 28bb8e776d6..aad78cd670f 100644 --- a/ompi/mpi/c/comm_get_info.c +++ b/ompi/mpi/c/comm_get_info.c.in @@ -21,17 +21,7 @@ #include #include -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Comm_get_info = PMPI_Comm_get_info -#endif -#define MPI_Comm_get_info PMPI_Comm_get_info -#endif - -static const char FUNC_NAME[] = "MPI_Comm_get_info"; - - -int MPI_Comm_get_info(MPI_Comm comm, MPI_Info *info_used) +PROTOTYPE ERROR_CLASS Comm_get_info(COMM comm, INFO_OUT info_used) { if (MPI_PARAM_CHECK) { OMPI_ERR_INIT_FINALIZE(FUNC_NAME); diff --git a/ompi/mpi/c/comm_get_name.c b/ompi/mpi/c/comm_get_name.c.in similarity index 89% rename from ompi/mpi/c/comm_get_name.c rename to ompi/mpi/c/comm_get_name.c.in index e635b768505..45ec0dd5f0f 100644 --- a/ompi/mpi/c/comm_get_name.c +++ b/ompi/mpi/c/comm_get_name.c.in @@ -33,17 +33,8 @@ #include "ompi/totalview.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Comm_get_name = PMPI_Comm_get_name -#endif -#define MPI_Comm_get_name PMPI_Comm_get_name -#endif -static const char FUNC_NAME[] = "MPI_Comm_get_name"; - - -int MPI_Comm_get_name(MPI_Comm comm, char *name, int *length) +PROTOTYPE ERROR_CLASS Comm_get_name(COMM comm, STRING_OUT name, INT_OUT length) { MEMCHECKER( memchecker_comm(comm); diff --git a/ompi/mpi/c/comm_get_parent.c b/ompi/mpi/c/comm_get_parent.c.in similarity index 85% rename from ompi/mpi/c/comm_get_parent.c rename to ompi/mpi/c/comm_get_parent.c.in index a6909ef2459..86d960e9938 100644 --- a/ompi/mpi/c/comm_get_parent.c +++ b/ompi/mpi/c/comm_get_parent.c.in @@ -25,17 +25,8 @@ #include "ompi/communicator/communicator.h" #include "ompi/errhandler/errhandler.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Comm_get_parent = PMPI_Comm_get_parent -#endif -#define MPI_Comm_get_parent PMPI_Comm_get_parent -#endif -static const char FUNC_NAME[] = "MPI_Comm_get_parent"; - - -int MPI_Comm_get_parent(MPI_Comm *parent) +PROTOTYPE ERROR_CLASS Comm_get_parent(COMM_OUT parent) { if ( MPI_PARAM_CHECK ) { OMPI_ERR_INIT_FINALIZE(FUNC_NAME); diff --git a/ompi/mpi/c/comm_group.c b/ompi/mpi/c/comm_group.c.in similarity index 87% rename from ompi/mpi/c/comm_group.c rename to ompi/mpi/c/comm_group.c.in index 7a563578dcc..6745e3cd9e2 100644 --- a/ompi/mpi/c/comm_group.c +++ b/ompi/mpi/c/comm_group.c.in @@ -27,17 +27,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Comm_group = PMPI_Comm_group -#endif -#define MPI_Comm_group PMPI_Comm_group -#endif - -static const char FUNC_NAME[] = "MPI_Comm_group"; - - -int MPI_Comm_group(MPI_Comm comm, MPI_Group *group) { +PROTOTYPE ERROR_CLASS Comm_group(COMM comm, GROUP_OUT group) +{ int rc; diff --git a/ompi/mpi/c/comm_idup.c b/ompi/mpi/c/comm_idup.c.in similarity index 87% rename from ompi/mpi/c/comm_idup.c rename to ompi/mpi/c/comm_idup.c.in index 278b9b1706f..b933b014d36 100644 --- a/ompi/mpi/c/comm_idup.c +++ b/ompi/mpi/c/comm_idup.c.in @@ -31,16 +31,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Comm_idup = PMPI_Comm_idup -#endif -#define MPI_Comm_idup PMPI_Comm_idup -#endif -static const char FUNC_NAME[] = "MPI_Comm_idup"; - -int MPI_Comm_idup(MPI_Comm comm, MPI_Comm *newcomm, MPI_Request *request) +PROTOTYPE ERROR_CLASS Comm_idup(COMM comm, COMM_OUT newcomm, REQUEST_INOUT request) { int rc; diff --git a/ompi/mpi/c/comm_idup_with_info.c b/ompi/mpi/c/comm_idup_with_info.c.in similarity index 88% rename from ompi/mpi/c/comm_idup_with_info.c rename to ompi/mpi/c/comm_idup_with_info.c.in index 1abbd35b5a9..b55d736f657 100644 --- a/ompi/mpi/c/comm_idup_with_info.c +++ b/ompi/mpi/c/comm_idup_with_info.c.in @@ -35,16 +35,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Comm_idup_with_info = PMPI_Comm_idup_with_info -#endif -#define MPI_Comm_idup_with_info PMPI_Comm_idup_with_info -#endif - -static const char FUNC_NAME[] = "MPI_Comm_idup_with_info"; -int MPI_Comm_idup_with_info(MPI_Comm comm, MPI_Info info, MPI_Comm *newcomm, MPI_Request *request) +PROTOTYPE ERROR_CLASS Comm_idup_with_info(COMM comm, INFO info, COMM_OUT newcomm, REQUEST_INOUT request) { int rc; diff --git a/ompi/mpi/c/comm_join.c b/ompi/mpi/c/comm_join.c.in similarity index 96% rename from ompi/mpi/c/comm_join.c rename to ompi/mpi/c/comm_join.c.in index 2d84895c29e..a79d925987a 100644 --- a/ompi/mpi/c/comm_join.c +++ b/ompi/mpi/c/comm_join.c.in @@ -47,110 +47,10 @@ #include "ompi/dpm/dpm.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Comm_join = PMPI_Comm_join -#endif -#define MPI_Comm_join PMPI_Comm_join -#endif - -static const char FUNC_NAME[] = "MPI_Comm_join"; static int ompi_socket_send (int fd, char *buf, int len ); static int ompi_socket_recv (int fd, char *buf, int len ); -int MPI_Comm_join(int fd, MPI_Comm *intercomm) -{ - int rc; - uint32_t len, rlen, llen, lrlen; - int send_first=0; - ompi_process_name_t rname, tmp_name; - - ompi_communicator_t *newcomp; - char port_name[MPI_MAX_PORT_NAME]; - - if ( MPI_PARAM_CHECK ) { - OMPI_ERR_INIT_FINALIZE(FUNC_NAME); - - if ( NULL == intercomm ) { - return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_ARG, - FUNC_NAME); - } - } - - if (!ompi_mpi_dynamics_is_enabled(FUNC_NAME)) { - return OMPI_ERRHANDLER_NOHANDLE_INVOKE(OMPI_ERR_NOT_SUPPORTED, - FUNC_NAME); - } - - /* send my process name */ - tmp_name = *OMPI_PROC_MY_NAME; - OMPI_PROCESS_NAME_HTON(tmp_name); - ompi_socket_send(fd, (char*) &tmp_name, sizeof(tmp_name)); - - /* recv the remote name */ - ompi_socket_recv(fd, (char*) &rname, sizeof(rname)); - OMPI_PROCESS_NAME_NTOH(rname); - - /* compare the two to get send_first */ - if (OMPI_PROC_MY_NAME->jobid == rname.jobid) { - if (OMPI_PROC_MY_NAME->vpid < rname.vpid) { - send_first = true; - } else if (OMPI_PROC_MY_NAME->vpid == rname.vpid) { - /* joining to myself is not allowed */ - *intercomm = MPI_COMM_NULL; - return MPI_ERR_INTERN; - } else { - send_first = false; - } - } else if (OMPI_PROC_MY_NAME->jobid < rname.jobid) { - send_first = true; - } - - /* Assumption: socket_send should not block, even if the socket - is not configured to be non-blocking, because the message length are - so short. */ - - /* we will only use the send_first proc's port name, - * so pass it to the recv_first participant */ - if (send_first) { - // The port_name that we get back will be \0-terminated. The - // strlen+\0 will be <= MPI_MAX_PORT_NAME characters. - if (OMPI_SUCCESS != (rc = ompi_dpm_open_port(port_name))) { - goto error; - } - // Send the strlen+1 so that we both send the \0 and the - // receiver receives the \0. - llen = (uint32_t)(strlen(port_name)+1); - len = htonl(llen); - ompi_socket_send( fd, (char *) &len, sizeof(uint32_t)); - ompi_socket_send (fd, port_name, llen); - } else { - ompi_socket_recv (fd, (char *) &rlen, sizeof(uint32_t)); - // The lrlen that we receive will be the strlen+1 (to account - // for \0), and will be <= MPI_MAX_PORT_NAME. - lrlen = ntohl(rlen); - ompi_socket_recv (fd, port_name, lrlen); - } - - /* use the port to connect/accept */ - rc = ompi_dpm_connect_accept (MPI_COMM_SELF, 0, port_name, send_first, &newcomp); - - *intercomm = newcomp; - - error: - if (OPAL_ERR_NOT_SUPPORTED == rc) { - opal_show_help("help-mpi-api.txt", - "MPI function not supported", - true, - FUNC_NAME, - "Underlying runtime environment does not support join functionality"); - } - - OMPI_ERRHANDLER_RETURN (rc, MPI_COMM_SELF, rc, FUNC_NAME); -} - - static int ompi_socket_send (int fd, char *buf, int len ) { int num; @@ -247,3 +147,95 @@ static int ompi_socket_recv (int fd, char *buf, int len ) return ret; } + +PROTOTYPE ERROR_CLASS comm_join(INT fd, COMM_OUT intercomm) +{ + + int rc; + uint32_t len, rlen, llen, lrlen; + int send_first=0; + ompi_process_name_t rname, tmp_name; + + ompi_communicator_t *newcomp; + char port_name[MPI_MAX_PORT_NAME]; + + if ( MPI_PARAM_CHECK ) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + + if ( NULL == intercomm ) { + return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_ARG, + FUNC_NAME); + } + } + + if (!ompi_mpi_dynamics_is_enabled(FUNC_NAME)) { + return OMPI_ERRHANDLER_NOHANDLE_INVOKE(OMPI_ERR_NOT_SUPPORTED, + FUNC_NAME); + } + + /* send my process name */ + tmp_name = *OMPI_PROC_MY_NAME; + OMPI_PROCESS_NAME_HTON(tmp_name); + ompi_socket_send(fd, (char*) &tmp_name, sizeof(tmp_name)); + + /* recv the remote name */ + ompi_socket_recv(fd, (char*) &rname, sizeof(rname)); + OMPI_PROCESS_NAME_NTOH(rname); + + /* compare the two to get send_first */ + if (OMPI_PROC_MY_NAME->jobid == rname.jobid) { + if (OMPI_PROC_MY_NAME->vpid < rname.vpid) { + send_first = true; + } else if (OMPI_PROC_MY_NAME->vpid == rname.vpid) { + /* joining to myself is not allowed */ + *intercomm = MPI_COMM_NULL; + return MPI_ERR_INTERN; + } else { + send_first = false; + } + } else if (OMPI_PROC_MY_NAME->jobid < rname.jobid) { + send_first = true; + } + + /* Assumption: socket_send should not block, even if the socket + is not configured to be non-blocking, because the message length are + so short. */ + + /* we will only use the send_first proc's port name, + * so pass it to the recv_first participant */ + if (send_first) { + // The port_name that we get back will be \0-terminated. The + // strlen+\0 will be <= MPI_MAX_PORT_NAME characters. + if (OMPI_SUCCESS != (rc = ompi_dpm_open_port(port_name))) { + goto error; + } + // Send the strlen+1 so that we both send the \0 and the + // receiver receives the \0. + llen = (uint32_t)(strlen(port_name)+1); + len = htonl(llen); + ompi_socket_send( fd, (char *) &len, sizeof(uint32_t)); + ompi_socket_send (fd, port_name, llen); + } else { + ompi_socket_recv (fd, (char *) &rlen, sizeof(uint32_t)); + // The lrlen that we receive will be the strlen+1 (to account + // for \0), and will be <= MPI_MAX_PORT_NAME. + lrlen = ntohl(rlen); + ompi_socket_recv (fd, port_name, lrlen); + } + + /* use the port to connect/accept */ + rc = ompi_dpm_connect_accept (MPI_COMM_SELF, 0, port_name, send_first, &newcomp); + + *intercomm = newcomp; + + error: + if (OPAL_ERR_NOT_SUPPORTED == rc) { + opal_show_help("help-mpi-api.txt", + "MPI function not supported", + true, + FUNC_NAME, + "Underlying runtime environment does not support join functionality"); + } + + OMPI_ERRHANDLER_RETURN (rc, MPI_COMM_SELF, rc, FUNC_NAME); +} diff --git a/ompi/mpi/c/comm_rank.c b/ompi/mpi/c/comm_rank.c.in similarity index 87% rename from ompi/mpi/c/comm_rank.c rename to ompi/mpi/c/comm_rank.c.in index 8709d71f34d..5959e19422b 100644 --- a/ompi/mpi/c/comm_rank.c +++ b/ompi/mpi/c/comm_rank.c.in @@ -27,17 +27,7 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Comm_rank = PMPI_Comm_rank -#endif -#define MPI_Comm_rank PMPI_Comm_rank -#endif - -static const char FUNC_NAME[] = "MPI_Comm_rank"; - - -int MPI_Comm_rank(MPI_Comm comm, int *rank) +PROTOTYPE ERROR_CLASS comm_rank(COMM comm, INT_OUT rank) { MEMCHECKER( memchecker_comm(comm); diff --git a/ompi/mpi/c/comm_remote_group.c b/ompi/mpi/c/comm_remote_group.c.in similarity index 86% rename from ompi/mpi/c/comm_remote_group.c rename to ompi/mpi/c/comm_remote_group.c.in index 5412d422d0d..f0e3829147f 100644 --- a/ompi/mpi/c/comm_remote_group.c +++ b/ompi/mpi/c/comm_remote_group.c.in @@ -28,18 +28,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Comm_remote_group = PMPI_Comm_remote_group -#endif -#define MPI_Comm_remote_group PMPI_Comm_remote_group -#endif - -static const char FUNC_NAME[] = "MPI_Comm_remote_group"; - - -int MPI_Comm_remote_group(MPI_Comm comm, MPI_Group *group) +PROTOTYPE ERROR_CLASS Comm_remote_group(COMM comm, GROUP_OUT group) { MEMCHECKER( memchecker_comm(comm); diff --git a/ompi/mpi/c/comm_remote_size.c b/ompi/mpi/c/comm_remote_size.c.in similarity index 85% rename from ompi/mpi/c/comm_remote_size.c rename to ompi/mpi/c/comm_remote_size.c.in index e02cb6d4790..f1ffa8640b6 100644 --- a/ompi/mpi/c/comm_remote_size.c +++ b/ompi/mpi/c/comm_remote_size.c.in @@ -27,18 +27,9 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Comm_remote_size = PMPI_Comm_remote_size -#endif -#define MPI_Comm_remote_size PMPI_Comm_remote_size -#endif - -static const char FUNC_NAME[] = "MPI_Comm_remote_size"; - - -int MPI_Comm_remote_size(MPI_Comm comm, int *size) { +PROTOTYPE ERROR_CLASS Comm_remote_size(COMM comm, INT_OUT size) +{ MEMCHECKER( memchecker_comm(comm); ); diff --git a/ompi/mpi/c/comm_set_attr.c b/ompi/mpi/c/comm_set_attr.c.in similarity index 85% rename from ompi/mpi/c/comm_set_attr.c rename to ompi/mpi/c/comm_set_attr.c.in index 0de8da979b2..9917cbd7863 100644 --- a/ompi/mpi/c/comm_set_attr.c +++ b/ompi/mpi/c/comm_set_attr.c.in @@ -28,17 +28,8 @@ #include "ompi/attribute/attribute.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Comm_set_attr = PMPI_Comm_set_attr -#endif -#define MPI_Comm_set_attr PMPI_Comm_set_attr -#endif -static const char FUNC_NAME[] = "MPI_Comm_set_attr"; - - -int MPI_Comm_set_attr(MPI_Comm comm, int comm_keyval, void *attribute_val) +PROTOTYPE ERROR_CLASS Comm_set_attr(COMM comm, INT comm_keyval, BUFFER_OUT attribute_val) { int ret; diff --git a/ompi/mpi/c/comm_set_errhandler.c b/ompi/mpi/c/comm_set_errhandler.c.in similarity index 88% rename from ompi/mpi/c/comm_set_errhandler.c rename to ompi/mpi/c/comm_set_errhandler.c.in index 0be31b76406..9adb245aa37 100644 --- a/ompi/mpi/c/comm_set_errhandler.c +++ b/ompi/mpi/c/comm_set_errhandler.c.in @@ -29,17 +29,7 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Comm_set_errhandler = PMPI_Comm_set_errhandler -#endif -#define MPI_Comm_set_errhandler PMPI_Comm_set_errhandler -#endif - -static const char FUNC_NAME[] = "MPI_Comm_set_errhandler"; - - -int MPI_Comm_set_errhandler(MPI_Comm comm, MPI_Errhandler errhandler) +PROTOTYPE ERROR_CLASS Comm_set_errhandler(COMM comm, ERRHANDLER errhandler) { MPI_Errhandler tmp; diff --git a/ompi/mpi/c/comm_set_info.c b/ompi/mpi/c/comm_set_info.c.in similarity index 81% rename from ompi/mpi/c/comm_set_info.c rename to ompi/mpi/c/comm_set_info.c.in index 9eca61263be..ef41654c720 100644 --- a/ompi/mpi/c/comm_set_info.c +++ b/ompi/mpi/c/comm_set_info.c.in @@ -21,17 +21,8 @@ #include #include -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Comm_set_info = PMPI_Comm_set_info -#endif -#define MPI_Comm_set_info PMPI_Comm_set_info -#endif -static const char FUNC_NAME[] = "MPI_Comm_set_info"; - - -int MPI_Comm_set_info(MPI_Comm comm, MPI_Info info) +PROTOTYPE ERROR_CLASS Comm_set_info(COMM comm, INFO info) { if (MPI_PARAM_CHECK) { OMPI_ERR_INIT_FINALIZE(FUNC_NAME); diff --git a/ompi/mpi/c/comm_set_name.c b/ompi/mpi/c/comm_set_name.c.in similarity index 88% rename from ompi/mpi/c/comm_set_name.c rename to ompi/mpi/c/comm_set_name.c.in index 538d3b81646..ff09d77d3fe 100644 --- a/ompi/mpi/c/comm_set_name.c +++ b/ompi/mpi/c/comm_set_name.c.in @@ -33,17 +33,7 @@ #include "ompi/totalview.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Comm_set_name = PMPI_Comm_set_name -#endif -#define MPI_Comm_set_name PMPI_Comm_set_name -#endif - -static const char FUNC_NAME[] = "MPI_Comm_set_name"; - - -int MPI_Comm_set_name(MPI_Comm comm, const char *name) +PROTOTYPE ERROR_CLASS Comm_set_name(COMM comm, STRING name) { int rc; diff --git a/ompi/mpi/c/comm_size.c b/ompi/mpi/c/comm_size.c.in similarity index 87% rename from ompi/mpi/c/comm_size.c rename to ompi/mpi/c/comm_size.c.in index 2c9f0232f48..b3aefff6f74 100644 --- a/ompi/mpi/c/comm_size.c +++ b/ompi/mpi/c/comm_size.c.in @@ -29,17 +29,7 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Comm_size = PMPI_Comm_size -#endif -#define MPI_Comm_size PMPI_Comm_size -#endif - -static const char FUNC_NAME[] = "MPI_Comm_size"; - - -int MPI_Comm_size(MPI_Comm comm, int *size) +PROTOTYPE ERROR_CLASS comm_size(COMM comm, INT_OUT size) { MEMCHECKER( memchecker_comm(comm); diff --git a/ompi/mpi/c/comm_spawn.c b/ompi/mpi/c/comm_spawn.c.in similarity index 94% rename from ompi/mpi/c/comm_spawn.c rename to ompi/mpi/c/comm_spawn.c.in index dfeb9bffe07..ec740a59f60 100644 --- a/ompi/mpi/c/comm_spawn.c +++ b/ompi/mpi/c/comm_spawn.c.in @@ -39,19 +39,10 @@ #include "ompi/dpm/dpm.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Comm_spawn = PMPI_Comm_spawn -#endif -#define MPI_Comm_spawn PMPI_Comm_spawn -#endif - -static const char FUNC_NAME[] = "MPI_Comm_spawn"; - -int MPI_Comm_spawn(const char *command, char *argv[], int maxprocs, MPI_Info info, - int root, MPI_Comm comm, MPI_Comm *intercomm, - int array_of_errcodes[]) +PROTOTYPE ERROR_CLASS Comm_spawn(STRING command, STRING_ARRAY argv, INT maxprocs, INFO info, + INT root, COMM comm, COMM_OUT intercomm, + INT_OUT array_of_errcodes) { int rank, rc=OMPI_SUCCESS, i, flag; bool send_first = false; /* we wait to be contacted */ diff --git a/ompi/mpi/c/comm_spawn_multiple.c b/ompi/mpi/c/comm_spawn_multiple.c.in similarity index 93% rename from ompi/mpi/c/comm_spawn_multiple.c rename to ompi/mpi/c/comm_spawn_multiple.c.in index 58b36c855c6..6b3b8360240 100644 --- a/ompi/mpi/c/comm_spawn_multiple.c +++ b/ompi/mpi/c/comm_spawn_multiple.c.in @@ -39,20 +39,11 @@ #include "ompi/dpm/dpm.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Comm_spawn_multiple = PMPI_Comm_spawn_multiple -#endif -#define MPI_Comm_spawn_multiple PMPI_Comm_spawn_multiple -#endif - -static const char FUNC_NAME[] = "MPI_Comm_spawn_multiple"; - -int MPI_Comm_spawn_multiple(int count, char *array_of_commands[], char **array_of_argv[], - const int array_of_maxprocs[], const MPI_Info array_of_info[], - int root, MPI_Comm comm, MPI_Comm *intercomm, - int array_of_errcodes[]) +PROTOTYPE ERROR_CLASS Comm_spawn_multiple(INT count, STRING_ARRAY array_of_commands, ARGV array_of_argv, + INT_ARRAY array_of_maxprocs, INFO_ARRAY array_of_info, + INT root, COMM comm, COMM_OUT intercomm, + INT_OUT array_of_errcodes) { int i=0, rc=0, rank=0, size=0, flag; ompi_communicator_t *newcomp=MPI_COMM_NULL; diff --git a/ompi/mpi/c/comm_split.c b/ompi/mpi/c/comm_split.c.in similarity index 89% rename from ompi/mpi/c/comm_split.c rename to ompi/mpi/c/comm_split.c.in index a55f0fa7204..0e25e798a19 100644 --- a/ompi/mpi/c/comm_split.c +++ b/ompi/mpi/c/comm_split.c.in @@ -28,18 +28,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Comm_split = PMPI_Comm_split -#endif -#define MPI_Comm_split PMPI_Comm_split -#endif - -static const char FUNC_NAME[] = "MPI_Comm_split"; - - -int MPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm *newcomm) { - +PROTOTYPE ERROR_CLASS comm_split(COMM comm, INT color, INT key, COMM_OUT newcomm) +{ int rc; MEMCHECKER( diff --git a/ompi/mpi/c/comm_split_type.c b/ompi/mpi/c/comm_split_type.c.in similarity index 92% rename from ompi/mpi/c/comm_split_type.c rename to ompi/mpi/c/comm_split_type.c.in index 3af3087eded..be277b35af9 100644 --- a/ompi/mpi/c/comm_split_type.c +++ b/ompi/mpi/c/comm_split_type.c.in @@ -32,19 +32,9 @@ #include "ompi/info/info.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Comm_split_type = PMPI_Comm_split_type -#endif -#define MPI_Comm_split_type PMPI_Comm_split_type -#endif - -static const char FUNC_NAME[] = "MPI_Comm_split_type"; - - -int MPI_Comm_split_type(MPI_Comm comm, int split_type, int key, - MPI_Info info, MPI_Comm *newcomm) { - +PROTOTYPE ERROR_CLASS comm_split_type(COMM comm, INT split_type, INT key, + INFO info, COMM_OUT newcomm) +{ int rc; MEMCHECKER( diff --git a/ompi/mpi/c/comm_test_inter.c b/ompi/mpi/c/comm_test_inter.c.in similarity index 79% rename from ompi/mpi/c/comm_test_inter.c rename to ompi/mpi/c/comm_test_inter.c.in index 141a90d3478..1d91892a468 100644 --- a/ompi/mpi/c/comm_test_inter.c +++ b/ompi/mpi/c/comm_test_inter.c.in @@ -27,17 +27,9 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Comm_test_inter = PMPI_Comm_test_inter -#endif -#define MPI_Comm_test_inter PMPI_Comm_test_inter -#endif -static const char FUNC_NAME[] = "MPI_Comm_test_inter"; - - -int MPI_Comm_test_inter(MPI_Comm comm, int *flag) { +PROTOTYPE ERROR_CLASS Comm_test_inter(COMM comm, INT_OUT flag) +{ MEMCHECKER( memchecker_comm(comm); @@ -46,17 +38,17 @@ int MPI_Comm_test_inter(MPI_Comm comm, int *flag) { if ( MPI_PARAM_CHECK ) { OMPI_ERR_INIT_FINALIZE(FUNC_NAME); - if ( ompi_comm_invalid ( comm ) ) { + if ( ompi_comm_invalid ( comm )) { return OMPI_ERRHANDLER_INVOKE ( MPI_COMM_WORLD, MPI_ERR_COMM, FUNC_NAME); } - if ( NULL == flag ) { + if ( NULL == flag ){ return OMPI_ERRHANDLER_INVOKE ( comm, MPI_ERR_ARG, FUNC_NAME); } } - *flag = (comm->c_flags & OMPI_COMM_INTER); + *flag = ( comm->c_flags & OMPI_COMM_INTER ); return MPI_SUCCESS; } diff --git a/ompi/mpi/c/compare_and_swap.c b/ompi/mpi/c/compare_and_swap.c.in similarity index 84% rename from ompi/mpi/c/compare_and_swap.c rename to ompi/mpi/c/compare_and_swap.c.in index 014c31d5c27..1a50d531ff3 100644 --- a/ompi/mpi/c/compare_and_swap.c +++ b/ompi/mpi/c/compare_and_swap.c.in @@ -33,18 +33,9 @@ #include "ompi/mca/osc/osc.h" #include "ompi/datatype/ompi_datatype.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Compare_and_swap = PMPI_Compare_and_swap -#endif -#define MPI_Compare_and_swap PMPI_Compare_and_swap -#endif -static const char FUNC_NAME[] = "MPI_Compare_and_swap"; - - -int MPI_Compare_and_swap(const void *origin_addr, const void *compare_addr, void *result_addr, - MPI_Datatype datatype, int target_rank, MPI_Aint target_disp, MPI_Win win) +PROTOTYPE ERROR_CLASS Compare_and_swap(BUFFER origin_addr, BUFFER compare_addr, BUFFER_OUT result_addr, + DATATYPE datatype, INT target_rank, AINT target_disp, WIN win) { int rc; diff --git a/ompi/mpi/c/dims_create.c b/ompi/mpi/c/dims_create.c.in similarity index 94% rename from ompi/mpi/c/dims_create.c rename to ompi/mpi/c/dims_create.c.in index 132feab54ba..3dae7bee1a5 100644 --- a/ompi/mpi/c/dims_create.c +++ b/ompi/mpi/c/dims_create.c.in @@ -31,113 +31,11 @@ #include "ompi/communicator/communicator.h" #include "ompi/errhandler/errhandler.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Dims_create = PMPI_Dims_create -#endif -#define MPI_Dims_create PMPI_Dims_create -#endif - -static const char FUNC_NAME[] = "MPI_Dims_create"; /* static functions */ static int assignnodes(int ndim, int nfactor, int *pfacts,int **pdims); static int getfactors(int num, int *nfators, int **factors); - -/* - * This is a utility function, no need to have anything in the lower - * layer for this at all - */ -int MPI_Dims_create(int nnodes, int ndims, int dims[]) -{ - int i; - int freeprocs; - int freedims; - int nfactors; - int *factors; - int *procs; - int *p; - int err; - - if (MPI_PARAM_CHECK) { - OMPI_ERR_INIT_FINALIZE(FUNC_NAME); - - if (0 > ndims) { - return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, - MPI_ERR_DIMS, FUNC_NAME); - } - - if ((0 != ndims) && (NULL == dims)) { - return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, - MPI_ERR_ARG, FUNC_NAME); - } - - if (1 > nnodes) { - return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, - MPI_ERR_DIMS, FUNC_NAME); - } - } - - /* Get # of free-to-be-assigned processes and # of free dimensions */ - freeprocs = nnodes; - freedims = 0; - for (i = 0, p = dims; i < ndims; ++i,++p) { - if (*p == 0) { - ++freedims; - } else if ((*p < 0) || ((nnodes % *p) != 0)) { - return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_DIMS, - FUNC_NAME); - } else { - freeprocs /= *p; - } - } - - if (freedims == 0) { - if (freeprocs == 1) { - return MPI_SUCCESS; - } - return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_DIMS, - FUNC_NAME); - } - - if (freeprocs == 1) { - for (i = 0; i < ndims; ++i, ++dims) { - if (*dims == 0) { - *dims = 1; - } - } - return MPI_SUCCESS; - } - - /* Factor the number of free processes */ - if (MPI_SUCCESS != (err = getfactors(freeprocs, &nfactors, &factors))) { - return OMPI_ERRHANDLER_NOHANDLE_INVOKE(err, - FUNC_NAME); - } - - /* Assign free processes to free dimensions */ - if (MPI_SUCCESS != (err = assignnodes(freedims, nfactors, factors, &procs))) { - free(factors); - return OMPI_ERRHANDLER_NOHANDLE_INVOKE(err, - FUNC_NAME); - } - - /* Return assignment results */ - p = procs; - for (i = 0; i < ndims; ++i, ++dims) { - if (*dims == 0) { - *dims = *p++; - } - } - - free((char *) factors); - free((char *) procs); - - /* all done */ - return MPI_SUCCESS; -} - /* * assignnodes * @@ -152,8 +50,7 @@ int MPI_Dims_create(int nnodes, int ndims, int dims[]) * - ptr to array of dimensions (returned value) * Returns: - 0 or ERROR */ -static int -assignnodes(int ndim, int nfactor, int *pfacts, int **pdims) +static int assignnodes(int ndim, int nfactor, int *pfacts, int **pdims) { int *bins; int i, j; @@ -213,8 +110,7 @@ assignnodes(int ndim, int nfactor, int *pfacts, int **pdims) * - array of prime factors * Returns: - MPI_SUCCESS or ERROR */ -static int -getfactors(int num, int *nfactors, int **factors) { +static int getfactors(int num, int *nfactors, int **factors) { int size; int d; int i; @@ -251,3 +147,95 @@ getfactors(int num, int *nfactors, int **factors) { (*nfactors) = i; return MPI_SUCCESS; } + +/* + * This is a utility function, no need to have anything in the lower + * layer for this at all + */ +PROTOTYPE ERROR_CLASS Dims_create(INT nnodes, INT ndims, INT_OUT dims) +{ + int i; + int freeprocs; + int freedims; + int nfactors; + int *factors; + int *procs; + int *p; + int err; + + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + + if (0 > ndims) { + return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, + MPI_ERR_DIMS, FUNC_NAME); + } + + if ((0 != ndims) && (NULL == dims)) { + return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, + MPI_ERR_ARG, FUNC_NAME); + } + + if (1 > nnodes) { + return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, + MPI_ERR_DIMS, FUNC_NAME); + } + } + + /* Get # of free-to-be-assigned processes and # of free dimensions */ + freeprocs = nnodes; + freedims = 0; + for (i = 0, p = dims; i < ndims; ++i,++p) { + if (*p == 0) { + ++freedims; + } else if ((*p < 0) || ((nnodes % *p) != 0)) { + return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_DIMS, + FUNC_NAME); + } else { + freeprocs /= *p; + } + } + + if (freedims == 0) { + if (freeprocs == 1) { + return MPI_SUCCESS; + } + return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_DIMS, + FUNC_NAME); + } + + if (freeprocs == 1) { + for (i = 0; i < ndims; ++i, ++dims) { + if (*dims == 0) { + *dims = 1; + } + } + return MPI_SUCCESS; + } + /* Factor the number of free processes */ + if (MPI_SUCCESS != (err = getfactors(freeprocs, &nfactors, &factors))) { + return OMPI_ERRHANDLER_NOHANDLE_INVOKE(err, + FUNC_NAME); + } + + /* Assign free processes to free dimensions */ + if (MPI_SUCCESS != (err = assignnodes(freedims, nfactors, factors, &procs))) { + free(factors); + return OMPI_ERRHANDLER_NOHANDLE_INVOKE(err, + FUNC_NAME); + } + + /* Return assignment results */ + p = procs; + for (i = 0; i < ndims; ++i, ++dims) { + if (*dims == 0) { + *dims = *p++; + } + } + + free((char *) factors); + free((char *) procs); + + /* all done */ + return MPI_SUCCESS; +} diff --git a/ompi/mpi/c/dist_graph_create.c b/ompi/mpi/c/dist_graph_create.c.in similarity index 89% rename from ompi/mpi/c/dist_graph_create.c rename to ompi/mpi/c/dist_graph_create.c.in index 22234916a1d..0ac9100d4e3 100644 --- a/ompi/mpi/c/dist_graph_create.c +++ b/ompi/mpi/c/dist_graph_create.c.in @@ -25,18 +25,10 @@ #include "ompi/mca/topo/topo.h" #include "ompi/mca/topo/base/base.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Dist_graph_create = PMPI_Dist_graph_create -#endif -#define MPI_Dist_graph_create PMPI_Dist_graph_create -#endif - -static const char FUNC_NAME[] = "MPI_Dist_graph_create"; -int MPI_Dist_graph_create(MPI_Comm comm_old, int n, const int sources[], - const int degrees[], const int destinations[], const int weights[], - MPI_Info info, int reorder, MPI_Comm * newcomm) +PROTOTYPE ERROR_CLASS Dist_graph_create(COMM comm_old, INT n, INT_ARRAY sources, + INT_ARRAY degrees, INT_ARRAY destinations, INT_ARRAY weights, + INFO info, INT reorder, COMM_OUT newcomm) { mca_topo_base_module_t* topo; int i, j, index, err, comm_size; diff --git a/ompi/mpi/c/dist_graph_create_adjacent.c b/ompi/mpi/c/dist_graph_create_adjacent.c.in similarity index 87% rename from ompi/mpi/c/dist_graph_create_adjacent.c rename to ompi/mpi/c/dist_graph_create_adjacent.c.in index a21070b214d..714eb4441eb 100644 --- a/ompi/mpi/c/dist_graph_create_adjacent.c +++ b/ompi/mpi/c/dist_graph_create_adjacent.c.in @@ -31,22 +31,13 @@ #include "ompi/mca/topo/topo.h" #include "ompi/mca/topo/base/base.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Dist_graph_create_adjacent = PMPI_Dist_graph_create_adjacent -#endif -#define MPI_Dist_graph_create_adjacent PMPI_Dist_graph_create_adjacent -#endif - -static const char FUNC_NAME[] = "MPI_Dist_graph_create_adjacent"; - -int MPI_Dist_graph_create_adjacent(MPI_Comm comm_old, - int indegree, const int sources[], - const int sourceweights[], int outdegree, - const int destinations[], const int destweights[], - MPI_Info info, int reorder, - MPI_Comm *comm_dist_graph) +PROTOTYPE ERROR_CLASS Dist_graph_create_adjacent(COMM comm_old, + INT indegree, INT_ARRAY sources, + INT_ARRAY sourceweights, INT outdegree, + INT_ARRAY destinations, INT_ARRAY destweights, + INFO info, INT reorder, + COMM_OUT comm_dist_graph) { mca_topo_base_module_t* topo; int i, comm_size, err; diff --git a/ompi/mpi/c/dist_graph_neighbors.c b/ompi/mpi/c/dist_graph_neighbors.c.in similarity index 81% rename from ompi/mpi/c/dist_graph_neighbors.c rename to ompi/mpi/c/dist_graph_neighbors.c.in index bbe86ce189b..a797719348b 100644 --- a/ompi/mpi/c/dist_graph_neighbors.c +++ b/ompi/mpi/c/dist_graph_neighbors.c.in @@ -25,20 +25,11 @@ #include "ompi/mca/topo/topo.h" #include "ompi/mca/topo/base/base.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Dist_graph_neighbors = PMPI_Dist_graph_neighbors -#endif -#define MPI_Dist_graph_neighbors PMPI_Dist_graph_neighbors -#endif -static const char FUNC_NAME[] = "MPI_Dist_graph_neighbors"; - - -int MPI_Dist_graph_neighbors(MPI_Comm comm, int maxindegree, - int sources[], int sourceweights[], - int maxoutdegree, int destinations[], - int destweights[]) +PROTOTYPE ERROR_CLASS Dist_graph_neighbors(COMM comm, INT maxindegree, + INT_OUT sources, INT_OUT sourceweights, + INT maxoutdegree, INT_OUT destinations, + INT_OUT destweights) { int err; diff --git a/ompi/mpi/c/dist_graph_neighbors_count.c b/ompi/mpi/c/dist_graph_neighbors_count.c.in similarity index 81% rename from ompi/mpi/c/dist_graph_neighbors_count.c rename to ompi/mpi/c/dist_graph_neighbors_count.c.in index 3a9f8c75d57..383f99ad49a 100644 --- a/ompi/mpi/c/dist_graph_neighbors_count.c +++ b/ompi/mpi/c/dist_graph_neighbors_count.c.in @@ -27,18 +27,8 @@ #include "ompi/mca/topo/topo.h" #include "ompi/mca/topo/base/base.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Dist_graph_neighbors_count = PMPI_Dist_graph_neighbors_count -#endif -#define MPI_Dist_graph_neighbors_count PMPI_Dist_graph_neighbors_count -#endif - -static const char FUNC_NAME[] = "MPI_Dist_graph_neighbors_count"; - - -int MPI_Dist_graph_neighbors_count(MPI_Comm comm, int *inneighbors, - int *outneighbors, int *weighted) +PROTOTYPE ERROR_CLASS Dist_graph_neighbors_count(COMM comm, INT_OUT inneighbors, + INT_OUT outneighbors, INT_OUT weighted) { int err; diff --git a/ompi/mpi/c/errhandler_c2f.c b/ompi/mpi/c/errhandler_c2f.c.in similarity index 82% rename from ompi/mpi/c/errhandler_c2f.c rename to ompi/mpi/c/errhandler_c2f.c.in index 7abd3116f81..2af8aad76ad 100644 --- a/ompi/mpi/c/errhandler_c2f.c +++ b/ompi/mpi/c/errhandler_c2f.c.in @@ -28,17 +28,7 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/mpi/fortran/base/fint_2_int.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Errhandler_c2f = PMPI_Errhandler_c2f -#endif -#define MPI_Errhandler_c2f PMPI_Errhandler_c2f -#endif - -static const char FUNC_NAME[] __opal_attribute_unused__ = "MPI_Errhandler_c2f"; - - -MPI_Fint MPI_Errhandler_c2f(MPI_Errhandler errhandler) +PROTOTYPE FINT errhandler_c2f(ERRHANDLER errhandler) { /* Error checking */ diff --git a/ompi/mpi/c/errhandler_f2c.c b/ompi/mpi/c/errhandler_f2c.c.in similarity index 89% rename from ompi/mpi/c/errhandler_f2c.c rename to ompi/mpi/c/errhandler_f2c.c.in index 8ec5dd2527e..41139999989 100644 --- a/ompi/mpi/c/errhandler_f2c.c +++ b/ompi/mpi/c/errhandler_f2c.c.in @@ -29,17 +29,7 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/mpi/fortran/base/fint_2_int.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Errhandler_f2c = PMPI_Errhandler_f2c -#endif -#define MPI_Errhandler_f2c PMPI_Errhandler_f2c -#endif - -static const char FUNC_NAME[] = "MPI_Errhandler_f2c"; - - -MPI_Errhandler MPI_Errhandler_f2c(MPI_Fint errhandler_f) +PROTOTYPE ERRHANDLER errhandler_f2c(FINT errhandler_f) { int eh_index = OMPI_FINT_2_INT(errhandler_f); MPI_Errhandler c_err_handler; diff --git a/ompi/mpi/c/errhandler_free.c b/ompi/mpi/c/errhandler_free.c.in similarity index 88% rename from ompi/mpi/c/errhandler_free.c rename to ompi/mpi/c/errhandler_free.c.in index 2e5a3c6997a..8ad7cf0088a 100644 --- a/ompi/mpi/c/errhandler_free.c +++ b/ompi/mpi/c/errhandler_free.c.in @@ -27,17 +27,8 @@ #include "ompi/communicator/communicator.h" #include "ompi/errhandler/errhandler.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Errhandler_free = PMPI_Errhandler_free -#endif -#define MPI_Errhandler_free PMPI_Errhandler_free -#endif -static const char FUNC_NAME[] __opal_attribute_unused__ = "MPI_Errhandler_free"; - - -int MPI_Errhandler_free(MPI_Errhandler *errhandler) +PROTOTYPE ERROR_CLASS Errhandler_free(ERRHANDLER_OUT errhandler) { /* Error checking */ diff --git a/ompi/mpi/c/error_class.c b/ompi/mpi/c/error_class.c.in similarity index 86% rename from ompi/mpi/c/error_class.c rename to ompi/mpi/c/error_class.c.in index a1e3c87144a..84e9c7ae215 100644 --- a/ompi/mpi/c/error_class.c +++ b/ompi/mpi/c/error_class.c.in @@ -28,17 +28,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/errhandler/errcode.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Error_class = PMPI_Error_class -#endif -#define MPI_Error_class PMPI_Error_class -#endif -static const char FUNC_NAME[] = "MPI_Error_class"; - - -int MPI_Error_class(int errorcode, int *errorclass) +PROTOTYPE ERROR_CLASS Error_class(INT errorcode, INT_OUT errorclass) { int ret; diff --git a/ompi/mpi/c/error_string.c b/ompi/mpi/c/error_string.c.in similarity index 88% rename from ompi/mpi/c/error_string.c rename to ompi/mpi/c/error_string.c.in index f3a12b6ce91..a5b8b31f3ba 100644 --- a/ompi/mpi/c/error_string.c +++ b/ompi/mpi/c/error_string.c.in @@ -32,17 +32,7 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/errhandler/errcode.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Error_string = PMPI_Error_string -#endif -#define MPI_Error_string PMPI_Error_string -#endif - -static const char FUNC_NAME[] = "MPI_Error_string"; - - -int MPI_Error_string(int errorcode, char *string, int *resultlen) +PROTOTYPE ERROR_CLASS Error_string(INT errorcode, STRING_OUT string, INT_OUT resultlen) { int ret; char *tmpstring; diff --git a/ompi/mpi/c/exscan.c b/ompi/mpi/c/exscan.c.in similarity index 92% rename from ompi/mpi/c/exscan.c rename to ompi/mpi/c/exscan.c.in index 812812a97b6..baecb54a065 100644 --- a/ompi/mpi/c/exscan.c +++ b/ompi/mpi/c/exscan.c.in @@ -33,18 +33,9 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Exscan = PMPI_Exscan -#endif -#define MPI_Exscan PMPI_Exscan -#endif - -static const char FUNC_NAME[] = "MPI_Exscan"; - -int MPI_Exscan(const void *sendbuf, void *recvbuf, int count, - MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) +PROTOTYPE ERROR_CLASS Exscan(BUFFER sendbuf, BUFFER_OUT recvbuf, INT count, + DATATYPE datatype, OP op, COMM comm) { int err; diff --git a/ompi/mpi/c/exscan_init.c b/ompi/mpi/c/exscan_init.c.in similarity index 87% rename from ompi/mpi/c/exscan_init.c rename to ompi/mpi/c/exscan_init.c.in index 9c18eade276..907140e990d 100644 --- a/ompi/mpi/c/exscan_init.c +++ b/ompi/mpi/c/exscan_init.c.in @@ -33,19 +33,10 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Exscan_init = PMPI_Exscan_init -#endif -#define MPI_Exscan_init PMPI_Exscan_init -#endif -static const char FUNC_NAME[] = "MPI_Exscan_init"; - - -int MPI_Exscan_init(const void *sendbuf, void *recvbuf, int count, - MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, - MPI_Info info, MPI_Request *request) +PROTOTYPE ERROR_CLASS Exscan_init(BUFFER sendbuf, BUFFER_OUT recvbuf, INT count, + DATATYPE datatype, OP op, COMM comm, + INFO info, REQUEST_INOUT request) { int err; diff --git a/ompi/mpi/c/fetch_and_op.c b/ompi/mpi/c/fetch_and_op.c.in similarity index 86% rename from ompi/mpi/c/fetch_and_op.c rename to ompi/mpi/c/fetch_and_op.c.in index 47d61e403d2..d35b938b083 100644 --- a/ompi/mpi/c/fetch_and_op.c +++ b/ompi/mpi/c/fetch_and_op.c.in @@ -33,18 +33,9 @@ #include "ompi/mca/osc/osc.h" #include "ompi/datatype/ompi_datatype.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Fetch_and_op = PMPI_Fetch_and_op -#endif -#define MPI_Fetch_and_op PMPI_Fetch_and_op -#endif -static const char FUNC_NAME[] = "MPI_Fetch_and_op"; - - -int MPI_Fetch_and_op(const void *origin_addr, void *result_addr, MPI_Datatype datatype, - int target_rank, MPI_Aint target_disp, MPI_Op op, MPI_Win win) +PROTOTYPE ERROR_CLASS Fetch_and_op(BUFFER origin_addr, BUFFER_OUT result_addr,DATATYPE datatype, + INT target_rank, AINT target_disp, OP op, WIN win) { int rc; diff --git a/ompi/mpi/c/file_c2f.c b/ompi/mpi/c/file_c2f.c.in similarity index 88% rename from ompi/mpi/c/file_c2f.c rename to ompi/mpi/c/file_c2f.c.in index 3ba4d40c5c9..757ba97de99 100644 --- a/ompi/mpi/c/file_c2f.c +++ b/ompi/mpi/c/file_c2f.c.in @@ -27,17 +27,7 @@ #include "ompi/mpi/fortran/base/fint_2_int.h" #include "ompi/file/file.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_c2f = PMPI_File_c2f -#endif -#define MPI_File_c2f PMPI_File_c2f -#endif - -static const char FUNC_NAME[] = "MPI_File_c2f"; - - -MPI_Fint MPI_File_c2f(MPI_File file) +PROTOTYPE FINT file_c2f(FILE file) { if (MPI_PARAM_CHECK) { OMPI_ERR_INIT_FINALIZE(FUNC_NAME); diff --git a/ompi/mpi/c/file_call_errhandler.c b/ompi/mpi/c/file_call_errhandler.c.in similarity index 82% rename from ompi/mpi/c/file_call_errhandler.c rename to ompi/mpi/c/file_call_errhandler.c.in index 64f2336f7de..4c1965e52d3 100644 --- a/ompi/mpi/c/file_call_errhandler.c +++ b/ompi/mpi/c/file_call_errhandler.c.in @@ -26,17 +26,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/file/file.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_call_errhandler = PMPI_File_call_errhandler -#endif -#define MPI_File_call_errhandler PMPI_File_call_errhandler -#endif -static const char FUNC_NAME[] = "MPI_File_call_errhandler"; - - -int MPI_File_call_errhandler(MPI_File fh, int errorcode) +PROTOTYPE ERROR_CLASS File_call_errhandler(FILE fh, INT errorcode) { /* Error checking */ diff --git a/ompi/mpi/c/file_close.c b/ompi/mpi/c/file_close.c.in similarity index 87% rename from ompi/mpi/c/file_close.c rename to ompi/mpi/c/file_close.c.in index 15e3629ca6b..09cd44dafdc 100644 --- a/ompi/mpi/c/file_close.c +++ b/ompi/mpi/c/file_close.c.in @@ -25,17 +25,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/file/file.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_close = PMPI_File_close -#endif -#define MPI_File_close PMPI_File_close -#endif -static const char FUNC_NAME[] = "MPI_File_close"; - - -int MPI_File_close(MPI_File *fh) +PROTOTYPE ERROR_CLASS File_close(FILE_OUT fh) { int rc; diff --git a/ompi/mpi/c/file_create_errhandler.c b/ompi/mpi/c/file_create_errhandler.c.in similarity index 84% rename from ompi/mpi/c/file_create_errhandler.c rename to ompi/mpi/c/file_create_errhandler.c.in index 4041d00b658..8e1e9821a19 100644 --- a/ompi/mpi/c/file_create_errhandler.c +++ b/ompi/mpi/c/file_create_errhandler.c.in @@ -30,18 +30,10 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/file/file.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_create_errhandler = PMPI_File_create_errhandler -#endif -#define MPI_File_create_errhandler PMPI_File_create_errhandler -#endif -static const char FUNC_NAME[] = "MPI_File_create_errhandler"; - - -int MPI_File_create_errhandler (MPI_File_errhandler_function *function, - MPI_Errhandler *errhandler) { +PROTOTYPE ERROR_CLASS File_create_errhandler (FILE_ERRHANDLER_FUNCTION function, + ERRHANDLER_OUT errhandler) +{ int err = MPI_SUCCESS; /* Error checking */ diff --git a/ompi/mpi/c/file_delete.c b/ompi/mpi/c/file_delete.c.in similarity index 91% rename from ompi/mpi/c/file_delete.c rename to ompi/mpi/c/file_delete.c.in index d666544b880..ab891b8dc07 100644 --- a/ompi/mpi/c/file_delete.c +++ b/ompi/mpi/c/file_delete.c.in @@ -32,17 +32,8 @@ #include "ompi/mca/io/io.h" #include "ompi/mca/io/base/base.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_delete = PMPI_File_delete -#endif -#define MPI_File_delete PMPI_File_delete -#endif -static const char FUNC_NAME[] = "MPI_File_delete"; - - -int MPI_File_delete(const char *filename, MPI_Info info) +PROTOTYPE ERROR_CLASS File_delete(STRING filename, INFO info) { int rc; diff --git a/ompi/mpi/c/file_f2c.c b/ompi/mpi/c/file_f2c.c.in similarity index 87% rename from ompi/mpi/c/file_f2c.c rename to ompi/mpi/c/file_f2c.c.in index 3640a2a9ae5..b290311de7b 100644 --- a/ompi/mpi/c/file_f2c.c +++ b/ompi/mpi/c/file_f2c.c.in @@ -28,17 +28,7 @@ #include "ompi/mpi/fortran/base/fint_2_int.h" #include "ompi/file/file.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_f2c = PMPI_File_f2c -#endif -#define MPI_File_f2c PMPI_File_f2c -#endif - -static const char FUNC_NAME[] = "MPI_File_f2c"; - - -MPI_File MPI_File_f2c(MPI_Fint file_f) +PROTOTYPE FILE file_f2c(FINT file_f) { int file_index = OMPI_FINT_2_INT(file_f); diff --git a/ompi/mpi/c/file_get_amode.c b/ompi/mpi/c/file_get_amode.c.in similarity index 87% rename from ompi/mpi/c/file_get_amode.c rename to ompi/mpi/c/file_get_amode.c.in index 7c930402090..cb94cacff75 100644 --- a/ompi/mpi/c/file_get_amode.c +++ b/ompi/mpi/c/file_get_amode.c.in @@ -28,17 +28,7 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/file/file.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_get_amode = PMPI_File_get_amode -#endif -#define MPI_File_get_amode PMPI_File_get_amode -#endif - -static const char FUNC_NAME[] = "MPI_File_get_amode"; - - -int MPI_File_get_amode(MPI_File fh, int *amode) +PROTOTYPE ERROR_CLASS File_get_amode(FILE fh, INT_OUT amode) { int rc; diff --git a/ompi/mpi/c/file_get_atomicity.c b/ompi/mpi/c/file_get_atomicity.c.in similarity index 86% rename from ompi/mpi/c/file_get_atomicity.c rename to ompi/mpi/c/file_get_atomicity.c.in index 52929660b71..51f79a7bc88 100644 --- a/ompi/mpi/c/file_get_atomicity.c +++ b/ompi/mpi/c/file_get_atomicity.c.in @@ -28,17 +28,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/file/file.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_get_atomicity = PMPI_File_get_atomicity -#endif -#define MPI_File_get_atomicity PMPI_File_get_atomicity -#endif -static const char FUNC_NAME[] = "MPI_File_get_atomicity"; - - -int MPI_File_get_atomicity(MPI_File fh, int *flag) +PROTOTYPE ERROR_CLASS File_get_atomicity(FILE fh, INT_OUT flag) { int rc; diff --git a/ompi/mpi/c/file_get_byte_offset.c b/ompi/mpi/c/file_get_byte_offset.c.in similarity index 84% rename from ompi/mpi/c/file_get_byte_offset.c rename to ompi/mpi/c/file_get_byte_offset.c.in index fb9713aaba9..9ba8e915390 100644 --- a/ompi/mpi/c/file_get_byte_offset.c +++ b/ompi/mpi/c/file_get_byte_offset.c.in @@ -28,18 +28,9 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/file/file.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_get_byte_offset = PMPI_File_get_byte_offset -#endif -#define MPI_File_get_byte_offset PMPI_File_get_byte_offset -#endif -static const char FUNC_NAME[] = "MPI_File_get_byte_offset"; - - -int MPI_File_get_byte_offset(MPI_File fh, MPI_Offset offset, - MPI_Offset *disp) +PROTOTYPE ERROR_CLASS File_get_byte_offset(FILE fh, OFFSET offset, + OFFSET_OUT disp) { int rc; diff --git a/ompi/mpi/c/file_get_errhandler.c b/ompi/mpi/c/file_get_errhandler.c.in similarity index 88% rename from ompi/mpi/c/file_get_errhandler.c rename to ompi/mpi/c/file_get_errhandler.c.in index 8836ec16b62..d39249a1ebf 100644 --- a/ompi/mpi/c/file_get_errhandler.c +++ b/ompi/mpi/c/file_get_errhandler.c.in @@ -32,17 +32,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/file/file.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_get_errhandler = PMPI_File_get_errhandler -#endif -#define MPI_File_get_errhandler PMPI_File_get_errhandler -#endif -static const char FUNC_NAME[] = "MPI_File_get_errhandler"; - - -int MPI_File_get_errhandler( MPI_File file, MPI_Errhandler *errhandler) +PROTOTYPE ERROR_CLASS File_get_errhandler(FILE file, ERRHANDLER_OUT errhandler) { int ret = MPI_SUCCESS; diff --git a/ompi/mpi/c/file_get_group.c b/ompi/mpi/c/file_get_group.c.in similarity index 84% rename from ompi/mpi/c/file_get_group.c rename to ompi/mpi/c/file_get_group.c.in index 3e09186377b..ac3c2b1e179 100644 --- a/ompi/mpi/c/file_get_group.c +++ b/ompi/mpi/c/file_get_group.c.in @@ -26,17 +26,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/file/file.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_get_group = PMPI_File_get_group -#endif -#define MPI_File_get_group PMPI_File_get_group -#endif -static const char FUNC_NAME[] = "MPI_File_get_group"; - - -int MPI_File_get_group(MPI_File fh, MPI_Group *group) +PROTOTYPE ERROR_CLASS File_get_group(FILE fh, GROUP_OUT group) { int rc; diff --git a/ompi/mpi/c/file_get_info.c b/ompi/mpi/c/file_get_info.c.in similarity index 91% rename from ompi/mpi/c/file_get_info.c rename to ompi/mpi/c/file_get_info.c.in index 429da4af303..78246245afa 100644 --- a/ompi/mpi/c/file_get_info.c +++ b/ompi/mpi/c/file_get_info.c.in @@ -31,17 +31,8 @@ #include "ompi/communicator/communicator.h" #include "ompi/file/file.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_get_info = PMPI_File_get_info -#endif -#define MPI_File_get_info PMPI_File_get_info -#endif -static const char FUNC_NAME[] = "MPI_File_get_info"; - - -int MPI_File_get_info(MPI_File fh, MPI_Info *info_used) +PROTOTYPE ERROR_CLASS File_get_info(FILE fh, INFO_OUT info_used) { if (MPI_PARAM_CHECK) { OMPI_ERR_INIT_FINALIZE(FUNC_NAME); diff --git a/ompi/mpi/c/file_get_position.c b/ompi/mpi/c/file_get_position.c.in similarity index 86% rename from ompi/mpi/c/file_get_position.c rename to ompi/mpi/c/file_get_position.c.in index c5627f43c6d..ffaada8552d 100644 --- a/ompi/mpi/c/file_get_position.c +++ b/ompi/mpi/c/file_get_position.c.in @@ -28,17 +28,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/file/file.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_get_position = PMPI_File_get_position -#endif -#define MPI_File_get_position PMPI_File_get_position -#endif -static const char FUNC_NAME[] = "MPI_File_get_position"; - - -int MPI_File_get_position(MPI_File fh, MPI_Offset *offset) +PROTOTYPE ERROR_CLASS File_get_position(FILE fh, OFFSET_OUT offset) { int rc; diff --git a/ompi/mpi/c/file_get_position_shared.c b/ompi/mpi/c/file_get_position_shared.c.in similarity index 84% rename from ompi/mpi/c/file_get_position_shared.c rename to ompi/mpi/c/file_get_position_shared.c.in index b094a002a72..e22a8984f96 100644 --- a/ompi/mpi/c/file_get_position_shared.c +++ b/ompi/mpi/c/file_get_position_shared.c.in @@ -28,17 +28,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/file/file.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_get_position_shared = PMPI_File_get_position_shared -#endif -#define MPI_File_get_position_shared PMPI_File_get_position_shared -#endif -static const char FUNC_NAME[] = "MPI_File_get_position_shared"; - - -int MPI_File_get_position_shared(MPI_File fh, MPI_Offset *offset) +PROTOTYPE ERROR_CLASS File_get_position_shared(FILE fh, OFFSET_OUT offset) { int rc; diff --git a/ompi/mpi/c/file_get_size.c b/ompi/mpi/c/file_get_size.c.in similarity index 87% rename from ompi/mpi/c/file_get_size.c rename to ompi/mpi/c/file_get_size.c.in index db361fb8adf..da4a9b3c151 100644 --- a/ompi/mpi/c/file_get_size.c +++ b/ompi/mpi/c/file_get_size.c.in @@ -28,17 +28,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/file/file.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_get_size = PMPI_File_get_size -#endif -#define MPI_File_get_size PMPI_File_get_size -#endif -static const char FUNC_NAME[] = "MPI_File_get_size"; - - -int MPI_File_get_size(MPI_File fh, MPI_Offset *size) +PROTOTYPE ERROR_CLASS File_get_size(FILE fh, OFFSET_OUT size) { int rc; diff --git a/ompi/mpi/c/file_get_type_extent.c b/ompi/mpi/c/file_get_type_extent.c.in similarity index 85% rename from ompi/mpi/c/file_get_type_extent.c rename to ompi/mpi/c/file_get_type_extent.c.in index 3fded0c207d..828077b7f3a 100644 --- a/ompi/mpi/c/file_get_type_extent.c +++ b/ompi/mpi/c/file_get_type_extent.c.in @@ -29,18 +29,9 @@ #include "ompi/file/file.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_get_type_extent = PMPI_File_get_type_extent -#endif -#define MPI_File_get_type_extent PMPI_File_get_type_extent -#endif -static const char FUNC_NAME[] = "MPI_File_get_type_extent"; - - -int MPI_File_get_type_extent(MPI_File fh, MPI_Datatype datatype, - MPI_Aint *extent) +PROTOTYPE ERROR_CLASS File_get_type_extent(FILE fh, DATATYPE datatype, + AINT_OUT extent) { int rc; diff --git a/ompi/mpi/c/file_get_view.c b/ompi/mpi/c/file_get_view.c.in similarity index 84% rename from ompi/mpi/c/file_get_view.c rename to ompi/mpi/c/file_get_view.c.in index e02b44d0c3f..52f8c2e2cd6 100644 --- a/ompi/mpi/c/file_get_view.c +++ b/ompi/mpi/c/file_get_view.c.in @@ -28,19 +28,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/file/file.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_get_view = PMPI_File_get_view -#endif -#define MPI_File_get_view PMPI_File_get_view -#endif - -static const char FUNC_NAME[] = "MPI_File_get_view"; - - -int MPI_File_get_view(MPI_File fh, MPI_Offset *disp, - MPI_Datatype *etype, - MPI_Datatype *filetype, char *datarep) +PROTOTYPE ERROR_CLASS file_get_view(FILE fh, OFFSET_OUT disp, DATATYPE_OUT etype, + DATATYPE_OUT filetype, STRING_OUT datarep) { int rc; diff --git a/ompi/mpi/c/file_iread.c b/ompi/mpi/c/file_iread.c.in similarity index 87% rename from ompi/mpi/c/file_iread.c rename to ompi/mpi/c/file_iread.c.in index a03dc360cd5..26a78175a32 100644 --- a/ompi/mpi/c/file_iread.c +++ b/ompi/mpi/c/file_iread.c.in @@ -32,18 +32,9 @@ #include "ompi/mca/io/base/io_base_request.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_iread = PMPI_File_iread -#endif -#define MPI_File_iread PMPI_File_iread -#endif -static const char FUNC_NAME[] = "MPI_File_iread"; - - -int MPI_File_iread(MPI_File fh, void *buf, int count, - MPI_Datatype datatype, MPI_Request *request) +PROTOTYPE ERROR_CLASS File_iread(FILE fh, BUFFER_OUT buf, INT count, + DATATYPE datatype, REQUEST_INOUT request) { int rc; diff --git a/ompi/mpi/c/file_iread_all.c b/ompi/mpi/c/file_iread_all.c.in similarity index 88% rename from ompi/mpi/c/file_iread_all.c rename to ompi/mpi/c/file_iread_all.c.in index 3e2534b2742..c12e8322ca9 100644 --- a/ompi/mpi/c/file_iread_all.c +++ b/ompi/mpi/c/file_iread_all.c.in @@ -34,18 +34,9 @@ #include "ompi/mca/io/base/io_base_request.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_iread_all = PMPI_File_iread_all -#endif -#define MPI_File_iread_all PMPI_File_iread_all -#endif -static const char FUNC_NAME[] = "MPI_File_iread_all"; - - -int MPI_File_iread_all(MPI_File fh, void *buf, int count, - MPI_Datatype datatype, MPI_Request *request) +PROTOTYPE ERROR_CLASS File_iread_all(FILE fh, BUFFER_OUT buf, INT count, + DATATYPE datatype, REQUEST_INOUT request) { int rc; diff --git a/ompi/mpi/c/file_iread_at.c b/ompi/mpi/c/file_iread_at.c.in similarity index 86% rename from ompi/mpi/c/file_iread_at.c rename to ompi/mpi/c/file_iread_at.c.in index 902154d3fd2..00b9de7cab8 100644 --- a/ompi/mpi/c/file_iread_at.c +++ b/ompi/mpi/c/file_iread_at.c.in @@ -32,18 +32,9 @@ #include "ompi/mca/io/base/io_base_request.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_iread_at = PMPI_File_iread_at -#endif -#define MPI_File_iread_at PMPI_File_iread_at -#endif -static const char FUNC_NAME[] = "MPI_File_iread_at"; - - -int MPI_File_iread_at(MPI_File fh, MPI_Offset offset, void *buf, - int count, MPI_Datatype datatype, MPI_Request *request) +PROTOTYPE ERROR_CLASS File_iread_at(FILE fh, OFFSET offset, BUFFER_OUT buf, + INT count, DATATYPE datatype, REQUEST_INOUT request) { int rc; diff --git a/ompi/mpi/c/file_iread_at_all.c b/ompi/mpi/c/file_iread_at_all.c.in similarity index 87% rename from ompi/mpi/c/file_iread_at_all.c rename to ompi/mpi/c/file_iread_at_all.c.in index 3e0c5cfca59..c4daeb88e76 100644 --- a/ompi/mpi/c/file_iread_at_all.c +++ b/ompi/mpi/c/file_iread_at_all.c.in @@ -34,18 +34,9 @@ #include "ompi/mca/io/base/io_base_request.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_iread_at_all = PMPI_File_iread_at_all -#endif -#define MPI_File_iread_at_all PMPI_File_iread_at_all -#endif -static const char FUNC_NAME[] = "MPI_File_iread_at_all"; - - -int MPI_File_iread_at_all(MPI_File fh, MPI_Offset offset, void *buf, - int count, MPI_Datatype datatype, MPI_Request *request) +PROTOTYPE ERROR_CLASS File_iread_at_all(FILE fh, OFFSET offset, BUFFER_OUT buf, + INT count, DATATYPE datatype, REQUEST_INOUT request) { int rc; diff --git a/ompi/mpi/c/file_iread_shared.c b/ompi/mpi/c/file_iread_shared.c.in similarity index 86% rename from ompi/mpi/c/file_iread_shared.c rename to ompi/mpi/c/file_iread_shared.c.in index f789561752f..2d74d2b7880 100644 --- a/ompi/mpi/c/file_iread_shared.c +++ b/ompi/mpi/c/file_iread_shared.c.in @@ -32,18 +32,9 @@ #include "ompi/mca/io/base/io_base_request.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_iread_shared = PMPI_File_iread_shared -#endif -#define MPI_File_iread_shared PMPI_File_iread_shared -#endif -static const char FUNC_NAME[] = "MPI_File_iread_shared"; - - -int MPI_File_iread_shared(MPI_File fh, void *buf, int count, - MPI_Datatype datatype, MPI_Request *request) +PROTOTYPE ERROR_CLASS File_iread_shared(FILE fh, BUFFER_OUT buf, INT count, + DATATYPE datatype, REQUEST_INOUT request) { int rc; diff --git a/ompi/mpi/c/file_iwrite.c b/ompi/mpi/c/file_iwrite.c.in similarity index 88% rename from ompi/mpi/c/file_iwrite.c rename to ompi/mpi/c/file_iwrite.c.in index 834271cd589..535db9d63f9 100644 --- a/ompi/mpi/c/file_iwrite.c +++ b/ompi/mpi/c/file_iwrite.c.in @@ -35,18 +35,8 @@ #include "ompi/mca/io/base/io_base_request.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_iwrite = PMPI_File_iwrite -#endif -#define MPI_File_iwrite PMPI_File_iwrite -#endif - -static const char FUNC_NAME[] = "MPI_File_iwrite"; - - -int MPI_File_iwrite(MPI_File fh, const void *buf, int count, MPI_Datatype - datatype, MPI_Request *request) +PROTOTYPE ERROR_CLASS File_iwrite(FILE fh, BUFFER buf, INT count, DATATYPE + datatype, REQUEST_INOUT request) { int rc; diff --git a/ompi/mpi/c/file_iwrite_all.c b/ompi/mpi/c/file_iwrite_all.c.in similarity index 88% rename from ompi/mpi/c/file_iwrite_all.c rename to ompi/mpi/c/file_iwrite_all.c.in index 900a1d49082..bee62d7ab50 100644 --- a/ompi/mpi/c/file_iwrite_all.c +++ b/ompi/mpi/c/file_iwrite_all.c.in @@ -37,18 +37,9 @@ #include "ompi/mca/io/base/io_base_request.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_iwrite_all = PMPI_File_iwrite_all -#endif -#define MPI_File_iwrite_all PMPI_File_iwrite_all -#endif -static const char FUNC_NAME[] = "MPI_File_iwrite_all"; - - -int MPI_File_iwrite_all(MPI_File fh, const void *buf, int count, MPI_Datatype - datatype, MPI_Request *request) +PROTOTYPE ERROR_CLASS File_iwrite_all(FILE fh, BUFFER buf, INT count, DATATYPE + datatype, REQUEST_INOUT request) { int rc; diff --git a/ompi/mpi/c/file_iwrite_at.c b/ompi/mpi/c/file_iwrite_at.c.in similarity index 86% rename from ompi/mpi/c/file_iwrite_at.c rename to ompi/mpi/c/file_iwrite_at.c.in index bf6ad3b6a4c..0f8e3412a99 100644 --- a/ompi/mpi/c/file_iwrite_at.c +++ b/ompi/mpi/c/file_iwrite_at.c.in @@ -35,19 +35,10 @@ #include "ompi/mca/io/base/io_base_request.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_iwrite_at = PMPI_File_iwrite_at -#endif -#define MPI_File_iwrite_at PMPI_File_iwrite_at -#endif -static const char FUNC_NAME[] = "MPI_File_iwrite_at"; - - -int MPI_File_iwrite_at(MPI_File fh, MPI_Offset offset, const void *buf, - int count, MPI_Datatype datatype, - MPI_Request *request) +PROTOTYPE ERROR_CLASS File_iwrite_at(FILE fh, OFFSET offset, BUFFER buf, + INT count, DATATYPE datatype, + REQUEST_INOUT request) { int rc; diff --git a/ompi/mpi/c/file_iwrite_at_all.c b/ompi/mpi/c/file_iwrite_at_all.c.in similarity index 87% rename from ompi/mpi/c/file_iwrite_at_all.c rename to ompi/mpi/c/file_iwrite_at_all.c.in index e682f7902fd..424e5d7908a 100644 --- a/ompi/mpi/c/file_iwrite_at_all.c +++ b/ompi/mpi/c/file_iwrite_at_all.c.in @@ -37,19 +37,9 @@ #include "ompi/mca/io/base/io_base_request.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_iwrite_at_all = PMPI_File_iwrite_at_all -#endif -#define MPI_File_iwrite_at_all PMPI_File_iwrite_at_all -#endif - -static const char FUNC_NAME[] = "MPI_File_iwrite_at_all"; - - -int MPI_File_iwrite_at_all(MPI_File fh, MPI_Offset offset, const void *buf, - int count, MPI_Datatype datatype, - MPI_Request *request) +PROTOTYPE ERROR_CLASS File_iwrite_at_all(FILE fh, OFFSET offset, BUFFER buf, + INT count, DATATYPE datatype, + REQUEST_INOUT request) { int rc; diff --git a/ompi/mpi/c/file_iwrite_shared.c b/ompi/mpi/c/file_iwrite_shared.c.in similarity index 86% rename from ompi/mpi/c/file_iwrite_shared.c rename to ompi/mpi/c/file_iwrite_shared.c.in index 23b7963d337..17b274cbf70 100644 --- a/ompi/mpi/c/file_iwrite_shared.c +++ b/ompi/mpi/c/file_iwrite_shared.c.in @@ -35,18 +35,9 @@ #include "ompi/mca/io/base/io_base_request.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_iwrite_shared = PMPI_File_iwrite_shared -#endif -#define MPI_File_iwrite_shared PMPI_File_iwrite_shared -#endif -static const char FUNC_NAME[] = "MPI_File_iwrite_shared"; - - -int MPI_File_iwrite_shared(MPI_File fh, const void *buf, int count, - MPI_Datatype datatype, MPI_Request *request) +PROTOTYPE ERROR_CLASS File_iwrite_shared(FILE fh, BUFFER buf, INT count, + DATATYPE datatype, REQUEST_INOUT request) { int rc; diff --git a/ompi/mpi/c/file_open.c b/ompi/mpi/c/file_open.c.in similarity index 92% rename from ompi/mpi/c/file_open.c rename to ompi/mpi/c/file_open.c.in index 204e92e9e44..0303ef4f970 100644 --- a/ompi/mpi/c/file_open.c +++ b/ompi/mpi/c/file_open.c.in @@ -39,18 +39,8 @@ extern opal_mutex_t ompi_mpi_file_bootstrap_mutex; -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_open = PMPI_File_open -#endif -#define MPI_File_open PMPI_File_open -#endif - -static const char FUNC_NAME[] = "MPI_File_open"; - - -int MPI_File_open(MPI_Comm comm, const char *filename, int amode, - MPI_Info info, MPI_File *fh) +PROTOTYPE ERROR_CLASS file_open(COMM comm, STRING filename, INT amode, + INFO info, FILE_OUT fh) { int rc; diff --git a/ompi/mpi/c/file_preallocate.c b/ompi/mpi/c/file_preallocate.c.in similarity index 86% rename from ompi/mpi/c/file_preallocate.c rename to ompi/mpi/c/file_preallocate.c.in index 52cc788920d..be1da2d54f4 100644 --- a/ompi/mpi/c/file_preallocate.c +++ b/ompi/mpi/c/file_preallocate.c.in @@ -28,17 +28,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/file/file.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_preallocate = PMPI_File_preallocate -#endif -#define MPI_File_preallocate PMPI_File_preallocate -#endif -static const char FUNC_NAME[] = "MPI_File_preallocate"; - - -int MPI_File_preallocate(MPI_File fh, MPI_Offset size) +PROTOTYPE ERROR_CLASS File_preallocate(FILE fh, OFFSET size) { int rc; diff --git a/ompi/mpi/c/file_read.c b/ompi/mpi/c/file_read.c.in similarity index 87% rename from ompi/mpi/c/file_read.c rename to ompi/mpi/c/file_read.c.in index bd37a74b31b..99589de978a 100644 --- a/ompi/mpi/c/file_read.c +++ b/ompi/mpi/c/file_read.c.in @@ -30,18 +30,9 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_read = PMPI_File_read -#endif -#define MPI_File_read PMPI_File_read -#endif -static const char FUNC_NAME[] = "MPI_File_read"; - - -int MPI_File_read(MPI_File fh, void *buf, int count, - MPI_Datatype datatype, MPI_Status *status) +PROTOTYPE ERROR_CLASS File_read(FILE fh, BUFFER_OUT buf, INT count, + DATATYPE datatype, STATUS_OUT status) { int rc; diff --git a/ompi/mpi/c/file_read_all.c b/ompi/mpi/c/file_read_all.c.in similarity index 86% rename from ompi/mpi/c/file_read_all.c rename to ompi/mpi/c/file_read_all.c.in index 3c793349533..804fbe59ddf 100644 --- a/ompi/mpi/c/file_read_all.c +++ b/ompi/mpi/c/file_read_all.c.in @@ -30,18 +30,9 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_read_all = PMPI_File_read_all -#endif -#define MPI_File_read_all PMPI_File_read_all -#endif -static const char FUNC_NAME[] = "MPI_File_read_all"; - - -int MPI_File_read_all(MPI_File fh, void *buf, int count, MPI_Datatype - datatype, MPI_Status *status) +PROTOTYPE ERROR_CLASS File_read_all(FILE fh, BUFFER_OUT buf, INT count, DATATYPE + datatype, STATUS_OUT status) { int rc; diff --git a/ompi/mpi/c/file_read_all_begin.c b/ompi/mpi/c/file_read_all_begin.c.in similarity index 85% rename from ompi/mpi/c/file_read_all_begin.c rename to ompi/mpi/c/file_read_all_begin.c.in index deea6d4e50b..7228c2a1404 100644 --- a/ompi/mpi/c/file_read_all_begin.c +++ b/ompi/mpi/c/file_read_all_begin.c.in @@ -30,18 +30,8 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_read_all_begin = PMPI_File_read_all_begin -#endif -#define MPI_File_read_all_begin PMPI_File_read_all_begin -#endif - -static const char FUNC_NAME[] = "MPI_File_read_all_begin"; - - -int MPI_File_read_all_begin(MPI_File fh, void *buf, int count, - MPI_Datatype datatype) +PROTOTYPE ERROR_CLASS File_read_all_begin(FILE fh, BUFFER_OUT buf, INT count, + DATATYPE datatype) { int rc; diff --git a/ompi/mpi/c/file_read_all_end.c b/ompi/mpi/c/file_read_all_end.c.in similarity index 85% rename from ompi/mpi/c/file_read_all_end.c rename to ompi/mpi/c/file_read_all_end.c.in index ed3ac7e2728..aed5a4dedf6 100644 --- a/ompi/mpi/c/file_read_all_end.c +++ b/ompi/mpi/c/file_read_all_end.c.in @@ -28,17 +28,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/file/file.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_read_all_end = PMPI_File_read_all_end -#endif -#define MPI_File_read_all_end PMPI_File_read_all_end -#endif -static const char FUNC_NAME[] = "MPI_File_read_all_end"; - - -int MPI_File_read_all_end(MPI_File fh, void *buf, MPI_Status *status) +PROTOTYPE ERROR_CLASS File_read_all_end(FILE fh, BUFFER_OUT buf, STATUS_OUT status) { int rc; diff --git a/ompi/mpi/c/file_read_at.c b/ompi/mpi/c/file_read_at.c.in similarity index 85% rename from ompi/mpi/c/file_read_at.c rename to ompi/mpi/c/file_read_at.c.in index 8bc1696ca37..110a25a98c6 100644 --- a/ompi/mpi/c/file_read_at.c +++ b/ompi/mpi/c/file_read_at.c.in @@ -30,18 +30,9 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_read_at = PMPI_File_read_at -#endif -#define MPI_File_read_at PMPI_File_read_at -#endif -static const char FUNC_NAME[] = "MPI_File_read_at"; - - -int MPI_File_read_at(MPI_File fh, MPI_Offset offset, void *buf, - int count, MPI_Datatype datatype, MPI_Status *status) +PROTOTYPE ERROR_CLASS File_read_at(FILE fh, OFFSET offset, BUFFER_OUT buf, + INT count, DATATYPE datatype, STATUS_OUT status) { int rc; diff --git a/ompi/mpi/c/file_read_at_all.c b/ompi/mpi/c/file_read_at_all.c.in similarity index 84% rename from ompi/mpi/c/file_read_at_all.c rename to ompi/mpi/c/file_read_at_all.c.in index 16d4d691d0a..ddfc5bdbe08 100644 --- a/ompi/mpi/c/file_read_at_all.c +++ b/ompi/mpi/c/file_read_at_all.c.in @@ -30,19 +30,9 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_read_at_all = PMPI_File_read_at_all -#endif -#define MPI_File_read_at_all PMPI_File_read_at_all -#endif - -static const char FUNC_NAME[] = "MPI_File_read_at_all"; - - -int MPI_File_read_at_all(MPI_File fh, MPI_Offset offset, void *buf, - int count, MPI_Datatype datatype, - MPI_Status *status) +PROTOTYPE ERROR_CLASS File_read_at_all(FILE fh, OFFSET offset, BUFFER_OUT buf, + INT count, DATATYPE datatype, + STATUS_OUT status) { int rc; diff --git a/ompi/mpi/c/file_read_at_all_begin.c b/ompi/mpi/c/file_read_at_all_begin.c.in similarity index 84% rename from ompi/mpi/c/file_read_at_all_begin.c rename to ompi/mpi/c/file_read_at_all_begin.c.in index 45f173f1a1f..6f4bd840055 100644 --- a/ompi/mpi/c/file_read_at_all_begin.c +++ b/ompi/mpi/c/file_read_at_all_begin.c.in @@ -30,18 +30,8 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_read_at_all_begin = PMPI_File_read_at_all_begin -#endif -#define MPI_File_read_at_all_begin PMPI_File_read_at_all_begin -#endif - -static const char FUNC_NAME[] = "MPI_File_read_at_all_begin"; - - -int MPI_File_read_at_all_begin(MPI_File fh, MPI_Offset offset, void *buf, - int count, MPI_Datatype datatype) +PROTOTYPE ERROR_CLASS File_read_at_all_begin(FILE fh, OFFSET offset, BUFFER_OUT buf, + INT count, DATATYPE datatype) { int rc; diff --git a/ompi/mpi/c/file_read_at_all_end.c b/ompi/mpi/c/file_read_at_all_end.c.in similarity index 84% rename from ompi/mpi/c/file_read_at_all_end.c rename to ompi/mpi/c/file_read_at_all_end.c.in index 2213bb0c87e..ba5b7ba396b 100644 --- a/ompi/mpi/c/file_read_at_all_end.c +++ b/ompi/mpi/c/file_read_at_all_end.c.in @@ -28,17 +28,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/file/file.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_read_at_all_end = PMPI_File_read_at_all_end -#endif -#define MPI_File_read_at_all_end PMPI_File_read_at_all_end -#endif -static const char FUNC_NAME[] = "MPI_File_read_at_all_end"; - - -int MPI_File_read_at_all_end(MPI_File fh, void *buf, MPI_Status *status) +PROTOTYPE ERROR_CLASS File_read_at_all_end(FILE fh, BUFFER_OUT buf, STATUS_OUT status) { int rc; diff --git a/ompi/mpi/c/file_read_ordered.c b/ompi/mpi/c/file_read_ordered.c.in similarity index 84% rename from ompi/mpi/c/file_read_ordered.c rename to ompi/mpi/c/file_read_ordered.c.in index befcc3736c9..016389a6622 100644 --- a/ompi/mpi/c/file_read_ordered.c +++ b/ompi/mpi/c/file_read_ordered.c.in @@ -29,18 +29,8 @@ #include "ompi/file/file.h" #include "ompi/datatype/ompi_datatype.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_read_ordered = PMPI_File_read_ordered -#endif -#define MPI_File_read_ordered PMPI_File_read_ordered -#endif - -static const char FUNC_NAME[] = "MPI_File_read_ordered"; - - -int MPI_File_read_ordered(MPI_File fh, void *buf, int count, - MPI_Datatype datatype, MPI_Status *status) +PROTOTYPE ERROR_CLASS File_read_ordered(FILE fh, BUFFER_OUT buf, INT count, + DATATYPE datatype, STATUS_OUT status) { int rc; diff --git a/ompi/mpi/c/file_read_ordered_begin.c b/ompi/mpi/c/file_read_ordered_begin.c.in similarity index 84% rename from ompi/mpi/c/file_read_ordered_begin.c rename to ompi/mpi/c/file_read_ordered_begin.c.in index 05c00564aa5..d132ea9932b 100644 --- a/ompi/mpi/c/file_read_ordered_begin.c +++ b/ompi/mpi/c/file_read_ordered_begin.c.in @@ -30,18 +30,9 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_read_ordered_begin = PMPI_File_read_ordered_begin -#endif -#define MPI_File_read_ordered_begin PMPI_File_read_ordered_begin -#endif -static const char FUNC_NAME[] = "MPI_File_read_ordered_begin"; - - -int MPI_File_read_ordered_begin(MPI_File fh, void *buf, int count, - MPI_Datatype datatype) +PROTOTYPE ERROR_CLASS File_read_ordered_begin(FILE fh, BUFFER_OUT buf, INT count, + DATATYPE datatype) { int rc; diff --git a/ompi/mpi/c/file_read_ordered_end.c b/ompi/mpi/c/file_read_ordered_end.c.in similarity index 84% rename from ompi/mpi/c/file_read_ordered_end.c rename to ompi/mpi/c/file_read_ordered_end.c.in index 288ed2ad191..858a3c59cae 100644 --- a/ompi/mpi/c/file_read_ordered_end.c +++ b/ompi/mpi/c/file_read_ordered_end.c.in @@ -28,17 +28,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/file/file.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_read_ordered_end = PMPI_File_read_ordered_end -#endif -#define MPI_File_read_ordered_end PMPI_File_read_ordered_end -#endif -static const char FUNC_NAME[] = "MPI_File_read_ordered_end"; - - -int MPI_File_read_ordered_end(MPI_File fh, void *buf, MPI_Status *status) +PROTOTYPE ERROR_CLASS File_read_ordered_end(FILE fh, BUFFER_OUT buf, STATUS_OUT status) { int rc; diff --git a/ompi/mpi/c/file_read_shared.c b/ompi/mpi/c/file_read_shared.c.in similarity index 85% rename from ompi/mpi/c/file_read_shared.c rename to ompi/mpi/c/file_read_shared.c.in index 98d180da343..c5aeb79d9dd 100644 --- a/ompi/mpi/c/file_read_shared.c +++ b/ompi/mpi/c/file_read_shared.c.in @@ -30,18 +30,9 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_read_shared = PMPI_File_read_shared -#endif -#define MPI_File_read_shared PMPI_File_read_shared -#endif -static const char FUNC_NAME[] = "MPI_File_read_shared"; - - -int MPI_File_read_shared(MPI_File fh, void *buf, int count, - MPI_Datatype datatype, MPI_Status *status) +PROTOTYPE ERROR_CLASS File_read_shared(FILE fh, BUFFER_OUT buf, INT count, + DATATYPE datatype, STATUS_OUT status) { int rc; diff --git a/ompi/mpi/c/file_seek.c b/ompi/mpi/c/file_seek.c.in similarity index 88% rename from ompi/mpi/c/file_seek.c rename to ompi/mpi/c/file_seek.c.in index 450d5f2a5f2..6f2b7f5d35c 100644 --- a/ompi/mpi/c/file_seek.c +++ b/ompi/mpi/c/file_seek.c.in @@ -28,17 +28,7 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/file/file.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_seek = PMPI_File_seek -#endif -#define MPI_File_seek PMPI_File_seek -#endif - -static const char FUNC_NAME[] = "MPI_File_seek"; - - -int MPI_File_seek(MPI_File fh, MPI_Offset offset, int whence) +PROTOTYPE ERROR_CLASS File_seek(FILE fh, OFFSET offset, INT whence) { int rc; diff --git a/ompi/mpi/c/file_seek_shared.c b/ompi/mpi/c/file_seek_shared.c.in similarity index 86% rename from ompi/mpi/c/file_seek_shared.c rename to ompi/mpi/c/file_seek_shared.c.in index 6e5150eca88..c5e2486aac1 100644 --- a/ompi/mpi/c/file_seek_shared.c +++ b/ompi/mpi/c/file_seek_shared.c.in @@ -28,17 +28,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/file/file.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_seek_shared = PMPI_File_seek_shared -#endif -#define MPI_File_seek_shared PMPI_File_seek_shared -#endif -static const char FUNC_NAME[] = "MPI_File_seek_shared"; - - -int MPI_File_seek_shared(MPI_File fh, MPI_Offset offset, int whence) +PROTOTYPE ERROR_CLASS File_seek_shared(FILE fh, OFFSET offset, INT whence) { int rc; diff --git a/ompi/mpi/c/file_set_atomicity.c b/ompi/mpi/c/file_set_atomicity.c.in similarity index 86% rename from ompi/mpi/c/file_set_atomicity.c rename to ompi/mpi/c/file_set_atomicity.c.in index cab58c335e7..77a3ad5f9a9 100644 --- a/ompi/mpi/c/file_set_atomicity.c +++ b/ompi/mpi/c/file_set_atomicity.c.in @@ -28,17 +28,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/file/file.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_set_atomicity = PMPI_File_set_atomicity -#endif -#define MPI_File_set_atomicity PMPI_File_set_atomicity -#endif -static const char FUNC_NAME[] = "MPI_File_set_atomicity"; - - -int MPI_File_set_atomicity(MPI_File fh, int flag) +PROTOTYPE ERROR_CLASS File_set_atomicity(FILE fh, INT flag) { int rc; diff --git a/ompi/mpi/c/file_set_errhandler.c b/ompi/mpi/c/file_set_errhandler.c.in similarity index 88% rename from ompi/mpi/c/file_set_errhandler.c rename to ompi/mpi/c/file_set_errhandler.c.in index 7590ab6c853..f45acd78c24 100644 --- a/ompi/mpi/c/file_set_errhandler.c +++ b/ompi/mpi/c/file_set_errhandler.c.in @@ -29,17 +29,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/file/file.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_set_errhandler = PMPI_File_set_errhandler -#endif -#define MPI_File_set_errhandler PMPI_File_set_errhandler -#endif -static const char FUNC_NAME[] = "MPI_File_set_errhandler"; - - -int MPI_File_set_errhandler( MPI_File file, MPI_Errhandler errhandler) +PROTOTYPE ERROR_CLASS File_set_errhandler(FILE file, ERRHANDLER errhandler) { MPI_Errhandler tmp; diff --git a/ompi/mpi/c/file_set_info.c b/ompi/mpi/c/file_set_info.c.in similarity index 90% rename from ompi/mpi/c/file_set_info.c rename to ompi/mpi/c/file_set_info.c.in index 530c92f47c2..d22f38bb5ee 100644 --- a/ompi/mpi/c/file_set_info.c +++ b/ompi/mpi/c/file_set_info.c.in @@ -32,17 +32,7 @@ #include "opal/util/info_subscriber.h" #include "ompi/file/file.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_set_info = PMPI_File_set_info -#endif -#define MPI_File_set_info PMPI_File_set_info -#endif - -static const char FUNC_NAME[] = "MPI_File_set_info"; - - -int MPI_File_set_info(MPI_File fh, MPI_Info info) +PROTOTYPE ERROR_CLASS File_set_info(FILE fh, INFO info) { int ret; diff --git a/ompi/mpi/c/file_set_size.c b/ompi/mpi/c/file_set_size.c.in similarity index 87% rename from ompi/mpi/c/file_set_size.c rename to ompi/mpi/c/file_set_size.c.in index 13103eefa61..3bb62e57e9b 100644 --- a/ompi/mpi/c/file_set_size.c +++ b/ompi/mpi/c/file_set_size.c.in @@ -28,17 +28,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/file/file.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_set_size = PMPI_File_set_size -#endif -#define MPI_File_set_size PMPI_File_set_size -#endif -static const char FUNC_NAME[] = "MPI_File_set_size"; - - -int MPI_File_set_size(MPI_File fh, MPI_Offset size) +PROTOTYPE ERROR_CLASS File_set_size(FILE fh, OFFSET size) { int rc; diff --git a/ompi/mpi/c/file_set_view.c b/ompi/mpi/c/file_set_view.c.in similarity index 87% rename from ompi/mpi/c/file_set_view.c rename to ompi/mpi/c/file_set_view.c.in index 5b91314ab10..2d652aed139 100644 --- a/ompi/mpi/c/file_set_view.c +++ b/ompi/mpi/c/file_set_view.c.in @@ -35,18 +35,8 @@ #include "ompi/file/file.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_set_view = PMPI_File_set_view -#endif -#define MPI_File_set_view PMPI_File_set_view -#endif - -static const char FUNC_NAME[] = "MPI_File_set_view"; - - -int MPI_File_set_view(MPI_File fh, MPI_Offset disp, MPI_Datatype etype, - MPI_Datatype filetype, const char *datarep, MPI_Info info) +PROTOTYPE ERROR_CLASS File_set_view(FILE fh, OFFSET disp, DATATYPE etype, + DATATYPE filetype, STRING datarep, INFO info) { int rc; diff --git a/ompi/mpi/c/file_sync.c b/ompi/mpi/c/file_sync.c.in similarity index 88% rename from ompi/mpi/c/file_sync.c rename to ompi/mpi/c/file_sync.c.in index 57d2db8dd09..7853047b554 100644 --- a/ompi/mpi/c/file_sync.c +++ b/ompi/mpi/c/file_sync.c.in @@ -28,17 +28,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/file/file.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_sync = PMPI_File_sync -#endif -#define MPI_File_sync PMPI_File_sync -#endif -static const char FUNC_NAME[] = "MPI_File_sync"; - - -int MPI_File_sync(MPI_File fh) +PROTOTYPE ERROR_CLASS File_sync(FILE fh) { int rc; diff --git a/ompi/mpi/c/file_write.c b/ompi/mpi/c/file_write.c.in similarity index 87% rename from ompi/mpi/c/file_write.c rename to ompi/mpi/c/file_write.c.in index 7a4784c2338..a338579ad91 100644 --- a/ompi/mpi/c/file_write.c +++ b/ompi/mpi/c/file_write.c.in @@ -33,18 +33,9 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_write = PMPI_File_write -#endif -#define MPI_File_write PMPI_File_write -#endif -static const char FUNC_NAME[] = "MPI_File_write"; - - -int MPI_File_write(MPI_File fh, const void *buf, int count, - MPI_Datatype datatype, MPI_Status *status) +PROTOTYPE ERROR_CLASS File_write(FILE fh, BUFFER buf, INT count, + DATATYPE datatype, STATUS_OUT status) { int rc; diff --git a/ompi/mpi/c/file_write_all.c b/ompi/mpi/c/file_write_all.c.in similarity index 87% rename from ompi/mpi/c/file_write_all.c rename to ompi/mpi/c/file_write_all.c.in index 9d809ef95ee..1a7908465b7 100644 --- a/ompi/mpi/c/file_write_all.c +++ b/ompi/mpi/c/file_write_all.c.in @@ -33,18 +33,9 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_write_all = PMPI_File_write_all -#endif -#define MPI_File_write_all PMPI_File_write_all -#endif -static const char FUNC_NAME[] = "MPI_File_write_all"; - - -int MPI_File_write_all(MPI_File fh, const void *buf, int count, MPI_Datatype - datatype, MPI_Status *status) +PROTOTYPE ERROR_CLASS File_write_all(FILE fh, BUFFER buf, INT count, DATATYPE + datatype, STATUS_OUT status) { int rc; diff --git a/ompi/mpi/c/file_write_all_begin.c b/ompi/mpi/c/file_write_all_begin.c.in similarity index 86% rename from ompi/mpi/c/file_write_all_begin.c rename to ompi/mpi/c/file_write_all_begin.c.in index 825a8e2d150..a02911b58b8 100644 --- a/ompi/mpi/c/file_write_all_begin.c +++ b/ompi/mpi/c/file_write_all_begin.c.in @@ -33,18 +33,8 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_write_all_begin = PMPI_File_write_all_begin -#endif -#define MPI_File_write_all_begin PMPI_File_write_all_begin -#endif - -static const char FUNC_NAME[] = "MPI_File_write_all_begin"; - - -int MPI_File_write_all_begin(MPI_File fh, const void *buf, int count, - MPI_Datatype datatype) +PROTOTYPE ERROR_CLASS File_write_all_begin(FILE fh, BUFFER buf, INT count, + DATATYPE datatype) { int rc; diff --git a/ompi/mpi/c/file_write_all_end.c b/ompi/mpi/c/file_write_all_end.c.in similarity index 86% rename from ompi/mpi/c/file_write_all_end.c rename to ompi/mpi/c/file_write_all_end.c.in index 3314a314685..e53b6fec44e 100644 --- a/ompi/mpi/c/file_write_all_end.c +++ b/ompi/mpi/c/file_write_all_end.c.in @@ -31,17 +31,7 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/file/file.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_write_all_end = PMPI_File_write_all_end -#endif -#define MPI_File_write_all_end PMPI_File_write_all_end -#endif - -static const char FUNC_NAME[] = "MPI_File_write_all_end"; - - -int MPI_File_write_all_end(MPI_File fh, const void *buf, MPI_Status *status) +PROTOTYPE ERROR_CLASS File_write_all_end(FILE fh, BUFFER buf, STATUS_OUT status) { int rc; diff --git a/ompi/mpi/c/file_write_at.c b/ompi/mpi/c/file_write_at.c.in similarity index 86% rename from ompi/mpi/c/file_write_at.c rename to ompi/mpi/c/file_write_at.c.in index 4e4a85d0081..ad8b30d4c00 100644 --- a/ompi/mpi/c/file_write_at.c +++ b/ompi/mpi/c/file_write_at.c.in @@ -33,19 +33,10 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_write_at = PMPI_File_write_at -#endif -#define MPI_File_write_at PMPI_File_write_at -#endif -static const char FUNC_NAME[] = "MPI_File_write_at"; - - -int MPI_File_write_at(MPI_File fh, MPI_Offset offset, const void *buf, - int count, MPI_Datatype datatype, - MPI_Status *status) +PROTOTYPE ERROR_CLASS File_write_at(FILE fh, OFFSET offset, BUFFER buf, + INT count, DATATYPE datatype, + STATUS_OUT status) { int rc; diff --git a/ompi/mpi/c/file_write_at_all.c b/ompi/mpi/c/file_write_at_all.c.in similarity index 85% rename from ompi/mpi/c/file_write_at_all.c rename to ompi/mpi/c/file_write_at_all.c.in index b92072861d0..a5c73e5c980 100644 --- a/ompi/mpi/c/file_write_at_all.c +++ b/ompi/mpi/c/file_write_at_all.c.in @@ -33,19 +33,10 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_write_at_all = PMPI_File_write_at_all -#endif -#define MPI_File_write_at_all PMPI_File_write_at_all -#endif -static const char FUNC_NAME[] = "MPI_File_write_at_all"; - - -int MPI_File_write_at_all(MPI_File fh, MPI_Offset offset, const void *buf, - int count, MPI_Datatype datatype, - MPI_Status *status) +PROTOTYPE ERROR_CLASS File_write_at_all(FILE fh, OFFSET offset, BUFFER buf, + INT count, DATATYPE datatype, + STATUS_OUT status) { int rc; diff --git a/ompi/mpi/c/file_write_at_all_begin.c b/ompi/mpi/c/file_write_at_all_begin.c.in similarity index 85% rename from ompi/mpi/c/file_write_at_all_begin.c rename to ompi/mpi/c/file_write_at_all_begin.c.in index e8fdf357407..c60e0ff6082 100644 --- a/ompi/mpi/c/file_write_at_all_begin.c +++ b/ompi/mpi/c/file_write_at_all_begin.c.in @@ -33,18 +33,8 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_write_at_all_begin = PMPI_File_write_at_all_begin -#endif -#define MPI_File_write_at_all_begin PMPI_File_write_at_all_begin -#endif - -static const char FUNC_NAME[] = "MPI_File_write_at_all_begin"; - - -int MPI_File_write_at_all_begin(MPI_File fh, MPI_Offset offset, const void *buf, - int count, MPI_Datatype datatype) +PROTOTYPE ERROR_CLASS File_write_at_all_begin(FILE fh, OFFSET offset, BUFFER buf, + INT count, DATATYPE datatype) { int rc; diff --git a/ompi/mpi/c/file_write_at_all_end.c b/ompi/mpi/c/file_write_at_all_end.c.in similarity index 85% rename from ompi/mpi/c/file_write_at_all_end.c rename to ompi/mpi/c/file_write_at_all_end.c.in index e20d4a9cf34..43a13d99b61 100644 --- a/ompi/mpi/c/file_write_at_all_end.c +++ b/ompi/mpi/c/file_write_at_all_end.c.in @@ -31,17 +31,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/file/file.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_write_at_all_end = PMPI_File_write_at_all_end -#endif -#define MPI_File_write_at_all_end PMPI_File_write_at_all_end -#endif -static const char FUNC_NAME[] = "MPI_File_write_at_all_end"; - - -int MPI_File_write_at_all_end(MPI_File fh, const void *buf, MPI_Status *status) +PROTOTYPE ERROR_CLASS File_write_at_all_end(FILE fh, BUFFER buf, STATUS_OUT status) { int rc; diff --git a/ompi/mpi/c/file_write_ordered.c b/ompi/mpi/c/file_write_ordered.c.in similarity index 86% rename from ompi/mpi/c/file_write_ordered.c rename to ompi/mpi/c/file_write_ordered.c.in index e84f5f64774..2c30df0c1ee 100644 --- a/ompi/mpi/c/file_write_ordered.c +++ b/ompi/mpi/c/file_write_ordered.c.in @@ -33,18 +33,8 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_write_ordered = PMPI_File_write_ordered -#endif -#define MPI_File_write_ordered PMPI_File_write_ordered -#endif - -static const char FUNC_NAME[] = "MPI_File_write_ordered"; - - -int MPI_File_write_ordered(MPI_File fh, const void *buf, int count, - MPI_Datatype datatype, MPI_Status *status) +PROTOTYPE ERROR_CLASS File_write_ordered(FILE fh, BUFFER buf, INT count, + DATATYPE datatype, STATUS_OUT status) { int rc; diff --git a/ompi/mpi/c/file_write_ordered_begin.c b/ompi/mpi/c/file_write_ordered_begin.c.in similarity index 85% rename from ompi/mpi/c/file_write_ordered_begin.c rename to ompi/mpi/c/file_write_ordered_begin.c.in index 2d26f17f0c3..bb723a31f23 100644 --- a/ompi/mpi/c/file_write_ordered_begin.c +++ b/ompi/mpi/c/file_write_ordered_begin.c.in @@ -33,18 +33,9 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_write_ordered_begin = PMPI_File_write_ordered_begin -#endif -#define MPI_File_write_ordered_begin PMPI_File_write_ordered_begin -#endif -static const char FUNC_NAME[] = "MPI_File_write_ordered_begin"; - - -int MPI_File_write_ordered_begin(MPI_File fh, const void *buf, int count, - MPI_Datatype datatype) +PROTOTYPE ERROR_CLASS File_write_ordered_begin(FILE fh, BUFFER buf, INT count, + DATATYPE datatype) { int rc; diff --git a/ompi/mpi/c/file_write_ordered_end.c b/ompi/mpi/c/file_write_ordered_end.c.in similarity index 85% rename from ompi/mpi/c/file_write_ordered_end.c rename to ompi/mpi/c/file_write_ordered_end.c.in index b13b50862b4..628923845c3 100644 --- a/ompi/mpi/c/file_write_ordered_end.c +++ b/ompi/mpi/c/file_write_ordered_end.c.in @@ -31,17 +31,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/file/file.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_write_ordered_end = PMPI_File_write_ordered_end -#endif -#define MPI_File_write_ordered_end PMPI_File_write_ordered_end -#endif -static const char FUNC_NAME[] = "MPI_File_write_ordered_end"; - - -int MPI_File_write_ordered_end(MPI_File fh, const void *buf, MPI_Status *status) +PROTOTYPE ERROR_CLASS File_write_ordered_end(FILE fh, BUFFER buf, STATUS_OUT status) { int rc; diff --git a/ompi/mpi/c/file_write_shared.c b/ompi/mpi/c/file_write_shared.c.in similarity index 86% rename from ompi/mpi/c/file_write_shared.c rename to ompi/mpi/c/file_write_shared.c.in index db4a1c871c8..cf421972c43 100644 --- a/ompi/mpi/c/file_write_shared.c +++ b/ompi/mpi/c/file_write_shared.c.in @@ -33,18 +33,9 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_File_write_shared = PMPI_File_write_shared -#endif -#define MPI_File_write_shared PMPI_File_write_shared -#endif -static const char FUNC_NAME[] = "MPI_File_write_shared"; - - -int MPI_File_write_shared(MPI_File fh, const void *buf, int count, - MPI_Datatype datatype, MPI_Status *status) +PROTOTYPE ERROR_CLASS File_write_shared(FILE fh, BUFFER buf, INT count, + DATATYPE datatype, STATUS_OUT status) { int rc; diff --git a/ompi/mpi/c/finalize.c b/ompi/mpi/c/finalize.c.in similarity index 86% rename from ompi/mpi/c/finalize.c rename to ompi/mpi/c/finalize.c.in index be7989261ba..a50fef2c5b0 100644 --- a/ompi/mpi/c/finalize.c +++ b/ompi/mpi/c/finalize.c.in @@ -25,17 +25,7 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Finalize = PMPI_Finalize -#endif -#define MPI_Finalize PMPI_Finalize -#endif - -static const char FUNC_NAME[] = "MPI_Finalize"; - - -int MPI_Finalize(void) +PROTOTYPE ERROR_CLASS finalize() { /* If --with-spc and ompi_mpi_spc_dump_enabled were specified, print * all of the final SPC values aggregated across the whole MPI run. diff --git a/ompi/mpi/c/finalized.c b/ompi/mpi/c/finalized.c.in similarity index 90% rename from ompi/mpi/c/finalized.c rename to ompi/mpi/c/finalized.c.in index 514e91b3b25..1a2934db784 100644 --- a/ompi/mpi/c/finalized.c +++ b/ompi/mpi/c/finalized.c.in @@ -28,17 +28,7 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/mca/hook/base/base.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Finalized = PMPI_Finalized -#endif -#define MPI_Finalized PMPI_Finalized -#endif - -static const char FUNC_NAME[] = "MPI_Finalized"; - - -int MPI_Finalized(int *flag) +PROTOTYPE ERROR_CLASS finalized(INT_OUT flag) { ompi_hook_base_mpi_finalized_top(flag); diff --git a/ompi/mpi/c/free_mem.c b/ompi/mpi/c/free_mem.c.in similarity index 87% rename from ompi/mpi/c/free_mem.c rename to ompi/mpi/c/free_mem.c.in index 5c0bbc4eb6a..149e726f68d 100644 --- a/ompi/mpi/c/free_mem.c +++ b/ompi/mpi/c/free_mem.c.in @@ -29,17 +29,8 @@ #include "ompi/errhandler/errhandler.h" #include "opal/mca/mpool/mpool.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Free_mem = PMPI_Free_mem -#endif -#define MPI_Free_mem PMPI_Free_mem -#endif -static const char FUNC_NAME[] = "MPI_Free_mem"; - - -int MPI_Free_mem(void *baseptr) +PROTOTYPE ERROR_CLASS Free_mem(BUFFER_OUT baseptr) { /* Per these threads: diff --git a/ompi/mpi/c/gather.c b/ompi/mpi/c/gather.c.in similarity index 95% rename from ompi/mpi/c/gather.c rename to ompi/mpi/c/gather.c.in index 0e8227cbc16..8ba1cd3f90d 100644 --- a/ompi/mpi/c/gather.c +++ b/ompi/mpi/c/gather.c.in @@ -35,19 +35,9 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Gather = PMPI_Gather -#endif -#define MPI_Gather PMPI_Gather -#endif - -static const char FUNC_NAME[] = "MPI_Gather"; - - -int MPI_Gather(const void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, - int root, MPI_Comm comm) +PROTOTYPE ERROR_CLASS Gather(BUFFER sendbuf, INT sendcount, DATATYPE sendtype, + BUFFER_OUT recvbuf, INT recvcount, DATATYPE recvtype, + INT root, COMM comm) { int err; diff --git a/ompi/mpi/c/gather_init.c b/ompi/mpi/c/gather_init.c.in similarity index 94% rename from ompi/mpi/c/gather_init.c rename to ompi/mpi/c/gather_init.c.in index 2539fdcdc1f..04e61e60dd7 100644 --- a/ompi/mpi/c/gather_init.c +++ b/ompi/mpi/c/gather_init.c.in @@ -35,19 +35,9 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Gather_init = PMPI_Gather_init -#endif -#define MPI_Gather_init PMPI_Gather_init -#endif - -static const char FUNC_NAME[] = "MPI_Gather_init"; - - -int MPI_Gather_init(const void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, - int root, MPI_Comm comm, MPI_Info info, MPI_Request *request) +PROTOTYPE ERROR_CLASS Gather_init(BUFFER sendbuf, INT sendcount, DATATYPE sendtype, + BUFFER_OUT recvbuf, INT recvcount, DATATYPE recvtype, + INT root, COMM comm, INFO info, REQUEST_INOUT request) { int err; diff --git a/ompi/mpi/c/gatherv.c b/ompi/mpi/c/gatherv.c.in similarity index 95% rename from ompi/mpi/c/gatherv.c rename to ompi/mpi/c/gatherv.c.in index eba4803d945..2b621ce2cb5 100644 --- a/ompi/mpi/c/gatherv.c +++ b/ompi/mpi/c/gatherv.c.in @@ -33,19 +33,10 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Gatherv = PMPI_Gatherv -#endif -#define MPI_Gatherv PMPI_Gatherv -#endif - -static const char FUNC_NAME[] = "MPI_Gatherv"; - -int MPI_Gatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, const int recvcounts[], const int displs[], - MPI_Datatype recvtype, int root, MPI_Comm comm) +PROTOTYPE ERROR_CLASS Gatherv(BUFFER sendbuf, COUNT sendcount, DATATYPE sendtype, + BUFFER_OUT recvbuf, COUNT_ARRAY recvcounts, DISP_ARRAY displs, + DATATYPE recvtype, INT root, COMM comm) { int i, size, err; ompi_count_array_t recvcounts_desc; diff --git a/ompi/mpi/c/gatherv_init.c b/ompi/mpi/c/gatherv_init.c.in similarity index 94% rename from ompi/mpi/c/gatherv_init.c rename to ompi/mpi/c/gatherv_init.c.in index 77fe3018614..713741e5e0c 100644 --- a/ompi/mpi/c/gatherv_init.c +++ b/ompi/mpi/c/gatherv_init.c.in @@ -33,20 +33,11 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Gatherv_init = PMPI_Gatherv_init -#endif -#define MPI_Gatherv_init PMPI_Gatherv_init -#endif -static const char FUNC_NAME[] = "MPI_Gatherv_init"; - - -int MPI_Gatherv_init(const void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, const int recvcounts[], const int displs[], - MPI_Datatype recvtype, int root, MPI_Comm comm, - MPI_Info info, MPI_Request *request) +PROTOTYPE ERROR_CLASS Gatherv_init(BUFFER sendbuf, COUNT sendcount, DATATYPE sendtype, + BUFFER_OUT recvbuf, COUNT_ARRAY recvcounts, DISP_ARRAY displs, + DATATYPE recvtype, INT root, COMM comm, + INFO info, REQUEST_INOUT request) { int i, size, err; ompi_count_array_t recvcounts_desc; diff --git a/ompi/mpi/c/get.c b/ompi/mpi/c/get.c.in similarity index 87% rename from ompi/mpi/c/get.c rename to ompi/mpi/c/get.c.in index d378012cfc4..fcdd5554737 100644 --- a/ompi/mpi/c/get.c +++ b/ompi/mpi/c/get.c.in @@ -32,20 +32,10 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Get = PMPI_Get -#endif -#define MPI_Get PMPI_Get -#endif - -static const char FUNC_NAME[] = "MPI_Get"; - - -int MPI_Get(void *origin_addr, int origin_count, - MPI_Datatype origin_datatype, int target_rank, - MPI_Aint target_disp, int target_count, - MPI_Datatype target_datatype, MPI_Win win) +PROTOTYPE ERROR_CLASS Get(BUFFER_OUT origin_addr, INT origin_count, + DATATYPE origin_datatype, INT target_rank, + AINT target_disp, INT target_count, + DATATYPE target_datatype, WIN win) { int rc; diff --git a/ompi/mpi/c/get_accumulate.c b/ompi/mpi/c/get_accumulate.c.in similarity index 91% rename from ompi/mpi/c/get_accumulate.c rename to ompi/mpi/c/get_accumulate.c.in index ad889ee76c9..33360f3b20e 100644 --- a/ompi/mpi/c/get_accumulate.c +++ b/ompi/mpi/c/get_accumulate.c.in @@ -35,19 +35,10 @@ #include "ompi/datatype/ompi_datatype_internal.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Get_accumulate = PMPI_Get_accumulate -#endif -#define MPI_Get_accumulate PMPI_Get_accumulate -#endif - -static const char FUNC_NAME[] = "MPI_Get_accumulate"; - -int MPI_Get_accumulate(const void *origin_addr, int origin_count, MPI_Datatype origin_datatype, - void *result_addr, int result_count, MPI_Datatype result_datatype, - int target_rank, MPI_Aint target_disp, int target_count, - MPI_Datatype target_datatype, MPI_Op op, MPI_Win win) +PROTOTYPE ERROR_CLASS Get_accumulate(BUFFER origin_addr, INT origin_count, DATATYPE origin_datatype, + BUFFER_OUT result_addr, INT result_count, DATATYPE result_datatype, + INT target_rank, AINT target_disp, INT target_count, + DATATYPE target_datatype, OP op, WIN win) { int rc; ompi_win_t *ompi_win = (ompi_win_t*) win; diff --git a/ompi/mpi/c/get_address.c b/ompi/mpi/c/get_address.c.in similarity index 84% rename from ompi/mpi/c/get_address.c rename to ompi/mpi/c/get_address.c.in index 0b934b2b751..ce86c45b814 100644 --- a/ompi/mpi/c/get_address.c +++ b/ompi/mpi/c/get_address.c.in @@ -27,17 +27,7 @@ #include "ompi/communicator/communicator.h" #include "ompi/errhandler/errhandler.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Get_address = PMPI_Get_address -#endif -#define MPI_Get_address PMPI_Get_address -#endif - -static const char FUNC_NAME[] = "MPI_Get_address"; - - -int MPI_Get_address(const void *location, MPI_Aint *address) +PROTOTYPE ERROR_CLASS Get_address(BUFFER location, AINT_OUT address) { if( MPI_PARAM_CHECK ) { OMPI_ERR_INIT_FINALIZE(FUNC_NAME); diff --git a/ompi/mpi/c/get_count.c b/ompi/mpi/c/get_count.c.in similarity index 90% rename from ompi/mpi/c/get_count.c rename to ompi/mpi/c/get_count.c.in index d2321a1dcc0..b6526c34cc0 100644 --- a/ompi/mpi/c/get_count.c +++ b/ompi/mpi/c/get_count.c.in @@ -32,17 +32,7 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Get_count = PMPI_Get_count -#endif -#define MPI_Get_count PMPI_Get_count -#endif - -static const char FUNC_NAME[] = "MPI_Get_count"; - - -int MPI_Get_count(const MPI_Status *status, MPI_Datatype datatype, int *count) +PROTOTYPE ERROR_CLASS Get_count(STATUS status, DATATYPE datatype, INT_OUT count) { size_t size = 0, internal_count; int rc = MPI_SUCCESS; diff --git a/ompi/mpi/c/get_elements.c b/ompi/mpi/c/get_elements.c.in similarity index 90% rename from ompi/mpi/c/get_elements.c rename to ompi/mpi/c/get_elements.c.in index 3789c96f5ca..5e4173d8865 100644 --- a/ompi/mpi/c/get_elements.c +++ b/ompi/mpi/c/get_elements.c.in @@ -32,16 +32,7 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Get_elements = PMPI_Get_elements -#endif -#define MPI_Get_elements PMPI_Get_elements -#endif - -static const char FUNC_NAME[] = "MPI_Get_elements"; - -int MPI_Get_elements(const MPI_Status *status, MPI_Datatype datatype, int *count) +PROTOTYPE ERROR_CLASS Get_elements(STATUS status, DATATYPE datatype, INT_OUT count) { size_t internal_count; int ret; diff --git a/ompi/mpi/c/get_elements_x.c b/ompi/mpi/c/get_elements_x.c.in similarity index 90% rename from ompi/mpi/c/get_elements_x.c rename to ompi/mpi/c/get_elements_x.c.in index 3224d0f1cce..46bb90ef7ee 100644 --- a/ompi/mpi/c/get_elements_x.c +++ b/ompi/mpi/c/get_elements_x.c.in @@ -32,16 +32,8 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Get_elements_x = PMPI_Get_elements_x -#endif -#define MPI_Get_elements_x PMPI_Get_elements_x -#endif -static const char FUNC_NAME[] = "MPI_Get_elements_x"; - -int MPI_Get_elements_x(const MPI_Status *status, MPI_Datatype datatype, MPI_Count *count) +PROTOTYPE ERROR_CLASS Get_elements_x(STATUS status, DATATYPE datatype, ELEMENT_COUNT count) { size_t internal_count; int ret; diff --git a/ompi/mpi/c/get_library_version.c b/ompi/mpi/c/get_library_version.c.in similarity index 93% rename from ompi/mpi/c/get_library_version.c rename to ompi/mpi/c/get_library_version.c.in index cb82d91c108..52da2059e39 100644 --- a/ompi/mpi/c/get_library_version.c +++ b/ompi/mpi/c/get_library_version.c.in @@ -27,17 +27,7 @@ #include "ompi/communicator/communicator.h" #include "ompi/errhandler/errhandler.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Get_library_version = PMPI_Get_library_version -#endif -#define MPI_Get_library_version PMPI_Get_library_version -#endif - -static const char FUNC_NAME[] = "MPI_Get_library_version"; - - -int MPI_Get_library_version(char *version, int *resultlen) +PROTOTYPE ERROR_CLASS get_library_version(STRING_OUT version, INT_OUT resultlen) { int len_left; char *ptr, tmp[MPI_MAX_LIBRARY_VERSION_STRING]; diff --git a/ompi/mpi/c/get_processor_name.c b/ompi/mpi/c/get_processor_name.c.in similarity index 87% rename from ompi/mpi/c/get_processor_name.c rename to ompi/mpi/c/get_processor_name.c.in index c76fd6dcdd3..d705c4d25a3 100644 --- a/ompi/mpi/c/get_processor_name.c +++ b/ompi/mpi/c/get_processor_name.c.in @@ -30,17 +30,7 @@ #include "ompi/communicator/communicator.h" #include "ompi/errhandler/errhandler.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Get_processor_name = PMPI_Get_processor_name -#endif -#define MPI_Get_processor_name PMPI_Get_processor_name -#endif - -static const char FUNC_NAME[] = "MPI_Get_processor_name"; - - -int MPI_Get_processor_name(char *name, int *resultlen) +PROTOTYPE ERROR_CLASS get_processor_name(STRING_OUT name, INT_OUT resultlen) { if ( MPI_PARAM_CHECK) { OMPI_ERR_INIT_FINALIZE(FUNC_NAME); diff --git a/ompi/mpi/c/get_version.c b/ompi/mpi/c/get_version.c.in similarity index 91% rename from ompi/mpi/c/get_version.c rename to ompi/mpi/c/get_version.c.in index 181e84987f0..2a40c81fe84 100644 --- a/ompi/mpi/c/get_version.c +++ b/ompi/mpi/c/get_version.c.in @@ -27,17 +27,8 @@ #include "ompi/communicator/communicator.h" #include "ompi/errhandler/errhandler.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Get_version = PMPI_Get_version -#endif -#define MPI_Get_version PMPI_Get_version -#endif -static const char FUNC_NAME[] = "MPI_Get_version"; - - -int MPI_Get_version(int *version, int *subversion) +PROTOTYPE ERROR_CLASS Get_version(INT_OUT version, INT_OUT subversion) { if (MPI_PARAM_CHECK) { /* Per MPI-2:3.1, this function can be invoked before diff --git a/ompi/mpi/c/graph_create.c b/ompi/mpi/c/graph_create.c.in similarity index 92% rename from ompi/mpi/c/graph_create.c rename to ompi/mpi/c/graph_create.c.in index c01aed97cc1..8b55c6bbe45 100644 --- a/ompi/mpi/c/graph_create.c +++ b/ompi/mpi/c/graph_create.c.in @@ -33,18 +33,9 @@ #include "ompi/mca/topo/base/base.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Graph_create = PMPI_Graph_create -#endif -#define MPI_Graph_create PMPI_Graph_create -#endif - -static const char FUNC_NAME[] = "MPI_Graph_create"; - -int MPI_Graph_create(MPI_Comm old_comm, int nnodes, const int indx[], - const int edges[], int reorder, MPI_Comm *comm_graph) +PROTOTYPE ERROR_CLASS Graph_create(COMM old_comm, INT nnodes, INT_ARRAY indx, + INT_ARRAY edges, INT reorder, COMM_OUT comm_graph) { mca_topo_base_module_t* topo; int err; diff --git a/ompi/mpi/c/graph_get.c b/ompi/mpi/c/graph_get.c.in similarity index 88% rename from ompi/mpi/c/graph_get.c rename to ompi/mpi/c/graph_get.c.in index c96d5027d42..d38896882aa 100644 --- a/ompi/mpi/c/graph_get.c +++ b/ompi/mpi/c/graph_get.c.in @@ -30,18 +30,8 @@ #include "ompi/mca/topo/topo.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Graph_get = PMPI_Graph_get -#endif -#define MPI_Graph_get PMPI_Graph_get -#endif - -static const char FUNC_NAME[] = "MPI_Graph_get"; - - -int MPI_Graph_get(MPI_Comm comm, int maxindx, int maxedges, - int indx[], int edges[]) +PROTOTYPE ERROR_CLASS Graph_get(COMM comm, INT maxindx, INT maxedges, + INT_OUT indx, INT_OUT edges) { int err; diff --git a/ompi/mpi/c/graph_map.c b/ompi/mpi/c/graph_map.c.in similarity index 89% rename from ompi/mpi/c/graph_map.c rename to ompi/mpi/c/graph_map.c.in index 8088b2f3483..0c29db29a99 100644 --- a/ompi/mpi/c/graph_map.c +++ b/ompi/mpi/c/graph_map.c.in @@ -32,18 +32,8 @@ #include "ompi/mca/topo/topo.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Graph_map = PMPI_Graph_map -#endif -#define MPI_Graph_map PMPI_Graph_map -#endif - -static const char FUNC_NAME[] = "MPI_Graph_map"; - - -int MPI_Graph_map(MPI_Comm comm, int nnodes, const int indx[], const int edges[], - int *newrank) +PROTOTYPE ERROR_CLASS Graph_map(COMM comm, INT nnodes, INT_ARRAY indx, INT_ARRAY edges, + INT_OUT newrank) { int err = MPI_SUCCESS; diff --git a/ompi/mpi/c/graph_neighbors.c b/ompi/mpi/c/graph_neighbors.c.in similarity index 88% rename from ompi/mpi/c/graph_neighbors.c rename to ompi/mpi/c/graph_neighbors.c.in index 867a841baa0..cf477980e98 100644 --- a/ompi/mpi/c/graph_neighbors.c +++ b/ompi/mpi/c/graph_neighbors.c.in @@ -30,18 +30,8 @@ #include "ompi/mca/topo/topo.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Graph_neighbors = PMPI_Graph_neighbors -#endif -#define MPI_Graph_neighbors PMPI_Graph_neighbors -#endif - -static const char FUNC_NAME[] = "MPI_Graph_neighbors"; - - -int MPI_Graph_neighbors(MPI_Comm comm, int rank, int maxneighbors, - int neighbors[]) +PROTOTYPE ERROR_CLASS Graph_neighbors(COMM comm, INT rank, INT maxneighbors, + INT_OUT neighbors) { int err; diff --git a/ompi/mpi/c/graph_neighbors_count.c b/ompi/mpi/c/graph_neighbors_count.c.in similarity index 87% rename from ompi/mpi/c/graph_neighbors_count.c rename to ompi/mpi/c/graph_neighbors_count.c.in index db1fb11dc7c..caba04dd13d 100644 --- a/ompi/mpi/c/graph_neighbors_count.c +++ b/ompi/mpi/c/graph_neighbors_count.c.in @@ -29,17 +29,7 @@ #include "ompi/mca/topo/topo.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Graph_neighbors_count = PMPI_Graph_neighbors_count -#endif -#define MPI_Graph_neighbors_count PMPI_Graph_neighbors_count -#endif - -static const char FUNC_NAME[] = "MPI_Graph_neighbors_count"; - - -int MPI_Graph_neighbors_count(MPI_Comm comm, int rank, int *nneighbors) +PROTOTYPE ERROR_CLASS Graph_neighbors_count(COMM comm, INT rank, INT_OUT nneighbors) { int err; diff --git a/ompi/mpi/c/graphdims_get.c b/ompi/mpi/c/graphdims_get.c.in similarity index 88% rename from ompi/mpi/c/graphdims_get.c rename to ompi/mpi/c/graphdims_get.c.in index 8af76da95ee..19f813d9fb1 100644 --- a/ompi/mpi/c/graphdims_get.c +++ b/ompi/mpi/c/graphdims_get.c.in @@ -29,17 +29,8 @@ #include "ompi/mca/topo/topo.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Graphdims_get = PMPI_Graphdims_get -#endif -#define MPI_Graphdims_get PMPI_Graphdims_get -#endif -static const char FUNC_NAME[] = "MPI_Graphdims_get"; - - -int MPI_Graphdims_get(MPI_Comm comm, int *nnodes, int *nedges) +PROTOTYPE ERROR_CLASS Graphdims_get(COMM comm, INT_OUT nnodes, INT_OUT nedges) { int err; diff --git a/ompi/mpi/c/grequest_complete.c b/ompi/mpi/c/grequest_complete.c.in similarity index 85% rename from ompi/mpi/c/grequest_complete.c rename to ompi/mpi/c/grequest_complete.c.in index 477441af161..ff1e5e803a0 100644 --- a/ompi/mpi/c/grequest_complete.c +++ b/ompi/mpi/c/grequest_complete.c.in @@ -28,17 +28,8 @@ #include "ompi/request/grequest.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Grequest_complete = PMPI_Grequest_complete -#endif -#define MPI_Grequest_complete PMPI_Grequest_complete -#endif -static const char FUNC_NAME[] = "MPI_Grequest_complete"; - - -int MPI_Grequest_complete(MPI_Request request) +PROTOTYPE ERROR_CLASS Grequest_complete(REQUEST request) { int rc = MPI_SUCCESS; diff --git a/ompi/mpi/c/grequest_start.c b/ompi/mpi/c/grequest_start.c.in similarity index 76% rename from ompi/mpi/c/grequest_start.c rename to ompi/mpi/c/grequest_start.c.in index 20077d5a027..2699d937649 100644 --- a/ompi/mpi/c/grequest_start.c +++ b/ompi/mpi/c/grequest_start.c.in @@ -27,20 +27,11 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/request/grequest.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Grequest_start = PMPI_Grequest_start -#endif -#define MPI_Grequest_start PMPI_Grequest_start -#endif -static const char FUNC_NAME[] = "MPI_Grequest_start"; - - -int MPI_Grequest_start(MPI_Grequest_query_function *query_fn, - MPI_Grequest_free_function *free_fn, - MPI_Grequest_cancel_function *cancel_fn, - void *extra_state, MPI_Request *request) +PROTOTYPE ERROR_CLASS Grequest_start(GREQUEST_QUERY_FUNCTION query_fn, + GREQUEST_FREE_FUNCTION free_fn, + GREQUEST_CANCEL_FUNCTION cancel_fn, + BUFFER_OUT extra_state, REQUEST_INOUT request) { int rc; diff --git a/ompi/mpi/c/group_c2f.c b/ompi/mpi/c/group_c2f.c.in similarity index 85% rename from ompi/mpi/c/group_c2f.c rename to ompi/mpi/c/group_c2f.c.in index 0c4022548ff..88c25b66573 100644 --- a/ompi/mpi/c/group_c2f.c +++ b/ompi/mpi/c/group_c2f.c.in @@ -27,17 +27,7 @@ #include "ompi/mpi/fortran/base/fint_2_int.h" #include "ompi/group/group.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Group_c2f = PMPI_Group_c2f -#endif -#define MPI_Group_c2f PMPI_Group_c2f -#endif - -static const char FUNC_NAME[] = "MPI_Group_c2f"; - - -MPI_Fint MPI_Group_c2f(MPI_Group group) +PROTOTYPE FINT group_c2f(GROUP group) { if ( MPI_PARAM_CHECK ) { OMPI_ERR_INIT_FINALIZE(FUNC_NAME); diff --git a/ompi/mpi/c/group_compare.c b/ompi/mpi/c/group_compare.c.in similarity index 87% rename from ompi/mpi/c/group_compare.c rename to ompi/mpi/c/group_compare.c.in index f51230713bb..89fcfa5088a 100644 --- a/ompi/mpi/c/group_compare.c +++ b/ompi/mpi/c/group_compare.c.in @@ -30,17 +30,9 @@ #include "ompi/communicator/communicator.h" #include "ompi/proc/proc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Group_compare = PMPI_Group_compare -#endif -#define MPI_Group_compare PMPI_Group_compare -#endif -static const char FUNC_NAME[] = "MPI_Group_compare"; - - -int MPI_Group_compare(MPI_Group group1, MPI_Group group2, int *result) { +PROTOTYPE ERROR_CLASS Group_compare(GROUP group1, GROUP group2, INT_OUT result) +{ int return_value = MPI_SUCCESS; /* check for errors */ diff --git a/ompi/mpi/c/group_difference.c b/ompi/mpi/c/group_difference.c.in similarity index 83% rename from ompi/mpi/c/group_difference.c rename to ompi/mpi/c/group_difference.c.in index 4036b7f61d4..6c4218f0b15 100644 --- a/ompi/mpi/c/group_difference.c +++ b/ompi/mpi/c/group_difference.c.in @@ -28,18 +28,9 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/group/group.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Group_difference = PMPI_Group_difference -#endif -#define MPI_Group_difference PMPI_Group_difference -#endif - -static const char FUNC_NAME[] = "MPI_Group_difference"; - - -int MPI_Group_difference(MPI_Group group1, MPI_Group group2, - MPI_Group *new_group) { +PROTOTYPE ERROR_CLASS Group_difference(GROUP group1, GROUP group2, + GROUP_OUT new_group) +{ int err; /* error checking */ diff --git a/ompi/mpi/c/group_excl.c b/ompi/mpi/c/group_excl.c.in similarity index 90% rename from ompi/mpi/c/group_excl.c rename to ompi/mpi/c/group_excl.c.in index 7280f592ae0..be8b6b6e1b1 100644 --- a/ompi/mpi/c/group_excl.c +++ b/ompi/mpi/c/group_excl.c.in @@ -30,18 +30,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/communicator/communicator.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Group_excl = PMPI_Group_excl -#endif -#define MPI_Group_excl PMPI_Group_excl -#endif - -static const char FUNC_NAME[] = "MPI_Group_excl"; - - -int MPI_Group_excl(MPI_Group group, int n, const int ranks[], - MPI_Group *new_group) +PROTOTYPE ERROR_CLASS Group_excl(GROUP group, INT n, INT_ARRAY ranks, + GROUP_OUT new_group) { ompi_group_t *group_pointer = (ompi_group_t *)group; int i, err, group_size; diff --git a/ompi/mpi/c/group_f2c.c b/ompi/mpi/c/group_f2c.c.in similarity index 87% rename from ompi/mpi/c/group_f2c.c rename to ompi/mpi/c/group_f2c.c.in index d6ee5c68f50..484c60e3a1d 100644 --- a/ompi/mpi/c/group_f2c.c +++ b/ompi/mpi/c/group_f2c.c.in @@ -28,17 +28,7 @@ #include "ompi/mpi/fortran/base/fint_2_int.h" #include "ompi/group/group.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Group_f2c = PMPI_Group_f2c -#endif -#define MPI_Group_f2c PMPI_Group_f2c -#endif - -static const char FUNC_NAME[] = "MPI_Group_f2c"; - - -MPI_Group MPI_Group_f2c(MPI_Fint group_f) +PROTOTYPE GROUP group_f2c(FINT group_f) { int group_index = OMPI_FINT_2_INT(group_f); diff --git a/ompi/mpi/c/group_free.c b/ompi/mpi/c/group_free.c.in similarity index 90% rename from ompi/mpi/c/group_free.c rename to ompi/mpi/c/group_free.c.in index f0b5788046c..a4eeb61adad 100644 --- a/ompi/mpi/c/group_free.c +++ b/ompi/mpi/c/group_free.c.in @@ -27,17 +27,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/group/group.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Group_free = PMPI_Group_free -#endif -#define MPI_Group_free PMPI_Group_free -#endif -static const char FUNC_NAME[] = "MPI_Group_free"; - - -int MPI_Group_free(MPI_Group *group) +PROTOTYPE ERROR_CLASS Group_free(GROUP_OUT group) { int ret; diff --git a/ompi/mpi/c/group_from_session_pset.c b/ompi/mpi/c/group_from_session_pset.c.in similarity index 79% rename from ompi/mpi/c/group_from_session_pset.c rename to ompi/mpi/c/group_from_session_pset.c.in index 4341a7b3a57..5a01207c275 100644 --- a/ompi/mpi/c/group_from_session_pset.c +++ b/ompi/mpi/c/group_from_session_pset.c.in @@ -16,17 +16,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/instance/instance.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Group_from_session_pset = PMPI_Group_from_session_pset -#endif -#define MPI_Group_from_session_pset PMPI_Group_from_session_pset -#endif -static const char FUNC_NAME[] = "MPI_Group_from_session_pset"; - - -int MPI_Group_from_session_pset (MPI_Session session, const char *pset_name, MPI_Group *newgroup) +PROTOTYPE ERROR_CLASS Group_from_session_pset (SESSION session, STRING pset_name, GROUP_OUT newgroup) { int rc; diff --git a/ompi/mpi/c/group_incl.c b/ompi/mpi/c/group_incl.c.in similarity index 90% rename from ompi/mpi/c/group_incl.c rename to ompi/mpi/c/group_incl.c.in index 7c1fb84531f..a5b46bd9394 100644 --- a/ompi/mpi/c/group_incl.c +++ b/ompi/mpi/c/group_incl.c.in @@ -31,17 +31,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/communicator/communicator.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Group_incl = PMPI_Group_incl -#endif -#define MPI_Group_incl PMPI_Group_incl -#endif -static const char FUNC_NAME[] = "MPI_Group_incl"; - - -int MPI_Group_incl(MPI_Group group, int n, const int ranks[], MPI_Group *new_group) +PROTOTYPE ERROR_CLASS Group_incl(GROUP group, INT n, INT_ARRAY ranks, GROUP_OUT new_group) { int i, group_size, err; ompi_group_t *group_pointer; diff --git a/ompi/mpi/c/group_intersection.c b/ompi/mpi/c/group_intersection.c.in similarity index 83% rename from ompi/mpi/c/group_intersection.c rename to ompi/mpi/c/group_intersection.c.in index 93e56d54b79..1dcebc73798 100644 --- a/ompi/mpi/c/group_intersection.c +++ b/ompi/mpi/c/group_intersection.c.in @@ -28,18 +28,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/communicator/communicator.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Group_intersection = PMPI_Group_intersection -#endif -#define MPI_Group_intersection PMPI_Group_intersection -#endif - -static const char FUNC_NAME[] = "MPI_Group_intersection"; - - -int MPI_Group_intersection(MPI_Group group1, MPI_Group group2, - MPI_Group *new_group) +PROTOTYPE ERROR_CLASS Group_intersection(GROUP group1, GROUP group2, + GROUP_OUT new_group) { int err; diff --git a/ompi/mpi/c/group_range_excl.c b/ompi/mpi/c/group_range_excl.c.in similarity index 91% rename from ompi/mpi/c/group_range_excl.c rename to ompi/mpi/c/group_range_excl.c.in index 48bf5fb56cb..0587770824c 100644 --- a/ompi/mpi/c/group_range_excl.c +++ b/ompi/mpi/c/group_range_excl.c.in @@ -28,18 +28,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/communicator/communicator.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Group_range_excl = PMPI_Group_range_excl -#endif -#define MPI_Group_range_excl PMPI_Group_range_excl -#endif - -static const char FUNC_NAME[] = "MPI_Group_range_excl"; - - -int MPI_Group_range_excl(MPI_Group group, int n_triplets, int ranges[][3], - MPI_Group *new_group) +PROTOTYPE ERROR_CLASS Group_range_excl(GROUP group, INT n_triplets, RANGE_ARRAY ranges, + GROUP_OUT new_group) { int err, i, group_size, indx; int * elements_int_list; diff --git a/ompi/mpi/c/group_range_incl.c b/ompi/mpi/c/group_range_incl.c.in similarity index 91% rename from ompi/mpi/c/group_range_incl.c rename to ompi/mpi/c/group_range_incl.c.in index 3559b88f872..21e8a5d274c 100644 --- a/ompi/mpi/c/group_range_incl.c +++ b/ompi/mpi/c/group_range_incl.c.in @@ -28,18 +28,9 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/communicator/communicator.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Group_range_incl = PMPI_Group_range_incl -#endif -#define MPI_Group_range_incl PMPI_Group_range_incl -#endif -static const char FUNC_NAME[] = "MPI_Group_range_incl"; - - -int MPI_Group_range_incl(MPI_Group group, int n_triplets, int ranges[][3], - MPI_Group *new_group) +PROTOTYPE ERROR_CLASS Group_range_incl(GROUP group, INT n_triplets, RANGE_ARRAY ranges, + GROUP_OUT new_group) { int err, i,indx; int group_size; diff --git a/ompi/mpi/c/group_rank.c b/ompi/mpi/c/group_rank.c.in similarity index 86% rename from ompi/mpi/c/group_rank.c rename to ompi/mpi/c/group_rank.c.in index ea42ce8b11c..4ca6aa56a4d 100644 --- a/ompi/mpi/c/group_rank.c +++ b/ompi/mpi/c/group_rank.c.in @@ -27,17 +27,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/group/group.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Group_rank = PMPI_Group_rank -#endif -#define MPI_Group_rank PMPI_Group_rank -#endif -static const char FUNC_NAME[] = "MPI_Group_rank"; - - -int MPI_Group_rank(MPI_Group group, int *rank) +PROTOTYPE ERROR_CLASS Group_rank(GROUP group, INT_OUT rank) { /* error checking */ if( MPI_PARAM_CHECK ) { diff --git a/ompi/mpi/c/group_size.c b/ompi/mpi/c/group_size.c.in similarity index 86% rename from ompi/mpi/c/group_size.c rename to ompi/mpi/c/group_size.c.in index 51e4bbda3de..3204d66590f 100644 --- a/ompi/mpi/c/group_size.c +++ b/ompi/mpi/c/group_size.c.in @@ -27,17 +27,7 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/group/group.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Group_size = PMPI_Group_size -#endif -#define MPI_Group_size PMPI_Group_size -#endif - -static const char FUNC_NAME[] = "MPI_Group_size"; - - -int MPI_Group_size(MPI_Group group, int *size) +PROTOTYPE ERROR_CLASS Group_size(GROUP group, INT_OUT size) { /* error checking */ if( MPI_PARAM_CHECK ) { diff --git a/ompi/mpi/c/group_translate_ranks.c b/ompi/mpi/c/group_translate_ranks.c.in similarity index 85% rename from ompi/mpi/c/group_translate_ranks.c rename to ompi/mpi/c/group_translate_ranks.c.in index c1949fe1a94..46a0b75aa85 100644 --- a/ompi/mpi/c/group_translate_ranks.c +++ b/ompi/mpi/c/group_translate_ranks.c.in @@ -30,18 +30,9 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/group/group.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Group_translate_ranks = PMPI_Group_translate_ranks -#endif -#define MPI_Group_translate_ranks PMPI_Group_translate_ranks -#endif -static const char FUNC_NAME[] = "MPI_Group_translate_ranks"; - - -int MPI_Group_translate_ranks(MPI_Group group1, int n_ranks, const int ranks1[], - MPI_Group group2, int ranks2[]) +PROTOTYPE ERROR_CLASS Group_translate_ranks(GROUP group1, INT n_ranks, INT_ARRAY ranks1, + GROUP group2, INT_OUT ranks2) { int err; diff --git a/ompi/mpi/c/group_union.c b/ompi/mpi/c/group_union.c.in similarity index 85% rename from ompi/mpi/c/group_union.c rename to ompi/mpi/c/group_union.c.in index cdfc3efb3c9..5d3400970bd 100644 --- a/ompi/mpi/c/group_union.c +++ b/ompi/mpi/c/group_union.c.in @@ -28,17 +28,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/communicator/communicator.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Group_union = PMPI_Group_union -#endif -#define MPI_Group_union PMPI_Group_union -#endif -static const char FUNC_NAME[] = "MPI_Group_union"; - - -int MPI_Group_union(MPI_Group group1, MPI_Group group2, MPI_Group *new_group) +PROTOTYPE ERROR_CLASS Group_union(GROUP group1, GROUP group2, GROUP_OUT new_group) { int err; diff --git a/ompi/mpi/c/iallgather.c b/ompi/mpi/c/iallgather.c.in similarity index 90% rename from ompi/mpi/c/iallgather.c rename to ompi/mpi/c/iallgather.c.in index 75cfb5d3ceb..6bc2aeb6b90 100644 --- a/ompi/mpi/c/iallgather.c +++ b/ompi/mpi/c/iallgather.c.in @@ -35,19 +35,9 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Iallgather = PMPI_Iallgather -#endif -#define MPI_Iallgather PMPI_Iallgather -#endif - -static const char FUNC_NAME[] = "MPI_Iallgather"; - - -int MPI_Iallgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, - MPI_Comm comm, MPI_Request *request) +PROTOTYPE ERROR_CLASS Iallgather(BUFFER sendbuf, INT sendcount, DATATYPE sendtype, + BUFFER_OUT recvbuf, INT recvcount, DATATYPE recvtype, + COMM comm, REQUEST_INOUT request) { int err; diff --git a/ompi/mpi/c/iallgatherv.c b/ompi/mpi/c/iallgatherv.c.in similarity index 91% rename from ompi/mpi/c/iallgatherv.c rename to ompi/mpi/c/iallgatherv.c.in index 3b9142c727a..92a3cbc2a9f 100644 --- a/ompi/mpi/c/iallgatherv.c +++ b/ompi/mpi/c/iallgatherv.c.in @@ -35,19 +35,9 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Iallgatherv = PMPI_Iallgatherv -#endif -#define MPI_Iallgatherv PMPI_Iallgatherv -#endif - -static const char FUNC_NAME[] = "MPI_Iallgatherv"; - - -int MPI_Iallgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, const int recvcounts[], const int displs[], - MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request) +PROTOTYPE ERROR_CLASS Iallgatherv(BUFFER sendbuf, COUNT sendcount, DATATYPE sendtype, + BUFFER_OUT recvbuf, COUNT_ARRAY recvcounts, DISP_ARRAY displs, + DATATYPE recvtype, COMM comm, REQUEST_INOUT request) { int i, size, err; ompi_count_array_t recvcounts_desc; diff --git a/ompi/mpi/c/iallreduce.c b/ompi/mpi/c/iallreduce.c.in similarity index 91% rename from ompi/mpi/c/iallreduce.c rename to ompi/mpi/c/iallreduce.c.in index ee9cf01e7a3..96c57296aeb 100644 --- a/ompi/mpi/c/iallreduce.c +++ b/ompi/mpi/c/iallreduce.c.in @@ -35,18 +35,9 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Iallreduce = PMPI_Iallreduce -#endif -#define MPI_Iallreduce PMPI_Iallreduce -#endif -static const char FUNC_NAME[] = "MPI_Iallreduce"; - - -int MPI_Iallreduce(const void *sendbuf, void *recvbuf, int count, - MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request) +PROTOTYPE ERROR_CLASS Iallreduce(BUFFER sendbuf, BUFFER_OUT recvbuf, INT count, + DATATYPE datatype, OP op, COMM comm, REQUEST_INOUT request) { int err; diff --git a/ompi/mpi/c/ialltoall.c b/ompi/mpi/c/ialltoall.c.in similarity index 90% rename from ompi/mpi/c/ialltoall.c rename to ompi/mpi/c/ialltoall.c.in index 15451ba1e63..778a5c8a9f5 100644 --- a/ompi/mpi/c/ialltoall.c +++ b/ompi/mpi/c/ialltoall.c.in @@ -35,19 +35,9 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Ialltoall = PMPI_Ialltoall -#endif -#define MPI_Ialltoall PMPI_Ialltoall -#endif - -static const char FUNC_NAME[] = "MPI_Ialltoall"; - - -int MPI_Ialltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, - MPI_Comm comm, MPI_Request *request) +PROTOTYPE ERROR_CLASS Ialltoall(BUFFER sendbuf, INT sendcount, DATATYPE sendtype, + BUFFER_OUT recvbuf, INT recvcount, DATATYPE recvtype, + COMM comm, REQUEST_INOUT request) { size_t sendtype_size, recvtype_size; int err; diff --git a/ompi/mpi/c/ialltoallv.c b/ompi/mpi/c/ialltoallv.c.in similarity index 91% rename from ompi/mpi/c/ialltoallv.c rename to ompi/mpi/c/ialltoallv.c.in index 97d9cc31b91..015559f9fec 100644 --- a/ompi/mpi/c/ialltoallv.c +++ b/ompi/mpi/c/ialltoallv.c.in @@ -34,20 +34,11 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Ialltoallv = PMPI_Ialltoallv -#endif -#define MPI_Ialltoallv PMPI_Ialltoallv -#endif -static const char FUNC_NAME[] = "MPI_Ialltoallv"; - - -int MPI_Ialltoallv(const void *sendbuf, const int sendcounts[], const int sdispls[], - MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], - const int rdispls[], MPI_Datatype recvtype, MPI_Comm comm, - MPI_Request *request) +PROTOTYPE ERROR_CLASS Ialltoallv(BUFFER sendbuf, COUNT_ARRAY sendcounts, DISP_ARRAY sdispls, + DATATYPE sendtype, BUFFER_OUT recvbuf, COUNT_ARRAY recvcounts, + DISP_ARRAY rdispls, DATATYPE recvtype, COMM comm, + REQUEST_INOUT request) { int i, size, err; ompi_count_array_t sendcounts_desc, recvcounts_desc; diff --git a/ompi/mpi/c/ialltoallw.c b/ompi/mpi/c/ialltoallw.c.in similarity index 90% rename from ompi/mpi/c/ialltoallw.c rename to ompi/mpi/c/ialltoallw.c.in index 240f782adba..c9b9af83985 100644 --- a/ompi/mpi/c/ialltoallw.c +++ b/ompi/mpi/c/ialltoallw.c.in @@ -34,20 +34,11 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Ialltoallw = PMPI_Ialltoallw -#endif -#define MPI_Ialltoallw PMPI_Ialltoallw -#endif -static const char FUNC_NAME[] = "MPI_Ialltoallw"; - - -int MPI_Ialltoallw(const void *sendbuf, const int sendcounts[], const int sdispls[], - const MPI_Datatype sendtypes[], void *recvbuf, const int recvcounts[], - const int rdispls[], const MPI_Datatype recvtypes[], MPI_Comm comm, - MPI_Request *request) +PROTOTYPE ERROR_CLASS Ialltoallw(BUFFER sendbuf, COUNT_ARRAY sendcounts, DISP_ARRAY sdispls, + DATATYPE_ARRAY sendtypes, BUFFER_OUT recvbuf, COUNT_ARRAY recvcounts, + DISP_ARRAY rdispls, DATATYPE_ARRAY recvtypes, COMM comm, + REQUEST_INOUT request) { int i, size, err; ompi_count_array_t sendcounts_desc, recvcounts_desc; diff --git a/ompi/mpi/c/ibarrier.c b/ompi/mpi/c/ibarrier.c.in similarity index 87% rename from ompi/mpi/c/ibarrier.c rename to ompi/mpi/c/ibarrier.c.in index e5672a14580..b51e0095a0c 100644 --- a/ompi/mpi/c/ibarrier.c +++ b/ompi/mpi/c/ibarrier.c.in @@ -29,17 +29,8 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Ibarrier = PMPI_Ibarrier -#endif -#define MPI_Ibarrier PMPI_Ibarrier -#endif -static const char FUNC_NAME[] = "MPI_Ibarrier"; - - -int MPI_Ibarrier(MPI_Comm comm, MPI_Request *request) +PROTOTYPE ERROR_CLASS Ibarrier(COMM comm, REQUEST_INOUT request) { int err = MPI_SUCCESS; diff --git a/ompi/mpi/c/ibcast.c b/ompi/mpi/c/ibcast.c.in similarity index 92% rename from ompi/mpi/c/ibcast.c rename to ompi/mpi/c/ibcast.c.in index acb55f93b9b..b0e26bc8147 100644 --- a/ompi/mpi/c/ibcast.c +++ b/ompi/mpi/c/ibcast.c.in @@ -23,18 +23,9 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Ibcast = PMPI_Ibcast -#endif -#define MPI_Ibcast PMPI_Ibcast -#endif -static const char FUNC_NAME[] = "MPI_Ibcast"; - - -int MPI_Ibcast(void *buffer, int count, MPI_Datatype datatype, - int root, MPI_Comm comm, MPI_Request *request) +PROTOTYPE ERROR_CLASS Ibcast(BUFFER_OUT buffer, INT count, DATATYPE datatype, + INT root, COMM comm, REQUEST_INOUT request) { int err; diff --git a/ompi/mpi/c/ibsend.c b/ompi/mpi/c/ibsend.c.in similarity index 90% rename from ompi/mpi/c/ibsend.c rename to ompi/mpi/c/ibsend.c.in index fa22b745213..046e16fd038 100644 --- a/ompi/mpi/c/ibsend.c +++ b/ompi/mpi/c/ibsend.c.in @@ -34,18 +34,9 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Ibsend = PMPI_Ibsend -#endif -#define MPI_Ibsend PMPI_Ibsend -#endif - -static const char FUNC_NAME[] = "MPI_Ibsend"; - -int MPI_Ibsend(const void *buf, int count, MPI_Datatype type, int dest, - int tag, MPI_Comm comm, MPI_Request *request) +PROTOTYPE ERROR_CLASS Ibsend(BUFFER buf, INT count, DATATYPE type, INT dest, + INT tag, COMM comm, REQUEST_INOUT request) { int rc = MPI_SUCCESS; diff --git a/ompi/mpi/c/iexscan.c b/ompi/mpi/c/iexscan.c.in similarity index 90% rename from ompi/mpi/c/iexscan.c rename to ompi/mpi/c/iexscan.c.in index 0c90e47af12..5f1e9936f87 100644 --- a/ompi/mpi/c/iexscan.c +++ b/ompi/mpi/c/iexscan.c.in @@ -33,18 +33,9 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Iexscan = PMPI_Iexscan -#endif -#define MPI_Iexscan PMPI_Iexscan -#endif -static const char FUNC_NAME[] = "MPI_Iexscan"; - - -int MPI_Iexscan(const void *sendbuf, void *recvbuf, int count, - MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request) +PROTOTYPE ERROR_CLASS Iexscan(BUFFER sendbuf, BUFFER_OUT recvbuf, INT count, + DATATYPE datatype, OP op, COMM comm, REQUEST_INOUT request) { int err; diff --git a/ompi/mpi/c/igather.c b/ompi/mpi/c/igather.c.in similarity index 94% rename from ompi/mpi/c/igather.c rename to ompi/mpi/c/igather.c.in index 37b977162b5..668cf37c115 100644 --- a/ompi/mpi/c/igather.c +++ b/ompi/mpi/c/igather.c.in @@ -35,19 +35,10 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Igather = PMPI_Igather -#endif -#define MPI_Igather PMPI_Igather -#endif -static const char FUNC_NAME[] = "MPI_Igather"; - - -int MPI_Igather(const void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, - int root, MPI_Comm comm, MPI_Request *request) +PROTOTYPE ERROR_CLASS Igather(BUFFER sendbuf, INT sendcount, DATATYPE sendtype, + BUFFER_OUT recvbuf, INT recvcount, DATATYPE recvtype, + INT root, COMM comm, REQUEST_INOUT request) { int err; diff --git a/ompi/mpi/c/igatherv.c b/ompi/mpi/c/igatherv.c.in similarity index 95% rename from ompi/mpi/c/igatherv.c rename to ompi/mpi/c/igatherv.c.in index f34993cb8a7..10fb8f4f527 100644 --- a/ompi/mpi/c/igatherv.c +++ b/ompi/mpi/c/igatherv.c.in @@ -33,19 +33,10 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Igatherv = PMPI_Igatherv -#endif -#define MPI_Igatherv PMPI_Igatherv -#endif -static const char FUNC_NAME[] = "MPI_Igatherv"; - - -int MPI_Igatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, const int recvcounts[], const int displs[], - MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request) +PROTOTYPE ERROR_CLASS Igatherv(BUFFER sendbuf, COUNT sendcount, DATATYPE sendtype, + BUFFER_OUT recvbuf, COUNT_ARRAY recvcounts, DISP_ARRAY displs, + DATATYPE recvtype, INT root, COMM comm, REQUEST_INOUT request) { int i, size, err; ompi_count_array_t recvcounts_desc; diff --git a/ompi/mpi/c/improbe.c b/ompi/mpi/c/improbe.c.in similarity index 88% rename from ompi/mpi/c/improbe.c rename to ompi/mpi/c/improbe.c.in index d0ea3f708f6..2eec2d2a6ae 100644 --- a/ompi/mpi/c/improbe.c +++ b/ompi/mpi/c/improbe.c.in @@ -23,18 +23,8 @@ #include "ompi/request/request.h" #include "ompi/message/message.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Improbe = PMPI_Improbe -#endif -#define MPI_Improbe PMPI_Improbe -#endif - -static const char FUNC_NAME[] = "MPI_Improbe"; - - -int MPI_Improbe(int source, int tag, MPI_Comm comm, int *flag, - MPI_Message *message, MPI_Status *status) +PROTOTYPE ERROR_CLASS Improbe(INT source, INT tag, COMM comm, INT_OUT flag, + MESSAGE_OUT message, STATUS_OUT status) { int rc; diff --git a/ompi/mpi/c/imrecv.c b/ompi/mpi/c/imrecv.c.in similarity index 86% rename from ompi/mpi/c/imrecv.c rename to ompi/mpi/c/imrecv.c.in index 719a3b8b719..1de0eec43c6 100644 --- a/ompi/mpi/c/imrecv.c +++ b/ompi/mpi/c/imrecv.c.in @@ -20,18 +20,8 @@ #include "ompi/request/request.h" #include "ompi/message/message.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Imrecv = PMPI_Imrecv -#endif -#define MPI_Imrecv PMPI_Imrecv -#endif - -static const char FUNC_NAME[] = "MPI_Imrecv"; - - -int MPI_Imrecv(void *buf, int count, MPI_Datatype type, - MPI_Message *message, MPI_Request *request) +PROTOTYPE ERROR_CLASS Imrecv(BUFFER_OUT buf, INT count, DATATYPE type, + MESSAGE_OUT message, REQUEST_INOUT request) { int rc = MPI_SUCCESS; ompi_communicator_t *comm; diff --git a/ompi/mpi/c/ineighbor_allgather.c b/ompi/mpi/c/ineighbor_allgather.c.in similarity index 90% rename from ompi/mpi/c/ineighbor_allgather.c rename to ompi/mpi/c/ineighbor_allgather.c.in index a6a5603ecd4..2d2bcacb5a1 100644 --- a/ompi/mpi/c/ineighbor_allgather.c +++ b/ompi/mpi/c/ineighbor_allgather.c.in @@ -38,19 +38,10 @@ #include "ompi/mca/topo/base/base.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Ineighbor_allgather = PMPI_Ineighbor_allgather -#endif -#define MPI_Ineighbor_allgather PMPI_Ineighbor_allgather -#endif -static const char FUNC_NAME[] = "MPI_Ineighbor_allgather"; - - -int MPI_Ineighbor_allgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, - MPI_Comm comm, MPI_Request *request) +PROTOTYPE ERROR_CLASS Ineighbor_allgather(BUFFER sendbuf, INT sendcount, DATATYPE sendtype, + BUFFER_OUT recvbuf, INT recvcount, DATATYPE recvtype, + COMM comm, REQUEST_INOUT request) { int err; diff --git a/ompi/mpi/c/ineighbor_allgatherv.c b/ompi/mpi/c/ineighbor_allgatherv.c.in similarity index 91% rename from ompi/mpi/c/ineighbor_allgatherv.c rename to ompi/mpi/c/ineighbor_allgatherv.c.in index 1a8f0c65e04..e34de21112e 100644 --- a/ompi/mpi/c/ineighbor_allgatherv.c +++ b/ompi/mpi/c/ineighbor_allgatherv.c.in @@ -38,19 +38,10 @@ #include "ompi/mca/topo/base/base.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Ineighbor_allgatherv = PMPI_Ineighbor_allgatherv -#endif -#define MPI_Ineighbor_allgatherv PMPI_Ineighbor_allgatherv -#endif -static const char FUNC_NAME[] = "MPI_Ineighbor_allgatherv"; - - -int MPI_Ineighbor_allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, const int recvcounts[], const int displs[], - MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request) +PROTOTYPE ERROR_CLASS Ineighbor_allgatherv(BUFFER sendbuf, COUNT sendcount, DATATYPE sendtype, + BUFFER_OUT recvbuf, COUNT_ARRAY recvcounts, DISP_ARRAY displs, + DATATYPE recvtype, COMM comm, REQUEST_INOUT request) { int i, size, err; ompi_count_array_t recvcounts_desc; diff --git a/ompi/mpi/c/ineighbor_alltoall.c b/ompi/mpi/c/ineighbor_alltoall.c.in similarity index 91% rename from ompi/mpi/c/ineighbor_alltoall.c rename to ompi/mpi/c/ineighbor_alltoall.c.in index 18ef991ecc5..4175a02a2f3 100644 --- a/ompi/mpi/c/ineighbor_alltoall.c +++ b/ompi/mpi/c/ineighbor_alltoall.c.in @@ -38,19 +38,10 @@ #include "ompi/mca/topo/base/base.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Ineighbor_alltoall = PMPI_Ineighbor_alltoall -#endif -#define MPI_Ineighbor_alltoall PMPI_Ineighbor_alltoall -#endif -static const char FUNC_NAME[] = "MPI_Ineighbor_alltoall"; - - -int MPI_Ineighbor_alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, - MPI_Comm comm, MPI_Request *request) +PROTOTYPE ERROR_CLASS Ineighbor_alltoall(BUFFER sendbuf, INT sendcount, DATATYPE sendtype, + BUFFER_OUT recvbuf, INT recvcount, DATATYPE recvtype, + COMM comm, REQUEST_INOUT request) { size_t sendtype_size, recvtype_size; int err; diff --git a/ompi/mpi/c/ineighbor_alltoallv.c b/ompi/mpi/c/ineighbor_alltoallv.c.in similarity index 91% rename from ompi/mpi/c/ineighbor_alltoallv.c rename to ompi/mpi/c/ineighbor_alltoallv.c.in index 97fe2728901..9ff9de63442 100644 --- a/ompi/mpi/c/ineighbor_alltoallv.c +++ b/ompi/mpi/c/ineighbor_alltoallv.c.in @@ -37,20 +37,11 @@ #include "ompi/mca/topo/base/base.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Ineighbor_alltoallv = PMPI_Ineighbor_alltoallv -#endif -#define MPI_Ineighbor_alltoallv PMPI_Ineighbor_alltoallv -#endif -static const char FUNC_NAME[] = "MPI_Ineighbor_alltoallv"; - - -int MPI_Ineighbor_alltoallv(const void *sendbuf, const int sendcounts[], const int sdispls[], - MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], - const int rdispls[], MPI_Datatype recvtype, MPI_Comm comm, - MPI_Request *request) +PROTOTYPE ERROR_CLASS Ineighbor_alltoallv(BUFFER sendbuf, COUNT_ARRAY sendcounts, DISP_ARRAY sdispls, + DATATYPE sendtype, BUFFER_OUT recvbuf, COUNT_ARRAY recvcounts, + DISP_ARRAY rdispls, DATATYPE recvtype, COMM comm, + REQUEST_INOUT request) { int i, err; int indegree, outdegree; diff --git a/ompi/mpi/c/ineighbor_alltoallw.c.in b/ompi/mpi/c/ineighbor_alltoallw.c.in new file mode 100644 index 00000000000..f54b851d6e4 --- /dev/null +++ b/ompi/mpi/c/ineighbor_alltoallw.c.in @@ -0,0 +1,144 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2022 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2008 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * Copyright (c) 2004-2005 The Regents of the University of California. + * All rights reserved. + * Copyright (c) 2007 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2012-2017 Los Alamos National Security, LLC. All rights + * reserved. + * Copyright (c) 2014-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2017 IBM Corporation. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" +#include + +#include "ompi/mpi/c/bindings.h" +#include "ompi/runtime/params.h" +#include "ompi/communicator/communicator.h" +#include "ompi/errhandler/errhandler.h" +#include "ompi/datatype/ompi_datatype.h" +#include "ompi/mca/coll/base/coll_base_util.h" +#include "ompi/memchecker.h" +#include "ompi/mca/topo/topo.h" +#include "ompi/mca/topo/base/base.h" +#include "ompi/runtime/ompi_spc.h" + + +PROTOTYPE ERROR_CLASS Ineighbor_alltoallw(BUFFER sendbuf, INT_ARRAY sendcounts, const MPI_Aint sdispls[], + const MPI_Datatype sendtypes[], BUFFER_OUT recvbuf, INT_ARRAY recvcounts, + const MPI_Aint rdispls[], const MPI_Datatype recvtypes[], COMM comm, + REQUEST_INOUT request) +{ + int i, err; + int indegree, outdegree; + + SPC_RECORD(OMPI_SPC_INEIGHBOR_ALLTOALLW, 1); + + MEMCHECKER( + ptrdiff_t recv_ext; + ptrdiff_t send_ext; + + memchecker_comm(comm); + + err = mca_topo_base_neighbor_count (comm, &indegree, &outdegree); + if (MPI_SUCCESS == err) { + if (MPI_IN_PLACE != sendbuf) { + for ( i = 0; i < outdegree; i++ ) { + memchecker_datatype(sendtypes[i]); + + ompi_datatype_type_extent(sendtypes[i], &send_ext); + + memchecker_call(&opal_memchecker_base_isdefined, + (char *)(sendbuf)+sdispls[i]*send_ext, + sendcounts[i], sendtypes[i]); + } + } + for ( i = 0; i < indegree; i++ ) { + memchecker_datatype(recvtypes[i]); + + ompi_datatype_type_extent(recvtypes[i], &recv_ext); + + memchecker_call(&opal_memchecker_base_isaddressable, + (char *)(recvbuf)+sdispls[i]*recv_ext, + recvcounts[i], recvtypes[i]); + } + } + ); + + if (MPI_PARAM_CHECK) { + + /* Unrooted operation -- same checks for all ranks */ + + err = MPI_SUCCESS; + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (ompi_comm_invalid(comm) || OMPI_COMM_IS_INTER(comm)) { + return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_COMM, + FUNC_NAME); + } else if (! OMPI_COMM_IS_TOPO(comm)) { + return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_TOPOLOGY, + FUNC_NAME); + } + + err = mca_topo_base_neighbor_count (comm, &indegree, &outdegree); + OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME); + if (((0 < outdegree) && ((NULL == sendcounts) || (NULL == sdispls) || (NULL == sendtypes))) || + ((0 < indegree) && ((NULL == recvcounts) || (NULL == rdispls) || (NULL == recvtypes))) || + MPI_IN_PLACE == sendbuf || MPI_IN_PLACE == recvbuf) { + return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); + } + for (i = 0; i < outdegree; ++i) { + OMPI_CHECK_DATATYPE_FOR_SEND(err, sendtypes[i], sendcounts[i]); + OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME); + } + for (i = 0; i < indegree; ++i) { + OMPI_CHECK_DATATYPE_FOR_RECV(err, recvtypes[i], recvcounts[i]); + OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME); + } + + if( OMPI_COMM_IS_CART(comm) ) { + const mca_topo_base_comm_cart_2_2_0_t *cart = comm->c_topo->mtc.cart; + if( 0 > cart->ndims ) { + return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); + } + } + else if( OMPI_COMM_IS_GRAPH(comm) ) { + int degree; + mca_topo_base_graph_neighbors_count(comm, ompi_comm_rank(comm), °ree); + if( 0 > degree ) { + return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); + } + } + else if( OMPI_COMM_IS_DIST_GRAPH(comm) ) { + const mca_topo_base_comm_dist_graph_2_2_0_t *dist_graph = comm->c_topo->mtc.dist_graph; + indegree = dist_graph->indegree; + outdegree = dist_graph->outdegree; + if( indegree < 0 || outdegree < 0 ) { + return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); + } + } + } + + /* Invoke the coll component to perform the back-end operation */ + err = comm->c_coll->coll_ineighbor_alltoallw(sendbuf, sendcounts, sdispls, sendtypes, + recvbuf, recvcounts, rdispls, recvtypes, comm, request, + comm->c_coll->coll_ineighbor_alltoallw_module); + if (OPAL_LIKELY(OMPI_SUCCESS == err)) { + ompi_coll_base_retain_datatypes_w(*request, sendtypes, recvtypes, true); + } + OMPI_ERRHANDLER_RETURN(err, comm, err, FUNC_NAME); +} + diff --git a/ompi/mpi/c/info_c2f.c b/ompi/mpi/c/info_c2f.c.in similarity index 86% rename from ompi/mpi/c/info_c2f.c rename to ompi/mpi/c/info_c2f.c.in index 372c8abe766..f7620ccec4f 100644 --- a/ompi/mpi/c/info_c2f.c +++ b/ompi/mpi/c/info_c2f.c.in @@ -30,17 +30,7 @@ #include "ompi/mpi/fortran/base/fint_2_int.h" #include "ompi/info/info.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Info_c2f = PMPI_Info_c2f -#endif -#define MPI_Info_c2f PMPI_Info_c2f -#endif - -/* static const char FUNC_NAME[] = "MPI_Info_c2f"; */ - - -MPI_Fint MPI_Info_c2f(MPI_Info info) +PROTOTYPE FINT info_c2f(INFO info) { if (MPI_PARAM_CHECK) { if (NULL == info || ompi_info_is_freed(info)) { diff --git a/ompi/mpi/c/info_create.c b/ompi/mpi/c/info_create.c.in similarity index 88% rename from ompi/mpi/c/info_create.c rename to ompi/mpi/c/info_create.c.in index c6f7ee18f26..a14391ce6d8 100644 --- a/ompi/mpi/c/info_create.c +++ b/ompi/mpi/c/info_create.c.in @@ -29,14 +29,6 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/info/info.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Info_create = PMPI_Info_create -#endif -#define MPI_Info_create PMPI_Info_create -#endif - -static const char FUNC_NAME[] = "MPI_Info_create"; /** * Create a new info object @@ -50,7 +42,7 @@ static const char FUNC_NAME[] = "MPI_Info_create"; * When an MPI_Info object is not being used, it should be freed using * MPI_Info_free */ -int MPI_Info_create(MPI_Info *info) +PROTOTYPE ERROR_CLASS Info_create(INFO_OUT info) { if (MPI_PARAM_CHECK) { if (NULL == info) { diff --git a/ompi/mpi/c/info_create_env.c b/ompi/mpi/c/info_create_env.c.in similarity index 88% rename from ompi/mpi/c/info_create_env.c rename to ompi/mpi/c/info_create_env.c.in index 68f7ffca99c..1c5f22b3c23 100644 --- a/ompi/mpi/c/info_create_env.c +++ b/ompi/mpi/c/info_create_env.c.in @@ -29,15 +29,6 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/info/info.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Info_create_env = PMPI_Info_create_env -#endif -#define MPI_Info_create_env PMPI_Info_create_env -#endif - -static const char FUNC_NAME[] = "MPI_Info_create_env"; - /** * Returns an info object with the same construction as MPI_INFO_ENV as created * during MPI_INIT or MPI_INIT_THREAD when the same arguments are used. @@ -53,7 +44,7 @@ static const char FUNC_NAME[] = "MPI_Info_create_env"; * When an MPI_Info object is not being used, it should be freed using * MPI_Info_free */ -int MPI_Info_create_env(int argc, char *argv[], MPI_Info *info) +PROTOTYPE ERROR_CLASS Info_create_env(INT argc, STRING_ARRAY argv, INFO_OUT info) { int rc; ompi_info_t *the_info; diff --git a/ompi/mpi/c/info_delete.c b/ompi/mpi/c/info_delete.c.in similarity index 91% rename from ompi/mpi/c/info_delete.c rename to ompi/mpi/c/info_delete.c.in index 3fcf5256782..c186a3af20f 100644 --- a/ompi/mpi/c/info_delete.c +++ b/ompi/mpi/c/info_delete.c.in @@ -34,16 +34,6 @@ #include #include -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Info_delete = PMPI_Info_delete -#endif -#define MPI_Info_delete PMPI_Info_delete -#endif - -static const char FUNC_NAME[] = "MPI_Info_delete"; - - /** * Delete a (key,value) pair from "info" * @@ -55,7 +45,8 @@ static const char FUNC_NAME[] = "MPI_Info_delete"; * @retval MPI_ERR_INFO * @retval MPI_ERR_INFO_KEYY */ -int MPI_Info_delete(MPI_Info info, const char *key) { +PROTOTYPE ERROR_CLASS Info_delete(INFO info, STRING key) +{ int key_length; int err; diff --git a/ompi/mpi/c/info_dup.c b/ompi/mpi/c/info_dup.c.in similarity index 91% rename from ompi/mpi/c/info_dup.c rename to ompi/mpi/c/info_dup.c.in index f678c2738b0..d9b3cb1c054 100644 --- a/ompi/mpi/c/info_dup.c +++ b/ompi/mpi/c/info_dup.c.in @@ -29,16 +29,6 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/info/info.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Info_dup = PMPI_Info_dup -#endif -#define MPI_Info_dup PMPI_Info_dup -#endif - -static const char FUNC_NAME[] = "MPI_Info_dup"; - - /** * MPI_Info_dup - Duplicate an 'MPI_Info' object * @@ -54,7 +44,8 @@ static const char FUNC_NAME[] = "MPI_Info_dup"; * When an info object is no longer being used, it should be freed with * 'MPI_Info_free'. */ -int MPI_Info_dup(MPI_Info info, MPI_Info *newinfo) { +PROTOTYPE ERROR_CLASS Info_dup(INFO info, INFO_OUT newinfo) +{ int err; /** diff --git a/ompi/mpi/c/info_f2c.c b/ompi/mpi/c/info_f2c.c.in similarity index 90% rename from ompi/mpi/c/info_f2c.c rename to ompi/mpi/c/info_f2c.c.in index 16f2161d5ed..67d6ddead3f 100644 --- a/ompi/mpi/c/info_f2c.c +++ b/ompi/mpi/c/info_f2c.c.in @@ -31,23 +31,13 @@ #include "ompi/mpi/fortran/base/fint_2_int.h" #include "ompi/info/info.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Info_f2c = PMPI_Info_f2c -#endif -#define MPI_Info_f2c PMPI_Info_f2c -#endif - -static const char FUNC_NAME[] __opal_attribute_unused__ = "MPI_Info_f2c"; - - /** * Converts the MPI_Fint info into a valid C MPI_Info handle * * @param info Integer handle to an MPI_INFO object * @retval C handle corresponding to MPI_INFO object */ -MPI_Info MPI_Info_f2c(MPI_Fint info) +PROTOTYPE INFO info_f2c(FINT info) { int info_index = OMPI_FINT_2_INT(info); diff --git a/ompi/mpi/c/info_free.c b/ompi/mpi/c/info_free.c.in similarity index 89% rename from ompi/mpi/c/info_free.c rename to ompi/mpi/c/info_free.c.in index 9ebc5a761fb..355869e6510 100644 --- a/ompi/mpi/c/info_free.c +++ b/ompi/mpi/c/info_free.c.in @@ -30,16 +30,6 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/info/info.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Info_free = PMPI_Info_free -#endif -#define MPI_Info_free PMPI_Info_free -#endif - -static const char FUNC_NAME[] = "MPI_Info_free"; - - /** * MPI_Info_free - Free an 'MPI_Info' object. * @@ -50,7 +40,7 @@ static const char FUNC_NAME[] = "MPI_Info_free"; * * Upon successful completion, 'info' will be set to 'MPI_INFO_NULL'. */ -int MPI_Info_free(MPI_Info *info) +PROTOTYPE ERROR_CLASS Info_free(INFO_OUT info) { int err; diff --git a/ompi/mpi/c/info_get.c b/ompi/mpi/c/info_get.c.in similarity index 92% rename from ompi/mpi/c/info_get.c rename to ompi/mpi/c/info_get.c.in index 563c6cd1f83..ccd32efbd59 100644 --- a/ompi/mpi/c/info_get.c +++ b/ompi/mpi/c/info_get.c.in @@ -35,15 +35,6 @@ #include #include -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Info_get = PMPI_Info_get -#endif -#define MPI_Info_get PMPI_Info_get -#endif - -static const char FUNC_NAME[] = "MPI_Info_get"; - /** * MPI_Info_get - Get a (key, value) pair from an 'MPI_Info' object * @@ -63,8 +54,8 @@ static const char FUNC_NAME[] = "MPI_Info_get"; * In C and C++, 'valuelen' should be one less than the allocated space * to allow for for the null terminator. */ -int MPI_Info_get(MPI_Info info, const char *key, int valuelen, - char *value, int *flag) +PROTOTYPE ERROR_CLASS Info_get(INFO info, STRING key, INT valuelen, + STRING_OUT value, INT_OUT flag) { int err; int key_length; diff --git a/ompi/mpi/c/info_get_nkeys.c b/ompi/mpi/c/info_get_nkeys.c.in similarity index 88% rename from ompi/mpi/c/info_get_nkeys.c rename to ompi/mpi/c/info_get_nkeys.c.in index 850dadeb5ca..6e5ce0d984a 100644 --- a/ompi/mpi/c/info_get_nkeys.c +++ b/ompi/mpi/c/info_get_nkeys.c.in @@ -29,15 +29,6 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/info/info.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Info_get_nkeys = PMPI_Info_get_nkeys -#endif -#define MPI_Info_get_nkeys PMPI_Info_get_nkeys -#endif - -static const char FUNC_NAME[] = "MPI_Info_get_nkeys"; - /** * MPI_Info_get_nkeys - Returns the number of keys defined on an @@ -53,7 +44,7 @@ static const char FUNC_NAME[] = "MPI_Info_get_nkeys"; * This function returns the number of elements in the list * containing the key-value pairs */ -int MPI_Info_get_nkeys(MPI_Info info, int *nkeys) +PROTOTYPE ERROR_CLASS Info_get_nkeys(INFO info, INT_OUT nkeys) { int err; diff --git a/ompi/mpi/c/info_get_nthkey.c b/ompi/mpi/c/info_get_nthkey.c.in similarity index 91% rename from ompi/mpi/c/info_get_nthkey.c rename to ompi/mpi/c/info_get_nthkey.c.in index 6e40ac8bab3..811ba0ef3eb 100644 --- a/ompi/mpi/c/info_get_nthkey.c +++ b/ompi/mpi/c/info_get_nthkey.c.in @@ -30,15 +30,6 @@ #include "opal/util/string_copy.h" #include -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Info_get_nthkey = PMPI_Info_get_nthkey -#endif -#define MPI_Info_get_nthkey PMPI_Info_get_nthkey -#endif - -static const char FUNC_NAME[] = "MPI_Info_get_nthkey"; - /** * MPI_Info_get_nthkey - Get a key indexed by integer from an 'MPI_Info' obje @@ -52,7 +43,7 @@ static const char FUNC_NAME[] = "MPI_Info_get_nthkey"; * @retval MPI_ERR_INFO * @retval MPI_ERR_INFO_KEY */ -int MPI_Info_get_nthkey(MPI_Info info, int n, char *key) +PROTOTYPE ERROR_CLASS Info_get_nthkey(INFO info, INT n, STRING_OUT key) { int nkeys; int err; diff --git a/ompi/mpi/c/info_get_string.c b/ompi/mpi/c/info_get_string.c.in similarity index 91% rename from ompi/mpi/c/info_get_string.c rename to ompi/mpi/c/info_get_string.c.in index d62d106b6ca..c6b617b3de2 100644 --- a/ompi/mpi/c/info_get_string.c +++ b/ompi/mpi/c/info_get_string.c.in @@ -35,14 +35,6 @@ #include #include -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Info_get_string = PMPI_Info_get_string -#endif -#define MPI_Info_get_string PMPI_Info_get_string -#endif - -static const char FUNC_NAME[] = "MPI_Info_get_string"; /** * MPI_Info_get_string - Get a (key, value) pair from an 'MPI_Info' object @@ -61,8 +53,8 @@ static const char FUNC_NAME[] = "MPI_Info_get_string"; * @retval MPI_ERR_INFO_VALUE * */ -int MPI_Info_get_string(MPI_Info info, const char *key, int *buflen, - char *value, int *flag) +PROTOTYPE ERROR_CLASS Info_get_string(INFO info, STRING key, INT_OUT buflen, + STRING_OUT value, INT_OUT flag) { int err; int key_length; diff --git a/ompi/mpi/c/info_get_valuelen.c b/ompi/mpi/c/info_get_valuelen.c.in similarity index 89% rename from ompi/mpi/c/info_get_valuelen.c rename to ompi/mpi/c/info_get_valuelen.c.in index e40d3c110f8..66fdca1ed17 100644 --- a/ompi/mpi/c/info_get_valuelen.c +++ b/ompi/mpi/c/info_get_valuelen.c.in @@ -33,15 +33,6 @@ #include #include -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Info_get_valuelen = PMPI_Info_get_valuelen -#endif -#define MPI_Info_get_valuelen PMPI_Info_get_valuelen -#endif - -static const char FUNC_NAME[] = "MPI_Info_get_valuelen"; - /** * MPI_Info_get_valuelen - Get the length of a value for a given key in an 'M @@ -61,8 +52,8 @@ static const char FUNC_NAME[] = "MPI_Info_get_valuelen"; * character. If the 'key' is not found on 'info', 'valuelen' is left * alone. */ -int MPI_Info_get_valuelen(MPI_Info info, const char *key, int *valuelen, - int *flag) +PROTOTYPE ERROR_CLASS Info_get_valuelen(INFO info, STRING key, INT_OUT valuelen, + INT_OUT flag) { int key_length; int err; diff --git a/ompi/mpi/c/info_set.c b/ompi/mpi/c/info_set.c.in similarity index 93% rename from ompi/mpi/c/info_set.c rename to ompi/mpi/c/info_set.c.in index c6bc689e903..f5e3a998158 100644 --- a/ompi/mpi/c/info_set.c +++ b/ompi/mpi/c/info_set.c.in @@ -34,15 +34,6 @@ #include #include -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Info_set = PMPI_Info_set -#endif -#define MPI_Info_set PMPI_Info_set -#endif - -static const char FUNC_NAME[] = "MPI_Info_set"; - /** * MPI_Info_set - Set a (key, value) pair in an 'MPI_Info' object @@ -65,7 +56,7 @@ static const char FUNC_NAME[] = "MPI_Info_set"; * key or value is greater than the allowed maxima, MPI_ERR_INFO_KEY * and MPI_ERR_INFO_VALUE are raised */ -int MPI_Info_set(MPI_Info info, const char *key, const char *value) +PROTOTYPE ERROR_CLASS Info_set(INFO info, STRING key, STRING value) { int err; int key_length; diff --git a/ompi/mpi/c/init.c b/ompi/mpi/c/init.c.in similarity index 92% rename from ompi/mpi/c/init.c rename to ompi/mpi/c/init.c.in index eb5a50a7643..65a493e85a4 100644 --- a/ompi/mpi/c/init.c +++ b/ompi/mpi/c/init.c.in @@ -31,17 +31,7 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/constants.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Init = PMPI_Init -#endif -#define MPI_Init PMPI_Init -#endif - -static const char FUNC_NAME[] = "MPI_Init"; - - -int MPI_Init(int *argc, char ***argv) +PROTOTYPE INT init(INT_OUT argc, ARGV argv) { int err; int provided; diff --git a/ompi/mpi/c/init_thread.c b/ompi/mpi/c/init_thread.c.in similarity index 92% rename from ompi/mpi/c/init_thread.c rename to ompi/mpi/c/init_thread.c.in index 95ca9df25e2..032cae8981d 100644 --- a/ompi/mpi/c/init_thread.c +++ b/ompi/mpi/c/init_thread.c.in @@ -34,18 +34,9 @@ #include "ompi/constants.h" #include "ompi/mca/hook/base/base.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Init_thread = PMPI_Init_thread -#endif -#define MPI_Init_thread PMPI_Init_thread -#endif -static const char FUNC_NAME[] = "MPI_Init_thread"; - - -int MPI_Init_thread(int *argc, char ***argv, int required, - int *provided) +PROTOTYPE ERROR_CLASS Init_thread(INT_OUT argc, ARGV argv, INT required, + INT_OUT provided) { int err, safe_required = MPI_THREAD_SERIALIZED; char *env; diff --git a/ompi/mpi/c/initialized.c b/ompi/mpi/c/initialized.c.in similarity index 90% rename from ompi/mpi/c/initialized.c rename to ompi/mpi/c/initialized.c.in index 57f4e466243..e05e6ba2b4e 100644 --- a/ompi/mpi/c/initialized.c +++ b/ompi/mpi/c/initialized.c.in @@ -28,17 +28,7 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/mca/hook/base/base.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Initialized = PMPI_Initialized -#endif -#define MPI_Initialized PMPI_Initialized -#endif - -static const char FUNC_NAME[] = "MPI_Initialized"; - - -int MPI_Initialized(int *flag) +PROTOTYPE ERROR_CLASS initialized(INT_OUT flag) { ompi_hook_base_mpi_initialized_top(flag); diff --git a/ompi/mpi/c/intercomm_create.c b/ompi/mpi/c/intercomm_create.c.in similarity index 87% rename from ompi/mpi/c/intercomm_create.c rename to ompi/mpi/c/intercomm_create.c.in index 0e8a903032a..ad249f07e40 100644 --- a/ompi/mpi/c/intercomm_create.c +++ b/ompi/mpi/c/intercomm_create.c.in @@ -36,19 +36,10 @@ #include "ompi/request/request.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Intercomm_create = PMPI_Intercomm_create -#endif -#define MPI_Intercomm_create PMPI_Intercomm_create -#endif - -static const char FUNC_NAME[] = "MPI_Intercomm_create"; - -int MPI_Intercomm_create(MPI_Comm local_comm, int local_leader, - MPI_Comm bridge_comm, int remote_leader, - int tag, MPI_Comm *newintercomm) +PROTOTYPE ERROR_CLASS Intercomm_create(COMM local_comm, INT local_leader, + COMM bridge_comm, INT remote_leader, + INT tag, COMM_OUT newintercomm) { int rc; diff --git a/ompi/mpi/c/intercomm_create_from_groups.c b/ompi/mpi/c/intercomm_create_from_groups.c.in similarity index 84% rename from ompi/mpi/c/intercomm_create_from_groups.c rename to ompi/mpi/c/intercomm_create_from_groups.c.in index a11a936b7d9..5244c32df75 100644 --- a/ompi/mpi/c/intercomm_create_from_groups.c +++ b/ompi/mpi/c/intercomm_create_from_groups.c.in @@ -36,19 +36,10 @@ #include "ompi/request/request.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Intercomm_create_from_groups = PMPI_Intercomm_create_from_groups -#endif -#define MPI_Intercomm_create_from_groups PMPI_Intercomm_create_from_groups -#endif -static const char FUNC_NAME[] = "MPI_Intercomm_create_from_groups"; - - -int MPI_Intercomm_create_from_groups (MPI_Group local_group, int local_leader, MPI_Group remote_group, - int remote_leader, const char *tag, MPI_Info info, MPI_Errhandler errhandler, - MPI_Comm *newintercomm) +PROTOTYPE ERROR_CLASS Intercomm_create_from_groups (GROUP local_group, INT local_leader, GROUP remote_group, + INT remote_leader, STRING tag, INFO info, ERRHANDLER errhandler, + COMM_OUT newintercomm) { int rc; diff --git a/ompi/mpi/c/intercomm_merge.c b/ompi/mpi/c/intercomm_merge.c.in similarity index 94% rename from ompi/mpi/c/intercomm_merge.c rename to ompi/mpi/c/intercomm_merge.c.in index 08c0b6d97b4..c910fcf8430 100644 --- a/ompi/mpi/c/intercomm_merge.c +++ b/ompi/mpi/c/intercomm_merge.c.in @@ -37,18 +37,9 @@ #include "ompi/proc/proc.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Intercomm_merge = PMPI_Intercomm_merge -#endif -#define MPI_Intercomm_merge PMPI_Intercomm_merge -#endif - -static const char FUNC_NAME[] = "MPI_Intercomm_merge"; - -int MPI_Intercomm_merge(MPI_Comm intercomm, int high, - MPI_Comm *newcomm) +PROTOTYPE ERROR_CLASS Intercomm_merge(COMM intercomm, INT high, + COMM_OUT newcomm) { ompi_communicator_t *newcomp = MPI_COMM_NULL; ompi_proc_t **procs=NULL; diff --git a/ompi/mpi/c/iprobe.c b/ompi/mpi/c/iprobe.c.in similarity index 91% rename from ompi/mpi/c/iprobe.c rename to ompi/mpi/c/iprobe.c.in index c156e704f86..4d30c6ff5a6 100644 --- a/ompi/mpi/c/iprobe.c +++ b/ompi/mpi/c/iprobe.c.in @@ -29,17 +29,8 @@ #include "ompi/request/request.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Iprobe = PMPI_Iprobe -#endif -#define MPI_Iprobe PMPI_Iprobe -#endif - -static const char FUNC_NAME[] = "MPI_Iprobe"; - -int MPI_Iprobe(int source, int tag, MPI_Comm comm, int *flag, MPI_Status *status) +PROTOTYPE ERROR_CLASS Iprobe(INT source, INT tag, COMM comm, INT_OUT flag, STATUS_OUT status) { int rc; diff --git a/ompi/mpi/c/irecv.c b/ompi/mpi/c/irecv.c.in similarity index 89% rename from ompi/mpi/c/irecv.c rename to ompi/mpi/c/irecv.c.in index 7173282de18..1668e7aa7d4 100644 --- a/ompi/mpi/c/irecv.c +++ b/ompi/mpi/c/irecv.c.in @@ -30,18 +30,8 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Irecv = PMPI_Irecv -#endif -#define MPI_Irecv PMPI_Irecv -#endif - -static const char FUNC_NAME[] = "MPI_Irecv"; - - -int MPI_Irecv(void *buf, int count, MPI_Datatype type, int source, - int tag, MPI_Comm comm, MPI_Request *request) +PROTOTYPE ERROR_CLASS irecv(BUFFER_OUT buf, COUNT count, DATATYPE type, + INT source, INT tag, COMM comm, REQUEST_INOUT request) { int rc = MPI_SUCCESS; diff --git a/ompi/mpi/c/ireduce.c b/ompi/mpi/c/ireduce.c.in similarity index 94% rename from ompi/mpi/c/ireduce.c rename to ompi/mpi/c/ireduce.c.in index 7aed9bafb27..c3a08280907 100644 --- a/ompi/mpi/c/ireduce.c +++ b/ompi/mpi/c/ireduce.c.in @@ -35,18 +35,9 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Ireduce = PMPI_Ireduce -#endif -#define MPI_Ireduce PMPI_Ireduce -#endif -static const char FUNC_NAME[] = "MPI_Ireduce"; - - -int MPI_Ireduce(const void *sendbuf, void *recvbuf, int count, - MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm, MPI_Request *request) +PROTOTYPE ERROR_CLASS Ireduce(BUFFER sendbuf, BUFFER_OUT recvbuf, INT count, + DATATYPE datatype, OP op, INT root, COMM comm, REQUEST_INOUT request) { int err; diff --git a/ompi/mpi/c/ireduce_scatter.c b/ompi/mpi/c/ireduce_scatter.c.in similarity index 92% rename from ompi/mpi/c/ireduce_scatter.c rename to ompi/mpi/c/ireduce_scatter.c.in index 9efcb1c0cdd..35cb9092353 100644 --- a/ompi/mpi/c/ireduce_scatter.c +++ b/ompi/mpi/c/ireduce_scatter.c.in @@ -35,18 +35,9 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Ireduce_scatter = PMPI_Ireduce_scatter -#endif -#define MPI_Ireduce_scatter PMPI_Ireduce_scatter -#endif -static const char FUNC_NAME[] = "MPI_Ireduce_scatter"; - - -int MPI_Ireduce_scatter(const void *sendbuf, void *recvbuf, const int recvcounts[], - MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request) +PROTOTYPE ERROR_CLASS Ireduce_scatter(BUFFER sendbuf, BUFFER_OUT recvbuf, INT_ARRAY recvcounts, + DATATYPE datatype, OP op, COMM comm, REQUEST_INOUT request) { int i, err, size, count; ompi_count_array_t recvcounts_desc; diff --git a/ompi/mpi/c/ireduce_scatter_block.c b/ompi/mpi/c/ireduce_scatter_block.c.in similarity index 88% rename from ompi/mpi/c/ireduce_scatter_block.c rename to ompi/mpi/c/ireduce_scatter_block.c.in index e33416d3b81..bc9c291a55c 100644 --- a/ompi/mpi/c/ireduce_scatter_block.c +++ b/ompi/mpi/c/ireduce_scatter_block.c.in @@ -35,19 +35,10 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Ireduce_scatter_block = PMPI_Ireduce_scatter_block -#endif -#define MPI_Ireduce_scatter_block PMPI_Ireduce_scatter_block -#endif -static const char FUNC_NAME[] = "MPI_Ireduce_scatter_block"; - - -int MPI_Ireduce_scatter_block(const void *sendbuf, void *recvbuf, int recvcount, - MPI_Datatype datatype, MPI_Op op, - MPI_Comm comm, MPI_Request *request) +PROTOTYPE ERROR_CLASS Ireduce_scatter_block(BUFFER sendbuf, BUFFER_OUT recvbuf, INT recvcount, + DATATYPE datatype, OP op, + COMM comm, REQUEST_INOUT request) { int err; diff --git a/ompi/mpi/c/irsend.c b/ompi/mpi/c/irsend.c.in similarity index 90% rename from ompi/mpi/c/irsend.c rename to ompi/mpi/c/irsend.c.in index 4db6cf39e3f..da6e2b7986f 100644 --- a/ompi/mpi/c/irsend.c +++ b/ompi/mpi/c/irsend.c.in @@ -34,18 +34,8 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Irsend = PMPI_Irsend -#endif -#define MPI_Irsend PMPI_Irsend -#endif - -static const char FUNC_NAME[] = "MPI_Irsend"; - - -int MPI_Irsend(const void *buf, int count, MPI_Datatype type, int dest, - int tag, MPI_Comm comm, MPI_Request *request) +PROTOTYPE ERROR_CLASS Irsend(BUFFER buf, INT count, DATATYPE type, INT dest, + INT tag, COMM comm, REQUEST_INOUT request) { int rc; diff --git a/ompi/mpi/c/is_thread_main.c b/ompi/mpi/c/is_thread_main.c.in similarity index 84% rename from ompi/mpi/c/is_thread_main.c rename to ompi/mpi/c/is_thread_main.c.in index b876dff4661..6b59ca008ea 100644 --- a/ompi/mpi/c/is_thread_main.c +++ b/ompi/mpi/c/is_thread_main.c.in @@ -27,17 +27,8 @@ #include "ompi/runtime/mpiruntime.h" #include "opal/mca/threads/threads.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Is_thread_main = PMPI_Is_thread_main -#endif -#define MPI_Is_thread_main PMPI_Is_thread_main -#endif -static const char FUNC_NAME[] = "MPI_Is_thread_main"; - - -int MPI_Is_thread_main(int *flag) +PROTOTYPE ERROR_CLASS Is_thread_main(INT_OUT flag) { if (MPI_PARAM_CHECK) { OMPI_ERR_INIT_FINALIZE(FUNC_NAME); diff --git a/ompi/mpi/c/iscan.c b/ompi/mpi/c/iscan.c.in similarity index 91% rename from ompi/mpi/c/iscan.c rename to ompi/mpi/c/iscan.c.in index 165add74124..e56d53b8753 100644 --- a/ompi/mpi/c/iscan.c +++ b/ompi/mpi/c/iscan.c.in @@ -34,18 +34,8 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Iscan = PMPI_Iscan -#endif -#define MPI_Iscan PMPI_Iscan -#endif - -static const char FUNC_NAME[] = "MPI_Iscan"; - - -int MPI_Iscan(const void *sendbuf, void *recvbuf, int count, - MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request) +PROTOTYPE ERROR_CLASS Iscan(BUFFER sendbuf, BUFFER_OUT recvbuf, INT count, + DATATYPE datatype, OP op, COMM comm, REQUEST_INOUT request) { int err; diff --git a/ompi/mpi/c/iscatter.c b/ompi/mpi/c/iscatter.c.in similarity index 94% rename from ompi/mpi/c/iscatter.c rename to ompi/mpi/c/iscatter.c.in index 56954038e8f..75d15f572c7 100644 --- a/ompi/mpi/c/iscatter.c +++ b/ompi/mpi/c/iscatter.c.in @@ -35,19 +35,9 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Iscatter = PMPI_Iscatter -#endif -#define MPI_Iscatter PMPI_Iscatter -#endif - -static const char FUNC_NAME[] = "MPI_Iscatter"; - - -int MPI_Iscatter(const void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, - int root, MPI_Comm comm, MPI_Request *request) +PROTOTYPE ERROR_CLASS Iscatter(BUFFER sendbuf, INT sendcount, DATATYPE sendtype, + BUFFER_OUT recvbuf, INT recvcount, DATATYPE recvtype, + INT root, COMM comm, REQUEST_INOUT request) { int err; diff --git a/ompi/mpi/c/iscatterv.c b/ompi/mpi/c/iscatterv.c.in similarity index 95% rename from ompi/mpi/c/iscatterv.c rename to ompi/mpi/c/iscatterv.c.in index 40c68157861..b0a8a684c9c 100644 --- a/ompi/mpi/c/iscatterv.c +++ b/ompi/mpi/c/iscatterv.c.in @@ -33,19 +33,9 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Iscatterv = PMPI_Iscatterv -#endif -#define MPI_Iscatterv PMPI_Iscatterv -#endif - -static const char FUNC_NAME[] = "MPI_Iscatterv"; - - -int MPI_Iscatterv(const void *sendbuf, const int sendcounts[], const int displs[], - MPI_Datatype sendtype, void *recvbuf, int recvcount, - MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request) +PROTOTYPE ERROR_CLASS Iscatterv(BUFFER sendbuf, INT_ARRAY sendcounts, INT_ARRAY displs, + DATATYPE sendtype, BUFFER_OUT recvbuf, INT recvcount, + DATATYPE recvtype, INT root, COMM comm, REQUEST_INOUT request) { int i, size, err; ompi_count_array_t sendcounts_desc; diff --git a/ompi/mpi/c/isend.c b/ompi/mpi/c/isend.c.in similarity index 91% rename from ompi/mpi/c/isend.c rename to ompi/mpi/c/isend.c.in index 5cbcd36d0d7..595929ece2f 100644 --- a/ompi/mpi/c/isend.c +++ b/ompi/mpi/c/isend.c.in @@ -34,18 +34,8 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Isend = PMPI_Isend -#endif -#define MPI_Isend PMPI_Isend -#endif - -static const char FUNC_NAME[] = "MPI_Isend"; - - -int MPI_Isend(const void *buf, int count, MPI_Datatype type, int dest, - int tag, MPI_Comm comm, MPI_Request *request) +PROTOTYPE ERROR_CLASS isend(BUFFER buf, COUNT count, DATATYPE type, INT dest, + INT tag, COMM comm, REQUEST_INOUT request) { int rc = MPI_SUCCESS; diff --git a/ompi/mpi/c/isendrecv.c b/ompi/mpi/c/isendrecv.c.in similarity index 93% rename from ompi/mpi/c/isendrecv.c rename to ompi/mpi/c/isendrecv.c.in index a4bcc6c7db9..98503c9b6ab 100644 --- a/ompi/mpi/c/isendrecv.c +++ b/ompi/mpi/c/isendrecv.c.in @@ -36,14 +36,6 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Isendrecv = PMPI_Isendrecv -#endif -#define MPI_Isendrecv PMPI_Isendrecv -#endif - -static const char FUNC_NAME[] = "MPI_Isendrecv"; struct ompi_isendrecv_context_t { opal_object_t super; @@ -90,10 +82,10 @@ static int ompi_isendrecv_complete_func (ompi_comm_request_t *request) } -int MPI_Isendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, - int dest, int sendtag, void *recvbuf, int recvcount, - MPI_Datatype recvtype, int source, int recvtag, - MPI_Comm comm, MPI_Request *request) +PROTOTYPE ERROR_CLASS Isendrecv(BUFFER sendbuf, INT sendcount, DATATYPE sendtype, + INT dest, INT sendtag, BUFFER_OUT recvbuf, INT recvcount, + DATATYPE recvtype, INT source, INT recvtag, + COMM comm, REQUEST_INOUT request) { ompi_isendrecv_context_t *context = NULL; ompi_comm_request_t *crequest; diff --git a/ompi/mpi/c/isendrecv_replace.c b/ompi/mpi/c/isendrecv_replace.c.in similarity index 95% rename from ompi/mpi/c/isendrecv_replace.c rename to ompi/mpi/c/isendrecv_replace.c.in index 1079f63fd88..c4f7c89bf82 100644 --- a/ompi/mpi/c/isendrecv_replace.c +++ b/ompi/mpi/c/isendrecv_replace.c.in @@ -35,15 +35,6 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Isendrecv_replace = PMPI_Isendrecv_replace -#endif -#define MPI_Isendrecv_replace PMPI_Isendrecv_replace -#endif - -static const char FUNC_NAME[] = "MPI_Isendrecv_replace"; - struct ompi_isendrecv_replace_context_t { opal_object_t super; opal_convertor_t convertor; @@ -111,9 +102,9 @@ static int ompi_isendrecv_replace_complete_func (ompi_comm_request_t *request) } -int MPI_Isendrecv_replace(void * buf, int count, MPI_Datatype datatype, - int dest, int sendtag, int source, int recvtag, - MPI_Comm comm, MPI_Request *request) +PROTOTYPE ERROR_CLASS Isendrecv_replace(BUFFER_OUT buf, INT count, DATATYPE datatype, + INT dest, INT sendtag, INT source, INT recvtag, + COMM comm, REQUEST_INOUT request) { int rc = MPI_SUCCESS; diff --git a/ompi/mpi/c/issend.c b/ompi/mpi/c/issend.c.in similarity index 90% rename from ompi/mpi/c/issend.c rename to ompi/mpi/c/issend.c.in index e233b145da1..9efff30a118 100644 --- a/ompi/mpi/c/issend.c +++ b/ompi/mpi/c/issend.c.in @@ -33,18 +33,8 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Issend = PMPI_Issend -#endif -#define MPI_Issend PMPI_Issend -#endif - -static const char FUNC_NAME[] = "MPI_Issend"; - - -int MPI_Issend(const void *buf, int count, MPI_Datatype type, int dest, - int tag, MPI_Comm comm, MPI_Request *request) +PROTOTYPE ERROR_CLASS Issend(BUFFER buf, INT count, DATATYPE type, INT dest, + INT tag, COMM comm, REQUEST_INOUT request) { int rc = MPI_SUCCESS; diff --git a/ompi/mpi/c/keyval_create.c b/ompi/mpi/c/keyval_create.c.in similarity index 84% rename from ompi/mpi/c/keyval_create.c rename to ompi/mpi/c/keyval_create.c.in index be340fe4efc..d081ccc365a 100644 --- a/ompi/mpi/c/keyval_create.c +++ b/ompi/mpi/c/keyval_create.c.in @@ -29,19 +29,9 @@ #include "ompi/attribute/attribute.h" #include "ompi/communicator/communicator.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Keyval_create = PMPI_Keyval_create -#endif -#define MPI_Keyval_create PMPI_Keyval_create -#endif - -static const char FUNC_NAME[] = "MPI_Keyval_create"; - - -int MPI_Keyval_create(MPI_Copy_function *copy_attr_fn, - MPI_Delete_function *delete_attr_fn, - int *keyval, void *extra_state) +PROTOTYPE ERROR_CLASS Keyval_create(COPY_FUNCTION copy_attr_fn, + DELETE_FUNCTION delete_attr_fn, + INT_OUT keyval, BUFFER_OUT extra_state) { int ret; ompi_attribute_fn_ptr_union_t copy_fn; diff --git a/ompi/mpi/c/keyval_free.c b/ompi/mpi/c/keyval_free.c.in similarity index 85% rename from ompi/mpi/c/keyval_free.c rename to ompi/mpi/c/keyval_free.c.in index 40183f72f14..318796e1698 100644 --- a/ompi/mpi/c/keyval_free.c +++ b/ompi/mpi/c/keyval_free.c.in @@ -26,17 +26,7 @@ #include "ompi/attribute/attribute.h" #include "ompi/communicator/communicator.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Keyval_free = PMPI_Keyval_free -#endif -#define MPI_Keyval_free PMPI_Keyval_free -#endif - -static const char FUNC_NAME[] = "MPI_Keyval_free"; - - -int MPI_Keyval_free(int *keyval) +PROTOTYPE ERROR_CLASS Keyval_free(INT_OUT keyval) { int ret; diff --git a/ompi/mpi/c/lookup_name.c b/ompi/mpi/c/lookup_name.c.in similarity index 93% rename from ompi/mpi/c/lookup_name.c rename to ompi/mpi/c/lookup_name.c.in index 0633d05a90f..126366beb65 100644 --- a/ompi/mpi/c/lookup_name.c +++ b/ompi/mpi/c/lookup_name.c.in @@ -36,17 +36,8 @@ #include "ompi/info/info.h" #include "ompi/communicator/communicator.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Lookup_name = PMPI_Lookup_name -#endif -#define MPI_Lookup_name PMPI_Lookup_name -#endif -static const char FUNC_NAME[] = "MPI_Lookup_name"; - - -int MPI_Lookup_name(const char *service_name, MPI_Info info, char *port_name) +PROTOTYPE ERROR_CLASS Lookup_name(STRING service_name, INFO info, STRING_OUT port_name) { int flag=0, ret; pmix_status_t rc; diff --git a/ompi/mpi/c/message_c2f.c b/ompi/mpi/c/message_c2f.c.in similarity index 89% rename from ompi/mpi/c/message_c2f.c rename to ompi/mpi/c/message_c2f.c.in index c6406da434b..c9f1b1cf4d4 100644 --- a/ompi/mpi/c/message_c2f.c +++ b/ompi/mpi/c/message_c2f.c.in @@ -29,17 +29,7 @@ #include "ompi/message/message.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Message_c2f = PMPI_Message_c2f -#endif -#define MPI_Message_c2f PMPI_Message_c2f -#endif - -static const char FUNC_NAME[] = "MPI_Message_c2f"; - - -MPI_Fint MPI_Message_c2f(MPI_Message message) +PROTOTYPE FINT message_c2f(MESSAGE message) { MEMCHECKER( memchecker_message(&message); diff --git a/ompi/mpi/c/message_f2c.c b/ompi/mpi/c/message_f2c.c.in similarity index 87% rename from ompi/mpi/c/message_f2c.c rename to ompi/mpi/c/message_f2c.c.in index b667b573b19..c6cf047295a 100644 --- a/ompi/mpi/c/message_f2c.c +++ b/ompi/mpi/c/message_f2c.c.in @@ -27,17 +27,7 @@ #include "ompi/mpi/fortran/base/fint_2_int.h" #include "ompi/message/message.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Message_f2c = PMPI_Message_f2c -#endif -#define MPI_Message_f2c PMPI_Message_f2c -#endif - -static const char FUNC_NAME[] = "MPI_Message_f2c"; - - -MPI_Message MPI_Message_f2c(MPI_Fint message) +PROTOTYPE MESSAGE message_f2c(FINT message) { int message_index = OMPI_FINT_2_INT(message); diff --git a/ompi/mpi/c/mprobe.c b/ompi/mpi/c/mprobe.c.in similarity index 90% rename from ompi/mpi/c/mprobe.c rename to ompi/mpi/c/mprobe.c.in index b63e446b91c..c40b996acc2 100644 --- a/ompi/mpi/c/mprobe.c +++ b/ompi/mpi/c/mprobe.c.in @@ -25,17 +25,9 @@ #include "ompi/request/request.h" #include "ompi/message/message.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Mprobe = PMPI_Mprobe -#endif -#define MPI_Mprobe PMPI_Mprobe -#endif - -static const char FUNC_NAME[] = "MPI_Mprobe"; -int MPI_Mprobe(int source, int tag, MPI_Comm comm, - MPI_Message *message, MPI_Status *status) +PROTOTYPE ERROR_CLASS Mprobe(INT source, INT tag, COMM comm, + MESSAGE_OUT message, STATUS_OUT status) { int rc; diff --git a/ompi/mpi/c/mrecv.c b/ompi/mpi/c/mrecv.c.in similarity index 89% rename from ompi/mpi/c/mrecv.c rename to ompi/mpi/c/mrecv.c.in index c56a0830619..83098421650 100644 --- a/ompi/mpi/c/mrecv.c +++ b/ompi/mpi/c/mrecv.c.in @@ -24,18 +24,9 @@ #include "ompi/message/message.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Mrecv = PMPI_Mrecv -#endif -#define MPI_Mrecv PMPI_Mrecv -#endif - -static const char FUNC_NAME[] = "MPI_Mrecv"; - -int MPI_Mrecv(void *buf, int count, MPI_Datatype type, - MPI_Message *message, MPI_Status *status) +PROTOTYPE ERROR_CLASS Mrecv(BUFFER_OUT buf, INT count, DATATYPE type, + MESSAGE_OUT message, STATUS_OUT status) { int rc = MPI_SUCCESS; ompi_communicator_t *comm; diff --git a/ompi/mpi/c/neighbor_allgather.c b/ompi/mpi/c/neighbor_allgather.c.in similarity index 91% rename from ompi/mpi/c/neighbor_allgather.c rename to ompi/mpi/c/neighbor_allgather.c.in index 872c2ffb292..7f9ced3bb78 100644 --- a/ompi/mpi/c/neighbor_allgather.c +++ b/ompi/mpi/c/neighbor_allgather.c.in @@ -37,19 +37,10 @@ #include "ompi/mca/topo/base/base.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Neighbor_allgather = PMPI_Neighbor_allgather -#endif -#define MPI_Neighbor_allgather PMPI_Neighbor_allgather -#endif - -static const char FUNC_NAME[] = "MPI_Neighbor_allgather"; - -int MPI_Neighbor_allgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, - MPI_Comm comm) +PROTOTYPE ERROR_CLASS Neighbor_allgather(BUFFER sendbuf, INT sendcount, DATATYPE sendtype, + BUFFER_OUT recvbuf, INT recvcount, DATATYPE recvtype, + COMM comm) { int err; diff --git a/ompi/mpi/c/neighbor_allgather_init.c b/ompi/mpi/c/neighbor_allgather_init.c.in similarity index 89% rename from ompi/mpi/c/neighbor_allgather_init.c rename to ompi/mpi/c/neighbor_allgather_init.c.in index 5b6042e7a8d..7a8ebfc28bd 100644 --- a/ompi/mpi/c/neighbor_allgather_init.c +++ b/ompi/mpi/c/neighbor_allgather_init.c.in @@ -38,19 +38,10 @@ #include "ompi/mca/topo/base/base.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Neighbor_allgather_init = PMPI_Neighbor_allgather_init -#endif -#define MPI_Neighbor_allgather_init PMPI_Neighbor_allgather_init -#endif -static const char FUNC_NAME[] = "MPI_Neighbor_allgather_init"; - - -int MPI_Neighbor_allgather_init(const void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, - MPI_Comm comm, MPI_Info info, MPI_Request *request) +PROTOTYPE ERROR_CLASS Neighbor_allgather_init(BUFFER sendbuf, INT sendcount, DATATYPE sendtype, + BUFFER_OUT recvbuf, INT recvcount, DATATYPE recvtype, + COMM comm, INFO info, REQUEST_INOUT request) { int err; diff --git a/ompi/mpi/c/neighbor_allgatherv.c b/ompi/mpi/c/neighbor_allgatherv.c.in similarity index 92% rename from ompi/mpi/c/neighbor_allgatherv.c rename to ompi/mpi/c/neighbor_allgatherv.c.in index 572ee918599..0a5acc8dd0d 100644 --- a/ompi/mpi/c/neighbor_allgatherv.c +++ b/ompi/mpi/c/neighbor_allgatherv.c.in @@ -38,19 +38,10 @@ #include "ompi/mca/topo/base/base.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Neighbor_allgatherv = PMPI_Neighbor_allgatherv -#endif -#define MPI_Neighbor_allgatherv PMPI_Neighbor_allgatherv -#endif - -static const char FUNC_NAME[] = "MPI_Neighbor_allgatherv"; - -int MPI_Neighbor_allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, const int recvcounts[], const int displs[], - MPI_Datatype recvtype, MPI_Comm comm) +PROTOTYPE ERROR_CLASS Neighbor_allgatherv(BUFFER sendbuf, COUNT sendcount, DATATYPE sendtype, + BUFFER_OUT recvbuf, COUNT_ARRAY recvcounts, DISP_ARRAY displs, + DATATYPE recvtype, COMM comm) { int in_size, out_size, err; ompi_count_array_t recvcounts_desc; diff --git a/ompi/mpi/c/neighbor_allgatherv_init.c b/ompi/mpi/c/neighbor_allgatherv_init.c.in similarity index 90% rename from ompi/mpi/c/neighbor_allgatherv_init.c rename to ompi/mpi/c/neighbor_allgatherv_init.c.in index 086443433b2..641a4a88138 100644 --- a/ompi/mpi/c/neighbor_allgatherv_init.c +++ b/ompi/mpi/c/neighbor_allgatherv_init.c.in @@ -38,20 +38,11 @@ #include "ompi/mca/topo/base/base.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Neighbor_allgatherv_init = PMPI_Neighbor_allgatherv_init -#endif -#define MPI_Neighbor_allgatherv_init PMPI_Neighbor_allgatherv_init -#endif -static const char FUNC_NAME[] = "MPI_Neighbor_allgatherv_init"; - - -int MPI_Neighbor_allgatherv_init(const void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, const int recvcounts[], const int displs[], - MPI_Datatype recvtype, MPI_Comm comm, - MPI_Info info, MPI_Request *request) +PROTOTYPE ERROR_CLASS Neighbor_allgatherv_init(BUFFER sendbuf, COUNT sendcount, DATATYPE sendtype, + BUFFER_OUT recvbuf, COUNT_ARRAY recvcounts, DISP_ARRAY displs, + DATATYPE recvtype, COMM comm, + INFO info, REQUEST_INOUT request) { int i, size, err; ompi_count_array_t recvcounts_desc; diff --git a/ompi/mpi/c/neighbor_alltoall.c b/ompi/mpi/c/neighbor_alltoall.c.in similarity index 92% rename from ompi/mpi/c/neighbor_alltoall.c rename to ompi/mpi/c/neighbor_alltoall.c.in index e50885fb1c3..4dd3b1fb968 100644 --- a/ompi/mpi/c/neighbor_alltoall.c +++ b/ompi/mpi/c/neighbor_alltoall.c.in @@ -36,19 +36,10 @@ #include "ompi/mca/topo/base/base.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Neighbor_alltoall = PMPI_Neighbor_alltoall -#endif -#define MPI_Neighbor_alltoall PMPI_Neighbor_alltoall -#endif - -static const char FUNC_NAME[] = "MPI_Neighbor_alltoall"; - -int MPI_Neighbor_alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, - MPI_Comm comm) +PROTOTYPE ERROR_CLASS Neighbor_alltoall(BUFFER sendbuf, INT sendcount, DATATYPE sendtype, + BUFFER_OUT recvbuf, INT recvcount, DATATYPE recvtype, + COMM comm) { size_t sendtype_size, recvtype_size; int err; diff --git a/ompi/mpi/c/neighbor_alltoall_init.c b/ompi/mpi/c/neighbor_alltoall_init.c.in similarity index 90% rename from ompi/mpi/c/neighbor_alltoall_init.c rename to ompi/mpi/c/neighbor_alltoall_init.c.in index ee6bb510f63..ec65f62908f 100644 --- a/ompi/mpi/c/neighbor_alltoall_init.c +++ b/ompi/mpi/c/neighbor_alltoall_init.c.in @@ -38,19 +38,10 @@ #include "ompi/mca/topo/base/base.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Neighbor_alltoall_init = PMPI_Neighbor_alltoall_init -#endif -#define MPI_Neighbor_alltoall_init PMPI_Neighbor_alltoall_init -#endif -static const char FUNC_NAME[] = "MPI_Neighbor_alltoall_init"; - - -int MPI_Neighbor_alltoall_init(const void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, - MPI_Comm comm, MPI_Info info, MPI_Request *request) +PROTOTYPE ERROR_CLASS Neighbor_alltoall_init(BUFFER sendbuf, INT sendcount, DATATYPE sendtype, + BUFFER_OUT recvbuf, INT recvcount, DATATYPE recvtype, + COMM comm, INFO info, REQUEST_INOUT request) { size_t sendtype_size, recvtype_size; int err; diff --git a/ompi/mpi/c/neighbor_alltoallv.c b/ompi/mpi/c/neighbor_alltoallv.c.in similarity index 92% rename from ompi/mpi/c/neighbor_alltoallv.c rename to ompi/mpi/c/neighbor_alltoallv.c.in index 5fbffa9f0e3..c41fb66bd90 100644 --- a/ompi/mpi/c/neighbor_alltoallv.c +++ b/ompi/mpi/c/neighbor_alltoallv.c.in @@ -36,20 +36,11 @@ #include "ompi/mca/topo/base/base.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Neighbor_alltoallv = PMPI_Neighbor_alltoallv -#endif -#define MPI_Neighbor_alltoallv PMPI_Neighbor_alltoallv -#endif - -static const char FUNC_NAME[] = "MPI_Neighbor_alltoallv"; - -int MPI_Neighbor_alltoallv(const void *sendbuf, const int sendcounts[], const int sdispls[], - MPI_Datatype sendtype, void *recvbuf, - const int recvcounts[], const int rdispls[], - MPI_Datatype recvtype, MPI_Comm comm) +PROTOTYPE ERROR_CLASS Neighbor_alltoallv(BUFFER sendbuf, COUNT_ARRAY sendcounts, DISP_ARRAY sdispls, + DATATYPE sendtype, BUFFER_OUT recvbuf, + COUNT_ARRAY recvcounts, DISP_ARRAY rdispls, + DATATYPE recvtype, COMM comm) { int i, err; int indegree, outdegree; diff --git a/ompi/mpi/c/neighbor_alltoallv_init.c b/ompi/mpi/c/neighbor_alltoallv_init.c.in similarity index 90% rename from ompi/mpi/c/neighbor_alltoallv_init.c rename to ompi/mpi/c/neighbor_alltoallv_init.c.in index fde885483f7..455e41bc60b 100644 --- a/ompi/mpi/c/neighbor_alltoallv_init.c +++ b/ompi/mpi/c/neighbor_alltoallv_init.c.in @@ -37,20 +37,11 @@ #include "ompi/mca/topo/base/base.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Neighbor_alltoallv_init = PMPI_Neighbor_alltoallv_init -#endif -#define MPI_Neighbor_alltoallv_init PMPI_Neighbor_alltoallv_init -#endif -static const char FUNC_NAME[] = "MPI_Neighbor_alltoallv_init"; - - -int MPI_Neighbor_alltoallv_init(const void *sendbuf, const int sendcounts[], const int sdispls[], - MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], - const int rdispls[], MPI_Datatype recvtype, MPI_Comm comm, - MPI_Info info, MPI_Request *request) +PROTOTYPE ERROR_CLASS Neighbor_alltoallv_init(BUFFER sendbuf, COUNT_ARRAY sendcounts, DISP_ARRAY sdispls, + DATATYPE sendtype, BUFFER_OUT recvbuf, COUNT_ARRAY recvcounts, + DISP_ARRAY rdispls, DATATYPE recvtype, COMM comm, + INFO info, REQUEST_INOUT request) { int i, err; int indegree, outdegree; diff --git a/ompi/mpi/c/neighbor_alltoallw.c.in b/ompi/mpi/c/neighbor_alltoallw.c.in new file mode 100644 index 00000000000..d45abcd1eec --- /dev/null +++ b/ompi/mpi/c/neighbor_alltoallw.c.in @@ -0,0 +1,149 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2020 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2008 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * Copyright (c) 2004-2005 The Regents of the University of California. + * All rights reserved. + * Copyright (c) 2007 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2012-2017 Los Alamos National Security, LLC. All rights + * reserved. + * Copyright (c) 2014-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2017 IBM Corporation. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" +#include + +#include "ompi/mpi/c/bindings.h" +#include "ompi/runtime/params.h" +#include "ompi/communicator/communicator.h" +#include "ompi/errhandler/errhandler.h" +#include "ompi/datatype/ompi_datatype.h" +#include "ompi/memchecker.h" +#include "ompi/mca/topo/topo.h" +#include "ompi/mca/topo/base/base.h" +#include "ompi/runtime/ompi_spc.h" + + +PROTOTYPE ERROR_CLASS Neighbor_alltoallw(BUFFER sendbuf, INT_ARRAY sendcounts, const MPI_Aint sdispls[], + const MPI_Datatype sendtypes[], BUFFER_OUT recvbuf, + INT_ARRAY recvcounts, const MPI_Aint rdispls[], + const MPI_Datatype recvtypes[], COMM comm) +{ + int i, err; + int indegree, outdegree; + + SPC_RECORD(OMPI_SPC_NEIGHBOR_ALLTOALLW, 1); + + MEMCHECKER( + ptrdiff_t recv_ext; + ptrdiff_t send_ext; + + memchecker_comm(comm); + + err = mca_topo_base_neighbor_count (comm, &indegree, &outdegree); + if (MPI_SUCCESS == err) { + if (MPI_IN_PLACE != sendbuf) { + for ( i = 0; i < outdegree; i++ ) { + memchecker_datatype(sendtypes[i]); + + ompi_datatype_type_extent(sendtypes[i], &send_ext); + + memchecker_call(&opal_memchecker_base_isdefined, + (char *)(sendbuf)+sdispls[i]*send_ext, + sendcounts[i], sendtypes[i]); + } + } + for ( i = 0; i < indegree; i++ ) { + memchecker_datatype(recvtypes[i]); + ompi_datatype_type_extent(recvtypes[i], &recv_ext); + memchecker_call(&opal_memchecker_base_isaddressable, + (char *)(recvbuf)+sdispls[i]*recv_ext, + recvcounts[i], recvtypes[i]); + } + } + ); + + if (MPI_PARAM_CHECK) { + + /* Unrooted operation -- same checks for all ranks */ + + err = MPI_SUCCESS; + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (ompi_comm_invalid(comm) || OMPI_COMM_IS_INTER(comm)) { + return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_COMM, + FUNC_NAME); + } else if (! OMPI_COMM_IS_TOPO(comm)) { + return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_TOPOLOGY, + FUNC_NAME); + } + + err = mca_topo_base_neighbor_count (comm, &indegree, &outdegree); + OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME); + if (((0 < outdegree) && ((NULL == sendcounts) || (NULL == sdispls) || (NULL == sendtypes))) || + ((0 < indegree) && ((NULL == recvcounts) || (NULL == rdispls) || (NULL == recvtypes))) || + MPI_IN_PLACE == sendbuf || MPI_IN_PLACE == recvbuf) { + return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); + } + for (i = 0; i < outdegree; ++i) { + OMPI_CHECK_DATATYPE_FOR_SEND(err, sendtypes[i], sendcounts[i]); + OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME); + } + for (i = 0; i < indegree; ++i) { + OMPI_CHECK_DATATYPE_FOR_RECV(err, recvtypes[i], recvcounts[i]); + OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME); + } + + if( OMPI_COMM_IS_CART(comm) ) { + const mca_topo_base_comm_cart_2_2_0_t *cart = comm->c_topo->mtc.cart; + if( 0 > cart->ndims ) { + return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); + } + } + else if( OMPI_COMM_IS_GRAPH(comm) ) { + int degree; + mca_topo_base_graph_neighbors_count(comm, ompi_comm_rank(comm), °ree); + if( 0 > degree ) { + return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); + } + } + else if( OMPI_COMM_IS_DIST_GRAPH(comm) ) { + const mca_topo_base_comm_dist_graph_2_2_0_t *dist_graph = comm->c_topo->mtc.dist_graph; + indegree = dist_graph->indegree; + outdegree = dist_graph->outdegree; + if( indegree < 0 || outdegree < 0 ) { + return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); + } + } + } + +#if OPAL_ENABLE_FT_MPI + /* + * An early check, so as to return early if we are using a broken + * communicator. This is not absolutely necessary since we will + * check for this, and other, error conditions during the operation. + */ + if( OPAL_UNLIKELY(!ompi_comm_iface_coll_check(comm, &err)) ) { + OMPI_ERRHANDLER_RETURN(err, comm, err, FUNC_NAME); + } +#endif + + /* Invoke the coll component to perform the back-end operation */ + err = comm->c_coll->coll_neighbor_alltoallw(sendbuf, sendcounts, sdispls, sendtypes, + recvbuf, recvcounts, rdispls, recvtypes, + comm, comm->c_coll->coll_neighbor_alltoallw_module); + OMPI_ERRHANDLER_RETURN(err, comm, err, FUNC_NAME); +} + diff --git a/ompi/mpi/c/neighbor_alltoallw_init.c.in b/ompi/mpi/c/neighbor_alltoallw_init.c.in new file mode 100644 index 00000000000..a1fb139598d --- /dev/null +++ b/ompi/mpi/c/neighbor_alltoallw_init.c.in @@ -0,0 +1,145 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2022 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2008 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * Copyright (c) 2004-2005 The Regents of the University of California. + * All rights reserved. + * Copyright (c) 2007 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2012-2017 Los Alamos National Security, LLC. All rights + * reserved. + * Copyright (c) 2014-2023 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2017 IBM Corporation. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" +#include + +#include "ompi/mpi/c/bindings.h" +#include "ompi/runtime/params.h" +#include "ompi/communicator/communicator.h" +#include "ompi/errhandler/errhandler.h" +#include "ompi/datatype/ompi_datatype.h" +#include "ompi/mca/coll/base/coll_base_util.h" +#include "ompi/memchecker.h" +#include "ompi/mca/topo/topo.h" +#include "ompi/mca/topo/base/base.h" +#include "ompi/runtime/ompi_spc.h" + + +PROTOTYPE ERROR_CLASS Neighbor_alltoallw_init(BUFFER sendbuf, INT_ARRAY sendcounts, const MPI_Aint sdispls[], + const MPI_Datatype sendtypes[], BUFFER_OUT recvbuf, INT_ARRAY recvcounts, + const MPI_Aint rdispls[], const MPI_Datatype recvtypes[], COMM comm, + INFO info, REQUEST_INOUT request) +{ + int i, err; + int indegree, outdegree; + + SPC_RECORD(OMPI_SPC_NEIGHBOR_ALLTOALLW_INIT, 1); + + MEMCHECKER( + ptrdiff_t recv_ext; + ptrdiff_t send_ext; + + memchecker_comm(comm); + + err = mca_topo_base_neighbor_count (comm, &indegree, &outdegree); + if (MPI_SUCCESS == err) { + if (MPI_IN_PLACE != sendbuf) { + for ( i = 0; i < outdegree; i++ ) { + memchecker_datatype(sendtypes[i]); + + ompi_datatype_type_extent(sendtypes[i], &send_ext); + + memchecker_call(&opal_memchecker_base_isdefined, + (char *)(sendbuf)+sdispls[i]*send_ext, + sendcounts[i], sendtypes[i]); + } + } + for ( i = 0; i < indegree; i++ ) { + memchecker_datatype(recvtypes[i]); + + ompi_datatype_type_extent(recvtypes[i], &recv_ext); + + memchecker_call(&opal_memchecker_base_isaddressable, + (char *)(recvbuf)+sdispls[i]*recv_ext, + recvcounts[i], recvtypes[i]); + } + } + ); + + if (MPI_PARAM_CHECK) { + + /* Unrooted operation -- same checks for all ranks */ + + err = MPI_SUCCESS; + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (ompi_comm_invalid(comm) || OMPI_COMM_IS_INTER(comm)) { + return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_COMM, + FUNC_NAME); + } else if (! OMPI_COMM_IS_TOPO(comm)) { + return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_TOPOLOGY, + FUNC_NAME); + } + + err = mca_topo_base_neighbor_count (comm, &indegree, &outdegree); + OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME); + if (((0 < outdegree) && ((NULL == sendcounts) || (NULL == sdispls) || (NULL == sendtypes))) || + ((0 < indegree) && ((NULL == recvcounts) || (NULL == rdispls) || (NULL == recvtypes))) || + MPI_IN_PLACE == sendbuf || MPI_IN_PLACE == recvbuf) { + return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); + } + for (i = 0; i < outdegree; ++i) { + OMPI_CHECK_DATATYPE_FOR_SEND(err, sendtypes[i], sendcounts[i]); + OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME); + } + for (i = 0; i < indegree; ++i) { + OMPI_CHECK_DATATYPE_FOR_RECV(err, recvtypes[i], recvcounts[i]); + OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME); + } + + if( OMPI_COMM_IS_CART(comm) ) { + const mca_topo_base_comm_cart_2_2_0_t *cart = comm->c_topo->mtc.cart; + if( 0 > cart->ndims ) { + return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); + } + } + else if( OMPI_COMM_IS_GRAPH(comm) ) { + int degree; + mca_topo_base_graph_neighbors_count(comm, ompi_comm_rank(comm), °ree); + if( 0 > degree ) { + return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); + } + } + else if( OMPI_COMM_IS_DIST_GRAPH(comm) ) { + const mca_topo_base_comm_dist_graph_2_2_0_t *dist_graph = comm->c_topo->mtc.dist_graph; + indegree = dist_graph->indegree; + outdegree = dist_graph->outdegree; + if( indegree < 0 || outdegree < 0 ) { + return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); + } + } + } + + /* Invoke the coll component to perform the back-end operation */ + err = comm->c_coll->coll_neighbor_alltoallw_init(sendbuf, sendcounts, sdispls, sendtypes, + recvbuf, recvcounts, rdispls, recvtypes, comm, + info, request, + comm->c_coll->coll_neighbor_alltoallw_init_module); + if (OPAL_LIKELY(OMPI_SUCCESS == err)) { + ompi_coll_base_retain_datatypes_w(*request, sendtypes, recvtypes, true); + } + OMPI_ERRHANDLER_RETURN(err, comm, err, FUNC_NAME); +} + diff --git a/ompi/mpi/c/op_c2f.c b/ompi/mpi/c/op_c2f.c.in similarity index 86% rename from ompi/mpi/c/op_c2f.c rename to ompi/mpi/c/op_c2f.c.in index bf09306c21e..77bc160aea1 100644 --- a/ompi/mpi/c/op_c2f.c +++ b/ompi/mpi/c/op_c2f.c.in @@ -27,17 +27,7 @@ #include "ompi/mpi/fortran/base/fint_2_int.h" #include "ompi/op/op.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Op_c2f = PMPI_Op_c2f -#endif -#define MPI_Op_c2f PMPI_Op_c2f -#endif - -static const char FUNC_NAME[] = "MPI_Op_c2f"; - - -MPI_Fint MPI_Op_c2f(MPI_Op op) +PROTOTYPE FINT op_c2f(OP op) { if (MPI_PARAM_CHECK) { OMPI_ERR_INIT_FINALIZE(FUNC_NAME); diff --git a/ompi/mpi/c/op_commutative.c b/ompi/mpi/c/op_commutative.c.in similarity index 86% rename from ompi/mpi/c/op_commutative.c rename to ompi/mpi/c/op_commutative.c.in index 2bd6ea94cd7..5a6d5ab5afe 100644 --- a/ompi/mpi/c/op_commutative.c +++ b/ompi/mpi/c/op_commutative.c.in @@ -28,17 +28,7 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/op/op.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Op_commutative = PMPI_Op_commutative -#endif -#define MPI_Op_commutative PMPI_Op_commutative -#endif - -static const char FUNC_NAME[] = "MPI_Op_commutative"; - - -int MPI_Op_commutative(MPI_Op op, int *commute) +PROTOTYPE ERROR_CLASS Op_commutative(OP op, INT_OUT commute) { /* Error checking */ diff --git a/ompi/mpi/c/op_create.c b/ompi/mpi/c/op_create.c.in similarity index 87% rename from ompi/mpi/c/op_create.c rename to ompi/mpi/c/op_create.c.in index 28e00222ad9..00e73574985 100644 --- a/ompi/mpi/c/op_create.c +++ b/ompi/mpi/c/op_create.c.in @@ -27,17 +27,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/op/op.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Op_create = PMPI_Op_create -#endif -#define MPI_Op_create PMPI_Op_create -#endif -static const char FUNC_NAME[] = "MPI_Op_create"; - - -int MPI_Op_create(MPI_User_function * function, int commute, MPI_Op * op) +PROTOTYPE ERROR_CLASS Op_create(USER_FUNCTION function, INT commute, OP_OUT op) { int err = MPI_SUCCESS; diff --git a/ompi/mpi/c/op_f2c.c b/ompi/mpi/c/op_f2c.c.in similarity index 88% rename from ompi/mpi/c/op_f2c.c rename to ompi/mpi/c/op_f2c.c.in index d9be1f240b0..fa5fd568551 100644 --- a/ompi/mpi/c/op_f2c.c +++ b/ompi/mpi/c/op_f2c.c.in @@ -27,17 +27,7 @@ #include "ompi/mpi/fortran/base/fint_2_int.h" #include "ompi/op/op.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Op_f2c = PMPI_Op_f2c -#endif -#define MPI_Op_f2c PMPI_Op_f2c -#endif - -static const char FUNC_NAME[] = "MPI_Op_f2c"; - - -MPI_Op MPI_Op_f2c(MPI_Fint op_f) +PROTOTYPE OP op_f2c(FINT op_f) { int op_index = OMPI_FINT_2_INT(op_f); diff --git a/ompi/mpi/c/op_free.c b/ompi/mpi/c/op_free.c.in similarity index 86% rename from ompi/mpi/c/op_free.c rename to ompi/mpi/c/op_free.c.in index 8920f271fd7..baebf7bbe4d 100644 --- a/ompi/mpi/c/op_free.c +++ b/ompi/mpi/c/op_free.c.in @@ -26,17 +26,7 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/op/op.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Op_free = PMPI_Op_free -#endif -#define MPI_Op_free PMPI_Op_free -#endif - -static const char FUNC_NAME[] = "MPI_Op_free"; - - -int MPI_Op_free(MPI_Op *op) +PROTOTYPE ERROR_CLASS Op_free(OP_OUT op) { /* Error checking */ diff --git a/ompi/mpi/c/open_port.c b/ompi/mpi/c/open_port.c.in similarity index 89% rename from ompi/mpi/c/open_port.c rename to ompi/mpi/c/open_port.c.in index f77ee6ae583..82c2ebaecd8 100644 --- a/ompi/mpi/c/open_port.c +++ b/ompi/mpi/c/open_port.c.in @@ -28,17 +28,8 @@ #include "ompi/info/info.h" #include "ompi/dpm/dpm.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Open_port = PMPI_Open_port -#endif -#define MPI_Open_port PMPI_Open_port -#endif -static const char FUNC_NAME[] = "MPI_Open_port"; - - -int MPI_Open_port(MPI_Info info, char *port_name) +PROTOTYPE ERROR_CLASS Open_port(INFO info, STRING_OUT port_name) { int rc; diff --git a/ompi/mpi/c/pack.c b/ompi/mpi/c/pack.c.in similarity index 93% rename from ompi/mpi/c/pack.c rename to ompi/mpi/c/pack.c.in index b43904ac7b2..0ea06e422cc 100644 --- a/ompi/mpi/c/pack.c +++ b/ompi/mpi/c/pack.c.in @@ -33,18 +33,9 @@ #include "opal/datatype/opal_convertor.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Pack = PMPI_Pack -#endif -#define MPI_Pack PMPI_Pack -#endif -static const char FUNC_NAME[] = "MPI_Pack"; - - -int MPI_Pack(const void *inbuf, int incount, MPI_Datatype datatype, - void *outbuf, int outsize, int *position, MPI_Comm comm) +PROTOTYPE ERROR_CLASS Pack(BUFFER inbuf, INT incount, DATATYPE datatype, + BUFFER_OUT outbuf, INT outsize, INT_OUT position, COMM comm) { int rc = MPI_SUCCESS, ret; opal_convertor_t local_convertor; diff --git a/ompi/mpi/c/pack_external.c b/ompi/mpi/c/pack_external.c.in similarity index 85% rename from ompi/mpi/c/pack_external.c rename to ompi/mpi/c/pack_external.c.in index f8c59485134..d7c4faa9dad 100644 --- a/ompi/mpi/c/pack_external.c +++ b/ompi/mpi/c/pack_external.c.in @@ -32,19 +32,9 @@ #include "opal/datatype/opal_convertor.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Pack_external = PMPI_Pack_external -#endif -#define MPI_Pack_external PMPI_Pack_external -#endif - -static const char FUNC_NAME[] = "MPI_Pack_external"; - - -int MPI_Pack_external(const char datarep[], const void *inbuf, int incount, - MPI_Datatype datatype, void *outbuf, - MPI_Aint outsize, MPI_Aint *position) +PROTOTYPE ERROR_CLASS Pack_external(STRING datarep, BUFFER inbuf, INT incount, + DATATYPE datatype, BUFFER_OUT outbuf, + AINT outsize, AINT_OUT position) { int rc = MPI_SUCCESS; diff --git a/ompi/mpi/c/pack_external_size.c b/ompi/mpi/c/pack_external_size.c.in similarity index 84% rename from ompi/mpi/c/pack_external_size.c rename to ompi/mpi/c/pack_external_size.c.in index 024aaf49de3..7413b625399 100644 --- a/ompi/mpi/c/pack_external_size.c +++ b/ompi/mpi/c/pack_external_size.c.in @@ -32,18 +32,9 @@ #include "opal/datatype/opal_convertor.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Pack_external_size = PMPI_Pack_external_size -#endif -#define MPI_Pack_external_size PMPI_Pack_external_size -#endif -static const char FUNC_NAME[] = "MPI_Pack_external_size"; - - -int MPI_Pack_external_size(const char datarep[], int incount, - MPI_Datatype datatype, MPI_Aint *size) +PROTOTYPE ERROR_CLASS Pack_external_size(STRING datarep, INT incount, + DATATYPE datatype, AINT_OUT size) { int rc = MPI_SUCCESS; diff --git a/ompi/mpi/c/pack_size.c b/ompi/mpi/c/pack_size.c.in similarity index 88% rename from ompi/mpi/c/pack_size.c rename to ompi/mpi/c/pack_size.c.in index 306dbcf2c6a..eec310da23a 100644 --- a/ompi/mpi/c/pack_size.c +++ b/ompi/mpi/c/pack_size.c.in @@ -29,17 +29,9 @@ #include "opal/datatype/opal_convertor.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Pack_size = PMPI_Pack_size -#endif -#define MPI_Pack_size PMPI_Pack_size -#endif -static const char FUNC_NAME[] = "MPI_Pack_size"; - -int MPI_Pack_size(int incount, MPI_Datatype datatype, MPI_Comm comm, - int *size) +PROTOTYPE ERROR_CLASS Pack_size(INT incount, DATATYPE datatype, COMM comm, + INT_OUT size) { opal_convertor_t local_convertor; size_t length; diff --git a/ompi/mpi/c/parrived.c b/ompi/mpi/c/parrived.c.in similarity index 88% rename from ompi/mpi/c/parrived.c rename to ompi/mpi/c/parrived.c.in index eeda2b6827b..10f7ffaa68d 100644 --- a/ompi/mpi/c/parrived.c +++ b/ompi/mpi/c/parrived.c.in @@ -33,17 +33,7 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Parrived = PMPI_Parrived -#endif -#define MPI_Parrived PMPI_Parrived -#endif - -static const char FUNC_NAME[] = "MPI_Parrived"; - - -int MPI_Parrived(MPI_Request request, int partition, int *flag) +PROTOTYPE ERROR_CLASS Parrived(REQUEST request, INT partition, INT_OUT flag) { int rc; diff --git a/ompi/mpi/c/pready.c b/ompi/mpi/c/pready.c.in similarity index 89% rename from ompi/mpi/c/pready.c rename to ompi/mpi/c/pready.c.in index 808cbdaf315..266ffd75fa7 100644 --- a/ompi/mpi/c/pready.c +++ b/ompi/mpi/c/pready.c.in @@ -33,17 +33,7 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Pready = PMPI_Pready -#endif -#define MPI_Pready PMPI_Pready -#endif - -static const char FUNC_NAME[] = "MPI_Pready"; - - -int MPI_Pready(int partition, MPI_Request request) +PROTOTYPE ERROR_CLASS Pready(INT partition, REQUEST request) { int rc; diff --git a/ompi/mpi/c/pready_list.c b/ompi/mpi/c/pready_list.c.in similarity index 87% rename from ompi/mpi/c/pready_list.c rename to ompi/mpi/c/pready_list.c.in index 94498eaba9b..3e56dd5760f 100644 --- a/ompi/mpi/c/pready_list.c +++ b/ompi/mpi/c/pready_list.c.in @@ -33,17 +33,8 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Pready_list = PMPI_Pready_list -#endif -#define MPI_Pready_list PMPI_Pready_list -#endif -static const char FUNC_NAME[] = "MPI_Pready_list"; - - -int MPI_Pready_list(int length, int* partitions, MPI_Request request) +PROTOTYPE ERROR_CLASS Pready_list(INT length, INT_OUT partitions, REQUEST request) { int rc = OMPI_SUCCESS; SPC_RECORD(OMPI_SPC_PREADY, 1); diff --git a/ompi/mpi/c/pready_range.c b/ompi/mpi/c/pready_range.c.in similarity index 86% rename from ompi/mpi/c/pready_range.c rename to ompi/mpi/c/pready_range.c.in index 07082cd79b7..5fe50281cf2 100644 --- a/ompi/mpi/c/pready_range.c +++ b/ompi/mpi/c/pready_range.c.in @@ -33,17 +33,8 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Pready_range = PMPI_Pready_range -#endif -#define MPI_Pready_range PMPI_Pready_range -#endif -static const char FUNC_NAME[] = "MPI_Pready_range"; - - -int MPI_Pready_range(int partition_low, int partition_high, MPI_Request request) +PROTOTYPE ERROR_CLASS Pready_range(INT partition_low, INT partition_high, REQUEST request) { int rc; diff --git a/ompi/mpi/c/precv_init.c b/ompi/mpi/c/precv_init.c.in similarity index 84% rename from ompi/mpi/c/precv_init.c rename to ompi/mpi/c/precv_init.c.in index 2b7b5f09658..b8cddcbefe7 100644 --- a/ompi/mpi/c/precv_init.c +++ b/ompi/mpi/c/precv_init.c.in @@ -34,17 +34,8 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Precv_init = PMPI_Precv_init -#endif -#define MPI_Precv_init PMPI_Precv_init -#endif -static const char FUNC_NAME[] = "MPI_Precv_init"; - - -int MPI_Precv_init(void* buf, int partitions, MPI_Count count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Info info, MPI_Request *request) +PROTOTYPE ERROR_CLASS Precv_init(BUFFER_OUT buf, INT partitions, PARTITIONED_COUNT count, DATATYPE datatype, INT source, INT tag, COMM comm, INFO info, REQUEST_INOUT request) { int rc; diff --git a/ompi/mpi/c/probe.c b/ompi/mpi/c/probe.c.in similarity index 92% rename from ompi/mpi/c/probe.c rename to ompi/mpi/c/probe.c.in index 3944f04a159..d98f569ded5 100644 --- a/ompi/mpi/c/probe.c +++ b/ompi/mpi/c/probe.c.in @@ -30,17 +30,8 @@ #include "ompi/request/request.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Probe = PMPI_Probe -#endif -#define MPI_Probe PMPI_Probe -#endif - -static const char FUNC_NAME[] = "MPI_Probe"; - -int MPI_Probe(int source, int tag, MPI_Comm comm, MPI_Status *status) +PROTOTYPE ERROR_CLASS Probe(INT source, INT tag, COMM comm, STATUS_OUT status) { int rc; diff --git a/ompi/mpi/c/psend_init.c b/ompi/mpi/c/psend_init.c.in similarity index 84% rename from ompi/mpi/c/psend_init.c rename to ompi/mpi/c/psend_init.c.in index 7981f845f09..19ff2196c1d 100644 --- a/ompi/mpi/c/psend_init.c +++ b/ompi/mpi/c/psend_init.c.in @@ -34,17 +34,7 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Psend_init = PMPI_Psend_init -#endif -#define MPI_Psend_init PMPI_Psend_init -#endif - -static const char FUNC_NAME[] = "MPI_Psend_init"; - - -int MPI_Psend_init(const void* buf, int partitions, MPI_Count count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Info info, MPI_Request *request) +PROTOTYPE ERROR_CLASS Psend_init(BUFFER buf, INT partitions, PARTITIONED_COUNT count, DATATYPE datatype, INT dest, INT tag, COMM comm, INFO info, REQUEST_INOUT request) { int rc; diff --git a/ompi/mpi/c/publish_name.c b/ompi/mpi/c/publish_name.c.in similarity index 94% rename from ompi/mpi/c/publish_name.c rename to ompi/mpi/c/publish_name.c.in index 73c95ab9e04..6bdc470ea16 100644 --- a/ompi/mpi/c/publish_name.c +++ b/ompi/mpi/c/publish_name.c.in @@ -35,18 +35,9 @@ #include "ompi/info/info.h" #include "ompi/communicator/communicator.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Publish_name = PMPI_Publish_name -#endif -#define MPI_Publish_name PMPI_Publish_name -#endif -static const char FUNC_NAME[] = "MPI_Publish_name"; - - -int MPI_Publish_name(const char *service_name, MPI_Info info, - const char *port_name) +PROTOTYPE ERROR_CLASS Publish_name(STRING service_name, INFO info, + STRING port_name) { int ret; opal_cstring_t *info_str; diff --git a/ompi/mpi/c/put.c b/ompi/mpi/c/put.c.in similarity index 88% rename from ompi/mpi/c/put.c rename to ompi/mpi/c/put.c.in index 097b41b5b9d..5217c8eb35b 100644 --- a/ompi/mpi/c/put.c +++ b/ompi/mpi/c/put.c.in @@ -33,19 +33,10 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Put = PMPI_Put -#endif -#define MPI_Put PMPI_Put -#endif -static const char FUNC_NAME[] = "MPI_Put"; - - -int MPI_Put(const void *origin_addr, int origin_count, MPI_Datatype origin_datatype, - int target_rank, MPI_Aint target_disp, int target_count, - MPI_Datatype target_datatype, MPI_Win win) +PROTOTYPE ERROR_CLASS Put(BUFFER origin_addr, INT origin_count, DATATYPE origin_datatype, + INT target_rank, AINT target_disp, INT target_count, + DATATYPE target_datatype, WIN win) { int rc; diff --git a/ompi/mpi/c/query_thread.c b/ompi/mpi/c/query_thread.c.in similarity index 83% rename from ompi/mpi/c/query_thread.c rename to ompi/mpi/c/query_thread.c.in index aaaef184d67..7f57eafc26d 100644 --- a/ompi/mpi/c/query_thread.c +++ b/ompi/mpi/c/query_thread.c.in @@ -25,17 +25,8 @@ #include "ompi/communicator/communicator.h" #include "ompi/errhandler/errhandler.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Query_thread = PMPI_Query_thread -#endif -#define MPI_Query_thread PMPI_Query_thread -#endif -static const char FUNC_NAME[] = "MPI_Query_thread"; - - -int MPI_Query_thread(int *provided) +PROTOTYPE ERROR_CLASS Query_thread(INT_OUT provided) { if (MPI_PARAM_CHECK) { OMPI_ERR_INIT_FINALIZE(FUNC_NAME); diff --git a/ompi/mpi/c/raccumulate.c b/ompi/mpi/c/raccumulate.c.in similarity index 92% rename from ompi/mpi/c/raccumulate.c rename to ompi/mpi/c/raccumulate.c.in index 3e7bb667312..fdf594ecdaa 100644 --- a/ompi/mpi/c/raccumulate.c +++ b/ompi/mpi/c/raccumulate.c.in @@ -35,18 +35,10 @@ #include "ompi/datatype/ompi_datatype_internal.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Raccumulate = PMPI_Raccumulate -#endif -#define MPI_Raccumulate PMPI_Raccumulate -#endif -static const char FUNC_NAME[] = "MPI_Raccumulate"; - -int MPI_Raccumulate(const void *origin_addr, int origin_count, MPI_Datatype origin_datatype, - int target_rank, MPI_Aint target_disp, int target_count, - MPI_Datatype target_datatype, MPI_Op op, MPI_Win win, MPI_Request *request) +PROTOTYPE ERROR_CLASS Raccumulate(BUFFER origin_addr, INT origin_count, DATATYPE origin_datatype, + INT target_rank, AINT target_disp, INT target_count, + DATATYPE target_datatype, OP op, WIN win, REQUEST_INOUT request) { int rc; ompi_win_t *ompi_win = (ompi_win_t*) win; diff --git a/ompi/mpi/c/recv.c b/ompi/mpi/c/recv.c.in similarity index 91% rename from ompi/mpi/c/recv.c rename to ompi/mpi/c/recv.c.in index 6a36bcf1167..573e82a90b4 100644 --- a/ompi/mpi/c/recv.c +++ b/ompi/mpi/c/recv.c.in @@ -31,18 +31,8 @@ #include "ompi/request/request.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Recv = PMPI_Recv -#endif -#define MPI_Recv PMPI_Recv -#endif - -static const char FUNC_NAME[] = "MPI_Recv"; - - -int MPI_Recv(void *buf, int count, MPI_Datatype type, int source, - int tag, MPI_Comm comm, MPI_Status *status) +PROTOTYPE ERROR_CLASS recv(BUFFER_OUT buf, COUNT count, DATATYPE type, + INT source, INT tag, COMM comm, STATUS_OUT status) { int rc = MPI_SUCCESS; diff --git a/ompi/mpi/c/recv_init.c b/ompi/mpi/c/recv_init.c.in similarity index 89% rename from ompi/mpi/c/recv_init.c rename to ompi/mpi/c/recv_init.c.in index a6d34477967..4bae34001e5 100644 --- a/ompi/mpi/c/recv_init.c +++ b/ompi/mpi/c/recv_init.c.in @@ -30,18 +30,9 @@ #include "ompi/request/request.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Recv_init = PMPI_Recv_init -#endif -#define MPI_Recv_init PMPI_Recv_init -#endif - -static const char FUNC_NAME[] = "MPI_Recv_init"; - -int MPI_Recv_init(void *buf, int count, MPI_Datatype type, int source, - int tag, MPI_Comm comm, MPI_Request *request) +PROTOTYPE ERROR_CLASS Recv_init(BUFFER_OUT buf, INT count, DATATYPE type, INT source, + INT tag, COMM comm, REQUEST_INOUT request) { int rc = MPI_SUCCESS; diff --git a/ompi/mpi/c/reduce.c b/ompi/mpi/c/reduce.c.in similarity index 94% rename from ompi/mpi/c/reduce.c rename to ompi/mpi/c/reduce.c.in index a46c9f218c7..c54997db2ab 100644 --- a/ompi/mpi/c/reduce.c +++ b/ompi/mpi/c/reduce.c.in @@ -34,18 +34,9 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Reduce = PMPI_Reduce -#endif -#define MPI_Reduce PMPI_Reduce -#endif - -static const char FUNC_NAME[] = "MPI_Reduce"; - -int MPI_Reduce(const void *sendbuf, void *recvbuf, int count, - MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm) +PROTOTYPE ERROR_CLASS Reduce(BUFFER sendbuf, BUFFER_OUT recvbuf, INT count, + DATATYPE datatype, OP op, INT root, COMM comm) { int err; diff --git a/ompi/mpi/c/reduce_init.c b/ompi/mpi/c/reduce_init.c.in similarity index 93% rename from ompi/mpi/c/reduce_init.c rename to ompi/mpi/c/reduce_init.c.in index e4c9991bf5a..8699785fff4 100644 --- a/ompi/mpi/c/reduce_init.c +++ b/ompi/mpi/c/reduce_init.c.in @@ -36,19 +36,9 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Reduce_init = PMPI_Reduce_init -#endif -#define MPI_Reduce_init PMPI_Reduce_init -#endif - -static const char FUNC_NAME[] = "MPI_Reduce_init"; - - -int MPI_Reduce_init(const void *sendbuf, void *recvbuf, int count, - MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm, - MPI_Info info, MPI_Request *request) +PROTOTYPE ERROR_CLASS Reduce_init(BUFFER sendbuf, BUFFER_OUT recvbuf, INT count, + DATATYPE datatype, OP op, INT root, COMM comm, + INFO info, REQUEST_INOUT request) { int err; diff --git a/ompi/mpi/c/reduce_local.c b/ompi/mpi/c/reduce_local.c.in similarity index 89% rename from ompi/mpi/c/reduce_local.c rename to ompi/mpi/c/reduce_local.c.in index 982edd7c6a1..bc3222a71af 100644 --- a/ompi/mpi/c/reduce_local.c +++ b/ompi/mpi/c/reduce_local.c.in @@ -33,18 +33,8 @@ #include "ompi/op/op.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Reduce_local = PMPI_Reduce_local -#endif -#define MPI_Reduce_local PMPI_Reduce_local -#endif - -static const char FUNC_NAME[] = "MPI_Reduce_local"; - - -int MPI_Reduce_local(const void *inbuf, void *inoutbuf, int count, - MPI_Datatype datatype, MPI_Op op) +PROTOTYPE ERROR_CLASS Reduce_local(BUFFER inbuf, BUFFER_OUT inoutbuf, INT count, + DATATYPE datatype, OP op) { int err; diff --git a/ompi/mpi/c/reduce_scatter.c b/ompi/mpi/c/reduce_scatter.c.in similarity index 92% rename from ompi/mpi/c/reduce_scatter.c rename to ompi/mpi/c/reduce_scatter.c.in index 1291fd1d95b..6c164ecd3d7 100644 --- a/ompi/mpi/c/reduce_scatter.c +++ b/ompi/mpi/c/reduce_scatter.c.in @@ -34,18 +34,9 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Reduce_scatter = PMPI_Reduce_scatter -#endif -#define MPI_Reduce_scatter PMPI_Reduce_scatter -#endif - -static const char FUNC_NAME[] = "MPI_Reduce_scatter"; - -int MPI_Reduce_scatter(const void *sendbuf, void *recvbuf, const int recvcounts[], - MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) +PROTOTYPE ERROR_CLASS Reduce_scatter(BUFFER sendbuf, BUFFER_OUT recvbuf, COUNT_ARRAY recvcounts, + DATATYPE datatype, OP op, COMM comm) { int i, err, size, count; ompi_count_array_t recvcounts_desc; diff --git a/ompi/mpi/c/reduce_scatter_block.c b/ompi/mpi/c/reduce_scatter_block.c.in similarity index 90% rename from ompi/mpi/c/reduce_scatter_block.c rename to ompi/mpi/c/reduce_scatter_block.c.in index 25681c916f9..3452ed7920d 100644 --- a/ompi/mpi/c/reduce_scatter_block.c +++ b/ompi/mpi/c/reduce_scatter_block.c.in @@ -34,18 +34,9 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Reduce_scatter_block = PMPI_Reduce_scatter_block -#endif -#define MPI_Reduce_scatter_block PMPI_Reduce_scatter_block -#endif - -static const char FUNC_NAME[] = "MPI_Reduce_scatter_block"; - -int MPI_Reduce_scatter_block(const void *sendbuf, void *recvbuf, int recvcount, - MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) +PROTOTYPE ERROR_CLASS Reduce_scatter_block(BUFFER sendbuf, BUFFER_OUT recvbuf, INT recvcount, + DATATYPE datatype, OP op, COMM comm) { int err; diff --git a/ompi/mpi/c/reduce_scatter_block_init.c b/ompi/mpi/c/reduce_scatter_block_init.c.in similarity index 87% rename from ompi/mpi/c/reduce_scatter_block_init.c rename to ompi/mpi/c/reduce_scatter_block_init.c.in index ec98b9aef78..3564f6385b0 100644 --- a/ompi/mpi/c/reduce_scatter_block_init.c +++ b/ompi/mpi/c/reduce_scatter_block_init.c.in @@ -35,19 +35,10 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Reduce_scatter_block_init = PMPI_Reduce_scatter_block_init -#endif -#define MPI_Reduce_scatter_block_init PMPI_Reduce_scatter_block_init -#endif -static const char FUNC_NAME[] = "MPI_Reduce_scatter_block_init"; - - -int MPI_Reduce_scatter_block_init(const void *sendbuf, void *recvbuf, int recvcount, - MPI_Datatype datatype, MPI_Op op, - MPI_Comm comm, MPI_Info info, MPI_Request *request) +PROTOTYPE ERROR_CLASS Reduce_scatter_block_init(BUFFER sendbuf, BUFFER_OUT recvbuf, INT recvcount, + DATATYPE datatype, OP op, + COMM comm, INFO info, REQUEST_INOUT request) { int err; diff --git a/ompi/mpi/c/reduce_scatter_init.c b/ompi/mpi/c/reduce_scatter_init.c.in similarity index 91% rename from ompi/mpi/c/reduce_scatter_init.c rename to ompi/mpi/c/reduce_scatter_init.c.in index 9f064cba774..e97a3a4fa3b 100644 --- a/ompi/mpi/c/reduce_scatter_init.c +++ b/ompi/mpi/c/reduce_scatter_init.c.in @@ -36,18 +36,9 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Reduce_scatter_init = PMPI_Reduce_scatter_init -#endif -#define MPI_Reduce_scatter_init PMPI_Reduce_scatter_init -#endif -static const char FUNC_NAME[] = "MPI_Reduce_scatter_init"; - - -int MPI_Reduce_scatter_init(const void *sendbuf, void *recvbuf, const int recvcounts[], - MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Info info, MPI_Request *request) +PROTOTYPE ERROR_CLASS Reduce_scatter_init(BUFFER sendbuf, BUFFER_OUT recvbuf, INT_ARRAY recvcounts, + DATATYPE datatype, OP op, COMM comm, INFO info, REQUEST_INOUT request) { int i, err, size, count; ompi_count_array_t recvcounts_desc; diff --git a/ompi/mpi/c/register_datarep.c b/ompi/mpi/c/register_datarep.c.in similarity index 82% rename from ompi/mpi/c/register_datarep.c rename to ompi/mpi/c/register_datarep.c.in index 2ce49dbe9f3..4f6cc1a1156 100644 --- a/ompi/mpi/c/register_datarep.c +++ b/ompi/mpi/c/register_datarep.c.in @@ -30,21 +30,12 @@ #include "ompi/mca/io/base/base.h" #include "ompi/file/file.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Register_datarep = PMPI_Register_datarep -#endif -#define MPI_Register_datarep PMPI_Register_datarep -#endif -static const char FUNC_NAME[] = "MPI_Register_datarep"; - - -int MPI_Register_datarep(const char *datarep, - MPI_Datarep_conversion_function *read_conversion_fn, - MPI_Datarep_conversion_function *write_conversion_fn, - MPI_Datarep_extent_function *dtype_file_extent_fn, - void *extra_state) +PROTOTYPE ERROR_CLASS Register_datarep(STRING datarep, + DATAREP_CONVERSION_FUNCTION read_conversion_fn, + DATAREP_CONVERSION_FUNCTION write_conversion_fn, + DATAREP_EXTENT_FUNCTION dtype_file_extent_fn, + BUFFER_OUT extra_state) { int rc; diff --git a/ompi/mpi/c/request_c2f.c b/ompi/mpi/c/request_c2f.c.in similarity index 89% rename from ompi/mpi/c/request_c2f.c rename to ompi/mpi/c/request_c2f.c.in index 9d98b2928b5..a76c54d2dec 100644 --- a/ompi/mpi/c/request_c2f.c +++ b/ompi/mpi/c/request_c2f.c.in @@ -29,17 +29,7 @@ #include "ompi/request/request.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Request_c2f = PMPI_Request_c2f -#endif -#define MPI_Request_c2f PMPI_Request_c2f -#endif - -static const char FUNC_NAME[] = "MPI_Request_c2f"; - - -MPI_Fint MPI_Request_c2f(MPI_Request request) +PROTOTYPE FINT request_c2f(REQUEST request) { MEMCHECKER( memchecker_request(&request); diff --git a/ompi/mpi/c/request_f2c.c b/ompi/mpi/c/request_f2c.c.in similarity index 87% rename from ompi/mpi/c/request_f2c.c rename to ompi/mpi/c/request_f2c.c.in index 993aa4383fe..9e57f4ae766 100644 --- a/ompi/mpi/c/request_f2c.c +++ b/ompi/mpi/c/request_f2c.c.in @@ -27,17 +27,7 @@ #include "ompi/mpi/fortran/base/fint_2_int.h" #include "ompi/request/request.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Request_f2c = PMPI_Request_f2c -#endif -#define MPI_Request_f2c PMPI_Request_f2c -#endif - -static const char FUNC_NAME[] = "MPI_Request_f2c"; - - -MPI_Request MPI_Request_f2c(MPI_Fint request) +PROTOTYPE REQUEST request_f2c(FINT request) { int request_index = OMPI_FINT_2_INT(request); diff --git a/ompi/mpi/c/request_free.c b/ompi/mpi/c/request_free.c.in similarity index 86% rename from ompi/mpi/c/request_free.c rename to ompi/mpi/c/request_free.c.in index 91f91786f13..3543871067b 100644 --- a/ompi/mpi/c/request_free.c +++ b/ompi/mpi/c/request_free.c.in @@ -28,17 +28,8 @@ #include "ompi/request/request.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Request_free = PMPI_Request_free -#endif -#define MPI_Request_free PMPI_Request_free -#endif -static const char FUNC_NAME[] = "MPI_Request_free"; - - -int MPI_Request_free(MPI_Request *request) +PROTOTYPE ERROR_CLASS Request_free(REQUEST_INOUT request) { int rc; diff --git a/ompi/mpi/c/request_get_status.c b/ompi/mpi/c/request_get_status.c.in similarity index 90% rename from ompi/mpi/c/request_get_status.c rename to ompi/mpi/c/request_get_status.c.in index f97e3af4b0b..38a7759c233 100644 --- a/ompi/mpi/c/request_get_status.c +++ b/ompi/mpi/c/request_get_status.c.in @@ -29,21 +29,12 @@ #include "ompi/request/grequest.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Request_get_status = PMPI_Request_get_status -#endif -#define MPI_Request_get_status PMPI_Request_get_status -#endif - -static const char FUNC_NAME[] = "MPI_Request_get_status"; - /* Non blocking test for the request status. Upon completion, the request will * not be freed (unlike the test function). A subsequent call to test, wait * or free should be executed on the request. */ -int MPI_Request_get_status(MPI_Request request, int *flag, - MPI_Status *status) +PROTOTYPE ERROR_CLASS Request_get_status(REQUEST request, INT_OUT flag, + STATUS_OUT status) { #if OPAL_ENABLE_PROGRESS_THREADS == 0 int do_it_once = 0; diff --git a/ompi/mpi/c/rget.c b/ompi/mpi/c/rget.c.in similarity index 86% rename from ompi/mpi/c/rget.c rename to ompi/mpi/c/rget.c.in index a5e789b6de2..e6f9728e6bf 100644 --- a/ompi/mpi/c/rget.c +++ b/ompi/mpi/c/rget.c.in @@ -32,20 +32,11 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Rget = PMPI_Rget -#endif -#define MPI_Rget PMPI_Rget -#endif -static const char FUNC_NAME[] = "MPI_Rget"; - - -int MPI_Rget(void *origin_addr, int origin_count, - MPI_Datatype origin_datatype, int target_rank, - MPI_Aint target_disp, int target_count, - MPI_Datatype target_datatype, MPI_Win win, MPI_Request *request) +PROTOTYPE ERROR_CLASS Rget(BUFFER_OUT origin_addr, INT origin_count, + DATATYPE origin_datatype, INT target_rank, + AINT target_disp, INT target_count, + DATATYPE target_datatype, WIN win, REQUEST_INOUT request) { int rc; diff --git a/ompi/mpi/c/rget_accumulate.c b/ompi/mpi/c/rget_accumulate.c.in similarity index 91% rename from ompi/mpi/c/rget_accumulate.c rename to ompi/mpi/c/rget_accumulate.c.in index 37f7ee3fb37..6121ed9c9a4 100644 --- a/ompi/mpi/c/rget_accumulate.c +++ b/ompi/mpi/c/rget_accumulate.c.in @@ -36,19 +36,11 @@ #include "ompi/datatype/ompi_datatype_internal.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Rget_accumulate = PMPI_Rget_accumulate -#endif -#define MPI_Rget_accumulate PMPI_Rget_accumulate -#endif -static const char FUNC_NAME[] = "MPI_Rget_accumulate"; - -int MPI_Rget_accumulate(const void *origin_addr, int origin_count, MPI_Datatype origin_datatype, - void *result_addr, int result_count, MPI_Datatype result_datatype, - int target_rank, MPI_Aint target_disp, int target_count, - MPI_Datatype target_datatype, MPI_Op op, MPI_Win win, MPI_Request *request) +PROTOTYPE ERROR_CLASS Rget_accumulate(BUFFER origin_addr, INT origin_count, DATATYPE origin_datatype, + BUFFER_OUT result_addr, INT result_count, DATATYPE result_datatype, + INT target_rank, AINT target_disp, INT target_count, + DATATYPE target_datatype, OP op, WIN win, REQUEST_INOUT request) { int rc; ompi_win_t *ompi_win = (ompi_win_t*) win; diff --git a/ompi/mpi/c/rput.c b/ompi/mpi/c/rput.c.in similarity index 87% rename from ompi/mpi/c/rput.c rename to ompi/mpi/c/rput.c.in index 8493ac14aba..6f4c534dc30 100644 --- a/ompi/mpi/c/rput.c +++ b/ompi/mpi/c/rput.c.in @@ -33,19 +33,10 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Rput = PMPI_Rput -#endif -#define MPI_Rput PMPI_Rput -#endif -static const char FUNC_NAME[] = "MPI_Rput"; - - -int MPI_Rput(const void *origin_addr, int origin_count, MPI_Datatype origin_datatype, - int target_rank, MPI_Aint target_disp, int target_count, - MPI_Datatype target_datatype, MPI_Win win, MPI_Request *request) +PROTOTYPE ERROR_CLASS Rput(BUFFER origin_addr, INT origin_count, DATATYPE origin_datatype, + INT target_rank, AINT target_disp, INT target_count, + DATATYPE target_datatype, WIN win, REQUEST_INOUT request) { int rc; diff --git a/ompi/mpi/c/rsend.c b/ompi/mpi/c/rsend.c.in similarity index 91% rename from ompi/mpi/c/rsend.c rename to ompi/mpi/c/rsend.c.in index cce1334a04b..64da25d4dc6 100644 --- a/ompi/mpi/c/rsend.c +++ b/ompi/mpi/c/rsend.c.in @@ -33,17 +33,8 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Rsend = PMPI_Rsend -#endif -#define MPI_Rsend PMPI_Rsend -#endif - -static const char FUNC_NAME[] = "MPI_Rsend"; - -int MPI_Rsend(const void *buf, int count, MPI_Datatype type, int dest, int tag, MPI_Comm comm) +PROTOTYPE ERROR_CLASS Rsend(BUFFER buf, INT count, DATATYPE type, INT dest, INT tag, COMM comm) { int rc = MPI_SUCCESS; diff --git a/ompi/mpi/c/rsend_init.c b/ompi/mpi/c/rsend_init.c.in similarity index 89% rename from ompi/mpi/c/rsend_init.c rename to ompi/mpi/c/rsend_init.c.in index d9fc9f4d1ee..256baf73bd5 100644 --- a/ompi/mpi/c/rsend_init.c +++ b/ompi/mpi/c/rsend_init.c.in @@ -34,19 +34,9 @@ #include "ompi/request/request.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Rsend_init = PMPI_Rsend_init -#endif -#define MPI_Rsend_init PMPI_Rsend_init -#endif - -static const char FUNC_NAME[] = "MPI_Rsend_init"; - - -int MPI_Rsend_init(const void *buf, int count, MPI_Datatype type, - int dest, int tag, MPI_Comm comm, - MPI_Request *request) +PROTOTYPE ERROR_CLASS Rsend_init(BUFFER buf, INT count, DATATYPE type, + INT dest, INT tag, COMM comm, + REQUEST_INOUT request) { int rc; diff --git a/ompi/mpi/c/scan.c b/ompi/mpi/c/scan.c.in similarity index 92% rename from ompi/mpi/c/scan.c rename to ompi/mpi/c/scan.c.in index 3d6aef421b8..ae093e8374a 100644 --- a/ompi/mpi/c/scan.c +++ b/ompi/mpi/c/scan.c.in @@ -34,18 +34,8 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Scan = PMPI_Scan -#endif -#define MPI_Scan PMPI_Scan -#endif - -static const char FUNC_NAME[] = "MPI_Scan"; - - -int MPI_Scan(const void *sendbuf, void *recvbuf, int count, - MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) +PROTOTYPE ERROR_CLASS scan(BUFFER sendbuf, BUFFER_OUT recvbuf, COUNT count, + DATATYPE datatype, OP op, COMM comm) { int err; diff --git a/ompi/mpi/c/scan_init.c b/ompi/mpi/c/scan_init.c.in similarity index 89% rename from ompi/mpi/c/scan_init.c rename to ompi/mpi/c/scan_init.c.in index 6008eb56190..7ab9a4d94a4 100644 --- a/ompi/mpi/c/scan_init.c +++ b/ompi/mpi/c/scan_init.c.in @@ -34,19 +34,10 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Scan_init = PMPI_Scan_init -#endif -#define MPI_Scan_init PMPI_Scan_init -#endif -static const char FUNC_NAME[] = "MPI_Scan_init"; - - -int MPI_Scan_init(const void *sendbuf, void *recvbuf, int count, - MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, - MPI_Info info, MPI_Request *request) +PROTOTYPE ERROR_CLASS Scan_init(BUFFER sendbuf, BUFFER_OUT recvbuf, INT count, + DATATYPE datatype, OP op, COMM comm, + INFO info, REQUEST_INOUT request) { int err; diff --git a/ompi/mpi/c/scatter.c b/ompi/mpi/c/scatter.c.in similarity index 94% rename from ompi/mpi/c/scatter.c rename to ompi/mpi/c/scatter.c.in index 6b42690c51d..4828b46ee52 100644 --- a/ompi/mpi/c/scatter.c +++ b/ompi/mpi/c/scatter.c.in @@ -35,19 +35,9 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Scatter = PMPI_Scatter -#endif -#define MPI_Scatter PMPI_Scatter -#endif - -static const char FUNC_NAME[] = "MPI_Scatter"; - - -int MPI_Scatter(const void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, - int root, MPI_Comm comm) +PROTOTYPE ERROR_CLASS Scatter(BUFFER sendbuf, INT sendcount, DATATYPE sendtype, + BUFFER_OUT recvbuf, INT recvcount, DATATYPE recvtype, + INT root, COMM comm) { int err; diff --git a/ompi/mpi/c/scatter_init.c b/ompi/mpi/c/scatter_init.c.in similarity index 93% rename from ompi/mpi/c/scatter_init.c rename to ompi/mpi/c/scatter_init.c.in index 86f43aae13f..5b7bdf98633 100644 --- a/ompi/mpi/c/scatter_init.c +++ b/ompi/mpi/c/scatter_init.c.in @@ -35,19 +35,10 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Scatter_init = PMPI_Scatter_init -#endif -#define MPI_Scatter_init PMPI_Scatter_init -#endif -static const char FUNC_NAME[] = "MPI_Scatter_init"; - - -int MPI_Scatter_init(const void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, - int root, MPI_Comm comm, MPI_Info info, MPI_Request *request) +PROTOTYPE ERROR_CLASS Scatter_init(BUFFER sendbuf, INT sendcount, DATATYPE sendtype, + BUFFER_OUT recvbuf, INT recvcount, DATATYPE recvtype, + INT root, COMM comm, INFO info, REQUEST_INOUT request) { int err; diff --git a/ompi/mpi/c/scatterv.c b/ompi/mpi/c/scatterv.c.in similarity index 95% rename from ompi/mpi/c/scatterv.c rename to ompi/mpi/c/scatterv.c.in index ac9688a018e..bf6ac537d47 100644 --- a/ompi/mpi/c/scatterv.c +++ b/ompi/mpi/c/scatterv.c.in @@ -33,19 +33,9 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Scatterv = PMPI_Scatterv -#endif -#define MPI_Scatterv PMPI_Scatterv -#endif - -static const char FUNC_NAME[] = "MPI_Scatterv"; - - -int MPI_Scatterv(const void *sendbuf, const int sendcounts[], const int displs[], - MPI_Datatype sendtype, void *recvbuf, int recvcount, - MPI_Datatype recvtype, int root, MPI_Comm comm) +PROTOTYPE ERROR_CLASS Scatterv(BUFFER sendbuf, INT_ARRAY sendcounts, INT_ARRAY displs, + DATATYPE sendtype, BUFFER_OUT recvbuf, INT recvcount, + DATATYPE recvtype, INT root, COMM comm) { int i, size, err; ompi_count_array_t sendcounts_desc; diff --git a/ompi/mpi/c/scatterv_init.c b/ompi/mpi/c/scatterv_init.c.in similarity index 94% rename from ompi/mpi/c/scatterv_init.c rename to ompi/mpi/c/scatterv_init.c.in index 24180e10c8c..63fe269586b 100644 --- a/ompi/mpi/c/scatterv_init.c +++ b/ompi/mpi/c/scatterv_init.c.in @@ -33,19 +33,10 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Scatterv_init = PMPI_Scatterv_init -#endif -#define MPI_Scatterv_init PMPI_Scatterv_init -#endif -static const char FUNC_NAME[] = "MPI_Scatterv_init"; - - -int MPI_Scatterv_init(const void *sendbuf, const int sendcounts[], const int displs[], - MPI_Datatype sendtype, void *recvbuf, int recvcount, - MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Info info, MPI_Request *request) +PROTOTYPE ERROR_CLASS Scatterv_init(BUFFER sendbuf, INT_ARRAY sendcounts, INT_ARRAY displs, + DATATYPE sendtype, BUFFER_OUT recvbuf, INT recvcount, + DATATYPE recvtype, INT root, COMM comm, INFO info, REQUEST_INOUT request) { int i, size, err; ompi_count_array_t sendcounts_desc; diff --git a/ompi/mpi/c/send.c b/ompi/mpi/c/send.c.in similarity index 91% rename from ompi/mpi/c/send.c rename to ompi/mpi/c/send.c.in index b21bba2c7bc..4b71b0bacf4 100644 --- a/ompi/mpi/c/send.c +++ b/ompi/mpi/c/send.c.in @@ -33,18 +33,8 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Send = PMPI_Send -#endif -#define MPI_Send PMPI_Send -#endif - -static const char FUNC_NAME[] = "MPI_Send"; - - -int MPI_Send(const void *buf, int count, MPI_Datatype type, int dest, - int tag, MPI_Comm comm) +PROTOTYPE ERROR_CLASS send(BUFFER buf, COUNT count, DATATYPE type, RANK dest, + TAG tag, COMM comm) { int rc = MPI_SUCCESS; diff --git a/ompi/mpi/c/send_init.c b/ompi/mpi/c/send_init.c.in similarity index 89% rename from ompi/mpi/c/send_init.c rename to ompi/mpi/c/send_init.c.in index 924b22948ff..0b42f0dbb99 100644 --- a/ompi/mpi/c/send_init.c +++ b/ompi/mpi/c/send_init.c.in @@ -34,19 +34,10 @@ #include "ompi/request/request.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Send_init = PMPI_Send_init -#endif -#define MPI_Send_init PMPI_Send_init -#endif - -static const char FUNC_NAME[] = "MPI_Send_init"; - -int MPI_Send_init(const void *buf, int count, MPI_Datatype type, - int dest, int tag, MPI_Comm comm, - MPI_Request *request) +PROTOTYPE ERROR_CLASS Send_init(BUFFER buf, INT count, DATATYPE type, + INT dest, INT tag, COMM comm, + REQUEST_INOUT request) { int rc = MPI_SUCCESS; diff --git a/ompi/mpi/c/sendrecv.c b/ompi/mpi/c/sendrecv.c.in similarity index 91% rename from ompi/mpi/c/sendrecv.c rename to ompi/mpi/c/sendrecv.c.in index d4d35a27b28..f7771dc4571 100644 --- a/ompi/mpi/c/sendrecv.c +++ b/ompi/mpi/c/sendrecv.c.in @@ -34,20 +34,11 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Sendrecv = PMPI_Sendrecv -#endif -#define MPI_Sendrecv PMPI_Sendrecv -#endif - -static const char FUNC_NAME[] = "MPI_Sendrecv"; - -int MPI_Sendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, - int dest, int sendtag, void *recvbuf, int recvcount, - MPI_Datatype recvtype, int source, int recvtag, - MPI_Comm comm, MPI_Status *status) +PROTOTYPE ERROR_CLASS Sendrecv(BUFFER sendbuf, INT sendcount, DATATYPE sendtype, + INT dest, INT sendtag, BUFFER_OUT recvbuf, INT recvcount, + DATATYPE recvtype, INT source, INT recvtag, + COMM comm, STATUS_OUT status) { ompi_request_t* req; int rc = MPI_SUCCESS; diff --git a/ompi/mpi/c/sendrecv_replace.c b/ompi/mpi/c/sendrecv_replace.c.in similarity index 93% rename from ompi/mpi/c/sendrecv_replace.c rename to ompi/mpi/c/sendrecv_replace.c.in index 46ce8fe753c..77c5b4ffb90 100644 --- a/ompi/mpi/c/sendrecv_replace.c +++ b/ompi/mpi/c/sendrecv_replace.c.in @@ -32,19 +32,9 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Sendrecv_replace = PMPI_Sendrecv_replace -#endif -#define MPI_Sendrecv_replace PMPI_Sendrecv_replace -#endif - -static const char FUNC_NAME[] = "MPI_Sendrecv_replace"; - - -int MPI_Sendrecv_replace(void * buf, int count, MPI_Datatype datatype, - int dest, int sendtag, int source, int recvtag, - MPI_Comm comm, MPI_Status *status) +PROTOTYPE ERROR_CLASS Sendrecv_replace(BUFFER_OUT buf, INT count, DATATYPE datatype, + INT dest, INT sendtag, INT source, INT recvtag, + COMM comm, STATUS_OUT status) { ompi_request_t* req; diff --git a/ompi/mpi/c/session_c2f.c b/ompi/mpi/c/session_c2f.c.in similarity index 85% rename from ompi/mpi/c/session_c2f.c rename to ompi/mpi/c/session_c2f.c.in index 93b5d7da7f5..e34093a478e 100644 --- a/ompi/mpi/c/session_c2f.c +++ b/ompi/mpi/c/session_c2f.c.in @@ -31,17 +31,7 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/mpi/fortran/base/fint_2_int.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Session_c2f = PMPI_Session_c2f -#endif -#define MPI_Session_c2f PMPI_Session_c2f -#endif - -static const char FUNC_NAME[] = "MPI_Session_c2f"; - - -MPI_Fint MPI_Session_c2f (MPI_Session session) +PROTOTYPE FINT session_c2f(SESSION session) { if ( MPI_PARAM_CHECK) { diff --git a/ompi/mpi/c/session_call_errhandler.c b/ompi/mpi/c/session_call_errhandler.c.in similarity index 81% rename from ompi/mpi/c/session_call_errhandler.c rename to ompi/mpi/c/session_call_errhandler.c.in index 4e177da8e5e..9f9436c2ff3 100644 --- a/ompi/mpi/c/session_call_errhandler.c +++ b/ompi/mpi/c/session_call_errhandler.c.in @@ -28,18 +28,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Session_call_errhandler = PMPI_Session_call_errhandler -#endif -#define MPI_Session_call_errhandler PMPI_Session_call_errhandler -#endif - -static const char FUNC_NAME[] __opal_attribute_unused__ = "MPI_Session_call_errhandler"; - - -int MPI_Session_call_errhandler(MPI_Session session, int errorcode) +PROTOTYPE ERROR_CLASS Session_call_errhandler(SESSION session, INT errorcode) { /* Error checking */ diff --git a/ompi/mpi/c/session_create_errhandler.c b/ompi/mpi/c/session_create_errhandler.c.in similarity index 74% rename from ompi/mpi/c/session_create_errhandler.c rename to ompi/mpi/c/session_create_errhandler.c.in index e7677d992a6..5ebe38cba1c 100644 --- a/ompi/mpi/c/session_create_errhandler.c +++ b/ompi/mpi/c/session_create_errhandler.c.in @@ -18,17 +18,8 @@ #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Session_create_errhandler = PMPI_Session_create_errhandler -#endif -#define MPI_Session_create_errhandler PMPI_Session_create_errhandler -#endif -static const char FUNC_NAME[] = "MPI_Session_create_errhandler"; - - -int MPI_Session_create_errhandler (MPI_Session_errhandler_function *session_errhandler_fn, MPI_Errhandler *errhandler) +PROTOTYPE ERROR_CLASS Session_create_errhandler (SESSION_ERRHANDLER_FUNCTION session_errhandler_fn, ERRHANDLER_OUT errhandler) { int err = MPI_SUCCESS; diff --git a/ompi/mpi/c/session_f2c.c b/ompi/mpi/c/session_f2c.c.in similarity index 87% rename from ompi/mpi/c/session_f2c.c rename to ompi/mpi/c/session_f2c.c.in index cb7c0dbd914..61f409d6a14 100644 --- a/ompi/mpi/c/session_f2c.c +++ b/ompi/mpi/c/session_f2c.c.in @@ -29,17 +29,7 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/mpi/fortran/base/fint_2_int.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Session_f2c = PMPI_Session_f2c -#endif -#define MPI_Session_f2c PMPI_Session_f2c -#endif - -static const char FUNC_NAME[] = "MPI_Session_f2c"; - - -MPI_Session MPI_Session_f2c(MPI_Fint session) +PROTOTYPE SESSION session_f2c(FINT session) { int o_index= OMPI_FINT_2_INT(session); diff --git a/ompi/mpi/c/session_finalize.c b/ompi/mpi/c/session_finalize.c.in similarity index 74% rename from ompi/mpi/c/session_finalize.c rename to ompi/mpi/c/session_finalize.c.in index 1c071a95865..8bc49480de8 100644 --- a/ompi/mpi/c/session_finalize.c +++ b/ompi/mpi/c/session_finalize.c.in @@ -17,17 +17,8 @@ #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Session_finalize = PMPI_Session_finalize -#endif -#define MPI_Session_finalize PMPI_Session_finalize -#endif -static const char FUNC_NAME[] = "MPI_Session_finalize"; - - -int MPI_Session_finalize (MPI_Session *session) +PROTOTYPE ERROR_CLASS Session_finalize (SESSION_OUT session) { int rc; diff --git a/ompi/mpi/c/session_get_errhandler.c b/ompi/mpi/c/session_get_errhandler.c.in similarity index 86% rename from ompi/mpi/c/session_get_errhandler.c rename to ompi/mpi/c/session_get_errhandler.c.in index 73ec6a2d0d7..40f7cd6e6c6 100644 --- a/ompi/mpi/c/session_get_errhandler.c +++ b/ompi/mpi/c/session_get_errhandler.c.in @@ -31,18 +31,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/instance/instance.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Session_get_errhandler = PMPI_Session_get_errhandler -#endif -#define MPI_Session_get_errhandler PMPI_Session_get_errhandler -#endif - -static const char FUNC_NAME[] = "MPI_Session_get_errhandler"; - - -int MPI_Session_get_errhandler(MPI_Session session, MPI_Errhandler *errhandler) +PROTOTYPE ERROR_CLASS Session_get_errhandler(SESSION session, ERRHANDLER_OUT errhandler) { int ret = MPI_SUCCESS; diff --git a/ompi/mpi/c/session_get_info.c b/ompi/mpi/c/session_get_info.c.in similarity index 85% rename from ompi/mpi/c/session_get_info.c rename to ompi/mpi/c/session_get_info.c.in index 2170a2ae5cf..eb25f8534b1 100644 --- a/ompi/mpi/c/session_get_info.c +++ b/ompi/mpi/c/session_get_info.c.in @@ -23,17 +23,7 @@ #include #include -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Session_get_info = PMPI_Session_get_info -#endif -#define MPI_Session_get_info PMPI_Session_get_info -#endif - -static const char FUNC_NAME[] = "MPI_Session_get_info"; - - -int MPI_Session_get_info (MPI_Session session, MPI_Info *info_used) +PROTOTYPE ERROR_CLASS Session_get_info (SESSION session, INFO_OUT info_used) { if (MPI_PARAM_CHECK) { OMPI_ERR_INIT_FINALIZE(FUNC_NAME); diff --git a/ompi/mpi/c/session_get_nth_pset.c b/ompi/mpi/c/session_get_nth_pset.c.in similarity index 75% rename from ompi/mpi/c/session_get_nth_pset.c rename to ompi/mpi/c/session_get_nth_pset.c.in index a3a986d9c73..bf45730e5dc 100644 --- a/ompi/mpi/c/session_get_nth_pset.c +++ b/ompi/mpi/c/session_get_nth_pset.c.in @@ -16,17 +16,7 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/instance/instance.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Session_get_nth_pset = PMPI_Session_get_nth_pset -#endif -#define MPI_Session_get_nth_pset PMPI_Session_get_nth_pset -#endif - -static const char FUNC_NAME[] = "MPI_Session_get_nth_pset"; - - -int MPI_Session_get_nth_pset (MPI_Session session, MPI_Info info, int n, int *len, char *pset_name) +PROTOTYPE ERROR_CLASS Session_get_nth_pset (SESSION session, INFO info, INT n, INT_OUT len, STRING_OUT pset_name) { int rc = MPI_SUCCESS; diff --git a/ompi/mpi/c/session_get_num_psets.c b/ompi/mpi/c/session_get_num_psets.c.in similarity index 75% rename from ompi/mpi/c/session_get_num_psets.c rename to ompi/mpi/c/session_get_num_psets.c.in index 638700b5a1e..87ea61e1a8d 100644 --- a/ompi/mpi/c/session_get_num_psets.c +++ b/ompi/mpi/c/session_get_num_psets.c.in @@ -16,17 +16,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/instance/instance.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Session_get_num_psets = PMPI_Session_get_num_psets -#endif -#define MPI_Session_get_num_psets PMPI_Session_get_num_psets -#endif -static const char FUNC_NAME[] = "MPI_Session_get_num_psets"; - - -int MPI_Session_get_num_psets (MPI_Session session, MPI_Info info, int *npset_names) +PROTOTYPE ERROR_CLASS Session_get_num_psets (SESSION session, INFO info, INT_OUT npset_names) { int rc; diff --git a/ompi/mpi/c/session_get_pset_info.c b/ompi/mpi/c/session_get_pset_info.c.in similarity index 83% rename from ompi/mpi/c/session_get_pset_info.c rename to ompi/mpi/c/session_get_pset_info.c.in index a05741fabcd..bbd751131d0 100644 --- a/ompi/mpi/c/session_get_pset_info.c +++ b/ompi/mpi/c/session_get_pset_info.c.in @@ -23,17 +23,7 @@ #include #include -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Session_get_pset_info = PMPI_Session_get_pset_info -#endif -#define MPI_Session_get_pset_info PMPI_Session_get_pset_info -#endif - -static const char FUNC_NAME[] = "MPI_Session_get_pset_info"; - - -int MPI_Session_get_pset_info (MPI_Session session, const char *pset_name, MPI_Info *info_used) +PROTOTYPE ERROR_CLASS Session_get_pset_info (SESSION session, STRING pset_name, INFO_OUT info_used) { int rc; diff --git a/ompi/mpi/c/session_init.c b/ompi/mpi/c/session_init.c.in similarity index 82% rename from ompi/mpi/c/session_init.c rename to ompi/mpi/c/session_init.c.in index 74c6e6f2cc3..cd4ad58611c 100644 --- a/ompi/mpi/c/session_init.c +++ b/ompi/mpi/c/session_init.c.in @@ -17,17 +17,7 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/instance/instance.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Session_init = PMPI_Session_init -#endif -#define MPI_Session_init PMPI_Session_init -#endif - -static const char FUNC_NAME[] = "MPI_Session_init"; - - -int MPI_Session_init (MPI_Info info, MPI_Errhandler errhandler, MPI_Session *session) +PROTOTYPE ERROR_CLASS Session_init (INFO info, ERRHANDLER errhandler, SESSION_OUT session) { int rc, flag; int ts_level = MPI_THREAD_SINGLE; /* for now we default to thread single for OMPI sessions */ diff --git a/ompi/mpi/c/session_set_errhandler.c b/ompi/mpi/c/session_set_errhandler.c.in similarity index 86% rename from ompi/mpi/c/session_set_errhandler.c rename to ompi/mpi/c/session_set_errhandler.c.in index bb6c12af62c..88e1b4e93c0 100644 --- a/ompi/mpi/c/session_set_errhandler.c +++ b/ompi/mpi/c/session_set_errhandler.c.in @@ -30,17 +30,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/instance/instance.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Session_set_errhandler = PMPI_Session_set_errhandler -#endif -#define MPI_Session_set_errhandler PMPI_Session_set_errhandler -#endif -static const char FUNC_NAME[] = "MPI_Session_set_errhandler"; - - -int MPI_Session_set_errhandler(MPI_Session session, MPI_Errhandler errhandler) +PROTOTYPE ERROR_CLASS Session_set_errhandler(SESSION session, ERRHANDLER errhandler) { MPI_Errhandler tmp; diff --git a/ompi/mpi/c/session_set_info.c b/ompi/mpi/c/session_set_info.c.in similarity index 82% rename from ompi/mpi/c/session_set_info.c rename to ompi/mpi/c/session_set_info.c.in index 5f7bffb8528..6e5de325533 100644 --- a/ompi/mpi/c/session_set_info.c +++ b/ompi/mpi/c/session_set_info.c.in @@ -23,17 +23,7 @@ #include #include -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Session_set_info = PMPI_Session_set_info -#endif -#define MPI_Session_set_info PMPI_Session_set_info -#endif - -static const char FUNC_NAME[] = "MPI_Session_set_info"; - - -int MPI_Session_set_info (MPI_Session session, MPI_Info info) +PROTOTYPE ERROR_CLASS Session_set_info (SESSION session, INFO info) { if (MPI_PARAM_CHECK) { OMPI_ERR_INIT_FINALIZE(FUNC_NAME); diff --git a/ompi/mpi/c/ssend.c b/ompi/mpi/c/ssend.c.in similarity index 91% rename from ompi/mpi/c/ssend.c rename to ompi/mpi/c/ssend.c.in index 55ec1c671ab..7ace63e5228 100644 --- a/ompi/mpi/c/ssend.c +++ b/ompi/mpi/c/ssend.c.in @@ -33,17 +33,8 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Ssend = PMPI_Ssend -#endif -#define MPI_Ssend PMPI_Ssend -#endif - -static const char FUNC_NAME[] = "MPI_Ssend"; - -int MPI_Ssend(const void *buf, int count, MPI_Datatype type, int dest, int tag, MPI_Comm comm) +PROTOTYPE ERROR_CLASS Ssend(BUFFER buf, INT count, DATATYPE type, INT dest, INT tag, COMM comm) { int rc = MPI_SUCCESS; diff --git a/ompi/mpi/c/ssend_init.c b/ompi/mpi/c/ssend_init.c.in similarity index 89% rename from ompi/mpi/c/ssend_init.c rename to ompi/mpi/c/ssend_init.c.in index 78844583200..fecd0ccb96c 100644 --- a/ompi/mpi/c/ssend_init.c +++ b/ompi/mpi/c/ssend_init.c.in @@ -34,19 +34,9 @@ #include "ompi/request/request.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Ssend_init = PMPI_Ssend_init -#endif -#define MPI_Ssend_init PMPI_Ssend_init -#endif - -static const char FUNC_NAME[] = "MPI_Ssend_init"; - - -int MPI_Ssend_init(const void *buf, int count, MPI_Datatype type, - int dest, int tag, MPI_Comm comm, - MPI_Request *request) +PROTOTYPE ERROR_CLASS Ssend_init(BUFFER buf, INT count, DATATYPE type, + INT dest, INT tag, COMM comm, + REQUEST_INOUT request) { int rc; diff --git a/ompi/mpi/c/start.c b/ompi/mpi/c/start.c.in similarity index 93% rename from ompi/mpi/c/start.c rename to ompi/mpi/c/start.c.in index 5bf202385f8..9f80d5e40a7 100644 --- a/ompi/mpi/c/start.c +++ b/ompi/mpi/c/start.c.in @@ -32,17 +32,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Start = PMPI_Start -#endif -#define MPI_Start PMPI_Start -#endif - -static const char FUNC_NAME[] = "MPI_Start"; - -int MPI_Start(MPI_Request *request) +PROTOTYPE ERROR_CLASS Start(REQUEST_INOUT request) { int ret = OMPI_SUCCESS; diff --git a/ompi/mpi/c/startall.c b/ompi/mpi/c/startall.c.in similarity index 93% rename from ompi/mpi/c/startall.c rename to ompi/mpi/c/startall.c.in index a733e7586cf..e640f45c089 100644 --- a/ompi/mpi/c/startall.c +++ b/ompi/mpi/c/startall.c.in @@ -34,17 +34,8 @@ #include "ompi/request/request.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Startall = PMPI_Startall -#endif -#define MPI_Startall PMPI_Startall -#endif - -static const char FUNC_NAME[] = "MPI_Startall"; - -int MPI_Startall(int count, MPI_Request requests[]) +PROTOTYPE ERROR_CLASS Startall(INT count, REQUEST_INOUT requests) { int i, j; int ret = OMPI_SUCCESS; diff --git a/ompi/mpi/c/status_c2f.c b/ompi/mpi/c/status_c2f.c.in similarity index 93% rename from ompi/mpi/c/status_c2f.c rename to ompi/mpi/c/status_c2f.c.in index dd0190cae66..cef6550ad02 100644 --- a/ompi/mpi/c/status_c2f.c +++ b/ompi/mpi/c/status_c2f.c.in @@ -32,17 +32,8 @@ #include "ompi/mpi/fortran/base/constants.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Status_c2f = PMPI_Status_c2f -#endif -#define MPI_Status_c2f PMPI_Status_c2f -#endif -static const char FUNC_NAME[] = "MPI_Status_c2f"; - - -int MPI_Status_c2f(const MPI_Status *c_status, MPI_Fint *f_status) +PROTOTYPE ERROR_CLASS Status_c2f(STATUS c_status, FINT_OUT f_status) { const int *c_ints; int i; diff --git a/ompi/mpi/c/status_c2f08.c b/ompi/mpi/c/status_c2f08.c.in similarity index 90% rename from ompi/mpi/c/status_c2f08.c rename to ompi/mpi/c/status_c2f08.c.in index c5b5dd335b7..6a9150530cd 100644 --- a/ompi/mpi/c/status_c2f08.c +++ b/ompi/mpi/c/status_c2f08.c.in @@ -32,17 +32,7 @@ #include "ompi/mpi/fortran/base/constants.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Status_c2f08 = PMPI_Status_c2f08 -#endif -#define MPI_Status_c2f08 PMPI_Status_c2f08 -#endif - -static const char FUNC_NAME[] = "MPI_Status_c2f08"; - - -int MPI_Status_c2f08(const MPI_Status *c_status, MPI_F08_status *f08_status) +PROTOTYPE ERROR_CLASS Status_c2f08(STATUS c_status, F08_STATUS_OUT f08_status) { const int *c_ints; MEMCHECKER( diff --git a/ompi/mpi/c/status_f082c.c b/ompi/mpi/c/status_f082c.c.in similarity index 90% rename from ompi/mpi/c/status_f082c.c rename to ompi/mpi/c/status_f082c.c.in index 0134b698f78..63541c4c7a1 100644 --- a/ompi/mpi/c/status_f082c.c +++ b/ompi/mpi/c/status_f082c.c.in @@ -30,17 +30,8 @@ #include "ompi/mpi/fortran/base/fint_2_int.h" #include "ompi/mpi/fortran/base/constants.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Status_f082c = PMPI_Status_f082c -#endif -#define MPI_Status_f082c PMPI_Status_f082c -#endif - -static const char FUNC_NAME[] = "MPI_Status_f082c"; - -int MPI_Status_f082c(const MPI_F08_status *f08_status, MPI_Status *c_status) +PROTOTYPE ERROR_CLASS Status_f082c(F08_STATUS f08_status, STATUS_OUT c_status) { int *c_ints; diff --git a/ompi/mpi/c/status_f082f.c b/ompi/mpi/c/status_f082f.c.in similarity index 88% rename from ompi/mpi/c/status_f082f.c rename to ompi/mpi/c/status_f082f.c.in index 0abc1762b39..ad20d554d20 100644 --- a/ompi/mpi/c/status_f082f.c +++ b/ompi/mpi/c/status_f082f.c.in @@ -30,17 +30,8 @@ #include "ompi/mpi/fortran/base/fint_2_int.h" #include "ompi/mpi/fortran/base/constants.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Status_f082f = PMPI_Status_f082f -#endif -#define MPI_Status_f082f PMPI_Status_f082f -#endif - -static const char FUNC_NAME[] = "MPI_Status_f082f"; - -int MPI_Status_f082f(const MPI_F08_status *f08_status, MPI_Fint *f_status) +PROTOTYPE ERROR_CLASS Status_f082f(F08_STATUS f08_status, FINT_OUT f_status) { if (MPI_PARAM_CHECK) { OMPI_ERR_INIT_FINALIZE(FUNC_NAME); diff --git a/ompi/mpi/c/status_f2c.c b/ompi/mpi/c/status_f2c.c.in similarity index 90% rename from ompi/mpi/c/status_f2c.c rename to ompi/mpi/c/status_f2c.c.in index 32fa39b86e9..917d16526a5 100644 --- a/ompi/mpi/c/status_f2c.c +++ b/ompi/mpi/c/status_f2c.c.in @@ -30,17 +30,7 @@ #include "ompi/mpi/fortran/base/fint_2_int.h" #include "ompi/mpi/fortran/base/constants.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Status_f2c = PMPI_Status_f2c -#endif -#define MPI_Status_f2c PMPI_Status_f2c -#endif - -static const char FUNC_NAME[] = "MPI_Status_f2c"; - - -int MPI_Status_f2c(const MPI_Fint *f_status, MPI_Status *c_status) +PROTOTYPE ERROR_CLASS Status_f2c(FINT_CONST f_status, STATUS_OUT c_status) { int i, *c_ints; diff --git a/ompi/mpi/c/status_f2f08.c b/ompi/mpi/c/status_f2f08.c.in similarity index 88% rename from ompi/mpi/c/status_f2f08.c rename to ompi/mpi/c/status_f2f08.c.in index 3c7c31df312..5f0d8a995fb 100644 --- a/ompi/mpi/c/status_f2f08.c +++ b/ompi/mpi/c/status_f2f08.c.in @@ -32,17 +32,8 @@ #include "ompi/mpi/fortran/base/constants.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Status_f2f08 = PMPI_Status_f2f08 -#endif -#define MPI_Status_f2f08 PMPI_Status_f2f08 -#endif - -static const char FUNC_NAME[] = "MPI_Status_f2f08"; - -int MPI_Status_f2f08(const MPI_Fint *f_status, MPI_F08_status *f08_status) +PROTOTYPE ERROR_CLASS Status_f2f08(FINT_CONST f_status, F08_STATUS_OUT f08_status) { if (MPI_PARAM_CHECK) { OMPI_ERR_INIT_FINALIZE(FUNC_NAME); diff --git a/ompi/mpi/c/status_set_cancelled.c b/ompi/mpi/c/status_set_cancelled.c.in similarity index 85% rename from ompi/mpi/c/status_set_cancelled.c rename to ompi/mpi/c/status_set_cancelled.c.in index 1c6cb835e9e..7cd72993ac3 100644 --- a/ompi/mpi/c/status_set_cancelled.c +++ b/ompi/mpi/c/status_set_cancelled.c.in @@ -26,17 +26,7 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Status_set_cancelled = PMPI_Status_set_cancelled -#endif -#define MPI_Status_set_cancelled PMPI_Status_set_cancelled -#endif - -static const char FUNC_NAME[] = "MPI_Status_set_cancelled"; - - -int MPI_Status_set_cancelled(MPI_Status *status, int flag) +PROTOTYPE ERROR_CLASS Status_set_cancelled(STATUS_OUT status, INT flag) { MEMCHECKER( if(status != MPI_STATUSES_IGNORE) { diff --git a/ompi/mpi/c/status_set_elements_x.c b/ompi/mpi/c/status_set_elements.c.in similarity index 88% rename from ompi/mpi/c/status_set_elements_x.c rename to ompi/mpi/c/status_set_elements.c.in index 8d7d4656718..30fced17ac6 100644 --- a/ompi/mpi/c/status_set_elements_x.c +++ b/ompi/mpi/c/status_set_elements.c.in @@ -31,16 +31,7 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Status_set_elements_x = PMPI_Status_set_elements_x -#endif -#define MPI_Status_set_elements_x PMPI_Status_set_elements_x -#endif - -static const char FUNC_NAME[] = "MPI_Status_set_elements_x"; - -int MPI_Status_set_elements_x(MPI_Status *status, MPI_Datatype datatype, MPI_Count count) +PROTOTYPE ERROR_CLASS Status_set_elements(STATUS_OUT status, DATATYPE datatype, INT count) { int rc = MPI_SUCCESS; size_t size; diff --git a/ompi/mpi/c/status_set_elements.c b/ompi/mpi/c/status_set_elements_x.c.in similarity index 88% rename from ompi/mpi/c/status_set_elements.c rename to ompi/mpi/c/status_set_elements_x.c.in index 34c8888bc81..585ea3e9bfb 100644 --- a/ompi/mpi/c/status_set_elements.c +++ b/ompi/mpi/c/status_set_elements_x.c.in @@ -31,16 +31,8 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Status_set_elements = PMPI_Status_set_elements -#endif -#define MPI_Status_set_elements PMPI_Status_set_elements -#endif -static const char FUNC_NAME[] = "MPI_Status_set_elements"; - -int MPI_Status_set_elements(MPI_Status *status, MPI_Datatype datatype, int count) +PROTOTYPE ERROR_CLASS Status_set_elements_x(STATUS_OUT status, DATATYPE datatype, PARTITIONED_COUNT count) { int rc = MPI_SUCCESS; size_t size; diff --git a/ompi/mpi/c/test.c b/ompi/mpi/c/test.c.in similarity index 88% rename from ompi/mpi/c/test.c rename to ompi/mpi/c/test.c.in index 795843da21f..421ee52ca31 100644 --- a/ompi/mpi/c/test.c +++ b/ompi/mpi/c/test.c.in @@ -29,17 +29,7 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Test = PMPI_Test -#endif -#define MPI_Test PMPI_Test -#endif - -static const char FUNC_NAME[] = "MPI_Test"; - - -int MPI_Test(MPI_Request *request, int *completed, MPI_Status *status) +PROTOTYPE ERROR_CLASS Test(REQUEST_INOUT request, INT_OUT completed, STATUS_OUT status) { int rc; diff --git a/ompi/mpi/c/test_cancelled.c b/ompi/mpi/c/test_cancelled.c.in similarity index 85% rename from ompi/mpi/c/test_cancelled.c rename to ompi/mpi/c/test_cancelled.c.in index bc13ade2b3b..d0f39365e0d 100644 --- a/ompi/mpi/c/test_cancelled.c +++ b/ompi/mpi/c/test_cancelled.c.in @@ -29,17 +29,7 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Test_cancelled = PMPI_Test_cancelled -#endif -#define MPI_Test_cancelled PMPI_Test_cancelled -#endif - -static const char FUNC_NAME[] = "MPI_Test_cancelled"; - - -int MPI_Test_cancelled(const MPI_Status *status, int *flag) +PROTOTYPE ERROR_CLASS Test_cancelled(STATUS status, INT_OUT flag) { int rc = MPI_SUCCESS; diff --git a/ompi/mpi/c/testall.c b/ompi/mpi/c/testall.c.in similarity index 90% rename from ompi/mpi/c/testall.c rename to ompi/mpi/c/testall.c.in index 4eac940b257..c2b846aea66 100644 --- a/ompi/mpi/c/testall.c +++ b/ompi/mpi/c/testall.c.in @@ -35,18 +35,9 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Testall = PMPI_Testall -#endif -#define MPI_Testall PMPI_Testall -#endif -static const char FUNC_NAME[] = "MPI_Testall"; - - -int MPI_Testall(int count, MPI_Request requests[], int *flag, - MPI_Status statuses[]) +PROTOTYPE ERROR_CLASS Testall(INT count, REQUEST_INOUT requests, INT_OUT flag, + STATUS_OUT statuses) { SPC_RECORD(OMPI_SPC_TESTALL, 1); diff --git a/ompi/mpi/c/testany.c b/ompi/mpi/c/testany.c.in similarity index 90% rename from ompi/mpi/c/testany.c rename to ompi/mpi/c/testany.c.in index 8a70002d495..e8d908290eb 100644 --- a/ompi/mpi/c/testany.c +++ b/ompi/mpi/c/testany.c.in @@ -35,17 +35,7 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Testany = PMPI_Testany -#endif -#define MPI_Testany PMPI_Testany -#endif - -static const char FUNC_NAME[] = "MPI_Testany"; - - -int MPI_Testany(int count, MPI_Request requests[], int *indx, int *completed, MPI_Status *status) +PROTOTYPE ERROR_CLASS Testany(INT count, REQUEST_INOUT requests, INT_OUT indx, INT_OUT completed, STATUS_OUT status) { SPC_RECORD(OMPI_SPC_TESTANY, 1); diff --git a/ompi/mpi/c/testsome.c b/ompi/mpi/c/testsome.c.in similarity index 89% rename from ompi/mpi/c/testsome.c rename to ompi/mpi/c/testsome.c.in index 459335ded67..393eaf5fa5e 100644 --- a/ompi/mpi/c/testsome.c +++ b/ompi/mpi/c/testsome.c.in @@ -35,19 +35,9 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Testsome = PMPI_Testsome -#endif -#define MPI_Testsome PMPI_Testsome -#endif - -static const char FUNC_NAME[] = "MPI_Testsome"; - - -int MPI_Testsome(int incount, MPI_Request requests[], - int *outcount, int indices[], - MPI_Status statuses[]) +PROTOTYPE ERROR_CLASS Testsome(INT incount, REQUEST_INOUT requests, + INT_OUT outcount, INT_OUT indices, + STATUS_OUT statuses) { SPC_RECORD(OMPI_SPC_TESTSOME, 1); diff --git a/ompi/mpi/c/topo_test.c b/ompi/mpi/c/topo_test.c.in similarity index 88% rename from ompi/mpi/c/topo_test.c rename to ompi/mpi/c/topo_test.c.in index 2fc9d82f25a..f1a4a38f97c 100644 --- a/ompi/mpi/c/topo_test.c +++ b/ompi/mpi/c/topo_test.c.in @@ -27,17 +27,8 @@ #include "ompi/communicator/communicator.h" #include "ompi/errhandler/errhandler.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Topo_test = PMPI_Topo_test -#endif -#define MPI_Topo_test PMPI_Topo_test -#endif -static const char FUNC_NAME[] = "MPI_Topo_test"; - - -int MPI_Topo_test(MPI_Comm comm, int *status) +PROTOTYPE ERROR_CLASS Topo_test(COMM comm, INT_OUT status) { MEMCHECKER( memchecker_comm(comm); diff --git a/ompi/mpi/c/type_c2f.c b/ompi/mpi/c/type_c2f.c.in similarity index 88% rename from ompi/mpi/c/type_c2f.c rename to ompi/mpi/c/type_c2f.c.in index d660756f81b..1dc3da53fd7 100644 --- a/ompi/mpi/c/type_c2f.c +++ b/ompi/mpi/c/type_c2f.c.in @@ -28,17 +28,7 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Type_c2f = PMPI_Type_c2f -#endif -#define MPI_Type_c2f PMPI_Type_c2f -#endif - -static const char FUNC_NAME[] = "MPI_Type_c2f"; - - -MPI_Fint MPI_Type_c2f(MPI_Datatype datatype) +PROTOTYPE FINT type_c2f(DATATYPE datatype) { MEMCHECKER( memchecker_datatype(datatype); diff --git a/ompi/mpi/c/type_commit.c b/ompi/mpi/c/type_commit.c.in similarity index 86% rename from ompi/mpi/c/type_commit.c rename to ompi/mpi/c/type_commit.c.in index d7ac77d87f6..0d0ad1f9022 100644 --- a/ompi/mpi/c/type_commit.c +++ b/ompi/mpi/c/type_commit.c.in @@ -28,17 +28,8 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Type_commit = PMPI_Type_commit -#endif -#define MPI_Type_commit PMPI_Type_commit -#endif -static const char FUNC_NAME[] = "MPI_Type_commit"; - - -int MPI_Type_commit(MPI_Datatype *type) +PROTOTYPE ERROR_CLASS Type_commit(DATATYPE_OUT type) { int rc; diff --git a/ompi/mpi/c/type_contiguous.c b/ompi/mpi/c/type_contiguous.c.in similarity index 85% rename from ompi/mpi/c/type_contiguous.c rename to ompi/mpi/c/type_contiguous.c.in index 4bac82c79ee..1b4e4141e20 100644 --- a/ompi/mpi/c/type_contiguous.c +++ b/ompi/mpi/c/type_contiguous.c.in @@ -31,19 +31,9 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Type_contiguous = PMPI_Type_contiguous -#endif -#define MPI_Type_contiguous PMPI_Type_contiguous -#endif - -static const char FUNC_NAME[] = "MPI_Type_contiguous"; - - -int MPI_Type_contiguous(int count, - MPI_Datatype oldtype, - MPI_Datatype *newtype) +PROTOTYPE ERROR_CLASS Type_contiguous(INT count, + DATATYPE oldtype, + DATATYPE_OUT newtype) { int rc; diff --git a/ompi/mpi/c/type_create_darray.c b/ompi/mpi/c/type_create_darray.c.in similarity index 85% rename from ompi/mpi/c/type_create_darray.c rename to ompi/mpi/c/type_create_darray.c.in index 9dbe45d615a..848e7b6c355 100644 --- a/ompi/mpi/c/type_create_darray.c +++ b/ompi/mpi/c/type_create_darray.c.in @@ -31,25 +31,17 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Type_create_darray = PMPI_Type_create_darray -#endif -#define MPI_Type_create_darray PMPI_Type_create_darray -#endif -static const char FUNC_NAME[] = "MPI_Type_create_darray"; - -int MPI_Type_create_darray(int size, - int rank, - int ndims, - const int gsize_array[], - const int distrib_array[], - const int darg_array[], - const int psize_array[], - int order, - MPI_Datatype oldtype, - MPI_Datatype *newtype) +PROTOTYPE ERROR_CLASS Type_create_darray(INT size, + INT rank, + INT ndims, + INT_ARRAY gsize_array, + INT_ARRAY distrib_array, + INT_ARRAY darg_array, + INT_ARRAY psize_array, + INT order, + DATATYPE oldtype, + DATATYPE_OUT newtype) { int i, rc; diff --git a/ompi/mpi/c/type_create_f90_complex.c b/ompi/mpi/c/type_create_f90_complex.c.in similarity index 93% rename from ompi/mpi/c/type_create_f90_complex.c rename to ompi/mpi/c/type_create_f90_complex.c.in index 84b254ceae6..51c3e1afa75 100644 --- a/ompi/mpi/c/type_create_f90_complex.c +++ b/ompi/mpi/c/type_create_f90_complex.c.in @@ -37,17 +37,7 @@ #include "ompi/communicator/communicator.h" #include "ompi/errhandler/errhandler.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Type_create_f90_complex = PMPI_Type_create_f90_complex -#endif -#define MPI_Type_create_f90_complex PMPI_Type_create_f90_complex -#endif - -static const char FUNC_NAME[] = "MPI_Type_create_f90_complex"; - - -int MPI_Type_create_f90_complex(int p, int r, MPI_Datatype *newtype) +PROTOTYPE ERROR_CLASS Type_create_f90_complex(INT p, INT r, DATATYPE_OUT newtype) { uint64_t key; int p_key, r_key; diff --git a/ompi/mpi/c/type_create_f90_integer.c b/ompi/mpi/c/type_create_f90_integer.c.in similarity index 93% rename from ompi/mpi/c/type_create_f90_integer.c rename to ompi/mpi/c/type_create_f90_integer.c.in index 628c2f3850a..04e63354a2b 100644 --- a/ompi/mpi/c/type_create_f90_integer.c +++ b/ompi/mpi/c/type_create_f90_integer.c.in @@ -33,17 +33,8 @@ #include "ompi/communicator/communicator.h" #include "ompi/errhandler/errhandler.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Type_create_f90_integer = PMPI_Type_create_f90_integer -#endif -#define MPI_Type_create_f90_integer PMPI_Type_create_f90_integer -#endif -static const char FUNC_NAME[] = "MPI_Type_create_f90_integer"; - - -int MPI_Type_create_f90_integer(int r, MPI_Datatype *newtype) +PROTOTYPE ERROR_CLASS Type_create_f90_integer(INT r, DATATYPE_OUT newtype) { if (MPI_PARAM_CHECK) { diff --git a/ompi/mpi/c/type_create_f90_real.c b/ompi/mpi/c/type_create_f90_real.c.in similarity index 94% rename from ompi/mpi/c/type_create_f90_real.c rename to ompi/mpi/c/type_create_f90_real.c.in index 199186ff5aa..ac0b434c33a 100644 --- a/ompi/mpi/c/type_create_f90_real.c +++ b/ompi/mpi/c/type_create_f90_real.c.in @@ -37,17 +37,8 @@ #include "ompi/communicator/communicator.h" #include "ompi/errhandler/errhandler.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Type_create_f90_real = PMPI_Type_create_f90_real -#endif -#define MPI_Type_create_f90_real PMPI_Type_create_f90_real -#endif -static const char FUNC_NAME[] = "MPI_Type_create_f90_real"; - - -int MPI_Type_create_f90_real(int p, int r, MPI_Datatype *newtype) +PROTOTYPE ERROR_CLASS Type_create_f90_real(INT p, INT r, DATATYPE_OUT newtype) { uint64_t key; int p_key, r_key; diff --git a/ompi/mpi/c/type_create_hvector.c b/ompi/mpi/c/type_create_hvector.c.in similarity index 83% rename from ompi/mpi/c/type_create_hvector.c rename to ompi/mpi/c/type_create_hvector.c.in index 6a7b259842c..da508ad28c6 100644 --- a/ompi/mpi/c/type_create_hvector.c +++ b/ompi/mpi/c/type_create_hvector.c.in @@ -30,21 +30,11 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Type_create_hvector = PMPI_Type_create_hvector -#endif -#define MPI_Type_create_hvector PMPI_Type_create_hvector -#endif - -static const char FUNC_NAME[] = "MPI_Type_create_hvector"; - - -int MPI_Type_create_hvector(int count, - int blocklength, - MPI_Aint stride, - MPI_Datatype oldtype, - MPI_Datatype *newtype) +PROTOTYPE ERROR_CLASS Type_create_hvector(INT count, + INT blocklength, + AINT stride, + DATATYPE oldtype, + DATATYPE_OUT newtype) { int rc; diff --git a/ompi/mpi/c/type_create_indexed_block.c b/ompi/mpi/c/type_create_indexed_block.c.in similarity index 82% rename from ompi/mpi/c/type_create_indexed_block.c rename to ompi/mpi/c/type_create_indexed_block.c.in index cec91fbfa5e..b675c866a11 100644 --- a/ompi/mpi/c/type_create_indexed_block.c +++ b/ompi/mpi/c/type_create_indexed_block.c.in @@ -30,21 +30,12 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Type_create_indexed_block = PMPI_Type_create_indexed_block -#endif -#define MPI_Type_create_indexed_block PMPI_Type_create_indexed_block -#endif -static const char FUNC_NAME[] = "MPI_Type_create_indexed_block"; - - -int MPI_Type_create_indexed_block(int count, - int blocklength, - const int array_of_displacements[], - MPI_Datatype oldtype, - MPI_Datatype *newtype) +PROTOTYPE ERROR_CLASS Type_create_indexed_block(INT count, + INT blocklength, + INT_ARRAY array_of_displacements, + DATATYPE oldtype, + DATATYPE_OUT newtype) { int rc; diff --git a/ompi/mpi/c/type_create_keyval.c b/ompi/mpi/c/type_create_keyval.c.in similarity index 80% rename from ompi/mpi/c/type_create_keyval.c rename to ompi/mpi/c/type_create_keyval.c.in index 9844599eabf..dd948ee31d4 100644 --- a/ompi/mpi/c/type_create_keyval.c +++ b/ompi/mpi/c/type_create_keyval.c.in @@ -29,20 +29,11 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/attribute/attribute.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Type_create_keyval = PMPI_Type_create_keyval -#endif -#define MPI_Type_create_keyval PMPI_Type_create_keyval -#endif -static const char FUNC_NAME[] = "MPI_Type_create_keyval"; - - -int MPI_Type_create_keyval(MPI_Type_copy_attr_function *type_copy_attr_fn, - MPI_Type_delete_attr_function *type_delete_attr_fn, - int *type_keyval, - void *extra_state) +PROTOTYPE ERROR_CLASS Type_create_keyval(TYPE_COPY_ATTR_FUNCTION type_copy_attr_fn, + TYPE_DELETE_ATTR_FUNCTION type_delete_attr_fn, + INT_OUT type_keyval, + BUFFER_OUT extra_state) { int ret; ompi_attribute_fn_ptr_union_t copy_fn; diff --git a/ompi/mpi/c/type_create_resized.c b/ompi/mpi/c/type_create_resized.c.in similarity index 81% rename from ompi/mpi/c/type_create_resized.c rename to ompi/mpi/c/type_create_resized.c.in index a88c5b9ad06..7657b3ad089 100644 --- a/ompi/mpi/c/type_create_resized.c +++ b/ompi/mpi/c/type_create_resized.c.in @@ -27,20 +27,11 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Type_create_resized = PMPI_Type_create_resized -#endif -#define MPI_Type_create_resized PMPI_Type_create_resized -#endif -static const char FUNC_NAME[] = "MPI_Type_create_resized"; - - -int MPI_Type_create_resized(MPI_Datatype oldtype, - MPI_Aint lb, - MPI_Aint extent, - MPI_Datatype *newtype) +PROTOTYPE ERROR_CLASS Type_create_resized(DATATYPE oldtype, + AINT lb, + AINT extent, + DATATYPE_OUT newtype) { int rc; diff --git a/ompi/mpi/c/type_create_subarray.c b/ompi/mpi/c/type_create_subarray.c.in similarity index 83% rename from ompi/mpi/c/type_create_subarray.c rename to ompi/mpi/c/type_create_subarray.c.in index daa68e634e6..1fd895633d5 100644 --- a/ompi/mpi/c/type_create_subarray.c +++ b/ompi/mpi/c/type_create_subarray.c.in @@ -31,23 +31,13 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Type_create_subarray = PMPI_Type_create_subarray -#endif -#define MPI_Type_create_subarray PMPI_Type_create_subarray -#endif - -static const char FUNC_NAME[] = "MPI_Type_create_subarray"; - - -int MPI_Type_create_subarray(int ndims, - const int size_array[], - const int subsize_array[], - const int start_array[], - int order, - MPI_Datatype oldtype, - MPI_Datatype *newtype) +PROTOTYPE ERROR_CLASS Type_create_subarray(INT ndims, + INT_ARRAY size_array, + INT_ARRAY subsize_array, + INT_ARRAY start_array, + INT order, + DATATYPE oldtype, + DATATYPE_OUT newtype) { int32_t i, rc; diff --git a/ompi/mpi/c/type_delete_attr.c b/ompi/mpi/c/type_delete_attr.c.in similarity index 85% rename from ompi/mpi/c/type_delete_attr.c rename to ompi/mpi/c/type_delete_attr.c.in index 050df3586d0..22b2f3ab07d 100644 --- a/ompi/mpi/c/type_delete_attr.c +++ b/ompi/mpi/c/type_delete_attr.c.in @@ -28,17 +28,8 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Type_delete_attr = PMPI_Type_delete_attr -#endif -#define MPI_Type_delete_attr PMPI_Type_delete_attr -#endif -static const char FUNC_NAME[] = "MPI_Type_delete_attr"; - - -int MPI_Type_delete_attr (MPI_Datatype type, int type_keyval) +PROTOTYPE ERROR_CLASS Type_delete_attr (DATATYPE type, INT type_keyval) { int ret; diff --git a/ompi/mpi/c/type_dup.c b/ompi/mpi/c/type_dup.c.in similarity index 90% rename from ompi/mpi/c/type_dup.c rename to ompi/mpi/c/type_dup.c.in index 27d3fae39cf..128173e3f50 100644 --- a/ompi/mpi/c/type_dup.c +++ b/ompi/mpi/c/type_dup.c.in @@ -28,18 +28,8 @@ #include "ompi/attribute/attribute.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Type_dup = PMPI_Type_dup -#endif -#define MPI_Type_dup PMPI_Type_dup -#endif - -static const char FUNC_NAME[] = "MPI_Type_dup"; - - -int MPI_Type_dup (MPI_Datatype type, - MPI_Datatype *newtype) +PROTOTYPE ERROR_CLASS Type_dup (DATATYPE type, + DATATYPE_OUT newtype) { int ret; diff --git a/ompi/mpi/c/type_f2c.c b/ompi/mpi/c/type_f2c.c.in similarity index 88% rename from ompi/mpi/c/type_f2c.c rename to ompi/mpi/c/type_f2c.c.in index 2afa2909ddd..77cb23a07ee 100644 --- a/ompi/mpi/c/type_f2c.c +++ b/ompi/mpi/c/type_f2c.c.in @@ -29,17 +29,7 @@ #include "ompi/datatype/ompi_datatype_internal.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Type_f2c = PMPI_Type_f2c -#endif -#define MPI_Type_f2c PMPI_Type_f2c -#endif - -static const char FUNC_NAME[] = "MPI_Type_f2c"; - - -MPI_Datatype MPI_Type_f2c(MPI_Fint datatype) +PROTOTYPE DATATYPE type_f2c(FINT datatype) { int datatype_index = OMPI_FINT_2_INT(datatype); diff --git a/ompi/mpi/c/type_free.c b/ompi/mpi/c/type_free.c.in similarity index 88% rename from ompi/mpi/c/type_free.c rename to ompi/mpi/c/type_free.c.in index c7b562d961b..2d6274c2f32 100644 --- a/ompi/mpi/c/type_free.c +++ b/ompi/mpi/c/type_free.c.in @@ -28,17 +28,7 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Type_free = PMPI_Type_free -#endif -#define MPI_Type_free PMPI_Type_free -#endif - -static const char FUNC_NAME[] = "MPI_Type_free"; - - -int MPI_Type_free(MPI_Datatype *type) +PROTOTYPE ERROR_CLASS Type_free(DATATYPE_OUT type) { int rc; diff --git a/ompi/mpi/c/type_free_keyval.c b/ompi/mpi/c/type_free_keyval.c.in similarity index 84% rename from ompi/mpi/c/type_free_keyval.c rename to ompi/mpi/c/type_free_keyval.c.in index 3ea276a1cf2..73a8a5eacb6 100644 --- a/ompi/mpi/c/type_free_keyval.c +++ b/ompi/mpi/c/type_free_keyval.c.in @@ -26,17 +26,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/attribute/attribute.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Type_free_keyval = PMPI_Type_free_keyval -#endif -#define MPI_Type_free_keyval PMPI_Type_free_keyval -#endif -static const char FUNC_NAME[] = "MPI_Type_free_keyval"; - - -int MPI_Type_free_keyval(int *type_keyval) +PROTOTYPE ERROR_CLASS Type_free_keyval(INT_OUT type_keyval) { int ret; diff --git a/ompi/mpi/c/type_get_attr.c b/ompi/mpi/c/type_get_attr.c.in similarity index 85% rename from ompi/mpi/c/type_get_attr.c rename to ompi/mpi/c/type_get_attr.c.in index 1b42b5c8122..1ef84fbfd4d 100644 --- a/ompi/mpi/c/type_get_attr.c +++ b/ompi/mpi/c/type_get_attr.c.in @@ -28,20 +28,11 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Type_get_attr = PMPI_Type_get_attr -#endif -#define MPI_Type_get_attr PMPI_Type_get_attr -#endif -static const char FUNC_NAME[] = "MPI_Type_get_attr"; - - -int MPI_Type_get_attr (MPI_Datatype type, - int type_keyval, - void *attribute_val, - int *flag) +PROTOTYPE ERROR_CLASS Type_get_attr (DATATYPE type, + INT type_keyval, + BUFFER_OUT attribute_val, + INT_OUT flag) { int ret; diff --git a/ompi/mpi/c/type_get_contents.c b/ompi/mpi/c/type_get_contents.c.in similarity index 83% rename from ompi/mpi/c/type_get_contents.c rename to ompi/mpi/c/type_get_contents.c.in index b2998818d5d..08b94a81a7f 100644 --- a/ompi/mpi/c/type_get_contents.c +++ b/ompi/mpi/c/type_get_contents.c.in @@ -27,23 +27,13 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Type_get_contents = PMPI_Type_get_contents -#endif -#define MPI_Type_get_contents PMPI_Type_get_contents -#endif - -static const char FUNC_NAME[] = "MPI_Type_get_contents"; - - -int MPI_Type_get_contents(MPI_Datatype mtype, - int max_integers, - int max_addresses, - int max_datatypes, - int array_of_integers[], - MPI_Aint array_of_addresses[], - MPI_Datatype array_of_datatypes[]) +PROTOTYPE ERROR_CLASS Type_get_contents(DATATYPE mtype, + INT max_integers, + INT max_addresses, + INT max_datatypes, + INT_OUT array_of_integers, + AINT_OUT array_of_addresses, + DATATYPE_OUT array_of_datatypes) { int rc, i; MPI_Datatype newtype; diff --git a/ompi/mpi/c/type_get_envelope.c b/ompi/mpi/c/type_get_envelope.c.in similarity index 80% rename from ompi/mpi/c/type_get_envelope.c rename to ompi/mpi/c/type_get_envelope.c.in index 2d6861ec5d0..8e3d9cf1028 100644 --- a/ompi/mpi/c/type_get_envelope.c +++ b/ompi/mpi/c/type_get_envelope.c.in @@ -27,21 +27,11 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Type_get_envelope = PMPI_Type_get_envelope -#endif -#define MPI_Type_get_envelope PMPI_Type_get_envelope -#endif - -static const char FUNC_NAME[] = "MPI_Type_get_envelope"; - - -int MPI_Type_get_envelope(MPI_Datatype type, - int *num_integers, - int *num_addresses, - int *num_datatypes, - int *combiner) +PROTOTYPE ERROR_CLASS Type_get_envelope(DATATYPE type, + INT_OUT num_integers, + INT_OUT num_addresses, + INT_OUT num_datatypes, + INT_OUT combiner) { int rc; diff --git a/ompi/mpi/c/type_get_extent.c b/ompi/mpi/c/type_get_extent.c.in similarity index 84% rename from ompi/mpi/c/type_get_extent.c rename to ompi/mpi/c/type_get_extent.c.in index 0fddff2b0cb..8851cf70525 100644 --- a/ompi/mpi/c/type_get_extent.c +++ b/ompi/mpi/c/type_get_extent.c.in @@ -29,16 +29,8 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Type_get_extent = PMPI_Type_get_extent -#endif -#define MPI_Type_get_extent PMPI_Type_get_extent -#endif -static const char FUNC_NAME[] = "MPI_Type_get_extent"; - -int MPI_Type_get_extent(MPI_Datatype type, MPI_Aint *lb, MPI_Aint *extent) +PROTOTYPE ERROR_CLASS Type_get_extent(DATATYPE type, AINT_OUT lb, AINT_OUT extent) { int rc; diff --git a/ompi/mpi/c/type_get_extent_x.c b/ompi/mpi/c/type_get_extent_x.c.in similarity index 85% rename from ompi/mpi/c/type_get_extent_x.c rename to ompi/mpi/c/type_get_extent_x.c.in index 5781a2f5468..9850372c96c 100644 --- a/ompi/mpi/c/type_get_extent_x.c +++ b/ompi/mpi/c/type_get_extent_x.c.in @@ -29,16 +29,7 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Type_get_extent_x = PMPI_Type_get_extent_x -#endif -#define MPI_Type_get_extent_x PMPI_Type_get_extent_x -#endif - -static const char FUNC_NAME[] = "MPI_Type_get_extent_x"; - -int MPI_Type_get_extent_x(MPI_Datatype type, MPI_Count *lb, MPI_Count *extent) +PROTOTYPE ERROR_CLASS Type_get_extent_x(DATATYPE type, ELEMENT_COUNT lb, ELEMENT_COUNT extent) { MPI_Aint alb, aextent; int rc; diff --git a/ompi/mpi/c/type_get_name.c b/ompi/mpi/c/type_get_name.c.in similarity index 88% rename from ompi/mpi/c/type_get_name.c rename to ompi/mpi/c/type_get_name.c.in index b38697a1bc1..e233642909e 100644 --- a/ompi/mpi/c/type_get_name.c +++ b/ompi/mpi/c/type_get_name.c.in @@ -32,17 +32,8 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Type_get_name = PMPI_Type_get_name -#endif -#define MPI_Type_get_name PMPI_Type_get_name -#endif -static const char FUNC_NAME[] = "MPI_Type_get_name"; - - -int MPI_Type_get_name(MPI_Datatype type, char *type_name, int *resultlen) +PROTOTYPE ERROR_CLASS Type_get_name(DATATYPE type, STRING_OUT type_name, INT_OUT resultlen) { MEMCHECKER( diff --git a/ompi/mpi/c/type_get_true_extent.c b/ompi/mpi/c/type_get_true_extent.c.in similarity index 81% rename from ompi/mpi/c/type_get_true_extent.c rename to ompi/mpi/c/type_get_true_extent.c.in index f2a6377593c..111ae789984 100644 --- a/ompi/mpi/c/type_get_true_extent.c +++ b/ompi/mpi/c/type_get_true_extent.c.in @@ -29,18 +29,9 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Type_get_true_extent = PMPI_Type_get_true_extent -#endif -#define MPI_Type_get_true_extent PMPI_Type_get_true_extent -#endif - -static const char FUNC_NAME[] = "MPI_Type_get_true_extent"; - -int MPI_Type_get_true_extent(MPI_Datatype datatype, - MPI_Aint *true_lb, - MPI_Aint *true_extent) +PROTOTYPE ERROR_CLASS Type_get_true_extent(DATATYPE datatype, + AINT_OUT true_lb, + AINT_OUT true_extent) { int rc; diff --git a/ompi/mpi/c/type_get_true_extent_x.c b/ompi/mpi/c/type_get_true_extent_x.c.in similarity index 82% rename from ompi/mpi/c/type_get_true_extent_x.c rename to ompi/mpi/c/type_get_true_extent_x.c.in index bbbe7197992..712a6d80909 100644 --- a/ompi/mpi/c/type_get_true_extent_x.c +++ b/ompi/mpi/c/type_get_true_extent_x.c.in @@ -29,18 +29,9 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Type_get_true_extent_x = PMPI_Type_get_true_extent_x -#endif -#define MPI_Type_get_true_extent_x PMPI_Type_get_true_extent_x -#endif - -static const char FUNC_NAME[] = "MPI_Type_get_true_extent_x"; - -int MPI_Type_get_true_extent_x(MPI_Datatype datatype, - MPI_Count *true_lb, - MPI_Count *true_extent) +PROTOTYPE ERROR_CLASS Type_get_true_extent_x(DATATYPE datatype, + ELEMENT_COUNT true_lb, + ELEMENT_COUNT true_extent) { MPI_Aint atrue_lb, atrue_extent; int rc; diff --git a/ompi/mpi/c/type_indexed.c b/ompi/mpi/c/type_indexed.c.in similarity index 86% rename from ompi/mpi/c/type_indexed.c rename to ompi/mpi/c/type_indexed.c.in index c4589d0583d..f4c03edeb28 100644 --- a/ompi/mpi/c/type_indexed.c +++ b/ompi/mpi/c/type_indexed.c.in @@ -30,20 +30,12 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Type_indexed = PMPI_Type_indexed -#endif -#define MPI_Type_indexed PMPI_Type_indexed -#endif -static const char FUNC_NAME[] = "MPI_Type_indexed"; - -int MPI_Type_indexed(int count, - const int array_of_blocklengths[], - const int array_of_displacements[], - MPI_Datatype oldtype, - MPI_Datatype *newtype) +PROTOTYPE ERROR_CLASS Type_indexed(INT count, + INT_ARRAY array_of_blocklengths, + INT_ARRAY array_of_displacements, + DATATYPE oldtype, + DATATYPE_OUT newtype) { int rc, i; diff --git a/ompi/mpi/c/type_match_size.c b/ompi/mpi/c/type_match_size.c.in similarity index 87% rename from ompi/mpi/c/type_match_size.c rename to ompi/mpi/c/type_match_size.c.in index d34f4825960..e83fd23de5a 100644 --- a/ompi/mpi/c/type_match_size.c +++ b/ompi/mpi/c/type_match_size.c.in @@ -28,17 +28,8 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/datatype/ompi_datatype_internal.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Type_match_size = PMPI_Type_match_size -#endif -#define MPI_Type_match_size PMPI_Type_match_size -#endif -static const char FUNC_NAME[] = "MPI_Type_match_size"; - - -int MPI_Type_match_size(int typeclass, int size, MPI_Datatype *type) +PROTOTYPE ERROR_CLASS Type_match_size(INT typeclass, INT size, DATATYPE_OUT type) { if (MPI_PARAM_CHECK) { OMPI_ERR_INIT_FINALIZE(FUNC_NAME); diff --git a/ompi/mpi/c/type_set_attr.c b/ompi/mpi/c/type_set_attr.c.in similarity index 82% rename from ompi/mpi/c/type_set_attr.c rename to ompi/mpi/c/type_set_attr.c.in index 6a4b2b3b27e..9a3841e2fa0 100644 --- a/ompi/mpi/c/type_set_attr.c +++ b/ompi/mpi/c/type_set_attr.c.in @@ -28,19 +28,10 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Type_set_attr = PMPI_Type_set_attr -#endif -#define MPI_Type_set_attr PMPI_Type_set_attr -#endif -static const char FUNC_NAME[] = "MPI_Type_set_attr"; - - -int MPI_Type_set_attr (MPI_Datatype type, - int type_keyval, - void *attribute_val) +PROTOTYPE ERROR_CLASS Type_set_attr (DATATYPE type, + INT type_keyval, + BUFFER_OUT attribute_val) { int ret; diff --git a/ompi/mpi/c/type_set_name.c b/ompi/mpi/c/type_set_name.c.in similarity index 87% rename from ompi/mpi/c/type_set_name.c rename to ompi/mpi/c/type_set_name.c.in index 86cb18d94a8..2fdcf16fcf0 100644 --- a/ompi/mpi/c/type_set_name.c +++ b/ompi/mpi/c/type_set_name.c.in @@ -35,17 +35,7 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Type_set_name = PMPI_Type_set_name -#endif -#define MPI_Type_set_name PMPI_Type_set_name -#endif - -static const char FUNC_NAME[] = "MPI_Type_set_name"; - - -int MPI_Type_set_name (MPI_Datatype type, const char *type_name) +PROTOTYPE ERROR_CLASS Type_set_name (DATATYPE type, STRING type_name) { MEMCHECKER( memchecker_datatype(type); diff --git a/ompi/mpi/c/type_size.c b/ompi/mpi/c/type_size.c.in similarity index 88% rename from ompi/mpi/c/type_size.c rename to ompi/mpi/c/type_size.c.in index 9d709624f49..66578fbd0d6 100644 --- a/ompi/mpi/c/type_size.c +++ b/ompi/mpi/c/type_size.c.in @@ -31,16 +31,8 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Type_size = PMPI_Type_size -#endif -#define MPI_Type_size PMPI_Type_size -#endif -static const char FUNC_NAME[] = "MPI_Type_size"; - -int MPI_Type_size(MPI_Datatype type, int *size) +PROTOTYPE ERROR_CLASS Type_size(DATATYPE type, INT_OUT size) { size_t type_size; MEMCHECKER( diff --git a/ompi/mpi/c/type_size_x.c b/ompi/mpi/c/type_size_x.c.in similarity index 87% rename from ompi/mpi/c/type_size_x.c rename to ompi/mpi/c/type_size_x.c.in index 8a10be03606..9da0b40c69b 100644 --- a/ompi/mpi/c/type_size_x.c +++ b/ompi/mpi/c/type_size_x.c.in @@ -31,16 +31,7 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Type_size_x = PMPI_Type_size_x -#endif -#define MPI_Type_size_x PMPI_Type_size_x -#endif - -static const char FUNC_NAME[] = "MPI_Type_size_x"; - -int MPI_Type_size_x(MPI_Datatype type, MPI_Count *size) +PROTOTYPE ERROR_CLASS Type_size_x(DATATYPE type, ELEMENT_COUNT size) { size_t type_size; MEMCHECKER( diff --git a/ompi/mpi/c/type_vector.c b/ompi/mpi/c/type_vector.c.in similarity index 85% rename from ompi/mpi/c/type_vector.c rename to ompi/mpi/c/type_vector.c.in index 12524f26271..81425cb3cc7 100644 --- a/ompi/mpi/c/type_vector.c +++ b/ompi/mpi/c/type_vector.c.in @@ -30,20 +30,12 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Type_vector = PMPI_Type_vector -#endif -#define MPI_Type_vector PMPI_Type_vector -#endif -static const char FUNC_NAME[] = "MPI_Type_vector"; - -int MPI_Type_vector(int count, - int blocklength, - int stride, - MPI_Datatype oldtype, - MPI_Datatype *newtype) +PROTOTYPE ERROR_CLASS Type_vector(INT count, + INT blocklength, + INT stride, + DATATYPE oldtype, + DATATYPE_OUT newtype) { int rc; diff --git a/ompi/mpi/c/unpack.c b/ompi/mpi/c/unpack.c.in similarity index 92% rename from ompi/mpi/c/unpack.c rename to ompi/mpi/c/unpack.c.in index fb1d45204d7..76d61781fbe 100644 --- a/ompi/mpi/c/unpack.c +++ b/ompi/mpi/c/unpack.c.in @@ -30,19 +30,10 @@ #include "opal/datatype/opal_convertor.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Unpack = PMPI_Unpack -#endif -#define MPI_Unpack PMPI_Unpack -#endif -static const char FUNC_NAME[] = "MPI_Unpack"; - - -int MPI_Unpack(const void *inbuf, int insize, int *position, - void *outbuf, int outcount, MPI_Datatype datatype, - MPI_Comm comm) +PROTOTYPE ERROR_CLASS Unpack(BUFFER inbuf, INT insize, INT_OUT position, + BUFFER_OUT outbuf, INT outcount, DATATYPE datatype, + COMM comm) { int rc = MPI_SUCCESS; opal_convertor_t local_convertor; diff --git a/ompi/mpi/c/unpack_external.c b/ompi/mpi/c/unpack_external.c.in similarity index 84% rename from ompi/mpi/c/unpack_external.c rename to ompi/mpi/c/unpack_external.c.in index 579f8b912f1..72696d8a5b4 100644 --- a/ompi/mpi/c/unpack_external.c +++ b/ompi/mpi/c/unpack_external.c.in @@ -31,19 +31,9 @@ #include "opal/datatype/opal_convertor.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Unpack_external = PMPI_Unpack_external -#endif -#define MPI_Unpack_external PMPI_Unpack_external -#endif - -static const char FUNC_NAME[] = "MPI_Unpack_external"; - - -int MPI_Unpack_external (const char datarep[], const void *inbuf, MPI_Aint insize, - MPI_Aint *position, void *outbuf, int outcount, - MPI_Datatype datatype) +PROTOTYPE ERROR_CLASS Unpack_external (STRING datarep, BUFFER inbuf, AINT insize, + AINT_OUT position, BUFFER_OUT outbuf, INT outcount, + DATATYPE datatype) { int rc = MPI_SUCCESS; diff --git a/ompi/mpi/c/unpublish_name.c b/ompi/mpi/c/unpublish_name.c.in similarity index 92% rename from ompi/mpi/c/unpublish_name.c rename to ompi/mpi/c/unpublish_name.c.in index 800853df0da..016f858e1d0 100644 --- a/ompi/mpi/c/unpublish_name.c +++ b/ompi/mpi/c/unpublish_name.c.in @@ -36,18 +36,9 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/info/info.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Unpublish_name = PMPI_Unpublish_name -#endif -#define MPI_Unpublish_name PMPI_Unpublish_name -#endif -static const char FUNC_NAME[] = "MPI_Unpublish_name"; - - -int MPI_Unpublish_name(const char *service_name, MPI_Info info, - const char *port_name) +PROTOTYPE ERROR_CLASS Unpublish_name(STRING service_name, INFO info, + STRING port_name) { int ret; opal_cstring_t *info_str; diff --git a/ompi/mpi/c/wait.c b/ompi/mpi/c/wait.c.in similarity index 91% rename from ompi/mpi/c/wait.c rename to ompi/mpi/c/wait.c.in index 0145eb7187d..29ab4b3f726 100644 --- a/ompi/mpi/c/wait.c +++ b/ompi/mpi/c/wait.c.in @@ -29,17 +29,8 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Wait = PMPI_Wait -#endif -#define MPI_Wait PMPI_Wait -#endif -static const char FUNC_NAME[] = "MPI_Wait"; - - -int MPI_Wait(MPI_Request *request, MPI_Status *status) +PROTOTYPE ERROR_CLASS Wait(REQUEST_INOUT request, STATUS_OUT status) { SPC_RECORD(OMPI_SPC_WAIT, 1); diff --git a/ompi/mpi/c/waitall.c b/ompi/mpi/c/waitall.c.in similarity index 90% rename from ompi/mpi/c/waitall.c rename to ompi/mpi/c/waitall.c.in index ce2353dfc9b..0d1b5f976ab 100644 --- a/ompi/mpi/c/waitall.c +++ b/ompi/mpi/c/waitall.c.in @@ -34,17 +34,8 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Waitall = PMPI_Waitall -#endif -#define MPI_Waitall PMPI_Waitall -#endif - -static const char FUNC_NAME[] = "MPI_Waitall"; - - -int MPI_Waitall(int count, MPI_Request requests[], MPI_Status statuses[]) +PROTOTYPE ERROR_CLASS waitall(INT count, REQUEST_INOUT requests:count, + STATUS_OUT statuses:count) { SPC_RECORD(OMPI_SPC_WAITALL, 1); diff --git a/ompi/mpi/c/waitany.c b/ompi/mpi/c/waitany.c.in similarity index 90% rename from ompi/mpi/c/waitany.c rename to ompi/mpi/c/waitany.c.in index 83c7fdf2a9e..f66aabfd29b 100644 --- a/ompi/mpi/c/waitany.c +++ b/ompi/mpi/c/waitany.c.in @@ -35,17 +35,8 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Waitany = PMPI_Waitany -#endif -#define MPI_Waitany PMPI_Waitany -#endif -static const char FUNC_NAME[] = "MPI_Waitany"; - - -int MPI_Waitany(int count, MPI_Request requests[], int *indx, MPI_Status *status) +PROTOTYPE ERROR_CLASS Waitany(INT count, REQUEST_INOUT requests, INT_OUT indx, STATUS_OUT status) { SPC_RECORD(OMPI_SPC_WAITANY, 1); diff --git a/ompi/mpi/c/waitsome.c b/ompi/mpi/c/waitsome.c.in similarity index 89% rename from ompi/mpi/c/waitsome.c rename to ompi/mpi/c/waitsome.c.in index 3b5b7ea3cc3..7ed550a2115 100644 --- a/ompi/mpi/c/waitsome.c +++ b/ompi/mpi/c/waitsome.c.in @@ -35,19 +35,9 @@ #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Waitsome = PMPI_Waitsome -#endif -#define MPI_Waitsome PMPI_Waitsome -#endif - -static const char FUNC_NAME[] = "MPI_Waitsome"; - - -int MPI_Waitsome(int incount, MPI_Request requests[], - int *outcount, int indices[], - MPI_Status statuses[]) +PROTOTYPE ERROR_CLASS waitsome(INT incount, REQUEST_INOUT requests:incount, + INT_OUT outcount, INT_OUT indices:incount, + STATUS_OUT statuses:incount) { SPC_RECORD(OMPI_SPC_WAITSOME, 1); diff --git a/ompi/mpi/c/win_allocate.c b/ompi/mpi/c/win_allocate.c.in similarity index 88% rename from ompi/mpi/c/win_allocate.c rename to ompi/mpi/c/win_allocate.c.in index 6db2837a3a2..ef21044418f 100644 --- a/ompi/mpi/c/win_allocate.c +++ b/ompi/mpi/c/win_allocate.c.in @@ -31,18 +31,9 @@ #include "ompi/win/win.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Win_allocate = PMPI_Win_allocate -#endif -#define MPI_Win_allocate PMPI_Win_allocate -#endif -static const char FUNC_NAME[] = "MPI_Win_allocate"; - - -int MPI_Win_allocate(MPI_Aint size, int disp_unit, MPI_Info info, - MPI_Comm comm, void *baseptr, MPI_Win *win) +PROTOTYPE ERROR_CLASS Win_allocate(AINT size, INT disp_unit, INFO info, + COMM comm, BUFFER_OUT baseptr, WIN_OUT win) { int ret = MPI_SUCCESS; diff --git a/ompi/mpi/c/win_allocate_shared.c b/ompi/mpi/c/win_allocate_shared.c.in similarity index 87% rename from ompi/mpi/c/win_allocate_shared.c rename to ompi/mpi/c/win_allocate_shared.c.in index aa6b72c2fcb..cdff24ee4a9 100644 --- a/ompi/mpi/c/win_allocate_shared.c +++ b/ompi/mpi/c/win_allocate_shared.c.in @@ -34,18 +34,8 @@ #include "ompi/win/win.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Win_allocate_shared = PMPI_Win_allocate_shared -#endif -#define MPI_Win_allocate_shared PMPI_Win_allocate_shared -#endif - -static const char FUNC_NAME[] = "MPI_Win_allocate_shared"; - - -int MPI_Win_allocate_shared(MPI_Aint size, int disp_unit, MPI_Info info, - MPI_Comm comm, void *baseptr, MPI_Win *win) +PROTOTYPE ERROR_CLASS Win_allocate_shared(AINT size, INT disp_unit, INFO info, + COMM comm, BUFFER_OUT baseptr, WIN_OUT win) { int ret = MPI_SUCCESS; diff --git a/ompi/mpi/c/win_attach.c b/ompi/mpi/c/win_attach.c.in similarity index 86% rename from ompi/mpi/c/win_attach.c rename to ompi/mpi/c/win_attach.c.in index 927a1b6278a..4587d77a459 100644 --- a/ompi/mpi/c/win_attach.c +++ b/ompi/mpi/c/win_attach.c.in @@ -30,16 +30,8 @@ #include "ompi/win/win.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Win_attach = PMPI_Win_attach -#endif -#define MPI_Win_attach PMPI_Win_attach -#endif -static const char FUNC_NAME[] = "MPI_Win_attach"; - -int MPI_Win_attach(MPI_Win win, void *base, MPI_Aint size) +PROTOTYPE ERROR_CLASS Win_attach(WIN win, BUFFER_OUT base, AINT size) { int ret = MPI_SUCCESS; diff --git a/ompi/mpi/c/win_c2f.c b/ompi/mpi/c/win_c2f.c.in similarity index 89% rename from ompi/mpi/c/win_c2f.c rename to ompi/mpi/c/win_c2f.c.in index 67a5f47b3be..2059df44f6c 100644 --- a/ompi/mpi/c/win_c2f.c +++ b/ompi/mpi/c/win_c2f.c.in @@ -28,17 +28,7 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/mpi/fortran/base/fint_2_int.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Win_c2f = PMPI_Win_c2f -#endif -#define MPI_Win_c2f PMPI_Win_c2f -#endif - -static const char FUNC_NAME[] = "MPI_Win_c2f"; - - -MPI_Fint MPI_Win_c2f(MPI_Win win) +PROTOTYPE ERROR_CLASS Win_c2f(WIN win) { if ( MPI_PARAM_CHECK) { OMPI_ERR_INIT_FINALIZE(FUNC_NAME); diff --git a/ompi/mpi/c/win_call_errhandler.c b/ompi/mpi/c/win_call_errhandler.c.in similarity index 83% rename from ompi/mpi/c/win_call_errhandler.c rename to ompi/mpi/c/win_call_errhandler.c.in index 7584653c501..0a2ccd32372 100644 --- a/ompi/mpi/c/win_call_errhandler.c +++ b/ompi/mpi/c/win_call_errhandler.c.in @@ -26,17 +26,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/win/win.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Win_call_errhandler = PMPI_Win_call_errhandler -#endif -#define MPI_Win_call_errhandler PMPI_Win_call_errhandler -#endif -static const char FUNC_NAME[] = "MPI_Win_call_errhandler"; - - -int MPI_Win_call_errhandler(MPI_Win win, int errorcode) +PROTOTYPE ERROR_CLASS Win_call_errhandler(WIN win, INT errorcode) { if (MPI_PARAM_CHECK) { OMPI_ERR_INIT_FINALIZE(FUNC_NAME); diff --git a/ompi/mpi/c/win_complete.c b/ompi/mpi/c/win_complete.c.in similarity index 85% rename from ompi/mpi/c/win_complete.c rename to ompi/mpi/c/win_complete.c.in index 98cc831af7c..384354a45cc 100644 --- a/ompi/mpi/c/win_complete.c +++ b/ompi/mpi/c/win_complete.c.in @@ -27,17 +27,8 @@ #include "ompi/win/win.h" #include "ompi/mca/osc/osc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Win_complete = PMPI_Win_complete -#endif -#define MPI_Win_complete PMPI_Win_complete -#endif -static const char FUNC_NAME[] = "MPI_Win_complete"; - - -int MPI_Win_complete(MPI_Win win) +PROTOTYPE ERROR_CLASS Win_complete(WIN win) { int rc; diff --git a/ompi/mpi/c/win_create.c b/ompi/mpi/c/win_create.c.in similarity index 88% rename from ompi/mpi/c/win_create.c rename to ompi/mpi/c/win_create.c.in index 419ff3ddf9f..a2e744ae754 100644 --- a/ompi/mpi/c/win_create.c +++ b/ompi/mpi/c/win_create.c.in @@ -31,18 +31,9 @@ #include "ompi/win/win.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Win_create = PMPI_Win_create -#endif -#define MPI_Win_create PMPI_Win_create -#endif -static const char FUNC_NAME[] = "MPI_Win_create"; - - -int MPI_Win_create(void *base, MPI_Aint size, int disp_unit, - MPI_Info info, MPI_Comm comm, MPI_Win *win) +PROTOTYPE ERROR_CLASS Win_create(BUFFER_OUT base, AINT size, INT disp_unit, + INFO info, COMM comm, WIN_OUT win) { int ret = MPI_SUCCESS; diff --git a/ompi/mpi/c/win_create_dynamic.c b/ompi/mpi/c/win_create_dynamic.c.in similarity index 88% rename from ompi/mpi/c/win_create_dynamic.c rename to ompi/mpi/c/win_create_dynamic.c.in index a8b218e2b90..014574f4562 100644 --- a/ompi/mpi/c/win_create_dynamic.c +++ b/ompi/mpi/c/win_create_dynamic.c.in @@ -32,17 +32,7 @@ #include "ompi/win/win.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Win_create_dynamic = PMPI_Win_create_dynamic -#endif -#define MPI_Win_create_dynamic PMPI_Win_create_dynamic -#endif - -static const char FUNC_NAME[] = "MPI_Win_create_dynamic"; - - -int MPI_Win_create_dynamic(MPI_Info info, MPI_Comm comm, MPI_Win *win) +PROTOTYPE ERROR_CLASS Win_create_dynamic(INFO info, COMM comm, WIN_OUT win) { int ret = MPI_SUCCESS; diff --git a/ompi/mpi/c/win_create_errhandler.c b/ompi/mpi/c/win_create_errhandler.c.in similarity index 84% rename from ompi/mpi/c/win_create_errhandler.c rename to ompi/mpi/c/win_create_errhandler.c.in index 16c9262ff4e..adca6e3e9ca 100644 --- a/ompi/mpi/c/win_create_errhandler.c +++ b/ompi/mpi/c/win_create_errhandler.c.in @@ -30,18 +30,9 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/win/win.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Win_create_errhandler = PMPI_Win_create_errhandler -#endif -#define MPI_Win_create_errhandler PMPI_Win_create_errhandler -#endif -static const char FUNC_NAME[] = "MPI_Win_create_errhandler"; - - -int MPI_Win_create_errhandler(MPI_Win_errhandler_function *function, - MPI_Errhandler *errhandler) +PROTOTYPE ERROR_CLASS Win_create_errhandler(WIN_ERRHANLDER_FUNCTION function, + ERRHANDLER_OUT errhandler) { int err = MPI_SUCCESS; diff --git a/ompi/mpi/c/win_create_keyval.c b/ompi/mpi/c/win_create_keyval.c.in similarity index 81% rename from ompi/mpi/c/win_create_keyval.c rename to ompi/mpi/c/win_create_keyval.c.in index 33b368bdba7..34714a24b28 100644 --- a/ompi/mpi/c/win_create_keyval.c +++ b/ompi/mpi/c/win_create_keyval.c.in @@ -29,19 +29,9 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/attribute/attribute.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Win_create_keyval = PMPI_Win_create_keyval -#endif -#define MPI_Win_create_keyval PMPI_Win_create_keyval -#endif - -static const char FUNC_NAME[] = "MPI_Win_create_keyval"; - - -int MPI_Win_create_keyval(MPI_Win_copy_attr_function *win_copy_attr_fn, - MPI_Win_delete_attr_function *win_delete_attr_fn, - int *win_keyval, void *extra_state) +PROTOTYPE ERROR_CLASS Win_create_keyval(WIN_COPY_ATTR_FUNCTION win_copy_attr_fn, + WIN_DELETE_ATTR_FUNCTION win_delete_attr_fn, + INT_OUT win_keyval, BUFFER_OUT extra_state) { int ret; ompi_attribute_fn_ptr_union_t copy_fn; diff --git a/ompi/mpi/c/win_delete_attr.c b/ompi/mpi/c/win_delete_attr.c.in similarity index 84% rename from ompi/mpi/c/win_delete_attr.c rename to ompi/mpi/c/win_delete_attr.c.in index e6bfbd3f9a2..667c77664ec 100644 --- a/ompi/mpi/c/win_delete_attr.c +++ b/ompi/mpi/c/win_delete_attr.c.in @@ -27,17 +27,8 @@ #include "ompi/attribute/attribute.h" #include "ompi/win/win.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Win_delete_attr = PMPI_Win_delete_attr -#endif -#define MPI_Win_delete_attr PMPI_Win_delete_attr -#endif -static const char FUNC_NAME[] = "MPI_Win_delete_attr"; - - -int MPI_Win_delete_attr(MPI_Win win, int win_keyval) +PROTOTYPE ERROR_CLASS Win_delete_attr(WIN win, INT win_keyval) { int ret; diff --git a/ompi/mpi/c/win_detach.c b/ompi/mpi/c/win_detach.c.in similarity index 87% rename from ompi/mpi/c/win_detach.c rename to ompi/mpi/c/win_detach.c.in index 00dd0eec52a..d59391b3f17 100644 --- a/ompi/mpi/c/win_detach.c +++ b/ompi/mpi/c/win_detach.c.in @@ -30,16 +30,8 @@ #include "ompi/win/win.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Win_detach = PMPI_Win_detach -#endif -#define MPI_Win_detach PMPI_Win_detach -#endif -static const char FUNC_NAME[] = "MPI_Win_detach"; - -int MPI_Win_detach(MPI_Win win, const void *base) +PROTOTYPE ERROR_CLASS Win_detach(WIN win, BUFFER base) { int ret = MPI_SUCCESS; diff --git a/ompi/mpi/c/win_f2c.c b/ompi/mpi/c/win_f2c.c index bc8bdb7dcab..82bf2b9cc71 100644 --- a/ompi/mpi/c/win_f2c.c +++ b/ompi/mpi/c/win_f2c.c @@ -36,7 +36,6 @@ static const char FUNC_NAME[] = "MPI_Win_f2c"; - MPI_Win MPI_Win_f2c(MPI_Fint win) { int o_index= OMPI_FINT_2_INT(win); diff --git a/ompi/mpi/c/win_fence.c b/ompi/mpi/c/win_fence.c.in similarity index 88% rename from ompi/mpi/c/win_fence.c rename to ompi/mpi/c/win_fence.c.in index 33458afb207..4bde8e278db 100644 --- a/ompi/mpi/c/win_fence.c +++ b/ompi/mpi/c/win_fence.c.in @@ -30,17 +30,7 @@ #include "ompi/win/win.h" #include "ompi/mca/osc/osc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Win_fence = PMPI_Win_fence -#endif -#define MPI_Win_fence PMPI_Win_fence -#endif - -static const char FUNC_NAME[] = "MPI_Win_fence"; - - -int MPI_Win_fence(int mpi_assert, MPI_Win win) +PROTOTYPE ERROR_CLASS Win_fence(INT mpi_assert, WIN win) { int rc; diff --git a/ompi/mpi/c/win_flush.c b/ompi/mpi/c/win_flush.c.in similarity index 87% rename from ompi/mpi/c/win_flush.c rename to ompi/mpi/c/win_flush.c.in index 99030dffc06..db2910458fd 100644 --- a/ompi/mpi/c/win_flush.c +++ b/ompi/mpi/c/win_flush.c.in @@ -30,16 +30,7 @@ #include "ompi/win/win.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Win_flush = PMPI_Win_flush -#endif -#define MPI_Win_flush PMPI_Win_flush -#endif - -static const char FUNC_NAME[] = "MPI_Win_flush"; - -int MPI_Win_flush(int rank, MPI_Win win) +PROTOTYPE ERROR_CLASS Win_flush(INT rank, WIN win) { int ret = MPI_SUCCESS; diff --git a/ompi/mpi/c/win_flush_all.c b/ompi/mpi/c/win_flush_all.c.in similarity index 86% rename from ompi/mpi/c/win_flush_all.c rename to ompi/mpi/c/win_flush_all.c.in index d21f86fdf92..655d9ca2650 100644 --- a/ompi/mpi/c/win_flush_all.c +++ b/ompi/mpi/c/win_flush_all.c.in @@ -30,16 +30,8 @@ #include "ompi/win/win.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Win_flush_all = PMPI_Win_flush_all -#endif -#define MPI_Win_flush_all PMPI_Win_flush_all -#endif -static const char FUNC_NAME[] = "MPI_Win_flush_all"; - -int MPI_Win_flush_all(MPI_Win win) +PROTOTYPE ERROR_CLASS Win_flush_all(WIN win) { int ret = MPI_SUCCESS; diff --git a/ompi/mpi/c/win_flush_local.c b/ompi/mpi/c/win_flush_local.c.in similarity index 85% rename from ompi/mpi/c/win_flush_local.c rename to ompi/mpi/c/win_flush_local.c.in index 07fa1d689dd..7b4df827eba 100644 --- a/ompi/mpi/c/win_flush_local.c +++ b/ompi/mpi/c/win_flush_local.c.in @@ -30,16 +30,8 @@ #include "ompi/win/win.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Win_flush_local = PMPI_Win_flush_local -#endif -#define MPI_Win_flush_local PMPI_Win_flush_local -#endif -static const char FUNC_NAME[] = "MPI_Win_flush_local"; - -int MPI_Win_flush_local(int rank, MPI_Win win) +PROTOTYPE ERROR_CLASS Win_flush_local(INT rank, WIN win) { int ret = MPI_SUCCESS; diff --git a/ompi/mpi/c/win_flush_local_all.c b/ompi/mpi/c/win_flush_local_all.c.in similarity index 85% rename from ompi/mpi/c/win_flush_local_all.c rename to ompi/mpi/c/win_flush_local_all.c.in index 4498a98ca83..3dfeed8ab34 100644 --- a/ompi/mpi/c/win_flush_local_all.c +++ b/ompi/mpi/c/win_flush_local_all.c.in @@ -30,16 +30,8 @@ #include "ompi/win/win.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Win_flush_local_all = PMPI_Win_flush_local_all -#endif -#define MPI_Win_flush_local_all PMPI_Win_flush_local_all -#endif -static const char FUNC_NAME[] = "MPI_Win_flush_local_all"; - -int MPI_Win_flush_local_all(MPI_Win win) +PROTOTYPE ERROR_CLASS Win_flush_local_all(WIN win) { int ret = MPI_SUCCESS; diff --git a/ompi/mpi/c/win_free.c b/ompi/mpi/c/win_free.c.in similarity index 86% rename from ompi/mpi/c/win_free.c rename to ompi/mpi/c/win_free.c.in index 809b5dbd702..8146a563652 100644 --- a/ompi/mpi/c/win_free.c +++ b/ompi/mpi/c/win_free.c.in @@ -26,17 +26,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/win/win.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Win_free = PMPI_Win_free -#endif -#define MPI_Win_free PMPI_Win_free -#endif -static const char FUNC_NAME[] = "MPI_Win_free"; - - -int MPI_Win_free(MPI_Win *win) +PROTOTYPE ERROR_CLASS Win_free(WIN_OUT win) { int ret; diff --git a/ompi/mpi/c/win_free_keyval.c b/ompi/mpi/c/win_free_keyval.c.in similarity index 84% rename from ompi/mpi/c/win_free_keyval.c rename to ompi/mpi/c/win_free_keyval.c.in index 1ef42ec7e38..6129cc9d4a0 100644 --- a/ompi/mpi/c/win_free_keyval.c +++ b/ompi/mpi/c/win_free_keyval.c.in @@ -26,17 +26,7 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/attribute/attribute.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Win_free_keyval = PMPI_Win_free_keyval -#endif -#define MPI_Win_free_keyval PMPI_Win_free_keyval -#endif - -static const char FUNC_NAME[] = "MPI_Win_free_keyval"; - - -int MPI_Win_free_keyval(int *win_keyval) +PROTOTYPE ERROR_CLASS Win_free_keyval(INT_OUT win_keyval) { int ret; diff --git a/ompi/mpi/c/win_get_attr.c b/ompi/mpi/c/win_get_attr.c.in similarity index 86% rename from ompi/mpi/c/win_get_attr.c rename to ompi/mpi/c/win_get_attr.c.in index cf89c3fa1bd..9a79b5826b5 100644 --- a/ompi/mpi/c/win_get_attr.c +++ b/ompi/mpi/c/win_get_attr.c.in @@ -30,18 +30,8 @@ #include "ompi/attribute/attribute.h" #include "ompi/win/win.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Win_get_attr = PMPI_Win_get_attr -#endif -#define MPI_Win_get_attr PMPI_Win_get_attr -#endif - -static const char FUNC_NAME[] = "MPI_Win_get_attr"; - - -int MPI_Win_get_attr(MPI_Win win, int win_keyval, - void *attribute_val, int *flag) +PROTOTYPE ERROR_CLASS Win_get_attr(WIN win, INT win_keyval, + BUFFER_OUT attribute_val, INT_OUT flag) { int ret; diff --git a/ompi/mpi/c/win_get_errhandler.c b/ompi/mpi/c/win_get_errhandler.c.in similarity index 87% rename from ompi/mpi/c/win_get_errhandler.c rename to ompi/mpi/c/win_get_errhandler.c.in index 292f3c706af..ebbab932a28 100644 --- a/ompi/mpi/c/win_get_errhandler.c +++ b/ompi/mpi/c/win_get_errhandler.c.in @@ -33,17 +33,8 @@ #include "ompi/win/win.h" #include "ompi/instance/instance.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Win_get_errhandler = PMPI_Win_get_errhandler -#endif -#define MPI_Win_get_errhandler PMPI_Win_get_errhandler -#endif -static const char FUNC_NAME[] = "MPI_Win_get_errhandler"; - - -int MPI_Win_get_errhandler(MPI_Win win, MPI_Errhandler *errhandler) +PROTOTYPE ERROR_CLASS Win_get_errhandler(WIN win, ERRHANDLER_OUT errhandler) { int ret = MPI_SUCCESS; diff --git a/ompi/mpi/c/win_get_group.c b/ompi/mpi/c/win_get_group.c.in similarity index 84% rename from ompi/mpi/c/win_get_group.c rename to ompi/mpi/c/win_get_group.c.in index d4b895ece57..ce1348c888a 100644 --- a/ompi/mpi/c/win_get_group.c +++ b/ompi/mpi/c/win_get_group.c.in @@ -26,17 +26,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/win/win.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Win_get_group = PMPI_Win_get_group -#endif -#define MPI_Win_get_group PMPI_Win_get_group -#endif -static const char FUNC_NAME[] = "MPI_Win_get_group"; - - -int MPI_Win_get_group(MPI_Win win, MPI_Group *group) +PROTOTYPE ERROR_CLASS Win_get_group(WIN win, GROUP_OUT group) { int ret; diff --git a/ompi/mpi/c/win_get_info.c b/ompi/mpi/c/win_get_info.c.in similarity index 85% rename from ompi/mpi/c/win_get_info.c rename to ompi/mpi/c/win_get_info.c.in index a982b5986e1..2b6ed9e95ed 100644 --- a/ompi/mpi/c/win_get_info.c +++ b/ompi/mpi/c/win_get_info.c.in @@ -22,16 +22,7 @@ #include "opal/util/info.h" #include "opal/util/info_subscriber.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Win_get_info = PMPI_Win_get_info -#endif -#define MPI_Win_get_info PMPI_Win_get_info -#endif - -static const char FUNC_NAME[] = "MPI_Win_get_info"; - -int MPI_Win_get_info(MPI_Win win, MPI_Info *info_used) +PROTOTYPE ERROR_CLASS Win_get_info(WIN win, INFO_OUT info_used) { int ret; diff --git a/ompi/mpi/c/win_get_name.c b/ompi/mpi/c/win_get_name.c.in similarity index 87% rename from ompi/mpi/c/win_get_name.c rename to ompi/mpi/c/win_get_name.c.in index 6d745c05a5f..ec645d03227 100644 --- a/ompi/mpi/c/win_get_name.c +++ b/ompi/mpi/c/win_get_name.c.in @@ -27,17 +27,7 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/win/win.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Win_get_name = PMPI_Win_get_name -#endif -#define MPI_Win_get_name PMPI_Win_get_name -#endif - -static const char FUNC_NAME[] = "MPI_Win_get_name"; - - -int MPI_Win_get_name(MPI_Win win, char *win_name, int *resultlen) +PROTOTYPE ERROR_CLASS Win_get_name(WIN win, STRING_OUT win_name, INT_OUT resultlen) { int ret; diff --git a/ompi/mpi/c/win_lock.c b/ompi/mpi/c/win_lock.c.in similarity index 89% rename from ompi/mpi/c/win_lock.c rename to ompi/mpi/c/win_lock.c.in index 78408291611..f27f227fb74 100644 --- a/ompi/mpi/c/win_lock.c +++ b/ompi/mpi/c/win_lock.c.in @@ -30,17 +30,8 @@ #include "ompi/win/win.h" #include "ompi/mca/osc/osc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Win_lock = PMPI_Win_lock -#endif -#define MPI_Win_lock PMPI_Win_lock -#endif -static const char FUNC_NAME[] = "MPI_Win_lock"; - - -int MPI_Win_lock(int lock_type, int rank, int mpi_assert, MPI_Win win) +PROTOTYPE ERROR_CLASS Win_lock(INT lock_type, INT rank, INT mpi_assert, WIN win) { int rc; diff --git a/ompi/mpi/c/win_lock_all.c b/ompi/mpi/c/win_lock_all.c.in similarity index 86% rename from ompi/mpi/c/win_lock_all.c rename to ompi/mpi/c/win_lock_all.c.in index 6c26a761ed9..81be68ee5ae 100644 --- a/ompi/mpi/c/win_lock_all.c +++ b/ompi/mpi/c/win_lock_all.c.in @@ -27,17 +27,7 @@ #include "ompi/win/win.h" #include "ompi/mca/osc/osc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Win_lock_all = PMPI_Win_lock_all -#endif -#define MPI_Win_lock_all PMPI_Win_lock_all -#endif - -static const char FUNC_NAME[] = "MPI_Win_lock_all"; - - -int MPI_Win_lock_all(int mpi_assert, MPI_Win win) +PROTOTYPE ERROR_CLASS Win_lock_all(INT mpi_assert, WIN win) { int rc; diff --git a/ompi/mpi/c/win_post.c b/ompi/mpi/c/win_post.c.in similarity index 86% rename from ompi/mpi/c/win_post.c rename to ompi/mpi/c/win_post.c.in index 3e5d223a508..fec2ca51825 100644 --- a/ompi/mpi/c/win_post.c +++ b/ompi/mpi/c/win_post.c.in @@ -27,17 +27,8 @@ #include "ompi/win/win.h" #include "ompi/mca/osc/osc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Win_post = PMPI_Win_post -#endif -#define MPI_Win_post PMPI_Win_post -#endif -static const char FUNC_NAME[] = "MPI_Win_post"; - - -int MPI_Win_post(MPI_Group group, int mpi_assert, MPI_Win win) +PROTOTYPE ERROR_CLASS Win_post(GROUP group, INT mpi_assert, WIN win) { int rc; diff --git a/ompi/mpi/c/win_set_attr.c b/ompi/mpi/c/win_set_attr.c.in similarity index 84% rename from ompi/mpi/c/win_set_attr.c rename to ompi/mpi/c/win_set_attr.c.in index bdb41cb3e1e..e10e175b81c 100644 --- a/ompi/mpi/c/win_set_attr.c +++ b/ompi/mpi/c/win_set_attr.c.in @@ -27,17 +27,7 @@ #include "ompi/attribute/attribute.h" #include "ompi/win/win.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Win_set_attr = PMPI_Win_set_attr -#endif -#define MPI_Win_set_attr PMPI_Win_set_attr -#endif - -static const char FUNC_NAME[] = "MPI_Win_set_attr"; - - -int MPI_Win_set_attr(MPI_Win win, int win_keyval, void *attribute_val) +PROTOTYPE ERROR_CLASS Win_set_attr(WIN win, INT win_keyval, BUFFER_OUT attribute_val) { int ret; diff --git a/ompi/mpi/c/win_set_errhandler.c b/ompi/mpi/c/win_set_errhandler.c.in similarity index 87% rename from ompi/mpi/c/win_set_errhandler.c rename to ompi/mpi/c/win_set_errhandler.c.in index 820ba51b330..9e3baffbf22 100644 --- a/ompi/mpi/c/win_set_errhandler.c +++ b/ompi/mpi/c/win_set_errhandler.c.in @@ -30,17 +30,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/win/win.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Win_set_errhandler = PMPI_Win_set_errhandler -#endif -#define MPI_Win_set_errhandler PMPI_Win_set_errhandler -#endif -static const char FUNC_NAME[] = "MPI_Win_set_errhandler"; - - -int MPI_Win_set_errhandler(MPI_Win win, MPI_Errhandler errhandler) +PROTOTYPE ERROR_CLASS Win_set_errhandler(WIN win, ERRHANDLER errhandler) { MPI_Errhandler tmp; diff --git a/ompi/mpi/c/win_set_info.c b/ompi/mpi/c/win_set_info.c.in similarity index 80% rename from ompi/mpi/c/win_set_info.c rename to ompi/mpi/c/win_set_info.c.in index bb9c6bb572b..f253b792507 100644 --- a/ompi/mpi/c/win_set_info.c +++ b/ompi/mpi/c/win_set_info.c.in @@ -19,17 +19,8 @@ #include "ompi/communicator/communicator.h" #include "opal/util/info_subscriber.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Win_set_info = PMPI_Win_set_info -#endif -#define MPI_Win_set_info PMPI_Win_set_info -#endif -static const char FUNC_NAME[] = "MPI_Win_set_info"; - - -int MPI_Win_set_info(MPI_Win win, MPI_Info info) +PROTOTYPE ERROR_CLASS Win_set_info(WIN win, INFO info) { int ret; diff --git a/ompi/mpi/c/win_set_name.c b/ompi/mpi/c/win_set_name.c.in similarity index 86% rename from ompi/mpi/c/win_set_name.c rename to ompi/mpi/c/win_set_name.c.in index 2d20c5a4d10..ee08b74e863 100644 --- a/ompi/mpi/c/win_set_name.c +++ b/ompi/mpi/c/win_set_name.c.in @@ -30,17 +30,7 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/win/win.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Win_set_name = PMPI_Win_set_name -#endif -#define MPI_Win_set_name PMPI_Win_set_name -#endif - -static const char FUNC_NAME[] = "MPI_Win_set_name"; - - -int MPI_Win_set_name(MPI_Win win, const char *win_name) +PROTOTYPE ERROR_CLASS Win_set_name(WIN win, STRING win_name) { int ret; diff --git a/ompi/mpi/c/win_shared_query.c b/ompi/mpi/c/win_shared_query.c.in similarity index 81% rename from ompi/mpi/c/win_shared_query.c rename to ompi/mpi/c/win_shared_query.c.in index e9293047689..ce3f65e71f4 100644 --- a/ompi/mpi/c/win_shared_query.c +++ b/ompi/mpi/c/win_shared_query.c.in @@ -22,17 +22,8 @@ #include "ompi/win/win.h" #include "ompi/mca/osc/osc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Win_shared_query = PMPI_Win_shared_query -#endif -#define MPI_Win_shared_query PMPI_Win_shared_query -#endif -static const char FUNC_NAME[] = "MPI_Win_shared_query"; - - -int MPI_Win_shared_query(MPI_Win win, int rank, MPI_Aint *size, int *disp_unit, void *baseptr) +PROTOTYPE ERROR_CLASS Win_shared_query(WIN win, INT rank, AINT_OUT size, INT_OUT disp_unit, BUFFER_OUT baseptr) { int rc; size_t tsize; diff --git a/ompi/mpi/c/win_start.c b/ompi/mpi/c/win_start.c.in similarity index 85% rename from ompi/mpi/c/win_start.c rename to ompi/mpi/c/win_start.c.in index bd9cbe776b6..08b2a437842 100644 --- a/ompi/mpi/c/win_start.c +++ b/ompi/mpi/c/win_start.c.in @@ -27,17 +27,7 @@ #include "ompi/win/win.h" #include "ompi/mca/osc/osc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Win_start = PMPI_Win_start -#endif -#define MPI_Win_start PMPI_Win_start -#endif - -static const char FUNC_NAME[] = "MPI_Win_start"; - - -int MPI_Win_start(MPI_Group group, int mpi_assert, MPI_Win win) +PROTOTYPE ERROR_CLASS Win_start(GROUP group, INT mpi_assert, WIN win) { int rc; diff --git a/ompi/mpi/c/win_sync.c b/ompi/mpi/c/win_sync.c.in similarity index 87% rename from ompi/mpi/c/win_sync.c rename to ompi/mpi/c/win_sync.c.in index 11f05e47c01..27d3b99c7bf 100644 --- a/ompi/mpi/c/win_sync.c +++ b/ompi/mpi/c/win_sync.c.in @@ -30,16 +30,8 @@ #include "ompi/win/win.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Win_sync = PMPI_Win_sync -#endif -#define MPI_Win_sync PMPI_Win_sync -#endif -static const char FUNC_NAME[] = "MPI_Win_sync"; - -int MPI_Win_sync(MPI_Win win) +PROTOTYPE ERROR_CLASS Win_sync(WIN win) { int ret = MPI_SUCCESS; diff --git a/ompi/mpi/c/win_test.c b/ompi/mpi/c/win_test.c.in similarity index 85% rename from ompi/mpi/c/win_test.c rename to ompi/mpi/c/win_test.c.in index a2ef3c8b448..f000d2337b1 100644 --- a/ompi/mpi/c/win_test.c +++ b/ompi/mpi/c/win_test.c.in @@ -27,17 +27,7 @@ #include "ompi/win/win.h" #include "ompi/mca/osc/osc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Win_test = PMPI_Win_test -#endif -#define MPI_Win_test PMPI_Win_test -#endif - -static const char FUNC_NAME[] = "MPI_Win_test"; - - -int MPI_Win_test(MPI_Win win, int *flag) +PROTOTYPE ERROR_CLASS Win_test(WIN win, INT_OUT flag) { int rc; diff --git a/ompi/mpi/c/win_unlock.c b/ompi/mpi/c/win_unlock.c.in similarity index 87% rename from ompi/mpi/c/win_unlock.c rename to ompi/mpi/c/win_unlock.c.in index 3e08087b553..ba91af670d8 100644 --- a/ompi/mpi/c/win_unlock.c +++ b/ompi/mpi/c/win_unlock.c.in @@ -30,17 +30,8 @@ #include "ompi/win/win.h" #include "ompi/mca/osc/osc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Win_unlock = PMPI_Win_unlock -#endif -#define MPI_Win_unlock PMPI_Win_unlock -#endif -static const char FUNC_NAME[] = "MPI_Win_unlock"; - - -int MPI_Win_unlock(int rank, MPI_Win win) +PROTOTYPE ERROR_CLASS Win_unlock(INT rank, WIN win) { int rc; diff --git a/ompi/mpi/c/win_unlock_all.c b/ompi/mpi/c/win_unlock_all.c.in similarity index 84% rename from ompi/mpi/c/win_unlock_all.c rename to ompi/mpi/c/win_unlock_all.c.in index cbf01986a78..e58c6890a5c 100644 --- a/ompi/mpi/c/win_unlock_all.c +++ b/ompi/mpi/c/win_unlock_all.c.in @@ -27,17 +27,8 @@ #include "ompi/win/win.h" #include "ompi/mca/osc/osc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Win_unlock_all = PMPI_Win_unlock_all -#endif -#define MPI_Win_unlock_all PMPI_Win_unlock_all -#endif -static const char FUNC_NAME[] = "MPI_Win_unlock_all"; - - -int MPI_Win_unlock_all(MPI_Win win) +PROTOTYPE ERROR_CLASS Win_unlock_all(WIN win) { int rc; diff --git a/ompi/mpi/c/win_wait.c b/ompi/mpi/c/win_wait.c.in similarity index 86% rename from ompi/mpi/c/win_wait.c rename to ompi/mpi/c/win_wait.c.in index d55ad56f999..53447fa4ec8 100644 --- a/ompi/mpi/c/win_wait.c +++ b/ompi/mpi/c/win_wait.c.in @@ -27,17 +27,8 @@ #include "ompi/win/win.h" #include "ompi/mca/osc/osc.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Win_wait = PMPI_Win_wait -#endif -#define MPI_Win_wait PMPI_Win_wait -#endif -static const char FUNC_NAME[] = "MPI_Win_wait"; - - -int MPI_Win_wait(MPI_Win win) +PROTOTYPE ERROR_CLASS Win_wait(WIN win) { int rc; diff --git a/ompi/mpi/c/wtime.c b/ompi/mpi/c/wtime.c.in similarity index 93% rename from ompi/mpi/c/wtime.c rename to ompi/mpi/c/wtime.c.in index b7918ad5d0d..3c2f88cbdfb 100644 --- a/ompi/mpi/c/wtime.c +++ b/ompi/mpi/c/wtime.c.in @@ -38,21 +38,18 @@ #include "opal/util/clock_gettime.h" #if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Wtime = PMPI_Wtime -#endif -#define MPI_Wtime PMPI_Wtime /** * Have a base time set on the first call to wtime, to improve the range * and accuracy of the user visible timer. * More info: https://github.com/mpi-forum/mpi-issues/issues/77#issuecomment-369663119 */ struct timespec ompi_wtime_time_origin = {.tv_sec = 0}; -#else /* OMPI_BUILD_MPI_PROFILING */ +#else extern struct timespec ompi_wtime_time_origin; #endif -double MPI_Wtime(void) + +PROTOTYPE DOUBLE wtime() { double wtime; diff --git a/ompi/util/count_disp_array.h b/ompi/util/count_disp_array.h index b95137db23a..964b67bc324 100644 --- a/ompi/util/count_disp_array.h +++ b/ompi/util/count_disp_array.h @@ -37,7 +37,8 @@ static inline void ompi_count_array_init_c(ompi_count_array_t *array, const size int *: ompi_count_array_init, \ const int *: ompi_count_array_init, \ size_t *: ompi_count_array_init_c, \ - const size_t *: ompi_count_array_init_c)(array, data) + const size_t *: ompi_count_array_init_c, \ + const MPI_Count *: ompi_count_array_init_c)(array, data) #else #define OMPI_COUNT_ARRAY_INIT(array, data) \ do { \