From 86be709c6849498f22d8a4601de9973ceee714ea Mon Sep 17 00:00:00 2001 From: Jake Tronge Date: Mon, 12 Aug 2024 09:49:34 -0600 Subject: [PATCH 1/3] 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. Note that there are additional changes needed to Open MPI for bigcount support. One is that the datatype system needs to be embiggened. This PR includes workarounds for this lack of support that will need to be changed once the datatype system is embiggened. These areas of code are marked with TODO:BIGCOUNT. 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 | 7 + 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 | 925 +++++++++++- ompi/mpi/Makefile.am | 9 +- ompi/mpi/bindings/bindings.py | 75 + ompi/mpi/bindings/ompi_bindings/c.py | 386 +++++ ompi/mpi/bindings/ompi_bindings/c_type.py | 1237 +++++++++++++++++ ompi/mpi/bindings/ompi_bindings/consts.py | 253 ++++ ompi/mpi/bindings/ompi_bindings/fortran.py | 287 ++++ .../bindings/ompi_bindings/fortran_type.py | 475 +++++++ ompi/mpi/bindings/ompi_bindings/parser.py | 145 ++ ompi/mpi/bindings/ompi_bindings/util.py | 146 ++ ompi/mpi/c/Makefile.am | 901 ++++++------ ompi/mpi/c/{abort.c => abort.c.in} | 15 +- ompi/mpi/c/{accumulate.c => accumulate.c.in} | 18 +- ...add_error_class.c => add_error_class.c.in} | 15 +- .../{add_error_code.c => add_error_code.c.in} | 15 +- ...d_error_string.c => add_error_string.c.in} | 14 +- ompi/mpi/c/{allgather.c => allgather.c.in} | 18 +- .../{allgather_init.c => allgather_init.c.in} | 18 +- ompi/mpi/c/{allgatherv.c => allgatherv.c.in} | 17 +- ...allgatherv_init.c => allgatherv_init.c.in} | 20 +- ompi/mpi/c/{alloc_mem.c => alloc_mem.c.in} | 14 +- ompi/mpi/c/{allreduce.c => allreduce.c.in} | 16 +- .../{allreduce_init.c => allreduce_init.c.in} | 18 +- ompi/mpi/c/{alltoall.c => alltoall.c.in} | 19 +- .../c/{alltoall_init.c => alltoall_init.c.in} | 18 +- ompi/mpi/c/{alltoallv.c => alltoallv.c.in} | 22 +- .../{alltoallv_init.c => alltoallv_init.c.in} | 20 +- ompi/mpi/c/{alltoallw.c => alltoallw.c.in} | 20 +- .../{alltoallw_init.c => alltoallw_init.c.in} | 20 +- .../mpi/c/{attr_delete.c => attr_delete.c.in} | 14 +- ompi/mpi/c/{attr_get.c => attr_get.c.in} | 13 +- ompi/mpi/c/{attr_put.c => attr_put.c.in} | 13 +- ompi/mpi/c/{barrier.c => barrier.c.in} | 14 +- .../c/{barrier_init.c => barrier_init.c.in} | 14 +- ompi/mpi/c/{bcast.c => bcast.c.in} | 16 +- ompi/mpi/c/{bcast_init.c => bcast_init.c.in} | 16 +- ompi/mpi/c/bindings.h | 12 + ompi/mpi/c/{bsend.c => bsend.c.in} | 15 +- ompi/mpi/c/{bsend_init.c => bsend_init.c.in} | 16 +- .../c/{buffer_attach.c => buffer_attach.c.in} | 14 +- .../c/{buffer_detach.c => buffer_detach.c.in} | 14 +- ompi/mpi/c/{cancel.c => cancel.c.in} | 15 +- .../mpi/c/{cart_coords.c => cart_coords.c.in} | 13 +- .../mpi/c/{cart_create.c => cart_create.c.in} | 16 +- ompi/mpi/c/{cart_get.c => cart_get.c.in} | 15 +- ompi/mpi/c/{cart_map.c => cart_map.c.in} | 16 +- ompi/mpi/c/{cart_rank.c => cart_rank.c.in} | 13 +- ompi/mpi/c/{cart_shift.c => cart_shift.c.in} | 16 +- ompi/mpi/c/{cart_sub.c => cart_sub.c.in} | 14 +- .../mpi/c/{cartdim_get.c => cartdim_get.c.in} | 15 +- ompi/mpi/c/{close_port.c => close_port.c.in} | 15 +- .../mpi/c/{comm_accept.c => comm_accept.c.in} | 16 +- ompi/mpi/c/{comm_c2f.c => comm_c2f.c.in} | 14 +- ...errhandler.c => comm_call_errhandler.c.in} | 15 +- .../c/{comm_compare.c => comm_compare.c.in} | 19 +- .../c/{comm_connect.c => comm_connect.c.in} | 16 +- .../mpi/c/{comm_create.c => comm_create.c.in} | 16 +- ...rhandler.c => comm_create_errhandler.c.in} | 17 +- ...om_group.c => comm_create_from_group.c.in} | 15 +- ..._create_group.c => comm_create_group.c.in} | 15 +- ...reate_keyval.c => comm_create_keyval.c.in} | 18 +- ...mm_delete_attr.c => comm_delete_attr.c.in} | 14 +- ...comm_disconnect.c => comm_disconnect.c.in} | 16 +- ompi/mpi/c/{comm_dup.c => comm_dup.c.in} | 13 +- ...up_with_info.c => comm_dup_with_info.c.in} | 13 +- ompi/mpi/c/{comm_f2c.c => comm_f2c.c.in} | 14 +- ompi/mpi/c/{comm_free.c => comm_free.c.in} | 14 +- ...mm_free_keyval.c => comm_free_keyval.c.in} | 14 +- .../c/{comm_get_attr.c => comm_get_attr.c.in} | 16 +- ..._errhandler.c => comm_get_errhandler.c.in} | 15 +- .../c/{comm_get_info.c => comm_get_info.c.in} | 14 +- .../c/{comm_get_name.c => comm_get_name.c.in} | 14 +- ...comm_get_parent.c => comm_get_parent.c.in} | 14 +- ompi/mpi/c/{comm_group.c => comm_group.c.in} | 15 +- ompi/mpi/c/{comm_idup.c => comm_idup.c.in} | 13 +- ...p_with_info.c => comm_idup_with_info.c.in} | 14 +- ompi/mpi/c/{comm_join.c => comm_join.c.in} | 194 ++- ompi/mpi/c/{comm_rank.c => comm_rank.c.in} | 14 +- ..._remote_group.c => comm_remote_group.c.in} | 15 +- ...mm_remote_size.c => comm_remote_size.c.in} | 16 +- .../c/{comm_set_attr.c => comm_set_attr.c.in} | 15 +- ..._errhandler.c => comm_set_errhandler.c.in} | 14 +- .../c/{comm_set_info.c => comm_set_info.c.in} | 14 +- .../c/{comm_set_name.c => comm_set_name.c.in} | 14 +- ompi/mpi/c/{comm_size.c => comm_size.c.in} | 14 +- ompi/mpi/c/{comm_spawn.c => comm_spawn.c.in} | 18 +- ...wn_multiple.c => comm_spawn_multiple.c.in} | 20 +- ompi/mpi/c/{comm_split.c => comm_split.c.in} | 16 +- ...comm_split_type.c => comm_split_type.c.in} | 18 +- ...comm_test_inter.c => comm_test_inter.c.in} | 21 +- ...mpare_and_swap.c => compare_and_swap.c.in} | 17 +- .../mpi/c/{dims_create.c => dims_create.c.in} | 203 ++- ..._graph_create.c => dist_graph_create.c.in} | 17 +- ...cent.c => dist_graph_create_adjacent.c.in} | 24 +- ..._neighbors.c => dist_graph_neighbors.c.in} | 20 +- ...ount.c => dist_graph_neighbors_count.c.in} | 16 +- .../{errhandler_c2f.c => errhandler_c2f.c.in} | 14 +- .../{errhandler_f2c.c => errhandler_f2c.c.in} | 14 +- ...errhandler_free.c => errhandler_free.c.in} | 14 +- .../mpi/c/{error_class.c => error_class.c.in} | 14 +- .../c/{error_string.c => error_string.c.in} | 15 +- ompi/mpi/c/{exscan.c => exscan.c.in} | 16 +- .../mpi/c/{exscan_init.c => exscan_init.c.in} | 18 +- .../c/{fetch_and_op.c => fetch_and_op.c.in} | 16 +- ompi/mpi/c/{file_c2f.c => file_c2f.c.in} | 14 +- ...errhandler.c => file_call_errhandler.c.in} | 14 +- ompi/mpi/c/{file_close.c => file_close.c.in} | 14 +- ...rhandler.c => file_create_errhandler.c.in} | 17 +- .../mpi/c/{file_delete.c => file_delete.c.in} | 14 +- ompi/mpi/c/{file_f2c.c => file_f2c.c.in} | 14 +- .../{file_get_amode.c => file_get_amode.c.in} | 12 +- ...et_atomicity.c => file_get_atomicity.c.in} | 12 +- ...yte_offset.c => file_get_byte_offset.c.in} | 14 +- ..._errhandler.c => file_get_errhandler.c.in} | 14 +- .../{file_get_group.c => file_get_group.c.in} | 14 +- .../c/{file_get_info.c => file_get_info.c.in} | 12 +- ..._get_position.c => file_get_position.c.in} | 12 +- ...shared.c => file_get_position_shared.c.in} | 12 +- .../c/{file_get_size.c => file_get_size.c.in} | 12 +- ...ype_extent.c => file_get_type_extent.c.in} | 18 +- .../c/{file_get_view.c => file_get_view.c.in} | 15 +- ompi/mpi/c/{file_iread.c => file_iread.c.in} | 14 +- .../{file_iread_all.c => file_iread_all.c.in} | 14 +- .../c/{file_iread_at.c => file_iread_at.c.in} | 14 +- ..._iread_at_all.c => file_iread_at_all.c.in} | 14 +- ..._iread_shared.c => file_iread_shared.c.in} | 14 +- .../mpi/c/{file_iwrite.c => file_iwrite.c.in} | 14 +- ...file_iwrite_all.c => file_iwrite_all.c.in} | 14 +- .../{file_iwrite_at.c => file_iwrite_at.c.in} | 16 +- ...write_at_all.c => file_iwrite_at_all.c.in} | 16 +- ...write_shared.c => file_iwrite_shared.c.in} | 14 +- ompi/mpi/c/{file_open.c => file_open.c.in} | 17 +- ...le_preallocate.c => file_preallocate.c.in} | 12 +- ompi/mpi/c/{file_read.c => file_read.c.in} | 14 +- .../c/{file_read_all.c => file_read_all.c.in} | 14 +- ...d_all_begin.c => file_read_all_begin.c.in} | 14 +- ..._read_all_end.c => file_read_all_end.c.in} | 12 +- .../c/{file_read_at.c => file_read_at.c.in} | 14 +- ...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} | 12 +- ..._read_ordered.c => file_read_ordered.c.in} | 14 +- ...d_begin.c => file_read_ordered_begin.c.in} | 14 +- ...dered_end.c => file_read_ordered_end.c.in} | 12 +- ...le_read_shared.c => file_read_shared.c.in} | 14 +- ompi/mpi/c/{file_seek.c => file_seek.c.in} | 12 +- ...le_seek_shared.c => file_seek_shared.c.in} | 12 +- ...et_atomicity.c => file_set_atomicity.c.in} | 12 +- ..._errhandler.c => file_set_errhandler.c.in} | 14 +- .../c/{file_set_info.c => file_set_info.c.in} | 12 +- .../c/{file_set_size.c => file_set_size.c.in} | 12 +- .../c/{file_set_view.c => file_set_view.c.in} | 14 +- ompi/mpi/c/{file_sync.c => file_sync.c.in} | 12 +- ompi/mpi/c/{file_write.c => file_write.c.in} | 14 +- .../{file_write_all.c => file_write_all.c.in} | 14 +- ..._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} | 16 +- ..._write_at_all.c => file_write_at_all.c.in} | 16 +- ...l_begin.c => file_write_at_all_begin.c.in} | 14 +- ...t_all_end.c => file_write_at_all_end.c.in} | 12 +- ...rite_ordered.c => file_write_ordered.c.in} | 14 +- ..._begin.c => file_write_ordered_begin.c.in} | 14 +- ...ered_end.c => file_write_ordered_end.c.in} | 12 +- ..._write_shared.c => file_write_shared.c.in} | 14 +- ompi/mpi/c/{finalize.c => finalize.c.in} | 14 +- ompi/mpi/c/{finalized.c => finalized.c.in} | 14 +- ompi/mpi/c/{free_mem.c => free_mem.c.in} | 14 +- ompi/mpi/c/{gather.c => gather.c.in} | 18 +- .../mpi/c/{gather_init.c => gather_init.c.in} | 18 +- ompi/mpi/c/{gatherv.c => gatherv.c.in} | 18 +- .../c/{gatherv_init.c => gatherv_init.c.in} | 20 +- ompi/mpi/c/{get.c => get.c.in} | 20 +- .../{get_accumulate.c => get_accumulate.c.in} | 19 +- .../mpi/c/{get_address.c => get_address.c.in} | 14 +- ompi/mpi/c/{get_count.c => get_count.c.in} | 14 +- .../c/{get_elements.c => get_elements.c.in} | 14 +- .../{get_elements_x.c => get_elements_x.c.in} | 13 +- ...ary_version.c => get_library_version.c.in} | 14 +- ...ocessor_name.c => get_processor_name.c.in} | 14 +- .../mpi/c/{get_version.c => get_version.c.in} | 15 +- .../c/{graph_create.c => graph_create.c.in} | 16 +- ompi/mpi/c/{graph_get.c => graph_get.c.in} | 16 +- ompi/mpi/c/{graph_map.c => graph_map.c.in} | 16 +- ...graph_neighbors.c => graph_neighbors.c.in} | 16 +- ...ors_count.c => graph_neighbors_count.c.in} | 14 +- .../c/{graphdims_get.c => graphdims_get.c.in} | 14 +- ...uest_complete.c => grequest_complete.c.in} | 14 +- .../{grequest_start.c => grequest_start.c.in} | 20 +- ompi/mpi/c/{group_c2f.c => group_c2f.c.in} | 14 +- .../c/{group_compare.c => group_compare.c.in} | 15 +- ...oup_difference.c => group_difference.c.in} | 17 +- ompi/mpi/c/{group_excl.c => group_excl.c.in} | 16 +- ompi/mpi/c/{group_f2c.c => group_f2c.c.in} | 15 +- ompi/mpi/c/{group_free.c => group_free.c.in} | 14 +- ...on_pset.c => group_from_session_pset.c.in} | 14 +- ompi/mpi/c/{group_incl.c => group_incl.c.in} | 14 +- ...intersection.c => group_intersection.c.in} | 16 +- ...oup_range_excl.c => group_range_excl.c.in} | 16 +- ...oup_range_incl.c => group_range_incl.c.in} | 16 +- ompi/mpi/c/{group_rank.c => group_rank.c.in} | 14 +- ompi/mpi/c/{group_size.c => group_size.c.in} | 14 +- ...ate_ranks.c => group_translate_ranks.c.in} | 16 +- .../mpi/c/{group_union.c => group_union.c.in} | 14 +- ompi/mpi/c/{iallgather.c => iallgather.c.in} | 19 +- .../mpi/c/{iallgatherv.c => iallgatherv.c.in} | 18 +- ompi/mpi/c/{iallreduce.c => iallreduce.c.in} | 16 +- ompi/mpi/c/{ialltoall.c => ialltoall.c.in} | 18 +- ompi/mpi/c/{ialltoallv.c => ialltoallv.c.in} | 20 +- ompi/mpi/c/{ialltoallw.c => ialltoallw.c.in} | 20 +- ompi/mpi/c/{ibarrier.c => ibarrier.c.in} | 14 +- ompi/mpi/c/{ibcast.c => ibcast.c.in} | 16 +- ompi/mpi/c/{ibsend.c => ibsend.c.in} | 16 +- ompi/mpi/c/{iexscan.c => iexscan.c.in} | 16 +- ompi/mpi/c/{igather.c => igather.c.in} | 19 +- ompi/mpi/c/{igatherv.c => igatherv.c.in} | 18 +- ompi/mpi/c/{improbe.c => improbe.c.in} | 16 +- ompi/mpi/c/{imrecv.c => imrecv.c.in} | 16 +- ...r_allgather.c => ineighbor_allgather.c.in} | 18 +- ...allgatherv.c => ineighbor_allgatherv.c.in} | 18 +- ...bor_alltoall.c => ineighbor_alltoall.c.in} | 18 +- ...r_alltoallv.c => ineighbor_alltoallv.c.in} | 20 +- ...r_alltoallw.c => ineighbor_alltoallw.c.in} | 22 +- ompi/mpi/c/{info_c2f.c => info_c2f.c.in} | 14 +- .../mpi/c/{info_create.c => info_create.c.in} | 13 +- ...info_create_env.c => info_create_env.c.in} | 13 +- .../mpi/c/{info_delete.c => info_delete.c.in} | 15 +- ompi/mpi/c/{info_dup.c => info_dup.c.in} | 15 +- ompi/mpi/c/{info_f2c.c => info_f2c.c.in} | 14 +- ompi/mpi/c/{info_free.c => info_free.c.in} | 14 +- ompi/mpi/c/{info_get.c => info_get.c.in} | 15 +- .../{info_get_nkeys.c => info_get_nkeys.c.in} | 13 +- ...info_get_nthkey.c => info_get_nthkey.c.in} | 14 +- ...info_get_string.c => info_get_string.c.in} | 14 +- ..._get_valuelen.c => info_get_valuelen.c.in} | 16 +- ompi/mpi/c/{info_set.c => info_set.c.in} | 14 +- ompi/mpi/c/{init.c => init.c.in} | 14 +- .../mpi/c/{init_thread.c => init_thread.c.in} | 16 +- .../mpi/c/{initialized.c => initialized.c.in} | 14 +- ...tercomm_create.c => intercomm_create.c.in} | 18 +- ...ps.c => intercomm_create_from_groups.c.in} | 16 +- ...intercomm_merge.c => intercomm_merge.c.in} | 16 +- ompi/mpi/c/{iprobe.c => iprobe.c.in} | 14 +- ompi/mpi/c/{irecv.c => irecv.c.in} | 16 +- ompi/mpi/c/{ireduce.c => ireduce.c.in} | 16 +- ...ireduce_scatter.c => ireduce_scatter.c.in} | 16 +- ...ter_block.c => ireduce_scatter_block.c.in} | 19 +- ompi/mpi/c/{irsend.c => irsend.c.in} | 16 +- .../{is_thread_main.c => is_thread_main.c.in} | 14 +- ompi/mpi/c/{iscan.c => iscan.c.in} | 16 +- ompi/mpi/c/{iscatter.c => iscatter.c.in} | 18 +- ompi/mpi/c/{iscatterv.c => iscatterv.c.in} | 18 +- ompi/mpi/c/{isend.c => isend.c.in} | 16 +- ompi/mpi/c/{isendrecv.c => isendrecv.c.in} | 19 +- ...drecv_replace.c => isendrecv_replace.c.in} | 19 +- ompi/mpi/c/{issend.c => issend.c.in} | 16 +- .../c/{keyval_create.c => keyval_create.c.in} | 18 +- .../mpi/c/{keyval_free.c => keyval_free.c.in} | 14 +- .../mpi/c/{lookup_name.c => lookup_name.c.in} | 12 +- .../mpi/c/{message_c2f.c => message_c2f.c.in} | 14 +- .../mpi/c/{message_f2c.c => message_f2c.c.in} | 14 +- ompi/mpi/c/{mprobe.c => mprobe.c.in} | 15 +- ompi/mpi/c/{mrecv.c => mrecv.c.in} | 16 +- ...or_allgather.c => neighbor_allgather.c.in} | 18 +- ...er_init.c => neighbor_allgather_init.c.in} | 18 +- ..._allgatherv.c => neighbor_allgatherv.c.in} | 18 +- ...v_init.c => neighbor_allgatherv_init.c.in} | 20 +- ...hbor_alltoall.c => neighbor_alltoall.c.in} | 18 +- ...all_init.c => neighbor_alltoall_init.c.in} | 18 +- ...or_alltoallv.c => neighbor_alltoallv.c.in} | 20 +- ...lv_init.c => neighbor_alltoallv_init.c.in} | 20 +- ...or_alltoallw.c => neighbor_alltoallw.c.in} | 23 +- ompi/mpi/c/neighbor_alltoallw_init.c.in | 152 ++ ompi/mpi/c/{op_c2f.c => op_c2f.c.in} | 14 +- .../{op_commutative.c => op_commutative.c.in} | 14 +- ompi/mpi/c/{op_create.c => op_create.c.in} | 19 +- ompi/mpi/c/{op_f2c.c => op_f2c.c.in} | 14 +- ompi/mpi/c/{op_free.c => op_free.c.in} | 14 +- ompi/mpi/c/{open_port.c => open_port.c.in} | 14 +- ompi/mpi/c/{pack.c => pack.c.in} | 16 +- .../c/{pack_external.c => pack_external.c.in} | 20 +- ...xternal_size.c => pack_external_size.c.in} | 20 +- ompi/mpi/c/{pack_size.c => pack_size.c.in} | 15 +- ompi/mpi/c/{parrived.c => parrived.c.in} | 14 +- ompi/mpi/c/{pready.c => pready.c.in} | 14 +- .../mpi/c/{pready_list.c => pready_list.c.in} | 14 +- .../c/{pready_range.c => pready_range.c.in} | 14 +- ompi/mpi/c/{precv_init.c => precv_init.c.in} | 16 +- ompi/mpi/c/{probe.c => probe.c.in} | 14 +- ompi/mpi/c/{psend_init.c => psend_init.c.in} | 16 +- .../c/{publish_name.c => publish_name.c.in} | 16 +- ompi/mpi/c/{put.c => put.c.in} | 18 +- .../c/{query_thread.c => query_thread.c.in} | 14 +- .../mpi/c/{raccumulate.c => raccumulate.c.in} | 17 +- ompi/mpi/c/{recv.c => recv.c.in} | 17 +- ompi/mpi/c/{recv_init.c => recv_init.c.in} | 16 +- ompi/mpi/c/{reduce.c => reduce.c.in} | 16 +- .../mpi/c/{reduce_init.c => reduce_init.c.in} | 18 +- .../c/{reduce_local.c => reduce_local.c.in} | 16 +- .../{reduce_scatter.c => reduce_scatter.c.in} | 16 +- ...tter_block.c => reduce_scatter_block.c.in} | 16 +- ..._init.c => reduce_scatter_block_init.c.in} | 18 +- ...catter_init.c => reduce_scatter_init.c.in} | 16 +- ...gister_datarep.c => register_datarep.c.in} | 27 +- .../mpi/c/{request_c2f.c => request_c2f.c.in} | 14 +- .../mpi/c/{request_f2c.c => request_f2c.c.in} | 14 +- .../c/{request_free.c => request_free.c.in} | 14 +- ...t_get_status.c => request_get_status.c.in} | 15 +- ompi/mpi/c/{rget.c => rget.c.in} | 20 +- ...rget_accumulate.c => rget_accumulate.c.in} | 18 +- ompi/mpi/c/{rput.c => rput.c.in} | 18 +- ompi/mpi/c/{rsend.c => rsend.c.in} | 14 +- ompi/mpi/c/{rsend_init.c => rsend_init.c.in} | 18 +- ompi/mpi/c/{scan.c => scan.c.in} | 16 +- ompi/mpi/c/{scan_init.c => scan_init.c.in} | 18 +- ompi/mpi/c/{scatter.c => scatter.c.in} | 18 +- .../c/{scatter_init.c => scatter_init.c.in} | 18 +- ompi/mpi/c/{scatterv.c => scatterv.c.in} | 18 +- .../c/{scatterv_init.c => scatterv_init.c.in} | 18 +- ompi/mpi/c/{send.c => send.c.in} | 16 +- ompi/mpi/c/{send_init.c => send_init.c.in} | 18 +- ompi/mpi/c/{sendrecv.c => sendrecv.c.in} | 20 +- ...ndrecv_replace.c => sendrecv_replace.c.in} | 19 +- .../mpi/c/{session_c2f.c => session_c2f.c.in} | 14 +- ...handler.c => session_call_errhandler.c.in} | 15 +- ...ndler.c => session_create_errhandler.c.in} | 14 +- .../mpi/c/{session_f2c.c => session_f2c.c.in} | 14 +- ...ssion_finalize.c => session_finalize.c.in} | 14 +- ...rhandler.c => session_get_errhandler.c.in} | 15 +- ...ssion_get_info.c => session_get_info.c.in} | 14 +- ...t_nth_pset.c => session_get_nth_pset.c.in} | 14 +- ...num_psets.c => session_get_num_psets.c.in} | 14 +- ...pset_info.c => session_get_pset_info.c.in} | 14 +- .../c/{session_init.c => session_init.c.in} | 14 +- ...rhandler.c => session_set_errhandler.c.in} | 14 +- ...ssion_set_info.c => session_set_info.c.in} | 14 +- ompi/mpi/c/{ssend.c => ssend.c.in} | 14 +- ompi/mpi/c/{ssend_init.c => ssend_init.c.in} | 18 +- ompi/mpi/c/{start.c => start.c.in} | 14 +- ompi/mpi/c/{startall.c => startall.c.in} | 14 +- ompi/mpi/c/{status_c2f.c => status_c2f.c.in} | 14 +- .../c/{status_c2f08.c => status_c2f08.c.in} | 14 +- .../c/{status_f082c.c => status_f082c.c.in} | 14 +- .../c/{status_f082f.c => status_f082f.c.in} | 14 +- ompi/mpi/c/{status_f2c.c => status_f2c.c.in} | 14 +- .../c/{status_f2f08.c => status_f2f08.c.in} | 14 +- ...atus_get_error.c => status_get_error.c.in} | 14 +- ...us_get_source.c => status_get_source.c.in} | 14 +- .../{status_get_tag.c => status_get_tag.c.in} | 14 +- ..._cancelled.c => status_set_cancelled.c.in} | 14 +- ...et_elements.c => status_set_elements.c.in} | 14 +- ...lements_x.c => status_set_elements_x.c.in} | 14 +- ...atus_set_error.c => status_set_error.c.in} | 14 +- ...us_set_source.c => status_set_source.c.in} | 14 +- .../{status_set_tag.c => status_set_tag.c.in} | 15 +- ompi/mpi/c/{test.c => test.c.in} | 14 +- .../{test_cancelled.c => test_cancelled.c.in} | 14 +- ompi/mpi/c/{testall.c => testall.c.in} | 16 +- ompi/mpi/c/{testany.c => testany.c.in} | 14 +- ompi/mpi/c/{testsome.c => testsome.c.in} | 18 +- ompi/mpi/c/{topo_test.c => topo_test.c.in} | 14 +- ompi/mpi/c/{type_c2f.c => type_c2f.c.in} | 15 +- .../mpi/c/{type_commit.c => type_commit.c.in} | 14 +- ...type_contiguous.c => type_contiguous.c.in} | 32 +- ...reate_darray.c => type_create_darray.c.in} | 61 +- ...complex.c => type_create_f90_complex.c.in} | 14 +- ...integer.c => type_create_f90_integer.c.in} | 16 +- ...e_f90_real.c => type_create_f90_real.c.in} | 14 +- ...e_hindexed.c => type_create_hindexed.c.in} | 60 +- ...lock.c => type_create_hindexed_block.c.in} | 53 +- ...ate_hvector.c => type_create_hvector.c.in} | 33 +- ...block.c => type_create_indexed_block.c.in} | 43 +- ...reate_keyval.c => type_create_keyval.c.in} | 20 +- ...ate_resized.c => type_create_resized.c.in} | 20 +- ...reate_struct.c => type_create_struct.c.in} | 59 +- ...e_subarray.c => type_create_subarray.c.in} | 81 +- ...pe_delete_attr.c => type_delete_attr.c.in} | 14 +- ompi/mpi/c/{type_dup.c => type_dup.c.in} | 15 +- ompi/mpi/c/{type_f2c.c => type_f2c.c.in} | 14 +- ompi/mpi/c/{type_free.c => type_free.c.in} | 14 +- ...pe_free_keyval.c => type_free_keyval.c.in} | 14 +- .../c/{type_get_attr.c => type_get_attr.c.in} | 20 +- ompi/mpi/c/type_get_contents_c.c | 95 ++ ompi/mpi/c/type_get_envelope.c.in | 59 + ompi/mpi/c/type_get_envelope_c.c | 69 + ...type_get_extent.c => type_get_extent.c.in} | 19 +- ..._get_extent_x.c => type_get_extent_x.c.in} | 13 +- .../c/{type_get_name.c => type_get_name.c.in} | 14 +- ...rue_extent.c => type_get_true_extent.c.in} | 19 +- ...extent_x.c => type_get_true_extent_x.c.in} | 17 +- .../c/{type_indexed.c => type_indexed.c.in} | 60 +- ...type_match_size.c => type_match_size.c.in} | 14 +- .../c/{type_set_attr.c => type_set_attr.c.in} | 17 +- .../c/{type_set_name.c => type_set_name.c.in} | 14 +- ompi/mpi/c/{type_size.c => type_size.c.in} | 13 +- .../mpi/c/{type_size_x.c => type_size_x.c.in} | 13 +- .../mpi/c/{type_vector.c => type_vector.c.in} | 32 +- ompi/mpi/c/{unpack.c => unpack.c.in} | 21 +- ...unpack_external.c => unpack_external.c.in} | 21 +- .../{unpublish_name.c => unpublish_name.c.in} | 16 +- ompi/mpi/c/{wait.c => wait.c.in} | 16 +- ompi/mpi/c/{waitall.c => waitall.c.in} | 18 +- ompi/mpi/c/{waitany.c => waitany.c.in} | 16 +- ompi/mpi/c/{waitsome.c => waitsome.c.in} | 20 +- .../c/{win_allocate.c => win_allocate.c.in} | 32 +- ...cate_shared.c => win_allocate_shared.c.in} | 31 +- ompi/mpi/c/{win_attach.c => win_attach.c.in} | 13 +- ompi/mpi/c/{win_c2f.c => win_c2f.c.in} | 15 +- ..._errhandler.c => win_call_errhandler.c.in} | 14 +- .../c/{win_complete.c => win_complete.c.in} | 14 +- ompi/mpi/c/{win_create.c => win_create.c.in} | 31 +- ...eate_dynamic.c => win_create_dynamic.c.in} | 15 +- ...rrhandler.c => win_create_errhandler.c.in} | 16 +- ...create_keyval.c => win_create_keyval.c.in} | 18 +- ...win_delete_attr.c => win_delete_attr.c.in} | 14 +- ompi/mpi/c/{win_detach.c => win_detach.c.in} | 13 +- ompi/mpi/c/win_f2c.c | 1 - ompi/mpi/c/{win_fence.c => win_fence.c.in} | 14 +- ompi/mpi/c/{win_flush.c => win_flush.c.in} | 13 +- .../c/{win_flush_all.c => win_flush_all.c.in} | 13 +- ...win_flush_local.c => win_flush_local.c.in} | 13 +- ...h_local_all.c => win_flush_local_all.c.in} | 13 +- ompi/mpi/c/{win_free.c => win_free.c.in} | 14 +- ...win_free_keyval.c => win_free_keyval.c.in} | 14 +- .../c/{win_get_attr.c => win_get_attr.c.in} | 16 +- ...t_errhandler.c => win_get_errhandler.c.in} | 14 +- .../c/{win_get_group.c => win_get_group.c.in} | 14 +- .../c/{win_get_info.c => win_get_info.c.in} | 13 +- .../c/{win_get_name.c => win_get_name.c.in} | 14 +- ompi/mpi/c/{win_lock.c => win_lock.c.in} | 14 +- .../c/{win_lock_all.c => win_lock_all.c.in} | 14 +- ompi/mpi/c/{win_post.c => win_post.c.in} | 14 +- .../c/{win_set_attr.c => win_set_attr.c.in} | 14 +- ...t_errhandler.c => win_set_errhandler.c.in} | 14 +- .../c/{win_set_info.c => win_set_info.c.in} | 14 +- .../c/{win_set_name.c => win_set_name.c.in} | 14 +- ...n_shared_query.c => win_shared_query.c.in} | 14 +- ompi/mpi/c/{win_start.c => win_start.c.in} | 14 +- ompi/mpi/c/{win_sync.c => win_sync.c.in} | 13 +- ompi/mpi/c/{win_test.c => win_test.c.in} | 14 +- ompi/mpi/c/{win_unlock.c => win_unlock.c.in} | 14 +- .../{win_unlock_all.c => win_unlock_all.c.in} | 14 +- ompi/mpi/c/{win_wait.c => win_wait.c.in} | 14 +- ompi/mpi/c/{wtime.c => wtime.c.in} | 12 +- ompi/util/count_disp_array.h | 3 +- 452 files changed, 7076 insertions(+), 5809 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} (85%) 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} (86%) 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} (90%) 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} (85%) 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} (84%) 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} (86%) 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} (78%) rename ompi/mpi/c/{errhandler_f2c.c => errhandler_f2c.c.in} (87%) rename ompi/mpi/c/{errhandler_free.c => errhandler_free.c.in} (85%) rename ompi/mpi/c/{error_class.c => error_class.c.in} (83%) rename ompi/mpi/c/{error_string.c => error_string.c.in} (85%) 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} (81%) 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} (85%) 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} (82%) 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} (85%) 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} (75%) 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%) rename ompi/mpi/c/{ineighbor_alltoallw.c => ineighbor_alltoallw.c.in} (90%) rename ompi/mpi/c/{info_c2f.c => info_c2f.c.in} (82%) rename ompi/mpi/c/{info_create.c => info_create.c.in} (85%) rename ompi/mpi/c/{info_create_env.c => info_create_env.c.in} (86%) rename ompi/mpi/c/{info_delete.c => info_delete.c.in} (89%) rename ompi/mpi/c/{info_dup.c => info_dup.c.in} (89%) rename ompi/mpi/c/{info_f2c.c => info_f2c.c.in} (88%) rename ompi/mpi/c/{info_free.c => info_free.c.in} (86%) rename ompi/mpi/c/{info_get.c => info_get.c.in} (90%) rename ompi/mpi/c/{info_get_nkeys.c => info_get_nkeys.c.in} (85%) rename ompi/mpi/c/{info_get_nthkey.c => info_get_nthkey.c.in} (89%) rename ompi/mpi/c/{info_get_string.c => info_get_string.c.in} (90%) rename ompi/mpi/c/{info_get_valuelen.c => info_get_valuelen.c.in} (87%) rename ompi/mpi/c/{info_set.c => info_set.c.in} (91%) 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} (85%) rename ompi/mpi/c/{intercomm_create_from_groups.c => intercomm_create_from_groups.c.in} (87%) rename ompi/mpi/c/{intercomm_merge.c => intercomm_merge.c.in} (93%) 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} (92%) rename ompi/mpi/c/{isendrecv_replace.c => isendrecv_replace.c.in} (94%) 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%) rename ompi/mpi/c/{neighbor_alltoallw.c => neighbor_alltoallw.c.in} (91%) 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} (86%) 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} (83%) rename ompi/mpi/c/{pack_external_size.c => pack_external_size.c.in} (81%) 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} (75%) 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} (82%) rename ompi/mpi/c/{session_call_errhandler.c => session_call_errhandler.c.in} (78%) rename ompi/mpi/c/{session_create_errhandler.c => session_create_errhandler.c.in} (70%) rename ompi/mpi/c/{session_f2c.c => session_f2c.c.in} (84%) rename ompi/mpi/c/{session_finalize.c => session_finalize.c.in} (68%) rename ompi/mpi/c/{session_get_errhandler.c => session_get_errhandler.c.in} (84%) rename ompi/mpi/c/{session_get_info.c => session_get_info.c.in} (82%) rename ompi/mpi/c/{session_get_nth_pset.c => session_get_nth_pset.c.in} (71%) rename ompi/mpi/c/{session_get_num_psets.c => session_get_num_psets.c.in} (71%) rename ompi/mpi/c/{session_get_pset_info.c => session_get_pset_info.c.in} (80%) rename ompi/mpi/c/{session_init.c => session_init.c.in} (79%) rename ompi/mpi/c/{session_set_errhandler.c => session_set_errhandler.c.in} (84%) rename ompi/mpi/c/{session_set_info.c => session_set_info.c.in} (78%) 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_get_error.c => status_get_error.c.in} (81%) rename ompi/mpi/c/{status_get_source.c => status_get_source.c.in} (81%) rename ompi/mpi/c/{status_get_tag.c => status_get_tag.c.in} (82%) rename ompi/mpi/c/{status_set_cancelled.c => status_set_cancelled.c.in} (85%) rename ompi/mpi/c/{status_set_elements.c => status_set_elements.c.in} (88%) rename ompi/mpi/c/{status_set_elements_x.c => status_set_elements_x.c.in} (88%) rename ompi/mpi/c/{status_set_error.c => status_set_error.c.in} (79%) rename ompi/mpi/c/{status_set_source.c => status_set_source.c.in} (79%) rename ompi/mpi/c/{status_set_tag.c => status_set_tag.c.in} (80%) 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} (87%) rename ompi/mpi/c/{testany.c => testany.c.in} (88%) rename ompi/mpi/c/{testsome.c => testsome.c.in} (87%) 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} (76%) rename ompi/mpi/c/{type_create_darray.c => type_create_darray.c.in} (71%) 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_hindexed.c => type_create_hindexed.c.in} (59%) rename ompi/mpi/c/{type_create_hindexed_block.c => type_create_hindexed_block.c.in} (56%) rename ompi/mpi/c/{type_create_hvector.c => type_create_hvector.c.in} (75%) rename ompi/mpi/c/{type_create_indexed_block.c => type_create_indexed_block.c.in} (68%) 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} (80%) rename ompi/mpi/c/{type_create_struct.c => type_create_struct.c.in} (62%) rename ompi/mpi/c/{type_create_subarray.c => type_create_subarray.c.in} (52%) rename ompi/mpi/c/{type_delete_attr.c => type_delete_attr.c.in} (84%) 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%) create mode 100644 ompi/mpi/c/type_get_contents_c.c create mode 100644 ompi/mpi/c/type_get_envelope.c.in create mode 100644 ompi/mpi/c/type_get_envelope_c.c rename ompi/mpi/c/{type_get_extent.c => type_get_extent.c.in} (82%) 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} (78%) 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} (59%) 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} (75%) rename ompi/mpi/c/{unpack.c => unpack.c.in} (92%) rename ompi/mpi/c/{unpack_external.c => unpack_external.c.in} (82%) rename ompi/mpi/c/{unpublish_name.c => unpublish_name.c.in} (92%) rename ompi/mpi/c/{wait.c => wait.c.in} (90%) rename ompi/mpi/c/{waitall.c => waitall.c.in} (88%) rename ompi/mpi/c/{waitany.c => waitany.c.in} (88%) rename ompi/mpi/c/{waitsome.c => waitsome.c.in} (87%) rename ompi/mpi/c/{win_allocate.c => win_allocate.c.in} (78%) rename ompi/mpi/c/{win_allocate_shared.c => win_allocate_shared.c.in} (77%) 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} (78%) 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} (81%) 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} (85%) 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} (91%) diff --git a/.gitignore b/.gitignore index 21ab8f5ddcc..62c1ea299ff 100644 --- a/.gitignore +++ b/.gitignore @@ -516,9 +516,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 @@ -528,3 +529,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 7c869ba7967..0110949f993 100644 --- a/config/ompi_config_files.m4 +++ b/config/ompi_config_files.m4 @@ -37,8 +37,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..0593a317024 100644 --- a/config/ompi_configure_options.m4 +++ b/config/ompi_configure_options.m4 @@ -253,5 +253,12 @@ else fi AM_CONDITIONAL(OMPI_OMPIO_SUPPORT, test "$ompi_want_ompio" = "1") +# 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 cf3e3329c42..eeb42064cc2 100644 --- a/config/ompi_setup_mpi_fortran.m4 +++ b/config/ompi_setup_mpi_fortran.m4 @@ -435,14 +435,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) @@ -576,8 +589,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], @@ -585,8 +596,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? @@ -616,6 +625,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 @@ -638,6 +653,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 # ------------------- @@ -778,10 +795,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) @@ -863,6 +879,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 15025e73391..dfb31852048 100644 --- a/ompi/include/mpi.h.in +++ b/ompi/include/mpi.h.in @@ -494,6 +494,8 @@ typedef struct ompi_f08_status_public_t ompi_f08_status_public_t; typedef int (MPI_Datarep_extent_function)(MPI_Datatype, MPI_Aint *, void *); typedef int (MPI_Datarep_conversion_function)(void *, MPI_Datatype, int, void *, MPI_Offset, void *); +typedef int (MPI_Datarep_conversion_function_c)(void *, MPI_Datatype, + MPI_Count, void *, MPI_Offset, void *); typedef void (MPI_Comm_errhandler_function)(MPI_Comm *, int *, ...); typedef void (MPI_Session_errhandler_function) (MPI_Session *, int *, ...); @@ -504,6 +506,7 @@ typedef void (MPI_Session_errhandler_function) (MPI_Session *, int *, ...); typedef void (ompi_file_errhandler_function)(MPI_File *, int *, ...); typedef void (MPI_Win_errhandler_function)(MPI_Win *, int *, ...); typedef void (MPI_User_function)(void *, void *, int *, MPI_Datatype *); +typedef void (MPI_User_function_c)(void *, void *, MPI_Count *, MPI_Datatype *); typedef int (MPI_Comm_copy_attr_function)(MPI_Comm, int, void *, void *, void *, int *); typedef int (MPI_Comm_delete_attr_function)(MPI_Comm, int, void *, void *); @@ -1032,6 +1035,7 @@ typedef void (*MPI_T_event_cb_function) (MPI_T_event_instance event, must be able to be present, and therefore has to be in this conditional block in mpi.h. */ #define MPI_CONVERSION_FN_NULL ((MPI_Datarep_conversion_function*) 0) +#define MPI_CONVERSION_FN_NULL_C ((MPI_Datarep_conversion_function_c*) 0) #endif OMPI_DECLSPEC int OMPI_C_MPI_TYPE_NULL_DELETE_FN( MPI_Datatype datatype, @@ -1427,82 +1431,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[], @@ -1601,10 +1670,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); @@ -1632,74 +1707,132 @@ 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); +OMPI_DECLSPEC int MPI_File_get_type_extent_c(MPI_File fh, MPI_Datatype datatype, + MPI_Count *extent); OMPI_DECLSPEC int MPI_File_set_atomicity(MPI_File fh, int flag); OMPI_DECLSPEC int MPI_File_get_atomicity(MPI_File fh, int *flag); OMPI_DECLSPEC int MPI_File_sync(MPI_File fh); @@ -1709,33 +1842,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); @@ -1779,11 +1940,15 @@ OMPI_DECLSPEC int MPI_Group_union(MPI_Group group1, MPI_Group group2, MPI_Group *newgroup); OMPI_DECLSPEC int MPI_Ibsend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPI_Ibsend_c(const void *buf, MPI_Count count, MPI_Datatype datatype, int dest, + int tag, MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int MPI_Improbe(int source, int tag, MPI_Comm comm, int *flag, MPI_Message *message, MPI_Status *status); OMPI_DECLSPEC int MPI_Imrecv(void *buf, int count, MPI_Datatype type, MPI_Message *message, MPI_Request *request); +OMPI_DECLSPEC int MPI_Imrecv_c(void *buf, MPI_Count count, MPI_Datatype type, + MPI_Message *message, MPI_Request *request); OMPI_DECLSPEC MPI_Fint MPI_Info_c2f(MPI_Info info); OMPI_DECLSPEC int MPI_Info_create(MPI_Info *info); OMPI_DECLSPEC int MPI_Info_create_env(int argc, char *argv[], MPI_Info *info); @@ -1812,19 +1977,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); @@ -1834,72 +2014,129 @@ 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); +OMPI_DECLSPEC int MPI_Op_create_c(MPI_User_function_c *function, int commute, MPI_Op *op); OMPI_DECLSPEC int MPI_Open_port(MPI_Info info, char *port_name); OMPI_DECLSPEC MPI_Op MPI_Op_f2c(MPI_Fint op); 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_Count outsize, MPI_Count *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_Count *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); OMPI_DECLSPEC int MPI_Pready_range(int partition_low, int partition_high, MPI_Request request); -OMPI_DECLSPEC int MPI_Pready_list(int length, int partition_list[], MPI_Request request); +OMPI_DECLSPEC int MPI_Pready_list(int length, const int partition_list[], MPI_Request request); OMPI_DECLSPEC 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); @@ -1912,39 +2149,76 @@ 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, MPI_Datarep_extent_function *dtype_file_extent_fn, void *extra_state); +OMPI_DECLSPEC int MPI_Register_datarep_c(const char *datarep, + MPI_Datarep_conversion_function_c *read_conversion_fn, + MPI_Datarep_conversion_function_c *write_conversion_fn, + MPI_Datarep_extent_function *dtype_file_extent_fn, + void *extra_state); OMPI_DECLSPEC MPI_Fint MPI_Request_c2f(MPI_Request request); OMPI_DECLSPEC MPI_Request MPI_Request_f2c(MPI_Fint request); OMPI_DECLSPEC int MPI_Request_free(MPI_Request *request); @@ -1953,55 +2227,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, MPI_Count 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, @@ -2020,8 +2346,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); @@ -2039,6 +2370,8 @@ OMPI_DECLSPEC int MPI_Status_set_source(MPI_Status *status, int source); OMPI_DECLSPEC int MPI_Status_set_tag(MPI_Status *status, int tag); 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, @@ -2055,11 +2388,18 @@ 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[], int order, MPI_Datatype oldtype, MPI_Datatype *newtype); +OMPI_DECLSPEC int MPI_Type_create_darray_c(int size, int rank, int ndims, + const MPI_Count gsize_array[], const int distrib_array[], + const int darg_array[], const int psize_array[], + int order, MPI_Datatype oldtype, + MPI_Datatype *newtype); OMPI_DECLSPEC int MPI_Type_create_f90_complex(int p, int r, MPI_Datatype *newtype); OMPI_DECLSPEC int MPI_Type_create_f90_integer(int r, MPI_Datatype *newtype); OMPI_DECLSPEC int MPI_Type_create_f90_real(int p, int r, MPI_Datatype *newtype); @@ -2067,13 +2407,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_Count 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_Count 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_Count 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); @@ -2081,15 +2432,28 @@ 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_Count 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_Count 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_create_resized_c(MPI_Datatype oldtype, MPI_Count lb, + MPI_Count extent, MPI_Datatype *newtype); OMPI_DECLSPEC int MPI_Type_delete_attr(MPI_Datatype type, int type_keyval); OMPI_DECLSPEC int MPI_Type_dup(MPI_Datatype type, MPI_Datatype *newtype); OMPI_DECLSPEC int MPI_Type_free(MPI_Datatype *type); @@ -2102,37 +2466,63 @@ 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[]); +OMPI_DECLSPEC int MPI_Type_get_contents_c(MPI_Datatype mtype, MPI_Count max_integers, + MPI_Count max_addresses, MPI_Count max_large_counts, + MPI_Count max_datatypes, + int array_of_integers[], + MPI_Aint array_of_addresses[], + MPI_Count array_of_large_counts[], + MPI_Datatype array_of_datatypes[]); OMPI_DECLSPEC int MPI_Type_get_envelope(MPI_Datatype type, int *num_integers, int *num_addresses, int *num_datatypes, int *combiner); +OMPI_DECLSPEC int MPI_Type_get_envelope_c(MPI_Datatype type, MPI_Count *num_integers, + MPI_Count *num_addresses, MPI_Count *num_large_counts, + MPI_Count *num_datatypes, int *combiner); OMPI_DECLSPEC int MPI_Type_get_extent(MPI_Datatype type, MPI_Aint *lb, MPI_Aint *extent); +OMPI_DECLSPEC int MPI_Type_get_extent_c(MPI_Datatype type, MPI_Count *lb, + MPI_Count *extent); OMPI_DECLSPEC int MPI_Type_get_extent_x(MPI_Datatype type, MPI_Count *lb, MPI_Count *extent); OMPI_DECLSPEC int MPI_Type_get_name(MPI_Datatype type, char *type_name, int *resultlen); OMPI_DECLSPEC int MPI_Type_get_true_extent(MPI_Datatype datatype, MPI_Aint *true_lb, MPI_Aint *true_extent); +OMPI_DECLSPEC int MPI_Type_get_true_extent_c(MPI_Datatype datatype, MPI_Count *true_lb, + MPI_Count *true_extent); OMPI_DECLSPEC int MPI_Type_get_true_extent_x(MPI_Datatype datatype, MPI_Count *true_lb, MPI_Count *true_extent); 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_Count 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_Count insize, + MPI_Count *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[], @@ -2143,14 +2533,20 @@ OMPI_DECLSPEC int MPI_Waitsome(int incount, MPI_Request array_of_requests[], MPI_Status array_of_statuses[]); OMPI_DECLSPEC int MPI_Win_allocate(MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, void *baseptr, MPI_Win *win); +OMPI_DECLSPEC int MPI_Win_allocate_c(MPI_Aint size, MPI_Aint disp_unit, MPI_Info info, + MPI_Comm comm, void *baseptr, MPI_Win *win); OMPI_DECLSPEC int MPI_Win_allocate_shared(MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, void *baseptr, MPI_Win *win); +OMPI_DECLSPEC int MPI_Win_allocate_shared_c(MPI_Aint size, MPI_Aint disp_unit, MPI_Info info, + MPI_Comm comm, void *baseptr, MPI_Win *win); OMPI_DECLSPEC int MPI_Win_attach(MPI_Win win, void *base, MPI_Aint size); OMPI_DECLSPEC MPI_Fint MPI_Win_c2f(MPI_Win win); OMPI_DECLSPEC int MPI_Win_call_errhandler(MPI_Win win, int errorcode); OMPI_DECLSPEC int MPI_Win_complete(MPI_Win win); OMPI_DECLSPEC int MPI_Win_create(void *base, MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, MPI_Win *win); +OMPI_DECLSPEC int MPI_Win_create_c(void *base, MPI_Aint size, MPI_Aint disp_unit, + MPI_Info info, MPI_Comm comm, MPI_Win *win); OMPI_DECLSPEC int MPI_Win_create_dynamic(MPI_Info info, MPI_Comm comm, MPI_Win *win); OMPI_DECLSPEC int MPI_Win_create_errhandler(MPI_Win_errhandler_function *function, MPI_Errhandler *errhandler); @@ -2181,6 +2577,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); @@ -2197,98 +2594,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[], @@ -2317,7 +2759,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); @@ -2331,6 +2773,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); @@ -2366,10 +2829,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); @@ -2397,74 +2866,132 @@ 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); +OMPI_DECLSPEC int PMPI_File_get_type_extent_c(MPI_File fh, MPI_Datatype datatype, + MPI_Count *extent); OMPI_DECLSPEC int PMPI_File_set_atomicity(MPI_File fh, int flag); OMPI_DECLSPEC int PMPI_File_get_atomicity(MPI_File fh, int *flag); OMPI_DECLSPEC int PMPI_File_sync(MPI_File fh); @@ -2474,35 +3001,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); @@ -2546,11 +3099,15 @@ OMPI_DECLSPEC int PMPI_Group_union(MPI_Group group1, MPI_Group group2, MPI_Group *newgroup); OMPI_DECLSPEC int PMPI_Ibsend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Ibsend_c(const void *buf, MPI_Count count, MPI_Datatype datatype, int dest, + int tag, MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int PMPI_Improbe(int source, int tag, MPI_Comm comm, int *flag, MPI_Message *message, MPI_Status *status); OMPI_DECLSPEC int PMPI_Imrecv(void *buf, int count, MPI_Datatype type, MPI_Message *message, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Imrecv_c(void *buf, MPI_Count count, MPI_Datatype type, + MPI_Message *message, MPI_Request *request); OMPI_DECLSPEC MPI_Fint PMPI_Info_c2f(MPI_Info info); OMPI_DECLSPEC int PMPI_Info_create(MPI_Info *info); OMPI_DECLSPEC int PMPI_Info_create_env(int argc, char *argv[], MPI_Info *info); @@ -2574,144 +3131,253 @@ 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); +OMPI_DECLSPEC int PMPI_Op_create_c(MPI_User_function_c *function, int commute, MPI_Op *op); OMPI_DECLSPEC int PMPI_Open_port(MPI_Info info, char *port_name); OMPI_DECLSPEC MPI_Op PMPI_Op_f2c(MPI_Fint op); 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_Count outsize, MPI_Count *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_Count *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, const 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, MPI_Datarep_extent_function *dtype_file_extent_fn, void *extra_state); +OMPI_DECLSPEC int PMPI_Register_datarep_c(const char *datarep, + MPI_Datarep_conversion_function_c *read_conversion_fn, + MPI_Datarep_conversion_function_c *write_conversion_fn, + MPI_Datarep_extent_function *dtype_file_extent_fn, + void *extra_state); OMPI_DECLSPEC MPI_Fint PMPI_Request_c2f(MPI_Request request); OMPI_DECLSPEC MPI_Request PMPI_Request_f2c(MPI_Fint request); OMPI_DECLSPEC int PMPI_Request_free(MPI_Request *request); @@ -2720,55 +3386,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, MPI_Count 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, @@ -2780,21 +3498,26 @@ 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_get_error(const MPI_Status *status, int *error); @@ -2806,11 +3529,14 @@ OMPI_DECLSPEC int PMPI_Status_set_source(MPI_Status *status, int source); OMPI_DECLSPEC int PMPI_Status_set_tag(MPI_Status *status, int tag); 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[], @@ -2821,41 +3547,72 @@ 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[], int order, MPI_Datatype oldtype, MPI_Datatype *newtype); +OMPI_DECLSPEC int PMPI_Type_create_darray_c(int size, int rank, int ndims, + const MPI_Count gsize_array[], const int distrib_array[], + const int darg_array[], const int psize_array[], + int order, MPI_Datatype oldtype, + MPI_Datatype *newtype); 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_Count 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_Count 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_Count 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_Count 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_Count 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_create_resized_c(MPI_Datatype oldtype, MPI_Count lb, + MPI_Count extent, MPI_Datatype *newtype); OMPI_DECLSPEC int PMPI_Type_delete_attr(MPI_Datatype type, int type_keyval); OMPI_DECLSPEC int PMPI_Type_dup(MPI_Datatype type, MPI_Datatype *newtype); OMPI_DECLSPEC int PMPI_Type_free(MPI_Datatype *type); @@ -2868,40 +3625,65 @@ 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[]); +OMPI_DECLSPEC int PMPI_Type_get_contents_c(MPI_Datatype mtype, MPI_Count max_integers, + MPI_Count max_addresses, MPI_Count max_large_counts, + MPI_Count max_datatypes, + int array_of_integers[], + MPI_Aint array_of_addresses[], + MPI_Count array_of_large_counts[], + MPI_Datatype array_of_datatypes[]); OMPI_DECLSPEC int PMPI_Type_get_envelope(MPI_Datatype type, int *num_integers, int *num_addresses, int *num_datatypes, int *combiner); +OMPI_DECLSPEC int PMPI_Type_get_envelope_c(MPI_Datatype type, MPI_Count *num_integers, + MPI_Count *num_addresses, MPI_Count *num_large_counts, + MPI_Count *num_datatypes, int *combiner); OMPI_DECLSPEC int PMPI_Type_get_extent(MPI_Datatype type, MPI_Aint *lb, MPI_Aint *extent); +OMPI_DECLSPEC int PMPI_Type_get_extent_c(MPI_Datatype type, MPI_Count *lb, + MPI_Count *extent); OMPI_DECLSPEC int PMPI_Type_get_extent_x(MPI_Datatype type, MPI_Count *lb, MPI_Count *extent); OMPI_DECLSPEC int PMPI_Type_get_name(MPI_Datatype type, char *type_name, int *resultlen); OMPI_DECLSPEC int PMPI_Type_get_true_extent(MPI_Datatype datatype, MPI_Aint *true_lb, MPI_Aint *true_extent); +OMPI_DECLSPEC int PMPI_Type_get_true_extent_c(MPI_Datatype datatype, MPI_Count *true_lb, + MPI_Count *true_extent); OMPI_DECLSPEC int PMPI_Type_get_true_extent_x(MPI_Datatype datatype, MPI_Count *true_lb, MPI_Count *true_extent); 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_Count 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_Count insize, + MPI_Count *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); @@ -2910,14 +3692,20 @@ OMPI_DECLSPEC int PMPI_Waitsome(int incount, MPI_Request array_of_requests[], MPI_Status array_of_statuses[]); OMPI_DECLSPEC int PMPI_Win_allocate(MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, void *baseptr, MPI_Win *win); +OMPI_DECLSPEC int PMPI_Win_allocate_c(MPI_Aint size, MPI_Aint disp_unit, MPI_Info info, + MPI_Comm comm, void *baseptr, MPI_Win *win); OMPI_DECLSPEC int PMPI_Win_allocate_shared(MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, void *baseptr, MPI_Win *win); +OMPI_DECLSPEC int PMPI_Win_allocate_shared_c(MPI_Aint size, MPI_Aint disp_unit, MPI_Info info, + MPI_Comm comm, void *baseptr, MPI_Win *win); OMPI_DECLSPEC int PMPI_Win_attach(MPI_Win win, void *base, MPI_Aint size); OMPI_DECLSPEC MPI_Fint PMPI_Win_c2f(MPI_Win win); OMPI_DECLSPEC int PMPI_Win_call_errhandler(MPI_Win win, int errorcode); OMPI_DECLSPEC int PMPI_Win_complete(MPI_Win win); OMPI_DECLSPEC int PMPI_Win_create(void *base, MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, MPI_Win *win); +OMPI_DECLSPEC int PMPI_Win_create_c(void *base, MPI_Aint size, MPI_Aint disp_unit, + MPI_Info info, MPI_Comm comm, MPI_Win *win); OMPI_DECLSPEC int PMPI_Win_create_dynamic(MPI_Info info, MPI_Comm comm, MPI_Win *win); OMPI_DECLSPEC int PMPI_Win_create_errhandler(MPI_Win_errhandler_function *function, MPI_Errhandler *errhandler); @@ -2948,6 +3736,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 3d22f4755dc..80ae278fde2 100644 --- a/ompi/mpi/Makefile.am +++ b/ompi/mpi/Makefile.am @@ -22,4 +22,11 @@ EXTRA_DIST += \ mpi/fortran/configure-fortran-output-bottom.h \ - mpi/help-mpi-api.txt + mpi/help-mpi-api.txt \ + 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 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..362f481d11b --- /dev/null +++ b/ompi/mpi/bindings/ompi_bindings/c.py @@ -0,0 +1,386 @@ +# 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 print_cdefs_for_bigcount(fn_name, out, enable_count=False): + if enable_count: + out.dump('#undef OMPI_BIGCOUNT_SRC') + out.dump('#define OMPI_BIGCOUNT_SRC 1') + else: + out.dump('#undef OMPI_BIGCOUNT_SRC') + out.dump('#define OMPI_BIGCOUNT_SRC 0') + +def ompi_abi(base_name, template, out): + """Generate the OMPI ABI functions.""" + template.print_header(out) + print_profiling_header(base_name, out) + print_cdefs_for_bigcount(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): + base_name_c = f'{base_name}_c' + print_profiling_header(base_name_c, out) + print_cdefs_for_bigcount(base_name_c, out, enable_count=True) + out.dump(template.prototype.signature(base_name_c, abi_type='ompi', enable_count=True)) + template.print_body(func_name=base_name_c, out=out) + + +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) + print_cdefs_for_bigcount(fn_name,enable_count) + + # 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..532dfb88e37 --- /dev/null +++ b/ompi/mpi/bindings/ompi_bindings/c_type.py @@ -0,0 +1,1237 @@ +# Copyright (c) 2024 Triad National Security, LLC. All rights +# reserved. +# +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +"""C type definitions.""" +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('AINT_COUNT_ARRAY') +class TypeAintCountArray(Type): + """Array of counts (either MPI_Aint or MPI_Count).""" + + @property + def is_count(self): + return True + + def type_text(self, enable_count=False): + return 'MPI_Count *' if enable_count else 'MPI_Aint *' + + def parameter(self, enable_count=False, **kwargs): + count_type = 'MPI_Count' if enable_count else 'MPI_Aint' + 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') +class TypeDisp(Type): + + @property + def is_count(self): + return True + + def type_text(self, enable_count=False): + return 'MPI_Aint' if enable_count else 'int' + + +@Type.add_type('DISP_ARRAY') +class TypeDispArray(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('AINT_ARRAY') +class TypeAintArray(Type): + + def type_text(self, enable_count=False): + return 'const MPI_Aint *' + + def parameter(self, enable_count=False, **kwargs): + return f'const MPI_Aint {self.name}[]' + + +@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('COUNT_OUT') +class TypeCountOut(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('AINT_COUNT') +class TypeAintCountOut(Type): + + @property + def is_count(self): + return True + + def type_text(self, enable_count=False): + return 'MPI_Count' if enable_count else 'MPI_Aint' + + +@Type.add_type('AINT_COUNT_OUT') +class TypeAintCountOut(Type): + + @property + def is_count(self): + return True + + def type_text(self, enable_count=False): + return 'MPI_Count *' if enable_count else 'MPI_Aint *' + + +@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('INT_AINT_OUT') +class TypeIntAintOut(Type): + + @property + def is_count(self): + return True + + def type_text(self, enable_count=False): + return 'MPI_Aint *' if enable_count else 'int *' + +@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): + + @property + def is_count(self): + return True + + def type_text(self, enable_count=False): + return 'MPI_User_function_c *' if enable_count else '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): + + @property + def is_count(self): + return True + + def type_text(self, enable_count=False): + return 'MPI_Datarep_conversion_function_c *' if enable_count else '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..df3ae87802d --- /dev/null +++ b/ompi/mpi/bindings/ompi_bindings/fortran.py @@ -0,0 +1,287 @@ +# 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() + print_binding(template.prototype, args.lang, bigcount=True, out=out, template=template) + + +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) + binding_c.print_interface() + 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..8dea59ae392 --- /dev/null +++ b/ompi/mpi/bindings/ompi_bindings/parser.py @@ -0,0 +1,145 @@ +# Copyright (c) 2024 Triad National Security, LLC. All rights +# reserved. +# +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +"""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..c2d38309be4 --- /dev/null +++ b/ompi/mpi/bindings/ompi_bindings/util.py @@ -0,0 +1,146 @@ +# 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' + + +BIGCOUNT_TYPE_NAMES = [ + 'COUNT', + 'COUNT_ARRAY', + 'DISP', + 'DISP_ARRAY', + 'COUNT_OUT', + 'AINT_COUNT', + 'AINT_COUNT_ARRAY', + 'AINT_COUNT_OUT', + 'INT_AINT_OUT', + 'USER_FUNCTION', + 'DATAREP_CONVERSION_FUNCTION', +] + + +def prototype_has_bigcount(prototype): + """Should this prototype have a bigcount version?""" + return any(param.type_name in BIGCOUNT_TYPE_NAMES for param in prototype.params) diff --git a/ompi/mpi/c/Makefile.am b/ompi/mpi/c/Makefile.am index 3a8e8356f38..67eed568e4f 100644 --- a/ompi/mpi/c/Makefile.am +++ b/ompi/mpi/c/Makefile.am @@ -35,6 +35,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 @@ -42,6 +44,443 @@ endif headers = bindings.h +# +# Template/prototype source files used for generating MPI functions +# + +prototype_sources = \ + abort.c.in \ + accumulate.c.in \ + add_error_class.c.in \ + add_error_code.c.in \ + add_error_string.c.in \ + allgather.c.in \ + allgather_init.c.in \ + allgatherv.c.in \ + allgatherv_init.c.in \ + alloc_mem.c.in \ + allreduce.c.in \ + allreduce_init.c.in \ + alltoall.c.in \ + alltoall_init.c.in \ + alltoallv.c.in \ + alltoallv_init.c.in \ + alltoallw.c.in \ + alltoallw_init.c.in \ + attr_delete.c.in \ + attr_get.c.in \ + attr_put.c.in \ + barrier.c.in \ + barrier_init.c.in \ + bcast.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_compare.c.in \ + comm_connect.c.in \ + comm_create.c.in \ + comm_create_errhandler.c.in \ + comm_create_group.c.in \ + comm_create_from_group.c.in \ + comm_create_keyval.c.in \ + comm_delete_attr.c.in \ + comm_disconnect.c.in \ + comm_dup.c.in \ + comm_dup_with_info.c.in \ + comm_f2c.c.in \ + comm_free.c.in \ + comm_free_keyval.c.in \ + comm_get_attr.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_idup.c.in \ + comm_idup_with_info.c.in \ + comm_join.c.in \ + comm_rank.c.in \ + comm_remote_group.c.in \ + comm_remote_size.c.in \ + comm_set_attr.c.in \ + comm_set_errhandler.c.in \ + comm_set_info.c.in \ + comm_set_name.c.in \ + comm_size.c.in \ + comm_spawn.c.in \ + comm_spawn_multiple.c.in \ + comm_split.c.in \ + comm_split_type.c.in \ + comm_test_inter.c.in \ + compare_and_swap.c.in \ + dims_create.c.in \ + dist_graph_create_adjacent.c.in \ + dist_graph_create.c.in \ + dist_graph_neighbors.c.in \ + dist_graph_neighbors_count.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 \ + exscan_init.c.in \ + fetch_and_op.c.in \ + file_c2f.c.in \ + file_call_errhandler.c.in \ + file_close.c.in \ + file_create_errhandler.c.in \ + file_delete.c.in \ + file_f2c.c.in \ + file_get_amode.c.in \ + file_get_atomicity.c.in \ + file_get_byte_offset.c.in \ + file_get_errhandler.c.in \ + file_get_group.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_get_view.c.in \ + file_iread_all.c.in \ + file_iread_at_all.c.in \ + file_iread_at.c.in \ + file_iread.c.in \ + file_iread_shared.c.in \ + file_iwrite_all.c.in \ + file_iwrite_at_all.c.in \ + file_iwrite_at.c.in \ + file_iwrite.c.in \ + file_iwrite_shared.c.in \ + file_open.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 \ + finalize.c.in \ + finalized.c.in \ + free_mem.c.in \ + gather.c.in \ + gather_init.c.in \ + gatherv.c.in \ + gatherv_init.c.in \ + get_accumulate.c.in \ + get_address.c.in \ + get.c.in \ + get_count.c.in \ + get_elements.c.in \ + get_elements_x.c.in \ + get_library_version.c.in \ + get_processor_name.c.in \ + get_version.c.in \ + graph_create.c.in \ + graphdims_get.c.in \ + graph_get.c.in \ + graph_map.c.in \ + graph_neighbors.c.in \ + graph_neighbors_count.c.in \ + grequest_complete.c.in \ + grequest_start.c.in \ + group_c2f.c.in \ + group_compare.c.in \ + group_difference.c.in \ + group_excl.c.in \ + group_f2c.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 \ + iallgather.c.in \ + iallgatherv.c.in \ + ialltoall.c.in \ + ialltoallv.c.in \ + ialltoallw.c.in \ + ibarrier.c.in \ + ibcast.c.in \ + ibsend.c.in \ + iexscan.c.in \ + igather.c.in \ + igatherv.c.in \ + improbe.c.in \ + imrecv.c.in \ + ineighbor_allgather.c.in \ + ineighbor_allgatherv.c.in \ + ineighbor_alltoall.c.in \ + ineighbor_alltoallv.c.in \ + ineighbor_alltoallw.c.in \ + info_c2f.c.in \ + info_create.c.in \ + info_create_env.c.in \ + info_delete.c.in \ + info_dup.c.in \ + info_f2c.c.in \ + info_free.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.c.in \ + initialized.c.in \ + init_thread.c.in \ + intercomm_create.c.in \ + intercomm_create_from_groups.c.in \ + intercomm_merge.c.in \ + iprobe.c.in \ + iallreduce.c.in \ + irecv.c.in \ + ireduce.c.in \ + ireduce_scatter_block.c.in \ + ireduce_scatter.c.in \ + irsend.c.in \ + iscan.c.in \ + iscatter.c.in \ + iscatterv.c.in \ + isend.c.in \ + isendrecv.c.in \ + isendrecv_replace.c.in \ + issend.c.in \ + is_thread_main.c.in \ + keyval_create.c.in \ + keyval_free.c.in \ + lookup_name.c.in \ + message_c2f.c.in \ + message_f2c.c.in \ + mprobe.c.in \ + mrecv.c.in \ + neighbor_allgather.c.in \ + neighbor_allgather_init.c.in \ + neighbor_allgatherv.c.in \ + neighbor_allgatherv_init.c.in \ + neighbor_alltoall.c.in \ + neighbor_alltoall_init.c.in \ + neighbor_alltoallv.c.in \ + neighbor_alltoallv_init.c.in\ + neighbor_alltoallw.c.in \ + neighbor_alltoallw_init.c.in \ + open_port.c.in \ + op_c2f.c.in \ + op_commutative.c.in \ + op_create.c.in \ + op_free.c.in \ + op_f2c.c.in \ + pack.c.in \ + pack_external.c.in \ + pack_external_size.c.in \ + pack_size.c.in \ + parrived.c.in \ + pready.c.in \ + pready_list.c.in \ + pready_range.c.in \ + precv_init.c.in \ + probe.c.in \ + psend_init.c.in \ + publish_name.c.in \ + put.c.in \ + query_thread.c.in \ + raccumulate.c.in \ + recv.c.in \ + recv_init.c.in \ + reduce.c.in \ + reduce_init.c.in \ + reduce_local.c.in \ + reduce_scatter_block.c.in \ + reduce_scatter_block_init.c.in \ + reduce_scatter.c.in \ + reduce_scatter_init.c.in \ + register_datarep.c.in \ + request_c2f.c.in \ + request_f2c.c.in \ + request_free.c.in \ + request_get_status.c.in \ + rget_accumulate.c.in \ + rget.c.in \ + rput.c.in \ + rsend.c.in \ + rsend_init.c.in \ + scan.c.in \ + scan_init.c.in \ + scatter.c.in \ + scatter_init.c.in \ + scatterv.c.in \ + scatterv_init.c.in \ + send.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_f2c.c.in \ + session_finalize.c.in \ + session_get_errhandler.c.in \ + session_get_info.c.in \ + session_get_nth_pset.c.in \ + session_get_num_psets.c.in \ + session_get_pset_info.c.in \ + session_init.c.in \ + session_set_errhandler.c.in \ + session_set_info.c.in \ + ssend.c.in \ + ssend_init.c.in \ + startall.c.in \ + start.c.in \ + status_c2f08.c.in \ + status_c2f.c.in \ + status_f082c.c.in \ + status_f082f.c.in \ + status_f2c.c.in \ + status_f2f08.c.in \ + status_get_error.c.in \ + status_get_source.c.in \ + status_get_tag.c.in \ + status_set_cancelled.c.in \ + status_set_elements.c.in \ + status_set_elements_x.c.in \ + status_set_error.c.in \ + status_set_source.c.in \ + status_set_tag.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_hindexed.c.in \ + type_create_hindexed_block.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_struct.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_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.c.in \ + unpack_external.c.in \ + unpublish_name.c.in \ + waitall.c.in \ + waitany.c.in \ + wait.c.in \ + waitsome.c.in \ + win_allocate.c.in \ + win_allocate_shared.c.in \ + win_attach.c.in \ + win_c2f.c.in \ + win_call_errhandler.c.in \ + win_complete.c.in \ + win_create.c.in \ + win_create_dynamic.c.in \ + win_create_errhandler.c.in \ + win_create_keyval.c.in \ + win_delete_attr.c.in \ + win_detach.c.in \ + win_fence.c.in \ + win_flush_all.c.in \ + win_flush.c.in \ + win_flush_local_all.c.in \ + win_flush_local.c.in \ + win_free.c.in \ + win_free_keyval.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_all.c.in \ + win_lock.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_start.c.in \ + win_sync.c.in \ + win_test.c.in \ + win_unlock_all.c.in \ + win_unlock.c.in \ + win_wait.c.in \ + wtime.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 = \ @@ -58,442 +497,24 @@ 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 \ - 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 \ +interface_profile_sources = $(prototype_sources:.c.in=_generated.c) + + +# The following are special case functions where we +# have to deal manually +# +interface_profile_sources += \ 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_get_error.c \ - status_get_source.c \ - status_get_tag.c \ - status_set_cancelled.c \ - status_set_elements.c \ - status_set_elements_x.c \ - status_set_error.c \ - status_set_source.c \ - status_set_tag.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 \ - type_create_hindexed.c \ - type_create_hvector.c \ - type_create_indexed_block.c \ - type_create_hindexed_block.c \ - type_create_keyval.c \ - 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_contents.c \ + type_get_contents_c.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 \ - 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 \ + type_get_envelope_c.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 + wtick.c # The following functions were removed from the MPI standard, but are # retained for ABI compliance reasons. They are listed independently @@ -516,3 +537,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 \ + $< + +endif +# Delete generated files on maintainer-clean +MAINTAINERCLEANFILES = *_generated.c 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..f8fe6381ec3 100644 --- a/ompi/mpi/c/abort.c +++ b/ompi/mpi/c/abort.c.in @@ -12,12 +12,15 @@ * Copyright (c) 2007-2008 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow * * $HEADER$ */ + #include "ompi_config.h" #include "opal/util/show_help.h" @@ -28,17 +31,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..d778f5dc822 100644 --- a/ompi/mpi/c/accumulate.c +++ b/ompi/mpi/c/accumulate.c.in @@ -15,12 +15,15 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow * * $HEADER$ */ + #include "ompi_config.h" #include #include "ompi/mpi/c/bindings.h" @@ -34,18 +37,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..624be311675 100644 --- a/ompi/mpi/c/add_error_class.c +++ b/ompi/mpi/c/add_error_class.c.in @@ -12,12 +12,15 @@ * Copyright (c) 2006 University of Houston. All rights reserved. * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow * * $HEADER$ */ + #include "ompi_config.h" #include @@ -28,17 +31,7 @@ #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..a4755ff275e 100644 --- a/ompi/mpi/c/add_error_code.c +++ b/ompi/mpi/c/add_error_code.c.in @@ -12,12 +12,15 @@ * Copyright (c) 2006 University of Houston. All rights reserved. * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow * * $HEADER$ */ + #include "ompi_config.h" #include @@ -28,17 +31,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..d5e1e0e5d74 100644 --- a/ompi/mpi/c/add_error_string.c +++ b/ompi/mpi/c/add_error_string.c.in @@ -12,6 +12,8 @@ * Copyright (c) 2006 University of Houston. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -28,17 +30,7 @@ #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..ec9e57c1079 100644 --- a/ompi/mpi/c/allgather.c +++ b/ompi/mpi/c/allgather.c.in @@ -17,6 +17,8 @@ * reserved. * Copyright (c) 2015-2018 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -35,19 +37,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, COUNT sendcount, DATATYPE sendtype, + BUFFER_OUT recvbuf, COUNT 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..54a14756231 100644 --- a/ompi/mpi/c/allgather_init.c +++ b/ompi/mpi/c/allgather_init.c.in @@ -16,6 +16,8 @@ * reserved. * Copyright (c) 2015-2019 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -35,19 +37,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, COUNT sendcount, DATATYPE sendtype, + BUFFER_OUT recvbuf, COUNT 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..e0501ce3887 100644 --- a/ompi/mpi/c/allgatherv.c +++ b/ompi/mpi/c/allgatherv.c.in @@ -17,6 +17,8 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -35,19 +37,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..090b1b9befb 100644 --- a/ompi/mpi/c/allgatherv_init.c +++ b/ompi/mpi/c/allgatherv_init.c.in @@ -16,6 +16,8 @@ * reserved. * Copyright (c) 2015-2019 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -35,20 +37,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_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..4dfd3d5bbfe 100644 --- a/ompi/mpi/c/alloc_mem.c +++ b/ompi/mpi/c/alloc_mem.c.in @@ -15,6 +15,8 @@ * and Technology (RIST). All rights reserved. * Copyright (c) 2015 Los Alamos National Security, LLC. All rights * reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -34,17 +36,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..182fa1fd02d 100644 --- a/ompi/mpi/c/allreduce.c +++ b/ompi/mpi/c/allreduce.c.in @@ -15,6 +15,8 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -34,18 +36,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..3f613c2d587 100644 --- a/ompi/mpi/c/allreduce_init.c +++ b/ompi/mpi/c/allreduce_init.c.in @@ -16,6 +16,8 @@ * and Technology (RIST). All rights reserved. * Copyright (c) 2016 IBM Corporation. All rights reserved. * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -36,19 +38,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, COUNT 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..63124937903 100644 --- a/ompi/mpi/c/alltoall.c +++ b/ompi/mpi/c/alltoall.c.in @@ -17,7 +17,8 @@ * Copyright (c) 2014-2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2015 Mellanox Technologies. All rights reserved. - * + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -36,19 +37,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 = 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, COUNT sendcount, DATATYPE sendtype, + BUFFER_OUT recvbuf, COUNT 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..becb9f77d54 100644 --- a/ompi/mpi/c/alltoall_init.c +++ b/ompi/mpi/c/alltoall_init.c.in @@ -16,6 +16,8 @@ * reserved. * Copyright (c) 2014-2019 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -35,19 +37,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, COUNT sendcount, DATATYPE sendtype, + BUFFER_OUT recvbuf, COUNT 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..dd9fabc5db1 100644 --- a/ompi/mpi/c/alltoallv.c +++ b/ompi/mpi/c/alltoallv.c.in @@ -16,6 +16,8 @@ * reserved. * Copyright (c) 2014-2018 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -34,25 +36,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 +61,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..da7a9358426 100644 --- a/ompi/mpi/c/alltoallv_init.c +++ b/ompi/mpi/c/alltoallv_init.c.in @@ -15,6 +15,8 @@ * reserved. * Copyright (c) 2014-2019 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -34,20 +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_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..75f0a131ec2 100644 --- a/ompi/mpi/c/alltoallw.c +++ b/ompi/mpi/c/alltoallw.c.in @@ -16,6 +16,8 @@ * reserved. * Copyright (c) 2014-2018 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -34,20 +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_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..bb37f852993 100644 --- a/ompi/mpi/c/alltoallw_init.c +++ b/ompi/mpi/c/alltoallw_init.c.in @@ -15,6 +15,8 @@ * reserved. * Copyright (c) 2014-2019 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -34,20 +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_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..8bc920ad4f5 100644 --- a/ompi/mpi/c/attr_delete.c +++ b/ompi/mpi/c/attr_delete.c.in @@ -12,6 +12,8 @@ * Copyright (c) 2007 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -29,17 +31,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..36b1e1f7a9b 100644 --- a/ompi/mpi/c/attr_get.c +++ b/ompi/mpi/c/attr_get.c.in @@ -11,6 +11,8 @@ * All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -28,16 +30,7 @@ #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..4b6e5cd8b5c 100644 --- a/ompi/mpi/c/attr_put.c +++ b/ompi/mpi/c/attr_put.c.in @@ -12,6 +12,8 @@ * Copyright (c) 2007 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -29,16 +31,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..1ba1c42d9e1 100644 --- a/ompi/mpi/c/barrier.c +++ b/ompi/mpi/c/barrier.c.in @@ -12,6 +12,8 @@ * Copyright (c) 2010-2012 Oak Ridge National Labs. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -28,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_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..dde5d3f669e 100644 --- a/ompi/mpi/c/barrier_init.c +++ b/ompi/mpi/c/barrier_init.c.in @@ -12,6 +12,8 @@ * Copyright (c) 2012 Oak Rigde National Laboratory. All rights reserved. * Copyright (c) 2015-2018 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -29,17 +31,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_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..bbb54d24b04 100644 --- a/ompi/mpi/c/bcast.c +++ b/ompi/mpi/c/bcast.c.in @@ -12,6 +12,8 @@ * Copyright (c) 2010-2012 Oak Ridge National Labs. All rights reserved. * Copyright (c) 2015-2018 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -29,18 +31,8 @@ #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, COUNT 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..08213a90a0a 100644 --- a/ompi/mpi/c/bcast_init.c +++ b/ompi/mpi/c/bcast_init.c.in @@ -5,6 +5,8 @@ * Copyright (c) 2017-2020 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -23,18 +25,8 @@ #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, COUNT count, DATATYPE datatype, + INT root, COMM comm, INFO info, REQUEST_INOUT request) { int err; diff --git a/ompi/mpi/c/bindings.h b/ompi/mpi/c/bindings.h index fec461654ba..2a849feea8d 100644 --- a/ompi/mpi/c/bindings.h +++ b/ompi/mpi/c/bindings.h @@ -104,6 +104,18 @@ BEGIN_C_DECLS } \ } while (0) + +/* check for integer overflow - needed while parts of Open MPI have not been embiggened */ +#define OMPI_CHECK_MPI_COUNT_INT_CONVERSION_OVERFLOW(RC, x) \ + do { \ + if ((x) > INT_MAX) { \ + (RC) = MPI_ERR_VALUE_TOO_LARGE; \ + } else { \ + (RC) = MPI_SUCCESS; \ + } \ + } while (0) + + END_C_DECLS #endif /* OMPI_C_BINDINGS_H */ 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..833f096d15f 100644 --- a/ompi/mpi/c/bsend.c +++ b/ompi/mpi/c/bsend.c.in @@ -16,6 +16,8 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -34,17 +36,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, COUNT 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..7a7bb5b0224 100644 --- a/ompi/mpi/c/bsend_init.c +++ b/ompi/mpi/c/bsend_init.c.in @@ -17,6 +17,8 @@ * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -34,18 +36,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, COUNT 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 ab28ffba31e..53d5421db8e 100644 --- a/ompi/mpi/c/buffer_attach.c +++ b/ompi/mpi/c/buffer_attach.c.in @@ -11,6 +11,8 @@ * All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -27,17 +29,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, COUNT size) { int ret = OMPI_SUCCESS; diff --git a/ompi/mpi/c/buffer_detach.c b/ompi/mpi/c/buffer_detach.c.in similarity index 85% rename from ompi/mpi/c/buffer_detach.c rename to ompi/mpi/c/buffer_detach.c.in index f50bb609f63..6e15b64e3ef 100644 --- a/ompi/mpi/c/buffer_detach.c +++ b/ompi/mpi/c/buffer_detach.c.in @@ -11,6 +11,8 @@ * All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -27,17 +29,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, COUNT_OUT size) { size_t size_arg; 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..c721098b6e8 100644 --- a/ompi/mpi/c/cancel.c +++ b/ompi/mpi/c/cancel.c.in @@ -12,13 +12,14 @@ * Copyright (c) 2009 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow * * $HEADER$ */ - #include "ompi_config.h" #include @@ -30,17 +31,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..edd02f68a91 100644 --- a/ompi/mpi/c/cart_coords.c +++ b/ompi/mpi/c/cart_coords.c.in @@ -14,6 +14,8 @@ * Copyright (c) 2012-2013 Inria. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -31,16 +33,7 @@ #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..54c84f5d746 100644 --- a/ompi/mpi/c/cart_create.c +++ b/ompi/mpi/c/cart_create.c.in @@ -16,6 +16,8 @@ * Copyright (c) 2012-2013 Inria. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -32,18 +34,8 @@ #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, INT_ARRAY dims, + INT_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..d7d222def11 100644 --- a/ompi/mpi/c/cart_get.c +++ b/ompi/mpi/c/cart_get.c.in @@ -14,6 +14,8 @@ * Copyright (c) 2012-2013 Inria. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -30,17 +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_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..c5d6c12649b 100644 --- a/ompi/mpi/c/cart_map.c +++ b/ompi/mpi/c/cart_map.c.in @@ -16,6 +16,8 @@ * Copyright (c) 2012-2013 Inria. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -32,18 +34,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_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, INT_ARRAY dims, + INT_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..64f4fe72e76 100644 --- a/ompi/mpi/c/cart_rank.c +++ b/ompi/mpi/c/cart_rank.c.in @@ -16,6 +16,8 @@ * Copyright (c) 2012-2013 Inria. All rights reserved. * Copyright (c) 2014-2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -32,16 +34,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_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, INT_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..3b25ead1fee 100644 --- a/ompi/mpi/c/cart_shift.c +++ b/ompi/mpi/c/cart_shift.c.in @@ -13,6 +13,8 @@ * Copyright (c) 2012-2013 Inria. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -29,18 +31,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_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..939cace0e91 100644 --- a/ompi/mpi/c/cart_sub.c +++ b/ompi/mpi/c/cart_sub.c.in @@ -16,6 +16,8 @@ * Copyright (c) 2012-2013 Inria. All rights reserved. * Copyright (c) 2014-2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -32,17 +34,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, INT_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..cad3d1a9af0 100644 --- a/ompi/mpi/c/cartdim_get.c +++ b/ompi/mpi/c/cartdim_get.c.in @@ -13,6 +13,8 @@ * Copyright (c) 2012-2013 Inria. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -29,18 +31,7 @@ #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 86% rename from ompi/mpi/c/close_port.c rename to ompi/mpi/c/close_port.c.in index 062d2f0ae51..a351858a48e 100644 --- a/ompi/mpi/c/close_port.c +++ b/ompi/mpi/c/close_port.c.in @@ -15,6 +15,8 @@ * Copyright (c) 2015 Intel, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -30,18 +32,7 @@ #include "ompi/errhandler/errhandler.h" #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..5e04389c633 100644 --- a/ompi/mpi/c/comm_accept.c +++ b/ompi/mpi/c/comm_accept.c.in @@ -17,6 +17,8 @@ * Copyright (c) 2015 Intel, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -37,18 +39,8 @@ #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..4458e0f563b 100644 --- a/ompi/mpi/c/comm_c2f.c +++ b/ompi/mpi/c/comm_c2f.c.in @@ -12,6 +12,8 @@ * Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -28,17 +30,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..ffe26023940 100644 --- a/ompi/mpi/c/comm_call_errhandler.c +++ b/ompi/mpi/c/comm_call_errhandler.c.in @@ -11,6 +11,8 @@ * All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -26,18 +28,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..7cb247d6baf 100644 --- a/ompi/mpi/c/comm_compare.c +++ b/ompi/mpi/c/comm_compare.c.in @@ -12,6 +12,8 @@ * Copyright (c) 2007 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -27,18 +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_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 +41,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..006a7a8e042 100644 --- a/ompi/mpi/c/comm_connect.c +++ b/ompi/mpi/c/comm_connect.c.in @@ -17,6 +17,8 @@ * Copyright (c) 2015 Intel, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -37,18 +39,8 @@ #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..3b315ac1002 100644 --- a/ompi/mpi/c/comm_create.c +++ b/ompi/mpi/c/comm_create.c.in @@ -13,6 +13,8 @@ * Copyright (c) 2010-2012 Oak Ridge National Labs. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -28,18 +30,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..2d1ba927233 100644 --- a/ompi/mpi/c/comm_create_errhandler.c +++ b/ompi/mpi/c/comm_create_errhandler.c.in @@ -15,6 +15,8 @@ * and Technology (RIST). All rights reserved. * Copyright (c) 2018-2021 Triad National Security, LLC. All rights * reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -29,19 +31,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 90% rename from ompi/mpi/c/comm_create_from_group.c rename to ompi/mpi/c/comm_create_from_group.c.in index 96cf895ee07..26e4049fac5 100644 --- a/ompi/mpi/c/comm_create_from_group.c +++ b/ompi/mpi/c/comm_create_from_group.c.in @@ -33,18 +33,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_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; char *pmix_group_tag = NULL; 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..44852ef4eba 100644 --- a/ompi/mpi/c/comm_create_group.c +++ b/ompi/mpi/c/comm_create_group.c.in @@ -15,6 +15,8 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -31,17 +33,8 @@ #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..d69c245fc49 100644 --- a/ompi/mpi/c/comm_create_keyval.c +++ b/ompi/mpi/c/comm_create_keyval.c.in @@ -14,6 +14,8 @@ * and Technology (RIST). All rights reserved. * Copyright (c) 2022 Amazon.com, Inc. or its affiliates. * All Rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -29,19 +31,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..7d792cd993c 100644 --- a/ompi/mpi/c/comm_delete_attr.c +++ b/ompi/mpi/c/comm_delete_attr.c.in @@ -12,6 +12,8 @@ * Copyright (c) 2007 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -28,17 +30,7 @@ #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..17e2ef4e43e 100644 --- a/ompi/mpi/c/comm_disconnect.c +++ b/ompi/mpi/c/comm_disconnect.c.in @@ -13,6 +13,8 @@ * Copyright (c) 2015 Intel, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -27,21 +29,9 @@ #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..c595673298b 100644 --- a/ompi/mpi/c/comm_dup.c +++ b/ompi/mpi/c/comm_dup.c.in @@ -14,6 +14,8 @@ * Copyright (c) 2010-2012 Oak Ridge National Labs. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -29,16 +31,7 @@ #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..4e6e2ad7b94 100644 --- a/ompi/mpi/c/comm_dup_with_info.c +++ b/ompi/mpi/c/comm_dup_with_info.c.in @@ -17,6 +17,8 @@ * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2016-2017 IBM Corporation. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -32,16 +34,7 @@ #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..769b7906a52 100644 --- a/ompi/mpi/c/comm_f2c.c +++ b/ompi/mpi/c/comm_f2c.c.in @@ -13,6 +13,8 @@ * Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -28,17 +30,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..9540ab668fd 100644 --- a/ompi/mpi/c/comm_free.c +++ b/ompi/mpi/c/comm_free.c.in @@ -11,6 +11,8 @@ * All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -26,17 +28,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..85ddf34f124 100644 --- a/ompi/mpi/c/comm_free_keyval.c +++ b/ompi/mpi/c/comm_free_keyval.c.in @@ -11,6 +11,8 @@ * All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -26,17 +28,7 @@ #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..1accf0c2c5e 100644 --- a/ompi/mpi/c/comm_get_attr.c +++ b/ompi/mpi/c/comm_get_attr.c.in @@ -12,6 +12,8 @@ * Copyright (c) 2009 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -28,18 +30,8 @@ #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 85% rename from ompi/mpi/c/comm_get_errhandler.c rename to ompi/mpi/c/comm_get_errhandler.c.in index 288476e1e9b..170a36fa841 100644 --- a/ompi/mpi/c/comm_get_errhandler.c +++ b/ompi/mpi/c/comm_get_errhandler.c.in @@ -15,7 +15,7 @@ * and Technology (RIST). All rights reserved. * Copyright (c) 2016-2017 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2020 Triad National Security, LLC. All rights + * Copyright (c) 2020-2024 Triad National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -33,18 +33,7 @@ #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..132a27fb413 100644 --- a/ompi/mpi/c/comm_get_info.c +++ b/ompi/mpi/c/comm_get_info.c.in @@ -4,6 +4,8 @@ * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2016-2017 IBM Corporation. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -21,17 +23,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..f0714830f27 100644 --- a/ompi/mpi/c/comm_get_name.c +++ b/ompi/mpi/c/comm_get_name.c.in @@ -12,6 +12,8 @@ * Copyright (c) 2006-2018 Cisco Systems, Inc. All rights reserved * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -33,17 +35,7 @@ #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 84% rename from ompi/mpi/c/comm_get_parent.c rename to ompi/mpi/c/comm_get_parent.c.in index a6909ef2459..49e4f38177b 100644 --- a/ompi/mpi/c/comm_get_parent.c +++ b/ompi/mpi/c/comm_get_parent.c.in @@ -11,6 +11,8 @@ * All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -25,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_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..f354e3e759d 100644 --- a/ompi/mpi/c/comm_group.c +++ b/ompi/mpi/c/comm_group.c.in @@ -12,6 +12,8 @@ * Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -27,17 +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_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..e51fd1b5493 100644 --- a/ompi/mpi/c/comm_idup.c +++ b/ompi/mpi/c/comm_idup.c.in @@ -16,6 +16,8 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -31,16 +33,7 @@ #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 86% rename from ompi/mpi/c/comm_idup_with_info.c rename to ompi/mpi/c/comm_idup_with_info.c.in index 1abbd35b5a9..983a2c35d0b 100644 --- a/ompi/mpi/c/comm_idup_with_info.c +++ b/ompi/mpi/c/comm_idup_with_info.c.in @@ -17,7 +17,7 @@ * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2016-2017 IBM Corporation. All rights reserved. - * Copyright (c) 2021 Triad National Security, LLC. All rights + * Copyright (c) 2021-2024 Triad National Security, LLC. All rights * reserved. * * $COPYRIGHT$ @@ -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..28d6c545c60 100644 --- a/ompi/mpi/c/comm_join.c +++ b/ompi/mpi/c/comm_join.c.in @@ -14,6 +14,8 @@ * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2015-2018 Cisco Systems, Inc. All rights reserved + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -47,110 +49,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 +149,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..8580bc3555d 100644 --- a/ompi/mpi/c/comm_rank.c +++ b/ompi/mpi/c/comm_rank.c.in @@ -12,6 +12,8 @@ * Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -27,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_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..32cf053e040 100644 --- a/ompi/mpi/c/comm_remote_group.c +++ b/ompi/mpi/c/comm_remote_group.c.in @@ -12,6 +12,8 @@ * Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -28,18 +30,7 @@ #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..dcdc03bd924 100644 --- a/ompi/mpi/c/comm_remote_size.c +++ b/ompi/mpi/c/comm_remote_size.c.in @@ -12,6 +12,8 @@ * Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -27,18 +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_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..9baa10aeac0 100644 --- a/ompi/mpi/c/comm_set_attr.c +++ b/ompi/mpi/c/comm_set_attr.c.in @@ -12,6 +12,8 @@ * Copyright (c) 2007 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -28,17 +30,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..9cfabe8e856 100644 --- a/ompi/mpi/c/comm_set_errhandler.c +++ b/ompi/mpi/c/comm_set_errhandler.c.in @@ -14,6 +14,8 @@ * and Technology (RIST). All rights reserved. * Copyright (c) 2016-2017 Los Alamos National Security, LLC. All rights * reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -29,17 +31,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..30cd717eaf9 100644 --- a/ompi/mpi/c/comm_set_info.c +++ b/ompi/mpi/c/comm_set_info.c.in @@ -4,6 +4,8 @@ * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2016-2017 IBM Corporation. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -21,17 +23,7 @@ #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..46dbd725bad 100644 --- a/ompi/mpi/c/comm_set_name.c +++ b/ompi/mpi/c/comm_set_name.c.in @@ -15,6 +15,8 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -33,17 +35,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..544a2f56256 100644 --- a/ompi/mpi/c/comm_size.c +++ b/ompi/mpi/c/comm_size.c.in @@ -12,6 +12,8 @@ * Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -29,17 +31,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..548fb113d02 100644 --- a/ompi/mpi/c/comm_spawn.c +++ b/ompi/mpi/c/comm_spawn.c.in @@ -18,6 +18,8 @@ * Copyright (c) 2015 Intel, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -39,19 +41,9 @@ #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..a729df6dfd0 100644 --- a/ompi/mpi/c/comm_spawn_multiple.c +++ b/ompi/mpi/c/comm_spawn_multiple.c.in @@ -18,6 +18,8 @@ * Copyright (c) 2015 Intel, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -39,20 +41,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_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..6d361ce539f 100644 --- a/ompi/mpi/c/comm_split.c +++ b/ompi/mpi/c/comm_split.c.in @@ -13,6 +13,8 @@ * Copyright (c) 2010-2012 Oak Ridge National Labs. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -28,18 +30,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..26f2b39cea9 100644 --- a/ompi/mpi/c/comm_split_type.c +++ b/ompi/mpi/c/comm_split_type.c.in @@ -15,6 +15,8 @@ * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2017-2022 IBM Corporation. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -32,19 +34,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..51aa348b0f5 100644 --- a/ompi/mpi/c/comm_test_inter.c +++ b/ompi/mpi/c/comm_test_inter.c.in @@ -12,6 +12,8 @@ * Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -27,17 +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_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 +39,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..5dc5e94e524 100644 --- a/ompi/mpi/c/compare_and_swap.c +++ b/ompi/mpi/c/compare_and_swap.c.in @@ -16,12 +16,15 @@ * and Technology (RIST). All rights reserved. * Copyright (c) 2015 Los Alamos National Security, LLC. All rights * reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow * * $HEADER$ */ + #include "ompi_config.h" #include @@ -33,18 +36,8 @@ #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..a669173e085 100644 --- a/ompi/mpi/c/dims_create.c +++ b/ompi/mpi/c/dims_create.c.in @@ -15,6 +15,8 @@ * Copyright (c) 2015 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015-2016 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -31,113 +33,10 @@ #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 +51,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 +111,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 +148,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..693ffb8ac8d 100644 --- a/ompi/mpi/c/dist_graph_create.c +++ b/ompi/mpi/c/dist_graph_create.c.in @@ -9,6 +9,8 @@ * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -25,18 +27,9 @@ #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..3423f7dd607 100644 --- a/ompi/mpi/c/dist_graph_create_adjacent.c +++ b/ompi/mpi/c/dist_graph_create_adjacent.c.in @@ -13,6 +13,8 @@ * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -31,22 +33,12 @@ #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..29c9427e5b1 100644 --- a/ompi/mpi/c/dist_graph_neighbors.c +++ b/ompi/mpi/c/dist_graph_neighbors.c.in @@ -9,6 +9,8 @@ * Copyright (c) 2012-2013 Inria. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -25,20 +27,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_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..51e3843a337 100644 --- a/ompi/mpi/c/dist_graph_neighbors_count.c +++ b/ompi/mpi/c/dist_graph_neighbors_count.c.in @@ -9,6 +9,8 @@ * Copyright (c) 2012-2013 Inria. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -27,18 +29,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 78% rename from ompi/mpi/c/errhandler_c2f.c rename to ompi/mpi/c/errhandler_c2f.c.in index 7abd3116f81..b563a49c333 100644 --- a/ompi/mpi/c/errhandler_c2f.c +++ b/ompi/mpi/c/errhandler_c2f.c.in @@ -12,7 +12,7 @@ * Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. - * Copyright (c) 2022 Triad National Security, LLC. All rights + * Copyright (c) 2022-2024 Triad National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -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 87% rename from ompi/mpi/c/errhandler_f2c.c rename to ompi/mpi/c/errhandler_f2c.c.in index 8ec5dd2527e..464ad3cf337 100644 --- a/ompi/mpi/c/errhandler_f2c.c +++ b/ompi/mpi/c/errhandler_f2c.c.in @@ -13,7 +13,7 @@ * Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. - * Copyright (c) 2020-2021 Triad National Security, LLC. + * Copyright (c) 2020-2024 Triad National Security, LLC. * All rights reserved. * $COPYRIGHT$ * @@ -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 85% rename from ompi/mpi/c/errhandler_free.c rename to ompi/mpi/c/errhandler_free.c.in index 2e5a3c6997a..8f888f1965e 100644 --- a/ompi/mpi/c/errhandler_free.c +++ b/ompi/mpi/c/errhandler_free.c.in @@ -11,7 +11,7 @@ * All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. - * Copyright (c) 2022 Triad National Security, LLC. All rights + * Copyright (c) 2022-2024 Triad National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -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_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 83% rename from ompi/mpi/c/error_class.c rename to ompi/mpi/c/error_class.c.in index a1e3c87144a..28a3116126b 100644 --- a/ompi/mpi/c/error_class.c +++ b/ompi/mpi/c/error_class.c.in @@ -11,7 +11,7 @@ * All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. - * Copyright (c) 2022 Triad National Security, LLC. All rights + * Copyright (c) 2022-2024 Triad National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -28,17 +28,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_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 85% rename from ompi/mpi/c/error_string.c rename to ompi/mpi/c/error_string.c.in index f3a12b6ce91..0b3bf36edbe 100644 --- a/ompi/mpi/c/error_string.c +++ b/ompi/mpi/c/error_string.c.in @@ -13,7 +13,7 @@ * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2018 Cisco Systems, Inc. All rights reserved - * Copyright (c) 2022 Triad National Security, LLC. All rights + * Copyright (c) 2022-2024 Triad National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -32,17 +32,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_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..0268810658c 100644 --- a/ompi/mpi/c/exscan.c +++ b/ompi/mpi/c/exscan.c.in @@ -15,6 +15,8 @@ * reserved. * Copyright (c) 2015-2018 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -33,18 +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_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, COUNT 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..7f155d78fe0 100644 --- a/ompi/mpi/c/exscan_init.c +++ b/ompi/mpi/c/exscan_init.c.in @@ -14,6 +14,8 @@ * reserved. * Copyright (c) 2015-2019 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -33,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_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, COUNT 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..5d26f2ca187 100644 --- a/ompi/mpi/c/fetch_and_op.c +++ b/ompi/mpi/c/fetch_and_op.c.in @@ -16,6 +16,8 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -33,18 +35,8 @@ #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..509c0216aac 100644 --- a/ompi/mpi/c/file_c2f.c +++ b/ompi/mpi/c/file_c2f.c.in @@ -12,6 +12,8 @@ * Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -27,17 +29,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..830e3eefc6d 100644 --- a/ompi/mpi/c/file_call_errhandler.c +++ b/ompi/mpi/c/file_call_errhandler.c.in @@ -11,6 +11,8 @@ * All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -26,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_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..4111c6a3026 100644 --- a/ompi/mpi/c/file_close.c +++ b/ompi/mpi/c/file_close.c.in @@ -11,6 +11,8 @@ * All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -25,17 +27,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_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 81% rename from ompi/mpi/c/file_create_errhandler.c rename to ompi/mpi/c/file_create_errhandler.c.in index 4041d00b658..f5040e98a12 100644 --- a/ompi/mpi/c/file_create_errhandler.c +++ b/ompi/mpi/c/file_create_errhandler.c.in @@ -13,7 +13,7 @@ * Copyright (c) 2008-2009 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. - * Copyright (c) 2018-2021 Triad National Security, LLC. All rights + * Copyright (c) 2018-2024 Triad National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -30,18 +30,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_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..f85442b50c4 100644 --- a/ompi/mpi/c/file_delete.c +++ b/ompi/mpi/c/file_delete.c.in @@ -15,6 +15,8 @@ * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -32,17 +34,7 @@ #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..283f1ff497d 100644 --- a/ompi/mpi/c/file_f2c.c +++ b/ompi/mpi/c/file_f2c.c.in @@ -13,6 +13,8 @@ * Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -28,17 +30,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..8fac4fbb98d 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..904e7875b18 100644 --- a/ompi/mpi/c/file_get_atomicity.c +++ b/ompi/mpi/c/file_get_atomicity.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_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..c86572ee5de 100644 --- a/ompi/mpi/c/file_get_byte_offset.c +++ b/ompi/mpi/c/file_get_byte_offset.c.in @@ -28,18 +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_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 85% rename from ompi/mpi/c/file_get_errhandler.c rename to ompi/mpi/c/file_get_errhandler.c.in index 8836ec16b62..8940b77bb3b 100644 --- a/ompi/mpi/c/file_get_errhandler.c +++ b/ompi/mpi/c/file_get_errhandler.c.in @@ -15,7 +15,7 @@ * and Technology (RIST). All rights reserved. * Copyright (c) 2016-2017 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2020 Triad National Security, LLC. All rights + * Copyright (c) 2020-2024 Triad National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -32,17 +32,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_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..cb2ef7ebdf5 100644 --- a/ompi/mpi/c/file_get_group.c +++ b/ompi/mpi/c/file_get_group.c.in @@ -11,6 +11,8 @@ * All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -26,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_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..9d158e11bc3 100644 --- a/ompi/mpi/c/file_get_info.c +++ b/ompi/mpi/c/file_get_info.c.in @@ -31,17 +31,7 @@ #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..ff36d078fab 100644 --- a/ompi/mpi/c/file_get_position.c +++ b/ompi/mpi/c/file_get_position.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_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..588d2d0bbcc 100644 --- a/ompi/mpi/c/file_get_position_shared.c +++ b/ompi/mpi/c/file_get_position_shared.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_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..5fee0729b53 100644 --- a/ompi/mpi/c/file_get_size.c +++ b/ompi/mpi/c/file_get_size.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_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 82% rename from ompi/mpi/c/file_get_type_extent.c rename to ompi/mpi/c/file_get_type_extent.c.in index 3fded0c207d..09748110e11 100644 --- a/ompi/mpi/c/file_get_type_extent.c +++ b/ompi/mpi/c/file_get_type_extent.c.in @@ -29,20 +29,11 @@ #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_COUNT_OUT extent) { int rc; + MPI_Aint tmp_extent = 0; MEMCHECKER( memchecker_datatype(datatype); @@ -68,7 +59,8 @@ int MPI_File_get_type_extent(MPI_File fh, MPI_Datatype datatype, switch (fh->f_io_version) { case MCA_IO_BASE_V_3_0_0: rc = fh->f_io_selected_module.v3_0_0. - io_module_file_get_type_extent(fh, datatype, extent); + io_module_file_get_type_extent(fh, datatype, &tmp_extent); + *extent = tmp_extent; break; default: 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..792d9204fd2 100644 --- a/ompi/mpi/c/file_iread.c +++ b/ompi/mpi/c/file_iread.c.in @@ -32,18 +32,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_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, COUNT 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..2e65290dd6d 100644 --- a/ompi/mpi/c/file_iread_all.c +++ b/ompi/mpi/c/file_iread_all.c.in @@ -34,18 +34,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_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, COUNT 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..f62d07eeab5 100644 --- a/ompi/mpi/c/file_iread_at.c +++ b/ompi/mpi/c/file_iread_at.c.in @@ -32,18 +32,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_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, + COUNT 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..6613a85e1ff 100644 --- a/ompi/mpi/c/file_iread_at_all.c +++ b/ompi/mpi/c/file_iread_at_all.c.in @@ -34,18 +34,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_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, + COUNT 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 85% rename from ompi/mpi/c/file_iread_shared.c rename to ompi/mpi/c/file_iread_shared.c.in index f789561752f..9c17a98c25a 100644 --- a/ompi/mpi/c/file_iread_shared.c +++ b/ompi/mpi/c/file_iread_shared.c.in @@ -32,18 +32,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_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, COUNT 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..dd6c3819b86 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, COUNT 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..d543bf76855 100644 --- a/ompi/mpi/c/file_iwrite_all.c +++ b/ompi/mpi/c/file_iwrite_all.c.in @@ -37,18 +37,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_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, COUNT 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..2b0d05b851c 100644 --- a/ompi/mpi/c/file_iwrite_at.c +++ b/ompi/mpi/c/file_iwrite_at.c.in @@ -35,19 +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_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, + COUNT 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..d11c109f4d4 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, + COUNT 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..4c0bb039391 100644 --- a/ompi/mpi/c/file_iwrite_shared.c +++ b/ompi/mpi/c/file_iwrite_shared.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_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, COUNT 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..a6278068471 100644 --- a/ompi/mpi/c/file_open.c +++ b/ompi/mpi/c/file_open.c.in @@ -17,6 +17,8 @@ * and Technology (RIST). All rights reserved. * Copyright (c) 2016 University of Houston. All rights reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -36,21 +38,10 @@ #include "ompi/mca/io/base/base.h" #include "ompi/memchecker.h" - 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..f188738045f 100644 --- a/ompi/mpi/c/file_preallocate.c +++ b/ompi/mpi/c/file_preallocate.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_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..5346df22d4d 100644 --- a/ompi/mpi/c/file_read.c +++ b/ompi/mpi/c/file_read.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 = 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, COUNT 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..3407258cadd 100644 --- a/ompi/mpi/c/file_read_all.c +++ b/ompi/mpi/c/file_read_all.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 = 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, COUNT 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..58552037653 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, COUNT 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..c038aa710fc 100644 --- a/ompi/mpi/c/file_read_all_end.c +++ b/ompi/mpi/c/file_read_all_end.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_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..37a2e1b86e8 100644 --- a/ompi/mpi/c/file_read_at.c +++ b/ompi/mpi/c/file_read_at.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 = 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, + COUNT 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..504fdd490b9 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, + COUNT 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..8ea532e3473 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, + COUNT 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..54584aaa78c 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,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_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..4a38fa16749 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, COUNT 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..c1f0e6dfba8 100644 --- a/ompi/mpi/c/file_read_ordered_begin.c +++ b/ompi/mpi/c/file_read_ordered_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_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, COUNT 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..4ef9e623ba7 100644 --- a/ompi/mpi/c/file_read_ordered_end.c +++ b/ompi/mpi/c/file_read_ordered_end.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_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..b473851aff0 100644 --- a/ompi/mpi/c/file_read_shared.c +++ b/ompi/mpi/c/file_read_shared.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_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, COUNT 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..697940771b1 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..e2caa35bb0f 100644 --- a/ompi/mpi/c/file_seek_shared.c +++ b/ompi/mpi/c/file_seek_shared.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_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..bb80f922813 100644 --- a/ompi/mpi/c/file_set_atomicity.c +++ b/ompi/mpi/c/file_set_atomicity.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_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..12edd9c65b2 100644 --- a/ompi/mpi/c/file_set_errhandler.c +++ b/ompi/mpi/c/file_set_errhandler.c.in @@ -15,6 +15,8 @@ * and Technology (RIST). All rights reserved. * Copyright (c) 2016-2017 Los Alamos National Security, LLC. All rights * reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -29,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_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..6d0d9eb5225 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..ebd426bcf94 100644 --- a/ompi/mpi/c/file_set_size.c +++ b/ompi/mpi/c/file_set_size.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_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..79ac5c04353 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..e8c37ca17cd 100644 --- a/ompi/mpi/c/file_sync.c +++ b/ompi/mpi/c/file_sync.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_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..0f737e7f667 100644 --- a/ompi/mpi/c/file_write.c +++ b/ompi/mpi/c/file_write.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 = 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, COUNT 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..ace251e326e 100644 --- a/ompi/mpi/c/file_write_all.c +++ b/ompi/mpi/c/file_write_all.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 = 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, COUNT 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..2ee5280b860 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, COUNT 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..31f3fa70750 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..517046900f2 100644 --- a/ompi/mpi/c/file_write_at.c +++ b/ompi/mpi/c/file_write_at.c.in @@ -33,19 +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_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, + COUNT 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..8bfe767c6fe 100644 --- a/ompi/mpi/c/file_write_at_all.c +++ b/ompi/mpi/c/file_write_at_all.c.in @@ -33,19 +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_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, + COUNT 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..90e487d816d 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, + COUNT 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..e4c372974f3 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,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_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..6b9b1a42e35 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, COUNT 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..68ce2c2fe62 100644 --- a/ompi/mpi/c/file_write_ordered_begin.c +++ b/ompi/mpi/c/file_write_ordered_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_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, COUNT 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..d2c95c5bcf5 100644 --- a/ompi/mpi/c/file_write_ordered_end.c +++ b/ompi/mpi/c/file_write_ordered_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_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..be4183cfe70 100644 --- a/ompi/mpi/c/file_write_shared.c +++ b/ompi/mpi/c/file_write_shared.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_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, COUNT 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..d260e699510 100644 --- a/ompi/mpi/c/finalize.c +++ b/ompi/mpi/c/finalize.c.in @@ -11,6 +11,8 @@ * All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -25,17 +27,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..76abbbf4eb4 100644 --- a/ompi/mpi/c/finalized.c +++ b/ompi/mpi/c/finalized.c.in @@ -13,6 +13,8 @@ * and Technology (RIST). All rights reserved. * Copyright (c) 2015-2018 Cisco Systems, Inc. All rights reserved * Copyright (c) 2015 Intel, Inc. All rights reserved + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -28,17 +30,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..fa68d9fb67f 100644 --- a/ompi/mpi/c/free_mem.c +++ b/ompi/mpi/c/free_mem.c.in @@ -12,6 +12,8 @@ * Copyright (c) 2007-2020 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -29,17 +31,7 @@ #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..0cef27ae84f 100644 --- a/ompi/mpi/c/gather.c +++ b/ompi/mpi/c/gather.c.in @@ -18,6 +18,8 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -35,19 +37,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, COUNT sendcount, DATATYPE sendtype, + BUFFER_OUT recvbuf, COUNT 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..97ae216e7eb 100644 --- a/ompi/mpi/c/gather_init.c +++ b/ompi/mpi/c/gather_init.c.in @@ -17,6 +17,8 @@ * reserved. * Copyright (c) 2015-2019 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -35,19 +37,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, COUNT sendcount, DATATYPE sendtype, + BUFFER_OUT recvbuf, COUNT 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..835243d3437 100644 --- a/ompi/mpi/c/gatherv.c +++ b/ompi/mpi/c/gatherv.c.in @@ -16,6 +16,8 @@ * reserved. * Copyright (c) 2015-2016 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -33,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_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..afb89860f24 100644 --- a/ompi/mpi/c/gatherv_init.c +++ b/ompi/mpi/c/gatherv_init.c.in @@ -15,6 +15,8 @@ * reserved. * Copyright (c) 2015-2019 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -33,20 +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_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..f8aa7674680 100644 --- a/ompi/mpi/c/get.c +++ b/ompi/mpi/c/get.c.in @@ -14,6 +14,8 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -32,20 +34,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, COUNT origin_count, + DATATYPE origin_datatype, INT target_rank, + AINT target_disp, COUNT 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..9bcc26b1b3b 100644 --- a/ompi/mpi/c/get_accumulate.c +++ b/ompi/mpi/c/get_accumulate.c.in @@ -16,6 +16,8 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -35,19 +37,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, COUNT origin_count, DATATYPE origin_datatype, + BUFFER_OUT result_addr, COUNT result_count, DATATYPE result_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/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..3aba3b67427 100644 --- a/ompi/mpi/c/get_address.c +++ b/ompi/mpi/c/get_address.c.in @@ -14,6 +14,8 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -27,17 +29,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..c2daea1543e 100644 --- a/ompi/mpi/c/get_count.c +++ b/ompi/mpi/c/get_count.c.in @@ -15,6 +15,8 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -32,17 +34,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, COUNT_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..49483f92f5d 100644 --- a/ompi/mpi/c/get_elements.c +++ b/ompi/mpi/c/get_elements.c.in @@ -14,13 +14,14 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow * * $HEADER$ */ - #include "ompi_config.h" #include #include @@ -32,16 +33,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, COUNT_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..d301f1336b2 100644 --- a/ompi/mpi/c/get_elements_x.c +++ b/ompi/mpi/c/get_elements_x.c.in @@ -14,6 +14,8 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -32,16 +34,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_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..b8e02e10a7d 100644 --- a/ompi/mpi/c/get_library_version.c +++ b/ompi/mpi/c/get_library_version.c.in @@ -13,6 +13,8 @@ * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2015 Intel, Inc. All rights reserved + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -27,17 +29,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..9902a653e8f 100644 --- a/ompi/mpi/c/get_processor_name.c +++ b/ompi/mpi/c/get_processor_name.c.in @@ -12,6 +12,8 @@ * Copyright (c) 2006-2008 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -30,17 +32,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..88abe13653c 100644 --- a/ompi/mpi/c/get_version.c +++ b/ompi/mpi/c/get_version.c.in @@ -13,12 +13,15 @@ * and Technology (RIST). All rights reserved. * Copyright (c) 2015 Intel, Inc. All rights reserved * Copyright (c) 2018 Cisco Systems, Inc. All rights reserved + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow * * $HEADER$ */ + #include "ompi_config.h" #include @@ -27,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_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..e4b1fb4f04c 100644 --- a/ompi/mpi/c/graph_create.c +++ b/ompi/mpi/c/graph_create.c.in @@ -17,6 +17,8 @@ * Copyright (c) 2012-2013 Inria. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -33,18 +35,8 @@ #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..ce61cc8a3c4 100644 --- a/ompi/mpi/c/graph_get.c +++ b/ompi/mpi/c/graph_get.c.in @@ -14,6 +14,8 @@ * Copyright (c) 2012-2013 Inria. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -30,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_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..d82a346f83b 100644 --- a/ompi/mpi/c/graph_map.c +++ b/ompi/mpi/c/graph_map.c.in @@ -16,6 +16,8 @@ * Copyright (c) 2012-2013 Inria. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -32,18 +34,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..c5596ed24b4 100644 --- a/ompi/mpi/c/graph_neighbors.c +++ b/ompi/mpi/c/graph_neighbors.c.in @@ -14,6 +14,8 @@ * Copyright (c) 2012-2013 Inria. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -30,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_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..752c1deaee0 100644 --- a/ompi/mpi/c/graph_neighbors_count.c +++ b/ompi/mpi/c/graph_neighbors_count.c.in @@ -13,6 +13,8 @@ * Copyright (c) 2012-2013 Inria. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -29,17 +31,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..f505040b5f9 100644 --- a/ompi/mpi/c/graphdims_get.c +++ b/ompi/mpi/c/graphdims_get.c.in @@ -13,6 +13,8 @@ * Copyright (c) 2012-2013 Inria. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -29,17 +31,7 @@ #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..8fcf8cf1c1b 100644 --- a/ompi/mpi/c/grequest_complete.c +++ b/ompi/mpi/c/grequest_complete.c.in @@ -12,6 +12,8 @@ * Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -28,17 +30,7 @@ #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..75acd2eb372 100644 --- a/ompi/mpi/c/grequest_start.c +++ b/ompi/mpi/c/grequest_start.c.in @@ -12,6 +12,8 @@ * Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -27,20 +29,10 @@ #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..c2251619a90 100644 --- a/ompi/mpi/c/group_c2f.c +++ b/ompi/mpi/c/group_c2f.c.in @@ -12,6 +12,8 @@ * Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -27,17 +29,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..728a091396f 100644 --- a/ompi/mpi/c/group_compare.c +++ b/ompi/mpi/c/group_compare.c.in @@ -14,6 +14,8 @@ * Copyright (c) 2012 Oak Ridge National Labs. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -30,17 +32,8 @@ #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..c3a1cca2fe0 100644 --- a/ompi/mpi/c/group_difference.c +++ b/ompi/mpi/c/group_difference.c.in @@ -13,6 +13,8 @@ * Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -28,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_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..2165594fad1 100644 --- a/ompi/mpi/c/group_excl.c +++ b/ompi/mpi/c/group_excl.c.in @@ -15,6 +15,8 @@ * Copyright (c) 2012-2013 Los Alamos Nat Security, LLC. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -30,18 +32,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..cd328493e95 100644 --- a/ompi/mpi/c/group_f2c.c +++ b/ompi/mpi/c/group_f2c.c.in @@ -13,13 +13,14 @@ * Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow * * $HEADER$ */ - #include "ompi_config.h" #include "ompi/mpi/c/bindings.h" @@ -28,17 +29,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..6fbc3ee6a36 100644 --- a/ompi/mpi/c/group_free.c +++ b/ompi/mpi/c/group_free.c.in @@ -12,6 +12,8 @@ * Copyright (c) 2006-2020 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -27,17 +29,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_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 75% rename from ompi/mpi/c/group_from_session_pset.c rename to ompi/mpi/c/group_from_session_pset.c.in index 4341a7b3a57..ec7bacc9415 100644 --- a/ompi/mpi/c/group_from_session_pset.c +++ b/ompi/mpi/c/group_from_session_pset.c.in @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* - * Copyright (c) 2018 Triad National Security, LLC. All rights + * Copyright (c) 2018-2024 Triad National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -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_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..2380238c1d7 100644 --- a/ompi/mpi/c/group_incl.c +++ b/ompi/mpi/c/group_incl.c.in @@ -16,6 +16,8 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -31,17 +33,7 @@ #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..0464ad5b570 100644 --- a/ompi/mpi/c/group_intersection.c +++ b/ompi/mpi/c/group_intersection.c.in @@ -13,6 +13,8 @@ * Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -28,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_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..483d3a75685 100644 --- a/ompi/mpi/c/group_range_excl.c +++ b/ompi/mpi/c/group_range_excl.c.in @@ -13,6 +13,8 @@ * Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -28,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_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..deee2458a53 100644 --- a/ompi/mpi/c/group_range_incl.c +++ b/ompi/mpi/c/group_range_incl.c.in @@ -13,6 +13,8 @@ * Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -28,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_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..550c18b347b 100644 --- a/ompi/mpi/c/group_rank.c +++ b/ompi/mpi/c/group_rank.c.in @@ -12,6 +12,8 @@ * Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -27,17 +29,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_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..2179e5b9f63 100644 --- a/ompi/mpi/c/group_size.c +++ b/ompi/mpi/c/group_size.c.in @@ -12,6 +12,8 @@ * Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -27,17 +29,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..b84f7212f56 100644 --- a/ompi/mpi/c/group_translate_ranks.c +++ b/ompi/mpi/c/group_translate_ranks.c.in @@ -15,6 +15,8 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -30,18 +32,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_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..af291660747 100644 --- a/ompi/mpi/c/group_union.c +++ b/ompi/mpi/c/group_union.c.in @@ -13,6 +13,8 @@ * Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -28,17 +30,7 @@ #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..6bc3d09adee 100644 --- a/ompi/mpi/c/iallgather.c +++ b/ompi/mpi/c/iallgather.c.in @@ -16,13 +16,14 @@ * reserved. * Copyright (c) 2015-2020 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow * * $HEADER$ */ - #include "ompi_config.h" #include @@ -35,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_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, COUNT sendcount, DATATYPE sendtype, + BUFFER_OUT recvbuf, COUNT 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..aa2b543a423 100644 --- a/ompi/mpi/c/iallgatherv.c +++ b/ompi/mpi/c/iallgatherv.c.in @@ -16,6 +16,8 @@ * reserved. * Copyright (c) 2015-2019 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -35,19 +37,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..60be428fa2e 100644 --- a/ompi/mpi/c/iallreduce.c +++ b/ompi/mpi/c/iallreduce.c.in @@ -15,6 +15,8 @@ * Copyright (c) 2015-2019 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2016 IBM Corporation. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -35,18 +37,8 @@ #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, COUNT 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..f6ccdb72815 100644 --- a/ompi/mpi/c/ialltoall.c +++ b/ompi/mpi/c/ialltoall.c.in @@ -16,6 +16,8 @@ * reserved. * Copyright (c) 2014-2019 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -35,19 +37,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, COUNT sendcount, DATATYPE sendtype, + BUFFER_OUT recvbuf, COUNT 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..838286975ee 100644 --- a/ompi/mpi/c/ialltoallv.c +++ b/ompi/mpi/c/ialltoallv.c.in @@ -15,6 +15,8 @@ * reserved. * Copyright (c) 2014-2019 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -34,20 +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_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..44e5f4a9e7a 100644 --- a/ompi/mpi/c/ialltoallw.c +++ b/ompi/mpi/c/ialltoallw.c.in @@ -15,6 +15,8 @@ * reserved. * Copyright (c) 2014-2020 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -34,20 +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_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..a0c23d31dec 100644 --- a/ompi/mpi/c/ibarrier.c +++ b/ompi/mpi/c/ibarrier.c.in @@ -12,6 +12,8 @@ * Copyright (c) 2012 Oak Rigde National Laboratory. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -29,17 +31,7 @@ #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..70eaea4a18f 100644 --- a/ompi/mpi/c/ibcast.c +++ b/ompi/mpi/c/ibcast.c.in @@ -5,6 +5,8 @@ * Copyright (c) 2017-2020 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -23,18 +25,8 @@ #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, COUNT 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..dbe9b9e0c29 100644 --- a/ompi/mpi/c/ibsend.c +++ b/ompi/mpi/c/ibsend.c.in @@ -16,6 +16,8 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -34,18 +36,8 @@ #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, COUNT 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..a945d98ae53 100644 --- a/ompi/mpi/c/iexscan.c +++ b/ompi/mpi/c/iexscan.c.in @@ -14,6 +14,8 @@ * reserved. * Copyright (c) 2015-2019 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -33,18 +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_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, COUNT 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..b947a324081 100644 --- a/ompi/mpi/c/igather.c +++ b/ompi/mpi/c/igather.c.in @@ -17,12 +17,15 @@ * reserved. * Copyright (c) 2015-2019 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow * * $HEADER$ */ + #include "ompi_config.h" #include @@ -35,19 +38,9 @@ #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, COUNT sendcount, DATATYPE sendtype, + BUFFER_OUT recvbuf, COUNT 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..346db74a4c9 100644 --- a/ompi/mpi/c/igatherv.c +++ b/ompi/mpi/c/igatherv.c.in @@ -15,6 +15,8 @@ * reserved. * Copyright (c) 2015-2019 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -33,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_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..a0f1c7c221f 100644 --- a/ompi/mpi/c/improbe.c +++ b/ompi/mpi/c/improbe.c.in @@ -7,6 +7,8 @@ * Copyright (c) 2020-2021 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -23,18 +25,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..ea8823790c0 100644 --- a/ompi/mpi/c/imrecv.c +++ b/ompi/mpi/c/imrecv.c.in @@ -4,6 +4,8 @@ * Copyright (c) 2012 Oak Ridge National Labs. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -20,18 +22,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, COUNT 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..b434176f31e 100644 --- a/ompi/mpi/c/ineighbor_allgather.c +++ b/ompi/mpi/c/ineighbor_allgather.c.in @@ -17,6 +17,8 @@ * Copyright (c) 2015-2019 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -38,19 +40,9 @@ #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, COUNT sendcount, DATATYPE sendtype, + BUFFER_OUT recvbuf, COUNT 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..5f1eb6086b9 100644 --- a/ompi/mpi/c/ineighbor_allgatherv.c +++ b/ompi/mpi/c/ineighbor_allgatherv.c.in @@ -17,6 +17,8 @@ * Copyright (c) 2015-2019 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -38,19 +40,9 @@ #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..c93bb5a248e 100644 --- a/ompi/mpi/c/ineighbor_alltoall.c +++ b/ompi/mpi/c/ineighbor_alltoall.c.in @@ -17,6 +17,8 @@ * Copyright (c) 2014-2019 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -38,19 +40,9 @@ #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, COUNT sendcount, DATATYPE sendtype, + BUFFER_OUT recvbuf, COUNT 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..38e7bf82abd 100644 --- a/ompi/mpi/c/ineighbor_alltoallv.c +++ b/ompi/mpi/c/ineighbor_alltoallv.c.in @@ -16,6 +16,8 @@ * Copyright (c) 2014-2019 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -37,20 +39,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_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 b/ompi/mpi/c/ineighbor_alltoallw.c.in similarity index 90% rename from ompi/mpi/c/ineighbor_alltoallw.c rename to ompi/mpi/c/ineighbor_alltoallw.c.in index 5e04be41b54..8f9d29591de 100644 --- a/ompi/mpi/c/ineighbor_alltoallw.c +++ b/ompi/mpi/c/ineighbor_alltoallw.c.in @@ -16,6 +16,8 @@ * Copyright (c) 2014-2019 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -37,20 +39,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_alltoallw = PMPI_Ineighbor_alltoallw -#endif -#define MPI_Ineighbor_alltoallw PMPI_Ineighbor_alltoallw -#endif - -static const char FUNC_NAME[] = "MPI_Ineighbor_alltoallw"; - - -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) +PROTOTYPE ERROR_CLASS ineighbor_alltoallw(BUFFER sendbuf, COUNT_ARRAY sendcounts, AINT_ARRAY sdispls, + DATATYPE_ARRAY sendtypes, BUFFER_OUT recvbuf, COUNT_ARRAY recvcounts, + AINT_ARRAY rdispls, DATATYPE_ARRAY recvtypes, COMM comm, + REQUEST_INOUT request) { int i, err; int indegree, outdegree; @@ -145,8 +137,8 @@ int MPI_Ineighbor_alltoallw(const void *sendbuf, const int sendcounts[], const M /* Invoke the coll component to perform the back-end operation */ OMPI_COUNT_ARRAY_INIT(&sendcounts_desc, sendcounts); - OMPI_COUNT_ARRAY_INIT(&recvcounts_desc, recvcounts); OMPI_DISP_ARRAY_INIT(&sdispls_desc, sdispls); + OMPI_COUNT_ARRAY_INIT(&recvcounts_desc, recvcounts); OMPI_DISP_ARRAY_INIT(&rdispls_desc, rdispls); err = comm->c_coll->coll_ineighbor_alltoallw(sendbuf, sendcounts_desc, sdispls_desc, sendtypes, recvbuf, recvcounts_desc, rdispls_desc, recvtypes, comm, request, diff --git a/ompi/mpi/c/info_c2f.c b/ompi/mpi/c/info_c2f.c.in similarity index 82% rename from ompi/mpi/c/info_c2f.c rename to ompi/mpi/c/info_c2f.c.in index 372c8abe766..827dde289ae 100644 --- a/ompi/mpi/c/info_c2f.c +++ b/ompi/mpi/c/info_c2f.c.in @@ -13,7 +13,7 @@ * Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. - * Copyright (c) 2018 Triad National Security, LLC. All rights + * Copyright (c) 2018-2024 Triad National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -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 85% rename from ompi/mpi/c/info_create.c rename to ompi/mpi/c/info_create.c.in index c6f7ee18f26..ad60e3f306d 100644 --- a/ompi/mpi/c/info_create.c +++ b/ompi/mpi/c/info_create.c.in @@ -12,7 +12,7 @@ * All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. - * Copyright (c) 2018-2021 Triad National Security, LLC. All rights + * Copyright (c) 2018-2024 Triad National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -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 = 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 +41,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 86% rename from ompi/mpi/c/info_create_env.c rename to ompi/mpi/c/info_create_env.c.in index 68f7ffca99c..9cdd7fc0120 100644 --- a/ompi/mpi/c/info_create_env.c +++ b/ompi/mpi/c/info_create_env.c.in @@ -12,7 +12,7 @@ * All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. - * Copyright (c) 2018-2021 Triad National Security, LLC. All rights + * Copyright (c) 2018-2024 Triad National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -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 89% rename from ompi/mpi/c/info_delete.c rename to ompi/mpi/c/info_delete.c.in index 3fcf5256782..1c0126803b6 100644 --- a/ompi/mpi/c/info_delete.c +++ b/ompi/mpi/c/info_delete.c.in @@ -15,7 +15,7 @@ * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2017 Cisco Systems, Inc. All rights reserved - * Copyright (c) 2018 Triad National Security, LLC. All rights + * Copyright (c) 2018-2024 Triad National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -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 89% rename from ompi/mpi/c/info_dup.c rename to ompi/mpi/c/info_dup.c.in index f678c2738b0..b18c11a36ec 100644 --- a/ompi/mpi/c/info_dup.c +++ b/ompi/mpi/c/info_dup.c.in @@ -12,7 +12,7 @@ * All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. - * Copyright (c) 2018 Triad National Security, LLC. All rights + * Copyright (c) 2018-2024 Triad National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -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 88% rename from ompi/mpi/c/info_f2c.c rename to ompi/mpi/c/info_f2c.c.in index 16f2161d5ed..44f1c9e9c0d 100644 --- a/ompi/mpi/c/info_f2c.c +++ b/ompi/mpi/c/info_f2c.c.in @@ -13,7 +13,7 @@ * Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. - * Copyright (c) 2018-2022 Triad National Security, LLC. All rights + * Copyright (c) 2018-2024 Triad National Security, LLC. All rights * reserved. * Copyright (c) 2023 Jeffrey M. Squyres. All rights reserved. * $COPYRIGHT$ @@ -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 86% rename from ompi/mpi/c/info_free.c rename to ompi/mpi/c/info_free.c.in index 9ebc5a761fb..96e45184187 100644 --- a/ompi/mpi/c/info_free.c +++ b/ompi/mpi/c/info_free.c.in @@ -12,7 +12,7 @@ * All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. - * Copyright (c) 2022 Triad National Security, LLC. All rights + * Copyright (c) 2022-2024 Triad National Security, LLC. All rights * reserved. * * $COPYRIGHT$ @@ -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 90% rename from ompi/mpi/c/info_get.c rename to ompi/mpi/c/info_get.c.in index 563c6cd1f83..4784eafcf26 100644 --- a/ompi/mpi/c/info_get.c +++ b/ompi/mpi/c/info_get.c.in @@ -15,7 +15,7 @@ * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2016-2017 IBM Corporation. All rights reserved. - * Copyright (c) 2018 Triad National Security, LLC. All rights + * Copyright (c) 2018-2024 Triad National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -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 85% rename from ompi/mpi/c/info_get_nkeys.c rename to ompi/mpi/c/info_get_nkeys.c.in index 850dadeb5ca..95e2bd9a540 100644 --- a/ompi/mpi/c/info_get_nkeys.c +++ b/ompi/mpi/c/info_get_nkeys.c.in @@ -12,7 +12,7 @@ * All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. - * Copyright (c) 2018 Triad National Security, LLC. All rights + * Copyright (c) 2018-2024 Triad National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -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 89% rename from ompi/mpi/c/info_get_nthkey.c rename to ompi/mpi/c/info_get_nthkey.c.in index 6e40ac8bab3..1795a2ac905 100644 --- a/ompi/mpi/c/info_get_nthkey.c +++ b/ompi/mpi/c/info_get_nthkey.c.in @@ -11,7 +11,7 @@ * All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. - * Copyright (c) 2022 Triad National Security, LLC. All rights + * Copyright (c) 2022-2024 Triad National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -30,16 +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 +42,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 90% rename from ompi/mpi/c/info_get_string.c rename to ompi/mpi/c/info_get_string.c.in index d62d106b6ca..a9b17c3f99c 100644 --- a/ompi/mpi/c/info_get_string.c +++ b/ompi/mpi/c/info_get_string.c.in @@ -15,7 +15,7 @@ * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2016-2017 IBM Corporation. All rights reserved. - * Copyright (c) 2021-2022 Triad National Security, LLC. All rights + * Copyright (c) 2021-2024 Triad National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -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 87% rename from ompi/mpi/c/info_get_valuelen.c rename to ompi/mpi/c/info_get_valuelen.c.in index e40d3c110f8..0195d602e28 100644 --- a/ompi/mpi/c/info_get_valuelen.c +++ b/ompi/mpi/c/info_get_valuelen.c.in @@ -14,7 +14,7 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. - * Copyright (c) 2018 Triad National Security, LLC. All rights + * Copyright (c) 2018-2024 Triad National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -33,16 +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 +51,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 91% rename from ompi/mpi/c/info_set.c rename to ompi/mpi/c/info_set.c.in index c6bc689e903..c58121ab9c9 100644 --- a/ompi/mpi/c/info_set.c +++ b/ompi/mpi/c/info_set.c.in @@ -14,7 +14,7 @@ * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2018 IBM Corporation. All rights reserved. - * Copyright (c) 2018 Triad National Security, LLC. All rights + * Copyright (c) 2018-2024 Triad National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -34,16 +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 +55,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..b9e5d513482 100644 --- a/ompi/mpi/c/init.c +++ b/ompi/mpi/c/init.c.in @@ -13,6 +13,8 @@ * Copyright (c) 2007-2008 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -31,17 +33,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..f56728ee262 100644 --- a/ompi/mpi/c/init_thread.c +++ b/ompi/mpi/c/init_thread.c.in @@ -16,6 +16,8 @@ * Copyright (c) 2015-2018 Cisco Systems, Inc. All rights reserved * Copyright (c) 2016 Los Alamos National Security, LLC. All rights * reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -34,18 +36,8 @@ #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..db347371bd2 100644 --- a/ompi/mpi/c/initialized.c +++ b/ompi/mpi/c/initialized.c.in @@ -13,6 +13,8 @@ * and Technology (RIST). All rights reserved. * Copyright (c) 2015-2018 Cisco Systems, Inc. All rights reserved * Copyright (c) 2015 Intel, Inc. All rights reserved + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -28,17 +30,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 85% rename from ompi/mpi/c/intercomm_create.c rename to ompi/mpi/c/intercomm_create.c.in index 0e8a903032a..6eb055aae98 100644 --- a/ompi/mpi/c/intercomm_create.c +++ b/ompi/mpi/c/intercomm_create.c.in @@ -17,7 +17,7 @@ * and Technology (RIST). All rights reserved. * Copyright (c) 2016 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2018 Triad National Security, LLC. All rights + * Copyright (c) 2018-2024 Triad National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -36,19 +36,9 @@ #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 87% rename from ompi/mpi/c/intercomm_create_from_groups.c rename to ompi/mpi/c/intercomm_create_from_groups.c.in index ef509b1a500..ac1b88f257c 100644 --- a/ompi/mpi/c/intercomm_create_from_groups.c +++ b/ompi/mpi/c/intercomm_create_from_groups.c.in @@ -36,19 +36,9 @@ #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, my_grp_rank, remote_grp_size; diff --git a/ompi/mpi/c/intercomm_merge.c b/ompi/mpi/c/intercomm_merge.c.in similarity index 93% rename from ompi/mpi/c/intercomm_merge.c rename to ompi/mpi/c/intercomm_merge.c.in index 4d09f159612..6e26f1e3fb6 100644 --- a/ompi/mpi/c/intercomm_merge.c +++ b/ompi/mpi/c/intercomm_merge.c.in @@ -18,7 +18,7 @@ * and Technology (RIST). All rights reserved. * Copyright (c) 2016 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2018-2021 Triad National Security, LLC. All rights + * Copyright (c) 2018-2024 Triad National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -37,18 +37,8 @@ #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..751f41ec8c3 100644 --- a/ompi/mpi/c/iprobe.c +++ b/ompi/mpi/c/iprobe.c.in @@ -11,6 +11,8 @@ * All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -29,17 +31,7 @@ #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..b2344cb5982 100644 --- a/ompi/mpi/c/irecv.c +++ b/ompi/mpi/c/irecv.c.in @@ -13,6 +13,8 @@ * Copyright (c) 2010-2012 Oak Ridge National Labs. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -30,18 +32,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..5dbdf1b102b 100644 --- a/ompi/mpi/c/ireduce.c +++ b/ompi/mpi/c/ireduce.c.in @@ -16,6 +16,8 @@ * Copyright (c) 2015-2019 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2016 IBM Corporation. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -35,18 +37,8 @@ #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, COUNT 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..7b47a7b7888 100644 --- a/ompi/mpi/c/ireduce_scatter.c +++ b/ompi/mpi/c/ireduce_scatter.c.in @@ -16,6 +16,8 @@ * Copyright (c) 2015-2019 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2016 IBM Corporation. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -35,18 +37,8 @@ #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, COUNT_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..d4d7e3e7361 100644 --- a/ompi/mpi/c/ireduce_scatter_block.c +++ b/ompi/mpi/c/ireduce_scatter_block.c.in @@ -16,12 +16,15 @@ * reserved. * Copyright (c) 2015-2019 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow * * $HEADER$ */ + #include "ompi_config.h" #include @@ -35,19 +38,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_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, COUNT 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..777d8feec29 100644 --- a/ompi/mpi/c/irsend.c +++ b/ompi/mpi/c/irsend.c.in @@ -16,6 +16,8 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -34,18 +36,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, COUNT 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..5e80109f2b4 100644 --- a/ompi/mpi/c/is_thread_main.c +++ b/ompi/mpi/c/is_thread_main.c.in @@ -11,6 +11,8 @@ * All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -27,17 +29,7 @@ #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..6d2c1d950ec 100644 --- a/ompi/mpi/c/iscan.c +++ b/ompi/mpi/c/iscan.c.in @@ -15,6 +15,8 @@ * reserved. * Copyright (c) 2015-2019 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -34,18 +36,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, COUNT 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..b5450ba9f6f 100644 --- a/ompi/mpi/c/iscatter.c +++ b/ompi/mpi/c/iscatter.c.in @@ -17,6 +17,8 @@ * reserved. * Copyright (c) 2015-2019 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -35,19 +37,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, COUNT sendcount, DATATYPE sendtype, + BUFFER_OUT recvbuf, COUNT 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..1791f64c5a2 100644 --- a/ompi/mpi/c/iscatterv.c +++ b/ompi/mpi/c/iscatterv.c.in @@ -15,6 +15,8 @@ * reserved. * Copyright (c) 2015-2019 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -33,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_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, COUNT_ARRAY sendcounts, DISP_ARRAY displs, + DATATYPE sendtype, BUFFER_OUT recvbuf, COUNT 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..1be898b1b3d 100644 --- a/ompi/mpi/c/isend.c +++ b/ompi/mpi/c/isend.c.in @@ -16,6 +16,8 @@ * reserved. * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -34,18 +36,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 92% rename from ompi/mpi/c/isendrecv.c rename to ompi/mpi/c/isendrecv.c.in index a4bcc6c7db9..39f410b6796 100644 --- a/ompi/mpi/c/isendrecv.c +++ b/ompi/mpi/c/isendrecv.c.in @@ -16,7 +16,7 @@ * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2021 Nanook Consulting. All rights reserved. - * Copyright (c) 2021 Triad National Security, LLC. All rights + * Copyright (c) 2021-2024 Triad National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -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; @@ -89,11 +81,10 @@ static int ompi_isendrecv_complete_func (ompi_comm_request_t *request) return OMPI_SUCCESS; } - -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, COUNT sendcount, DATATYPE sendtype, + INT dest, INT sendtag, BUFFER_OUT recvbuf, COUNT 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 94% rename from ompi/mpi/c/isendrecv_replace.c rename to ompi/mpi/c/isendrecv_replace.c.in index 1079f63fd88..2dad8a3078e 100644 --- a/ompi/mpi/c/isendrecv_replace.c +++ b/ompi/mpi/c/isendrecv_replace.c.in @@ -13,7 +13,7 @@ * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. - * Copyright (c) 2021 Triad National Security, LLC. All rights + * Copyright (c) 2021-2024 Triad National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -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; @@ -110,11 +101,9 @@ static int ompi_isendrecv_replace_complete_func (ompi_comm_request_t *request) return OMPI_SUCCESS; } - -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, COUNT count, DATATYPE datatype, + INT dest, INT sendtag, INT source, INT recvtag, + COMM comm, REQUEST_INOUT request) { int rc = MPI_SUCCESS; size_t max_data; 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..1a34c0a4c9c 100644 --- a/ompi/mpi/c/issend.c +++ b/ompi/mpi/c/issend.c.in @@ -15,6 +15,8 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -33,18 +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_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, COUNT 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..8a318ad4da3 100644 --- a/ompi/mpi/c/keyval_create.c +++ b/ompi/mpi/c/keyval_create.c.in @@ -14,6 +14,8 @@ * and Technology (RIST). All rights reserved. * Copyright (c) 2022 Amazon.com, Inc. or its affiliates. * All Rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -29,19 +31,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..8705ada7a10 100644 --- a/ompi/mpi/c/keyval_free.c +++ b/ompi/mpi/c/keyval_free.c.in @@ -11,6 +11,8 @@ * All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -26,17 +28,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..a49ee143e59 100644 --- a/ompi/mpi/c/lookup_name.c +++ b/ompi/mpi/c/lookup_name.c.in @@ -36,17 +36,7 @@ #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..407fc9f1ff3 100644 --- a/ompi/mpi/c/message_c2f.c +++ b/ompi/mpi/c/message_c2f.c.in @@ -13,6 +13,8 @@ * Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -29,17 +31,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..e9179e86ba0 100644 --- a/ompi/mpi/c/message_f2c.c +++ b/ompi/mpi/c/message_f2c.c.in @@ -13,6 +13,8 @@ * Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -27,17 +29,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..2f060e52b49 100644 --- a/ompi/mpi/c/mprobe.c +++ b/ompi/mpi/c/mprobe.c.in @@ -8,6 +8,8 @@ * Copyright (c) 2020-2021 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -25,17 +27,8 @@ #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..a23368eaf51 100644 --- a/ompi/mpi/c/mrecv.c +++ b/ompi/mpi/c/mrecv.c.in @@ -7,6 +7,8 @@ * Copyright (c) 2018-2021 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -24,18 +26,8 @@ #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, COUNT 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..fbfbf8ef342 100644 --- a/ompi/mpi/c/neighbor_allgather.c +++ b/ompi/mpi/c/neighbor_allgather.c.in @@ -17,6 +17,8 @@ * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -37,19 +39,9 @@ #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, COUNT sendcount, DATATYPE sendtype, + BUFFER_OUT recvbuf, COUNT 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..ed93cf30c69 100644 --- a/ompi/mpi/c/neighbor_allgather_init.c +++ b/ompi/mpi/c/neighbor_allgather_init.c.in @@ -17,6 +17,8 @@ * Copyright (c) 2015-2019 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -38,19 +40,9 @@ #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, COUNT sendcount, DATATYPE sendtype, + BUFFER_OUT recvbuf, COUNT 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..c71ffe1674d 100644 --- a/ompi/mpi/c/neighbor_allgatherv.c +++ b/ompi/mpi/c/neighbor_allgatherv.c.in @@ -17,6 +17,8 @@ * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -38,19 +40,9 @@ #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..24dc3c9a503 100644 --- a/ompi/mpi/c/neighbor_allgatherv_init.c +++ b/ompi/mpi/c/neighbor_allgatherv_init.c.in @@ -17,6 +17,8 @@ * Copyright (c) 2015-2019 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -38,20 +40,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_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..d015c2742ba 100644 --- a/ompi/mpi/c/neighbor_alltoall.c +++ b/ompi/mpi/c/neighbor_alltoall.c.in @@ -16,6 +16,8 @@ * Copyright (c) 2014-2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -36,19 +38,9 @@ #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, COUNT sendcount, DATATYPE sendtype, + BUFFER_OUT recvbuf, COUNT 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..7541a5d7824 100644 --- a/ompi/mpi/c/neighbor_alltoall_init.c +++ b/ompi/mpi/c/neighbor_alltoall_init.c.in @@ -17,6 +17,8 @@ * Copyright (c) 2014-2019 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -38,19 +40,9 @@ #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, COUNT sendcount, DATATYPE sendtype, + BUFFER_OUT recvbuf, COUNT 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..62a2051edbd 100644 --- a/ompi/mpi/c/neighbor_alltoallv.c +++ b/ompi/mpi/c/neighbor_alltoallv.c.in @@ -16,6 +16,8 @@ * Copyright (c) 2014-2019 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -36,20 +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_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..e5a7fcfb541 100644 --- a/ompi/mpi/c/neighbor_alltoallv_init.c +++ b/ompi/mpi/c/neighbor_alltoallv_init.c.in @@ -16,6 +16,8 @@ * Copyright (c) 2014-2023 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -37,20 +39,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_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 b/ompi/mpi/c/neighbor_alltoallw.c.in similarity index 91% rename from ompi/mpi/c/neighbor_alltoallw.c rename to ompi/mpi/c/neighbor_alltoallw.c.in index f6343fdb270..e44c1ed260a 100644 --- a/ompi/mpi/c/neighbor_alltoallw.c +++ b/ompi/mpi/c/neighbor_alltoallw.c.in @@ -16,6 +16,8 @@ * Copyright (c) 2014-2019 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -36,20 +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_alltoallw = PMPI_Neighbor_alltoallw -#endif -#define MPI_Neighbor_alltoallw PMPI_Neighbor_alltoallw -#endif - -static const char FUNC_NAME[] = "MPI_Neighbor_alltoallw"; - - -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) +PROTOTYPE ERROR_CLASS neighbor_alltoallw(BUFFER sendbuf, COUNT_ARRAY sendcounts, AINT_ARRAY sdispls, + DATATYPE_ARRAY sendtypes, BUFFER_OUT recvbuf, + COUNT_ARRAY recvcounts, AINT_ARRAY rdispls, + DATATYPE_ARRAY recvtypes, COMM comm) { int i, err; int indegree, outdegree; @@ -153,8 +145,8 @@ int MPI_Neighbor_alltoallw(const void *sendbuf, const int sendcounts[], const MP /* Invoke the coll component to perform the back-end operation */ OMPI_COUNT_ARRAY_INIT(&sendcounts_desc, sendcounts); - OMPI_COUNT_ARRAY_INIT(&recvcounts_desc, recvcounts); OMPI_DISP_ARRAY_INIT(&sdispls_desc, sdispls); + OMPI_COUNT_ARRAY_INIT(&recvcounts_desc, recvcounts); OMPI_DISP_ARRAY_INIT(&rdispls_desc, rdispls); err = comm->c_coll->coll_neighbor_alltoallw(sendbuf, sendcounts_desc, sdispls_desc, sendtypes, recvbuf, recvcounts_desc, rdispls_desc, recvtypes, @@ -162,3 +154,4 @@ int MPI_Neighbor_alltoallw(const void *sendbuf, const int sendcounts[], const MP 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..a51fb2f7e1c --- /dev/null +++ b/ompi/mpi/c/neighbor_alltoallw_init.c.in @@ -0,0 +1,152 @@ +/* -*- 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 (c) 2024 Triad National Security, LLC. 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, COUNT_ARRAY sendcounts, AINT_ARRAY sdispls, + DATATYPE_ARRAY sendtypes, BUFFER_OUT recvbuf, COUNT_ARRAY recvcounts, + AINT_ARRAY rdispls, DATATYPE_ARRAY recvtypes, COMM comm, + INFO info, REQUEST_INOUT request) +{ + int i, err; + int indegree, outdegree; + ompi_count_array_t sendcounts_desc, recvcounts_desc; + ompi_disp_array_t sdispls_desc, rdispls_desc; + + 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 */ + OMPI_COUNT_ARRAY_INIT(&sendcounts_desc, sendcounts); + OMPI_DISP_ARRAY_INIT(&sdispls_desc, sdispls); + OMPI_COUNT_ARRAY_INIT(&recvcounts_desc, recvcounts); + OMPI_DISP_ARRAY_INIT(&rdispls_desc, rdispls); + err = comm->c_coll->coll_neighbor_alltoallw_init(sendbuf, sendcounts_desc, sdispls_desc, sendtypes, + recvbuf, recvcounts_desc, rdispls_desc, 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..be3a49fe04c 100644 --- a/ompi/mpi/c/op_c2f.c +++ b/ompi/mpi/c/op_c2f.c.in @@ -12,6 +12,8 @@ * Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -27,17 +29,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..0346036efee 100644 --- a/ompi/mpi/c/op_commutative.c +++ b/ompi/mpi/c/op_commutative.c.in @@ -12,6 +12,8 @@ * Copyright (c) 2009-2014 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -28,17 +30,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 86% rename from ompi/mpi/c/op_create.c rename to ompi/mpi/c/op_create.c.in index 1fafbea899a..b3a39473ce1 100644 --- a/ompi/mpi/c/op_create.c +++ b/ompi/mpi/c/op_create.c.in @@ -29,19 +29,14 @@ #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; +#if OMPI_BIGCOUNT_SRC + bool bc_op = true; +#else + bool bc_op = false; +#endif /* Error checking */ @@ -59,7 +54,7 @@ int MPI_Op_create(MPI_User_function * function, int commute, MPI_Op * op) /* Create and cache the op. Sets a refcount of 1. */ *op = ompi_op_create_user(OPAL_INT_TO_BOOL(commute), - false, + bc_op, (ompi_op_fortran_handler_fn_t *) function); if (NULL == *op) { err = MPI_ERR_INTERN; 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..59812d893d2 100644 --- a/ompi/mpi/c/op_f2c.c +++ b/ompi/mpi/c/op_f2c.c.in @@ -13,6 +13,8 @@ * Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -27,17 +29,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..93668a28abc 100644 --- a/ompi/mpi/c/op_free.c +++ b/ompi/mpi/c/op_free.c.in @@ -11,6 +11,8 @@ * All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -26,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_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..5020da632b2 100644 --- a/ompi/mpi/c/open_port.c +++ b/ompi/mpi/c/open_port.c.in @@ -12,6 +12,8 @@ * Copyright (c) 2015 Intel, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -28,17 +30,7 @@ #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..69a0bb358eb 100644 --- a/ompi/mpi/c/pack.c +++ b/ompi/mpi/c/pack.c.in @@ -16,6 +16,8 @@ * Copyright (c) 2015-2018 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2021 IBM Corporation. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -33,18 +35,8 @@ #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, COUNT incount, DATATYPE datatype, + BUFFER_OUT outbuf, COUNT outsize, COUNT_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 83% rename from ompi/mpi/c/pack_external.c rename to ompi/mpi/c/pack_external.c.in index f8c59485134..cc880e91ee7 100644 --- a/ompi/mpi/c/pack_external.c +++ b/ompi/mpi/c/pack_external.c.in @@ -15,6 +15,8 @@ * reserved. * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -32,19 +34,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, COUNT incount, + DATATYPE datatype, BUFFER_OUT outbuf, + AINT_COUNT outsize, AINT_COUNT_OUT position) { int rc = MPI_SUCCESS; @@ -70,7 +62,7 @@ int MPI_Pack_external(const char datarep[], const void *inbuf, int incount, rc = ompi_datatype_pack_external(datarep, inbuf, incount, datatype, outbuf, - outsize, position); + outsize, (MPI_Aint *)position); OMPI_ERRHANDLER_NOHANDLE_RETURN(rc, rc, FUNC_NAME); } diff --git a/ompi/mpi/c/pack_external_size.c b/ompi/mpi/c/pack_external_size.c.in similarity index 81% rename from ompi/mpi/c/pack_external_size.c rename to ompi/mpi/c/pack_external_size.c.in index 024aaf49de3..8ff195bf34f 100644 --- a/ompi/mpi/c/pack_external_size.c +++ b/ompi/mpi/c/pack_external_size.c.in @@ -15,6 +15,8 @@ * reserved. * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -32,20 +34,11 @@ #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, COUNT incount, + DATATYPE datatype, AINT_COUNT_OUT size) { int rc = MPI_SUCCESS; + MPI_Aint tmp_size = 0; MEMCHECKER( memchecker_datatype(datatype); @@ -61,7 +54,8 @@ int MPI_Pack_external_size(const char datarep[], int incount, } rc = ompi_datatype_pack_external_size(datarep, incount, - datatype, size); + datatype, &tmp_size); + *size = tmp_size; OMPI_ERRHANDLER_NOHANDLE_RETURN(rc, rc, FUNC_NAME); } 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..f0931d00671 100644 --- a/ompi/mpi/c/pack_size.c +++ b/ompi/mpi/c/pack_size.c.in @@ -12,6 +12,8 @@ * Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -29,17 +31,8 @@ #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(COUNT incount, DATATYPE datatype, COMM comm, + COUNT_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..562138ef1ca 100644 --- a/ompi/mpi/c/parrived.c +++ b/ompi/mpi/c/parrived.c.in @@ -16,6 +16,8 @@ * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2020 Sandia National Laboratories. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -33,17 +35,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..8610688f420 100644 --- a/ompi/mpi/c/pready.c +++ b/ompi/mpi/c/pready.c.in @@ -16,6 +16,8 @@ * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2020 Sandia National Laboratories. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -33,17 +35,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..086ff618954 100644 --- a/ompi/mpi/c/pready_list.c +++ b/ompi/mpi/c/pready_list.c.in @@ -16,6 +16,8 @@ * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2020 Sandia National Laboratories. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -33,17 +35,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_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_ARRAY 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..7dfc2df59ae 100644 --- a/ompi/mpi/c/pready_range.c +++ b/ompi/mpi/c/pready_range.c.in @@ -16,6 +16,8 @@ * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2020 Sandia National Laboratories. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -33,17 +35,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_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..31b1f3d97f8 100644 --- a/ompi/mpi/c/precv_init.c +++ b/ompi/mpi/c/precv_init.c.in @@ -17,6 +17,8 @@ * and Technology (RIST). All rights reserved. * Copyright (c) 2020 Sandia National Laboratories. All rights reserved. * Copyright (c) 2021 Bull S.A.S. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -34,17 +36,9 @@ #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..906b164633e 100644 --- a/ompi/mpi/c/probe.c +++ b/ompi/mpi/c/probe.c.in @@ -12,6 +12,8 @@ * Copyright (c) 2010-2012 Oak Ridge National Labs. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -30,17 +32,7 @@ #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..7ddf8335090 100644 --- a/ompi/mpi/c/psend_init.c +++ b/ompi/mpi/c/psend_init.c.in @@ -17,6 +17,8 @@ * and Technology (RIST). All rights reserved. * Copyright (c) 2020 Sandia National Laboratories. All rights reserved. * Copyright (c) 2021 Bull S.A.S. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -34,17 +36,9 @@ #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..967ee44033f 100644 --- a/ompi/mpi/c/publish_name.c +++ b/ompi/mpi/c/publish_name.c.in @@ -16,6 +16,8 @@ * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2015 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -35,18 +37,8 @@ #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..c24cedd7e62 100644 --- a/ompi/mpi/c/put.c +++ b/ompi/mpi/c/put.c.in @@ -15,6 +15,8 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -33,19 +35,9 @@ #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, COUNT origin_count, DATATYPE origin_datatype, + INT target_rank, AINT target_disp, COUNT 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..493076c2ce9 100644 --- a/ompi/mpi/c/query_thread.c +++ b/ompi/mpi/c/query_thread.c.in @@ -11,6 +11,8 @@ * All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -25,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_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..8280c313295 100644 --- a/ompi/mpi/c/raccumulate.c +++ b/ompi/mpi/c/raccumulate.c.in @@ -16,6 +16,8 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -35,18 +37,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_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, COUNT origin_count, DATATYPE origin_datatype, + INT target_rank, AINT target_disp, COUNT 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..6a022fc14a8 100644 --- a/ompi/mpi/c/recv.c +++ b/ompi/mpi/c/recv.c.in @@ -13,13 +13,14 @@ * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2023 Jeffrey M. Squyres. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow * * $HEADER$ */ - #include "ompi_config.h" #include "ompi/mpi/c/bindings.h" @@ -31,18 +32,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..33386f94c25 100644 --- a/ompi/mpi/c/recv_init.c +++ b/ompi/mpi/c/recv_init.c.in @@ -14,6 +14,8 @@ * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -30,18 +32,8 @@ #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, COUNT 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..04aecd91675 100644 --- a/ompi/mpi/c/reduce.c +++ b/ompi/mpi/c/reduce.c.in @@ -16,6 +16,8 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -34,18 +36,8 @@ #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, COUNT 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..1912420e798 100644 --- a/ompi/mpi/c/reduce_init.c +++ b/ompi/mpi/c/reduce_init.c.in @@ -17,6 +17,8 @@ * and Technology (RIST). All rights reserved. * Copyright (c) 2016 IBM Corporation. All rights reserved. * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -36,19 +38,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, COUNT 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..29bce96f91c 100644 --- a/ompi/mpi/c/reduce_local.c +++ b/ompi/mpi/c/reduce_local.c.in @@ -16,6 +16,8 @@ * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2016-2017 IBM Corporation. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -33,18 +35,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, COUNT 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..4a83f57ea26 100644 --- a/ompi/mpi/c/reduce_scatter.c +++ b/ompi/mpi/c/reduce_scatter.c.in @@ -16,6 +16,8 @@ * reserved. * Copyright (c) 2015-2018 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -34,18 +36,8 @@ #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..124a0e9ebf9 100644 --- a/ompi/mpi/c/reduce_scatter_block.c +++ b/ompi/mpi/c/reduce_scatter_block.c.in @@ -16,6 +16,8 @@ * reserved. * Copyright (c) 2015-2018 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -34,18 +36,8 @@ #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, COUNT 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..46aec913ef1 100644 --- a/ompi/mpi/c/reduce_scatter_block_init.c +++ b/ompi/mpi/c/reduce_scatter_block_init.c.in @@ -16,6 +16,8 @@ * reserved. * Copyright (c) 2015-2019 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -35,19 +37,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_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, COUNT 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..717093ca410 100644 --- a/ompi/mpi/c/reduce_scatter_init.c +++ b/ompi/mpi/c/reduce_scatter_init.c.in @@ -17,6 +17,8 @@ * and Technology (RIST). All rights reserved. * Copyright (c) 2016 IBM Corporation. All rights reserved. * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -36,18 +38,8 @@ #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, COUNT_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 75% rename from ompi/mpi/c/register_datarep.c rename to ompi/mpi/c/register_datarep.c.in index 2ce49dbe9f3..4f49fc239fc 100644 --- a/ompi/mpi/c/register_datarep.c +++ b/ompi/mpi/c/register_datarep.c.in @@ -14,13 +14,14 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow * * $HEADER$ */ - #include "ompi_config.h" #include @@ -30,21 +31,11 @@ #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; @@ -67,8 +58,8 @@ int MPI_Register_datarep(const char *datarep, } /* Call the back-end io component function */ - rc = mca_io_base_register_datarep(datarep, read_conversion_fn, - write_conversion_fn, + rc = mca_io_base_register_datarep(datarep, (MPI_Datarep_conversion_function *) read_conversion_fn, + (MPI_Datarep_conversion_function *) write_conversion_fn, dtype_file_extent_fn, extra_state); 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..65a21fb692d 100644 --- a/ompi/mpi/c/request_c2f.c +++ b/ompi/mpi/c/request_c2f.c.in @@ -13,6 +13,8 @@ * Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -29,17 +31,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..3f6b6345f59 100644 --- a/ompi/mpi/c/request_f2c.c +++ b/ompi/mpi/c/request_f2c.c.in @@ -13,6 +13,8 @@ * Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -27,17 +29,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..28a18e95431 100644 --- a/ompi/mpi/c/request_free.c +++ b/ompi/mpi/c/request_free.c.in @@ -12,6 +12,8 @@ * Copyright (c) 2006-2009 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -28,17 +30,7 @@ #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..86ba237866b 100644 --- a/ompi/mpi/c/request_get_status.c +++ b/ompi/mpi/c/request_get_status.c.in @@ -12,6 +12,8 @@ * Copyright (c) 2006-2010 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -29,21 +31,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..a0c70e235e9 100644 --- a/ompi/mpi/c/rget.c +++ b/ompi/mpi/c/rget.c.in @@ -14,6 +14,8 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -32,20 +34,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_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, COUNT origin_count, + DATATYPE origin_datatype, INT target_rank, + AINT target_disp, COUNT 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..146a9416dbb 100644 --- a/ompi/mpi/c/rget_accumulate.c +++ b/ompi/mpi/c/rget_accumulate.c.in @@ -16,6 +16,8 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -36,19 +38,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, COUNT origin_count, DATATYPE origin_datatype, + BUFFER_OUT result_addr, COUNT result_count, DATATYPE result_datatype, + INT target_rank, AINT target_disp, COUNT 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..8ee8b5adabb 100644 --- a/ompi/mpi/c/rput.c +++ b/ompi/mpi/c/rput.c.in @@ -15,6 +15,8 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -33,19 +35,9 @@ #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, COUNT origin_count, DATATYPE origin_datatype, + INT target_rank, AINT target_disp, COUNT 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..2364e8178b5 100644 --- a/ompi/mpi/c/rsend.c +++ b/ompi/mpi/c/rsend.c.in @@ -16,6 +16,8 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -33,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_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, COUNT 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..a6a90588c62 100644 --- a/ompi/mpi/c/rsend_init.c +++ b/ompi/mpi/c/rsend_init.c.in @@ -17,6 +17,8 @@ * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -34,19 +36,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, COUNT 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..4f028c7c709 100644 --- a/ompi/mpi/c/scan.c +++ b/ompi/mpi/c/scan.c.in @@ -16,6 +16,8 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -34,18 +36,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..b1625f138a6 100644 --- a/ompi/mpi/c/scan_init.c +++ b/ompi/mpi/c/scan_init.c.in @@ -15,6 +15,8 @@ * reserved. * Copyright (c) 2015-2019 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -34,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_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, COUNT 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..e07ffde7d9f 100644 --- a/ompi/mpi/c/scatter.c +++ b/ompi/mpi/c/scatter.c.in @@ -18,6 +18,8 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -35,19 +37,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, COUNT sendcount, DATATYPE sendtype, + BUFFER_OUT recvbuf, COUNT 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..c17ef222d77 100644 --- a/ompi/mpi/c/scatter_init.c +++ b/ompi/mpi/c/scatter_init.c.in @@ -17,6 +17,8 @@ * reserved. * Copyright (c) 2015-2019 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -35,19 +37,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_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, COUNT sendcount, DATATYPE sendtype, + BUFFER_OUT recvbuf, COUNT 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..78eda87c80f 100644 --- a/ompi/mpi/c/scatterv.c +++ b/ompi/mpi/c/scatterv.c.in @@ -16,6 +16,8 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -33,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_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, COUNT_ARRAY sendcounts, DISP_ARRAY displs, + DATATYPE sendtype, BUFFER_OUT recvbuf, COUNT 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..c42b0b1d9b5 100644 --- a/ompi/mpi/c/scatterv_init.c +++ b/ompi/mpi/c/scatterv_init.c.in @@ -15,6 +15,8 @@ * reserved. * Copyright (c) 2015-2019 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -33,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_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, COUNT_ARRAY sendcounts, DISP_ARRAY displs, + DATATYPE sendtype, BUFFER_OUT recvbuf, COUNT 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..797bc7630ad 100644 --- a/ompi/mpi/c/send.c +++ b/ompi/mpi/c/send.c.in @@ -15,6 +15,8 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -33,18 +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_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..de0dd93f777 100644 --- a/ompi/mpi/c/send_init.c +++ b/ompi/mpi/c/send_init.c.in @@ -17,6 +17,8 @@ * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -34,19 +36,9 @@ #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, COUNT 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..ea00b883bb0 100644 --- a/ompi/mpi/c/sendrecv.c +++ b/ompi/mpi/c/sendrecv.c.in @@ -17,6 +17,8 @@ * and Technology (RIST). All rights reserved. * Copyright (c) 2021 Nanook Consulting. All rights reserved. * Copyright (c) 2023 Jeffrey M. Squyres. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -34,20 +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_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, COUNT sendcount, DATATYPE sendtype, + INT dest, INT sendtag, BUFFER_OUT recvbuf, COUNT 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..76aadb3ab30 100644 --- a/ompi/mpi/c/sendrecv_replace.c +++ b/ompi/mpi/c/sendrecv_replace.c.in @@ -13,6 +13,8 @@ * Copyright (c) 2015-2021 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -32,20 +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_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, COUNT count, DATATYPE datatype, + INT dest, INT sendtag, INT source, INT recvtag, + COMM comm, STATUS_OUT status) { ompi_request_t* req; int rc = MPI_SUCCESS; diff --git a/ompi/mpi/c/session_c2f.c b/ompi/mpi/c/session_c2f.c.in similarity index 82% rename from ompi/mpi/c/session_c2f.c rename to ompi/mpi/c/session_c2f.c.in index 93b5d7da7f5..0bb1fa2ef79 100644 --- a/ompi/mpi/c/session_c2f.c +++ b/ompi/mpi/c/session_c2f.c.in @@ -13,7 +13,7 @@ * Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. - * Copyright (c) 2018 Triad National Security, LLC. All rights + * Copyright (c) 2018-2024 Triad National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -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 78% rename from ompi/mpi/c/session_call_errhandler.c rename to ompi/mpi/c/session_call_errhandler.c.in index 4e177da8e5e..2966e85298b 100644 --- a/ompi/mpi/c/session_call_errhandler.c +++ b/ompi/mpi/c/session_call_errhandler.c.in @@ -11,7 +11,7 @@ * All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. - * Copyright (c) 2022 Triad National Security, LLC. All rights + * Copyright (c) 2022-2024 Triad National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -28,18 +28,7 @@ #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 70% rename from ompi/mpi/c/session_create_errhandler.c rename to ompi/mpi/c/session_create_errhandler.c.in index e7677d992a6..9a4a64435be 100644 --- a/ompi/mpi/c/session_create_errhandler.c +++ b/ompi/mpi/c/session_create_errhandler.c.in @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* - * Copyright (c) 2018-2021 Triad National Security, LLC. All rights + * Copyright (c) 2018-2024 Triad National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -18,17 +18,7 @@ #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 84% rename from ompi/mpi/c/session_f2c.c rename to ompi/mpi/c/session_f2c.c.in index cb7c0dbd914..3f5f347a7f9 100644 --- a/ompi/mpi/c/session_f2c.c +++ b/ompi/mpi/c/session_f2c.c.in @@ -13,7 +13,7 @@ * Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. - * Copyright (c) 2018 Triad National Security, LLC. All rights + * Copyright (c) 2018-2024 Triad National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -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 68% rename from ompi/mpi/c/session_finalize.c rename to ompi/mpi/c/session_finalize.c.in index 1c071a95865..44e67abeb8e 100644 --- a/ompi/mpi/c/session_finalize.c +++ b/ompi/mpi/c/session_finalize.c.in @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* - * Copyright (c) 2018 Triad National Security, LLC. All rights + * Copyright (c) 2018-2024 Triad National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -17,17 +17,7 @@ #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 84% rename from ompi/mpi/c/session_get_errhandler.c rename to ompi/mpi/c/session_get_errhandler.c.in index 73ec6a2d0d7..70c9eb75ebb 100644 --- a/ompi/mpi/c/session_get_errhandler.c +++ b/ompi/mpi/c/session_get_errhandler.c.in @@ -15,7 +15,7 @@ * and Technology (RIST). All rights reserved. * Copyright (c) 2016-2017 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2022 Triad National Security, LLC. All rights + * Copyright (c) 2022-2024 Triad National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -31,18 +31,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_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 82% rename from ompi/mpi/c/session_get_info.c rename to ompi/mpi/c/session_get_info.c.in index 2170a2ae5cf..3c4d743b3d8 100644 --- a/ompi/mpi/c/session_get_info.c +++ b/ompi/mpi/c/session_get_info.c.in @@ -4,7 +4,7 @@ * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2016-2017 IBM Corporation. All rights reserved. - * Copyright (c) 2018 Triad National Security, LLC. All rights + * Copyright (c) 2018-2024 Triad National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -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 71% rename from ompi/mpi/c/session_get_nth_pset.c rename to ompi/mpi/c/session_get_nth_pset.c.in index a3a986d9c73..11d84569b15 100644 --- a/ompi/mpi/c/session_get_nth_pset.c +++ b/ompi/mpi/c/session_get_nth_pset.c.in @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* - * Copyright (c) 2018-2020 Triad National Security, LLC. All rights + * Copyright (c) 2018-2024 Triad National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -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 71% rename from ompi/mpi/c/session_get_num_psets.c rename to ompi/mpi/c/session_get_num_psets.c.in index 638700b5a1e..93bb265424c 100644 --- a/ompi/mpi/c/session_get_num_psets.c +++ b/ompi/mpi/c/session_get_num_psets.c.in @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* - * Copyright (c) 2018 Triad National Security, LLC. All rights + * Copyright (c) 2018-2024 Triad National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -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_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 80% rename from ompi/mpi/c/session_get_pset_info.c rename to ompi/mpi/c/session_get_pset_info.c.in index a05741fabcd..660fe91ed6d 100644 --- a/ompi/mpi/c/session_get_pset_info.c +++ b/ompi/mpi/c/session_get_pset_info.c.in @@ -4,7 +4,7 @@ * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2016-2017 IBM Corporation. All rights reserved. - * Copyright (c) 2018-2022 Triad National Security, LLC. All rights + * Copyright (c) 2018-2024 Triad National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -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 79% rename from ompi/mpi/c/session_init.c rename to ompi/mpi/c/session_init.c.in index 74c6e6f2cc3..bcc71c7eeb4 100644 --- a/ompi/mpi/c/session_init.c +++ b/ompi/mpi/c/session_init.c.in @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* - * Copyright (c) 2018-2021 Triad National Security, LLC. All rights + * Copyright (c) 2018-2024 Triad National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -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 84% rename from ompi/mpi/c/session_set_errhandler.c rename to ompi/mpi/c/session_set_errhandler.c.in index bb6c12af62c..a2ad8e36efe 100644 --- a/ompi/mpi/c/session_set_errhandler.c +++ b/ompi/mpi/c/session_set_errhandler.c.in @@ -14,7 +14,7 @@ * and Technology (RIST). All rights reserved. * Copyright (c) 2016-2017 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2022 Triad National Security, LLC. All rights + * Copyright (c) 2022-2024 Triad National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -30,17 +30,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_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 78% rename from ompi/mpi/c/session_set_info.c rename to ompi/mpi/c/session_set_info.c.in index 5f7bffb8528..ba974b2f402 100644 --- a/ompi/mpi/c/session_set_info.c +++ b/ompi/mpi/c/session_set_info.c.in @@ -4,7 +4,7 @@ * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2016-2017 IBM Corporation. All rights reserved. - * Copyright (c) 2018 Triad National Security, LLC. All rights + * Copyright (c) 2018-2024 Triad National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -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..a5bb55d0712 100644 --- a/ompi/mpi/c/ssend.c +++ b/ompi/mpi/c/ssend.c.in @@ -16,6 +16,8 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -33,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_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, COUNT 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..33bc8616a16 100644 --- a/ompi/mpi/c/ssend_init.c +++ b/ompi/mpi/c/ssend_init.c.in @@ -17,6 +17,8 @@ * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -34,19 +36,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, COUNT 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..954724e5154 100644 --- a/ompi/mpi/c/start.c +++ b/ompi/mpi/c/start.c.in @@ -15,6 +15,8 @@ * and Technology (RIST). All rights reserved. * Copyright (c) 2017 FUJITSU LIMITED. All rights reserved. * Copyright (c) 2020 Sandia National Laboratories. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -32,17 +34,7 @@ #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..d75c02debfe 100644 --- a/ompi/mpi/c/startall.c +++ b/ompi/mpi/c/startall.c.in @@ -17,6 +17,8 @@ * Copyright (c) 2014-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2017-2018 FUJITSU LIMITED. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -34,17 +36,7 @@ #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..d430bc7964f 100644 --- a/ompi/mpi/c/status_c2f.c +++ b/ompi/mpi/c/status_c2f.c.in @@ -15,6 +15,8 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -32,17 +34,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_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..74919c4b1d7 100644 --- a/ompi/mpi/c/status_c2f08.c +++ b/ompi/mpi/c/status_c2f08.c.in @@ -15,6 +15,8 @@ * reserved. * Copyright (c) 2015-2020 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -32,17 +34,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..dc7920a4e13 100644 --- a/ompi/mpi/c/status_f082c.c +++ b/ompi/mpi/c/status_f082c.c.in @@ -15,6 +15,8 @@ * reserved. * Copyright (c) 2015-2020 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -30,17 +32,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_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..39ff75516c1 100644 --- a/ompi/mpi/c/status_f082f.c +++ b/ompi/mpi/c/status_f082f.c.in @@ -15,6 +15,8 @@ * reserved. * Copyright (c) 2015-2020 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -30,17 +32,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_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..3216193e3e9 100644 --- a/ompi/mpi/c/status_f2c.c +++ b/ompi/mpi/c/status_f2c.c.in @@ -15,6 +15,8 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -30,17 +32,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..5bc1972e958 100644 --- a/ompi/mpi/c/status_f2f08.c +++ b/ompi/mpi/c/status_f2f08.c.in @@ -15,6 +15,8 @@ * reserved. * Copyright (c) 2015-2020 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -32,17 +34,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_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_get_error.c b/ompi/mpi/c/status_get_error.c.in similarity index 81% rename from ompi/mpi/c/status_get_error.c rename to ompi/mpi/c/status_get_error.c.in index b8a036a6dc9..9f5e95e6c27 100644 --- a/ompi/mpi/c/status_get_error.c +++ b/ompi/mpi/c/status_get_error.c.in @@ -1,6 +1,8 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2025 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (c) 2025 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -16,17 +18,7 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Status_get_error = PMPI_Status_get_error -#endif -#define MPI_Status_get_error PMPI_Status_get_error -#endif - -static const char FUNC_NAME[] = "MPI_Status_get_error"; - - -int MPI_Status_get_error(const MPI_Status *status, int *error) +PROTOTYPE ERROR_CLASS status_get_error(STATUS status, INT_OUT error) { int rc = MPI_SUCCESS; diff --git a/ompi/mpi/c/status_get_source.c b/ompi/mpi/c/status_get_source.c.in similarity index 81% rename from ompi/mpi/c/status_get_source.c rename to ompi/mpi/c/status_get_source.c.in index 9c4e964966f..a982b960cbc 100644 --- a/ompi/mpi/c/status_get_source.c +++ b/ompi/mpi/c/status_get_source.c.in @@ -1,6 +1,8 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2025 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (c) 2025 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -16,17 +18,7 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Status_get_source = PMPI_Status_get_source -#endif -#define MPI_Status_get_source PMPI_Status_get_source -#endif - -static const char FUNC_NAME[] = "MPI_Status_get_source"; - - -int MPI_Status_get_source(const MPI_Status *status, int *source) +PROTOTYPE ERROR_CLASS status_get_source(STATUS status, INT_OUT source) { int rc = MPI_SUCCESS; diff --git a/ompi/mpi/c/status_get_tag.c b/ompi/mpi/c/status_get_tag.c.in similarity index 82% rename from ompi/mpi/c/status_get_tag.c rename to ompi/mpi/c/status_get_tag.c.in index 86ce2d5982b..b953cee1878 100644 --- a/ompi/mpi/c/status_get_tag.c +++ b/ompi/mpi/c/status_get_tag.c.in @@ -1,6 +1,9 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2025 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (c) 2025 Triad National Security, LLC. All rights + * reserved. + * * $COPYRIGHT$ * * Additional copyrights may follow @@ -16,17 +19,8 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/memchecker.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Status_get_tag = PMPI_Status_get_tag -#endif -#define MPI_Status_get_tag PMPI_Status_get_tag -#endif - -static const char FUNC_NAME[] = "MPI_Status_get_tag"; - -int MPI_Status_get_tag(const MPI_Status *status, int *tag) +PROTOTYPE ERROR_CLASS status_get_tag(STATUS status, INT_OUT tag) { int rc = MPI_SUCCESS; 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..3c47560527c 100644 --- a/ompi/mpi/c/status_set_cancelled.c +++ b/ompi/mpi/c/status_set_cancelled.c.in @@ -11,6 +11,8 @@ * All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -26,17 +28,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.c b/ompi/mpi/c/status_set_elements.c.in similarity index 88% rename from ompi/mpi/c/status_set_elements.c rename to ompi/mpi/c/status_set_elements.c.in index 34c8888bc81..953a7aef7d0 100644 --- a/ompi/mpi/c/status_set_elements.c +++ b/ompi/mpi/c/status_set_elements.c.in @@ -14,13 +14,14 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow * * $HEADER$ */ - #include "ompi_config.h" #include @@ -31,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_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(STATUS_OUT status, DATATYPE datatype, COUNT count) { int rc = MPI_SUCCESS; size_t size; diff --git a/ompi/mpi/c/status_set_elements_x.c b/ompi/mpi/c/status_set_elements_x.c.in similarity index 88% rename from ompi/mpi/c/status_set_elements_x.c rename to ompi/mpi/c/status_set_elements_x.c.in index 8d7d4656718..c24b24f9c55 100644 --- a/ompi/mpi/c/status_set_elements_x.c +++ b/ompi/mpi/c/status_set_elements_x.c.in @@ -14,13 +14,14 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow * * $HEADER$ */ - #include "ompi_config.h" #include @@ -31,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_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_x(STATUS_OUT status, DATATYPE datatype, PARTITIONED_COUNT count) { int rc = MPI_SUCCESS; size_t size; diff --git a/ompi/mpi/c/status_set_error.c b/ompi/mpi/c/status_set_error.c.in similarity index 79% rename from ompi/mpi/c/status_set_error.c rename to ompi/mpi/c/status_set_error.c.in index b2bd6c4e09b..30a667cd5a5 100644 --- a/ompi/mpi/c/status_set_error.c +++ b/ompi/mpi/c/status_set_error.c.in @@ -1,5 +1,7 @@ /* * Copyright (c) 2025 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (c) 2025 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -15,17 +17,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_error = PMPI_Status_set_error -#endif -#define MPI_Status_set_error PMPI_Status_set_error -#endif - -static const char FUNC_NAME[] = "MPI_Status_set_error"; - - -int MPI_Status_set_error(MPI_Status *status, int error) +PROTOTYPE ERROR_CLASS status_set_error(STATUS_OUT status, INT error) { MEMCHECKER( if(status != MPI_STATUSES_IGNORE) { diff --git a/ompi/mpi/c/status_set_source.c b/ompi/mpi/c/status_set_source.c.in similarity index 79% rename from ompi/mpi/c/status_set_source.c rename to ompi/mpi/c/status_set_source.c.in index 8d02cb34d0a..46e1959bb85 100644 --- a/ompi/mpi/c/status_set_source.c +++ b/ompi/mpi/c/status_set_source.c.in @@ -1,5 +1,7 @@ /* * Copyright (c) 2025 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (c) 2025 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -15,17 +17,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_source = PMPI_Status_set_source -#endif -#define MPI_Status_set_source PMPI_Status_set_source -#endif - -static const char FUNC_NAME[] = "MPI_Status_set_source"; - - -int MPI_Status_set_source(MPI_Status *status, int source) +PROTOTYPE ERROR_CLASS status_set_source(STATUS_OUT status, INT source) { MEMCHECKER( if(status != MPI_STATUSES_IGNORE) { diff --git a/ompi/mpi/c/status_set_tag.c b/ompi/mpi/c/status_set_tag.c.in similarity index 80% rename from ompi/mpi/c/status_set_tag.c rename to ompi/mpi/c/status_set_tag.c.in index f357c9a754b..2a85c3cb62f 100644 --- a/ompi/mpi/c/status_set_tag.c +++ b/ompi/mpi/c/status_set_tag.c.in @@ -1,5 +1,8 @@ /* * Copyright (c) 2025 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (c) 2025 Triad National Security, LLC. All rights + * reserved. + * * $COPYRIGHT$ * * Additional copyrights may follow @@ -15,17 +18,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_tag = PMPI_Status_set_tag -#endif -#define MPI_Status_set_tag PMPI_Status_set_tag -#endif - -static const char FUNC_NAME[] = "MPI_Status_set_tag"; - - -int MPI_Status_set_tag(MPI_Status *status, int tag) +PROTOTYPE ERROR_CLASS status_set_tag(STATUS_OUT status, INT tag) { MEMCHECKER( if(status != MPI_STATUSES_IGNORE) { 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..a44ac730458 100644 --- a/ompi/mpi/c/test.c +++ b/ompi/mpi/c/test.c.in @@ -12,6 +12,8 @@ * Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -29,17 +31,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..aa52f937d5f 100644 --- a/ompi/mpi/c/test_cancelled.c +++ b/ompi/mpi/c/test_cancelled.c.in @@ -14,6 +14,8 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -29,17 +31,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 87% rename from ompi/mpi/c/testall.c rename to ompi/mpi/c/testall.c.in index 4eac940b257..c1ba8e9e21e 100644 --- a/ompi/mpi/c/testall.c +++ b/ompi/mpi/c/testall.c.in @@ -15,7 +15,7 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. - * Copyright (c) 2021 Triad National Security, LLC. All rights + * Copyright (c) 2021-2024 Triad National Security, LLC. All rights * reserved. * Copyright (c) 2024 NVIDIA Corporation. All rights reserved. * $COPYRIGHT$ @@ -35,18 +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_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 88% rename from ompi/mpi/c/testany.c rename to ompi/mpi/c/testany.c.in index 8a70002d495..50ed88b2fa5 100644 --- a/ompi/mpi/c/testany.c +++ b/ompi/mpi/c/testany.c.in @@ -15,7 +15,7 @@ * reserved. * Copyright (c) 2014-2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. - * Copyright (c) 2021 Triad National Security, LLC. All rights + * Copyright (c) 2021-2024 Triad National Security, LLC. All rights * reserved. * Copyright (c) 2024 NVIDIA Corporation. All rights reserved. * $COPYRIGHT$ @@ -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 87% rename from ompi/mpi/c/testsome.c rename to ompi/mpi/c/testsome.c.in index 459335ded67..e5bccca0a28 100644 --- a/ompi/mpi/c/testsome.c +++ b/ompi/mpi/c/testsome.c.in @@ -15,7 +15,7 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. - * Copyright (c) 2021 Triad National Security, LLC. All rights + * Copyright (c) 2021-2024 Triad National Security, LLC. All rights * reserved. * Copyright (c) 2024 NVIDIA Corporation. All rights reserved. * $COPYRIGHT$ @@ -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..33c1d9e1fda 100644 --- a/ompi/mpi/c/topo_test.c +++ b/ompi/mpi/c/topo_test.c.in @@ -12,13 +12,14 @@ * Copyright (c) 2012-2013 Inria. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow * * $HEADER$ */ - #include "ompi_config.h" #include @@ -27,17 +28,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..9ca8ec5faa7 100644 --- a/ompi/mpi/c/type_c2f.c +++ b/ompi/mpi/c/type_c2f.c.in @@ -12,12 +12,15 @@ * Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow * * $HEADER$ */ + #include "ompi_config.h" #include @@ -28,17 +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_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..cd67aa24501 100644 --- a/ompi/mpi/c/type_commit.c +++ b/ompi/mpi/c/type_commit.c.in @@ -12,6 +12,8 @@ * Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -28,17 +30,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_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 76% rename from ompi/mpi/c/type_contiguous.c rename to ompi/mpi/c/type_contiguous.c.in index 4bac82c79ee..cc88f3cab77 100644 --- a/ompi/mpi/c/type_contiguous.c +++ b/ompi/mpi/c/type_contiguous.c.in @@ -15,13 +15,14 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow * * $HEADER$ */ - #include "ompi_config.h" #include "ompi/mpi/c/bindings.h" @@ -31,19 +32,15 @@ #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"; +/* + * TODO:BIGCOUNT this file will need to be updated once + * the datatype framework supports bigcount + */ -int MPI_Type_contiguous(int count, - MPI_Datatype oldtype, - MPI_Datatype *newtype) +PROTOTYPE ERROR_CLASS type_contiguous(COUNT count, + DATATYPE oldtype, + DATATYPE_OUT newtype) { int rc; @@ -59,6 +56,12 @@ int MPI_Type_contiguous(int count, } else if( count < 0 ) { return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_COUNT, FUNC_NAME); } +#if OMPI_BIGCOUNT_SRC + OMPI_CHECK_MPI_COUNT_INT_CONVERSION_OVERFLOW(rc, count); + if (OMPI_SUCCESS != rc) { + return OMPI_ERRHANDLER_NOHANDLE_INVOKE(rc, FUNC_NAME); + } +#endif } rc = ompi_datatype_create_contiguous( count, oldtype, newtype ); @@ -66,7 +69,12 @@ int MPI_Type_contiguous(int count, /* data description */ { +#if OMPI_BIGCOUNT_SRC + int icount = (int)count; + const int* a_i[1] = {&icount}; +#else const int* a_i[1] = {&count}; +#endif ompi_datatype_set_args( *newtype, 1, a_i, 0, NULL, 1, &oldtype, MPI_COMBINER_CONTIGUOUS ); } diff --git a/ompi/mpi/c/type_create_darray.c b/ompi/mpi/c/type_create_darray.c.in similarity index 71% rename from ompi/mpi/c/type_create_darray.c rename to ompi/mpi/c/type_create_darray.c.in index 9dbe45d615a..f1a7fd20e1c 100644 --- a/ompi/mpi/c/type_create_darray.c +++ b/ompi/mpi/c/type_create_darray.c.in @@ -15,6 +15,8 @@ * Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -31,28 +33,25 @@ #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"; +/* + * TODO:BIGCOUNT this file will need to be updated once + * the datatype framework supports bigcount + */ -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, + COUNT_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; + int *igsize_array = NULL; MEMCHECKER( memchecker_datatype(oldtype); @@ -76,6 +75,14 @@ int MPI_Type_create_darray(int size, return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_ARG, FUNC_NAME); } if( ndims > 0 ) { +#if OMPI_BIGCOUNT_SRC + for( i = 0; i < ndims; i++ ) { + OMPI_CHECK_MPI_COUNT_INT_CONVERSION_OVERFLOW(rc, gsize_array[i]); + if (OMPI_SUCCESS != rc) { + return OMPI_ERRHANDLER_NOHANDLE_INVOKE(rc, FUNC_NAME); + } + } +#endif for( i = 0; i < ndims; i++ ) { if( (MPI_DISTRIBUTE_BLOCK != distrib_array[i]) && (MPI_DISTRIBUTE_CYCLIC != distrib_array[i]) && @@ -97,16 +104,30 @@ int MPI_Type_create_darray(int size, } } +#if OMPI_BIGCOUNT_SRC + igsize_array = (int *)malloc(ndims * sizeof(int)); + if (NULL == igsize_array) { + return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_NO_MEM, FUNC_NAME); + } + for (int ii=0;ii 0 ) { for ( i = 0; i < count; i++ ) { @@ -80,20 +79,46 @@ int MPI_Type_create_struct(int count, } } - rc = ompi_datatype_create_struct( count, array_of_blocklengths, array_of_displacements, +#if OMPI_BIGCOUNT_SRC + iarray_of_blocklengths = (int *)malloc(count * sizeof(int)); + if (NULL == iarray_of_blocklengths) { + return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_NO_MEM, FUNC_NAME); + } + iarray_of_displacements = (MPI_Aint *)malloc(count * sizeof(MPI_Aint)); + if (NULL == iarray_of_displacements) { + free(iarray_of_blocklengths); + return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_NO_MEM, FUNC_NAME); + } + for (int ii = 0; ii < (int)count; ii++) { + iarray_of_blocklengths[ii] = (int)array_of_blocklengths[ii]; + iarray_of_displacements[ii] = (MPI_Aint)array_of_displacements[ii]; + } +#else + iarray_of_blocklengths = (int *)array_of_blocklengths; + iarray_of_displacements = (MPI_Aint *)array_of_displacements; +#endif + rc = ompi_datatype_create_struct( count, iarray_of_blocklengths, iarray_of_displacements, array_of_types, newtype ); if( rc != MPI_SUCCESS ) { ompi_datatype_destroy( newtype ); +#if OMPI_BIGCOUNT_SRC + free(iarray_of_blocklengths); + free(iarray_of_displacements); +#endif OMPI_ERRHANDLER_NOHANDLE_RETURN( rc, rc, FUNC_NAME ); } { - const int* a_i[2] = {&count, array_of_blocklengths}; + const int* a_i[2] = {(int *)&count, iarray_of_blocklengths}; - ompi_datatype_set_args( *newtype, count + 1, a_i, count, array_of_displacements, + ompi_datatype_set_args( *newtype, count + 1, a_i, count, iarray_of_displacements, count, array_of_types, MPI_COMBINER_STRUCT ); } +#if OMPI_BIGCOUNT_SRC + free(iarray_of_blocklengths); + free(iarray_of_displacements); +#endif return MPI_SUCCESS; } diff --git a/ompi/mpi/c/type_create_subarray.c b/ompi/mpi/c/type_create_subarray.c.in similarity index 52% rename from ompi/mpi/c/type_create_subarray.c rename to ompi/mpi/c/type_create_subarray.c.in index daa68e634e6..d25cde247c4 100644 --- a/ompi/mpi/c/type_create_subarray.c +++ b/ompi/mpi/c/type_create_subarray.c.in @@ -15,6 +15,8 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -31,25 +33,23 @@ #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"; - +/* + * TODO:BIGCOUNT this file will need to be updated once + * the datatype framework supports bigcount + */ -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, + COUNT_ARRAY size_array, + COUNT_ARRAY subsize_array, + COUNT_ARRAY start_array, + INT order, + DATATYPE oldtype, + DATATYPE_OUT newtype) { int32_t i, rc; + int *isize_array = NULL; + int *isubsize_array = NULL; + int *istart_array = NULL; MEMCHECKER( memchecker_datatype(oldtype); @@ -67,6 +67,20 @@ int MPI_Type_create_subarray(int ndims, return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_ARG, FUNC_NAME); } for( i = 0; i < ndims; i++ ) { +#if OMPI_BIGCOUNT_SRC + OMPI_CHECK_MPI_COUNT_INT_CONVERSION_OVERFLOW(rc, size_array[i]); + if (OMPI_SUCCESS != rc) { + return OMPI_ERRHANDLER_NOHANDLE_INVOKE(rc, FUNC_NAME); + } + OMPI_CHECK_MPI_COUNT_INT_CONVERSION_OVERFLOW(rc, subsize_array[i]); + if (OMPI_SUCCESS != rc) { + return OMPI_ERRHANDLER_NOHANDLE_INVOKE(rc, FUNC_NAME); + } + OMPI_CHECK_MPI_COUNT_INT_CONVERSION_OVERFLOW(rc, start_array[i]); + if (OMPI_SUCCESS != rc) { + return OMPI_ERRHANDLER_NOHANDLE_INVOKE(rc, FUNC_NAME); + } +#endif if( (subsize_array[i] < 1) || (subsize_array[i] > size_array[i]) ) { return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_ARG, FUNC_NAME); } else if( (start_array[i] < 0) || (start_array[i] > (size_array[i] - subsize_array[i])) ) { @@ -75,14 +89,45 @@ int MPI_Type_create_subarray(int ndims, } } - rc = ompi_datatype_create_subarray( ndims, size_array, subsize_array, start_array, +#if OMPI_BIGCOUNT_SRC + isize_array = (int *)malloc(ndims * sizeof(int)); + if (NULL == isize_array) { + return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_NO_MEM, FUNC_NAME); + } + isubsize_array = (int *)malloc(ndims * sizeof(int)); + if (NULL == isubsize_array) { + free(isize_array); + return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_NO_MEM, FUNC_NAME); + } + istart_array = (int *)malloc(ndims * sizeof(int)); + if (NULL == istart_array) { + free(isize_array); + free(isubsize_array); + return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_NO_MEM, FUNC_NAME); + } + for (int ii = 0; ii < ndims; ii++) { + isize_array[ii] = (int)size_array[ii]; + isubsize_array[ii] = (int)subsize_array[ii]; + istart_array[ii] = (int)start_array[ii]; + } +#else + isize_array = (int *)size_array; + isubsize_array = (int *)subsize_array; + istart_array = (int *)start_array; +#endif + rc = ompi_datatype_create_subarray( ndims, isize_array, isubsize_array, istart_array, order, oldtype, newtype); if( OMPI_SUCCESS == rc ) { - const int* a_i[5] = {&ndims, size_array, subsize_array, start_array, &order}; + const int* a_i[5] = {&ndims, isize_array, isubsize_array, istart_array, &order}; ompi_datatype_set_args( *newtype, 3 * ndims + 2, a_i, 0, NULL, 1, &oldtype, MPI_COMBINER_SUBARRAY ); } +#if OMPI_BIGCOUNT_SRC + free(isize_array); + free(isubsize_array); + free(istart_array); +#endif OMPI_ERRHANDLER_NOHANDLE_RETURN(rc, rc, FUNC_NAME); } diff --git a/ompi/mpi/c/type_delete_attr.c b/ompi/mpi/c/type_delete_attr.c.in similarity index 84% rename from ompi/mpi/c/type_delete_attr.c rename to ompi/mpi/c/type_delete_attr.c.in index 050df3586d0..68de235978c 100644 --- a/ompi/mpi/c/type_delete_attr.c +++ b/ompi/mpi/c/type_delete_attr.c.in @@ -11,6 +11,8 @@ * All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -28,17 +30,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_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..41abec68692 100644 --- a/ompi/mpi/c/type_dup.c +++ b/ompi/mpi/c/type_dup.c.in @@ -11,6 +11,8 @@ * All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -28,18 +30,7 @@ #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..083e0dcae80 100644 --- a/ompi/mpi/c/type_f2c.c +++ b/ompi/mpi/c/type_f2c.c.in @@ -13,6 +13,8 @@ * Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -29,17 +31,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..fbdfb199434 100644 --- a/ompi/mpi/c/type_free.c +++ b/ompi/mpi/c/type_free.c.in @@ -12,6 +12,8 @@ * Copyright (c) 2009 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -28,17 +30,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..1c08edd3351 100644 --- a/ompi/mpi/c/type_free_keyval.c +++ b/ompi/mpi/c/type_free_keyval.c.in @@ -11,6 +11,8 @@ * All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -26,17 +28,7 @@ #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..506adb9bf9d 100644 --- a/ompi/mpi/c/type_get_attr.c +++ b/ompi/mpi/c/type_get_attr.c.in @@ -11,6 +11,8 @@ * All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -28,20 +30,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_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.c b/ompi/mpi/c/type_get_contents_c.c new file mode 100644 index 00000000000..6be23ccc4c4 --- /dev/null +++ b/ompi/mpi/c/type_get_contents_c.c @@ -0,0 +1,95 @@ +/* + * 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) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" + +#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" + +#if OMPI_BUILD_MPI_PROFILING +#if OPAL_HAVE_WEAK_SYMBOLS +#pragma weak MPI_Type_get_contents_c = PMPI_Type_get_contents_c +#endif +#define MPI_Type_get_contents_c PMPI_Type_get_contents_c +#endif + +static const char FUNC_NAME[] = "MPI_Type_get_contents_c"; + + +int MPI_Type_get_contents_c(MPI_Datatype mtype, + MPI_Count max_integers, + MPI_Count max_addresses, + MPI_Count max_large_counts, + MPI_Count max_datatypes, + int array_of_integers[], + MPI_Aint array_of_addresses[], + MPI_Count array_of_large_counts[], + MPI_Datatype array_of_datatypes[]) +{ + int rc, i; + MPI_Datatype newtype; + + MEMCHECKER( + memchecker_datatype(mtype); + ); + + if( MPI_PARAM_CHECK ) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == mtype || MPI_DATATYPE_NULL == mtype) { + return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_TYPE, + FUNC_NAME ); + } else if( ((NULL == array_of_integers) && (max_integers != 0)) || + ((NULL == array_of_addresses) && (max_addresses != 0)) || + ((NULL == array_of_datatypes) && (max_datatypes != 0)) ) { + return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_ARG, + FUNC_NAME ); + } + } + +/* TODO:BIGCOUNT: Need to embiggen ompi_datatype_get_args */ + rc = ompi_datatype_get_args( mtype, 1, (int *)&max_integers, array_of_integers, + (int *)&max_addresses, array_of_addresses, + (int *)&max_datatypes, array_of_datatypes, NULL ); + if( rc != MPI_SUCCESS ) { + OMPI_ERRHANDLER_NOHANDLE_RETURN( MPI_ERR_INTERN, + MPI_ERR_INTERN, FUNC_NAME ); + } + + for( i = 0; i < max_datatypes; i++ ) { + /* if we have a predefined datatype then we return directly a pointer to + * the datatype, otherwise we should create a copy and give back the copy. + */ + if( !(ompi_datatype_is_predefined(array_of_datatypes[i])) ) { + if( (rc = ompi_datatype_duplicate( array_of_datatypes[i], &newtype )) != MPI_SUCCESS ) { + ompi_datatype_destroy( &newtype ); + OMPI_ERRHANDLER_NOHANDLE_RETURN( MPI_ERR_INTERN, + MPI_ERR_INTERN, FUNC_NAME ); + } + ompi_datatype_copy_args( array_of_datatypes[i], newtype ); + array_of_datatypes[i] = newtype; + } + } + + return MPI_SUCCESS; +} diff --git a/ompi/mpi/c/type_get_envelope.c.in b/ompi/mpi/c/type_get_envelope.c.in new file mode 100644 index 00000000000..e5395d796e4 --- /dev/null +++ b/ompi/mpi/c/type_get_envelope.c.in @@ -0,0 +1,59 @@ +/* + * 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) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" + +#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" + +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; + + MEMCHECKER( + memchecker_datatype(type); + ); + + if( MPI_PARAM_CHECK ) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == type || MPI_DATATYPE_NULL == type) { + return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_TYPE, + FUNC_NAME ); + } else if (NULL == num_integers || NULL == num_addresses || + NULL == num_datatypes || NULL == combiner) { + return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_ARG, + FUNC_NAME ); + } + } + + rc = ompi_datatype_get_args( type, 0, num_integers, NULL, num_addresses, NULL, + num_datatypes, NULL, combiner ); + OMPI_ERRHANDLER_NOHANDLE_RETURN( rc, rc, FUNC_NAME ); +} diff --git a/ompi/mpi/c/type_get_envelope_c.c b/ompi/mpi/c/type_get_envelope_c.c new file mode 100644 index 00000000000..24229e327cf --- /dev/null +++ b/ompi/mpi/c/type_get_envelope_c.c @@ -0,0 +1,69 @@ +/* + * 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) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" + +#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" + +#if OMPI_BUILD_MPI_PROFILING +#if OPAL_HAVE_WEAK_SYMBOLS +#pragma weak MPI_Type_get_envelope_c = PMPI_Type_get_envelope_c +#endif +#define MPI_Type_get_envelope_c PMPI_Type_get_envelope_c +#endif + +static const char FUNC_NAME[] = "MPI_Type_get_envelope_c"; + +int MPI_Type_get_envelope_c(MPI_Datatype type, + MPI_Count *num_integers, + MPI_Count *num_addresses, + MPI_Count *num_large_counts, + MPI_Count *num_datatypes, + int *combiner) +{ + int rc; + + MEMCHECKER( + memchecker_datatype(type); + ); + + if( MPI_PARAM_CHECK ) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == type || MPI_DATATYPE_NULL == type) { + return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_TYPE, + FUNC_NAME ); + } else if (NULL == num_integers || NULL == num_addresses || + NULL == num_datatypes || NULL == combiner) { + return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_ARG, + FUNC_NAME ); + } + } + +/* TODO:BIGCOUNT: Need to embiggen ompi_datatype_get_args */ + rc = ompi_datatype_get_args( type, 0, (int *)num_integers, NULL, (int *)num_addresses, NULL, + (int *)num_datatypes, NULL, combiner ); + OMPI_ERRHANDLER_NOHANDLE_RETURN( rc, rc, FUNC_NAME ); +} + diff --git a/ompi/mpi/c/type_get_extent.c b/ompi/mpi/c/type_get_extent.c.in similarity index 82% rename from ompi/mpi/c/type_get_extent.c rename to ompi/mpi/c/type_get_extent.c.in index 0fddff2b0cb..a2b044c9e33 100644 --- a/ompi/mpi/c/type_get_extent.c +++ b/ompi/mpi/c/type_get_extent.c.in @@ -13,6 +13,8 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -29,18 +31,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_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_COUNT_OUT lb, AINT_COUNT_OUT extent) { int rc; + ptrdiff_t tmp_lb = 0; + ptrdiff_t tmp_extent = 0; MEMCHECKER( memchecker_datatype(type); @@ -55,6 +50,8 @@ int MPI_Type_get_extent(MPI_Datatype type, MPI_Aint *lb, MPI_Aint *extent) } } - rc = ompi_datatype_get_extent( type, lb, extent ); + rc = ompi_datatype_get_extent( type, &tmp_lb, &tmp_extent ); + *lb = tmp_lb; + *extent = tmp_extent; OMPI_ERRHANDLER_NOHANDLE_RETURN(rc, rc, FUNC_NAME ); } 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..4ee710708b5 100644 --- a/ompi/mpi/c/type_get_extent_x.c +++ b/ompi/mpi/c/type_get_extent_x.c.in @@ -13,6 +13,8 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -29,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_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..68358762dce 100644 --- a/ompi/mpi/c/type_get_name.c +++ b/ompi/mpi/c/type_get_name.c.in @@ -12,6 +12,8 @@ * Copyright (c) 2008-2018 Cisco Systems, Inc. All rights reserved * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -32,17 +34,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_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 78% rename from ompi/mpi/c/type_get_true_extent.c rename to ompi/mpi/c/type_get_true_extent.c.in index f2a6377593c..ab8b2e2cddf 100644 --- a/ompi/mpi/c/type_get_true_extent.c +++ b/ompi/mpi/c/type_get_true_extent.c.in @@ -13,6 +13,8 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -29,18 +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_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_COUNT_OUT true_lb, + AINT_COUNT_OUT true_extent) { int rc; @@ -59,6 +52,6 @@ int MPI_Type_get_true_extent(MPI_Datatype datatype, } } - rc = ompi_datatype_get_true_extent( datatype, true_lb, true_extent ); + rc = ompi_datatype_get_true_extent( datatype, (MPI_Aint *)true_lb, (MPI_Aint *)true_extent ); OMPI_ERRHANDLER_NOHANDLE_RETURN(rc, rc, FUNC_NAME ); } 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..8999e924165 100644 --- a/ompi/mpi/c/type_get_true_extent_x.c +++ b/ompi/mpi/c/type_get_true_extent_x.c.in @@ -13,6 +13,8 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -29,18 +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_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 59% rename from ompi/mpi/c/type_indexed.c rename to ompi/mpi/c/type_indexed.c.in index c4589d0583d..c3ff80c1b1c 100644 --- a/ompi/mpi/c/type_indexed.c +++ b/ompi/mpi/c/type_indexed.c.in @@ -14,6 +14,8 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -30,22 +32,21 @@ #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 +/* + * TODO:BIGCOUNT this file will need to be updated once + * the datatype framework supports bigcount + */ -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(COUNT count, + COUNT_ARRAY array_of_blocklengths, + COUNT_ARRAY array_of_displacements, + DATATYPE oldtype, + DATATYPE_OUT newtype) { int rc, i; + int *iarray_of_blocklengths; + int *iarray_of_displacements; MEMCHECKER( memchecker_datatype(oldtype); @@ -65,6 +66,12 @@ int MPI_Type_indexed(int count, return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_ARG, FUNC_NAME); } +#if OMPI_BIGCOUNT_SRC + OMPI_CHECK_MPI_COUNT_INT_CONVERSION_OVERFLOW(rc, count); + if (OMPI_SUCCESS != rc) { + return OMPI_ERRHANDLER_NOHANDLE_INVOKE(rc, FUNC_NAME); + } +#endif for( i = 0; i < count; i++ ) { if( array_of_blocklengths[i] < 0 ) { return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_ARG, @@ -73,8 +80,27 @@ int MPI_Type_indexed(int count, } } - rc = ompi_datatype_create_indexed ( count, array_of_blocklengths, - array_of_displacements, +#if OMPI_BIGCOUNT_SRC + iarray_of_blocklengths = (int *)malloc(count * sizeof(int)); + if (NULL == iarray_of_blocklengths) { + return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_NO_MEM, FUNC_NAME); + } + iarray_of_displacements = (int *)malloc(count * sizeof(int)); + if (NULL == iarray_of_displacements) { + free(iarray_of_blocklengths); + return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_NO_MEM, FUNC_NAME); + } + + for (int ii = 0; ii < (int)count; ii++) { + iarray_of_blocklengths[ii] = (int)array_of_blocklengths[ii]; + iarray_of_displacements[ii] = (int)array_of_displacements[ii]; + } +#else + iarray_of_blocklengths = (int *)array_of_blocklengths; + iarray_of_displacements = (int *)array_of_displacements; +#endif + rc = ompi_datatype_create_indexed ( count, iarray_of_blocklengths, + iarray_of_displacements, oldtype, newtype ); if( rc != MPI_SUCCESS ) { ompi_datatype_destroy( newtype ); @@ -83,11 +109,15 @@ int MPI_Type_indexed(int count, } { - const int* a_i[3] = {&count, array_of_blocklengths, array_of_displacements}; + const int* a_i[3] = {(int *)&count, iarray_of_blocklengths, iarray_of_displacements}; ompi_datatype_set_args( *newtype, 2 * count + 1, a_i, 0, NULL, 1, &oldtype, MPI_COMBINER_INDEXED ); } +#if OMPI_BIGCOUNT_SRC + free(iarray_of_blocklengths); + free(iarray_of_displacements); +#endif return MPI_SUCCESS; } 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..cbb94a3305b 100644 --- a/ompi/mpi/c/type_match_size.c +++ b/ompi/mpi/c/type_match_size.c.in @@ -12,6 +12,8 @@ * Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -28,17 +30,7 @@ #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..9c3c88ea20a 100644 --- a/ompi/mpi/c/type_set_attr.c +++ b/ompi/mpi/c/type_set_attr.c.in @@ -11,6 +11,8 @@ * All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -28,19 +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_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..6414bb4bb46 100644 --- a/ompi/mpi/c/type_set_name.c +++ b/ompi/mpi/c/type_set_name.c.in @@ -15,6 +15,8 @@ * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2018 Cisco Systems, Inc. All rights reserved + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -35,17 +37,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..6e0897dd7aa 100644 --- a/ompi/mpi/c/type_size.c +++ b/ompi/mpi/c/type_size.c.in @@ -15,6 +15,8 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -31,16 +33,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 = 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, COUNT_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..ded1005acc6 100644 --- a/ompi/mpi/c/type_size_x.c +++ b/ompi/mpi/c/type_size_x.c.in @@ -15,6 +15,8 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -31,16 +33,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 75% rename from ompi/mpi/c/type_vector.c rename to ompi/mpi/c/type_vector.c.in index 12524f26271..08bad80d75f 100644 --- a/ompi/mpi/c/type_vector.c +++ b/ompi/mpi/c/type_vector.c.in @@ -14,6 +14,8 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -30,20 +32,16 @@ #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"; +/* + * TODO:BIGCOUNT this file will need to be updated once + * the datatype framework supports bigcount + */ -int MPI_Type_vector(int count, - int blocklength, - int stride, - MPI_Datatype oldtype, - MPI_Datatype *newtype) +PROTOTYPE ERROR_CLASS type_vector(COUNT count, + COUNT blocklength, + COUNT stride, + DATATYPE oldtype, + DATATYPE_OUT newtype) { int rc; @@ -64,13 +62,19 @@ int MPI_Type_vector(int count, OMPI_ERRHANDLER_NOHANDLE_RETURN( MPI_ERR_ARG, MPI_ERR_ARG, FUNC_NAME ); } +#if OMPI_BIGCOUNT_SRC + OMPI_CHECK_MPI_COUNT_INT_CONVERSION_OVERFLOW(rc, count); + if (OMPI_SUCCESS != rc) { + OMPI_ERRHANDLER_NOHANDLE_RETURN(rc, rc, FUNC_NAME); + } +#endif } rc = ompi_datatype_create_vector ( count, blocklength, stride, oldtype, newtype ); OMPI_ERRHANDLER_NOHANDLE_CHECK(rc, rc, FUNC_NAME ); { - const int* a_i[3] = {&count, &blocklength, &stride}; + const int* a_i[3] = {(int *)&count, (int *)&blocklength, (int *)&stride}; ompi_datatype_set_args( *newtype, 3, a_i, 0, NULL, 1, &oldtype, MPI_COMBINER_VECTOR ); } 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..baf050539b9 100644 --- a/ompi/mpi/c/unpack.c +++ b/ompi/mpi/c/unpack.c.in @@ -13,6 +13,8 @@ * Copyright (c) 2015-2018 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2021 IBM Corporation. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -30,19 +32,12 @@ #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, + COUNT insize, + COUNT_OUT position, + BUFFER_OUT outbuf, + COUNT 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 82% rename from ompi/mpi/c/unpack_external.c rename to ompi/mpi/c/unpack_external.c.in index 579f8b912f1..645031cfd32 100644 --- a/ompi/mpi/c/unpack_external.c +++ b/ompi/mpi/c/unpack_external.c.in @@ -15,6 +15,8 @@ * reserved. * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -31,19 +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_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_COUNT insize, + AINT_COUNT_OUT position, BUFFER_OUT outbuf, COUNT outcount, + DATATYPE datatype) { int rc = MPI_SUCCESS; @@ -66,8 +58,7 @@ int MPI_Unpack_external (const char datarep[], const void *inbuf, MPI_Aint insiz } rc = ompi_datatype_unpack_external(datarep, inbuf, insize, - position, outbuf, outcount, + (MPI_Aint *)position, outbuf, outcount, datatype); - OMPI_ERRHANDLER_NOHANDLE_RETURN(rc, rc, FUNC_NAME); } 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..ca4aa92f7a8 100644 --- a/ompi/mpi/c/unpublish_name.c +++ b/ompi/mpi/c/unpublish_name.c.in @@ -16,6 +16,8 @@ * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2015 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -36,18 +38,8 @@ #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 90% rename from ompi/mpi/c/wait.c rename to ompi/mpi/c/wait.c.in index 0145eb7187d..d2db5ab726f 100644 --- a/ompi/mpi/c/wait.c +++ b/ompi/mpi/c/wait.c.in @@ -12,6 +12,10 @@ * Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -29,17 +33,7 @@ #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 88% rename from ompi/mpi/c/waitall.c rename to ompi/mpi/c/waitall.c.in index ce2353dfc9b..b2f3c4fe7a1 100644 --- a/ompi/mpi/c/waitall.c +++ b/ompi/mpi/c/waitall.c.in @@ -14,15 +14,18 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. - * Copyright (c) 2021 Triad National Security, LLC. All rights + * Copyright (c) 2021-2024 Triad National Security, LLC. All rights * reserved. * Copyright (c) 2024 NVIDIA Corporation. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow * * $HEADER$ */ + #include "ompi_config.h" #include @@ -34,17 +37,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 88% rename from ompi/mpi/c/waitany.c rename to ompi/mpi/c/waitany.c.in index 83c7fdf2a9e..5d2fb4424eb 100644 --- a/ompi/mpi/c/waitany.c +++ b/ompi/mpi/c/waitany.c.in @@ -15,9 +15,11 @@ * reserved. * Copyright (c) 2014-2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. - * Copyright (c) 2021 Triad National Security, LLC. All rights + * Copyright (c) 2021-2024 Triad National Security, LLC. All rights * reserved. * Copyright (c) 2024 NVIDIA Corporation. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -35,17 +37,7 @@ #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 87% rename from ompi/mpi/c/waitsome.c rename to ompi/mpi/c/waitsome.c.in index 3b5b7ea3cc3..ce25d1f47e8 100644 --- a/ompi/mpi/c/waitsome.c +++ b/ompi/mpi/c/waitsome.c.in @@ -15,9 +15,11 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. - * Copyright (c) 2021 Triad National Security, LLC. All rights + * Copyright (c) 2021-2024 Triad National Security, LLC. All rights * reserved. * Copyright (c) 2024 NVIDIA Corporation. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -35,19 +37,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 78% rename from ompi/mpi/c/win_allocate.c rename to ompi/mpi/c/win_allocate.c.in index 6db2837a3a2..b1f40905b11 100644 --- a/ompi/mpi/c/win_allocate.c +++ b/ompi/mpi/c/win_allocate.c.in @@ -13,6 +13,8 @@ * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -31,18 +33,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 = 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, DISP disp_unit, INFO info, + COMM comm, BUFFER_OUT baseptr, WIN_OUT win) { int ret = MPI_SUCCESS; @@ -75,8 +67,22 @@ int MPI_Win_allocate(MPI_Aint size, int disp_unit, MPI_Info info, return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_COMM, FUNC_NAME); } +/* + * TODO:BIGCOUNT remove this check once ompi-rma supports bigcount + */ +#if OMPI_BIGCOUNT_SRC + OMPI_CHECK_MPI_COUNT_INT_CONVERSION_OVERFLOW(ret, disp_unit); + if (OMPI_SUCCESS != ret) { + *win = MPI_WIN_NULL; + return OMPI_ERRHANDLER_INVOKE(comm, ret, FUNC_NAME); + } +#endif + /* create window and return */ - ret = ompi_win_allocate((size_t)size, disp_unit, &(info->super), +/* + * TODO:BIGCOUNT remove (int) before disp_unit once ompi-rma supports bigcount + */ + ret = ompi_win_allocate((size_t)size, (int)disp_unit, &(info->super), comm, baseptr, win); if (OMPI_SUCCESS != ret) { *win = MPI_WIN_NULL; diff --git a/ompi/mpi/c/win_allocate_shared.c b/ompi/mpi/c/win_allocate_shared.c.in similarity index 77% rename from ompi/mpi/c/win_allocate_shared.c rename to ompi/mpi/c/win_allocate_shared.c.in index aa6b72c2fcb..bcec8b3a761 100644 --- a/ompi/mpi/c/win_allocate_shared.c +++ b/ompi/mpi/c/win_allocate_shared.c.in @@ -16,6 +16,8 @@ * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -34,18 +36,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, DISP disp_unit, INFO info, + COMM comm, BUFFER_OUT baseptr, WIN_OUT win) { int ret = MPI_SUCCESS; @@ -69,6 +61,16 @@ int MPI_Win_allocate_shared(MPI_Aint size, int disp_unit, MPI_Info info, } else if ( size < 0 ) { return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_SIZE, FUNC_NAME); } +/* + * TODO:BIGCOUNT remove this check once ompi-rma supports bigcount + */ +#if OMPI_BIGCOUNT_SRC + OMPI_CHECK_MPI_COUNT_INT_CONVERSION_OVERFLOW(ret, disp_unit); + if (OMPI_SUCCESS != ret) { + *win = MPI_WIN_NULL; + return OMPI_ERRHANDLER_INVOKE(comm, ret, FUNC_NAME); + } +#endif } /* communicator must be an intracommunicator */ @@ -77,7 +79,10 @@ int MPI_Win_allocate_shared(MPI_Aint size, int disp_unit, MPI_Info info, } /* create window and return */ - ret = ompi_win_allocate_shared((size_t)size, disp_unit, &(info->super), +/* + * TODO:BIGCOUNT remove (int) from disp_unit once ompi-rma supports bigcount + */ + ret = ompi_win_allocate_shared((size_t)size, (int)disp_unit, &(info->super), comm, baseptr, win); if (OMPI_SUCCESS != ret) { *win = MPI_WIN_NULL; 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..18529108967 100644 --- a/ompi/mpi/c/win_attach.c +++ b/ompi/mpi/c/win_attach.c.in @@ -12,6 +12,8 @@ * Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -30,16 +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_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..cb1e0fb0562 100644 --- a/ompi/mpi/c/win_c2f.c +++ b/ompi/mpi/c/win_c2f.c.in @@ -12,12 +12,15 @@ * Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow * * $HEADER$ */ + #include "ompi_config.h" #include @@ -28,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_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..644b0e5e93d 100644 --- a/ompi/mpi/c/win_call_errhandler.c +++ b/ompi/mpi/c/win_call_errhandler.c.in @@ -11,6 +11,8 @@ * All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -26,17 +28,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_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..a9fd3d2b2a9 100644 --- a/ompi/mpi/c/win_complete.c +++ b/ompi/mpi/c/win_complete.c.in @@ -11,6 +11,8 @@ * All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -27,17 +29,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_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 78% rename from ompi/mpi/c/win_create.c rename to ompi/mpi/c/win_create.c.in index 419ff3ddf9f..c737d22370f 100644 --- a/ompi/mpi/c/win_create.c +++ b/ompi/mpi/c/win_create.c.in @@ -13,6 +13,8 @@ * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -31,18 +33,8 @@ #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, DISP disp_unit, + INFO info, COMM comm, WIN_OUT win) { int ret = MPI_SUCCESS; @@ -68,6 +60,16 @@ int MPI_Win_create(void *base, MPI_Aint size, int disp_unit, } else if ( disp_unit <= 0 ) { return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_DISP, FUNC_NAME); } +/* + * TODO:BIGCOUNT remove this check once ompi-rma supports bigcount + */ +#if OMPI_BIGCOUNT_SRC + OMPI_CHECK_MPI_COUNT_INT_CONVERSION_OVERFLOW(ret, disp_unit); + if (OMPI_SUCCESS != ret) { + *win = MPI_WIN_NULL; + return OMPI_ERRHANDLER_INVOKE(comm, ret, FUNC_NAME); + } +#endif } /* communicator must be an intracommunicator */ @@ -75,8 +77,11 @@ int MPI_Win_create(void *base, MPI_Aint size, int disp_unit, return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_COMM, FUNC_NAME); } +/* + * TODO:BIGCOUNT remove (int) before disp_unit once ompi-rma supports bigcount + */ /* create window and return */ - ret = ompi_win_create(base, (size_t)size, disp_unit, comm, + ret = ompi_win_create(base, (size_t)size, (int)disp_unit, comm, &(info->super), win); if (OMPI_SUCCESS != ret) { *win = MPI_WIN_NULL; 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..f50a2d697ff 100644 --- a/ompi/mpi/c/win_create_dynamic.c +++ b/ompi/mpi/c/win_create_dynamic.c.in @@ -13,13 +13,14 @@ * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow * * $HEADER$ */ - #include "ompi_config.h" #include @@ -32,17 +33,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 81% rename from ompi/mpi/c/win_create_errhandler.c rename to ompi/mpi/c/win_create_errhandler.c.in index 16c9262ff4e..27a48e33aa4 100644 --- a/ompi/mpi/c/win_create_errhandler.c +++ b/ompi/mpi/c/win_create_errhandler.c.in @@ -13,7 +13,7 @@ * Copyright (c) 2008-2009 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. - * Copyright (c) 2018-2021 Triad National Security, LLC. All rights + * Copyright (c) 2018-2024 Triad National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -30,18 +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_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..f58401685bf 100644 --- a/ompi/mpi/c/win_create_keyval.c +++ b/ompi/mpi/c/win_create_keyval.c.in @@ -14,6 +14,8 @@ * and Technology (RIST). All rights reserved. * Copyright (c) 2022 Amazon.com, Inc. or its affiliates. * All Rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -29,19 +31,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..0baa3cc01c3 100644 --- a/ompi/mpi/c/win_delete_attr.c +++ b/ompi/mpi/c/win_delete_attr.c.in @@ -11,6 +11,8 @@ * All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -27,17 +29,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_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..e6b6836adec 100644 --- a/ompi/mpi/c/win_detach.c +++ b/ompi/mpi/c/win_detach.c.in @@ -12,6 +12,8 @@ * Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -30,16 +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_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..e71ad6831b6 100644 --- a/ompi/mpi/c/win_fence.c +++ b/ompi/mpi/c/win_fence.c.in @@ -14,6 +14,8 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -30,17 +32,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..01a78419822 100644 --- a/ompi/mpi/c/win_flush.c +++ b/ompi/mpi/c/win_flush.c.in @@ -12,6 +12,8 @@ * Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -30,16 +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_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..559d99926f6 100644 --- a/ompi/mpi/c/win_flush_all.c +++ b/ompi/mpi/c/win_flush_all.c.in @@ -12,6 +12,8 @@ * Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -30,16 +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_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..a61afa2542e 100644 --- a/ompi/mpi/c/win_flush_local.c +++ b/ompi/mpi/c/win_flush_local.c.in @@ -12,6 +12,8 @@ * Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -30,16 +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_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..5d43b5b4bcf 100644 --- a/ompi/mpi/c/win_flush_local_all.c +++ b/ompi/mpi/c/win_flush_local_all.c.in @@ -12,6 +12,8 @@ * Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -30,16 +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_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..fb8604f6688 100644 --- a/ompi/mpi/c/win_free.c +++ b/ompi/mpi/c/win_free.c.in @@ -11,6 +11,8 @@ * All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -26,17 +28,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_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..8b7b5448cac 100644 --- a/ompi/mpi/c/win_free_keyval.c +++ b/ompi/mpi/c/win_free_keyval.c.in @@ -11,6 +11,8 @@ * All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -26,17 +28,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..bcca259625c 100644 --- a/ompi/mpi/c/win_get_attr.c +++ b/ompi/mpi/c/win_get_attr.c.in @@ -14,6 +14,8 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -30,18 +32,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 85% rename from ompi/mpi/c/win_get_errhandler.c rename to ompi/mpi/c/win_get_errhandler.c.in index 292f3c706af..8a027da4fd1 100644 --- a/ompi/mpi/c/win_get_errhandler.c +++ b/ompi/mpi/c/win_get_errhandler.c.in @@ -15,7 +15,7 @@ * and Technology (RIST). All rights reserved. * Copyright (c) 2016 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2020 Triad National Security, LLC. All rights + * Copyright (c) 2020-2024 Triad National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -33,17 +33,7 @@ #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..5330d2dbbec 100644 --- a/ompi/mpi/c/win_get_group.c +++ b/ompi/mpi/c/win_get_group.c.in @@ -11,6 +11,8 @@ * All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -26,17 +28,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_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..abd1622756f 100644 --- a/ompi/mpi/c/win_get_info.c +++ b/ompi/mpi/c/win_get_info.c.in @@ -6,6 +6,8 @@ * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2016-2017 IBM Corporation. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -22,16 +24,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..49ab8b8fd75 100644 --- a/ompi/mpi/c/win_get_name.c +++ b/ompi/mpi/c/win_get_name.c.in @@ -12,6 +12,8 @@ * Copyright (c) 2008 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -27,17 +29,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..34aa454026b 100644 --- a/ompi/mpi/c/win_lock.c +++ b/ompi/mpi/c/win_lock.c.in @@ -14,6 +14,8 @@ * reserved. * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -30,17 +32,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 = 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..3dde356ec4d 100644 --- a/ompi/mpi/c/win_lock_all.c +++ b/ompi/mpi/c/win_lock_all.c.in @@ -11,6 +11,8 @@ * All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -27,17 +29,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..be0587aacd5 100644 --- a/ompi/mpi/c/win_post.c +++ b/ompi/mpi/c/win_post.c.in @@ -11,6 +11,8 @@ * All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -27,17 +29,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_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..0776b8b1966 100644 --- a/ompi/mpi/c/win_set_attr.c +++ b/ompi/mpi/c/win_set_attr.c.in @@ -11,6 +11,8 @@ * All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -27,17 +29,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..80a71e34aad 100644 --- a/ompi/mpi/c/win_set_errhandler.c +++ b/ompi/mpi/c/win_set_errhandler.c.in @@ -15,6 +15,8 @@ * and Technology (RIST). All rights reserved. * Copyright (c) 2016-2017 Los Alamos National Security, LLC. All rights * reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -30,17 +32,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_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..d1b376ca305 100644 --- a/ompi/mpi/c/win_set_info.c +++ b/ompi/mpi/c/win_set_info.c.in @@ -3,6 +3,8 @@ * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2016-2017 IBM Corporation. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -19,17 +21,7 @@ #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..fdbd842fe57 100644 --- a/ompi/mpi/c/win_set_name.c +++ b/ompi/mpi/c/win_set_name.c.in @@ -15,6 +15,8 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -30,17 +32,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..ad88189428f 100644 --- a/ompi/mpi/c/win_shared_query.c +++ b/ompi/mpi/c/win_shared_query.c.in @@ -5,6 +5,8 @@ * Copyright (c) 2024 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -22,17 +24,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_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_AINT_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..ae7254c8f10 100644 --- a/ompi/mpi/c/win_start.c +++ b/ompi/mpi/c/win_start.c.in @@ -11,6 +11,8 @@ * All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -27,17 +29,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..ad28415a559 100644 --- a/ompi/mpi/c/win_sync.c +++ b/ompi/mpi/c/win_sync.c.in @@ -12,6 +12,8 @@ * Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -30,16 +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_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..b3cb93a155b 100644 --- a/ompi/mpi/c/win_test.c +++ b/ompi/mpi/c/win_test.c.in @@ -11,6 +11,8 @@ * All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -27,17 +29,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..7beaa304b00 100644 --- a/ompi/mpi/c/win_unlock.c +++ b/ompi/mpi/c/win_unlock.c.in @@ -14,6 +14,8 @@ * reserved. * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -30,17 +32,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_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..a3d0b094f75 100644 --- a/ompi/mpi/c/win_unlock_all.c +++ b/ompi/mpi/c/win_unlock_all.c.in @@ -11,6 +11,8 @@ * All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -27,17 +29,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_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..7ad43c67337 100644 --- a/ompi/mpi/c/win_wait.c +++ b/ompi/mpi/c/win_wait.c.in @@ -11,6 +11,8 @@ * All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -27,17 +29,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_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 91% rename from ompi/mpi/c/wtime.c rename to ompi/mpi/c/wtime.c.in index 1d7c672de59..e60041aad71 100644 --- a/ompi/mpi/c/wtime.c +++ b/ompi/mpi/c/wtime.c.in @@ -16,6 +16,8 @@ * Copyright (c) 2017 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2024 NVIDIA Corporation. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -39,19 +41,17 @@ #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 -#endif /** * Use this as a base time set early during MPI initialization 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 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..f95d65dc858 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, (const void *) data) #else #define OMPI_COUNT_ARRAY_INIT(array, data) \ do { \ From ff4352ca0c7d68a117fd18e5eb85488096685f6a Mon Sep 17 00:00:00 2001 From: Jake Tronge Date: Mon, 12 Aug 2024 09:51:15 -0600 Subject: [PATCH 2/3] Generate mpi_f08 bindings and add CFI support This updates fortran/use-mpi-f08 to generate most of the Fortran bindings from a script and template files. It also adds support for Fortran TS 29113 when possible, allowing for better Fortran array handling that matches the standard. The C files were imported from PR #10302 and converted to templates to be fed into the binding script. Co-authored-by: Gilles Gouaillardet Co-authored-by: Howard Pritchard Signed-off-by: Jake Tronge --- .gitignore | 1 + config/ompi_config_files.m4 | 1 - ompi/mpi/bindings/ompi_bindings/fortran.py | 3 +- .../bindings/ompi_bindings/fortran_type.py | 290 +- ompi/mpi/bindings/ompi_bindings/parser.py | 2 +- ompi/mpi/bindings/ompi_bindings/util.py | 3 + ompi/mpi/c/wtime.c.in | 4 - ompi/mpi/fortran/base/fint_2_int.h | 22 +- .../mpi/fortran/configure-fortran-output.h.in | 3 + .../fortran/mpif-h/type_get_envelope_f_c.c | 53 + ompi/mpi/fortran/use-mpi-f08/Makefile.am | 267 +- .../use-mpi-f08/Makefile.prototype_files | 169 ++ .../fortran/use-mpi-f08/accumulate_f08.F90 | 35 - .../fortran/use-mpi-f08/accumulate_ts.c.in | 56 + .../mpi/fortran/use-mpi-f08/allgather_f08.F90 | 31 - .../use-mpi-f08/allgather_init_f08.F90 | 34 - .../use-mpi-f08/allgather_init_ts.c.in | 79 + .../mpi/fortran/use-mpi-f08/allgather_ts.c.in | 71 + .../fortran/use-mpi-f08/allgatherv_f08.F90 | 33 - .../use-mpi-f08/allgatherv_init_f08.F90 | 36 - .../use-mpi-f08/allgatherv_init_ts.c.in | 100 + .../fortran/use-mpi-f08/allgatherv_ts.c.in | 93 + .../mpi/fortran/use-mpi-f08/allreduce_f08.F90 | 31 - .../use-mpi-f08/allreduce_init_f08.F90 | 34 - .../use-mpi-f08/allreduce_init_ts.c.in | 63 + .../mpi/fortran/use-mpi-f08/allreduce_ts.c.in | 58 + ompi/mpi/fortran/use-mpi-f08/alltoall_f08.F90 | 32 - .../fortran/use-mpi-f08/alltoall_init_f08.F90 | 35 - .../fortran/use-mpi-f08/alltoall_init_ts.c.in | 72 + ompi/mpi/fortran/use-mpi-f08/alltoall_ts.c.in | 66 + .../mpi/fortran/use-mpi-f08/alltoallv_f08.F90 | 32 - .../use-mpi-f08/alltoallv_init_f08.F90 | 35 - .../use-mpi-f08/alltoallv_init_ts.c.in | 90 + .../mpi/fortran/use-mpi-f08/alltoallv_ts.c.in | 81 + .../mpi/fortran/use-mpi-f08/alltoallw_f08.F90 | 42 - .../use-mpi-f08/alltoallw_init_f08.F90 | 44 - .../use-mpi-f08/alltoallw_init_ts.c.in | 99 + .../mpi/fortran/use-mpi-f08/alltoallw_ts.c.in | 92 + ompi/mpi/fortran/use-mpi-f08/base/Makefile.am | 35 +- ompi/mpi/fortran/use-mpi-f08/base/bigcount.h | 36 + .../fortran/use-mpi-f08/base/buffer_detach.c | 77 - .../base/ompi_type_get_contents_f_c.c | 126 + .../base/ompi_type_get_envelope_f_c.c | 62 + .../base/ompi_type_get_extent_f_c.c | 42 + ompi/mpi/fortran/use-mpi-f08/base/ts.c | 138 + ompi/mpi/fortran/use-mpi-f08/base/ts.h | 158 + ompi/mpi/fortran/use-mpi-f08/bcast_f08.F90 | 29 - .../fortran/use-mpi-f08/bcast_init_f08.F90 | 31 - .../fortran/use-mpi-f08/bcast_init_ts.c.in | 61 + ompi/mpi/fortran/use-mpi-f08/bcast_ts.c.in | 53 + ompi/mpi/fortran/use-mpi-f08/bindings.h | 219 ++ .../bindings/mpi-f-interfaces-bind.h | 26 + ompi/mpi/fortran/use-mpi-f08/bsend_f08.F90 | 28 - .../fortran/use-mpi-f08/bsend_init_f08.F90 | 32 - .../fortran/use-mpi-f08/bsend_init_ts.c.in | 55 + ompi/mpi/fortran/use-mpi-f08/bsend_ts.c.in | 47 + .../fortran/use-mpi-f08/buffer_attach_f08.F90 | 26 - .../fortran/use-mpi-f08/buffer_attach_ts.c.in | 34 + .../fortran/use-mpi-f08/buffer_detach.c.in | 37 + .../fortran/use-mpi-f08/buffer_detach_f08.F90 | 27 - .../use-mpi-f08/compare_and_swap_f08.F90 | 33 - .../use-mpi-f08/compare_and_swap_ts.c.in | 60 + ompi/mpi/fortran/use-mpi-f08/exscan_f08.F90 | 31 - .../fortran/use-mpi-f08/exscan_init_f08.F90 | 34 - .../fortran/use-mpi-f08/exscan_init_ts.c.in | 63 + ompi/mpi/fortran/use-mpi-f08/exscan_ts.c.in | 56 + .../fortran/use-mpi-f08/f_sync_reg_ts.c.in | 29 + .../fortran/use-mpi-f08/fetch_and_op_f08.F90 | 33 - .../fortran/use-mpi-f08/fetch_and_op_ts.c.in | 55 + .../use-mpi-f08/file_iread_all_f08.F90 | 29 - .../use-mpi-f08/file_iread_all_ts.c.in | 53 + .../use-mpi-f08/file_iread_at_all_f08.F90 | 31 - .../use-mpi-f08/file_iread_at_all_ts.c.in | 55 + .../fortran/use-mpi-f08/file_iread_at_ts.c.in | 55 + .../fortran/use-mpi-f08/file_iread_f08.F90 | 29 - .../use-mpi-f08/file_iread_shared_f08.F90 | 30 - .../use-mpi-f08/file_iread_shared_ts.c.in | 54 + .../fortran/use-mpi-f08/file_iread_ts.c.in | 53 + .../use-mpi-f08/file_iwrite_all_f08.F90 | 30 - .../use-mpi-f08/file_iwrite_all_ts.c.in | 53 + .../use-mpi-f08/file_iwrite_at_all_f08.F90 | 31 - .../use-mpi-f08/file_iwrite_at_all_ts.c.in | 56 + .../use-mpi-f08/file_iwrite_at_f08.F90 | 31 - .../use-mpi-f08/file_iwrite_at_ts.c.in | 56 + .../fortran/use-mpi-f08/file_iwrite_f08.F90 | 30 - .../use-mpi-f08/file_iwrite_shared_f08.F90 | 30 - .../use-mpi-f08/file_iwrite_shared_ts.c.in | 52 + .../fortran/use-mpi-f08/file_iwrite_ts.c.in | 52 + .../use-mpi-f08/file_read_all_begin_f08.F90 | 28 - .../use-mpi-f08/file_read_all_begin_ts.c.in | 46 + .../use-mpi-f08/file_read_all_end_f08.F90 | 27 - .../use-mpi-f08/file_read_all_end_ts.c.in | 39 + .../fortran/use-mpi-f08/file_read_all_f08.F90 | 29 - .../fortran/use-mpi-f08/file_read_all_ts.c.in | 53 + .../file_read_at_all_begin_f08.F90 | 30 - .../file_read_at_all_begin_ts.c.in | 48 + .../use-mpi-f08/file_read_at_all_end_f08.F90 | 27 - .../use-mpi-f08/file_read_at_all_end_ts.c.in | 39 + .../use-mpi-f08/file_read_at_all_f08.F90 | 31 - .../use-mpi-f08/file_read_at_all_ts.c.in | 54 + .../fortran/use-mpi-f08/file_read_at_f08.F90 | 30 - .../fortran/use-mpi-f08/file_read_at_ts.c.in | 54 + .../file_read_ordered_begin_f08.F90 | 28 - .../file_read_ordered_begin_ts.c.in | 46 + .../use-mpi-f08/file_read_ordered_end_f08.F90 | 27 - .../use-mpi-f08/file_read_ordered_end_ts.c.in | 38 + .../use-mpi-f08/file_read_ordered_f08.F90 | 30 - .../use-mpi-f08/file_read_ordered_ts.c.in | 53 + .../use-mpi-f08/file_read_shared_f08.F90 | 29 - .../use-mpi-f08/file_read_shared_ts.c.in | 53 + .../mpi/fortran/use-mpi-f08/file_read_ts.c.in | 53 + .../use-mpi-f08/file_write_all_begin_f08.F90 | 28 - .../use-mpi-f08/file_write_all_begin_ts.c.in | 46 + .../use-mpi-f08/file_write_all_end_f08.F90 | 27 - .../use-mpi-f08/file_write_all_end_ts.c.in | 39 + .../use-mpi-f08/file_write_all_f08.F90 | 30 - .../use-mpi-f08/file_write_all_ts.c.in | 53 + .../file_write_at_all_begin_f08.F90 | 30 - .../file_write_at_all_begin_ts.c.in | 48 + .../use-mpi-f08/file_write_at_all_end_f08.F90 | 27 - .../use-mpi-f08/file_write_at_all_end_ts.c.in | 39 + .../use-mpi-f08/file_write_at_all_f08.F90 | 31 - .../use-mpi-f08/file_write_at_all_ts.c.in | 54 + .../fortran/use-mpi-f08/file_write_at_f08.F90 | 31 - .../fortran/use-mpi-f08/file_write_at_ts.c.in | 54 + .../fortran/use-mpi-f08/file_write_f08.F90 | 30 - .../file_write_ordered_begin_f08.F90 | 28 - .../file_write_ordered_begin_ts.c.in | 46 + .../file_write_ordered_end_f08.F90 | 27 - .../file_write_ordered_end_ts.c.in | 39 + .../use-mpi-f08/file_write_ordered_f08.F90 | 30 - .../use-mpi-f08/file_write_ordered_ts.c.in | 53 + .../use-mpi-f08/file_write_shared_f08.F90 | 30 - .../use-mpi-f08/file_write_shared_ts.c.in | 53 + .../fortran/use-mpi-f08/file_write_ts.c.in | 54 + ompi/mpi/fortran/use-mpi-f08/free_mem_f08.F90 | 22 - ompi/mpi/fortran/use-mpi-f08/free_mem_ts.c.in | 34 + ompi/mpi/fortran/use-mpi-f08/gather_f08.F90 | 32 - .../fortran/use-mpi-f08/gather_init_f08.F90 | 35 - .../fortran/use-mpi-f08/gather_init_ts.c.in | 96 + ompi/mpi/fortran/use-mpi-f08/gather_ts.c.in | 98 + ompi/mpi/fortran/use-mpi-f08/gatherv_f08.F90 | 33 - .../fortran/use-mpi-f08/gatherv_init_f08.F90 | 36 - .../fortran/use-mpi-f08/gatherv_init_ts.c.in | 118 + ompi/mpi/fortran/use-mpi-f08/gatherv_ts.c.in | 102 + .../use-mpi-f08/get_accumulate_f08.F90 | 39 - .../use-mpi-f08/get_accumulate_ts.c.in | 77 + .../fortran/use-mpi-f08/get_address_f08.F90 | 26 - .../fortran/use-mpi-f08/get_address_ts.c.in | 35 + ompi/mpi/fortran/use-mpi-f08/get_count.c.in | 44 + .../mpi/fortran/use-mpi-f08/get_count_f08.F90 | 25 - .../mpi/fortran/use-mpi-f08/get_elements.c.in | 44 + .../fortran/use-mpi-f08/get_elements_f08.F90 | 25 - ompi/mpi/fortran/use-mpi-f08/get_f08.F90 | 32 - ompi/mpi/fortran/use-mpi-f08/get_ts.c.in | 53 + .../fortran/use-mpi-f08/iallgather_f08.F90 | 32 - .../fortran/use-mpi-f08/iallgather_ts.c.in | 70 + .../fortran/use-mpi-f08/iallgatherv_f08.F90 | 34 - .../fortran/use-mpi-f08/iallgatherv_ts.c.in | 96 + .../fortran/use-mpi-f08/iallreduce_f08.F90 | 32 - .../fortran/use-mpi-f08/iallreduce_ts.c.in | 60 + .../mpi/fortran/use-mpi-f08/ialltoall_f08.F90 | 33 - .../mpi/fortran/use-mpi-f08/ialltoall_ts.c.in | 67 + .../fortran/use-mpi-f08/ialltoallv_f08.F90 | 33 - .../fortran/use-mpi-f08/ialltoallv_ts.c.in | 84 + .../fortran/use-mpi-f08/ialltoallw_f08.F90 | 43 - .../fortran/use-mpi-f08/ialltoallw_ts.c.in | 93 + ompi/mpi/fortran/use-mpi-f08/ibcast_f08.F90 | 30 - ompi/mpi/fortran/use-mpi-f08/ibcast_ts.c.in | 58 + ompi/mpi/fortran/use-mpi-f08/ibsend_f08.F90 | 29 - ompi/mpi/fortran/use-mpi-f08/ibsend_ts.c.in | 55 + ompi/mpi/fortran/use-mpi-f08/iexscan_f08.F90 | 32 - ompi/mpi/fortran/use-mpi-f08/iexscan_ts.c.in | 59 + ompi/mpi/fortran/use-mpi-f08/igather_f08.F90 | 33 - ompi/mpi/fortran/use-mpi-f08/igather_ts.c.in | 93 + ompi/mpi/fortran/use-mpi-f08/igatherv_f08.F90 | 34 - ompi/mpi/fortran/use-mpi-f08/igatherv_ts.c.in | 101 + ompi/mpi/fortran/use-mpi-f08/imrecv_f08.F90 | 29 - ompi/mpi/fortran/use-mpi-f08/imrecv_ts.c.in | 56 + .../use-mpi-f08/ineighbor_allgather_f08.F90 | 33 - .../use-mpi-f08/ineighbor_allgather_ts.c.in | 70 + .../use-mpi-f08/ineighbor_allgatherv_f08.F90 | 35 - .../use-mpi-f08/ineighbor_allgatherv_ts.c.in | 78 + .../use-mpi-f08/ineighbor_alltoall_f08.F90 | 34 - .../use-mpi-f08/ineighbor_alltoall_ts.c.in | 66 + .../use-mpi-f08/ineighbor_alltoallv_f08.F90 | 35 - .../use-mpi-f08/ineighbor_alltoallv_ts.c.in | 83 + .../use-mpi-f08/ineighbor_alltoallw_f08.F90 | 35 - .../use-mpi-f08/ineighbor_alltoallw_ts.c.in | 86 + ompi/mpi/fortran/use-mpi-f08/irecv_ts.c.in | 54 + ompi/mpi/fortran/use-mpi-f08/ireduce_f08.F90 | 32 - .../use-mpi-f08/ireduce_scatter_block_f08.F90 | 32 - .../use-mpi-f08/ireduce_scatter_block_ts.c.in | 63 + .../use-mpi-f08/ireduce_scatter_f08.F90 | 32 - .../use-mpi-f08/ireduce_scatter_ts.c.in | 66 + ompi/mpi/fortran/use-mpi-f08/ireduce_ts.c.in | 62 + ompi/mpi/fortran/use-mpi-f08/irsend_f08.F90 | 29 - ompi/mpi/fortran/use-mpi-f08/irsend_ts.c.in | 54 + ompi/mpi/fortran/use-mpi-f08/iscan_f08.F90 | 32 - ompi/mpi/fortran/use-mpi-f08/iscan_ts.c.in | 61 + ompi/mpi/fortran/use-mpi-f08/iscatter_f08.F90 | 33 - ompi/mpi/fortran/use-mpi-f08/iscatter_ts.c.in | 97 + .../mpi/fortran/use-mpi-f08/iscatterv_f08.F90 | 34 - .../mpi/fortran/use-mpi-f08/iscatterv_ts.c.in | 111 + ompi/mpi/fortran/use-mpi-f08/isend_ts.c.in | 54 + .../mpi/fortran/use-mpi-f08/isendrecv_f08.F90 | 36 - .../use-mpi-f08/isendrecv_replace_f08.F90 | 34 - .../use-mpi-f08/isendrecv_replace_ts.c.in | 60 + .../mpi/fortran/use-mpi-f08/isendrecv_ts.c.in | 75 + ompi/mpi/fortran/use-mpi-f08/issend_f08.F90 | 29 - ompi/mpi/fortran/use-mpi-f08/issend_ts.c.in | 54 + ompi/mpi/fortran/use-mpi-f08/mod/Makefile.am | 27 +- .../use-mpi-f08/mod/mpi-f08-interfaces.F90 | 1 + .../use-mpi-f08/mod/mpi-f08-interfaces.h.in | 2659 +---------------- .../fortran/use-mpi-f08/mod/mpi-f08-rename.h | 1408 ++++----- ompi/mpi/fortran/use-mpi-f08/mrecv_f08.F90 | 29 - ompi/mpi/fortran/use-mpi-f08/mrecv_ts.c.in | 60 + .../use-mpi-f08/neighbor_allgather_f08.F90 | 32 - .../neighbor_allgather_init_f08.F90 | 34 - .../neighbor_allgather_init_ts.c.in | 82 + .../use-mpi-f08/neighbor_allgather_ts.c.in | 73 + .../use-mpi-f08/neighbor_allgatherv_f08.F90 | 34 - .../neighbor_allgatherv_init_f08.F90 | 36 - .../neighbor_allgatherv_init_ts.c.in | 92 + .../use-mpi-f08/neighbor_allgatherv_ts.c.in | 81 + .../use-mpi-f08/neighbor_alltoall_f08.F90 | 33 - .../neighbor_alltoall_init_f08.F90 | 35 - .../neighbor_alltoall_init_ts.c.in | 73 + .../use-mpi-f08/neighbor_alltoall_ts.c.in | 63 + .../use-mpi-f08/neighbor_alltoallv_f08.F90 | 34 - .../neighbor_alltoallv_init_f08.F90 | 36 - .../neighbor_alltoallv_init_ts.c.in | 97 + .../use-mpi-f08/neighbor_alltoallv_ts.c.in | 80 + .../use-mpi-f08/neighbor_alltoallw_f08.F90 | 34 - .../neighbor_alltoallw_init_f08.F90 | 36 - .../neighbor_alltoallw_init_ts.c.in | 107 + .../use-mpi-f08/neighbor_alltoallw_ts.c.in | 84 + .../fortran/use-mpi-f08/pack_external_f08.F90 | 34 - .../use-mpi-f08/pack_external_size.c.in | 34 + .../use-mpi-f08/pack_external_size_f08.F90 | 26 - .../fortran/use-mpi-f08/pack_external_ts.c.in | 60 + ompi/mpi/fortran/use-mpi-f08/pack_f08.F90 | 32 - ompi/mpi/fortran/use-mpi-f08/pack_size.c.in | 43 + .../mpi/fortran/use-mpi-f08/pack_size_f08.F90 | 26 - ompi/mpi/fortran/use-mpi-f08/pack_ts.c.in | 69 + .../fortran/use-mpi-f08/precv_init_f08.F90 | 36 - .../fortran/use-mpi-f08/precv_init_ts.c.in | 55 + .../fortran/use-mpi-f08/profile/Makefile.am | 481 --- .../profile/pcomm_create_from_group_f08.F90 | 29 - .../profile/pgroup_from_session_pset_f08.F90 | 29 - .../pintercomm_create_from_groups_f08.F90 | 35 - .../profile/psession_finalize_f08.F90 | 24 - .../fortran/use-mpi-f08/psend_init_f08.F90 | 35 - .../fortran/use-mpi-f08/psend_init_ts.c.in | 55 + ompi/mpi/fortran/use-mpi-f08/put_f08.F90 | 32 - ompi/mpi/fortran/use-mpi-f08/put_ts.c.in | 53 + .../fortran/use-mpi-f08/raccumulate_f08.F90 | 36 - .../fortran/use-mpi-f08/raccumulate_ts.c.in | 66 + ompi/mpi/fortran/use-mpi-f08/recv_f08.F90 | 29 - .../mpi/fortran/use-mpi-f08/recv_init_f08.F90 | 30 - .../mpi/fortran/use-mpi-f08/recv_init_ts.c.in | 55 + ompi/mpi/fortran/use-mpi-f08/recv_ts.c.in | 56 + ompi/mpi/fortran/use-mpi-f08/reduce_f08.F90 | 31 - .../fortran/use-mpi-f08/reduce_init_f08.F90 | 34 - .../fortran/use-mpi-f08/reduce_init_ts.c.in | 70 + .../fortran/use-mpi-f08/reduce_local_f08.F90 | 29 - .../fortran/use-mpi-f08/reduce_local_ts.c.in | 55 + .../use-mpi-f08/reduce_scatter_block_f08.F90 | 31 - .../reduce_scatter_block_init_f08.F90 | 34 - .../reduce_scatter_block_init_ts.c.in | 70 + .../use-mpi-f08/reduce_scatter_block_ts.c.in | 60 + .../use-mpi-f08/reduce_scatter_f08.F90 | 31 - .../use-mpi-f08/reduce_scatter_init_f08.F90 | 34 - .../use-mpi-f08/reduce_scatter_init_ts.c.in | 84 + .../use-mpi-f08/reduce_scatter_ts.c.in | 64 + ompi/mpi/fortran/use-mpi-f08/reduce_ts.c.in | 60 + .../use-mpi-f08/rget_accumulate_f08.F90 | 40 - .../use-mpi-f08/rget_accumulate_ts.c.in | 83 + ompi/mpi/fortran/use-mpi-f08/rget_f08.F90 | 34 - ompi/mpi/fortran/use-mpi-f08/rget_ts.c.in | 61 + ompi/mpi/fortran/use-mpi-f08/rput_f08.F90 | 34 - ompi/mpi/fortran/use-mpi-f08/rput_ts.c.in | 61 + ompi/mpi/fortran/use-mpi-f08/rsend_f08.F90 | 28 - .../fortran/use-mpi-f08/rsend_init_f08.F90 | 29 - .../fortran/use-mpi-f08/rsend_init_ts.c.in | 56 + ompi/mpi/fortran/use-mpi-f08/rsend_ts.c.in | 48 + ompi/mpi/fortran/use-mpi-f08/scan_f08.F90 | 31 - .../mpi/fortran/use-mpi-f08/scan_init_f08.F90 | 34 - .../mpi/fortran/use-mpi-f08/scan_init_ts.c.in | 69 + ompi/mpi/fortran/use-mpi-f08/scan_ts.c.in | 58 + ompi/mpi/fortran/use-mpi-f08/scatter_f08.F90 | 32 - .../fortran/use-mpi-f08/scatter_init_f08.F90 | 35 - .../fortran/use-mpi-f08/scatter_init_ts.c.in | 101 + ompi/mpi/fortran/use-mpi-f08/scatter_ts.c.in | 92 + ompi/mpi/fortran/use-mpi-f08/scatterv_f08.F90 | 33 - .../fortran/use-mpi-f08/scatterv_init_f08.F90 | 36 - .../fortran/use-mpi-f08/scatterv_init_ts.c.in | 125 + ompi/mpi/fortran/use-mpi-f08/scatterv_ts.c.in | 102 + ompi/mpi/fortran/use-mpi-f08/send_f08.F90 | 28 - .../mpi/fortran/use-mpi-f08/send_init_f08.F90 | 30 - .../mpi/fortran/use-mpi-f08/send_init_ts.c.in | 55 + ompi/mpi/fortran/use-mpi-f08/send_ts.c.in | 47 + ompi/mpi/fortran/use-mpi-f08/sendrecv_f08.F90 | 34 - .../use-mpi-f08/sendrecv_replace_f08.F90 | 32 - .../use-mpi-f08/sendrecv_replace_ts.c.in | 61 + ompi/mpi/fortran/use-mpi-f08/sendrecv_ts.c.in | 77 + ompi/mpi/fortran/use-mpi-f08/ssend_f08.F90 | 28 - .../fortran/use-mpi-f08/ssend_init_f08.F90 | 30 - .../fortran/use-mpi-f08/ssend_init_ts.c.in | 54 + ompi/mpi/fortran/use-mpi-f08/ssend_ts.c.in | 49 + .../use-mpi-f08/status_set_elements_c.in | 48 + .../use-mpi-f08/status_set_elements_f08.F90 | 25 - ompi/mpi/fortran/use-mpi-f08/testany.c.in | 81 + .../fortran/use-mpi-f08/type_contiguous.c.in | 37 + .../use-mpi-f08/type_contiguous_f08.F90 | 25 - .../use-mpi-f08/type_create_darray.c.in | 61 + .../use-mpi-f08/type_create_darray_f08.F90 | 30 - .../use-mpi-f08/type_create_hindexed.c.in | 48 + .../type_create_hindexed_block.c.in | 34 + .../type_create_hindexed_block_f08.F90 | 30 - .../use-mpi-f08/type_create_hindexed_f08.F90 | 30 - .../use-mpi-f08/type_create_hvector.c.in | 41 + .../use-mpi-f08/type_create_hvector_f08.F90 | 27 - .../type_create_indexed_block.c.in | 47 + .../type_create_indexed_block_f08.F90 | 28 - .../use-mpi-f08/type_create_struct.c.in | 61 + .../use-mpi-f08/type_create_struct_f08.F90 | 29 - .../use-mpi-f08/type_create_subarray.c.in | 56 + .../use-mpi-f08/type_create_subarray_f08.F90 | 29 - .../use-mpi-f08/type_get_contents_f08_c.F90 | 33 + .../use-mpi-f08/type_get_envelope_f08_c.F90 | 28 + .../use-mpi-f08/type_get_true_extent.c.in | 31 + .../use-mpi-f08/type_get_true_extent_f08.F90 | 24 - .../mpi/fortran/use-mpi-f08/type_indexed.c.in | 49 + .../fortran/use-mpi-f08/type_indexed_f08.F90 | 28 - ompi/mpi/fortran/use-mpi-f08/type_size.c.in | 36 + .../mpi/fortran/use-mpi-f08/type_size_f08.F90 | 24 - ompi/mpi/fortran/use-mpi-f08/type_vector.c.in | 43 + .../fortran/use-mpi-f08/type_vector_f08.F90 | 26 - .../use-mpi-f08/unpack_external_f08.F90 | 33 - .../use-mpi-f08/unpack_external_ts.c.in | 61 + ompi/mpi/fortran/use-mpi-f08/unpack_f08.F90 | 32 - ompi/mpi/fortran/use-mpi-f08/unpack_ts.c.in | 64 + ompi/mpi/fortran/use-mpi-f08/waitall.c.in | 66 + ompi/mpi/fortran/use-mpi-f08/waitall_f08.F90 | 25 - .../mpi/fortran/use-mpi-f08/win_allocate.c.in | 41 + .../fortran/use-mpi-f08/win_allocate_f08.F90 | 32 - .../use-mpi-f08/win_allocate_shared.c.in | 41 + .../use-mpi-f08/win_allocate_shared_f08.F90 | 30 - .../fortran/use-mpi-f08/win_attach_f08.F90 | 25 - .../fortran/use-mpi-f08/win_attach_ts.c.in | 26 + .../fortran/use-mpi-f08/win_create_f08.F90 | 32 - .../fortran/use-mpi-f08/win_create_ts.c.in | 48 + .../fortran/use-mpi-f08/win_detach_ts.c.in | 26 + .../fortran/use-mpi-f08/win_shared_query.c.in | 37 + .../use-mpi-f08/win_shared_query_f08.F90 | 29 - 356 files changed, 12600 insertions(+), 9066 deletions(-) create mode 100644 ompi/mpi/fortran/mpif-h/type_get_envelope_f_c.c create mode 100644 ompi/mpi/fortran/use-mpi-f08/Makefile.prototype_files delete mode 100644 ompi/mpi/fortran/use-mpi-f08/accumulate_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/accumulate_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/allgather_f08.F90 delete mode 100644 ompi/mpi/fortran/use-mpi-f08/allgather_init_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/allgather_init_ts.c.in create mode 100644 ompi/mpi/fortran/use-mpi-f08/allgather_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/allgatherv_f08.F90 delete mode 100644 ompi/mpi/fortran/use-mpi-f08/allgatherv_init_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/allgatherv_init_ts.c.in create mode 100644 ompi/mpi/fortran/use-mpi-f08/allgatherv_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/allreduce_f08.F90 delete mode 100644 ompi/mpi/fortran/use-mpi-f08/allreduce_init_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/allreduce_init_ts.c.in create mode 100644 ompi/mpi/fortran/use-mpi-f08/allreduce_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/alltoall_f08.F90 delete mode 100644 ompi/mpi/fortran/use-mpi-f08/alltoall_init_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/alltoall_init_ts.c.in create mode 100644 ompi/mpi/fortran/use-mpi-f08/alltoall_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/alltoallv_f08.F90 delete mode 100644 ompi/mpi/fortran/use-mpi-f08/alltoallv_init_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/alltoallv_init_ts.c.in create mode 100644 ompi/mpi/fortran/use-mpi-f08/alltoallv_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/alltoallw_f08.F90 delete mode 100644 ompi/mpi/fortran/use-mpi-f08/alltoallw_init_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/alltoallw_init_ts.c.in create mode 100644 ompi/mpi/fortran/use-mpi-f08/alltoallw_ts.c.in create mode 100644 ompi/mpi/fortran/use-mpi-f08/base/bigcount.h delete mode 100644 ompi/mpi/fortran/use-mpi-f08/base/buffer_detach.c create mode 100644 ompi/mpi/fortran/use-mpi-f08/base/ompi_type_get_contents_f_c.c create mode 100644 ompi/mpi/fortran/use-mpi-f08/base/ompi_type_get_envelope_f_c.c create mode 100644 ompi/mpi/fortran/use-mpi-f08/base/ompi_type_get_extent_f_c.c create mode 100644 ompi/mpi/fortran/use-mpi-f08/base/ts.c create mode 100644 ompi/mpi/fortran/use-mpi-f08/base/ts.h delete mode 100644 ompi/mpi/fortran/use-mpi-f08/bcast_f08.F90 delete mode 100644 ompi/mpi/fortran/use-mpi-f08/bcast_init_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/bcast_init_ts.c.in create mode 100644 ompi/mpi/fortran/use-mpi-f08/bcast_ts.c.in create mode 100644 ompi/mpi/fortran/use-mpi-f08/bindings.h delete mode 100644 ompi/mpi/fortran/use-mpi-f08/bsend_f08.F90 delete mode 100644 ompi/mpi/fortran/use-mpi-f08/bsend_init_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/bsend_init_ts.c.in create mode 100644 ompi/mpi/fortran/use-mpi-f08/bsend_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/buffer_attach_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/buffer_attach_ts.c.in create mode 100644 ompi/mpi/fortran/use-mpi-f08/buffer_detach.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/buffer_detach_f08.F90 delete mode 100644 ompi/mpi/fortran/use-mpi-f08/compare_and_swap_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/compare_and_swap_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/exscan_f08.F90 delete mode 100644 ompi/mpi/fortran/use-mpi-f08/exscan_init_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/exscan_init_ts.c.in create mode 100644 ompi/mpi/fortran/use-mpi-f08/exscan_ts.c.in create mode 100644 ompi/mpi/fortran/use-mpi-f08/f_sync_reg_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/fetch_and_op_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/fetch_and_op_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/file_iread_all_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/file_iread_all_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/file_iread_at_all_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/file_iread_at_all_ts.c.in create mode 100644 ompi/mpi/fortran/use-mpi-f08/file_iread_at_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/file_iread_f08.F90 delete mode 100644 ompi/mpi/fortran/use-mpi-f08/file_iread_shared_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/file_iread_shared_ts.c.in create mode 100644 ompi/mpi/fortran/use-mpi-f08/file_iread_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/file_iwrite_all_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/file_iwrite_all_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/file_iwrite_at_all_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/file_iwrite_at_all_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/file_iwrite_at_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/file_iwrite_at_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/file_iwrite_f08.F90 delete mode 100644 ompi/mpi/fortran/use-mpi-f08/file_iwrite_shared_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/file_iwrite_shared_ts.c.in create mode 100644 ompi/mpi/fortran/use-mpi-f08/file_iwrite_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/file_read_all_begin_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/file_read_all_begin_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/file_read_all_end_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/file_read_all_end_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/file_read_all_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/file_read_all_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/file_read_at_all_begin_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/file_read_at_all_begin_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/file_read_at_all_end_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/file_read_at_all_end_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/file_read_at_all_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/file_read_at_all_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/file_read_at_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/file_read_at_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/file_read_ordered_begin_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/file_read_ordered_begin_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/file_read_ordered_end_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/file_read_ordered_end_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/file_read_ordered_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/file_read_ordered_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/file_read_shared_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/file_read_shared_ts.c.in create mode 100644 ompi/mpi/fortran/use-mpi-f08/file_read_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/file_write_all_begin_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/file_write_all_begin_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/file_write_all_end_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/file_write_all_end_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/file_write_all_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/file_write_all_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/file_write_at_all_begin_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/file_write_at_all_begin_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/file_write_at_all_end_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/file_write_at_all_end_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/file_write_at_all_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/file_write_at_all_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/file_write_at_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/file_write_at_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/file_write_f08.F90 delete mode 100644 ompi/mpi/fortran/use-mpi-f08/file_write_ordered_begin_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/file_write_ordered_begin_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/file_write_ordered_end_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/file_write_ordered_end_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/file_write_ordered_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/file_write_ordered_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/file_write_shared_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/file_write_shared_ts.c.in create mode 100644 ompi/mpi/fortran/use-mpi-f08/file_write_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/free_mem_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/free_mem_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/gather_f08.F90 delete mode 100644 ompi/mpi/fortran/use-mpi-f08/gather_init_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/gather_init_ts.c.in create mode 100644 ompi/mpi/fortran/use-mpi-f08/gather_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/gatherv_f08.F90 delete mode 100644 ompi/mpi/fortran/use-mpi-f08/gatherv_init_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/gatherv_init_ts.c.in create mode 100644 ompi/mpi/fortran/use-mpi-f08/gatherv_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/get_accumulate_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/get_accumulate_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/get_address_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/get_address_ts.c.in create mode 100644 ompi/mpi/fortran/use-mpi-f08/get_count.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/get_count_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/get_elements.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/get_elements_f08.F90 delete mode 100644 ompi/mpi/fortran/use-mpi-f08/get_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/get_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/iallgather_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/iallgather_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/iallgatherv_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/iallgatherv_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/iallreduce_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/iallreduce_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/ialltoall_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/ialltoall_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/ialltoallv_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/ialltoallv_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/ialltoallw_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/ialltoallw_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/ibcast_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/ibcast_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/ibsend_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/ibsend_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/iexscan_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/iexscan_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/igather_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/igather_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/igatherv_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/igatherv_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/imrecv_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/imrecv_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/ineighbor_allgather_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/ineighbor_allgather_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/ineighbor_allgatherv_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/ineighbor_allgatherv_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/ineighbor_alltoall_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/ineighbor_alltoall_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/ineighbor_alltoallv_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/ineighbor_alltoallv_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/ineighbor_alltoallw_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/ineighbor_alltoallw_ts.c.in create mode 100644 ompi/mpi/fortran/use-mpi-f08/irecv_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/ireduce_f08.F90 delete mode 100644 ompi/mpi/fortran/use-mpi-f08/ireduce_scatter_block_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/ireduce_scatter_block_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/ireduce_scatter_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/ireduce_scatter_ts.c.in create mode 100644 ompi/mpi/fortran/use-mpi-f08/ireduce_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/irsend_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/irsend_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/iscan_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/iscan_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/iscatter_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/iscatter_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/iscatterv_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/iscatterv_ts.c.in create mode 100644 ompi/mpi/fortran/use-mpi-f08/isend_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/isendrecv_f08.F90 delete mode 100644 ompi/mpi/fortran/use-mpi-f08/isendrecv_replace_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/isendrecv_replace_ts.c.in create mode 100644 ompi/mpi/fortran/use-mpi-f08/isendrecv_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/issend_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/issend_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/mrecv_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/mrecv_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/neighbor_allgather_f08.F90 delete mode 100644 ompi/mpi/fortran/use-mpi-f08/neighbor_allgather_init_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/neighbor_allgather_init_ts.c.in create mode 100644 ompi/mpi/fortran/use-mpi-f08/neighbor_allgather_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/neighbor_allgatherv_f08.F90 delete mode 100644 ompi/mpi/fortran/use-mpi-f08/neighbor_allgatherv_init_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/neighbor_allgatherv_init_ts.c.in create mode 100644 ompi/mpi/fortran/use-mpi-f08/neighbor_allgatherv_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/neighbor_alltoall_f08.F90 delete mode 100644 ompi/mpi/fortran/use-mpi-f08/neighbor_alltoall_init_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/neighbor_alltoall_init_ts.c.in create mode 100644 ompi/mpi/fortran/use-mpi-f08/neighbor_alltoall_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/neighbor_alltoallv_f08.F90 delete mode 100644 ompi/mpi/fortran/use-mpi-f08/neighbor_alltoallv_init_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/neighbor_alltoallv_init_ts.c.in create mode 100644 ompi/mpi/fortran/use-mpi-f08/neighbor_alltoallv_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/neighbor_alltoallw_f08.F90 delete mode 100644 ompi/mpi/fortran/use-mpi-f08/neighbor_alltoallw_init_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/neighbor_alltoallw_init_ts.c.in create mode 100644 ompi/mpi/fortran/use-mpi-f08/neighbor_alltoallw_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/pack_external_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/pack_external_size.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/pack_external_size_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/pack_external_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/pack_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/pack_size.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/pack_size_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/pack_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/precv_init_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/precv_init_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/profile/Makefile.am delete mode 100644 ompi/mpi/fortran/use-mpi-f08/profile/pcomm_create_from_group_f08.F90 delete mode 100644 ompi/mpi/fortran/use-mpi-f08/profile/pgroup_from_session_pset_f08.F90 delete mode 100644 ompi/mpi/fortran/use-mpi-f08/profile/pintercomm_create_from_groups_f08.F90 delete mode 100644 ompi/mpi/fortran/use-mpi-f08/profile/psession_finalize_f08.F90 delete mode 100644 ompi/mpi/fortran/use-mpi-f08/psend_init_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/psend_init_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/put_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/put_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/raccumulate_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/raccumulate_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/recv_f08.F90 delete mode 100644 ompi/mpi/fortran/use-mpi-f08/recv_init_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/recv_init_ts.c.in create mode 100644 ompi/mpi/fortran/use-mpi-f08/recv_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/reduce_f08.F90 delete mode 100644 ompi/mpi/fortran/use-mpi-f08/reduce_init_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/reduce_init_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/reduce_local_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/reduce_local_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/reduce_scatter_block_f08.F90 delete mode 100644 ompi/mpi/fortran/use-mpi-f08/reduce_scatter_block_init_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/reduce_scatter_block_init_ts.c.in create mode 100644 ompi/mpi/fortran/use-mpi-f08/reduce_scatter_block_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/reduce_scatter_f08.F90 delete mode 100644 ompi/mpi/fortran/use-mpi-f08/reduce_scatter_init_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/reduce_scatter_init_ts.c.in create mode 100644 ompi/mpi/fortran/use-mpi-f08/reduce_scatter_ts.c.in create mode 100644 ompi/mpi/fortran/use-mpi-f08/reduce_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/rget_accumulate_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/rget_accumulate_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/rget_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/rget_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/rput_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/rput_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/rsend_f08.F90 delete mode 100644 ompi/mpi/fortran/use-mpi-f08/rsend_init_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/rsend_init_ts.c.in create mode 100644 ompi/mpi/fortran/use-mpi-f08/rsend_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/scan_f08.F90 delete mode 100644 ompi/mpi/fortran/use-mpi-f08/scan_init_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/scan_init_ts.c.in create mode 100644 ompi/mpi/fortran/use-mpi-f08/scan_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/scatter_f08.F90 delete mode 100644 ompi/mpi/fortran/use-mpi-f08/scatter_init_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/scatter_init_ts.c.in create mode 100644 ompi/mpi/fortran/use-mpi-f08/scatter_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/scatterv_f08.F90 delete mode 100644 ompi/mpi/fortran/use-mpi-f08/scatterv_init_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/scatterv_init_ts.c.in create mode 100644 ompi/mpi/fortran/use-mpi-f08/scatterv_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/send_f08.F90 delete mode 100644 ompi/mpi/fortran/use-mpi-f08/send_init_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/send_init_ts.c.in create mode 100644 ompi/mpi/fortran/use-mpi-f08/send_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/sendrecv_f08.F90 delete mode 100644 ompi/mpi/fortran/use-mpi-f08/sendrecv_replace_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/sendrecv_replace_ts.c.in create mode 100644 ompi/mpi/fortran/use-mpi-f08/sendrecv_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/ssend_f08.F90 delete mode 100644 ompi/mpi/fortran/use-mpi-f08/ssend_init_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/ssend_init_ts.c.in create mode 100644 ompi/mpi/fortran/use-mpi-f08/ssend_ts.c.in create mode 100644 ompi/mpi/fortran/use-mpi-f08/status_set_elements_c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/status_set_elements_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/testany.c.in create mode 100644 ompi/mpi/fortran/use-mpi-f08/type_contiguous.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/type_contiguous_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/type_create_darray.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/type_create_darray_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/type_create_hindexed.c.in create mode 100644 ompi/mpi/fortran/use-mpi-f08/type_create_hindexed_block.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/type_create_hindexed_block_f08.F90 delete mode 100644 ompi/mpi/fortran/use-mpi-f08/type_create_hindexed_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/type_create_hvector.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/type_create_hvector_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/type_create_indexed_block.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/type_create_indexed_block_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/type_create_struct.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/type_create_struct_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/type_create_subarray.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/type_create_subarray_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/type_get_contents_f08_c.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/type_get_envelope_f08_c.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/type_get_true_extent.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/type_get_true_extent_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/type_indexed.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/type_indexed_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/type_size.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/type_size_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/type_vector.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/type_vector_f08.F90 delete mode 100644 ompi/mpi/fortran/use-mpi-f08/unpack_external_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/unpack_external_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/unpack_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/unpack_ts.c.in create mode 100644 ompi/mpi/fortran/use-mpi-f08/waitall.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/waitall_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/win_allocate.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/win_allocate_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/win_allocate_shared.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/win_allocate_shared_f08.F90 delete mode 100644 ompi/mpi/fortran/use-mpi-f08/win_attach_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/win_attach_ts.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/win_create_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/win_create_ts.c.in create mode 100644 ompi/mpi/fortran/use-mpi-f08/win_detach_ts.c.in create mode 100644 ompi/mpi/fortran/use-mpi-f08/win_shared_query.c.in delete mode 100644 ompi/mpi/fortran/use-mpi-f08/win_shared_query_f08.F90 diff --git a/.gitignore b/.gitignore index 62c1ea299ff..24027a0ea8d 100644 --- a/.gitignore +++ b/.gitignore @@ -201,6 +201,7 @@ ompi/mpi/fortran/mpiext/mpi-ext-module.F90 ompi/mpi/fortran/mpiext/mpi-f08-ext-module.F90 ompi/mpi/fortran/mpiext-use-mpi/mpi-ext-module.F90 ompi/mpi/fortran/mpiext-use-mpi-f08/mpi-f08-ext-module.F90 +ompi/mpi/fortran/use-mpi-f08/psizeof_f08.f90 ompi/mpi/fortran/mpif-h/sizeof_f.f90 ompi/mpi/fortran/mpif-h/profile/p*.c diff --git a/config/ompi_config_files.m4 b/config/ompi_config_files.m4 index 0110949f993..21d1e3eb791 100644 --- a/config/ompi_config_files.m4 +++ b/config/ompi_config_files.m4 @@ -37,7 +37,6 @@ 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/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 diff --git a/ompi/mpi/bindings/ompi_bindings/fortran.py b/ompi/mpi/bindings/ompi_bindings/fortran.py index df3ae87802d..d35824965e0 100644 --- a/ompi/mpi/bindings/ompi_bindings/fortran.py +++ b/ompi/mpi/bindings/ompi_bindings/fortran.py @@ -228,8 +228,9 @@ def print_c_source_header(out): 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 "ompi/mca/coll/base/coll_base_util.h"') out.dump('#include "ts.h"') - out.dump('#include "array.h"') + out.dump('#include "bigcount.h"') def print_binding(prototype, lang, out, bigcount=False, template=None): diff --git a/ompi/mpi/bindings/ompi_bindings/fortran_type.py b/ompi/mpi/bindings/ompi_bindings/fortran_type.py index 7a841f988ed..38627123536 100644 --- a/ompi/mpi/bindings/ompi_bindings/fortran_type.py +++ b/ompi/mpi/bindings/ompi_bindings/fortran_type.py @@ -176,6 +176,17 @@ def c_parameter(self): return f'OMPI_CFI_BUFFER *{self.name}' +@FortranType.add('C_PTR_OUT') +class CptrType(FortranType): + def declare(self): + return f'TYPE(C_PTR), INTENT(OUT) :: {self.name}' + + def use(self): + return [('ISO_C_BINDING', 'C_PTR')] + + def c_parameter(self): + return f'char *{self.name}' + @FortranType.add('COUNT') class CountType(FortranType): def declare(self): @@ -191,6 +202,50 @@ def c_parameter(self): type_ = 'MPI_Count' if self.bigcount else 'MPI_Fint' return f'{type_} *{self.name}' +@FortranType.add('COUNT_INOUT') +class CountTypeInOut(FortranType): + """COUNT type with INOUT INTENT""" + def declare(self): + if self.bigcount: + return f'INTEGER(KIND=MPI_COUNT_KIND), INTENT(INOUT) :: {self.name}' + else: + return f'INTEGER, INTENT(INOUT) :: {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('COUNT_OUT') +class CountTypeInOut(FortranType): + """COUNT type with OUT INTENT""" + def declare(self): + if self.bigcount: + return f'INTEGER(KIND=MPI_COUNT_KIND), INTENT(OUT) :: {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('PARTITIONED_COUNT') +class PartitionedCountType(FortranType): + def declare(self): + return f'INTEGER(KIND=MPI_COUNT_KIND), INTENT(IN) :: {self.name}' + + def use(self): + return [('mpi_f08_types', 'MPI_COUNT_KIND')] + + def c_parameter(self): + return f'MPI_Count *{self.name}' + @FortranType.add('DATATYPE') class DatatypeType(FortranType): @@ -209,6 +264,24 @@ def use(self): def c_parameter(self): return f'MPI_Fint *{self.name}' +@FortranType.add('DATATYPE_OUT') +class DatatypeTypeOut(FortranType): + def declare(self): + return f'TYPE(MPI_Datatype), 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_Datatype')] + + def c_parameter(self): + return f'MPI_Fint *{self.name}' + + @FortranType.add('DATATYPE_ARRAY') class DatatypeArrayType(FortranType): @@ -293,8 +366,20 @@ def c_parameter(self): return f'MPI_Fint *{self.name}' -@FortranType.add('STATUS_OUT') +@FortranType.add('STATUS') class StatusType(FortranType): + def declare(self): + return f'TYPE(MPI_Status) :: {self.name}' + + def use(self): + return [('mpi_f08_types', 'MPI_Status')] + + def c_parameter(self): + return f'MPI_Fint *{self.name}' + + +@FortranType.add('STATUS_OUT') +class StatusOutType(FortranType): def declare(self): return f'TYPE(MPI_Status), INTENT(OUT) :: {self.name}' @@ -382,9 +467,28 @@ def c_parameter(self): count_type = 'MPI_Count' if self.bigcount else 'MPI_Fint' return f'{count_type} *{self.name}' +@FortranType.add('AINT_COUNT_ARRAY') +class CountArray(IntArray): + """Array of MPI_Count or int.""" + + def declare(self): + kind = '(KIND=MPI_COUNT_KIND)' if self.bigcount else '(KIND=MPI_ADDRESS_KIND)' + return f'INTEGER{kind}, INTENT(IN) :: {self.name}(*)' + + def use(self): + if self.bigcount: + return [('mpi_f08_types', 'MPI_COUNT_KIND')] + else: + return [('mpi_f08_types', 'MPI_ADDRESS_KIND')] + + def c_parameter(self): + count_type = 'MPI_Count' if self.bigcount else 'MPI_Aint' + return f'{count_type} *{self.name}' + + @FortranType.add('AINT') -class Disp(FortranType): +class Aint(FortranType): """MPI_Aint type.""" def declare(self): @@ -397,6 +501,95 @@ def c_parameter(self): return f'MPI_Aint *{self.name}' +@FortranType.add('AINT_OUT') +class AintOut(FortranType): + """MPI_Aint out type.""" + + def declare(self): + return f'INTEGER(MPI_ADDRESS_KIND), INTENT(OUT) :: {self.name}' + + def use(self): + return [('mpi_f08_types', 'MPI_ADDRESS_KIND')] + + def c_parameter(self): + return f'MPI_Aint *{self.name}' + + +@FortranType.add('AINT_COUNT') +class AintCountTypeIn(FortranType): + """AINT/COUNT type with ININTENT""" + def declare(self): + if self.bigcount: + return f'INTEGER(KIND=MPI_COUNT_KIND), INTENT(IN) :: {self.name}' + else: + return f'INTEGER(KIND=MPI_ADDRESS_KIND), INTENT(IN) :: {self.name}' + + def use(self): + if self.bigcount: + return [('mpi_f08_types', 'MPI_COUNT_KIND')] + else: + return [('mpi_f08_types', 'MPI_ADDRESS_KIND')] + + def c_parameter(self): + type_ = 'MPI_Count' if self.bigcount else 'MPI_Aint' + return f'{type_} *{self.name}' + + +@FortranType.add('AINT_COUNT_INOUT') +class AintCountTypeInOut(FortranType): + """AINT/COUNT type with INOUT INTENT""" + def declare(self): + if self.bigcount: + return f'INTEGER(KIND=MPI_COUNT_KIND), INTENT(INOUT) :: {self.name}' + else: + return f'INTEGER(KIND=MPI_ADDRESS_KIND), INTENT(INOUT) :: {self.name}' + + def use(self): + if self.bigcount: + return [('mpi_f08_types', 'MPI_COUNT_KIND')] + else: + return [('mpi_f08_types', 'MPI_ADDRESS_KIND')] + + def c_parameter(self): + type_ = 'MPI_Count' if self.bigcount else 'MPI_Aint' + return f'{type_} *{self.name}' + + +@FortranType.add('AINT_COUNT_OUT') +class AintCountTypeOut(FortranType): + """AINT/COUNT type with OUT INTENT""" + def declare(self): + if self.bigcount: + return f'INTEGER(KIND=MPI_COUNT_KIND), INTENT(OUT) :: {self.name}' + else: + return f'INTEGER(KIND=MPI_ADDRESS_KIND), INTENT(OUT) :: {self.name}' + + def use(self): + if self.bigcount: + return [('mpi_f08_types', 'MPI_COUNT_KIND')] + else: + return [('mpi_f08_types', 'MPI_ADDRESS_KIND')] + + def c_parameter(self): + type_ = 'MPI_Count' if self.bigcount else 'MPI_Aint' + return f'{type_} *{self.name}' + + +@FortranType.add('AINT_ARRAY') +class AintArrayType(FortranType): + """Array of MPI_Aint.""" + + def declare(self): + # TODO: Should there be a separate ASYNC version here, when the OMPI_ASYNCHRONOUS attr is required? + return f'INTEGER(KIND=MPI_ADDRESS_KIND), INTENT(IN) OMPI_ASYNCHRONOUS :: {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.""" @@ -414,6 +607,23 @@ def c_parameter(self): count_type = 'MPI_Aint' if self.bigcount else 'MPI_Fint' return f'{count_type} *{self.name}' +@FortranType.add('DISP_OUT') +class DispOut(FortranType): + """Displacecment out type.""" + + def declare(self): + kind = '(KIND=MPI_ADDRESS_KIND)' if self.bigcount else '' + return f'INTEGER{kind}, INTENT(OUT) :: {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): @@ -460,6 +670,25 @@ def use(self): def c_parameter(self): return f'MPI_Fint *{self.name}' +@FortranType.add('WIN_OUT') +class WinOut(FortranType): + """MPI_Win out type.""" + + def declare(self): + return f'TYPE(MPI_Win), 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_Win')] + + def c_parameter(self): + return f'MPI_Fint *{self.name}' + @FortranType.add('FILE') class File(FortranType): @@ -473,3 +702,60 @@ def use(self): def c_parameter(self): return f'MPI_Fint *{self.name}' + +@FortranType.add('INFO') +class Info(FortranType): + """MPI_Info type.""" + + def declare(self): + return f'TYPE(MPI_Info), INTENT(IN) :: {self.name}' + + def use(self): + return [('mpi_f08_types', 'MPI_Info')] + + def c_parameter(self): + return f'MPI_Fint *{self.name}' + +@FortranType.add('OFFSET') +class Offset(FortranType): + """MPI_Offset type.""" + + def declare(self): + return f'INTEGER(MPI_OFFSET_KIND), INTENT(IN) :: {self.name}' + + def use(self): + return [('mpi_f08_types', 'MPI_OFFSET_KIND')] + + def c_parameter(self): + return f'MPI_Offset *{self.name}' + + +@FortranType.add('CHAR_ARRAY') +class CharArray(FortranType): + """Fortran CHAR type.""" + + def declare(self): + return f'CHARACTER(LEN=*), INTENT(IN) :: {self.name}' + + def use(self): + return [('iso_c_binding', 'c_char')] + + def declare_cbinding_fortran(self): + return f'CHARACTER(KIND=C_CHAR), INTENT(IN) :: {self.name}(*)' + + def c_parameter(self): + return f'char *{self.name}' + + +@FortranType.add('MESSAGE_INOUT') +class MessageInOut(FortranType): + """MPI_Message INOUT type.""" + + def declare(self): + return f'TYPE(MPI_Message), INTENT(INOUT) :: {self.name}' + + def use(self): + return [('mpi_f08_types', 'MPI_Message')] + + 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 index 8dea59ae392..b7c6b36eba4 100644 --- a/ompi/mpi/bindings/ompi_bindings/parser.py +++ b/ompi/mpi/bindings/ompi_bindings/parser.py @@ -113,7 +113,7 @@ def load(fname, prefix=None, type_constructor=None): header.append(line) if not prototype: - raise RuntimeError('missing prototype') + raise RuntimeError(f'missing prototype for {fname}') # Parse the prototype prototype = ''.join(prototype) prototype = prototype[len('PROTOTYPE'):] diff --git a/ompi/mpi/bindings/ompi_bindings/util.py b/ompi/mpi/bindings/ompi_bindings/util.py index c2d38309be4..b8b9f1e7a46 100644 --- a/ompi/mpi/bindings/ompi_bindings/util.py +++ b/ompi/mpi/bindings/ompi_bindings/util.py @@ -131,10 +131,13 @@ def abi_internal_name(extname): 'COUNT_ARRAY', 'DISP', 'DISP_ARRAY', + 'DISP_OUT', + 'COUNT_INOUT', 'COUNT_OUT', 'AINT_COUNT', 'AINT_COUNT_ARRAY', 'AINT_COUNT_OUT', + 'AINT_COUNT_INOUT', 'INT_AINT_OUT', 'USER_FUNCTION', 'DATAREP_CONVERSION_FUNCTION', diff --git a/ompi/mpi/c/wtime.c.in b/ompi/mpi/c/wtime.c.in index e60041aad71..e31db4d630e 100644 --- a/ompi/mpi/c/wtime.c.in +++ b/ompi/mpi/c/wtime.c.in @@ -40,16 +40,12 @@ #include "opal/util/clock_gettime.h" -#if OMPI_BUILD_MPI_PROFILING /** * Use this as a base time set early during MPI initialization 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 extern struct timespec ompi_wtime_time_origin; -#endif PROTOTYPE DOUBLE wtime() { diff --git a/ompi/mpi/fortran/base/fint_2_int.h b/ompi/mpi/fortran/base/fint_2_int.h index 3cffe37a719..15b55eaa867 100644 --- a/ompi/mpi/fortran/base/fint_2_int.h +++ b/ompi/mpi/fortran/base/fint_2_int.h @@ -33,21 +33,22 @@ */ #if OMPI_SIZEOF_FORTRAN_INTEGER == SIZEOF_INT - #define OMPI_ARRAY_NAME_DECL(a) int *c_##a = NULL - #define OMPI_2_DIM_ARRAY_NAME_DECL(a, dim2) int (*c_##a)[dim2] + #define OMPI_ARRAY_NAME_DECL(a) + #define OMPI_2_DIM_ARRAY_NAME_DECL(a, dim2) #define OMPI_SINGLE_NAME_DECL(a) - #define OMPI_ARRAY_NAME_CONVERT(a) c_##a + #define OMPI_ARRAY_NAME_CONVERT(a) a #define OMPI_SINGLE_NAME_CONVERT(a) a #define OMPI_INT_2_FINT(a) a #define OMPI_FINT_2_INT(a) a #define OMPI_PFINT_2_PINT(a) a - #define OMPI_ARRAY_FINT_2_INT_ALLOC(in, n) { OMPI_ARRAY_NAME_CONVERT(in) = in; } - #define OMPI_ARRAY_FINT_2_INT(in, n) { OMPI_ARRAY_NAME_CONVERT(in) = in; } - #define OMPI_2_DIM_ARRAY_FINT_2_INT(in, n, dim2) { OMPI_ARRAY_NAME_CONVERT(in) = in; } + #define OMPI_ARRAY_FINT_2_INT_ALLOC(in, n) + #define OMPI_ARRAY_FINT_2_INT(in, n) + #define OMPI_2_DIM_ARRAY_FINT_2_INT(in, n, dim2) #define OMPI_ARRAY_FINT_2_INT_CLEANUP(in) #define OMPI_SINGLE_FINT_2_INT(in) #define OMPI_SINGLE_INT_2_FINT(in) #define OMPI_ARRAY_INT_2_FINT(in, n) + #define OMPI_COND_STATEMENT(a) #elif OMPI_SIZEOF_FORTRAN_INTEGER > SIZEOF_INT #define OMPI_ARRAY_NAME_DECL(a) int *c_##a = NULL @@ -87,7 +88,8 @@ /* This is for IN parameters. Does only free */ #define OMPI_ARRAY_FINT_2_INT_CLEANUP(in) \ - free(OMPI_ARRAY_NAME_CONVERT(in)) + if (NULL != OMPI_ARRAY_NAME_CONVERT(in)) \ + free(OMPI_ARRAY_NAME_CONVERT(in)) /* This is for single IN parameter */ #define OMPI_SINGLE_FINT_2_INT(in) \ @@ -106,6 +108,8 @@ } \ free(OMPI_ARRAY_NAME_CONVERT(in)); \ } while (0) + + #define OMPI_COND_STATEMENT(a) a #else /* int > MPI_Fint */ #define OMPI_ARRAY_NAME_DECL(a) int *c_##a = NULL #define OMPI_2_DIM_ARRAY_NAME_DECL(a, dim2) int (*c_##a)[dim2], dim2_index @@ -141,7 +145,8 @@ } while (0) #define OMPI_ARRAY_FINT_2_INT_CLEANUP(in) \ - free(OMPI_ARRAY_NAME_CONVERT(in)) + if (NULL != OMPI_ARRAY_NAME_CONVERT(in)) \ + free(OMPI_ARRAY_NAME_CONVERT(in)) #define OMPI_SINGLE_FINT_2_INT(in) \ OMPI_ARRAY_NAME_CONVERT(in) = *(in) @@ -158,6 +163,7 @@ free(OMPI_ARRAY_NAME_CONVERT(in)); \ } while (0) + #define OMPI_COND_STATEMENT(a) a #endif /* diff --git a/ompi/mpi/fortran/configure-fortran-output.h.in b/ompi/mpi/fortran/configure-fortran-output.h.in index 2c96d83a2b6..ed239693b15 100644 --- a/ompi/mpi/fortran/configure-fortran-output.h.in +++ b/ompi/mpi/fortran/configure-fortran-output.h.in @@ -43,6 +43,9 @@ ! Line 2 of the ignore TKR syntax #define OMPI_FORTRAN_IGNORE_TKR_TYPE @OMPI_FORTRAN_IGNORE_TKR_TYPE@ +! f08 TKR syntax (w/o TS 29113) +#define OMPI_F08_IGNORE_TKR_PREDECL @OMPI_F08_IGNORE_TKR_PREDECL@ +#define OMPI_F08_IGNORE_TKR_TYPE @OMPI_F08_IGNORE_TKR_TYPE@ #define OMPI_FORTRAN_BUILD_SIZEOF @OMPI_FORTRAN_BUILD_SIZEOF@ ! Integers diff --git a/ompi/mpi/fortran/mpif-h/type_get_envelope_f_c.c b/ompi/mpi/fortran/mpif-h/type_get_envelope_f_c.c new file mode 100644 index 00000000000..ba088345f57 --- /dev/null +++ b/ompi/mpi/fortran/mpif-h/type_get_envelope_f_c.c @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" + +#include "ompi/mpi/fortran/mpif-h/bindings.h" + +void ompi_type_get_envelope_f_c(MPI_Fint *type, MPI_Count *num_integers, + MPI_Count *num_addresses, + MPI_Count *num_large_counts, + MPI_Count *num_datatypes, MPI_Fint *combiner, + MPI_Fint *ierr) +{ + int c_ierr; + MPI_Datatype c_type = PMPI_Type_f2c(*type); + OMPI_SINGLE_NAME_DECL(num_integers); + OMPI_SINGLE_NAME_DECL(num_addresses); + OMPI_SINGLE_NAME_DECL(num_datatypes); + OMPI_SINGLE_NAME_DECL(combiner); + + c_ierr = PMPI_Type_get_envelope_c(c_type, + OMPI_SINGLE_NAME_CONVERT(num_integers), + OMPI_SINGLE_NAME_CONVERT(num_addresses), + OMPI_SINGLE_NAME_CONVERT(num_large_counts), + OMPI_SINGLE_NAME_CONVERT(num_datatypes), + OMPI_SINGLE_NAME_CONVERT(combiner)); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + OMPI_SINGLE_INT_2_FINT(num_integers); + OMPI_SINGLE_INT_2_FINT(num_addresses); + OMPI_SINGLE_INT_2_FINT(num_datatypes); + OMPI_SINGLE_INT_2_FINT(combiner); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/Makefile.am b/ompi/mpi/fortran/use-mpi-f08/Makefile.am index 93e503c03c4..593feca0480 100644 --- a/ompi/mpi/fortran/use-mpi-f08/Makefile.am +++ b/ompi/mpi/fortran/use-mpi-f08/Makefile.am @@ -23,8 +23,6 @@ # $HEADER$ # -SUBDIRS = profile - include $(top_srcdir)/Makefile.ompi-rules # Note that Automake's Fortran-buidling rules uses CPPFLAGS and @@ -36,6 +34,20 @@ AM_CPPFLAGS = # This Makefile is only relevant if we're building the "use mpi_f08" # MPI bindings. + +# Profiling entry points are generated using a combination of the +# the mod/mpi-f08-rename.h file and the OMPI_BUILD_MPI_PROFILING +# define flag. This approach is used both for the generated +# F08 entry points like MPI_SEND and ones that are still built +# using *.F90 files like COMM_SET_ERRHANDLER. +# +# When adding a new function, if it involves big count arguments and/or +# involves a user supplied buffer(s), and hence the need to generate +# either assumed rank or assumed shape arrays with possible async +# attributes, the *.c.in method needs to be used. Otherwise a *.F90 +# file can be used. In addition, the mod/mpi-f08-rename.h file +# will need to be updated to include a rename line for the new method. +# if OMPI_BUILD_FORTRAN_USEMPIF08_BINDINGS AM_FCFLAGS = -I$(top_srcdir)/ompi/mpi/fortran/use-mpi-f08/mod \ @@ -45,14 +57,14 @@ AM_FCFLAGS = -I$(top_srcdir)/ompi/mpi/fortran/use-mpi-f08/mod \ $(OMPI_FC_MODULE_FLAG)$(top_builddir)/ompi/mpi/fortran/use-mpi-ignore-tkr \ $(OMPI_FC_MODULE_FLAG)mod \ $(OMPI_FC_MODULE_FLAG)bindings \ - -I$(top_srcdir) -I$(top_builddir) $(FCFLAGS_f90) \ - -DOMPI_BUILD_MPI_PROFILING=0 + -I$(top_srcdir) -I$(top_builddir) $(FCFLAGS_f90) MOSTLYCLEANFILES = *.mod CLEANFILES += *.i90 lib_LTLIBRARIES = lib@OMPI_LIBMPI_NAME@_usempif08.la +noinst_LTLIBRARIES = lib@OMPI_LIBMPI_NAME@_usempif08_profile.la module_sentinel_files = \ mod/libforce_usempif08_internal_modules_to_be_built.la \ @@ -97,9 +109,9 @@ sizeof_f08.f90: --complex4=$(OMPI_HAVE_FORTRAN_COMPLEX4) \ --complex32=$(OMPI_HAVE_FORTRAN_COMPLEX32) -profile/psizeof_f08.f90: $(top_builddir)/config.status -profile/psizeof_f08.f90: $(sizeof_pl) -profile/psizeof_f08.f90: +psizeof_f08.f90: $(top_builddir)/config.status +psizeof_f08.f90: $(sizeof_pl) +psizeof_f08.f90: $(OMPI_V_GEN) $(sizeof_pl) \ --impl=$@ --ierror=optional --pmpi \ --maxrank=$(OMPI_FORTRAN_MAX_ARRAY_RANK) \ @@ -110,37 +122,18 @@ profile/psizeof_f08.f90: --complex4=$(OMPI_HAVE_FORTRAN_COMPLEX4) \ --complex32=$(OMPI_HAVE_FORTRAN_COMPLEX32) -CLEANFILES += sizeof_f08.h sizeof_f08.f90 profile/psizeof_f08.f90 +CLEANFILES += sizeof_f08.h sizeof_f08.f90 psizeof_f08.f90 mpi_api_files = \ abort_f08.F90 \ - accumulate_f08.F90 \ add_error_class_f08.F90 \ add_error_code_f08.F90 \ add_error_string_f08.F90 \ aint_add_f08.F90 \ aint_diff_f08.F90 \ - allgather_f08.F90 \ - allgather_init_f08.F90 \ - allgatherv_f08.F90 \ - allgatherv_init_f08.F90 \ alloc_mem_f08.F90 \ - allreduce_f08.F90 \ - allreduce_init_f08.F90 \ - alltoall_f08.F90 \ - alltoall_init_f08.F90 \ - alltoallv_f08.F90 \ - alltoallv_init_f08.F90 \ - alltoallw_f08.F90 \ - alltoallw_init_f08.F90 \ barrier_f08.F90 \ barrier_init_f08.F90 \ - bcast_f08.F90 \ - bcast_init_f08.F90 \ - bsend_f08.F90 \ - bsend_init_f08.F90 \ - buffer_attach_f08.F90 \ - buffer_detach_f08.F90 \ cancel_f08.F90 \ cart_coords_f08.F90 \ cart_create_f08.F90 \ @@ -188,7 +181,6 @@ mpi_api_files = \ comm_split_f08.F90 \ comm_split_type_f08.F90 \ comm_test_inter_f08.F90 \ - compare_and_swap_f08.F90 \ dist_graph_create_adjacent_f08.F90 \ dist_graph_create_f08.F90 \ dist_graph_neighbors_count_f08.F90 \ @@ -197,10 +189,6 @@ mpi_api_files = \ errhandler_free_f08.F90 \ error_class_f08.F90 \ error_string_f08.F90 \ - exscan_f08.F90 \ - exscan_init_f08.F90 \ - f_sync_reg_f08.F90 \ - fetch_and_op_f08.F90 \ file_call_errhandler_f08.F90 \ file_close_f08.F90 \ file_create_errhandler_f08.F90 \ @@ -216,30 +204,8 @@ mpi_api_files = \ file_get_size_f08.F90 \ file_get_type_extent_f08.F90 \ file_get_view_f08.F90 \ - file_iread_at_f08.F90 \ - file_iread_f08.F90 \ - file_iread_at_all_f08.F90 \ - file_iread_all_f08.F90 \ - file_iread_shared_f08.F90 \ - file_iwrite_at_f08.F90 \ - file_iwrite_f08.F90 \ - file_iwrite_at_all_f08.F90 \ - file_iwrite_all_f08.F90 \ - file_iwrite_shared_f08.F90 \ file_open_f08.F90 \ file_preallocate_f08.F90 \ - file_read_all_begin_f08.F90 \ - file_read_all_end_f08.F90 \ - file_read_all_f08.F90 \ - file_read_at_all_begin_f08.F90 \ - file_read_at_all_end_f08.F90 \ - file_read_at_all_f08.F90 \ - file_read_at_f08.F90 \ - file_read_f08.F90 \ - file_read_ordered_begin_f08.F90 \ - file_read_ordered_end_f08.F90 \ - file_read_ordered_f08.F90 \ - file_read_shared_f08.F90 \ file_seek_f08.F90 \ file_seek_shared_f08.F90 \ file_set_atomicity_f08.F90 \ @@ -248,31 +214,9 @@ mpi_api_files = \ file_set_size_f08.F90 \ file_set_view_f08.F90 \ file_sync_f08.F90 \ - file_write_all_begin_f08.F90 \ - file_write_all_end_f08.F90 \ - file_write_all_f08.F90 \ - file_write_at_all_begin_f08.F90 \ - file_write_at_all_end_f08.F90 \ - file_write_at_all_f08.F90 \ - file_write_at_f08.F90 \ - file_write_f08.F90 \ - file_write_ordered_begin_f08.F90 \ - file_write_ordered_end_f08.F90 \ - file_write_ordered_f08.F90 \ - file_write_shared_f08.F90 \ finalized_f08.F90 \ finalize_f08.F90 \ - free_mem_f08.F90 \ - gather_f08.F90 \ - gather_init_f08.F90 \ - gatherv_f08.F90 \ - gatherv_init_f08.F90 \ - get_accumulate_f08.F90 \ - get_address_f08.F90 \ - get_count_f08.F90 \ - get_elements_f08.F90 \ get_elements_x_f08.F90 \ - get_f08.F90 \ get_library_version_f08.F90 \ get_processor_name_f08.F90 \ get_version_f08.F90 \ @@ -297,25 +241,8 @@ mpi_api_files = \ group_size_f08.F90 \ group_translate_ranks_f08.F90 \ group_union_f08.F90 \ - iallgather_f08.F90 \ - iallgatherv_f08.F90 \ - iallreduce_f08.F90 \ - ialltoall_f08.F90 \ - ialltoallv_f08.F90 \ - ialltoallw_f08.F90 \ ibarrier_f08.F90 \ - ibcast_f08.F90 \ - ibsend_f08.F90 \ - iexscan_f08.F90 \ - igather_f08.F90 \ - igatherv_f08.F90 \ improbe_f08.F90 \ - imrecv_f08.F90 \ - ineighbor_allgather_f08.F90 \ - ineighbor_allgatherv_f08.F90 \ - ineighbor_alltoall_f08.F90 \ - ineighbor_alltoallv_f08.F90 \ - ineighbor_alltoallw_f08.F90 \ info_create_f08.F90 \ info_create_env_f08.F90 \ info_delete_f08.F90 \ @@ -334,79 +261,24 @@ mpi_api_files = \ intercomm_create_from_groups_f08.F90 \ intercomm_merge_f08.F90 \ iprobe_f08.F90 \ - irecv_f08.F90 \ - ireduce_f08.F90 \ - ireduce_scatter_f08.F90 \ - ireduce_scatter_block_f08.F90 \ - irsend_f08.F90 \ - iscan_f08.F90 \ - iscatter_f08.F90 \ - iscatterv_f08.F90 \ - isend_f08.F90 \ - isendrecv_f08.F90 \ - isendrecv_replace_f08.F90 \ - issend_f08.F90 \ is_thread_main_f08.F90 \ lookup_name_f08.F90 \ mprobe_f08.F90 \ - mrecv_f08.F90 \ - neighbor_allgather_f08.F90 \ - neighbor_allgather_init_f08.F90 \ - neighbor_allgatherv_f08.F90 \ - neighbor_allgatherv_init_f08.F90 \ - neighbor_alltoall_f08.F90 \ - neighbor_alltoall_init_f08.F90 \ - neighbor_alltoallv_f08.F90 \ - neighbor_alltoallv_init_f08.F90 \ - neighbor_alltoallw_f08.F90 \ - neighbor_alltoallw_init_f08.F90 \ op_commutative_f08.F90 \ op_create_f08.F90 \ open_port_f08.F90 \ op_free_f08.F90 \ - pack_external_f08.F90 \ - pack_external_size_f08.F90 \ - pack_f08.F90 \ - pack_size_f08.F90 \ parrived_f08.F90 \ pcontrol_f08.F90 \ pready_f08.F90 \ pready_range_f08.F90 \ pready_list_f08.F90 \ - precv_init_f08.F90 \ probe_f08.F90 \ - psend_init_f08.F90 \ publish_name_f08.F90 \ - put_f08.F90 \ query_thread_f08.F90 \ - raccumulate_f08.F90 \ - recv_f08.F90 \ - recv_init_f08.F90 \ - reduce_f08.F90 \ - reduce_init_f08.F90 \ - reduce_local_f08.F90 \ - reduce_scatter_f08.F90 \ - reduce_scatter_init_f08.F90 \ - reduce_scatter_block_f08.F90 \ - reduce_scatter_block_init_f08.F90 \ register_datarep_f08.F90 \ request_free_f08.F90 \ request_get_status_f08.F90 \ - rget_f08.F90 \ - rget_accumulate_f08.F90 \ - rput_f08.F90 \ - rsend_f08.F90 \ - rsend_init_f08.F90 \ - scan_f08.F90 \ - scan_init_f08.F90 \ - scatter_f08.F90 \ - scatter_init_f08.F90 \ - scatterv_f08.F90 \ - scatterv_init_f08.F90 \ - send_f08.F90 \ - send_init_f08.F90 \ - sendrecv_f08.F90 \ - sendrecv_replace_f08.F90 \ session_call_errhandler_f08.F90\ session_create_errhandler_f08.F90\ session_get_errhandler_f08.F90\ @@ -417,72 +289,50 @@ mpi_api_files = \ session_init_f08.F90 \ session_finalize_f08.F90 \ session_set_errhandler_f08.F90\ - ssend_f08.F90 \ - ssend_init_f08.F90 \ startall_f08.F90 \ start_f08.F90 \ status_f082f_f08.F90 \ status_f2f08_f08.F90 \ status_set_cancelled_f08.F90 \ - status_set_elements_f08.F90 \ status_set_elements_x_f08.F90 \ testall_f08.F90 \ - testany_f08.F90 \ test_cancelled_f08.F90 \ test_f08.F90 \ testsome_f08.F90 \ topo_test_f08.F90 \ type_commit_f08.F90 \ - type_contiguous_f08.F90 \ - type_create_darray_f08.F90 \ type_create_f90_complex_f08.F90 \ type_create_f90_integer_f08.F90 \ type_create_f90_real_f08.F90 \ - type_create_hindexed_f08.F90 \ - type_create_hvector_f08.F90 \ - type_create_indexed_block_f08.F90 \ - type_create_hindexed_block_f08.F90 \ type_create_keyval_f08.F90 \ type_create_resized_f08.F90 \ - type_create_struct_f08.F90 \ - type_create_subarray_f08.F90 \ type_delete_attr_f08.F90 \ type_dup_f08.F90 \ type_free_f08.F90 \ type_free_keyval_f08.F90 \ type_get_attr_f08.F90 \ type_get_contents_f08.F90 \ - type_get_envelope_f08.F90 \ + type_get_contents_f08_c.F90 \ type_get_extent_f08.F90 \ type_get_extent_x_f08.F90 \ type_get_name_f08.F90 \ - type_get_true_extent_f08.F90 \ type_get_true_extent_x_f08.F90 \ - type_indexed_f08.F90 \ + type_get_envelope_f08.F90 \ + type_get_envelope_f08_c.F90 \ type_match_size_f08.F90 \ type_set_attr_f08.F90 \ type_set_name_f08.F90 \ - type_size_f08.F90 \ type_size_x_f08.F90 \ - type_vector_f08.F90 \ - unpack_external_f08.F90 \ - unpack_f08.F90 \ unpublish_name_f08.F90 \ - waitall_f08.F90 \ waitany_f08.F90 \ wait_f08.F90 \ waitsome_f08.F90 \ - win_allocate_f08.F90 \ - win_allocate_shared_f08.F90 \ - win_attach_f08.F90 \ win_call_errhandler_f08.F90 \ win_complete_f08.F90 \ win_create_dynamic_f08.F90 \ win_create_errhandler_f08.F90 \ - win_create_f08.F90 \ win_create_keyval_f08.F90 \ win_delete_attr_f08.F90 \ - win_detach_f08.F90 \ win_fence_f08.F90 \ win_flush_f08.F90 \ win_flush_all_f08.F90 \ @@ -502,34 +352,30 @@ mpi_api_files = \ win_set_errhandler_f08.F90 \ win_set_info_f08.F90 \ win_set_name_f08.F90 \ - win_shared_query_f08.F90 \ win_start_f08.F90 \ win_sync_f08.F90 \ win_test_f08.F90 \ win_unlock_f08.F90 \ win_unlock_all_f08.F90 \ - win_wait_f08.F90 - -# JMS Somehow this variable substitution isn't quite working, and I -# don't have time to figure it out. So just wholesale copy the file -# list. :-( -#pmpi_api_files = $(mpi_api_files:%=profile/p%) + win_wait_f08.F90 \ + api_f08_generated.F90 lib@OMPI_LIBMPI_NAME@_usempif08_la_SOURCES = \ $(mpi_api_files) \ mpi-f08.F90 -# These are generated; do not ship them -nodist_lib@OMPI_LIBMPI_NAME@_usempif08_la_SOURCES = - if BUILD_FORTRAN_SIZEOF SIZEOF_H = sizeof_f08.h -nodist_lib@OMPI_LIBMPI_NAME@_usempif08_la_SOURCES += \ +nodist_lib@OMPI_LIBMPI_NAME@_usempif08_la_SOURCES = \ sizeof_f08.h \ sizeof_f08.f90 \ - profile/psizeof_f08.f90 + psizeof_f08.f90 endif +lib@OMPI_LIBMPI_NAME@_usempif08_la_FCFLAGS = \ + $(AM_FCFLAGS) \ + -DOMPI_BUILD_MPI_PROFILING=0 + # # Include the mpi_f08-based MPI extensions in libmpi_usempif08, too. # @@ -539,13 +385,20 @@ endif # lib@OMPI_LIBMPI_NAME@_usempif08_la_LIBADD = \ - profile/libmpi_usempif08_pmpi.la \ + lib@OMPI_LIBMPI_NAME@_usempif08_profile.la \ $(OMPI_MPIEXT_USEMPIF08_LIBS) \ $(top_builddir)/ompi/mpi/fortran/mpif-h/lib@OMPI_LIBMPI_NAME@_mpifh.la \ $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la \ mod/libusempif08_internal_modules.la \ base/libusempif08_ccode.la -lib@OMPI_LIBMPI_NAME@_usempif08_la_DEPENDENCIES = $(module_sentinel_files) + +# +# Make sure to build the profile library before this library, since adding it +# to LIBADD doesn't enforce any ordering +# +lib@OMPI_LIBMPI_NAME@_usempif08_la_DEPENDENCIES = \ + $(module_sentinel_files) \ + lib@OMPI_LIBMPI_NAME@_usempif08_profile.la lib@OMPI_LIBMPI_NAME@_usempif08_la_LDFLAGS = -version-info $(libmpi_usempif08_so_version) # @@ -558,6 +411,46 @@ mpi_api_lo_files = $(mpi_api_files:.F90=.lo) $(mpi_api_lo_files): bindings/libforce_usempif08_internal_bindings_to_be_built.la mpi-f08.lo: $(module_sentinel_files) $(SIZEOF_H) +mpi-f08.F90: $(SIZEOF_H) + +# +# Profiling interface +# + +lib@OMPI_LIBMPI_NAME@_usempif08_profile_la_SOURCES = \ + $(mpi_api_files) + +lib@OMPI_LIBMPI_NAME@_usempif08_profile_la_FCFLAGS = \ + $(AM_FCFLAGS) \ + -DOMPI_BUILD_MPI_PROFILING=1 + + +# +# Generate the Fortran bindings and C wrapper functions for bindings with a +# *.in template. +# + +if OMPI_GENERATE_BINDINGS + +include Makefile.prototype_files +template_files =${prototype_files:%=$(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/%} + +api_f08_generated.F90: $(template_files) + $(OMPI_V_GEN) $(PYTHON) $(top_srcdir)/ompi/mpi/bindings/bindings.py \ + --builddir $(abs_top_builddir) \ + --srcdir $(abs_top_srcdir) \ + --output $(abs_builddir)/$@ \ + fortran \ + code \ + --lang fortran \ + --prototype-files $(template_files) + +EXTRA_DIST = $(prototype_files) + +endif + +# Delete generated file on maintainer-clean +MAINTAINERCLEANFILES = api_f08_generated.F90 ########################################################################### diff --git a/ompi/mpi/fortran/use-mpi-f08/Makefile.prototype_files b/ompi/mpi/fortran/use-mpi-f08/Makefile.prototype_files new file mode 100644 index 00000000000..f17f7edefa9 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/Makefile.prototype_files @@ -0,0 +1,169 @@ +# +# Shared list of prototype files to avoid listing dependencies multiple times. +# + +prototype_files = \ + accumulate_ts.c.in \ + allgather_init_ts.c.in \ + allgather_ts.c.in \ + allgatherv_init_ts.c.in \ + allgatherv_ts.c.in \ + allreduce_init_ts.c.in \ + allreduce_ts.c.in \ + alltoall_init_ts.c.in \ + alltoall_ts.c.in \ + alltoallv_init_ts.c.in \ + alltoallv_ts.c.in \ + alltoallw_init_ts.c.in \ + alltoallw_ts.c.in \ + bcast_init_ts.c.in \ + bcast_ts.c.in \ + bsend_init_ts.c.in \ + bsend_ts.c.in \ + buffer_attach_ts.c.in \ + buffer_detach.c.in \ + compare_and_swap_ts.c.in \ + exscan_init_ts.c.in \ + exscan_ts.c.in \ + fetch_and_op_ts.c.in \ + file_iread_all_ts.c.in \ + file_iread_at_all_ts.c.in \ + file_iread_at_ts.c.in \ + file_iread_shared_ts.c.in \ + file_iread_ts.c.in \ + file_iwrite_all_ts.c.in \ + file_iwrite_at_all_ts.c.in \ + file_iwrite_at_ts.c.in \ + file_iwrite_shared_ts.c.in \ + file_iwrite_ts.c.in \ + file_read_all_begin_ts.c.in \ + file_read_all_end_ts.c.in \ + file_read_all_ts.c.in \ + file_read_at_all_begin_ts.c.in \ + file_read_at_all_end_ts.c.in \ + file_read_at_all_ts.c.in \ + file_read_at_ts.c.in \ + file_read_ordered_begin_ts.c.in \ + file_read_ordered_end_ts.c.in \ + file_read_ordered_ts.c.in \ + file_read_shared_ts.c.in \ + file_read_ts.c.in \ + file_write_all_begin_ts.c.in \ + file_write_all_end_ts.c.in \ + file_write_all_ts.c.in \ + file_write_at_all_begin_ts.c.in \ + file_write_at_all_end_ts.c.in \ + file_write_at_all_ts.c.in \ + file_write_at_ts.c.in \ + file_write_ordered_begin_ts.c.in \ + file_write_ordered_end_ts.c.in \ + file_write_ordered_ts.c.in \ + file_write_shared_ts.c.in \ + file_write_ts.c.in \ + free_mem_ts.c.in \ + f_sync_reg_ts.c.in \ + gather_init_ts.c.in \ + gather_ts.c.in \ + gatherv_init_ts.c.in \ + gatherv_ts.c.in \ + get_accumulate_ts.c.in \ + get_address_ts.c.in \ + get_count.c.in \ + get_elements.c.in \ + get_ts.c.in \ + iallgather_ts.c.in \ + iallgatherv_ts.c.in \ + iallreduce_ts.c.in \ + ialltoall_ts.c.in \ + ialltoallv_ts.c.in \ + ialltoallw_ts.c.in \ + ibcast_ts.c.in \ + ibsend_ts.c.in \ + iexscan_ts.c.in \ + igather_ts.c.in \ + igatherv_ts.c.in \ + imrecv_ts.c.in \ + ineighbor_allgather_ts.c.in \ + ineighbor_allgatherv_ts.c.in \ + ineighbor_alltoall_ts.c.in \ + ineighbor_alltoallv_ts.c.in \ + ineighbor_alltoallw_ts.c.in \ + irecv_ts.c.in \ + ireduce_scatter_block_ts.c.in \ + ireduce_scatter_ts.c.in \ + ireduce_ts.c.in \ + irsend_ts.c.in \ + iscan_ts.c.in \ + iscatter_ts.c.in \ + iscatterv_ts.c.in \ + isendrecv_replace_ts.c.in \ + isendrecv_ts.c.in \ + isend_ts.c.in \ + issend_ts.c.in \ + mrecv_ts.c.in \ + neighbor_allgather_init_ts.c.in \ + neighbor_allgather_ts.c.in \ + neighbor_allgatherv_init_ts.c.in \ + neighbor_allgatherv_ts.c.in \ + neighbor_alltoall_init_ts.c.in \ + neighbor_alltoall_ts.c.in \ + neighbor_alltoallv_init_ts.c.in \ + neighbor_alltoallv_ts.c.in \ + neighbor_alltoallw_init_ts.c.in \ + neighbor_alltoallw_ts.c.in \ + pack_external_size.c.in \ + pack_external_ts.c.in \ + pack_size.c.in \ + pack_ts.c.in \ + precv_init_ts.c.in \ + psend_init_ts.c.in \ + put_ts.c.in \ + raccumulate_ts.c.in \ + recv_init_ts.c.in \ + recv_ts.c.in \ + reduce_init_ts.c.in \ + reduce_local_ts.c.in \ + reduce_scatter_block_init_ts.c.in \ + reduce_scatter_block_ts.c.in \ + reduce_scatter_init_ts.c.in \ + reduce_scatter_ts.c.in \ + reduce_ts.c.in \ + rget_accumulate_ts.c.in \ + rget_ts.c.in \ + rput_ts.c.in \ + rsend_init_ts.c.in \ + rsend_ts.c.in \ + scan_init_ts.c.in \ + scan_ts.c.in \ + scatter_init_ts.c.in \ + scatter_ts.c.in \ + scatterv_init_ts.c.in \ + scatterv_ts.c.in \ + send_init_ts.c.in \ + sendrecv_replace_ts.c.in \ + sendrecv_ts.c.in \ + send_ts.c.in \ + ssend_init_ts.c.in \ + ssend_ts.c.in \ + testany.c.in \ + type_contiguous.c.in \ + type_create_darray.c.in \ + type_create_hindexed_block.c.in \ + type_create_hindexed.c.in \ + type_create_hvector.c.in \ + type_create_indexed_block.c.in \ + type_create_struct.c.in \ + type_create_subarray.c.in \ + type_get_true_extent.c.in \ + type_indexed.c.in \ + type_size.c.in \ + type_vector.c.in \ + unpack_external_ts.c.in \ + unpack_ts.c.in \ + waitall.c.in \ + win_allocate.c.in \ + win_allocate_shared.c.in \ + win_attach_ts.c.in \ + win_create_ts.c.in \ + win_detach_ts.c.in \ + win_shared_query.c.in diff --git a/ompi/mpi/fortran/use-mpi-f08/accumulate_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/accumulate_f08.F90 deleted file mode 100644 index cf5f9ada671..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/accumulate_f08.F90 +++ /dev/null @@ -1,35 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2010-2022 Cisco Systems, Inc. All rights reserved -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All Rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Accumulate_f08(origin_addr,origin_count,origin_datatype,& - target_rank,target_disp,target_count, & - target_datatype,op,win,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Op, MPI_Win, MPI_ADDRESS_KIND - use :: ompi_mpifh_bindings, only : ompi_accumulate_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) OMPI_ASYNCHRONOUS :: origin_addr - INTEGER, INTENT(IN) :: origin_count, target_rank, target_count - TYPE(MPI_Datatype), INTENT(IN) :: origin_datatype - INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: target_disp - TYPE(MPI_Datatype), INTENT(IN) :: target_datatype - TYPE(MPI_Op), INTENT(IN) :: op - TYPE(MPI_Win), INTENT(IN) :: win - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_accumulate_f(origin_addr,origin_count,origin_datatype%MPI_VAL,target_rank,& - target_disp,target_count,target_datatype%MPI_VAL,& - op%MPI_VAL,win%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Accumulate_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/accumulate_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/accumulate_ts.c.in new file mode 100644 index 00000000000..b2d9495b025 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/accumulate_ts.c.in @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID accumulate(BUFFER x, COUNT origin_count, + DATATYPE origin_datatype, RANK target_rank, + AINT target_disp, COUNT target_count, + DATATYPE target_datatype, OP op, WIN win) +{ + int c_ierr; + + MPI_Datatype c_origin_datatype, c_origin_type = PMPI_Type_f2c(*origin_datatype); + MPI_Datatype c_target_datatype = PMPI_Type_f2c(*target_datatype); + MPI_Win c_win = PMPI_Win_f2c(*win); + MPI_Op c_op = PMPI_Op_f2c(*op); + char *origin_addr = OMPI_CFI_BASE_ADDR(x); + int c_origin_count = OMPI_INT_2_FINT(*origin_count); + + OMPI_CFI_2_C(x, c_origin_count, c_origin_type, c_origin_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_win, c_ierr, FUNC_NAME) + return; + } + c_ierr = @INNER_CALL@(OMPI_F2C_BOTTOM(origin_addr), + c_origin_count, + c_origin_datatype, + OMPI_FINT_2_INT(*target_rank), + *target_disp, + OMPI_FINT_2_INT(*target_count), + c_target_datatype, c_op, c_win); + if (c_origin_datatype != c_origin_type) { + ompi_datatype_destroy(&c_origin_datatype); + } + + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/allgather_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/allgather_f08.F90 deleted file mode 100644 index ed2aefbad59..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/allgather_f08.F90 +++ /dev/null @@ -1,31 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Allgather_f08(sendbuf,sendcount,sendtype,recvbuf,recvcount,recvtype,comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm - use :: ompi_mpifh_bindings, only : ompi_allgather_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE :: recvbuf - INTEGER, INTENT(IN) :: sendcount, recvcount - TYPE(MPI_Datatype), INTENT(IN) :: sendtype - TYPE(MPI_Datatype), INTENT(IN) :: recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_allgather_f(sendbuf,sendcount,sendtype%MPI_VAL,& - recvbuf,recvcount,recvtype%MPI_VAL,comm%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Allgather_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/allgather_init_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/allgather_init_f08.F90 deleted file mode 100644 index 8fe93a449d0..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/allgather_init_f08.F90 +++ /dev/null @@ -1,34 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2022 Cisco Systems, Inc. All rights reserved -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2021 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Allgather_init_f08(sendbuf,sendcount,sendtype,recvbuf,recvcount,recvtype,comm,info,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Info, MPI_Request - use :: ompi_mpifh_bindings, only : ompi_allgather_init_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: sendcount, recvcount - TYPE(MPI_Datatype), INTENT(IN) :: sendtype - TYPE(MPI_Datatype), INTENT(IN) :: recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_allgather_init_f(sendbuf,sendcount,sendtype%MPI_VAL,& - recvbuf,recvcount,recvtype%MPI_VAL,comm%MPI_VAL,info%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Allgather_init_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/allgather_init_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/allgather_init_ts.c.in new file mode 100644 index 00000000000..215c880f1df --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/allgather_init_ts.c.in @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2021 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + + +PROTOTYPE VOID allgather_init(BUFFER_ASYNC x1, COUNT sendcount, DATATYPE sendtype, + BUFFER_ASYNC_OUT x2, COUNT recvcount, DATATYPE recvtype, + COMM comm, INFO info, REQUEST_OUT request) +{ + int c_ierr; + MPI_Comm c_comm = PMPI_Comm_f2c(*comm); + MPI_Request c_req; + MPI_Datatype c_sendtype = NULL, c_recvtype = NULL, c_senddatatype = NULL; + MPI_Info c_info; + void *sendbuf = OMPI_CFI_BASE_ADDR(x1), *recvbuf = OMPI_CFI_BASE_ADDR(x2); + @COUNT_TYPE@ c_sendcount = (@COUNT_TYPE@) *sendcount; + + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + + c_comm = PMPI_Comm_f2c(*comm); + c_sendtype = PMPI_Type_f2c(*sendtype); + c_senddatatype = c_sendtype; + c_recvtype = PMPI_Type_f2c(*recvtype); + c_info = PMPI_Info_f2c(*info); + + sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf); + sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); + recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); + + if (OMPI_COMM_IS_INTER(c_comm) || !OMPI_IS_FORTRAN_IN_PLACE(sendbuf)) { + OMPI_CFI_2_C(x1, c_sendcount, c_sendtype, c_senddatatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + } else { + sendbuf = MPI_IN_PLACE; + } + + c_ierr = @INNER_CALL@(sendbuf, + c_sendcount, + c_senddatatype, + recvbuf, + (@COUNT_TYPE@) *recvcount, + c_recvtype, c_comm, c_info, &c_req); + + if (c_senddatatype != c_sendtype) { + ompi_datatype_destroy(&c_senddatatype); + } + + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) *request = PMPI_Request_c2f(c_req); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/allgather_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/allgather_ts.c.in new file mode 100644 index 00000000000..db3305b9057 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/allgather_ts.c.in @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + + +PROTOTYPE VOID allgather(BUFFER x1, COUNT sendcount, DATATYPE sendtype, + BUFFER_OUT x2, COUNT recvcount, DATATYPE recvtype, + COMM comm) +{ + int c_ierr; + MPI_Comm c_comm = PMPI_Comm_f2c(*comm); + int c_sendcount = 0; + MPI_Datatype c_sendtype = NULL, c_senddatatype = NULL; + MPI_Datatype c_recvtype = PMPI_Type_f2c(*recvtype); + void *sendbuf = OMPI_CFI_BASE_ADDR(x1), *recvbuf = OMPI_CFI_BASE_ADDR(x2); + + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + + if (OMPI_COMM_IS_INTER(c_comm) || !OMPI_IS_FORTRAN_IN_PLACE(sendbuf)) { + c_sendtype = PMPI_Type_f2c(*sendtype); + c_sendcount = OMPI_FINT_2_INT(*sendcount); + OMPI_CFI_2_C(x1, c_sendcount, c_sendtype, c_senddatatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + } else { + sendbuf = MPI_IN_PLACE; + } + + sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); + recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); + + c_ierr = @INNER_CALL@(sendbuf, + c_sendcount, + c_senddatatype, + recvbuf, + OMPI_FINT_2_INT(*recvcount), + c_recvtype, c_comm); + + if (c_senddatatype != c_sendtype) { + ompi_datatype_destroy(&c_senddatatype); + } + + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/allgatherv_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/allgatherv_f08.F90 deleted file mode 100644 index 260b89a986b..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/allgatherv_f08.F90 +++ /dev/null @@ -1,33 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Allgatherv_f08(sendbuf,sendcount,sendtype,recvbuf,recvcounts,& - displs,recvtype,comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm - use :: ompi_mpifh_bindings, only : ompi_allgatherv_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE :: recvbuf - INTEGER, INTENT(IN) :: sendcount - INTEGER, INTENT(IN) :: recvcounts(*), displs(*) - TYPE(MPI_Datatype), INTENT(IN) :: sendtype - TYPE(MPI_Datatype), INTENT(IN) :: recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_allgatherv_f(sendbuf,sendcount,sendtype%MPI_VAL,recvbuf,recvcounts,& - displs,recvtype%MPI_VAL,comm%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Allgatherv_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/allgatherv_init_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/allgatherv_init_f08.F90 deleted file mode 100644 index 97f1b223350..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/allgatherv_init_f08.F90 +++ /dev/null @@ -1,36 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2022 Cisco Systems, Inc. All rights reserved -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2021 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Allgatherv_init_f08(sendbuf,sendcount,sendtype,recvbuf,recvcounts,& - displs,recvtype,comm,info,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Info, MPI_Request - use :: ompi_mpifh_bindings, only : ompi_allgatherv_init_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: sendcount - INTEGER, INTENT(IN) OMPI_ASYNCHRONOUS :: recvcounts(*), displs(*) - TYPE(MPI_Datatype), INTENT(IN) :: sendtype - TYPE(MPI_Datatype), INTENT(IN) :: recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_allgatherv_init_f(sendbuf,sendcount,sendtype%MPI_VAL,recvbuf,recvcounts,& - displs,recvtype%MPI_VAL,comm%MPI_VAL,info%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Allgatherv_init_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/allgatherv_init_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/allgatherv_init_ts.c.in new file mode 100644 index 00000000000..c559a5f107a --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/allgatherv_init_ts.c.in @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2021 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2021 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID allgatherv_init(BUFFER_ASYNC x1, COUNT sendcount, DATATYPE sendtype, + BUFFER_ASYNC_OUT x2, COUNT_ARRAY recvcounts, DISP_ARRAY displs, + DATATYPE recvtype, COMM comm, + INFO info, REQUEST_OUT request) +{ + MPI_Comm c_comm; + MPI_Datatype c_sendtype = NULL, c_senddatatype = NULL, c_recvtype = NULL; + MPI_Request c_request; + MPI_Info c_info; + int size, idx = 0, c_ierr; + char *sendbuf = OMPI_CFI_BASE_ADDR(x1), *recvbuf = OMPI_CFI_BASE_ADDR(x2); + @COUNT_TYPE@ c_sendcount = (@COUNT_TYPE@) *sendcount; + @COUNT_TYPE@ *tmp_recvcounts = NULL; + @DISP_TYPE@ *tmp_displs = NULL; + + c_comm = PMPI_Comm_f2c(*comm); + c_sendtype = PMPI_Type_f2c(*sendtype); + c_recvtype = PMPI_Type_f2c(*recvtype); + c_info = PMPI_Info_f2c(*info); + + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + + if (OMPI_COMM_IS_INTER(c_comm)) { + size = ompi_comm_remote_size(c_comm); + c_sendtype = PMPI_Type_f2c(*sendtype); + OMPI_CFI_2_C(x1, c_sendcount, c_sendtype, c_senddatatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + } else { + size = ompi_comm_size(c_comm); + if (OMPI_IS_FORTRAN_IN_PLACE(sendbuf)) { + sendbuf = MPI_IN_PLACE; + } else { + c_sendtype = PMPI_Type_f2c(*sendtype); + OMPI_CFI_2_C(x1, c_sendcount, c_sendtype, c_senddatatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + } + } + + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(recvcounts, tmp_recvcounts, size); + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(displs, tmp_displs, size); + + sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf); + sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); + recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); + + c_ierr = @INNER_CALL@(sendbuf, + c_sendcount, + c_senddatatype, + recvbuf, + tmp_recvcounts, + tmp_displs, + c_recvtype, c_comm, c_info, &c_request); + + if (c_senddatatype != c_sendtype) { + ompi_datatype_destroy(&c_senddatatype); + } + + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + if (MPI_SUCCESS == c_ierr) { + *request = PMPI_Request_c2f(c_request); + } + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP_NONBLOCKING(recvcounts, tmp_recvcounts, c_request, c_ierr, idx); + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP_NONBLOCKING(displs, tmp_displs, c_request, c_ierr, idx); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/allgatherv_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/allgatherv_ts.c.in new file mode 100644 index 00000000000..bccc21b864e --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/allgatherv_ts.c.in @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + + +PROTOTYPE VOID allgatherv(BUFFER x1, COUNT sendcount, DATATYPE sendtype, + BUFFER_OUT x2, COUNT_ARRAY recvcounts, DISP_ARRAY displs, + DATATYPE recvtype, COMM comm) +{ + int c_ierr; + MPI_Comm c_comm = PMPI_Comm_f2c(*comm); + int c_sendcount = 0; + MPI_Datatype c_sendtype = NULL, c_senddatatype = NULL, c_recvtype = PMPI_Type_f2c(*recvtype); + char *sendbuf = OMPI_CFI_BASE_ADDR(x1), *recvbuf = OMPI_CFI_BASE_ADDR(x2); + int size = 0; + @COUNT_TYPE@ *tmp_recvcounts = NULL; + @DISP_TYPE@ *tmp_displs = NULL; + + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + + if (OMPI_COMM_IS_INTER(c_comm)) { + size = ompi_comm_remote_size(c_comm); + c_sendtype = PMPI_Type_f2c(*sendtype); + c_sendcount = (@COUNT_TYPE@) *sendcount; + OMPI_CFI_2_C(x1, c_sendcount, c_sendtype, c_senddatatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + } else { + size = ompi_comm_size(c_comm); + if (OMPI_IS_FORTRAN_IN_PLACE(sendbuf)) { + sendbuf = MPI_IN_PLACE; + } else { + c_sendtype = PMPI_Type_f2c(*sendtype); + c_sendcount = (@COUNT_TYPE@) *sendcount; + OMPI_CFI_2_C(x1, c_sendcount, c_sendtype, c_senddatatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + } + } + + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(recvcounts, tmp_recvcounts, size); + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(displs, tmp_displs, size); + + sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); + recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); + + c_ierr = @INNER_CALL@(sendbuf, + c_sendcount, + c_senddatatype, + recvbuf, + tmp_recvcounts, + tmp_displs, + c_recvtype, c_comm); + + if (c_senddatatype != c_sendtype) { + ompi_datatype_destroy(&c_senddatatype); + } + + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP(recvcounts, tmp_recvcounts); + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP(displs, tmp_displs); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/allreduce_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/allreduce_f08.F90 deleted file mode 100644 index 0e98b9e171a..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/allreduce_f08.F90 +++ /dev/null @@ -1,31 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Allreduce_f08(sendbuf,recvbuf,count,datatype,op,comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Op, MPI_Comm - use :: ompi_mpifh_bindings, only : ompi_allreduce_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE :: recvbuf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Op), INTENT(IN) :: op - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_allreduce_f(sendbuf,recvbuf,count,datatype%MPI_VAL,& - op%MPI_VAL,comm%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Allreduce_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/allreduce_init_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/allreduce_init_f08.F90 deleted file mode 100644 index 85b67cac49c..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/allreduce_init_f08.F90 +++ /dev/null @@ -1,34 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2022 Cisco Systems, Inc. All rights reserved -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2021 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Allreduce_init_f08(sendbuf,recvbuf,count,datatype,op,comm,info,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Op, MPI_Comm, MPI_Info, MPI_Request - use :: ompi_mpifh_bindings, only : ompi_allreduce_init_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Op), INTENT(IN) :: op - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_allreduce_init_f(sendbuf,recvbuf,count,datatype%MPI_VAL,& - op%MPI_VAL,comm%MPI_VAL,info%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Allreduce_init_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/allreduce_init_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/allreduce_init_ts.c.in new file mode 100644 index 00000000000..7a12727f921 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/allreduce_init_ts.c.in @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2021 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID allreduce_init(BUFFER_ASYNC x1, BUFFER_ASYNC_OUT x2, COUNT count, + DATATYPE datatype, OP op, COMM comm, + INFO info, REQUEST_OUT request) +{ + int c_ierr; + MPI_Comm c_comm; + MPI_Datatype c_type; + MPI_Info c_info; + MPI_Request c_request; + MPI_Op c_op; + char *sendbuf = OMPI_CFI_BASE_ADDR(x1), *recvbuf = OMPI_CFI_BASE_ADDR(x2); + + c_comm = PMPI_Comm_f2c(*comm); + c_type = PMPI_Type_f2c(*datatype); + c_op = PMPI_Op_f2c(*op); + c_info = PMPI_Info_f2c(*info); + + OMPI_CFI_CHECK_CONTIGUOUS(x1, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + + sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf); + sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); + recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); + + c_ierr = @INNER_CALL@(sendbuf, recvbuf, + (@COUNT_TYPE@) *count, + c_type, c_op, c_comm, c_info, &c_request); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + if (MPI_SUCCESS == c_ierr) *request = PMPI_Request_c2f(c_request); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/allreduce_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/allreduce_ts.c.in new file mode 100644 index 00000000000..05039409c59 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/allreduce_ts.c.in @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + + +PROTOTYPE VOID allreduce(BUFFER x1, BUFFER_OUT x2, COUNT count, + DATATYPE datatype, OP op, COMM comm) +{ + int c_ierr; + @COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count; + MPI_Comm c_comm = PMPI_Comm_f2c(*comm); + MPI_Datatype c_type; + MPI_Op c_op; + char *sendbuf = OMPI_CFI_BASE_ADDR(x1), *recvbuf = OMPI_CFI_BASE_ADDR(x2); + + OMPI_CFI_CHECK_CONTIGUOUS(x1, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + c_type = PMPI_Type_f2c(*datatype); + c_op = PMPI_Op_f2c(*op); + + sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf); + sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); + recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); + + c_ierr = @INNER_CALL@(sendbuf, recvbuf, + c_count, + c_type, c_op, c_comm); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/alltoall_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/alltoall_f08.F90 deleted file mode 100644 index f201dd2f769..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/alltoall_f08.F90 +++ /dev/null @@ -1,32 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Alltoall_f08(sendbuf,sendcount,sendtype,recvbuf,& - recvcount,recvtype,comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm - use :: ompi_mpifh_bindings, only : ompi_alltoall_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE :: recvbuf - INTEGER, INTENT(IN) :: sendcount, recvcount - TYPE(MPI_Datatype), INTENT(IN) :: sendtype - TYPE(MPI_Datatype), INTENT(IN) :: recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_alltoall_f(sendbuf,sendcount,sendtype%MPI_VAL,recvbuf,& - recvcount,recvtype%MPI_VAL,comm%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Alltoall_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/alltoall_init_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/alltoall_init_f08.F90 deleted file mode 100644 index 513ef505d00..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/alltoall_init_f08.F90 +++ /dev/null @@ -1,35 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2022 Cisco Systems, Inc. All rights reserved -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2021 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Alltoall_init_f08(sendbuf,sendcount,sendtype,recvbuf,& - recvcount,recvtype,comm,info,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Info, MPI_Request - use :: ompi_mpifh_bindings, only : ompi_alltoall_init_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: sendcount, recvcount - TYPE(MPI_Datatype), INTENT(IN) :: sendtype - TYPE(MPI_Datatype), INTENT(IN) :: recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_alltoall_init_f(sendbuf,sendcount,sendtype%MPI_VAL,recvbuf,& - recvcount,recvtype%MPI_VAL,comm%MPI_VAL,info%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Alltoall_init_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/alltoall_init_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/alltoall_init_ts.c.in new file mode 100644 index 00000000000..63e45a47080 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/alltoall_init_ts.c.in @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2021 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + + +PROTOTYPE VOID alltoall_init(BUFFER_ASYNC x1, COUNT sendcount, DATATYPE sendtype, + BUFFER_ASYNC_OUT x2, COUNT recvcount, DATATYPE recvtype, + COMM comm, INFO info, REQUEST_OUT request) +{ + int c_ierr; + MPI_Comm c_comm; + MPI_Request c_req; + MPI_Datatype c_sendtype, c_recvtype; + MPI_Info c_info; + void *sendbuf = OMPI_CFI_BASE_ADDR(x1), *recvbuf = OMPI_CFI_BASE_ADDR(x2); + + c_comm = PMPI_Comm_f2c(*comm); + c_sendtype = PMPI_Type_f2c(*sendtype); + c_recvtype = PMPI_Type_f2c(*recvtype); + c_info = PMPI_Info_f2c(*info); + + if (OMPI_COMM_IS_INTER(c_comm) || !OMPI_IS_FORTRAN_IN_PLACE(sendbuf)) { + OMPI_CFI_CHECK_CONTIGUOUS(x1, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + } else { + sendbuf = MPI_IN_PLACE; + } + + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + + sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf); + sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); + recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); + + c_ierr = @INNER_CALL@(sendbuf, + (@COUNT_TYPE@) *sendcount, + c_sendtype, + recvbuf, + (@COUNT_TYPE@) *recvcount, + c_recvtype, c_comm, c_info, &c_req); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) *request = PMPI_Request_c2f(c_req); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/alltoall_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/alltoall_ts.c.in new file mode 100644 index 00000000000..b1412f45932 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/alltoall_ts.c.in @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + + +PROTOTYPE VOID alltoall(BUFFER x1, COUNT sendcount, DATATYPE sendtype, + BUFFER_OUT x2, COUNT recvcount, DATATYPE recvtype, + COMM comm) +{ + int c_ierr; + MPI_Comm c_comm = PMPI_Comm_f2c(*comm); + MPI_Datatype c_sendtype = NULL, c_recvtype = PMPI_Type_f2c(*recvtype); + void *sendbuf = OMPI_CFI_BASE_ADDR(x1), *recvbuf = OMPI_CFI_BASE_ADDR(x2); + int c_sendcount = 0, c_recvcount = OMPI_FINT_2_INT(*recvcount); + + if (OMPI_COMM_IS_INTER(c_comm) || !OMPI_IS_FORTRAN_IN_PLACE(sendbuf)) { + c_sendtype = PMPI_Type_f2c(*sendtype); + c_sendcount = OMPI_FINT_2_INT(*sendcount); + OMPI_CFI_CHECK_CONTIGUOUS(x1, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + } else { + sendbuf = MPI_IN_PLACE; + } + + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + + sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); + recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); + + c_ierr = @INNER_CALL@(sendbuf, + c_sendcount, + c_sendtype, + recvbuf, + c_recvcount, + c_recvtype, c_comm); + + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/alltoallv_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/alltoallv_f08.F90 deleted file mode 100644 index 0acf0fd03a5..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/alltoallv_f08.F90 +++ /dev/null @@ -1,32 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Alltoallv_f08(sendbuf,sendcounts,sdispls,sendtype,recvbuf,& - recvcounts,rdispls,recvtype,comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm - use :: ompi_mpifh_bindings, only : ompi_alltoallv_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE :: recvbuf - INTEGER, INTENT(IN) :: sendcounts(*), sdispls(*), recvcounts(*), rdispls(*) - TYPE(MPI_Datatype), INTENT(IN) :: sendtype - TYPE(MPI_Datatype), INTENT(IN) :: recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_alltoallv_f(sendbuf,sendcounts,sdispls,sendtype%MPI_VAL,& - recvbuf,recvcounts,rdispls,recvtype%MPI_VAL,comm%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Alltoallv_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/alltoallv_init_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/alltoallv_init_f08.F90 deleted file mode 100644 index 49bf9e97d01..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/alltoallv_init_f08.F90 +++ /dev/null @@ -1,35 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2022 Cisco Systems, Inc. All rights reserved -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2021 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Alltoallv_init_f08(sendbuf,sendcounts,sdispls,sendtype,recvbuf,& - recvcounts,rdispls,recvtype,comm,info,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Info, MPI_Request - use :: ompi_mpifh_bindings, only : ompi_alltoallv_init_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) OMPI_ASYNCHRONOUS :: sendcounts(*), sdispls(*), recvcounts(*), rdispls(*) - TYPE(MPI_Datatype), INTENT(IN) :: sendtype - TYPE(MPI_Datatype), INTENT(IN) :: recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_alltoallv_init_f(sendbuf,sendcounts,sdispls,sendtype%MPI_VAL,& - recvbuf,recvcounts,rdispls,recvtype%MPI_VAL,comm%MPI_VAL,info%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Alltoallv_init_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/alltoallv_init_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/alltoallv_init_ts.c.in new file mode 100644 index 00000000000..5bdd4155294 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/alltoallv_init_ts.c.in @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2021 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2021 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID alltoallv_init(BUFFER_ASYNC x1, COUNT_ARRAY sendcounts, DISP_ARRAY sdispls, + DATATYPE sendtype, BUFFER_ASYNC_OUT x2, COUNT_ARRAY recvcounts, + DISP_ARRAY rdispls, DATATYPE recvtype, + COMM comm, INFO info, REQUEST_OUT request) +{ + MPI_Comm c_comm; + MPI_Datatype c_sendtype, c_recvtype; + MPI_Info c_info; + MPI_Request c_request; + int size, idx = 0, c_ierr; + @COUNT_TYPE@ *tmp_sendcounts = NULL; + @DISP_TYPE@ *tmp_sdispls = NULL; + @COUNT_TYPE@ *tmp_recvcounts = NULL; + @DISP_TYPE@ *tmp_rdispls = NULL; + char *sendbuf = OMPI_CFI_BASE_ADDR(x1), *recvbuf = OMPI_CFI_BASE_ADDR(x2); + + c_comm = PMPI_Comm_f2c(*comm); + c_sendtype = PMPI_Type_f2c(*sendtype); + c_recvtype = PMPI_Type_f2c(*recvtype); + c_info = PMPI_Info_f2c(*info); + + PMPI_Comm_size(c_comm, &size); + if (OMPI_COMM_IS_INTER(c_comm) || !OMPI_IS_FORTRAN_IN_PLACE(sendbuf)) { + OMPI_CFI_CHECK_CONTIGUOUS(x1, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(sendcounts, tmp_sendcounts, size); + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(sdispls, tmp_sdispls, size); + } else { + sendbuf = MPI_IN_PLACE; + } + + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + OMPI_ARRAY_FINT_2_INT(sendcounts, size); + OMPI_ARRAY_FINT_2_INT(sdispls, size); + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(recvcounts, tmp_recvcounts, size); + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(rdispls, tmp_rdispls, size); + + sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf); + sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); + recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); + + c_ierr = @INNER_CALL@(sendbuf, + tmp_sendcounts, + tmp_sdispls, + c_sendtype, + recvbuf, + tmp_recvcounts, + tmp_rdispls, + c_recvtype, c_comm, c_info, &c_request); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + if (MPI_SUCCESS == c_ierr) { + *request = PMPI_Request_c2f(c_request); + } + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP_NONBLOCKING(sendcounts, tmp_sendcounts, c_request, c_ierr, idx); + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP_NONBLOCKING(sdispls, tmp_sdispls, c_request, c_ierr, idx); + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP_NONBLOCKING(recvcounts, tmp_recvcounts, c_request, c_ierr, idx); + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP_NONBLOCKING(rdispls, tmp_rdispls, c_request, c_ierr, idx); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/alltoallv_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/alltoallv_ts.c.in new file mode 100644 index 00000000000..bac6148455f --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/alltoallv_ts.c.in @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID alltoallv(BUFFER x1, COUNT_ARRAY sendcounts, DISP_ARRAY sdispls, + DATATYPE sendtype, BUFFER_OUT x2, COUNT_ARRAY recvcounts, + DISP_ARRAY rdispls, DATATYPE recvtype, COMM comm) +{ + int c_ierr; + MPI_Comm c_comm = PMPI_Comm_f2c(*comm); + char *sendbuf = OMPI_CFI_BASE_ADDR(x1), *recvbuf = OMPI_CFI_BASE_ADDR(x2); + MPI_Datatype c_sendtype = NULL, c_recvtype = PMPI_Type_f2c(*recvtype); + int size = OMPI_COMM_IS_INTER(c_comm)?ompi_comm_remote_size(c_comm):ompi_comm_size(c_comm); + @COUNT_TYPE@ *tmp_sendcounts = NULL; + @DISP_TYPE@ *tmp_sdispls = NULL; + @COUNT_TYPE@ *tmp_recvcounts = NULL; + @DISP_TYPE@ *tmp_rdispls = NULL; + + if (OMPI_COMM_IS_INTER(c_comm) || !OMPI_IS_FORTRAN_IN_PLACE(sendbuf)) { + c_sendtype = PMPI_Type_f2c(*sendtype); + OMPI_CFI_CHECK_CONTIGUOUS(x1, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(sendcounts, tmp_sendcounts, size); + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(sdispls, tmp_sdispls, size); + } else { + sendbuf = MPI_IN_PLACE; + } + + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(recvcounts, tmp_recvcounts, size); + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(rdispls, tmp_rdispls, size); + + sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); + recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); + + c_ierr = @INNER_CALL@(sendbuf, + tmp_sendcounts, + tmp_sdispls, + c_sendtype, + recvbuf, + tmp_recvcounts, + tmp_rdispls, + c_recvtype, c_comm); + + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + if (MPI_IN_PLACE == sendbuf) { + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP(sendcounts, tmp_sendcounts); + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP(sdispls, tmp_sdispls); + } + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP(recvcounts, tmp_recvcounts); + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP(rdispls, tmp_rdispls); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/alltoallw_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/alltoallw_f08.F90 deleted file mode 100644 index f63ac4842f7..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/alltoallw_f08.F90 +++ /dev/null @@ -1,42 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2013 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Alltoallw_f08(sendbuf,sendcounts,sdispls,sendtypes,& - recvbuf,recvcounts,rdispls,recvtypes,comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm - use :: ompi_mpifh_bindings, only : ompi_alltoallw_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE :: recvbuf - INTEGER, INTENT(IN) :: sendcounts(*), sdispls(*), recvcounts(*), rdispls(*) - TYPE(MPI_Datatype), INTENT(IN) :: sendtypes(*) - TYPE(MPI_Datatype), INTENT(IN) :: recvtypes(*) - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - ! Note that we pass a scalar here for both the sendtypes and - ! recvtypes arguments, even though the real Alltoallw function - ! expects an array of integers. This is a hack: we know that - ! [send|recv]types(1)%MPI_VAL will pass the address of the first - ! integer in the array of Type(MPI_Datatype) derived types. And - ! since Type(MPI_Datatype) are exactly memory-equivalent to a - ! single INTEGER, passing the address of the first one is the same - ! as passing the address to an array of integers. To be clear: the - ! back-end ompi_alltoallw_f is expecting a pointer to an array of - ! integers. So it all works out (but is a hack :-\ ). - call ompi_alltoallw_f(sendbuf,sendcounts,sdispls,sendtypes(1)%MPI_VAL,& - recvbuf,recvcounts,rdispls,recvtypes(1)%MPI_VAL,comm%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Alltoallw_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/alltoallw_init_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/alltoallw_init_f08.F90 deleted file mode 100644 index ce2dbd88532..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/alltoallw_init_f08.F90 +++ /dev/null @@ -1,44 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2022 Cisco Systems, Inc. All rights reserved -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2021 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Alltoallw_init_f08(sendbuf,sendcounts,sdispls,sendtypes,& - recvbuf,recvcounts,rdispls,recvtypes,comm,info,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Info, MPI_Request - use :: ompi_mpifh_bindings, only : ompi_alltoallw_init_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) OMPI_ASYNCHRONOUS :: sendcounts(*), sdispls(*), recvcounts(*), rdispls(*) - TYPE(MPI_Datatype), INTENT(IN) OMPI_ASYNCHRONOUS :: sendtypes(*), recvtypes(*) - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - ! Note that we pass a scalar here for both the sendtypes and - ! recvtypes arguments, even though the real Alltoallw function - ! expects an array of integers. This is a hack: we know that - ! [send|recv]types(1)%MPI_VAL will pass the address of the first - ! integer in the array of Type(MPI_Datatype) derived types. And - ! since Type(MPI_Datatype) are exactly memory-equivalent to a - ! single INTEGER, passing the address of the first one is the same - ! as passing the address to an array of integers. To be clear: the - ! back-end ompi_alltoallw_f is expecting a pointer to an array of - ! integers. So it all works out (but is a hack :-\ ). - call ompi_alltoallw_init_f(sendbuf,sendcounts,sdispls,sendtypes(1)%MPI_VAL,& - recvbuf,recvcounts,rdispls,recvtypes(1)%MPI_VAL,comm%MPI_VAL,info%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Alltoallw_init_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/alltoallw_init_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/alltoallw_init_ts.c.in new file mode 100644 index 00000000000..34765cd1af1 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/alltoallw_init_ts.c.in @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2021 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2021 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID alltoallw_init(BUFFER_ASYNC x1, COUNT_ARRAY sendcounts, + DISP_ARRAY sdispls, DATATYPE_ARRAY sendtypes, + BUFFER_ASYNC_OUT x2, COUNT_ARRAY recvcounts, + DISP_ARRAY rdispls, DATATYPE_ARRAY recvtypes, + COMM comm, INFO info, REQUEST_OUT request) +{ + MPI_Comm c_comm; + MPI_Datatype *c_sendtypes = NULL, *c_recvtypes; + MPI_Info c_info; + MPI_Request c_request; + int size, idx = 0, c_ierr; + char *sendbuf = OMPI_CFI_BASE_ADDR(x1), *recvbuf = OMPI_CFI_BASE_ADDR(x2); + @COUNT_TYPE@ *tmp_sendcounts = NULL; + @DISP_TYPE@ *tmp_sdispls = NULL; + @COUNT_TYPE@ *tmp_recvcounts = NULL; + @DISP_TYPE@ *tmp_rdispls = NULL; + + c_comm = PMPI_Comm_f2c(*comm); + c_info = PMPI_Info_f2c(*info); + + OMPI_CFI_CHECK_CONTIGUOUS(x1, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + + size = OMPI_COMM_IS_INTER(c_comm)?ompi_comm_remote_size(c_comm):ompi_comm_size(c_comm); + + if (!OMPI_IS_FORTRAN_IN_PLACE(sendbuf)) { + c_sendtypes = (MPI_Datatype *) malloc(size * sizeof(MPI_Datatype)); + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(sendcounts, tmp_sendcounts, size); + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(sdispls, tmp_sdispls, size); + for (int i=0; idata.release_arrays[(idx)++] = tmp_array; \ + } \ + nb_request->data.release_arrays[idx] = NULL; \ + } else { \ + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP((array), (tmp_array)); \ + } \ + } while (0) diff --git a/ompi/mpi/fortran/use-mpi-f08/base/buffer_detach.c b/ompi/mpi/fortran/use-mpi-f08/base/buffer_detach.c deleted file mode 100644 index 5d2cfa849f7..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/base/buffer_detach.c +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana - * University Research and Technology - * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University - * of Tennessee Research Foundation. All rights - * reserved. - * Copyright (c) 2004-2005 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 Sun Microsystems, Inc. All rights reserved. - * Copyright (c) 2011-2015 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2015 Research Organization for Information Science - * and Technology (RIST). All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#include "ompi_config.h" - -#include "mpi.h" -#include "ompi/mpi/fortran/base/fint_2_int.h" - -/* - * This function implemented in this file is only called from Fortran, - * so we never bothered to put a prototype for it in any C header - * file. To avoid compiler warnings about no prototype, we prototype - * it here. - */ -OMPI_DECLSPEC void ompi_buffer_detach_f08(char *buffer, MPI_Fint *size, - MPI_Fint *ierr); - -OMPI_DECLSPEC void pompi_buffer_detach_f08(char *buffer, MPI_Fint *size, - MPI_Fint *ierr); - -/* (this comment is repeated in ompi/mpi/fortran/mpif-h/buffer_detach_f.c) - * - * MPI-3.1 section 3.6, page 45, states that the mpif.h and mpi module - * interfaces for MPI_BUFFER_DETACH ignore the buffer argument. - * Therefore, for the mpif.h and mpi module interfaces, we use a dummy - * variable and leave the value handed in alone. - * - * The mpi_f08 implementation for MPI_BUFFER_DETACH therefore is a - * separate routine in the use-mpi-f08 directory (it's not built in - * the mpif-h directory because of all the different combinations of - * supporting weak symbols (or not), building the profiling layer (or - * not), etc.). - * - * Note that we only need to build this function once -- the F08 - * interfaces for MPI_BUFFER_ATTACH and PMPI_BUFFER_ATTACH both - * bind(C) to the name ompi_buffer_detach_f08. - */ -void ompi_buffer_detach_f08(char *buffer, MPI_Fint *size, MPI_Fint *ierr) -{ - int c_ierr; - void *dummy; - OMPI_SINGLE_NAME_DECL(size); - - c_ierr = PMPI_Buffer_detach(&dummy, OMPI_SINGLE_NAME_CONVERT(size)); - if (NULL != ierr) { - *ierr = OMPI_INT_2_FINT(c_ierr); - } - - if (MPI_SUCCESS == c_ierr) { - OMPI_SINGLE_INT_2_FINT(size); - *(void **)buffer = dummy; - } -} - -void pompi_buffer_detach_f08(char *buffer, MPI_Fint *size, MPI_Fint *ierr) -{ - ompi_buffer_detach_f08(buffer, size, ierr); -} diff --git a/ompi/mpi/fortran/use-mpi-f08/base/ompi_type_get_contents_f_c.c b/ompi/mpi/fortran/use-mpi-f08/base/ompi_type_get_contents_f_c.c new file mode 100644 index 00000000000..c40551be2c7 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/base/ompi_type_get_contents_f_c.c @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2004-2005 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-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" + +#include "ompi/datatype/ompi_datatype.h" +#include "ompi/errhandler/errhandler.h" +#include "ompi/mpi/fortran/base/fint_2_int.h" + +/* + * big count entry point, only needed by F08 bindings. + */ + +static const char FUNC_NAME[] = "MPI_TYPE_GET_CONTENTS_C"; + +void ompi_type_get_contents_f_c(MPI_Fint *mtype, MPI_Count *max_integers, + MPI_Count *max_addresses, MPI_Count *max_large_counts, + MPI_Count *max_datatypes, + MPI_Fint *array_of_integers, + MPI_Aint *array_of_addresses, + MPI_Count *array_of_large_counts, + MPI_Fint *array_of_datatypes, MPI_Fint *ierr); +void ompi_type_get_contents_f_c(MPI_Fint *mtype, MPI_Count *max_integers, + MPI_Count *max_addresses, MPI_Count *max_large_counts, + MPI_Count *max_datatypes, + MPI_Fint *array_of_integers, + MPI_Aint *array_of_addresses, + MPI_Count *array_of_large_counts, + MPI_Fint *array_of_datatypes, MPI_Fint *ierr) +{ + MPI_Aint *c_address_array = NULL; + MPI_Count *c_large_counts_array = NULL; + MPI_Datatype *c_datatype_array = NULL; + MPI_Datatype c_mtype = PMPI_Type_f2c(*mtype); + int i, c_ierr; + OMPI_ARRAY_NAME_DECL(array_of_integers); + + if (*max_datatypes) { + c_datatype_array = (MPI_Datatype *) malloc(*max_datatypes * sizeof(MPI_Datatype)); + if (NULL == c_datatype_array) { + c_ierr = OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_NO_MEM, + FUNC_NAME); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + return; + } + } + + if (*max_addresses) { + c_address_array = (MPI_Aint *) malloc(*max_addresses * sizeof(MPI_Aint)); + if (NULL == c_address_array) { + if (NULL != c_datatype_array) { + free(c_datatype_array); + } + + c_ierr = OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_NO_MEM, + FUNC_NAME); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + return; + } + } + + if (*max_large_counts) { + c_large_counts_array = (MPI_Count *) malloc(*max_large_counts * sizeof(MPI_Count)); + if (NULL == c_large_counts_array) { + if (NULL != c_datatype_array) { + free(c_datatype_array); + } + if (NULL != c_address_array) { + free(c_address_array); + } + + c_ierr = OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_NO_MEM, + FUNC_NAME); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + return; + } + } + + OMPI_ARRAY_FINT_2_INT(array_of_integers, *max_integers); + + c_ierr = PMPI_Type_get_contents_c(c_mtype, + OMPI_FINT_2_INT(*max_integers), + OMPI_FINT_2_INT(*max_addresses), + OMPI_FINT_2_INT(*max_datatypes), + OMPI_FINT_2_INT(*max_large_counts), + OMPI_ARRAY_NAME_CONVERT(array_of_integers), + c_address_array, c_large_counts_array, + c_datatype_array); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + for (i = 0; i < *max_addresses; i++) { + array_of_addresses[i] = c_address_array[i]; + } + for (i = 0; i < *max_large_counts; i++) { + array_of_large_counts[i] = c_large_counts_array[i]; + } + for (i = 0; i < *max_datatypes; i++) { + array_of_datatypes[i] = PMPI_Type_c2f(c_datatype_array[i]); + } + } + free(c_address_array); + free(c_datatype_array); + free(c_large_counts_array); + OMPI_ARRAY_FINT_2_INT_CLEANUP(array_of_integers); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/base/ompi_type_get_envelope_f_c.c b/ompi/mpi/fortran/use-mpi-f08/base/ompi_type_get_envelope_f_c.c new file mode 100644 index 00000000000..414aaf62987 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/base/ompi_type_get_envelope_f_c.c @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + + +#include "ompi_config.h" + +#include "ompi/datatype/ompi_datatype.h" +#include "ompi/mpi/fortran/base/fint_2_int.h" + +void ompi_type_get_envelope_f_c(MPI_Fint *type, MPI_Count *num_integers, + MPI_Count *num_addresses, + MPI_Count *num_large_counts, + MPI_Count *num_datatypes, MPI_Fint *combiner, + MPI_Fint *ierr); +void ompi_type_get_envelope_f_c(MPI_Fint *type, MPI_Count *num_integers, + MPI_Count *num_addresses, + MPI_Count *num_large_counts, + MPI_Count *num_datatypes, MPI_Fint *combiner, + MPI_Fint *ierr) +{ + int c_ierr; + MPI_Datatype c_type = PMPI_Type_f2c(*type); + OMPI_SINGLE_NAME_DECL(num_integers); + OMPI_SINGLE_NAME_DECL(num_addresses); + OMPI_SINGLE_NAME_DECL(num_datatypes); + OMPI_SINGLE_NAME_DECL(combiner); + + c_ierr = PMPI_Type_get_envelope_c(c_type, + OMPI_SINGLE_NAME_CONVERT(num_integers), + OMPI_SINGLE_NAME_CONVERT(num_addresses), + OMPI_SINGLE_NAME_CONVERT(num_large_counts), + OMPI_SINGLE_NAME_CONVERT(num_datatypes), + OMPI_SINGLE_NAME_CONVERT(combiner)); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + OMPI_SINGLE_INT_2_FINT(num_integers); + OMPI_SINGLE_INT_2_FINT(num_addresses); + OMPI_SINGLE_INT_2_FINT(num_datatypes); + OMPI_SINGLE_INT_2_FINT(combiner); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/base/ompi_type_get_extent_f_c.c b/ompi/mpi/fortran/use-mpi-f08/base/ompi_type_get_extent_f_c.c new file mode 100644 index 00000000000..5eea206fc04 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/base/ompi_type_get_extent_f_c.c @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" + +#include "ompi/datatype/ompi_datatype.h" +#include "ompi/mpi/fortran/base/fint_2_int.h" + +/* + * big count entry point, only needed by F08 bindings. + */ +void ompi_type_get_extent_f_c(MPI_Fint *type, MPI_Count *lb, + MPI_Count *extent, MPI_Fint *ierr); +void ompi_type_get_extent_f_c(MPI_Fint *type, MPI_Count *lb, + MPI_Count *extent, MPI_Fint *ierr) +{ + int c_ierr; + MPI_Datatype c_type = PMPI_Type_f2c(*type); + + c_ierr = PMPI_Type_get_extent_c(c_type, lb, extent); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/base/ts.c b/ompi/mpi/fortran/use-mpi-f08/base/ts.c new file mode 100644 index 00000000000..4ff011db7ef --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/base/ts.c @@ -0,0 +1,138 @@ +/* -*- Mode: C; c-basic-offset:4 ; -*- */ +/* + * Copyright (c) 2014 Argonne National Laboratory. + * Copyright (c) 2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ts.h" + +#include + +int ompi_ts_create_datatype(CFI_cdesc_t *cdesc, int oldcount, MPI_Datatype oldtype, MPI_Datatype *newtype) +{ + const int MAX_RANK = 15; /* Fortran 2008 specifies a maximum rank of 15 */ + MPI_Datatype types[MAX_RANK + 1]; /* Use a fixed size array to avoid malloc. + 1 for oldtype */ + int mpi_errno = MPI_SUCCESS; + int accum_elems = 1; + int accum_sm = cdesc->elem_len; + int done = false; /* Have we created a datatype for oldcount of oldtype? */ + int last; /* Index of the last successfully created datatype in types[] */ + int extent; + int i, j; + +#if OPAL_ENABLE_DEBUG + { + size_t size; + assert(cdesc->rank <= MAX_RANK); + ompi_datatype_type_size(oldtype, &size); + /* When cdesc->elem_len != size, things suddenly become complicated. Generally, it is hard to create + * a composite datatype based on two datatypes. Currently we don't support it and doubt it is useful. + */ + assert(cdesc->elem_len == size); + } +#endif + + types[0] = oldtype; + i = 0; + done = false; + while (i < cdesc->rank && !done) { + if (oldcount % accum_elems) { + /* oldcount should be a multiple of accum_elems, otherwise we might need an + * MPI indexed datatype to describle the irregular region, which is not supported yet. + */ + mpi_errno = MPI_ERR_INTERN; + last = i; + goto fn_exit; + } + + extent = oldcount / accum_elems; + if (extent > cdesc->dim[i].extent) { + extent = cdesc->dim[i].extent; + } else { + /* Up to now, we have accumlated enough elements */ + done = true; + } + + if (cdesc->dim[i].sm == accum_sm) { + mpi_errno = PMPI_Type_contiguous(extent, types[i], &types[i+1]); + } else { + mpi_errno = PMPI_Type_create_hvector(extent, 1, cdesc->dim[i].sm, types[i], &types[i+1]); + } + if (mpi_errno != MPI_SUCCESS) { + last = i; + goto fn_exit; + } + + accum_sm = cdesc->dim[i].sm * cdesc->dim[i].extent; + accum_elems *= cdesc->dim[i].extent; + i++; + } + + if (done) { + *newtype = types[i]; + MPI_Type_commit(newtype); + last = i - 1; /* To avoid freeing newtype */ + mpi_errno = MPI_SUCCESS; + } else { + /* If # of elements given by "oldcount oldtype" is bigger than + * what cdesc describles, then we will reach here. + */ + last = i; + mpi_errno = MPI_ERR_ARG; + goto fn_exit; + } + +fn_exit: + for (j = 1; j <= last; j++) { + PMPI_Type_free(&types[j]); + } + return mpi_errno; +} + +static void copy(CFI_dim_t *dim, int rank, char * base, char **dest, size_t len) { + for (CFI_index_t i=0; iextent; i++) { + if (rank > 1) { + copy(dim-1, rank-1, base, dest, len); + } else { + memcpy(*dest, base, len); + *dest += len; + } + base += dim->sm; + } +} + +int ompi_ts_copy(CFI_cdesc_t *cdesc, char *buffer) { + copy(&cdesc->dim[cdesc->rank - 1], cdesc->rank, cdesc->base_addr, &buffer, cdesc->elem_len); + return OMPI_SUCCESS; +} + +static void copy_back(CFI_dim_t *dim, int rank, char * base, char **source, size_t len) { + for (CFI_index_t i=0; iextent; i++) { + if (rank > 1) { + copy_back(dim-1, rank-1, base, source, len); + } else { + memcpy(base, *source, len); + *source += len; + } + base += dim->sm; + } +} + +int ompi_ts_copy_back(char *buffer, CFI_cdesc_t *cdesc) { + copy_back(&cdesc->dim[cdesc->rank - 1], cdesc->rank, cdesc->base_addr, &buffer, cdesc->elem_len); + return OMPI_SUCCESS; +} + +size_t ompi_ts_size(CFI_cdesc_t *cdesc) { + size_t res = cdesc->elem_len; + for (int i=0; irank; i++) { + res *= cdesc->dim[i].extent; + } + return res; +} diff --git a/ompi/mpi/fortran/use-mpi-f08/base/ts.h b/ompi/mpi/fortran/use-mpi-f08/base/ts.h new file mode 100644 index 00000000000..b6cbd73d31e --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/base/ts.h @@ -0,0 +1,158 @@ +/* -*- Mode: C; c-basic-offset:4 ; -*- */ +/* + * Copyright (c) 2014 Argonne National Laboratory. + * Copyright (c) 2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" + +#include "ompi/datatype/ompi_datatype.h" +#include "ompi/mpi/fortran/base/fint_2_int.h" + +#if OMPI_FORTRAN_HAVE_TS + +#include + +#define OMPI_CFI_BUFFER CFI_cdesc_t + +extern int ompi_ts_create_datatype(CFI_cdesc_t *cdesc, int oldcount, MPI_Datatype oldtype, MPI_Datatype *newtype); + +extern size_t ompi_ts_size(CFI_cdesc_t *cdesc); + +extern int ompi_ts_copy_back(char *buffer, CFI_cdesc_t *cdesc); + +extern int ompi_ts_copy(CFI_cdesc_t *cdesc, char *buffer); + +#define OMPI_CFI_BASE_ADDR(x) (x)->base_addr + +#define OMPI_CFI_2_C(x, count, type, datatype, rc) \ + do { \ + datatype = type; \ + if (x->rank != 0 && !CFI_is_contiguous(x)) { \ + rc = ompi_ts_create_datatype(x, count, type, &datatype); \ + if (OPAL_LIKELY(MPI_SUCCESS == rc)) { \ + count = 1; \ + } \ + } else { \ + rc = MPI_SUCCESS; \ + } \ + } while (0) + +#define OMPI_CFI_2_C_ALLOC(x, buffer, count, type, datatype, rc) \ + do { \ + datatype = type; \ + if (x->rank != 0 && !CFI_is_contiguous(x)) { \ + size_t size = ompi_ts_size(x); \ + buffer = malloc(size); \ + if (OPAL_UNLIKELY(NULL == buffer)) { \ + rc = MPI_ERR_NO_MEM; \ + } else { \ + rc = MPI_SUCCESS; \ + } \ + } else { \ + buffer = x->base_addr; \ + rc = MPI_SUCCESS; \ + } \ + } while (0) + +#define OMPI_CFI_2_C_COPY(x, buffer, count, type, datatype, rc) \ + do { \ + datatype = type; \ + if (x->rank != 0 && !CFI_is_contiguous(x)) { \ + size_t size = ompi_ts_size(x); \ + buffer = malloc(size); \ + if (OPAL_UNLIKELY(NULL == buffer)) { \ + rc = MPI_ERR_NO_MEM; \ + } else { \ + rc = ompi_ts_copy(x, buffer); \ + } \ + } else { \ + buffer = x->base_addr; \ + rc = MPI_SUCCESS; \ + } \ + } while (0) + +#define OMPI_C_2_CFI_FREE(x, buffer, count, type, datatype, rc) \ + do { \ + if (buffer != x->base_addr) { \ + free(buffer); \ + } \ + if (type != datatype) { \ + rc = PMPI_Type_free(&datatype); \ + } \ + } while (0) + +#define OMPI_C_2_CFI_COPY(x, buffer, count, type, datatype, rc) \ + do { \ + if (buffer != x->base_addr) { \ + rc = ompi_ts_copy_back(buffer, x); \ + free(buffer); \ + } \ + if (type != datatype) { \ + rc = PMPI_Type_free(&datatype); \ + } \ + } while (0) + +#define OMPI_CFI_IS_CONTIGUOUS(x) \ + (0 == x->rank || CFI_is_contiguous(x)) + +#define OMPI_CFI_CHECK_CONTIGUOUS(x, rc) \ + do { \ + if (OMPI_CFI_IS_CONTIGUOUS(x)) { \ + rc = MPI_SUCCESS; \ + } else { \ + rc = MPI_ERR_INTERN; \ + } \ + } while (0) + +#else + +/* + * Macros for compilers not supporting TS 29113. + */ + +#define OMPI_CFI_BUFFER char + +#define OMPI_CFI_BASE_ADDR(x) (x) + +#define OMPI_CFI_2_C(x, count, type, datatype, rc) \ + do { \ + datatype = type; \ + rc = MPI_SUCCESS; \ + } while (0) + +#define OMPI_CFI_2_C_ALLOC(x, buffer, count, type, datatype, rc) \ + do { \ + datatype = type; \ + buffer = x; \ + rc = MPI_SUCCESS; \ + } while (0) + +#define OMPI_CFI_2_C_COPY(x, buffer, count, type, datatype, rc) \ + do { \ + datatype = type; \ + buffer = x; \ + rc = MPI_SUCCESS; \ + } while (0) + +#define OMPI_C_2_CFI_FREE(x, buffer, count, type, datatype, rc) \ + do {} while (0) + +#define OMPI_C_2_CFI_COPY(x, buffer, count, type, datatype, rc) \ + do {} while (0) + +#define OMPI_CFI_IS_CONTIGUOUS(x) 1 + +#define OMPI_CFI_CHECK_CONTIGUOUS(x, rc) \ + do { \ + rc = MPI_SUCCESS; \ + } while (0) +#endif /* OMPI_FORTRAN_HAVE_TS */ + +#define OMPI_COUNT_CONVERT(fcount) diff --git a/ompi/mpi/fortran/use-mpi-f08/bcast_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/bcast_f08.F90 deleted file mode 100644 index 1a5e5001411..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/bcast_f08.F90 +++ /dev/null @@ -1,29 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Bcast_f08(buffer,count,datatype,root,comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm - use :: ompi_mpifh_bindings, only : ompi_bcast_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE :: buffer - INTEGER, INTENT(IN) :: count, root - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_bcast_f(buffer,count,datatype%MPI_VAL,root,comm%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Bcast_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/bcast_init_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/bcast_init_f08.F90 deleted file mode 100644 index 997d28263e3..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/bcast_init_f08.F90 +++ /dev/null @@ -1,31 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2022 Cisco Systems, Inc. All rights reserved -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2021 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Bcast_init_f08(buffer,count,datatype,root,comm,info,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Info, MPI_Request - use :: ompi_mpifh_bindings, only : ompi_bcast_init_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: buffer - INTEGER, INTENT(IN) :: count, root - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_bcast_init_f(buffer,count,datatype%MPI_VAL,root,comm%MPI_VAL,info%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Bcast_init_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/bcast_init_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/bcast_init_ts.c.in new file mode 100644 index 00000000000..e872a72d8ec --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/bcast_init_ts.c.in @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2021 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID bcast_init(BUFFER_ASYNC x, COUNT count, DATATYPE datatype, + RANK root, COMM comm, INFO info, REQUEST_OUT request) +{ + int c_ierr; + MPI_Comm c_comm; + MPI_Info c_info; + MPI_Request c_req; + MPI_Datatype c_type, c_datatype = MPI_DATATYPE_NULL; + void *buffer = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count; + int c_root = OMPI_FINT_2_INT(*root); + + c_comm = PMPI_Comm_f2c(*comm); + c_type = PMPI_Type_f2c(*datatype); + c_info = PMPI_Info_f2c(*info); + + if (OMPI_COMM_IS_INTRA(c_comm) || MPI_PROC_NULL != c_root) { + OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + } + + c_ierr = @INNER_CALL@(OMPI_F2C_BOTTOM(buffer), + c_count, + (c_datatype == MPI_DATATYPE_NULL) ? c_type : c_datatype, + c_root, + c_comm, + c_info, + &c_req); + if (MPI_DATATYPE_NULL != c_datatype && c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + if (MPI_SUCCESS == c_ierr) *request = PMPI_Request_c2f(c_req); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/bcast_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/bcast_ts.c.in new file mode 100644 index 00000000000..8dedd051ae1 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/bcast_ts.c.in @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID bcast(BUFFER_OUT x, COUNT count, DATATYPE datatype, + RANK root, COMM comm) +{ + int c_ierr; + MPI_Comm c_comm = PMPI_Comm_f2c(*comm); + MPI_Datatype c_datatype = NULL, c_type = NULL; + int c_root = OMPI_FINT_2_INT(*root); + void *buffer = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count; + + if (OMPI_COMM_IS_INTRA(c_comm) || MPI_PROC_NULL != c_root) { + c_type = PMPI_Type_f2c(*datatype); + OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + } + + c_ierr = @INNER_CALL@(OMPI_F2C_BOTTOM(buffer), + c_count, + c_datatype, + c_root, + c_comm); + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/bindings.h b/ompi/mpi/fortran/use-mpi-f08/bindings.h new file mode 100644 index 00000000000..7452a5e9bd1 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/bindings.h @@ -0,0 +1,219 @@ +/* + * Copyright (c) 2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#ifndef OMPI_CDESC_BINDINGS_H +#define OMPI_CDESC_BINDINGS_H + +#include "ompi_config.h" + +#include "ts.h" + +#include "mpi.h" + +void ompi_bsend_ts(CFI_cdesc_t* x, MPI_Fint *count, MPI_Fint *datatype, + MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, + MPI_Fint *ierr); + +void ompi_bsend_init_ts(CFI_cdesc_t* x, MPI_Fint *count, MPI_Fint *datatype, + MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, + MPI_Fint *request, MPI_Fint *ierr); + +void ompi_buffer_attach_ts(CFI_cdesc_t *x, MPI_Fint *size, MPI_Fint *ierr); + +void ompi_ibsend_ts(CFI_cdesc_t* x, MPI_Fint *count, MPI_Fint *datatype, + MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, + MPI_Fint *request, MPI_Fint *ierr); + +void ompi_irecv_ts(CFI_cdesc_t *x, MPI_Fint *count, MPI_Fint *datatype, + MPI_Fint *source, MPI_Fint *tag, MPI_Fint *comm, + MPI_Fint *request, MPI_Fint *ierr); + +void ompi_irsend_ts(CFI_cdesc_t* x, MPI_Fint *count, MPI_Fint *datatype, + MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, + MPI_Fint *request, MPI_Fint *ierr); + +void ompi_isend_ts(CFI_cdesc_t *x, MPI_Fint *count, MPI_Fint *datatype, + MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, + MPI_Fint *request, MPI_Fint *ierr); + +void ompi_issend_ts(CFI_cdesc_t* x, MPI_Fint *count, MPI_Fint *datatype, + MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, + MPI_Fint *request, MPI_Fint *ierr); + +void ompi_recv_ts(CFI_cdesc_t *x, MPI_Fint *count, MPI_Fint *datatype, + MPI_Fint *source, MPI_Fint *tag, MPI_Fint *comm, + MPI_Fint *status, MPI_Fint *ierr); + +void ompi_recv_init_ts(CFI_cdesc_t* x, MPI_Fint *count, MPI_Fint *datatype, + MPI_Fint *source, MPI_Fint *tag, MPI_Fint *comm, + MPI_Fint *request, MPI_Fint *ierr); + +void ompi_rsend_ts(CFI_cdesc_t* x, MPI_Fint *count, MPI_Fint *datatype, + MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, + MPI_Fint *ierr); + +void ompi_rsend_init_ts(CFI_cdesc_t* x, MPI_Fint *count, + MPI_Fint *datatype, MPI_Fint *dest, + MPI_Fint *tag, MPI_Fint *comm, + MPI_Fint *request, MPI_Fint *ierr); + +void ompi_send_ts(CFI_cdesc_t* x, MPI_Fint *count, MPI_Fint *datatype, + MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *ierr); + +void ompi_sendrecv_ts(CFI_cdesc_t* x1, MPI_Fint *sendcount, MPI_Fint *sendtype, + MPI_Fint *dest, MPI_Fint *sendtag, CFI_cdesc_t* x2, + MPI_Fint *recvcount, MPI_Fint *recvtype, + MPI_Fint *source, MPI_Fint *recvtag, MPI_Fint *comm, + MPI_Fint *status, MPI_Fint *ierr); + +void ompi_sendrecv_replace_ts(CFI_cdesc_t* x, MPI_Fint *count, MPI_Fint *datatype, + MPI_Fint *dest, MPI_Fint *sendtag, + MPI_Fint *source, MPI_Fint *recvtag, + MPI_Fint *comm, MPI_Fint *status, MPI_Fint *ierr); + +void ompi_send_init_ts(CFI_cdesc_t *x, MPI_Fint *count, MPI_Fint *datatype, + MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, + MPI_Fint *request, MPI_Fint *ierr); + +void ompi_ssend_ts(CFI_cdesc_t* x, MPI_Fint *count, MPI_Fint *datatype, + MPI_Fint *dest, MPI_Fint *tag, + MPI_Fint *comm, MPI_Fint *ierr); + +void ompi_ssend_init_ts(CFI_cdesc_t* x, MPI_Fint *count, MPI_Fint *datatype, + MPI_Fint *dest, MPI_Fint *tag, + MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr); + +void ompi_get_address_ts(CFI_cdesc_t *x, MPI_Aint *address, MPI_Fint *ierr); + +void ompi_pack_ts(CFI_cdesc_t* x1, MPI_Fint *incount, MPI_Fint *datatype, + CFI_cdesc_t* x2, MPI_Fint *outsize, MPI_Fint *position, + MPI_Fint *comm, MPI_Fint *ierr); + +void ompi_pack_external_ts(char *datarep, CFI_cdesc_t* x1, MPI_Fint *incount, + MPI_Fint *datatype, CFI_cdesc_t* x2, + MPI_Aint *outsize, MPI_Aint *position, + MPI_Fint *ierr, int datarep_len); + +void ompi_unpack_ts(CFI_cdesc_t* x1, MPI_Fint *insize, MPI_Fint *position, + CFI_cdesc_t* x2, MPI_Fint *outcount, MPI_Fint *datatype, + MPI_Fint *comm, MPI_Fint *ierr); + +void ompi_unpack_external_ts(char *datarep, CFI_cdesc_t* x1, MPI_Aint *insize, + MPI_Aint *position, CFI_cdesc_t* x2, + MPI_Fint *outcount, MPI_Fint *datatype, + MPI_Fint *ierr, int datarep_len); + +void ompi_allgather_ts(CFI_cdesc_t* x1, MPI_Fint *sendcount, MPI_Fint *sendtype, + CFI_cdesc_t* x2, MPI_Fint *recvcount, MPI_Fint *recvtype, + MPI_Fint *comm, MPI_Fint *ierr); + +void ompi_allgatherv_ts(CFI_cdesc_t *x1, MPI_Fint *sendcount, MPI_Fint *sendtype, + CFI_cdesc_t *x2, MPI_Fint *recvcounts, MPI_Fint *displs, + MPI_Fint *recvtype, MPI_Fint *comm, MPI_Fint *ierr); + +void ompi_allreduce_ts(CFI_cdesc_t *x1, CFI_cdesc_t *x2, MPI_Fint *count, + MPI_Fint *datatype, MPI_Fint *op, MPI_Fint *comm, + MPI_Fint *ierr); + +void ompi_alltoall_ts(CFI_cdesc_t* x1, MPI_Fint *sendcount, MPI_Fint *sendtype, + CFI_cdesc_t* x2, MPI_Fint *recvcount, MPI_Fint *recvtype, + MPI_Fint *comm, MPI_Fint *ierr); + +void ompi_alltoallv_ts(CFI_cdesc_t *x1, MPI_Fint *sendcounts, MPI_Fint *sdispls, + MPI_Fint *sendtype, CFI_cdesc_t *x2, MPI_Fint *recvcounts, + MPI_Fint *rdispls, MPI_Fint *recvtype, + MPI_Fint *comm, MPI_Fint *ierr); + +void ompi_alltoallw_ts(CFI_cdesc_t *x1, MPI_Fint *sendcounts, + MPI_Fint *sdispls, MPI_Fint *sendtypes, + CFI_cdesc_t *x2, MPI_Fint *recvcounts, + MPI_Fint *rdispls, MPI_Fint *recvtypes, + MPI_Fint *comm, MPI_Fint *ierr); + +void ompi_bcast_ts(CFI_cdesc_t* x, MPI_Fint *count, MPI_Fint *datatype, + MPI_Fint *root, MPI_Fint *comm, MPI_Fint *ierr); + +void ompi_exscan_ts(CFI_cdesc_t *x1, CFI_cdesc_t *x2, MPI_Fint *count, + MPI_Fint *datatype, MPI_Fint *op, MPI_Fint *comm, + MPI_Fint *ierr); + +void ompi_gather_ts(CFI_cdesc_t *x1, MPI_Fint *sendcount, MPI_Fint *sendtype, + CFI_cdesc_t *x2, MPI_Fint *recvcount, MPI_Fint *recvtype, + MPI_Fint *root, MPI_Fint *comm, MPI_Fint *ierr); + +void ompi_gatherv_ts(CFI_cdesc_t *x1, MPI_Fint *sendcount, MPI_Fint *sendtype, + CFI_cdesc_t *x2, MPI_Fint *recvcounts, MPI_Fint *displs, + MPI_Fint *recvtype, MPI_Fint *root, MPI_Fint *comm, + MPI_Fint *ierr); + +void ompi_reduce_ts(CFI_cdesc_t *x1, CFI_cdesc_t *x2, MPI_Fint *count, + MPI_Fint *datatype, MPI_Fint *op, + MPI_Fint *root, MPI_Fint *comm, MPI_Fint *ierr); + +void ompi_reduce_local_ts(CFI_cdesc_t *x1, CFI_cdesc_t *x2, MPI_Fint *count, + MPI_Fint *datatype, MPI_Fint *op, MPI_Fint *ierr); + +void ompi_reduce_scatter_ts(CFI_cdesc_t *x1, CFI_cdesc_t *x2, + MPI_Fint *recvcounts, MPI_Fint *datatype, + MPI_Fint *op, MPI_Fint *comm, MPI_Fint *ierr); + +void ompi_reduce_scatter_block_ts(CFI_cdesc_t *x1, CFI_cdesc_t *x2, + MPI_Fint *recvcount, MPI_Fint *datatype, + MPI_Fint *op, MPI_Fint *comm, MPI_Fint *ierr); + +void ompi_scan_ts(CFI_cdesc_t *x1, CFI_cdesc_t *x2, MPI_Fint *count, + MPI_Fint *datatype, MPI_Fint *op, MPI_Fint *comm, + MPI_Fint *ierr); + +void ompi_scatter_ts(CFI_cdesc_t *x1, MPI_Fint *sendcount, + MPI_Fint *sendtype, CFI_cdesc_t *x2, + MPI_Fint *recvcount, MPI_Fint *recvtype, + MPI_Fint *root, MPI_Fint *comm, MPI_Fint *ierr); + +void ompi_scatterv_ts(CFI_cdesc_t *x1, MPI_Fint *sendcounts, + MPI_Fint *displs, MPI_Fint *sendtype, + CFI_cdesc_t *x2, MPI_Fint *recvcount, + MPI_Fint *recvtype, MPI_Fint *root, + MPI_Fint *comm, MPI_Fint *ierr); + +void ompi_free_mem_ts(CFI_cdesc_t *x, MPI_Fint *ierr); + +void ompi_f_sync_reg_ts(CFI_cdesc_t *x); + +void ompi_imrecv_ts(CFI_cdesc_t* x, MPI_Fint *count, MPI_Fint *datatype, + MPI_Fint *message, MPI_Fint *request, MPI_Fint *ierr); + +void ompi_mrecv_ts(CFI_cdesc_t* x, MPI_Fint *count, MPI_Fint *datatype, + MPI_Fint *message, MPI_Fint *status, MPI_Fint *ierr); + +void ompi_neighbor_allgather_ts(CFI_cdesc_t *x1, MPI_Fint *sendcount, MPI_Fint *sendtype, + CFI_cdesc_t *x2, MPI_Fint *recvcount, MPI_Fint *recvtype, + MPI_Fint *comm, MPI_Fint *ierr); + +void ompi_neighbor_allgatherv_ts(CFI_cdesc_t *x1, MPI_Fint *sendcount, MPI_Fint *sendtype, + CFI_cdesc_t *x2, MPI_Fint *recvcounts, MPI_Fint *displs, + MPI_Fint *recvtype, MPI_Fint *comm, MPI_Fint *ierr); + +void ompi_neighbor_alltoall_ts(CFI_cdesc_t *x1, MPI_Fint *sendcount, MPI_Fint *sendtype, + CFI_cdesc_t *x2, MPI_Fint *recvcount, MPI_Fint *recvtype, + MPI_Fint *comm, MPI_Fint *ierr); + +void ompi_neighbor_alltoallv_ts(CFI_cdesc_t *x1, MPI_Fint *sendcounts, MPI_Fint *sdispls, + MPI_Fint *sendtype, CFI_cdesc_t *x2, MPI_Fint *recvcounts, + MPI_Fint *rdispls, MPI_Fint *recvtype, + MPI_Fint *comm, MPI_Fint *ierr); + +void ompi_neighbor_alltoallw_ts(CFI_cdesc_t *x1, MPI_Fint *sendcounts, + MPI_Aint *sdispls, MPI_Fint *sendtypes, + CFI_cdesc_t *x2, MPI_Fint *recvcounts, + MPI_Aint *rdispls, MPI_Fint *recvtypes, + MPI_Fint *comm, MPI_Fint *ierr); + +#endif /* OMPI_CDESC_BINDINGS_H */ diff --git a/ompi/mpi/fortran/use-mpi-f08/bindings/mpi-f-interfaces-bind.h b/ompi/mpi/fortran/use-mpi-f08/bindings/mpi-f-interfaces-bind.h index 2de875ade72..f88264f8805 100644 --- a/ompi/mpi/fortran/use-mpi-f08/bindings/mpi-f-interfaces-bind.h +++ b/ompi/mpi/fortran/use-mpi-f08/bindings/mpi-f-interfaces-bind.h @@ -771,6 +771,21 @@ subroutine ompi_type_get_contents_f(datatype,max_integers,max_addresses, & INTEGER, INTENT(OUT) :: ierror end subroutine ompi_type_get_contents_f +subroutine ompi_type_get_contents_f_c(datatype,max_integers,max_addresses, & + max_large_counts, max_datatypes,array_of_integers,array_of_addresses, & + array_of_large_counts, array_of_datatypes,ierror) & + BIND(C, name="ompi_type_get_contents_f_c") + use :: mpi_f08_types, only : MPI_ADDRESS_KIND, MPI_COUNT_KIND + implicit none + INTEGER, INTENT(IN) :: datatype + INTEGER(KIND=MPI_COUNT_KIND), INTENT(IN) :: max_integers, max_addresses, max_large_counts, max_datatypes + INTEGER, INTENT(OUT) :: array_of_integers(max_integers) + INTEGER(MPI_ADDRESS_KIND), INTENT(OUT) :: array_of_addresses(max_addresses) + INTEGER(KIND=MPI_COUNT_KIND), INTENT(OUT) :: array_of_large_counts(max_large_counts) + INTEGER, INTENT(OUT) :: array_of_datatypes(max_datatypes) + INTEGER, INTENT(OUT) :: ierror +end subroutine ompi_type_get_contents_f_c + subroutine ompi_type_get_envelope_f(datatype,num_integers, & num_addresses,num_datatypes,combiner,ierror) & BIND(C, name="ompi_type_get_envelope_f") @@ -780,6 +795,17 @@ subroutine ompi_type_get_envelope_f(datatype,num_integers, & INTEGER, INTENT(OUT) :: ierror end subroutine ompi_type_get_envelope_f +subroutine ompi_type_get_envelope_f_c(datatype,num_integers, num_addresses, & + num_large_counts, num_datatypes,combiner,ierror) & + BIND(C, name="ompi_type_get_envelope_f_c") + use :: mpi_f08_types, only : MPI_COUNT_KIND + implicit none + INTEGER, INTENT(IN) :: datatype + INTEGER(KIND=MPI_COUNT_KIND), INTENT(OUT) :: num_integers, num_large_counts, num_addresses, & + num_datatypes, combiner + INTEGER, INTENT(OUT) :: ierror +end subroutine ompi_type_get_envelope_f_c + subroutine ompi_type_get_extent_f(datatype,lb,extent,ierror) & BIND(C, name="ompi_type_get_extent_f") use :: mpi_f08_types, only : MPI_ADDRESS_KIND diff --git a/ompi/mpi/fortran/use-mpi-f08/bsend_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/bsend_f08.F90 deleted file mode 100644 index d35900bacc1..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/bsend_f08.F90 +++ /dev/null @@ -1,28 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Bsend_f08(buf,count,datatype,dest,tag,comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm - use :: ompi_mpifh_bindings, only : ompi_bsend_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: buf - INTEGER, INTENT(IN) :: count, dest, tag - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_bsend_f(buf,count,datatype%MPI_VAL,dest,tag,comm%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Bsend_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/bsend_init_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/bsend_init_f08.F90 deleted file mode 100644 index 78e48fc1240..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/bsend_init_f08.F90 +++ /dev/null @@ -1,32 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2022 Cisco Systems, Inc. All rights reserved -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Bsend_init_f08(buf,count,datatype,dest,tag,comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request - use :: ompi_mpifh_bindings, only : ompi_bsend_init_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) OMPI_ASYNCHRONOUS :: buf - INTEGER, INTENT(IN) :: count, dest, tag - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_bsend_init_f(buf,count,datatype%MPI_VAL,dest,tag,comm%MPI_VAL, & - request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Bsend_init_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/bsend_init_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/bsend_init_ts.c.in new file mode 100644 index 00000000000..fd25c5e2315 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/bsend_init_ts.c.in @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID bsend_init(BUFFER x, COUNT count, DATATYPE datatype, RANK dest, + TAG tag, COMM comm, REQUEST_OUT request) +{ + int c_ierr; + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + MPI_Request c_req; + MPI_Comm c_comm = PMPI_Comm_f2c (*comm); + + void *buf = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count; + + OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + + c_ierr = @INNER_CALL@(OMPI_F2C_BOTTOM(buf), c_count, + c_datatype, + OMPI_FINT_2_INT(*dest), + OMPI_FINT_2_INT(*tag), + c_comm, &c_req); + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + *request = PMPI_Request_c2f(c_req); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/bsend_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/bsend_ts.c.in new file mode 100644 index 00000000000..4b9812d8e80 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/bsend_ts.c.in @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID bsend(BUFFER x, COUNT count, DATATYPE datatype, RANK dest, + TAG tag, COMM comm) +{ + int c_ierr; + MPI_Comm c_comm = PMPI_Comm_f2c (*comm); + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + void *buf = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count; + + OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + + c_ierr = @INNER_CALL@(OMPI_F2C_BOTTOM(buf), c_count, + c_datatype, OMPI_FINT_2_INT(*dest), + OMPI_FINT_2_INT(*tag), c_comm); + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/buffer_attach_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/buffer_attach_f08.F90 deleted file mode 100644 index d5491bc753e..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/buffer_attach_f08.F90 +++ /dev/null @@ -1,26 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Buffer_attach_f08(buffer,size,ierror) - use :: ompi_mpifh_bindings, only : ompi_buffer_attach_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS:: buffer - INTEGER, INTENT(IN) :: size - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_buffer_attach_f(buffer,size,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Buffer_attach_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/buffer_attach_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/buffer_attach_ts.c.in new file mode 100644 index 00000000000..e8982631431 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/buffer_attach_ts.c.in @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID buffer_attach(BUFFER_ASYNC x, COUNT size) +{ + int c_ierr; + if (OMPI_CFI_IS_CONTIGUOUS(x)) { + c_ierr = PMPI_Buffer_attach(OMPI_CFI_BASE_ADDR(x), OMPI_FINT_2_INT(*size)); + } else { + c_ierr = MPI_ERR_BUFFER; + OMPI_ERRHANDLER_INVOKE(MPI_COMM_SELF, c_ierr, FUNC_NAME); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/buffer_detach.c.in b/ompi/mpi/fortran/use-mpi-f08/buffer_detach.c.in new file mode 100644 index 00000000000..ec2f80d7b85 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/buffer_detach.c.in @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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 Sun Microsystems, Inc. All rights reserved. + * Copyright (c) 2011-2015 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID buffer_detach(C_PTR_OUT buffer, COUNT size) +{ + int c_ierr; + void *dummy; + OMPI_SINGLE_NAME_DECL(size); + + c_ierr = @INNER_CALL@(&dummy, OMPI_SINGLE_NAME_CONVERT(size)); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + OMPI_SINGLE_INT_2_FINT(size); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/buffer_detach_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/buffer_detach_f08.F90 deleted file mode 100644 index 53cb423b4b7..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/buffer_detach_f08.F90 +++ /dev/null @@ -1,27 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2015 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Buffer_detach_f08(buffer_addr,size,ierror) - USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR - use :: ompi_mpifh_bindings, only : ompi_buffer_detach_f - implicit none - TYPE(C_PTR), INTENT(OUT) :: buffer_addr - INTEGER, INTENT(OUT) :: size - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_buffer_detach_f(buffer_addr,size,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Buffer_detach_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/compare_and_swap_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/compare_and_swap_f08.F90 deleted file mode 100644 index 07f9080087b..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/compare_and_swap_f08.F90 +++ /dev/null @@ -1,33 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2010-2022 Cisco Systems, Inc. All rights reserved -! Copyright (c) 2009-2014 Los Alamos National Security, LLC. -! All Rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Compare_and_swap_f08(origin_addr,compare_addr,result_addr,& - datatype,target_rank,target_disp,win,& - ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Win, MPI_ADDRESS_KIND - use :: ompi_mpifh_bindings, only : ompi_compare_and_swap_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) OMPI_ASYNCHRONOUS :: origin_addr, compare_addr - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: result_addr - TYPE(MPI_Datatype), INTENT(IN) :: datatype - INTEGER, INTENT(IN) :: target_rank - INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: target_disp - TYPE(MPI_Win), INTENT(IN) :: win - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_compare_and_swap_f(origin_addr,compare_addr,result_addr,datatype%MPI_VAL,& - target_rank,target_disp,win%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Compare_and_swap_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/compare_and_swap_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/compare_and_swap_ts.c.in new file mode 100644 index 00000000000..62308b358ca --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/compare_and_swap_ts.c.in @@ -0,0 +1,60 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2014 Los Alamos National Security, LLC. All rights + * reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID compare_and_swap(BUFFER x1, BUFFER x2, BUFFER_ASYNC x3, + DATATYPE datatype, RANK target_rank, AINT target_disp, + WIN win) +{ + int c_ierr; + MPI_Datatype c_datatype = PMPI_Type_f2c(*datatype); + MPI_Win c_win = PMPI_Win_f2c(*win); + char *origin_addr = OMPI_CFI_BASE_ADDR(x1), *compare_addr = OMPI_CFI_BASE_ADDR(x2), *result_addr = OMPI_CFI_BASE_ADDR(x3); + + OMPI_CFI_CHECK_CONTIGUOUS(x1, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_win, c_ierr, FUNC_NAME) + return; + } + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_win, c_ierr, FUNC_NAME) + return; + } + OMPI_CFI_CHECK_CONTIGUOUS(x3, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + return; + } + c_ierr = PMPI_Compare_and_swap(OMPI_F2C_BOTTOM(origin_addr), + OMPI_F2C_BOTTOM(compare_addr), + OMPI_F2C_BOTTOM(result_addr), + c_datatype, + OMPI_FINT_2_INT(*target_rank), + *target_disp, c_win); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/exscan_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/exscan_f08.F90 deleted file mode 100644 index cf78dc016c5..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/exscan_f08.F90 +++ /dev/null @@ -1,31 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Exscan_f08(sendbuf,recvbuf,count,datatype,op,comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Op, MPI_Comm - use :: ompi_mpifh_bindings, only : ompi_exscan_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE :: recvbuf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Op), INTENT(IN) :: op - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_exscan_f(sendbuf,recvbuf,count,datatype%MPI_VAL,& - op%MPI_VAL,comm%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Exscan_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/exscan_init_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/exscan_init_f08.F90 deleted file mode 100644 index 3669eb7d454..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/exscan_init_f08.F90 +++ /dev/null @@ -1,34 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2022 Cisco Systems, Inc. All rights reserved -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2021 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Exscan_init_f08(sendbuf,recvbuf,count,datatype,op,comm,info,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Op, MPI_Comm, MPI_Info, MPI_Request - use :: ompi_mpifh_bindings, only : ompi_exscan_init_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Op), INTENT(IN) :: op - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_exscan_init_f(sendbuf,recvbuf,count,datatype%MPI_VAL,& - op%MPI_VAL,comm%MPI_VAL,info%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Exscan_init_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/exscan_init_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/exscan_init_ts.c.in new file mode 100644 index 00000000000..af0d924d304 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/exscan_init_ts.c.in @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2021 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID exscan_init(BUFFER_ASYNC x1, BUFFER_ASYNC_OUT x2, COUNT count, + DATATYPE datatype, OP op, COMM comm, + INFO info, REQUEST_OUT request) +{ + int c_ierr; + MPI_Comm c_comm; + MPI_Datatype c_type; + MPI_Info c_info; + MPI_Request c_request; + MPI_Op c_op; + char *sendbuf = OMPI_CFI_BASE_ADDR(x1), *recvbuf = OMPI_CFI_BASE_ADDR(x2); + + c_comm = PMPI_Comm_f2c(*comm); + c_type = PMPI_Type_f2c(*datatype); + c_op = PMPI_Op_f2c(*op); + c_info = PMPI_Info_f2c(*info); + + OMPI_CFI_CHECK_CONTIGUOUS(x1, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + + sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf); + sendbuf = (char *) OMPI_F2C_BOTTOM (sendbuf); + recvbuf = (char *) OMPI_F2C_BOTTOM (recvbuf); + + c_ierr = @INNER_CALL@(sendbuf, recvbuf, + (@COUNT_TYPE@) *count, + c_type, c_op, c_comm, c_info, &c_request); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + if (MPI_SUCCESS == c_ierr) *request = PMPI_Request_c2f(c_request); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/exscan_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/exscan_ts.c.in new file mode 100644 index 00000000000..234037053ad --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/exscan_ts.c.in @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID exscan(BUFFER x1, BUFFER_OUT x2, COUNT count, + DATATYPE datatype, OP op, COMM comm) +{ + int c_ierr; + MPI_Comm c_comm = PMPI_Comm_f2c(*comm); + MPI_Datatype c_type; + MPI_Op c_op; + char *sendbuf = OMPI_CFI_BASE_ADDR(x1), *recvbuf = OMPI_CFI_BASE_ADDR(x2); + + OMPI_CFI_CHECK_CONTIGUOUS(x1, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + c_type = PMPI_Type_f2c(*datatype); + c_op = PMPI_Op_f2c(*op); + + sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf); + sendbuf = (char *) OMPI_F2C_BOTTOM (sendbuf); + recvbuf = (char *) OMPI_F2C_BOTTOM (recvbuf); + + c_ierr = @INNER_CALL@(sendbuf, recvbuf, + (@COUNT_TYPE@) *count, + c_type, c_op, c_comm); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/f_sync_reg_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/f_sync_reg_ts.c.in new file mode 100644 index 00000000000..08d72b85a82 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/f_sync_reg_ts.c.in @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2012 University of Oregon. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID f_sync_reg(BUFFER x) +{ + /* This is a noop in C to disable potential Fortran optimizations. */ + return; +} diff --git a/ompi/mpi/fortran/use-mpi-f08/fetch_and_op_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/fetch_and_op_f08.F90 deleted file mode 100644 index 4958a4019ac..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/fetch_and_op_f08.F90 +++ /dev/null @@ -1,33 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2010-2022 Cisco Systems, Inc. All rights reserved -! Copyright (c) 2009-2014 Los Alamos National Security, LLC. -! All Rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Fetch_and_op_f08(origin_addr,result_addr,datatype,target_rank, & - target_disp,op,win,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Op, MPI_Win, MPI_ADDRESS_KIND - use :: ompi_mpifh_bindings, only : ompi_fetch_and_op_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) OMPI_ASYNCHRONOUS :: origin_addr - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: result_addr - TYPE(MPI_Datatype), INTENT(IN) :: datatype - INTEGER, INTENT(IN) :: target_rank - INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: target_disp - TYPE(MPI_Op), INTENT(IN) :: op - TYPE(MPI_Win), INTENT(IN) :: win - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_fetch_and_op_f(origin_addr,result_addr,datatype%MPI_VAL,target_rank,& - target_disp,op%MPI_VAL,win%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Fetch_and_op_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/fetch_and_op_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/fetch_and_op_ts.c.in new file mode 100644 index 00000000000..c6ca7e55415 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/fetch_and_op_ts.c.in @@ -0,0 +1,55 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2014 Los Alamos National Security, LLC. All rights + * reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID fetch_and_op(BUFFER x1, BUFFER_OUT x2, DATATYPE datatype, + RANK target_rank, AINT target_disp, + OP op, WIN win) +{ + int c_ierr; + MPI_Datatype c_datatype = PMPI_Type_f2c(*datatype); + MPI_Win c_win = PMPI_Win_f2c(*win); + MPI_Op c_op = PMPI_Op_f2c(*op); + char *origin_addr = OMPI_CFI_BASE_ADDR(x1), *result_addr = OMPI_CFI_BASE_ADDR(x2); + + OMPI_CFI_CHECK_CONTIGUOUS(x1, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_win, c_ierr, FUNC_NAME) + return; + } + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_win, c_ierr, FUNC_NAME) + return; + } + c_ierr = PMPI_Fetch_and_op(OMPI_F2C_BOTTOM(origin_addr), + OMPI_F2C_BOTTOM(result_addr), + c_datatype, + OMPI_FINT_2_INT(*target_rank), + *target_disp, c_op, c_win); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/file_iread_all_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/file_iread_all_f08.F90 deleted file mode 100644 index 88a2f714bef..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/file_iread_all_f08.F90 +++ /dev/null @@ -1,29 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2010-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All Rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_File_iread_all_f08(fh,buf,count,datatype,request,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Request - use :: ompi_mpifh_bindings, only : ompi_file_iread_all_f - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_file_iread_all_f(fh%MPI_VAL,buf,count,datatype%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_File_iread_all_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/file_iread_all_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/file_iread_all_ts.c.in new file mode 100644 index 00000000000..23c828f3a6c --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_iread_all_ts.c.in @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID file_iread_all(FILE fh, BUFFER_ASYNC x, COUNT count, + DATATYPE datatype, REQUEST_OUT request) +{ + int c_ierr; + MPI_File c_fh = PMPI_File_f2c(*fh); + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + void *buf = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count; + MPI_Request c_request; + + OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_fh, c_ierr, FUNC_NAME) + return; + } + + c_ierr = @INNER_CALL@(c_fh, OMPI_F2C_BOTTOM(buf), + c_count, + c_datatype, &c_request); + + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + *request = PMPI_Request_c2f(c_request); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/file_iread_at_all_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/file_iread_at_all_f08.F90 deleted file mode 100644 index b62a3de3ce4..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/file_iread_at_all_f08.F90 +++ /dev/null @@ -1,31 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2010-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All Rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_File_iread_at_all_f08(fh,offset,buf,count,datatype,request,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Request, MPI_OFFSET_KIND - use :: ompi_mpifh_bindings, only : ompi_file_iread_at_all_f - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - INTEGER(MPI_OFFSET_KIND), INTENT(IN) :: offset - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_file_iread_at_all_f(fh%MPI_VAL,offset,buf,count,& - datatype%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_File_iread_at_all_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/file_iread_at_all_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/file_iread_at_all_ts.c.in new file mode 100644 index 00000000000..b5fcb9ce8a3 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_iread_at_all_ts.c.in @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID file_iread_at_all(FILE fh, OFFSET offset, + BUFFER_ASYNC x, COUNT count, + DATATYPE datatype, REQUEST_OUT request) +{ + int c_ierr; + MPI_File c_fh = PMPI_File_f2c(*fh); + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + void *buf = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count; + MPI_Request c_request; + + OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_fh, c_ierr, FUNC_NAME) + return; + } + + c_ierr = @INNER_CALL@(c_fh, (MPI_Offset) *offset, + OMPI_F2C_BOTTOM(buf), + c_count, + c_datatype, + &c_request); + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + *request = PMPI_Request_c2f(c_request); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/file_iread_at_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/file_iread_at_ts.c.in new file mode 100644 index 00000000000..c89829cac80 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_iread_at_ts.c.in @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID file_iread_at(FILE fh, OFFSET offset, + BUFFER_ASYNC x, COUNT count, + DATATYPE datatype, REQUEST_OUT request) +{ + int c_ierr; + MPI_File c_fh = PMPI_File_f2c(*fh); + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + void *buf = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count; + MPI_Request c_request; + + OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_fh, c_ierr, FUNC_NAME) + return; + } + + c_ierr = @INNER_CALL@(c_fh, (MPI_Offset) *offset, + OMPI_F2C_BOTTOM(buf), + c_count, + c_datatype, + &c_request); + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + *request = PMPI_Request_c2f(c_request); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/file_iread_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/file_iread_f08.F90 deleted file mode 100644 index 4b403188c9d..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/file_iread_f08.F90 +++ /dev/null @@ -1,29 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2010-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All Rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_File_iread_f08(fh,buf,count,datatype,request,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Request - use :: ompi_mpifh_bindings, only : ompi_file_iread_f - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_file_iread_f(fh%MPI_VAL,buf,count,datatype%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_File_iread_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/file_iread_shared_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/file_iread_shared_f08.F90 deleted file mode 100644 index 91e40cc4e52..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/file_iread_shared_f08.F90 +++ /dev/null @@ -1,30 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2010-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All Rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_File_iread_shared_f08(fh,buf,count,datatype,request,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Request - use :: ompi_mpifh_bindings, only : ompi_file_iread_shared_f - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_file_iread_shared_f(fh%MPI_VAL,buf,count,& - datatype%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_File_iread_shared_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/file_iread_shared_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/file_iread_shared_ts.c.in new file mode 100644 index 00000000000..6decb21234d --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_iread_shared_ts.c.in @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID file_iread_shared(FILE fh, BUFFER_ASYNC x, COUNT count, + DATATYPE datatype, REQUEST_OUT request) +{ + int c_ierr; + MPI_File c_fh = PMPI_File_f2c(*fh); + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + void *buf = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count; + MPI_Request c_request; + + OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_fh, c_ierr, FUNC_NAME) + return; + } + + c_ierr = @INNER_CALL@(c_fh, + OMPI_F2C_BOTTOM(buf), + c_count, + c_datatype, + &c_request); + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + *request = PMPI_Request_c2f(c_request); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/file_iread_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/file_iread_ts.c.in new file mode 100644 index 00000000000..b1c4aabad12 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_iread_ts.c.in @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID file_iread(FILE fh, BUFFER_ASYNC x, COUNT count, + DATATYPE datatype, REQUEST_OUT request) +{ + int c_ierr; + MPI_File c_fh = PMPI_File_f2c(*fh); + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + void *buf = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count; + MPI_Request c_request; + + OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_fh, c_ierr, FUNC_NAME) + return; + } + + c_ierr = @INNER_CALL@(c_fh, OMPI_F2C_BOTTOM(buf), + c_count, + c_datatype, &c_request); + + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + *request = PMPI_Request_c2f(c_request); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/file_iwrite_all_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/file_iwrite_all_f08.F90 deleted file mode 100644 index e42f494ab10..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/file_iwrite_all_f08.F90 +++ /dev/null @@ -1,30 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2010-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All Rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_File_iwrite_all_f08(fh,buf,count,datatype,request,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Request - use :: ompi_mpifh_bindings, only : ompi_file_iwrite_all_f - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS, INTENT(IN) :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_file_iwrite_all_f(fh%MPI_VAL,buf,count,& - datatype%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_File_iwrite_all_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/file_iwrite_all_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/file_iwrite_all_ts.c.in new file mode 100644 index 00000000000..3f11d68db89 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_iwrite_all_ts.c.in @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID file_iwrite_all(FILE fh, BUFFER x, COUNT count, + DATATYPE datatype, REQUEST_OUT request) +{ + int c_ierr; + MPI_File c_fh = PMPI_File_f2c(*fh); + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + void *buf = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count; + MPI_Request c_request; + + OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_fh, c_ierr, FUNC_NAME) + return; + } + + c_ierr = @INNER_CALL@(c_fh, OMPI_F2C_BOTTOM(buf), + c_count, + c_datatype, + &c_request); + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + *request = PMPI_Request_c2f(c_request); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/file_iwrite_at_all_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/file_iwrite_at_all_f08.F90 deleted file mode 100644 index 149c7ba6d5b..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/file_iwrite_at_all_f08.F90 +++ /dev/null @@ -1,31 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All Rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_File_iwrite_at_all_f08(fh,offset,buf,count,datatype,request,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Request, MPI_OFFSET_KIND - use :: ompi_mpifh_bindings, only : ompi_file_iwrite_at_all_f - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - INTEGER(MPI_OFFSET_KIND), INTENT(IN) :: offset - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS, INTENT(IN) :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_file_iwrite_at_all_f(fh%MPI_VAL,offset,buf,count,& - datatype%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_File_iwrite_at_all_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/file_iwrite_at_all_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/file_iwrite_at_all_ts.c.in new file mode 100644 index 00000000000..09a8bb39598 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_iwrite_at_all_ts.c.in @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID file_iwrite_at_all(FILE fh, OFFSET offset, BUFFER x, + COUNT count, DATATYPE datatype, + REQUEST_OUT request) +{ + int c_ierr; + MPI_File c_fh = PMPI_File_f2c(*fh); + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + void *buf = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count; + MPI_Request c_request; + + OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_fh, c_ierr, FUNC_NAME) + return; + } + + c_ierr = @INNER_CALL@(c_fh, (MPI_Offset) *offset, + OMPI_F2C_BOTTOM(buf), + c_count, + c_datatype, + &c_request); + + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + *request = PMPI_Request_c2f(c_request); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/file_iwrite_at_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/file_iwrite_at_f08.F90 deleted file mode 100644 index 08135a0bd2b..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/file_iwrite_at_f08.F90 +++ /dev/null @@ -1,31 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All Rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_File_iwrite_at_f08(fh,offset,buf,count,datatype,request,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Request, MPI_OFFSET_KIND - use :: ompi_mpifh_bindings, only : ompi_file_iwrite_at_f - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - INTEGER(MPI_OFFSET_KIND), INTENT(IN) :: offset - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS, INTENT(IN) :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_file_iwrite_at_f(fh%MPI_VAL,offset,buf,count,& - datatype%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_File_iwrite_at_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/file_iwrite_at_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/file_iwrite_at_ts.c.in new file mode 100644 index 00000000000..e6e09c1c560 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_iwrite_at_ts.c.in @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID file_iwrite_at(FILE fh, OFFSET offset, BUFFER x, + COUNT count, DATATYPE datatype, + REQUEST_OUT request) +{ + int c_ierr; + MPI_File c_fh = PMPI_File_f2c(*fh); + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + void *buf = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count; + MPI_Request c_request; + + OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_fh, c_ierr, FUNC_NAME) + return; + } + + c_ierr = @INNER_CALL@(c_fh, (MPI_Offset) *offset, + OMPI_F2C_BOTTOM(buf), + c_count, + c_datatype, + &c_request); + + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + *request = PMPI_Request_c2f(c_request); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/file_iwrite_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/file_iwrite_f08.F90 deleted file mode 100644 index e6e17ad77f3..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/file_iwrite_f08.F90 +++ /dev/null @@ -1,30 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2010-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All Rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_File_iwrite_f08(fh,buf,count,datatype,request,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Request - use :: ompi_mpifh_bindings, only : ompi_file_iwrite_f - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS, INTENT(IN) :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_file_iwrite_f(fh%MPI_VAL,buf,count,& - datatype%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_File_iwrite_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/file_iwrite_shared_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/file_iwrite_shared_f08.F90 deleted file mode 100644 index de15107a306..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/file_iwrite_shared_f08.F90 +++ /dev/null @@ -1,30 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All Rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_File_iwrite_shared_f08(fh,buf,count,datatype,request,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Request - use :: ompi_mpifh_bindings, only : ompi_file_iwrite_shared_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS, INTENT(IN) :: buf - TYPE(MPI_File), INTENT(IN) :: fh - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_file_iwrite_shared_f(fh%MPI_VAL,buf,count,& - datatype%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_File_iwrite_shared_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/file_iwrite_shared_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/file_iwrite_shared_ts.c.in new file mode 100644 index 00000000000..0e5a236cbef --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_iwrite_shared_ts.c.in @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID file_iwrite_shared(FILE fh, BUFFER x, COUNT count, + DATATYPE datatype, REQUEST_OUT request) +{ + int c_ierr; + MPI_File c_fh = PMPI_File_f2c(*fh); + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + void *buf = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count; + MPI_Request c_request; + + OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_fh, c_ierr, FUNC_NAME) + return; + } + + c_ierr = @INNER_CALL@(c_fh, OMPI_F2C_BOTTOM(buf), c_count, + c_datatype, &c_request); + + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + *request = PMPI_Request_c2f(c_request); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/file_iwrite_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/file_iwrite_ts.c.in new file mode 100644 index 00000000000..c994d7cad3c --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_iwrite_ts.c.in @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID file_iwrite(FILE fh, BUFFER x, COUNT count, DATATYPE datatype, + REQUEST_OUT request) +{ + int c_ierr; + MPI_File c_fh = PMPI_File_f2c(*fh); + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + void *buf = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count; + MPI_Request c_request; + + OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_fh, c_ierr, FUNC_NAME) + return; + } + + c_ierr = @INNER_CALL@(c_fh, OMPI_F2C_BOTTOM(buf), c_count, + c_datatype, &c_request); + + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + *request = PMPI_Request_c2f(c_request); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/file_read_all_begin_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/file_read_all_begin_f08.F90 deleted file mode 100644 index a2b2060e246..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/file_read_all_begin_f08.F90 +++ /dev/null @@ -1,28 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All Rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_File_read_all_begin_f08(fh,buf,count,datatype,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype - use :: ompi_mpifh_bindings, only : ompi_file_read_all_begin_f - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS, INTENT(IN) :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_file_read_all_begin_f(fh%MPI_VAL,buf,count,datatype%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_File_read_all_begin_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/file_read_all_begin_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/file_read_all_begin_ts.c.in new file mode 100644 index 00000000000..f962e2e3566 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_read_all_begin_ts.c.in @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID file_read_all_begin(FILE fh, BUFFER_ASYNC x, + COUNT count, DATATYPE datatype) +{ + int c_ierr; + MPI_File c_fh = PMPI_File_f2c(*fh); + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + void *buf = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count; + + OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_fh, c_ierr, FUNC_NAME) + return; + } + + c_ierr = @INNER_CALL@(c_fh, OMPI_F2C_BOTTOM(buf), c_count, c_datatype); + + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/file_read_all_end_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/file_read_all_end_f08.F90 deleted file mode 100644 index 0a5d251a128..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/file_read_all_end_f08.F90 +++ /dev/null @@ -1,27 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All Rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_File_read_all_end_f08(fh,buf,status,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Status - use :: ompi_mpifh_bindings, only : ompi_file_read_all_end_f - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS, INTENT(IN) :: buf - TYPE(MPI_Status), INTENT(OUT) :: status - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_file_read_all_end_f(fh%MPI_VAL,buf,status,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_File_read_all_end_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/file_read_all_end_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/file_read_all_end_ts.c.in new file mode 100644 index 00000000000..40aedf00e4c --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_read_all_end_ts.c.in @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID file_read_all_end(FILE fh, BUFFER_ASYNC x, STATUS_OUT status) +{ + int c_ierr; + void *buf = OMPI_CFI_BASE_ADDR(x); + OMPI_FORTRAN_STATUS_DECLARATION(c_status,c_status2) + MPI_File c_fh = PMPI_File_f2c(*fh); + + OMPI_FORTRAN_STATUS_SET_POINTER(c_status,c_status2,status) + + c_ierr = PMPI_File_read_all_end(c_fh, buf, c_status); + + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + OMPI_FORTRAN_STATUS_RETURN(c_status,c_status2,status,c_ierr) +} diff --git a/ompi/mpi/fortran/use-mpi-f08/file_read_all_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/file_read_all_f08.F90 deleted file mode 100644 index 4a917a50265..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/file_read_all_f08.F90 +++ /dev/null @@ -1,29 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All Rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_File_read_all_f08(fh,buf,count,datatype,status,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Status - use :: ompi_mpifh_bindings, only : ompi_file_read_all_f - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Status), INTENT(OUT) :: status - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_file_read_all_f(fh%MPI_VAL,buf,count,datatype%MPI_VAL,status,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_File_read_all_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/file_read_all_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/file_read_all_ts.c.in new file mode 100644 index 00000000000..4116d175198 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_read_all_ts.c.in @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID file_read_all(FILE fh, BUFFER x, COUNT count, + DATATYPE datatype, STATUS_OUT status) +{ + int c_ierr; + MPI_File c_fh = PMPI_File_f2c(*fh); + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + void *buf = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count; + OMPI_FORTRAN_STATUS_DECLARATION(c_status,c_status2) + + OMPI_FORTRAN_STATUS_SET_POINTER(c_status,c_status2,status) + + OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_fh, c_ierr, FUNC_NAME) + return; + } + + c_ierr = @INNER_CALL@(c_fh, OMPI_F2C_BOTTOM(buf), c_count, c_datatype, + c_status); + + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + OMPI_FORTRAN_STATUS_RETURN(c_status,c_status2,status,c_ierr) +} diff --git a/ompi/mpi/fortran/use-mpi-f08/file_read_at_all_begin_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/file_read_at_all_begin_f08.F90 deleted file mode 100644 index 8d4527e19bd..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/file_read_at_all_begin_f08.F90 +++ /dev/null @@ -1,30 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All Rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_File_read_at_all_begin_f08(fh,offset,buf,count,datatype,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_OFFSET_KIND - use :: ompi_mpifh_bindings, only : ompi_file_read_at_all_begin_f - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - INTEGER(MPI_OFFSET_KIND), INTENT(IN) :: offset - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS, INTENT(IN) :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_file_read_at_all_begin_f(fh%MPI_VAL,offset,buf,count,& - datatype%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_File_read_at_all_begin_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/file_read_at_all_begin_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/file_read_at_all_begin_ts.c.in new file mode 100644 index 00000000000..23b60e81f5e --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_read_at_all_begin_ts.c.in @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID file_read_at_all_begin(FILE fh, OFFSET offset, + BUFFER_ASYNC x, COUNT count, + DATATYPE datatype) +{ + int c_ierr; + MPI_File c_fh = PMPI_File_f2c(*fh); + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + void *buf = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count; + + OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_fh, c_ierr, FUNC_NAME) + return; + } + + c_ierr = @INNER_CALL@(c_fh, (MPI_Offset) *offset, OMPI_F2C_BOTTOM(buf), + c_count, c_datatype); + + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/file_read_at_all_end_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/file_read_at_all_end_f08.F90 deleted file mode 100644 index 0cf1a58bda5..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/file_read_at_all_end_f08.F90 +++ /dev/null @@ -1,27 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All Rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_File_read_at_all_end_f08(fh,buf,status,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Status - use :: ompi_mpifh_bindings, only : ompi_file_read_at_all_end_f - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS, INTENT(IN) :: buf - TYPE(MPI_Status), INTENT(OUT) :: status - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_file_read_at_all_end_f(fh%MPI_VAL,buf,status,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_File_read_at_all_end_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/file_read_at_all_end_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/file_read_at_all_end_ts.c.in new file mode 100644 index 00000000000..5193f23e8b9 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_read_at_all_end_ts.c.in @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID file_read_at_all_end(FILE fh, BUFFER_ASYNC x, + STATUS_OUT status) +{ + int c_ierr; + MPI_File c_fh = PMPI_File_f2c(*fh); + void *buf = OMPI_CFI_BASE_ADDR(x); + OMPI_FORTRAN_STATUS_DECLARATION(c_status,c_status2) + + OMPI_FORTRAN_STATUS_SET_POINTER(c_status,c_status2,status) + + c_ierr = PMPI_File_read_at_all_end(c_fh, buf, c_status); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + OMPI_FORTRAN_STATUS_RETURN(c_status,c_status2,status,c_ierr) +} diff --git a/ompi/mpi/fortran/use-mpi-f08/file_read_at_all_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/file_read_at_all_f08.F90 deleted file mode 100644 index e358b7dbbaf..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/file_read_at_all_f08.F90 +++ /dev/null @@ -1,31 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All Rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_File_read_at_all_f08(fh,offset,buf,count,datatype,status,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Status, MPI_OFFSET_KIND - use :: ompi_mpifh_bindings, only : ompi_file_read_at_all_f - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - INTEGER(MPI_OFFSET_KIND), INTENT(IN) :: offset - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Status), INTENT(OUT) :: status - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_file_read_at_all_f(fh%MPI_VAL,offset,buf,count,& - datatype%MPI_VAL,status,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_File_read_at_all_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/file_read_at_all_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/file_read_at_all_ts.c.in new file mode 100644 index 00000000000..d9ec1042113 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_read_at_all_ts.c.in @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2006-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID file_read_at_all(FILE fh, OFFSET offset, + BUFFER x, COUNT count, + DATATYPE datatype, STATUS_OUT status) +{ + int c_ierr; + MPI_File c_fh = PMPI_File_f2c(*fh); + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + void *buf = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count; + OMPI_FORTRAN_STATUS_DECLARATION(c_status,c_status2) + + OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_fh, c_ierr, FUNC_NAME) + return; + } + + OMPI_FORTRAN_STATUS_SET_POINTER(c_status,c_status2,status) + + c_ierr = @INNER_CALL@(c_fh, (MPI_Offset) *offset, OMPI_F2C_BOTTOM(buf), + c_count, c_datatype, c_status); + + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + OMPI_FORTRAN_STATUS_RETURN(c_status,c_status2,status,c_ierr) +} diff --git a/ompi/mpi/fortran/use-mpi-f08/file_read_at_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/file_read_at_f08.F90 deleted file mode 100644 index e7004c759e0..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/file_read_at_f08.F90 +++ /dev/null @@ -1,30 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All Rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_File_read_at_f08(fh,offset,buf,count,datatype,status,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Status, MPI_OFFSET_KIND - use :: ompi_mpifh_bindings, only : ompi_file_read_at_f - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - INTEGER(MPI_OFFSET_KIND), INTENT(IN) :: offset - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Status), INTENT(OUT) :: status - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_file_read_at_f(fh%MPI_VAL,offset,buf,count,datatype%MPI_VAL,status,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_File_read_at_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/file_read_at_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/file_read_at_ts.c.in new file mode 100644 index 00000000000..054ae0cba1f --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_read_at_ts.c.in @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2006-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID file_read_at(FILE fh, OFFSET offset, BUFFER x, + COUNT count, DATATYPE datatype, + STATUS_OUT status) +{ + int c_ierr; + MPI_File c_fh = PMPI_File_f2c(*fh); + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + void *buf = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count; + OMPI_FORTRAN_STATUS_DECLARATION(c_status,c_status2) + + OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_fh, c_ierr, FUNC_NAME) + return; + } + + OMPI_FORTRAN_STATUS_SET_POINTER(c_status,c_status2,status) + + c_ierr = @INNER_CALL@(c_fh, (MPI_Offset) *offset, buf, c_count, + c_datatype, c_status); + + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + OMPI_FORTRAN_STATUS_RETURN(c_status,c_status2,status,c_ierr) +} diff --git a/ompi/mpi/fortran/use-mpi-f08/file_read_ordered_begin_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/file_read_ordered_begin_f08.F90 deleted file mode 100644 index 3f67832e930..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/file_read_ordered_begin_f08.F90 +++ /dev/null @@ -1,28 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All Rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_File_read_ordered_begin_f08(fh,buf,count,datatype,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype - use :: ompi_mpifh_bindings, only : ompi_file_read_ordered_begin_f - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS, INTENT(IN) :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_file_read_ordered_begin_f(fh%MPI_VAL,buf,count,datatype%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_File_read_ordered_begin_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/file_read_ordered_begin_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/file_read_ordered_begin_ts.c.in new file mode 100644 index 00000000000..c48b13cbe15 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_read_ordered_begin_ts.c.in @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID file_read_ordered_begin(FILE fh, BUFFER_ASYNC x, COUNT count, + DATATYPE datatype) +{ + int c_ierr; + MPI_File c_fh = PMPI_File_f2c(*fh); + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + void *buf = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count; + + OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_fh, c_ierr, FUNC_NAME) + return; + } + + c_ierr = @INNER_CALL@(c_fh, OMPI_F2C_BOTTOM(buf), c_count, c_datatype); + + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/file_read_ordered_end_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/file_read_ordered_end_f08.F90 deleted file mode 100644 index 8ddde76a44d..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/file_read_ordered_end_f08.F90 +++ /dev/null @@ -1,27 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All Rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_File_read_ordered_end_f08(fh,buf,status,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Status - use :: ompi_mpifh_bindings, only : ompi_file_read_ordered_end_f - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS, INTENT(IN) :: buf - TYPE(MPI_Status), INTENT(OUT) :: status - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_file_read_ordered_end_f(fh%MPI_VAL,buf,status,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_File_read_ordered_end_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/file_read_ordered_end_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/file_read_ordered_end_ts.c.in new file mode 100644 index 00000000000..06a486b7006 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_read_ordered_end_ts.c.in @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2006-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID file_read_ordered_end(FILE fh, BUFFER_ASYNC x, STATUS_OUT status) +{ + int c_ierr; + MPI_File c_fh = PMPI_File_f2c(*fh); + void *buf = OMPI_CFI_BASE_ADDR(x); + OMPI_FORTRAN_STATUS_DECLARATION(c_status,c_status2) + + OMPI_FORTRAN_STATUS_SET_POINTER(c_status,c_status2,status) + + c_ierr = PMPI_File_read_ordered_end(c_fh, buf, c_status); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + OMPI_FORTRAN_STATUS_RETURN(c_status,c_status2,status,c_ierr) +} diff --git a/ompi/mpi/fortran/use-mpi-f08/file_read_ordered_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/file_read_ordered_f08.F90 deleted file mode 100644 index c9947619c16..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/file_read_ordered_f08.F90 +++ /dev/null @@ -1,30 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All Rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_File_read_ordered_f08(fh,buf,count,datatype,status,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Status - use :: ompi_mpifh_bindings, only : ompi_file_read_ordered_f - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Status), INTENT(OUT) :: status - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_file_read_ordered_f(fh%MPI_VAL,buf,count,& - datatype%MPI_VAL,status,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_File_read_ordered_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/file_read_ordered_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/file_read_ordered_ts.c.in new file mode 100644 index 00000000000..c59e581b627 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_read_ordered_ts.c.in @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID file_read_ordered(FILE fh, BUFFER x, COUNT count, + DATATYPE datatype, STATUS_OUT status) +{ + int c_ierr; + MPI_File c_fh = PMPI_File_f2c(*fh); + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + void *buf = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count; + OMPI_FORTRAN_STATUS_DECLARATION(c_status,c_status2) + + OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_fh, c_ierr, FUNC_NAME) + return; + } + + OMPI_FORTRAN_STATUS_SET_POINTER(c_status,c_status2,status) + + c_ierr = @INNER_CALL@(c_fh, OMPI_F2C_BOTTOM(buf), c_count, c_datatype, + c_status); + + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + OMPI_FORTRAN_STATUS_RETURN(c_status,c_status2,status,c_ierr) +} diff --git a/ompi/mpi/fortran/use-mpi-f08/file_read_shared_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/file_read_shared_f08.F90 deleted file mode 100644 index a6bd046f497..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/file_read_shared_f08.F90 +++ /dev/null @@ -1,29 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All Rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_File_read_shared_f08(fh,buf,count,datatype,status,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Status - use :: ompi_mpifh_bindings, only : ompi_file_read_shared_f - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Status), INTENT(OUT) :: status - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_file_read_shared_f(fh%MPI_VAL,buf,count,datatype%MPI_VAL,status,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_File_read_shared_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/file_read_shared_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/file_read_shared_ts.c.in new file mode 100644 index 00000000000..b47b0a46a46 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_read_shared_ts.c.in @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID file_read_shared(FILE fh, BUFFER x, COUNT count, + DATATYPE datatype, STATUS_OUT status) +{ + int c_ierr; + MPI_File c_fh = PMPI_File_f2c(*fh); + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + void *buf = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count; + OMPI_FORTRAN_STATUS_DECLARATION(c_status,c_status2) + + OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_fh, c_ierr, FUNC_NAME) + return; + } + + OMPI_FORTRAN_STATUS_SET_POINTER(c_status,c_status2,status) + + c_ierr = @INNER_CALL@(c_fh, OMPI_F2C_BOTTOM(buf), c_count, c_datatype, + c_status); + + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + OMPI_FORTRAN_STATUS_RETURN(c_status,c_status2,status,c_ierr) +} diff --git a/ompi/mpi/fortran/use-mpi-f08/file_read_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/file_read_ts.c.in new file mode 100644 index 00000000000..3c36266af7b --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_read_ts.c.in @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2006-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID file_read(FILE fh, BUFFER x, COUNT count, + DATATYPE datatype, STATUS_OUT status) +{ + int c_ierr; + MPI_File c_fh = PMPI_File_f2c(*fh); + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + void *buf = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count; + OMPI_FORTRAN_STATUS_DECLARATION(c_status,c_status2) + + OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_fh, c_ierr, FUNC_NAME) + return; + } + + OMPI_FORTRAN_STATUS_SET_POINTER(c_status,c_status2,status) + + c_ierr = @INNER_CALL@(c_fh, OMPI_F2C_BOTTOM(buf), c_count, c_datatype, + c_status); + + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + OMPI_FORTRAN_STATUS_RETURN(c_status,c_status2,status,c_ierr) +} diff --git a/ompi/mpi/fortran/use-mpi-f08/file_write_all_begin_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/file_write_all_begin_f08.F90 deleted file mode 100644 index 6bdbc0ec7ca..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/file_write_all_begin_f08.F90 +++ /dev/null @@ -1,28 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All Rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_File_write_all_begin_f08(fh,buf,count,datatype,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype - use :: ompi_mpifh_bindings, only : ompi_file_write_all_begin_f - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS, INTENT(IN) :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_file_write_all_begin_f(fh%MPI_VAL,buf,count,datatype%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_File_write_all_begin_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/file_write_all_begin_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/file_write_all_begin_ts.c.in new file mode 100644 index 00000000000..1f79c0c43b9 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_write_all_begin_ts.c.in @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID file_write_all_begin(FILE fh, BUFFER_ASYNC x, + COUNT count, DATATYPE datatype) +{ + int c_ierr; + MPI_File c_fh = PMPI_File_f2c(*fh); + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + void *buf = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count; + + OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_fh, c_ierr, FUNC_NAME) + return; + } + + c_ierr = @INNER_CALL@(c_fh, OMPI_F2C_BOTTOM(buf), c_count, c_datatype); + + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/file_write_all_end_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/file_write_all_end_f08.F90 deleted file mode 100644 index 8a42355052a..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/file_write_all_end_f08.F90 +++ /dev/null @@ -1,27 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All Rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_File_write_all_end_f08(fh,buf,status,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Status - use :: ompi_mpifh_bindings, only : ompi_file_write_all_end_f - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS, INTENT(IN) :: buf - TYPE(MPI_Status), INTENT(OUT) :: status - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_file_write_all_end_f(fh%MPI_VAL,buf,status,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_File_write_all_end_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/file_write_all_end_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/file_write_all_end_ts.c.in new file mode 100644 index 00000000000..186df951f9a --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_write_all_end_ts.c.in @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID file_write_all_end(FILE fh, BUFFER_ASYNC x, STATUS_OUT status) +{ + int c_ierr; + void *buf = OMPI_CFI_BASE_ADDR(x); + OMPI_FORTRAN_STATUS_DECLARATION(c_status,c_status2) + MPI_File c_fh = PMPI_File_f2c(*fh); + + OMPI_FORTRAN_STATUS_SET_POINTER(c_status,c_status2,status) + + c_ierr = PMPI_File_write_all_end(c_fh, buf, c_status); + + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + OMPI_FORTRAN_STATUS_RETURN(c_status,c_status2,status,c_ierr) +} diff --git a/ompi/mpi/fortran/use-mpi-f08/file_write_all_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/file_write_all_f08.F90 deleted file mode 100644 index af975304c94..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/file_write_all_f08.F90 +++ /dev/null @@ -1,30 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All Rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_File_write_all_f08(fh,buf,count,datatype,status,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Status - use :: ompi_mpifh_bindings, only : ompi_file_write_all_f - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Status), INTENT(OUT) :: status - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_file_write_all_f(fh%MPI_VAL,buf,count,& - datatype%MPI_VAL,status,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_File_write_all_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/file_write_all_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/file_write_all_ts.c.in new file mode 100644 index 00000000000..9c07a808bef --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_write_all_ts.c.in @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID file_write_all(FILE fh, BUFFER x, COUNT count, + DATATYPE datatype, STATUS_OUT status) +{ + int c_ierr; + MPI_File c_fh = PMPI_File_f2c(*fh); + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + void *buf = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count; + OMPI_FORTRAN_STATUS_DECLARATION(c_status,c_status2) + + OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_fh, c_ierr, FUNC_NAME) + return; + } + + OMPI_FORTRAN_STATUS_SET_POINTER(c_status,c_status2,status) + + c_ierr = @INNER_CALL@(c_fh, OMPI_F2C_BOTTOM(buf), c_count, + c_datatype, c_status); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + + OMPI_FORTRAN_STATUS_RETURN(c_status,c_status2,status,c_ierr) +} diff --git a/ompi/mpi/fortran/use-mpi-f08/file_write_at_all_begin_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/file_write_at_all_begin_f08.F90 deleted file mode 100644 index 22a80139d15..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/file_write_at_all_begin_f08.F90 +++ /dev/null @@ -1,30 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All Rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_File_write_at_all_begin_f08(fh,offset,buf,count,datatype,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_OFFSET_KIND - use :: ompi_mpifh_bindings, only : ompi_file_write_at_all_begin_f - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - INTEGER(MPI_OFFSET_KIND), INTENT(IN) :: offset - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS, INTENT(IN) :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_file_write_at_all_begin_f(fh%MPI_VAL,offset,buf,count,& - datatype%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_File_write_at_all_begin_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/file_write_at_all_begin_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/file_write_at_all_begin_ts.c.in new file mode 100644 index 00000000000..242f066e0d9 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_write_at_all_begin_ts.c.in @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID file_write_at_all_begin(FILE fh, OFFSET offset, + BUFFER_ASYNC x, COUNT count, + DATATYPE datatype) +{ + int c_ierr; + MPI_File c_fh = PMPI_File_f2c(*fh); + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + void *buf = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count; + + OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_fh, c_ierr, FUNC_NAME) + return; + } + + c_ierr = @INNER_CALL@(c_fh, (MPI_Offset) *offset, OMPI_F2C_BOTTOM(buf), + c_count, c_datatype); + + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/file_write_at_all_end_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/file_write_at_all_end_f08.F90 deleted file mode 100644 index 5a180b34252..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/file_write_at_all_end_f08.F90 +++ /dev/null @@ -1,27 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All Rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_File_write_at_all_end_f08(fh,buf,status,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Status - use :: ompi_mpifh_bindings, only : ompi_file_write_at_all_end_f - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS, INTENT(IN) :: buf - TYPE(MPI_Status), INTENT(OUT) :: status - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_file_write_at_all_end_f(fh%MPI_VAL,buf,status,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_File_write_at_all_end_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/file_write_at_all_end_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/file_write_at_all_end_ts.c.in new file mode 100644 index 00000000000..3883cc5634b --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_write_at_all_end_ts.c.in @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID file_write_at_all_end(FILE fh, BUFFER_ASYNC x, STATUS_OUT status) +{ + int c_ierr; + MPI_File c_fh = PMPI_File_f2c(*fh); + void *buf = OMPI_CFI_BASE_ADDR(x); + OMPI_FORTRAN_STATUS_DECLARATION(c_status,c_status2) + + OMPI_FORTRAN_STATUS_SET_POINTER(c_status,c_status2,status) + + c_ierr = PMPI_File_write_at_all_end(c_fh, buf, c_status); + + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + OMPI_FORTRAN_STATUS_RETURN(c_status,c_status2,status,c_ierr) +} diff --git a/ompi/mpi/fortran/use-mpi-f08/file_write_at_all_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/file_write_at_all_f08.F90 deleted file mode 100644 index 6973a334bae..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/file_write_at_all_f08.F90 +++ /dev/null @@ -1,31 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All Rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_File_write_at_all_f08(fh,offset,buf,count,datatype,status,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Status, MPI_OFFSET_KIND - use :: ompi_mpifh_bindings, only : ompi_file_write_at_all_f - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - INTEGER(MPI_OFFSET_KIND), INTENT(IN) :: offset - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Status), INTENT(OUT) :: status - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_file_write_at_all_f(fh%MPI_VAL,offset,buf,count,& - datatype%MPI_VAL,status,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_File_write_at_all_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/file_write_at_all_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/file_write_at_all_ts.c.in new file mode 100644 index 00000000000..4ecd1486336 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_write_at_all_ts.c.in @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID file_write_at_all(FILE fh, OFFSET offset, + BUFFER x, COUNT count, + DATATYPE datatype, STATUS_OUT status) +{ + int c_ierr; + MPI_File c_fh = PMPI_File_f2c(*fh); + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + void *buf = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count; + OMPI_FORTRAN_STATUS_DECLARATION(c_status,c_status2) + + OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_fh, c_ierr, FUNC_NAME) + return; + } + + OMPI_FORTRAN_STATUS_SET_POINTER(c_status,c_status2,status) + + c_ierr = @INNER_CALL@(c_fh, (MPI_Offset) *offset, OMPI_F2C_BOTTOM(buf), + c_count, c_datatype, c_status); + + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + OMPI_FORTRAN_STATUS_RETURN(c_status,c_status2,status,c_ierr) +} diff --git a/ompi/mpi/fortran/use-mpi-f08/file_write_at_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/file_write_at_f08.F90 deleted file mode 100644 index 1ad8f65703e..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/file_write_at_f08.F90 +++ /dev/null @@ -1,31 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All Rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_File_write_at_f08(fh,offset,buf,count,datatype,status,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Status, MPI_OFFSET_KIND - use :: ompi_mpifh_bindings, only : ompi_file_write_at_f - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - INTEGER(MPI_OFFSET_KIND), INTENT(IN) :: offset - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Status), INTENT(OUT) :: status - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_file_write_at_f(fh%MPI_VAL,offset,buf,count,& - datatype%MPI_VAL,status,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_File_write_at_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/file_write_at_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/file_write_at_ts.c.in new file mode 100644 index 00000000000..771cb58392f --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_write_at_ts.c.in @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID file_write_at(FILE fh, OFFSET offset, + BUFFER x, COUNT count, + DATATYPE datatype, STATUS_OUT status) +{ + int c_ierr; + MPI_File c_fh = PMPI_File_f2c(*fh); + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + void *buf = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count; + OMPI_FORTRAN_STATUS_DECLARATION(c_status,c_status2) + + OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_fh, c_ierr, FUNC_NAME) + return; + } + + OMPI_FORTRAN_STATUS_SET_POINTER(c_status,c_status2,status) + + c_ierr = @INNER_CALL@(c_fh, (MPI_Offset) *offset, OMPI_F2C_BOTTOM(buf), + c_count, c_datatype, c_status); + + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + OMPI_FORTRAN_STATUS_RETURN(c_status,c_status2,status,c_ierr) +} diff --git a/ompi/mpi/fortran/use-mpi-f08/file_write_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/file_write_f08.F90 deleted file mode 100644 index 8dd3c49496d..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/file_write_f08.F90 +++ /dev/null @@ -1,30 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All Rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_File_write_f08(fh,buf,count,datatype,status,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Status - use :: ompi_mpifh_bindings, only : ompi_file_write_f - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Status), INTENT(OUT) :: status - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_file_write_f(fh%MPI_VAL,buf,count,& - datatype%MPI_VAL,status,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_File_write_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/file_write_ordered_begin_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/file_write_ordered_begin_f08.F90 deleted file mode 100644 index cec70707280..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/file_write_ordered_begin_f08.F90 +++ /dev/null @@ -1,28 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All Rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_File_write_ordered_begin_f08(fh,buf,count,datatype,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype - use :: ompi_mpifh_bindings, only : ompi_file_write_ordered_begin_f - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS, INTENT(IN) :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_file_write_ordered_begin_f(fh%MPI_VAL,buf,count,datatype%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_File_write_ordered_begin_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/file_write_ordered_begin_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/file_write_ordered_begin_ts.c.in new file mode 100644 index 00000000000..2c8483667f1 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_write_ordered_begin_ts.c.in @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID file_write_ordered_begin(FILE fh, BUFFER_ASYNC x, + COUNT count, DATATYPE datatype) +{ + int c_ierr; + MPI_File c_fh = PMPI_File_f2c(*fh); + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + void *buf = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count; + + OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_fh, c_ierr, FUNC_NAME) + return; + } + + c_ierr = @INNER_CALL@(c_fh, OMPI_F2C_BOTTOM(buf), c_count, c_datatype); + + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/file_write_ordered_end_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/file_write_ordered_end_f08.F90 deleted file mode 100644 index 2226ec5b5d8..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/file_write_ordered_end_f08.F90 +++ /dev/null @@ -1,27 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All Rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_File_write_ordered_end_f08(fh,buf,status,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Status - use :: ompi_mpifh_bindings, only : ompi_file_write_ordered_end_f - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS, INTENT(IN) :: buf - TYPE(MPI_Status), INTENT(OUT) :: status - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_file_write_ordered_end_f(fh%MPI_VAL,buf,status,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_File_write_ordered_end_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/file_write_ordered_end_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/file_write_ordered_end_ts.c.in new file mode 100644 index 00000000000..c1fe3feffda --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_write_ordered_end_ts.c.in @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID file_write_ordered_end(FILE fh, BUFFER_ASYNC x, STATUS_OUT status) +{ + int c_ierr; + MPI_File c_fh = PMPI_File_f2c(*fh); + void *buf = OMPI_CFI_BASE_ADDR(x); + OMPI_FORTRAN_STATUS_DECLARATION(c_status,c_status2) + + OMPI_FORTRAN_STATUS_SET_POINTER(c_status,c_status2,status) + + c_ierr = PMPI_File_write_ordered_end(c_fh, buf, c_status); + + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + OMPI_FORTRAN_STATUS_RETURN(c_status,c_status2,status,c_ierr) +} diff --git a/ompi/mpi/fortran/use-mpi-f08/file_write_ordered_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/file_write_ordered_f08.F90 deleted file mode 100644 index 8087420e5ff..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/file_write_ordered_f08.F90 +++ /dev/null @@ -1,30 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All Rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_File_write_ordered_f08(fh,buf,count,datatype,status,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Status - use :: ompi_mpifh_bindings, only : ompi_file_write_ordered_f - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Status), INTENT(OUT) :: status - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_file_write_ordered_f(fh%MPI_VAL,buf,count,& - datatype%MPI_VAL,status,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_File_write_ordered_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/file_write_ordered_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/file_write_ordered_ts.c.in new file mode 100644 index 00000000000..2e67e4b142f --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_write_ordered_ts.c.in @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID file_write_ordered(FILE fh, BUFFER x, COUNT count, + DATATYPE datatype, STATUS_OUT status) +{ + int c_ierr; + MPI_File c_fh = PMPI_File_f2c(*fh); + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + void *buf = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count; + OMPI_FORTRAN_STATUS_DECLARATION(c_status,c_status2) + + OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_fh, c_ierr, FUNC_NAME) + return; + } + + OMPI_FORTRAN_STATUS_SET_POINTER(c_status,c_status2,status) + + c_ierr = @INNER_CALL@(c_fh, OMPI_F2C_BOTTOM(buf), c_count, c_datatype, + c_status); + + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + OMPI_FORTRAN_STATUS_RETURN(c_status,c_status2,status,c_ierr) +} diff --git a/ompi/mpi/fortran/use-mpi-f08/file_write_shared_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/file_write_shared_f08.F90 deleted file mode 100644 index f2e4400dda9..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/file_write_shared_f08.F90 +++ /dev/null @@ -1,30 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All Rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_File_write_shared_f08(fh,buf,count,datatype,status,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Status - use :: ompi_mpifh_bindings, only : ompi_file_write_shared_f - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Status), INTENT(OUT) :: status - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_file_write_shared_f(fh%MPI_VAL,buf,count,& - datatype%MPI_VAL,status,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_File_write_shared_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/file_write_shared_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/file_write_shared_ts.c.in new file mode 100644 index 00000000000..62b5c80b456 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_write_shared_ts.c.in @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID file_write_shared(FILE fh, BUFFER x, COUNT count, + DATATYPE datatype, STATUS_OUT status) +{ + int c_ierr; + MPI_File c_fh = PMPI_File_f2c(*fh); + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + void *buf = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count; + OMPI_FORTRAN_STATUS_DECLARATION(c_status,c_status2) + + OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_fh, c_ierr, FUNC_NAME) + return; + } + + OMPI_FORTRAN_STATUS_SET_POINTER(c_status,c_status2,status) + + c_ierr = @INNER_CALL@(c_fh, OMPI_F2C_BOTTOM(buf), c_count, c_datatype, + c_status); + + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + OMPI_FORTRAN_STATUS_RETURN(c_status,c_status2,status,c_ierr) +} diff --git a/ompi/mpi/fortran/use-mpi-f08/file_write_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/file_write_ts.c.in new file mode 100644 index 00000000000..f2b97e4a55b --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_write_ts.c.in @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID file_write(FILE fh, BUFFER x, COUNT count, + DATATYPE datatype, STATUS_OUT status) +{ + int c_ierr; + MPI_File c_fh = PMPI_File_f2c(*fh); + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + void *buf = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ __opal_attribute_unused__ c_count = (@COUNT_TYPE@) *count; + OMPI_FORTRAN_STATUS_DECLARATION(c_status,c_status2) + + OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_fh, c_ierr, FUNC_NAME) + return; + } + + OMPI_FORTRAN_STATUS_SET_POINTER(c_status,c_status2,status) + + c_ierr = @INNER_CALL@(c_fh, OMPI_F2C_BOTTOM(buf), + OMPI_FINT_2_INT(*count), + c_type, c_status); + + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + OMPI_FORTRAN_STATUS_RETURN(c_status,c_status2,status,c_ierr) +} diff --git a/ompi/mpi/fortran/use-mpi-f08/free_mem_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/free_mem_f08.F90 deleted file mode 100644 index 02a4006e5d2..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/free_mem_f08.F90 +++ /dev/null @@ -1,22 +0,0 @@ -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All Rights reserved. -! Copyright (c) 2015-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Free_mem_f08(base,ierror) - use :: ompi_mpifh_bindings, only : ompi_free_mem_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: base - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_free_mem_f(base,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Free_mem_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/free_mem_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/free_mem_ts.c.in new file mode 100644 index 00000000000..deced5f5920 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/free_mem_ts.c.in @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID free_mem(BUFFER x) +{ + int c_ierr; + if (OMPI_CFI_IS_CONTIGUOUS(x)) { + c_ierr = PMPI_Free_mem(OMPI_CFI_BASE_ADDR(x)); + } else { + c_ierr = MPI_ERR_BUFFER; + OMPI_ERRHANDLER_INVOKE(MPI_COMM_SELF, c_ierr, FUNC_NAME); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/gather_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/gather_f08.F90 deleted file mode 100644 index f238c103fbb..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/gather_f08.F90 +++ /dev/null @@ -1,32 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Gather_f08(sendbuf,sendcount,sendtype,recvbuf,recvcount,& - recvtype,root,comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm - use :: ompi_mpifh_bindings, only : ompi_gather_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE :: recvbuf - INTEGER, INTENT(IN) :: sendcount, recvcount, root - TYPE(MPI_Datatype), INTENT(IN) :: sendtype - TYPE(MPI_Datatype), INTENT(IN) :: recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_gather_f(sendbuf,sendcount,sendtype%MPI_VAL,recvbuf,recvcount,& - recvtype%MPI_VAL,root,comm%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Gather_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/gather_init_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/gather_init_f08.F90 deleted file mode 100644 index d18bfd1bc19..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/gather_init_f08.F90 +++ /dev/null @@ -1,35 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2022 Cisco Systems, Inc. All rights reserved -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2021 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Gather_init_f08(sendbuf,sendcount,sendtype,recvbuf,recvcount,& - recvtype,root,comm,info,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Info, MPI_Request - use :: ompi_mpifh_bindings, only : ompi_gather_init_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: sendcount, recvcount, root - TYPE(MPI_Datatype), INTENT(IN) :: sendtype - TYPE(MPI_Datatype), INTENT(IN) :: recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_gather_init_f(sendbuf,sendcount,sendtype%MPI_VAL,recvbuf,recvcount,& - recvtype%MPI_VAL,root,comm%MPI_VAL,info%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Gather_init_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/gather_init_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/gather_init_ts.c.in new file mode 100644 index 00000000000..85ad3eb9bc4 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/gather_init_ts.c.in @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2021 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID gather_init(BUFFER_ASYNC x1, COUNT sendcount, DATATYPE sendtype, + BUFFER_ASYNC_OUT x2, COUNT recvcount, DATATYPE recvtype, + RANK root, COMM comm, INFO info, REQUEST_OUT request) +{ + int c_ierr; + MPI_Comm c_comm; + MPI_Datatype c_sendtype, c_recvtype; + MPI_Datatype c_senddatatype = MPI_DATATYPE_NULL; + MPI_Info c_info; + MPI_Request c_request; + int c_root = OMPI_FINT_2_INT(*root); + void *sendbuf = OMPI_CFI_BASE_ADDR(x1), *recvbuf = OMPI_CFI_BASE_ADDR(x2); + @COUNT_TYPE@ c_sendcount = (@COUNT_TYPE@) *sendcount; + @COUNT_TYPE@ c_recvcount = (@COUNT_TYPE@) *recvcount; + + c_comm = PMPI_Comm_f2c(*comm); + c_sendtype = PMPI_Type_f2c(*sendtype); + c_recvtype = PMPI_Type_f2c(*recvtype); + c_info = PMPI_Info_f2c(*info); + if (OMPI_COMM_IS_INTER(c_comm)) { + if (MPI_ROOT == c_root) { + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + } else if (MPI_PROC_NULL != c_root) { + OMPI_CFI_2_C(x1, c_sendcount, c_sendtype, c_senddatatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + } + } else { + if (ompi_comm_rank(c_comm) == c_root) { + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + } + if (OMPI_IS_FORTRAN_IN_PLACE(sendbuf)) { + sendbuf = MPI_IN_PLACE; + } else { + OMPI_CFI_2_C(x1, c_sendcount, c_sendtype, c_senddatatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + } + } + + sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf); + sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); + recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); + + c_ierr = @INNER_CALL@(sendbuf, c_sendcount, + c_senddatatype, + recvbuf, + c_recvcount, + c_recvtype, + c_root, + c_comm, c_info, &c_request); + if (MPI_DATATYPE_NULL != c_senddatatype && c_senddatatype != c_sendtype) { + ompi_datatype_destroy(&c_senddatatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + if (MPI_SUCCESS == c_ierr) *request = PMPI_Request_c2f(c_request); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/gather_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/gather_ts.c.in new file mode 100644 index 00000000000..ac41efbb91c --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/gather_ts.c.in @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID gather(BUFFER x1, COUNT sendcount, DATATYPE sendtype, + BUFFER x2, COUNT recvcount, DATATYPE recvtype, + RANK root, COMM comm) +{ + int c_root, c_ierr; + MPI_Comm c_comm; + MPI_Datatype c_senddatatype = NULL, c_sendtype = NULL; + void *sendbuf = OMPI_CFI_BASE_ADDR(x1); + int c_sendcount = 0, c_recvcount = 0; + MPI_Datatype c_recvtype = NULL; + void *recvbuf = OMPI_CFI_BASE_ADDR(x2); + + c_comm = PMPI_Comm_f2c(*comm); + c_root = OMPI_FINT_2_INT(*root); + + if (OMPI_COMM_IS_INTER(c_comm)) { + if (MPI_ROOT == c_root) { + c_recvtype = PMPI_Type_f2c(*recvtype); + c_recvcount = OMPI_FINT_2_INT(*recvcount); + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + } else if (MPI_PROC_NULL != c_root) { + c_sendtype = PMPI_Type_f2c(*sendtype); + c_sendcount = OMPI_FINT_2_INT(*sendcount); + OMPI_CFI_2_C(x1, c_sendcount, c_sendtype, c_senddatatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + } + } else { + if (ompi_comm_rank(c_comm) == c_root) { + c_recvtype = PMPI_Type_f2c(*recvtype); + c_recvcount = OMPI_FINT_2_INT(*recvcount); + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + } + if (OMPI_IS_FORTRAN_IN_PLACE(sendbuf)) { + sendbuf = MPI_IN_PLACE; + } else { + c_sendtype = PMPI_Type_f2c(*sendtype); + c_sendcount = OMPI_FINT_2_INT(*sendcount); + OMPI_CFI_2_C(x1, c_sendcount, c_sendtype, c_senddatatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + } + } + + sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); + recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); + + + c_ierr = PMPI_Gather(sendbuf, c_sendcount, + c_senddatatype, recvbuf, + c_recvcount, + c_recvtype, + c_root, + c_comm); + if (c_senddatatype != c_sendtype) { + ompi_datatype_destroy(&c_senddatatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/gatherv_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/gatherv_f08.F90 deleted file mode 100644 index b53fa2e00e7..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/gatherv_f08.F90 +++ /dev/null @@ -1,33 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Gatherv_f08(sendbuf,sendcount,sendtype,recvbuf,recvcounts,& - displs,recvtype,root,comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm - use :: ompi_mpifh_bindings, only : ompi_gatherv_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE :: recvbuf - INTEGER, INTENT(IN) :: sendcount, root - INTEGER, INTENT(IN) :: recvcounts(*), displs(*) - TYPE(MPI_Datatype), INTENT(IN) :: sendtype - TYPE(MPI_Datatype), INTENT(IN) :: recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_gatherv_f(sendbuf,sendcount,sendtype%MPI_VAL,recvbuf,recvcounts,& - displs,recvtype%MPI_VAL,root,comm%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Gatherv_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/gatherv_init_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/gatherv_init_f08.F90 deleted file mode 100644 index 5ab996416ed..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/gatherv_init_f08.F90 +++ /dev/null @@ -1,36 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2022 Cisco Systems, Inc. All rights reserved -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2021 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Gatherv_init_f08(sendbuf,sendcount,sendtype,recvbuf,recvcounts,& - displs,recvtype,root,comm,info,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Info, MPI_Request - use :: ompi_mpifh_bindings, only : ompi_gatherv_init_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: sendcount, root - INTEGER, INTENT(IN) OMPI_ASYNCHRONOUS :: recvcounts(*), displs(*) - TYPE(MPI_Datatype), INTENT(IN) :: sendtype - TYPE(MPI_Datatype), INTENT(IN) :: recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_gatherv_init_f(sendbuf,sendcount,sendtype%MPI_VAL,recvbuf,recvcounts,& - displs,recvtype%MPI_VAL,root,comm%MPI_VAL,info%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Gatherv_init_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/gatherv_init_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/gatherv_init_ts.c.in new file mode 100644 index 00000000000..10e8b8bb5d0 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/gatherv_init_ts.c.in @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2021 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2021 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID gatherv_init(BUFFER_ASYNC x1, COUNT sendcount, DATATYPE sendtype, + BUFFER_ASYNC_OUT x2, COUNT_ARRAY recvcounts, DISP_ARRAY displs, + DATATYPE recvtype, RANK root, COMM comm, + INFO info, REQUEST_OUT request) +{ + MPI_Comm c_comm; + MPI_Datatype c_sendtype, c_recvtype; + MPI_Datatype c_senddatatype = MPI_DATATYPE_NULL; + MPI_Info c_info; + MPI_Request c_request; + int idx = 0, c_ierr; + int c_root = OMPI_FINT_2_INT(*root); + char *sendbuf = OMPI_CFI_BASE_ADDR(x1), *recvbuf = OMPI_CFI_BASE_ADDR(x2); + @COUNT_TYPE@ *tmp_recvcounts = NULL; + @DISP_TYPE@ *tmp_displs = NULL; + + c_comm = PMPI_Comm_f2c(*comm); + c_sendtype = PMPI_Type_f2c(*sendtype); + c_recvtype = PMPI_Type_f2c(*recvtype); + c_info = PMPI_Info_f2c(*info); + @COUNT_TYPE@ c_sendcount = (@COUNT_TYPE@) *sendcount; + + if (OMPI_COMM_IS_INTER(c_comm)) { + if (MPI_ROOT == c_root) { + int size = ompi_comm_remote_size(c_comm); + c_recvtype = PMPI_Type_f2c(*recvtype); + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(recvcounts, tmp_recvcounts, size); + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(displs, tmp_displs, size); + } else if (MPI_PROC_NULL != c_root) { + c_sendtype = PMPI_Type_f2c(*sendtype); + OMPI_CFI_2_C(x1, c_sendcount, c_sendtype, c_senddatatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + } + } else { + if (ompi_comm_rank(c_comm) == c_root) { + int size = ompi_comm_size(c_comm); + c_recvtype = PMPI_Type_f2c(*recvtype); + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(recvcounts, tmp_recvcounts, size); + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(displs, tmp_displs, size); + } + if (OMPI_IS_FORTRAN_IN_PLACE(sendbuf)) { + sendbuf = MPI_IN_PLACE; + } else { + c_sendtype = PMPI_Type_f2c(*sendtype); + OMPI_CFI_2_C(x1, c_sendcount, c_sendtype, c_senddatatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + } + } + + sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf); + sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); + recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); + + c_ierr = @INNER_CALL@(sendbuf, + c_sendcount, + c_senddatatype, + recvbuf, + tmp_recvcounts, + tmp_displs, + c_recvtype, + c_root, + c_comm, c_info, &c_request); + if (MPI_DATATYPE_NULL != c_senddatatype && c_senddatatype != c_sendtype) { + ompi_datatype_destroy(&c_senddatatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + if (MPI_SUCCESS == c_ierr) { + *request = PMPI_Request_c2f(c_request); + } else { + OMPI_ARRAY_FINT_2_INT_CLEANUP(recvcounts); + OMPI_ARRAY_FINT_2_INT_CLEANUP(displs); + } + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP_NONBLOCKING(recvcounts, tmp_recvcounts, c_request, c_ierr, idx); + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP_NONBLOCKING(displs, tmp_displs, c_request, c_ierr, idx); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/gatherv_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/gatherv_ts.c.in new file mode 100644 index 00000000000..bb4c827c4d5 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/gatherv_ts.c.in @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID gatherv(BUFFER x1, COUNT sendcount, DATATYPE sendtype, + BUFFER x2, COUNT_ARRAY recvcounts, DISP_ARRAY displs, + DATATYPE recvtype, RANK root, COMM comm) +{ + int c_ierr; + MPI_Comm c_comm = PMPI_Comm_f2c(*comm); + int c_root = OMPI_FINT_2_INT(*root); + MPI_Datatype c_senddatatype = NULL, c_sendtype = NULL, c_recvtype = NULL; + @COUNT_TYPE@ c_sendcount = (@COUNT_TYPE@) *sendcount; + char *sendbuf = OMPI_CFI_BASE_ADDR(x1), *recvbuf = OMPI_CFI_BASE_ADDR(x2); + @COUNT_TYPE@ *tmp_recvcounts = NULL; + @DISP_TYPE@ *tmp_displs = NULL; + + if (OMPI_COMM_IS_INTER(c_comm)) { + if (MPI_ROOT == c_root) { + int size = ompi_comm_remote_size(c_comm); + c_recvtype = PMPI_Type_f2c(*recvtype); + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(recvcounts, tmp_recvcounts, size); + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(displs, tmp_displs, size); + } else if (MPI_PROC_NULL != c_root) { + c_sendtype = PMPI_Type_f2c(*sendtype); + OMPI_CFI_2_C(x1, c_sendcount, c_sendtype, c_senddatatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + } + } else { + if (ompi_comm_rank(c_comm) == c_root) { + int size = ompi_comm_size(c_comm); + c_recvtype = PMPI_Type_f2c(*recvtype); + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(recvcounts, tmp_recvcounts, size); + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(displs, tmp_displs, size); + } + if (OMPI_IS_FORTRAN_IN_PLACE(sendbuf)) { + sendbuf = MPI_IN_PLACE; + } else { + c_sendtype = PMPI_Type_f2c(*sendtype); + OMPI_CFI_2_C(x1, c_sendcount, c_sendtype, c_senddatatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + } + } + + sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); + recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); + + c_ierr = @INNER_CALL@(sendbuf, c_sendcount, + c_senddatatype, recvbuf, + tmp_recvcounts, + tmp_displs, + c_recvtype, + c_root, + c_comm); + + if (c_senddatatype != c_sendtype) { + ompi_datatype_destroy(&c_senddatatype); + } + + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP(recvcounts, tmp_recvcounts); + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP(displs, tmp_displs); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/get_accumulate_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/get_accumulate_f08.F90 deleted file mode 100644 index 9fd4f2ead5b..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/get_accumulate_f08.F90 +++ /dev/null @@ -1,39 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2010-2022 Cisco Systems, Inc. All rights reserved -! Copyright (c) 2009-2014 Los Alamos National Security, LLC. -! All Rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Get_accumulate_f08(origin_addr,origin_count,origin_datatype,& - result_addr,result_count,result_datatype,& - target_rank,target_disp,target_count, & - target_datatype,op,win,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Op, MPI_Win, MPI_ADDRESS_KIND - use :: ompi_mpifh_bindings, only : ompi_get_accumulate_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) OMPI_ASYNCHRONOUS :: origin_addr - INTEGER, INTENT(IN) :: origin_count, result_count, target_rank, target_count - TYPE(MPI_Datatype), INTENT(IN) :: origin_datatype - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: result_addr - TYPE(MPI_Datatype), INTENT(IN) :: result_datatype - INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: target_disp - TYPE(MPI_Datatype), INTENT(IN) :: target_datatype - TYPE(MPI_Op), INTENT(IN) :: op - TYPE(MPI_Win), INTENT(IN) :: win - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_get_accumulate_f(origin_addr,origin_count,origin_datatype%MPI_VAL,& - result_addr,result_count,result_datatype%MPI_VAL,& - target_rank,target_disp,target_count,target_datatype%MPI_VAL,& - op%MPI_VAL,win%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Get_accumulate_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/get_accumulate_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/get_accumulate_ts.c.in new file mode 100644 index 00000000000..3b3b00d39f0 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/get_accumulate_ts.c.in @@ -0,0 +1,77 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2014 Los Alamos National Security, LLC. All rights + * reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID get_accumulate(BUFFER_ASYNC x1, COUNT origin_count, + DATATYPE origin_datatype, BUFFER_ASYNC_OUT x2, + COUNT result_count, DATATYPE result_datatype, + RANK target_rank, DISP target_disp, + COUNT target_count, DATATYPE target_datatype, + OP op, WIN win) +{ + int c_ierr; + MPI_Datatype c_origin_datatype, c_origin_type = PMPI_Type_f2c(*origin_datatype); + MPI_Datatype c_result_datatype, c_result_type = PMPI_Type_f2c(*result_datatype); + MPI_Datatype c_target_datatype = PMPI_Type_f2c(*target_datatype); + MPI_Win c_win = PMPI_Win_f2c(*win); + MPI_Op c_op = PMPI_Op_f2c(*op); + char *origin_addr = OMPI_CFI_BASE_ADDR(x1); + @COUNT_TYPE@ c_origin_count = (@COUNT_TYPE@) *origin_count; + char *result_addr = OMPI_CFI_BASE_ADDR(x2); + @COUNT_TYPE@ c_result_count = (@COUNT_TYPE@) *result_count; + + OMPI_CFI_2_C(x1, c_origin_count, c_origin_type, c_origin_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_win, c_ierr, FUNC_NAME) + return; + } + OMPI_CFI_2_C(x2, c_result_count, c_result_type, c_result_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + if (c_origin_datatype != c_origin_type) { + ompi_datatype_destroy(&c_origin_datatype); + } + OMPI_ERRHANDLER_INVOKE(c_win, c_ierr, FUNC_NAME) + return; + } + c_ierr = @INNER_CALL@(OMPI_F2C_BOTTOM(origin_addr), + c_origin_count, + c_origin_datatype, + OMPI_F2C_BOTTOM(result_addr), + c_result_count, + c_result_datatype, + OMPI_FINT_2_INT(*target_rank), + *target_disp, + OMPI_FINT_2_INT(*target_count), + c_target_datatype, c_op, c_win); + if (c_origin_datatype != c_origin_type) { + ompi_datatype_destroy(&c_origin_datatype); + } + if (c_result_datatype != c_result_type) { + ompi_datatype_destroy(&c_result_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/get_address_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/get_address_f08.F90 deleted file mode 100644 index 187086d0fc5..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/get_address_f08.F90 +++ /dev/null @@ -1,26 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Get_address_f08(location,address,ierror) - use :: mpi_f08_types, only : MPI_ADDRESS_KIND - use :: ompi_mpifh_bindings, only : ompi_get_address_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: location - INTEGER(MPI_ADDRESS_KIND), INTENT(OUT) :: address - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_get_address_f(location,address,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Get_address_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/get_address_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/get_address_ts.c.in new file mode 100644 index 00000000000..d672e8c1139 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/get_address_ts.c.in @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID get_address(BUFFER_ASYNC x, AINT address) +{ + int c_ierr; + MPI_Aint c_address; + + c_ierr = PMPI_Get_address(OMPI_F2C_BOTTOM(OMPI_CFI_BASE_ADDR(x)), &c_address); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + *address = (MPI_Aint) c_address; + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/get_count.c.in b/ompi/mpi/fortran/use-mpi-f08/get_count.c.in new file mode 100644 index 00000000000..bd2c67eab4e --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/get_count.c.in @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID get_count(STATUS status, DATATYPE datatype, COUNT count) +{ + int c_ierr; + MPI_Datatype c_type = PMPI_Type_f2c(*datatype); + MPI_Status c_status; + OMPI_SINGLE_NAME_DECL(count); + + if (OMPI_IS_FORTRAN_STATUS_IGNORE(status)) { + *count = OMPI_INT_2_FINT(0); + c_ierr = MPI_SUCCESS; + } else { + c_ierr = PMPI_Status_f2c(status, &c_status); + + if (MPI_SUCCESS == c_ierr) { + c_ierr = @INNER_CALL@(&c_status, c_type, + OMPI_SINGLE_NAME_CONVERT(count)); + OMPI_SINGLE_INT_2_FINT(count); + } + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/get_count_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/get_count_f08.F90 deleted file mode 100644 index 63333becea8..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/get_count_f08.F90 +++ /dev/null @@ -1,25 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "mpi-f08-rename.h" - -subroutine MPI_Get_count_f08(status,datatype,count,ierror) - use :: mpi_f08_types, only : MPI_Status, MPI_Datatype - use :: ompi_mpifh_bindings, only : ompi_get_count_f - implicit none - TYPE(MPI_Status), INTENT(IN) :: status - TYPE(MPI_Datatype), INTENT(IN) :: datatype - INTEGER, INTENT(OUT) :: count - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_get_count_f(status,datatype%MPI_VAL,count,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Get_count_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/get_elements.c.in b/ompi/mpi/fortran/use-mpi-f08/get_elements.c.in new file mode 100644 index 00000000000..6bc81b7b1dd --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/get_elements.c.in @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID get_elements(STATUS status, DATATYPE datatype, COUNT_OUT count) +{ + int c_ierr; + MPI_Datatype c_type = PMPI_Type_f2c(*datatype); + MPI_Status c_status; + OMPI_SINGLE_NAME_DECL(count); + + if (OMPI_IS_FORTRAN_STATUS_IGNORE(status)) { + *count = OMPI_INT_2_FINT(0); + c_ierr = MPI_SUCCESS; + } else { + c_ierr = PMPI_Status_f2c(status, &c_status); + + if (MPI_SUCCESS == c_ierr) { + c_ierr = @INNER_CALL@(&c_status, c_type, + OMPI_SINGLE_NAME_CONVERT(count)); + OMPI_SINGLE_INT_2_FINT(count); + } + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/get_elements_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/get_elements_f08.F90 deleted file mode 100644 index 472e3089183..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/get_elements_f08.F90 +++ /dev/null @@ -1,25 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "mpi-f08-rename.h" - -subroutine MPI_Get_elements_f08(status,datatype,count,ierror) - use :: mpi_f08_types, only : MPI_Status, MPI_Datatype - use :: ompi_mpifh_bindings, only : ompi_get_elements_f - implicit none - TYPE(MPI_Status), INTENT(IN) :: status - TYPE(MPI_Datatype), INTENT(IN) :: datatype - INTEGER, INTENT(OUT) :: count - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_get_elements_f(status,datatype%MPI_VAL,count,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Get_elements_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/get_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/get_f08.F90 deleted file mode 100644 index a51ca425ccd..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/get_f08.F90 +++ /dev/null @@ -1,32 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2010-2022 Cisco Systems, Inc. All rights reserved -! Copyright (c) 2009-2018 Los Alamos National Security, LLC. -! All Rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Get_f08(origin_addr,origin_count,origin_datatype,target_rank,& - target_disp,target_count,target_datatype,win,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Win, MPI_ADDRESS_KIND - use :: ompi_mpifh_bindings, only : ompi_get_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: origin_addr - INTEGER, INTENT(IN) :: origin_count, target_rank, target_count - TYPE(MPI_Datatype), INTENT(IN) :: origin_datatype - INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: target_disp - TYPE(MPI_Datatype), INTENT(IN) :: target_datatype - TYPE(MPI_Win), INTENT(IN) :: win - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_get_f(origin_addr,origin_count,origin_datatype%MPI_VAL,target_rank,& - target_disp,target_count,target_datatype%MPI_VAL,win%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Get_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/get_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/get_ts.c.in new file mode 100644 index 00000000000..c47dc0622b6 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/get_ts.c.in @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID get(BUFFER_ASYNC x, COUNT origin_count, + DATATYPE origin_datatype, RANK target_rank, + AINT target_disp, COUNT target_count, + DATATYPE target_datatype, WIN win) +{ + int c_ierr; + MPI_Datatype c_origin_datatype, c_origin_type = PMPI_Type_f2c(*origin_datatype); + MPI_Datatype c_target_datatype = PMPI_Type_f2c(*target_datatype); + MPI_Win c_win = PMPI_Win_f2c(*win); + char *origin_addr = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_origin_count = (@COUNT_TYPE@) *origin_count; + + OMPI_CFI_2_C(x, c_origin_count, c_origin_type, c_origin_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_win, c_ierr, FUNC_NAME) + return; + } + c_ierr = @INNER_CALL@(OMPI_F2C_BOTTOM(origin_addr), + c_origin_count, + c_origin_datatype, + OMPI_FINT_2_INT(*target_rank), + *target_disp, + OMPI_FINT_2_INT(*target_count), + c_target_datatype, c_win); + if (c_origin_datatype != c_origin_type) { + ompi_datatype_destroy(&c_origin_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/iallgather_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/iallgather_f08.F90 deleted file mode 100644 index f178b948529..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/iallgather_f08.F90 +++ /dev/null @@ -1,32 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2022 Cisco Systems, Inc. All rights reserved -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Iallgather_f08(sendbuf,sendcount,sendtype,recvbuf,recvcount,recvtype,comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request - use :: ompi_mpifh_bindings, only : ompi_iallgather_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: sendcount, recvcount - TYPE(MPI_Datatype), INTENT(IN) :: sendtype - TYPE(MPI_Datatype), INTENT(IN) :: recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_iallgather_f(sendbuf,sendcount,sendtype%MPI_VAL,& - recvbuf,recvcount,recvtype%MPI_VAL,comm%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Iallgather_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/iallgather_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/iallgather_ts.c.in new file mode 100644 index 00000000000..8730f5980a4 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/iallgather_ts.c.in @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID iallgather(BUFFER_ASYNC x1, COUNT sendcount, DATATYPE sendtype, + BUFFER_ASYNC_OUT x2, COUNT recvcount, DATATYPE recvtype, + COMM comm, REQUEST_OUT request) +{ + int c_ierr; + MPI_Comm c_comm = PMPI_Comm_f2c(*comm); + MPI_Request c_req; + MPI_Datatype c_sendtype = NULL, c_senddatatype = NULL; + void *sendbuf = OMPI_CFI_BASE_ADDR(x1); + @COUNT_TYPE@ c_sendcount = 0; + MPI_Datatype c_recvtype = PMPI_Type_f2c(*recvtype); + void *recvbuf = OMPI_CFI_BASE_ADDR(x2); + @COUNT_TYPE@ c_recvcount = (@COUNT_TYPE@) *recvcount; + + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + if (OMPI_COMM_IS_INTER(c_comm) || !OMPI_IS_FORTRAN_IN_PLACE(sendbuf)) { + c_sendtype = PMPI_Type_f2c(*sendtype); + c_sendcount = OMPI_FINT_2_INT(*sendcount); + OMPI_CFI_2_C(x1, c_sendcount, c_sendtype, c_senddatatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + } else { + sendbuf = MPI_IN_PLACE; + } + + sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); + recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); + + c_ierr = @INNER_CALL@(sendbuf, c_sendcount, c_sendtype, + recvbuf, c_recvcount, c_recvtype, + c_comm, &c_req); + + if (c_senddatatype != c_sendtype && c_senddatatype != NULL) { + ompi_datatype_destroy(&c_senddatatype); + } + + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + if (MPI_SUCCESS == c_ierr) *request = PMPI_Request_c2f(c_req); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/iallgatherv_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/iallgatherv_f08.F90 deleted file mode 100644 index 3d44e27b0c7..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/iallgatherv_f08.F90 +++ /dev/null @@ -1,34 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2022 Cisco Systems, Inc. All rights reserved -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Iallgatherv_f08(sendbuf,sendcount,sendtype,recvbuf,recvcounts,& - displs,recvtype,comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request - use :: ompi_mpifh_bindings, only : ompi_iallgatherv_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: sendcount - INTEGER, INTENT(IN) OMPI_ASYNCHRONOUS :: recvcounts(*), displs(*) - TYPE(MPI_Datatype), INTENT(IN) :: sendtype - TYPE(MPI_Datatype), INTENT(IN) :: recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_iallgatherv_f(sendbuf,sendcount,sendtype%MPI_VAL,recvbuf,recvcounts,& - displs,recvtype%MPI_VAL,comm%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Iallgatherv_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/iallgatherv_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/iallgatherv_ts.c.in new file mode 100644 index 00000000000..cacd6ec6356 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/iallgatherv_ts.c.in @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID iallgatherv(BUFFER_ASYNC x1, COUNT sendcount, DATATYPE sendtype, + BUFFER_ASYNC_OUT x2, COUNT_ARRAY recvcounts, DISP_ARRAY displs, + DATATYPE recvtype, COMM comm, REQUEST_OUT request) +{ + int c_ierr; + MPI_Comm c_comm = PMPI_Comm_f2c(*comm); + @COUNT_TYPE@ c_sendcount = 0; + MPI_Datatype c_sendtype = NULL, c_senddatatype = NULL; + MPI_Datatype c_recvtype = PMPI_Type_f2c(*recvtype); + char *sendbuf = OMPI_CFI_BASE_ADDR(x1), *recvbuf = OMPI_CFI_BASE_ADDR(x2); + MPI_Request c_request; + int size; + @COUNT_TYPE@ *tmp_recvcounts = NULL; + @DISP_TYPE@ *tmp_displs = NULL; + + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + if (OMPI_COMM_IS_INTER(c_comm)) { + size = ompi_comm_remote_size(c_comm); + c_sendtype = PMPI_Type_f2c(*sendtype); + c_sendcount = (@COUNT_TYPE@) *sendcount; + OMPI_CFI_2_C(x1, c_sendcount, c_sendtype, c_senddatatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + } else { + size = ompi_comm_size(c_comm); + if (OMPI_IS_FORTRAN_IN_PLACE(sendbuf)) { + sendbuf = MPI_IN_PLACE; + } else { + c_sendtype = PMPI_Type_f2c(*sendtype); + c_sendcount = (@COUNT_TYPE@) *sendcount; + OMPI_CFI_2_C(x1, c_sendcount, c_sendtype, c_senddatatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + } + } + + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(recvcounts, tmp_recvcounts, size); + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(displs, tmp_displs, size); + + sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); + recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); + + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(recvcounts, tmp_recvcounts, size); + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(displs, tmp_displs, size); + + c_ierr = @INNER_CALL@(sendbuf, c_sendcount, c_sendtype, + recvbuf, + OMPI_ARRAY_NAME_CONVERT(recvcounts), + OMPI_ARRAY_NAME_CONVERT(displs), + c_recvtype, + c_comm, &c_request); + + if (c_senddatatype != c_sendtype && NULL != c_senddatatype) { + ompi_datatype_destroy(&c_senddatatype); + } + + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + if (MPI_SUCCESS == c_ierr) *request = PMPI_Request_c2f(c_request); + + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP(recvcounts, tmp_recvcounts); + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP(displs, tmp_displs); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/iallreduce_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/iallreduce_f08.F90 deleted file mode 100644 index e0bbffec347..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/iallreduce_f08.F90 +++ /dev/null @@ -1,32 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2022 Cisco Systems, Inc. All rights reserved -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Iallreduce_f08(sendbuf,recvbuf,count,datatype,op,comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Op, MPI_Comm, MPI_Request - use :: ompi_mpifh_bindings, only : ompi_iallreduce_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Op), INTENT(IN) :: op - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_iallreduce_f(sendbuf,recvbuf,count,datatype%MPI_VAL,& - op%MPI_VAL,comm%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Iallreduce_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/iallreduce_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/iallreduce_ts.c.in new file mode 100644 index 00000000000..5f803ada126 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/iallreduce_ts.c.in @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID iallreduce(BUFFER_ASYNC x1, BUFFER_ASYNC_OUT x2, COUNT count, + DATATYPE datatype, OP op, COMM comm, + REQUEST_OUT request) +{ + int c_ierr; + @COUNT_TYPE@ c_count = (@COUNT_TYPE@)*count; + MPI_Comm c_comm = PMPI_Comm_f2c(*comm); + MPI_Datatype c_type; + MPI_Request c_request; + MPI_Op c_op; + char *sendbuf = OMPI_CFI_BASE_ADDR(x1), *recvbuf = OMPI_CFI_BASE_ADDR(x2); + + OMPI_CFI_CHECK_CONTIGUOUS(x1, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + c_type = PMPI_Type_f2c(*datatype); + c_op = PMPI_Op_f2c(*op); + + sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf); + sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); + recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); + + c_ierr = @INNER_CALL@(sendbuf, recvbuf, + c_count, + c_type, c_op, c_comm, &c_request); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + if (MPI_SUCCESS == c_ierr) *request = PMPI_Request_c2f(c_request); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/ialltoall_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/ialltoall_f08.F90 deleted file mode 100644 index 3df84b0352d..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/ialltoall_f08.F90 +++ /dev/null @@ -1,33 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2022 Cisco Systems, Inc. All rights reserved -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Ialltoall_f08(sendbuf,sendcount,sendtype,recvbuf,& - recvcount,recvtype,comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request - use :: ompi_mpifh_bindings, only : ompi_ialltoall_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: sendcount, recvcount - TYPE(MPI_Datatype), INTENT(IN) :: sendtype - TYPE(MPI_Datatype), INTENT(IN) :: recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_ialltoall_f(sendbuf,sendcount,sendtype%MPI_VAL,recvbuf,& - recvcount,recvtype%MPI_VAL,comm%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Ialltoall_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/ialltoall_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/ialltoall_ts.c.in new file mode 100644 index 00000000000..1a9c39a8725 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/ialltoall_ts.c.in @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID ialltoall(BUFFER_ASYNC x1, COUNT sendcount, DATATYPE sendtype, + BUFFER_ASYNC_OUT x2, COUNT recvcount, DATATYPE recvtype, + COMM comm, REQUEST_OUT request) +{ + int c_ierr; + MPI_Comm c_comm = PMPI_Comm_f2c(*comm); + MPI_Datatype c_sendtype = NULL, c_recvtype = PMPI_Type_f2c(*recvtype); + void *sendbuf = OMPI_CFI_BASE_ADDR(x1), *recvbuf = OMPI_CFI_BASE_ADDR(x2); + @COUNT_TYPE@ c_sendcount = 0, c_recvcount = (@COUNT_TYPE@)*recvcount; + MPI_Request c_request; + + if (OMPI_COMM_IS_INTER(c_comm) || !OMPI_IS_FORTRAN_IN_PLACE(sendbuf)) { + c_sendtype = PMPI_Type_f2c(*sendtype); + c_sendcount = (@COUNT_TYPE@)*sendcount; + OMPI_CFI_CHECK_CONTIGUOUS(x1, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + } else { + sendbuf = MPI_IN_PLACE; + } + + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + + sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); + recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); + + c_ierr = @INNER_CALL@(sendbuf, + c_sendcount, + c_sendtype, + recvbuf, + c_recvcount, + c_recvtype, c_comm, &c_request); + + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + if (MPI_SUCCESS == c_ierr) *request = PMPI_Request_c2f(c_request); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/ialltoallv_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/ialltoallv_f08.F90 deleted file mode 100644 index 65bc9858931..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/ialltoallv_f08.F90 +++ /dev/null @@ -1,33 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2022 Cisco Systems, Inc. All rights reserved -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Ialltoallv_f08(sendbuf,sendcounts,sdispls,sendtype,recvbuf,& - recvcounts,rdispls,recvtype,comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request - use :: ompi_mpifh_bindings, only : ompi_ialltoallv_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) OMPI_ASYNCHRONOUS :: sendcounts(*), sdispls(*), recvcounts(*), rdispls(*) - TYPE(MPI_Datatype), INTENT(IN) :: sendtype - TYPE(MPI_Datatype), INTENT(IN) :: recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_ialltoallv_f(sendbuf,sendcounts,sdispls,sendtype%MPI_VAL,& - recvbuf,recvcounts,rdispls,recvtype%MPI_VAL,comm%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Ialltoallv_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/ialltoallv_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/ialltoallv_ts.c.in new file mode 100644 index 00000000000..bd8255f1ad3 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/ialltoallv_ts.c.in @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID ialltoallv(BUFFER_ASYNC x1, COUNT_ARRAY sendcounts, DISP_ARRAY sdispls, + DATATYPE sendtype, BUFFER_ASYNC_OUT x2, COUNT_ARRAY recvcounts, + DISP_ARRAY rdispls, DATATYPE recvtype, + COMM comm, REQUEST_OUT request) +{ + int c_ierr; + MPI_Comm c_comm = PMPI_Comm_f2c(*comm); + char *sendbuf = OMPI_CFI_BASE_ADDR(x1), *recvbuf = OMPI_CFI_BASE_ADDR(x2); + MPI_Datatype c_sendtype = NULL, c_recvtype = PMPI_Type_f2c(*recvtype); + MPI_Request c_request; + int size = OMPI_COMM_IS_INTER(c_comm)?ompi_comm_remote_size(c_comm):ompi_comm_size(c_comm); + @COUNT_TYPE@ *tmp_sendcounts = NULL; + @DISP_TYPE@ *tmp_sdispls = NULL; + @COUNT_TYPE@ *tmp_recvcounts = NULL; + @DISP_TYPE@ *tmp_rdispls = NULL; + + if (OMPI_COMM_IS_INTER(c_comm) || !OMPI_IS_FORTRAN_IN_PLACE(sendbuf)) { + c_sendtype = PMPI_Type_f2c(*sendtype); + OMPI_CFI_CHECK_CONTIGUOUS(x1, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(sendcounts, tmp_sendcounts, size); + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(sdispls, tmp_sdispls, size); + } else { + sendbuf = MPI_IN_PLACE; + } + + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(recvcounts, tmp_recvcounts, size); + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(rdispls, tmp_rdispls, size); + + sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); + recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); + + c_ierr = @INNER_CALL@(sendbuf, + tmp_sendcounts, + tmp_sdispls, + c_sendtype, + recvbuf, + tmp_recvcounts, + tmp_rdispls, + c_recvtype, c_comm, &c_request); + + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + if (MPI_SUCCESS == c_ierr) *request = PMPI_Request_c2f(c_request); + if (MPI_IN_PLACE == sendbuf) { + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP(sendcounts, tmp_sendcounts); + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP(sdispls, tmp_sdispls); + } + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP(recvcounts, tmp_recvcounts); + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP(rdispls, tmp_rdispls); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/ialltoallw_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/ialltoallw_f08.F90 deleted file mode 100644 index c5432df5815..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/ialltoallw_f08.F90 +++ /dev/null @@ -1,43 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2022 Cisco Systems, Inc. All rights reserved -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Ialltoallw_f08(sendbuf,sendcounts,sdispls,sendtypes,& - recvbuf,recvcounts,rdispls,recvtypes,comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request - use :: ompi_mpifh_bindings, only : ompi_ialltoallw_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) OMPI_ASYNCHRONOUS :: sendcounts(*), sdispls(*), recvcounts(*), rdispls(*) - TYPE(MPI_Datatype), INTENT(IN) OMPI_ASYNCHRONOUS :: sendtypes(*), recvtypes(*) - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - ! Note that we pass a scalar here for both the sendtypes and - ! recvtypes arguments, even though the real Alltoallw function - ! expects an array of integers. This is a hack: we know that - ! [send|recv]types(1)%MPI_VAL will pass the address of the first - ! integer in the array of Type(MPI_Datatype) derived types. And - ! since Type(MPI_Datatype) are exactly memory-equivalent to a - ! single INTEGER, passing the address of the first one is the same - ! as passing the address to an array of integers. To be clear: the - ! back-end ompi_alltoallw_f is expecting a pointer to an array of - ! integers. So it all works out (but is a hack :-\ ). - call ompi_ialltoallw_f(sendbuf,sendcounts,sdispls,sendtypes(1)%MPI_VAL,& - recvbuf,recvcounts,rdispls,recvtypes(1)%MPI_VAL,comm%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Ialltoallw_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/ialltoallw_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/ialltoallw_ts.c.in new file mode 100644 index 00000000000..dbeebf41910 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/ialltoallw_ts.c.in @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID ialltoallw(BUFFER_ASYNC x1, COUNT_ARRAY sendcounts, + DISP_ARRAY sdispls, DATATYPE_ARRAY sendtypes, + BUFFER_ASYNC_OUT x2, COUNT_ARRAY recvcounts, + DISP_ARRAY rdispls, DATATYPE_ARRAY recvtypes, + COMM comm, REQUEST_OUT request) +{ + MPI_Comm c_comm = PMPI_Comm_f2c(*comm); + MPI_Datatype *c_sendtypes = NULL, *c_recvtypes; + MPI_Request c_request; + int size, c_ierr; + char *sendbuf = OMPI_CFI_BASE_ADDR(x1), *recvbuf = OMPI_CFI_BASE_ADDR(x2); + @COUNT_TYPE@ *tmp_sendcounts = NULL; + @DISP_TYPE@ *tmp_sdispls = NULL; + @COUNT_TYPE@ *tmp_recvcounts = NULL; + @DISP_TYPE@ *tmp_rdispls = NULL; + + OMPI_CFI_CHECK_CONTIGUOUS(x1, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + size = OMPI_COMM_IS_INTER(c_comm)?ompi_comm_remote_size(c_comm):ompi_comm_size(c_comm); + + if (!OMPI_IS_FORTRAN_IN_PLACE(sendbuf)) { + c_sendtypes = (MPI_Datatype *) malloc(size * sizeof(MPI_Datatype)); + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(sendcounts, tmp_sendcounts, size); + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(sdispls, tmp_sdispls, size); + for (int i=0; i 0) { + c_sendtypes[size - 1] = PMPI_Type_f2c(sendtypes[size - 1]); + c_recvtypes[size - 1] = PMPI_Type_f2c(recvtypes[size - 1]); + --size; + } + + /* Ineighbor_alltoallw does not support MPI_IN_PLACE */ + sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); + recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); + + c_ierr = @INNER_CALL@(sendbuf, + tmp_sendcounts, + sdispls, + c_sendtypes, + recvbuf, + tmp_recvcounts, + rdispls, + c_recvtypes, c_comm, &c_request); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + if (MPI_SUCCESS == c_ierr) *request = PMPI_Request_c2f(c_request); + + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP(sendcounts, tmp_sendcounts); + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP(recvcounts, tmp_recvcounts); + free(c_sendtypes); + free(c_recvtypes); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/irecv_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/irecv_ts.c.in new file mode 100644 index 00000000000..19048b01ae5 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/irecv_ts.c.in @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE void irecv(BUFFER_OUT x, COUNT count, DATATYPE datatype, + RANK source, TAG tag, COMM comm, + REQUEST_OUT request) +{ + int c_ierr; + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + MPI_Request c_req; + MPI_Comm c_comm = PMPI_Comm_f2c (*comm); + void *buf = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count; + + OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + + c_ierr = @INNER_CALL@(OMPI_F2C_BOTTOM(buf), c_count, + c_datatype, OMPI_FINT_2_INT(*source), + OMPI_FINT_2_INT(*tag), c_comm, &c_req); + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + *request = PMPI_Request_c2f(c_req); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/ireduce_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/ireduce_f08.F90 deleted file mode 100644 index f69dd777fb9..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/ireduce_f08.F90 +++ /dev/null @@ -1,32 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2022 Cisco Systems, Inc. All rights reserved -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Ireduce_f08(sendbuf,recvbuf,count,datatype,op,root,comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Op, MPI_Comm, MPI_Request - use :: ompi_mpifh_bindings, only : ompi_ireduce_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: count, root - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Op), INTENT(IN) :: op - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_ireduce_f(sendbuf,recvbuf,count,datatype%MPI_VAL,& - op%MPI_VAL,root,comm%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Ireduce_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/ireduce_scatter_block_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/ireduce_scatter_block_f08.F90 deleted file mode 100644 index 0e2a3906131..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/ireduce_scatter_block_f08.F90 +++ /dev/null @@ -1,32 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2022 Cisco Systems, Inc. All rights reserved -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Ireduce_scatter_block_f08(sendbuf,recvbuf,recvcount,datatype,op,comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Op, MPI_Comm, MPI_Request - use :: ompi_mpifh_bindings, only : ompi_ireduce_scatter_block_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: recvcount - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Op), INTENT(IN) :: op - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_ireduce_scatter_block_f(sendbuf,recvbuf,recvcount,& - datatype%MPI_VAL,op%MPI_VAL,comm%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Ireduce_scatter_block_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/ireduce_scatter_block_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/ireduce_scatter_block_ts.c.in new file mode 100644 index 00000000000..1d5e0e853ca --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/ireduce_scatter_block_ts.c.in @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID ireduce_scatter_block(BUFFER_ASYNC x1, BUFFER_ASYNC_OUT x2, + COUNT recvcount, DATATYPE datatype, + OP op, COMM comm, + REQUEST_OUT request) +{ + int c_ierr; + MPI_Comm c_comm = PMPI_Comm_f2c(*comm); + MPI_Datatype c_type; + MPI_Request c_request; + MPI_Op c_op; + int size; + char *sendbuf = OMPI_CFI_BASE_ADDR(x1), *recvbuf = OMPI_CFI_BASE_ADDR(x2); + + OMPI_CFI_CHECK_CONTIGUOUS(x1, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + + c_type = PMPI_Type_f2c(*datatype); + c_op = PMPI_Op_f2c(*op); + + PMPI_Comm_size(c_comm, &size); + + sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf); + sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); + recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); + + c_ierr = @INNER_CALL@(sendbuf, recvbuf, (@COUNT_TYPE@) *recvcount, + c_type, c_op, c_comm, &c_request); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + if (MPI_SUCCESS == c_ierr) *request = PMPI_Request_c2f(c_request); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/ireduce_scatter_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/ireduce_scatter_f08.F90 deleted file mode 100644 index 8f1c4db8d46..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/ireduce_scatter_f08.F90 +++ /dev/null @@ -1,32 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2022 Cisco Systems, Inc. All rights reserved -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Ireduce_scatter_f08(sendbuf,recvbuf,recvcounts,datatype,op,comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Op, MPI_Comm, MPI_Request - use :: ompi_mpifh_bindings, only : ompi_ireduce_scatter_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) OMPI_ASYNCHRONOUS :: recvcounts(*) - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Op), INTENT(IN) :: op - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_ireduce_scatter_f(sendbuf,recvbuf,recvcounts,datatype%MPI_VAL,& - op%MPI_VAL,comm%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Ireduce_scatter_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/ireduce_scatter_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/ireduce_scatter_ts.c.in new file mode 100644 index 00000000000..e6c319b03e3 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/ireduce_scatter_ts.c.in @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID ireduce_scatter(BUFFER_ASYNC x1, BUFFER_ASYNC_OUT x2, + COUNT_ARRAY recvcounts, DATATYPE datatype, + OP op, COMM comm, REQUEST_OUT request) +{ + int c_ierr, idx = 0; + MPI_Comm c_comm = PMPI_Comm_f2c(*comm); + MPI_Datatype c_type; + MPI_Request c_request; + MPI_Op c_op; + int size; + char *sendbuf = OMPI_CFI_BASE_ADDR(x1), *recvbuf = OMPI_CFI_BASE_ADDR(x2); + @COUNT_TYPE@ *tmp_recvcounts = NULL; + + OMPI_CFI_CHECK_CONTIGUOUS(x1, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + c_type = PMPI_Type_f2c(*datatype); + c_op = PMPI_Op_f2c(*op); + + PMPI_Comm_size(c_comm, &size); + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(recvcounts, tmp_recvcounts, size); + + sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf); + sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); + recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); + + c_ierr = @INNER_CALL@(sendbuf, recvbuf, tmp_recvcounts, + c_type, c_op, c_comm, &c_request); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + if (MPI_SUCCESS == c_ierr) *request = PMPI_Request_c2f(c_request); + + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP_NONBLOCKING(recvcounts, tmp_recvcounts, c_request, c_ierr, idx); + +} diff --git a/ompi/mpi/fortran/use-mpi-f08/ireduce_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/ireduce_ts.c.in new file mode 100644 index 00000000000..48d8e40fd45 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/ireduce_ts.c.in @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID ireduce(BUFFER_ASYNC x1, BUFFER_ASYNC_OUT x2, COUNT count, + DATATYPE datatype, OP op, + RANK root, COMM comm, REQUEST_OUT request) +{ + int c_ierr; + MPI_Datatype c_type; + MPI_Request c_request; + MPI_Op c_op; + MPI_Comm c_comm = PMPI_Comm_f2c(*comm); + char *sendbuf = OMPI_CFI_BASE_ADDR(x1), *recvbuf = OMPI_CFI_BASE_ADDR(x2); + + OMPI_CFI_CHECK_CONTIGUOUS(x1, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + + c_type = PMPI_Type_f2c(*datatype); + c_op = PMPI_Op_f2c(*op); + + sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf); + sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); + recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); + + c_ierr = @INNER_CALL@(sendbuf, recvbuf, + (@COUNT_TYPE@) *count, + c_type, c_op, + OMPI_FINT_2_INT(*root), + c_comm, &c_request); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + if (MPI_SUCCESS == c_ierr) *request = PMPI_Request_c2f(c_request); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/irsend_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/irsend_f08.F90 deleted file mode 100644 index b87f025b284..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/irsend_f08.F90 +++ /dev/null @@ -1,29 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Irsend_f08(buf,count,datatype,dest,tag,comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request - use :: ompi_mpifh_bindings, only : ompi_irsend_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) OMPI_ASYNCHRONOUS :: buf - INTEGER, INTENT(IN) :: count, dest, tag - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_irsend_f(buf,count,datatype%MPI_VAL,dest,tag,comm%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Irsend_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/irsend_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/irsend_ts.c.in new file mode 100644 index 00000000000..f21a428af52 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/irsend_ts.c.in @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID irsend(BUFFER_ASYNC x, COUNT count, DATATYPE datatype, RANK dest, + TAG tag, COMM comm, REQUEST_OUT request) +{ + int c_ierr; + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + MPI_Request c_req; + MPI_Comm c_comm = PMPI_Comm_f2c (*comm); + + void *buf = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count; + + OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + + c_ierr = @INNER_CALL@(OMPI_F2C_BOTTOM(buf), c_count, + c_datatype, OMPI_FINT_2_INT(*dest), + OMPI_FINT_2_INT(*tag), c_comm, + &c_req); + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + *request = PMPI_Request_c2f(c_req); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/iscan_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/iscan_f08.F90 deleted file mode 100644 index 5504b6f16c0..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/iscan_f08.F90 +++ /dev/null @@ -1,32 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2022 Cisco Systems, Inc. All rights reserved -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Iscan_f08(sendbuf,recvbuf,count,datatype,op,comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Op, MPI_Comm, MPI_Request - use :: ompi_mpifh_bindings, only : ompi_iscan_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Op), INTENT(IN) :: op - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_iscan_f(sendbuf,recvbuf,count,datatype%MPI_VAL,& - op%MPI_VAL,comm%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Iscan_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/iscan_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/iscan_ts.c.in new file mode 100644 index 00000000000..158ed781796 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/iscan_ts.c.in @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID iscan(BUFFER_ASYNC x1, BUFFER_ASYNC_OUT x2, COUNT count, + DATATYPE datatype, OP op, COMM comm, + REQUEST_OUT request) +{ + int c_ierr; + MPI_Comm c_comm = PMPI_Comm_f2c(*comm); + MPI_Datatype c_type; + MPI_Request c_request; + MPI_Op c_op; + char *sendbuf = OMPI_CFI_BASE_ADDR(x1), *recvbuf = OMPI_CFI_BASE_ADDR(x2); + + OMPI_CFI_CHECK_CONTIGUOUS(x1, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + + c_type = PMPI_Type_f2c(*datatype); + c_op = PMPI_Op_f2c(*op); + + sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf); + sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); + recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); + + c_ierr = @INNER_CALL@(sendbuf, recvbuf, + (@COUNT_TYPE@) *count, + c_type, c_op, + c_comm, &c_request); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + if (MPI_SUCCESS == c_ierr) *request = PMPI_Request_c2f(c_request); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/iscatter_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/iscatter_f08.F90 deleted file mode 100644 index 3849525959e..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/iscatter_f08.F90 +++ /dev/null @@ -1,33 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2022 Cisco Systems, Inc. All rights reserved -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Iscatter_f08(sendbuf,sendcount,sendtype,recvbuf,& - recvcount,recvtype,root,comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request - use :: ompi_mpifh_bindings, only : ompi_iscatter_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: sendcount, recvcount, root - TYPE(MPI_Datatype), INTENT(IN) :: sendtype - TYPE(MPI_Datatype), INTENT(IN) :: recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_iscatter_f(sendbuf,sendcount,sendtype%MPI_VAL,recvbuf,recvcount,& - recvtype%MPI_VAL,root,comm%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Iscatter_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/iscatter_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/iscatter_ts.c.in new file mode 100644 index 00000000000..58ef0785162 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/iscatter_ts.c.in @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID iscatter(BUFFER_ASYNC x1, COUNT sendcount, + DATATYPE sendtype, BUFFER_ASYNC_OUT x2, + COUNT recvcount, DATATYPE recvtype, + RANK root, COMM comm, REQUEST_OUT request) +{ + int c_ierr; + MPI_Comm c_comm = PMPI_Comm_f2c(*comm); + int c_root = OMPI_FINT_2_INT(*root); + MPI_Datatype c_sendtype = NULL, c_recvtype = NULL, c_recvdatatype = NULL; + @COUNT_TYPE@ c_sendcount = 0, c_recvcount = 0; + char *sendbuf = OMPI_CFI_BASE_ADDR(x1), *recvbuf = OMPI_CFI_BASE_ADDR(x2); + MPI_Request c_request; + + if (OMPI_COMM_IS_INTER(c_comm)) { + if (MPI_ROOT == c_root) { + c_sendtype = PMPI_Type_f2c(*sendtype); + c_sendcount = OMPI_FINT_2_INT(*sendcount); + OMPI_CFI_CHECK_CONTIGUOUS(x1, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + } else if (MPI_PROC_NULL != c_root) { + c_recvtype = PMPI_Type_f2c(*recvtype); + c_recvcount = OMPI_FINT_2_INT(*recvcount); + OMPI_CFI_2_C(x2, c_recvcount, c_recvtype, c_recvdatatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + } + } else { + if (ompi_comm_rank(c_comm) == c_root) { + c_sendtype = PMPI_Type_f2c(*sendtype); + c_sendcount = (@COUNT_TYPE@) *sendcount; + OMPI_CFI_CHECK_CONTIGUOUS(x1, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + } + if (OMPI_IS_FORTRAN_IN_PLACE(recvbuf)) { + recvbuf = MPI_IN_PLACE; + } else { + c_recvtype = PMPI_Type_f2c(*recvtype); + c_recvcount = (@COUNT_TYPE@) *recvcount; + OMPI_CFI_2_C(x2, c_recvcount, c_recvtype, c_recvdatatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + } + } + + recvbuf = (char *) OMPI_F2C_IN_PLACE(recvbuf); + recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); + + + c_ierr = @INNER_CALL@(sendbuf, c_sendcount, c_sendtype, + recvbuf, c_recvcount, c_recvdatatype, + c_root, c_comm, &c_request); + + if (c_recvdatatype != c_recvtype) { + ompi_datatype_destroy(&c_recvdatatype); + } + + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + if (MPI_SUCCESS == c_ierr) *request = PMPI_Request_c2f(c_request); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/iscatterv_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/iscatterv_f08.F90 deleted file mode 100644 index ddc1b429a69..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/iscatterv_f08.F90 +++ /dev/null @@ -1,34 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2022 Cisco Systems, Inc. All rights reserved -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Iscatterv_f08(sendbuf,sendcounts,displs,sendtype,recvbuf,& - recvcount,recvtype,root,comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request - use :: ompi_mpifh_bindings, only : ompi_iscatterv_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: recvcount, root - INTEGER, INTENT(IN) OMPI_ASYNCHRONOUS :: sendcounts(*), displs(*) - TYPE(MPI_Datatype), INTENT(IN) :: sendtype - TYPE(MPI_Datatype), INTENT(IN) :: recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_iscatterv_f(sendbuf,sendcounts,displs,sendtype%MPI_VAL,recvbuf,& - recvcount,recvtype%MPI_VAL,root,comm%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Iscatterv_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/iscatterv_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/iscatterv_ts.c.in new file mode 100644 index 00000000000..d6462d7e83b --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/iscatterv_ts.c.in @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID iscatterv(BUFFER_ASYNC x1, COUNT_ARRAY sendcounts, + DISP_ARRAY displs, DATATYPE sendtype, + BUFFER_ASYNC_OUT x2, COUNT recvcount, + DATATYPE recvtype, RANK root, + COMM comm, REQUEST_OUT request) +{ + int c_ierr; + MPI_Comm c_comm = PMPI_Comm_f2c(*comm); + int c_root = OMPI_FINT_2_INT(*root); + MPI_Datatype __opal_attribute_unused__ c_recvdatatype = MPI_DATATYPE_NULL; + MPI_Datatype c_sendtype = MPI_DATATYPE_NULL, c_recvtype = MPI_DATATYPE_NULL; + @COUNT_TYPE@ c_recvcount = 0; + char *sendbuf = OMPI_CFI_BASE_ADDR(x1), *recvbuf = OMPI_CFI_BASE_ADDR(x2); + MPI_Request c_request; + @COUNT_TYPE@ *tmp_sendcounts = NULL; + @DISP_TYPE@ *tmp_displs = NULL; + + if (OMPI_COMM_IS_INTER(c_comm)) { + if (MPI_ROOT == c_root) { + int size = ompi_comm_size(c_comm); + c_sendtype = PMPI_Type_f2c(*sendtype); + OMPI_CFI_CHECK_CONTIGUOUS(x1, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(sendcounts, tmp_sendcounts, size); + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(displs, tmp_displs, size); + } else if (MPI_PROC_NULL != c_root) { + c_recvtype = PMPI_Type_f2c(*recvtype); + c_recvcount = OMPI_FINT_2_INT(*recvcount); + OMPI_CFI_2_C(x2, c_recvcount, c_recvtype, c_recvdatatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + } + } else { + if (ompi_comm_rank(c_comm) == c_root) { + int size = ompi_comm_size(c_comm); + c_sendtype = PMPI_Type_f2c(*sendtype); + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(sendcounts, tmp_sendcounts, size); + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(displs, tmp_displs, size); + OMPI_CFI_CHECK_CONTIGUOUS(x1, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + } + if (OMPI_IS_FORTRAN_IN_PLACE(recvbuf)) { + recvbuf = MPI_IN_PLACE; + } else { + c_recvtype = PMPI_Type_f2c(*recvtype); + c_recvcount = OMPI_FINT_2_INT(*recvcount); + OMPI_CFI_2_C(x2, c_recvcount, c_recvtype, c_recvdatatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + } + } + + recvbuf = (char *) OMPI_F2C_IN_PLACE(recvbuf); + recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); + + c_ierr = @INNER_CALL@(sendbuf, + tmp_sendcounts, + tmp_displs, + c_sendtype, + recvbuf, + c_recvcount, + (c_recvdatatype == MPI_DATATYPE_NULL) ? c_recvtype : c_recvdatatype, + c_root, c_comm, &c_request); + if (c_recvdatatype != MPI_DATATYPE_NULL && c_recvdatatype != c_recvtype) { + ompi_datatype_destroy(&c_recvdatatype); + } + + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + if (MPI_SUCCESS == c_ierr) *request = PMPI_Request_c2f(c_request); + + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP(sendcounts, tmp_sendcounts); + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP(displs, tmp_displs); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/isend_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/isend_ts.c.in new file mode 100644 index 00000000000..fb9844eb2d4 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/isend_ts.c.in @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID isend(BUFFER x, COUNT count, DATATYPE datatype, RANK dest, + TAG tag, COMM comm, REQUEST_OUT request) +{ + int c_ierr; + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + MPI_Request c_req; + MPI_Comm c_comm = PMPI_Comm_f2c (*comm); + + void *buf = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count; + + OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + + c_ierr = @INNER_CALL@(OMPI_F2C_BOTTOM(buf), c_count, + c_datatype, OMPI_FINT_2_INT(*dest), + OMPI_FINT_2_INT(*tag), + c_comm, &c_req); + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + *request = PMPI_Request_c2f(c_req); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/isendrecv_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/isendrecv_f08.F90 deleted file mode 100644 index 0975c50f4ab..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/isendrecv_f08.F90 +++ /dev/null @@ -1,36 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. -! Copyright (c) 2019 Triad National Security, LLC. All rights -! reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Isendrecv_f08(sendbuf,sendcount,sendtype,dest,sendtag,recvbuf, & - recvcount,recvtype,source,recvtag,comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request - use :: ompi_mpifh_bindings, only : ompi_isendrecv_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE :: recvbuf - INTEGER, INTENT(IN) :: sendcount, dest, sendtag, recvcount, source, recvtag - TYPE(MPI_Datatype), INTENT(IN) :: sendtype - TYPE(MPI_Datatype), INTENT(IN) :: recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_isendrecv_f(sendbuf,sendcount,sendtype%MPI_VAL,dest,sendtag,recvbuf, & - recvcount,recvtype%MPI_VAL,source,recvtag,comm%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Isendrecv_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/isendrecv_replace_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/isendrecv_replace_f08.F90 deleted file mode 100644 index 91a18ca4ac6..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/isendrecv_replace_f08.F90 +++ /dev/null @@ -1,34 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. -! Copyright (c) 2019 Triad National Security, LLC. All rights -! reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Isendrecv_replace_f08(buf,count,datatype,dest,sendtag,source, & - recvtag,comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request - use :: ompi_mpifh_bindings, only : ompi_isendrecv_replace_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE :: buf - INTEGER, INTENT(IN) :: count, dest, sendtag, source, recvtag - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_isendrecv_replace_f(buf,count,datatype%MPI_VAL,dest,sendtag,source, & - recvtag,comm%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Isendrecv_replace_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/isendrecv_replace_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/isendrecv_replace_ts.c.in new file mode 100644 index 00000000000..d11e6127fa0 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/isendrecv_replace_ts.c.in @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID isendrecv_replace(BUFFER_ASYNC_OUT x, COUNT count, DATATYPE datatype, + RANK dest, TAG sendtag, + RANK source, TAG recvtag, + COMM comm, REQUEST_OUT request) +{ + int c_ierr; + MPI_Request c_req; + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + MPI_Comm c_comm = PMPI_Comm_f2c (*comm); + + void *buf = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ __opal_attribute_unused__ c_count = (@COUNT_TYPE@) *count; + + OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + + c_ierr = @INNER_CALL@(OMPI_F2C_BOTTOM(buf), + OMPI_FINT_2_INT(*count), + c_datatype, + OMPI_FINT_2_INT(*dest), + OMPI_FINT_2_INT(*sendtag), + OMPI_FINT_2_INT(*source), + OMPI_FINT_2_INT(*recvtag), + c_comm, &c_req); + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + *request = PMPI_Request_c2f(c_req); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/isendrecv_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/isendrecv_ts.c.in new file mode 100644 index 00000000000..cbf9b4aca9c --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/isendrecv_ts.c.in @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID isendrecv(BUFFER_ASYNC x1, COUNT sendcount, DATATYPE sendtype, + RANK dest, TAG sendtag, BUFFER_ASYNC_OUT x2, + COUNT recvcount, DATATYPE recvtype, + RANK source, TAG recvtag, COMM comm, + REQUEST_OUT request) +{ + int c_ierr; + MPI_Comm c_comm = PMPI_Comm_f2c (*comm); + MPI_Request c_req; + MPI_Datatype c_senddatatype, c_sendtype = PMPI_Type_f2c(*sendtype); + MPI_Datatype c_recvdatatype, c_recvtype = PMPI_Type_f2c(*recvtype); + void *sendbuf = OMPI_CFI_BASE_ADDR(x1); + @COUNT_TYPE@ c_sendcount = (@COUNT_TYPE@) *sendcount; + void *recvbuf = OMPI_CFI_BASE_ADDR(x2); + @COUNT_TYPE@ c_recvcount = (@COUNT_TYPE@) *recvcount; + + OMPI_CFI_2_C(x1, c_sendcount, c_sendtype, c_senddatatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + OMPI_CFI_2_C(x2, c_recvcount, c_recvtype, c_recvdatatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + if (c_senddatatype != c_sendtype) { + ompi_datatype_destroy(&c_senddatatype); + } + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + + c_ierr = @INNER_CALL@(OMPI_F2C_BOTTOM(sendbuf), c_sendcount, + c_senddatatype, + OMPI_FINT_2_INT(*dest), + OMPI_FINT_2_INT(*sendtag), + OMPI_F2C_BOTTOM(recvbuf), c_recvcount, + c_recvdatatype, OMPI_FINT_2_INT(*source), + OMPI_FINT_2_INT(*recvtag), + c_comm, &c_req); + if (c_senddatatype != c_sendtype) { + ompi_datatype_destroy(&c_senddatatype); + } + if (c_recvdatatype != c_recvtype) { + ompi_datatype_destroy(&c_recvdatatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + *request = PMPI_Request_c2f(c_req); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/issend_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/issend_f08.F90 deleted file mode 100644 index d9ba894d04d..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/issend_f08.F90 +++ /dev/null @@ -1,29 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Issend_f08(buf,count,datatype,dest,tag,comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request - use :: ompi_mpifh_bindings, only : ompi_issend_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) OMPI_ASYNCHRONOUS :: buf - INTEGER, INTENT(IN) :: count, dest, tag - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_issend_f(buf,count,datatype%MPI_VAL,dest,tag,comm%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Issend_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/issend_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/issend_ts.c.in new file mode 100644 index 00000000000..56ea0d70652 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/issend_ts.c.in @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID issend(BUFFER_ASYNC x, COUNT count, DATATYPE datatype, RANK dest, + TAG tag, COMM comm, REQUEST_OUT request) +{ + int c_ierr; + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + MPI_Request c_req; + MPI_Comm c_comm = PMPI_Comm_f2c (*comm); + + void *buf = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count; + + OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + + c_ierr = @INNER_CALL@(OMPI_F2C_BOTTOM(buf), c_count, + c_datatype, OMPI_FINT_2_INT(*dest), + OMPI_FINT_2_INT(*tag), + c_comm, &c_req); + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + *request = PMPI_Request_c2f(c_req); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/mod/Makefile.am b/ompi/mpi/fortran/use-mpi-f08/mod/Makefile.am index f6907627cc7..9a72cf2ee88 100644 --- a/ompi/mpi/fortran/use-mpi-f08/mod/Makefile.am +++ b/ompi/mpi/fortran/use-mpi-f08/mod/Makefile.am @@ -10,6 +10,8 @@ # Copyright (c) 2015-2020 Research Organization for Information Science # and Technology (RIST). All rights reserved. # Copyright (c) 2016 IBM Corporation. All rights reserved. +# Copyright (C) 2024 Triad National Security, LLC. All rights +# reserved. # # $COPYRIGHT$ # @@ -64,7 +66,9 @@ libforce_usempif08_internal_modules_to_be_built_la_SOURCES = \ nodist_noinst_HEADERS = mpi-f08-interfaces.h -noinst_HEADERS = mpi-f08-rename.h +noinst_HEADERS = \ + mpi-f08-rename.h \ + mpi-f08-interfaces-generated.h libforce_usempi_internal_modules_to_be_built.la: libusempif08_internal_modules.la @@ -72,6 +76,25 @@ config_h = \ $(top_builddir)/ompi/mpi/fortran/configure-fortran-output.h \ $(top_srcdir)/ompi/mpi/fortran/configure-fortran-output-bottom.h +# Generate the Fortran interfaces +if OMPI_GENERATE_BINDINGS + +include ../Makefile.prototype_files +template_files =${prototype_files:%=$(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/%} + +mpi-f08-interfaces-generated.h: $(template_files) + $(OMPI_V_GEN) $(PYTHON) $(top_srcdir)/ompi/mpi/bindings/bindings.py \ + --builddir $(abs_top_builddir) \ + --srcdir $(abs_top_srcdir) \ + --output $(abs_builddir)/$@ \ + fortran \ + interface \ + --prototype-files $(template_files) + +endif +# Delete generated file on maintainer-clean +MAINTAINERCLEANFILES = mpi-f08-interfaces-generated.h + # # Automake doesn't do Fortran dependency analysis, so must list them # manually here. Bummer! @@ -83,6 +106,7 @@ mpi-f08-interfaces.lo: $(config_h) mpi-f08-interfaces.lo: mpi-f08-interfaces.F90 mpi-f08-interfaces.lo: mpi-f08-interfaces-callbacks.lo mpi-f08-interfaces.lo: mpi-f08-interfaces.h +mpi-f08-interfaces.lo: mpi-f08-interfaces-generated.h mpi-f08-interfaces-callbacks.lo: $(config_h) mpi-f08-interfaces-callbacks.lo: mpi-f08-interfaces-callbacks.F90 mpi-f08-interfaces-callbacks.lo: mpi-f08-types.lo @@ -94,6 +118,7 @@ pmpi-f08-interfaces.lo: pmpi-f08-interfaces.F90 pmpi-f08-interfaces.lo: mpi-f08-interfaces-callbacks.lo pmpi-f08-interfaces.lo: mpi-f08-interfaces.h pmpi-f08-interfaces.lo: mpi-f08-rename.h +pmpi-f08-interfaces.lo: mpi-f08-interfaces-generated.h ########################################################################### diff --git a/ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-interfaces.F90 b/ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-interfaces.F90 index 71cefb1f128..ad4a92223b0 100644 --- a/ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-interfaces.F90 +++ b/ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-interfaces.F90 @@ -24,6 +24,7 @@ module mpi_f08_interfaces #include "mpi-f08-interfaces.h" +#include "mpi-f08-interfaces-generated.h" ! MPI_Wtick is not a wrapper function ! diff --git a/ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-interfaces.h.in b/ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-interfaces.h.in index c66f92d1332..9b462537a25 100644 --- a/ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-interfaces.h.in +++ b/ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-interfaces.h.in @@ -19,53 +19,6 @@ ! and the name for tools ("MPI_Init_f08") and the back-end implementation ! name (e.g., "MPI_Init_f08"). -interface MPI_Bsend -subroutine MPI_Bsend_f08(buf,count,datatype,dest,tag,comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: buf - INTEGER, INTENT(IN) :: count, dest, tag - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Bsend_f08 -end interface MPI_Bsend - -interface MPI_Bsend_init -subroutine MPI_Bsend_init_f08(buf,count,datatype,dest,tag,comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: buf - INTEGER, INTENT(IN) :: count, dest, tag - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Bsend_init_f08 -end interface MPI_Bsend_init - -interface MPI_Buffer_attach -subroutine MPI_Buffer_attach_f08(buffer,size,ierror) - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buffer - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: buffer - INTEGER, INTENT(IN) :: size - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Buffer_attach_f08 -end interface MPI_Buffer_attach - -interface MPI_Buffer_detach -subroutine MPI_Buffer_detach_f08(buffer_addr,size,ierror) - USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR - implicit none - TYPE(C_PTR), INTENT(OUT) :: buffer_addr - INTEGER, INTENT(OUT) :: size - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Buffer_detach_f08 -end interface MPI_Buffer_detach - interface MPI_Cancel subroutine MPI_Cancel_f08(request,ierror) use :: mpi_f08_types, only : MPI_Request @@ -75,31 +28,6 @@ subroutine MPI_Cancel_f08(request,ierror) end subroutine MPI_Cancel_f08 end interface MPI_Cancel -interface MPI_Get_count -subroutine MPI_Get_count_f08(status,datatype,count,ierror) - use :: mpi_f08_types, only : MPI_Status, MPI_Datatype - implicit none - TYPE(MPI_Status), INTENT(IN) :: status - TYPE(MPI_Datatype), INTENT(IN) :: datatype - INTEGER, INTENT(OUT) :: count - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Get_count_f08 -end interface MPI_Get_count - -interface MPI_Ibsend -subroutine MPI_Ibsend_f08(buf,count,datatype,dest,tag,comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: buf - INTEGER, INTENT(IN) :: count, dest, tag - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Ibsend_f08 -end interface MPI_Ibsend - interface MPI_Iprobe subroutine MPI_Iprobe_f08(source,tag,comm,flag,status,ierror) use :: mpi_f08_types, only : MPI_Comm, MPI_Status @@ -112,131 +40,6 @@ subroutine MPI_Iprobe_f08(source,tag,comm,flag,status,ierror) end subroutine MPI_Iprobe_f08 end interface MPI_Iprobe -interface MPI_Irecv -subroutine MPI_Irecv_f08(buf,count,datatype,source,tag,comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: buf - INTEGER, INTENT(IN) :: count, source, tag - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Irecv_f08 -end interface MPI_Irecv - -interface MPI_Irsend -subroutine MPI_Irsend_f08(buf,count,datatype,dest,tag,comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: buf - INTEGER, INTENT(IN) :: count, dest, tag - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Irsend_f08 -end interface MPI_Irsend - -interface MPI_Isend -subroutine MPI_Isend_f08(buf,count,datatype,dest,tag,comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: buf - INTEGER, INTENT(IN) :: count, dest, tag - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Isend_f08 -end interface MPI_Isend - -interface MPI_Isendrecv -subroutine MPI_Isendrecv_f08(sendbuf,sendcount,sendtype,dest,sendtag,recvbuf, & - recvcount,recvtype,source,recvtag,comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: recvbuf - INTEGER, INTENT(IN) :: sendcount, dest, sendtag, recvcount, source, recvtag - TYPE(MPI_Datatype), INTENT(IN) :: sendtype, recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Isendrecv_f08 -end interface MPI_Isendrecv - -interface MPI_Isendrecv_replace -subroutine MPI_Isendrecv_replace_f08(buf,count,datatype,dest,sendtag,source,recvtag, & - comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: buf - INTEGER, INTENT(IN) :: count, dest, sendtag, source, recvtag - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Isendrecv_replace_f08 -end interface MPI_Isendrecv_replace - -interface MPI_Issend -subroutine MPI_Issend_f08(buf,count,datatype,dest,tag,comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: buf - INTEGER, INTENT(IN) :: count, dest, tag - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Issend_f08 -end interface MPI_Issend - -interface MPI_Precv_init -subroutine MPI_Precv_init_f08(buf,partitions,count,datatype,dest,tag,comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request, MPI_COUNT_KIND - implicit none - !DEC$ ATTRIBUTES NO_ARG_CHECK :: buf - !GCC$ ATTRIBUTES NO_ARG_CHECK :: buf - !$PRAGMA IGNORE_TKR buf - !DIR$ IGNORE_TKR buf - !IBM* IGNORE_TKR buf - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: buf - INTEGER, INTENT(IN) :: partitions, dest, tag - INTEGER(MPI_COUNT_KIND), INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Precv_init_f08 -end interface MPI_Precv_init - -interface MPI_Psend_init -subroutine MPI_Psend_init_f08(buf,partitions,count,datatype,dest,tag,comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request, MPI_COUNT_KIND - implicit none - !DEC$ ATTRIBUTES NO_ARG_CHECK :: buf - !GCC$ ATTRIBUTES NO_ARG_CHECK :: buf - !$PRAGMA IGNORE_TKR buf - !DIR$ IGNORE_TKR buf - !IBM* IGNORE_TKR buf - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: buf - INTEGER, INTENT(IN) :: partitions, dest, tag - INTEGER(MPI_COUNT_KIND), INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Psend_init_f08 -end interface MPI_Psend_init - interface MPI_Pready subroutine MPI_Pready_f08(partition,request,ierror) use :: mpi_f08_types, only : MPI_Request @@ -290,34 +93,6 @@ subroutine MPI_Probe_f08(source,tag,comm,status,ierror) end subroutine MPI_Probe_f08 end interface MPI_Probe -interface MPI_Recv -subroutine MPI_Recv_f08(buf,count,datatype,source,tag,comm,status,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Status - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: buf - INTEGER, INTENT(IN) :: count, source, tag - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Status) :: status - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Recv_f08 -end interface MPI_Recv - -interface MPI_Recv_init -subroutine MPI_Recv_init_f08(buf,count,datatype,source,tag,comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: buf - INTEGER, INTENT(IN) :: count, source, tag - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Recv_init_f08 -end interface MPI_Recv_init - interface MPI_Request_free subroutine MPI_Request_free_f08(request,ierror) use :: mpi_f08_types, only : MPI_Request @@ -338,91 +113,6 @@ subroutine MPI_Request_get_status_f08(request,flag,status,ierror) end subroutine MPI_Request_get_status_f08 end interface MPI_Request_get_status -interface MPI_Rsend -subroutine MPI_Rsend_f08(buf,count,datatype,dest,tag,comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: buf - INTEGER, INTENT(IN) :: count, dest, tag - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Rsend_f08 -end interface MPI_Rsend - -interface MPI_Rsend_init -subroutine MPI_Rsend_init_f08(buf,count,datatype,dest,tag,comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: buf - INTEGER, INTENT(IN) :: count, dest, tag - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Rsend_init_f08 -end interface MPI_Rsend_init - -interface MPI_Send -subroutine MPI_Send_f08(buf,count,datatype,dest,tag,comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: buf - INTEGER, INTENT(IN) :: count, dest, tag - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Send_f08 -end interface MPI_Send - -interface MPI_Sendrecv -subroutine MPI_Sendrecv_f08(sendbuf,sendcount,sendtype,dest,sendtag,recvbuf, & - recvcount,recvtype,source,recvtag,comm,status,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Status - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: recvbuf - INTEGER, INTENT(IN) :: sendcount, dest, sendtag, recvcount, source, recvtag - TYPE(MPI_Datatype), INTENT(IN) :: sendtype, recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Status) :: status - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Sendrecv_f08 -end interface MPI_Sendrecv - -interface MPI_Sendrecv_replace -subroutine MPI_Sendrecv_replace_f08(buf,count,datatype,dest,sendtag,source,recvtag, & - comm,status,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Status - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: buf - INTEGER, INTENT(IN) :: count, dest, sendtag, source, recvtag - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Status) :: status - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Sendrecv_replace_f08 -end interface MPI_Sendrecv_replace - -interface MPI_Send_init -subroutine MPI_Send_init_f08(buf,count,datatype,dest,tag,comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: buf - INTEGER, INTENT(IN) :: count, dest, tag - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Send_init_f08 -end interface MPI_Send_init - interface MPI_Session_call_errhandler subroutine MPI_Session_call_errhandler_f08(session,errorcode,ierror) use :: mpi_f08_types, only : MPI_Session @@ -529,33 +219,6 @@ subroutine MPI_Session_set_errhandler_f08(session,errhandler,ierror) end subroutine MPI_Session_set_errhandler_f08 end interface MPI_Session_set_errhandler -interface MPI_Ssend -subroutine MPI_Ssend_f08(buf,count,datatype,dest,tag,comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: buf - INTEGER, INTENT(IN) :: count, dest, tag - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Ssend_f08 -end interface MPI_Ssend - -interface MPI_Ssend_init -subroutine MPI_Ssend_init_f08(buf,count,datatype,dest,tag,comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: buf - INTEGER, INTENT(IN) :: count, dest, tag - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Ssend_init_f08 -end interface MPI_Ssend_init - interface MPI_Start subroutine MPI_Start_f08(request,ierror) use :: mpi_f08_types, only : MPI_Request @@ -598,19 +261,6 @@ subroutine MPI_Testall_f08(count,array_of_requests,flag,array_of_statuses,ierror end subroutine MPI_Testall_f08 end interface MPI_Testall -interface MPI_Testany -subroutine MPI_Testany_f08(count,array_of_requests,index,flag,status,ierror) - use :: mpi_f08_types, only : MPI_Request, MPI_Status - implicit none - INTEGER, INTENT(IN) :: count - TYPE(MPI_Request), INTENT(INOUT) :: array_of_requests(count) - INTEGER, INTENT(OUT) :: index - LOGICAL, INTENT(OUT) :: flag - TYPE(MPI_Status) :: status - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Testany_f08 -end interface MPI_Testany - interface MPI_Testsome subroutine MPI_Testsome_f08(incount,array_of_requests,outcount, & array_of_indices,array_of_statuses,ierror) @@ -644,17 +294,6 @@ subroutine MPI_Wait_f08(request,status,ierror) end subroutine MPI_Wait_f08 end interface MPI_Wait -interface MPI_Waitall -subroutine MPI_Waitall_f08(count,array_of_requests,array_of_statuses,ierror) - use :: mpi_f08_types, only : MPI_Request, MPI_Status - implicit none - INTEGER, INTENT(IN) :: count - TYPE(MPI_Request), INTENT(INOUT) :: array_of_requests(count) - TYPE(MPI_Status) :: array_of_statuses(*) - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Waitall_f08 -end interface MPI_Waitall - interface MPI_Waitany subroutine MPI_Waitany_f08(count,array_of_requests,index,status,ierror) use :: mpi_f08_types, only : MPI_Request, MPI_Status @@ -680,28 +319,6 @@ subroutine MPI_Waitsome_f08(incount,array_of_requests,outcount, & end subroutine MPI_Waitsome_f08 end interface MPI_Waitsome -interface MPI_Get_address -subroutine MPI_Get_address_f08(location,address,ierror) - use :: mpi_f08_types, only : MPI_ADDRESS_KIND - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ location - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: location - INTEGER(MPI_ADDRESS_KIND), INTENT(OUT) :: address - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Get_address_f08 -end interface MPI_Get_address - -interface MPI_Get_elements -subroutine MPI_Get_elements_f08(status,datatype,count,ierror) - use :: mpi_f08_types, only : MPI_Status, MPI_Datatype - implicit none - TYPE(MPI_Status), INTENT(IN) :: status - TYPE(MPI_Datatype), INTENT(IN) :: datatype - INTEGER, INTENT(OUT) :: count - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Get_elements_f08 -end interface MPI_Get_elements - interface MPI_Get_elements_x subroutine MPI_Get_elements_x_f08(status,datatype,count,ierror) use :: mpi_f08_types, only : MPI_Status, MPI_Datatype, MPI_COUNT_KIND @@ -713,63 +330,6 @@ subroutine MPI_Get_elements_x_f08(status,datatype,count,ierror) end subroutine MPI_Get_elements_x_f08 end interface MPI_Get_elements_x -interface MPI_Pack -subroutine MPI_Pack_f08(inbuf,incount,datatype,outbuf,outsize,position,comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ inbuf, outbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: inbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: outbuf - INTEGER, INTENT(IN) :: incount, outsize - TYPE(MPI_Datatype), INTENT(IN) :: datatype - INTEGER, INTENT(INOUT) :: position - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Pack_f08 -end interface MPI_Pack - -interface MPI_Pack_external -subroutine MPI_Pack_external_f08(datarep,inbuf,incount,datatype,outbuf,outsize, & - position,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_ADDRESS_KIND - implicit none - CHARACTER(LEN=*), INTENT(IN) :: datarep - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ inbuf, outbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: inbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: outbuf - INTEGER, INTENT(IN) :: incount - TYPE(MPI_Datatype), INTENT(IN) :: datatype - INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: outsize - INTEGER(MPI_ADDRESS_KIND), INTENT(INOUT) :: position - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Pack_external_f08 -end interface MPI_Pack_external - -interface MPI_Pack_external_size -subroutine MPI_Pack_external_size_f08(datarep,incount,datatype,size,ierror & - ) - use :: mpi_f08_types, only : MPI_Datatype, MPI_ADDRESS_KIND - implicit none - TYPE(MPI_Datatype), INTENT(IN) :: datatype - INTEGER, INTENT(IN) :: incount - CHARACTER(LEN=*), INTENT(IN) :: datarep - INTEGER(MPI_ADDRESS_KIND), INTENT(OUT) :: size - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Pack_external_size_f08 -end interface MPI_Pack_external_size - -interface MPI_Pack_size -subroutine MPI_Pack_size_f08(incount,datatype,comm,size,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm - implicit none - INTEGER, INTENT(IN) :: incount - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, INTENT(OUT) :: size - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Pack_size_f08 -end interface MPI_Pack_size - interface MPI_Type_commit subroutine MPI_Type_commit_f08(datatype,ierror) use :: mpi_f08_types, only : MPI_Datatype @@ -779,84 +339,6 @@ subroutine MPI_Type_commit_f08(datatype,ierror) end subroutine MPI_Type_commit_f08 end interface MPI_Type_commit -interface MPI_Type_contiguous -subroutine MPI_Type_contiguous_f08(count,oldtype,newtype,ierror) - use :: mpi_f08_types, only : MPI_Datatype - implicit none - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: oldtype - TYPE(MPI_Datatype), INTENT(OUT) :: newtype - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Type_contiguous_f08 -end interface MPI_Type_contiguous - -interface MPI_Type_create_darray -subroutine MPI_Type_create_darray_f08(size,rank,ndims,array_of_gsizes, & - array_of_distribs,array_of_dargs,array_of_psizes,order, & - oldtype,newtype,ierror) - use :: mpi_f08_types, only : MPI_Datatype - implicit none - INTEGER, INTENT(IN) :: size, rank, ndims, order - INTEGER, INTENT(IN) :: array_of_gsizes(ndims), array_of_distribs(ndims) - INTEGER, INTENT(IN) :: array_of_dargs(ndims), array_of_psizes(ndims) - TYPE(MPI_Datatype), INTENT(IN) :: oldtype - TYPE(MPI_Datatype), INTENT(OUT) :: newtype - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Type_create_darray_f08 -end interface MPI_Type_create_darray - -interface MPI_Type_create_hindexed -subroutine MPI_Type_create_hindexed_f08(count,array_of_blocklengths, & - array_of_displacements,oldtype,newtype,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_ADDRESS_KIND - implicit none - INTEGER, INTENT(IN) :: count - INTEGER, INTENT(IN) :: array_of_blocklengths(count) - INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: array_of_displacements(count) - TYPE(MPI_Datatype), INTENT(IN) :: oldtype - TYPE(MPI_Datatype), INTENT(OUT) :: newtype - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Type_create_hindexed_f08 -end interface MPI_Type_create_hindexed - -interface MPI_Type_create_hvector -subroutine MPI_Type_create_hvector_f08(count,blocklength,stride,oldtype,newtype,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_ADDRESS_KIND - implicit none - INTEGER, INTENT(IN) :: count, blocklength - INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: stride - TYPE(MPI_Datatype), INTENT(IN) :: oldtype - TYPE(MPI_Datatype), INTENT(OUT) :: newtype - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Type_create_hvector_f08 -end interface MPI_Type_create_hvector - -interface MPI_Type_create_indexed_block -subroutine MPI_Type_create_indexed_block_f08(count,blocklength, & - array_of_displacements,oldtype,newtype,ierror) - use :: mpi_f08_types, only : MPI_Datatype - implicit none - INTEGER, INTENT(IN) :: count, blocklength - INTEGER, INTENT(IN) :: array_of_displacements(count) - TYPE(MPI_Datatype), INTENT(IN) :: oldtype - TYPE(MPI_Datatype), INTENT(OUT) :: newtype - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Type_create_indexed_block_f08 -end interface MPI_Type_create_indexed_block - -interface MPI_Type_create_hindexed_block -subroutine MPI_Type_create_hindexed_block_f08(count,blocklength, & - array_of_displacements,oldtype,newtype,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_ADDRESS_KIND - implicit none - INTEGER, INTENT(IN) :: count, blocklength - INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: array_of_displacements(count) - TYPE(MPI_Datatype), INTENT(IN) :: oldtype - TYPE(MPI_Datatype), INTENT(OUT) :: newtype - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Type_create_hindexed_block_f08 -end interface MPI_Type_create_hindexed_block - interface MPI_Type_create_resized subroutine MPI_Type_create_resized_f08(oldtype,lb,extent,newtype,ierror) use :: mpi_f08_types, only : MPI_Datatype, MPI_ADDRESS_KIND @@ -868,34 +350,6 @@ subroutine MPI_Type_create_resized_f08(oldtype,lb,extent,newtype,ierror) end subroutine MPI_Type_create_resized_f08 end interface MPI_Type_create_resized -interface MPI_Type_create_struct -subroutine MPI_Type_create_struct_f08(count,array_of_blocklengths, & - array_of_displacements,array_of_types,newtype,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_ADDRESS_KIND - implicit none - INTEGER, INTENT(IN) :: count - INTEGER, INTENT(IN) :: array_of_blocklengths(count) - INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: array_of_displacements(count) - TYPE(MPI_Datatype), INTENT(IN) :: array_of_types(count) - TYPE(MPI_Datatype), INTENT(OUT) :: newtype - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Type_create_struct_f08 -end interface MPI_Type_create_struct - -interface MPI_Type_create_subarray -subroutine MPI_Type_create_subarray_f08(ndims,array_of_sizes,array_of_subsizes, & - array_of_starts,order,oldtype,newtype,ierror) - use :: mpi_f08_types, only : MPI_Datatype - implicit none - INTEGER, INTENT(IN) :: ndims, order - INTEGER, INTENT(IN) :: array_of_sizes(ndims), array_of_subsizes(ndims) - INTEGER, INTENT(IN) :: array_of_starts(ndims) - TYPE(MPI_Datatype), INTENT(IN) :: oldtype - TYPE(MPI_Datatype), INTENT(OUT) :: newtype - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Type_create_subarray_f08 -end interface MPI_Type_create_subarray - interface MPI_Type_dup subroutine MPI_Type_dup_f08(oldtype,newtype,ierror) use :: mpi_f08_types, only : MPI_Datatype @@ -928,6 +382,20 @@ subroutine MPI_Type_get_contents_f08(datatype,max_integers,max_addresses,max_dat TYPE(MPI_Datatype), INTENT(OUT) :: array_of_datatypes(max_datatypes) INTEGER, OPTIONAL, INTENT(OUT) :: ierror end subroutine MPI_Type_get_contents_f08 +subroutine MPI_Type_get_contents_f08_c(datatype, max_integers, max_addresses, max_large_counts, & + max_datatypes, array_of_integers, array_of_addresses, & + array_of_large_counts, array_of_datatypes, ierror) + use :: mpi_f08_types, only : MPI_Datatype, MPI_ADDRESS_KIND, MPI_COUNT_KIND + implicit none + TYPE(MPI_Datatype), INTENT(IN) :: datatype + INTEGER(KIND=MPI_COUNT_KIND), INTENT(IN) :: max_integers, max_addresses, & + max_large_counts, max_datatypes + INTEGER, INTENT(OUT) :: array_of_integers(max_integers) + INTEGER(MPI_ADDRESS_KIND), INTENT(OUT) :: array_of_addresses(max_addresses) + INTEGER(KIND=MPI_COUNT_KIND), INTENT(OUT) :: array_of_large_counts(max_large_counts) + TYPE(MPI_Datatype), INTENT(OUT) :: array_of_datatypes(max_datatypes) + INTEGER, OPTIONAL, INTENT(OUT) :: ierror +end subroutine MPI_Type_get_contents_f08_c end interface MPI_Type_get_contents interface MPI_Type_get_envelope @@ -939,6 +407,15 @@ subroutine MPI_Type_get_envelope_f08(datatype,num_integers,num_addresses,num_dat INTEGER, INTENT(OUT) :: num_integers, num_addresses, num_datatypes, combiner INTEGER, OPTIONAL, INTENT(OUT) :: ierror end subroutine MPI_Type_get_envelope_f08 +subroutine MPI_Type_get_envelope_f08_c(datatype,num_integers,num_addresses,num_large_counts,num_datatypes, & + combiner,ierror) + use :: mpi_f08_types, only : MPI_Datatype, MPI_COUNT_KIND + implicit none + TYPE(MPI_Datatype), INTENT(IN) :: datatype + INTEGER(MPI_COUNT_KIND), INTENT(OUT) :: num_integers, num_addresses, num_large_counts, num_datatypes + INTEGER, INTENT(OUT) :: combiner + INTEGER, OPTIONAL, INTENT(OUT) :: ierror +end subroutine MPI_Type_get_envelope_f08_c end interface MPI_Type_get_envelope interface MPI_Type_get_extent @@ -961,16 +438,6 @@ subroutine MPI_Type_get_extent_x_f08(datatype,lb,extent,ierror) end subroutine MPI_Type_get_extent_x_f08 end interface MPI_Type_get_extent_x -interface MPI_Type_get_true_extent -subroutine MPI_Type_get_true_extent_f08(datatype,true_lb,true_extent,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_ADDRESS_KIND - implicit none - TYPE(MPI_Datatype), INTENT(IN) :: datatype - INTEGER(MPI_ADDRESS_KIND), INTENT(OUT) :: true_lb, true_extent - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Type_get_true_extent_f08 -end interface MPI_Type_get_true_extent - interface MPI_Type_get_true_extent_x subroutine MPI_Type_get_true_extent_x_f08(datatype,true_lb,true_extent,ierror) use :: mpi_f08_types, only : MPI_Datatype, MPI_ADDRESS_KIND, MPI_COUNT_KIND @@ -981,32 +448,9 @@ subroutine MPI_Type_get_true_extent_x_f08(datatype,true_lb,true_extent,ierror) end subroutine MPI_Type_get_true_extent_x_f08 end interface MPI_Type_get_true_extent_x -interface MPI_Type_indexed -subroutine MPI_Type_indexed_f08(count,array_of_blocklengths, & - array_of_displacements,oldtype,newtype,ierror) - use :: mpi_f08_types, only : MPI_Datatype - implicit none - INTEGER, INTENT(IN) :: count - INTEGER, INTENT(IN) :: array_of_blocklengths(count), array_of_displacements(count) - TYPE(MPI_Datatype), INTENT(IN) :: oldtype - TYPE(MPI_Datatype), INTENT(OUT) :: newtype - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Type_indexed_f08 -end interface MPI_Type_indexed - -interface MPI_Type_size -subroutine MPI_Type_size_f08(datatype,size,ierror) - use :: mpi_f08_types, only : MPI_Datatype - implicit none - TYPE(MPI_Datatype), INTENT(IN) :: datatype - INTEGER, INTENT(OUT) :: size - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Type_size_f08 -end interface MPI_Type_size - -interface MPI_Type_size_x -subroutine MPI_Type_size_x_f08(datatype,size,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_COUNT_KIND +interface MPI_Type_size_x +subroutine MPI_Type_size_x_f08(datatype,size,ierror) + use :: mpi_f08_types, only : MPI_Datatype, MPI_COUNT_KIND implicit none TYPE(MPI_Datatype), INTENT(IN) :: datatype INTEGER(MPI_COUNT_KIND), INTENT(OUT) :: size @@ -1014,342 +458,6 @@ subroutine MPI_Type_size_x_f08(datatype,size,ierror) end subroutine MPI_Type_size_x_f08 end interface MPI_Type_size_x -interface MPI_Type_vector -subroutine MPI_Type_vector_f08(count,blocklength,stride,oldtype,newtype,ierror) - use :: mpi_f08_types, only : MPI_Datatype - implicit none - INTEGER, INTENT(IN) :: count, blocklength, stride - TYPE(MPI_Datatype), INTENT(IN) :: oldtype - TYPE(MPI_Datatype), INTENT(OUT) :: newtype - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Type_vector_f08 -end interface MPI_Type_vector - -interface MPI_Unpack -subroutine MPI_Unpack_f08(inbuf,insize,position,outbuf,outcount,datatype,comm, & - ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ inbuf, outbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: inbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: outbuf - INTEGER, INTENT(IN) :: insize, outcount - INTEGER, INTENT(INOUT) :: position - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Unpack_f08 -end interface MPI_Unpack - -interface MPI_Unpack_external -subroutine MPI_Unpack_external_f08(datarep,inbuf,insize,position,outbuf,outcount, & - datatype,ierror & - ) - use :: mpi_f08_types, only : MPI_Datatype, MPI_ADDRESS_KIND - implicit none - CHARACTER(LEN=*), INTENT(IN) :: datarep - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ inbuf, outbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: inbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: outbuf - INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: insize - INTEGER(MPI_ADDRESS_KIND), INTENT(INOUT) :: position - INTEGER, INTENT(IN) :: outcount - TYPE(MPI_Datatype), INTENT(IN) :: datatype - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Unpack_external_f08 -end interface MPI_Unpack_external - -interface MPI_Allgather -subroutine MPI_Allgather_f08(sendbuf,sendcount,sendtype,recvbuf,recvcount,recvtype, & - comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: recvbuf - INTEGER, INTENT(IN) :: sendcount, recvcount - TYPE(MPI_Datatype), INTENT(IN) :: sendtype, recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Allgather_f08 -end interface MPI_Allgather - -interface MPI_Iallgather -subroutine MPI_Iallgather_f08(sendbuf,sendcount,sendtype,recvbuf,recvcount,recvtype, & - comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: sendcount, recvcount - TYPE(MPI_Datatype), INTENT(IN) :: sendtype, recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Iallgather_f08 -end interface MPI_Iallgather - -interface MPI_Allgather_init -subroutine MPI_Allgather_init_f08(sendbuf,sendcount,sendtype,recvbuf,recvcount,recvtype, & - comm,info,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Info, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: sendcount, recvcount - TYPE(MPI_Datatype), INTENT(IN) :: sendtype, recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Allgather_init_f08 -end interface MPI_Allgather_init - -interface MPI_Allgatherv -subroutine MPI_Allgatherv_f08(sendbuf,sendcount,sendtype,recvbuf,recvcounts,displs, & - recvtype,comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: recvbuf - INTEGER, INTENT(IN) :: sendcount - INTEGER, INTENT(IN) :: recvcounts(*), displs(*) - TYPE(MPI_Datatype), INTENT(IN) :: sendtype, recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Allgatherv_f08 -end interface MPI_Allgatherv - -interface MPI_Iallgatherv -subroutine MPI_Iallgatherv_f08(sendbuf,sendcount,sendtype,recvbuf,recvcounts,displs, & - recvtype,comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: sendcount - INTEGER, INTENT(IN) OMPI_ASYNCHRONOUS :: recvcounts(*), displs(*) - TYPE(MPI_Datatype), INTENT(IN) :: sendtype, recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Iallgatherv_f08 -end interface MPI_Iallgatherv - -interface MPI_Allgatherv_init -subroutine MPI_Allgatherv_init_f08(sendbuf,sendcount,sendtype,recvbuf,recvcounts,displs, & - recvtype,comm,info,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Info, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: sendcount - INTEGER, INTENT(IN) OMPI_ASYNCHRONOUS :: recvcounts(*), displs(*) - TYPE(MPI_Datatype), INTENT(IN) :: sendtype, recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Allgatherv_init_f08 -end interface MPI_Allgatherv_init - -interface MPI_Allreduce -subroutine MPI_Allreduce_f08(sendbuf,recvbuf,count,datatype,op,comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Op, MPI_Comm - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: recvbuf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Op), INTENT(IN) :: op - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Allreduce_f08 -end interface MPI_Allreduce - -interface MPI_Iallreduce -subroutine MPI_Iallreduce_f08(sendbuf,recvbuf,count,datatype,op,comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Op, MPI_Comm, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Op), INTENT(IN) :: op - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Iallreduce_f08 -end interface MPI_Iallreduce - -interface MPI_Allreduce_init -subroutine MPI_Allreduce_init_f08(sendbuf,recvbuf,count,datatype,op,comm,info,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Op, MPI_Comm, MPI_Info, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Op), INTENT(IN) :: op - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Allreduce_init_f08 -end interface MPI_Allreduce_init - -interface MPI_Alltoall -subroutine MPI_Alltoall_f08(sendbuf,sendcount,sendtype,recvbuf,recvcount,recvtype, & - comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: recvbuf - INTEGER, INTENT(IN) :: sendcount, recvcount - TYPE(MPI_Datatype), INTENT(IN) :: sendtype, recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Alltoall_f08 -end interface MPI_Alltoall - -interface MPI_Ialltoall -subroutine MPI_Ialltoall_f08(sendbuf,sendcount,sendtype,recvbuf,recvcount,recvtype, & - comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: sendcount, recvcount - TYPE(MPI_Datatype), INTENT(IN) :: sendtype, recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Ialltoall_f08 -end interface MPI_Ialltoall - -interface MPI_Alltoall_init -subroutine MPI_Alltoall_init_f08(sendbuf,sendcount,sendtype,recvbuf,recvcount,recvtype, & - comm,info,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Info, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) OMPI_ASYNCHRONOUS :: sendcount, recvcount - TYPE(MPI_Datatype), INTENT(IN) :: sendtype, recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Alltoall_init_f08 -end interface MPI_Alltoall_init - -interface MPI_Alltoallv -subroutine MPI_Alltoallv_f08(sendbuf,sendcounts,sdispls,sendtype,recvbuf,recvcounts, & - rdispls,recvtype,comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: recvbuf - INTEGER, INTENT(IN) :: sendcounts(*), sdispls(*), recvcounts(*), rdispls(*) - TYPE(MPI_Datatype), INTENT(IN) :: sendtype, recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Alltoallv_f08 -end interface MPI_Alltoallv - -interface MPI_Ialltoallv -subroutine MPI_Ialltoallv_f08(sendbuf,sendcounts,sdispls,sendtype,recvbuf,recvcounts, & - rdispls,recvtype,comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) OMPI_ASYNCHRONOUS :: sendcounts(*), sdispls(*), recvcounts(*), rdispls(*) - TYPE(MPI_Datatype), INTENT(IN) :: sendtype, recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Ialltoallv_f08 -end interface MPI_Ialltoallv - -interface MPI_Alltoallv_init -subroutine MPI_Alltoallv_init_f08(sendbuf,sendcounts,sdispls,sendtype,recvbuf,recvcounts, & - rdispls,recvtype,comm,info,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Info, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) OMPI_ASYNCHRONOUS :: sendcounts(*), sdispls(*), recvcounts(*), rdispls(*) - TYPE(MPI_Datatype), INTENT(IN) :: sendtype, recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Alltoallv_init_f08 -end interface MPI_Alltoallv_init - -interface MPI_Alltoallw -subroutine MPI_Alltoallw_f08(sendbuf,sendcounts,sdispls,sendtypes,recvbuf,recvcounts, & - rdispls,recvtypes,comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: recvbuf - INTEGER, INTENT(IN) :: sendcounts(*), sdispls(*), recvcounts(*), rdispls(*) - TYPE(MPI_Datatype), INTENT(IN) :: sendtypes(*), recvtypes(*) - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Alltoallw_f08 -end interface MPI_Alltoallw - -interface MPI_Ialltoallw -subroutine MPI_Ialltoallw_f08(sendbuf,sendcounts,sdispls,sendtypes,recvbuf,recvcounts, & - rdispls,recvtypes,comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) OMPI_ASYNCHRONOUS :: sendcounts(*), sdispls(*), recvcounts(*), rdispls(*) - TYPE(MPI_Datatype), INTENT(IN) OMPI_ASYNCHRONOUS :: sendtypes(*), recvtypes(*) - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Ialltoallw_f08 -end interface MPI_Ialltoallw - -interface MPI_Alltoallw_init -subroutine MPI_Alltoallw_init_f08(sendbuf,sendcounts,sdispls,sendtypes,recvbuf,recvcounts, & - rdispls,recvtypes,comm,info,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Info, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) OMPI_ASYNCHRONOUS :: sendcounts(*), sdispls(*), recvcounts(*), rdispls(*) - TYPE(MPI_Datatype), INTENT(IN) OMPI_ASYNCHRONOUS :: sendtypes(*), recvtypes(*) - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Alltoallw_init_f08 -end interface MPI_Alltoallw_init - interface MPI_Barrier subroutine MPI_Barrier_f08(comm,ierror) use :: mpi_f08_types, only : MPI_Comm @@ -1380,195 +488,6 @@ subroutine MPI_Barrier_init_f08(comm,info,request,ierror) end subroutine MPI_Barrier_init_f08 end interface MPI_Barrier_init -interface MPI_Bcast -subroutine MPI_Bcast_f08(buffer,count,datatype,root,comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buffer - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: buffer - INTEGER, INTENT(IN) :: count, root - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Bcast_f08 -end interface MPI_Bcast - -interface MPI_Ibcast -subroutine MPI_Ibcast_f08(buffer,count,datatype,root,comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buffer - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: buffer - INTEGER, INTENT(IN) :: count, root - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Ibcast_f08 -end interface MPI_Ibcast - -interface MPI_Bcast_init -subroutine MPI_Bcast_init_f08(buffer,count,datatype,root,comm,info,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Info, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buffer - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: buffer - INTEGER, INTENT(IN) :: count, root - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Bcast_init_f08 -end interface MPI_Bcast_init - -interface MPI_Exscan -subroutine MPI_Exscan_f08(sendbuf,recvbuf,count,datatype,op,comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Op, MPI_Comm - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: recvbuf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Op), INTENT(IN) :: op - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Exscan_f08 -end interface MPI_Exscan - -interface MPI_Iexscan -subroutine MPI_Iexscan_f08(sendbuf,recvbuf,count,datatype,op,comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Op, MPI_Comm, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Op), INTENT(IN) :: op - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Iexscan_f08 -end interface MPI_Iexscan - -interface MPI_Exscan_init -subroutine MPI_Exscan_init_f08(sendbuf,recvbuf,count,datatype,op,comm,info,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Op, MPI_Comm, MPI_Info, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Op), INTENT(IN) :: op - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Exscan_init_f08 -end interface MPI_Exscan_init - -interface MPI_Gather -subroutine MPI_Gather_f08(sendbuf,sendcount,sendtype,recvbuf,recvcount,recvtype, & - root,comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: recvbuf - INTEGER, INTENT(IN) :: sendcount, recvcount, root - TYPE(MPI_Datatype), INTENT(IN) :: sendtype, recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Gather_f08 -end interface MPI_Gather - -interface MPI_Igather -subroutine MPI_Igather_f08(sendbuf,sendcount,sendtype,recvbuf,recvcount,recvtype, & - root,comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: sendcount, recvcount, root - TYPE(MPI_Datatype), INTENT(IN) :: sendtype, recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Igather_f08 -end interface MPI_Igather - -interface MPI_Gather_init -subroutine MPI_Gather_init_f08(sendbuf,sendcount,sendtype,recvbuf,recvcount,recvtype, & - root,comm,info,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Info, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: sendcount, recvcount, root - TYPE(MPI_Datatype), INTENT(IN) :: sendtype, recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Gather_init_f08 -end interface MPI_Gather_init - -interface MPI_Gatherv -subroutine MPI_Gatherv_f08(sendbuf,sendcount,sendtype,recvbuf,recvcounts,displs, & - recvtype,root,comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: recvbuf - INTEGER, INTENT(IN) :: sendcount, root - INTEGER, INTENT(IN) :: recvcounts(*), displs(*) - TYPE(MPI_Datatype), INTENT(IN) :: sendtype, recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Gatherv_f08 -end interface MPI_Gatherv - -interface MPI_Igatherv -subroutine MPI_Igatherv_f08(sendbuf,sendcount,sendtype,recvbuf,recvcounts,displs, & - recvtype,root,comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: sendcount, root - INTEGER, INTENT(IN) OMPI_ASYNCHRONOUS :: recvcounts(*), displs(*) - TYPE(MPI_Datatype), INTENT(IN) :: sendtype, recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Igatherv_f08 -end interface MPI_Igatherv - -interface MPI_Gatherv_init -subroutine MPI_Gatherv_init_f08(sendbuf,sendcount,sendtype,recvbuf,recvcounts,displs, & - recvtype,root,comm,info,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Info, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: sendcount, root - INTEGER, INTENT(IN) OMPI_ASYNCHRONOUS :: recvcounts(*), displs(*) - TYPE(MPI_Datatype), INTENT(IN) :: sendtype, recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Gatherv_init_f08 -end interface MPI_Gatherv_init - interface MPI_Op_commutative subroutine MPI_Op_commutative_f08(op,commute,ierror) use :: mpi_f08_types, only : MPI_Op @@ -1600,317 +519,6 @@ subroutine MPI_Op_free_f08(op,ierror) end subroutine MPI_Op_free_f08 end interface MPI_Op_free -interface MPI_Reduce -subroutine MPI_Reduce_f08(sendbuf,recvbuf,count,datatype,op,root,comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Op, MPI_Comm - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: recvbuf - INTEGER, INTENT(IN) :: count, root - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Op), INTENT(IN) :: op - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Reduce_f08 -end interface MPI_Reduce - -interface MPI_Ireduce -subroutine MPI_Ireduce_f08(sendbuf,recvbuf,count,datatype,op,root,comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Op, MPI_Comm, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: count, root - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Op), INTENT(IN) :: op - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Ireduce_f08 -end interface MPI_Ireduce - -interface MPI_Reduce_init -subroutine MPI_Reduce_init_f08(sendbuf,recvbuf,count,datatype,op,root,comm,info,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Op, MPI_Comm, MPI_Info, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: count, root - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Op), INTENT(IN) :: op - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Reduce_init_f08 -end interface MPI_Reduce_init - -interface MPI_Reduce_local -subroutine MPI_Reduce_local_f08(inbuf,inoutbuf,count,datatype,op,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Op - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ inbuf, inoutbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: inbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: inoutbuf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Op), INTENT(IN) :: op - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Reduce_local_f08 -end interface MPI_Reduce_local - -interface MPI_Reduce_scatter -subroutine MPI_Reduce_scatter_f08(sendbuf,recvbuf,recvcounts,datatype,op,comm, & - ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Op, MPI_Comm - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: recvbuf - INTEGER, INTENT(IN) :: recvcounts(*) - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Op), INTENT(IN) :: op - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Reduce_scatter_f08 -end interface MPI_Reduce_scatter - -interface MPI_Ireduce_scatter -subroutine MPI_Ireduce_scatter_f08(sendbuf,recvbuf,recvcounts,datatype,op,comm, & - request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Op, MPI_Comm, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) OMPI_ASYNCHRONOUS :: recvcounts(*) - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Op), INTENT(IN) :: op - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Ireduce_scatter_f08 -end interface MPI_Ireduce_scatter - -interface MPI_Reduce_scatter_init -subroutine MPI_Reduce_scatter_init_f08(sendbuf,recvbuf,recvcounts,datatype,op,comm, & - info,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Op, MPI_Comm, MPI_Info, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) OMPI_ASYNCHRONOUS :: recvcounts(*) - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Op), INTENT(IN) :: op - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Reduce_scatter_init_f08 -end interface MPI_Reduce_scatter_init - -interface MPI_Reduce_scatter_block -subroutine MPI_Reduce_scatter_block_f08(sendbuf,recvbuf,recvcount,datatype,op,comm, & - ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Op, MPI_Comm - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: recvbuf - INTEGER, INTENT(IN) :: recvcount - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Op), INTENT(IN) :: op - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Reduce_scatter_block_f08 -end interface MPI_Reduce_scatter_block - -interface MPI_Ireduce_scatter_block -subroutine MPI_Ireduce_scatter_block_f08(sendbuf,recvbuf,recvcount,datatype,op,comm, & - request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Op, MPI_Comm, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: recvcount - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Op), INTENT(IN) :: op - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Ireduce_scatter_block_f08 -end interface MPI_Ireduce_scatter_block - -interface MPI_Reduce_scatter_block_init -subroutine MPI_Reduce_scatter_block_init_f08(sendbuf,recvbuf,recvcount,datatype,op,comm, & - info,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Op, MPI_Comm, MPI_Info, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: recvcount - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Op), INTENT(IN) :: op - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Reduce_scatter_block_init_f08 -end interface MPI_Reduce_scatter_block_init - -interface MPI_Scan -subroutine MPI_Scan_f08(sendbuf,recvbuf,count,datatype,op,comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Op, MPI_Comm - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: recvbuf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Op), INTENT(IN) :: op - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Scan_f08 -end interface MPI_Scan - -interface MPI_Iscan -subroutine MPI_Iscan_f08(sendbuf,recvbuf,count,datatype,op,comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Op, MPI_Comm, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Op), INTENT(IN) :: op - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Iscan_f08 -end interface MPI_Iscan - -interface MPI_Scan_init -subroutine MPI_Scan_init_f08(sendbuf,recvbuf,count,datatype,op,comm,info,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Op, MPI_Comm, MPI_Info, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Op), INTENT(IN) :: op - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Scan_init_f08 -end interface MPI_Scan_init - -interface MPI_Scatter -subroutine MPI_Scatter_f08(sendbuf,sendcount,sendtype,recvbuf,recvcount,recvtype, & - root,comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: recvbuf - INTEGER, INTENT(IN) :: sendcount, recvcount, root - TYPE(MPI_Datatype), INTENT(IN) :: sendtype, recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Scatter_f08 -end interface MPI_Scatter - -interface MPI_Iscatter -subroutine MPI_Iscatter_f08(sendbuf,sendcount,sendtype,recvbuf,recvcount,recvtype, & - root,comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: sendcount, recvcount, root - TYPE(MPI_Datatype), INTENT(IN) :: sendtype, recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Iscatter_f08 -end interface MPI_Iscatter - -interface MPI_Scatter_init -subroutine MPI_Scatter_init_f08(sendbuf,sendcount,sendtype,recvbuf,recvcount,recvtype, & - root,comm,info,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Info, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: sendcount, recvcount, root - TYPE(MPI_Datatype), INTENT(IN) :: sendtype, recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Scatter_init_f08 -end interface MPI_Scatter_init - -interface MPI_Scatterv -subroutine MPI_Scatterv_f08(sendbuf,sendcounts,displs,sendtype,recvbuf,recvcount, & - recvtype,root,comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: recvbuf - INTEGER, INTENT(IN) :: recvcount, root - INTEGER, INTENT(IN) :: sendcounts(*), displs(*) - TYPE(MPI_Datatype), INTENT(IN) :: sendtype, recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Scatterv_f08 -end interface MPI_Scatterv - -interface MPI_Iscatterv -subroutine MPI_Iscatterv_f08(sendbuf,sendcounts,displs,sendtype,recvbuf,recvcount, & - recvtype,root,comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: recvcount, root - INTEGER, INTENT(IN) OMPI_ASYNCHRONOUS :: sendcounts(*), displs(*) - TYPE(MPI_Datatype), INTENT(IN) :: sendtype, recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Iscatterv_f08 -end interface MPI_Iscatterv - -interface MPI_Scatterv_init -subroutine MPI_Scatterv_init_f08(sendbuf,sendcounts,displs,sendtype,recvbuf,recvcount, & - recvtype,root,comm,info,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Info, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: recvcount, root - INTEGER, INTENT(IN) OMPI_ASYNCHRONOUS :: sendcounts(*), displs(*) - TYPE(MPI_Datatype), INTENT(IN) :: sendtype, recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Scatterv_init_f08 -end interface MPI_Scatterv_init - interface MPI_Comm_compare subroutine MPI_Comm_compare_f08(comm1,comm2,result,ierror) use :: mpi_f08_types, only : MPI_Comm @@ -2417,36 +1025,6 @@ subroutine MPI_Type_set_name_f08(datatype,type_name,ierror) end subroutine MPI_Type_set_name_f08 end interface MPI_Type_set_name -interface MPI_Win_allocate -subroutine MPI_Win_allocate_f08(size, disp_unit, info, comm, & - baseptr, win, ierror) - USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR - use :: mpi_f08_types, only : MPI_Info, MPI_Comm, MPI_Win, MPI_ADDRESS_KIND - INTEGER(KIND=MPI_ADDRESS_KIND), INTENT(IN) :: size - INTEGER, INTENT(IN) :: disp_unit - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(C_PTR), INTENT(OUT) :: baseptr - TYPE(MPI_Win), INTENT(OUT) :: win - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Win_allocate_f08 -end interface MPI_Win_allocate - -interface MPI_Win_allocate_shared -subroutine MPI_Win_allocate_shared_f08(size, disp_unit, info, comm, & - baseptr, win, ierror) - USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR - use :: mpi_f08_types, only : MPI_Info, MPI_Comm, MPI_Win, MPI_ADDRESS_KIND - INTEGER(KIND=MPI_ADDRESS_KIND), INTENT(IN) :: size - INTEGER, INTENT(IN) :: disp_unit - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(C_PTR), INTENT(OUT) :: baseptr - TYPE(MPI_Win), INTENT(OUT) :: win - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Win_allocate_shared_f08 -end interface MPI_Win_allocate_shared - interface MPI_Win_create_keyval subroutine MPI_Win_create_keyval_f08(win_copy_attr_fn,win_delete_attr_fn,win_keyval, & extra_state,ierror) @@ -2968,18 +1546,6 @@ subroutine MPI_Finalized_f08(flag,ierror) end subroutine MPI_Finalized_f08 end interface MPI_Finalized -! ASYNCHRONOUS had to removed from the base argument because -! the dummy argument is not an assumed-shape array. This will -! be okay once the Interop TR is implemented. -interface MPI_Free_mem -subroutine MPI_Free_mem_f08(base,ierror) - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ base - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: base - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Free_mem_f08 -end interface MPI_Free_mem - interface MPI_Get_processor_name subroutine MPI_Get_processor_name_f08(name,resultlen,ierror) use :: mpi_f08_types, only : MPI_MAX_PROCESSOR_NAME @@ -3265,220 +1831,44 @@ end interface MPI_Comm_spawn_multiple interface MPI_Lookup_name subroutine MPI_Lookup_name_f08(service_name,info,port_name,ierror) - use :: mpi_f08_types, only : MPI_Info, MPI_MAX_PORT_NAME - implicit none - CHARACTER(LEN=*), INTENT(IN) :: service_name - TYPE(MPI_Info), INTENT(IN) :: info - CHARACTER(LEN=MPI_MAX_PORT_NAME), INTENT(OUT) :: port_name - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Lookup_name_f08 -end interface MPI_Lookup_name - -interface MPI_Open_port -subroutine MPI_Open_port_f08(info,port_name,ierror) - use :: mpi_f08_types, only : MPI_Info, MPI_MAX_PORT_NAME - implicit none - TYPE(MPI_Info), INTENT(IN) :: info - CHARACTER(LEN=MPI_MAX_PORT_NAME), INTENT(OUT) :: port_name - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Open_port_f08 -end interface MPI_Open_port - -interface MPI_Publish_name -subroutine MPI_Publish_name_f08(service_name,info,port_name,ierror) - use :: mpi_f08_types, only : MPI_Info - implicit none - TYPE(MPI_Info), INTENT(IN) :: info - CHARACTER(LEN=*), INTENT(IN) :: service_name, port_name - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Publish_name_f08 -end interface MPI_Publish_name - -interface MPI_Unpublish_name -subroutine MPI_Unpublish_name_f08(service_name,info,port_name,ierror) - use :: mpi_f08_types, only : MPI_Info - implicit none - CHARACTER(LEN=*), INTENT(IN) :: service_name, port_name - TYPE(MPI_Info), INTENT(IN) :: info - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Unpublish_name_f08 -end interface MPI_Unpublish_name - -interface MPI_Accumulate -subroutine MPI_Accumulate_f08(origin_addr,origin_count,origin_datatype,target_rank, & - target_disp,target_count,target_datatype,op,win,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Op, MPI_Win, MPI_ADDRESS_KIND - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ origin_addr - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: origin_addr - INTEGER, INTENT(IN) :: origin_count, target_rank, target_count - TYPE(MPI_Datatype), INTENT(IN) :: origin_datatype - INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: target_disp - TYPE(MPI_Datatype), INTENT(IN) :: target_datatype - TYPE(MPI_Op), INTENT(IN) :: op - TYPE(MPI_Win), INTENT(IN) :: win - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Accumulate_f08 -end interface MPI_Accumulate - -interface MPI_Raccumulate -subroutine MPI_Raccumulate_f08(origin_addr,origin_count,origin_datatype,target_rank, & - target_disp,target_count,target_datatype,op,win,request, & - ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Op, MPI_Win, MPI_Request, MPI_ADDRESS_KIND - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ origin_addr - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: origin_addr - INTEGER, INTENT(IN) :: origin_count, target_rank, target_count - TYPE(MPI_Datatype), INTENT(IN) :: origin_datatype - INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: target_disp - TYPE(MPI_Datatype), INTENT(IN) :: target_datatype - TYPE(MPI_Op), INTENT(IN) :: op - TYPE(MPI_Win), INTENT(IN) :: win - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Raccumulate_f08 -end interface MPI_Raccumulate - -interface MPI_Get -subroutine MPI_Get_f08(origin_addr,origin_count,origin_datatype,target_rank, & - target_disp,target_count,target_datatype,win,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Win, MPI_ADDRESS_KIND - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ origin_addr - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: origin_addr - INTEGER, INTENT(IN) :: origin_count, target_rank, target_count - TYPE(MPI_Datatype), INTENT(IN) :: origin_datatype - INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: target_disp - TYPE(MPI_Datatype), INTENT(IN) :: target_datatype - TYPE(MPI_Win), INTENT(IN) :: win - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Get_f08 -end interface MPI_Get - -interface MPI_Rget -subroutine MPI_Rget_f08(origin_addr,origin_count,origin_datatype,target_rank, & - target_disp,target_count,target_datatype,win,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Request, MPI_Win, MPI_ADDRESS_KIND - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ origin_addr - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: origin_addr - INTEGER, INTENT(IN) :: origin_count, target_rank, target_count - TYPE(MPI_Datatype), INTENT(IN) :: origin_datatype - INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: target_disp - TYPE(MPI_Datatype), INTENT(IN) :: target_datatype - TYPE(MPI_Win), INTENT(IN) :: win - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Rget_f08 -end interface MPI_Rget - -interface MPI_Get_accumulate -subroutine MPI_Get_accumulate_f08(origin_addr,origin_count,origin_datatype,result_addr, & - result_count,result_datatype,target_rank,target_disp, & - target_count,target_datatype,op,win,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Op, MPI_Win, MPI_ADDRESS_KIND - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ origin_addr,result_addr - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: origin_addr - INTEGER, INTENT(IN) :: origin_count, result_count, target_rank, target_count - TYPE(MPI_Datatype), INTENT(IN) :: origin_datatype - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: result_addr - TYPE(MPI_Datatype), INTENT(IN) :: result_datatype - INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: target_disp - TYPE(MPI_Datatype), INTENT(IN) :: target_datatype - TYPE(MPI_Op), INTENT(IN) :: op - TYPE(MPI_Win), INTENT(IN) :: win - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Get_accumulate_f08 -end interface MPI_Get_accumulate - -interface MPI_Rget_accumulate -subroutine MPI_Rget_accumulate_f08(origin_addr,origin_count,origin_datatype,result_addr, & - result_count,result_datatype,target_rank,target_disp, & - target_count,target_datatype,op,win,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Op, MPI_Request, MPI_Win, MPI_ADDRESS_KIND - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ origin_addr,result_addr - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: origin_addr - INTEGER, INTENT(IN) :: origin_count, result_count, target_rank, target_count - TYPE(MPI_Datatype), INTENT(IN) :: origin_datatype - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: result_addr - TYPE(MPI_Datatype), INTENT(IN) :: result_datatype - INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: target_disp - TYPE(MPI_Datatype), INTENT(IN) :: target_datatype - TYPE(MPI_Op), INTENT(IN) :: op - TYPE(MPI_Win), INTENT(IN) :: win - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Rget_accumulate_f08 -end interface MPI_Rget_accumulate - -interface MPI_Put -subroutine MPI_Put_f08(origin_addr,origin_count,origin_datatype,target_rank, & - target_disp,target_count,target_datatype,win,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Win, MPI_ADDRESS_KIND + use :: mpi_f08_types, only : MPI_Info, MPI_MAX_PORT_NAME implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ origin_addr - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: origin_addr - INTEGER, INTENT(IN) :: origin_count, target_rank, target_count - TYPE(MPI_Datatype), INTENT(IN) :: origin_datatype - INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: target_disp - TYPE(MPI_Datatype), INTENT(IN) :: target_datatype - TYPE(MPI_Win), INTENT(IN) :: win + CHARACTER(LEN=*), INTENT(IN) :: service_name + TYPE(MPI_Info), INTENT(IN) :: info + CHARACTER(LEN=MPI_MAX_PORT_NAME), INTENT(OUT) :: port_name INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Put_f08 -end interface MPI_Put +end subroutine MPI_Lookup_name_f08 +end interface MPI_Lookup_name -interface MPI_Rput -subroutine MPI_Rput_f08(origin_addr,origin_count,origin_datatype,target_rank, & - target_disp,target_count,target_datatype,win,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Win, MPI_Request, MPI_ADDRESS_KIND +interface MPI_Open_port +subroutine MPI_Open_port_f08(info,port_name,ierror) + use :: mpi_f08_types, only : MPI_Info, MPI_MAX_PORT_NAME implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ origin_addr - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: origin_addr - INTEGER, INTENT(IN) :: origin_count, target_rank, target_count - TYPE(MPI_Datatype), INTENT(IN) :: origin_datatype - INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: target_disp - TYPE(MPI_Datatype), INTENT(IN) :: target_datatype - TYPE(MPI_Win), INTENT(IN) :: win - TYPE(MPI_Request), INTENT(OUT) :: request + TYPE(MPI_Info), INTENT(IN) :: info + CHARACTER(LEN=MPI_MAX_PORT_NAME), INTENT(OUT) :: port_name INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Rput_f08 -end interface MPI_Rput +end subroutine MPI_Open_port_f08 +end interface MPI_Open_port -interface MPI_Fetch_and_op -subroutine MPI_Fetch_and_op_f08(origin_addr,result_addr,datatype,target_rank, & - target_disp,op,win,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Op, MPI_Win, MPI_ADDRESS_KIND +interface MPI_Publish_name +subroutine MPI_Publish_name_f08(service_name,info,port_name,ierror) + use :: mpi_f08_types, only : MPI_Info implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ origin_addr,result_addr - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: origin_addr - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: result_addr - TYPE(MPI_Datatype), INTENT(IN) :: datatype - INTEGER, INTENT(IN) :: target_rank - INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: target_disp - TYPE(MPI_Op), INTENT(IN) :: op - TYPE(MPI_Win), INTENT(IN) :: win + TYPE(MPI_Info), INTENT(IN) :: info + CHARACTER(LEN=*), INTENT(IN) :: service_name, port_name INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Fetch_and_op_f08 -end interface MPI_Fetch_and_op +end subroutine MPI_Publish_name_f08 +end interface MPI_Publish_name -interface MPI_Compare_and_swap -subroutine MPI_Compare_and_swap_f08(origin_addr,compare_addr,result_addr,datatype, & - target_rank,target_disp,win,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Win, MPI_ADDRESS_KIND +interface MPI_Unpublish_name +subroutine MPI_Unpublish_name_f08(service_name,info,port_name,ierror) + use :: mpi_f08_types, only : MPI_Info implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ origin_addr,compare_addr,result_addr - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: origin_addr,compare_addr - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: result_addr - TYPE(MPI_Datatype), INTENT(IN) :: datatype - INTEGER, INTENT(IN) :: target_rank - INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: target_disp - TYPE(MPI_Win), INTENT(IN) :: win + CHARACTER(LEN=*), INTENT(IN) :: service_name, port_name + TYPE(MPI_Info), INTENT(IN) :: info INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Compare_and_swap_f08 -end interface MPI_Compare_and_swap +end subroutine MPI_Unpublish_name_f08 +end interface MPI_Unpublish_name interface MPI_Win_complete subroutine MPI_Win_complete_f08(win,ierror) @@ -3489,21 +1879,6 @@ subroutine MPI_Win_complete_f08(win,ierror) end subroutine MPI_Win_complete_f08 end interface MPI_Win_complete -interface MPI_Win_create -subroutine MPI_Win_create_f08(base,size,disp_unit,info,comm,win,ierror) - use :: mpi_f08_types, only : MPI_Info, MPI_Comm, MPI_Win, MPI_ADDRESS_KIND - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ base - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: base - INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: size - INTEGER, INTENT(IN) :: disp_unit - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Win), INTENT(OUT) :: win - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Win_create_f08 -end interface MPI_Win_create - interface MPI_Win_create_dynamic subroutine MPI_Win_create_dynamic_f08(info,comm,win,ierror) use :: mpi_f08_types, only : MPI_Info, MPI_Comm, MPI_Win @@ -3515,29 +1890,6 @@ subroutine MPI_Win_create_dynamic_f08(info,comm,win,ierror) end subroutine MPI_Win_create_dynamic_f08 end interface MPI_Win_create_dynamic -interface MPI_Win_attach -subroutine MPI_Win_attach_f08(win,base,size,ierror) - use :: mpi_f08_types, only : MPI_Win, MPI_ADDRESS_KIND - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ base - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: base - INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: size - TYPE(MPI_Win), INTENT(IN) :: win - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Win_attach_f08 -end interface MPI_Win_attach - -interface MPI_Win_detach -subroutine MPI_Win_detach_f08(win,base,ierror) - use :: mpi_f08_types, only : MPI_Win, MPI_ADDRESS_KIND - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ base - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: base - TYPE(MPI_Win), INTENT(IN) :: win - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Win_detach_f08 -end interface MPI_Win_detach - interface MPI_Win_fence subroutine MPI_Win_fence_f08(assert,win,ierror) use :: mpi_f08_types, only : MPI_Win @@ -3598,20 +1950,6 @@ subroutine MPI_Win_post_f08(group,assert,win,ierror) end subroutine MPI_Win_post_f08 end interface MPI_Win_post -interface MPI_Win_shared_query -subroutine MPI_Win_shared_query_f08(win, rank, size, disp_unit, baseptr,& - ierror) - USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR - use :: mpi_f08_types, only : MPI_Win, MPI_ADDRESS_KIND - TYPE(MPI_Win), INTENT(IN) :: win - INTEGER, INTENT(IN) :: rank - INTEGER(KIND=MPI_ADDRESS_KIND), INTENT(OUT) :: size - INTEGER, INTENT(OUT) :: disp_unit - TYPE(C_PTR), INTENT(OUT) :: baseptr - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Win_shared_query_f08 -end interface MPI_Win_shared_query - interface MPI_Win_start subroutine MPI_Win_start_f08(group,assert,win,ierror) use :: mpi_f08_types, only : MPI_Group, MPI_Win @@ -3769,17 +2107,6 @@ subroutine MPI_Status_set_cancelled_f08(status,flag,ierror) end subroutine MPI_Status_set_cancelled_f08 end interface MPI_Status_set_cancelled -interface MPI_Status_set_elements -subroutine MPI_Status_set_elements_f08(status,datatype,count,ierror) - use :: mpi_f08_types, only : MPI_Status, MPI_Datatype - implicit none - TYPE(MPI_Status), INTENT(INOUT) :: status - TYPE(MPI_Datatype), INTENT(IN) :: datatype - INTEGER, INTENT(IN) :: count - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Status_set_elements_f08 -end interface MPI_Status_set_elements - interface MPI_Status_set_elements_x subroutine MPI_Status_set_elements_x_f08(status,datatype,count,ierror) use :: mpi_f08_types, only : MPI_Status, MPI_Datatype, MPI_COUNT_KIND @@ -3835,414 +2162,108 @@ subroutine MPI_File_get_byte_offset_f08(fh,offset,disp,ierror) use :: mpi_f08_types, only : MPI_File, MPI_OFFSET_KIND implicit none TYPE(MPI_File), INTENT(IN) :: fh - INTEGER(MPI_OFFSET_KIND), INTENT(IN) :: offset - INTEGER(MPI_OFFSET_KIND), INTENT(OUT) :: disp - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_File_get_byte_offset_f08 -end interface MPI_File_get_byte_offset - -interface MPI_File_get_group -subroutine MPI_File_get_group_f08(fh,group,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Group - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - TYPE(MPI_Group), INTENT(OUT) :: group - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_File_get_group_f08 -end interface MPI_File_get_group - -interface MPI_File_get_info -subroutine MPI_File_get_info_f08(fh,info_used,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Info - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - TYPE(MPI_Info), INTENT(OUT) :: info_used - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_File_get_info_f08 -end interface MPI_File_get_info - -interface MPI_File_get_position -subroutine MPI_File_get_position_f08(fh,offset,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_OFFSET_KIND - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - INTEGER(MPI_OFFSET_KIND), INTENT(OUT) :: offset - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_File_get_position_f08 -end interface MPI_File_get_position - -interface MPI_File_get_position_shared -subroutine MPI_File_get_position_shared_f08(fh,offset,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_OFFSET_KIND - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - INTEGER(MPI_OFFSET_KIND), INTENT(OUT) :: offset - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_File_get_position_shared_f08 -end interface MPI_File_get_position_shared - -interface MPI_File_get_size -subroutine MPI_File_get_size_f08(fh,size,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_OFFSET_KIND - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - INTEGER(MPI_OFFSET_KIND), INTENT(OUT) :: size - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_File_get_size_f08 -end interface MPI_File_get_size - -interface MPI_File_get_type_extent -subroutine MPI_File_get_type_extent_f08(fh,datatype,extent,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_ADDRESS_KIND - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - TYPE(MPI_Datatype), INTENT(IN) :: datatype - INTEGER(MPI_ADDRESS_KIND), INTENT(OUT) :: extent - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_File_get_type_extent_f08 -end interface MPI_File_get_type_extent - -interface MPI_File_get_view -subroutine MPI_File_get_view_f08(fh,disp,etype,filetype,datarep,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_OFFSET_KIND - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - INTEGER(MPI_OFFSET_KIND), INTENT(OUT) :: disp - TYPE(MPI_Datatype), INTENT(OUT) :: etype - TYPE(MPI_Datatype), INTENT(OUT) :: filetype - CHARACTER(LEN=*), INTENT(OUT) :: datarep - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_File_get_view_f08 -end interface MPI_File_get_view - -interface MPI_File_iread -subroutine MPI_File_iread_f08(fh,buf,count,datatype,request,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Request - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_File_iread_f08 -end interface MPI_File_iread - -interface MPI_File_iread_at -subroutine MPI_File_iread_at_f08(fh,offset,buf,count,datatype,request,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Request, MPI_OFFSET_KIND - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - INTEGER(MPI_OFFSET_KIND), INTENT(IN) :: offset - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_File_iread_at_f08 -end interface MPI_File_iread_at - -interface MPI_File_iread_all -subroutine MPI_File_iread_all_f08(fh,buf,count,datatype,request,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Request - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_File_iread_all_f08 -end interface MPI_File_iread_all - -interface MPI_File_iread_at_all -subroutine MPI_File_iread_at_all_f08(fh,offset,buf,count,datatype,request,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Request, MPI_OFFSET_KIND - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - INTEGER(MPI_OFFSET_KIND), INTENT(IN) :: offset - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_File_iread_at_all_f08 -end interface MPI_File_iread_at_all - -interface MPI_File_iread_shared -subroutine MPI_File_iread_shared_f08(fh,buf,count,datatype,request,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Request - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_File_iread_shared_f08 -end interface MPI_File_iread_shared - -interface MPI_File_iwrite -subroutine MPI_File_iwrite_f08(fh,buf,count,datatype,request,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Request - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_File_iwrite_f08 -end interface MPI_File_iwrite - -interface MPI_File_iwrite_at -subroutine MPI_File_iwrite_at_f08(fh,offset,buf,count,datatype,request,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Request, MPI_OFFSET_KIND - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - INTEGER(MPI_OFFSET_KIND), INTENT(IN) :: offset - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_File_iwrite_at_f08 -end interface MPI_File_iwrite_at - -interface MPI_File_iwrite_all -subroutine MPI_File_iwrite_all_f08(fh,buf,count,datatype,request,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Request - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_File_iwrite_all_f08 -end interface MPI_File_iwrite_all - -interface MPI_File_iwrite_at_all -subroutine MPI_File_iwrite_at_all_f08(fh,offset,buf,count,datatype,request,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Request, MPI_OFFSET_KIND - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - INTEGER(MPI_OFFSET_KIND), INTENT(IN) :: offset - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_File_iwrite_at_all_f08 -end interface MPI_File_iwrite_at_all - -interface MPI_File_iwrite_shared -subroutine MPI_File_iwrite_shared_f08(fh,buf,count,datatype,request,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: buf - TYPE(MPI_File), INTENT(IN) :: fh - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_File_iwrite_shared_f08 -end interface MPI_File_iwrite_shared - -interface MPI_File_open -subroutine MPI_File_open_f08(comm,filename,amode,info,fh,ierror) - use :: mpi_f08_types, only : MPI_Comm, MPI_Info, MPI_File - implicit none - TYPE(MPI_Comm), INTENT(IN) :: comm - CHARACTER(LEN=*), INTENT(IN) :: filename - INTEGER, INTENT(IN) :: amode - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_File), INTENT(OUT) :: fh - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_File_open_f08 -end interface MPI_File_open - -interface MPI_File_preallocate -subroutine MPI_File_preallocate_f08(fh,size,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_OFFSET_KIND - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - INTEGER(MPI_OFFSET_KIND), INTENT(IN) :: size - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_File_preallocate_f08 -end interface MPI_File_preallocate - -interface MPI_File_read -subroutine MPI_File_read_f08(fh,buf,count,datatype,status,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Status - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Status) :: status - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_File_read_f08 -end interface MPI_File_read - -interface MPI_File_read_all -subroutine MPI_File_read_all_f08(fh,buf,count,datatype,status,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Status - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Status) :: status - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_File_read_all_f08 -end interface MPI_File_read_all - -interface MPI_File_read_all_begin -subroutine MPI_File_read_all_begin_f08(fh,buf,count,datatype,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype + INTEGER(MPI_OFFSET_KIND), INTENT(IN) :: offset + INTEGER(MPI_OFFSET_KIND), INTENT(OUT) :: disp INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_File_read_all_begin_f08 -end interface MPI_File_read_all_begin +end subroutine MPI_File_get_byte_offset_f08 +end interface MPI_File_get_byte_offset -interface MPI_File_read_all_end -subroutine MPI_File_read_all_end_f08(fh,buf,status,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Status +interface MPI_File_get_group +subroutine MPI_File_get_group_f08(fh,group,ierror) + use :: mpi_f08_types, only : MPI_File, MPI_Group implicit none TYPE(MPI_File), INTENT(IN) :: fh - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: buf - TYPE(MPI_Status) :: status + TYPE(MPI_Group), INTENT(OUT) :: group INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_File_read_all_end_f08 -end interface MPI_File_read_all_end +end subroutine MPI_File_get_group_f08 +end interface MPI_File_get_group -interface MPI_File_read_at -subroutine MPI_File_read_at_f08(fh,offset,buf,count,datatype,status,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Status, MPI_OFFSET_KIND +interface MPI_File_get_info +subroutine MPI_File_get_info_f08(fh,info_used,ierror) + use :: mpi_f08_types, only : MPI_File, MPI_Info implicit none TYPE(MPI_File), INTENT(IN) :: fh - INTEGER(MPI_OFFSET_KIND), INTENT(IN) :: offset - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Status) :: status + TYPE(MPI_Info), INTENT(OUT) :: info_used INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_File_read_at_f08 -end interface MPI_File_read_at +end subroutine MPI_File_get_info_f08 +end interface MPI_File_get_info -interface MPI_File_read_at_all -subroutine MPI_File_read_at_all_f08(fh,offset,buf,count,datatype,status,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Status, MPI_OFFSET_KIND +interface MPI_File_get_position +subroutine MPI_File_get_position_f08(fh,offset,ierror) + use :: mpi_f08_types, only : MPI_File, MPI_OFFSET_KIND implicit none TYPE(MPI_File), INTENT(IN) :: fh - INTEGER(MPI_OFFSET_KIND), INTENT(IN) :: offset - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Status) :: status + INTEGER(MPI_OFFSET_KIND), INTENT(OUT) :: offset INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_File_read_at_all_f08 -end interface MPI_File_read_at_all +end subroutine MPI_File_get_position_f08 +end interface MPI_File_get_position -interface MPI_File_read_at_all_begin -subroutine MPI_File_read_at_all_begin_f08(fh,offset,buf,count,datatype,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_OFFSET_KIND +interface MPI_File_get_position_shared +subroutine MPI_File_get_position_shared_f08(fh,offset,ierror) + use :: mpi_f08_types, only : MPI_File, MPI_OFFSET_KIND implicit none TYPE(MPI_File), INTENT(IN) :: fh - INTEGER(MPI_OFFSET_KIND), INTENT(IN) :: offset - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype + INTEGER(MPI_OFFSET_KIND), INTENT(OUT) :: offset INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_File_read_at_all_begin_f08 -end interface MPI_File_read_at_all_begin +end subroutine MPI_File_get_position_shared_f08 +end interface MPI_File_get_position_shared -interface MPI_File_read_at_all_end -subroutine MPI_File_read_at_all_end_f08(fh,buf,status,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Status +interface MPI_File_get_size +subroutine MPI_File_get_size_f08(fh,size,ierror) + use :: mpi_f08_types, only : MPI_File, MPI_OFFSET_KIND implicit none TYPE(MPI_File), INTENT(IN) :: fh - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: buf - TYPE(MPI_Status) :: status + INTEGER(MPI_OFFSET_KIND), INTENT(OUT) :: size INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_File_read_at_all_end_f08 -end interface MPI_File_read_at_all_end +end subroutine MPI_File_get_size_f08 +end interface MPI_File_get_size -interface MPI_File_read_ordered -subroutine MPI_File_read_ordered_f08(fh,buf,count,datatype,status,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Status +interface MPI_File_get_type_extent +subroutine MPI_File_get_type_extent_f08(fh,datatype,extent,ierror) + use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_ADDRESS_KIND implicit none TYPE(MPI_File), INTENT(IN) :: fh - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: buf - INTEGER, INTENT(IN) :: count TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Status) :: status + INTEGER(MPI_ADDRESS_KIND), INTENT(OUT) :: extent INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_File_read_ordered_f08 -end interface MPI_File_read_ordered +end subroutine MPI_File_get_type_extent_f08 +end interface MPI_File_get_type_extent -interface MPI_File_read_ordered_begin -subroutine MPI_File_read_ordered_begin_f08(fh,buf,count,datatype,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype +interface MPI_File_get_view +subroutine MPI_File_get_view_f08(fh,disp,etype,filetype,datarep,ierror) + use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_OFFSET_KIND implicit none TYPE(MPI_File), INTENT(IN) :: fh - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype + INTEGER(MPI_OFFSET_KIND), INTENT(OUT) :: disp + TYPE(MPI_Datatype), INTENT(OUT) :: etype + TYPE(MPI_Datatype), INTENT(OUT) :: filetype + CHARACTER(LEN=*), INTENT(OUT) :: datarep INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_File_read_ordered_begin_f08 -end interface MPI_File_read_ordered_begin +end subroutine MPI_File_get_view_f08 +end interface MPI_File_get_view -interface MPI_File_read_ordered_end -subroutine MPI_File_read_ordered_end_f08(fh,buf,status,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Status +interface MPI_File_open +subroutine MPI_File_open_f08(comm,filename,amode,info,fh,ierror) + use :: mpi_f08_types, only : MPI_Comm, MPI_Info, MPI_File implicit none - TYPE(MPI_File), INTENT(IN) :: fh - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: buf - TYPE(MPI_Status) :: status + TYPE(MPI_Comm), INTENT(IN) :: comm + CHARACTER(LEN=*), INTENT(IN) :: filename + INTEGER, INTENT(IN) :: amode + TYPE(MPI_Info), INTENT(IN) :: info + TYPE(MPI_File), INTENT(OUT) :: fh INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_File_read_ordered_end_f08 -end interface MPI_File_read_ordered_end +end subroutine MPI_File_open_f08 +end interface MPI_File_open -interface MPI_File_read_shared -subroutine MPI_File_read_shared_f08(fh,buf,count,datatype,status,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Status +interface MPI_File_preallocate +subroutine MPI_File_preallocate_f08(fh,size,ierror) + use :: mpi_f08_types, only : MPI_File, MPI_OFFSET_KIND implicit none TYPE(MPI_File), INTENT(IN) :: fh - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Status) :: status + INTEGER(MPI_OFFSET_KIND), INTENT(IN) :: size INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_File_read_shared_f08 -end interface MPI_File_read_shared +end subroutine MPI_File_preallocate_f08 +end interface MPI_File_preallocate interface MPI_File_seek subroutine MPI_File_seek_f08(fh,offset,whence,ierror) @@ -4319,168 +2340,6 @@ subroutine MPI_File_sync_f08(fh,ierror) end subroutine MPI_File_sync_f08 end interface MPI_File_sync -interface MPI_File_write -subroutine MPI_File_write_f08(fh,buf,count,datatype,status,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Status - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Status) :: status - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_File_write_f08 -end interface MPI_File_write - -interface MPI_File_write_all -subroutine MPI_File_write_all_f08(fh,buf,count,datatype,status,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Status - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Status) :: status - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_File_write_all_f08 -end interface MPI_File_write_all - -interface MPI_File_write_all_begin -subroutine MPI_File_write_all_begin_f08(fh,buf,count,datatype,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_File_write_all_begin_f08 -end interface MPI_File_write_all_begin - -interface MPI_File_write_all_end -subroutine MPI_File_write_all_end_f08(fh,buf,status,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Status - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: buf - TYPE(MPI_Status) :: status - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_File_write_all_end_f08 -end interface MPI_File_write_all_end - -interface MPI_File_write_at -subroutine MPI_File_write_at_f08(fh,offset,buf,count,datatype,status,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Status, MPI_OFFSET_KIND - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - INTEGER(MPI_OFFSET_KIND), INTENT(IN) :: offset - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Status) :: status - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_File_write_at_f08 -end interface MPI_File_write_at - -interface MPI_File_write_at_all -subroutine MPI_File_write_at_all_f08(fh,offset,buf,count,datatype,status,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Status, MPI_OFFSET_KIND - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - INTEGER(MPI_OFFSET_KIND), INTENT(IN) :: offset - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Status) :: status - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_File_write_at_all_f08 -end interface MPI_File_write_at_all - -interface MPI_File_write_at_all_begin -subroutine MPI_File_write_at_all_begin_f08(fh,offset,buf,count,datatype,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_OFFSET_KIND - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - INTEGER(MPI_OFFSET_KIND), INTENT(IN) :: offset - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_File_write_at_all_begin_f08 -end interface MPI_File_write_at_all_begin - -interface MPI_File_write_at_all_end -subroutine MPI_File_write_at_all_end_f08(fh,buf,status,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Status - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: buf - TYPE(MPI_Status) :: status - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_File_write_at_all_end_f08 -end interface MPI_File_write_at_all_end - -interface MPI_File_write_ordered -subroutine MPI_File_write_ordered_f08(fh,buf,count,datatype,status,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Status - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Status) :: status - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_File_write_ordered_f08 -end interface MPI_File_write_ordered - -interface MPI_File_write_ordered_begin -subroutine MPI_File_write_ordered_begin_f08(fh,buf,count,datatype,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_File_write_ordered_begin_f08 -end interface MPI_File_write_ordered_begin - -interface MPI_File_write_ordered_end -subroutine MPI_File_write_ordered_end_f08(fh,buf,status,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Status - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: buf - TYPE(MPI_Status) :: status - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_File_write_ordered_end_f08 -end interface MPI_File_write_ordered_end - -interface MPI_File_write_shared -subroutine MPI_File_write_shared_f08(fh,buf,count,datatype,status,ierror) - use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Status - implicit none - TYPE(MPI_File), INTENT(IN) :: fh - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Status) :: status - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_File_write_shared_f08 -end interface MPI_File_write_shared - interface MPI_Register_datarep subroutine MPI_Register_datarep_f08(datarep,read_conversion_fn,write_conversion_fn, & dtype_file_extent_fn,extra_state,ierror) @@ -4575,14 +2434,6 @@ subroutine MPI_Comm_split_type_f08(comm,split_type,key,info,newcomm,ierror) end subroutine MPI_Comm_split_type_f08 end interface MPI_Comm_split_type -interface MPI_F_sync_reg -subroutine MPI_F_sync_reg_f08(buf) - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: buf -end subroutine MPI_F_sync_reg_f08 -end interface MPI_F_sync_reg - interface MPI_Get_library_version subroutine MPI_Get_library_version_f08(version,resultlen,ierror) use :: mpi_f08_types, only : MPI_MAX_LIBRARY_VERSION_STRING @@ -4618,280 +2469,6 @@ subroutine MPI_Improbe_f08(source,tag,comm,flag,message,status,ierror) end subroutine MPI_Improbe_f08 end interface MPI_Improbe -interface MPI_Imrecv -subroutine MPI_Imrecv_f08(buf,count,datatype,message,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Message, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Message), INTENT(INOUT) :: message - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Imrecv_f08 -end interface MPI_Imrecv - -interface MPI_Mrecv -subroutine MPI_Mrecv_f08(buf,count,datatype,message,status,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Message, MPI_Status - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Message), INTENT(INOUT) :: message - TYPE(MPI_Status) :: status - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Mrecv_f08 -end interface MPI_Mrecv - -interface MPI_Neighbor_allgather -subroutine MPI_Neighbor_allgather_f08(sendbuf,sendcount,sendtype,recvbuf,recvcount,recvtype, & - comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: recvbuf - INTEGER, INTENT(IN) :: sendcount, recvcount - TYPE(MPI_Datatype), INTENT(IN) :: sendtype, recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Neighbor_allgather_f08 -end interface MPI_Neighbor_allgather - -interface MPI_Ineighbor_allgather -subroutine MPI_Ineighbor_allgather_f08(sendbuf,sendcount,sendtype,recvbuf,recvcount,recvtype, & - comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: sendcount, recvcount - TYPE(MPI_Datatype), INTENT(IN) :: sendtype, recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Ineighbor_allgather_f08 -end interface MPI_Ineighbor_allgather - -interface MPI_Neighbor_allgather_init -subroutine MPI_Neighbor_allgather_init_f08(sendbuf,sendcount,sendtype,recvbuf,recvcount,recvtype, & - comm,info,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Info, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: recvbuf - INTEGER, INTENT(IN) :: sendcount, recvcount - TYPE(MPI_Datatype), INTENT(IN) :: sendtype, recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Neighbor_allgather_init_f08 -end interface MPI_Neighbor_allgather_init - -interface MPI_Neighbor_allgatherv -subroutine MPI_Neighbor_allgatherv_f08(sendbuf,sendcount,sendtype,recvbuf,recvcounts,displs, & - recvtype,comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: recvbuf - INTEGER, INTENT(IN) :: sendcount - INTEGER, INTENT(IN) :: recvcounts(*), displs(*) - TYPE(MPI_Datatype), INTENT(IN) :: sendtype, recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Neighbor_allgatherv_f08 -end interface MPI_Neighbor_allgatherv - -interface MPI_Ineighbor_allgatherv -subroutine MPI_Ineighbor_allgatherv_f08(sendbuf,sendcount,sendtype,recvbuf,recvcounts,displs, & - recvtype,comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: sendcount - INTEGER, INTENT(IN) OMPI_ASYNCHRONOUS :: recvcounts(*), displs(*) - TYPE(MPI_Datatype), INTENT(IN) :: sendtype, recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Ineighbor_allgatherv_f08 -end interface MPI_Ineighbor_allgatherv - -interface MPI_Neighbor_allgatherv_init -subroutine MPI_Neighbor_allgatherv_init_f08(sendbuf,sendcount,sendtype,recvbuf,recvcounts,displs, & - recvtype,comm,info,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Info, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: recvbuf - INTEGER, INTENT(IN) :: sendcount - INTEGER, INTENT(IN) :: recvcounts(*), displs(*) - TYPE(MPI_Datatype), INTENT(IN) :: sendtype, recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Neighbor_allgatherv_init_f08 -end interface MPI_Neighbor_allgatherv_init - -interface MPI_Neighbor_alltoall -subroutine MPI_Neighbor_alltoall_f08(sendbuf,sendcount,sendtype,recvbuf,recvcount,recvtype, & - comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: recvbuf - INTEGER, INTENT(IN) :: sendcount, recvcount - TYPE(MPI_Datatype), INTENT(IN) :: sendtype, recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Neighbor_alltoall_f08 -end interface MPI_Neighbor_alltoall - -interface MPI_Ineighbor_alltoall -subroutine MPI_Ineighbor_alltoall_f08(sendbuf,sendcount,sendtype,recvbuf,recvcount,recvtype, & - comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: sendcount, recvcount - TYPE(MPI_Datatype), INTENT(IN) :: sendtype, recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Ineighbor_alltoall_f08 -end interface MPI_Ineighbor_alltoall - -interface MPI_Neighbor_alltoall_init -subroutine MPI_Neighbor_alltoall_init_f08(sendbuf,sendcount,sendtype,recvbuf,recvcount,recvtype, & - comm,info,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Info, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: recvbuf - INTEGER, INTENT(IN) :: sendcount, recvcount - TYPE(MPI_Datatype), INTENT(IN) :: sendtype, recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Neighbor_alltoall_init_f08 -end interface MPI_Neighbor_alltoall_init - -interface MPI_Neighbor_alltoallv -subroutine MPI_Neighbor_alltoallv_f08(sendbuf,sendcounts,sdispls,sendtype,recvbuf,recvcounts, & - rdispls,recvtype,comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: recvbuf - INTEGER, INTENT(IN) :: sendcounts(*), sdispls(*), recvcounts(*), rdispls(*) - TYPE(MPI_Datatype), INTENT(IN) :: sendtype, recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Neighbor_alltoallv_f08 -end interface MPI_Neighbor_alltoallv - -interface MPI_Ineighbor_alltoallv -subroutine MPI_Ineighbor_alltoallv_f08(sendbuf,sendcounts,sdispls,sendtype,recvbuf,recvcounts, & - rdispls,recvtype,comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) OMPI_ASYNCHRONOUS :: sendcounts(*), sdispls(*), recvcounts(*), rdispls(*) - TYPE(MPI_Datatype), INTENT(IN) :: sendtype, recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Ineighbor_alltoallv_f08 -end interface MPI_Ineighbor_alltoallv - -interface MPI_Neighbor_alltoallv_init -subroutine MPI_Neighbor_alltoallv_init_f08(sendbuf,sendcounts,sdispls,sendtype,recvbuf,recvcounts, & - rdispls,recvtype,comm,info,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Info, MPI_Request - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: recvbuf - INTEGER, INTENT(IN) :: sendcounts(*), sdispls(*), recvcounts(*), rdispls(*) - TYPE(MPI_Datatype), INTENT(IN) :: sendtype, recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Neighbor_alltoallv_init_f08 -end interface MPI_Neighbor_alltoallv_init - -interface MPI_Neighbor_alltoallw -subroutine MPI_Neighbor_alltoallw_f08(sendbuf,sendcounts,sdispls,sendtypes,recvbuf,recvcounts, & - rdispls,recvtypes,comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_ADDRESS_KIND - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: recvbuf - INTEGER, INTENT(IN) :: sendcounts(*), recvcounts(*) - INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: sdispls(*), rdispls(*) - TYPE(MPI_Datatype), INTENT(IN) :: sendtypes(*), recvtypes(*) - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Neighbor_alltoallw_f08 -end interface MPI_Neighbor_alltoallw - -interface MPI_Ineighbor_alltoallw -subroutine MPI_Ineighbor_alltoallw_f08(sendbuf,sendcounts,sdispls,sendtypes,recvbuf,recvcounts, & - rdispls,recvtypes,comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request, MPI_ADDRESS_KIND - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) OMPI_ASYNCHRONOUS :: sendcounts(*), recvcounts(*) - INTEGER(MPI_ADDRESS_KIND), INTENT(IN) OMPI_ASYNCHRONOUS :: sdispls(*), rdispls(*) - TYPE(MPI_Datatype), INTENT(IN) OMPI_ASYNCHRONOUS :: sendtypes(*), recvtypes(*) - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Ineighbor_alltoallw_f08 -end interface MPI_Ineighbor_alltoallw - -interface MPI_Neighbor_alltoallw_init -subroutine MPI_Neighbor_alltoallw_init_f08(sendbuf,sendcounts,sdispls,sendtypes,recvbuf,recvcounts, & - rdispls,recvtypes,comm,info,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Info, MPI_Request, MPI_ADDRESS_KIND - implicit none - @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ sendbuf, recvbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: sendbuf - @OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: recvbuf - INTEGER, INTENT(IN) :: sendcounts(*), recvcounts(*) - INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: sdispls(*), rdispls(*) - TYPE(MPI_Datatype), INTENT(IN) :: sendtypes(*), recvtypes(*) - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Neighbor_alltoallw_init_f08 -end interface MPI_Neighbor_alltoallw_init - interface MPI_Status_f2f08 subroutine MPI_Status_f2f08_f08(f_status,f08_status,ierror) use :: mpi_f08_types, only : MPI_Status, MPI_STATUS_SIZE diff --git a/ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-rename.h b/ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-rename.h index 41e747e975c..1ed460e7259 100644 --- a/ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-rename.h +++ b/ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-rename.h @@ -5,800 +5,804 @@ #if OMPI_BUILD_MPI_PROFILING -#define MPI_Bsend PMPI_Bsend -#define MPI_Bsend_f08 PMPI_Bsend_f08 -#define MPI_Bsend_init PMPI_Bsend_init -#define MPI_Bsend_init_f08 PMPI_Bsend_init_f08 -#define MPI_Buffer_attach PMPI_Buffer_attach -#define MPI_Buffer_attach_f08 PMPI_Buffer_attach_f08 -#define MPI_Buffer_detach PMPI_Buffer_detach -#define MPI_Buffer_detach_f08 PMPI_Buffer_detach_f08 -#define MPI_Cancel PMPI_Cancel -#define MPI_Cancel_f08 PMPI_Cancel_f08 -#define MPI_Get_count PMPI_Get_count -#define MPI_Get_count_f08 PMPI_Get_count_f08 -#define MPI_Ibsend PMPI_Ibsend -#define MPI_Ibsend_f08 PMPI_Ibsend_f08 -#define MPI_Iprobe PMPI_Iprobe -#define MPI_Iprobe_f08 PMPI_Iprobe_f08 -#define MPI_Irecv PMPI_Irecv -#define MPI_Irecv_f08 PMPI_Irecv_f08 -#define MPI_Irsend PMPI_Irsend -#define MPI_Irsend_f08 PMPI_Irsend_f08 -#define MPI_Isend PMPI_Isend -#define MPI_Isend_f08 PMPI_Isend_f08 -#define MPI_Isendrecv PMPI_Isendrecv -#define MPI_Isendrecv_f08 PMPI_Isendrecv_f08 -#define MPI_Isendrecv_replace PMPI_Isendrecv_replace -#define MPI_Isendrecv_replace_f08 PMPI_Isendrecv_replace_f08 -#define MPI_Issend PMPI_Issend -#define MPI_Issend_f08 PMPI_Issend_f08 -#define MPI_Precv_init PMPI_Precv_init -#define MPI_Precv_init_f08 PMPI_Precv_init_f08 -#define MPI_Psend_init PMPI_Psend_init -#define MPI_Psend_init_f08 PMPI_Psend_init_f08 -#define MPI_Pready PMPI_Pready -#define MPI_Pready_f08 PMPI_Pready_f08 -#define MPI_Pready_list PMPI_Pready_list -#define MPI_Pready_list_f08 PMPI_Pready_list_f08 -#define MPI_Pready_range PMPI_Pready_range -#define MPI_Pready_range_f08 PMPI_Pready_range_f08 -#define MPI_Parrived PMPI_Parrived -#define MPI_Parrived_f08 PMPI_Parrived_f08 -#define MPI_Probe PMPI_Probe -#define MPI_Probe_f08 PMPI_Probe_f08 -#define MPI_Recv PMPI_Recv -#define MPI_Recv_f08 PMPI_Recv_f08 -#define MPI_Recv_init PMPI_Recv_init -#define MPI_Recv_init_f08 PMPI_Recv_init_f08 -#define MPI_Request_free PMPI_Request_free -#define MPI_Request_free_f08 PMPI_Request_free_f08 -#define MPI_Request_get_status PMPI_Request_get_status -#define MPI_Request_get_status_f08 PMPI_Request_get_status_f08 -#define MPI_Rsend PMPI_Rsend -#define MPI_Rsend_f08 PMPI_Rsend_f08 -#define MPI_Rsend_init PMPI_Rsend_init -#define MPI_Rsend_init_f08 PMPI_Rsend_init_f08 -#define MPI_Send PMPI_Send -#define MPI_Send_f08 PMPI_Send_f08 -#define MPI_Sendrecv PMPI_Sendrecv -#define MPI_Sendrecv_f08 PMPI_Sendrecv_f08 -#define MPI_Sendrecv_replace PMPI_Sendrecv_replace -#define MPI_Sendrecv_replace_f08 PMPI_Sendrecv_replace_f08 -#define MPI_Send_init PMPI_Send_init -#define MPI_Send_init_f08 PMPI_Send_init_f08 -#define MPI_Session_call_errhandler PMPI_Session_call_errhandler -#define MPI_Session_call_errhandler_f08 PMPI_Session_call_errhandler_f08 -#define MPI_Session_create_errhandler PMPI_Session_create_errhandler -#define MPI_Session_create_errhandler_f08 PMPI_Session_create_errhandler_f08 -#define MPI_Session_get_errhandler PMPI_Session_get_errhandler -#define MPI_Session_get_errhandler_f08 PMPI_Session_get_errhandler_f08 -#define MPI_Session_get_info PMPI_Session_get_info -#define MPI_Session_get_info PMPI_Session_get_info -#define MPI_Session_get_info_f08 PMPI_Session_get_info_f08 -#define MPI_Session_get_nth_pset PMPI_Session_get_nth_pset -#define MPI_Session_get_nth_pset_f08 PMPI_Session_get_nth_pset_f08 -#define MPI_Session_get_nth_psetlen PMPI_Session_get_nth_psetlen -#define MPI_Session_get_nth_psetlen_f08 PMPI_Session_get_nth_psetlen_f08 -#define MPI_Session_get_num_psets PMPI_Session_get_num_psets -#define MPI_Session_get_num_psets_f08 PMPI_Session_get_num_psets_f08 -#define MPI_Session_get_pset_info PMPI_Session_get_pset_info -#define MPI_Session_get_pset_info_f08 PMPI_Session_get_pset_info_f08 -#define MPI_Session_init PMPI_Session_init -#define MPI_Session_init_f08 PMPI_Session_init_f08 -#define MPI_Session_finalize PMPI_Session_finalize -#define MPI_Session_finalize_f08 PMPI_Session_finalize_f08 -#define MPI_Session_set_errhandler PMPI_Session_set_errhandler -#define MPI_Session_set_errhandler_f08 PMPI_Session_set_errhandler_f08 -#define MPI_Ssend PMPI_Ssend -#define MPI_Ssend_f08 PMPI_Ssend_f08 -#define MPI_Ssend_init PMPI_Ssend_init -#define MPI_Ssend_init_f08 PMPI_Ssend_init_f08 -#define MPI_Start PMPI_Start -#define MPI_Start_f08 PMPI_Start_f08 -#define MPI_Startall PMPI_Startall -#define MPI_Startall_f08 PMPI_Startall_f08 -#define MPI_Test PMPI_Test -#define MPI_Test_f08 PMPI_Test_f08 -#define MPI_Testall PMPI_Testall -#define MPI_Testall_f08 PMPI_Testall_f08 -#define MPI_Testany PMPI_Testany -#define MPI_Testany_f08 PMPI_Testany_f08 -#define MPI_Testsome PMPI_Testsome -#define MPI_Testsome_f08 PMPI_Testsome_f08 -#define MPI_Test_cancelled PMPI_Test_cancelled -#define MPI_Test_cancelled_f08 PMPI_Test_cancelled_f08 -#define MPI_Wait PMPI_Wait -#define MPI_Wait_f08 PMPI_Wait_f08 -#define MPI_Waitall PMPI_Waitall -#define MPI_Waitall_f08 PMPI_Waitall_f08 -#define MPI_Waitany PMPI_Waitany -#define MPI_Waitany_f08 PMPI_Waitany_f08 -#define MPI_Waitsome PMPI_Waitsome -#define MPI_Waitsome_f08 PMPI_Waitsome_f08 -#define MPI_Get_address PMPI_Get_address -#define MPI_Get_address_f08 PMPI_Get_address_f08 -#define MPI_Get_elements PMPI_Get_elements -#define MPI_Get_elements_f08 PMPI_Get_elements_f08 -#define MPI_Get_elements_x PMPI_Get_elements_x -#define MPI_Get_elements_x_f08 PMPI_Get_elements_x_f08 -#define MPI_Pack PMPI_Pack -#define MPI_Pack_f08 PMPI_Pack_f08 -#define MPI_Pack_external PMPI_Pack_external -#define MPI_Pack_external_f08 PMPI_Pack_external_f08 -#define MPI_Pack_external_size PMPI_Pack_external_size -#define MPI_Pack_external_size_f08 PMPI_Pack_external_size_f08 -#define MPI_Pack_size PMPI_Pack_size -#define MPI_Pack_size_f08 PMPI_Pack_size_f08 -#define MPI_Type_commit PMPI_Type_commit -#define MPI_Type_commit_f08 PMPI_Type_commit_f08 -#define MPI_Type_contiguous PMPI_Type_contiguous -#define MPI_Type_contiguous_f08 PMPI_Type_contiguous_f08 -#define MPI_Type_create_darray PMPI_Type_create_darray -#define MPI_Type_create_darray_f08 PMPI_Type_create_darray_f08 -#define MPI_Type_create_hindexed PMPI_Type_create_hindexed -#define MPI_Type_create_hindexed_f08 PMPI_Type_create_hindexed_f08 -#define MPI_Type_create_hvector PMPI_Type_create_hvector -#define MPI_Type_create_hvector_f08 PMPI_Type_create_hvector_f08 -#define MPI_Type_create_indexed_block PMPI_Type_create_indexed_block -#define MPI_Type_create_indexed_block_f08 PMPI_Type_create_indexed_block_f08 -#define MPI_Type_create_hindexed_block PMPI_Type_create_hindexed_block -#define MPI_Type_create_hindexed_block_f08 PMPI_Type_create_hindexed_block_f08 -#define MPI_Type_create_resized PMPI_Type_create_resized -#define MPI_Type_create_resized_f08 PMPI_Type_create_resized_f08 -#define MPI_Type_create_struct PMPI_Type_create_struct -#define MPI_Type_create_struct_f08 PMPI_Type_create_struct_f08 -#define MPI_Type_create_subarray PMPI_Type_create_subarray -#define MPI_Type_create_subarray_f08 PMPI_Type_create_subarray_f08 -#define MPI_Type_dup PMPI_Type_dup -#define MPI_Type_dup_f08 PMPI_Type_dup_f08 -#define MPI_Type_free PMPI_Type_free -#define MPI_Type_free_f08 PMPI_Type_free_f08 -#define MPI_Type_get_contents PMPI_Type_get_contents -#define MPI_Type_get_contents_f08 PMPI_Type_get_contents_f08 -#define MPI_Type_get_envelope PMPI_Type_get_envelope -#define MPI_Type_get_envelope_f08 PMPI_Type_get_envelope_f08 -#define MPI_Type_get_extent PMPI_Type_get_extent -#define MPI_Type_get_extent_f08 PMPI_Type_get_extent_f08 -#define MPI_Type_get_extent_x PMPI_Type_get_extent_x -#define MPI_Type_get_extent_x_f08 PMPI_Type_get_extent_x_f08 -#define MPI_Type_get_true_extent PMPI_Type_get_true_extent -#define MPI_Type_get_true_extent_f08 PMPI_Type_get_true_extent_f08 -#define MPI_Type_get_true_extent_x PMPI_Type_get_true_extent_x -#define MPI_Type_get_true_extent_x_f08 PMPI_Type_get_true_extent_x_f08 -#define MPI_Type_indexed PMPI_Type_indexed -#define MPI_Type_indexed_f08 PMPI_Type_indexed_f08 -#define MPI_Type_size PMPI_Type_size -#define MPI_Type_size_f08 PMPI_Type_size_f08 -#define MPI_Type_size_x PMPI_Type_size_x -#define MPI_Type_size_x_f08 PMPI_Type_size_x_f08 -#define MPI_Type_vector PMPI_Type_vector -#define MPI_Type_vector_f08 PMPI_Type_vector_f08 -#define MPI_Unpack PMPI_Unpack -#define MPI_Unpack_f08 PMPI_Unpack_f08 -#define MPI_Unpack_external PMPI_Unpack_external -#define MPI_Unpack_external_f08 PMPI_Unpack_external_f08 -#define MPI_Allgather PMPI_Allgather +#define MPI_Abort_f08 PMPI_Abort_f08 +#define MPI_Abort PMPI_Abort +#define MPI_Accumulate_f08 PMPI_Accumulate_f08 +#define MPI_Accumulate PMPI_Accumulate +#define MPI_Add_error_class_f08 PMPI_Add_error_class_f08 +#define MPI_Add_error_class PMPI_Add_error_class +#define MPI_Add_error_code_f08 PMPI_Add_error_code_f08 +#define MPI_Add_error_code PMPI_Add_error_code +#define MPI_Add_error_string_f08 PMPI_Add_error_string_f08 +#define MPI_Add_error_string PMPI_Add_error_string +#define MPI_Aint_add_f08 PMPI_Aint_add_f08 +#define MPI_Aint_add PMPI_Aint_add +#define MPI_Aint_diff_f08 PMPI_Aint_diff_f08 +#define MPI_Aint_diff PMPI_Aint_diff #define MPI_Allgather_f08 PMPI_Allgather_f08 -#define MPI_Iallgather PMPI_Iallgather -#define MPI_Iallgather_f08 PMPI_Iallgather_f08 -#define MPI_Allgather_init PMPI_Allgather_init #define MPI_Allgather_init_f08 PMPI_Allgather_init_f08 -#define MPI_Allgatherv PMPI_Allgatherv +#define MPI_Allgather_init PMPI_Allgather_init +#define MPI_Allgather PMPI_Allgather #define MPI_Allgatherv_f08 PMPI_Allgatherv_f08 -#define MPI_Iallgatherv PMPI_Iallgatherv -#define MPI_Iallgatherv_f08 PMPI_Iallgatherv_f08 -#define MPI_Allgatherv_init PMPI_Allgatherv_init #define MPI_Allgatherv_init_f08 PMPI_Allgatherv_init_f08 -#define MPI_Allreduce PMPI_Allreduce +#define MPI_Allgatherv_init PMPI_Allgatherv_init +#define MPI_Allgatherv PMPI_Allgatherv +#define MPI_Alloc_mem_f08 PMPI_Alloc_mem_f08 +#define MPI_Alloc_mem PMPI_Alloc_mem #define MPI_Allreduce_f08 PMPI_Allreduce_f08 -#define MPI_Iallreduce PMPI_Iallreduce -#define MPI_Iallreduce_f08 PMPI_Iallreduce_f08 -#define MPI_Allreduce_init PMPI_Allreduce_init #define MPI_Allreduce_init_f08 PMPI_Allreduce_init_f08 -#define MPI_Alltoall PMPI_Alltoall +#define MPI_Allreduce_init PMPI_Allreduce_init +#define MPI_Allreduce PMPI_Allreduce #define MPI_Alltoall_f08 PMPI_Alltoall_f08 -#define MPI_Ialltoall PMPI_Ialltoall -#define MPI_Ialltoall_f08 PMPI_Ialltoall_f08 -#define MPI_Alltoall_init PMPI_Alltoall_init #define MPI_Alltoall_init_f08 PMPI_Alltoall_init_f08 -#define MPI_Alltoallv PMPI_Alltoallv +#define MPI_Alltoall_init PMPI_Alltoall_init +#define MPI_Alltoall PMPI_Alltoall #define MPI_Alltoallv_f08 PMPI_Alltoallv_f08 -#define MPI_Ialltoallv PMPI_Ialltoallv -#define MPI_Ialltoallv_f08 PMPI_Ialltoallv_f08 -#define MPI_Alltoallv_init PMPI_Alltoallv_init #define MPI_Alltoallv_init_f08 PMPI_Alltoallv_init_f08 -#define MPI_Alltoallw PMPI_Alltoallw +#define MPI_Alltoallv_init PMPI_Alltoallv_init +#define MPI_Alltoallv PMPI_Alltoallv #define MPI_Alltoallw_f08 PMPI_Alltoallw_f08 -#define MPI_Ialltoallw PMPI_Ialltoallw -#define MPI_Ialltoallw_f08 PMPI_Ialltoallw_f08 -#define MPI_Alltoallw_init PMPI_Alltoallw_init #define MPI_Alltoallw_init_f08 PMPI_Alltoallw_init_f08 -#define MPI_Barrier PMPI_Barrier +#define MPI_Alltoallw_init PMPI_Alltoallw_init +#define MPI_Alltoallw PMPI_Alltoallw #define MPI_Barrier_f08 PMPI_Barrier_f08 -#define MPI_Ibarrier PMPI_Ibarrier -#define MPI_Ibarrier_f08 PMPI_Ibarrier_f08 -#define MPI_Barrier_init PMPI_Barrier_init #define MPI_Barrier_init_f08 PMPI_Barrier_init_f08 -#define MPI_Bcast PMPI_Bcast +#define MPI_Barrier_init PMPI_Barrier_init +#define MPI_Barrier PMPI_Barrier #define MPI_Bcast_f08 PMPI_Bcast_f08 -#define MPI_Ibcast PMPI_Ibcast -#define MPI_Ibcast_f08 PMPI_Ibcast_f08 -#define MPI_Bcast_init PMPI_Bcast_init #define MPI_Bcast_init_f08 PMPI_Bcast_init_f08 -#define MPI_Exscan PMPI_Exscan -#define MPI_Exscan_f08 PMPI_Exscan_f08 -#define MPI_Iexscan PMPI_Iexscan -#define MPI_Iexscan_f08 PMPI_Iexscan_f08 -#define MPI_Exscan_init PMPI_Exscan_init -#define MPI_Exscan_init_f08 PMPI_Exscan_init_f08 -#define MPI_Gather PMPI_Gather -#define MPI_Gather_f08 PMPI_Gather_f08 -#define MPI_Igather PMPI_Igather -#define MPI_Igather_f08 PMPI_Igather_f08 -#define MPI_Gather_init PMPI_Gather_init -#define MPI_Gather_init_f08 PMPI_Gather_init_f08 -#define MPI_Gatherv PMPI_Gatherv -#define MPI_Gatherv_f08 PMPI_Gatherv_f08 -#define MPI_Igatherv PMPI_Igatherv -#define MPI_Igatherv_f08 PMPI_Igatherv_f08 -#define MPI_Gatherv_init PMPI_Gatherv_init -#define MPI_Gatherv_init_f08 PMPI_Gatherv_init_f08 -#define MPI_Op_commutative PMPI_Op_commutative -#define MPI_Op_commutative_f08 PMPI_Op_commutative_f08 -#define MPI_Op_create PMPI_Op_create -#define MPI_Op_create_f08 PMPI_Op_create_f08 -#define MPI_Op_free PMPI_Op_free -#define MPI_Op_free_f08 PMPI_Op_free_f08 -#define MPI_Reduce PMPI_Reduce -#define MPI_Reduce_f08 PMPI_Reduce_f08 -#define MPI_Ireduce PMPI_Ireduce -#define MPI_Ireduce_f08 PMPI_Ireduce_f08 -#define MPI_Reduce_init PMPI_Reduce_init -#define MPI_Reduce_init_f08 PMPI_Reduce_init_f08 -#define MPI_Reduce_local PMPI_Reduce_local -#define MPI_Reduce_local_f08 PMPI_Reduce_local_f08 -#define MPI_Reduce_scatter PMPI_Reduce_scatter -#define MPI_Reduce_scatter_f08 PMPI_Reduce_scatter_f08 -#define MPI_Ireduce_scatter PMPI_Ireduce_scatter -#define MPI_Ireduce_scatter_f08 PMPI_Ireduce_scatter_f08 -#define MPI_Reduce_scatter_init PMPI_Reduce_scatter_init -#define MPI_Reduce_scatter_init_f08 PMPI_Reduce_scatter_init_f08 -#define MPI_Reduce_scatter_block PMPI_Reduce_scatter_block -#define MPI_Reduce_scatter_block_f08 PMPI_Reduce_scatter_block_f08 -#define MPI_Ireduce_scatter_block PMPI_Ireduce_scatter_block -#define MPI_Ireduce_scatter_block_f08 PMPI_Ireduce_scatter_block_f08 -#define MPI_Reduce_scatter_block_init PMPI_Reduce_scatter_block_init -#define MPI_Reduce_scatter_block_init_f08 PMPI_Reduce_scatter_block_init_f08 -#define MPI_Scan PMPI_Scan -#define MPI_Scan_f08 PMPI_Scan_f08 -#define MPI_Iscan PMPI_Iscan -#define MPI_Iscan_f08 PMPI_Iscan_f08 -#define MPI_Scan_init PMPI_Scan_init -#define MPI_Scan_init_f08 PMPI_Scan_init_f08 -#define MPI_Scatter PMPI_Scatter -#define MPI_Scatter_f08 PMPI_Scatter_f08 -#define MPI_Iscatter PMPI_Iscatter -#define MPI_Iscatter_f08 PMPI_Iscatter_f08 -#define MPI_Scatter_init PMPI_Scatter_init -#define MPI_Scatter_init_f08 PMPI_Scatter_init_f08 -#define MPI_Scatterv PMPI_Scatterv -#define MPI_Scatterv_f08 PMPI_Scatterv_f08 -#define MPI_Iscatterv PMPI_Iscatterv -#define MPI_Iscatterv_f08 PMPI_Iscatterv_f08 -#define MPI_Scatterv_init PMPI_Scatterv_init -#define MPI_Scatterv_init_f08 PMPI_Scatterv_init_f08 -#define MPI_Comm_compare PMPI_Comm_compare +#define MPI_Bcast_init PMPI_Bcast_init +#define MPI_Bcast PMPI_Bcast +#define MPI_Bsend_f08 PMPI_Bsend_f08 +#define MPI_Bsend_init_f08 PMPI_Bsend_init_f08 +#define MPI_Bsend_init PMPI_Bsend_init +#define MPI_Bsend PMPI_Bsend +#define MPI_Buffer_attach_f08 PMPI_Buffer_attach_f08 +#define MPI_Buffer_attach PMPI_Buffer_attach +#define MPI_Buffer_detach_f08 PMPI_Buffer_detach_f08 +#define MPI_Buffer_detach PMPI_Buffer_detach +#define MPI_Cancel_f08 PMPI_Cancel_f08 +#define MPI_Cancel PMPI_Cancel +#define MPI_Cart_coords_f08 PMPI_Cart_coords_f08 +#define MPI_Cart_coords PMPI_Cart_coords +#define MPI_Cart_create_f08 PMPI_Cart_create_f08 +#define MPI_Cart_create PMPI_Cart_create +#define MPI_Cartdim_get_f08 PMPI_Cartdim_get_f08 +#define MPI_Cartdim_get PMPI_Cartdim_get +#define MPI_Cart_get_f08 PMPI_Cart_get_f08 +#define MPI_Cart_get PMPI_Cart_get +#define MPI_Cart_map_f08 PMPI_Cart_map_f08 +#define MPI_Cart_map PMPI_Cart_map +#define MPI_Cart_rank_f08 PMPI_Cart_rank_f08 +#define MPI_Cart_rank PMPI_Cart_rank +#define MPI_Cart_shift_f08 PMPI_Cart_shift_f08 +#define MPI_Cart_shift PMPI_Cart_shift +#define MPI_Cart_sub_f08 PMPI_Cart_sub_f08 +#define MPI_Cart_sub PMPI_Cart_sub +#define MPI_Close_port_f08 PMPI_Close_port_f08 +#define MPI_Close_port PMPI_Close_port +#define MPI_Comm_accept_f08 PMPI_Comm_accept_f08 +#define MPI_Comm_accept PMPI_Comm_accept +#define MPI_Comm_call_errhandler_f08 PMPI_Comm_call_errhandler_f08 +#define MPI_Comm_call_errhandler PMPI_Comm_call_errhandler #define MPI_Comm_compare_f08 PMPI_Comm_compare_f08 -#define MPI_Comm_create PMPI_Comm_create +#define MPI_Comm_compare PMPI_Comm_compare +#define MPI_Comm_connect_f08 PMPI_Comm_connect_f08 +#define MPI_Comm_connect PMPI_Comm_connect +#define MPI_Comm_create_errhandler_f08 PMPI_Comm_create_errhandler_f08 +#define MPI_Comm_create_errhandler PMPI_Comm_create_errhandler #define MPI_Comm_create_f08 PMPI_Comm_create_f08 -#define MPI_Comm_create_group PMPI_Comm_create_group -#define MPI_Comm_create_group_f08 PMPI_Comm_create_group_f08 -#define MPI_Comm_create_from_group PMPI_Comm_create_from_group #define MPI_Comm_create_from_group_f08 PMPI_Comm_create_from_group_f08 -#define MPI_Comm_create_keyval PMPI_Comm_create_keyval +#define MPI_Comm_create_from_group PMPI_Comm_create_from_group +#define MPI_Comm_create_group_f08 PMPI_Comm_create_group_f08 +#define MPI_Comm_create_group PMPI_Comm_create_group #define MPI_Comm_create_keyval_f08 PMPI_Comm_create_keyval_f08 -#define MPI_Comm_delete_attr PMPI_Comm_delete_attr +#define MPI_Comm_create_keyval PMPI_Comm_create_keyval +#define MPI_Comm_create PMPI_Comm_create #define MPI_Comm_delete_attr_f08 PMPI_Comm_delete_attr_f08 -#define MPI_Comm_dup PMPI_Comm_dup +#define MPI_Comm_delete_attr PMPI_Comm_delete_attr +#define MPI_Comm_disconnect_f08 PMPI_Comm_disconnect_f08 +#define MPI_Comm_disconnect PMPI_Comm_disconnect #define MPI_Comm_dup_f08 PMPI_Comm_dup_f08 -#define MPI_Comm_dup_with_info PMPI_Comm_dup_with_info +#define MPI_Comm_dup PMPI_Comm_dup #define MPI_Comm_dup_with_info_f08 PMPI_Comm_dup_with_info_f08 -#define MPI_Comm_idup PMPI_Comm_idup -#define MPI_Comm_idup_f08 PMPI_Comm_idup_f08 -#define MPI_Comm_idup_with_info PMPI_Comm_idup_with_info -#define MPI_Comm_idup_with_info_f08 PMPI_Comm_idup_with_info_f08 -#define MPI_Comm_free PMPI_Comm_free +#define MPI_Comm_dup_with_info PMPI_Comm_dup_with_info #define MPI_Comm_free_f08 PMPI_Comm_free_f08 -#define MPI_Comm_free_keyval PMPI_Comm_free_keyval #define MPI_Comm_free_keyval_f08 PMPI_Comm_free_keyval_f08 -#define MPI_Comm_get_attr PMPI_Comm_get_attr +#define MPI_Comm_free_keyval PMPI_Comm_free_keyval +#define MPI_Comm_free PMPI_Comm_free #define MPI_Comm_get_attr_f08 PMPI_Comm_get_attr_f08 -#define MPI_Comm_get_info PMPI_Comm_get_info +#define MPI_Comm_get_attr PMPI_Comm_get_attr +#define MPI_Comm_get_errhandler_f08 PMPI_Comm_get_errhandler_f08 +#define MPI_Comm_get_errhandler PMPI_Comm_get_errhandler #define MPI_Comm_get_info_f08 PMPI_Comm_get_info_f08 -#define MPI_Comm_get_name PMPI_Comm_get_name +#define MPI_Comm_get_info PMPI_Comm_get_info #define MPI_Comm_get_name_f08 PMPI_Comm_get_name_f08 -#define MPI_Comm_group PMPI_Comm_group +#define MPI_Comm_get_name PMPI_Comm_get_name +#define MPI_Comm_get_parent_f08 PMPI_Comm_get_parent_f08 +#define MPI_Comm_get_parent PMPI_Comm_get_parent #define MPI_Comm_group_f08 PMPI_Comm_group_f08 -#define MPI_Comm_rank PMPI_Comm_rank +#define MPI_Comm_group PMPI_Comm_group +#define MPI_Comm_idup_f08 PMPI_Comm_idup_f08 +#define MPI_Comm_idup PMPI_Comm_idup +#define MPI_Comm_idup_with_info_f08 PMPI_Comm_idup_with_info_f08 +#define MPI_Comm_idup_with_info PMPI_Comm_idup_with_info +#define MPI_Comm_join_f08 PMPI_Comm_join_f08 +#define MPI_Comm_join PMPI_Comm_join #define MPI_Comm_rank_f08 PMPI_Comm_rank_f08 -#define MPI_Comm_remote_group PMPI_Comm_remote_group +#define MPI_Comm_rank PMPI_Comm_rank #define MPI_Comm_remote_group_f08 PMPI_Comm_remote_group_f08 -#define MPI_Comm_remote_size PMPI_Comm_remote_size +#define MPI_Comm_remote_group PMPI_Comm_remote_group #define MPI_Comm_remote_size_f08 PMPI_Comm_remote_size_f08 -#define MPI_Comm_set_attr PMPI_Comm_set_attr +#define MPI_Comm_remote_size PMPI_Comm_remote_size #define MPI_Comm_set_attr_f08 PMPI_Comm_set_attr_f08 -#define MPI_Comm_set_info PMPI_Comm_set_info +#define MPI_Comm_set_attr PMPI_Comm_set_attr +#define MPI_Comm_set_errhandler_f08 PMPI_Comm_set_errhandler_f08 +#define MPI_Comm_set_errhandler PMPI_Comm_set_errhandler #define MPI_Comm_set_info_f08 PMPI_Comm_set_info_f08 -#define MPI_Comm_set_name PMPI_Comm_set_name +#define MPI_Comm_set_info PMPI_Comm_set_info #define MPI_Comm_set_name_f08 PMPI_Comm_set_name_f08 -#define MPI_Comm_size PMPI_Comm_size +#define MPI_Comm_set_name PMPI_Comm_set_name #define MPI_Comm_size_f08 PMPI_Comm_size_f08 -#define MPI_Comm_split PMPI_Comm_split +#define MPI_Comm_size PMPI_Comm_size +#define MPI_Comm_spawn_f08 PMPI_Comm_spawn_f08 +#define MPI_Comm_spawn_multiple_f08 PMPI_Comm_spawn_multiple_f08 +#define MPI_Comm_spawn_multiple PMPI_Comm_spawn_multiple +#define MPI_Comm_spawn PMPI_Comm_spawn #define MPI_Comm_split_f08 PMPI_Comm_split_f08 -#define MPI_Comm_test_inter PMPI_Comm_test_inter +#define MPI_Comm_split PMPI_Comm_split +#define MPI_Comm_split_type_f08 PMPI_Comm_split_type_f08 +#define MPI_Comm_split_type PMPI_Comm_split_type #define MPI_Comm_test_inter_f08 PMPI_Comm_test_inter_f08 -#define MPI_Group_compare PMPI_Group_compare -#define MPI_Group_compare_f08 PMPI_Group_compare_f08 -#define MPI_Group_difference PMPI_Group_difference -#define MPI_Group_difference_f08 PMPI_Group_difference_f08 -#define MPI_Group_excl PMPI_Group_excl -#define MPI_Group_excl_f08 PMPI_Group_excl_f08 -#define MPI_Group_from_session_pset PMPI_Group_from_session_pset -#define MPI_Group_from_session_pset_f08 PMPI_Group_from_session_pset_f08 -#define MPI_Group_free PMPI_Group_free -#define MPI_Group_free_f08 PMPI_Group_free_f08 -#define MPI_Group_incl PMPI_Group_incl -#define MPI_Group_incl_f08 PMPI_Group_incl_f08 -#define MPI_Group_intersection PMPI_Group_intersection -#define MPI_Group_intersection_f08 PMPI_Group_intersection_f08 -#define MPI_Group_range_excl PMPI_Group_range_excl -#define MPI_Group_range_excl_f08 PMPI_Group_range_excl_f08 -#define MPI_Group_range_incl PMPI_Group_range_incl -#define MPI_Group_range_incl_f08 PMPI_Group_range_incl_f08 -#define MPI_Group_rank PMPI_Group_rank -#define MPI_Group_rank_f08 PMPI_Group_rank_f08 -#define MPI_Group_size PMPI_Group_size -#define MPI_Group_size_f08 PMPI_Group_size_f08 -#define MPI_Group_translate_ranks PMPI_Group_translate_ranks -#define MPI_Group_translate_ranks_f08 PMPI_Group_translate_ranks_f08 -#define MPI_Group_union PMPI_Group_union -#define MPI_Group_union_f08 PMPI_Group_union_f08 -#define MPI_Intercomm_create PMPI_Intercomm_create -#define MPI_Intercomm_create_f08 PMPI_Intercomm_create_f08 -#define MPI_Intercomm_create_from_groups PMPI_Intercomm_create_from_groups -#define MPI_Intercomm_create_from_groups_f08 PMPI_Intercomm_create_from_groups_f08 -#define MPI_Intercomm_merge PMPI_Intercomm_merge -#define MPI_Intercomm_merge_f08 PMPI_Intercomm_merge_f08 -#define MPI_Type_create_keyval PMPI_Type_create_keyval -#define MPI_Type_create_keyval_f08 PMPI_Type_create_keyval_f08 -#define MPI_Type_delete_attr PMPI_Type_delete_attr -#define MPI_Type_delete_attr_f08 PMPI_Type_delete_attr_f08 -#define MPI_Type_free_keyval PMPI_Type_free_keyval -#define MPI_Type_free_keyval_f08 PMPI_Type_free_keyval_f08 -#define MPI_Type_get_attr PMPI_Type_get_attr -#define MPI_Type_get_attr_f08 PMPI_Type_get_attr_f08 -#define MPI_Type_get_name PMPI_Type_get_name -#define MPI_Type_get_name_f08 PMPI_Type_get_name_f08 -#define MPI_Type_set_attr PMPI_Type_set_attr -#define MPI_Type_set_attr_f08 PMPI_Type_set_attr_f08 -#define MPI_Type_set_name PMPI_Type_set_name -#define MPI_Type_set_name_f08 PMPI_Type_set_name_f08 -#define MPI_Win_allocate PMPI_Win_allocate -#define MPI_Win_allocate_f08 PMPI_Win_allocate_f08 -#define MPI_Win_allocate_shared PMPI_Win_allocate_shared -#define MPI_Win_allocate_shared_f08 PMPI_Win_allocate_shared_f08 -#define MPI_Win_create_keyval PMPI_Win_create_keyval -#define MPI_Win_create_keyval_f08 PMPI_Win_create_keyval_f08 -#define MPI_Win_delete_attr PMPI_Win_delete_attr -#define MPI_Win_delete_attr_f08 PMPI_Win_delete_attr_f08 -#define MPI_Win_free_keyval PMPI_Win_free_keyval -#define MPI_Win_free_keyval_f08 PMPI_Win_free_keyval_f08 -#define MPI_Win_get_attr PMPI_Win_get_attr -#define MPI_Win_get_attr_f08 PMPI_Win_get_attr_f08 -#define MPI_Win_get_info PMPI_Win_get_info -#define MPI_Win_get_info_f08 PMPI_Win_get_info_f08 -#define MPI_Win_get_name PMPI_Win_get_name -#define MPI_Win_get_name_f08 PMPI_Win_get_name_f08 -#define MPI_Win_set_attr PMPI_Win_set_attr -#define MPI_Win_set_attr_f08 PMPI_Win_set_attr_f08 -#define MPI_Win_set_info PMPI_Win_set_info -#define MPI_Win_set_info_f08 PMPI_Win_set_info_f08 -#define MPI_Win_set_name PMPI_Win_set_name -#define MPI_Win_set_name_f08 PMPI_Win_set_name_f08 -#define MPI_Cartdim_get PMPI_Cartdim_get -#define MPI_Cartdim_get_f08 PMPI_Cartdim_get_f08 -#define MPI_Cart_coords PMPI_Cart_coords -#define MPI_Cart_coords_f08 PMPI_Cart_coords_f08 -#define MPI_Cart_create PMPI_Cart_create -#define MPI_Cart_create_f08 PMPI_Cart_create_f08 -#define MPI_Cart_get PMPI_Cart_get -#define MPI_Cart_get_f08 PMPI_Cart_get_f08 -#define MPI_Cart_map PMPI_Cart_map -#define MPI_Cart_map_f08 PMPI_Cart_map_f08 -#define MPI_Cart_rank PMPI_Cart_rank -#define MPI_Cart_rank_f08 PMPI_Cart_rank_f08 -#define MPI_Cart_shift PMPI_Cart_shift -#define MPI_Cart_shift_f08 PMPI_Cart_shift_f08 -#define MPI_Cart_sub PMPI_Cart_sub -#define MPI_Cart_sub_f08 PMPI_Cart_sub_f08 -#define MPI_Dims_create PMPI_Dims_create +#define MPI_Comm_test_inter PMPI_Comm_test_inter +#define MPI_Compare_and_swap_f08 PMPI_Compare_and_swap_f08 +#define MPI_Compare_and_swap PMPI_Compare_and_swap #define MPI_Dims_create_f08 PMPI_Dims_create_f08 -#define MPI_Dist_graph_create PMPI_Dist_graph_create -#define MPI_Dist_graph_create_f08 PMPI_Dist_graph_create_f08 -#define MPI_Dist_graph_create_adjacent PMPI_Dist_graph_create_adjacent +#define MPI_Dims_create PMPI_Dims_create #define MPI_Dist_graph_create_adjacent_f08 PMPI_Dist_graph_create_adjacent_f08 -#define MPI_Dist_graph_neighbors PMPI_Dist_graph_neighbors -#define MPI_Dist_graph_neighbors_f08 PMPI_Dist_graph_neighbors_f08 -#define MPI_Dist_graph_neighbors_count PMPI_Dist_graph_neighbors_count +#define MPI_Dist_graph_create_adjacent PMPI_Dist_graph_create_adjacent +#define MPI_Dist_graph_create_f08 PMPI_Dist_graph_create_f08 +#define MPI_Dist_graph_create PMPI_Dist_graph_create #define MPI_Dist_graph_neighbors_count_f08 PMPI_Dist_graph_neighbors_count_f08 -#define MPI_Graphdims_get PMPI_Graphdims_get -#define MPI_Graphdims_get_f08 PMPI_Graphdims_get_f08 -#define MPI_Graph_create PMPI_Graph_create -#define MPI_Graph_create_f08 PMPI_Graph_create_f08 -#define MPI_Graph_get PMPI_Graph_get -#define MPI_Graph_get_f08 PMPI_Graph_get_f08 -#define MPI_Graph_map PMPI_Graph_map -#define MPI_Graph_map_f08 PMPI_Graph_map_f08 -#define MPI_Graph_neighbors PMPI_Graph_neighbors -#define MPI_Graph_neighbors_f08 PMPI_Graph_neighbors_f08 -#define MPI_Graph_neighbors_count PMPI_Graph_neighbors_count -#define MPI_Graph_neighbors_count_f08 PMPI_Graph_neighbors_count_f08 -#define MPI_Topo_test PMPI_Topo_test -#define MPI_Topo_test_f08 PMPI_Topo_test_f08 -#define MPI_Aint_add PMPI_Aint_add -#define MPI_Aint_add_f08 PMPI_Aint_add_f08 -#define MPI_Aint_diff PMPI_Aint_diff -#define MPI_Aint_diff_f08 PMPI_Aint_diff_f08 -#define MPI_Abort PMPI_Abort -#define MPI_Abort_f08 PMPI_Abort_f08 -#define MPI_Add_error_class PMPI_Add_error_class -#define MPI_Add_error_class_f08 PMPI_Add_error_class_f08 -#define MPI_Add_error_code PMPI_Add_error_code -#define MPI_Add_error_code_f08 PMPI_Add_error_code_f08 -#define MPI_Add_error_string PMPI_Add_error_string -#define MPI_Add_error_string_f08 PMPI_Add_error_string_f08 -#define MPI_Alloc_mem PMPI_Alloc_mem -#define MPI_Alloc_mem_f08 PMPI_Alloc_mem_f08 -#define MPI_Comm_call_errhandler PMPI_Comm_call_errhandler -#define MPI_Comm_call_errhandler_f08 PMPI_Comm_call_errhandler_f08 -#define MPI_Comm_create_errhandler PMPI_Comm_create_errhandler -#define MPI_Comm_create_errhandler_f08 PMPI_Comm_create_errhandler_f08 -#define MPI_Comm_get_errhandler PMPI_Comm_get_errhandler -#define MPI_Comm_get_errhandler_f08 PMPI_Comm_get_errhandler_f08 -#define MPI_Comm_set_errhandler PMPI_Comm_set_errhandler -#define MPI_Comm_set_errhandler_f08 PMPI_Comm_set_errhandler_f08 -#define MPI_Errhandler_free PMPI_Errhandler_free +#define MPI_Dist_graph_neighbors_count PMPI_Dist_graph_neighbors_count +#define MPI_Dist_graph_neighbors_f08 PMPI_Dist_graph_neighbors_f08 +#define MPI_Dist_graph_neighbors PMPI_Dist_graph_neighbors #define MPI_Errhandler_free_f08 PMPI_Errhandler_free_f08 -#define MPI_Error_class PMPI_Error_class +#define MPI_Errhandler_free PMPI_Errhandler_free #define MPI_Error_class_f08 PMPI_Error_class_f08 -#define MPI_Error_string PMPI_Error_string +#define MPI_Error_class PMPI_Error_class #define MPI_Error_string_f08 PMPI_Error_string_f08 -#define MPI_File_call_errhandler PMPI_File_call_errhandler -#define MPI_File_call_errhandler_f08 PMPI_File_call_errhandler_f08 -#define MPI_File_create_errhandler PMPI_File_create_errhandler -#define MPI_File_create_errhandler_f08 PMPI_File_create_errhandler_f08 -#define MPI_File_get_errhandler PMPI_File_get_errhandler -#define MPI_File_get_errhandler_f08 PMPI_File_get_errhandler_f08 -#define MPI_File_set_errhandler PMPI_File_set_errhandler -#define MPI_File_set_errhandler_f08 PMPI_File_set_errhandler_f08 -#define MPI_Finalize PMPI_Finalize -#define MPI_Finalize_f08 PMPI_Finalize_f08 -#define MPI_Finalized PMPI_Finalized -#define MPI_Finalized_f08 PMPI_Finalized_f08 -#define MPI_Free_mem PMPI_Free_mem -#define MPI_Free_mem_f08 PMPI_Free_mem_f08 -#define MPI_Get_processor_name PMPI_Get_processor_name -#define MPI_Get_processor_name_f08 PMPI_Get_processor_name_f08 -#define MPI_Get_version PMPI_Get_version -#define MPI_Get_version_f08 PMPI_Get_version_f08 -#define MPI_Init PMPI_Init -#define MPI_Init_f08 PMPI_Init_f08 -#define MPI_Initialized PMPI_Initialized -#define MPI_Initialized_f08 PMPI_Initialized_f08 -#define MPI_Win_call_errhandler PMPI_Win_call_errhandler -#define MPI_Win_call_errhandler_f08 PMPI_Win_call_errhandler_f08 -#define MPI_Win_create_errhandler PMPI_Win_create_errhandler -#define MPI_Win_create_errhandler_f08 PMPI_Win_create_errhandler_f08 -#define MPI_Win_get_errhandler PMPI_Win_get_errhandler -#define MPI_Win_get_errhandler_f08 PMPI_Win_get_errhandler_f08 -#define MPI_Win_set_errhandler PMPI_Win_set_errhandler -#define MPI_Win_set_errhandler_f08 PMPI_Win_set_errhandler_f08 -#define MPI_Info_create PMPI_Info_create -#define MPI_Info_create_f08 PMPI_Info_create_f08 -#define MPI_Info_create_env PMPI_Info_create_env -#define MPI_Info_create_env_f08 PMPI_Info_create_env_f08 -#define MPI_Info_delete PMPI_Info_delete -#define MPI_Info_delete_f08 PMPI_Info_delete_f08 -#define MPI_Info_dup PMPI_Info_dup -#define MPI_Info_dup_f08 PMPI_Info_dup_f08 -#define MPI_Info_free PMPI_Info_free -#define MPI_Info_free_f08 PMPI_Info_free_f08 -#define MPI_Info_get PMPI_Info_get -#define MPI_Info_get_f08 PMPI_Info_get_f08 -#define MPI_Info_get_nkeys PMPI_Info_get_nkeys -#define MPI_Info_get_nkeys_f08 PMPI_Info_get_nkeys_f08 -#define MPI_Info_get_nthkey PMPI_Info_get_nthkey -#define MPI_Info_get_nthkey_f08 PMPI_Info_get_nthkey_f08 -#define MPI_Info_get_string PMPI_Info_get_string -#define MPI_Info_get_string_f08 PMPI_Info_get_string_f08 -#define MPI_Info_get_valuelen PMPI_Info_get_valuelen -#define MPI_Info_get_valuelen_f08 PMPI_Info_get_valuelen_f08 -#define MPI_Info_set PMPI_Info_set -#define MPI_Info_set_f08 PMPI_Info_set_f08 -#define MPI_Close_port PMPI_Close_port -#define MPI_Close_port_f08 PMPI_Close_port_f08 -#define MPI_Comm_accept PMPI_Comm_accept -#define MPI_Comm_accept_f08 PMPI_Comm_accept_f08 -#define MPI_Comm_connect PMPI_Comm_connect -#define MPI_Comm_connect_f08 PMPI_Comm_connect_f08 -#define MPI_Comm_disconnect PMPI_Comm_disconnect -#define MPI_Comm_disconnect_f08 PMPI_Comm_disconnect_f08 -#define MPI_Comm_get_parent PMPI_Comm_get_parent -#define MPI_Comm_get_parent_f08 PMPI_Comm_get_parent_f08 -#define MPI_Comm_join PMPI_Comm_join -#define MPI_Comm_join_f08 PMPI_Comm_join_f08 -#define MPI_Comm_spawn PMPI_Comm_spawn -#define MPI_Comm_spawn_f08 PMPI_Comm_spawn_f08 -#define MPI_Comm_spawn_multiple PMPI_Comm_spawn_multiple -#define MPI_Comm_spawn_multiple_f08 PMPI_Comm_spawn_multiple_f08 -#define MPI_Lookup_name PMPI_Lookup_name -#define MPI_Lookup_name_f08 PMPI_Lookup_name_f08 -#define MPI_Open_port PMPI_Open_port -#define MPI_Open_port_f08 PMPI_Open_port_f08 -#define MPI_Publish_name PMPI_Publish_name -#define MPI_Publish_name_f08 PMPI_Publish_name_f08 -#define MPI_Unpublish_name PMPI_Unpublish_name -#define MPI_Unpublish_name_f08 PMPI_Unpublish_name_f08 -#define MPI_Accumulate PMPI_Accumulate -#define MPI_Accumulate_f08 PMPI_Accumulate_f08 -#define MPI_Raccumulate PMPI_Raccumulate -#define MPI_Raccumulate_f08 PMPI_Raccumulate_f08 -#define MPI_Get PMPI_Get -#define MPI_Get_f08 PMPI_Get_f08 -#define MPI_Rget PMPI_Rget -#define MPI_Rget_f08 PMPI_Rget_f08 -#define MPI_Get_accumulate PMPI_Get_accumulate -#define MPI_Get_accumulate_f08 PMPI_Get_accumulate_f08 -#define MPI_Rget_accumulate PMPI_Rget_accumulate -#define MPI_Rget_accumulate_f08 PMPI_Rget_accumulate_f08 -#define MPI_Put PMPI_Put -#define MPI_Put_f08 PMPI_Put_f08 -#define MPI_Rput PMPI_Rput -#define MPI_Rput_f08 PMPI_Rput_f08 -#define MPI_Fetch_and_op PMPI_Fetch_and_op +#define MPI_Error_string PMPI_Error_string +#define MPI_Exscan_f08 PMPI_Exscan_f08 +#define MPI_Exscan_init_f08 PMPI_Exscan_init_f08 +#define MPI_Exscan_init PMPI_Exscan_init +#define MPI_Exscan PMPI_Exscan #define MPI_Fetch_and_op_f08 PMPI_Fetch_and_op_f08 -#define MPI_Compare_and_swap PMPI_Compare_and_swap -#define MPI_Compare_and_swap_f08 PMPI_Compare_and_swap_f08 -#define MPI_Win_complete PMPI_Win_complete -#define MPI_Win_complete_f08 PMPI_Win_complete_f08 -#define MPI_Win_create PMPI_Win_create -#define MPI_Win_create_f08 PMPI_Win_create_f08 -#define MPI_Win_create_dynamic PMPI_Win_create_dynamic -#define MPI_Win_create_dynamic_f08 PMPI_Win_create_dynamic_f08 -#define MPI_Win_attach PMPI_Win_attach -#define MPI_Win_attach_f08 PMPI_Win_attach_f08 -#define MPI_Win_detach PMPI_Win_detach -#define MPI_Win_detach_f08 PMPI_Win_detach_f08 -#define MPI_Win_fence PMPI_Win_fence -#define MPI_Win_fence_f08 PMPI_Win_fence_f08 -#define MPI_Win_free PMPI_Win_free -#define MPI_Win_free_f08 PMPI_Win_free_f08 -#define MPI_Win_get_group PMPI_Win_get_group -#define MPI_Win_get_group_f08 PMPI_Win_get_group_f08 -#define MPI_Win_lock PMPI_Win_lock -#define MPI_Win_lock_f08 PMPI_Win_lock_f08 -#define MPI_Win_lock_all PMPI_Win_lock_all -#define MPI_Win_lock_all_f08 PMPI_Win_lock_all_f08 -#define MPI_Win_post PMPI_Win_post -#define MPI_Win_post_f08 PMPI_Win_post_f08 -#define MPI_Win_shared_query PMPI_Win_shared_query -#define MPI_Win_shared_query_f08 PMPI_Win_shared_query_f08 -#define MPI_Win_start PMPI_Win_start -#define MPI_Win_start_f08 PMPI_Win_start_f08 -#define MPI_Win_sync PMPI_Win_sync -#define MPI_Win_sync_f08 PMPI_Win_sync_f08 -#define MPI_Win_test PMPI_Win_test -#define MPI_Win_test_f08 PMPI_Win_test_f08 -#define MPI_Win_unlock PMPI_Win_unlock -#define MPI_Win_unlock_f08 PMPI_Win_unlock_f08 -#define MPI_Win_unlock_all PMPI_Win_unlock_all -#define MPI_Win_unlock_all_f08 PMPI_Win_unlock_all_f08 -#define MPI_Win_wait PMPI_Win_wait -#define MPI_Win_wait_f08 PMPI_Win_wait_f08 -#define MPI_Win_flush PMPI_Win_flush -#define MPI_Win_flush_f08 PMPI_Win_flush_f08 -#define MPI_Win_flush_local PMPI_Win_flush_local -#define MPI_Win_flush_local_f08 PMPI_Win_flush_local_f08 -#define MPI_Win_flush_local_all PMPI_Win_flush_local_all -#define MPI_Win_flush_local_all_f08 PMPI_Win_flush_local_all_f08 -#define MPI_Win_flush_all PMPI_Win_flush_all -#define MPI_Win_flush_all_f08 PMPI_Win_flush_all_f08 -#define MPI_Grequest_complete PMPI_Grequest_complete -#define MPI_Grequest_complete_f08 PMPI_Grequest_complete_f08 -#define MPI_Grequest_start PMPI_Grequest_start -#define MPI_Grequest_start_f08 PMPI_Grequest_start_f08 -#define MPI_Init_thread PMPI_Init_thread -#define MPI_Init_thread_f08 PMPI_Init_thread_f08 -#define MPI_Is_thread_main PMPI_Is_thread_main -#define MPI_Is_thread_main_f08 PMPI_Is_thread_main_f08 -#define MPI_Query_thread PMPI_Query_thread -#define MPI_Query_thread_f08 PMPI_Query_thread_f08 -#define MPI_Status_f082f PMPI_Status_f082f -#define MPI_Status_f082f_f08 PMPI_Status_f082f_f08 -#define MPI_Status_f2f08 PMPI_Status_f2f08 -#define MPI_Status_f2f08_f08 PMPI_Status_f2f08_f08 -#define MPI_Status_set_cancelled PMPI_Status_set_cancelled -#define MPI_Status_set_cancelled_f08 PMPI_Status_set_cancelled_f08 -#define MPI_Status_set_elements PMPI_Status_set_elements -#define MPI_Status_set_elements_f08 PMPI_Status_set_elements_f08 -#define MPI_Status_set_elements_x PMPI_Status_set_elements_x -#define MPI_Status_set_elements_x_f08 PMPI_Status_set_elements_x_f08 -#define MPI_File_close PMPI_File_close +#define MPI_Fetch_and_op PMPI_Fetch_and_op +#define MPI_File_call_errhandler_f08 PMPI_File_call_errhandler_f08 +#define MPI_File_call_errhandler PMPI_File_call_errhandler #define MPI_File_close_f08 PMPI_File_close_f08 -#define MPI_File_delete PMPI_File_delete +#define MPI_File_close PMPI_File_close +#define MPI_File_create_errhandler_f08 PMPI_File_create_errhandler_f08 +#define MPI_File_create_errhandler PMPI_File_create_errhandler #define MPI_File_delete_f08 PMPI_File_delete_f08 -#define MPI_File_get_amode PMPI_File_get_amode +#define MPI_File_delete PMPI_File_delete #define MPI_File_get_amode_f08 PMPI_File_get_amode_f08 -#define MPI_File_get_atomicity PMPI_File_get_atomicity +#define MPI_File_get_amode PMPI_File_get_amode #define MPI_File_get_atomicity_f08 PMPI_File_get_atomicity_f08 -#define MPI_File_get_byte_offset PMPI_File_get_byte_offset +#define MPI_File_get_atomicity PMPI_File_get_atomicity #define MPI_File_get_byte_offset_f08 PMPI_File_get_byte_offset_f08 -#define MPI_File_get_group PMPI_File_get_group +#define MPI_File_get_byte_offset PMPI_File_get_byte_offset +#define MPI_File_get_errhandler_f08 PMPI_File_get_errhandler_f08 +#define MPI_File_get_errhandler PMPI_File_get_errhandler #define MPI_File_get_group_f08 PMPI_File_get_group_f08 -#define MPI_File_get_info PMPI_File_get_info +#define MPI_File_get_group PMPI_File_get_group #define MPI_File_get_info_f08 PMPI_File_get_info_f08 -#define MPI_File_get_position PMPI_File_get_position +#define MPI_File_get_info PMPI_File_get_info #define MPI_File_get_position_f08 PMPI_File_get_position_f08 -#define MPI_File_get_position_shared PMPI_File_get_position_shared +#define MPI_File_get_position PMPI_File_get_position #define MPI_File_get_position_shared_f08 PMPI_File_get_position_shared_f08 -#define MPI_File_get_size PMPI_File_get_size +#define MPI_File_get_position_shared PMPI_File_get_position_shared #define MPI_File_get_size_f08 PMPI_File_get_size_f08 -#define MPI_File_get_type_extent PMPI_File_get_type_extent +#define MPI_File_get_size PMPI_File_get_size #define MPI_File_get_type_extent_f08 PMPI_File_get_type_extent_f08 -#define MPI_File_get_view PMPI_File_get_view +#define MPI_File_get_type_extent PMPI_File_get_type_extent #define MPI_File_get_view_f08 PMPI_File_get_view_f08 -#define MPI_File_iread PMPI_File_iread -#define MPI_File_iread_f08 PMPI_File_iread_f08 -#define MPI_File_iread_at PMPI_File_iread_at -#define MPI_File_iread_at_f08 PMPI_File_iread_at_f08 -#define MPI_File_iread_all PMPI_File_iread_all +#define MPI_File_get_view PMPI_File_get_view #define MPI_File_iread_all_f08 PMPI_File_iread_all_f08 -#define MPI_File_iread_at_all PMPI_File_iread_at_all +#define MPI_File_iread_all PMPI_File_iread_all #define MPI_File_iread_at_all_f08 PMPI_File_iread_at_all_f08 -#define MPI_File_iread_shared PMPI_File_iread_shared +#define MPI_File_iread_at_all PMPI_File_iread_at_all +#define MPI_File_iread_at_f08 PMPI_File_iread_at_f08 +#define MPI_File_iread_at PMPI_File_iread_at +#define MPI_File_iread_f08 PMPI_File_iread_f08 +#define MPI_File_iread PMPI_File_iread #define MPI_File_iread_shared_f08 PMPI_File_iread_shared_f08 -#define MPI_File_iwrite PMPI_File_iwrite -#define MPI_File_iwrite_f08 PMPI_File_iwrite_f08 -#define MPI_File_iwrite_at PMPI_File_iwrite_at -#define MPI_File_iwrite_at_f08 PMPI_File_iwrite_at_f08 -#define MPI_File_iwrite_all PMPI_File_iwrite_all +#define MPI_File_iread_shared PMPI_File_iread_shared #define MPI_File_iwrite_all_f08 PMPI_File_iwrite_all_f08 -#define MPI_File_iwrite_at_all PMPI_File_iwrite_at_all +#define MPI_File_iwrite_all PMPI_File_iwrite_all #define MPI_File_iwrite_at_all_f08 PMPI_File_iwrite_at_all_f08 -#define MPI_File_iwrite_shared PMPI_File_iwrite_shared -#define MPI_File_iwrite_shared_f08 PMPI_File_iwrite_shared_f08 -#define MPI_File_open PMPI_File_open -#define MPI_File_open_f08 PMPI_File_open_f08 -#define MPI_File_preallocate PMPI_File_preallocate +#define MPI_File_iwrite_at_all PMPI_File_iwrite_at_all +#define MPI_File_iwrite_at_f08 PMPI_File_iwrite_at_f08 +#define MPI_File_iwrite_at PMPI_File_iwrite_at +#define MPI_File_iwrite_f08 PMPI_File_iwrite_f08 +#define MPI_File_iwrite PMPI_File_iwrite +#define MPI_File_iwrite_shared_f08 PMPI_File_iwrite_shared_f08 +#define MPI_File_iwrite_shared PMPI_File_iwrite_shared +#define MPI_File_open_f08 PMPI_File_open_f08 +#define MPI_File_open PMPI_File_open #define MPI_File_preallocate_f08 PMPI_File_preallocate_f08 -#define MPI_File_read PMPI_File_read -#define MPI_File_read_f08 PMPI_File_read_f08 -#define MPI_File_read_all PMPI_File_read_all -#define MPI_File_read_all_f08 PMPI_File_read_all_f08 -#define MPI_File_read_all_begin PMPI_File_read_all_begin +#define MPI_File_preallocate PMPI_File_preallocate #define MPI_File_read_all_begin_f08 PMPI_File_read_all_begin_f08 -#define MPI_File_read_all_end PMPI_File_read_all_end +#define MPI_File_read_all_begin PMPI_File_read_all_begin #define MPI_File_read_all_end_f08 PMPI_File_read_all_end_f08 -#define MPI_File_read_at PMPI_File_read_at -#define MPI_File_read_at_f08 PMPI_File_read_at_f08 -#define MPI_File_read_at_all PMPI_File_read_at_all -#define MPI_File_read_at_all_f08 PMPI_File_read_at_all_f08 -#define MPI_File_read_at_all_begin PMPI_File_read_at_all_begin +#define MPI_File_read_all_end PMPI_File_read_all_end +#define MPI_File_read_all_f08 PMPI_File_read_all_f08 +#define MPI_File_read_all PMPI_File_read_all #define MPI_File_read_at_all_begin_f08 PMPI_File_read_at_all_begin_f08 -#define MPI_File_read_at_all_end PMPI_File_read_at_all_end +#define MPI_File_read_at_all_begin PMPI_File_read_at_all_begin #define MPI_File_read_at_all_end_f08 PMPI_File_read_at_all_end_f08 -#define MPI_File_read_ordered PMPI_File_read_ordered -#define MPI_File_read_ordered_f08 PMPI_File_read_ordered_f08 -#define MPI_File_read_ordered_begin PMPI_File_read_ordered_begin +#define MPI_File_read_at_all_end PMPI_File_read_at_all_end +#define MPI_File_read_at_all_f08 PMPI_File_read_at_all_f08 +#define MPI_File_read_at_all PMPI_File_read_at_all +#define MPI_File_read_at_f08 PMPI_File_read_at_f08 +#define MPI_File_read_at PMPI_File_read_at +#define MPI_File_read_f08 PMPI_File_read_f08 #define MPI_File_read_ordered_begin_f08 PMPI_File_read_ordered_begin_f08 -#define MPI_File_read_ordered_end PMPI_File_read_ordered_end +#define MPI_File_read_ordered_begin PMPI_File_read_ordered_begin #define MPI_File_read_ordered_end_f08 PMPI_File_read_ordered_end_f08 -#define MPI_File_read_shared PMPI_File_read_shared +#define MPI_File_read_ordered_end PMPI_File_read_ordered_end +#define MPI_File_read_ordered_f08 PMPI_File_read_ordered_f08 +#define MPI_File_read_ordered PMPI_File_read_ordered +#define MPI_File_read PMPI_File_read #define MPI_File_read_shared_f08 PMPI_File_read_shared_f08 -#define MPI_File_seek PMPI_File_seek +#define MPI_File_read_shared PMPI_File_read_shared #define MPI_File_seek_f08 PMPI_File_seek_f08 -#define MPI_File_seek_shared PMPI_File_seek_shared +#define MPI_File_seek PMPI_File_seek #define MPI_File_seek_shared_f08 PMPI_File_seek_shared_f08 -#define MPI_File_set_atomicity PMPI_File_set_atomicity +#define MPI_File_seek_shared PMPI_File_seek_shared #define MPI_File_set_atomicity_f08 PMPI_File_set_atomicity_f08 -#define MPI_File_set_info PMPI_File_set_info +#define MPI_File_set_atomicity PMPI_File_set_atomicity +#define MPI_File_set_errhandler_f08 PMPI_File_set_errhandler_f08 +#define MPI_File_set_errhandler PMPI_File_set_errhandler #define MPI_File_set_info_f08 PMPI_File_set_info_f08 -#define MPI_File_set_size PMPI_File_set_size +#define MPI_File_set_info PMPI_File_set_info #define MPI_File_set_size_f08 PMPI_File_set_size_f08 -#define MPI_File_set_view PMPI_File_set_view +#define MPI_File_set_size PMPI_File_set_size #define MPI_File_set_view_f08 PMPI_File_set_view_f08 -#define MPI_File_sync PMPI_File_sync +#define MPI_File_set_view PMPI_File_set_view #define MPI_File_sync_f08 PMPI_File_sync_f08 -#define MPI_File_write PMPI_File_write -#define MPI_File_write_f08 PMPI_File_write_f08 -#define MPI_File_write_all PMPI_File_write_all -#define MPI_File_write_all_f08 PMPI_File_write_all_f08 -#define MPI_File_write_all_begin PMPI_File_write_all_begin +#define MPI_File_sync PMPI_File_sync #define MPI_File_write_all_begin_f08 PMPI_File_write_all_begin_f08 -#define MPI_File_write_all_end PMPI_File_write_all_end +#define MPI_File_write_all_begin PMPI_File_write_all_begin #define MPI_File_write_all_end_f08 PMPI_File_write_all_end_f08 -#define MPI_File_write_at PMPI_File_write_at -#define MPI_File_write_at_f08 PMPI_File_write_at_f08 -#define MPI_File_write_at_all PMPI_File_write_at_all -#define MPI_File_write_at_all_f08 PMPI_File_write_at_all_f08 -#define MPI_File_write_at_all_begin PMPI_File_write_at_all_begin +#define MPI_File_write_all_end PMPI_File_write_all_end +#define MPI_File_write_all_f08 PMPI_File_write_all_f08 +#define MPI_File_write_all PMPI_File_write_all #define MPI_File_write_at_all_begin_f08 PMPI_File_write_at_all_begin_f08 -#define MPI_File_write_at_all_end PMPI_File_write_at_all_end +#define MPI_File_write_at_all_begin PMPI_File_write_at_all_begin #define MPI_File_write_at_all_end_f08 PMPI_File_write_at_all_end_f08 -#define MPI_File_write_ordered PMPI_File_write_ordered -#define MPI_File_write_ordered_f08 PMPI_File_write_ordered_f08 -#define MPI_File_write_ordered_begin PMPI_File_write_ordered_begin +#define MPI_File_write_at_all_end PMPI_File_write_at_all_end +#define MPI_File_write_at_all_f08 PMPI_File_write_at_all_f08 +#define MPI_File_write_at_all PMPI_File_write_at_all +#define MPI_File_write_at_f08 PMPI_File_write_at_f08 +#define MPI_File_write_at PMPI_File_write_at +#define MPI_File_write_f08 PMPI_File_write_f08 #define MPI_File_write_ordered_begin_f08 PMPI_File_write_ordered_begin_f08 -#define MPI_File_write_ordered_end PMPI_File_write_ordered_end +#define MPI_File_write_ordered_begin PMPI_File_write_ordered_begin #define MPI_File_write_ordered_end_f08 PMPI_File_write_ordered_end_f08 -#define MPI_File_write_shared PMPI_File_write_shared +#define MPI_File_write_ordered_end PMPI_File_write_ordered_end +#define MPI_File_write_ordered_f08 PMPI_File_write_ordered_f08 +#define MPI_File_write_ordered PMPI_File_write_ordered +#define MPI_File_write PMPI_File_write #define MPI_File_write_shared_f08 PMPI_File_write_shared_f08 -#define MPI_Register_datarep PMPI_Register_datarep -#define MPI_Register_datarep_f08 PMPI_Register_datarep_f08 -#define MPI_Type_create_f90_complex PMPI_Type_create_f90_complex -#define MPI_Type_create_f90_complex_f08 PMPI_Type_create_f90_complex_f08 -#define MPI_Type_create_f90_integer PMPI_Type_create_f90_integer -#define MPI_Type_create_f90_integer_f08 PMPI_Type_create_f90_integer_f08 -#define MPI_Type_create_f90_real PMPI_Type_create_f90_real -#define MPI_Type_create_f90_real_f08 PMPI_Type_create_f90_real_f08 -#define MPI_Type_match_size PMPI_Type_match_size -#define MPI_Type_match_size_f08 PMPI_Type_match_size_f08 -#define MPI_Pcontrol PMPI_Pcontrol -#define MPI_Pcontrol_f08 PMPI_Pcontrol_f08 -#define MPI_Comm_split_type PMPI_Comm_split_type -#define MPI_Comm_split_type_f08 PMPI_Comm_split_type_f08 -#define MPI_F_sync_reg PMPI_F_sync_reg +#define MPI_File_write_shared PMPI_File_write_shared +#define MPI_Finalized_f08 PMPI_Finalized_f08 +#define MPI_Finalized PMPI_Finalized +#define MPI_Finalize_f08 PMPI_Finalize_f08 +#define MPI_Finalize PMPI_Finalize +#define MPI_Free_mem_f08 PMPI_Free_mem_f08 +#define MPI_Free_mem PMPI_Free_mem #define MPI_F_sync_reg_f08 PMPI_F_sync_reg_f08 -#define MPI_Get_library_version PMPI_Get_library_version +#define MPI_F_sync_reg PMPI_F_sync_reg +#define MPI_Gather_f08 PMPI_Gather_f08 +#define MPI_Gather_init_f08 PMPI_Gather_init_f08 +#define MPI_Gather_init PMPI_Gather_init +#define MPI_Gather PMPI_Gather +#define MPI_Gatherv_f08 PMPI_Gatherv_f08 +#define MPI_Gatherv_init_f08 PMPI_Gatherv_init_f08 +#define MPI_Gatherv_init PMPI_Gatherv_init +#define MPI_Gatherv PMPI_Gatherv +#define MPI_Get_accumulate_f08 PMPI_Get_accumulate_f08 +#define MPI_Get_accumulate PMPI_Get_accumulate +#define MPI_Get_address_f08 PMPI_Get_address_f08 +#define MPI_Get_address PMPI_Get_address +#define MPI_Get_count_f08 PMPI_Get_count_f08 +#define MPI_Get_count PMPI_Get_count +#define MPI_Get_elements_f08 PMPI_Get_elements_f08 +#define MPI_Get_elements PMPI_Get_elements +#define MPI_Get_elements_x_f08 PMPI_Get_elements_x_f08 +#define MPI_Get_elements_x PMPI_Get_elements_x +#define MPI_Get_f08 PMPI_Get_f08 #define MPI_Get_library_version_f08 PMPI_Get_library_version_f08 -#define MPI_Mprobe PMPI_Mprobe -#define MPI_Mprobe_f08 PMPI_Mprobe_f08 -#define MPI_Improbe PMPI_Improbe +#define MPI_Get_library_version PMPI_Get_library_version +#define MPI_Get PMPI_Get +#define MPI_Get_processor_name_f08 PMPI_Get_processor_name_f08 +#define MPI_Get_processor_name PMPI_Get_processor_name +#define MPI_Get_version_f08 PMPI_Get_version_f08 +#define MPI_Get_version PMPI_Get_version +#define MPI_Graph_create_f08 PMPI_Graph_create_f08 +#define MPI_Graph_create PMPI_Graph_create +#define MPI_Graphdims_get_f08 PMPI_Graphdims_get_f08 +#define MPI_Graphdims_get PMPI_Graphdims_get +#define MPI_Graph_get_f08 PMPI_Graph_get_f08 +#define MPI_Graph_get PMPI_Graph_get +#define MPI_Graph_map_f08 PMPI_Graph_map_f08 +#define MPI_Graph_map PMPI_Graph_map +#define MPI_Graph_neighbors_count_f08 PMPI_Graph_neighbors_count_f08 +#define MPI_Graph_neighbors_count PMPI_Graph_neighbors_count +#define MPI_Graph_neighbors_f08 PMPI_Graph_neighbors_f08 +#define MPI_Graph_neighbors PMPI_Graph_neighbors +#define MPI_Grequest_complete_f08 PMPI_Grequest_complete_f08 +#define MPI_Grequest_complete PMPI_Grequest_complete +#define MPI_Grequest_start_f08 PMPI_Grequest_start_f08 +#define MPI_Grequest_start PMPI_Grequest_start +#define MPI_Group_compare_f08 PMPI_Group_compare_f08 +#define MPI_Group_compare PMPI_Group_compare +#define MPI_Group_difference_f08 PMPI_Group_difference_f08 +#define MPI_Group_difference PMPI_Group_difference +#define MPI_Group_excl_f08 PMPI_Group_excl_f08 +#define MPI_Group_excl PMPI_Group_excl +#define MPI_Group_free_f08 PMPI_Group_free_f08 +#define MPI_Group_free PMPI_Group_free +#define MPI_Group_from_session_pset_f08 PMPI_Group_from_session_pset_f08 +#define MPI_Group_from_session_pset PMPI_Group_from_session_pset +#define MPI_Group_incl_f08 PMPI_Group_incl_f08 +#define MPI_Group_incl PMPI_Group_incl +#define MPI_Group_intersection_f08 PMPI_Group_intersection_f08 +#define MPI_Group_intersection PMPI_Group_intersection +#define MPI_Group_range_excl_f08 PMPI_Group_range_excl_f08 +#define MPI_Group_range_excl PMPI_Group_range_excl +#define MPI_Group_range_incl_f08 PMPI_Group_range_incl_f08 +#define MPI_Group_range_incl PMPI_Group_range_incl +#define MPI_Group_rank_f08 PMPI_Group_rank_f08 +#define MPI_Group_rank PMPI_Group_rank +#define MPI_Group_size_f08 PMPI_Group_size_f08 +#define MPI_Group_size PMPI_Group_size +#define MPI_Group_translate_ranks_f08 PMPI_Group_translate_ranks_f08 +#define MPI_Group_translate_ranks PMPI_Group_translate_ranks +#define MPI_Group_union_f08 PMPI_Group_union_f08 +#define MPI_Group_union PMPI_Group_union +#define MPI_Iallgather_f08 PMPI_Iallgather_f08 +#define MPI_Iallgather PMPI_Iallgather +#define MPI_Iallgatherv_f08 PMPI_Iallgatherv_f08 +#define MPI_Iallgatherv PMPI_Iallgatherv +#define MPI_Iallreduce_f08 PMPI_Iallreduce_f08 +#define MPI_Iallreduce PMPI_Iallreduce +#define MPI_Ialltoall_f08 PMPI_Ialltoall_f08 +#define MPI_Ialltoall PMPI_Ialltoall +#define MPI_Ialltoallv_f08 PMPI_Ialltoallv_f08 +#define MPI_Ialltoallv PMPI_Ialltoallv +#define MPI_Ialltoallw_f08 PMPI_Ialltoallw_f08 +#define MPI_Ialltoallw PMPI_Ialltoallw +#define MPI_Ibarrier_f08 PMPI_Ibarrier_f08 +#define MPI_Ibarrier PMPI_Ibarrier +#define MPI_Ibcast_f08 PMPI_Ibcast_f08 +#define MPI_Ibcast PMPI_Ibcast +#define MPI_Ibsend_f08 PMPI_Ibsend_f08 +#define MPI_Ibsend PMPI_Ibsend +#define MPI_Iexscan_f08 PMPI_Iexscan_f08 +#define MPI_Iexscan PMPI_Iexscan +#define MPI_Igather_f08 PMPI_Igather_f08 +#define MPI_Igather PMPI_Igather +#define MPI_Igatherv_f08 PMPI_Igatherv_f08 +#define MPI_Igatherv PMPI_Igatherv #define MPI_Improbe_f08 PMPI_Improbe_f08 -#define MPI_Imrecv PMPI_Imrecv +#define MPI_Improbe PMPI_Improbe #define MPI_Imrecv_f08 PMPI_Imrecv_f08 -#define MPI_Mrecv PMPI_Mrecv -#define MPI_Mrecv_f08 PMPI_Mrecv_f08 -#define MPI_Neighbor_allgather PMPI_Neighbor_allgather -#define MPI_Neighbor_allgather_f08 PMPI_Neighbor_allgather_f08 -#define MPI_Ineighbor_allgather PMPI_Ineighbor_allgather +#define MPI_Imrecv PMPI_Imrecv #define MPI_Ineighbor_allgather_f08 PMPI_Ineighbor_allgather_f08 -#define MPI_Neighbor_allgather_init PMPI_Neighbor_allgather_init -#define MPI_Neighbor_allgather_init_f08 PMPI_Neighbor_allgather_init_f08 -#define MPI_Neighbor_allgatherv PMPI_Neighbor_allgatherv -#define MPI_Neighbor_allgatherv_f08 PMPI_Neighbor_allgatherv_f08 -#define MPI_Ineighbor_allgatherv PMPI_Ineighbor_allgatherv +#define MPI_Ineighbor_allgather PMPI_Ineighbor_allgather #define MPI_Ineighbor_allgatherv_f08 PMPI_Ineighbor_allgatherv_f08 -#define MPI_Neighbor_allgatherv_init PMPI_Neighbor_allgatherv_init -#define MPI_Neighbor_allgatherv_init_f08 PMPI_Neighbor_allgatherv_init_f08 -#define MPI_Neighbor_alltoall PMPI_Neighbor_alltoall -#define MPI_Neighbor_alltoall_f08 PMPI_Neighbor_alltoall_f08 -#define MPI_Ineighbor_alltoall PMPI_Ineighbor_alltoall +#define MPI_Ineighbor_allgatherv PMPI_Ineighbor_allgatherv #define MPI_Ineighbor_alltoall_f08 PMPI_Ineighbor_alltoall_f08 -#define MPI_Neighbor_alltoall_init PMPI_Neighbor_alltoall_init -#define MPI_Neighbor_alltoall_init_f08 PMPI_Neighbor_alltoall_init_f08 -#define MPI_Neighbor_alltoallv PMPI_Neighbor_alltoallv -#define MPI_Neighbor_alltoallv_f08 PMPI_Neighbor_alltoallv_f08 -#define MPI_Ineighbor_alltoallv PMPI_Ineighbor_alltoallv +#define MPI_Ineighbor_alltoall PMPI_Ineighbor_alltoall #define MPI_Ineighbor_alltoallv_f08 PMPI_Ineighbor_alltoallv_init_f08 -#define MPI_Neighbor_alltoallv_init PMPI_Neighbor_alltoallv_init -#define MPI_Neighbor_alltoallv_init_f08 PMPI_Neighbor_alltoallv_init_f08 -#define MPI_Neighbor_alltoallw PMPI_Neighbor_alltoallw -#define MPI_Neighbor_alltoallw_f08 PMPI_Neighbor_alltoallw_f08 -#define MPI_Ineighbor_alltoallw PMPI_Ineighbor_alltoallw +#define MPI_Ineighbor_alltoallv PMPI_Ineighbor_alltoallv #define MPI_Ineighbor_alltoallw_f08 PMPI_Ineighbor_alltoallw_f08 -#define MPI_Neighbor_alltoallw_init PMPI_Neighbor_alltoallw_init -#define MPI_Neighbor_alltoallw_init_f08 PMPI_Neighbor_alltoallw_init_f08 +#define MPI_Ineighbor_alltoallw PMPI_Ineighbor_alltoallw +#define MPI_Info_create_env_f08 PMPI_Info_create_env_f08 +#define MPI_Info_create_env PMPI_Info_create_env +#define MPI_Info_create_f08 PMPI_Info_create_f08 +#define MPI_Info_create PMPI_Info_create +#define MPI_Info_delete_f08 PMPI_Info_delete_f08 +#define MPI_Info_delete PMPI_Info_delete +#define MPI_Info_dup_f08 PMPI_Info_dup_f08 +#define MPI_Info_dup PMPI_Info_dup +#define MPI_Info_free_f08 PMPI_Info_free_f08 +#define MPI_Info_free PMPI_Info_free +#define MPI_Info_get_f08 PMPI_Info_get_f08 +#define MPI_Info_get_nkeys_f08 PMPI_Info_get_nkeys_f08 +#define MPI_Info_get_nkeys PMPI_Info_get_nkeys +#define MPI_Info_get_nthkey_f08 PMPI_Info_get_nthkey_f08 +#define MPI_Info_get_nthkey PMPI_Info_get_nthkey +#define MPI_Info_get PMPI_Info_get +#define MPI_Info_get_string_f08 PMPI_Info_get_string_f08 +#define MPI_Info_get_string PMPI_Info_get_string +#define MPI_Info_get_valuelen_f08 PMPI_Info_get_valuelen_f08 +#define MPI_Info_get_valuelen PMPI_Info_get_valuelen +#define MPI_Info_set_f08 PMPI_Info_set_f08 +#define MPI_Info_set PMPI_Info_set +#define MPI_Init_f08 PMPI_Init_f08 +#define MPI_Initialized_f08 PMPI_Initialized_f08 +#define MPI_Initialized PMPI_Initialized +#define MPI_Init PMPI_Init +#define MPI_Init_thread_f08 PMPI_Init_thread_f08 +#define MPI_Init_thread PMPI_Init_thread +#define MPI_Intercomm_create_f08 PMPI_Intercomm_create_f08 +#define MPI_Intercomm_create_from_groups_f08 PMPI_Intercomm_create_from_groups_f08 +#define MPI_Intercomm_create_from_groups PMPI_Intercomm_create_from_groups +#define MPI_Intercomm_create PMPI_Intercomm_create +#define MPI_Intercomm_merge_f08 PMPI_Intercomm_merge_f08 +#define MPI_Intercomm_merge PMPI_Intercomm_merge +#define MPI_Iprobe_f08 PMPI_Iprobe_f08 +#define MPI_Iprobe PMPI_Iprobe +#define MPI_Irecv_f08 PMPI_Irecv_f08 +#define MPI_Irecv PMPI_Irecv +#define MPI_Ireduce_f08 PMPI_Ireduce_f08 +#define MPI_Ireduce PMPI_Ireduce +#define MPI_Ireduce_scatter_block_f08 PMPI_Ireduce_scatter_block_f08 +#define MPI_Ireduce_scatter_block PMPI_Ireduce_scatter_block +#define MPI_Ireduce_scatter_f08 PMPI_Ireduce_scatter_f08 +#define MPI_Ireduce_scatter PMPI_Ireduce_scatter +#define MPI_Irsend_f08 PMPI_Irsend_f08 +#define MPI_Irsend PMPI_Irsend +#define MPI_Iscan_f08 PMPI_Iscan_f08 +#define MPI_Iscan PMPI_Iscan +#define MPI_Iscatter_f08 PMPI_Iscatter_f08 +#define MPI_Iscatter PMPI_Iscatter +#define MPI_Iscatterv_f08 PMPI_Iscatterv_f08 +#define MPI_Iscatterv PMPI_Iscatterv +#define MPI_Isend_f08 PMPI_Isend_f08 +#define MPI_Isend PMPI_Isend +#define MPI_Isendrecv_f08 PMPI_Isendrecv_f08 +#define MPI_Isendrecv PMPI_Isendrecv +#define MPI_Isendrecv_replace_f08 PMPI_Isendrecv_replace_f08 +#define MPI_Isendrecv_replace PMPI_Isendrecv_replace +#define MPI_Issend_f08 PMPI_Issend_f08 +#define MPI_Issend PMPI_Issend +#define MPI_Is_thread_main_f08 PMPI_Is_thread_main_f08 +#define MPI_Is_thread_main PMPI_Is_thread_main +#define MPI_Lookup_name_f08 PMPI_Lookup_name_f08 +#define MPI_Lookup_name PMPI_Lookup_name +#define MPI_Mprobe_f08 PMPI_Mprobe_f08 +#define MPI_Mprobe PMPI_Mprobe +#define MPI_Mrecv_f08 PMPI_Mrecv_f08 +#define MPI_Mrecv PMPI_Mrecv +#define MPI_Neighbor_allgather_f08 PMPI_Neighbor_allgather_f08 +#define MPI_Neighbor_allgather_init_f08 PMPI_Neighbor_allgather_init_f08 +#define MPI_Neighbor_allgather_init PMPI_Neighbor_allgather_init +#define MPI_Neighbor_allgather PMPI_Neighbor_allgather +#define MPI_Neighbor_allgatherv_f08 PMPI_Neighbor_allgatherv_f08 +#define MPI_Neighbor_allgatherv_init_f08 PMPI_Neighbor_allgatherv_init_f08 +#define MPI_Neighbor_allgatherv_init PMPI_Neighbor_allgatherv_init +#define MPI_Neighbor_allgatherv PMPI_Neighbor_allgatherv +#define MPI_Neighbor_alltoall_f08 PMPI_Neighbor_alltoall_f08 +#define MPI_Neighbor_alltoall_init_f08 PMPI_Neighbor_alltoall_init_f08 +#define MPI_Neighbor_alltoall_init PMPI_Neighbor_alltoall_init +#define MPI_Neighbor_alltoall PMPI_Neighbor_alltoall +#define MPI_Neighbor_alltoallv_f08 PMPI_Neighbor_alltoallv_f08 +#define MPI_Neighbor_alltoallv_init_f08 PMPI_Neighbor_alltoallv_init_f08 +#define MPI_Neighbor_alltoallv_init PMPI_Neighbor_alltoallv_init +#define MPI_Neighbor_alltoallv PMPI_Neighbor_alltoallv +#define MPI_Neighbor_alltoallw_f08 PMPI_Neighbor_alltoallw_f08 +#define MPI_Neighbor_alltoallw_init_f08 PMPI_Neighbor_alltoallw_init_f08 +#define MPI_Neighbor_alltoallw_init PMPI_Neighbor_alltoallw_init +#define MPI_Neighbor_alltoallw PMPI_Neighbor_alltoallw +#define MPI_Op_commutative_f08 PMPI_Op_commutative_f08 +#define MPI_Op_commutative PMPI_Op_commutative +#define MPI_Op_create_f08 PMPI_Op_create_f08 +#define MPI_Op_create PMPI_Op_create +#define MPI_Open_port_f08 PMPI_Open_port_f08 +#define MPI_Open_port PMPI_Open_port +#define MPI_Op_free_f08 PMPI_Op_free_f08 +#define MPI_Op_free PMPI_Op_free +#define MPI_Pack_external_f08 PMPI_Pack_external_f08 +#define MPI_Pack_external PMPI_Pack_external +#define MPI_Pack_external_size_f08 PMPI_Pack_external_size_f08 +#define MPI_Pack_external_size PMPI_Pack_external_size +#define MPI_Pack_f08 PMPI_Pack_f08 +#define MPI_Pack PMPI_Pack +#define MPI_Pack_size_f08 PMPI_Pack_size_f08 +#define MPI_Pack_size PMPI_Pack_size +#define MPI_Parrived_f08 PMPI_Parrived_f08 +#define MPI_Parrived PMPI_Parrived +#define MPI_Pcontrol_f08 PMPI_Pcontrol_f08 +#define MPI_Pcontrol PMPI_Pcontrol +#define MPI_Pready_f08 PMPI_Pready_f08 +#define MPI_Pready_list_f08 PMPI_Pready_list_f08 +#define MPI_Pready_list PMPI_Pready_list +#define MPI_Pready PMPI_Pready +#define MPI_Pready_range_f08 PMPI_Pready_range_f08 +#define MPI_Pready_range PMPI_Pready_range +#define MPI_Precv_init_f08 PMPI_Precv_init_f08 +#define MPI_Precv_init PMPI_Precv_init +#define MPI_Probe_f08 PMPI_Probe_f08 +#define MPI_Probe PMPI_Probe +#define MPI_Psend_init_f08 PMPI_Psend_init_f08 +#define MPI_Psend_init PMPI_Psend_init +#define MPI_Publish_name_f08 PMPI_Publish_name_f08 +#define MPI_Publish_name PMPI_Publish_name +#define MPI_Put_f08 PMPI_Put_f08 +#define MPI_Put PMPI_Put +#define MPI_Query_thread_f08 PMPI_Query_thread_f08 +#define MPI_Query_thread PMPI_Query_thread +#define MPI_Raccumulate_f08 PMPI_Raccumulate_f08 +#define MPI_Raccumulate PMPI_Raccumulate +#define MPI_Recv_f08_c PMPI_Recv_f08_c +#define MPI_Recv_f08 PMPI_Recv_f08 +#define MPI_Recv_init_f08 PMPI_Recv_init_f08 +#define MPI_Recv_init PMPI_Recv_init +#define MPI_Recv PMPI_Recv +#define MPI_Reduce_f08 PMPI_Reduce_f08 +#define MPI_Reduce_init_f08 PMPI_Reduce_init_f08 +#define MPI_Reduce_init PMPI_Reduce_init +#define MPI_Reduce_local_f08 PMPI_Reduce_local_f08 +#define MPI_Reduce_local PMPI_Reduce_local +#define MPI_Reduce PMPI_Reduce +#define MPI_Reduce_scatter_block_f08 PMPI_Reduce_scatter_block_f08 +#define MPI_Reduce_scatter_block_init_f08 PMPI_Reduce_scatter_block_init_f08 +#define MPI_Reduce_scatter_block_init PMPI_Reduce_scatter_block_init +#define MPI_Reduce_scatter_block PMPI_Reduce_scatter_block +#define MPI_Reduce_scatter_f08 PMPI_Reduce_scatter_f08 +#define MPI_Reduce_scatter_init_f08 PMPI_Reduce_scatter_init_f08 +#define MPI_Reduce_scatter_init PMPI_Reduce_scatter_init +#define MPI_Reduce_scatter PMPI_Reduce_scatter +#define MPI_Register_datarep_f08 PMPI_Register_datarep_f08 +#define MPI_Register_datarep PMPI_Register_datarep +#define MPI_Request_free_f08 PMPI_Request_free_f08 +#define MPI_Request_free PMPI_Request_free +#define MPI_Request_get_status_f08 PMPI_Request_get_status_f08 +#define MPI_Request_get_status PMPI_Request_get_status +#define MPI_Rget_accumulate_f08 PMPI_Rget_accumulate_f08 +#define MPI_Rget_accumulate PMPI_Rget_accumulate +#define MPI_Rget_f08 PMPI_Rget_f08 +#define MPI_Rget PMPI_Rget +#define MPI_Rput_f08 PMPI_Rput_f08 +#define MPI_Rput PMPI_Rput +#define MPI_Rsend_f08 PMPI_Rsend_f08 +#define MPI_Rsend_init_f08 PMPI_Rsend_init_f08 +#define MPI_Rsend_init PMPI_Rsend_init +#define MPI_Rsend PMPI_Rsend +#define MPI_Scan_f08 PMPI_Scan_f08 +#define MPI_Scan_init_f08 PMPI_Scan_init_f08 +#define MPI_Scan_init PMPI_Scan_init +#define MPI_Scan PMPI_Scan +#define MPI_Scatter_f08 PMPI_Scatter_f08 +#define MPI_Scatter_init_f08 PMPI_Scatter_init_f08 +#define MPI_Scatter_init PMPI_Scatter_init +#define MPI_Scatter PMPI_Scatter +#define MPI_Scatterv_f08 PMPI_Scatterv_f08 +#define MPI_Scatterv_init_f08 PMPI_Scatterv_init_f08 +#define MPI_Scatterv_init PMPI_Scatterv_init +#define MPI_Scatterv PMPI_Scatterv +#define MPI_Send_f08_c PMPI_Send_f08_c +#define MPI_Send_f08 PMPI_Send_f08 +#define MPI_Send_init_f08 PMPI_Send_init_f08 +#define MPI_Send_init PMPI_Send_init +#define MPI_Send PMPI_Send +#define MPI_Sendrecv_f08 PMPI_Sendrecv_f08 +#define MPI_Sendrecv PMPI_Sendrecv +#define MPI_Sendrecv_replace_f08 PMPI_Sendrecv_replace_f08 +#define MPI_Sendrecv_replace PMPI_Sendrecv_replace +#define MPI_Session_call_errhandler_f08 PMPI_Session_call_errhandler_f08 +#define MPI_Session_call_errhandler PMPI_Session_call_errhandler +#define MPI_Session_create_errhandler_f08 PMPI_Session_create_errhandler_f08 +#define MPI_Session_create_errhandler PMPI_Session_create_errhandler +#define MPI_Session_finalize_f08 PMPI_Session_finalize_f08 +#define MPI_Session_finalize PMPI_Session_finalize +#define MPI_Session_get_errhandler_f08 PMPI_Session_get_errhandler_f08 +#define MPI_Session_get_errhandler PMPI_Session_get_errhandler +#define MPI_Session_get_info_f08 PMPI_Session_get_info_f08 +#define MPI_Session_get_info PMPI_Session_get_info +#define MPI_Session_get_info PMPI_Session_get_info +#define MPI_Session_get_nth_pset_f08 PMPI_Session_get_nth_pset_f08 +#define MPI_Session_get_nth_psetlen_f08 PMPI_Session_get_nth_psetlen_f08 +#define MPI_Session_get_nth_psetlen PMPI_Session_get_nth_psetlen +#define MPI_Session_get_nth_pset PMPI_Session_get_nth_pset +#define MPI_Session_get_num_psets_f08 PMPI_Session_get_num_psets_f08 +#define MPI_Session_get_num_psets PMPI_Session_get_num_psets +#define MPI_Session_get_pset_info_f08 PMPI_Session_get_pset_info_f08 +#define MPI_Session_get_pset_info PMPI_Session_get_pset_info +#define MPI_Session_init_f08 PMPI_Session_init_f08 +#define MPI_Session_init PMPI_Session_init +#define MPI_Session_set_errhandler_f08 PMPI_Session_set_errhandler_f08 +#define MPI_Session_set_errhandler PMPI_Session_set_errhandler +#define MPI_Ssend_f08 PMPI_Ssend_f08 +#define MPI_Ssend_init_f08 PMPI_Ssend_init_f08 +#define MPI_Ssend_init PMPI_Ssend_init +#define MPI_Ssend PMPI_Ssend +#define MPI_Startall_f08 PMPI_Startall_f08 +#define MPI_Startall PMPI_Startall +#define MPI_Start_f08 PMPI_Start_f08 +#define MPI_Start PMPI_Start +#define MPI_Status_f082f_f08 PMPI_Status_f082f_f08 +#define MPI_Status_f082f PMPI_Status_f082f +#define MPI_Status_f2f08_f08 PMPI_Status_f2f08_f08 +#define MPI_Status_f2f08 PMPI_Status_f2f08 +#define MPI_Status_set_cancelled_f08 PMPI_Status_set_cancelled_f08 +#define MPI_Status_set_cancelled PMPI_Status_set_cancelled +#define MPI_Status_set_elements_f08 PMPI_Status_set_elements_f08 +#define MPI_Status_set_elements PMPI_Status_set_elements +#define MPI_Status_set_elements_x_f08 PMPI_Status_set_elements_x_f08 +#define MPI_Status_set_elements_x PMPI_Status_set_elements_x +#define MPI_Testall_f08 PMPI_Testall_f08 +#define MPI_Testall PMPI_Testall +#define MPI_Testany_f08 PMPI_Testany_f08 +#define MPI_Testany PMPI_Testany +#define MPI_Test_cancelled_f08 PMPI_Test_cancelled_f08 +#define MPI_Test_cancelled PMPI_Test_cancelled +#define MPI_Test_f08 PMPI_Test_f08 +#define MPI_Test PMPI_Test +#define MPI_Testsome_f08 PMPI_Testsome_f08 +#define MPI_Testsome PMPI_Testsome +#define MPI_Topo_test_f08 PMPI_Topo_test_f08 +#define MPI_Topo_test PMPI_Topo_test +#define MPI_Type_commit_f08 PMPI_Type_commit_f08 +#define MPI_Type_commit PMPI_Type_commit +#define MPI_Type_contiguous_f08 PMPI_Type_contiguous_f08 +#define MPI_Type_contiguous PMPI_Type_contiguous +#define MPI_Type_create_darray_f08 PMPI_Type_create_darray_f08 +#define MPI_Type_create_darray PMPI_Type_create_darray +#define MPI_Type_create_f90_complex_f08 PMPI_Type_create_f90_complex_f08 +#define MPI_Type_create_f90_complex PMPI_Type_create_f90_complex +#define MPI_Type_create_f90_integer_f08 PMPI_Type_create_f90_integer_f08 +#define MPI_Type_create_f90_integer PMPI_Type_create_f90_integer +#define MPI_Type_create_f90_real_f08 PMPI_Type_create_f90_real_f08 +#define MPI_Type_create_f90_real PMPI_Type_create_f90_real +#define MPI_Type_create_hindexed_block_f08 PMPI_Type_create_hindexed_block_f08 +#define MPI_Type_create_hindexed_block PMPI_Type_create_hindexed_block +#define MPI_Type_create_hindexed_f08 PMPI_Type_create_hindexed_f08 +#define MPI_Type_create_hindexed PMPI_Type_create_hindexed +#define MPI_Type_create_hvector_f08 PMPI_Type_create_hvector_f08 +#define MPI_Type_create_hvector PMPI_Type_create_hvector +#define MPI_Type_create_indexed_block_f08 PMPI_Type_create_indexed_block_f08 +#define MPI_Type_create_indexed_block PMPI_Type_create_indexed_block +#define MPI_Type_create_keyval_f08 PMPI_Type_create_keyval_f08 +#define MPI_Type_create_keyval PMPI_Type_create_keyval +#define MPI_Type_create_resized_f08 PMPI_Type_create_resized_f08 +#define MPI_Type_create_resized PMPI_Type_create_resized +#define MPI_Type_create_struct_f08 PMPI_Type_create_struct_f08 +#define MPI_Type_create_struct PMPI_Type_create_struct +#define MPI_Type_create_subarray_f08 PMPI_Type_create_subarray_f08 +#define MPI_Type_create_subarray PMPI_Type_create_subarray +#define MPI_Type_delete_attr_f08 PMPI_Type_delete_attr_f08 +#define MPI_Type_delete_attr PMPI_Type_delete_attr +#define MPI_Type_dup_f08 PMPI_Type_dup_f08 +#define MPI_Type_dup PMPI_Type_dup +#define MPI_Type_free_f08 PMPI_Type_free_f08 +#define MPI_Type_free_keyval_f08 PMPI_Type_free_keyval_f08 +#define MPI_Type_free_keyval PMPI_Type_free_keyval +#define MPI_Type_free PMPI_Type_free +#define MPI_Type_get_attr_f08 PMPI_Type_get_attr_f08 +#define MPI_Type_get_attr PMPI_Type_get_attr +#define MPI_Type_get_contents_f08_c PMPI_Type_get_contents_f08_c +#define MPI_Type_get_contents_f08 PMPI_Type_get_contents_f08 +#define MPI_Type_get_contents PMPI_Type_get_contents +#define MPI_Type_get_envelope_f08_c PMPI_Type_get_envelope_f08_c +#define MPI_Type_get_envelope_f08 PMPI_Type_get_envelope_f08 +#define MPI_Type_get_envelope PMPI_Type_get_envelope +#define MPI_Type_get_extent_f08 PMPI_Type_get_extent_f08 +#define MPI_Type_get_extent PMPI_Type_get_extent +#define MPI_Type_get_extent_x_f08 PMPI_Type_get_extent_x_f08 +#define MPI_Type_get_extent_x PMPI_Type_get_extent_x +#define MPI_Type_get_name_f08 PMPI_Type_get_name_f08 +#define MPI_Type_get_name PMPI_Type_get_name +#define MPI_Type_get_true_extent_f08 PMPI_Type_get_true_extent_f08 +#define MPI_Type_get_true_extent PMPI_Type_get_true_extent +#define MPI_Type_get_true_extent_x_f08 PMPI_Type_get_true_extent_x_f08 +#define MPI_Type_get_true_extent_x PMPI_Type_get_true_extent_x +#define MPI_Type_indexed_f08 PMPI_Type_indexed_f08 +#define MPI_Type_indexed PMPI_Type_indexed +#define MPI_Type_match_size_f08 PMPI_Type_match_size_f08 +#define MPI_Type_match_size PMPI_Type_match_size +#define MPI_Type_set_attr_f08 PMPI_Type_set_attr_f08 +#define MPI_Type_set_attr PMPI_Type_set_attr +#define MPI_Type_set_name_f08 PMPI_Type_set_name_f08 +#define MPI_Type_set_name PMPI_Type_set_name +#define MPI_Type_size_f08 PMPI_Type_size_f08 +#define MPI_Type_size PMPI_Type_size +#define MPI_Type_size_x_f08 PMPI_Type_size_x_f08 +#define MPI_Type_size_x PMPI_Type_size_x +#define MPI_Type_vector_f08 PMPI_Type_vector_f08 +#define MPI_Type_vector PMPI_Type_vector +#define MPI_Unpack_external_f08 PMPI_Unpack_external_f08 +#define MPI_Unpack_external PMPI_Unpack_external +#define MPI_Unpack_f08 PMPI_Unpack_f08 +#define MPI_Unpack PMPI_Unpack +#define MPI_Unpublish_name_f08 PMPI_Unpublish_name_f08 +#define MPI_Unpublish_name PMPI_Unpublish_name +#define MPI_Waitall_f08 PMPI_Waitall_f08 +#define MPI_Waitall PMPI_Waitall +#define MPI_Waitany_f08 PMPI_Waitany_f08 +#define MPI_Waitany PMPI_Waitany +#define MPI_Wait_f08 PMPI_Wait_f08 +#define MPI_Wait PMPI_Wait +#define MPI_Waitsome_f08 PMPI_Waitsome_f08 +#define MPI_Waitsome PMPI_Waitsome +#define MPI_Win_allocate_f08 PMPI_Win_allocate_f08 +#define MPI_Win_allocate PMPI_Win_allocate +#define MPI_Win_allocate_shared_f08 PMPI_Win_allocate_shared_f08 +#define MPI_Win_allocate_shared PMPI_Win_allocate_shared +#define MPI_Win_attach_f08 PMPI_Win_attach_f08 +#define MPI_Win_attach PMPI_Win_attach +#define MPI_Win_call_errhandler_f08 PMPI_Win_call_errhandler_f08 +#define MPI_Win_call_errhandler PMPI_Win_call_errhandler +#define MPI_Win_complete_f08 PMPI_Win_complete_f08 +#define MPI_Win_complete PMPI_Win_complete +#define MPI_Win_create_dynamic_f08 PMPI_Win_create_dynamic_f08 +#define MPI_Win_create_dynamic PMPI_Win_create_dynamic +#define MPI_Win_create_errhandler_f08 PMPI_Win_create_errhandler_f08 +#define MPI_Win_create_errhandler PMPI_Win_create_errhandler +#define MPI_Win_create_f08 PMPI_Win_create_f08 +#define MPI_Win_create_keyval_f08 PMPI_Win_create_keyval_f08 +#define MPI_Win_create_keyval PMPI_Win_create_keyval +#define MPI_Win_create PMPI_Win_create +#define MPI_Win_delete_attr_f08 PMPI_Win_delete_attr_f08 +#define MPI_Win_delete_attr PMPI_Win_delete_attr +#define MPI_Win_detach_f08 PMPI_Win_detach_f08 +#define MPI_Win_detach PMPI_Win_detach +#define MPI_Win_fence_f08 PMPI_Win_fence_f08 +#define MPI_Win_fence PMPI_Win_fence +#define MPI_Win_flush_all_f08 PMPI_Win_flush_all_f08 +#define MPI_Win_flush_all PMPI_Win_flush_all +#define MPI_Win_flush_f08 PMPI_Win_flush_f08 +#define MPI_Win_flush_local_all_f08 PMPI_Win_flush_local_all_f08 +#define MPI_Win_flush_local_all PMPI_Win_flush_local_all +#define MPI_Win_flush_local_f08 PMPI_Win_flush_local_f08 +#define MPI_Win_flush_local PMPI_Win_flush_local +#define MPI_Win_flush PMPI_Win_flush +#define MPI_Win_free_f08 PMPI_Win_free_f08 +#define MPI_Win_free_keyval_f08 PMPI_Win_free_keyval_f08 +#define MPI_Win_free_keyval PMPI_Win_free_keyval +#define MPI_Win_free PMPI_Win_free +#define MPI_Win_get_attr_f08 PMPI_Win_get_attr_f08 +#define MPI_Win_get_attr PMPI_Win_get_attr +#define MPI_Win_get_errhandler_f08 PMPI_Win_get_errhandler_f08 +#define MPI_Win_get_errhandler PMPI_Win_get_errhandler +#define MPI_Win_get_group_f08 PMPI_Win_get_group_f08 +#define MPI_Win_get_group PMPI_Win_get_group +#define MPI_Win_get_info_f08 PMPI_Win_get_info_f08 +#define MPI_Win_get_info PMPI_Win_get_info +#define MPI_Win_get_name_f08 PMPI_Win_get_name_f08 +#define MPI_Win_get_name PMPI_Win_get_name +#define MPI_Win_lock_all_f08 PMPI_Win_lock_all_f08 +#define MPI_Win_lock_all PMPI_Win_lock_all +#define MPI_Win_lock_f08 PMPI_Win_lock_f08 +#define MPI_Win_lock PMPI_Win_lock +#define MPI_Win_post_f08 PMPI_Win_post_f08 +#define MPI_Win_post PMPI_Win_post +#define MPI_Win_set_attr_f08 PMPI_Win_set_attr_f08 +#define MPI_Win_set_attr PMPI_Win_set_attr +#define MPI_Win_set_errhandler_f08 PMPI_Win_set_errhandler_f08 +#define MPI_Win_set_errhandler PMPI_Win_set_errhandler +#define MPI_Win_set_info_f08 PMPI_Win_set_info_f08 +#define MPI_Win_set_info PMPI_Win_set_info +#define MPI_Win_set_name_f08 PMPI_Win_set_name_f08 +#define MPI_Win_set_name PMPI_Win_set_name +#define MPI_Win_shared_query_f08 PMPI_Win_shared_query_f08 +#define MPI_Win_shared_query PMPI_Win_shared_query +#define MPI_Win_start_f08 PMPI_Win_start_f08 +#define MPI_Win_start PMPI_Win_start +#define MPI_Win_sync_f08 PMPI_Win_sync_f08 +#define MPI_Win_sync PMPI_Win_sync +#define MPI_Win_test_f08 PMPI_Win_test_f08 +#define MPI_Win_test PMPI_Win_test +#define MPI_Win_unlock_all_f08 PMPI_Win_unlock_all_f08 +#define MPI_Win_unlock_all PMPI_Win_unlock_all +#define MPI_Win_unlock_f08 PMPI_Win_unlock_f08 +#define MPI_Win_unlock PMPI_Win_unlock +#define MPI_Win_wait_f08 PMPI_Win_wait_f08 +#define MPI_Win_wait PMPI_Win_wait #endif diff --git a/ompi/mpi/fortran/use-mpi-f08/mrecv_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/mrecv_f08.F90 deleted file mode 100644 index 3eb9651cb31..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/mrecv_f08.F90 +++ /dev/null @@ -1,29 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All Rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Mrecv_f08(buf,count,datatype,message,status,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Message, MPI_Status - use :: ompi_mpifh_bindings, only : ompi_mrecv_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE :: buf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Message), INTENT(INOUT) :: message - TYPE(MPI_Status) :: status - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_mrecv_f(buf,count,datatype%MPI_VAL,message%MPI_VAL,status,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Mrecv_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/mrecv_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/mrecv_ts.c.in new file mode 100644 index 00000000000..eefce291914 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/mrecv_ts.c.in @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2015 FUJITSU LIMITED. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID mrecv(BUFFER x, COUNT count, DATATYPE datatype, + MESSAGE_INOUT message, STATUS status) +{ + int c_ierr; + OMPI_FORTRAN_STATUS_DECLARATION(c_status,c_status2) + MPI_Message c_message = PMPI_Message_f2c(*message); + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + void *buf = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count; + + OMPI_FORTRAN_STATUS_SET_POINTER(c_status,c_status2,status) + + OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(MPI_COMM_SELF, c_ierr, FUNC_NAME); + return; + } + + + /* Call the C function */ + c_ierr = @INNER_CALL@(OMPI_F2C_BOTTOM(buf), c_count, + c_datatype, &c_message, + c_status); + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + OMPI_FORTRAN_STATUS_RETURN(c_status,c_status2,status,c_ierr) + /* message is an INOUT, and may be updated by the recv */ + *message = PMPI_Message_c2f(c_message); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/neighbor_allgather_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/neighbor_allgather_f08.F90 deleted file mode 100644 index 084ab11076b..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/neighbor_allgather_f08.F90 +++ /dev/null @@ -1,32 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2013 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Neighbor_allgather_f08(sendbuf,sendcount,sendtype,recvbuf,recvcount,recvtype,comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm - use :: ompi_mpifh_bindings, only : ompi_neighbor_allgather_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE :: recvbuf - INTEGER, INTENT(IN) :: sendcount, recvcount - TYPE(MPI_Datatype), INTENT(IN) :: sendtype - TYPE(MPI_Datatype), INTENT(IN) :: recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_neighbor_allgather_f(sendbuf,sendcount,sendtype%MPI_VAL,& - recvbuf,recvcount,recvtype%MPI_VAL,comm%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Neighbor_allgather_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/neighbor_allgather_init_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/neighbor_allgather_init_f08.F90 deleted file mode 100644 index 0137d7ef79b..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/neighbor_allgather_init_f08.F90 +++ /dev/null @@ -1,34 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2022 Cisco Systems, Inc. All rights reserved -! Copyright (c) 2009-2013 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2021 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Neighbor_allgather_init_f08(sendbuf,sendcount,sendtype,recvbuf,recvcount,recvtype,comm,info,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Info, MPI_Request - use :: ompi_mpifh_bindings, only : ompi_neighbor_allgather_init_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: sendcount, recvcount - TYPE(MPI_Datatype), INTENT(IN) :: sendtype - TYPE(MPI_Datatype), INTENT(IN) :: recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_neighbor_allgather_init_f(sendbuf,sendcount,sendtype%MPI_VAL,& - recvbuf,recvcount,recvtype%MPI_VAL,comm%MPI_VAL,info%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Neighbor_allgather_init_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/neighbor_allgather_init_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/neighbor_allgather_init_ts.c.in new file mode 100644 index 00000000000..652eac1b4c8 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/neighbor_allgather_init_ts.c.in @@ -0,0 +1,82 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2013 Los Alamos National Security, LLC. All rights + * reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID neighbor_allgather_init(BUFFER x1, COUNT sendcount, DATATYPE sendtype, + BUFFER_OUT x2, COUNT recvcount, DATATYPE recvtype, + COMM comm, INFO info, REQUEST_OUT request) +{ + int c_ierr; + MPI_Comm c_comm = PMPI_Comm_f2c(*comm); + MPI_Datatype c_senddatatype, c_sendtype = PMPI_Type_f2c(*sendtype); + MPI_Request c_request; + MPI_Info c_info; + void *sendbuf = OMPI_CFI_BASE_ADDR(x1); + @COUNT_TYPE@ c_sendcount = (@COUNT_TYPE@) *sendcount; + MPI_Datatype c_recvtype = PMPI_Type_f2c(*recvtype); + void *recvbuf = OMPI_CFI_BASE_ADDR(x2); + @COUNT_TYPE@ c_recvcount = (@COUNT_TYPE@) *recvcount; + + c_info = PMPI_Info_f2c(*info); + + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + OMPI_CFI_2_C(x1, c_sendcount, c_sendtype, c_senddatatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + + c_sendtype = PMPI_Type_f2c(*sendtype); + c_recvtype = PMPI_Type_f2c(*recvtype); + + sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf); + sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); + recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); + + c_ierr = @INNER_CALL@(sendbuf, + c_sendcount, + c_sendtype, + recvbuf, + c_recvcount, + c_recvtype, + c_comm, + c_info, + &c_request); + + if (c_senddatatype != c_sendtype) { + ompi_datatype_destroy(&c_senddatatype); + } + + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + if (MPI_SUCCESS == c_ierr) { + *request = PMPI_Request_c2f(c_request); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/neighbor_allgather_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/neighbor_allgather_ts.c.in new file mode 100644 index 00000000000..8c714580ac1 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/neighbor_allgather_ts.c.in @@ -0,0 +1,73 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2013 Los Alamos National Security, LLC. All rights + * reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID neighbor_allgather(BUFFER x1, COUNT sendcount, DATATYPE sendtype, + BUFFER_OUT x2, COUNT recvcount, DATATYPE recvtype, + COMM comm) +{ + int c_ierr; + MPI_Comm c_comm = PMPI_Comm_f2c(*comm); + MPI_Datatype __opal_attribute_unused__ c_senddatatype; + MPI_Datatype c_sendtype = PMPI_Type_f2c(*sendtype); + void *sendbuf = OMPI_CFI_BASE_ADDR(x1); + @COUNT_TYPE@ c_sendcount = (@COUNT_TYPE@) *sendcount; + MPI_Datatype c_recvtype = PMPI_Type_f2c(*recvtype); + void *recvbuf = OMPI_CFI_BASE_ADDR(x2); + @COUNT_TYPE@ c_recvcount = (@COUNT_TYPE@) *recvcount; + + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + OMPI_CFI_2_C(x1, c_sendcount, c_sendtype, c_senddatatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + + c_sendtype = PMPI_Type_f2c(*sendtype); + c_recvtype = PMPI_Type_f2c(*recvtype); + + sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf); + sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); + recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); + + c_ierr = @INNER_CALL@(sendbuf, + c_sendcount, + c_senddatatype, + recvbuf, + c_recvcount, + c_recvtype, c_comm); + + if (c_senddatatype != c_sendtype) { + ompi_datatype_destroy(&c_senddatatype); + } + + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/neighbor_allgatherv_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/neighbor_allgatherv_f08.F90 deleted file mode 100644 index 7335c3f8b39..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/neighbor_allgatherv_f08.F90 +++ /dev/null @@ -1,34 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2013 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Neighbor_allgatherv_f08(sendbuf,sendcount,sendtype,recvbuf,recvcounts,& - displs,recvtype,comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm - use :: ompi_mpifh_bindings, only : ompi_neighbor_allgatherv_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE :: recvbuf - INTEGER, INTENT(IN) :: sendcount - INTEGER, INTENT(IN) :: recvcounts(*), displs(*) - TYPE(MPI_Datatype), INTENT(IN) :: sendtype - TYPE(MPI_Datatype), INTENT(IN) :: recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_neighbor_allgatherv_f(sendbuf,sendcount,sendtype%MPI_VAL,recvbuf,recvcounts,& - displs,recvtype%MPI_VAL,comm%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Neighbor_allgatherv_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/neighbor_allgatherv_init_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/neighbor_allgatherv_init_f08.F90 deleted file mode 100644 index eebeaecfbae..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/neighbor_allgatherv_init_f08.F90 +++ /dev/null @@ -1,36 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2022 Cisco Systems, Inc. All rights reserved -! Copyright (c) 2009-2013 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2021 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Neighbor_allgatherv_init_f08(sendbuf,sendcount,sendtype,recvbuf,recvcounts,& - displs,recvtype,comm,info,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Info, MPI_Request - use :: ompi_mpifh_bindings, only : ompi_neighbor_allgatherv_init_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: sendcount - INTEGER, INTENT(IN) OMPI_ASYNCHRONOUS :: recvcounts(*), displs(*) - TYPE(MPI_Datatype), INTENT(IN) :: sendtype - TYPE(MPI_Datatype), INTENT(IN) :: recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_neighbor_allgatherv_init_f(sendbuf,sendcount,sendtype%MPI_VAL,recvbuf,recvcounts,& - displs,recvtype%MPI_VAL,comm%MPI_VAL,info%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Neighbor_allgatherv_init_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/neighbor_allgatherv_init_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/neighbor_allgatherv_init_ts.c.in new file mode 100644 index 00000000000..1c74849f556 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/neighbor_allgatherv_init_ts.c.in @@ -0,0 +1,92 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2013 Los Alamos National Security, LLC. All rights + * reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID neighbor_allgatherv_init(BUFFER x1, COUNT sendcount, DATATYPE sendtype, + BUFFER_OUT x2, COUNT_ARRAY recvcounts, DISP_ARRAY displs, + DATATYPE recvtype, COMM comm, + INFO info, REQUEST_OUT request) +{ + MPI_Comm c_comm = PMPI_Comm_f2c(*comm); + MPI_Datatype c_senddatatype, c_sendtype = PMPI_Type_f2c(*sendtype); + char *sendbuf = OMPI_CFI_BASE_ADDR(x1), *recvbuf = OMPI_CFI_BASE_ADDR(x2); + @COUNT_TYPE@ c_sendcount = (@COUNT_TYPE@) *sendcount; + MPI_Datatype c_recvtype = PMPI_Type_f2c(*recvtype); + MPI_Request c_request; + MPI_Info c_info; + int size, c_ierr, idx=0; + @COUNT_TYPE@ *tmp_recvcounts = NULL; + @DISP_TYPE@ *tmp_displs = NULL; + + c_info = PMPI_Info_f2c(*info); + + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + OMPI_CFI_2_C(x1, c_sendcount, c_sendtype, c_senddatatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + + c_sendtype = PMPI_Type_f2c(*sendtype); + c_recvtype = PMPI_Type_f2c(*recvtype); + + PMPI_Comm_size(c_comm, &size); + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(recvcounts, tmp_recvcounts, size); + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(displs, tmp_displs, size); + + sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf); + sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); + recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); + + c_ierr = @INNER_CALL@(sendbuf, + c_sendcount, + c_senddatatype, + recvbuf, + tmp_recvcounts, + tmp_displs, + c_recvtype, + c_comm, + c_info, + &c_request); + if (c_senddatatype != c_sendtype) { + ompi_datatype_destroy(&c_senddatatype); + } + + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + if (MPI_SUCCESS == c_ierr) { + *request = PMPI_Request_c2f(c_request); + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP_NONBLOCKING(recvcounts, tmp_recvcounts, c_request, c_ierr, idx); + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP_NONBLOCKING(displs, tmp_displs, c_request, c_ierr, idx); + } else { + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP(recvcounts, tmp_recvcounts); + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP(displs, tmp_displs); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/neighbor_allgatherv_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/neighbor_allgatherv_ts.c.in new file mode 100644 index 00000000000..220c351dcb0 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/neighbor_allgatherv_ts.c.in @@ -0,0 +1,81 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2013 Los Alamos National Security, LLC. All rights + * reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID neighbor_allgatherv(BUFFER x1, COUNT sendcount, DATATYPE sendtype, + BUFFER_OUT x2, COUNT_ARRAY recvcounts, DISP_ARRAY displs, + DATATYPE recvtype, COMM comm) +{ + MPI_Comm c_comm = PMPI_Comm_f2c(*comm); + MPI_Datatype __opal_attribute_unused__ c_senddatatype; + MPI_Datatype c_sendtype = PMPI_Type_f2c(*sendtype); + char *sendbuf = OMPI_CFI_BASE_ADDR(x1), *recvbuf = OMPI_CFI_BASE_ADDR(x2); + @COUNT_TYPE@ c_sendcount = (@COUNT_TYPE@) *sendcount; + MPI_Datatype c_recvtype = PMPI_Type_f2c(*recvtype); + int size, c_ierr; + @COUNT_TYPE@ *tmp_recvcounts = NULL; + @DISP_TYPE@ *tmp_displs = NULL; + + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + OMPI_CFI_2_C(x1, c_sendcount, c_sendtype, c_senddatatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + + c_sendtype = PMPI_Type_f2c(*sendtype); + c_recvtype = PMPI_Type_f2c(*recvtype); + + PMPI_Comm_size(c_comm, &size); + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(recvcounts, tmp_recvcounts, size); + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(displs, tmp_displs, size); + + sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf); + sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); + recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); + + c_ierr = @INNER_CALL@(sendbuf, + c_sendcount, + c_senddatatype, + recvbuf, + tmp_recvcounts, + tmp_displs, + c_recvtype, c_comm); + + if (c_senddatatype != c_sendtype) { + ompi_datatype_destroy(&c_senddatatype); + } + + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP(recvcounts, tmp_recvcounts); + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP(displs, tmp_displs); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/neighbor_alltoall_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/neighbor_alltoall_f08.F90 deleted file mode 100644 index 8bfb42dd83b..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/neighbor_alltoall_f08.F90 +++ /dev/null @@ -1,33 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2013 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Neighbor_alltoall_f08(sendbuf,sendcount,sendtype,recvbuf,& - recvcount,recvtype,comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm - use :: ompi_mpifh_bindings, only : ompi_neighbor_alltoall_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE :: recvbuf - INTEGER, INTENT(IN) :: sendcount, recvcount - TYPE(MPI_Datatype), INTENT(IN) :: sendtype - TYPE(MPI_Datatype), INTENT(IN) :: recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_neighbor_alltoall_f(sendbuf,sendcount,sendtype%MPI_VAL,recvbuf,& - recvcount,recvtype%MPI_VAL,comm%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Neighbor_alltoall_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/neighbor_alltoall_init_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/neighbor_alltoall_init_f08.F90 deleted file mode 100644 index a77283d4e78..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/neighbor_alltoall_init_f08.F90 +++ /dev/null @@ -1,35 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2022 Cisco Systems, Inc. All rights reserved -! Copyright (c) 2009-2013 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2021 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Neighbor_alltoall_init_f08(sendbuf,sendcount,sendtype,recvbuf,& - recvcount,recvtype,comm,info,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Info, MPI_Request - use :: ompi_mpifh_bindings, only : ompi_neighbor_alltoall_init_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: sendcount, recvcount - TYPE(MPI_Datatype), INTENT(IN) :: sendtype - TYPE(MPI_Datatype), INTENT(IN) :: recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_neighbor_alltoall_init_f(sendbuf,sendcount,sendtype%MPI_VAL,recvbuf,& - recvcount,recvtype%MPI_VAL,comm%MPI_VAL,info%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Neighbor_alltoall_init_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/neighbor_alltoall_init_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/neighbor_alltoall_init_ts.c.in new file mode 100644 index 00000000000..2120d1b5905 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/neighbor_alltoall_init_ts.c.in @@ -0,0 +1,73 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2013 Los Alamos National Security, LLC. All rights + * reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID neighbor_alltoall_init(BUFFER x1, COUNT sendcount, DATATYPE sendtype, + BUFFER_OUT x2, COUNT recvcount, DATATYPE recvtype, + COMM comm, INFO info, REQUEST_OUT request) +{ + int c_ierr; + MPI_Comm c_comm = PMPI_Comm_f2c(*comm); + MPI_Datatype c_sendtype, c_recvtype; + MPI_Request c_request; + MPI_Info c_info; + char *sendbuf = OMPI_CFI_BASE_ADDR(x1), *recvbuf = OMPI_CFI_BASE_ADDR(x2); + + c_info = PMPI_Info_f2c(*info); + + OMPI_CFI_CHECK_CONTIGUOUS(x1, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + + c_sendtype = PMPI_Type_f2c(*sendtype); + c_recvtype = PMPI_Type_f2c(*recvtype); + + sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf); + sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); + recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); + + c_ierr = @INNER_CALL@(sendbuf, + (@COUNT_TYPE@) *sendcount, + c_sendtype, + recvbuf, + (@COUNT_TYPE@) *recvcount, + c_recvtype, + c_comm, + c_info, + &c_request); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + if (MPI_SUCCESS == c_ierr) { + *request = PMPI_Request_c2f(c_request); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/neighbor_alltoall_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/neighbor_alltoall_ts.c.in new file mode 100644 index 00000000000..6af37a17826 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/neighbor_alltoall_ts.c.in @@ -0,0 +1,63 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2013 Los Alamos National Security, LLC. All rights + * reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID neighbor_alltoall(BUFFER x1, COUNT sendcount, DATATYPE sendtype, + BUFFER_OUT x2, COUNT recvcount, DATATYPE recvtype, + COMM comm) +{ + int c_ierr; + MPI_Comm c_comm = PMPI_Comm_f2c(*comm); + MPI_Datatype c_sendtype, c_recvtype; + char *sendbuf = OMPI_CFI_BASE_ADDR(x1), *recvbuf = OMPI_CFI_BASE_ADDR(x2); + + OMPI_CFI_CHECK_CONTIGUOUS(x1, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + + c_sendtype = PMPI_Type_f2c(*sendtype); + c_recvtype = PMPI_Type_f2c(*recvtype); + + sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf); + sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); + recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); + + c_ierr = @INNER_CALL@(sendbuf, + (@COUNT_TYPE@) *sendcount, + c_sendtype, + recvbuf, + (@COUNT_TYPE@) *recvcount, + c_recvtype, c_comm); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/neighbor_alltoallv_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/neighbor_alltoallv_f08.F90 deleted file mode 100644 index 377ac5b6f1f..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/neighbor_alltoallv_f08.F90 +++ /dev/null @@ -1,34 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2013 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Neighbor_alltoallv_f08(sendbuf,sendcounts,sdispls,sendtype,recvbuf,& - recvcounts,rdispls,recvtype,comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm - use :: ompi_mpifh_bindings, only : ompi_neighbor_alltoallv_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE :: recvbuf - INTEGER, INTENT(IN) :: sendcounts(*), sdispls(*), recvcounts(*), rdispls(*) - TYPE(MPI_Datatype), INTENT(IN) :: sendtype - TYPE(MPI_Datatype), INTENT(IN) :: recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_neighbor_alltoallv_f(sendbuf,sendcounts,sdispls,sendtype%MPI_VAL,& - recvbuf,recvcounts,rdispls,recvtype%MPI_VAL,& - comm%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Neighbor_alltoallv_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/neighbor_alltoallv_init_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/neighbor_alltoallv_init_f08.F90 deleted file mode 100644 index 1ed7d8a502b..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/neighbor_alltoallv_init_f08.F90 +++ /dev/null @@ -1,36 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2022 Cisco Systems, Inc. All rights reserved -! Copyright (c) 2009-2013 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2021 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Neighbor_alltoallv_init_f08(sendbuf,sendcounts,sdispls,sendtype,recvbuf,& - recvcounts,rdispls,recvtype,comm,info,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Info, MPI_Request - use :: ompi_mpifh_bindings, only : ompi_neighbor_alltoallv_init_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) OMPI_ASYNCHRONOUS :: sendcounts(*), sdispls(*), recvcounts(*), rdispls(*) - TYPE(MPI_Datatype), INTENT(IN) :: sendtype - TYPE(MPI_Datatype), INTENT(IN) :: recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_neighbor_alltoallv_init_f(sendbuf,sendcounts,sdispls,sendtype%MPI_VAL,& - recvbuf,recvcounts,rdispls,recvtype%MPI_VAL,& - comm%MPI_VAL,info%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Neighbor_alltoallv_init_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/neighbor_alltoallv_init_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/neighbor_alltoallv_init_ts.c.in new file mode 100644 index 00000000000..c54f7cc9a70 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/neighbor_alltoallv_init_ts.c.in @@ -0,0 +1,97 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2013 Los Alamos National Security, LLC. All rights + * reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID neighbor_alltoallv_init(BUFFER x1, COUNT_ARRAY sendcounts, DISP_ARRAY sdispls, + DATATYPE sendtype, BUFFER_OUT x2, COUNT_ARRAY recvcounts, + DISP_ARRAY rdispls, DATATYPE recvtype, + COMM comm, + INFO info, + REQUEST_OUT request) +{ + MPI_Comm c_comm = PMPI_Comm_f2c(*comm); + MPI_Datatype c_sendtype, c_recvtype; + MPI_Info c_info; + MPI_Request c_request; + int size, c_ierr, idx = 0; + char *sendbuf = OMPI_CFI_BASE_ADDR(x1), *recvbuf = OMPI_CFI_BASE_ADDR(x2); + @COUNT_TYPE@ *tmp_sendcounts = NULL; + @DISP_TYPE@ *tmp_sdispls = NULL; + @COUNT_TYPE@ *tmp_recvcounts = NULL; + @DISP_TYPE@ *tmp_rdispls = NULL; + + c_info = PMPI_Info_f2c(*info); + + OMPI_CFI_CHECK_CONTIGUOUS(x1, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + c_sendtype = PMPI_Type_f2c(*sendtype); + c_recvtype = PMPI_Type_f2c(*recvtype); + + PMPI_Comm_size(c_comm, &size); + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(sendcounts, tmp_sendcounts, size); + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(sdispls, tmp_sdispls, size); + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(recvcounts, tmp_recvcounts, size); + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(rdispls, tmp_rdispls, size); + + sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf); + sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); + recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); + + c_ierr = @INNER_CALL@(sendbuf, + tmp_sendcounts, + tmp_sdispls, + c_sendtype, + recvbuf, + tmp_recvcounts, + tmp_rdispls, + c_recvtype, + c_comm, + c_info, + &c_request); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + *request = PMPI_Request_c2f(c_request); + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP_NONBLOCKING(recvcounts, tmp_recvcounts, c_request, c_ierr, idx); + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP_NONBLOCKING(sendcounts, tmp_sendcounts, c_request, c_ierr, idx); + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP_NONBLOCKING(rdispls, tmp_rdispls, c_request, c_ierr, idx); + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP_NONBLOCKING(sdispls, tmp_sdispls, c_request, c_ierr, idx); + } else { + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP(recvcounts, tmp_recvcounts); + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP(sendcounts, tmp_sendcounts); + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP(rdispls, tmp_rdispls); + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP(sdispls, tmp_sdispls); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/neighbor_alltoallv_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/neighbor_alltoallv_ts.c.in new file mode 100644 index 00000000000..f33edb16b0d --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/neighbor_alltoallv_ts.c.in @@ -0,0 +1,80 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2013 Los Alamos National Security, LLC. All rights + * reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID neighbor_alltoallv(BUFFER x1, COUNT_ARRAY sendcounts, DISP_ARRAY sdispls, + DATATYPE sendtype, BUFFER_OUT x2, COUNT_ARRAY recvcounts, + DISP_ARRAY rdispls, DATATYPE recvtype, + COMM comm) +{ + MPI_Comm c_comm = PMPI_Comm_f2c(*comm); + MPI_Datatype c_sendtype, c_recvtype; + int size, c_ierr; + char *sendbuf = OMPI_CFI_BASE_ADDR(x1), *recvbuf = OMPI_CFI_BASE_ADDR(x2); + @COUNT_TYPE@ *tmp_sendcounts = NULL; + @DISP_TYPE@ *tmp_sdispls = NULL; + @COUNT_TYPE@ *tmp_recvcounts = NULL; + @DISP_TYPE@ *tmp_rdispls = NULL; + + OMPI_CFI_CHECK_CONTIGUOUS(x1, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + c_sendtype = PMPI_Type_f2c(*sendtype); + c_recvtype = PMPI_Type_f2c(*recvtype); + + PMPI_Comm_size(c_comm, &size); + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(sendcounts, tmp_sendcounts, size); + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(sdispls, tmp_sdispls, size); + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(recvcounts, tmp_recvcounts, size); + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(rdispls, tmp_rdispls, size); + + sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf); + sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); + recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); + + c_ierr = @INNER_CALL@(sendbuf, + tmp_sendcounts, + tmp_sdispls, + c_sendtype, + recvbuf, + tmp_recvcounts, + tmp_rdispls, + c_recvtype, c_comm); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP(sendcounts, tmp_sendcounts); + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP(sdispls, tmp_sdispls); + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP(recvcounts, tmp_recvcounts); + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP(rdispls, tmp_rdispls); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/neighbor_alltoallw_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/neighbor_alltoallw_f08.F90 deleted file mode 100644 index e0fd6a68b8e..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/neighbor_alltoallw_f08.F90 +++ /dev/null @@ -1,34 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2013 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2013 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Neighbor_alltoallw_f08(sendbuf,sendcounts,sdispls,sendtypes,& - recvbuf,recvcounts,rdispls,recvtypes,comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_ADDRESS_KIND - use :: ompi_mpifh_bindings, only : ompi_neighbor_alltoallw_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE :: recvbuf - INTEGER, INTENT(IN) :: sendcounts(*), recvcounts(*) - INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: sdispls(*), rdispls(*) - TYPE(MPI_Datatype), INTENT(IN) :: sendtypes(*) - TYPE(MPI_Datatype), INTENT(IN) :: recvtypes(*) - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_neighbor_alltoallw_f(sendbuf,sendcounts,sdispls,sendtypes(1)%MPI_VAL,& - recvbuf,recvcounts,rdispls,recvtypes(1)%MPI_VAL,& - comm%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Neighbor_alltoallw_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/neighbor_alltoallw_init_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/neighbor_alltoallw_init_f08.F90 deleted file mode 100644 index 6ab2219e1c8..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/neighbor_alltoallw_init_f08.F90 +++ /dev/null @@ -1,36 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2022 Cisco Systems, Inc. All rights reserved -! Copyright (c) 2009-2013 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2021 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Neighbor_alltoallw_init_f08(sendbuf,sendcounts,sdispls,sendtypes,& - recvbuf,recvcounts,rdispls,recvtypes,comm,info,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Info, MPI_Request, MPI_ADDRESS_KIND - use :: ompi_mpifh_bindings, only : ompi_neighbor_alltoallw_init_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) OMPI_ASYNCHRONOUS :: sendcounts(*), recvcounts(*) - INTEGER(MPI_ADDRESS_KIND), INTENT(IN) OMPI_ASYNCHRONOUS :: sdispls(*), rdispls(*) - TYPE(MPI_Datatype), INTENT(IN) OMPI_ASYNCHRONOUS :: sendtypes(*) - TYPE(MPI_Datatype), INTENT(IN) OMPI_ASYNCHRONOUS :: recvtypes(*) - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_neighbor_alltoallw_init_f(sendbuf,sendcounts,sdispls,sendtypes(1)%MPI_VAL,& - recvbuf,recvcounts,rdispls,recvtypes(1)%MPI_VAL,& - comm%MPI_VAL,info%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Neighbor_alltoallw_init_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/neighbor_alltoallw_init_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/neighbor_alltoallw_init_ts.c.in new file mode 100644 index 00000000000..be976f2015f --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/neighbor_alltoallw_init_ts.c.in @@ -0,0 +1,107 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2021 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2013 Los Alamos National Security, LLC. All rights + * reserved. + * Copyright (c) 2015-2021 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID neighbor_alltoallw_init(BUFFER x1, COUNT_ARRAY sendcounts, + AINT_ARRAY sdispls, DATATYPE_ARRAY sendtypes, + BUFFER_OUT x2, COUNT_ARRAY recvcounts, + AINT_ARRAY rdispls, DATATYPE_ARRAY recvtypes, + COMM comm, + INFO info, + REQUEST_OUT request) +{ + MPI_Comm c_comm = PMPI_Comm_f2c(*comm); + MPI_Datatype *c_sendtypes, *c_recvtypes; + MPI_Request c_request; + MPI_Info c_info; + int size, c_ierr, idx = 0; + char *sendbuf = OMPI_CFI_BASE_ADDR(x1), *recvbuf = OMPI_CFI_BASE_ADDR(x2); + @COUNT_TYPE@ *tmp_sendcounts = NULL; + @COUNT_TYPE@ *tmp_recvcounts = NULL; + MPI_Aint *tmp_sdispls = NULL, *tmp_rdispls; + + c_info = PMPI_Info_f2c(*info); + + OMPI_CFI_CHECK_CONTIGUOUS(x1, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + PMPI_Comm_size(c_comm, &size); + + c_sendtypes = (MPI_Datatype *) malloc(size * sizeof(MPI_Datatype)); + c_recvtypes = (MPI_Datatype *) malloc(size * sizeof(MPI_Datatype)); + + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(sendcounts, tmp_sendcounts, size); + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(recvcounts, tmp_recvcounts, size); + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(sdispls, tmp_sdispls, size); + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(rdispls, tmp_rdispls, size); + + /* Alltoallw does not support MPI_IN_PLACE */ + sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); + recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); + + while (size > 0) { + c_sendtypes[size - 1] = PMPI_Type_f2c(sendtypes[size - 1]); + c_recvtypes[size - 1] = PMPI_Type_f2c(recvtypes[size - 1]); + --size; + } + + c_ierr = @INNER_CALL@(sendbuf, + tmp_sendcounts, + tmp_sdispls, + c_sendtypes, + recvbuf, + tmp_recvcounts, + tmp_rdispls, + c_recvtypes, + c_comm, + c_info, + &c_request); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + if (MPI_SUCCESS == c_ierr) { + *request = PMPI_Request_c2f(c_request); + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP_NONBLOCKING(recvcounts, tmp_recvcounts, c_request, c_ierr, idx); + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP_NONBLOCKING(sendcounts, tmp_sendcounts, c_request, c_ierr, idx); + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP_NONBLOCKING(rdispls, tmp_rdispls, c_request, c_ierr, idx); + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP_NONBLOCKING(sdispls, tmp_sdispls, c_request, c_ierr, idx); + } else { + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP(recvcounts, tmp_recvcounts); + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP(sendcounts, tmp_sendcounts); + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP(rdispls, tmp_rdispls); + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP(sdispls, tmp_sdispls); + } + + + free(c_sendtypes); + free(c_recvtypes); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/neighbor_alltoallw_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/neighbor_alltoallw_ts.c.in new file mode 100644 index 00000000000..e4dc0181dc7 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/neighbor_alltoallw_ts.c.in @@ -0,0 +1,84 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2013 Los Alamos National Security, LLC. All rights + * reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID neighbor_alltoallw(BUFFER x1, COUNT_ARRAY sendcounts, + AINT_ARRAY sdispls, DATATYPE_ARRAY sendtypes, + BUFFER_OUT x2, COUNT_ARRAY recvcounts, + AINT_ARRAY rdispls, DATATYPE_ARRAY recvtypes, + COMM comm) +{ + MPI_Comm c_comm = PMPI_Comm_f2c(*comm); + MPI_Datatype *c_sendtypes, *c_recvtypes; + int size, c_ierr; + char *sendbuf = OMPI_CFI_BASE_ADDR(x1), *recvbuf = OMPI_CFI_BASE_ADDR(x2); + @COUNT_TYPE@ *tmp_sendcounts = NULL; + @COUNT_TYPE@ *tmp_recvcounts = NULL; + + OMPI_CFI_CHECK_CONTIGUOUS(x1, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + PMPI_Comm_size(c_comm, &size); + + c_sendtypes = (MPI_Datatype *) malloc(size * sizeof(MPI_Datatype)); + c_recvtypes = (MPI_Datatype *) malloc(size * sizeof(MPI_Datatype)); + + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(sendcounts, tmp_sendcounts, size); + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(recvcounts, tmp_recvcounts, size); + + while (size > 0) { + c_sendtypes[size - 1] = PMPI_Type_f2c(sendtypes[size - 1]); + c_recvtypes[size - 1] = PMPI_Type_f2c(recvtypes[size - 1]); + --size; + } + + /* Alltoallw does not support MPI_IN_PLACE */ + sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); + recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); + + c_ierr = @INNER_CALL@(sendbuf, + tmp_sendcounts, + sdispls, + c_sendtypes, + recvbuf, + tmp_recvcounts, + rdispls, + c_recvtypes, c_comm); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP(sendcounts, tmp_sendcounts); + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP(recvcounts, tmp_recvcounts); + free(c_sendtypes); + free(c_recvtypes); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/pack_external_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/pack_external_f08.F90 deleted file mode 100644 index 9f4ae490051..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/pack_external_f08.F90 +++ /dev/null @@ -1,34 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Pack_external_f08(datarep,inbuf,incount,datatype,outbuf,outsize, & - position,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_ADDRESS_KIND - use :: ompi_mpifh_bindings, only : ompi_pack_external_f - implicit none - CHARACTER(LEN=*), INTENT(IN) :: datarep - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: inbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE :: outbuf - INTEGER, INTENT(IN) :: incount - TYPE(MPI_Datatype), INTENT(IN) :: datatype - INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: outsize - INTEGER(MPI_ADDRESS_KIND), INTENT(INOUT) :: position - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_pack_external_f(datarep,inbuf,incount,datatype%MPI_VAL,outbuf, & - outsize,position,c_ierror,len(datarep)) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Pack_external_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/pack_external_size.c.in b/ompi/mpi/fortran/use-mpi-f08/pack_external_size.c.in new file mode 100644 index 00000000000..51126948951 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/pack_external_size.c.in @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2004-2005 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-2005 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-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2017 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID pack_external_size(CHAR_ARRAY datarep, COUNT incount, + DATATYPE datatype, AINT_COUNT_OUT size) +{ + int c_ierr; + MPI_Datatype type = PMPI_Type_f2c(*datatype); + + c_ierr = @INNER_CALL@(datarep, + OMPI_FINT_2_INT(*incount), + type, size); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/pack_external_size_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/pack_external_size_f08.F90 deleted file mode 100644 index 477487a617d..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/pack_external_size_f08.F90 +++ /dev/null @@ -1,26 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "mpi-f08-rename.h" - -subroutine MPI_Pack_external_size_f08(datarep,incount,datatype,size,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_ADDRESS_KIND - use :: ompi_mpifh_bindings, only : ompi_pack_external_size_f - implicit none - CHARACTER(LEN=*), INTENT(IN) :: datarep - INTEGER, INTENT(IN) :: incount - TYPE(MPI_Datatype), INTENT(IN) :: datatype - INTEGER(MPI_ADDRESS_KIND), INTENT(OUT) :: size - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_pack_external_size_f(datarep,incount,datatype%MPI_VAL,size,c_ierror,len(datarep)) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Pack_external_size_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/pack_external_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/pack_external_ts.c.in new file mode 100644 index 00000000000..fd8e77b47ac --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/pack_external_ts.c.in @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID pack_external(CHAR_ARRAY datarep, BUFFER x1, COUNT incount, + DATATYPE datatype, BUFFER x2, + COUNT outsize, AINT_COUNT_INOUT position) +{ + int c_ierr; + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + void *inbuf = OMPI_CFI_BASE_ADDR(x1); + char *outbuf = OMPI_CFI_BASE_ADDR(x2); + int c_incount = OMPI_FINT_2_INT(*incount); + + OMPI_CFI_2_C(x1, c_incount, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(MPI_COMM_SELF, c_ierr, FUNC_NAME); + return; + } + + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(MPI_COMM_SELF, c_ierr, FUNC_NAME); + return; + } + + c_ierr = @INNER_CALL@(datarep, OMPI_F2C_BOTTOM(inbuf), + c_incount, + c_datatype, outbuf, + *outsize, + position); + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/pack_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/pack_f08.F90 deleted file mode 100644 index 5b0da89c213..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/pack_f08.F90 +++ /dev/null @@ -1,32 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Pack_f08(inbuf,incount,datatype,outbuf,outsize,position,comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm - use :: ompi_mpifh_bindings, only : ompi_pack_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: inbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE :: outbuf - INTEGER, INTENT(IN) :: incount, outsize - TYPE(MPI_Datatype), INTENT(IN) :: datatype - INTEGER, INTENT(INOUT) :: position - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_pack_f(inbuf,incount,datatype%MPI_VAL,outbuf,outsize, & - position,comm%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Pack_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/pack_size.c.in b/ompi/mpi/fortran/use-mpi-f08/pack_size.c.in new file mode 100644 index 00000000000..3ae578502ae --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/pack_size.c.in @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID pack_size(COUNT incount, DATATYPE datatype, + COMM comm, COUNT_OUT size) +{ + int c_ierr; + MPI_Comm c_comm; + MPI_Datatype c_type; + OMPI_SINGLE_NAME_DECL(size); + + c_comm = PMPI_Comm_f2c(*comm); + c_type = PMPI_Type_f2c(*datatype); + + c_ierr = @INNER_CALL@(OMPI_FINT_2_INT(*incount), + c_type, c_comm, + OMPI_SINGLE_NAME_CONVERT(size)); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + OMPI_SINGLE_INT_2_FINT(size); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/pack_size_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/pack_size_f08.F90 deleted file mode 100644 index 57c1f54dbbb..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/pack_size_f08.F90 +++ /dev/null @@ -1,26 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "mpi-f08-rename.h" - -subroutine MPI_Pack_size_f08(incount,datatype,comm,size,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm - use :: ompi_mpifh_bindings, only : ompi_pack_size_f - implicit none - INTEGER, INTENT(IN) :: incount - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, INTENT(OUT) :: size - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_pack_size_f(incount,datatype%MPI_VAL,comm%MPI_VAL,size,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Pack_size_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/pack_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/pack_ts.c.in new file mode 100644 index 00000000000..885653f5eba --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/pack_ts.c.in @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID pack(BUFFER x1, COUNT incount, DATATYPE datatype, + BUFFER x2, COUNT outsize, COUNT_INOUT position, + COMM comm) +{ + int c_ierr; + MPI_Comm c_comm = PMPI_Comm_f2c(*comm); + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + OMPI_SINGLE_NAME_DECL(position); + void *inbuf = OMPI_CFI_BASE_ADDR(x1); + char *outbuf = OMPI_CFI_BASE_ADDR(x2); + int c_incount = OMPI_FINT_2_INT(*incount); + int c_outsize = OMPI_FINT_2_INT(*outsize); + + OMPI_SINGLE_FINT_2_INT(position); + + OMPI_CFI_2_C(x1, c_incount, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + + c_ierr = @INNER_CALL@(OMPI_F2C_BOTTOM(inbuf), c_incount, + c_datatype, outbuf, + c_outsize, + OMPI_SINGLE_NAME_CONVERT(position), + c_comm); + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + OMPI_SINGLE_INT_2_FINT(position); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/precv_init_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/precv_init_f08.F90 deleted file mode 100644 index 94fae6fb892..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/precv_init_f08.F90 +++ /dev/null @@ -1,36 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! Copyright (c) 2020 Sandia National Laboratories. All rights reserved. -! Copyright (c) 2021 Bull S.A.S. All rights reserved. -! Copyright (c) 2023 Triad National Security, LLC. All rights -! reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Precv_init_f08(buf,partitions,count,datatype,dest,tag,comm,info,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Info, MPI_Request, MPI_COUNT_KIND - use :: ompi_mpifh_bindings, only : ompi_precv_init_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: buf - INTEGER, INTENT(IN) :: partitions, dest, tag - INTEGER(KIND=MPI_COUNT_KIND), INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_precv_init_f(buf,partitions,count,datatype%MPI_VAL,dest,tag,comm%MPI_VAL, & - info%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Precv_init_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/precv_init_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/precv_init_ts.c.in new file mode 100644 index 00000000000..53a5b30f526 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/precv_init_ts.c.in @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2020 Sandia National Laboratories. All rights reserved. + * Copyright (c) 2021 Bull S.A.S. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE void precv_init(BUFFER_OUT x, INT partitions, PARTITIONED_COUNT count, DATATYPE datatype, + RANK dest, TAG tag, COMM comm, INFO info, REQUEST_OUT request) +{ + int c_ierr; + MPI_Info c_info; + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + MPI_Request c_req; + MPI_Comm c_comm; + void *buf = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count; + + c_info = PMPI_Info_f2c(*info); + c_comm = PMPI_Comm_f2c (*comm); + + OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); + c_ierr = @INNER_CALL@(OMPI_F2C_BOTTOM(buf), + OMPI_FINT_2_INT(*partitions), + c_count, + c_type, OMPI_FINT_2_INT(*dest), + OMPI_FINT_2_INT(*tag), + c_comm, c_info, &c_req); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + + if (MPI_SUCCESS == c_ierr) { + *request = PMPI_Request_c2f(c_req); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/profile/Makefile.am b/ompi/mpi/fortran/use-mpi-f08/profile/Makefile.am deleted file mode 100644 index 1002fdc70c4..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/profile/Makefile.am +++ /dev/null @@ -1,481 +0,0 @@ - -# -*- makefile.am -*- -# -# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana -# University Research and Technology -# Corporation. All rights reserved. -# Copyright (c) 2004-2013 The University of Tennessee and The University -# of Tennessee Research Foundation. All rights -# reserved. -# Copyright (c) 2004-2005 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) 2009-2021 Cisco Systems, Inc. All rights reserved. -# Copyright (c) 2011 Sandia National Laboratories. All rights reserved. -# Copyright (c) 2012 Oak Ridge National Laboratory. All rights reserved. -# Copyright (c) 2012-2013 Inria. All rights reserved. -# Copyright (c) 2013 Los Alamos National Security, LLC. All rights -# reserved. -# Copyright (c) 2015-2021 Research Organization for Information Science -# and Technology (RIST). All rights reserved. -# Copyright (c) 2022 Triad National Security, LLC. All rights -# reserved. -# Copyright (c) 2024 Jeffrey M. Squyres. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -include $(top_srcdir)/Makefile.ompi-rules - -# Note that Automake's Fortran-buidling rules uses CPPFLAGS and -# AM_CPPFLAGS. This can cause weirdness (e.g., -# https://github.com/open-mpi/ompi/issues/7253). Let's just zero -# those out and rely on AM_FCFLAGS. -CPPFLAGS = -AM_CPPFLAGS = - -# This Makefile is only relevant if we're building the "use mpi_f08" -# MPI bindings. -if OMPI_BUILD_FORTRAN_USEMPIF08_BINDINGS - -AM_FCFLAGS = -I$(top_srcdir)/ompi/mpi/fortran/use-mpi-f08/mod \ - -I$(top_builddir)/ompi/include \ - -I$(top_srcdir)/ompi/include \ - $(OMPI_FC_MODULE_FLAG)$(top_builddir)/ompi/mpi/fortran/use-mpi \ - $(OMPI_FC_MODULE_FLAG)$(top_builddir)/ompi/mpi/fortran/use-mpi-ignore-tkr \ - $(OMPI_FC_MODULE_FLAG)../mod \ - $(OMPI_FC_MODULE_FLAG)../bindings \ - -I$(top_srcdir) -I$(top_builddir) $(FCFLAGS_f90) \ - -DOMPI_BUILD_MPI_PROFILING=1 - -CLEANFILES += *.i90 - -noinst_LTLIBRARIES = libmpi_usempif08_pmpi.la - -pmpi_api_files = \ - pabort_f08.F90 \ - paccumulate_f08.F90 \ - padd_error_class_f08.F90 \ - padd_error_code_f08.F90 \ - padd_error_string_f08.F90 \ - paint_add_f08.F90 \ - paint_diff_f08.F90 \ - pallgather_f08.F90 \ - pallgather_init_f08.F90 \ - pallgatherv_f08.F90 \ - pallgatherv_init_f08.F90 \ - palloc_mem_f08.F90 \ - pallreduce_f08.F90 \ - pallreduce_init_f08.F90 \ - palltoall_f08.F90 \ - palltoall_init_f08.F90 \ - palltoallv_f08.F90 \ - palltoallv_init_f08.F90 \ - palltoallw_f08.F90 \ - palltoallw_init_f08.F90 \ - pbarrier_f08.F90 \ - pbarrier_init_f08.F90 \ - pbcast_f08.F90 \ - pbcast_init_f08.F90 \ - pbsend_f08.F90 \ - pbsend_init_f08.F90 \ - pbuffer_attach_f08.F90 \ - pbuffer_detach_f08.F90 \ - pcancel_f08.F90 \ - pcart_coords_f08.F90 \ - pcart_create_f08.F90 \ - pcartdim_get_f08.F90 \ - pcart_get_f08.F90 \ - pcart_map_f08.F90 \ - pcart_rank_f08.F90 \ - pcart_shift_f08.F90 \ - pcart_sub_f08.F90 \ - pclose_port_f08.F90 \ - pcomm_accept_f08.F90 \ - pcomm_call_errhandler_f08.F90 \ - pcomm_compare_f08.F90 \ - pcomm_connect_f08.F90 \ - pcomm_create_from_group_f08.F90 \ - pcomm_create_errhandler_f08.F90 \ - pcomm_create_f08.F90 \ - pcomm_create_group_f08.F90 \ - pcomm_create_keyval_f08.F90 \ - pcomm_delete_attr_f08.F90 \ - pcomm_disconnect_f08.F90 \ - pcomm_dup_f08.F90 \ - pcomm_dup_with_info_f08.F90 \ - pcomm_idup_f08.F90 \ - pcomm_idup_with_info_f08.F90 \ - pcomm_free_f08.F90 \ - pcomm_free_keyval_f08.F90 \ - pcomm_get_attr_f08.F90 \ - pcomm_get_errhandler_f08.F90 \ - pcomm_get_info_f08.F90 \ - pcomm_get_name_f08.F90 \ - pcomm_get_parent_f08.F90 \ - pcomm_group_f08.F90 \ - pcomm_join_f08.F90 \ - pcomm_rank_f08.F90 \ - pcomm_remote_group_f08.F90 \ - pcomm_remote_size_f08.F90 \ - pcomm_set_attr_f08.F90 \ - pcomm_set_errhandler_f08.F90 \ - pcomm_set_info_f08.F90 \ - pcomm_set_name_f08.F90 \ - pcomm_size_f08.F90 \ - pcomm_spawn_f08.F90 \ - pcomm_spawn_multiple_f08.F90 \ - pcomm_split_f08.F90 \ - pcomm_split_type_f08.F90 \ - pcomm_test_inter_f08.F90 \ - pcompare_and_swap_f08.F90 \ - pdims_create_f08.F90 \ - pdist_graph_create_adjacent_f08.F90 \ - pdist_graph_create_f08.F90 \ - pdist_graph_neighbors_count_f08.F90 \ - pdist_graph_neighbors_f08.F90 \ - perrhandler_free_f08.F90 \ - perror_class_f08.F90 \ - perror_string_f08.F90 \ - pexscan_f08.F90 \ - pexscan_init_f08.F90 \ - pf_sync_reg_f08.F90 \ - pfetch_and_op_f08.F90 \ - pfile_call_errhandler_f08.F90 \ - pfile_close_f08.F90 \ - pfile_create_errhandler_f08.F90 \ - pfile_delete_f08.F90 \ - pfile_get_amode_f08.F90 \ - pfile_get_atomicity_f08.F90 \ - pfile_get_byte_offset_f08.F90 \ - pfile_get_errhandler_f08.F90 \ - pfile_get_group_f08.F90 \ - pfile_get_info_f08.F90 \ - pfile_get_position_f08.F90 \ - pfile_get_position_shared_f08.F90 \ - pfile_get_size_f08.F90 \ - pfile_get_type_extent_f08.F90 \ - pfile_get_view_f08.F90 \ - pfile_iread_at_f08.F90 \ - pfile_iread_f08.F90 \ - pfile_iread_at_all_f08.F90 \ - pfile_iread_all_f08.F90 \ - pfile_iread_shared_f08.F90 \ - pfile_iwrite_at_f08.F90 \ - pfile_iwrite_f08.F90 \ - pfile_iwrite_at_all_f08.F90 \ - pfile_iwrite_all_f08.F90 \ - pfile_iwrite_shared_f08.F90 \ - pfile_open_f08.F90 \ - pfile_preallocate_f08.F90 \ - pfile_read_all_begin_f08.F90 \ - pfile_read_all_end_f08.F90 \ - pfile_read_all_f08.F90 \ - pfile_read_at_all_begin_f08.F90 \ - pfile_read_at_all_end_f08.F90 \ - pfile_read_at_all_f08.F90 \ - pfile_read_at_f08.F90 \ - pfile_read_f08.F90 \ - pfile_read_ordered_begin_f08.F90 \ - pfile_read_ordered_end_f08.F90 \ - pfile_read_ordered_f08.F90 \ - pfile_read_shared_f08.F90 \ - pfile_seek_f08.F90 \ - pfile_seek_shared_f08.F90 \ - pfile_set_atomicity_f08.F90 \ - pfile_set_errhandler_f08.F90 \ - pfile_set_info_f08.F90 \ - pfile_set_size_f08.F90 \ - pfile_set_view_f08.F90 \ - pfile_sync_f08.F90 \ - pfile_write_all_begin_f08.F90 \ - pfile_write_all_end_f08.F90 \ - pfile_write_all_f08.F90 \ - pfile_write_at_all_begin_f08.F90 \ - pfile_write_at_all_end_f08.F90 \ - pfile_write_at_all_f08.F90 \ - pfile_write_at_f08.F90 \ - pfile_write_f08.F90 \ - pfile_write_ordered_begin_f08.F90 \ - pfile_write_ordered_end_f08.F90 \ - pfile_write_ordered_f08.F90 \ - pfile_write_shared_f08.F90 \ - pfinalized_f08.F90 \ - pfinalize_f08.F90 \ - pfree_mem_f08.F90 \ - pgather_f08.F90 \ - pgather_init_f08.F90 \ - pgatherv_f08.F90 \ - pgatherv_init_f08.F90 \ - pget_accumulate_f08.F90 \ - pget_address_f08.F90 \ - pget_count_f08.F90 \ - pget_elements_f08.F90 \ - pget_elements_x_f08.F90 \ - pget_f08.F90 \ - pget_library_version_f08.F90 \ - pget_processor_name_f08.F90 \ - pget_version_f08.F90 \ - pgraph_create_f08.F90 \ - pgraphdims_get_f08.F90 \ - pgraph_get_f08.F90 \ - pgraph_map_f08.F90 \ - pgraph_neighbors_count_f08.F90 \ - pgraph_neighbors_f08.F90 \ - pgrequest_complete_f08.F90 \ - pgrequest_start_f08.F90 \ - pgroup_compare_f08.F90 \ - pgroup_difference_f08.F90 \ - pgroup_excl_f08.F90 \ - pgroup_free_f08.F90 \ - pgroup_from_session_pset_f08.F90 \ - pgroup_incl_f08.F90 \ - pgroup_intersection_f08.F90 \ - pgroup_range_excl_f08.F90 \ - pgroup_range_incl_f08.F90 \ - pgroup_rank_f08.F90 \ - pgroup_size_f08.F90 \ - pgroup_translate_ranks_f08.F90 \ - pgroup_union_f08.F90 \ - piallgather_f08.F90 \ - piallgatherv_f08.F90 \ - piallreduce_f08.F90 \ - pialltoall_f08.F90 \ - pialltoallv_f08.F90 \ - pialltoallw_f08.F90 \ - pibarrier_f08.F90 \ - pibcast_f08.F90 \ - pibsend_f08.F90 \ - pigather_f08.F90 \ - pigatherv_f08.F90 \ - piexscan_f08.F90 \ - pimprobe_f08.F90 \ - pimrecv_f08.F90 \ - pineighbor_allgather_f08.F90 \ - pineighbor_allgatherv_f08.F90 \ - pineighbor_alltoall_f08.F90 \ - pineighbor_alltoallv_f08.F90 \ - pineighbor_alltoallw_f08.F90 \ - pinfo_create_f08.F90 \ - pinfo_create_env_f08.F90 \ - pinfo_delete_f08.F90 \ - pinfo_dup_f08.F90 \ - pinfo_free_f08.F90 \ - pinfo_get_f08.F90 \ - pinfo_get_nkeys_f08.F90 \ - pinfo_get_nthkey_f08.F90 \ - pinfo_get_string_f08.F90 \ - pinfo_get_valuelen_f08.F90 \ - pinfo_set_f08.F90 \ - pinit_f08.F90 \ - pinitialized_f08.F90 \ - pinit_thread_f08.F90 \ - pintercomm_create_f08.F90 \ - pintercomm_create_from_groups_f08.F90 \ - pintercomm_merge_f08.F90 \ - piprobe_f08.F90 \ - pirecv_f08.F90 \ - pireduce_f08.F90 \ - pireduce_scatter_f08.F90 \ - pireduce_scatter_block_f08.F90 \ - pirsend_f08.F90 \ - piscan_f08.F90 \ - piscatter_f08.F90 \ - piscatterv_f08.F90 \ - pisend_f08.F90 \ - pisendrecv_f08.F90 \ - pisendrecv_replace_f08.F90 \ - pissend_f08.F90 \ - pis_thread_main_f08.F90 \ - plookup_name_f08.F90 \ - pmprobe_f08.F90 \ - pmrecv_f08.F90 \ - pneighbor_allgather_f08.F90 \ - pneighbor_allgather_init_f08.F90 \ - pneighbor_allgatherv_f08.F90 \ - pneighbor_allgatherv_init_f08.F90 \ - pneighbor_alltoall_f08.F90 \ - pneighbor_alltoall_init_f08.F90 \ - pneighbor_alltoallv_f08.F90 \ - pneighbor_alltoallv_init_f08.F90 \ - pneighbor_alltoallw_f08.F90 \ - pneighbor_alltoallw_init_f08.F90 \ - pop_commutative_f08.F90 \ - pop_create_f08.F90 \ - popen_port_f08.F90 \ - pop_free_f08.F90 \ - ppack_external_f08.F90 \ - ppack_external_size_f08.F90 \ - ppack_f08.F90 \ - ppack_size_f08.F90 \ - pparrived_f08.F90 \ - ppcontrol_f08.F90 \ - ppready_f08.F90 \ - ppready_list_f08.F90 \ - ppready_range_f08.F90 \ - pprobe_f08.F90 \ - ppsend_init_f08.F90 \ - ppublish_name_f08.F90 \ - pput_f08.F90 \ - pquery_thread_f08.F90 \ - praccumulate_f08.F90 \ - precv_f08.F90 \ - precv_init_f08.F90 \ - preduce_f08.F90 \ - preduce_init_f08.F90 \ - preduce_local_f08.F90 \ - preduce_scatter_f08.F90 \ - preduce_scatter_init_f08.F90 \ - preduce_scatter_block_f08.F90 \ - preduce_scatter_block_init_f08.F90 \ - pregister_datarep_f08.F90 \ - prequest_free_f08.F90 \ - prequest_get_status_f08.F90 \ - prget_f08.F90 \ - prget_accumulate_f08.F90 \ - prput_f08.F90 \ - prsend_f08.F90 \ - prsend_init_f08.F90 \ - pscan_f08.F90 \ - pscan_init_f08.F90 \ - pscatter_f08.F90 \ - pscatter_init_f08.F90 \ - pscatterv_f08.F90 \ - pscatterv_init_f08.F90 \ - psend_f08.F90 \ - psend_init_f08.F90 \ - psendrecv_f08.F90 \ - psendrecv_replace_f08.F90 \ - psession_call_errhandler_f08.F90 \ - psession_create_errhandler_f08.F90\ - psession_get_errhandler_f08.F90\ - psession_get_info_f08.F90 \ - psession_get_nth_pset_f08.F90 \ - psession_get_num_psets_f08.F90 \ - psession_get_pset_info_f08.F90 \ - psession_init_f08.F90 \ - psession_finalize_f08.F90 \ - psession_set_errhandler_f08.F90\ - pssend_f08.F90 \ - pssend_init_f08.F90 \ - pstartall_f08.F90 \ - pstart_f08.F90 \ - pstatus_f082f_f08.F90 \ - pstatus_f2f08_f08.F90 \ - pstatus_set_cancelled_f08.F90 \ - pstatus_set_elements_f08.F90 \ - pstatus_set_elements_x_f08.F90 \ - ptestall_f08.F90 \ - ptestany_f08.F90 \ - ptest_cancelled_f08.F90 \ - ptest_f08.F90 \ - ptestsome_f08.F90 \ - ptopo_test_f08.F90 \ - ptype_commit_f08.F90 \ - ptype_contiguous_f08.F90 \ - ptype_create_darray_f08.F90 \ - ptype_create_f90_complex_f08.F90 \ - ptype_create_f90_integer_f08.F90 \ - ptype_create_f90_real_f08.F90 \ - ptype_create_hindexed_f08.F90 \ - ptype_create_hvector_f08.F90 \ - ptype_create_indexed_block_f08.F90 \ - ptype_create_hindexed_block_f08.F90 \ - ptype_create_keyval_f08.F90 \ - ptype_create_resized_f08.F90 \ - ptype_create_struct_f08.F90 \ - ptype_create_subarray_f08.F90 \ - ptype_delete_attr_f08.F90 \ - ptype_dup_f08.F90 \ - ptype_free_f08.F90 \ - ptype_free_keyval_f08.F90 \ - ptype_get_attr_f08.F90 \ - ptype_get_contents_f08.F90 \ - ptype_get_envelope_f08.F90 \ - ptype_get_extent_f08.F90 \ - ptype_get_extent_x_f08.F90 \ - ptype_get_name_f08.F90 \ - ptype_get_true_extent_f08.F90 \ - ptype_get_true_extent_x_f08.F90 \ - ptype_indexed_f08.F90 \ - ptype_match_size_f08.F90 \ - ptype_set_attr_f08.F90 \ - ptype_set_name_f08.F90 \ - ptype_size_f08.F90 \ - ptype_size_x_f08.F90 \ - ptype_vector_f08.F90 \ - punpack_external_f08.F90 \ - punpack_f08.F90 \ - punpublish_name_f08.F90 \ - pwaitall_f08.F90 \ - pwaitany_f08.F90 \ - pwait_f08.F90 \ - pwaitsome_f08.F90 \ - pwin_allocate_f08.F90 \ - pwin_allocate_shared_f08.F90 \ - pwin_attach_f08.F90 \ - pwin_call_errhandler_f08.F90 \ - pwin_complete_f08.F90 \ - pwin_create_dynamic_f08.F90 \ - pwin_create_errhandler_f08.F90 \ - pwin_create_f08.F90 \ - pwin_create_keyval_f08.F90 \ - pwin_delete_attr_f08.F90 \ - pwin_detach_f08.F90 \ - pwin_fence_f08.F90 \ - pwin_flush_f08.F90 \ - pwin_flush_all_f08.F90 \ - pwin_flush_local_f08.F90 \ - pwin_flush_local_all_f08.F90 \ - pwin_free_f08.F90 \ - pwin_free_keyval_f08.F90 \ - pwin_get_attr_f08.F90 \ - pwin_get_errhandler_f08.F90 \ - pwin_get_group_f08.F90 \ - pwin_get_info_f08.F90 \ - pwin_get_name_f08.F90 \ - pwin_lock_f08.F90 \ - pwin_lock_all_f08.F90 \ - pwin_post_f08.F90 \ - pwin_set_attr_f08.F90 \ - pwin_set_errhandler_f08.F90 \ - pwin_set_info_f08.F90 \ - pwin_set_name_f08.F90 \ - pwin_shared_query_f08.F90 \ - pwin_start_f08.F90 \ - pwin_sync_f08.F90 \ - pwin_test_f08.F90 \ - pwin_unlock_f08.F90 \ - pwin_unlock_all_f08.F90 \ - pwin_wait_f08.F90 - -# -# Automake doesn't do Fortran dependency analysis, so must list them -# manually here. Bummer! -# - -pmpi_api_lo_files = $(pmpi_api_files:.F90=.lo) - -$(pmpi_api_lo_files): ../bindings/libforce_usempif08_internal_bindings_to_be_built.la - -nodist_libmpi_usempif08_pmpi_la_SOURCES = \ - $(pmpi_api_files) - -# -# Sym link in the sources from the real MPI directory -# -$(nodist_libmpi_usempif08_pmpi_la_SOURCES): - $(OMPI_V_LN_S) if test ! -r $@ ; then \ - pname=`echo $@ | cut -b '2-'` ; \ - $(LN_S) $(top_srcdir)/ompi/mpi/fortran/use-mpi-f08/$$pname $@ ; \ - fi - -# These files were created by targets above - -MAINTAINERCLEANFILES = $(nodist_libmpi_usempif08_pmpi_la_SOURCES) - -endif diff --git a/ompi/mpi/fortran/use-mpi-f08/profile/pcomm_create_from_group_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/profile/pcomm_create_from_group_f08.F90 deleted file mode 100644 index 84098a44dc2..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/profile/pcomm_create_from_group_f08.F90 +++ /dev/null @@ -1,29 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2013 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! Copyright (c) 2019 Triad National Security, LLC. All rights -! reserved. -! $COPYRIGHT$ - -subroutine PMPI_Comm_create_from_group_f08(group, stringtag, info, errhandler, newcomm, ierror) - use :: mpi_f08_types, only : MPI_Session, MPI_Group, MPI_Errhandler, MPI_Info, MPI_Comm - use :: ompi_mpifh_bindings, only : ompi_comm_create_from_group_f - implicit none - TYPE(MPI_Group), INTENT(IN) :: group - CHARACTER(LEN=*), INTENT(IN) :: stringtag - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Errhandler), INTENT(IN) :: errhandler - TYPE(MPI_Comm), INTENT(OUT) :: newcomm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_comm_create_from_group_f(group%MPI_VAL, stringtag, info%MPI_VAL, errhandler%MPI_VAL, & - newcomm%MPI_VAL, c_ierror, len(stringtag)) - if (present(ierror)) ierror = c_ierror - -end subroutine PMPI_Comm_create_from_group_f08 - diff --git a/ompi/mpi/fortran/use-mpi-f08/profile/pgroup_from_session_pset_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/profile/pgroup_from_session_pset_f08.F90 deleted file mode 100644 index a719b361302..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/profile/pgroup_from_session_pset_f08.F90 +++ /dev/null @@ -1,29 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2013 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! Copyright (c) 2019-2021 Triad National Security, LLC. All rights -! reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" -#include "mpi-f08-rename.h" - -subroutine PMPI_Group_from_session_pset_f08(session, pset_name, newgroup, ierror) - use :: mpi_f08_types, only : MPI_Session, MPI_Group - use :: ompi_mpifh_bindings, only : ompi_group_from_session_pset_f - implicit none - TYPE(MPI_Session), INTENT(IN) :: session - CHARACTER(LEN=*), INTENT(IN) :: pset_name - TYPE(MPI_Group), INTENT(OUT) :: newgroup - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_group_from_session_pset_f(session%MPI_VAL, pset_name, newgroup%MPI_VAL, c_ierror, len(pset_name)) - if (present(ierror)) ierror = c_ierror - -end subroutine PMPI_Group_from_session_pset_f08 - diff --git a/ompi/mpi/fortran/use-mpi-f08/profile/pintercomm_create_from_groups_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/profile/pintercomm_create_from_groups_f08.F90 deleted file mode 100644 index 668188d1adb..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/profile/pintercomm_create_from_groups_f08.F90 +++ /dev/null @@ -1,35 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2013 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! Copyright (c) 2019 Triad National Security, LLC. All rights -! reserved. -! $COPYRIGHT$ - -subroutine PMPI_Intercomm_create_from_groups_f08(local_group, local_leader, remote_group, & - remote_leader, stringtag, info, errhandler, & - newintercomm, ierror) - use :: mpi_f08_types, only : MPI_Comm, MPI_Group, MPI_Errhandler, MPI_Info - use :: ompi_mpifh_bindings, only : ompi_intercomm_create_from_groups_f - implicit none - TYPE(MPI_Group), INTENT(IN) :: local_group, remote_group - INTEGER, INTENT(IN):: local_leader, remote_leader - CHARACTER(LEN=*), INTENT(IN) :: stringtag - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Errhandler), INTENT(IN) :: errhandler - TYPE(MPI_Comm), INTENT(OUT) :: newintercomm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_intercomm_create_from_groups_f(local_group%MPI_VAL, local_leader, & - remote_group%MPI_VAL, & - remote_leader, stringtag, info%MPI_VAL, & - errhandler%MPI_VAL, & - newintercomm%MPI_VAL, c_ierror, len(stringtag)) - if (present(ierror)) ierror = c_ierror - -end subroutine PMPI_Intercomm_create_from_groups_f08 - diff --git a/ompi/mpi/fortran/use-mpi-f08/profile/psession_finalize_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/profile/psession_finalize_f08.F90 deleted file mode 100644 index 01316dd79ca..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/profile/psession_finalize_f08.F90 +++ /dev/null @@ -1,24 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2013 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! Copyright (c) 2019 Triad National Security, LLC. All rights -! reserved. -! $COPYRIGHT$ - -subroutine PMPI_Session_finalize_f08(session,ierror) - use :: mpi_f08_types, only : MPI_Session - use :: ompi_mpifh_bindings, only : ompi_session_finalize_f - implicit none - TYPE(MPI_Session), INTENT(OUT) :: session - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_session_finalize_f(session%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine PMPI_Session_finalize_f08 - diff --git a/ompi/mpi/fortran/use-mpi-f08/psend_init_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/psend_init_f08.F90 deleted file mode 100644 index b0ce80ddd48..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/psend_init_f08.F90 +++ /dev/null @@ -1,35 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! Copyright (c) 2020 Sandia National Laboratories. All rights reserved. -! Copyright (c) 2021 Bull S.A.S. All rights reserved. -! Copyright (c) 2023 Triad National Security, LLC. All rights -! reserved. -! $COPYRIGHT$ - -#include "mpi-f08-rename.h" -#include "ompi/mpi/fortran/configure-fortran-output.h" - -subroutine MPI_Psend_init_f08(buf,partitions,count,datatype,dest,tag,comm,info,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Info, MPI_Request, MPI_COUNT_KIND - use :: ompi_mpifh_bindings, only : ompi_psend_init_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: buf - INTEGER, INTENT(IN) :: partitions, dest, tag - INTEGER(KIND=MPI_COUNT_KIND), INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_psend_init_f(buf,partitions,count,datatype%MPI_VAL,dest,tag,comm%MPI_VAL, & - info%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Psend_init_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/psend_init_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/psend_init_ts.c.in new file mode 100644 index 00000000000..9d7ad29b22c --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/psend_init_ts.c.in @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2020 Sandia National Laboratories. All rights reserved. + * Copyright (c) 2021 Bull S.A.S. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID psend_init(BUFFER_ASYNC x, INT partitions, PARTITIONED_COUNT count, DATATYPE datatype, + RANK dest, TAG tag, COMM comm, INFO info, REQUEST_OUT request) +{ + int c_ierr; + MPI_Info c_info; + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + MPI_Request c_req; + MPI_Comm c_comm; + void *buf = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count; + + c_info = PMPI_Info_f2c(*info); + c_comm = PMPI_Comm_f2c (*comm); + + OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); + c_ierr = @INNER_CALL@(OMPI_F2C_BOTTOM(buf), + OMPI_FINT_2_INT(*partitions), + c_count, + c_type, OMPI_FINT_2_INT(*dest), + OMPI_FINT_2_INT(*tag), + c_comm, c_info, &c_req); + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + *request = PMPI_Request_c2f(c_req); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/put_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/put_f08.F90 deleted file mode 100644 index b58e4d88623..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/put_f08.F90 +++ /dev/null @@ -1,32 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2010-2022 Cisco Systems, Inc. All rights reserved -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All Rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Put_f08(origin_addr,origin_count,origin_datatype,target_rank,& - target_disp,target_count,target_datatype,win,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Win, MPI_ADDRESS_KIND - use :: ompi_mpifh_bindings, only : ompi_put_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) OMPI_ASYNCHRONOUS :: origin_addr - INTEGER, INTENT(IN) :: origin_count, target_rank, target_count - TYPE(MPI_Datatype), INTENT(IN) :: origin_datatype - INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: target_disp - TYPE(MPI_Datatype), INTENT(IN) :: target_datatype - TYPE(MPI_Win), INTENT(IN) :: win - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_put_f(origin_addr,origin_count,origin_datatype%MPI_VAL,target_rank,& - target_disp,target_count,target_datatype%MPI_VAL,win%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Put_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/put_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/put_ts.c.in new file mode 100644 index 00000000000..6643aaf3cee --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/put_ts.c.in @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID put(BUFFER x, COUNT origin_count, + DATATYPE origin_datatype, RANK target_rank, + AINT target_disp, COUNT target_count, + DATATYPE target_datatype, WIN win) +{ + int c_ierr; + MPI_Datatype c_origin_datatype, c_origin_type = PMPI_Type_f2c(*origin_datatype); + MPI_Datatype c_target_datatype = PMPI_Type_f2c(*target_datatype); + MPI_Win c_win = PMPI_Win_f2c(*win); + char *origin_addr = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_origin_count = (@COUNT_TYPE@)*origin_count; + + OMPI_CFI_2_C(x, c_origin_count, c_origin_type, c_origin_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_win, c_ierr, FUNC_NAME) + return; + } + c_ierr = @INNER_CALL@(OMPI_F2C_BOTTOM(origin_addr), + c_origin_count, + c_origin_datatype, + OMPI_FINT_2_INT(*target_rank), + *target_disp, + (@COUNT_TYPE@) *target_count, + c_target_datatype, c_win); + if (c_origin_datatype != c_origin_type) { + ompi_datatype_destroy(&c_origin_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/raccumulate_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/raccumulate_f08.F90 deleted file mode 100644 index 1935be341d4..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/raccumulate_f08.F90 +++ /dev/null @@ -1,36 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2010-2022 Cisco Systems, Inc. All rights reserved -! Copyright (c) 2009-2014 Los Alamos National Security, LLC. -! All Rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Raccumulate_f08(origin_addr,origin_count,origin_datatype,& - target_rank,target_disp,target_count, & - target_datatype,op,win,request, ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Op, MPI_Win, MPI_Request, MPI_ADDRESS_KIND - use :: ompi_mpifh_bindings, only : ompi_raccumulate_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) OMPI_ASYNCHRONOUS :: origin_addr - INTEGER, INTENT(IN) :: origin_count, target_rank, target_count - TYPE(MPI_Datatype), INTENT(IN) :: origin_datatype - INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: target_disp - TYPE(MPI_Datatype), INTENT(IN) :: target_datatype - TYPE(MPI_Op), INTENT(IN) :: op - TYPE(MPI_Win), INTENT(IN) :: win - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_raccumulate_f(origin_addr,origin_count,origin_datatype%MPI_VAL,target_rank,& - target_disp,target_count,target_datatype%MPI_VAL,& - op%MPI_VAL,win%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Raccumulate_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/raccumulate_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/raccumulate_ts.c.in new file mode 100644 index 00000000000..d35c47f4225 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/raccumulate_ts.c.in @@ -0,0 +1,66 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2014-2016 Los Alamos National Security, LLC. All rights + * reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID raccumulate(BUFFER x, COUNT origin_count, + DATATYPE origin_datatype, RANK target_rank, + AINT target_disp, COUNT target_count, + DATATYPE target_datatype, OP op, WIN win, + REQUEST_OUT request) +{ + int c_ierr; + + MPI_Datatype c_origin_datatype, c_origin_type = PMPI_Type_f2c(*origin_datatype); + MPI_Datatype c_target_datatype = PMPI_Type_f2c(*target_datatype); + MPI_Win c_win = PMPI_Win_f2c(*win); + MPI_Op c_op = PMPI_Op_f2c(*op); + MPI_Request c_req; + char *origin_addr = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_origin_count = (@COUNT_TYPE@) *origin_count; + + OMPI_CFI_2_C(x, c_origin_count, c_origin_type, c_origin_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_win, c_ierr, FUNC_NAME) + return; + } + c_ierr = @INNER_CALL@(OMPI_F2C_BOTTOM(origin_addr), + c_origin_count, + c_origin_datatype, + OMPI_FINT_2_INT(*target_rank), + *target_disp, + (@COUNT_TYPE@) *target_count, + c_target_datatype, c_op, c_win, + &c_req); + if (c_origin_datatype != c_origin_type) { + ompi_datatype_destroy(&c_origin_datatype); + } + + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + *request = PMPI_Request_c2f(c_req); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/recv_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/recv_f08.F90 deleted file mode 100644 index 034fe0fdc19..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/recv_f08.F90 +++ /dev/null @@ -1,29 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Recv_f08(buf,count,datatype,source,tag,comm,status,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Status - use :: ompi_mpifh_bindings, only : ompi_recv_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE :: buf - INTEGER, INTENT(IN) :: count, source, tag - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Status), INTENT(OUT) :: status - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_recv_f(buf,count,datatype%MPI_VAL,source,tag,comm%MPI_VAL,status,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Recv_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/recv_init_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/recv_init_f08.F90 deleted file mode 100644 index 5207511c281..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/recv_init_f08.F90 +++ /dev/null @@ -1,30 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Recv_init_f08(buf,count,datatype,source,tag,comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request - use :: ompi_mpifh_bindings, only : ompi_recv_init_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: buf - INTEGER, INTENT(IN) :: count, source, tag - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_recv_init_f(buf,count,datatype%MPI_VAL,source,tag,comm%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Recv_init_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/recv_init_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/recv_init_ts.c.in new file mode 100644 index 00000000000..d5653252687 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/recv_init_ts.c.in @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID recv_init(BUFFER_ASYNC x, COUNT count, DATATYPE datatype, + RANK source, TAG tag, COMM comm, + REQUEST_OUT request) +{ + int c_ierr; + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + MPI_Request c_req; + MPI_Comm c_comm = PMPI_Comm_f2c (*comm); + + void *buf = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count; + + OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + + c_ierr = @INNER_CALL@(OMPI_F2C_BOTTOM(buf), c_count, + c_datatype, OMPI_FINT_2_INT(*source), + OMPI_INT_2_FINT(*tag), c_comm, + &c_req); + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + *request = PMPI_Request_c2f(c_req); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/recv_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/recv_ts.c.in new file mode 100644 index 00000000000..5cada770821 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/recv_ts.c.in @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID recv(BUFFER_OUT x, COUNT count, DATATYPE datatype, + RANK source, TAG tag, COMM comm, STATUS_OUT status) +{ + OMPI_FORTRAN_STATUS_DECLARATION(c_status,c_status2) + MPI_Comm c_comm = PMPI_Comm_f2c(*comm); + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + int c_ierr; + void *buf = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count; + + OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + + OMPI_FORTRAN_STATUS_SET_POINTER(c_status,c_status2,status) + + /* Call the C function */ + c_ierr = @INNER_CALL@(OMPI_F2C_BOTTOM(buf), c_count, + c_datatype, OMPI_FINT_2_INT(*source), + OMPI_FINT_2_INT(*tag), c_comm, + c_status); + + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + OMPI_FORTRAN_STATUS_RETURN(c_status,c_status2,status,c_ierr) +} diff --git a/ompi/mpi/fortran/use-mpi-f08/reduce_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/reduce_f08.F90 deleted file mode 100644 index 1f9baea4005..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/reduce_f08.F90 +++ /dev/null @@ -1,31 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Reduce_f08(sendbuf,recvbuf,count,datatype,op,root,comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Op, MPI_Comm - use :: ompi_mpifh_bindings, only : ompi_reduce_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE :: recvbuf - INTEGER, INTENT(IN) :: count, root - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Op), INTENT(IN) :: op - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_reduce_f(sendbuf,recvbuf,count,datatype%MPI_VAL,& - op%MPI_VAL,root,comm%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Reduce_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/reduce_init_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/reduce_init_f08.F90 deleted file mode 100644 index 00dbda4965f..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/reduce_init_f08.F90 +++ /dev/null @@ -1,34 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2022 Cisco Systems, Inc. All rights reserved -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2021 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Reduce_init_f08(sendbuf,recvbuf,count,datatype,op,root,comm,info,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Op, MPI_Comm, MPI_Info, MPI_Request - use :: ompi_mpifh_bindings, only : ompi_reduce_init_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: count, root - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Op), INTENT(IN) :: op - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_reduce_init_f(sendbuf,recvbuf,count,datatype%MPI_VAL,& - op%MPI_VAL,root,comm%MPI_VAL,info%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Reduce_init_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/reduce_init_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/reduce_init_ts.c.in new file mode 100644 index 00000000000..90a4c2b3077 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/reduce_init_ts.c.in @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID reduce_init(BUFFER x1, BUFFER_OUT x2, COUNT count, + DATATYPE datatype, OP op, + RANK root, COMM comm, + INFO info, REQUEST_OUT request) +{ + int c_ierr; + MPI_Datatype c_type; + MPI_Op c_op; + MPI_Request c_request; + MPI_Info c_info; + MPI_Comm c_comm = PMPI_Comm_f2c(*comm); + char *sendbuf = OMPI_CFI_BASE_ADDR(x1), *recvbuf = OMPI_CFI_BASE_ADDR(x2); + + c_info = PMPI_Info_f2c(*info); + + OMPI_CFI_CHECK_CONTIGUOUS(x1, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + + c_type = PMPI_Type_f2c(*datatype); + c_op = PMPI_Op_f2c(*op); + + sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf); + sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); + recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); + + c_ierr = @INNER_CALL@(sendbuf, recvbuf, + OMPI_FINT_2_INT(*count), + c_type, c_op, + OMPI_FINT_2_INT(*root), + c_comm, + c_info, + &c_request); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + if (MPI_SUCCESS == c_ierr) { + *request = PMPI_Request_c2f(c_request); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/reduce_local_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/reduce_local_f08.F90 deleted file mode 100644 index ad9c10106b0..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/reduce_local_f08.F90 +++ /dev/null @@ -1,29 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Reduce_local_f08(inbuf,inoutbuf,count,datatype,op,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Op - use :: ompi_mpifh_bindings, only : ompi_reduce_local_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: inbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE :: inoutbuf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Op), INTENT(IN) :: op - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_reduce_local_f(inbuf,inoutbuf,count,datatype%MPI_VAL,op%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Reduce_local_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/reduce_local_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/reduce_local_ts.c.in new file mode 100644 index 00000000000..622c48182e3 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/reduce_local_ts.c.in @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2009-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID reduce_local(BUFFER x1, BUFFER_OUT x2, COUNT count, + DATATYPE datatype, OP op) +{ + int c_ierr; + MPI_Datatype c_type; + MPI_Op c_op; + char *inbuf = OMPI_CFI_BASE_ADDR(x1), *inoutbuf = OMPI_CFI_BASE_ADDR(x2); + + OMPI_CFI_CHECK_CONTIGUOUS(x1, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(MPI_COMM_SELF, c_ierr, FUNC_NAME) + return; + } + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(MPI_COMM_SELF, c_ierr, FUNC_NAME) + return; + } + + c_type = PMPI_Type_f2c(*datatype); + c_op = PMPI_Op_f2c(*op); + + inbuf = (char *) OMPI_F2C_BOTTOM(inbuf); + inoutbuf = (char *) OMPI_F2C_BOTTOM(inoutbuf); + + c_ierr = @INNER_CALL@(inbuf, inoutbuf, + (@COUNT_TYPE@) *count, + c_type, c_op); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/reduce_scatter_block_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/reduce_scatter_block_f08.F90 deleted file mode 100644 index 6bd4b38bbce..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/reduce_scatter_block_f08.F90 +++ /dev/null @@ -1,31 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Reduce_scatter_block_f08(sendbuf,recvbuf,recvcount,datatype,op,comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Op, MPI_Comm - use :: ompi_mpifh_bindings, only : ompi_reduce_scatter_block_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE :: recvbuf - INTEGER, INTENT(IN) :: recvcount - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Op), INTENT(IN) :: op - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_reduce_scatter_block_f(sendbuf,recvbuf,recvcount,& - datatype%MPI_VAL,op%MPI_VAL,comm%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Reduce_scatter_block_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/reduce_scatter_block_init_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/reduce_scatter_block_init_f08.F90 deleted file mode 100644 index 460f2a158c2..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/reduce_scatter_block_init_f08.F90 +++ /dev/null @@ -1,34 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2022 Cisco Systems, Inc. All rights reserved -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2021 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Reduce_scatter_block_init_f08(sendbuf,recvbuf,recvcount,datatype,op,comm,info,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Op, MPI_Comm, MPI_Info, MPI_Request - use :: ompi_mpifh_bindings, only : ompi_reduce_scatter_block_init_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: recvcount - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Op), INTENT(IN) :: op - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_reduce_scatter_block_init_f(sendbuf,recvbuf,recvcount,& - datatype%MPI_VAL,op%MPI_VAL,comm%MPI_VAL,info%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Reduce_scatter_block_init_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/reduce_scatter_block_init_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/reduce_scatter_block_init_ts.c.in new file mode 100644 index 00000000000..bfcd4c82512 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/reduce_scatter_block_init_ts.c.in @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID reduce_scatter_block_init(BUFFER x1, BUFFER_OUT x2, + COUNT recvcount, DATATYPE datatype, + OP op, COMM comm, INFO info, + REQUEST_OUT request) +{ + int c_ierr; + MPI_Comm c_comm = PMPI_Comm_f2c(*comm); + MPI_Datatype c_type; + MPI_Op c_op; + MPI_Info c_info; + MPI_Request c_request; + int size; + char *sendbuf = OMPI_CFI_BASE_ADDR(x1), *recvbuf = OMPI_CFI_BASE_ADDR(x2); + + c_info = PMPI_Info_f2c(*info); + + OMPI_CFI_CHECK_CONTIGUOUS(x1, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + c_type = PMPI_Type_f2c(*datatype); + c_op = PMPI_Op_f2c(*op); + + PMPI_Comm_size(c_comm, &size); + + sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf); + sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); + recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); + + c_ierr = @INNER_CALL@(sendbuf, recvbuf, + (@COUNT_TYPE@) *recvcount, + c_type, c_op, c_comm, + c_info, &c_request); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + if (MPI_SUCCESS == c_ierr) { + *request = PMPI_Request_c2f(c_request); + } + +} diff --git a/ompi/mpi/fortran/use-mpi-f08/reduce_scatter_block_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/reduce_scatter_block_ts.c.in new file mode 100644 index 00000000000..443da88c593 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/reduce_scatter_block_ts.c.in @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID reduce_scatter_block(BUFFER x1, BUFFER_OUT x2, + COUNT recvcount, DATATYPE datatype, + OP op, COMM comm) +{ + int c_ierr; + MPI_Comm c_comm = PMPI_Comm_f2c(*comm); + MPI_Datatype c_type; + MPI_Op c_op; + int size; + char *sendbuf = OMPI_CFI_BASE_ADDR(x1), *recvbuf = OMPI_CFI_BASE_ADDR(x2); + + OMPI_CFI_CHECK_CONTIGUOUS(x1, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + c_type = PMPI_Type_f2c(*datatype); + c_op = PMPI_Op_f2c(*op); + + PMPI_Comm_size(c_comm, &size); + + sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf); + sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); + recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); + + c_ierr = @INNER_CALL@(sendbuf, recvbuf, + (@COUNT_TYPE@) *recvcount, + c_type, c_op, c_comm); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/reduce_scatter_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/reduce_scatter_f08.F90 deleted file mode 100644 index a8587ea033b..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/reduce_scatter_f08.F90 +++ /dev/null @@ -1,31 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Reduce_scatter_f08(sendbuf,recvbuf,recvcounts,datatype,op,comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Op, MPI_Comm - use :: ompi_mpifh_bindings, only : ompi_reduce_scatter_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE :: recvbuf - INTEGER, INTENT(IN) :: recvcounts(*) - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Op), INTENT(IN) :: op - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_reduce_scatter_f(sendbuf,recvbuf,recvcounts,datatype%MPI_VAL,& - op%MPI_VAL,comm%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Reduce_scatter_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/reduce_scatter_init_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/reduce_scatter_init_f08.F90 deleted file mode 100644 index e7531662b47..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/reduce_scatter_init_f08.F90 +++ /dev/null @@ -1,34 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2022 Cisco Systems, Inc. All rights reserved -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2021 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Reduce_scatter_init_f08(sendbuf,recvbuf,recvcounts,datatype,op,comm,info,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Op, MPI_Comm, MPI_Info, MPI_Request - use :: ompi_mpifh_bindings, only : ompi_reduce_scatter_init_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) OMPI_ASYNCHRONOUS :: recvcounts(*) - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Op), INTENT(IN) :: op - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_reduce_scatter_init_f(sendbuf,recvbuf,recvcounts,datatype%MPI_VAL,& - op%MPI_VAL,comm%MPI_VAL,info%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Reduce_scatter_init_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/reduce_scatter_init_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/reduce_scatter_init_ts.c.in new file mode 100644 index 00000000000..dd091ce89a9 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/reduce_scatter_init_ts.c.in @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID reduce_scatter_init(BUFFER x1, BUFFER_OUT x2, + COUNT_ARRAY recvcounts, DATATYPE datatype, + OP op, COMM comm, INFO info, + REQUEST_OUT request) +{ + int c_ierr; + MPI_Comm c_comm = PMPI_Comm_f2c(*comm); + MPI_Datatype c_type; + MPI_Op c_op; + MPI_Request c_request; + MPI_Info c_info; + int size; + char *sendbuf = OMPI_CFI_BASE_ADDR(x1), *recvbuf = OMPI_CFI_BASE_ADDR(x2); + @COUNT_TYPE@ *tmp_recvcounts = NULL; + + c_info = PMPI_Info_f2c(*info); + + OMPI_CFI_CHECK_CONTIGUOUS(x1, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + + c_type = PMPI_Type_f2c(*datatype); + c_op = PMPI_Op_f2c(*op); + + PMPI_Comm_size(c_comm, &size); + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(recvcounts, tmp_recvcounts, size); + + sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf); + sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); + recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); + + c_ierr = @INNER_CALL@(sendbuf, + recvbuf, + tmp_recvcounts, + c_type, + c_op, + c_comm, + c_info, + &c_request); + if (MPI_SUCCESS == c_ierr) { + *request = PMPI_Request_c2f(c_request); + if ((recvcounts != NULL) && (recvcounts != tmp_recvcounts)) { + ompi_coll_base_nbc_request_t* nb_request = (ompi_coll_base_nbc_request_t*)c_request; + nb_request->data.release_arrays[0] = tmp_recvcounts; + nb_request->data.release_arrays[1] = NULL; + } + } else { + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP(recvcounts, tmp_recvcounts); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + +} diff --git a/ompi/mpi/fortran/use-mpi-f08/reduce_scatter_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/reduce_scatter_ts.c.in new file mode 100644 index 00000000000..3203c959999 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/reduce_scatter_ts.c.in @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID reduce_scatter(BUFFER x1, BUFFER_OUT x2, + COUNT_ARRAY recvcounts, DATATYPE datatype, + OP op, COMM comm) +{ + int c_ierr; + MPI_Comm c_comm = PMPI_Comm_f2c(*comm); + MPI_Datatype c_type; + MPI_Op c_op; + int size; + char *sendbuf = OMPI_CFI_BASE_ADDR(x1), *recvbuf = OMPI_CFI_BASE_ADDR(x2); + @COUNT_TYPE@ *tmp_recvcounts = NULL; + + OMPI_CFI_CHECK_CONTIGUOUS(x1, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + + c_type = PMPI_Type_f2c(*datatype); + c_op = PMPI_Op_f2c(*op); + + PMPI_Comm_size(c_comm, &size); + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(recvcounts, tmp_recvcounts, size); + + sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf); + sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); + recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); + + c_ierr = @INNER_CALL@(sendbuf, recvbuf, + tmp_recvcounts, + c_type, c_op, c_comm); + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP(recvcounts, tmp_recvcounts); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/reduce_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/reduce_ts.c.in new file mode 100644 index 00000000000..85a6d614213 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/reduce_ts.c.in @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID reduce(BUFFER x1, BUFFER_OUT x2, COUNT count, + DATATYPE datatype, OP op, + RANK root, COMM comm) +{ + int c_ierr; + MPI_Datatype c_type; + MPI_Op c_op; + MPI_Comm c_comm = PMPI_Comm_f2c(*comm); + char *sendbuf = OMPI_CFI_BASE_ADDR(x1), *recvbuf = OMPI_CFI_BASE_ADDR(x2); + + OMPI_CFI_CHECK_CONTIGUOUS(x1, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + + c_type = PMPI_Type_f2c(*datatype); + c_op = PMPI_Op_f2c(*op); + + sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf); + sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); + recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); + + c_ierr = @INNER_CALL@(sendbuf, recvbuf, + OMPI_FINT_2_INT(*count), + c_type, c_op, + OMPI_FINT_2_INT(*root), + c_comm); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/rget_accumulate_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/rget_accumulate_f08.F90 deleted file mode 100644 index f442abf2358..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/rget_accumulate_f08.F90 +++ /dev/null @@ -1,40 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2010-2022 Cisco Systems, Inc. All rights reserved -! Copyright (c) 2009-2014 Los Alamos National Security, LLC. -! All Rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Rget_accumulate_f08(origin_addr,origin_count,origin_datatype,& - result_addr,result_count,result_datatype,& - target_rank,target_disp,target_count, & - target_datatype,op,win,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Op, MPI_Win, MPI_Request, MPI_ADDRESS_KIND - use :: ompi_mpifh_bindings, only : ompi_rget_accumulate_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) OMPI_ASYNCHRONOUS :: origin_addr - INTEGER, INTENT(IN) :: origin_count, result_count, target_rank, target_count - TYPE(MPI_Datatype), INTENT(IN) :: origin_datatype - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: result_addr - TYPE(MPI_Datatype), INTENT(IN) :: result_datatype - INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: target_disp - TYPE(MPI_Datatype), INTENT(IN) :: target_datatype - TYPE(MPI_Op), INTENT(IN) :: op - TYPE(MPI_Win), INTENT(IN) :: win - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_rget_accumulate_f(origin_addr,origin_count,origin_datatype%MPI_VAL,& - result_addr,result_count,result_datatype%MPI_VAL,& - target_rank,target_disp,target_count,target_datatype%MPI_VAL,& - op%MPI_VAL,win%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Rget_accumulate_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/rget_accumulate_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/rget_accumulate_ts.c.in new file mode 100644 index 00000000000..3e257c2cbe3 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/rget_accumulate_ts.c.in @@ -0,0 +1,83 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2014-2016 Los Alamos National Security, LLC. All rights + * reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2015 FUJITSU LIMITED. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID rget_accumulate(BUFFER_ASYNC x1, COUNT origin_count, + DATATYPE origin_datatype, BUFFER_ASYNC_OUT x2, + COUNT result_count, DATATYPE result_datatype, + RANK target_rank, AINT target_disp, + COUNT target_count, DATATYPE target_datatype, + OP op, WIN win, REQUEST_OUT request) +{ + int c_ierr; + MPI_Datatype c_origin_datatype, c_origin_type = PMPI_Type_f2c(*origin_datatype); + MPI_Datatype c_result_datatype, c_result_type = PMPI_Type_f2c(*result_datatype); + MPI_Datatype c_target_datatype = PMPI_Type_f2c(*target_datatype); + MPI_Win c_win = PMPI_Win_f2c(*win); + MPI_Op c_op = PMPI_Op_f2c(*op); + char *origin_addr = OMPI_CFI_BASE_ADDR(x1); + @COUNT_TYPE@ c_origin_count = (@COUNT_TYPE@) *origin_count; + char *result_addr = OMPI_CFI_BASE_ADDR(x2); + @COUNT_TYPE@ c_result_count = (@COUNT_TYPE@) *result_count; + MPI_Request c_req; + + OMPI_CFI_2_C(x1, c_origin_count, c_origin_type, c_origin_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_win, c_ierr, FUNC_NAME) + return; + } + OMPI_CFI_2_C(x2, c_result_count, c_result_type, c_result_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + if (c_origin_datatype != c_origin_type) { + ompi_datatype_destroy(&c_origin_datatype); + } + OMPI_ERRHANDLER_INVOKE(c_win, c_ierr, FUNC_NAME); + return; + } + c_ierr = @INNER_CALL@(OMPI_F2C_BOTTOM(origin_addr), + c_origin_count, + c_origin_datatype, + OMPI_F2C_BOTTOM(result_addr), + c_result_count, + c_result_datatype, + OMPI_FINT_2_INT(*target_rank), + *target_disp, + (@COUNT_TYPE@) *target_count, + c_target_datatype, c_op, c_win, &c_req); + if (c_origin_datatype != c_origin_type) { + ompi_datatype_destroy(&c_origin_datatype); + } + if (c_result_datatype != c_result_type) { + ompi_datatype_destroy(&c_result_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + *request = PMPI_Request_c2f(c_req); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/rget_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/rget_f08.F90 deleted file mode 100644 index 5e419fa8bfb..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/rget_f08.F90 +++ /dev/null @@ -1,34 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2010-2022 Cisco Systems, Inc. All rights reserved -! Copyright (c) 2009-2014 Los Alamos National Security, LLC. -! All Rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Rget_f08(origin_addr,origin_count,origin_datatype,target_rank,& - target_disp,target_count,target_datatype,win,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Win, MPI_Request, MPI_ADDRESS_KIND - use :: ompi_mpifh_bindings, only : ompi_rget_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: origin_addr - INTEGER, INTENT(IN) :: origin_count, target_rank, target_count - TYPE(MPI_Datatype), INTENT(IN) :: origin_datatype - INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: target_disp - TYPE(MPI_Datatype), INTENT(IN) :: target_datatype - TYPE(MPI_Win), INTENT(IN) :: win - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_rget_f(origin_addr,origin_count,origin_datatype%MPI_VAL,target_rank,& - target_disp,target_count,target_datatype%MPI_VAL,win%MPI_VAL,& - request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Rget_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/rget_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/rget_ts.c.in new file mode 100644 index 00000000000..b2c55cc298b --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/rget_ts.c.in @@ -0,0 +1,61 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2014-2016 Los Alamos National Security, LLC. All rights + * reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID rget(BUFFER_ASYNC_OUT x, COUNT origin_count, + DATATYPE origin_datatype, RANK target_rank, + AINT target_disp, COUNT target_count, + DATATYPE target_datatype, WIN win, REQUEST_OUT request) +{ + int c_ierr; + MPI_Datatype c_origin_datatype, c_origin_type = PMPI_Type_f2c(*origin_datatype); + MPI_Datatype c_target_datatype = PMPI_Type_f2c(*target_datatype); + MPI_Win c_win = PMPI_Win_f2c(*win); + char *origin_addr = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_origin_count = (@COUNT_TYPE@) *origin_count; + MPI_Request c_req; + + OMPI_CFI_2_C(x, c_origin_count, c_origin_type, c_origin_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_win, c_ierr, FUNC_NAME); + return; + } + c_ierr = @INNER_CALL@(OMPI_F2C_BOTTOM(origin_addr), + c_origin_count, + c_origin_datatype, + OMPI_FINT_2_INT(*target_rank), + *target_disp, + (@COUNT_TYPE@) *target_count, + c_target_datatype, c_win, &c_req); + if (c_origin_datatype != c_origin_type) { + ompi_datatype_destroy(&c_origin_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + *request = PMPI_Request_c2f(c_req); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/rput_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/rput_f08.F90 deleted file mode 100644 index efbca357754..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/rput_f08.F90 +++ /dev/null @@ -1,34 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2010-2022 Cisco Systems, Inc. All rights reserved -! Copyright (c) 2009-2014 Los Alamos National Security, LLC. -! All Rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Rput_f08(origin_addr,origin_count,origin_datatype,target_rank,& - target_disp,target_count,target_datatype,win,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Win, MPI_Request, MPI_ADDRESS_KIND - use :: ompi_mpifh_bindings, only : ompi_rput_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) OMPI_ASYNCHRONOUS :: origin_addr - INTEGER, INTENT(IN) :: origin_count, target_rank, target_count - TYPE(MPI_Datatype), INTENT(IN) :: origin_datatype - INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: target_disp - TYPE(MPI_Datatype), INTENT(IN) :: target_datatype - TYPE(MPI_Win), INTENT(IN) :: win - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_rput_f(origin_addr,origin_count,origin_datatype%MPI_VAL,target_rank,& - target_disp,target_count,target_datatype%MPI_VAL,win%MPI_VAL,& - request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Rput_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/rput_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/rput_ts.c.in new file mode 100644 index 00000000000..bd3edbd2e33 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/rput_ts.c.in @@ -0,0 +1,61 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2014-2016 Los Alamos National Security, LLC. All rights + * reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID rput(BUFFER_ASYNC x, COUNT origin_count, + DATATYPE origin_datatype, RANK target_rank, + AINT target_disp, COUNT target_count, + DATATYPE target_datatype, WIN win, REQUEST_OUT request) +{ + int c_ierr; + MPI_Datatype c_origin_datatype, c_origin_type = PMPI_Type_f2c(*origin_datatype); + MPI_Datatype c_target_datatype = PMPI_Type_f2c(*target_datatype); + MPI_Win c_win = PMPI_Win_f2c(*win); + char *origin_addr = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_origin_count = (@COUNT_TYPE@) *origin_count; + MPI_Request c_req; + + OMPI_CFI_2_C(x, c_origin_count, c_origin_type, c_origin_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_win, c_ierr, FUNC_NAME); + return; + } + c_ierr = @INNER_CALL@(OMPI_F2C_BOTTOM(origin_addr), + c_origin_count, + c_origin_datatype, + OMPI_FINT_2_INT(*target_rank), + *target_disp, + (@COUNT_TYPE@) *target_count, + c_target_datatype, c_win, &c_req); + if (c_origin_datatype != c_origin_type) { + ompi_datatype_destroy(&c_origin_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + *request = PMPI_Request_c2f(c_req); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/rsend_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/rsend_f08.F90 deleted file mode 100644 index e00ebee63e9..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/rsend_f08.F90 +++ /dev/null @@ -1,28 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Rsend_f08(buf,count,datatype,dest,tag,comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm - use :: ompi_mpifh_bindings, only : ompi_rsend_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: buf - INTEGER, INTENT(IN) :: count, dest, tag - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_rsend_f(buf,count,datatype%MPI_VAL,dest,tag,comm%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Rsend_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/rsend_init_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/rsend_init_f08.F90 deleted file mode 100644 index 28a3e8a6d31..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/rsend_init_f08.F90 +++ /dev/null @@ -1,29 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Rsend_init_f08(buf,count,datatype,dest,tag,comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request - use :: ompi_mpifh_bindings, only : ompi_rsend_init_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS, INTENT(IN) :: buf - INTEGER, INTENT(IN) :: count, dest, tag - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_rsend_init_f(buf,count,datatype%MPI_VAL,dest,tag,comm%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Rsend_init_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/rsend_init_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/rsend_init_ts.c.in new file mode 100644 index 00000000000..7c4948edac7 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/rsend_init_ts.c.in @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID rsend_init(BUFFER_ASYNC x, COUNT count, + DATATYPE datatype, RANK dest, + TAG tag, COMM comm, + REQUEST_OUT request) +{ + int c_ierr; + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + MPI_Request c_req; + MPI_Comm c_comm = PMPI_Comm_f2c (*comm); + + void *buf = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count; + + OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + + c_ierr = @INNER_CALL@(OMPI_F2C_BOTTOM(buf), c_count, + c_datatype, OMPI_FINT_2_INT(*dest), + OMPI_FINT_2_INT(*tag), + c_comm, &c_req); + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + *request = PMPI_Request_c2f(c_req); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/rsend_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/rsend_ts.c.in new file mode 100644 index 00000000000..b46fbd78715 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/rsend_ts.c.in @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID rsend(BUFFER x, COUNT count, DATATYPE datatype, + RANK dest, TAG tag, COMM comm) +{ + int c_ierr; + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + MPI_Comm c_comm = PMPI_Comm_f2c (*comm); + + void *buf = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count; + + OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + + c_ierr = @INNER_CALL@(OMPI_F2C_BOTTOM(buf), c_count, + c_datatype, OMPI_FINT_2_INT(*dest), + OMPI_FINT_2_INT(*tag), c_comm); + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/scan_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/scan_f08.F90 deleted file mode 100644 index 78a09fa6dad..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/scan_f08.F90 +++ /dev/null @@ -1,31 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Scan_f08(sendbuf,recvbuf,count,datatype,op,comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Op, MPI_Comm - use :: ompi_mpifh_bindings, only : ompi_scan_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE :: recvbuf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Op), INTENT(IN) :: op - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_scan_f(sendbuf,recvbuf,count,datatype%MPI_VAL,& - op%MPI_VAL,comm%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Scan_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/scan_init_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/scan_init_f08.F90 deleted file mode 100644 index 0b7fe3b993d..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/scan_init_f08.F90 +++ /dev/null @@ -1,34 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2022 Cisco Systems, Inc. All rights reserved -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2021 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Scan_init_f08(sendbuf,recvbuf,count,datatype,op,comm,info,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Op, MPI_Comm, MPI_Info, MPI_Request - use :: ompi_mpifh_bindings, only : ompi_scan_init_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Op), INTENT(IN) :: op - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_scan_init_f(sendbuf,recvbuf,count,datatype%MPI_VAL,& - op%MPI_VAL,comm%MPI_VAL,info%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Scan_init_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/scan_init_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/scan_init_ts.c.in new file mode 100644 index 00000000000..7ed6a8c07d8 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/scan_init_ts.c.in @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID scan_init(BUFFER x1, BUFFER_OUT x2, COUNT count, + DATATYPE datatype, OP op, COMM comm, + INFO info, REQUEST_OUT request) +{ + int c_ierr; + MPI_Comm c_comm = PMPI_Comm_f2c(*comm); + MPI_Datatype c_type; + MPI_Op c_op; + MPI_Info c_info; + MPI_Request c_request; + char *sendbuf = OMPI_CFI_BASE_ADDR(x1), *recvbuf = OMPI_CFI_BASE_ADDR(x2); + + c_info = PMPI_Info_f2c(*info); + + OMPI_CFI_CHECK_CONTIGUOUS(x1, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + + c_type = PMPI_Type_f2c(*datatype); + c_op = PMPI_Op_f2c(*op); + + sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf); + sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); + recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); + + c_ierr = @INNER_CALL@(sendbuf, recvbuf, + (@COUNT_TYPE@) *count, + c_type, c_op, + c_comm, + c_info, + &c_request); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + *request = PMPI_Request_c2f(c_request); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/scan_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/scan_ts.c.in new file mode 100644 index 00000000000..c7fcba1411f --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/scan_ts.c.in @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID scan(BUFFER x1, BUFFER_OUT x2, COUNT count, + DATATYPE datatype, OP op, COMM comm) +{ + int c_ierr; + MPI_Comm c_comm = PMPI_Comm_f2c(*comm); + MPI_Datatype c_type; + MPI_Op c_op; + char *sendbuf = OMPI_CFI_BASE_ADDR(x1), *recvbuf = OMPI_CFI_BASE_ADDR(x2); + + OMPI_CFI_CHECK_CONTIGUOUS(x1, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + + c_type = PMPI_Type_f2c(*datatype); + c_op = PMPI_Op_f2c(*op); + + sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf); + sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); + recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); + + c_ierr = @INNER_CALL@(sendbuf, recvbuf, + (@COUNT_TYPE@) *count, + c_type, c_op, + c_comm); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/scatter_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/scatter_f08.F90 deleted file mode 100644 index 26ee9507e6f..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/scatter_f08.F90 +++ /dev/null @@ -1,32 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Scatter_f08(sendbuf,sendcount,sendtype,recvbuf,& - recvcount,recvtype,root,comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm - use :: ompi_mpifh_bindings, only : ompi_scatter_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE :: recvbuf - INTEGER, INTENT(IN) :: sendcount, recvcount, root - TYPE(MPI_Datatype), INTENT(IN) :: sendtype - TYPE(MPI_Datatype), INTENT(IN) :: recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_scatter_f(sendbuf,sendcount,sendtype%MPI_VAL,recvbuf,recvcount,& - recvtype%MPI_VAL,root,comm%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Scatter_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/scatter_init_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/scatter_init_f08.F90 deleted file mode 100644 index e892d27dea8..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/scatter_init_f08.F90 +++ /dev/null @@ -1,35 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2022 Cisco Systems, Inc. All rights reserved -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2021 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Scatter_init_f08(sendbuf,sendcount,sendtype,recvbuf,& - recvcount,recvtype,root,comm,info,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Info, MPI_Request - use :: ompi_mpifh_bindings, only : ompi_scatter_init_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: sendcount, recvcount, root - TYPE(MPI_Datatype), INTENT(IN) :: sendtype - TYPE(MPI_Datatype), INTENT(IN) :: recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_scatter_init_f(sendbuf,sendcount,sendtype%MPI_VAL,recvbuf,recvcount,& - recvtype%MPI_VAL,root,comm%MPI_VAL,info%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Scatter_init_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/scatter_init_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/scatter_init_ts.c.in new file mode 100644 index 00000000000..94f94eb5c85 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/scatter_init_ts.c.in @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2013 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID scatter_init(BUFFER x1, COUNT sendcount, + DATATYPE sendtype, BUFFER_OUT x2, + COUNT recvcount, DATATYPE recvtype, + RANK root, COMM comm, INFO info, REQUEST_OUT request) +{ + int c_ierr; + MPI_Comm c_comm = PMPI_Comm_f2c(*comm); + int c_root = OMPI_FINT_2_INT(*root); + MPI_Datatype c_sendtype = NULL, c_recvtype = NULL, c_recvdatatype = NULL; + void *sendbuf = OMPI_CFI_BASE_ADDR(x1), *recvbuf = OMPI_CFI_BASE_ADDR(x2); + MPI_Info c_info; + MPI_Request c_request; + @COUNT_TYPE@ c_sendcount = 0, c_recvcount = 0; + + c_info = PMPI_Info_f2c(*info); + + if (OMPI_COMM_IS_INTER(c_comm)) { + if (MPI_ROOT == c_root) { + c_sendtype = PMPI_Type_f2c(*sendtype); + c_sendcount = (@COUNT_TYPE@) *sendcount; + OMPI_CFI_CHECK_CONTIGUOUS(x1, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + } else if (MPI_PROC_NULL != c_root) { + c_recvtype = PMPI_Type_f2c(*recvtype); + c_recvcount = (@COUNT_TYPE@) *recvcount; + OMPI_CFI_2_C(x2, c_recvcount, c_recvtype, c_recvdatatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + } + } else { + if (ompi_comm_rank(c_comm) == c_root) { + c_sendtype = PMPI_Type_f2c(*sendtype); + c_sendcount = (@COUNT_TYPE@) *sendcount; + OMPI_CFI_CHECK_CONTIGUOUS(x1, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + } + if (OMPI_IS_FORTRAN_IN_PLACE(recvbuf)) { + recvbuf = MPI_IN_PLACE; + } else { + c_recvtype = PMPI_Type_f2c(*recvtype); + c_recvcount = (@COUNT_TYPE@) *recvcount; + OMPI_CFI_2_C(x2, c_recvcount, c_recvtype, c_recvdatatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + } + } + + sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); + recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); + + c_ierr = @INNER_CALL@(sendbuf,c_sendcount, c_sendtype, + recvbuf, c_recvcount, c_recvdatatype, + c_root, c_comm, c_info, &c_request); + if (MPI_SUCCESS == c_ierr) { + *request = PMPI_Request_c2f(c_request); + } + + if ((c_recvdatatype != NULL ) && (c_recvdatatype != c_recvtype)){ + ompi_datatype_destroy(&c_recvdatatype); + } + + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + +} diff --git a/ompi/mpi/fortran/use-mpi-f08/scatter_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/scatter_ts.c.in new file mode 100644 index 00000000000..7eb27a09fda --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/scatter_ts.c.in @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2013 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID scatter(BUFFER x1, COUNT sendcount, + DATATYPE sendtype, BUFFER_OUT x2, + COUNT recvcount, DATATYPE recvtype, + RANK root, COMM comm) +{ + int c_ierr; + MPI_Comm c_comm = PMPI_Comm_f2c(*comm); + int c_root = OMPI_FINT_2_INT(*root); + MPI_Datatype c_sendtype = NULL, c_recvtype = NULL, c_recvdatatype = NULL; + void *sendbuf = OMPI_CFI_BASE_ADDR(x1), *recvbuf = OMPI_CFI_BASE_ADDR(x2); + @COUNT_TYPE@ c_sendcount = 0, c_recvcount = 0; + + if (OMPI_COMM_IS_INTER(c_comm)) { + if (MPI_ROOT == c_root) { + c_sendtype = PMPI_Type_f2c(*sendtype); + c_sendcount = (@COUNT_TYPE@) *sendcount; + OMPI_CFI_CHECK_CONTIGUOUS(x1, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + } else if (MPI_PROC_NULL != c_root) { + c_recvtype = PMPI_Type_f2c(*recvtype); + c_recvcount = (@COUNT_TYPE@) *recvcount; + OMPI_CFI_2_C(x2, c_recvcount, c_recvtype, c_recvdatatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + } + } else { + if (ompi_comm_rank(c_comm) == c_root) { + c_sendtype = PMPI_Type_f2c(*sendtype); + c_sendcount = (@COUNT_TYPE@) *sendcount; + OMPI_CFI_CHECK_CONTIGUOUS(x1, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + } + if (OMPI_IS_FORTRAN_IN_PLACE(recvbuf)) { + recvbuf = MPI_IN_PLACE; + } else { + c_recvtype = PMPI_Type_f2c(*recvtype); + c_recvcount = (@COUNT_TYPE@) *recvcount; + OMPI_CFI_2_C(x2, c_recvcount, c_recvtype, c_recvdatatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + } + } + + sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); + recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); + + c_ierr = @INNER_CALL@(sendbuf,c_sendcount, c_sendtype, + recvbuf, c_recvcount, c_recvdatatype, + c_root, c_comm); + + if (c_recvdatatype != c_recvtype) { + ompi_datatype_destroy(&c_recvdatatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/scatterv_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/scatterv_f08.F90 deleted file mode 100644 index 931d264748b..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/scatterv_f08.F90 +++ /dev/null @@ -1,33 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Scatterv_f08(sendbuf,sendcounts,displs,sendtype,recvbuf,& - recvcount,recvtype,root,comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm - use :: ompi_mpifh_bindings, only : ompi_scatterv_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE :: recvbuf - INTEGER, INTENT(IN) :: recvcount, root - INTEGER, INTENT(IN) :: sendcounts(*), displs(*) - TYPE(MPI_Datatype), INTENT(IN) :: sendtype - TYPE(MPI_Datatype), INTENT(IN) :: recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_scatterv_f(sendbuf,sendcounts,displs,sendtype%MPI_VAL,recvbuf,& - recvcount,recvtype%MPI_VAL,root,comm%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Scatterv_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/scatterv_init_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/scatterv_init_f08.F90 deleted file mode 100644 index bbf3c77cdd0..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/scatterv_init_f08.F90 +++ /dev/null @@ -1,36 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2022 Cisco Systems, Inc. All rights reserved -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2021 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Scatterv_init_f08(sendbuf,sendcounts,displs,sendtype,recvbuf,& - recvcount,recvtype,root,comm,info,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Info, MPI_Request - use :: ompi_mpifh_bindings, only : ompi_scatterv_init_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) OMPI_ASYNCHRONOUS :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: recvbuf - INTEGER, INTENT(IN) :: recvcount, root - INTEGER, INTENT(IN) OMPI_ASYNCHRONOUS :: sendcounts(*), displs(*) - TYPE(MPI_Datatype), INTENT(IN) :: sendtype - TYPE(MPI_Datatype), INTENT(IN) :: recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_scatterv_init_f(sendbuf,sendcounts,displs,sendtype%MPI_VAL,recvbuf,& - recvcount,recvtype%MPI_VAL,root,comm%MPI_VAL,info%MPI_VAL,request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Scatterv_init_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/scatterv_init_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/scatterv_init_ts.c.in new file mode 100644 index 00000000000..aa91f4e262c --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/scatterv_init_ts.c.in @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2021 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2021 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID scatterv_init(BUFFER x1, COUNT_ARRAY sendcounts, + DISP_ARRAY displs, DATATYPE sendtype, + BUFFER_OUT x2, COUNT recvcount, + DATATYPE recvtype, RANK root, + COMM comm, INFO info, REQUEST_OUT request) +{ + int c_ierr; + int idx = 0; + MPI_Comm c_comm = PMPI_Comm_f2c(*comm); + int c_root = OMPI_FINT_2_INT(*root); + MPI_Datatype c_sendtype = NULL, c_recvtype = NULL, c_recvdatatype = NULL; + void *sendbuf = OMPI_CFI_BASE_ADDR(x1), *recvbuf = OMPI_CFI_BASE_ADDR(x2); + MPI_Info c_info; + MPI_Request c_request; + @COUNT_TYPE@ c_recvcount = 0; + @COUNT_TYPE@ *tmp_sendcounts = NULL; + @DISP_TYPE@ *tmp_displs = NULL; + + c_info = PMPI_Info_f2c(*info); + + if (OMPI_COMM_IS_INTER(c_comm)) { + if (MPI_ROOT == c_root) { + int size = ompi_comm_size(c_comm); + c_sendtype = PMPI_Type_f2c(*sendtype); + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(sendcounts, tmp_sendcounts, size); + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(displs, tmp_displs, size); + OMPI_CFI_CHECK_CONTIGUOUS(x1, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + } else if (MPI_PROC_NULL != c_root) { + c_recvtype = PMPI_Type_f2c(*recvtype); + c_recvcount = (@COUNT_TYPE@) *recvcount; + OMPI_CFI_2_C(x2, c_recvcount, c_recvtype, c_recvdatatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + } + } else { + if (ompi_comm_rank(c_comm) == c_root) { + int size = ompi_comm_size(c_comm); + c_sendtype = PMPI_Type_f2c(*sendtype); + OMPI_CFI_CHECK_CONTIGUOUS(x1, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(sendcounts, tmp_sendcounts, size); + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(displs, tmp_displs, size); + } + if (OMPI_IS_FORTRAN_IN_PLACE(recvbuf)) { + recvbuf = MPI_IN_PLACE; + } else { + c_recvtype = PMPI_Type_f2c(*recvtype); + c_recvcount = (@COUNT_TYPE@) *recvcount; + OMPI_CFI_2_C(x2, c_recvcount, c_recvtype, c_recvdatatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + } + } + + c_ierr = @INNER_CALL@(sendbuf, + tmp_sendcounts, + tmp_displs, + c_sendtype, + recvbuf, + c_recvcount, + c_recvdatatype, + c_root, + c_comm, + c_info, + &c_request); + if (NULL != ierr) { + *ierr = OMPI_INT_2_FINT(c_ierr); + } + if (MPI_SUCCESS == c_ierr) { + *request = PMPI_Request_c2f(c_request); + ompi_coll_base_nbc_request_t* nb_request = (ompi_coll_base_nbc_request_t*)c_request; + if (tmp_sendcounts != sendcounts) { + nb_request->data.release_arrays[idx++] = tmp_sendcounts; + } + if (tmp_displs != displs) { + nb_request->data.release_arrays[idx++] = tmp_displs; + } + nb_request->data.release_arrays[idx] = NULL; + } else { + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP(sendcounts, tmp_sendcounts); + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP(displs, tmp_displs); + } + + if ((c_recvdatatype != NULL ) && (c_recvdatatype != c_recvtype)){ + ompi_datatype_destroy(&c_recvdatatype); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/scatterv_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/scatterv_ts.c.in new file mode 100644 index 00000000000..23fad728bfe --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/scatterv_ts.c.in @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2013 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID scatterv(BUFFER x1, COUNT_ARRAY sendcounts, + DISP_ARRAY displs, DATATYPE sendtype, + BUFFER_OUT x2, COUNT recvcount, + DATATYPE recvtype, RANK root, + COMM comm) +{ + int c_ierr; + MPI_Comm c_comm = PMPI_Comm_f2c(*comm); + int c_root = OMPI_FINT_2_INT(*root); + MPI_Datatype c_sendtype = NULL, c_recvtype = NULL, c_recvdatatype = NULL; + void *sendbuf = OMPI_CFI_BASE_ADDR(x1), *recvbuf = OMPI_CFI_BASE_ADDR(x2); + @COUNT_TYPE@ c_recvcount = 0; + @COUNT_TYPE@ *tmp_sendcounts = NULL; + @DISP_TYPE@ *tmp_displs = NULL; + + if (OMPI_COMM_IS_INTER(c_comm)) { + if (MPI_ROOT == c_root) { + int size = ompi_comm_size(c_comm); + c_sendtype = PMPI_Type_f2c(*sendtype); + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(sendcounts, tmp_sendcounts, size); + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(displs, tmp_displs, size); + OMPI_CFI_CHECK_CONTIGUOUS(x1, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + } else if (MPI_PROC_NULL != c_root) { + c_recvtype = PMPI_Type_f2c(*recvtype); + c_recvcount = (@COUNT_TYPE@) *recvcount; + OMPI_CFI_2_C(x2, c_recvcount, c_recvtype, c_recvdatatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + } + } else { + if (ompi_comm_rank(c_comm) == c_root) { + int size = ompi_comm_size(c_comm); + c_sendtype = PMPI_Type_f2c(*sendtype); + OMPI_CFI_CHECK_CONTIGUOUS(x1, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(sendcounts, tmp_sendcounts, size); + OMPI_FORTRAN_BIGCOUNT_ARRAY_SET(displs, tmp_displs, size); + } + if (OMPI_IS_FORTRAN_IN_PLACE(recvbuf)) { + recvbuf = MPI_IN_PLACE; + } else { + c_recvtype = PMPI_Type_f2c(*recvtype); + c_recvcount = (@COUNT_TYPE@) *recvcount; + OMPI_CFI_2_C(x2, c_recvcount, c_recvtype, c_recvdatatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME) + return; + } + } + } + + c_ierr = @INNER_CALL@(sendbuf, + tmp_sendcounts, + tmp_displs, + c_sendtype, + recvbuf, c_recvcount, c_recvdatatype, + c_root, c_comm); + + if (c_recvdatatype != c_recvtype) { + ompi_datatype_destroy(&c_recvdatatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP(sendcounts, tmp_sendcounts); + OMPI_FORTRAN_BIGCOUNT_ARRAY_CLEANUP(displs, tmp_displs); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/send_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/send_f08.F90 deleted file mode 100644 index 25fecbffb7a..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/send_f08.F90 +++ /dev/null @@ -1,28 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Send_f08(buf,count,datatype,dest,tag,comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm - use :: ompi_mpifh_bindings, only : ompi_send_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: buf - INTEGER, INTENT(IN) :: count, dest, tag - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_send_f(buf,count,datatype%MPI_VAL,dest,tag,comm%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Send_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/send_init_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/send_init_f08.F90 deleted file mode 100644 index 769501bddb6..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/send_init_f08.F90 +++ /dev/null @@ -1,30 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Send_init_f08(buf,count,datatype,dest,tag,comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request - use :: ompi_mpifh_bindings, only : ompi_send_init_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS, INTENT(IN) :: buf - INTEGER, INTENT(IN) :: count, dest, tag - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_send_init_f(buf,count,datatype%MPI_VAL,dest,tag,comm%MPI_VAL, & - request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Send_init_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/send_init_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/send_init_ts.c.in new file mode 100644 index 00000000000..edb96d73536 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/send_init_ts.c.in @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID send_init(BUFFER_ASYNC x, COUNT count, DATATYPE datatype, + RANK dest, TAG tag, COMM comm, + REQUEST_OUT request) +{ + int c_ierr; + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + MPI_Request c_req; + MPI_Comm c_comm = PMPI_Comm_f2c (*comm); + + void *buf = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count; + + OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + + c_ierr = @INNER_CALL@(OMPI_F2C_BOTTOM(buf), c_count, + c_datatype, OMPI_FINT_2_INT(*dest), + OMPI_FINT_2_INT(*tag), + c_comm, &c_req); + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + *request = PMPI_Request_c2f(c_req); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/send_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/send_ts.c.in new file mode 100644 index 00000000000..b35715f5d55 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/send_ts.c.in @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID send(BUFFER x, COUNT count, DATATYPE datatype, RANK dest, + TAG tag, COMM comm) +{ + int c_ierr; + + MPI_Comm c_comm = PMPI_Comm_f2c(*comm); + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + void *buf = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count; + + OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + c_ierr = @INNER_CALL@(OMPI_F2C_BOTTOM(buf), c_count, + c_datatype, OMPI_FINT_2_INT(*dest), + OMPI_FINT_2_INT(*tag), c_comm); + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/sendrecv_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/sendrecv_f08.F90 deleted file mode 100644 index 9cbef5c81e8..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/sendrecv_f08.F90 +++ /dev/null @@ -1,34 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Sendrecv_f08(sendbuf,sendcount,sendtype,dest,sendtag,recvbuf, & - recvcount,recvtype,source,recvtag,comm,status,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Status - use :: ompi_mpifh_bindings, only : ompi_sendrecv_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: sendbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE :: recvbuf - INTEGER, INTENT(IN) :: sendcount, dest, sendtag, recvcount, source, recvtag - TYPE(MPI_Datatype), INTENT(IN) :: sendtype - TYPE(MPI_Datatype), INTENT(IN) :: recvtype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Status), INTENT(OUT) :: status - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_sendrecv_f(sendbuf,sendcount,sendtype%MPI_VAL,dest,sendtag,recvbuf, & - recvcount,recvtype%MPI_VAL,source,recvtag,comm%MPI_VAL,status,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Sendrecv_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/sendrecv_replace_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/sendrecv_replace_f08.F90 deleted file mode 100644 index 4ed700efa61..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/sendrecv_replace_f08.F90 +++ /dev/null @@ -1,32 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Sendrecv_replace_f08(buf,count,datatype,dest,sendtag,source, & - recvtag,comm,status,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Status - use :: ompi_mpifh_bindings, only : ompi_sendrecv_replace_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE :: buf - INTEGER, INTENT(IN) :: count, dest, sendtag, source, recvtag - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Status), INTENT(OUT) :: status - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_sendrecv_replace_f(buf,count,datatype%MPI_VAL,dest,sendtag,source, & - recvtag,comm%MPI_VAL,status,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Sendrecv_replace_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/sendrecv_replace_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/sendrecv_replace_ts.c.in new file mode 100644 index 00000000000..84276dc33b6 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/sendrecv_replace_ts.c.in @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID sendrecv_replace(BUFFER_OUT x, COUNT count, DATATYPE datatype, + RANK dest, TAG sendtag, + RANK source, TAG recvtag, + COMM comm, STATUS_OUT status) +{ + int c_ierr; + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + MPI_Comm c_comm = PMPI_Comm_f2c (*comm); + + MPI_Status c_status; + void *buf = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ __opal_attribute_unused__ c_count = (@COUNT_TYPE@) *count; + + OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + + c_ierr = @INNER_CALL@(OMPI_F2C_BOTTOM(buf), + (@COUNT_TYPE@) *count, + c_datatype, + OMPI_FINT_2_INT(*dest), + OMPI_FINT_2_INT(*sendtag), + OMPI_FINT_2_INT(*source), + OMPI_FINT_2_INT(*recvtag), + c_comm, &c_status); + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr && + !OMPI_IS_FORTRAN_STATUS_IGNORE(status)) { + PMPI_Status_c2f(&c_status, status); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/sendrecv_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/sendrecv_ts.c.in new file mode 100644 index 00000000000..58619186a4c --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/sendrecv_ts.c.in @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID sendrecv(BUFFER x1, COUNT sendcount, DATATYPE sendtype, + RANK dest, TAG sendtag, BUFFER_OUT x2, + COUNT recvcount, DATATYPE recvtype, + RANK source, TAG recvtag, COMM comm, + STATUS_OUT status) +{ + int c_ierr; + MPI_Comm c_comm = PMPI_Comm_f2c (*comm); + + MPI_Datatype c_senddatatype, c_sendtype = PMPI_Type_f2c(*sendtype); + MPI_Datatype c_recvdatatype, c_recvtype = PMPI_Type_f2c(*recvtype); + MPI_Status c_status; + void *sendbuf = OMPI_CFI_BASE_ADDR(x1); + @COUNT_TYPE@ c_sendcount = (@COUNT_TYPE@) *sendcount; + void *recvbuf = OMPI_CFI_BASE_ADDR(x2); + @COUNT_TYPE@ c_recvcount = (@COUNT_TYPE@) *recvcount; + + OMPI_CFI_2_C(x1, c_sendcount, c_sendtype, c_senddatatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + OMPI_CFI_2_C(x2, c_recvcount, c_recvtype, c_recvdatatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + if (c_senddatatype != c_sendtype) { + ompi_datatype_destroy(&c_senddatatype); + } + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + + c_ierr = @INNER_CALL@(OMPI_F2C_BOTTOM(sendbuf), c_sendcount, + c_senddatatype, + OMPI_FINT_2_INT(*dest), + OMPI_FINT_2_INT(*sendtag), + OMPI_F2C_BOTTOM(recvbuf), c_recvcount, + c_recvdatatype, OMPI_FINT_2_INT(*source), + OMPI_FINT_2_INT(*recvtag), + c_comm, &c_status); + if (c_senddatatype != c_sendtype) { + ompi_datatype_destroy(&c_senddatatype); + } + if (c_recvdatatype != c_recvtype) { + ompi_datatype_destroy(&c_recvdatatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr && + !OMPI_IS_FORTRAN_STATUS_IGNORE(status)) { + PMPI_Status_c2f(&c_status, status); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/ssend_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/ssend_f08.F90 deleted file mode 100644 index b4221f659bb..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/ssend_f08.F90 +++ /dev/null @@ -1,28 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Ssend_f08(buf,count,datatype,dest,tag,comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm - use :: ompi_mpifh_bindings, only : ompi_ssend_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: buf - INTEGER, INTENT(IN) :: count, dest, tag - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_ssend_f(buf,count,datatype%MPI_VAL,dest,tag,comm%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Ssend_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/ssend_init_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/ssend_init_f08.F90 deleted file mode 100644 index e40b75c6108..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/ssend_init_f08.F90 +++ /dev/null @@ -1,30 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Ssend_init_f08(buf,count,datatype,dest,tag,comm,request,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request - use :: ompi_mpifh_bindings, only : ompi_ssend_init_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS, INTENT(IN) :: buf - INTEGER, INTENT(IN) :: count, dest, tag - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Request), INTENT(OUT) :: request - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_ssend_init_f(buf,count,datatype%MPI_VAL,dest,tag,comm%MPI_VAL, & - request%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Ssend_init_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/ssend_init_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/ssend_init_ts.c.in new file mode 100644 index 00000000000..e5a58d0f8f5 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/ssend_init_ts.c.in @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID ssend_init(BUFFER_ASYNC x, COUNT count, DATATYPE datatype, + RANK dest, TAG tag, + COMM comm, REQUEST_OUT request) +{ + int c_ierr; + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + MPI_Request c_req; + MPI_Comm c_comm = PMPI_Comm_f2c (*comm); + void *buf = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count; + + OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + + c_ierr = @INNER_CALL@(OMPI_F2C_BOTTOM(buf), c_count, + c_datatype, OMPI_FINT_2_INT(*dest), + OMPI_FINT_2_INT(*tag), + c_comm, &c_req); + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + *request = PMPI_Request_c2f(c_req); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/ssend_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/ssend_ts.c.in new file mode 100644 index 00000000000..ea82a0f75c0 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/ssend_ts.c.in @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID ssend(BUFFER x, COUNT count, DATATYPE datatype, + RANK dest, TAG tag, + COMM comm) +{ + int c_ierr; + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + MPI_Comm c_comm = PMPI_Comm_f2c (*comm); + + void *buf = OMPI_CFI_BASE_ADDR(x); + @COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count; + + OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + + c_ierr = @INNER_CALL@(OMPI_F2C_BOTTOM(buf), c_count, + c_datatype, OMPI_FINT_2_INT(*dest), + OMPI_FINT_2_INT(*tag), c_comm); + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/status_set_elements_c.in b/ompi/mpi/fortran/use-mpi-f08/status_set_elements_c.in new file mode 100644 index 00000000000..dcbc4fdb0c5 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/status_set_elements_c.in @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID status_set_elements(STATUS status, DATATYPE datatype, + COUNT_OUT count) +{ + int c_ierr; + MPI_Datatype c_type = PMPI_Type_f2c(*datatype); + MPI_Status c_status; + + /* This seems silly, but someone will do it */ + + if (OMPI_IS_FORTRAN_STATUS_IGNORE(status)) { + c_ierr = MPI_SUCCESS; + } else { + PMPI_Status_f2c( status, &c_status ); + + c_ierr = @INNER_CALL@(&c_status, c_type, + OMPI_FINT_2_INT(*count)); + + /* If datatype is really being set, then that needs to be + converted.... */ + if (MPI_SUCCESS == c_ierr) { + PMPI_Status_c2f(&c_status, status); + } + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/status_set_elements_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/status_set_elements_f08.F90 deleted file mode 100644 index 25f06ef3074..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/status_set_elements_f08.F90 +++ /dev/null @@ -1,25 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2010-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All Rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "mpi-f08-rename.h" - -subroutine MPI_Status_set_elements_f08(status,datatype,count,ierror) - use :: mpi_f08_types, only : MPI_Status, MPI_Datatype - use :: ompi_mpifh_bindings, only : ompi_status_set_elements_f - implicit none - TYPE(MPI_Status), INTENT(INOUT) :: status - TYPE(MPI_Datatype), INTENT(IN) :: datatype - INTEGER, INTENT(IN) :: count - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_status_set_elements_f(status,datatype%MPI_VAL,count,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Status_set_elements_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/testany.c.in b/ompi/mpi/fortran/use-mpi-f08/testany.c.in new file mode 100644 index 00000000000..49d8d998d69 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/testany.c.in @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2004-2005 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-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID testany(INT count, REQUEST_ARRAY array_of_requests:count, INT indx, + LOGICAL_OUT flag, STATUS_OUT status) +{ + MPI_Request *c_req; + MPI_Status c_status; + int i, c_ierr; + OMPI_LOGICAL_NAME_DECL(flag); + OMPI_SINGLE_NAME_DECL(indx); + + /* Shortcut to avoid malloc(0) if *count==0. We're intentionally + skipping other parameter error checks. */ + if (OPAL_UNLIKELY(0 == OMPI_FINT_2_INT(*count))) { + *flag = OMPI_FORTRAN_VALUE_TRUE; + *indx = OMPI_INT_2_FINT(MPI_UNDEFINED); + PMPI_Status_c2f(&ompi_status_empty, status); + *ierr = OMPI_INT_2_FINT(MPI_SUCCESS); + return; + } + + c_req = (MPI_Request *) malloc(OMPI_FINT_2_INT(*count) * sizeof(MPI_Request)); + if (c_req == NULL) { + c_ierr = OMPI_ERRHANDLER_NOHANDLE_INVOKE( + MPI_ERR_NO_MEM, + FUNC_NAME); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + return; + } + + for (i = 0; i < OMPI_FINT_2_INT(*count); ++i) { + c_req[i] = PMPI_Request_f2c(array_of_requests[i]); + } + + c_ierr = PMPI_Testany(OMPI_FINT_2_INT(*count), c_req, + OMPI_SINGLE_NAME_CONVERT(indx), + OMPI_LOGICAL_SINGLE_NAME_CONVERT(flag), + &c_status); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + OMPI_SINGLE_INT_2_LOGICAL(flag); + if (MPI_SUCCESS == c_ierr) { + + /* Increment index by one for fortran conventions. Note that + all Fortran compilers have FALSE==0; we just need to check + for any nonzero value (because TRUE is not always 1) */ + + OMPI_SINGLE_INT_2_FINT(indx); + if (*flag && + MPI_UNDEFINED != *(OMPI_SINGLE_NAME_CONVERT(indx))) { + array_of_requests[OMPI_INT_2_FINT(*indx)] = + c_req[OMPI_INT_2_FINT(*indx)]->req_f_to_c_index; + ++(*indx); + } + if (!OMPI_IS_FORTRAN_STATUS_IGNORE(status)) { + PMPI_Status_c2f(&c_status, status); + } + } + free(c_req); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/type_contiguous.c.in b/ompi/mpi/fortran/use-mpi-f08/type_contiguous.c.in new file mode 100644 index 00000000000..2209ffb5773 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/type_contiguous.c.in @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID type_contiguous(COUNT count, DATATYPE oldtype, + DATATYPE_OUT newtype) +{ + int c_ierr; + MPI_Datatype c_old = PMPI_Type_f2c(*oldtype); + MPI_Datatype c_new; + + c_ierr = @INNER_CALL@(OMPI_FINT_2_INT(*count), c_old, &c_new); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + *newtype = PMPI_Type_c2f(c_new); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/type_contiguous_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/type_contiguous_f08.F90 deleted file mode 100644 index cd00a5a0fd4..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/type_contiguous_f08.F90 +++ /dev/null @@ -1,25 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "mpi-f08-rename.h" - -subroutine MPI_Type_contiguous_f08(count,oldtype,newtype,ierror) - use :: mpi_f08_types, only : MPI_Datatype - use :: ompi_mpifh_bindings, only : ompi_type_contiguous_f - implicit none - INTEGER, INTENT(IN) :: count - TYPE(MPI_Datatype), INTENT(IN) :: oldtype - TYPE(MPI_Datatype), INTENT(OUT) :: newtype - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_type_contiguous_f(count,oldtype%MPI_VAL,newtype%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Type_contiguous_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/type_create_darray.c.in b/ompi/mpi/fortran/use-mpi-f08/type_create_darray.c.in new file mode 100644 index 00000000000..0e489438ced --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/type_create_darray.c.in @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID type_create_darray(INT size, RANK rank, + INT ndims, COUNT_ARRAY gsize_array, + INT_ARRAY distrib_array, INT_ARRAY darg_array, + INT_ARRAY psize_array, INT order, + DATATYPE oldtype, DATATYPE_OUT newtype) +{ + int c_ierr; + MPI_Datatype c_old = PMPI_Type_f2c(*oldtype); + MPI_Datatype c_new; + OMPI_ARRAY_NAME_DECL(gsize_array); + OMPI_ARRAY_NAME_DECL(distrib_array); + OMPI_ARRAY_NAME_DECL(darg_array); + OMPI_ARRAY_NAME_DECL(psize_array); + + OMPI_ARRAY_FINT_2_INT(gsize_array, *ndims); + OMPI_ARRAY_FINT_2_INT(distrib_array, *ndims); + OMPI_ARRAY_FINT_2_INT(darg_array, *ndims); + OMPI_ARRAY_FINT_2_INT(psize_array, *ndims); + + c_ierr = @INNER_CALL@(OMPI_FINT_2_INT(*size), + OMPI_FINT_2_INT(*rank), + OMPI_FINT_2_INT(*ndims), + OMPI_ARRAY_NAME_CONVERT(gsize_array), + OMPI_ARRAY_NAME_CONVERT(distrib_array), + OMPI_ARRAY_NAME_CONVERT(darg_array), + OMPI_ARRAY_NAME_CONVERT(psize_array), + OMPI_FINT_2_INT(*order), c_old, &c_new); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + OMPI_ARRAY_FINT_2_INT_CLEANUP(gsize_array); + OMPI_ARRAY_FINT_2_INT_CLEANUP(distrib_array); + OMPI_ARRAY_FINT_2_INT_CLEANUP(darg_array); + OMPI_ARRAY_FINT_2_INT_CLEANUP(psize_array); + + if (MPI_SUCCESS == c_ierr) { + *newtype = PMPI_Type_c2f(c_new); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/type_create_darray_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/type_create_darray_f08.F90 deleted file mode 100644 index 3f55f301c41..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/type_create_darray_f08.F90 +++ /dev/null @@ -1,30 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "mpi-f08-rename.h" - -subroutine MPI_Type_create_darray_f08(size,rank,ndims,& - array_of_gsizes,array_of_distribs,array_of_dargs,array_of_psizes,& - order,oldtype,newtype,ierror) - use :: mpi_f08_types, only : MPI_Datatype - use :: ompi_mpifh_bindings, only : ompi_type_create_darray_f - implicit none - INTEGER, INTENT(IN) :: size, rank, ndims, order - INTEGER, INTENT(IN) :: array_of_gsizes(*), array_of_distribs(*), array_of_dargs(*), array_of_psizes(*) - TYPE(MPI_Datatype), INTENT(IN) :: oldtype - TYPE(MPI_Datatype), INTENT(OUT) :: newtype - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_type_create_darray_f(size,rank,ndims, & - array_of_gsizes,array_of_distribs,array_of_dargs,array_of_psizes, & - order,oldtype%MPI_VAL,newtype%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Type_create_darray_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/type_create_hindexed.c.in b/ompi/mpi/fortran/use-mpi-f08/type_create_hindexed.c.in new file mode 100644 index 00000000000..9f076b219b5 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/type_create_hindexed.c.in @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2014 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID type_create_hindexed(COUNT count, + COUNT_ARRAY array_of_blocklengths, + AINT_COUNT_ARRAY array_of_displacements, + DATATYPE oldtype, + DATATYPE_OUT newtype) +{ + int c_ierr; + MPI_Datatype c_old = PMPI_Type_f2c(*oldtype); + MPI_Datatype c_new; + OMPI_ARRAY_NAME_DECL(array_of_blocklengths); + + OMPI_ARRAY_FINT_2_INT(array_of_blocklengths, *count); + + c_ierr = @INNER_CALL@(OMPI_FINT_2_INT(*count), + OMPI_ARRAY_NAME_CONVERT(array_of_blocklengths), + array_of_displacements, c_old, + &c_new); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + *newtype = PMPI_Type_c2f(c_new); + } + + OMPI_ARRAY_FINT_2_INT_CLEANUP(array_of_blocklengths); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/type_create_hindexed_block.c.in b/ompi/mpi/fortran/use-mpi-f08/type_create_hindexed_block.c.in new file mode 100644 index 00000000000..3f58e681490 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/type_create_hindexed_block.c.in @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2012 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2012 Inria. All rights reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID type_create_hindexed_block(COUNT count, COUNT blocklength, + AINT_COUNT_ARRAY array_of_displacements, + DATATYPE oldtype, DATATYPE_OUT newtype) +{ + int c_ierr; + MPI_Datatype c_old = PMPI_Type_f2c(*oldtype); + MPI_Datatype c_new; + + c_ierr = @INNER_CALL@(OMPI_FINT_2_INT(*count), + OMPI_FINT_2_INT(*blocklength), + array_of_displacements, + c_old, &c_new); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + *newtype = PMPI_Type_c2f(c_new); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/type_create_hindexed_block_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/type_create_hindexed_block_f08.F90 deleted file mode 100644 index f85fea57629..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/type_create_hindexed_block_f08.F90 +++ /dev/null @@ -1,30 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2012 The University of Tennessee and The University -! of Tennessee Research Foundation. All rights -! reserved. -! Copyright (c) 2012 Inria. All rights reserved. -! Copyright (c) 2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "mpi-f08-rename.h" - -subroutine MPI_Type_create_hindexed_block_f08(count,blocklength, & - array_of_displacements,oldtype,newtype,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_ADDRESS_KIND - use :: ompi_mpifh_bindings, only : ompi_type_create_hindexed_block_f - implicit none - INTEGER, INTENT(IN) :: count, blocklength - INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: array_of_displacements(count) - TYPE(MPI_Datatype), INTENT(IN) :: oldtype - TYPE(MPI_Datatype), INTENT(OUT) :: newtype - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_type_create_hindexed_block_f(count,blocklength,array_of_displacements, & - oldtype%MPI_VAL,newtype%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Type_create_hindexed_block_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/type_create_hindexed_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/type_create_hindexed_f08.F90 deleted file mode 100644 index 66443dd81cd..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/type_create_hindexed_f08.F90 +++ /dev/null @@ -1,30 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "mpi-f08-rename.h" - -subroutine MPI_Type_create_hindexed_f08(count,array_of_blocklengths, & - array_of_displacements,oldtype,newtype,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_ADDRESS_KIND - use :: ompi_mpifh_bindings, only : ompi_type_create_hindexed_f - implicit none - INTEGER, INTENT(IN) :: count - INTEGER, INTENT(IN) :: array_of_blocklengths(count) - INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: array_of_displacements(count) - TYPE(MPI_Datatype), INTENT(IN) :: oldtype - TYPE(MPI_Datatype), INTENT(OUT) :: newtype - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_type_create_hindexed_f(count,array_of_blocklengths, & - array_of_displacements,oldtype%MPI_VAL, & - newtype%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Type_create_hindexed_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/type_create_hvector.c.in b/ompi/mpi/fortran/use-mpi-f08/type_create_hvector.c.in new file mode 100644 index 00000000000..5756ca9dbef --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/type_create_hvector.c.in @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID type_create_hvector(COUNT count, COUNT blocklength, + AINT_COUNT stride, DATATYPE oldtype, + DATATYPE_OUT newtype) +{ + int c_ierr; + MPI_Datatype c_old = PMPI_Type_f2c(*oldtype); + MPI_Datatype c_new; + + c_ierr = @INNER_CALL@(OMPI_FINT_2_INT(*count), + OMPI_FINT_2_INT(*blocklength), + *stride, + c_old, &c_new); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + *newtype = PMPI_Type_c2f(c_new); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/type_create_hvector_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/type_create_hvector_f08.F90 deleted file mode 100644 index 87b93a7e675..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/type_create_hvector_f08.F90 +++ /dev/null @@ -1,27 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "mpi-f08-rename.h" - -subroutine MPI_Type_create_hvector_f08(count,blocklength,stride,oldtype,newtype,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_ADDRESS_KIND - use :: ompi_mpifh_bindings, only : ompi_type_create_hvector_f - implicit none - INTEGER, INTENT(IN) :: count, blocklength - INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: stride - TYPE(MPI_Datatype), INTENT(IN) :: oldtype - TYPE(MPI_Datatype), INTENT(OUT) :: newtype - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_type_create_hvector_f(count,blocklength,stride, & - oldtype%MPI_VAL,newtype%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Type_create_hvector_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/type_create_indexed_block.c.in b/ompi/mpi/fortran/use-mpi-f08/type_create_indexed_block.c.in new file mode 100644 index 00000000000..9c2eafca92d --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/type_create_indexed_block.c.in @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID type_create_indexed_block(COUNT count, COUNT blocklength, + COUNT_ARRAY array_of_displacements, + DATATYPE oldtype, DATATYPE_OUT newtype) +{ + int c_ierr; + MPI_Datatype c_old = PMPI_Type_f2c(*oldtype); + MPI_Datatype c_new; + OMPI_ARRAY_NAME_DECL(array_of_displacements); + + OMPI_ARRAY_FINT_2_INT(array_of_displacements, *count); + + c_ierr = @INNER_CALL@(OMPI_FINT_2_INT(*count), + OMPI_FINT_2_INT(*blocklength), + OMPI_ARRAY_NAME_CONVERT(array_of_displacements), + c_old, &c_new); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + *newtype = PMPI_Type_c2f(c_new); + } + + OMPI_ARRAY_FINT_2_INT_CLEANUP(array_of_displacements); +} + diff --git a/ompi/mpi/fortran/use-mpi-f08/type_create_indexed_block_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/type_create_indexed_block_f08.F90 deleted file mode 100644 index 956acbd0cc3..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/type_create_indexed_block_f08.F90 +++ /dev/null @@ -1,28 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "mpi-f08-rename.h" - -subroutine MPI_Type_create_indexed_block_f08(count,blocklength, & - array_of_displacements,oldtype,newtype,ierror) - use :: mpi_f08_types, only : MPI_Datatype - use :: ompi_mpifh_bindings, only : ompi_type_create_indexed_block_f - implicit none - INTEGER, INTENT(IN) :: count, blocklength - INTEGER, INTENT(IN) :: array_of_displacements(count) - TYPE(MPI_Datatype), INTENT(IN) :: oldtype - TYPE(MPI_Datatype), INTENT(OUT) :: newtype - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_type_create_indexed_block_f(count,blocklength,array_of_displacements, & - oldtype%MPI_VAL,newtype%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Type_create_indexed_block_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/type_create_struct.c.in b/ompi/mpi/fortran/use-mpi-f08/type_create_struct.c.in new file mode 100644 index 00000000000..a984f138bea --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/type_create_struct.c.in @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2004-2005 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-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID type_create_struct(COUNT count, + COUNT_ARRAY array_of_block_lengths, + AINT_COUNT_ARRAY array_of_displacements, + DATATYPE_ARRAY array_of_types, + DATATYPE_OUT newtype) +{ + MPI_Datatype c_new; + MPI_Datatype *c_type_old_array; + int i, c_ierr; + OMPI_ARRAY_NAME_DECL(array_of_block_lengths); + + c_type_old_array = (MPI_Datatype *) malloc(*count * sizeof(MPI_Datatype)); + if (NULL == c_type_old_array) { + c_ierr = OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_NO_MEM, + FUNC_NAME); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + return; + } + + for (i = 0; i < *count; i++) { + c_type_old_array[i] = PMPI_Type_f2c(array_of_types[i]); + } + + OMPI_ARRAY_FINT_2_INT(array_of_block_lengths, *count); + + c_ierr = @INNER_CALL@(OMPI_FINT_2_INT(*count), + OMPI_ARRAY_NAME_CONVERT(array_of_block_lengths), + array_of_displacements, c_type_old_array, &c_new); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + OMPI_ARRAY_FINT_2_INT_CLEANUP(array_of_block_lengths); + + if (MPI_SUCCESS == c_ierr) { + *newtype = PMPI_Type_c2f(c_new); + } + + free(c_type_old_array); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/type_create_struct_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/type_create_struct_f08.F90 deleted file mode 100644 index 92a1de45dbe..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/type_create_struct_f08.F90 +++ /dev/null @@ -1,29 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "mpi-f08-rename.h" - -subroutine MPI_Type_create_struct_f08(count,array_of_blocklengths,array_of_displacements, & - array_of_types,newtype,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_ADDRESS_KIND - use :: ompi_mpifh_bindings, only : ompi_type_create_struct_f - implicit none - INTEGER, INTENT(IN) :: count - INTEGER, INTENT(IN) :: array_of_blocklengths(count) - INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: array_of_displacements(count) - TYPE(MPI_Datatype), INTENT(IN) :: array_of_types(count) - TYPE(MPI_Datatype), INTENT(OUT) :: newtype - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_type_create_struct_f(count,array_of_blocklengths,array_of_displacements, & - array_of_types(:)%MPI_VAL,newtype%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Type_create_struct_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/type_create_subarray.c.in b/ompi/mpi/fortran/use-mpi-f08/type_create_subarray.c.in new file mode 100644 index 00000000000..bf8fb450944 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/type_create_subarray.c.in @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID type_create_subarray(INT ndims, COUNT_ARRAY size_array, + COUNT_ARRAY subsize_array, + COUNT_ARRAY start_array, INT order, + DATATYPE oldtype, DATATYPE_OUT newtype) +{ + int c_ierr; + MPI_Datatype c_old; + MPI_Datatype c_new; + OMPI_ARRAY_NAME_DECL(size_array); + OMPI_ARRAY_NAME_DECL(subsize_array); + OMPI_ARRAY_NAME_DECL(start_array); + + c_old = PMPI_Type_f2c(*oldtype); + + OMPI_ARRAY_FINT_2_INT(size_array, *ndims); + OMPI_ARRAY_FINT_2_INT(subsize_array, *ndims); + OMPI_ARRAY_FINT_2_INT(start_array, *ndims); + + c_ierr = @INNER_CALL@(OMPI_FINT_2_INT(*ndims), + OMPI_ARRAY_NAME_CONVERT(size_array), + OMPI_ARRAY_NAME_CONVERT(subsize_array), + OMPI_ARRAY_NAME_CONVERT(start_array), + *order, c_old, &c_new); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + *newtype = PMPI_Type_c2f(c_new); + } + + OMPI_ARRAY_FINT_2_INT_CLEANUP(size_array); + OMPI_ARRAY_FINT_2_INT_CLEANUP(subsize_array); + OMPI_ARRAY_FINT_2_INT_CLEANUP(start_array); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/type_create_subarray_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/type_create_subarray_f08.F90 deleted file mode 100644 index a870231b922..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/type_create_subarray_f08.F90 +++ /dev/null @@ -1,29 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "mpi-f08-rename.h" - -subroutine MPI_Type_create_subarray_f08(ndims,array_of_sizes,array_of_subsizes, & - array_of_starts,order,oldtype,newtype,ierror) - use :: mpi_f08_types, only : MPI_Datatype - use :: ompi_mpifh_bindings, only : ompi_type_create_subarray_f - implicit none - INTEGER, INTENT(IN) :: ndims, order - INTEGER, INTENT(IN) :: array_of_sizes(*), array_of_subsizes(*), array_of_starts(*) - TYPE(MPI_Datatype), INTENT(IN) :: oldtype - TYPE(MPI_Datatype), INTENT(OUT) :: newtype - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_type_create_subarray_f(ndims,array_of_sizes, & - array_of_subsizes,array_of_starts, & - order,oldtype%MPI_VAL,newtype%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Type_create_subarray_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/type_get_contents_f08_c.F90 b/ompi/mpi/fortran/use-mpi-f08/type_get_contents_f08_c.F90 new file mode 100644 index 00000000000..5b089fb9ca9 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/type_get_contents_f08_c.F90 @@ -0,0 +1,33 @@ +! -*- f90 -*- +! +! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. +! Copyright (c) 2009-2012 Los Alamos National Security, LLC. +! All rights reserved. +! Copyright (c) 2018-2020 Research Organization for Information Science +! and Technology (RIST). All rights reserved. +! $COPYRIGHT$ + +#include "mpi-f08-rename.h" + +subroutine MPI_Type_get_contents_f08_c(datatype, max_integers, max_addresses, max_large_counts, & + max_datatypes, array_of_integers, array_of_addresses, & + array_of_large_counts, array_of_datatypes, ierror) + use :: mpi_f08_types, only : MPI_Datatype, MPI_ADDRESS_KIND, MPI_COUNT_KIND + use :: ompi_mpifh_bindings, only : ompi_type_get_contents_f_c + implicit none + TYPE(MPI_Datatype), INTENT(IN) :: datatype + INTEGER(KIND=MPI_COUNT_KIND), INTENT(IN) :: max_integers, max_addresses, & + max_large_counts, max_datatypes + INTEGER, INTENT(OUT) :: array_of_integers(max_integers) + INTEGER(MPI_ADDRESS_KIND), INTENT(OUT) :: array_of_addresses(max_addresses) + INTEGER(KIND=MPI_COUNT_KIND), INTENT(OUT) :: array_of_large_counts(max_large_counts) + TYPE(MPI_Datatype), INTENT(OUT) :: array_of_datatypes(max_datatypes) + INTEGER, OPTIONAL, INTENT(OUT) :: ierror + integer :: c_ierror + + call ompi_type_get_contents_f_c(datatype%MPI_VAL,max_integers,max_addresses, & + max_large_counts, max_datatypes,array_of_integers,array_of_addresses, & + array_of_large_counts, array_of_datatypes(:)%MPI_VAL,c_ierror) + if (present(ierror)) ierror = c_ierror + +end subroutine MPI_Type_get_contents_f08_c diff --git a/ompi/mpi/fortran/use-mpi-f08/type_get_envelope_f08_c.F90 b/ompi/mpi/fortran/use-mpi-f08/type_get_envelope_f08_c.F90 new file mode 100644 index 00000000000..cefa541ba8b --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/type_get_envelope_f08_c.F90 @@ -0,0 +1,28 @@ +! -*- f90 -*- +! +! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. +! Copyright (c) 2009-2012 Los Alamos National Security, LLC. +! All rights reserved. +! Copyright (c) 2018-2020 Research Organization for Information Science +! and Technology (RIST). All rights reserved. +! $COPYRIGHT$ + +#include "mpi-f08-rename.h" + +subroutine MPI_Type_get_envelope_f08_c(datatype,num_integers,num_addresses, & + num_large_counts, num_datatypes,combiner,ierror) + use :: mpi_f08_types, only : MPI_Datatype, MPI_ADDRESS_KIND, MPI_COUNT_KIND + use :: ompi_mpifh_bindings, only : ompi_type_get_envelope_f_c + implicit none + TYPE(MPI_Datatype), INTENT(IN) :: datatype + INTEGER(KIND=MPI_COUNT_KIND), INTENT(OUT) :: num_integers, num_addresses, num_large_counts, & + num_datatypes, combiner + INTEGER, OPTIONAL, INTENT(OUT) :: ierror + integer :: c_ierror + + call ompi_type_get_envelope_f_c(datatype%MPI_VAL,num_integers,num_addresses, & + num_large_counts, num_datatypes,combiner,c_ierror) + if (present(ierror)) ierror = c_ierror + +end subroutine MPI_Type_get_envelope_f08_c + diff --git a/ompi/mpi/fortran/use-mpi-f08/type_get_true_extent.c.in b/ompi/mpi/fortran/use-mpi-f08/type_get_true_extent.c.in new file mode 100644 index 00000000000..32188707e20 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/type_get_true_extent.c.in @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID type_get_true_extent(DATATYPE datatype, AINT_OUT true_lb, AINT_OUT true_extent) +{ + int c_ierr; + MPI_Datatype c_type = PMPI_Type_f2c(*datatype); + + c_ierr = @INNER_CALL@(c_type, true_lb, true_extent); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/type_get_true_extent_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/type_get_true_extent_f08.F90 deleted file mode 100644 index de477a00bbe..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/type_get_true_extent_f08.F90 +++ /dev/null @@ -1,24 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "mpi-f08-rename.h" - -subroutine MPI_Type_get_true_extent_f08(datatype,true_lb,true_extent,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_ADDRESS_KIND - use :: ompi_mpifh_bindings, only : ompi_type_get_true_extent_f - implicit none - TYPE(MPI_Datatype), INTENT(IN) :: datatype - INTEGER(MPI_ADDRESS_KIND), INTENT(OUT) :: true_lb, true_extent - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_type_get_true_extent_f(datatype%MPI_VAL,true_lb,true_extent,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Type_get_true_extent_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/type_indexed.c.in b/ompi/mpi/fortran/use-mpi-f08/type_indexed.c.in new file mode 100644 index 00000000000..164f5ed73dd --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/type_indexed.c.in @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID type_indexed(COUNT count, COUNT_ARRAY array_of_blocklengths, + COUNT_ARRAY array_of_displacements, DATATYPE oldtype, + DATATYPE_OUT newtype) +{ + int c_ierr; + MPI_Datatype c_old = PMPI_Type_f2c(*oldtype); + MPI_Datatype c_new; + OMPI_ARRAY_NAME_DECL(array_of_blocklengths); + OMPI_ARRAY_NAME_DECL(array_of_displacements); + + OMPI_ARRAY_FINT_2_INT(array_of_blocklengths, *count); + OMPI_ARRAY_FINT_2_INT(array_of_displacements, *count); + + c_ierr = @INNER_CALL@(OMPI_FINT_2_INT(*count), + OMPI_ARRAY_NAME_CONVERT(array_of_blocklengths), + OMPI_ARRAY_NAME_CONVERT(array_of_displacements), + c_old, &c_new); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + OMPI_ARRAY_FINT_2_INT_CLEANUP(array_of_blocklengths); + OMPI_ARRAY_FINT_2_INT_CLEANUP(array_of_displacements); + + if (MPI_SUCCESS == c_ierr) { + *newtype = PMPI_Type_c2f(c_new); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/type_indexed_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/type_indexed_f08.F90 deleted file mode 100644 index 813665ce6c1..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/type_indexed_f08.F90 +++ /dev/null @@ -1,28 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "mpi-f08-rename.h" - -subroutine MPI_Type_indexed_f08(count,array_of_blocklengths, & - array_of_displacements,oldtype,newtype,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_ADDRESS_KIND - use :: ompi_mpifh_bindings, only : ompi_type_indexed_f - implicit none - INTEGER, INTENT(IN) :: count - INTEGER, INTENT(IN) :: array_of_blocklengths(count), array_of_displacements(count) - TYPE(MPI_Datatype), INTENT(IN) :: oldtype - TYPE(MPI_Datatype), INTENT(OUT) :: newtype - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_type_indexed_f(count,array_of_blocklengths,array_of_displacements, & - oldtype%MPI_VAL,newtype%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Type_indexed_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/type_size.c.in b/ompi/mpi/fortran/use-mpi-f08/type_size.c.in new file mode 100644 index 00000000000..d8d50bcb069 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/type_size.c.in @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID type_size(DATATYPE type, COUNT size) +{ + int c_ierr; + MPI_Datatype c_type = PMPI_Type_f2c(*type); + OMPI_SINGLE_NAME_DECL(size); + + c_ierr = @INNER_CALL@(c_type, OMPI_SINGLE_NAME_CONVERT(size)); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + OMPI_SINGLE_INT_2_FINT(size); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/type_size_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/type_size_f08.F90 deleted file mode 100644 index 244a6e2378b..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/type_size_f08.F90 +++ /dev/null @@ -1,24 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "mpi-f08-rename.h" - -subroutine MPI_Type_size_f08(datatype,size,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_ADDRESS_KIND - use :: ompi_mpifh_bindings, only : ompi_type_size_f - implicit none - TYPE(MPI_Datatype), INTENT(IN) :: datatype - INTEGER, INTENT(OUT) :: size - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_type_size_f(datatype%MPI_VAL,size,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Type_size_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/type_vector.c.in b/ompi/mpi/fortran/use-mpi-f08/type_vector.c.in new file mode 100644 index 00000000000..5273387d080 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/type_vector.c.in @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID type_vector(COUNT count, COUNT blocklength, + COUNT stride, DATATYPE oldtype, + DATATYPE_OUT newtype) +{ + int c_ierr; + MPI_Datatype c_old; + MPI_Datatype c_new; + + c_old = PMPI_Type_f2c(*oldtype); + + c_ierr = @INNER_CALL@(OMPI_FINT_2_INT(*count), + OMPI_FINT_2_INT(*blocklength), + OMPI_FINT_2_INT(*stride), + c_old, &c_new); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + *newtype = PMPI_Type_c2f(c_new); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/type_vector_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/type_vector_f08.F90 deleted file mode 100644 index 66791440104..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/type_vector_f08.F90 +++ /dev/null @@ -1,26 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "mpi-f08-rename.h" - -subroutine MPI_Type_vector_f08(count,blocklength,stride,oldtype,newtype,ierror) - use :: mpi_f08_types, only : MPI_Datatype - use :: ompi_mpifh_bindings, only : ompi_type_vector_f - implicit none - INTEGER, INTENT(IN) :: count, blocklength, stride - TYPE(MPI_Datatype), INTENT(IN) :: oldtype - TYPE(MPI_Datatype), INTENT(OUT) :: newtype - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_type_vector_f(count,blocklength,stride, & - oldtype%MPI_VAL,newtype%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Type_vector_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/unpack_external_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/unpack_external_f08.F90 deleted file mode 100644 index 8cf2e637fe8..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/unpack_external_f08.F90 +++ /dev/null @@ -1,33 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Unpack_external_f08(datarep,inbuf,insize,position,outbuf,outcount,datatype,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_ADDRESS_KIND - use :: ompi_mpifh_bindings, only : ompi_unpack_external_f - implicit none - CHARACTER(LEN=*), INTENT(IN) :: datarep - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: inbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE :: outbuf - INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: insize - INTEGER(MPI_ADDRESS_KIND), INTENT(INOUT) :: position - INTEGER, INTENT(IN) :: outcount - TYPE(MPI_Datatype), INTENT(IN) :: datatype - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_unpack_external_f(datarep,inbuf,insize,position,outbuf,& - outcount,datatype%MPI_VAL,c_ierror,len(datarep)) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Unpack_external_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/unpack_external_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/unpack_external_ts.c.in new file mode 100644 index 00000000000..adbf2e9e04c --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/unpack_external_ts.c.in @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID unpack_external(CHAR_ARRAY datarep, BUFFER x1, COUNT insize, + AINT_COUNT_INOUT position, BUFFER x2, + COUNT_OUT outcount, DATATYPE datatype) +{ + int c_ierr; + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + char *inbuf = OMPI_CFI_BASE_ADDR(x1); + void *outbuf = OMPI_CFI_BASE_ADDR(x2); + int c_outcount = OMPI_FINT_2_INT(*outcount); + + c_type = PMPI_Type_f2c(*datatype); + + OMPI_CFI_CHECK_CONTIGUOUS(x1, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(MPI_COMM_SELF, c_ierr, FUNC_NAME); + return; + } + + OMPI_CFI_2_C(x2, c_outcount, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(MPI_COMM_SELF, c_ierr, FUNC_NAME); + return; + } + + c_ierr = @INNER_CALL@(datarep, inbuf, + *insize, + position, + OMPI_F2C_BOTTOM(outbuf), + c_outcount, + c_datatype); + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + +} diff --git a/ompi/mpi/fortran/use-mpi-f08/unpack_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/unpack_f08.F90 deleted file mode 100644 index 0f91d7859bc..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/unpack_f08.F90 +++ /dev/null @@ -1,32 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Unpack_f08(inbuf,insize,position,outbuf,outcount,datatype,comm,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm - use :: ompi_mpifh_bindings, only : ompi_unpack_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: inbuf - OMPI_FORTRAN_IGNORE_TKR_TYPE :: outbuf - INTEGER, INTENT(IN) :: insize, outcount - INTEGER, INTENT(INOUT) :: position - TYPE(MPI_Datatype), INTENT(IN) :: datatype - TYPE(MPI_Comm), INTENT(IN) :: comm - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_unpack_f(inbuf,insize,position,outbuf,outcount, & - datatype%MPI_VAL,comm%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Unpack_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/unpack_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/unpack_ts.c.in new file mode 100644 index 00000000000..ba8e2138a6b --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/unpack_ts.c.in @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID unpack(BUFFER x1, COUNT insize, COUNT_INOUT position, + BUFFER_OUT x2, COUNT_OUT outcount, DATATYPE datatype, + COMM comm) +{ + int c_ierr; + MPI_Comm c_comm = PMPI_Comm_f2c(*comm); + MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); + OMPI_SINGLE_NAME_DECL(position); + char *inbuf = OMPI_CFI_BASE_ADDR(x1); + void *outbuf = OMPI_CFI_BASE_ADDR(x2); + int c_outcount = OMPI_FINT_2_INT(*outcount); + + OMPI_CFI_CHECK_CONTIGUOUS(x1, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + + OMPI_CFI_2_C(x2, c_outcount, c_type, c_datatype, c_ierr); + if (MPI_SUCCESS != c_ierr) { + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + return; + } + + OMPI_SINGLE_FINT_2_INT(position); + + c_ierr = @INNER_CALL@(inbuf, OMPI_FINT_2_INT(*insize), + OMPI_SINGLE_NAME_CONVERT(position), + OMPI_F2C_BOTTOM(outbuf), c_outcount, + c_datatype, c_comm); + if (c_datatype != c_type) { + ompi_datatype_destroy(&c_datatype); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + OMPI_SINGLE_INT_2_FINT(position); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/waitall.c.in b/ompi/mpi/fortran/use-mpi-f08/waitall.c.in new file mode 100644 index 00000000000..38cd9389722 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/waitall.c.in @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2004-2005 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-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID waitall(INT count, REQUEST_ARRAY array_of_requests:count, + STATUS_ARRAY array_of_statuses) +{ + MPI_Request *c_req; + MPI_Status *c_status; + int i, c_ierr; + + /* Shortcut to avoid malloc(0) if *count==0. We're intentionally + skipping other parameter error checks. */ + if (OPAL_UNLIKELY(0 == OMPI_FINT_2_INT(*count))) { + *ierr = OMPI_INT_2_FINT(MPI_SUCCESS); + return; + } + + c_req = (MPI_Request *) malloc(OMPI_FINT_2_INT(*count) * + (sizeof(MPI_Request) + sizeof(MPI_Status))); + if (NULL == c_req) { + c_ierr = OMPI_ERRHANDLER_NOHANDLE_INVOKE( + MPI_ERR_NO_MEM, + FUNC_NAME); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + return; + } + c_status = (MPI_Status*) (c_req + OMPI_FINT_2_INT(*count)); + + for (i = 0; i < OMPI_FINT_2_INT(*count); ++i) { + c_req[i] = PMPI_Request_f2c(array_of_requests[i]); + } + + c_ierr = PMPI_Waitall(OMPI_FINT_2_INT(*count), c_req, c_status); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + for (i = 0; i < OMPI_FINT_2_INT(*count); ++i) { + array_of_requests[i] = c_req[i]->req_f_to_c_index; + if (!OMPI_IS_FORTRAN_STATUSES_IGNORE(array_of_statuses) && + !OMPI_IS_FORTRAN_STATUS_IGNORE(&array_of_statuses[i])) { + PMPI_Status_c2f( &c_status[i], &array_of_statuses[i * (sizeof(MPI_Status) / sizeof(int))]); + } + } + } + free(c_req); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/waitall_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/waitall_f08.F90 deleted file mode 100644 index f07551d4c45..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/waitall_f08.F90 +++ /dev/null @@ -1,25 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "mpi-f08-rename.h" - -subroutine MPI_Waitall_f08(count,array_of_requests,array_of_statuses,ierror) - use :: mpi_f08_types, only : MPI_Request, MPI_Status - use :: ompi_mpifh_bindings, only : ompi_waitall_f - implicit none - INTEGER, INTENT(IN) :: count - TYPE(MPI_Request), INTENT(INOUT) :: array_of_requests(count) - TYPE(MPI_Status), INTENT(OUT) :: array_of_statuses(*) - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_waitall_f(count,array_of_requests(:)%MPI_VAL,array_of_statuses,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Waitall_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/win_allocate.c.in b/ompi/mpi/fortran/use-mpi-f08/win_allocate.c.in new file mode 100644 index 00000000000..ea639f4bb68 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/win_allocate.c.in @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2014 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) 2011-2014 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID win_allocate(AINT size, DISP disp_unit, + INFO info, COMM comm, C_PTR_OUT baseptr, + WIN_OUT win) +{ + int c_ierr; + MPI_Info c_info; + MPI_Comm c_comm; + MPI_Win c_win; + + c_info = PMPI_Info_f2c(*info); + c_comm = PMPI_Comm_f2c(*comm); + + c_ierr = @INNER_CALL@(*size, OMPI_FINT_2_INT(*disp_unit), + c_info, c_comm, + baseptr, &c_win); + *win = PMPI_Win_c2f(c_win); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/win_allocate_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/win_allocate_f08.F90 deleted file mode 100644 index a0f4f06562d..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/win_allocate_f08.F90 +++ /dev/null @@ -1,32 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2010-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All Rights reserved. -! Copyright (c) 2004-2014 High Performance Computing Center Stuttgart, -! University of Stuttgart. All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "mpi-f08-rename.h" - -subroutine MPI_Win_allocate_f08(size, disp_unit, info, comm, & - baseptr, win, ierror) - USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR - use :: mpi_f08_types, only : MPI_Info, MPI_Comm, MPI_Win, MPI_ADDRESS_KIND - use :: ompi_mpifh_bindings, only : ompi_win_allocate_f - implicit none - INTEGER(KIND=MPI_ADDRESS_KIND), INTENT(IN) :: size - INTEGER, INTENT(IN) :: disp_unit - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(C_PTR), INTENT(OUT) :: baseptr - TYPE(MPI_Win), INTENT(OUT) :: win - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_win_allocate_f(size, disp_unit, info%MPI_VAL, comm%MPI_VAL, baseptr, win%MPI_VAL, c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Win_allocate_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/win_allocate_shared.c.in b/ompi/mpi/fortran/use-mpi-f08/win_allocate_shared.c.in new file mode 100644 index 00000000000..4e5e1d5c4e6 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/win_allocate_shared.c.in @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2014 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) 2011-2014 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID win_allocate_shared(AINT size, DISP disp_unit, + INFO info, COMM comm, C_PTR_OUT baseptr, + WIN win) +{ + int c_ierr; + MPI_Info c_info; + MPI_Comm c_comm; + MPI_Win c_win; + + c_info = PMPI_Info_f2c(*info); + c_comm = PMPI_Comm_f2c(*comm); + + c_ierr = @INNER_CALL@(*size, OMPI_FINT_2_INT(*disp_unit), + c_info, c_comm, + baseptr, &c_win); + *win = PMPI_Win_c2f(c_win); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/win_allocate_shared_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/win_allocate_shared_f08.F90 deleted file mode 100644 index ec692f900fb..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/win_allocate_shared_f08.F90 +++ /dev/null @@ -1,30 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2010-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All Rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "mpi-f08-rename.h" - -subroutine MPI_Win_allocate_shared_f08(size, disp_unit, info, comm, & - baseptr, win, ierror) - USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR - use :: mpi_f08_types, only : MPI_Info, MPI_Comm, MPI_Win, MPI_ADDRESS_KIND - use :: ompi_mpifh_bindings, only : ompi_win_allocate_shared_f - implicit none - INTEGER(KIND=MPI_ADDRESS_KIND), INTENT(IN) :: size - INTEGER, INTENT(IN) :: disp_unit - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(C_PTR), INTENT(OUT) :: baseptr - TYPE(MPI_Win), INTENT(OUT) :: win - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_win_allocate_shared_f(size, disp_unit, info%MPI_VAL, comm%MPI_VAL, baseptr, win%MPI_VAL, c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Win_allocate_shared_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/win_attach_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/win_attach_f08.F90 deleted file mode 100644 index fb78b337158..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/win_attach_f08.F90 +++ /dev/null @@ -1,25 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2015-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Win_attach_f08(win,base,size,ierror) - use :: mpi_f08_types, only : MPI_Win, MPI_ADDRESS_KIND - use :: ompi_mpifh_bindings, only : ompi_win_attach_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: base - INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: size - TYPE(MPI_Win), INTENT(IN) :: win - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_win_attach_f(win%MPI_VAL,base,size,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Win_attach_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/win_attach_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/win_attach_ts.c.in new file mode 100644 index 00000000000..bfb4b3accb2 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/win_attach_ts.c.in @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID win_attach(WIN win, BUFFER x, AINT size) +{ + int c_ierr; + MPI_Win c_win; + + c_win = PMPI_Win_f2c(*win); + if (OMPI_CFI_IS_CONTIGUOUS(x)) { + c_ierr = PMPI_Win_attach(c_win, OMPI_CFI_BASE_ADDR(x), *size); + } else { + c_ierr = MPI_ERR_BUFFER; + OMPI_ERRHANDLER_INVOKE(c_win, c_ierr, FUNC_NAME); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/win_create_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/win_create_f08.F90 deleted file mode 100644 index 2376f399ce5..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/win_create_f08.F90 +++ /dev/null @@ -1,32 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2010-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All Rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. -! $COPYRIGHT$ - -#include "ompi/mpi/fortran/configure-fortran-output.h" - -#include "mpi-f08-rename.h" - -subroutine MPI_Win_create_f08(base,size,disp_unit,info,comm,win,ierror) - use :: mpi_f08_types, only : MPI_Info, MPI_Comm, MPI_Win, MPI_ADDRESS_KIND - use :: ompi_mpifh_bindings, only : ompi_win_create_f - implicit none - OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS:: base - INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: size - INTEGER, INTENT(IN) :: disp_unit - TYPE(MPI_Info), INTENT(IN) :: info - TYPE(MPI_Comm), INTENT(IN) :: comm - TYPE(MPI_Win), INTENT(OUT) :: win - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_win_create_f(base,size,disp_unit,info%MPI_VAL,& - comm%MPI_VAL,win%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Win_create_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/win_create_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/win_create_ts.c.in new file mode 100644 index 00000000000..c46f59f8bf4 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/win_create_ts.c.in @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID win_create(BUFFER x, AINT size, DISP disp_unit, + INFO info, COMM comm, WIN_OUT win) +{ + int c_ierr; + MPI_Win c_win; + MPI_Info c_info; + MPI_Comm c_comm; + + c_comm = PMPI_Comm_f2c(*comm); + c_info = PMPI_Info_f2c(*info); + + if (OMPI_CFI_IS_CONTIGUOUS(x)) { + c_ierr = @INNER_CALL@(OMPI_CFI_BASE_ADDR(x), *size, + OMPI_FINT_2_INT(*disp_unit), + c_info, c_comm, &c_win); + } else { + c_ierr = MPI_ERR_BUFFER; + OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + *win = PMPI_Win_c2f(c_win); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/win_detach_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/win_detach_ts.c.in new file mode 100644 index 00000000000..e89f9f4396f --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/win_detach_ts.c.in @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID win_detach(WIN win, BUFFER x) +{ + int c_ierr; + MPI_Win c_win; + + c_win = PMPI_Win_f2c(*win); + if (OMPI_CFI_IS_CONTIGUOUS(x)) { + c_ierr = @INNER_CALL@(c_win, OMPI_CFI_BASE_ADDR(x)); + } else { + c_ierr = MPI_ERR_BUFFER; + OMPI_ERRHANDLER_INVOKE(c_win, c_ierr, FUNC_NAME); + } + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/win_shared_query.c.in b/ompi/mpi/fortran/use-mpi-f08/win_shared_query.c.in new file mode 100644 index 00000000000..073e80e0fc7 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/win_shared_query.c.in @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 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) 2011-2014 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2017 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +PROTOTYPE VOID win_shared_query(WIN win, INT rank, AINT_OUT size, + DISP_OUT disp_unit, C_PTR_OUT baseptr) +{ + int c_ierr; + MPI_Win c_win; + OMPI_SINGLE_NAME_DECL(disp_unit); + + c_win = PMPI_Win_f2c(*win); + + c_ierr = @INNER_CALL@(c_win, OMPI_FINT_2_INT(*rank), size, + OMPI_SINGLE_NAME_CONVERT(disp_unit), baseptr); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + +} diff --git a/ompi/mpi/fortran/use-mpi-f08/win_shared_query_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/win_shared_query_f08.F90 deleted file mode 100644 index e69f3028212..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/win_shared_query_f08.F90 +++ /dev/null @@ -1,29 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2010-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All Rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "mpi-f08-rename.h" - -subroutine MPI_Win_shared_query_f08(win, rank, size, disp_unit, baseptr,& - ierror) - USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR - use :: mpi_f08_types, only : MPI_Win, MPI_ADDRESS_KIND - use :: ompi_mpifh_bindings, only : ompi_win_shared_query_f - implicit none - TYPE(MPI_Win), INTENT(IN) :: win - INTEGER, INTENT(IN) :: rank - INTEGER(KIND=MPI_ADDRESS_KIND), INTENT(OUT) :: size - INTEGER, INTENT(OUT) :: disp_unit - TYPE(C_PTR), INTENT(OUT) :: baseptr - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_win_shared_query_f(win%MPI_VAL, rank, size, disp_unit, baseptr, c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Win_shared_query_f08 From 05a592475ed2ead3afdd52b790be6690e20f36ea Mon Sep 17 00:00:00 2001 From: Jake Tronge Date: Tue, 10 Dec 2024 06:29:54 -0700 Subject: [PATCH 3/3] Bigcount: Update docs and address other comments Signed-off-by: Jake Tronge --- config/ompi_setup_mpi_fortran.m4 | 2 - docs/developers/bindings.rst | 80 ++++++-------------- docs/developers/prerequisites.rst | 11 +++ ompi/mpi/fortran/use-mpi-f08/base/bigcount.h | 10 +++ 4 files changed, 44 insertions(+), 59 deletions(-) diff --git a/config/ompi_setup_mpi_fortran.m4 b/config/ompi_setup_mpi_fortran.m4 index eeb42064cc2..758268b6f35 100644 --- a/config/ompi_setup_mpi_fortran.m4 +++ b/config/ompi_setup_mpi_fortran.m4 @@ -653,8 +653,6 @@ 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 # ------------------- diff --git a/docs/developers/bindings.rst b/docs/developers/bindings.rst index f747429c3df..5363f559494 100644 --- a/docs/developers/bindings.rst +++ b/docs/developers/bindings.rst @@ -2,10 +2,10 @@ 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``. +``ompi/mpi/bindings``. Both the language bindings are generated from +template files for each function. In the C case, each template file corresponds +to a single generated C file, while in the Fortran case there are three major +files generated for all functions. 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 @@ -69,66 +69,32 @@ generated file name must be of the form ``generated_${basename}.c``, where 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``: +Adding new Fortran bindings follows a similar process to the C version above. +All new interfaces are actually based on a single C-template file following the +same format as the C interface templates. However, the C file generated will +use Fortran-specific arguments, including ``CFI_*`` arguments, when TS 29113 is +enabled, ``MPI_Fint *`` arguments in other cases, and others specific to how +the Fortran MPI types are defined. Most of these files perform Fortran-specific +error handling, Fortran-to-C type conversion, and other necessary steps before +calling the actually C bindings with the proper arguments. -.. 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: +These templates are used not only to generate a C backing file for the Fortran +code, but also the Fortran interface definitions and the Fortran subroutines +corresponding to the generated C file. These are output in three separate files: * ``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``. +definitions, each of which makes a call into corresponding C functions. 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``. The C file ``api_f08_generated.c`` +basically contains a concatenation of all fully expanded C templates. +These files contain preprocessing directives to ensure they can support +compilers with and without TS 29113 support, allowing use of +``CFI_cdesc_t`` types when available (see `Fortran 2018`_ for more details). .. _Fortran 2018: https://fortranwiki.org/fortran/show/Fortran+2018 diff --git a/docs/developers/prerequisites.rst b/docs/developers/prerequisites.rst index 2ac278e2285..e2aa34d4c9c 100644 --- a/docs/developers/prerequisites.rst +++ b/docs/developers/prerequisites.rst @@ -47,6 +47,15 @@ build them manually, see the :ref:`how to build and install GNU Autotools section ` for much more detail. +Python +------ + +Python >= v3.6 is required for generating the Fortran bindings, which +is necessary if you build Open MPI from a Git clone. + +Python is also required for running Sphinx to generate the docs, too +(:ref:`see below `). + Perl ---- @@ -88,6 +97,8 @@ MacPorts on MacOS), see `the Flex Github repository `_. +.. _developers-requirements-sphinx-label: + Sphinx (and therefore Python) ----------------------------- diff --git a/ompi/mpi/fortran/use-mpi-f08/base/bigcount.h b/ompi/mpi/fortran/use-mpi-f08/base/bigcount.h index e96c52afad1..96f16651c35 100644 --- a/ompi/mpi/fortran/use-mpi-f08/base/bigcount.h +++ b/ompi/mpi/fortran/use-mpi-f08/base/bigcount.h @@ -1,3 +1,13 @@ +/* + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + /* * Bigcount array conversion macros for Fortran templates. */