From c3e588596ed189a7b92f9445fa7e6746fa89d50e Mon Sep 17 00:00:00 2001 From: Jake Tronge Date: Mon, 12 Aug 2024 09:51:15 -0600 Subject: [PATCH] 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/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 | 250 +- .../use-mpi-f08/Makefile.prototype_files | 342 +++ .../fortran/use-mpi-f08/accumulate_ts.c.in | 54 + .../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 | 76 + .../mpi/fortran/use-mpi-f08/allgather_ts.c.in | 68 + .../fortran/use-mpi-f08/allgatherv_f08.F90 | 33 - .../use-mpi-f08/allgatherv_init_f08.F90 | 36 - .../use-mpi-f08/allgatherv_init_ts.c.in | 98 + .../fortran/use-mpi-f08/allgatherv_ts.c.in | 90 + .../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 | 61 + .../mpi/fortran/use-mpi-f08/allreduce_ts.c.in | 55 + 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 | 69 + ompi/mpi/fortran/use-mpi-f08/alltoall_ts.c.in | 63 + .../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 | 88 + .../mpi/fortran/use-mpi-f08/alltoallv_ts.c.in | 79 + .../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 | 97 + .../mpi/fortran/use-mpi-f08/alltoallw_ts.c.in | 90 + ompi/mpi/fortran/use-mpi-f08/base/Makefile.am | 30 +- ompi/mpi/fortran/use-mpi-f08/base/bigcount.h | 35 + .../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 | 139 + 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 | 59 + ompi/mpi/fortran/use-mpi-f08/bcast_ts.c.in | 51 + 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 | 53 + ompi/mpi/fortran/use-mpi-f08/bsend_ts.c.in | 45 + .../fortran/use-mpi-f08/buffer_attach_f08.F90 | 26 - .../fortran/use-mpi-f08/buffer_attach_ts.c.in | 32 + .../fortran/use-mpi-f08/buffer_detach.c.in | 36 + .../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 | 58 + 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 | 61 + ompi/mpi/fortran/use-mpi-f08/exscan_ts.c.in | 54 + .../fortran/use-mpi-f08/f_sync_reg_ts.c.in | 27 + .../fortran/use-mpi-f08/fetch_and_op_f08.F90 | 33 - .../fortran/use-mpi-f08/fetch_and_op_ts.c.in | 53 + .../use-mpi-f08/file_iread_all_f08.F90 | 29 - .../use-mpi-f08/file_iread_all_ts.c.in | 51 + .../use-mpi-f08/file_iread_at_all_f08.F90 | 31 - .../use-mpi-f08/file_iread_at_all_ts.c.in | 53 + .../fortran/use-mpi-f08/file_iread_at_ts.c.in | 53 + .../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 | 52 + .../fortran/use-mpi-f08/file_iread_ts.c.in | 51 + .../use-mpi-f08/file_iwrite_all_f08.F90 | 30 - .../use-mpi-f08/file_iwrite_all_ts.c.in | 51 + .../use-mpi-f08/file_iwrite_at_all_f08.F90 | 31 - .../use-mpi-f08/file_iwrite_at_all_ts.c.in | 54 + .../use-mpi-f08/file_iwrite_at_f08.F90 | 31 - .../use-mpi-f08/file_iwrite_at_ts.c.in | 54 + .../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 | 50 + .../fortran/use-mpi-f08/file_iwrite_ts.c.in | 50 + .../use-mpi-f08/file_read_all_begin_f08.F90 | 28 - .../use-mpi-f08/file_read_all_begin_ts.c.in | 44 + .../use-mpi-f08/file_read_all_end_f08.F90 | 27 - .../use-mpi-f08/file_read_all_end_ts.c.in | 37 + .../fortran/use-mpi-f08/file_read_all_f08.F90 | 29 - .../fortran/use-mpi-f08/file_read_all_ts.c.in | 51 + .../file_read_at_all_begin_f08.F90 | 30 - .../file_read_at_all_begin_ts.c.in | 46 + .../use-mpi-f08/file_read_at_all_end_f08.F90 | 27 - .../use-mpi-f08/file_read_at_all_end_ts.c.in | 37 + .../use-mpi-f08/file_read_at_all_f08.F90 | 31 - .../use-mpi-f08/file_read_at_all_ts.c.in | 52 + .../fortran/use-mpi-f08/file_read_at_f08.F90 | 30 - .../fortran/use-mpi-f08/file_read_at_ts.c.in | 52 + .../file_read_ordered_begin_f08.F90 | 28 - .../file_read_ordered_begin_ts.c.in | 44 + .../use-mpi-f08/file_read_ordered_end_f08.F90 | 27 - .../use-mpi-f08/file_read_ordered_end_ts.c.in | 36 + .../use-mpi-f08/file_read_ordered_f08.F90 | 30 - .../use-mpi-f08/file_read_ordered_ts.c.in | 51 + .../use-mpi-f08/file_read_shared_f08.F90 | 29 - .../use-mpi-f08/file_read_shared_ts.c.in | 51 + .../mpi/fortran/use-mpi-f08/file_read_ts.c.in | 51 + .../use-mpi-f08/file_write_all_begin_f08.F90 | 28 - .../use-mpi-f08/file_write_all_begin_ts.c.in | 44 + .../use-mpi-f08/file_write_all_end_f08.F90 | 27 - .../use-mpi-f08/file_write_all_end_ts.c.in | 37 + .../use-mpi-f08/file_write_all_f08.F90 | 30 - .../use-mpi-f08/file_write_all_ts.c.in | 51 + .../file_write_at_all_begin_f08.F90 | 30 - .../file_write_at_all_begin_ts.c.in | 46 + .../use-mpi-f08/file_write_at_all_end_f08.F90 | 27 - .../use-mpi-f08/file_write_at_all_end_ts.c.in | 37 + .../use-mpi-f08/file_write_at_all_f08.F90 | 31 - .../use-mpi-f08/file_write_at_all_ts.c.in | 52 + .../fortran/use-mpi-f08/file_write_at_f08.F90 | 31 - .../fortran/use-mpi-f08/file_write_at_ts.c.in | 52 + .../fortran/use-mpi-f08/file_write_f08.F90 | 30 - .../file_write_ordered_begin_f08.F90 | 28 - .../file_write_ordered_begin_ts.c.in | 44 + .../file_write_ordered_end_f08.F90 | 27 - .../file_write_ordered_end_ts.c.in | 37 + .../use-mpi-f08/file_write_ordered_f08.F90 | 30 - .../use-mpi-f08/file_write_ordered_ts.c.in | 51 + .../use-mpi-f08/file_write_shared_f08.F90 | 30 - .../use-mpi-f08/file_write_shared_ts.c.in | 51 + .../fortran/use-mpi-f08/file_write_ts.c.in | 52 + ompi/mpi/fortran/use-mpi-f08/free_mem_f08.F90 | 22 - ompi/mpi/fortran/use-mpi-f08/free_mem_ts.c.in | 32 + 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 | 93 + ompi/mpi/fortran/use-mpi-f08/gather_ts.c.in | 96 + 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 | 115 + ompi/mpi/fortran/use-mpi-f08/gatherv_ts.c.in | 100 + .../use-mpi-f08/get_accumulate_f08.F90 | 39 - .../use-mpi-f08/get_accumulate_ts.c.in | 75 + .../fortran/use-mpi-f08/get_address_f08.F90 | 26 - .../fortran/use-mpi-f08/get_address_ts.c.in | 33 + ompi/mpi/fortran/use-mpi-f08/get_count.c.in | 42 + .../mpi/fortran/use-mpi-f08/get_count_f08.F90 | 25 - .../mpi/fortran/use-mpi-f08/get_elements.c.in | 43 + .../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 | 51 + .../fortran/use-mpi-f08/iallgather_f08.F90 | 32 - .../fortran/use-mpi-f08/iallgather_ts.c.in | 68 + .../fortran/use-mpi-f08/iallgatherv_f08.F90 | 34 - .../fortran/use-mpi-f08/iallgatherv_ts.c.in | 94 + .../fortran/use-mpi-f08/iallreduce_f08.F90 | 32 - .../fortran/use-mpi-f08/iallreduce_ts.c.in | 58 + .../mpi/fortran/use-mpi-f08/ialltoall_f08.F90 | 33 - .../mpi/fortran/use-mpi-f08/ialltoall_ts.c.in | 65 + .../fortran/use-mpi-f08/ialltoallv_f08.F90 | 33 - .../fortran/use-mpi-f08/ialltoallv_ts.c.in | 82 + .../fortran/use-mpi-f08/ialltoallw_f08.F90 | 43 - .../fortran/use-mpi-f08/ialltoallw_ts.c.in | 91 + ompi/mpi/fortran/use-mpi-f08/ibcast_f08.F90 | 30 - ompi/mpi/fortran/use-mpi-f08/ibcast_ts.c.in | 56 + ompi/mpi/fortran/use-mpi-f08/ibsend_f08.F90 | 29 - ompi/mpi/fortran/use-mpi-f08/ibsend_ts.c.in | 53 + ompi/mpi/fortran/use-mpi-f08/iexscan_f08.F90 | 32 - ompi/mpi/fortran/use-mpi-f08/iexscan_ts.c.in | 57 + ompi/mpi/fortran/use-mpi-f08/igather_f08.F90 | 33 - ompi/mpi/fortran/use-mpi-f08/igather_ts.c.in | 91 + ompi/mpi/fortran/use-mpi-f08/igatherv_f08.F90 | 34 - ompi/mpi/fortran/use-mpi-f08/igatherv_ts.c.in | 99 + ompi/mpi/fortran/use-mpi-f08/imrecv_f08.F90 | 29 - ompi/mpi/fortran/use-mpi-f08/imrecv_ts.c.in | 54 + .../use-mpi-f08/ineighbor_allgather_f08.F90 | 33 - .../use-mpi-f08/ineighbor_allgather_ts.c.in | 68 + .../use-mpi-f08/ineighbor_allgatherv_f08.F90 | 35 - .../use-mpi-f08/ineighbor_allgatherv_ts.c.in | 76 + .../use-mpi-f08/ineighbor_alltoall_f08.F90 | 34 - .../use-mpi-f08/ineighbor_alltoall_ts.c.in | 64 + .../use-mpi-f08/ineighbor_alltoallv_f08.F90 | 35 - .../use-mpi-f08/ineighbor_alltoallv_ts.c.in | 81 + .../use-mpi-f08/ineighbor_alltoallw_f08.F90 | 35 - .../use-mpi-f08/ineighbor_alltoallw_ts.c.in | 84 + ompi/mpi/fortran/use-mpi-f08/irecv_ts.c.in | 52 + 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 | 61 + .../use-mpi-f08/ireduce_scatter_f08.F90 | 32 - .../use-mpi-f08/ireduce_scatter_ts.c.in | 63 + ompi/mpi/fortran/use-mpi-f08/ireduce_ts.c.in | 60 + ompi/mpi/fortran/use-mpi-f08/irsend_f08.F90 | 29 - ompi/mpi/fortran/use-mpi-f08/irsend_ts.c.in | 52 + ompi/mpi/fortran/use-mpi-f08/iscan_f08.F90 | 32 - ompi/mpi/fortran/use-mpi-f08/iscan_ts.c.in | 59 + ompi/mpi/fortran/use-mpi-f08/iscatter_f08.F90 | 33 - ompi/mpi/fortran/use-mpi-f08/iscatter_ts.c.in | 95 + .../mpi/fortran/use-mpi-f08/iscatterv_f08.F90 | 34 - .../mpi/fortran/use-mpi-f08/iscatterv_ts.c.in | 107 + ompi/mpi/fortran/use-mpi-f08/isend_ts.c.in | 52 + .../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 | 58 + .../mpi/fortran/use-mpi-f08/isendrecv_ts.c.in | 73 + ompi/mpi/fortran/use-mpi-f08/issend_f08.F90 | 29 - ompi/mpi/fortran/use-mpi-f08/issend_ts.c.in | 52 + ompi/mpi/fortran/use-mpi-f08/mod/Makefile.am | 26 +- .../use-mpi-f08/mod/mpi-f08-interfaces.F90 | 1 + .../use-mpi-f08/mod/mpi-f08-interfaces.h.in | 2604 +---------------- .../fortran/use-mpi-f08/mod/mpi-f08-rename.h | 4 + ompi/mpi/fortran/use-mpi-f08/mrecv_f08.F90 | 29 - ompi/mpi/fortran/use-mpi-f08/mrecv_ts.c.in | 58 + .../use-mpi-f08/neighbor_allgather_f08.F90 | 32 - .../neighbor_allgather_init_f08.F90 | 34 - .../neighbor_allgather_init_ts.c.in | 80 + .../use-mpi-f08/neighbor_allgather_ts.c.in | 69 + .../use-mpi-f08/neighbor_allgatherv_f08.F90 | 34 - .../neighbor_allgatherv_init_f08.F90 | 36 - .../neighbor_allgatherv_init_ts.c.in | 90 + .../use-mpi-f08/neighbor_allgatherv_ts.c.in | 77 + .../use-mpi-f08/neighbor_alltoall_f08.F90 | 33 - .../neighbor_alltoall_init_f08.F90 | 35 - .../neighbor_alltoall_init_ts.c.in | 71 + .../use-mpi-f08/neighbor_alltoall_ts.c.in | 61 + .../use-mpi-f08/neighbor_alltoallv_f08.F90 | 34 - .../neighbor_alltoallv_init_f08.F90 | 36 - .../neighbor_alltoallv_init_ts.c.in | 95 + .../use-mpi-f08/neighbor_alltoallv_ts.c.in | 78 + .../use-mpi-f08/neighbor_alltoallw_f08.F90 | 34 - .../neighbor_alltoallw_init_f08.F90 | 36 - .../neighbor_alltoallw_init_ts.c.in | 106 + .../use-mpi-f08/neighbor_alltoallw_ts.c.in | 82 + .../fortran/use-mpi-f08/pack_external_f08.F90 | 34 - .../use-mpi-f08/pack_external_size.c.in | 32 + .../use-mpi-f08/pack_external_size_f08.F90 | 26 - .../fortran/use-mpi-f08/pack_external_ts.c.in | 58 + ompi/mpi/fortran/use-mpi-f08/pack_f08.F90 | 32 - ompi/mpi/fortran/use-mpi-f08/pack_size.c.in | 42 + .../mpi/fortran/use-mpi-f08/pack_size_f08.F90 | 26 - ompi/mpi/fortran/use-mpi-f08/pack_ts.c.in | 68 + .../fortran/use-mpi-f08/precv_init_f08.F90 | 36 - .../fortran/use-mpi-f08/precv_init_ts.c.in | 56 + .../fortran/use-mpi-f08/profile/Makefile.am | 477 --- .../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 | 77 + ompi/mpi/fortran/use-mpi-f08/put_f08.F90 | 32 - ompi/mpi/fortran/use-mpi-f08/put_ts.c.in | 51 + .../fortran/use-mpi-f08/raccumulate_f08.F90 | 36 - .../fortran/use-mpi-f08/raccumulate_ts.c.in | 64 + 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 | 53 + ompi/mpi/fortran/use-mpi-f08/recv_ts.c.in | 55 + 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 | 68 + .../fortran/use-mpi-f08/reduce_local_f08.F90 | 29 - .../fortran/use-mpi-f08/reduce_local_ts.c.in | 53 + .../use-mpi-f08/reduce_scatter_block_f08.F90 | 31 - .../reduce_scatter_block_init_f08.F90 | 34 - .../reduce_scatter_block_init_ts.c.in | 68 + .../use-mpi-f08/reduce_scatter_block_ts.c.in | 58 + .../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 | 82 + .../use-mpi-f08/reduce_scatter_ts.c.in | 62 + ompi/mpi/fortran/use-mpi-f08/reduce_ts.c.in | 58 + .../use-mpi-f08/rget_accumulate_f08.F90 | 40 - .../use-mpi-f08/rget_accumulate_ts.c.in | 81 + ompi/mpi/fortran/use-mpi-f08/rget_f08.F90 | 34 - ompi/mpi/fortran/use-mpi-f08/rget_ts.c.in | 59 + ompi/mpi/fortran/use-mpi-f08/rput_f08.F90 | 34 - ompi/mpi/fortran/use-mpi-f08/rput_ts.c.in | 59 + 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 | 54 + ompi/mpi/fortran/use-mpi-f08/rsend_ts.c.in | 46 + 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 | 67 + ompi/mpi/fortran/use-mpi-f08/scan_ts.c.in | 56 + 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 | 99 + ompi/mpi/fortran/use-mpi-f08/scatter_ts.c.in | 90 + 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 | 123 + ompi/mpi/fortran/use-mpi-f08/scatterv_ts.c.in | 100 + 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 | 53 + ompi/mpi/fortran/use-mpi-f08/send_ts.c.in | 45 + 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 | 59 + ompi/mpi/fortran/use-mpi-f08/sendrecv_ts.c.in | 75 + 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 | 52 + ompi/mpi/fortran/use-mpi-f08/ssend_ts.c.in | 47 + .../use-mpi-f08/status_set_elements_c.in | 46 + .../use-mpi-f08/status_set_elements_f08.F90 | 25 - ompi/mpi/fortran/use-mpi-f08/testany.c.in | 79 + .../fortran/use-mpi-f08/type_contiguous.c.in | 35 + .../use-mpi-f08/type_create_darray.c.in | 59 + .../use-mpi-f08/type_create_darray_f08.F90 | 30 - .../use-mpi-f08/type_create_hindexed.c.in | 46 + .../type_create_hindexed_block.c.in | 33 + .../type_create_hindexed_block_f08.F90 | 30 - .../use-mpi-f08/type_create_hindexed_f08.F90 | 30 - .../use-mpi-f08/type_create_hvector.c.in | 39 + .../use-mpi-f08/type_create_hvector_f08.F90 | 27 - .../type_create_indexed_block.c.in | 45 + .../type_create_indexed_block_f08.F90 | 28 - .../use-mpi-f08/type_create_struct.c.in | 60 + .../use-mpi-f08/type_create_struct_f08.F90 | 29 - .../use-mpi-f08/type_create_subarray.c.in | 55 + .../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 | 30 + .../use-mpi-f08/type_get_true_extent_f08.F90 | 24 - .../mpi/fortran/use-mpi-f08/type_indexed.c.in | 48 + .../fortran/use-mpi-f08/type_indexed_f08.F90 | 28 - ompi/mpi/fortran/use-mpi-f08/type_size.c.in | 35 + .../mpi/fortran/use-mpi-f08/type_size_f08.F90 | 24 - ompi/mpi/fortran/use-mpi-f08/type_vector.c.in | 42 + .../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 | 60 + ompi/mpi/fortran/use-mpi-f08/unpack_f08.F90 | 32 - ompi/mpi/fortran/use-mpi-f08/unpack_ts.c.in | 63 + ompi/mpi/fortran/use-mpi-f08/waitall.c.in | 64 + 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 | 63 + .../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 | 24 + .../fortran/use-mpi-f08/win_create_f08.F90 | 32 - .../fortran/use-mpi-f08/win_create_ts.c.in | 46 + .../fortran/use-mpi-f08/win_detach_ts.c.in | 25 + .../fortran/use-mpi-f08/win_shared_query.c.in | 35 + .../use-mpi-f08/win_shared_query_f08.F90 | 29 - 353 files changed, 11757 insertions(+), 8256 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 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 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 694d6325d53..4a1baada79d 100644 --- a/.gitignore +++ b/.gitignore @@ -219,6 +219,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 dde7f9cd1aa..69b12fa6b82 100644 --- a/config/ompi_config_files.m4 +++ b/config/ompi_config_files.m4 @@ -40,7 +40,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 c8ace55e049..a62e46a15b9 100644 --- a/ompi/mpi/bindings/ompi_bindings/parser.py +++ b/ompi/mpi/bindings/ompi_bindings/parser.py @@ -105,7 +105,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/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 9440b7a9c23..94692d9d9d2 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 @@ -45,14 +43,14 @@ AM_FCFLAGS = -I$(top_srcdir)/ompi/mpi/fortran/use-mpi-f08/mod \ $(OMPI_FC_MODULE_FLAG)$(top_builddir)/ompi/$(OMPI_FORTRAN_USEMPI_DIR) \ $(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 +95,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 +108,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 +167,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 +175,7 @@ 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 +191,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 +201,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 +228,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 +248,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 +276,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 +339,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 +372,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 +398,44 @@ 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 + +api_f08_generated.F90: $(prototype_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 $(prototype_files) + +EXTRA_DIST = $(extra_dist_prototype_files) + +# Delete generated file on maintainer-clean +MAINTAINERCLEANFILES = api_f08_generated.F90 +endif ########################################################################### 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..1c57a15023f --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/Makefile.prototype_files @@ -0,0 +1,342 @@ +# +# Shared list of prototype files to avoid listing dependencies multiple times. +# + +# TODO: I don't think the below file should be a prototype +# $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/f_sync_reg_ts.c.in + +prototype_files = \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/accumulate_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/allgather_init_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/allgather_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/allgatherv_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/allgatherv_init_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/allreduce_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/allreduce_init_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/alltoall_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/alltoall_init_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/alltoallv_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/alltoallv_init_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/alltoallw_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/alltoallw_init_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/bcast_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/bcast_init_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/bsend_init_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/bsend_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/buffer_attach_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/buffer_detach.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/compare_and_swap_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/exscan_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/exscan_init_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/fetch_and_op_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/file_iread_all_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/file_iread_at_all_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/file_iread_at_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/file_iread_shared_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/file_iread_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/file_iwrite_all_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/file_iwrite_at_all_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/file_iwrite_at_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/file_iwrite_shared_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/file_iwrite_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/file_read_all_begin_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/file_read_all_end_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/file_read_all_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/file_read_at_all_begin_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/file_read_at_all_end_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/file_read_at_all_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/file_read_at_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/file_read_ordered_begin_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/file_read_ordered_end_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/file_read_ordered_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/file_read_shared_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/file_read_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/file_write_all_begin_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/file_write_all_end_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/file_write_all_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/file_write_at_all_begin_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/file_write_at_all_end_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/file_write_at_all_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/file_write_at_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/file_write_ordered_begin_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/file_write_ordered_end_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/file_write_ordered_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/file_write_shared_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/file_write_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/free_mem_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/gather_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/gather_init_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/gatherv_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/gatherv_init_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/get_address_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/get_accumulate_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/get_count.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/get_elements.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/get_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/iallgather_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/iallgatherv_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/iallreduce_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/ialltoall_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/ialltoallv_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/ialltoallw_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/ibcast_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/ibsend_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/iexscan_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/igather_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/igatherv_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/imrecv_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/ineighbor_allgather_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/ineighbor_allgatherv_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/ineighbor_alltoall_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/ineighbor_alltoallv_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/ineighbor_alltoallw_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/irecv_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/ireduce_scatter_block_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/ireduce_scatter_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/ireduce_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/irsend_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/iscan_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/iscatter_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/iscatterv_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/isendrecv_replace_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/isendrecv_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/isend_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/issend_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/mrecv_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/neighbor_allgather_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/neighbor_allgather_init_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/neighbor_allgatherv_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/neighbor_allgatherv_init_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/neighbor_alltoall_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/neighbor_alltoall_init_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/neighbor_alltoallv_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/neighbor_alltoallv_init_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/neighbor_alltoallw_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/neighbor_alltoallw_init_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/recv_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/reduce_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/reduce_init_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/send_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/testany.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/waitall.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/win_attach_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/win_shared_query.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/win_create_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/win_detach_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/win_allocate.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/win_allocate_shared.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/unpack_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/unpack_external_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/pack_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/pack_size.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/pack_external_size.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/pack_external_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/put_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/raccumulate_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/recv_init_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/reduce_local_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/reduce_scatter_block_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/reduce_scatter_block_init_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/reduce_scatter_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/reduce_scatter_init_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/rget_accumulate_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/rget_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/rput_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/rsend_init_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/rsend_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/scan_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/scan_init_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/scatter_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/scatter_init_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/scatterv_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/scatterv_init_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/send_init_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/sendrecv_replace_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/sendrecv_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/ssend_init_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/ssend_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/type_vector.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/type_size.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/type_indexed.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/type_contiguous.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/type_create_darray.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/type_get_true_extent.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/type_create_subarray.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/type_create_struct.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/type_create_hindexed.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/type_create_hindexed_block.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/type_create_indexed_block.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/type_create_hvector.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/psend_init_ts.c.in \ + $(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/precv_init_ts.c.in + +# TODO: Is there any way to get EXTRA_DIST to work with absolute paths? Or, +# better yet, is there some way to make these dependencies a little +# easier to work with? +extra_dist_prototype_files = \ + file_iwrite_all_ts.c.in \ + iexscan_ts.c.in \ + file_write_all_begin_ts.c.in \ + file_write_at_all_ts.c.in \ + file_iwrite_at_all_ts.c.in \ + ssend_ts.c.in \ + bsend_init_ts.c.in \ + alltoall_ts.c.in \ + alltoall_init_ts.c.in \ + alltoallv_ts.c.in \ + alltoallv_init_ts.c.in \ + alltoallw_ts.c.in \ + alltoallw_init_ts.c.in \ + file_iwrite_at_ts.c.in \ + igather_ts.c.in \ + sendrecv_replace_ts.c.in \ + file_write_ordered_end_ts.c.in \ + file_write_all_end_ts.c.in \ + file_write_ordered_ts.c.in \ + iscan_ts.c.in \ + reduce_scatter_block_ts.c.in \ + reduce_scatter_block_init_ts.c.in \ + send_ts.c.in \ + ineighbor_allgather_ts.c.in \ + send_init_ts.c.in \ + file_iwrite_ts.c.in \ + file_iread_all_ts.c.in \ + alltoallw_ts.c.in \ + file_read_at_all_begin_ts.c.in \ + allgather_init_ts.c.in \ + allgather_ts.c.in \ + iallgatherv_ts.c.in \ + isendrecv_ts.c.in \ + ineighbor_alltoallv_ts.c.in \ + neighbor_alltoall_ts.c.in \ + neighbor_alltoall_init_ts.c.in \ + reduce_ts.c.in \ + reduce_init_ts.c.in \ + pack_size.c.in \ + pack_ts.c.in \ + file_read_all_ts.c.in \ + raccumulate_ts.c.in \ + scatterv_ts.c.in \ + scatterv_init_ts.c.in \ + scatter_ts.c.in \ + scatter_init_ts.c.in \ + neighbor_alltoallv_ts.c.in \ + neighbor_alltoallv_init_ts.c.in \ + compare_and_swap_ts.c.in \ + rput_ts.c.in \ + reduce_scatter_ts.c.in \ + reduce_scatter_init_ts.c.in \ + win_create_ts.c.in \ + file_read_at_ts.c.in \ + ineighbor_alltoall_ts.c.in \ + ssend_init_ts.c.in \ + iscatter_ts.c.in \ + file_write_at_ts.c.in \ + file_iread_shared_ts.c.in \ + f_sync_reg_ts.c.in \ + win_allocate.c.in \ + win_allocate_shared.c.in \ + win_detach_ts.c.in \ + file_read_ts.c.in \ + rget_accumulate_ts.c.in \ + file_read_all_begin_ts.c.in \ + waitall.c.in \ + reduce_local_ts.c.in \ + scan_ts.c.in \ + scan_init_ts.c.in \ + fetch_and_op_ts.c.in \ + file_write_shared_ts.c.in \ + testany.c.in \ + isendrecv_replace_ts.c.in \ + file_write_at_all_end_ts.c.in \ + ireduce_scatter_block_ts.c.in \ + file_iwrite_shared_ts.c.in \ + rsend_ts.c.in \ + file_iread_at_all_ts.c.in \ + ibsend_ts.c.in \ + recv_init_ts.c.in \ + file_read_all_end_ts.c.in \ + isend_ts.c.in \ + gather_ts.c.in \ + gather_init_ts.c.in \ + igatherv_ts.c.in \ + ialltoallw_ts.c.in \ + ialltoallv_ts.c.in \ + allreduce_ts.c.in \ + allreduce_init_ts.c.in \ + allgatherv_ts.c.in \ + allgatherv_init_ts.c.in \ + pack_external_ts.c.in \ + pack_external_size.c.in \ + file_write_ordered_begin_ts.c.in \ + ineighbor_allgatherv_ts.c.in \ + recv_ts.c.in \ + iallgather_ts.c.in \ + neighbor_alltoallw_ts.c.in \ + neighbor_alltoallw_init_ts.c.in \ + neighbor_allgatherv_ts.c.in \ + neighbor_allgatherv_init_ts.c.in \ + irsend_ts.c.in \ + put_ts.c.in \ + free_mem_ts.c.in \ + file_read_ordered_begin_ts.c.in \ + issend_ts.c.in \ + alltoallv_ts.c.in \ + file_write_ts.c.in \ + file_read_shared_ts.c.in \ + get_address_ts.c.in \ + ialltoall_ts.c.in \ + ireduce_ts.c.in \ + ineighbor_alltoallw_ts.c.in \ + accumulate_ts.c.in \ + file_read_ordered_ts.c.in \ + get_accumulate_ts.c.in \ + iallreduce_ts.c.in \ + imrecv_ts.c.in \ + exscan_ts.c.in \ + exscan_init_ts.c.in \ + rsend_init_ts.c.in \ + file_iread_ts.c.in \ + file_read_at_all_ts.c.in \ + win_attach_ts.c.in \ + win_shared_query.c.in \ + file_write_at_all_begin_ts.c.in \ + mrecv_ts.c.in \ + sendrecv_ts.c.in \ + file_read_at_all_end_ts.c.in \ + get_ts.c.in \ + unpack_ts.c.in \ + unpack_external_ts.c.in \ + ibcast_ts.c.in \ + bcast_ts.c.in \ + bcast_init_ts.c.in \ + bsend_ts.c.in \ + buffer_attach_ts.c.in \ + buffer_detach.c.in \ + irecv_ts.c.in \ + neighbor_allgather_ts.c.in \ + neighbor_allgather_init_ts.c.in \ + gatherv_ts.c.in \ + gatherv_init_ts.c.in \ + file_read_ordered_end_ts.c.in \ + file_iread_at_ts.c.in \ + rget_ts.c.in \ + iscatterv_ts.c.in \ + ireduce_scatter_ts.c.in \ + file_write_all_ts.c.in \ + type_vector.c.in \ + type_size.c.in \ + type_indexed.c.in \ + type_contiguous.c.in \ + type_create_darray.c.in \ + type_get_true_extent.c.in \ + type_create_subarray.c.in \ + type_create_struct.c.in \ + type_create_hindexed.c.in \ + type_create_hindexed_block.c.in \ + type_create_indexed_block.c.in \ + type_create_hvector.c.in \ + get_count.c.in \ + get_elements.c.in \ + psend_init_ts.c.in \ + precv_init_ts.c.in 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..5d9924d350d --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/accumulate_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$ + * + * 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..f9a51c5cc28 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/allgather_init_ts.c.in @@ -0,0 +1,76 @@ +/* + * 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$ + * + * 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..6ef928593eb --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/allgather_ts.c.in @@ -0,0 +1,68 @@ +/* + * 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$ + * + * 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..3c30e3139f5 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/allgatherv_init_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-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$ + * + * 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..7f606a4d2b0 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/allgatherv_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-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$ + * + * 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..6cfa34e032b --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/allreduce_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$ + * + * 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..c0c5a6cb363 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/allreduce_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$ + * + * 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..870fc9b9636 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/alltoall_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-2021 Research Organization for Information Science + * and Technology (RIST). 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..81dd106afc6 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/alltoall_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$ + * + * 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..dead3fbbe3c --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/alltoallv_init_ts.c.in @@ -0,0 +1,88 @@ +/* + * 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$ + * + * 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..d99df6fd377 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/alltoallv_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-2019 Research Organization for Information Science + * and Technology (RIST). 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..5d7a430919d --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/alltoallw_init_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-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$ + * + * 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..97cae3e9a37 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/base/ts.c @@ -0,0 +1,139 @@ +/* -*- 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 + +#if OMPI_FORTRAN_HAVE_TS + +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 = 0; /* 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; + +#ifdef 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 usefull. + */ + assert(cdesc->elem_len == size); + } +#endif + + types[0] = oldtype; + i = 0; + done = 0; + 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 = 1; + } + + 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 */ + } 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; +} +#endif /* OMPI_FORTRAN_HAVE_TS */ 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..66670f6ba08 --- /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 (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 (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 (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..a3e3035578d --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/bcast_init_ts.c.in @@ -0,0 +1,59 @@ +/* + * 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$ + * + * 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; + 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, + c_root, + 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/bcast_ts.c.in b/ompi/mpi/fortran/use-mpi-f08/bcast_ts.c.in new file mode 100644 index 00000000000..ebc5f9b8669 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/bcast_ts.c.in @@ -0,0 +1,51 @@ +/* + * 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$ + * + * 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..0c4c288f75b --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/bsend_init_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$ + * + * 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..dce909e8f33 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/bsend_ts.c.in @@ -0,0 +1,45 @@ +/* + * 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$ + * + * 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..ba640f2ebef --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/buffer_attach_ts.c.in @@ -0,0 +1,32 @@ +/* + * 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$ + * + * 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..ef4e85382a8 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/buffer_detach.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) 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$ + */ + + +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..fb151c8cb0f --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/compare_and_swap_ts.c.in @@ -0,0 +1,58 @@ +/* -*- 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$ + * + * 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..7ced8b25978 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/exscan_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$ + * + * 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..c81fe07e45a --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/exscan_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$ + * + * 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..a6b7542c670 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/f_sync_reg_ts.c.in @@ -0,0 +1,27 @@ +/* + * 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$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +void ompi_f_sync_reg_ts(CFI_cdesc_t *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..f2f9ff6f6fb --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/fetch_and_op_ts.c.in @@ -0,0 +1,53 @@ +/* -*- 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$ + * + * 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..a64ead33171 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_iread_all_ts.c.in @@ -0,0 +1,51 @@ +/* + * 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$ + * + * 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..06f0c26cb7e --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_iread_at_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$ + * + * 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..8da4ce544ef --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_iread_at_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$ + * + * 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..a60e413083c --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_iread_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$ + * + * 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..a87193b3cd5 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_iread_ts.c.in @@ -0,0 +1,51 @@ +/* + * 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$ + * + * 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..a8fc977e5fb --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_iwrite_all_ts.c.in @@ -0,0 +1,51 @@ +/* + * 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$ + * + * 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..6c96299dc5a --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_iwrite_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) 2015-2019 Research Organization for Information Science + * and Technology (RIST). 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..d46c05f1d50 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_iwrite_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) 2015-2019 Research Organization for Information Science + * and Technology (RIST). 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..d4a201d1453 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_iwrite_shared_ts.c.in @@ -0,0 +1,50 @@ +/* + * 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$ + * + * 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..bab6d646659 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_iwrite_ts.c.in @@ -0,0 +1,50 @@ +/* + * 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$ + * + * 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..42fd1dae4f6 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_read_all_begin_ts.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-2019 Research Organization for Information Science + * and Technology (RIST). 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..9d1f68a07ff --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_read_all_end_ts.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) 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$ + * + * 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..d95a7b93393 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_read_all_ts.c.in @@ -0,0 +1,51 @@ +/* + * 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$ + * + * 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..971fd62eb43 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_read_at_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$ + * + * 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..cf7d90e2d34 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_read_at_all_end_ts.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) 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$ + * + * 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..721c0eb756f --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_read_at_all_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) 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$ + * + * 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..b666d234ce1 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_read_at_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) 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$ + * + * 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..6bd90c9c309 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_read_ordered_begin_ts.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-2019 Research Organization for Information Science + * and Technology (RIST). 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..abf8bf8c980 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_read_ordered_end_ts.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) 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$ + * + * 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..3b9115e8e04 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_read_ordered_ts.c.in @@ -0,0 +1,51 @@ +/* + * 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$ + * + * 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..4fe4b74ca34 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_read_shared_ts.c.in @@ -0,0 +1,51 @@ +/* + * 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$ + * + * 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..b7ae0a1969b --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_read_ts.c.in @@ -0,0 +1,51 @@ +/* + * 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$ + * + * 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..bbc3eb1711f --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_write_all_begin_ts.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-2019 Research Organization for Information Science + * and Technology (RIST). 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..68ab37fa1ba --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_write_all_end_ts.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) 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$ + * + * 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..480f24af0f6 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_write_all_ts.c.in @@ -0,0 +1,51 @@ +/* + * 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$ + * + * 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..68b2c0a352c --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_write_at_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$ + * + * 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..65cc41ebbd0 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_write_at_all_end_ts.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) 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$ + * + * 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..9b8f00cc425 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_write_at_all_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) 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$ + * + * 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..e069bc4dc9b --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_write_at_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) 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$ + * + * 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..c17f4789fc3 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_write_ordered_begin_ts.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-2019 Research Organization for Information Science + * and Technology (RIST). 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..2feacd235a9 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_write_ordered_end_ts.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) 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$ + * + * 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..62707a9c955 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_write_ordered_ts.c.in @@ -0,0 +1,51 @@ +/* + * 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$ + * + * 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..f3ed0cd233d --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_write_shared_ts.c.in @@ -0,0 +1,51 @@ +/* + * 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$ + * + * 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..352ef5458a2 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/file_write_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) 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$ + * + * 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..f1c62f836e1 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/free_mem_ts.c.in @@ -0,0 +1,32 @@ +/* + * 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$ + * + * 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..0cb720516a9 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/gather_init_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-2021 Research Organization for Information Science + * and Technology (RIST). 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_senddatatype, c_recvtype; + 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 (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..62ae27e5731 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/gather_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$ + * + * 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..67d3b355bdc --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/gatherv_init_ts.c.in @@ -0,0 +1,115 @@ +/* + * 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$ + * + * 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_senddatatype, c_recvtype; + 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 (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..5a12c201467 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/gatherv_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-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$ + * + * 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..b6450e744b5 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/get_accumulate_ts.c.in @@ -0,0 +1,75 @@ +/* -*- 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$ + * + * 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..6d4be6f0e2c --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/get_address_ts.c.in @@ -0,0 +1,33 @@ +/* + * 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$ + * + * 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..111d16e2455 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/get_count.c.in @@ -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$ + * + * 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..6e0bb6a9a57 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/get_elements.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$ + * + * 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..a31a9a7f446 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/get_ts.c.in @@ -0,0 +1,51 @@ +/* + * 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$ + * + * 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..6a15e99ef34 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/iallgather_ts.c.in @@ -0,0 +1,68 @@ +/* + * 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$ + * + * 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..53c653fa5a0 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/iallgatherv_ts.c.in @@ -0,0 +1,94 @@ +/* + * 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$ + * + * 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..c798194abcd --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/iallreduce_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$ + * + * 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..4839fa1ebb5 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/ialltoall_ts.c.in @@ -0,0 +1,65 @@ +/* + * 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$ + * + * 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..5d20e4be789 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/ialltoallv_ts.c.in @@ -0,0 +1,82 @@ +/* + * 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$ + * + * 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..b337334f9eb --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/ialltoallw_ts.c.in @@ -0,0 +1,91 @@ +/* + * 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$ + * + * 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..2a4883eae4a --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/irecv_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$ + * + * 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..db1edd3500e --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/ireduce_scatter_block_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$ + * + * 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..9c8cae7975e --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/ireduce_scatter_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$ + * + * 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; + 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); + + /* TODO: Set pointer to tmp_recvcounts on request? */ +} 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..5727aec4b32 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/ireduce_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$ + * + * 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..0f155bb7f08 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/irsend_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$ + * + * 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..46f258cb4b4 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/iscan_ts.c.in @@ -0,0 +1,59 @@ +/* + * 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$ + * + * 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..8bf8eb654c9 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/iscatter_ts.c.in @@ -0,0 +1,95 @@ +/* + * 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$ + * + * 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..4822a227f7c --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/iscatterv_ts.c.in @@ -0,0 +1,107 @@ +/* + * 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$ + * + * 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 = NULL; + MPI_Datatype c_sendtype = NULL, c_recvtype = 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); + + /* TODO: c_recvdatatype seems to be getting allocated in some cases but is not used below? */ + c_ierr = @INNER_CALL@(sendbuf, + tmp_sendcounts, + tmp_displs, + c_sendtype, + recvbuf, c_recvcount, c_recvtype, + c_root, c_comm, &c_request); + + /* TODO: Free datatypes */ + + 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..39adaafe28b --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/isend_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$ + * + * 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..dcfd07fe8d1 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/isendrecv_replace_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$ + * + * 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..4958c96e8ae --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/isendrecv_ts.c.in @@ -0,0 +1,73 @@ +/* + * 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$ + * + * 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..e1a7ef91fe4 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/issend_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$ + * + * 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 bf6595c0d9f..510d064ad22 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,24 @@ 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 + +mpi-f08-interfaces-generated.h: $(prototype_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 $(prototype_files) + +# Delete generated file on maintainer-clean +MAINTAINERCLEANFILES = mpi-f08-interfaces-generated.h +endif + # # Automake doesn't do Fortran dependency analysis, so must list them # manually here. Bummer! @@ -83,6 +105,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 +117,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..f465faee95d 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,8 +382,22 @@ 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 -end interface MPI_Type_get_contents - +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 subroutine MPI_Type_get_envelope_f08(datatype,num_integers,num_addresses,num_datatypes, & combiner,ierror) @@ -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,29 +448,6 @@ 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 @@ -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,17 +1546,20 @@ subroutine MPI_Finalized_f08(flag,ierror) end subroutine MPI_Finalized_f08 end interface MPI_Finalized +! +! TODO: Does this the below comment affect TS/CFI support? +! ! 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_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) @@ -3275,210 +1856,34 @@ 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 - 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 - INTEGER, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_Put_f08 -end interface MPI_Put - -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 +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 +1894,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 +1905,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 +1965,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 +2122,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 @@ -3866,383 +2208,77 @@ 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, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_File_read_all_begin_f08 -end interface MPI_File_read_all_begin - -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 - 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, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_File_read_all_end_f08 -end interface MPI_File_read_all_end - -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 - 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, OPTIONAL, INTENT(OUT) :: ierror -end subroutine MPI_File_read_at_f08 -end interface MPI_File_read_at - -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 - 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 +2355,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) @@ -4618,280 +2492,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..4d8cc00f7db 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 @@ -49,6 +49,7 @@ #define MPI_Probe_f08 PMPI_Probe_f08 #define MPI_Recv PMPI_Recv #define MPI_Recv_f08 PMPI_Recv_f08 +#define MPI_Recv_f08_c PMPI_Recv_f08_c #define MPI_Recv_init PMPI_Recv_init #define MPI_Recv_init_f08 PMPI_Recv_init_f08 #define MPI_Request_free PMPI_Request_free @@ -61,6 +62,7 @@ #define MPI_Rsend_init_f08 PMPI_Rsend_init_f08 #define MPI_Send PMPI_Send #define MPI_Send_f08 PMPI_Send_f08 +#define MPI_Send_f08_c PMPI_Send_f08_c #define MPI_Sendrecv PMPI_Sendrecv #define MPI_Sendrecv_f08 PMPI_Sendrecv_f08 #define MPI_Sendrecv_replace PMPI_Sendrecv_replace @@ -156,8 +158,10 @@ #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_contents_f08_c PMPI_Type_get_contents_f08_c #define MPI_Type_get_envelope PMPI_Type_get_envelope #define MPI_Type_get_envelope_f08 PMPI_Type_get_envelope_f08 +#define MPI_Type_get_envelope_f08_c PMPI_Type_get_envelope_f08_c #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 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..5f23f37c8e3 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/mrecv_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) 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$ + * + * 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..d62915041e4 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/neighbor_allgather_init_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$ + * + * 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..4b2bdc95e8a --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/neighbor_allgather_ts.c.in @@ -0,0 +1,69 @@ +/* -*- 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$ + * + * 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_sendtype, + recvbuf, + c_recvcount, + c_recvtype, c_comm); + + /* TODO: Created type c_senddatatype is not being used above */ + + 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..63b360116eb --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/neighbor_allgatherv_init_ts.c.in @@ -0,0 +1,90 @@ +/* -*- 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$ + * + * 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..8b4bacf5393 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/neighbor_allgatherv_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) 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$ + * + * 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_sendtype, + recvbuf, + tmp_recvcounts, + tmp_displs, + c_recvtype, c_comm); + + /* TODO: Free datatypes (note: it also looks like the code above is not using the datatypes) */ + + 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..d6930cdc028 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/neighbor_alltoall_init_ts.c.in @@ -0,0 +1,71 @@ +/* -*- 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$ + * + * 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..d9e133aff66 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/neighbor_alltoall_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) 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$ + * + * 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..8286ff8ad98 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/neighbor_alltoallv_init_ts.c.in @@ -0,0 +1,95 @@ +/* -*- 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$ + * + * 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..d7ff1a992bf --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/neighbor_alltoallv_ts.c.in @@ -0,0 +1,78 @@ +/* -*- 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$ + * + * 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..26ff428d31c --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/neighbor_alltoallw_init_ts.c.in @@ -0,0 +1,106 @@ +/* -*- 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$ + * + * 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..b8057dcd207 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/neighbor_alltoallw_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$ + * + * 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..d69a2c48acd --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/pack_external_size.c.in @@ -0,0 +1,32 @@ +/* + * 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$ + * + * 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..b0ef467a77d --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/pack_external_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$ + * + * 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..955ee96783d --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/pack_size.c.in @@ -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$ + * + * 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..a46e60a566c --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/pack_ts.c.in @@ -0,0 +1,68 @@ +/* + * 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$ + * + * 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..b77f2d02915 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/precv_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 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$ + * + * 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 13a6148ade7..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/profile/Makefile.am +++ /dev/null @@ -1,477 +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$ -# -# 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/$(OMPI_FORTRAN_USEMPI_DIR) \ - $(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 \ - 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_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_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..e00a7db8065 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/psend_init_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 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$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + + +/* + * 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$ + * + * 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..2aa166a6867 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/put_ts.c.in @@ -0,0 +1,51 @@ +/* + * 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$ + * + * 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..d6161a7cc16 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/raccumulate_ts.c.in @@ -0,0 +1,64 @@ +/* -*- 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$ + * + * 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..614828d53ca --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/recv_init_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$ + * + * 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..af572d7ad6a --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/recv_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) 2012 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). 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..ef3dff0fec3 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/reduce_init_ts.c.in @@ -0,0 +1,68 @@ +/* + * 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$ + * + * 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..64b2d36135a --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/reduce_local_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) 2009-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). 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..d9df4b20de9 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/reduce_scatter_block_init_ts.c.in @@ -0,0 +1,68 @@ +/* + * 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$ + * + * 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..d9c435b84f8 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/reduce_scatter_block_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$ + * + * 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..04cdd801fcb --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/reduce_scatter_init_ts.c.in @@ -0,0 +1,82 @@ +/* + * 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$ + * + * 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..4a68315891d --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/reduce_scatter_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$ + * + * 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..f38ab2b970f --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/reduce_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$ + * + * 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..da6fd5668ff --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/rget_accumulate_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) 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$ + * + * 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..6c82c5ebddd --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/rget_ts.c.in @@ -0,0 +1,59 @@ +/* -*- 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$ + * + * 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..e00cb047f02 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/rput_ts.c.in @@ -0,0 +1,59 @@ +/* -*- 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$ + * + * 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..f58c01da18a --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/rsend_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$ + * + * 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..ead72050281 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/rsend_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$ + * + * 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..ea998b23765 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/scan_init_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$ + * + * 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..1a1f26adbb9 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/scan_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$ + * + * 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..a74bcac71ca --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/scatter_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-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$ + * + * 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..87bdf341fd7 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/scatter_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-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$ + * + * 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..ef45eb280b7 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/scatterv_init_ts.c.in @@ -0,0 +1,123 @@ +/* + * 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$ + * + * 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..08d54d34896 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/scatterv_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-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$ + * + * 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..7646314fa57 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/send_init_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$ + * + * 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..62d1792ac40 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/send_ts.c.in @@ -0,0 +1,45 @@ +/* + * 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$ + * + * 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..85c828636ea --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/sendrecv_replace_ts.c.in @@ -0,0 +1,59 @@ +/* + * 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$ + * + * 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..a041fc3bfd3 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/sendrecv_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$ + * + * 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..2c4fdbeb9db --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/ssend_init_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$ + * + * 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..0fba198c0b8 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/ssend_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$ + * + * 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..df50be271ef --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/status_set_elements_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 Research Organization for Information Science + * and Technology (RIST). 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..4eb2c039f92 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/testany.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-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$ + * + * 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..ed7584e9e40 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/type_contiguous.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 Research Organization for Information Science + * and Technology (RIST). 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_create_darray.c.in b/ompi/mpi/fortran/use-mpi-f08/type_create_darray.c.in new file mode 100644 index 00000000000..823d6bd8192 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/type_create_darray.c.in @@ -0,0 +1,59 @@ +/* + * 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$ + */ + +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..7ec9aebe675 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/type_create_hindexed.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-2014 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$ + */ + +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..4ec3d919b7d --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/type_create_hindexed_block.c.in @@ -0,0 +1,33 @@ +/* + * 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$ + * + * 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..cb510a4f563 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/type_create_hvector.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) 2007-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$ + */ + +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..0c0e65aec66 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/type_create_indexed_block.c.in @@ -0,0 +1,45 @@ +/* + * 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$ + */ + +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..1c2c96bfb5a --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/type_create_struct.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-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$ + * + * 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..bfbdb933113 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/type_create_subarray.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$ + * + * 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..20c6dd00c7a --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/type_get_true_extent.c.in @@ -0,0 +1,30 @@ +/* + * 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$ + */ + + +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..01a9d8226ad --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/type_indexed.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$ + * + * 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..af9b181d3aa --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/type_size.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 Research Organization for Information Science + * and Technology (RIST). 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..2df0dba031e --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/type_vector.c.in @@ -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$ + * + * 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..664e3b89a15 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/unpack_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$ + * + * 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..8f884ea2ccc --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/unpack_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$ + * + * 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..fc88382a70c --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/waitall.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-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$ + * + * 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..b04a691dbd2 --- /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$ + * + * 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..804a6926e32 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/win_allocate_shared.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-2014 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$ + */ + + +/* + * 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$ + * + * 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..36860dc492f --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/win_attach_ts.c.in @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). 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..bbb3901e4b1 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/win_create_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) 2007-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). 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..0d7a5f37fdc --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/win_detach_ts.c.in @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). 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..cdf18b055c0 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/win_shared_query.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-2014 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2017 Research Organization for Information Science + * and Technology (RIST). 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