diff --git a/MPI_DEVEL_MERGE_README b/MPI_DEVEL_MERGE_README new file mode 100644 index 0000000000..c182e11462 --- /dev/null +++ b/MPI_DEVEL_MERGE_README @@ -0,0 +1,295 @@ + svn merge -r4825:5039 svn+ssh://svn.open-mpi.org/l/svn/ompi/tmp/mpi-devel . + +U include/mpi.h +C src/event/event.c +Skipped missing target: 'src/runtime/ompi_rte_wait.c' +U src/mpi/c/status_c2f.c +U src/mpi/c/Makefile.am +U src/mpi/c/get_elements.c +U src/mpi/c/status_set_elements.c +U src/mpi/c/status_f2c.c +U src/mpi/c/type_create_darray.c +U src/mpi/c/get_count.c +D src/mpi/c/wtick.c +D src/mpi/c/wtime.c +U src/mpi/f77/keyval_free_f.c +U src/mpi/f77/type_free_keyval_f.c +U src/mpi/f77/rsend_init_f.c +U src/mpi/f77/gatherv_f.c +U src/mpi/f77/open_port_f.c +U src/mpi/f77/type_ub_f.c +U src/mpi/f77/file_get_view_f.c +U src/mpi/f77/sendrecv_f.c +U src/mpi/f77/file_set_atomicity_f.c +U src/mpi/f77/type_get_name_f.c +U src/mpi/f77/file_set_size_f.c +U src/mpi/f77/win_complete_f.c +U src/mpi/f77/win_get_attr_f.c +U src/mpi/f77/file_read_all_end_f.c +U src/mpi/f77/type_create_resized_f.c +U src/mpi/f77/scatterv_f.c +U src/mpi/f77/comm_test_inter_f.c +U src/mpi/f77/bindings.h +U src/mpi/f77/file_read_at_f.c +U src/mpi/f77/type_create_f90_integer_f.c +U src/mpi/f77/file_open_f.c +U src/mpi/f77/file_delete_f.c +U src/mpi/f77/file_iwrite_f.c +U src/mpi/f77/file_iread_shared_f.c +U src/mpi/f77/pack_external_size_f.c +U src/mpi/f77/comm_spawn_multiple_f.c +U src/mpi/f77/dims_create_f.c +U src/mpi/f77/unpack_external_f.c +U src/mpi/f77/file_iread_f.c +U src/mpi/f77/type_match_size_f.c +U src/mpi/f77/reduce_scatter_f.c +U src/mpi/f77/win_get_name_f.c +U src/mpi/f77/type_create_hvector_f.c +U src/mpi/f77/recv_f.c +U src/mpi/f77/win_lock_f.c +U src/mpi/f77/constants.h +U src/mpi/f77/send_init_f.c +U src/mpi/f77/grequest_start_f.c +U src/mpi/f77/info_delete_f.c +U src/mpi/f77/pack_external_f.c +U src/mpi/f77/scan_f.c +U src/mpi/f77/get_address_f.c +U src/mpi/f77/file_iwrite_at_f.c +U src/mpi/f77/testany_f.c +U src/mpi/f77/status_set_cancelled_f.c +U src/mpi/f77/info_free_f.c +U src/mpi/f77/win_fence_f.c +U src/mpi/f77/type_lb_f.c +U src/mpi/f77/win_post_f.c +U src/mpi/f77/isend_f.c +U src/mpi/f77/info_dup_f.c +U src/mpi/f77/wait_f.c +U src/mpi/f77/finalized_f.c +U src/mpi/f77/comm_split_f.c +U src/mpi/f77/type_create_struct_f.c +U src/mpi/f77/unpublish_name_f.c +U src/mpi/f77/win_delete_attr_f.c +U src/mpi/f77/type_hvector_f.c +U src/mpi/f77/file_seek_shared_f.c +U src/mpi/f77/ssend_f.c +U src/mpi/f77/unpack_f.c +U src/mpi/f77/type_set_attr_f.c +U src/mpi/f77/win_create_errhandler_f.c +U src/mpi/f77/group_compare_f.c +U src/mpi/f77/file_read_ordered_end_f.c +U src/mpi/f77/file_write_at_all_f.c +U src/mpi/f77/type_get_true_extent_f.c +U src/mpi/f77/is_thread_main_f.c +U src/mpi/f77/testall_f.c +U src/mpi/f77/pack_size_f.c +U src/mpi/f77/file_write_at_all_begin_f.c +U src/mpi/f77/file_sync_f.c +U src/mpi/f77/info_get_nthkey_f.c +U src/mpi/f77/comm_set_errhandler_f.c +U src/mpi/f77/type_get_envelope_f.c +U src/mpi/f77/file_write_at_f.c +U src/mpi/f77/file_read_ordered_begin_f.c +U src/mpi/f77/graph_create_f.c +U src/mpi/f77/file_set_view_f.c +U src/mpi/f77/errhandler_get_f.c +U src/mpi/f77/file_read_at_all_f.c +U src/mpi/f77/type_hindexed_f.c +U src/mpi/f77/type_dup_f.c +U src/mpi/f77/request_get_status_f.c +U src/mpi/f77/info_get_f.c +U src/mpi/f77/type_set_name_f.c +U src/mpi/f77/pcontrol_f.c +U src/mpi/f77/op_create_f.c +U src/mpi/f77/win_set_attr_f.c +U src/mpi/f77/group_difference_f.c +U src/mpi/f77/put_f.c +U src/mpi/f77/lookup_name_f.c +U src/mpi/f77/win_free_keyval_f.c +U src/mpi/f77/keyval_create_f.c +U src/mpi/f77/win_create_f.c +U src/mpi/f77/accumulate_f.c +U src/mpi/f77/get_version_f.c +U src/mpi/f77/info_get_valuelen_f.c +U src/mpi/f77/file_write_all_begin_f.c +U src/mpi/f77/file_get_group_f.c +U src/mpi/f77/file_write_at_all_end_f.c +U src/mpi/f77/query_thread_f.c +U src/mpi/f77/prototypes_mpi.h +U src/mpi/f77/win_call_errhandler_f.c +U src/mpi/f77/attr_put_f.c +U src/mpi/f77/info_get_nkeys_f.c +U src/mpi/f77/file_iread_at_f.c +U src/mpi/f77/type_create_hindexed_f.c +U src/mpi/f77/exscan_f.c +U src/mpi/f77/group_size_f.c +U src/mpi/f77/file_preallocate_f.c +U src/mpi/f77/start_f.c +U src/mpi/f77/group_incl_f.c +U src/mpi/f77/publish_name_f.c +U src/mpi/f77/group_excl_f.c +U src/mpi/f77/file_read_f.c +U src/mpi/f77/graphdims_get_f.c +U src/mpi/f77/file_write_shared_f.c +U src/mpi/f77/comm_create_errhandler_f.c +U src/mpi/f77/type_struct_f.c +U src/mpi/f77/issend_f.c +U src/mpi/f77/add_error_string_f.c +U src/mpi/f77/file_get_position_shared_f.c +U src/mpi/f77/file_get_info_f.c +U src/mpi/f77/send_f.c +U src/mpi/f77/comm_get_name_f.c +U src/mpi/f77/group_free_f.c +U src/mpi/f77/file_read_shared_f.c +U src/mpi/f77/group_union_f.c +U src/mpi/f77/probe_f.c +U src/mpi/f77/type_get_extent_f.c +U src/mpi/f77/graph_neighbors_count_f.c +U src/mpi/f77/info_create_f.c +U src/mpi/f77/type_create_indexed_block_f.c +U src/mpi/f77/test_f.c +U src/mpi/f77/type_indexed_f.c +U src/mpi/f77/comm_size_f.c +U src/mpi/f77/waitsome_f.c +U src/mpi/f77/comm_create_keyval_f.c +U src/mpi/f77/initialized_f.c +U src/mpi/f77/file_read_all_begin_f.c +U src/mpi/f77/errhandler_create_f.c +U src/mpi/f77/type_create_f90_complex_f.c +U src/mpi/f77/gather_f.c +U src/mpi/f77/type_size_f.c +U src/mpi/f77/op_free_f.c +U src/mpi/f77/intercomm_create_f.c +U src/mpi/f77/group_intersection_f.c +U src/mpi/f77/file_iwrite_shared_f.c +U src/mpi/f77/type_commit_f.c +U src/mpi/f77/testsome_f.c +U src/mpi/f77/file_read_at_all_end_f.c +U src/mpi/f77/win_set_errhandler_f.c +U src/mpi/f77/free_mem_f.c +U src/mpi/f77/type_free_f.c +U src/mpi/f77/recv_init_f.c +U src/mpi/f77/grequest_complete_f.c +U src/mpi/f77/allgatherv_f.c +U src/mpi/f77/request_free_f.c +U src/mpi/f77/file_read_at_all_begin_f.c +U src/mpi/f77/status_set_elements_f.c +U src/mpi/f77/bsend_f.c +U src/mpi/f77/comm_set_attr_f.c +U src/mpi/f77/type_contiguous_f.c +U src/mpi/f77/file_read_all_f.c +U src/mpi/f77/allgather_f.c +U src/mpi/f77/type_create_darray_f.c +U src/mpi/f77/group_rank_f.c +U src/mpi/f77/file_create_errhandler_f.c +U src/mpi/f77/rsend_f.c +U src/mpi/f77/get_elements_f.c +U src/mpi/f77/constants_f.c +U src/mpi/f77/type_create_subarray_f.c +U src/mpi/f77/intercomm_merge_f.c +U src/mpi/f77/error_class_f.c +U src/mpi/f77/type_create_f90_real_f.c +U src/mpi/f77/win_free_f.c +U src/mpi/f77/file_set_errhandler_f.c +U src/mpi/f77/graph_neighbors_f.c +U src/mpi/f77/file_set_info_f.c +U src/mpi/f77/comm_set_name_f.c +U src/mpi/f77/file_get_type_extent_f.c +U src/mpi/f77/reduce_f.c +U src/mpi/f77/file_get_size_f.c +U src/mpi/f77/waitany_f.c +U src/mpi/f77/get_processor_name_f.c +U src/mpi/f77/error_string_f.c +U src/mpi/f77/iprobe_f.c +U src/mpi/f77/startall_f.c +U src/mpi/f77/init_thread_f.c +U src/mpi/f77/win_create_keyval_f.c +U src/mpi/f77/file_write_ordered_f.c +U src/mpi/f77/ssend_init_f.c +U src/mpi/f77/errhandler_set_f.c +U src/mpi/f77/file_write_ordered_begin_f.c +U src/mpi/f77/sendrecv_replace_f.c +U src/mpi/f77/info_set_f.c +U src/mpi/f77/irecv_f.c +U src/mpi/f77/profile/prototypes_pmpi.h +U src/mpi/f77/group_range_incl_f.c +U src/mpi/f77/topo_test_f.c +U src/mpi/f77/file_write_all_f.c +U src/mpi/f77/group_range_excl_f.c +U src/mpi/f77/register_datarep_f.c +U src/mpi/f77/errhandler_free_f.c +U src/mpi/f77/file_write_f.c +U src/mpi/f77/type_delete_attr_f.c +U src/mpi/f77/type_get_contents_f.c +U src/mpi/f77/waitall_f.c +U src/mpi/f77/finalize_f.c +U src/mpi/f77/win_get_errhandler_f.c +U src/mpi/f77/file_get_byte_offset_f.c +U src/mpi/f77/type_extent_f.c +U src/mpi/f77/win_get_group_f.c +U src/mpi/f77/test_cancelled_f.c +U src/mpi/f77/file_read_ordered_f.c +U src/mpi/f77/get_f.c +U src/mpi/f77/file_write_ordered_end_f.c +U src/mpi/f77/file_seek_f.c +U src/mpi/f77/cart_shift_f.c +U src/mpi/f77/get_count_f.c +U src/mpi/f77/graph_map_f.c +U src/mpi/f77/graph_get_f.c +U src/mpi/f77/file_get_position_f.c +U src/mpi/f77/type_vector_f.c +U src/mpi/f77/init_f.c +U src/mpi/f77/comm_spawn_f.c +U src/mpi/f77/ibsend_f.c +U src/mpi/f77/scatter_f.c +U src/mpi/f77/file_write_all_end_f.c +U src/mpi/f77/group_translate_ranks_f.c +U src/mpi/f77/type_get_attr_f.c +U src/mpi/f77/bsend_init_f.c +U src/mpi/f77/pack_f.c +U src/mpi/f77/type_create_keyval_f.c +U src/mpi/f77/file_get_errhandler_f.c +U src/mpi/f77/irsend_f.c +C src/mpi/runtime/ompi_mpi_params.c +U src/request/grequest.c +U src/request/grequest.h +U src/request/req_wait.c +U src/request/request.h +Skipped missing target: 'src/mca/pcm/rsh/pcm_rsh_spawn.c' +Skipped missing target: 'src/mca/pcm/rsh' +Skipped missing target: 'src/mca/pcm' +U src/mca/pml/teg/src/pml_teg_isend.c +U src/mca/pml/teg/src/pml_teg_irecv.c +U src/mca/pml/teg/src/pml_teg_recvreq.h +U src/mca/pml/base/pml_base_sendreq.h +U src/mca/pml/base/pml_base_bsend.c +A src/mca/pml/example +A src/mca/pml/example/pml_example_recvreq.h +A src/mca/pml/example/pml_example.c +A src/mca/pml/example/pml_example_iprobe.c +A src/mca/pml/example/.ompi_ignore +A src/mca/pml/example/pml_example.h +A src/mca/pml/example/pml_example_cancel.c +A src/mca/pml/example/pml_example_start.c +A src/mca/pml/example/configure.params +A src/mca/pml/example/pml_example_ptl.c +A src/mca/pml/example/pml_example_recvfrag.c +A src/mca/pml/example/pml_example_sendreq.c +A src/mca/pml/example/pml_example_component.c +A src/mca/pml/example/pml_example_isend.c +A src/mca/pml/example/pml_example_proc.c +A src/mca/pml/example/pml_example_ptl.h +A src/mca/pml/example/pml_example_progress.c +A src/mca/pml/example/pml_example_recvfrag.h +A src/mca/pml/example/Makefile.am +A src/mca/pml/example/pml_example_sendreq.h +A src/mca/pml/example/pml_example_recvreq.c +A src/mca/pml/example/pml_example_proc.h +A src/mca/pml/example/pml_example_irecv.c +U src/mca/ptl/sm/src/ptl_sm_component.c +C src/mca/ptl/gm/src/ptl_gm.c +C src/mca/ptl/gm/src/ptl_gm_priv.c +C src/mca/ptl/gm/src/ptl_gm_component.c +U src/mca/ptl/gm/src/ptl_gm.h +U src/mca/ptl/tcp/src/ptl_tcp.c +C src/mca/iof/base/iof_base_flush.c + diff --git a/include/mpi.h b/include/mpi.h index a5fb096873..8f67fe157f 100644 --- a/include/mpi.h +++ b/include/mpi.h @@ -1084,8 +1084,31 @@ OMPI_DECLSPEC int MPI_Win_test(MPI_Win win, int *flag); OMPI_DECLSPEC int MPI_Win_unlock(int rank, MPI_Win win); OMPI_DECLSPEC int MPI_Win_wait(MPI_Win win); #endif -OMPI_DECLSPEC double MPI_Wtick(void); -OMPI_DECLSPEC double MPI_Wtime(void); + +/* These 2 functions will shortly became macros, giving access to the high performance + * timers available on the specific architecture. Until then we let them here. + * Beware: We dont have profiling interface for these 2 functions. + */ +#ifdef HAVE_SYS_TIME_H +#include +#endif +#include + +static inline double MPI_Wtick(void) +{ + return (double)0.000001; +} + +static inline double MPI_Wtime(void) +{ + struct timeval tv; + double wtime; + gettimeofday(&tv, NULL); + wtime = tv.tv_sec; + wtime += (double)tv.tv_usec / 1000000.0; + return wtime; +} + /* * Profiling MPI API diff --git a/src/event/event.c b/src/event/event.c index 1cb9f5d718..57cc67a356 100644 --- a/src/event/event.c +++ b/src/event/event.c @@ -207,7 +207,7 @@ static int ompi_timeout_next(struct timeval *tv) } #endif - +#if OMPI_ENABLE_PROGRESS_THREADS /* run loop for dispatch thread */ static void* ompi_event_run(ompi_object_t* arg) { @@ -230,7 +230,7 @@ static void* ompi_event_run(ompi_object_t* arg) #endif return NULL; } - +#endif /* OMPI_ENABLE_PROGRESS_THREADS */ #if OMPI_ENABLE_PROGRESS_THREADS static void ompi_event_pipe_handler(int sd, short flags, void* user) diff --git a/src/mca/pml/base/pml_base_bsend.c b/src/mca/pml/base/pml_base_bsend.c index 960e53be3c..91e471b1d8 100644 --- a/src/mca/pml/base/pml_base_bsend.c +++ b/src/mca/pml/base/pml_base_bsend.c @@ -268,7 +268,7 @@ int mca_pml_base_bsend_request_start(ompi_request_t* request) /* * Request completed - free buffer and decrement pending count - */ + */ int mca_pml_base_bsend_request_fini(ompi_request_t* request) { mca_pml_base_send_request_t* sendreq = (mca_pml_base_send_request_t*)request; diff --git a/src/mca/pml/base/pml_base_sendreq.h b/src/mca/pml/base/pml_base_sendreq.h index a7bfa0caaf..cf6f6e7aa1 100644 --- a/src/mca/pml/base/pml_base_sendreq.h +++ b/src/mca/pml/base/pml_base_sendreq.h @@ -100,6 +100,7 @@ typedef struct mca_pml_base_send_request_t mca_pml_base_send_request_t; request->req_base.req_persistent = persistent; \ request->req_base.req_pml_complete = (persistent ? true : false); \ request->req_base.req_free_called = false; \ + request->req_base.req_ompi.req_status._cancelled = 0; \ \ /* initialize datatype convertor for this request */ \ if(count > 0) { \ diff --git a/src/mca/pml/example/.ompi_ignore b/src/mca/pml/example/.ompi_ignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/mca/pml/example/Makefile.am b/src/mca/pml/example/Makefile.am new file mode 100644 index 0000000000..9a13ffcb5c --- /dev/null +++ b/src/mca/pml/example/Makefile.am @@ -0,0 +1,62 @@ +# +# Copyright (c) 2004-2005 The Trustees of Indiana University. +# All rights reserved. +# Copyright (c) 2004-2005 The Trustees of the University of Tennessee. +# All rights reserved. +# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Use the top-level Makefile.options + +include $(top_ompi_srcdir)/config/Makefile.options + +# Make the output library in this directory, and name it either +# mca__.la (for DSO builds) or libmca__.la +# (for static builds). + +if OMPI_BUILD_pml_example_DSO +component_noinst = +component_install = mca_pml_example.la +else +component_noinst = libmca_pml_example.la +component_install = +endif + +local_sources = \ + pml_example.c \ + pml_example.h \ + pml_example_cancel.c \ + pml_example_component.c \ + pml_example_iprobe.c \ + pml_example_irecv.c \ + pml_example_isend.c \ + pml_example_ptl.c \ + pml_example_ptl.h \ + pml_example_proc.c \ + pml_example_proc.h \ + pml_example_progress.c \ + pml_example_recvfrag.c \ + pml_example_recvfrag.h \ + pml_example_recvreq.c \ + pml_example_recvreq.h \ + pml_example_sendreq.c \ + pml_example_sendreq.h \ + pml_example_start.c + +mcacomponentdir = $(libdir)/openmpi +mcacomponent_LTLIBRARIES = $(component_install) +mca_pml_example_la_SOURCES = $(local_sources) +mca_pml_example_la_LIBADD = +mca_pml_example_la_LDFLAGS = -module -avoid-version + +noinst_LTLIBRARIES = $(component_noinst) +libmca_pml_example_la_SOURCES = $(local_sources) +libmca_pml_example_la_LIBADD = +libmca_pml_example_la_LDFLAGS = -module -avoid-version + diff --git a/src/mca/pml/example/configure.params b/src/mca/pml/example/configure.params new file mode 100644 index 0000000000..2d2dc938d7 --- /dev/null +++ b/src/mca/pml/example/configure.params @@ -0,0 +1,20 @@ +# -*- shell-script -*- +# +# Copyright (c) 2004-2005 The Trustees of Indiana University. +# All rights reserved. +# Copyright (c) 2004-2005 The Trustees of the University of Tennessee. +# All rights reserved. +# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module + +PARAM_INIT_FILE=pml_teg.c +PARAM_CONFIG_HEADER_FILE="example_config.h" +PARAM_CONFIG_FILES="Makefile" diff --git a/src/mca/pml/example/pml_example.c b/src/mca/pml/example/pml_example.c new file mode 100644 index 0000000000..fc0c3557b9 --- /dev/null +++ b/src/mca/pml/example/pml_example.c @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. + * All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" +#include "pml_example.h" +#include "pml_example_recvreq.h" +#include "pml_example_sendreq.h" + +mca_pml_example_t mca_pml_example = { + { + mca_pml_example_add_procs, + mca_pml_example_del_procs, + mca_pml_example_add_ptls, + mca_pml_example_control, + mca_pml_example_progress, + mca_pml_example_add_comm, + mca_pml_example_del_comm, + mca_pml_example_irecv_init, + mca_pml_example_irecv, + mca_pml_example_recv, + mca_pml_example_isend_init, + mca_pml_example_isend, + mca_pml_example_send, + mca_pml_example_iprobe, + mca_pml_example_probe, + mca_pml_example_start + } +}; + +int mca_pml_example_add_comm(ompi_communicator_t* comm) +{ + return OMPI_SUCCESS; +} + +int mca_pml_example_del_comm(ompi_communicator_t* comm) +{ + return OMPI_SUCCESS; +} + +int mca_pml_example_add_ptls(ompi_list_t *ptls) +{ + return OMPI_SUCCESS; +} + +int mca_pml_example_control(int param, void* value, size_t size) +{ + return OMPI_SUCCESS; +} + +int mca_pml_example_add_procs(ompi_proc_t** procs, size_t nprocs) +{ + return OMPI_SUCCESS; +} + +int mca_pml_example_del_procs(ompi_proc_t** procs, size_t nprocs) +{ + return OMPI_SUCCESS; +} + diff --git a/src/mca/pml/example/pml_example.h b/src/mca/pml/example/pml_example.h new file mode 100644 index 0000000000..7f30fe4095 --- /dev/null +++ b/src/mca/pml/example/pml_example.h @@ -0,0 +1,134 @@ +/* + * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. + * All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#ifndef PML_EXAMPLE_H_HAS_BEEN_INCLUDED +#define PML_EXAMPLE_H_HAS_BEEN_INCLUDED + +#include "threads/thread.h" +#include "threads/condition.h" +#include "class/ompi_free_list.h" +#include "util/cmd_line.h" +#include "request/request.h" +#include "mca/pml/pml.h" +#include "mca/ptl/ptl.h" + +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif + +struct mca_pml_example_t { + mca_pml_base_module_t super; + + mca_ptl_base_component_t **example_ptl_components; + size_t example_num_ptl_components; + + mca_ptl_base_module_t** example_ptl_modules; + size_t example_num_ptl_modules; + + ompi_list_t example_procs; + ompi_mutex_t example_lock; + + /* free list of requests */ + ompi_free_list_t example_send_requests; + ompi_free_list_t example_recv_requests; + + /* list of pending send requests */ + ompi_list_t example_send_pending; +}; +typedef struct mca_pml_example_t mca_pml_example_t; + +extern mca_pml_example_t mca_pml_example; + +/* + * PML interface functions. + */ +extern int mca_pml_example_add_comm( struct ompi_communicator_t* comm ); +extern int mca_pml_example_del_comm( struct ompi_communicator_t* comm ); + +extern int mca_pml_example_add_procs( struct ompi_proc_t **procs, size_t nprocs ); +extern int mca_pml_example_del_procs( struct ompi_proc_t **procs, size_t nprocs ); + +extern int mca_pml_example_add_ptls( ompi_list_t *ptls ); + +extern int mca_pml_example_control( int param, void *size, size_t value ); + +extern int mca_pml_example_iprobe( int dst, + int tag, + struct ompi_communicator_t* comm, + int *matched, + ompi_status_public_t* status ); + +extern int mca_pml_example_probe( int dst, + int tag, + struct ompi_communicator_t* comm, + ompi_status_public_t* status ); + +extern int mca_pml_example_cancel( ompi_request_t* request ); +extern int mca_pml_example_cancelled( ompi_request_t* request, int *flag ); + +extern int mca_pml_example_isend_init( void *buf, + size_t count, + ompi_datatype_t *datatype, + int dst, + int tag, + mca_pml_base_send_mode_t mode, + struct ompi_communicator_t* comm, + struct ompi_request_t **request ); + +extern int mca_pml_example_isend( void *buf, + size_t count, + ompi_datatype_t *datatype, + int dst, + int tag, + mca_pml_base_send_mode_t mode, + struct ompi_communicator_t* comm, + struct ompi_request_t **request ); + +extern int mca_pml_example_send( void *buf, + size_t count, + ompi_datatype_t *datatype, + int dst, + int tag, + mca_pml_base_send_mode_t mode, + struct ompi_communicator_t* comm ); + +extern int mca_pml_example_irecv_init( void *buf, + size_t count, + ompi_datatype_t *datatype, + int src, + int tag, + struct ompi_communicator_t* comm, + struct ompi_request_t **request ); + +extern int mca_pml_example_irecv( void *buf, + size_t count, + ompi_datatype_t *datatype, + int src, + int tag, + struct ompi_communicator_t* comm, + struct ompi_request_t **request ); + +extern int mca_pml_example_recv( void *buf, + size_t count, + ompi_datatype_t *datatype, + int src, + int tag, + struct ompi_communicator_t* comm, + ompi_status_public_t* status ); + +extern int mca_pml_example_progress(void); + +extern int mca_pml_example_start( size_t count, ompi_request_t** requests ); + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + +#endif /* PML_EXAMPLE_H_HAS_BEEN_INCLUDED */ diff --git a/src/mca/pml/example/pml_example_cancel.c b/src/mca/pml/example/pml_example_cancel.c new file mode 100644 index 0000000000..4a52d92549 --- /dev/null +++ b/src/mca/pml/example/pml_example_cancel.c @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. + * All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" + +#include "pml_example.h" + +int mca_pml_example_cancel(ompi_request_t* request) +{ + return OMPI_SUCCESS; +} + +int mca_pml_example_cancelled(ompi_request_t* request, int* flag) +{ + if(NULL != flag) + *flag = 0; + return OMPI_SUCCESS; +} + diff --git a/src/mca/pml/example/pml_example_component.c b/src/mca/pml/example/pml_example_component.c new file mode 100644 index 0000000000..54287c418b --- /dev/null +++ b/src/mca/pml/example/pml_example_component.c @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. + * All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" + +#include "event/event.h" +#include "pml_example.h" +#include "mca/base/mca_base_param.h" + +static int mca_pml_example_component_open(void); +static int mca_pml_example_component_close(void); +static mca_pml_base_module_t* mca_pml_example_component_init( int* priority, + bool *allow_multi_user_threads, bool *have_hidden_threads ); +static int mca_pml_example_component_fini(void); + +mca_pml_base_component_1_0_0_t mca_pml_example_component = { + + /* First, the mca_base_component_t struct containing meta + * information about the component itself */ + + { + /* Indicate that we are a pml v1.0.0 component (which also implies + * a specific MCA version) */ + + MCA_PML_BASE_VERSION_1_0_0, + + "example", /* MCA component name */ + 1, /* MCA component major version */ + 0, /* MCA component minor version */ + 0, /* MCA component release version */ + mca_pml_example_component_open, /* component open */ + mca_pml_example_component_close /* component close */ + }, + + /* Next the MCA v1.0.0 component meta data */ + + { + /* Whether the component is checkpointable or not */ + false + }, + + mca_pml_example_component_init, /* component init */ + mca_pml_example_component_fini /* component finalize */ +}; + +static inline int mca_pml_example_param_register_int( const char* param_name, + int default_value ) +{ + int id = mca_base_param_register_int("pml","example",param_name,NULL,default_value); + int param_value = default_value; + mca_base_param_lookup_int(id,¶m_value); + return param_value; +} + +static int mca_pml_example_component_open(void) +{ + return OMPI_SUCCESS; +} + +static int mca_pml_example_component_close(void) +{ + return OMPI_SUCCESS; +} + +static mca_pml_base_module_t* +mca_pml_example_component_init( int* priority, + bool *allow_multi_user_threads, + bool *have_hidden_threads ) +{ + *priority = mca_pml_example_param_register_int( "priority", 0 ); + *have_hidden_threads = false; + *allow_multi_user_threads &= true; + return &mca_pml_example.super; +} + +static int mca_pml_example_component_fini(void) +{ + return OMPI_SUCCESS; +} + diff --git a/src/mca/pml/example/pml_example_iprobe.c b/src/mca/pml/example/pml_example_iprobe.c new file mode 100644 index 0000000000..7ec11224a8 --- /dev/null +++ b/src/mca/pml/example/pml_example_iprobe.c @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. + * All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" +#include "request/request.h" +#include "pml_example.h" + +int mca_pml_example_iprobe( int src, int tag, + struct ompi_communicator_t *comm, + int *matched, ompi_status_public_t * status ) +{ + return OMPI_SUCCESS; +} + +int mca_pml_example_probe( int src, int tag, + struct ompi_communicator_t *comm, + ompi_status_public_t * status ) +{ + return OMPI_SUCCESS; +} diff --git a/src/mca/pml/example/pml_example_irecv.c b/src/mca/pml/example/pml_example_irecv.c new file mode 100644 index 0000000000..88f23779a8 --- /dev/null +++ b/src/mca/pml/example/pml_example_irecv.c @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. + * All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" +#include "pml_example.h" +#include "request/request.h" + +int mca_pml_example_irecv_init( void *addr, + size_t count, + ompi_datatype_t * datatype, + int src, + int tag, + struct ompi_communicator_t *comm, + struct ompi_request_t **request ) +{ + return OMPI_SUCCESS; +} + +int mca_pml_example_irecv( void *addr, + size_t count, + ompi_datatype_t * datatype, + int src, + int tag, + struct ompi_communicator_t *comm, + struct ompi_request_t **request ) +{ + return OMPI_SUCCESS; +} + + +int mca_pml_example_recv( void *addr, + size_t count, + ompi_datatype_t * datatype, + int src, + int tag, + struct ompi_communicator_t *comm, + ompi_status_public_t * status ) +{ + return OMPI_SUCCESS; +} + diff --git a/src/mca/pml/example/pml_example_isend.c b/src/mca/pml/example/pml_example_isend.c new file mode 100644 index 0000000000..4ab3162663 --- /dev/null +++ b/src/mca/pml/example/pml_example_isend.c @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. + * All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" +#include "pml_example.h" + +int mca_pml_example_isend_init( void* buf, + size_t count, + ompi_datatype_t* datatype, + int dst, + int tag, + mca_pml_base_send_mode_t sendmode, + ompi_communicator_t* comm, + ompi_request_t** request ) +{ + return OMPI_SUCCESS; +} + + +int mca_pml_example_isend( void* buf, + size_t count, + ompi_datatype_t* datatype, + int dst, + int tag, + mca_pml_base_send_mode_t sendmode, + ompi_communicator_t* comm, + ompi_request_t** request ) +{ + return OMPI_SUCCESS; +} + +int mca_pml_example_send( void *buf, + size_t count, + ompi_datatype_t* datatype, + int dst, + int tag, + mca_pml_base_send_mode_t sendmode, + ompi_communicator_t* comm ) +{ + return OMPI_SUCCESS; +} + diff --git a/src/mca/pml/example/pml_example_proc.c b/src/mca/pml/example/pml_example_proc.c new file mode 100644 index 0000000000..2de8f1b711 --- /dev/null +++ b/src/mca/pml/example/pml_example_proc.c @@ -0,0 +1,13 @@ +/* + * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. + * All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" +#include "pml_example.h" + diff --git a/src/mca/pml/example/pml_example_proc.h b/src/mca/pml/example/pml_example_proc.h new file mode 100644 index 0000000000..ce29c0ae3a --- /dev/null +++ b/src/mca/pml/example/pml_example_proc.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. + * All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#ifndef PML_EXAMPLE_PROC_H_HAS_BEEN_INCLUDED +#define PML_EXAMPLE_PROC_H_HAS_BEEN_INCLUDED + + + +#endif /* PML_EXAMPLE_PROC_H_HAS_BEEN_INCLUDED */ diff --git a/src/mca/pml/example/pml_example_progress.c b/src/mca/pml/example/pml_example_progress.c new file mode 100644 index 0000000000..8c6de275f1 --- /dev/null +++ b/src/mca/pml/example/pml_example_progress.c @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. + * All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" +#include "pml_example.h" + +int mca_pml_example_progress(void) +{ + return 0; +} diff --git a/src/mca/pml/example/pml_example_ptl.c b/src/mca/pml/example/pml_example_ptl.c new file mode 100644 index 0000000000..2de8f1b711 --- /dev/null +++ b/src/mca/pml/example/pml_example_ptl.c @@ -0,0 +1,13 @@ +/* + * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. + * All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" +#include "pml_example.h" + diff --git a/src/mca/pml/example/pml_example_ptl.h b/src/mca/pml/example/pml_example_ptl.h new file mode 100644 index 0000000000..5b2f6b4c83 --- /dev/null +++ b/src/mca/pml/example/pml_example_ptl.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. + * All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#ifndef PML_EXAMPLE_PTL_H_HAS_BEEN_INCLUDED +#define PML_EXAMPLE_PTL_H_HAS_BEEN_INCLUDED + + + +#endif /* PML_EXAMPLE_PTL_H_HAS_BEEN_INCLUDED */ diff --git a/src/mca/pml/example/pml_example_recvfrag.c b/src/mca/pml/example/pml_example_recvfrag.c new file mode 100644 index 0000000000..09a6fd6f5d --- /dev/null +++ b/src/mca/pml/example/pml_example_recvfrag.c @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. + * All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" +#include "pml_example.h" +#include "pml_example_recvfrag.h" + +bool mca_pml_example_recv_frag_match( mca_ptl_base_module_t* ptl, + mca_ptl_base_recv_frag_t* frag, + mca_ptl_base_match_header_t* header ) +{ + return false; +} diff --git a/src/mca/pml/example/pml_example_recvfrag.h b/src/mca/pml/example/pml_example_recvfrag.h new file mode 100644 index 0000000000..821009c334 --- /dev/null +++ b/src/mca/pml/example/pml_example_recvfrag.h @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. + * All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#ifndef PML_EXAMPLE_RECVFRAG_H_HAS_BEEN_INCLUDED +#define PML_EXAMPLE_RECVFRAG_H_HAS_BEEN_INCLUDED + +#include "mca/ptl/base/ptl_base_recvfrag.h" + +bool mca_pml_example_recv_frag_match( mca_ptl_base_module_t* ptl, + mca_ptl_base_recv_frag_t* frag, + mca_ptl_base_match_header_t* header ); + +#endif /* PML_EXAMPLE_RECVFRAG_H_HAS_BEEN_INCLUDED */ diff --git a/src/mca/pml/example/pml_example_recvreq.c b/src/mca/pml/example/pml_example_recvreq.c new file mode 100644 index 0000000000..fa1e40ce1f --- /dev/null +++ b/src/mca/pml/example/pml_example_recvreq.c @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. + * All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" +#include "pml_example.h" +#include "pml_example_recvreq.h" + +/* + * Update the recv request status to reflect the number of bytes + * received and actually delivered to the application. + */ + +void mca_pml_example_recv_request_progress( struct mca_ptl_base_module_t* ptl, + mca_pml_base_recv_request_t* req, + size_t bytes_received, + size_t bytes_delivered ) +{ +} diff --git a/src/mca/pml/example/pml_example_recvreq.h b/src/mca/pml/example/pml_example_recvreq.h new file mode 100644 index 0000000000..76e09ec679 --- /dev/null +++ b/src/mca/pml/example/pml_example_recvreq.h @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. + * All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#ifndef PML_EXAMPLE_RECVREQ_H_HAS_BEEN_INCLUDED +#define PML_EXAMPLE_RECVREQ_H_HAS_BEEN_INCLUDED + +#include "mca/pml/base/pml_base_recvreq.h" + +void mca_pml_example_recv_request_progress( struct mca_ptl_base_module_t* ptl, + mca_pml_base_recv_request_t* req, + size_t bytes_received, + size_t bytes_delivered ); + +#endif /* PML_EXAMPLE_RECVREQ_H_HAS_BEEN_INCLUDED */ diff --git a/src/mca/pml/example/pml_example_sendreq.c b/src/mca/pml/example/pml_example_sendreq.c new file mode 100644 index 0000000000..fde0717883 --- /dev/null +++ b/src/mca/pml/example/pml_example_sendreq.c @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. + * All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" +#include "pml_example.h" +#include "pml_example_sendreq.h" + +void mca_pml_example_send_request_progress( struct mca_ptl_base_module_t* ptl, + mca_pml_base_send_request_t* req, + size_t bytes_sent ) +{ +} + diff --git a/src/mca/pml/example/pml_example_sendreq.h b/src/mca/pml/example/pml_example_sendreq.h new file mode 100644 index 0000000000..7f5a2f60cf --- /dev/null +++ b/src/mca/pml/example/pml_example_sendreq.h @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. + * All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#ifndef PML_EXAMPLE_SENDREQ_H_HAS_BEEN_INCLUDED +#define PML_EXAMPLE_SENDREQ_H_HAS_BEEN_INCLUDED + +#include "mca/pml/base/pml_base_sendreq.h" + +void mca_pml_example_send_request_progress( struct mca_ptl_base_module_t* ptl, + mca_pml_base_send_request_t* req, + size_t bytes_sent ); + +#endif /* PML_EXAMPLE_SENDREQ_H_HAS_BEEN_INCLUDED */ diff --git a/src/mca/pml/example/pml_example_start.c b/src/mca/pml/example/pml_example_start.c new file mode 100644 index 0000000000..33e33e071f --- /dev/null +++ b/src/mca/pml/example/pml_example_start.c @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. + * All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" +#include "pml_example.h" + +int mca_pml_example_start(size_t count, ompi_request_t** requests) +{ + return OMPI_SUCCESS; +} diff --git a/src/mca/pml/teg/src/pml_teg_irecv.c b/src/mca/pml/teg/src/pml_teg_irecv.c index aff914add7..34b6b3fa83 100644 --- a/src/mca/pml/teg/src/pml_teg_irecv.c +++ b/src/mca/pml/teg/src/pml_teg_irecv.c @@ -88,8 +88,7 @@ int mca_pml_teg_recv(void *addr, count, datatype, src, tag, comm, false); if ((rc = mca_pml_teg_recv_request_start(recvreq)) != OMPI_SUCCESS) { - MCA_PML_TEG_RECV_REQUEST_RETURN(recvreq); - return rc; + goto recv_finish; } if (recvreq->req_base.req_ompi.req_complete == false) { @@ -108,12 +107,11 @@ int mca_pml_teg_recv(void *addr, ompi_request_waiting--; } } - - /* return status */ - if (NULL != status) { + recv_finish: + if (NULL != status) { /* return status */ *status = recvreq->req_base.req_ompi.req_status; } MCA_PML_TEG_RECV_REQUEST_RETURN(recvreq); - return OMPI_SUCCESS; + return recvreq->req_base.req_ompi.req_status.MPI_ERROR; } diff --git a/src/mca/pml/teg/src/pml_teg_isend.c b/src/mca/pml/teg/src/pml_teg_isend.c index 00b954ade0..1a77efccb8 100644 --- a/src/mca/pml/teg/src/pml_teg_isend.c +++ b/src/mca/pml/teg/src/pml_teg_isend.c @@ -72,10 +72,8 @@ int mca_pml_teg_isend(void *buf, comm, sendmode, false); MCA_PML_TEG_SEND_REQUEST_START(sendreq, rc); - if (rc != OMPI_SUCCESS) - return rc; *request = (ompi_request_t *) sendreq; - return OMPI_SUCCESS; + return rc; } diff --git a/src/mca/pml/teg/src/pml_teg_recvreq.h b/src/mca/pml/teg/src/pml_teg_recvreq.h index c71ea0743d..b0d493598a 100644 --- a/src/mca/pml/teg/src/pml_teg_recvreq.h +++ b/src/mca/pml/teg/src/pml_teg_recvreq.h @@ -87,6 +87,7 @@ static inline int mca_pml_teg_recv_request_start(mca_pml_base_recv_request_t* re request->req_base.req_ompi.req_complete = false; request->req_base.req_ompi.req_state = OMPI_REQUEST_ACTIVE; request->req_base.req_ompi.req_status.MPI_ERROR = OMPI_SUCCESS; + request->req_base.req_ompi.req_status._cancelled = 0; /* attempt to match posted recv */ if(request->req_base.req_peer == OMPI_ANY_SOURCE) { diff --git a/src/mca/ptl/gm/src/ptl_gm.c b/src/mca/ptl/gm/src/ptl_gm.c index 16a9cc5a48..9aef6042e0 100644 --- a/src/mca/ptl/gm/src/ptl_gm.c +++ b/src/mca/ptl/gm/src/ptl_gm.c @@ -325,7 +325,7 @@ mca_ptl_gm_matched( mca_ptl_base_module_t * ptl, mca_ptl_gm_module_t *gm_ptl; mca_ptl_gm_recv_frag_t *recv_frag; mca_ptl_gm_peer_t* peer; - struct iovec iov = { NULL, 0}; + struct iovec iov = { NULL, 0 }; gm_ptl = (mca_ptl_gm_module_t *)ptl; request = frag->frag_request; @@ -333,19 +333,18 @@ mca_ptl_gm_matched( mca_ptl_base_module_t * ptl, peer = (mca_ptl_gm_peer_t*)recv_frag->frag_recv.frag_base.frag_peer; if( frag->frag_base.frag_header.hdr_common.hdr_flags & MCA_PTL_FLAGS_ACK ) { /* need to send an ack back */ - ompi_list_item_t *item; + ompi_list_item_t *item; - OMPI_FREE_LIST_TRY_GET( &(gm_ptl->gm_send_dma_frags), item ); - + OMPI_FREE_LIST_TRY_GET( &(gm_ptl->gm_send_dma_frags), item ); if( NULL == item ) { ompi_output(0,"[%s:%d] unable to alloc a gm fragment\n", __FILE__,__LINE__); OMPI_THREAD_LOCK (&mca_ptl_gm_component.gm_lock); ompi_list_append (&mca_ptl_gm_module.gm_pending_acks, (ompi_list_item_t *)frag); OMPI_THREAD_UNLOCK (&mca_ptl_gm_component.gm_lock); } else { - ompi_atomic_sub( &(gm_ptl->num_send_tokens), 1 ); - assert( gm_ptl->num_send_tokens >= 0 ); - hdr = (mca_ptl_base_header_t*)item; + ompi_atomic_sub( &(gm_ptl->num_send_tokens), 1 ); + assert( gm_ptl->num_send_tokens >= 0 ); + hdr = (mca_ptl_base_header_t*)item; hdr->hdr_ack.hdr_common.hdr_type = MCA_PTL_HDR_TYPE_ACK; hdr->hdr_ack.hdr_common.hdr_flags = 0; @@ -370,12 +369,12 @@ mca_ptl_gm_matched( mca_ptl_base_module_t * ptl, unsigned int max_data, out_size; int freeAfter; - iov.iov_len = mca_ptl_gm_component.gm_segment_size - sizeof(mca_ptl_base_rendezvous_header_t); - if( frag->frag_base.frag_size < iov.iov_len ) { - iov.iov_len = frag->frag_base.frag_size; - } - /* Here we expect that frag_addr is the begin of the buffer header included */ - iov.iov_base = frag->frag_base.frag_addr; + iov.iov_len = mca_ptl_gm_component.gm_segment_size - sizeof(mca_ptl_base_rendezvous_header_t); + if( frag->frag_base.frag_size < iov.iov_len ) { + iov.iov_len = frag->frag_base.frag_size; + } + /* Here we expect that frag_addr is the begin of the buffer header included */ + iov.iov_base = frag->frag_base.frag_addr; ompi_convertor_copy( peer->peer_proc->proc_ompi->proc_convertor, &frag->frag_base.frag_convertor ); diff --git a/src/mca/ptl/gm/src/ptl_gm.h b/src/mca/ptl/gm/src/ptl_gm.h index 4eae77be92..1ac4f97546 100644 --- a/src/mca/ptl/gm/src/ptl_gm.h +++ b/src/mca/ptl/gm/src/ptl_gm.h @@ -51,7 +51,7 @@ extern "C" { uint32_t gm_free_list_num; /**< initial size of free lists */ uint32_t gm_free_list_max; /**< maximum size of free lists */ uint32_t gm_free_list_inc; /**< number of elements to alloc when growing free lists */ - uint32_t gm_segment_size; /**< size of the allocated segment */ + uint32_t gm_segment_size; /**< size of the allocated segment */ uint32_t gm_eager_limit; /**< number of bytes before the rendez-vous protocol. If the **< size of the message is less than this number then GM **< use a eager protocol. */ @@ -61,6 +61,7 @@ extern "C" { struct mca_ptl_gm_proc_t* gm_local; ompi_list_t gm_procs; ompi_list_t gm_send_req; + ompi_free_list_t gm_unexpected_frags_data; ompi_mutex_t gm_lock; /**< lock for accessing module state */ }; diff --git a/src/mca/ptl/gm/src/ptl_gm_component.c b/src/mca/ptl/gm/src/ptl_gm_component.c index a4338deee7..f6340cec03 100644 --- a/src/mca/ptl/gm/src/ptl_gm_component.c +++ b/src/mca/ptl/gm/src/ptl_gm_component.c @@ -147,9 +147,9 @@ int mca_ptl_gm_component_close (void) if (NULL != mca_ptl_gm_component.gm_ptl_modules) free (mca_ptl_gm_component.gm_ptl_modules); - OBJ_DESTRUCT (&mca_ptl_gm_component.gm_procs); - OBJ_DESTRUCT (&mca_ptl_gm_component.gm_send_req); - OBJ_DESTRUCT (&mca_ptl_gm_component.gm_lock); + OBJ_DESTRUCT( &mca_ptl_gm_component.gm_procs ); + OBJ_DESTRUCT( &mca_ptl_gm_component.gm_send_req ); + OBJ_DESTRUCT( &mca_ptl_gm_component.gm_lock ); return OMPI_SUCCESS; } @@ -279,8 +279,8 @@ mca_ptl_gm_discover_boards( mca_ptl_gm_module_t** pptl, pptl[index]->port_id = port_no; pptl[index]->gm_port = gm_port; - pptl[index]->local_id = local_id; - pptl[index]->global_id = global_id; + pptl[index]->local_id = local_id; + pptl[index]->global_id = global_id; /* everything is OK let's mark it as usable and go to the next one */ if( (++index) >= max_ptls ) { @@ -341,22 +341,22 @@ mca_ptl_gm_init_sendrecv (mca_ptl_gm_module_t * ptl) ptl->gm_send_dma_memory = gm_dma_malloc( ptl->gm_port, (mca_ptl_gm_component.gm_segment_size * ptl->num_send_tokens) + GM_PAGE_LEN ); if( NULL == ptl->gm_send_dma_memory ) { - ompi_output( 0, "unable to allocate registered memory\n" ); - return OMPI_ERR_OUT_OF_RESOURCE; + ompi_output( 0, "unable to allocate registered memory\n" ); + return OMPI_ERR_OUT_OF_RESOURCE; } for (i = 0; i < ptl->num_send_tokens; i++) { - sfragment->send_buf = NULL; - OMPI_FREE_LIST_RETURN( &(ptl->gm_send_frags), (ompi_list_item_t *)sfragment ); - OMPI_FREE_LIST_RETURN( &(ptl->gm_send_dma_frags), + sfragment->send_buf = NULL; + OMPI_FREE_LIST_RETURN( &(ptl->gm_send_frags), (ompi_list_item_t *)sfragment ); + OMPI_FREE_LIST_RETURN( &(ptl->gm_send_dma_frags), (ompi_list_item_t *)((char*)ptl->gm_send_dma_memory + - i * mca_ptl_gm_component.gm_segment_size) ); - sfragment++; + i * mca_ptl_gm_component.gm_segment_size) ); + sfragment++; } /*****************RECEIVE*****************************/ /* allow remote memory access */ if( GM_SUCCESS != gm_allow_remote_memory_access (ptl->gm_port) ) { - ompi_output (0, "unable to allow remote memory access\n"); + ompi_output (0, "unable to allow remote memory access\n"); } OBJ_CONSTRUCT (&(ptl->gm_recv_outstanding_queue), ompi_list_t); @@ -365,9 +365,9 @@ mca_ptl_gm_init_sendrecv (mca_ptl_gm_module_t * ptl) OBJ_CONSTRUCT (&(ptl->gm_recv_frags_free), ompi_free_list_t); ompi_free_list_init( &(ptl->gm_recv_frags_free), - sizeof (mca_ptl_gm_recv_frag_t), - OBJ_CLASS (mca_ptl_gm_recv_frag_t), - 0, /* by default I will provide all items */ + sizeof (mca_ptl_gm_recv_frag_t), + OBJ_CLASS (mca_ptl_gm_recv_frag_t), + 0, /* by default I will provide all items */ ptl->num_recv_tokens * 10, /* the maximum number of items in the free list */ ptl->num_recv_tokens, /* if it need to allocate some more */ NULL ); @@ -379,25 +379,25 @@ mca_ptl_gm_init_sendrecv (mca_ptl_gm_module_t * ptl) /*allocate the registered memory */ ptl->gm_recv_dma_memory = - gm_dma_malloc( ptl->gm_port, (mca_ptl_gm_component.gm_segment_size * ptl->num_recv_tokens) + GM_PAGE_LEN ); + gm_dma_malloc( ptl->gm_port, (mca_ptl_gm_component.gm_segment_size * ptl->num_recv_tokens) + GM_PAGE_LEN ); if( NULL == ptl->gm_recv_dma_memory ) { - ompi_output( 0, "unable to allocate registered memory for receive\n" ); - return OMPI_ERR_OUT_OF_RESOURCE; + ompi_output( 0, "unable to allocate registered memory for receive\n" ); + return OMPI_ERR_OUT_OF_RESOURCE; } for( i = 0; i < 2; i++ ) { - OMPI_FREE_LIST_RETURN( &(ptl->gm_recv_frags_free), (ompi_list_item_t *)free_rfragment ); - free_rfragment++; + OMPI_FREE_LIST_RETURN( &(ptl->gm_recv_frags_free), (ompi_list_item_t *)free_rfragment ); + free_rfragment++; - gm_provide_receive_buffer( ptl->gm_port, (char*)ptl->gm_recv_dma_memory + i * mca_ptl_gm_component.gm_segment_size, - GM_SIZE, GM_HIGH_PRIORITY ); + gm_provide_receive_buffer( ptl->gm_port, (char*)ptl->gm_recv_dma_memory + i * mca_ptl_gm_component.gm_segment_size, + GM_SIZE, GM_HIGH_PRIORITY ); } for( i = 2; i < ptl->num_recv_tokens; i++ ) { - OMPI_FREE_LIST_RETURN( &(ptl->gm_recv_frags_free), (ompi_list_item_t *)free_rfragment ); - free_rfragment++; + OMPI_FREE_LIST_RETURN( &(ptl->gm_recv_frags_free), (ompi_list_item_t *)free_rfragment ); + free_rfragment++; - gm_provide_receive_buffer( ptl->gm_port, (char*)ptl->gm_recv_dma_memory + i * mca_ptl_gm_component.gm_segment_size, - GM_SIZE, GM_LOW_PRIORITY ); + gm_provide_receive_buffer( ptl->gm_port, (char*)ptl->gm_recv_dma_memory + i * mca_ptl_gm_component.gm_segment_size, + GM_SIZE, GM_LOW_PRIORITY ); } OBJ_CONSTRUCT( &(ptl->gm_pending_acks), ompi_list_t ); @@ -415,7 +415,7 @@ mca_ptl_gm_init( mca_ptl_gm_component_t * gm ) /* let's try to find if GM is available */ if( GM_SUCCESS != gm_init() ) { ompi_output( 0, "[%s:%d] error in initializing the gm library\n", __FILE__, __LINE__ ); - return OMPI_ERR_OUT_OF_RESOURCE; + return OMPI_ERR_OUT_OF_RESOURCE; } /* First discover all available boards. For each board we will create a unique PTL */ mca_ptl_gm_component.gm_ptl_modules = calloc( mca_ptl_gm_component.gm_max_ptl_modules, @@ -427,9 +427,9 @@ mca_ptl_gm_init( mca_ptl_gm_component_t * gm ) mca_ptl_gm_component.gm_num_ptl_modules = mca_ptl_gm_discover_boards( mca_ptl_gm_component.gm_ptl_modules, - mca_ptl_gm_component.gm_max_ptl_modules, - mca_ptl_gm_component.gm_max_boards_number, - mca_ptl_gm_component.gm_max_port_number ); + mca_ptl_gm_component.gm_max_ptl_modules, + mca_ptl_gm_component.gm_max_boards_number, + mca_ptl_gm_component.gm_max_port_number ); /* In the case when we are in a multi-threaded environment each * PTL will have its own thread. At this point all structures are @@ -444,11 +444,16 @@ mca_ptl_gm_init( mca_ptl_gm_component_t * gm ) break; if( ompi_using_threads() ) { #if OMPI_HAVE_POSIX_THREADS - ptl->thread.t_run = (ompi_thread_fn_t)mca_ptl_gm_thread_progress; - ptl->thread.t_arg = (void*)ptl; + ptl->thread.t_run = (ompi_thread_fn_t)mca_ptl_gm_thread_progress; + ptl->thread.t_arg = (void*)ptl; #endif /* OMPI_HAVE_POSIX_THREADS */ +<<<<<<< .working if( OMPI_SUCCESS != ompi_thread_start( &(ptl->thread) ) ) { break; +======= + if( OMPI_SUCCESS != ompi_thread_start( &(ptl->thread) ) ) + break; +>>>>>>> .merge-right.r5039 } } } @@ -462,6 +467,15 @@ mca_ptl_gm_init( mca_ptl_gm_component_t * gm ) } mca_ptl_gm_component.gm_num_ptl_modules = save_counter; + /* A free list containing all memory used for keep data for unexpected requests. */ + ompi_free_list_init( &(mca_ptl_gm_component.gm_unexpected_frags_data), + mca_ptl_gm_component.gm_segment_size, + OBJ_CLASS (ompi_list_item_t), + 0, /* do not allocate any items I'll provide them */ + 0, /* maximum number of list allocated elements will be zero */ + 0, + NULL ); /* not using mpool */ + return (mca_ptl_gm_component.gm_num_ptl_modules > 0 ? OMPI_SUCCESS : OMPI_ERR_OUT_OF_RESOURCE); } @@ -520,12 +534,16 @@ mca_ptl_gm_component_control (int param, void *value, size_t size) char* gm_get_local_buffer( void ) { - return malloc( sizeof(char) * mca_ptl_gm_component.gm_segment_size ); + ompi_list_item_t* item; + int rc; + + OMPI_FREE_LIST_WAIT( &(mca_ptl_gm_component.gm_unexpected_frags_data), item, rc ); + return (char*)item; } void gm_release_local_buffer( char* ptr ) { - free(ptr); + OMPI_FREE_LIST_RETURN( &(mca_ptl_gm_component.gm_unexpected_frags_data), (ompi_list_item_t*)ptr ); } /* diff --git a/src/mca/ptl/gm/src/ptl_gm_priv.c b/src/mca/ptl/gm/src/ptl_gm_priv.c index 87bd741fe4..fd0fdbb000 100644 --- a/src/mca/ptl/gm/src/ptl_gm_priv.c +++ b/src/mca/ptl/gm/src/ptl_gm_priv.c @@ -101,57 +101,57 @@ int mca_ptl_gm_receiver_advance_pipeline( mca_ptl_gm_recv_frag_t* frag, int only /* start the current get */ get_line = &(frag->pipeline.lines[frag->pipeline.pos_transfert]); if( (PTL_GM_PIPELINE_TRANSFERT & get_line->flags) == PTL_GM_PIPELINE_TRANSFERT ) { - peer->get_started = true; - gm_get( peer->peer_ptl->gm_port, get_line->remote_memory.lval, - get_line->local_memory.pval, get_line->length, - GM_LOW_PRIORITY, peer->local_id, peer->port_number, mca_ptl_gm_get_callback, frag ); - get_line->flags ^= PTL_GM_PIPELINE_REMOTE; - DO_DEBUG( count += sprintf( buffer + count, " start get %lld (%d)", get_line->length, frag->pipeline.pos_transfert ); ); - frag->pipeline.pos_transfert = (frag->pipeline.pos_transfert + 1) % GM_PIPELINE_DEPTH; + peer->get_started = true; + gm_get( peer->peer_ptl->gm_port, get_line->remote_memory.lval, + get_line->local_memory.pval, get_line->length, + GM_LOW_PRIORITY, peer->local_id, peer->port_number, mca_ptl_gm_get_callback, frag ); + get_line->flags ^= PTL_GM_PIPELINE_REMOTE; + DO_DEBUG( count += sprintf( buffer + count, " start get %lld (%d)", get_line->length, frag->pipeline.pos_transfert ); ); + frag->pipeline.pos_transfert = (frag->pipeline.pos_transfert + 1) % GM_PIPELINE_DEPTH; } else if( 1 == onlyifget ) return OMPI_SUCCESS; /* register the next segment */ reg_line = &(frag->pipeline.lines[frag->pipeline.pos_register]); length = frag->frag_recv.frag_base.frag_size - frag->frag_bytes_processed; if( (0 != length) && !(reg_line->flags & PTL_GM_PIPELINE_REGISTER) ) { - reg_line->hdr_flags = get_line->hdr_flags; - reg_line->length = length; - if( reg_line->length > mca_ptl_gm_component.gm_rdma_frag_size ) - reg_line->length = mca_ptl_gm_component.gm_rdma_frag_size; - reg_line->offset = get_line->offset + get_line->length; - reg_line->local_memory.lval = 0L; - reg_line->local_memory.pval = (char*)frag->frag_recv.frag_base.frag_addr + - reg_line->offset; - status = gm_register_memory( peer->peer_ptl->gm_port, reg_line->local_memory.pval, - reg_line->length ); - if( GM_SUCCESS != status ) { - ompi_output( 0, "Cannot register receiver memory (%p, %ld) bytes offset %ld\n", - reg_line->local_memory.pval, - reg_line->length, reg_line->offset ); - return OMPI_ERROR; - } - DO_DEBUG( count += sprintf( buffer + count, " start register %lld (%d)", reg_line->length, frag->pipeline.pos_register ); ); - reg_line->flags |= PTL_GM_PIPELINE_REGISTER; - frag->frag_bytes_processed += reg_line->length; - frag->pipeline.pos_register = (frag->pipeline.pos_register + 1) % GM_PIPELINE_DEPTH; + reg_line->hdr_flags = get_line->hdr_flags; + reg_line->length = length; + if( reg_line->length > mca_ptl_gm_component.gm_rdma_frag_size ) + reg_line->length = mca_ptl_gm_component.gm_rdma_frag_size; + reg_line->offset = get_line->offset + get_line->length; + reg_line->local_memory.lval = 0L; + reg_line->local_memory.pval = (char*)frag->frag_recv.frag_base.frag_addr + + reg_line->offset; + status = gm_register_memory( peer->peer_ptl->gm_port, reg_line->local_memory.pval, + reg_line->length ); + if( GM_SUCCESS != status ) { + ompi_output( 0, "Cannot register receiver memory (%p, %ld) bytes offset %ld\n", + reg_line->local_memory.pval, + reg_line->length, reg_line->offset ); + return OMPI_ERROR; + } + DO_DEBUG( count += sprintf( buffer + count, " start register %lld (%d)", reg_line->length, frag->pipeline.pos_register ); ); + reg_line->flags |= PTL_GM_PIPELINE_REGISTER; + frag->frag_bytes_processed += reg_line->length; + frag->pipeline.pos_register = (frag->pipeline.pos_register + 1) % GM_PIPELINE_DEPTH; } /* deregister the previous one */ dereg_line = &(frag->pipeline.lines[frag->pipeline.pos_deregister]); if( dereg_line->flags & PTL_GM_PIPELINE_DEREGISTER ) { /* something usefull */ - /*status = gm_deregister_memory( peer->peer_ptl->gm_port, + status = gm_deregister_memory( peer->peer_ptl->gm_port, dereg_line->local_memory.pval, dereg_line->length ); - if( GM_SUCCESS != status ) { + if( GM_SUCCESS != status ) { ompi_output( 0, "unpinning receiver memory from get (%p, %u) failed \n", dereg_line->local_memory.pval, dereg_line->length ); - }*/ + } dereg_line->flags ^= (PTL_GM_PIPELINE_DEREGISTER|PTL_GM_PIPELINE_REGISTER); assert( dereg_line->flags == 0 ); frag->frag_bytes_validated += dereg_line->length; - DO_DEBUG( count += sprintf( buffer + count, " start deregister %lld (%d)", dereg_line->length, frag->pipeline.pos_deregister ); ) - frag->pipeline.pos_deregister = (frag->pipeline.pos_deregister + 1) % GM_PIPELINE_DEPTH; + DO_DEBUG( count += sprintf( buffer + count, " start deregister %lld (%d)", dereg_line->length, frag->pipeline.pos_deregister ); ) + frag->pipeline.pos_deregister = (frag->pipeline.pos_deregister + 1) % GM_PIPELINE_DEPTH; } if( frag->frag_recv.frag_base.frag_size <= frag->frag_bytes_validated ) { @@ -159,7 +159,7 @@ int mca_ptl_gm_receiver_advance_pipeline( mca_ptl_gm_recv_frag_t* frag, int only frag->frag_recv.frag_request, frag->frag_recv.frag_base.frag_size, frag->frag_recv.frag_base.frag_size ); OMPI_FREE_LIST_RETURN( &(peer->peer_ptl->gm_recv_frags_free), (ompi_list_item_t*)frag ); - DO_DEBUG( count += sprintf( buffer + count, " finish" ); ) + DO_DEBUG( count += sprintf( buffer + count, " finish" ); ) } DO_DEBUG( ompi_output( 0, "%s", buffer ); ) return OMPI_SUCCESS; @@ -180,21 +180,21 @@ int mca_ptl_gm_sender_advance_pipeline( mca_ptl_gm_send_frag_t* frag ) /* send current segment */ send_line = &(frag->pipeline.lines[frag->pipeline.pos_transfert]); if( (send_line->flags & PTL_GM_PIPELINE_TRANSFERT) == PTL_GM_PIPELINE_TRANSFERT ) { - ompi_list_item_t* item; - int32_t rc; + ompi_list_item_t* item; + int32_t rc; - OMPI_FREE_LIST_WAIT( &(peer->peer_ptl->gm_send_dma_frags), item, rc ); - ompi_atomic_sub( &(peer->peer_ptl->num_send_tokens), 1 ); - hdr = (mca_ptl_gm_frag_header_t*)item; + OMPI_FREE_LIST_WAIT( &(peer->peer_ptl->gm_send_dma_frags), item, rc ); + ompi_atomic_sub( &(peer->peer_ptl->num_send_tokens), 1 ); + hdr = (mca_ptl_gm_frag_header_t*)item; - hdr->hdr_frag.hdr_common.hdr_type = MCA_PTL_HDR_TYPE_FRAG; - hdr->hdr_frag.hdr_common.hdr_flags = send_line->hdr_flags | frag->frag_send.frag_base.frag_header.hdr_common.hdr_flags; - hdr->hdr_frag.hdr_src_ptr.lval = 0L; /* for VALGRIND/PURIFY - REPLACE WITH MACRO */ - hdr->hdr_frag.hdr_src_ptr.pval = frag; - hdr->hdr_frag.hdr_dst_ptr = frag->frag_send.frag_base.frag_header.hdr_ack.hdr_dst_match; - hdr->hdr_frag.hdr_frag_offset = send_line->offset; - hdr->hdr_frag.hdr_frag_length = send_line->length; - hdr->registered_memory = send_line->local_memory; + hdr->hdr_frag.hdr_common.hdr_type = MCA_PTL_HDR_TYPE_FRAG; + hdr->hdr_frag.hdr_common.hdr_flags = send_line->hdr_flags | frag->frag_send.frag_base.frag_header.hdr_common.hdr_flags; + hdr->hdr_frag.hdr_src_ptr.lval = 0L; /* for VALGRIND/PURIFY - REPLACE WITH MACRO */ + hdr->hdr_frag.hdr_src_ptr.pval = frag; + hdr->hdr_frag.hdr_dst_ptr = frag->frag_send.frag_base.frag_header.hdr_ack.hdr_dst_match; + hdr->hdr_frag.hdr_frag_offset = send_line->offset; + hdr->hdr_frag.hdr_frag_length = send_line->length; + hdr->registered_memory = send_line->local_memory; gm_send_with_callback( peer->peer_ptl->gm_port, hdr, GM_SIZE, sizeof(mca_ptl_gm_frag_header_t), @@ -203,54 +203,54 @@ int mca_ptl_gm_sender_advance_pipeline( mca_ptl_gm_send_frag_t* frag ) peer->port_number, send_continue_callback, (void*)hdr ); - send_line->flags ^= PTL_GM_PIPELINE_REMOTE; - frag->pipeline.pos_transfert = (frag->pipeline.pos_transfert + 1) % GM_PIPELINE_DEPTH; - DO_DEBUG( count += sprintf( buffer + count, " send new fragment %lld", send_line->length ); ) + send_line->flags ^= PTL_GM_PIPELINE_REMOTE; + frag->pipeline.pos_transfert = (frag->pipeline.pos_transfert + 1) % GM_PIPELINE_DEPTH; + DO_DEBUG( count += sprintf( buffer + count, " send new fragment %lld", send_line->length ); ) } /* deregister previous segment */ dereg_line = &(frag->pipeline.lines[frag->pipeline.pos_deregister]); if( dereg_line->flags & PTL_GM_PIPELINE_DEREGISTER ) { /* something usefull */ - /*status = gm_deregister_memory( peer->peer_ptl->gm_port, - dereg_line->local_memory.pval, dereg_line->length ); - if( GM_SUCCESS != status ) { - ompi_output( 0, "unpinning receiver memory from get (%p, %u) failed \n", - dereg_line->local_memory.pval, dereg_line->length ); - }*/ - dereg_line->flags ^= (PTL_GM_PIPELINE_REGISTER | PTL_GM_PIPELINE_DEREGISTER); - assert( dereg_line->flags == 0 ); + status = gm_deregister_memory( peer->peer_ptl->gm_port, + dereg_line->local_memory.pval, dereg_line->length ); + if( GM_SUCCESS != status ) { + ompi_output( 0, "unpinning receiver memory from get (%p, %u) failed \n", + dereg_line->local_memory.pval, dereg_line->length ); + } + dereg_line->flags ^= (PTL_GM_PIPELINE_REGISTER | PTL_GM_PIPELINE_DEREGISTER); + assert( dereg_line->flags == 0 ); frag->frag_bytes_validated += dereg_line->length; - frag->pipeline.pos_deregister = (frag->pipeline.pos_deregister + 1) % GM_PIPELINE_DEPTH; - DO_DEBUG( count += sprintf( buffer + count, " start deregister %lld", dereg_line->length ); ) + frag->pipeline.pos_deregister = (frag->pipeline.pos_deregister + 1) % GM_PIPELINE_DEPTH; + DO_DEBUG( count += sprintf( buffer + count, " start deregister %lld", dereg_line->length ); ) } /* register next segment */ reg_line = &(frag->pipeline.lines[frag->pipeline.pos_register]); if( !(reg_line->flags & PTL_GM_PIPELINE_REGISTER) ) { - reg_line->length = frag->frag_send.frag_base.frag_size - frag->frag_bytes_processed; - if( 0 != reg_line->length ) { - reg_line->hdr_flags = frag->frag_send.frag_base.frag_header.hdr_common.hdr_flags; - if( reg_line->length > mca_ptl_gm_component.gm_rdma_frag_size ) { - reg_line->length = mca_ptl_gm_component.gm_rdma_frag_size; - } else { - reg_line->hdr_flags |= PTL_FLAG_GM_LAST_FRAGMENT; - } - reg_line->offset = send_line->offset + send_line->length; - reg_line->local_memory.lval = 0L; - reg_line->local_memory.pval = (char*)frag->frag_send.frag_base.frag_addr + - reg_line->offset; - status = gm_register_memory( peer->peer_ptl->gm_port, reg_line->local_memory.pval, - reg_line->length ); - if( GM_SUCCESS != status ) { - ompi_output( 0, "Cannot register sender memory (%p, %ld) bytes offset %ld\n", - reg_line->local_memory.pval, reg_line->length, reg_line->offset ); - return OMPI_ERROR; - } - reg_line->flags |= PTL_GM_PIPELINE_TRANSFERT; - frag->frag_bytes_processed += reg_line->length; - frag->pipeline.pos_register = (frag->pipeline.pos_register + 1) % GM_PIPELINE_DEPTH; - DO_DEBUG( count += sprintf( buffer + count, " start register %lld", reg_line->length ); ) - } + reg_line->length = frag->frag_send.frag_base.frag_size - frag->frag_bytes_processed; + if( 0 != reg_line->length ) { + reg_line->hdr_flags = frag->frag_send.frag_base.frag_header.hdr_common.hdr_flags; + if( reg_line->length > mca_ptl_gm_component.gm_rdma_frag_size ) { + reg_line->length = mca_ptl_gm_component.gm_rdma_frag_size; + } else { + reg_line->hdr_flags |= PTL_FLAG_GM_LAST_FRAGMENT; + } + reg_line->offset = send_line->offset + send_line->length; + reg_line->local_memory.lval = 0L; + reg_line->local_memory.pval = (char*)frag->frag_send.frag_base.frag_addr + + reg_line->offset; + status = gm_register_memory( peer->peer_ptl->gm_port, reg_line->local_memory.pval, + reg_line->length ); + if( GM_SUCCESS != status ) { + ompi_output( 0, "Cannot register sender memory (%p, %ld) bytes offset %ld\n", + reg_line->local_memory.pval, reg_line->length, reg_line->offset ); + return OMPI_ERROR; + } + reg_line->flags |= PTL_GM_PIPELINE_TRANSFERT; + frag->frag_bytes_processed += reg_line->length; + frag->pipeline.pos_register = (frag->pipeline.pos_register + 1) % GM_PIPELINE_DEPTH; + DO_DEBUG( count += sprintf( buffer + count, " start register %lld", reg_line->length ); ) + } } DO_DEBUG( ompi_output( 0, "%s", buffer ); ) @@ -277,7 +277,7 @@ int mca_ptl_gm_peer_send_continue( mca_ptl_gm_peer_t *ptl_peer, * before attempting to send the fragment */ mca_pml_base_send_request_offset( sendreq, - fragment->frag_send.frag_base.frag_size ); + fragment->frag_send.frag_base.frag_size ); DO_DEBUG( ompi_output( 0, "sender start new send length %ld\n", *size ); ) /* The first DMA memory buffer has been alocated in same time as the fragment */ item = (ompi_list_item_t*)fragment->send_buf; @@ -285,42 +285,42 @@ int mca_ptl_gm_peer_send_continue( mca_ptl_gm_peer_t *ptl_peer, remaining_bytes = fragment->frag_send.frag_base.frag_size - fragment->frag_bytes_processed; if( remaining_bytes <= mca_ptl_gm_component.gm_eager_limit ) { /* small protocol */ - int32_t freeAfter; - uint32_t max_data, in_size; - struct iovec iov; - ompi_convertor_t *convertor = &(fragment->frag_send.frag_base.frag_convertor); + int32_t freeAfter; + uint32_t max_data, in_size; + struct iovec iov; + ompi_convertor_t *convertor = &(fragment->frag_send.frag_base.frag_convertor); - /* If we have an eager send then we should send the rest of the data. */ + /* If we have an eager send then we should send the rest of the data. */ while( 0 < remaining_bytes ) { - if( NULL == item ) { - OMPI_FREE_LIST_WAIT( &(ptl_peer->peer_ptl->gm_send_dma_frags), item, rc ); - ompi_atomic_sub( &(ptl_peer->peer_ptl->num_send_tokens), 1 ); - hdr = (mca_ptl_gm_frag_header_t*)item; - } + if( NULL == item ) { + OMPI_FREE_LIST_WAIT( &(ptl_peer->peer_ptl->gm_send_dma_frags), item, rc ); + ompi_atomic_sub( &(ptl_peer->peer_ptl->num_send_tokens), 1 ); + hdr = (mca_ptl_gm_frag_header_t*)item; + } iov.iov_base = (char*)item + sizeof(mca_ptl_base_frag_header_t); iov.iov_len = mca_ptl_gm_component.gm_segment_size - sizeof(mca_ptl_base_frag_header_t); - if( iov.iov_len >= remaining_bytes ) - iov.iov_len = remaining_bytes; + if( iov.iov_len >= remaining_bytes ) + iov.iov_len = remaining_bytes; max_data = iov.iov_len; in_size = 1; if( ompi_convertor_pack(convertor, &(iov), &in_size, &max_data, &freeAfter) < 0) return OMPI_ERROR; - hdr->hdr_frag.hdr_common.hdr_type = MCA_PTL_HDR_TYPE_FRAG; - hdr->hdr_frag.hdr_common.hdr_flags = flags; - hdr->hdr_frag.hdr_src_ptr.lval = 0L; /* for VALGRIND/PURIFY - REPLACE WITH MACRO */ - hdr->hdr_frag.hdr_src_ptr.pval = fragment; - hdr->hdr_frag.hdr_dst_ptr = sendreq->req_peer_match; - hdr->hdr_frag.hdr_frag_offset = fragment->frag_offset + fragment->frag_bytes_processed; - hdr->hdr_frag.hdr_frag_length = iov.iov_len; + hdr->hdr_frag.hdr_common.hdr_type = MCA_PTL_HDR_TYPE_FRAG; + hdr->hdr_frag.hdr_common.hdr_flags = flags; + hdr->hdr_frag.hdr_src_ptr.lval = 0L; /* for VALGRIND/PURIFY - REPLACE WITH MACRO */ + hdr->hdr_frag.hdr_src_ptr.pval = fragment; + hdr->hdr_frag.hdr_dst_ptr = sendreq->req_peer_match; + hdr->hdr_frag.hdr_frag_offset = fragment->frag_offset + fragment->frag_bytes_processed; + hdr->hdr_frag.hdr_frag_length = iov.iov_len; - fragment->frag_bytes_processed += iov.iov_len; - remaining_bytes -= iov.iov_len; - if( remaining_bytes == 0 ) - hdr->hdr_frag.hdr_common.hdr_flags |= PTL_FLAG_GM_LAST_FRAGMENT; + fragment->frag_bytes_processed += iov.iov_len; + remaining_bytes -= iov.iov_len; + if( remaining_bytes == 0 ) + hdr->hdr_frag.hdr_common.hdr_flags |= PTL_FLAG_GM_LAST_FRAGMENT; - /* for the last piece set the header type to FIN */ + /* for the last piece set the header type to FIN */ gm_send_with_callback( ptl_peer->peer_ptl->gm_port, hdr, GM_SIZE, iov.iov_len + @@ -329,15 +329,15 @@ int mca_ptl_gm_peer_send_continue( mca_ptl_gm_peer_t *ptl_peer, ptl_peer->local_id, ptl_peer->port_number, send_continue_callback, (void*)hdr ); - item = NULL; /* force to retrieve a new one on the next loop */ + item = NULL; /* force to retrieve a new one on the next loop */ } *size = fragment->frag_bytes_processed; - if( !(flags & MCA_PTL_FLAGS_ACK) ) { - ptl_peer->peer_ptl->super.ptl_send_progress( (mca_ptl_base_module_t*)ptl_peer->peer_ptl, - fragment->frag_send.frag_request, - (*size) ); - } - return OMPI_SUCCESS; + if( !(flags & MCA_PTL_FLAGS_ACK) ) { + ptl_peer->peer_ptl->super.ptl_send_progress( (mca_ptl_base_module_t*)ptl_peer->peer_ptl, + fragment->frag_send.frag_request, + (*size) ); + } + return OMPI_SUCCESS; } pipeline = &(fragment->pipeline.lines[0]); /* Large set of data => we have to setup a rendez-vous protocol. Here we can @@ -366,11 +366,11 @@ int mca_ptl_gm_peer_send_continue( mca_ptl_gm_peer_t *ptl_peer, pipeline->length = fragment->frag_send.frag_base.frag_size % mca_ptl_gm_component.gm_rdma_frag_size; if( pipeline->length < (mca_ptl_gm_component.gm_rdma_frag_size >> 1) ) { - if( 0 == pipeline->length ) - pipeline->length = mca_ptl_gm_component.gm_rdma_frag_size; - else - if( fragment->frag_send.frag_base.frag_size > mca_ptl_gm_component.gm_rdma_frag_size ) - pipeline->length = (mca_ptl_gm_component.gm_rdma_frag_size >> 1); + if( 0 == pipeline->length ) + pipeline->length = mca_ptl_gm_component.gm_rdma_frag_size; + else + if( fragment->frag_send.frag_base.frag_size > mca_ptl_gm_component.gm_rdma_frag_size ) + pipeline->length = (mca_ptl_gm_component.gm_rdma_frag_size >> 1); } pipeline->offset = fragment->frag_offset; pipeline->hdr_flags = fragment->frag_send.frag_base.frag_header.hdr_common.hdr_flags; @@ -384,7 +384,8 @@ int mca_ptl_gm_peer_send_continue( mca_ptl_gm_peer_t *ptl_peer, } pipeline->flags = PTL_GM_PIPELINE_TRANSFERT; fragment->frag_bytes_processed += pipeline->length; - DO_DEBUG( ompi_output( 0, "sender %p start register %lld (%d)", fragment, pipeline->length, fragment->pipeline.pos_register ); ); + DO_DEBUG( ompi_output( 0, "sender %p start register %lld (%d)", fragment, pipeline->length, + fragment->pipeline.pos_register ); ); fragment->pipeline.pos_register = (fragment->pipeline.pos_register + 1) % GM_PIPELINE_DEPTH; return OMPI_SUCCESS; /* Now we are waiting for the ack message. Meanwhile we can register the sender first piece @@ -413,10 +414,10 @@ static void send_match_callback( struct gm_port* port, void* context, gm_status_ */ int mca_ptl_gm_peer_send( struct mca_ptl_base_module_t* ptl, struct mca_ptl_base_peer_t* ptl_base_peer, - struct mca_pml_base_send_request_t *sendreq, - size_t offset, - size_t size, - int flags ) + struct mca_pml_base_send_request_t *sendreq, + size_t offset, + size_t size, + int flags ) { struct iovec iov; size_t size_in, size_out; @@ -427,6 +428,7 @@ int mca_ptl_gm_peer_send( struct mca_ptl_base_module_t* ptl, unsigned int in_size, max_data = 0; mca_ptl_gm_peer_t* ptl_peer = (mca_ptl_gm_peer_t*)ptl_base_peer; ompi_list_item_t *item; + gm_send_completion_callback_t completion_cb; char* sendbuf; OMPI_FREE_LIST_WAIT( &(((mca_ptl_gm_module_t*)ptl)->gm_send_dma_frags), item, rc ); @@ -445,27 +447,27 @@ int mca_ptl_gm_peer_send( struct mca_ptl_base_module_t* ptl, hdr->hdr_common.hdr_type = MCA_PTL_HDR_TYPE_RNDV; if( size_in > 0 ) { - convertor = &sendreq->req_convertor; + convertor = &sendreq->req_convertor; - if( (size_in + header_length) <= mca_ptl_gm_component.gm_segment_size ) - iov.iov_len = size_in; - else - iov.iov_len = mca_ptl_gm_component.gm_segment_size - header_length; + if( (size_in + header_length) <= mca_ptl_gm_component.gm_segment_size ) + iov.iov_len = size_in; + else + iov.iov_len = mca_ptl_gm_component.gm_segment_size - header_length; - /* copy the data to the registered buffer */ - iov.iov_base = ((char*)hdr) + header_length; - max_data = iov.iov_len; - in_size = 1; - if((rc = ompi_convertor_pack(convertor, &(iov), &in_size, &max_data, &freeAfter)) < 0) - return OMPI_ERROR; + /* copy the data to the registered buffer */ + iov.iov_base = ((char*)hdr) + header_length; + max_data = iov.iov_len; + in_size = 1; + if((rc = ompi_convertor_pack(convertor, &(iov), &in_size, &max_data, &freeAfter)) < 0) + return OMPI_ERROR; - /* must update the offset after actual fragment size is determined - * before attempting to send the fragment - */ - mca_pml_base_send_request_offset( sendreq, max_data ); + /* must update the offset after actual fragment size is determined + * before attempting to send the fragment + */ + mca_pml_base_send_request_offset( sendreq, max_data ); } else { - iov.iov_len = 0; /* no data will be transmitted */ + iov.iov_len = 0; /* no data will be transmitted */ } /* adjust size and request offset to reflect actual number of bytes @@ -481,9 +483,8 @@ int mca_ptl_gm_peer_send( struct mca_ptl_base_module_t* ptl, send_match_callback, (void *)hdr ); if( !(flags & MCA_PTL_FLAGS_ACK) ) { - ptl_peer->peer_ptl->super.ptl_send_progress( (mca_ptl_base_module_t*)ptl_peer->peer_ptl, - sendreq, - max_data ); + ptl_peer->peer_ptl->super.ptl_send_progress( (mca_ptl_base_module_t*)ptl_peer->peer_ptl, + sendreq, max_data ); } return OMPI_SUCCESS; @@ -496,36 +497,35 @@ mca_ptl_gm_ctrl_frag( struct mca_ptl_gm_module_t *ptl, mca_pml_base_send_request_t *req; if( MCA_PTL_HDR_TYPE_ACK == header->hdr_common.hdr_type ) { - if( header->hdr_common.hdr_flags & PTL_FLAG_GM_HAS_FRAGMENT ) { - mca_ptl_gm_send_frag_t* frag = (mca_ptl_gm_send_frag_t*)(header->hdr_ack.hdr_src_ptr.pval); - /* update the fragment header with the most up2date informations */ - frag->frag_send.frag_base.frag_header.hdr_ack.hdr_dst_match = header->hdr_ack.hdr_dst_match; - req = frag->frag_send.frag_request; - assert(req != NULL); - req->req_peer_match = header->hdr_ack.hdr_dst_match; - req->req_peer_addr = header->hdr_ack.hdr_dst_addr; - req->req_peer_size = header->hdr_ack.hdr_dst_size; - - if( (req->req_peer_size != 0) && (req->req_peer_addr.pval == NULL) ) { - ptl->super.ptl_send_progress( (mca_ptl_base_module_t*)ptl, - req, frag->frag_send.frag_base.frag_size ); - OMPI_FREE_LIST_RETURN( &(ptl->gm_send_frags), (ompi_list_item_t *)frag ); - } else { - if( header->hdr_common.hdr_flags & PTL_FLAG_GM_HAS_FRAGMENT ) { - frag->frag_send.frag_base.frag_header.hdr_common.hdr_flags |= PTL_FLAG_GM_HAS_FRAGMENT; - } - } - } else { /* initial reply to a rendez-vous request */ - req = (mca_pml_base_send_request_t*)(header->hdr_ack.hdr_src_ptr.pval); - req->req_peer_match = header->hdr_ack.hdr_dst_match; + if( header->hdr_common.hdr_flags & PTL_FLAG_GM_HAS_FRAGMENT ) { + mca_ptl_gm_send_frag_t* frag = (mca_ptl_gm_send_frag_t*)(header->hdr_ack.hdr_src_ptr.pval); + /* update the fragment header with the most up2date informations */ + frag->frag_send.frag_base.frag_header.hdr_ack.hdr_dst_match = header->hdr_ack.hdr_dst_match; + req = frag->frag_send.frag_request; + assert(req != NULL); + req->req_peer_match = header->hdr_ack.hdr_dst_match; req->req_peer_addr = header->hdr_ack.hdr_dst_addr; req->req_peer_size = header->hdr_ack.hdr_dst_size; - ptl->super.ptl_send_progress( (mca_ptl_base_module_t*)ptl, - req, req->req_offset ); - } + + if( (req->req_peer_size != 0) && (req->req_peer_addr.pval == NULL) ) { + ptl->super.ptl_send_progress( (mca_ptl_base_module_t*)ptl, + req, frag->frag_send.frag_base.frag_size ); + OMPI_FREE_LIST_RETURN( &(ptl->gm_send_frags), (ompi_list_item_t *)frag ); + } else { + if( header->hdr_common.hdr_flags & PTL_FLAG_GM_HAS_FRAGMENT ) { + frag->frag_send.frag_base.frag_header.hdr_common.hdr_flags |= PTL_FLAG_GM_HAS_FRAGMENT; + } + } + } else { /* initial reply to a rendez-vous request */ + req = (mca_pml_base_send_request_t*)(header->hdr_ack.hdr_src_ptr.pval); + req->req_peer_match = header->hdr_ack.hdr_dst_match; + req->req_peer_addr = header->hdr_ack.hdr_dst_addr; + req->req_peer_size = header->hdr_ack.hdr_dst_size; + ptl->super.ptl_send_progress( (mca_ptl_base_module_t*)ptl, req, req->req_offset ); + } } else if( MCA_PTL_HDR_TYPE_NACK == header->hdr_common.hdr_type ) { } else { - OMPI_OUTPUT((0, "Unkonwn header type in ptl_gm_ctrl_frag\n")); + OMPI_OUTPUT((0, "Unkonwn header type in ptl_gm_ctrl_frag\n")); } return NULL; } @@ -537,7 +537,7 @@ mca_ptl_gm_ctrl_frag( struct mca_ptl_gm_module_t *ptl, */ static mca_ptl_gm_recv_frag_t* mca_ptl_gm_recv_frag_match( struct mca_ptl_gm_module_t *ptl, - mca_ptl_base_header_t* hdr ) + mca_ptl_base_header_t* hdr ) { mca_ptl_gm_recv_frag_t* recv_frag; bool matched; @@ -549,12 +549,13 @@ mca_ptl_gm_recv_frag_match( struct mca_ptl_gm_module_t *ptl, if( MCA_PTL_HDR_TYPE_MATCH == hdr->hdr_rndv.hdr_match.hdr_common.hdr_type ) { recv_frag->frag_recv.frag_base.frag_addr = (char*)hdr + sizeof(mca_ptl_base_match_header_t); + recv_frag->frag_recv.frag_base.frag_size = hdr->hdr_match.hdr_msg_length; } else { assert( MCA_PTL_HDR_TYPE_RNDV == hdr->hdr_rndv.hdr_match.hdr_common.hdr_type ); recv_frag->frag_recv.frag_base.frag_addr = (char*)hdr + sizeof(mca_ptl_base_rendezvous_header_t); + recv_frag->frag_recv.frag_base.frag_size = hdr->hdr_rndv.hdr_match.hdr_msg_length; } - recv_frag->frag_recv.frag_base.frag_size = hdr->hdr_rndv.hdr_match.hdr_msg_length; recv_frag->frag_recv.frag_is_buffered = false; recv_frag->have_allocated_buffer = false; @@ -566,7 +567,7 @@ mca_ptl_gm_recv_frag_match( struct mca_ptl_gm_module_t *ptl, length = mca_ptl_gm_component.gm_segment_size - sizeof(mca_ptl_base_rendezvous_header_t); if( recv_frag->frag_recv.frag_base.frag_size < length ) { - length = recv_frag->frag_recv.frag_base.frag_size; + length = recv_frag->frag_recv.frag_base.frag_size; } /* get some memory and copy the data inside. We can then release the receive buffer */ if( 0 != length ) { @@ -642,14 +643,14 @@ static void mca_ptl_gm_get_callback( struct gm_port *port, void * context, gm_st switch( status ) { case GM_SUCCESS: - /* send an ack message to the sender */ - mca_ptl_gm_send_quick_fin_message( peer, &(frag->frag_recv.frag_base) ); - peer->get_started = false; - /* mark the memory as being ready to be deregistered */ - frag->pipeline.lines[frag->pipeline.pos_deregister].flags |= PTL_GM_PIPELINE_DEREGISTER; - DO_DEBUG( ompi_output( 0, "receiver %p get_callback processed %lld validated %lld", - frag, frag->frag_bytes_processed, frag->frag_bytes_validated ); ) - mca_ptl_gm_receiver_advance_pipeline( frag, 0 ); + /* send an ack message to the sender */ + mca_ptl_gm_send_quick_fin_message( peer, &(frag->frag_recv.frag_base) ); + peer->get_started = false; + /* mark the memory as being ready to be deregistered */ + frag->pipeline.lines[frag->pipeline.pos_deregister].flags |= PTL_GM_PIPELINE_DEREGISTER; + DO_DEBUG( ompi_output( 0, "receiver %p get_callback processed %lld validated %lld", + frag, frag->frag_bytes_processed, frag->frag_bytes_validated ); ) + mca_ptl_gm_receiver_advance_pipeline( frag, 0 ); break; case GM_SEND_TIMED_OUT: ompi_output( 0, "mca_ptl_gm_get_callback timed out\n" ); @@ -674,102 +675,102 @@ mca_ptl_gm_recv_frag_frag( struct mca_ptl_gm_module_t* ptl, mca_ptl_gm_recv_frag_t* frag; if( hdr->hdr_frag.hdr_common.hdr_flags & PTL_FLAG_GM_HAS_FRAGMENT ) { - frag = (mca_ptl_gm_recv_frag_t*)hdr->hdr_frag.hdr_dst_ptr.pval; - request = (mca_pml_base_recv_request_t*)frag->frag_recv.frag_request; - /* here we can have a synchronisation problem if several threads work in same time - * with the same request. The only question is if it's possible ? - */ - convertor = &(frag->frag_recv.frag_base.frag_convertor); + frag = (mca_ptl_gm_recv_frag_t*)hdr->hdr_frag.hdr_dst_ptr.pval; + request = (mca_pml_base_recv_request_t*)frag->frag_recv.frag_request; + /* here we can have a synchronisation problem if several threads work in same time + * with the same request. The only question is if it's possible ? + */ + convertor = &(frag->frag_recv.frag_base.frag_convertor); } else { - request = (mca_pml_base_recv_request_t*)hdr->hdr_frag.hdr_dst_ptr.pval; + request = (mca_pml_base_recv_request_t*)hdr->hdr_frag.hdr_dst_ptr.pval; - if( hdr->hdr_frag.hdr_frag_length <= (mca_ptl_gm_component.gm_segment_size - sizeof(mca_ptl_base_frag_header_t)) ) { - ompi_proc_t* proc = ompi_comm_peer_lookup( request->req_base.req_comm, - request->req_base.req_ompi.req_status.MPI_SOURCE ); - convertor = &local_convertor; - convertor->stack_size = 0; /* dont let the convertor free the stack */ + if( hdr->hdr_frag.hdr_frag_length <= (mca_ptl_gm_component.gm_segment_size - sizeof(mca_ptl_base_frag_header_t)) ) { + ompi_proc_t* proc = ompi_comm_peer_lookup( request->req_base.req_comm, + request->req_base.req_ompi.req_status.MPI_SOURCE ); + convertor = &local_convertor; + convertor->stack_size = 0; /* dont let the convertor free the stack */ ompi_convertor_copy( proc->proc_convertor, convertor ); - frag = NULL; - } else { /* large message => we have to create a receive fragment */ - frag = mca_ptl_gm_alloc_recv_frag( (struct mca_ptl_base_module_t*)ptl ); - frag->frag_recv.frag_request = request; - frag->frag_offset = hdr->hdr_frag.hdr_frag_offset; - frag->matched = true; - frag->frag_recv.frag_base.frag_addr = frag->frag_recv.frag_request->req_base.req_addr; - frag->frag_recv.frag_base.frag_size = hdr->hdr_frag.hdr_frag_length; - frag->frag_recv.frag_base.frag_peer = (struct mca_ptl_base_peer_t*) - mca_pml_teg_proc_lookup_remote_peer( request->req_base.req_comm, - request->req_base.req_ompi.req_status.MPI_SOURCE, - (struct mca_ptl_base_module_t*)ptl ); - convertor = &(frag->frag_recv.frag_base.frag_convertor); - } - ompi_convertor_init_for_recv( convertor, 0, - request->req_base.req_datatype, - request->req_base.req_count, - request->req_base.req_addr, - hdr->hdr_frag.hdr_frag_offset, NULL ); + frag = NULL; + } else { /* large message => we have to create a receive fragment */ + frag = mca_ptl_gm_alloc_recv_frag( (struct mca_ptl_base_module_t*)ptl ); + frag->frag_recv.frag_request = request; + frag->frag_offset = hdr->hdr_frag.hdr_frag_offset; + frag->matched = true; + frag->frag_recv.frag_base.frag_addr = frag->frag_recv.frag_request->req_base.req_addr; + frag->frag_recv.frag_base.frag_size = hdr->hdr_frag.hdr_frag_length; + frag->frag_recv.frag_base.frag_peer = (struct mca_ptl_base_peer_t*) + mca_pml_teg_proc_lookup_remote_peer( request->req_base.req_comm, + request->req_base.req_ompi.req_status.MPI_SOURCE, + (struct mca_ptl_base_module_t*)ptl ); + convertor = &(frag->frag_recv.frag_base.frag_convertor); + } + ompi_convertor_init_for_recv( convertor, 0, + request->req_base.req_datatype, + request->req_base.req_count, + request->req_base.req_addr, + hdr->hdr_frag.hdr_frag_offset, NULL ); } if( NULL == frag ) { - iov.iov_base = (char*)hdr + sizeof(mca_ptl_base_frag_header_t); - iov.iov_len = hdr->hdr_frag.hdr_frag_length; - iov_count = 1; - max_data = hdr->hdr_frag.hdr_frag_length; - freeAfter = 0; /* unused here */ - rc = ompi_convertor_unpack( convertor, &iov, &iov_count, &max_data, &freeAfter ); - assert( 0 == freeAfter ); - ptl->super.ptl_recv_progress( (mca_ptl_base_module_t*)ptl, request, max_data, max_data ); + iov.iov_base = (char*)hdr + sizeof(mca_ptl_base_frag_header_t); + iov.iov_len = hdr->hdr_frag.hdr_frag_length; + iov_count = 1; + max_data = hdr->hdr_frag.hdr_frag_length; + freeAfter = 0; /* unused here */ + rc = ompi_convertor_unpack( convertor, &iov, &iov_count, &max_data, &freeAfter ); + assert( 0 == freeAfter ); + ptl->super.ptl_recv_progress( (mca_ptl_base_module_t*)ptl, request, max_data, max_data ); } else { - gm_status_t status; - mca_ptl_gm_pipeline_line_t* pipeline; + gm_status_t status; + mca_ptl_gm_pipeline_line_t* pipeline; - frag->frag_recv.frag_base.frag_header.hdr_frag = hdr->hdr_frag; - if( NULL == hdr->registered_memory.pval ) { /* first round of the local rendez-vous protocol */ - /* send an ack message to the sender ... quick hack (TODO) */ - frag->frag_recv.frag_base.frag_header.hdr_frag.hdr_frag_length = 0; - mca_ptl_gm_send_quick_fin_message( (mca_ptl_gm_peer_t*)frag->frag_recv.frag_base.frag_peer, - &(frag->frag_recv.frag_base) ); - frag->frag_recv.frag_base.frag_header.hdr_frag.hdr_frag_length = hdr->hdr_frag.hdr_frag_length; - pipeline = &(frag->pipeline.lines[0]); - pipeline->length = frag->frag_recv.frag_base.frag_size % mca_ptl_gm_component.gm_rdma_frag_size; - if( pipeline->length < (mca_ptl_gm_component.gm_rdma_frag_size >> 1) ) { - if( 0 == pipeline->length ) - pipeline->length = mca_ptl_gm_component.gm_rdma_frag_size; - else - if( frag->frag_recv.frag_base.frag_size > mca_ptl_gm_component.gm_rdma_frag_size ) - pipeline->length = (mca_ptl_gm_component.gm_rdma_frag_size >> 1); - } - pipeline->local_memory.lval = 0L; - pipeline->local_memory.pval = (char*)request->req_base.req_addr + hdr->hdr_frag.hdr_frag_offset; - status = gm_register_memory( ptl->gm_port, - pipeline->local_memory.pval, pipeline->length ); - if( status != GM_SUCCESS ) { - ompi_output( 0, "Cannot register receiver memory (%p, %ld) bytes offset %ld\n", - (char*)request->req_base.req_addr + hdr->hdr_frag.hdr_frag_offset, - pipeline->length, hdr->hdr_frag.hdr_frag_offset ); - return NULL; - } - pipeline->offset = hdr->hdr_frag.hdr_frag_offset; - pipeline->flags |= PTL_GM_PIPELINE_REGISTER; - frag->frag_bytes_processed += pipeline->length; - DO_DEBUG( ompi_output( 0, "receiver %p start register %lld (%d)\n", frag, pipeline->length, frag->pipeline.pos_register ); ); - frag->pipeline.pos_register = (frag->pipeline.pos_register + 1) % GM_PIPELINE_DEPTH; - } else { - /* There is a kind of rendez-vous protocol used internally by the GM driver. If the amount of data - * to transfert is large enough, then the sender will start sending a frag message with the - * remote_memory set to NULL (but with the length set to the length of the first fragment). - * It will allow the receiver to start to register it's own memory. Later when the receiver - * get a fragment with the remote_memory field not NULL it can start getting the data. - */ - pipeline = &(frag->pipeline.lines[frag->pipeline.pos_remote]); - DO_DEBUG( ompi_output( 0, "receiver %p get remote memory length %lld (%d)\n", frag, hdr->hdr_frag.hdr_frag_length, frag->pipeline.pos_remote ); ); - frag->pipeline.pos_remote = (frag->pipeline.pos_remote + 1) % GM_PIPELINE_DEPTH; - assert( (pipeline->flags & PTL_GM_PIPELINE_REMOTE) == 0 ); - pipeline->remote_memory = hdr->registered_memory; - pipeline->flags |= PTL_GM_PIPELINE_REMOTE; - /*if( false == ((mca_ptl_gm_peer_t*)frag->frag_recv.frag_base.frag_peer)->get_started )*/ - mca_ptl_gm_receiver_advance_pipeline( frag, 1 ); - } + frag->frag_recv.frag_base.frag_header.hdr_frag = hdr->hdr_frag; + if( NULL == hdr->registered_memory.pval ) { /* first round of the local rendez-vous protocol */ + /* send an ack message to the sender ... quick hack (TODO) */ + frag->frag_recv.frag_base.frag_header.hdr_frag.hdr_frag_length = 0; + mca_ptl_gm_send_quick_fin_message( (mca_ptl_gm_peer_t*)frag->frag_recv.frag_base.frag_peer, + &(frag->frag_recv.frag_base) ); + frag->frag_recv.frag_base.frag_header.hdr_frag.hdr_frag_length = hdr->hdr_frag.hdr_frag_length; + pipeline = &(frag->pipeline.lines[0]); + pipeline->length = frag->frag_recv.frag_base.frag_size % mca_ptl_gm_component.gm_rdma_frag_size; + if( pipeline->length < (mca_ptl_gm_component.gm_rdma_frag_size >> 1) ) { + if( 0 == pipeline->length ) + pipeline->length = mca_ptl_gm_component.gm_rdma_frag_size; + else + if( frag->frag_recv.frag_base.frag_size > mca_ptl_gm_component.gm_rdma_frag_size ) + pipeline->length = (mca_ptl_gm_component.gm_rdma_frag_size >> 1); + } + pipeline->local_memory.lval = 0L; + pipeline->local_memory.pval = (char*)request->req_base.req_addr + hdr->hdr_frag.hdr_frag_offset; + status = gm_register_memory( ptl->gm_port, + pipeline->local_memory.pval, pipeline->length ); + if( status != GM_SUCCESS ) { + ompi_output( 0, "Cannot register receiver memory (%p, %ld) bytes offset %ld\n", + (char*)request->req_base.req_addr + hdr->hdr_frag.hdr_frag_offset, + pipeline->length, hdr->hdr_frag.hdr_frag_offset ); + return NULL; + } + pipeline->offset = hdr->hdr_frag.hdr_frag_offset; + pipeline->flags |= PTL_GM_PIPELINE_REGISTER; + frag->frag_bytes_processed += pipeline->length; + DO_DEBUG( ompi_output( 0, "receiver %p start register %lld (%d)\n", frag, pipeline->length, frag->pipeline.pos_register ); ); + frag->pipeline.pos_register = (frag->pipeline.pos_register + 1) % GM_PIPELINE_DEPTH; + } else { + /* There is a kind of rendez-vous protocol used internally by the GM driver. If the amount of data + * to transfert is large enough, then the sender will start sending a frag message with the + * remote_memory set to NULL (but with the length set to the length of the first fragment). + * It will allow the receiver to start to register it's own memory. Later when the receiver + * get a fragment with the remote_memory field not NULL it can start getting the data. + */ + pipeline = &(frag->pipeline.lines[frag->pipeline.pos_remote]); + DO_DEBUG( ompi_output( 0, "receiver %p get remote memory length %lld (%d)\n", frag, hdr->hdr_frag.hdr_frag_length, frag->pipeline.pos_remote ); ); + frag->pipeline.pos_remote = (frag->pipeline.pos_remote + 1) % GM_PIPELINE_DEPTH; + assert( (pipeline->flags & PTL_GM_PIPELINE_REMOTE) == 0 ); + pipeline->remote_memory = hdr->registered_memory; + pipeline->flags |= PTL_GM_PIPELINE_REMOTE; + /*if( false == ((mca_ptl_gm_peer_t*)frag->frag_recv.frag_base.frag_peer)->get_started )*/ + mca_ptl_gm_receiver_advance_pipeline( frag, 1 ); + } } return NULL; @@ -787,21 +788,21 @@ mca_ptl_gm_recv_frag_fin( struct mca_ptl_gm_module_t* ptl, frag->frag_send.frag_base.frag_header.hdr_ack.hdr_dst_match = hdr->hdr_ack.hdr_dst_match; if( 0 == hdr->hdr_ack.hdr_dst_size ) { - /* I just receive the ack for the first fragment => setup the pipeline */ + /* I just receive the ack for the first fragment => setup the pipeline */ mca_ptl_gm_sender_advance_pipeline( frag ); } else { - /* mark the memory as ready to be deregistered */ - frag->pipeline.lines[frag->pipeline.pos_deregister].flags |= PTL_GM_PIPELINE_DEREGISTER; + /* mark the memory as ready to be deregistered */ + frag->pipeline.lines[frag->pipeline.pos_deregister].flags |= PTL_GM_PIPELINE_DEREGISTER; } /* continue the pipeline ... send the next segment */ mca_ptl_gm_sender_advance_pipeline( frag ); if( frag->frag_send.frag_base.frag_size == frag->frag_bytes_validated ) { - /* mark the request as done before deregistering the memory */ - ptl->super.ptl_send_progress( (mca_ptl_base_module_t*)ptl, - frag->frag_send.frag_request, - frag->frag_bytes_validated ); - OMPI_FREE_LIST_RETURN( &(ptl->gm_send_frags), (ompi_list_item_t*)frag ); + /* mark the request as done before deregistering the memory */ + ptl->super.ptl_send_progress( (mca_ptl_base_module_t*)ptl, + frag->frag_send.frag_request, + frag->frag_bytes_validated ); + OMPI_FREE_LIST_RETURN( &(ptl->gm_send_frags), (ompi_list_item_t*)frag ); } return NULL; @@ -820,17 +821,16 @@ void mca_ptl_gm_outstanding_recv( struct mca_ptl_gm_module_t *ptl ) ompi_list_remove_first( (ompi_list_t *)&(ptl->gm_recv_outstanding_queue) ); - matched = ptl->super.ptl_match( &(ptl->super), - &(frag->frag_recv), - &(frag->frag_recv.frag_base.frag_header.hdr_match) ); + matched = ptl->super.ptl_match( &(ptl->super), &(frag->frag_recv), + &(frag->frag_recv.frag_base.frag_header.hdr_match) ); if(!matched) { - ompi_list_append((ompi_list_t *)&(ptl->gm_recv_outstanding_queue), - (ompi_list_item_t *) frag); + ompi_list_append((ompi_list_t *)&(ptl->gm_recv_outstanding_queue), + (ompi_list_item_t *) frag); } else { - /* if allocated buffer, free the buffer */ - /* return the recv descriptor to the free list */ - OMPI_FREE_LIST_RETURN(&(ptl->gm_recv_frags_free), (ompi_list_item_t *)frag); + /* if allocated buffer, free the buffer */ + /* return the recv descriptor to the free list */ + OMPI_FREE_LIST_RETURN(&(ptl->gm_recv_frags_free), (ompi_list_item_t *)frag); } } } @@ -860,38 +860,38 @@ int mca_ptl_gm_analyze_recv_event( struct mca_ptl_gm_module_t* ptl, gm_recv_even switch (gm_ntohc(event->recv.type)) { case GM_FAST_RECV_EVENT: case GM_FAST_PEER_RECV_EVENT: - priority = GM_LOW_PRIORITY; + priority = GM_LOW_PRIORITY; case GM_FAST_HIGH_RECV_EVENT: case GM_FAST_HIGH_PEER_RECV_EVENT: - header = (mca_ptl_base_header_t *)gm_ntohp(event->recv.message); - goto have_event; + header = (mca_ptl_base_header_t *)gm_ntohp(event->recv.message); + goto have_event; case GM_RECV_EVENT: case GM_PEER_RECV_EVENT: - priority = GM_LOW_PRIORITY; + priority = GM_LOW_PRIORITY; case GM_HIGH_RECV_EVENT: case GM_HIGH_PEER_RECV_EVENT: - header = release_buf; - goto have_event; + header = release_buf; + goto have_event; case GM_NO_RECV_EVENT: break; default: - gm_unknown(ptl->gm_port, event); + gm_unknown(ptl->gm_port, event); } return 0; have_event: if( header->hdr_common.hdr_type >= MCA_PTL_HDR_TYPE_MAX ) { - ompi_output( 0, "[%s:%d] unexpected frag type %d\n", - __FILE__, __LINE__, header->hdr_common.hdr_type ); + ompi_output( 0, "[%s:%d] unexpected frag type %d\n", + __FILE__, __LINE__, header->hdr_common.hdr_type ); } else { - function = frag_management_fct[header->hdr_common.hdr_type]; - if( NULL == function ) { - ompi_output( 0, "[%s:%d] NOT yet implemented function for the header type %d\n", - __FILE__, __LINE__, header->hdr_common.hdr_type ); - } else { - frag = function( ptl, header ); - } + function = frag_management_fct[header->hdr_common.hdr_type]; + if( NULL == function ) { + ompi_output( 0, "[%s:%d] NOT yet implemented function for the header type %d\n", + __FILE__, __LINE__, header->hdr_common.hdr_type ); + } else { + frag = function( ptl, header ); + } } gm_provide_receive_buffer( ptl->gm_port, release_buf, GM_SIZE, priority ); @@ -902,23 +902,23 @@ void mca_ptl_gm_dump_header( char* str, mca_ptl_base_header_t* hdr ) { switch( hdr->hdr_common.hdr_type ) { case MCA_PTL_HDR_TYPE_MATCH: - goto print_match_hdr; + goto print_match_hdr; case MCA_PTL_HDR_TYPE_RNDV: - goto print_rndv_hdr; + goto print_rndv_hdr; case MCA_PTL_HDR_TYPE_FRAG: - goto print_frag_hdr; + goto print_frag_hdr; case MCA_PTL_HDR_TYPE_ACK: - goto print_ack_hdr; + goto print_ack_hdr; case MCA_PTL_HDR_TYPE_NACK: - goto print_ack_hdr; + goto print_ack_hdr; case MCA_PTL_HDR_TYPE_GET: - goto print_match_hdr; + goto print_match_hdr; case MCA_PTL_HDR_TYPE_FIN: - goto print_ack_hdr; + goto print_ack_hdr; case MCA_PTL_HDR_TYPE_FIN_ACK: - goto print_match_hdr; + goto print_match_hdr; default: - ompi_output( 0, "unknown header of type %d\n", hdr->hdr_common.hdr_type ); + ompi_output( 0, "unknown header of type %d\n", hdr->hdr_common.hdr_type ); } return; diff --git a/src/mca/ptl/sm/src/ptl_sm_component.c b/src/mca/ptl/sm/src/ptl_sm_component.c index ccdab215a9..e24947890b 100644 --- a/src/mca/ptl/sm/src/ptl_sm_component.c +++ b/src/mca/ptl/sm/src/ptl_sm_component.c @@ -213,7 +213,7 @@ int mca_ptl_sm_component_close(void) #if OMPI_ENABLE_PROGRESS_THREADS == 1 /* close/cleanup fifo create for event notification */ - if(mca_ptl_sm_component.sm_fifo_fd >= 0) { + if(mca_ptl_sm_component.sm_fifo_fd > 0) { /* write a done message down the pipe */ unsigned char cmd = DONE; if( write(mca_ptl_sm_component.sm_fifo_fd,&cmd,sizeof(cmd)) != diff --git a/src/mca/ptl/tcp/src/ptl_tcp.c b/src/mca/ptl/tcp/src/ptl_tcp.c index 6da139a2e8..53d2063c07 100644 --- a/src/mca/ptl/tcp/src/ptl_tcp.c +++ b/src/mca/ptl/tcp/src/ptl_tcp.c @@ -192,8 +192,11 @@ void mca_ptl_tcp_request_fini(struct mca_ptl_base_module_t* ptl, struct mca_pml_ void mca_ptl_tcp_recv_frag_return(struct mca_ptl_base_module_t* ptl, struct mca_ptl_tcp_recv_frag_t* frag) { - if(frag->frag_recv.frag_is_buffered) + if(frag->frag_recv.frag_is_buffered) { free(frag->frag_recv.frag_base.frag_addr); + frag->frag_recv.frag_is_buffered = false; + frag->frag_recv.frag_base.frag_addr = NULL; + } OMPI_FREE_LIST_RETURN(&mca_ptl_tcp_component.tcp_recv_frags, (ompi_list_item_t*)frag); } diff --git a/src/mpi/c/Makefile.am b/src/mpi/c/Makefile.am index fe413b84a9..36c15988fd 100644 --- a/src/mpi/c/Makefile.am +++ b/src/mpi/c/Makefile.am @@ -52,9 +52,7 @@ headers = bindings.h # libmpi_c_la_SOURCES = \ - attr_fn.c \ - wtick.c \ - wtime.c + attr_fn.c # # libmpi_c_mpi.la is only built in some cases (see above) diff --git a/src/mpi/c/get_count.c b/src/mpi/c/get_count.c index 552b85be54..841f5f151d 100644 --- a/src/mpi/c/get_count.c +++ b/src/mpi/c/get_count.c @@ -46,13 +46,11 @@ int MPI_Get_count(MPI_Status *status, MPI_Datatype datatype, int *count) if( ompi_ddt_type_size( datatype, &size ) == MPI_SUCCESS ) { if( size == 0 ) { *count = 0; - return MPI_SUCCESS; + } else { + *count = status->_count / size; + if( ((*count) * size) != status->_count ) + *count = MPI_UNDEFINED; } - - *count = status->_count / size; - if( ((*count) * size) == status->_count ) - return MPI_SUCCESS; - *count = MPI_UNDEFINED; } - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); + return MPI_SUCCESS; } diff --git a/src/mpi/c/get_elements.c b/src/mpi/c/get_elements.c index d015ada5c5..3bed3504eb 100644 --- a/src/mpi/c/get_elements.c +++ b/src/mpi/c/get_elements.c @@ -51,7 +51,6 @@ int MPI_Get_elements(MPI_Status *status, MPI_Datatype datatype, int *count) if( (datatype->flags & DT_FLAG_BASIC) == DT_FLAG_BASIC ) { if( size != 0 ) { *count = MPI_UNDEFINED; - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); } return MPI_SUCCESS; } diff --git a/src/mpi/c/status_c2f.c b/src/mpi/c/status_c2f.c index 3699fa81e4..0144fa522e 100644 --- a/src/mpi/c/status_c2f.c +++ b/src/mpi/c/status_c2f.c @@ -36,6 +36,8 @@ static const char FUNC_NAME[] = "MPI_Status_c2f"; int MPI_Status_c2f(MPI_Status *c_status, MPI_Fint *f_status) { + int i, *c_ints; + if (MPI_PARAM_CHECK) { OMPI_ERR_INIT_FINALIZE(FUNC_NAME); @@ -49,10 +51,16 @@ int MPI_Status_c2f(MPI_Status *c_status, MPI_Fint *f_status) } } + c_ints = (int*)c_status; + for( i = 0; i < (int)(sizeof(MPI_Status) / sizeof(int)); i++ ) + f_status[i] = OMPI_INT_2_FINT(c_ints[i]); + + /* f_status[0] = OMPI_INT_2_FINT(c_status->MPI_SOURCE); f_status[1] = OMPI_INT_2_FINT(c_status->MPI_TAG); f_status[2] = OMPI_INT_2_FINT(c_status->MPI_ERROR); f_status[3] = OMPI_INT_2_FINT(c_status->_count); - + f_status[4] = OMPI_INT_2_FINT(c_status->_cancelled); + */ return MPI_SUCCESS; } diff --git a/src/mpi/c/status_f2c.c b/src/mpi/c/status_f2c.c index 197656dfcd..540a25d96e 100644 --- a/src/mpi/c/status_f2c.c +++ b/src/mpi/c/status_f2c.c @@ -35,6 +35,8 @@ static const char FUNC_NAME[] = "MPI_Status_f2c"; int MPI_Status_f2c(MPI_Fint *f_status, MPI_Status *c_status) { + int i, *c_ints; + if (MPI_PARAM_CHECK) { OMPI_ERR_INIT_FINALIZE(FUNC_NAME); @@ -58,11 +60,16 @@ int MPI_Status_f2c(MPI_Fint *f_status, MPI_Status *c_status) /* We can't use OMPI_FINT_2_INT here because of some complications with include files. :-( So just do the casting manually. */ + c_ints = (int*)c_status; + for( i = 0; i < (int)(sizeof(MPI_Status) / sizeof(int)); i++ ) + c_ints[i] = (int)f_status[i]; + /* c_status->MPI_SOURCE = (int) f_status[0]; c_status->MPI_TAG = (int) f_status[1]; c_status->MPI_ERROR = (int) f_status[2]; c_status->_count = (int) f_status[3]; - + c_status->_cancelled = (int) f_status[4]; + */ return MPI_SUCCESS; } diff --git a/src/mpi/c/status_set_elements.c b/src/mpi/c/status_set_elements.c index 17d6cc8090..2a1de60fae 100644 --- a/src/mpi/c/status_set_elements.c +++ b/src/mpi/c/status_set_elements.c @@ -50,5 +50,11 @@ int MPI_Status_set_elements(MPI_Status *status, MPI_Datatype datatype, if (status != MPI_STATUS_IGNORE) { status->_count = count; } + /* I dont have the MPI standard with me but I strongly suppose + * that the expected behaviour of this function should take in + * account the real size of the datatype. Otherwise this argument + * is completly useless ... + */ + /* This function is not yet implemented */ OMPI_ERRHANDLER_RETURN(rc, MPI_COMM_WORLD, rc, FUNC_NAME); } diff --git a/src/mpi/c/type_create_darray.c b/src/mpi/c/type_create_darray.c index 4ece9d60aa..a09f80d716 100644 --- a/src/mpi/c/type_create_darray.c +++ b/src/mpi/c/type_create_darray.c @@ -32,6 +32,10 @@ static const char FUNC_NAME[] = "MPI_Type_create_darray"; +static MPI_Datatype cyclic( int32_t darg, int32_t gsize, int32_t r, int32_t psize, MPI_Datatype oldtype ) +{ + return &ompi_mpi_datatype_null; +} int MPI_Type_create_darray(int size, int rank, @@ -45,9 +49,11 @@ int MPI_Type_create_darray(int size, MPI_Datatype *newtype) { - int32_t i; + int32_t i, step, end_loop, *r; + MPI_Datatype temptype; if (MPI_PARAM_CHECK) { + int prod_psize = 1; OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if( (rank < 0) || (size < 0) || (rank >= size) ) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); @@ -68,17 +74,50 @@ int MPI_Type_create_darray(int size, return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); } else if( (gsize_array[i] < 1) || (darg_array[i] < 0) || (psize_array[i] < 0) ) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); - } else if( (MPI_DISTRIBUTE_DFLT_DARG != darg_array[i]) && (MPI_DISTRIBUTE_BLOCK == distrib_array[i]) && + } else if( (MPI_DISTRIBUTE_DFLT_DARG != darg_array[i]) && + (MPI_DISTRIBUTE_BLOCK == distrib_array[i]) && ((darg_array[i] * psize_array[i]) < gsize_array[i]) ) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); - } + } else if( 1 > psize_array[i] ) + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); + prod_psize *= psize_array[i]; } + if( prod_psize != size ) + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); } if( ndims < 1 ) { *newtype = &ompi_mpi_datatype_null; return MPI_SUCCESS; } + r = (int*)malloc( ndims * sizeof(int) ); + { + int t_rank = rank; + int t_size = size; + for( i = 0; i < ndims; i++ ) { + t_size = t_size / psize_array[i]; + r[i] = t_rank / t_size; + t_rank = t_rank % t_size; + } + } + if( MPI_ORDER_FORTRAN == order ) { + i = 0; + step = 1; + end_loop = ndims; + } else { + i = ndims - 1; + step = -1; + end_loop = -1; + } + + temptype = cyclic( darg_array[i], gsize_array[i], r[i], psize_array[i], oldtype ); + for( i += step; i != end_loop; i += step ) { + *newtype = cyclic( darg_array[i], gsize_array[i], r[i], psize_array[i], temptype ); + ompi_ddt_destroy( &temptype ); + temptype = *newtype; + } + + free( r ); /* This function is not yet implemented */ { diff --git a/src/mpi/c/wtick.c b/src/mpi/c/wtick.c deleted file mode 100644 index 61ac300032..0000000000 --- a/src/mpi/c/wtick.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2004-2005 The Trustees of Indiana University. - * All rights reserved. - * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. - * All rights reserved. - * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, - * University of Stuttgart. All rights reserved. - * Copyright (c) 2004-2005 The Regents of the University of California. - * All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ -#include "ompi_config.h" -#include - -#include "mpi.h" -#include "mpi/c/bindings.h" - -#if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES -#pragma weak MPI_Wtick = PMPI_Wtick -#endif - -#if OMPI_PROFILING_DEFINES -#include "mpi/c/profile/defines.h" -#endif - - -double MPI_Wtick(void) -{ - return (double)0.000001; -} diff --git a/src/mpi/c/wtime.c b/src/mpi/c/wtime.c deleted file mode 100644 index 26767285ca..0000000000 --- a/src/mpi/c/wtime.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2004-2005 The Trustees of Indiana University. - * All rights reserved. - * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. - * All rights reserved. - * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, - * University of Stuttgart. All rights reserved. - * Copyright (c) 2004-2005 The Regents of the University of California. - * All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ -#include "ompi_config.h" -#include -#ifdef HAVE_SYS_TIME_H -#include -#endif - -#include "mpi.h" -#include "mpi/c/bindings.h" - -#if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES -#pragma weak MPI_Wtime = PMPI_Wtime -#endif - -#if OMPI_PROFILING_DEFINES -#include "mpi/c/profile/defines.h" -#endif - - -double MPI_Wtime(void) -{ - struct timeval tv; - double wtime; - gettimeofday(&tv, NULL); - wtime = tv.tv_sec; - wtime += (double)tv.tv_usec / 1000000.0; - return wtime; -} diff --git a/src/mpi/f77/accumulate_f.c b/src/mpi/f77/accumulate_f.c index 1889d2a2a4..4104dc7719 100644 --- a/src/mpi/f77/accumulate_f.c +++ b/src/mpi/f77/accumulate_f.c @@ -66,7 +66,7 @@ void mpi_accumulate_f(char *origin_addr, MPI_Fint *origin_count, MPI_Win c_win = MPI_Win_f2c(*win); MPI_Op c_op = MPI_Op_f2c(*op); - *ierr = OMPI_INT_2_FINT(MPI_Accumulate(origin_addr, + *ierr = OMPI_INT_2_FINT(MPI_Accumulate(OMPI_ADDR(origin_addr), OMPI_FINT_2_INT(*origin_count), c_origin_datatype, OMPI_FINT_2_INT(*target_rank), diff --git a/src/mpi/f77/add_error_string_f.c b/src/mpi/f77/add_error_string_f.c index e9f8611aba..00f3875956 100644 --- a/src/mpi/f77/add_error_string_f.c +++ b/src/mpi/f77/add_error_string_f.c @@ -16,9 +16,9 @@ #include "ompi_config.h" -#include "mpi/f77/strings.h" #include "mpi/f77/bindings.h" #include "mpi/f77/constants.h" +#include "mpi/f77/strings.h" #include "communicator/communicator.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/allgather_f.c b/src/mpi/f77/allgather_f.c index 48068994e3..a64b7790b4 100644 --- a/src/mpi/f77/allgather_f.c +++ b/src/mpi/f77/allgather_f.c @@ -66,11 +66,11 @@ void mpi_allgather_f(char *sendbuf, MPI_Fint *sendcount, MPI_Fint *sendtype, c_sendtype = MPI_Type_f2c(*sendtype); c_recvtype = MPI_Type_f2c(*recvtype); - *ierr = OMPI_INT_2_FINT(MPI_Allgather(sendbuf, + *ierr = OMPI_INT_2_FINT(MPI_Allgather(sendbuf, OMPI_FINT_2_INT(*sendcount), c_sendtype, - recvbuf, - OMPI_FINT_2_INT(*recvcount), + recvbuf, + OMPI_FINT_2_INT(*recvcount), c_recvtype, c_comm)); } diff --git a/src/mpi/f77/allgatherv_f.c b/src/mpi/f77/allgatherv_f.c index 3f90b3ec7f..d07dccadd9 100644 --- a/src/mpi/f77/allgatherv_f.c +++ b/src/mpi/f77/allgatherv_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" - #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER @@ -74,10 +73,10 @@ void mpi_allgatherv_f(char *sendbuf, MPI_Fint *sendcount, MPI_Fint *sendtype, OMPI_ARRAY_FINT_2_INT(recvcounts, size); OMPI_ARRAY_FINT_2_INT(displs, size); - *ierr = OMPI_INT_2_FINT(MPI_Allgatherv(sendbuf, + *ierr = OMPI_INT_2_FINT(MPI_Allgatherv(sendbuf, OMPI_FINT_2_INT(*sendcount), - c_sendtype, - recvbuf, + c_sendtype, + recvbuf, OMPI_ARRAY_NAME_CONVERT(recvcounts), OMPI_ARRAY_NAME_CONVERT(displs), c_recvtype, c_comm)); diff --git a/src/mpi/f77/attr_put_f.c b/src/mpi/f77/attr_put_f.c index 0c48e9a921..9475a787c6 100644 --- a/src/mpi/f77/attr_put_f.c +++ b/src/mpi/f77/attr_put_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/bindings.h b/src/mpi/f77/bindings.h index ed7d78e322..03c1db55c9 100644 --- a/src/mpi/f77/bindings.h +++ b/src/mpi/f77/bindings.h @@ -20,6 +20,10 @@ #include "ompi_config.h" #include "mpi.h" +#include "errhandler/errhandler.h" +#include "attribute/attribute.h" +#include "op/op.h" +#include "request/grequest.h" /* * We now build all four fortran bindings and dont care too much about diff --git a/src/mpi/f77/bsend_f.c b/src/mpi/f77/bsend_f.c index 6f5f88a5ea..8aea069e52 100644 --- a/src/mpi/f77/bsend_f.c +++ b/src/mpi/f77/bsend_f.c @@ -16,8 +16,8 @@ #include "ompi_config.h" - #include "mpi/f77/bindings.h" +#include "mpi/f77/constants.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER #pragma weak PMPI_BSEND = mpi_bsend_f @@ -63,7 +63,7 @@ void mpi_bsend_f(char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, c_comm = MPI_Comm_f2c (*comm); - *ierr = OMPI_INT_2_FINT(MPI_Bsend(buf, OMPI_FINT_2_INT(*count), + *ierr = OMPI_INT_2_FINT(MPI_Bsend(OMPI_ADDR(buf), OMPI_FINT_2_INT(*count), c_type, OMPI_FINT_2_INT(*dest), OMPI_FINT_2_INT(*tag), c_comm)); } diff --git a/src/mpi/f77/bsend_init_f.c b/src/mpi/f77/bsend_init_f.c index 0cd69e5c6a..1c229753f2 100644 --- a/src/mpi/f77/bsend_init_f.c +++ b/src/mpi/f77/bsend_init_f.c @@ -17,6 +17,7 @@ #include "ompi_config.h" #include "mpi/f77/bindings.h" +#include "mpi/f77/constants.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER #pragma weak PMPI_BSEND_INIT = mpi_bsend_init_f @@ -63,7 +64,7 @@ void mpi_bsend_init_f(char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint * c_comm = MPI_Comm_f2c (*comm); - *ierr = OMPI_INT_2_FINT(MPI_Bsend_init(buf, OMPI_FINT_2_INT(*count), + *ierr = OMPI_INT_2_FINT(MPI_Bsend_init(OMPI_ADDR(buf), OMPI_FINT_2_INT(*count), c_type, OMPI_FINT_2_INT(*dest), OMPI_FINT_2_INT(*tag), diff --git a/src/mpi/f77/cart_shift_f.c b/src/mpi/f77/cart_shift_f.c index 81931ca09b..99a6022a40 100644 --- a/src/mpi/f77/cart_shift_f.c +++ b/src/mpi/f77/cart_shift_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" - #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/comm_create_errhandler_f.c b/src/mpi/f77/comm_create_errhandler_f.c index 2d96da2210..92cca97c52 100644 --- a/src/mpi/f77/comm_create_errhandler_f.c +++ b/src/mpi/f77/comm_create_errhandler_f.c @@ -29,7 +29,7 @@ OMPI_GENERATE_F77_BINDINGS (PMPI_COMM_CREATE_ERRHANDLER, pmpi_comm_create_errhandler_, pmpi_comm_create_errhandler__, pmpi_comm_create_errhandler_f, - (void *function, MPI_Fint *errhandler, MPI_Fint *ierr), + (ompi_errhandler_fortran_handler_fn_t* function, MPI_Fint *errhandler, MPI_Fint *ierr), (function, errhandler, ierr) ) #endif @@ -46,7 +46,7 @@ OMPI_GENERATE_F77_BINDINGS (MPI_COMM_CREATE_ERRHANDLER, mpi_comm_create_errhandler_, mpi_comm_create_errhandler__, mpi_comm_create_errhandler_f, - (void *function, MPI_Fint *errhandler, MPI_Fint *ierr), + (ompi_errhandler_fortran_handler_fn_t* function, MPI_Fint *errhandler, MPI_Fint *ierr), (function, errhandler, ierr) ) #endif @@ -55,7 +55,7 @@ OMPI_GENERATE_F77_BINDINGS (MPI_COMM_CREATE_ERRHANDLER, #include "mpi/f77/profile/defines.h" #endif -void mpi_comm_create_errhandler_f(void *function, +void mpi_comm_create_errhandler_f(ompi_errhandler_fortran_handler_fn_t *function, MPI_Fint *errhandler, MPI_Fint *ierr) { MPI_Errhandler c_errhandler; @@ -64,7 +64,7 @@ void mpi_comm_create_errhandler_f(void *function, (void*) for function pointers in this function */ *ierr = OMPI_INT_2_FINT( - MPI_Comm_create_errhandler((MPI_Comm_errhandler_fn*) function, + MPI_Comm_create_errhandler((MPI_Comm_errhandler_fn*)function, &c_errhandler)); *errhandler = MPI_Errhandler_c2f(c_errhandler); } diff --git a/src/mpi/f77/comm_create_keyval_f.c b/src/mpi/f77/comm_create_keyval_f.c index 95a4043100..9a59a13430 100644 --- a/src/mpi/f77/comm_create_keyval_f.c +++ b/src/mpi/f77/comm_create_keyval_f.c @@ -17,7 +17,6 @@ #include "ompi_config.h" #include "mpi/f77/bindings.h" -#include "attribute/attribute.h" #include "communicator/communicator.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER @@ -31,7 +30,7 @@ OMPI_GENERATE_F77_BINDINGS (PMPI_COMM_CREATE_KEYVAL, pmpi_comm_create_keyval_, pmpi_comm_create_keyval__, pmpi_comm_create_keyval_f, - (void *comm_copy_attr_fn, void *comm_delete_attr_fn, MPI_Fint *comm_keyval, char *extra_state, MPI_Fint *ierr), + (MPI_F_copy_function* comm_copy_attr_fn, MPI_F_delete_function* comm_delete_attr_fn, MPI_Fint *comm_keyval, char *extra_state, MPI_Fint *ierr), (comm_copy_attr_fn, comm_delete_attr_fn, comm_keyval, extra_state, ierr) ) #endif @@ -48,7 +47,7 @@ OMPI_GENERATE_F77_BINDINGS (MPI_COMM_CREATE_KEYVAL, mpi_comm_create_keyval_, mpi_comm_create_keyval__, mpi_comm_create_keyval_f, - (void *comm_copy_attr_fn, void *comm_delete_attr_fn, MPI_Fint *comm_keyval, char *extra_state, MPI_Fint *ierr), + (MPI_F_copy_function* comm_copy_attr_fn, MPI_F_delete_function* comm_delete_attr_fn, MPI_Fint *comm_keyval, char *extra_state, MPI_Fint *ierr), (comm_copy_attr_fn, comm_delete_attr_fn, comm_keyval, extra_state, ierr) ) #endif @@ -59,8 +58,8 @@ OMPI_GENERATE_F77_BINDINGS (MPI_COMM_CREATE_KEYVAL, static const char FUNC_NAME[] = "MPI_Comm_create_keyval_f"; -void mpi_comm_create_keyval_f(void *comm_copy_attr_fn, - void *comm_delete_attr_fn, +void mpi_comm_create_keyval_f(MPI_F_copy_function* comm_copy_attr_fn, + MPI_F_delete_function* comm_delete_attr_fn, MPI_Fint *comm_keyval, char *extra_state, MPI_Fint *ierr) { diff --git a/src/mpi/f77/comm_get_name_f.c b/src/mpi/f77/comm_get_name_f.c index de04ac4c5a..a57f06f64a 100644 --- a/src/mpi/f77/comm_get_name_f.c +++ b/src/mpi/f77/comm_get_name_f.c @@ -16,10 +16,10 @@ #include "ompi_config.h" -#include "include/constants.h" -#include "communicator/communicator.h" #include "mpi/f77/bindings.h" #include "mpi/f77/strings.h" +#include "include/constants.h" +#include "communicator/communicator.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER #pragma weak PMPI_COMM_GET_NAME = mpi_comm_get_name_f diff --git a/src/mpi/f77/comm_set_attr_f.c b/src/mpi/f77/comm_set_attr_f.c index 5f1022830a..4cc2be1e66 100644 --- a/src/mpi/f77/comm_set_attr_f.c +++ b/src/mpi/f77/comm_set_attr_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/comm_set_errhandler_f.c b/src/mpi/f77/comm_set_errhandler_f.c index efbf9848c5..8ba14bdef6 100644 --- a/src/mpi/f77/comm_set_errhandler_f.c +++ b/src/mpi/f77/comm_set_errhandler_f.c @@ -16,8 +16,8 @@ #include "ompi_config.h" -#include "errhandler/errhandler.h" #include "mpi/f77/bindings.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER #pragma weak PMPI_COMM_SET_ERRHANDLER = mpi_comm_set_errhandler_f diff --git a/src/mpi/f77/comm_set_name_f.c b/src/mpi/f77/comm_set_name_f.c index d3fbf885dd..2e6571e9de 100644 --- a/src/mpi/f77/comm_set_name_f.c +++ b/src/mpi/f77/comm_set_name_f.c @@ -16,9 +16,9 @@ #include "ompi_config.h" +#include "mpi/f77/bindings.h" #include "include/constants.h" #include "communicator/communicator.h" -#include "mpi/f77/bindings.h" #include "mpi/f77/strings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/comm_size_f.c b/src/mpi/f77/comm_size_f.c index be3643cee2..06fd68f46d 100644 --- a/src/mpi/f77/comm_size_f.c +++ b/src/mpi/f77/comm_size_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/comm_spawn_f.c b/src/mpi/f77/comm_spawn_f.c index e46416d4e8..36da5de0a6 100644 --- a/src/mpi/f77/comm_spawn_f.c +++ b/src/mpi/f77/comm_spawn_f.c @@ -18,11 +18,10 @@ #include -#include "mpi.h" -#include "util/argv.h" #include "mpi/f77/bindings.h" #include "mpi/f77/constants.h" #include "mpi/f77/strings.h" +#include "util/argv.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER #pragma weak PMPI_COMM_SPAWN = mpi_comm_spawn_f diff --git a/src/mpi/f77/comm_spawn_multiple_f.c b/src/mpi/f77/comm_spawn_multiple_f.c index 0de853ec76..bf09f621a4 100644 --- a/src/mpi/f77/comm_spawn_multiple_f.c +++ b/src/mpi/f77/comm_spawn_multiple_f.c @@ -19,11 +19,10 @@ #include #include -#include "mpi.h" -#include "util/argv.h" #include "mpi/f77/bindings.h" #include "mpi/f77/constants.h" #include "mpi/f77/strings.h" +#include "util/argv.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/comm_split_f.c b/src/mpi/f77/comm_split_f.c index 934a9da840..a0a207bc86 100644 --- a/src/mpi/f77/comm_split_f.c +++ b/src/mpi/f77/comm_split_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/comm_test_inter_f.c b/src/mpi/f77/comm_test_inter_f.c index 2201fe09f2..618eba5526 100644 --- a/src/mpi/f77/comm_test_inter_f.c +++ b/src/mpi/f77/comm_test_inter_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/constants.h b/src/mpi/f77/constants.h index f6ad1bf183..c62c73e431 100644 --- a/src/mpi/f77/constants.h +++ b/src/mpi/f77/constants.h @@ -37,7 +37,7 @@ */ #if defined(HAVE_LONG_DOUBLE) && OMPI_ALIGNMENT_LONG_DOUBLE == 16 -typedef struct { long double bogus; } ompi_fortran_common_t; +typedef struct { long double bogus[1]; } ompi_fortran_common_t; #else typedef struct { double bogus[2]; } ompi_fortran_common_t; #endif @@ -102,7 +102,6 @@ DECL(MPI_FORTRAN_STATUSES_IGNORE, mpi_fortran_statuses_ignore, * Create macros to do the checking. Only check for all 4 if we have * weak symbols. Otherwise, just check for the one relevant symbol. */ - #if OMPI_HAVE_WEAK_SYMBOLS #define OMPI_IS_FORTRAN_BOTTOM(addr) \ (addr == (void*) &MPI_FORTRAN_BOTTOM || \ @@ -193,4 +192,7 @@ DECL(MPI_FORTRAN_STATUSES_IGNORE, mpi_fortran_statuses_ignore, #endif /* weak / specific symbol type */ +/* Convert between Fortran and C MPI_BOTTOM */ +#define OMPI_ADDR(addr) (OMPI_IS_FORTRAN_BOTTOM(addr) ? MPI_BOTTOM : (addr)) + #endif /* OMPI_F77_CONSTANTS_H */ diff --git a/src/mpi/f77/constants_f.c b/src/mpi/f77/constants_f.c index 61078ae109..337747d2b7 100644 --- a/src/mpi/f77/constants_f.c +++ b/src/mpi/f77/constants_f.c @@ -20,13 +20,13 @@ #include "constants.h" #define INST(upper_case, lower_case, single_u, double_u) \ -ompi_fortran_common_t upper_case; \ ompi_fortran_common_t lower_case; \ +ompi_fortran_common_t upper_case; \ ompi_fortran_common_t single_u; \ ompi_fortran_common_t double_u -INST(MPI_FORTRAN_STATUS_IGNORE, mpi_fortran_status_ignore, - mpi_fortran_status_ignore_, mpi_fortran_status_ignore__); +INST(MPI_FORTRAN_BOTTOM, mpi_fortran_bottom, + mpi_fortran_bottom_, mpi_fortran_bottom__); INST(MPI_FORTRAN_ARGV_NULL, mpi_fortran_argv_null, mpi_fortran_argv_null_, mpi_fortran_argv_null__); INST(MPI_FORTRAN_ARGVS_NULL, mpi_fortran_argvs_null, diff --git a/src/mpi/f77/dims_create_f.c b/src/mpi/f77/dims_create_f.c index de86312b0a..592a31d4ce 100644 --- a/src/mpi/f77/dims_create_f.c +++ b/src/mpi/f77/dims_create_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/errhandler_create_f.c b/src/mpi/f77/errhandler_create_f.c index af60f9a5fa..7c9def16d2 100644 --- a/src/mpi/f77/errhandler_create_f.c +++ b/src/mpi/f77/errhandler_create_f.c @@ -29,7 +29,7 @@ OMPI_GENERATE_F77_BINDINGS (PMPI_ERRHANDLER_CREATE, pmpi_errhandler_create_, pmpi_errhandler_create__, pmpi_errhandler_create_f, - (void *function, MPI_Fint *errhandler, MPI_Fint *ierr), + (ompi_errhandler_fortran_handler_fn_t* function, MPI_Fint *errhandler, MPI_Fint *ierr), (function, errhandler, ierr) ) #endif @@ -46,7 +46,7 @@ OMPI_GENERATE_F77_BINDINGS (MPI_ERRHANDLER_CREATE, mpi_errhandler_create_, mpi_errhandler_create__, mpi_errhandler_create_f, - (void *function, MPI_Fint *errhandler, MPI_Fint *ierr), + (ompi_errhandler_fortran_handler_fn_t* function, MPI_Fint *errhandler, MPI_Fint *ierr), (function, errhandler, ierr) ) #endif @@ -55,7 +55,7 @@ OMPI_GENERATE_F77_BINDINGS (MPI_ERRHANDLER_CREATE, #include "mpi/f77/profile/defines.h" #endif -void mpi_errhandler_create_f(void *function, +void mpi_errhandler_create_f(ompi_errhandler_fortran_handler_fn_t* function, MPI_Fint *errhandler, MPI_Fint *ierr) { MPI_Errhandler c_errhandler; diff --git a/src/mpi/f77/errhandler_free_f.c b/src/mpi/f77/errhandler_free_f.c index 404ed7d26c..8e95d83888 100644 --- a/src/mpi/f77/errhandler_free_f.c +++ b/src/mpi/f77/errhandler_free_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/errhandler_get_f.c b/src/mpi/f77/errhandler_get_f.c index 27217d1058..977f2542dc 100644 --- a/src/mpi/f77/errhandler_get_f.c +++ b/src/mpi/f77/errhandler_get_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/errhandler_set_f.c b/src/mpi/f77/errhandler_set_f.c index 276687b6bc..03f573e728 100644 --- a/src/mpi/f77/errhandler_set_f.c +++ b/src/mpi/f77/errhandler_set_f.c @@ -16,9 +16,8 @@ #include "ompi_config.h" -#include "mpi.h" -#include "errhandler/errhandler.h" #include "mpi/f77/bindings.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER #pragma weak PMPI_ERRHANDLER_SET = mpi_errhandler_set_f diff --git a/src/mpi/f77/error_class_f.c b/src/mpi/f77/error_class_f.c index 7141cae7be..8249ca4d4b 100644 --- a/src/mpi/f77/error_class_f.c +++ b/src/mpi/f77/error_class_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/error_string_f.c b/src/mpi/f77/error_string_f.c index 5e26066cf7..c9583f54ab 100644 --- a/src/mpi/f77/error_string_f.c +++ b/src/mpi/f77/error_string_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/exscan_f.c b/src/mpi/f77/exscan_f.c index 0502345ab7..72b0e9dfa7 100644 --- a/src/mpi/f77/exscan_f.c +++ b/src/mpi/f77/exscan_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/file_create_errhandler_f.c b/src/mpi/f77/file_create_errhandler_f.c index cdbda18c45..46b4692e85 100644 --- a/src/mpi/f77/file_create_errhandler_f.c +++ b/src/mpi/f77/file_create_errhandler_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER @@ -30,7 +29,7 @@ OMPI_GENERATE_F77_BINDINGS (PMPI_FILE_CREATE_ERRHANDLER, pmpi_file_create_errhandler_, pmpi_file_create_errhandler__, pmpi_file_create_errhandler_f, - (void *function, MPI_Fint *errhandler, MPI_Fint *ierr), + (ompi_errhandler_fortran_handler_fn_t* function, MPI_Fint *errhandler, MPI_Fint *ierr), (function, errhandler, ierr) ) #endif @@ -47,7 +46,7 @@ OMPI_GENERATE_F77_BINDINGS (MPI_FILE_CREATE_ERRHANDLER, mpi_file_create_errhandler_, mpi_file_create_errhandler__, mpi_file_create_errhandler_f, - (void *function, MPI_Fint *errhandler, MPI_Fint *ierr), + (ompi_errhandler_fortran_handler_fn_t* function, MPI_Fint *errhandler, MPI_Fint *ierr), (function, errhandler, ierr) ) #endif @@ -56,7 +55,7 @@ OMPI_GENERATE_F77_BINDINGS (MPI_FILE_CREATE_ERRHANDLER, #include "mpi/f77/profile/defines.h" #endif -void mpi_file_create_errhandler_f(void *function, +void mpi_file_create_errhandler_f(ompi_errhandler_fortran_handler_fn_t* function, MPI_Fint *errhandler, MPI_Fint *ierr) { MPI_Errhandler c_errhandler; diff --git a/src/mpi/f77/file_delete_f.c b/src/mpi/f77/file_delete_f.c index 3cb29659c2..bc5eca60d2 100644 --- a/src/mpi/f77/file_delete_f.c +++ b/src/mpi/f77/file_delete_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/file_get_byte_offset_f.c b/src/mpi/f77/file_get_byte_offset_f.c index 4849dd7b73..4dac34d20c 100644 --- a/src/mpi/f77/file_get_byte_offset_f.c +++ b/src/mpi/f77/file_get_byte_offset_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/file_get_errhandler_f.c b/src/mpi/f77/file_get_errhandler_f.c index e6b1561d79..1e47d5fc86 100644 --- a/src/mpi/f77/file_get_errhandler_f.c +++ b/src/mpi/f77/file_get_errhandler_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/file_get_group_f.c b/src/mpi/f77/file_get_group_f.c index ce3e9c8311..90d5d2d06e 100644 --- a/src/mpi/f77/file_get_group_f.c +++ b/src/mpi/f77/file_get_group_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/file_get_info_f.c b/src/mpi/f77/file_get_info_f.c index 82f340c061..03cf723bf2 100644 --- a/src/mpi/f77/file_get_info_f.c +++ b/src/mpi/f77/file_get_info_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/file_get_position_f.c b/src/mpi/f77/file_get_position_f.c index 46fa407a8f..34ef253476 100644 --- a/src/mpi/f77/file_get_position_f.c +++ b/src/mpi/f77/file_get_position_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/file_get_position_shared_f.c b/src/mpi/f77/file_get_position_shared_f.c index bd3371efe0..f13c2f9d96 100644 --- a/src/mpi/f77/file_get_position_shared_f.c +++ b/src/mpi/f77/file_get_position_shared_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/file_get_size_f.c b/src/mpi/f77/file_get_size_f.c index 418c6beb41..8e295a5b55 100644 --- a/src/mpi/f77/file_get_size_f.c +++ b/src/mpi/f77/file_get_size_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/file_get_type_extent_f.c b/src/mpi/f77/file_get_type_extent_f.c index 5c52cfe2a6..8afe64bfc6 100644 --- a/src/mpi/f77/file_get_type_extent_f.c +++ b/src/mpi/f77/file_get_type_extent_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/file_get_view_f.c b/src/mpi/f77/file_get_view_f.c index 66d68f4b6f..af99ebc7e5 100644 --- a/src/mpi/f77/file_get_view_f.c +++ b/src/mpi/f77/file_get_view_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/file_iread_at_f.c b/src/mpi/f77/file_iread_at_f.c index 755d328522..2ffedeae51 100644 --- a/src/mpi/f77/file_iread_at_f.c +++ b/src/mpi/f77/file_iread_at_f.c @@ -16,8 +16,8 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" +#include "mpi/f77/constants.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER #pragma weak PMPI_FILE_IREAD_AT = mpi_file_iread_at_f @@ -26,12 +26,12 @@ #pragma weak pmpi_file_iread_at__ = mpi_file_iread_at_f #elif OMPI_PROFILE_LAYER OMPI_GENERATE_F77_BINDINGS (PMPI_FILE_IREAD_AT, - pmpi_file_iread_at, - pmpi_file_iread_at_, - pmpi_file_iread_at__, - pmpi_file_iread_at_f, - (MPI_Fint *fh, MPI_Offset *offset, char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *request, MPI_Fint *ierr), - (fh, offset, buf, count, datatype, request, ierr) ) + pmpi_file_iread_at, + pmpi_file_iread_at_, + pmpi_file_iread_at__, + pmpi_file_iread_at_f, + (MPI_Fint *fh, MPI_Offset *offset, char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *request, MPI_Fint *ierr), + (fh, offset, buf, count, datatype, request, ierr) ) #endif #if OMPI_HAVE_WEAK_SYMBOLS @@ -42,13 +42,13 @@ OMPI_GENERATE_F77_BINDINGS (PMPI_FILE_IREAD_AT, #endif #if ! OMPI_HAVE_WEAK_SYMBOLS && ! OMPI_PROFILE_LAYER -OMPI_GENERATE_F77_BINDINGS (MPI_FILE_IREAD_AT, - mpi_file_iread_at, - mpi_file_iread_at_, - mpi_file_iread_at__, - mpi_file_iread_at_f, - (MPI_Fint *fh, MPI_Offset *offset, char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *request, MPI_Fint *ierr), - (fh, offset, buf, count, datatype, request, ierr) ) + OMPI_GENERATE_F77_BINDINGS (MPI_FILE_IREAD_AT, + mpi_file_iread_at, + mpi_file_iread_at_, + mpi_file_iread_at__, + mpi_file_iread_at_f, + (MPI_Fint *fh, MPI_Offset *offset, char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *request, MPI_Fint *ierr), + (fh, offset, buf, count, datatype, request, ierr) ) #endif @@ -57,18 +57,19 @@ OMPI_GENERATE_F77_BINDINGS (MPI_FILE_IREAD_AT, #endif void mpi_file_iread_at_f(MPI_Fint *fh, MPI_Offset *offset, - char *buf, MPI_Fint *count, - MPI_Fint *datatype, MPI_Fint *request, MPI_Fint *ierr) + char *buf, MPI_Fint *count, + MPI_Fint *datatype, MPI_Fint *request, MPI_Fint *ierr) { - MPI_File c_fh = MPI_File_f2c(*fh); - MPI_Datatype c_type = MPI_Type_f2c(*datatype); - MPI_Request c_request; + MPI_File c_fh = MPI_File_f2c(*fh); + MPI_Datatype c_type = MPI_Type_f2c(*datatype); + MPI_Request c_request; - *ierr = OMPI_INT_2_FINT(MPI_File_iread_at(c_fh, (MPI_Offset) *offset, - buf, OMPI_FINT_2_INT(*count), - c_type, - &c_request)); - if (MPI_SUCCESS == *ierr) { - *request = MPI_Request_c2f(c_request); - } + *ierr = OMPI_INT_2_FINT(MPI_File_iread_at(c_fh, (MPI_Offset) *offset, + OMPI_ADDR(buf), + OMPI_FINT_2_INT(*count), + c_type, + &c_request)); + if (MPI_SUCCESS == *ierr) { + *request = MPI_Request_c2f(c_request); + } } diff --git a/src/mpi/f77/file_iread_f.c b/src/mpi/f77/file_iread_f.c index 8827abdafd..38ff8d211c 100644 --- a/src/mpi/f77/file_iread_f.c +++ b/src/mpi/f77/file_iread_f.c @@ -16,8 +16,8 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" +#include "mpi/f77/constants.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER #pragma weak PMPI_FILE_IREAD = mpi_file_iread_f @@ -59,15 +59,15 @@ OMPI_GENERATE_F77_BINDINGS (MPI_FILE_IREAD, void mpi_file_iread_f(MPI_Fint *fh, char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *request, MPI_Fint *ierr) { - MPI_File c_fh = MPI_File_f2c(*fh); - MPI_Datatype c_type = MPI_Type_f2c(*datatype); - MPI_Request c_request; + MPI_File c_fh = MPI_File_f2c(*fh); + MPI_Datatype c_type = MPI_Type_f2c(*datatype); + MPI_Request c_request; - *ierr = OMPI_INT_2_FINT(MPI_File_iread(c_fh, buf, - OMPI_FINT_2_INT(*count), - c_type, &c_request)); - - if (MPI_SUCCESS == *ierr) { - *request = MPI_Request_c2f(c_request); - } + *ierr = OMPI_INT_2_FINT(MPI_File_iread(c_fh, OMPI_ADDR(buf), + OMPI_FINT_2_INT(*count), + c_type, &c_request)); + + if (MPI_SUCCESS == *ierr) { + *request = MPI_Request_c2f(c_request); + } } diff --git a/src/mpi/f77/file_iread_shared_f.c b/src/mpi/f77/file_iread_shared_f.c index e642b6f170..60aeafbdc6 100644 --- a/src/mpi/f77/file_iread_shared_f.c +++ b/src/mpi/f77/file_iread_shared_f.c @@ -16,8 +16,8 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" +#include "mpi/f77/constants.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER #pragma weak PMPI_FILE_IREAD_SHARED = mpi_file_iread_shared_f @@ -60,16 +60,16 @@ void mpi_file_iread_shared_f(MPI_Fint *fh, char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *request, MPI_Fint *ierr) { - MPI_File c_fh = MPI_File_f2c(*fh); - MPI_Datatype c_type = MPI_Type_f2c(*datatype); - MPI_Request c_request; - - *ierr = OMPI_INT_2_FINT(MPI_File_iread_shared(c_fh, - buf, - OMPI_FINT_2_INT(*count), - c_type, - &c_request)); - if (MPI_SUCCESS == *ierr) { - *request = MPI_Request_c2f(c_request); - } + MPI_File c_fh = MPI_File_f2c(*fh); + MPI_Datatype c_type = MPI_Type_f2c(*datatype); + MPI_Request c_request; + + *ierr = OMPI_INT_2_FINT(MPI_File_iread_shared(c_fh, + OMPI_ADDR(buf), + OMPI_FINT_2_INT(*count), + c_type, + &c_request)); + if (MPI_SUCCESS == *ierr) { + *request = MPI_Request_c2f(c_request); + } } diff --git a/src/mpi/f77/file_iwrite_at_f.c b/src/mpi/f77/file_iwrite_at_f.c index 6b1f4b8b86..ada40cef4b 100644 --- a/src/mpi/f77/file_iwrite_at_f.c +++ b/src/mpi/f77/file_iwrite_at_f.c @@ -16,8 +16,8 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" +#include "mpi/f77/constants.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER #pragma weak PMPI_FILE_IWRITE_AT = mpi_file_iwrite_at_f @@ -60,15 +60,15 @@ void mpi_file_iwrite_at_f(MPI_Fint *fh, MPI_Offset *offset, char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *request, MPI_Fint *ierr) { - MPI_File c_fh = MPI_File_f2c(*fh); - MPI_Datatype c_type = MPI_Type_f2c(*datatype); - MPI_Request c_request; - - *ierr = OMPI_INT_2_FINT(MPI_File_iwrite_at(c_fh, (MPI_Offset) *offset, - buf, OMPI_FINT_2_INT(*count), - c_type, - &c_request)); - if (MPI_SUCCESS == *ierr) { - *request = MPI_Request_c2f(c_request); - } + MPI_File c_fh = MPI_File_f2c(*fh); + MPI_Datatype c_type = MPI_Type_f2c(*datatype); + MPI_Request c_request; + + *ierr = OMPI_INT_2_FINT(MPI_File_iwrite_at(c_fh, (MPI_Offset) *offset, + OMPI_ADDR(buf), + OMPI_FINT_2_INT(*count), + c_type, &c_request)); + if (MPI_SUCCESS == *ierr) { + *request = MPI_Request_c2f(c_request); + } } diff --git a/src/mpi/f77/file_iwrite_f.c b/src/mpi/f77/file_iwrite_f.c index 1b24c94829..22f93b3f59 100644 --- a/src/mpi/f77/file_iwrite_f.c +++ b/src/mpi/f77/file_iwrite_f.c @@ -16,8 +16,8 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" +#include "mpi/f77/constants.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER #pragma weak PMPI_FILE_IWRITE = mpi_file_iwrite_f @@ -58,15 +58,15 @@ OMPI_GENERATE_F77_BINDINGS (MPI_FILE_IWRITE, void mpi_file_iwrite_f(MPI_Fint *fh, char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *request, MPI_Fint *ierr) { - MPI_File c_fh = MPI_File_f2c(*fh); - MPI_Datatype c_type = MPI_Type_f2c(*datatype); - MPI_Request c_request; - - *ierr = OMPI_INT_2_FINT(MPI_File_iwrite(c_fh, buf, + MPI_File c_fh = MPI_File_f2c(*fh); + MPI_Datatype c_type = MPI_Type_f2c(*datatype); + MPI_Request c_request; + + *ierr = OMPI_INT_2_FINT(MPI_File_iwrite(c_fh, OMPI_ADDR(buf), OMPI_FINT_2_INT(*count), c_type, &c_request)); - - if (MPI_SUCCESS == *ierr) { - *request = MPI_Request_c2f(c_request); - } + + if (MPI_SUCCESS == *ierr) { + *request = MPI_Request_c2f(c_request); + } } diff --git a/src/mpi/f77/file_iwrite_shared_f.c b/src/mpi/f77/file_iwrite_shared_f.c index 95df2cecac..5086fe325d 100644 --- a/src/mpi/f77/file_iwrite_shared_f.c +++ b/src/mpi/f77/file_iwrite_shared_f.c @@ -16,8 +16,8 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" +#include "mpi/f77/constants.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER #pragma weak PMPI_FILE_IWRITE_SHARED = mpi_file_iwrite_shared_f @@ -60,17 +60,16 @@ void mpi_file_iwrite_shared_f(MPI_Fint *fh, char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *request, MPI_Fint *ierr) { - MPI_File c_fh = MPI_File_f2c(*fh); - MPI_Datatype c_type = MPI_Type_f2c(*datatype); - MPI_Request c_request; - - *ierr = OMPI_INT_2_FINT(MPI_File_iwrite_shared(c_fh, - buf, - OMPI_FINT_2_INT(*count), - c_type, - &c_request)); - if (MPI_SUCCESS == *ierr) { - *request = MPI_Request_c2f(c_request); - } - + MPI_File c_fh = MPI_File_f2c(*fh); + MPI_Datatype c_type = MPI_Type_f2c(*datatype); + MPI_Request c_request; + + *ierr = OMPI_INT_2_FINT(MPI_File_iwrite_shared(c_fh, + OMPI_ADDR(buf), + OMPI_FINT_2_INT(*count), + c_type, + &c_request)); + if (MPI_SUCCESS == *ierr) { + *request = MPI_Request_c2f(c_request); + } } diff --git a/src/mpi/f77/file_open_f.c b/src/mpi/f77/file_open_f.c index e5580fa7b5..33a3746357 100644 --- a/src/mpi/f77/file_open_f.c +++ b/src/mpi/f77/file_open_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/file_preallocate_f.c b/src/mpi/f77/file_preallocate_f.c index e3b351e0d5..df364b40a2 100644 --- a/src/mpi/f77/file_preallocate_f.c +++ b/src/mpi/f77/file_preallocate_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/file_read_all_begin_f.c b/src/mpi/f77/file_read_all_begin_f.c index 270b8c9514..e8e8940ba9 100644 --- a/src/mpi/f77/file_read_all_begin_f.c +++ b/src/mpi/f77/file_read_all_begin_f.c @@ -16,8 +16,8 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" +#include "mpi/f77/constants.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER #pragma weak PMPI_FILE_READ_ALL_BEGIN = mpi_file_read_all_begin_f @@ -60,10 +60,10 @@ void mpi_file_read_all_begin_f(MPI_Fint *fh, char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *ierr) { - MPI_File c_fh = MPI_File_f2c(*fh); - MPI_Datatype c_type = MPI_Type_f2c(*datatype); + MPI_File c_fh = MPI_File_f2c(*fh); + MPI_Datatype c_type = MPI_Type_f2c(*datatype); - *ierr = OMPI_INT_2_FINT(MPI_File_read_all_begin(c_fh, buf, - OMPI_FINT_2_INT(*count), - c_type)); + *ierr = OMPI_INT_2_FINT(MPI_File_read_all_begin(c_fh, OMPI_ADDR(buf), + OMPI_FINT_2_INT(*count), + c_type)); } diff --git a/src/mpi/f77/file_read_all_end_f.c b/src/mpi/f77/file_read_all_end_f.c index 6779638af1..f558d328e3 100644 --- a/src/mpi/f77/file_read_all_end_f.c +++ b/src/mpi/f77/file_read_all_end_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #include "mpi/f77/constants.h" #include "errhandler/errhandler.h" diff --git a/src/mpi/f77/file_read_all_f.c b/src/mpi/f77/file_read_all_f.c index b5cef36d14..3908eb74fd 100644 --- a/src/mpi/f77/file_read_all_f.c +++ b/src/mpi/f77/file_read_all_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #include "mpi/f77/constants.h" #include "errhandler/errhandler.h" @@ -62,37 +61,35 @@ OMPI_GENERATE_F77_BINDINGS (MPI_FILE_READ_ALL, void mpi_file_read_all_f(MPI_Fint *fh, char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *status, MPI_Fint *ierr) { - MPI_File c_fh = MPI_File_f2c(*fh); - MPI_Datatype c_type = MPI_Type_f2c(*datatype); - MPI_Status *c_status; + MPI_File c_fh = MPI_File_f2c(*fh); + MPI_Datatype c_type = MPI_Type_f2c(*datatype); + MPI_Status *c_status; #if OMPI_SIZEOF_FORTRAN_INT != SIZEOF_INT - MPI_Status c_status2; + MPI_Status c_status2; #endif - /* See if we got MPI_STATUS_IGNORE */ - - if (OMPI_IS_FORTRAN_STATUS_IGNORE(status)) { - c_status = MPI_STATUS_IGNORE; - } else { - - /* If sizeof(int) == sizeof(INTEGER), then there's no - translation necessary -- let the underlying functions write - directly into the Fortran status */ + /* See if we got MPI_STATUS_IGNORE */ + if (OMPI_IS_FORTRAN_STATUS_IGNORE(status)) { + c_status = MPI_STATUS_IGNORE; + } else { + /* If sizeof(int) == sizeof(INTEGER), then there's no + translation necessary -- let the underlying functions write + directly into the Fortran status */ #if OMPI_SIZEOF_FORTRAN_INT == SIZEOF_INT - c_status = (MPI_Status *) status; + c_status = (MPI_Status *) status; #else - c_status = &c_status2; + c_status = &c_status2; #endif - } + } - *ierr = OMPI_INT_2_FINT(MPI_File_read_all(c_fh, buf, - OMPI_FINT_2_INT(*count), - c_type, c_status)); - + *ierr = OMPI_INT_2_FINT(MPI_File_read_all(c_fh, OMPI_ADDR(buf), + OMPI_FINT_2_INT(*count), + c_type, c_status)); + #if OMPI_SIZEOF_FORTRAN_INT != SIZEOF_INT - if (MPI_STATUS_IGNORE != c_status) { - MPI_Status_c2f(c_status, status); - } + if (MPI_STATUS_IGNORE != c_status) { + MPI_Status_c2f(c_status, status); + } #endif } diff --git a/src/mpi/f77/file_read_at_all_begin_f.c b/src/mpi/f77/file_read_at_all_begin_f.c index c29509e9ef..f3f7fee86c 100644 --- a/src/mpi/f77/file_read_at_all_begin_f.c +++ b/src/mpi/f77/file_read_at_all_begin_f.c @@ -16,8 +16,8 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" +#include "mpi/f77/constants.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER #pragma weak PMPI_FILE_READ_AT_ALL_BEGIN = mpi_file_read_at_all_begin_f @@ -60,12 +60,12 @@ void mpi_file_read_at_all_begin_f(MPI_Fint *fh, MPI_Offset *offset, char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *ierr) { - MPI_File c_fh = MPI_File_f2c(*fh); - MPI_Datatype c_type = MPI_Type_f2c(*datatype); + MPI_File c_fh = MPI_File_f2c(*fh); + MPI_Datatype c_type = MPI_Type_f2c(*datatype); - *ierr = OMPI_FINT_2_INT(MPI_File_read_at_all_begin(c_fh, - (MPI_Offset) *offset, - buf, - OMPI_FINT_2_INT(*count), - c_type)); + *ierr = OMPI_FINT_2_INT(MPI_File_read_at_all_begin(c_fh, + (MPI_Offset) *offset, + OMPI_ADDR(buf), + OMPI_FINT_2_INT(*count), + c_type)); } diff --git a/src/mpi/f77/file_read_at_all_end_f.c b/src/mpi/f77/file_read_at_all_end_f.c index 43c9247686..1ea871fcd1 100644 --- a/src/mpi/f77/file_read_at_all_end_f.c +++ b/src/mpi/f77/file_read_at_all_end_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #include "mpi/f77/constants.h" #include "errhandler/errhandler.h" diff --git a/src/mpi/f77/file_read_at_all_f.c b/src/mpi/f77/file_read_at_all_f.c index eda777df10..150a3ca637 100644 --- a/src/mpi/f77/file_read_at_all_f.c +++ b/src/mpi/f77/file_read_at_all_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #include "mpi/f77/constants.h" #include "errhandler/errhandler.h" @@ -64,40 +63,38 @@ void mpi_file_read_at_all_f(MPI_Fint *fh, MPI_Offset *offset, MPI_Fint *datatype, MPI_Fint *status, MPI_Fint *ierr) { - MPI_File c_fh = MPI_File_f2c(*fh); - MPI_Datatype c_type = MPI_Type_f2c(*datatype); - MPI_Status *c_status; + MPI_File c_fh = MPI_File_f2c(*fh); + MPI_Datatype c_type = MPI_Type_f2c(*datatype); + MPI_Status *c_status; #if OMPI_SIZEOF_FORTRAN_INT != SIZEOF_INT - MPI_Status c_status2; + MPI_Status c_status2; #endif - /* See if we got MPI_STATUS_IGNORE */ - - if (OMPI_IS_FORTRAN_STATUS_IGNORE(status)) { - c_status = MPI_STATUS_IGNORE; - } else { - - /* If sizeof(int) == sizeof(INTEGER), then there's no - translation necessary -- let the underlying functions write - directly into the Fortran status */ - + /* See if we got MPI_STATUS_IGNORE */ + if (OMPI_IS_FORTRAN_STATUS_IGNORE(status)) { + c_status = MPI_STATUS_IGNORE; + } else { + /* If sizeof(int) == sizeof(INTEGER), then there's no + translation necessary -- let the underlying functions write + directly into the Fortran status */ + #if OMPI_SIZEOF_FORTRAN_INT == SIZEOF_INT - c_status = (MPI_Status *) status; + c_status = (MPI_Status *) status; #else - c_status = &c_status2; + c_status = &c_status2; #endif } - *ierr = OMPI_FINT_2_INT(MPI_File_read_at_all(c_fh, - (MPI_Offset) *offset, - buf, - OMPI_FINT_2_INT(*count), - c_type, - c_status)); + *ierr = OMPI_FINT_2_INT(MPI_File_read_at_all(c_fh, + (MPI_Offset) *offset, + OMPI_ADDR(buf), + OMPI_FINT_2_INT(*count), + c_type, + c_status)); #if OMPI_SIZEOF_FORTRAN_INT != SIZEOF_INT - if (MPI_STATUS_IGNORE != c_status) { - MPI_Status_c2f(c_status, status); - } + if (MPI_STATUS_IGNORE != c_status) { + MPI_Status_c2f(c_status, status); + } #endif } diff --git a/src/mpi/f77/file_read_at_f.c b/src/mpi/f77/file_read_at_f.c index 77ff81bd93..fb23ba5354 100644 --- a/src/mpi/f77/file_read_at_f.c +++ b/src/mpi/f77/file_read_at_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #include "mpi/f77/constants.h" #include "errhandler/errhandler.h" diff --git a/src/mpi/f77/file_read_f.c b/src/mpi/f77/file_read_f.c index 3edb9ea7e1..386d3dfc3c 100644 --- a/src/mpi/f77/file_read_f.c +++ b/src/mpi/f77/file_read_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #include "mpi/f77/constants.h" #include "errhandler/errhandler.h" @@ -62,37 +61,35 @@ OMPI_GENERATE_F77_BINDINGS (MPI_FILE_READ, void mpi_file_read_f(MPI_Fint *fh, char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *status, MPI_Fint *ierr) { - MPI_File c_fh = MPI_File_f2c(*fh); - MPI_Datatype c_type = MPI_Type_f2c(*datatype); - MPI_Status *c_status; + MPI_File c_fh = MPI_File_f2c(*fh); + MPI_Datatype c_type = MPI_Type_f2c(*datatype); + MPI_Status *c_status; #if OMPI_SIZEOF_FORTRAN_INT != SIZEOF_INT - MPI_Status c_status2; + MPI_Status c_status2; #endif - /* See if we got MPI_STATUS_IGNORE */ - - if (OMPI_IS_FORTRAN_STATUS_IGNORE(status)) { - c_status = MPI_STATUS_IGNORE; - } else { - - /* If sizeof(int) == sizeof(INTEGER), then there's no - translation necessary -- let the underlying functions write - directly into the Fortran status */ + /* See if we got MPI_STATUS_IGNORE */ + if (OMPI_IS_FORTRAN_STATUS_IGNORE(status)) { + c_status = MPI_STATUS_IGNORE; + } else { + /* If sizeof(int) == sizeof(INTEGER), then there's no + translation necessary -- let the underlying functions write + directly into the Fortran status */ #if OMPI_SIZEOF_FORTRAN_INT == SIZEOF_INT - c_status = (MPI_Status *) status; + c_status = (MPI_Status *) status; #else - c_status = &c_status2; + c_status = &c_status2; #endif - } + } - *ierr = OMPI_INT_2_FINT(MPI_File_read(c_fh, buf, - OMPI_FINT_2_INT(*count), - c_type, c_status)); + *ierr = OMPI_INT_2_FINT(MPI_File_read(c_fh, OMPI_ADDR(buf), + OMPI_FINT_2_INT(*count), + c_type, c_status)); #if OMPI_SIZEOF_FORTRAN_INT != SIZEOF_INT - if (MPI_STATUS_IGNORE != c_status) { - MPI_Status_c2f(c_status, status); - } + if (MPI_STATUS_IGNORE != c_status) { + MPI_Status_c2f(c_status, status); + } #endif } diff --git a/src/mpi/f77/file_read_ordered_begin_f.c b/src/mpi/f77/file_read_ordered_begin_f.c index f231162f0b..e751525779 100644 --- a/src/mpi/f77/file_read_ordered_begin_f.c +++ b/src/mpi/f77/file_read_ordered_begin_f.c @@ -16,8 +16,8 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" +#include "mpi/f77/constants.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER #pragma weak PMPI_FILE_READ_ORDERED_BEGIN = mpi_file_read_ordered_begin_f @@ -59,11 +59,10 @@ OMPI_GENERATE_F77_BINDINGS (MPI_FILE_READ_ORDERED_BEGIN, void mpi_file_read_ordered_begin_f(MPI_Fint *fh, char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *ierr) { - MPI_File c_fh = MPI_File_f2c(*fh); + MPI_File c_fh = MPI_File_f2c(*fh); + MPI_Datatype c_type = MPI_Type_f2c(*datatype); - MPI_Datatype c_type = MPI_Type_f2c(*datatype); - - *ierr = OMPI_INT_2_FINT(MPI_File_read_ordered_begin(c_fh, buf, - OMPI_FINT_2_INT(*count), - c_type)); + *ierr = OMPI_INT_2_FINT(MPI_File_read_ordered_begin(c_fh, OMPI_ADDR(buf), + OMPI_FINT_2_INT(*count), + c_type)); } diff --git a/src/mpi/f77/file_read_ordered_end_f.c b/src/mpi/f77/file_read_ordered_end_f.c index 1e45a3cc9e..86d45491a5 100644 --- a/src/mpi/f77/file_read_ordered_end_f.c +++ b/src/mpi/f77/file_read_ordered_end_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #include "mpi/f77/constants.h" #include "errhandler/errhandler.h" diff --git a/src/mpi/f77/file_read_ordered_f.c b/src/mpi/f77/file_read_ordered_f.c index 57c00065a8..a3d32dd91a 100644 --- a/src/mpi/f77/file_read_ordered_f.c +++ b/src/mpi/f77/file_read_ordered_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #include "mpi/f77/constants.h" #include "errhandler/errhandler.h" @@ -63,39 +62,37 @@ void mpi_file_read_ordered_f(MPI_Fint *fh, char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *status, MPI_Fint *ierr) { - MPI_File c_fh = MPI_File_f2c(*fh); - MPI_Datatype c_type = MPI_Type_f2c(*datatype); - MPI_Status *c_status; + MPI_File c_fh = MPI_File_f2c(*fh); + MPI_Datatype c_type = MPI_Type_f2c(*datatype); + MPI_Status *c_status; #if OMPI_SIZEOF_FORTRAN_INT != SIZEOF_INT - MPI_Status c_status2; + MPI_Status c_status2; #endif - /* See if we got MPI_STATUS_IGNORE */ - - if (OMPI_IS_FORTRAN_STATUS_IGNORE(status)) { - c_status = MPI_STATUS_IGNORE; - } else { - - /* If sizeof(int) == sizeof(INTEGER), then there's no - translation necessary -- let the underlying functions write - directly into the Fortran status */ + /* See if we got MPI_STATUS_IGNORE */ + if (OMPI_IS_FORTRAN_STATUS_IGNORE(status)) { + c_status = MPI_STATUS_IGNORE; + } else { + /* If sizeof(int) == sizeof(INTEGER), then there's no + translation necessary -- let the underlying functions write + directly into the Fortran status */ #if OMPI_SIZEOF_FORTRAN_INT == SIZEOF_INT - c_status = (MPI_Status *) status; + c_status = (MPI_Status *) status; #else - c_status = &c_status2; + c_status = &c_status2; #endif - } + } - *ierr = OMPI_FINT_2_INT(MPI_File_read_ordered(c_fh, - buf, + *ierr = OMPI_FINT_2_INT(MPI_File_read_ordered(c_fh, + OMPI_ADDR(buf), OMPI_FINT_2_INT(*count), c_type, c_status)); #if OMPI_SIZEOF_FORTRAN_INT != SIZEOF_INT - if (MPI_STATUS_IGNORE != c_status) { - MPI_Status_c2f(c_status, status); - } + if (MPI_STATUS_IGNORE != c_status) { + MPI_Status_c2f(c_status, status); + } #endif } diff --git a/src/mpi/f77/file_read_shared_f.c b/src/mpi/f77/file_read_shared_f.c index 4fbd585116..30fb4c3dff 100644 --- a/src/mpi/f77/file_read_shared_f.c +++ b/src/mpi/f77/file_read_shared_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #include "mpi/f77/constants.h" #include "errhandler/errhandler.h" @@ -63,39 +62,37 @@ void mpi_file_read_shared_f(MPI_Fint *fh, char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *status, MPI_Fint *ierr) { - MPI_File c_fh = MPI_File_f2c(*fh); - MPI_Datatype c_type = MPI_Type_f2c(*datatype); - MPI_Status *c_status; + MPI_File c_fh = MPI_File_f2c(*fh); + MPI_Datatype c_type = MPI_Type_f2c(*datatype); + MPI_Status *c_status; #if OMPI_SIZEOF_FORTRAN_INT != SIZEOF_INT - MPI_Status c_status2; + MPI_Status c_status2; #endif - /* See if we got MPI_STATUS_IGNORE */ - - if (OMPI_IS_FORTRAN_STATUS_IGNORE(status)) { - c_status = MPI_STATUS_IGNORE; - } else { - - /* If sizeof(int) == sizeof(INTEGER), then there's no - translation necessary -- let the underlying functions write - directly into the Fortran status */ + /* See if we got MPI_STATUS_IGNORE */ + if (OMPI_IS_FORTRAN_STATUS_IGNORE(status)) { + c_status = MPI_STATUS_IGNORE; + } else { + /* If sizeof(int) == sizeof(INTEGER), then there's no + translation necessary -- let the underlying functions write + directly into the Fortran status */ #if OMPI_SIZEOF_FORTRAN_INT == SIZEOF_INT - c_status = (MPI_Status *) status; + c_status = (MPI_Status *) status; #else - c_status = &c_status2; + c_status = &c_status2; #endif - } + } - *ierr = OMPI_FINT_2_INT(MPI_File_read_shared(c_fh, - buf, - OMPI_FINT_2_INT(*count), - c_type, - c_status)); + *ierr = OMPI_FINT_2_INT(MPI_File_read_shared(c_fh, + OMPI_ADDR(buf), + OMPI_FINT_2_INT(*count), + c_type, + c_status)); #if OMPI_SIZEOF_FORTRAN_INT != SIZEOF_INT - if (MPI_STATUS_IGNORE != c_status) { - MPI_Status_c2f(c_status, status); - } + if (MPI_STATUS_IGNORE != c_status) { + MPI_Status_c2f(c_status, status); + } #endif } diff --git a/src/mpi/f77/file_seek_f.c b/src/mpi/f77/file_seek_f.c index 1be1d1e340..f73a21cc9e 100644 --- a/src/mpi/f77/file_seek_f.c +++ b/src/mpi/f77/file_seek_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/file_seek_shared_f.c b/src/mpi/f77/file_seek_shared_f.c index 42a7d5ea4c..caa6c0810b 100644 --- a/src/mpi/f77/file_seek_shared_f.c +++ b/src/mpi/f77/file_seek_shared_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/file_set_atomicity_f.c b/src/mpi/f77/file_set_atomicity_f.c index a73f84d2be..31042feb85 100644 --- a/src/mpi/f77/file_set_atomicity_f.c +++ b/src/mpi/f77/file_set_atomicity_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/file_set_errhandler_f.c b/src/mpi/f77/file_set_errhandler_f.c index 1614e62494..504677c0ca 100644 --- a/src/mpi/f77/file_set_errhandler_f.c +++ b/src/mpi/f77/file_set_errhandler_f.c @@ -16,9 +16,8 @@ #include "ompi_config.h" -#include "mpi.h" -#include "errhandler/errhandler.h" #include "mpi/f77/bindings.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER #pragma weak PMPI_FILE_SET_ERRHANDLER = mpi_file_set_errhandler_f diff --git a/src/mpi/f77/file_set_info_f.c b/src/mpi/f77/file_set_info_f.c index 47e08b7aad..59516114d8 100644 --- a/src/mpi/f77/file_set_info_f.c +++ b/src/mpi/f77/file_set_info_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/file_set_size_f.c b/src/mpi/f77/file_set_size_f.c index 06ad2d8f6e..930ea2e767 100644 --- a/src/mpi/f77/file_set_size_f.c +++ b/src/mpi/f77/file_set_size_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/file_set_view_f.c b/src/mpi/f77/file_set_view_f.c index e9782d5371..87bcc4cd35 100644 --- a/src/mpi/f77/file_set_view_f.c +++ b/src/mpi/f77/file_set_view_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER @@ -60,12 +59,12 @@ void mpi_file_set_view_f(MPI_Fint *fh, MPI_Offset *disp, MPI_Fint *etype, MPI_Fint *filetype, char *datarep, MPI_Fint *info, MPI_Fint *ierr) { - MPI_File c_fh = MPI_File_f2c(*fh); - MPI_Datatype c_etype = MPI_Type_f2c(*etype); - MPI_Datatype c_filetype = MPI_Type_f2c(*filetype); - MPI_Info c_info = MPI_Info_f2c(*info); + MPI_File c_fh = MPI_File_f2c(*fh); + MPI_Datatype c_etype = MPI_Type_f2c(*etype); + MPI_Datatype c_filetype = MPI_Type_f2c(*filetype); + MPI_Info c_info = MPI_Info_f2c(*info); - *ierr = OMPI_INT_2_FINT(MPI_File_set_view(c_fh, (MPI_Offset) *disp, - c_etype, c_filetype, - datarep, c_info)); + *ierr = OMPI_INT_2_FINT(MPI_File_set_view(c_fh, (MPI_Offset) *disp, + c_etype, c_filetype, + datarep, c_info)); } diff --git a/src/mpi/f77/file_sync_f.c b/src/mpi/f77/file_sync_f.c index 746e777675..13700849c6 100644 --- a/src/mpi/f77/file_sync_f.c +++ b/src/mpi/f77/file_sync_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/file_write_all_begin_f.c b/src/mpi/f77/file_write_all_begin_f.c index dccd3da863..234271367e 100644 --- a/src/mpi/f77/file_write_all_begin_f.c +++ b/src/mpi/f77/file_write_all_begin_f.c @@ -16,8 +16,8 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" +#include "mpi/f77/constants.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER #pragma weak PMPI_FILE_WRITE_ALL_BEGIN = mpi_file_write_all_begin_f @@ -60,10 +60,10 @@ void mpi_file_write_all_begin_f(MPI_Fint *fh, char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *ierr) { - MPI_File c_fh = MPI_File_f2c(*fh); - MPI_Datatype c_type = MPI_Type_f2c(*datatype); + MPI_File c_fh = MPI_File_f2c(*fh); + MPI_Datatype c_type = MPI_Type_f2c(*datatype); - *ierr = OMPI_INT_2_FINT(MPI_File_write_all_begin(c_fh, buf, + *ierr = OMPI_INT_2_FINT(MPI_File_write_all_begin(c_fh, OMPI_ADDR(buf), OMPI_FINT_2_INT(*count), c_type)); } diff --git a/src/mpi/f77/file_write_all_end_f.c b/src/mpi/f77/file_write_all_end_f.c index 796cf4bd9e..82d1a47f64 100644 --- a/src/mpi/f77/file_write_all_end_f.c +++ b/src/mpi/f77/file_write_all_end_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #include "mpi/f77/constants.h" #include "errhandler/errhandler.h" diff --git a/src/mpi/f77/file_write_all_f.c b/src/mpi/f77/file_write_all_f.c index 8339a32c74..65b07d4128 100644 --- a/src/mpi/f77/file_write_all_f.c +++ b/src/mpi/f77/file_write_all_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #include "mpi/f77/constants.h" #include "errhandler/errhandler.h" @@ -62,38 +61,36 @@ OMPI_GENERATE_F77_BINDINGS (MPI_FILE_WRITE_ALL, void mpi_file_write_all_f(MPI_Fint *fh, char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *status, MPI_Fint *ierr) { - MPI_File c_fh = MPI_File_f2c(*fh); - MPI_Datatype c_type = MPI_Type_f2c(*datatype); - MPI_Status *c_status; + MPI_File c_fh = MPI_File_f2c(*fh); + MPI_Datatype c_type = MPI_Type_f2c(*datatype); + MPI_Status *c_status; #if OMPI_SIZEOF_FORTRAN_INT != SIZEOF_INT - MPI_Status c_status2; + MPI_Status c_status2; #endif - /* See if we got MPI_STATUS_IGNORE */ - - if (OMPI_IS_FORTRAN_STATUS_IGNORE(status)) { - c_status = MPI_STATUS_IGNORE; - } else { - - /* If sizeof(int) == sizeof(INTEGER), then there's no - translation necessary -- let the underlying functions write - directly into the Fortran status */ + /* See if we got MPI_STATUS_IGNORE */ + if (OMPI_IS_FORTRAN_STATUS_IGNORE(status)) { + c_status = MPI_STATUS_IGNORE; + } else { + /* If sizeof(int) == sizeof(INTEGER), then there's no + translation necessary -- let the underlying functions write + directly into the Fortran status */ #if OMPI_SIZEOF_FORTRAN_INT == SIZEOF_INT - c_status = (MPI_Status *) status; + c_status = (MPI_Status *) status; #else - c_status = &c_status2; + c_status = &c_status2; #endif - } + } - *ierr = OMPI_INT_2_FINT(MPI_File_write_all(c_fh, buf, + *ierr = OMPI_INT_2_FINT(MPI_File_write_all(c_fh, OMPI_ADDR(buf), OMPI_FINT_2_INT(*count), c_type, c_status)); #if OMPI_SIZEOF_FORTRAN_INT != SIZEOF_INT - if (MPI_STATUS_IGNORE != c_status) { - MPI_Status_c2f(c_status, status); - } + if (MPI_STATUS_IGNORE != c_status) { + MPI_Status_c2f(c_status, status); + } #endif } diff --git a/src/mpi/f77/file_write_at_all_begin_f.c b/src/mpi/f77/file_write_at_all_begin_f.c index 01d410b032..0b0d9db537 100644 --- a/src/mpi/f77/file_write_at_all_begin_f.c +++ b/src/mpi/f77/file_write_at_all_begin_f.c @@ -16,8 +16,8 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" +#include "mpi/f77/constants.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER #pragma weak PMPI_FILE_WRITE_AT_ALL_BEGIN = mpi_file_write_at_all_begin_f @@ -60,12 +60,12 @@ void mpi_file_write_at_all_begin_f(MPI_Fint *fh, MPI_Offset *offset, char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *ierr) { - MPI_File c_fh = MPI_File_f2c(*fh); - MPI_Datatype c_type = MPI_Type_f2c(*datatype); + MPI_File c_fh = MPI_File_f2c(*fh); + MPI_Datatype c_type = MPI_Type_f2c(*datatype); - *ierr = OMPI_FINT_2_INT(MPI_File_write_at_all_begin(c_fh, + *ierr = OMPI_FINT_2_INT(MPI_File_write_at_all_begin(c_fh, (MPI_Offset) *offset, - buf, + OMPI_ADDR(buf), OMPI_FINT_2_INT(*count), c_type)); } diff --git a/src/mpi/f77/file_write_at_all_end_f.c b/src/mpi/f77/file_write_at_all_end_f.c index 304b0ed7a0..b5ed7a16fa 100644 --- a/src/mpi/f77/file_write_at_all_end_f.c +++ b/src/mpi/f77/file_write_at_all_end_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #include "mpi/f77/constants.h" #include "errhandler/errhandler.h" diff --git a/src/mpi/f77/file_write_at_all_f.c b/src/mpi/f77/file_write_at_all_f.c index 67316ba6f0..c7779a41fb 100644 --- a/src/mpi/f77/file_write_at_all_f.c +++ b/src/mpi/f77/file_write_at_all_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #include "mpi/f77/constants.h" #include "errhandler/errhandler.h" @@ -64,40 +63,38 @@ void mpi_file_write_at_all_f(MPI_Fint *fh, MPI_Offset *offset, MPI_Fint *datatype, MPI_Fint *status, MPI_Fint *ierr) { - MPI_File c_fh = MPI_File_f2c(*fh); - MPI_Datatype c_type = MPI_Type_f2c(*datatype); - MPI_Status *c_status; + MPI_File c_fh = MPI_File_f2c(*fh); + MPI_Datatype c_type = MPI_Type_f2c(*datatype); + MPI_Status *c_status; #if OMPI_SIZEOF_FORTRAN_INT != SIZEOF_INT - MPI_Status c_status2; + MPI_Status c_status2; #endif - /* See if we got MPI_STATUS_IGNORE */ - - if (OMPI_IS_FORTRAN_STATUS_IGNORE(status)) { - c_status = MPI_STATUS_IGNORE; - } else { - - /* If sizeof(int) == sizeof(INTEGER), then there's no - translation necessary -- let the underlying functions write - directly into the Fortran status */ + /* See if we got MPI_STATUS_IGNORE */ + if (OMPI_IS_FORTRAN_STATUS_IGNORE(status)) { + c_status = MPI_STATUS_IGNORE; + } else { + /* If sizeof(int) == sizeof(INTEGER), then there's no + translation necessary -- let the underlying functions write + directly into the Fortran status */ #if OMPI_SIZEOF_FORTRAN_INT == SIZEOF_INT - c_status = (MPI_Status *) status; + c_status = (MPI_Status *) status; #else - c_status = &c_status2; + c_status = &c_status2; #endif - } + } - *ierr = OMPI_FINT_2_INT(MPI_File_write_at_all(c_fh, + *ierr = OMPI_FINT_2_INT(MPI_File_write_at_all(c_fh, (MPI_Offset) *offset, - buf, + OMPI_ADDR(buf), OMPI_FINT_2_INT(*count), c_type, c_status)); - + #if OMPI_SIZEOF_FORTRAN_INT != SIZEOF_INT - if (MPI_STATUS_IGNORE != c_status) { - MPI_Status_c2f(c_status, status); - } + if (MPI_STATUS_IGNORE != c_status) { + MPI_Status_c2f(c_status, status); + } #endif } diff --git a/src/mpi/f77/file_write_at_f.c b/src/mpi/f77/file_write_at_f.c index 3fb0c0fb31..60528a0405 100644 --- a/src/mpi/f77/file_write_at_f.c +++ b/src/mpi/f77/file_write_at_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #include "mpi/f77/constants.h" #include "errhandler/errhandler.h" @@ -62,39 +61,37 @@ void mpi_file_write_at_f(MPI_Fint *fh, MPI_Offset *offset, char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *status, MPI_Fint *ierr) { - MPI_File c_fh = MPI_File_f2c(*fh); - MPI_Datatype c_type = MPI_Type_f2c(*datatype); - MPI_Status *c_status; + MPI_File c_fh = MPI_File_f2c(*fh); + MPI_Datatype c_type = MPI_Type_f2c(*datatype); + MPI_Status *c_status; #if OMPI_SIZEOF_FORTRAN_INT != SIZEOF_INT - MPI_Status c_status2; + MPI_Status c_status2; #endif - /* See if we got MPI_STATUS_IGNORE */ - - if (OMPI_IS_FORTRAN_STATUS_IGNORE(status)) { - c_status = MPI_STATUS_IGNORE; - } else { - - /* If sizeof(int) == sizeof(INTEGER), then there's no - translation necessary -- let the underlying functions write - directly into the Fortran status */ + /* See if we got MPI_STATUS_IGNORE */ + if (OMPI_IS_FORTRAN_STATUS_IGNORE(status)) { + c_status = MPI_STATUS_IGNORE; + } else { + /* If sizeof(int) == sizeof(INTEGER), then there's no + translation necessary -- let the underlying functions write + directly into the Fortran status */ #if OMPI_SIZEOF_FORTRAN_INT == SIZEOF_INT - c_status = (MPI_Status *) status; + c_status = (MPI_Status *) status; #else - c_status = &c_status2; + c_status = &c_status2; #endif - } + } - *ierr = OMPI_FINT_2_INT(MPI_File_write_at(c_fh, - (MPI_Offset) *offset, - buf, - OMPI_FINT_2_INT(*count), - c_type, c_status)); + *ierr = OMPI_FINT_2_INT(MPI_File_write_at(c_fh, + (MPI_Offset) *offset, + OMPI_ADDR(buf), + OMPI_FINT_2_INT(*count), + c_type, c_status)); #if OMPI_SIZEOF_FORTRAN_INT != SIZEOF_INT - if (MPI_STATUS_IGNORE != c_status) { - MPI_Status_c2f(c_status, status); - } + if (MPI_STATUS_IGNORE != c_status) { + MPI_Status_c2f(c_status, status); + } #endif } diff --git a/src/mpi/f77/file_write_f.c b/src/mpi/f77/file_write_f.c index 36e3911059..a8a6b11e81 100644 --- a/src/mpi/f77/file_write_f.c +++ b/src/mpi/f77/file_write_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #include "mpi/f77/constants.h" #include "errhandler/errhandler.h" @@ -62,37 +61,35 @@ OMPI_GENERATE_F77_BINDINGS (MPI_FILE_WRITE, void mpi_file_write_f(MPI_Fint *fh, char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *status, MPI_Fint *ierr) { - MPI_File c_fh = MPI_File_f2c(*fh); - MPI_Datatype c_type = MPI_Type_f2c(*datatype); - MPI_Status *c_status; + MPI_File c_fh = MPI_File_f2c(*fh); + MPI_Datatype c_type = MPI_Type_f2c(*datatype); + MPI_Status *c_status; #if OMPI_SIZEOF_FORTRAN_INT != SIZEOF_INT - MPI_Status c_status2; + MPI_Status c_status2; #endif - /* See if we got MPI_STATUS_IGNORE */ - - if (OMPI_IS_FORTRAN_STATUS_IGNORE(status)) { - c_status = MPI_STATUS_IGNORE; - } else { - - /* If sizeof(int) == sizeof(INTEGER), then there's no - translation necessary -- let the underlying functions write - directly into the Fortran status */ + /* See if we got MPI_STATUS_IGNORE */ + if (OMPI_IS_FORTRAN_STATUS_IGNORE(status)) { + c_status = MPI_STATUS_IGNORE; + } else { + /* If sizeof(int) == sizeof(INTEGER), then there's no + translation necessary -- let the underlying functions write + directly into the Fortran status */ #if OMPI_SIZEOF_FORTRAN_INT == SIZEOF_INT - c_status = (MPI_Status *) status; + c_status = (MPI_Status *) status; #else - c_status = &c_status2; + c_status = &c_status2; #endif - } + } - *ierr = OMPI_INT_2_FINT(MPI_File_write(c_fh, buf, - OMPI_FINT_2_INT(*count), - c_type, c_status)); - + *ierr = OMPI_INT_2_FINT(MPI_File_write(c_fh, OMPI_ADDR(buf), + OMPI_FINT_2_INT(*count), + c_type, c_status)); + #if OMPI_SIZEOF_FORTRAN_INT != SIZEOF_INT - if (MPI_STATUS_IGNORE != c_status) { - MPI_Status_c2f(c_status, status); - } + if (MPI_STATUS_IGNORE != c_status) { + MPI_Status_c2f(c_status, status); + } #endif } diff --git a/src/mpi/f77/file_write_ordered_begin_f.c b/src/mpi/f77/file_write_ordered_begin_f.c index 653401a255..b6a406012a 100644 --- a/src/mpi/f77/file_write_ordered_begin_f.c +++ b/src/mpi/f77/file_write_ordered_begin_f.c @@ -16,8 +16,8 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" +#include "mpi/f77/constants.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER #pragma weak PMPI_FILE_WRITE_ORDERED_BEGIN = mpi_file_write_ordered_begin_f @@ -60,11 +60,10 @@ void mpi_file_write_ordered_begin_f(MPI_Fint *fh, char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *ierr) { - MPI_File c_fh = MPI_File_f2c(*fh); + MPI_File c_fh = MPI_File_f2c(*fh); + MPI_Datatype c_type = MPI_Type_f2c(*datatype); - MPI_Datatype c_type = MPI_Type_f2c(*datatype); - - *ierr = OMPI_INT_2_FINT(MPI_File_write_ordered_begin(c_fh, buf, - OMPI_FINT_2_INT(*count), - c_type)); + *ierr = OMPI_INT_2_FINT(MPI_File_write_ordered_begin(c_fh, OMPI_ADDR(buf), + OMPI_FINT_2_INT(*count), + c_type)); } diff --git a/src/mpi/f77/file_write_ordered_end_f.c b/src/mpi/f77/file_write_ordered_end_f.c index d7477fff09..a5ea923d0e 100644 --- a/src/mpi/f77/file_write_ordered_end_f.c +++ b/src/mpi/f77/file_write_ordered_end_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #include "mpi/f77/constants.h" #include "errhandler/errhandler.h" diff --git a/src/mpi/f77/file_write_ordered_f.c b/src/mpi/f77/file_write_ordered_f.c index 3b66d09bed..47dc2efd4f 100644 --- a/src/mpi/f77/file_write_ordered_f.c +++ b/src/mpi/f77/file_write_ordered_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #include "mpi/f77/constants.h" #include "errhandler/errhandler.h" @@ -63,39 +62,37 @@ void mpi_file_write_ordered_f(MPI_Fint *fh, char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *status, MPI_Fint *ierr) { - MPI_File c_fh = MPI_File_f2c(*fh); - MPI_Datatype c_type = MPI_Type_f2c(*datatype); - MPI_Status *c_status; + MPI_File c_fh = MPI_File_f2c(*fh); + MPI_Datatype c_type = MPI_Type_f2c(*datatype); + MPI_Status *c_status; #if OMPI_SIZEOF_FORTRAN_INT != SIZEOF_INT - MPI_Status c_status2; + MPI_Status c_status2; #endif - /* See if we got MPI_STATUS_IGNORE */ - - if (OMPI_IS_FORTRAN_STATUS_IGNORE(status)) { - c_status = MPI_STATUS_IGNORE; - } else { - - /* If sizeof(int) == sizeof(INTEGER), then there's no - translation necessary -- let the underlying functions write - directly into the Fortran status */ + /* See if we got MPI_STATUS_IGNORE */ + if (OMPI_IS_FORTRAN_STATUS_IGNORE(status)) { + c_status = MPI_STATUS_IGNORE; + } else { + /* If sizeof(int) == sizeof(INTEGER), then there's no + translation necessary -- let the underlying functions write + directly into the Fortran status */ #if OMPI_SIZEOF_FORTRAN_INT == SIZEOF_INT - c_status = (MPI_Status *) status; + c_status = (MPI_Status *) status; #else - c_status = &c_status2; + c_status = &c_status2; #endif - } - - *ierr = OMPI_FINT_2_INT(MPI_File_write_ordered(c_fh, - buf, - OMPI_FINT_2_INT(*count), - c_type, - c_status)); + } + *ierr = OMPI_FINT_2_INT(MPI_File_write_ordered(c_fh, + OMPI_ADDR(buf), + OMPI_FINT_2_INT(*count), + c_type, + c_status)); + #if OMPI_SIZEOF_FORTRAN_INT != SIZEOF_INT - if (MPI_STATUS_IGNORE != c_status) { - MPI_Status_c2f(c_status, status); - } + if (MPI_STATUS_IGNORE != c_status) { + MPI_Status_c2f(c_status, status); + } #endif } diff --git a/src/mpi/f77/file_write_shared_f.c b/src/mpi/f77/file_write_shared_f.c index c6b751013b..1a806e56af 100644 --- a/src/mpi/f77/file_write_shared_f.c +++ b/src/mpi/f77/file_write_shared_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #include "mpi/f77/constants.h" #include "errhandler/errhandler.h" @@ -63,39 +62,37 @@ void mpi_file_write_shared_f(MPI_Fint *fh, char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *status, MPI_Fint *ierr) { - MPI_File c_fh = MPI_File_f2c(*fh); - MPI_Datatype c_type = MPI_Type_f2c(*datatype); - MPI_Status *c_status; + MPI_File c_fh = MPI_File_f2c(*fh); + MPI_Datatype c_type = MPI_Type_f2c(*datatype); + MPI_Status *c_status; #if OMPI_SIZEOF_FORTRAN_INT != SIZEOF_INT - MPI_Status c_status2; + MPI_Status c_status2; #endif - /* See if we got MPI_STATUS_IGNORE */ - - if (OMPI_IS_FORTRAN_STATUS_IGNORE(status)) { - c_status = MPI_STATUS_IGNORE; - } else { - - /* If sizeof(int) == sizeof(INTEGER), then there's no - translation necessary -- let the underlying functions write - directly into the Fortran status */ + /* See if we got MPI_STATUS_IGNORE */ + if (OMPI_IS_FORTRAN_STATUS_IGNORE(status)) { + c_status = MPI_STATUS_IGNORE; + } else { + /* If sizeof(int) == sizeof(INTEGER), then there's no + translation necessary -- let the underlying functions write + directly into the Fortran status */ #if OMPI_SIZEOF_FORTRAN_INT == SIZEOF_INT - c_status = (MPI_Status *) status; + c_status = (MPI_Status *) status; #else - c_status = &c_status2; + c_status = &c_status2; #endif - } - - *ierr = OMPI_FINT_2_INT(MPI_File_write_shared(c_fh, - buf, - OMPI_FINT_2_INT(*count), - c_type, - c_status)); + } + *ierr = OMPI_FINT_2_INT(MPI_File_write_shared(c_fh, + OMPI_ADDR(buf), + OMPI_FINT_2_INT(*count), + c_type, + c_status)); + #if OMPI_SIZEOF_FORTRAN_INT != SIZEOF_INT - if (MPI_STATUS_IGNORE != c_status) { - MPI_Status_c2f(c_status, status); - } + if (MPI_STATUS_IGNORE != c_status) { + MPI_Status_c2f(c_status, status); + } #endif } diff --git a/src/mpi/f77/finalize_f.c b/src/mpi/f77/finalize_f.c index 1d4903f2f7..7f09147f7a 100644 --- a/src/mpi/f77/finalize_f.c +++ b/src/mpi/f77/finalize_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/finalized_f.c b/src/mpi/f77/finalized_f.c index ff13c9c3a0..220b45d918 100644 --- a/src/mpi/f77/finalized_f.c +++ b/src/mpi/f77/finalized_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/free_mem_f.c b/src/mpi/f77/free_mem_f.c index a8fd4316fd..d375c7059a 100644 --- a/src/mpi/f77/free_mem_f.c +++ b/src/mpi/f77/free_mem_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/gather_f.c b/src/mpi/f77/gather_f.c index 1c6c784d49..56a1c5be3c 100644 --- a/src/mpi/f77/gather_f.c +++ b/src/mpi/f77/gather_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/gatherv_f.c b/src/mpi/f77/gatherv_f.c index ac20e36221..f89e77ebe3 100644 --- a/src/mpi/f77/gatherv_f.c +++ b/src/mpi/f77/gatherv_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/get_address_f.c b/src/mpi/f77/get_address_f.c index 3f7ffa71bc..4932625e55 100644 --- a/src/mpi/f77/get_address_f.c +++ b/src/mpi/f77/get_address_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/get_count_f.c b/src/mpi/f77/get_count_f.c index 14e0e647b5..e0ef3c65ea 100644 --- a/src/mpi/f77/get_count_f.c +++ b/src/mpi/f77/get_count_f.c @@ -16,8 +16,8 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" +#include "mpi/f77/constants.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER #pragma weak PMPI_GET_COUNT = mpi_get_count_f @@ -62,11 +62,16 @@ void mpi_get_count_f(MPI_Fint *status, MPI_Fint *datatype, MPI_Fint *count, MPI_ MPI_Status c_status; OMPI_SINGLE_NAME_DECL(count); - *ierr = OMPI_INT_2_FINT(MPI_Status_f2c(status, &c_status)); + if (OMPI_IS_FORTRAN_STATUS_IGNORE(status)) { + *count = OMPI_INT_2_FINT(0); + *ierr = OMPI_INT_2_FINT(MPI_SUCCESS); + } else { + *ierr = OMPI_INT_2_FINT(MPI_Status_f2c(status, &c_status)); - if (MPI_SUCCESS == OMPI_FINT_2_INT(*ierr)) { - *ierr = OMPI_INT_2_FINT(MPI_Get_count(&c_status, c_type, - OMPI_SINGLE_NAME_CONVERT(count))); - OMPI_SINGLE_INT_2_FINT(count); + if (MPI_SUCCESS == OMPI_FINT_2_INT(*ierr)) { + *ierr = OMPI_INT_2_FINT(MPI_Get_count(&c_status, c_type, + OMPI_SINGLE_NAME_CONVERT(count))); + OMPI_SINGLE_INT_2_FINT(count); + } } } diff --git a/src/mpi/f77/get_elements_f.c b/src/mpi/f77/get_elements_f.c index 433068fab2..a70bbcec51 100644 --- a/src/mpi/f77/get_elements_f.c +++ b/src/mpi/f77/get_elements_f.c @@ -16,8 +16,8 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" +#include "mpi/f77/constants.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER #pragma weak PMPI_GET_ELEMENTS = mpi_get_elements_f @@ -62,12 +62,16 @@ void mpi_get_elements_f(MPI_Fint *status, MPI_Fint *datatype, MPI_Fint *count, M MPI_Status c_status; OMPI_SINGLE_NAME_DECL(count); - *ierr = MPI_Status_f2c(status, &c_status); + if (OMPI_IS_FORTRAN_STATUS_IGNORE(status)) { + *count = OMPI_INT_2_FINT(0); + *ierr = OMPI_INT_2_FINT(MPI_SUCCESS); + } else { + *ierr = MPI_Status_f2c(status, &c_status); - if (MPI_SUCCESS == *ierr) { - *ierr = OMPI_INT_2_FINT(MPI_Get_elements(&c_status, c_type, - OMPI_SINGLE_NAME_CONVERT(count) - )); - OMPI_SINGLE_INT_2_FINT(count); + if (MPI_SUCCESS == *ierr) { + *ierr = OMPI_INT_2_FINT(MPI_Get_elements(&c_status, c_type, + OMPI_SINGLE_NAME_CONVERT(count))); + OMPI_SINGLE_INT_2_FINT(count); + } } } diff --git a/src/mpi/f77/get_f.c b/src/mpi/f77/get_f.c index 2adaf3410a..5a822563ac 100644 --- a/src/mpi/f77/get_f.c +++ b/src/mpi/f77/get_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER @@ -65,7 +64,7 @@ void mpi_get_f(char *origin_addr, MPI_Fint *origin_count, MPI_Datatype c_target_datatype = MPI_Type_f2c(*target_datatype); MPI_Win c_win = MPI_Win_f2c(*win); - *ierr = OMPI_INT_2_FINT(MPI_Get(origin_addr, + *ierr = OMPI_INT_2_FINT(MPI_Get(OMPI_ADDR(origin_addr), OMPI_FINT_2_INT(*origin_count), c_origin_datatype, OMPI_FINT_2_INT(*target_rank), diff --git a/src/mpi/f77/get_processor_name_f.c b/src/mpi/f77/get_processor_name_f.c index 9b7b69599f..a5cde2770e 100644 --- a/src/mpi/f77/get_processor_name_f.c +++ b/src/mpi/f77/get_processor_name_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/get_version_f.c b/src/mpi/f77/get_version_f.c index 27fa6ce314..a49c1c03c6 100644 --- a/src/mpi/f77/get_version_f.c +++ b/src/mpi/f77/get_version_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/graph_create_f.c b/src/mpi/f77/graph_create_f.c index bc82434b30..1d722834ab 100644 --- a/src/mpi/f77/graph_create_f.c +++ b/src/mpi/f77/graph_create_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/graph_get_f.c b/src/mpi/f77/graph_get_f.c index 465a2eea51..7f8fa23372 100644 --- a/src/mpi/f77/graph_get_f.c +++ b/src/mpi/f77/graph_get_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/graph_map_f.c b/src/mpi/f77/graph_map_f.c index 316257dbde..80c1e692e1 100644 --- a/src/mpi/f77/graph_map_f.c +++ b/src/mpi/f77/graph_map_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/graph_neighbors_count_f.c b/src/mpi/f77/graph_neighbors_count_f.c index d14abdba65..209d7fa62d 100644 --- a/src/mpi/f77/graph_neighbors_count_f.c +++ b/src/mpi/f77/graph_neighbors_count_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/graph_neighbors_f.c b/src/mpi/f77/graph_neighbors_f.c index 89451082e0..a01e67ce2c 100644 --- a/src/mpi/f77/graph_neighbors_f.c +++ b/src/mpi/f77/graph_neighbors_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/graphdims_get_f.c b/src/mpi/f77/graphdims_get_f.c index 33484592cd..6d230c8a60 100644 --- a/src/mpi/f77/graphdims_get_f.c +++ b/src/mpi/f77/graphdims_get_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/grequest_complete_f.c b/src/mpi/f77/grequest_complete_f.c index f49ed6a570..18af7d04e1 100644 --- a/src/mpi/f77/grequest_complete_f.c +++ b/src/mpi/f77/grequest_complete_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/grequest_start_f.c b/src/mpi/f77/grequest_start_f.c index 1205a6d8b9..7be7371385 100644 --- a/src/mpi/f77/grequest_start_f.c +++ b/src/mpi/f77/grequest_start_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER @@ -30,7 +29,7 @@ OMPI_GENERATE_F77_BINDINGS (PMPI_GREQUEST_START, pmpi_grequest_start_, pmpi_grequest_start__, pmpi_grequest_start_f, - (void *query_fn, void *free_fn, void *cancel_fn, char *extra_state, MPI_Fint *request, MPI_Fint *ierr), + (MPI_F_Grequest_query_function* query_fn, MPI_F_Grequest_free_function* free_fn, MPI_F_Grequest_cancel_function* cancel_fn, char *extra_state, MPI_Fint *request, MPI_Fint *ierr), (query_fn, free_fn, cancel_fn, extra_state, request, ierr) ) #endif @@ -47,7 +46,7 @@ OMPI_GENERATE_F77_BINDINGS (MPI_GREQUEST_START, mpi_grequest_start_, mpi_grequest_start__, mpi_grequest_start_f, - (void *query_fn, void *free_fn, void *cancel_fn, char *extra_state, MPI_Fint *request, MPI_Fint *ierr), + (MPI_F_Grequest_query_function* query_fn, MPI_F_Grequest_free_function* free_fn, MPI_F_Grequest_cancel_function* cancel_fn, char *extra_state, MPI_Fint *request, MPI_Fint *ierr), (query_fn, free_fn, cancel_fn, extra_state, request, ierr) ) #endif @@ -56,8 +55,10 @@ OMPI_GENERATE_F77_BINDINGS (MPI_GREQUEST_START, #include "mpi/f77/profile/defines.h" #endif -void mpi_grequest_start_f(void *query_fn, void *free_fn, - void *cancel_fn, char *extra_state, +void mpi_grequest_start_f(MPI_F_Grequest_query_function* query_fn, + MPI_F_Grequest_free_function* free_fn, + MPI_F_Grequest_cancel_function* cancel_fn, + char *extra_state, MPI_Fint *request, MPI_Fint *ierr) { MPI_Request c_req; diff --git a/src/mpi/f77/group_compare_f.c b/src/mpi/f77/group_compare_f.c index d0ae3de2bd..f7746603d9 100644 --- a/src/mpi/f77/group_compare_f.c +++ b/src/mpi/f77/group_compare_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #include "group/group.h" diff --git a/src/mpi/f77/group_difference_f.c b/src/mpi/f77/group_difference_f.c index 16a4e15747..930454b4ed 100644 --- a/src/mpi/f77/group_difference_f.c +++ b/src/mpi/f77/group_difference_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #include "group/group.h" diff --git a/src/mpi/f77/group_excl_f.c b/src/mpi/f77/group_excl_f.c index 2d90373dfb..4402fc9dc9 100644 --- a/src/mpi/f77/group_excl_f.c +++ b/src/mpi/f77/group_excl_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #include "group/group.h" diff --git a/src/mpi/f77/group_free_f.c b/src/mpi/f77/group_free_f.c index 628bd3a875..8ecae34f7a 100644 --- a/src/mpi/f77/group_free_f.c +++ b/src/mpi/f77/group_free_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #include "group/group.h" diff --git a/src/mpi/f77/group_incl_f.c b/src/mpi/f77/group_incl_f.c index 1cc4e3201a..4b0c500767 100644 --- a/src/mpi/f77/group_incl_f.c +++ b/src/mpi/f77/group_incl_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #include "group/group.h" diff --git a/src/mpi/f77/group_intersection_f.c b/src/mpi/f77/group_intersection_f.c index b6d1b973b6..bde0e2790c 100644 --- a/src/mpi/f77/group_intersection_f.c +++ b/src/mpi/f77/group_intersection_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #include "group/group.h" diff --git a/src/mpi/f77/group_range_excl_f.c b/src/mpi/f77/group_range_excl_f.c index ca80b84505..e67c5c746d 100644 --- a/src/mpi/f77/group_range_excl_f.c +++ b/src/mpi/f77/group_range_excl_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #include "group/group.h" diff --git a/src/mpi/f77/group_range_incl_f.c b/src/mpi/f77/group_range_incl_f.c index 9f8aecb0d1..c7014688ac 100644 --- a/src/mpi/f77/group_range_incl_f.c +++ b/src/mpi/f77/group_range_incl_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #include "group/group.h" diff --git a/src/mpi/f77/group_rank_f.c b/src/mpi/f77/group_rank_f.c index 35f7bb06c7..ebb43a6fa5 100644 --- a/src/mpi/f77/group_rank_f.c +++ b/src/mpi/f77/group_rank_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #include "group/group.h" diff --git a/src/mpi/f77/group_size_f.c b/src/mpi/f77/group_size_f.c index 451ee9ff47..d806e3e97f 100644 --- a/src/mpi/f77/group_size_f.c +++ b/src/mpi/f77/group_size_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #include "group/group.h" diff --git a/src/mpi/f77/group_translate_ranks_f.c b/src/mpi/f77/group_translate_ranks_f.c index b801e66878..49f135c887 100644 --- a/src/mpi/f77/group_translate_ranks_f.c +++ b/src/mpi/f77/group_translate_ranks_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #include "group/group.h" diff --git a/src/mpi/f77/group_union_f.c b/src/mpi/f77/group_union_f.c index 326ea719a2..0c98368b10 100644 --- a/src/mpi/f77/group_union_f.c +++ b/src/mpi/f77/group_union_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #include "group/group.h" diff --git a/src/mpi/f77/ibsend_f.c b/src/mpi/f77/ibsend_f.c index 161e456e1a..00379ee43e 100644 --- a/src/mpi/f77/ibsend_f.c +++ b/src/mpi/f77/ibsend_f.c @@ -16,8 +16,8 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" +#include "mpi/f77/constants.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER #pragma weak PMPI_IBSEND = mpi_ibsend_f @@ -60,18 +60,18 @@ void mpi_ibsend_f(char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr) { - MPI_Datatype c_type = MPI_Type_f2c(*datatype); - MPI_Request c_req; - MPI_Comm c_comm; + MPI_Datatype c_type = MPI_Type_f2c(*datatype); + MPI_Request c_req; + MPI_Comm c_comm; - c_comm = MPI_Comm_f2c (*comm); + c_comm = MPI_Comm_f2c (*comm); - *ierr = OMPI_INT_2_FINT(MPI_Ibsend(buf, OMPI_FINT_2_INT(*count), - c_type, OMPI_FINT_2_INT(*dest), - OMPI_FINT_2_INT(*tag), - c_comm, &c_req)); + *ierr = OMPI_INT_2_FINT(MPI_Ibsend(OMPI_ADDR(buf), OMPI_FINT_2_INT(*count), + c_type, OMPI_FINT_2_INT(*dest), + OMPI_FINT_2_INT(*tag), + c_comm, &c_req)); - if (MPI_SUCCESS == *ierr) { - *request = MPI_Request_c2f(c_req); - } + if (MPI_SUCCESS == *ierr) { + *request = MPI_Request_c2f(c_req); + } } diff --git a/src/mpi/f77/info_create_f.c b/src/mpi/f77/info_create_f.c index b032130d21..972dc44f2d 100644 --- a/src/mpi/f77/info_create_f.c +++ b/src/mpi/f77/info_create_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/info_delete_f.c b/src/mpi/f77/info_delete_f.c index 2e5dbf3ccf..b0313b58ca 100644 --- a/src/mpi/f77/info_delete_f.c +++ b/src/mpi/f77/info_delete_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/info_dup_f.c b/src/mpi/f77/info_dup_f.c index 5edfce740c..5bf3d96b04 100644 --- a/src/mpi/f77/info_dup_f.c +++ b/src/mpi/f77/info_dup_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/info_free_f.c b/src/mpi/f77/info_free_f.c index dee1cbf51a..346e3d0564 100644 --- a/src/mpi/f77/info_free_f.c +++ b/src/mpi/f77/info_free_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/info_get_f.c b/src/mpi/f77/info_get_f.c index 67afdd83ff..0e3bdb777c 100644 --- a/src/mpi/f77/info_get_f.c +++ b/src/mpi/f77/info_get_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/info_get_nkeys_f.c b/src/mpi/f77/info_get_nkeys_f.c index da44d19cb5..a0aa32407b 100644 --- a/src/mpi/f77/info_get_nkeys_f.c +++ b/src/mpi/f77/info_get_nkeys_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/info_get_nthkey_f.c b/src/mpi/f77/info_get_nthkey_f.c index a5ee2b4b7f..37c5aa7727 100644 --- a/src/mpi/f77/info_get_nthkey_f.c +++ b/src/mpi/f77/info_get_nthkey_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/info_get_valuelen_f.c b/src/mpi/f77/info_get_valuelen_f.c index 2d86fbb8a3..ffcc7eeb0f 100644 --- a/src/mpi/f77/info_get_valuelen_f.c +++ b/src/mpi/f77/info_get_valuelen_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/info_set_f.c b/src/mpi/f77/info_set_f.c index 7f229824f3..279744cbc9 100644 --- a/src/mpi/f77/info_set_f.c +++ b/src/mpi/f77/info_set_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/init_f.c b/src/mpi/f77/init_f.c index 1d521419e3..3ba8d7755b 100644 --- a/src/mpi/f77/init_f.c +++ b/src/mpi/f77/init_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/init_thread_f.c b/src/mpi/f77/init_thread_f.c index 8faf581cc2..e3e97439af 100644 --- a/src/mpi/f77/init_thread_f.c +++ b/src/mpi/f77/init_thread_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/initialized_f.c b/src/mpi/f77/initialized_f.c index 44333b2408..be7ba7b941 100644 --- a/src/mpi/f77/initialized_f.c +++ b/src/mpi/f77/initialized_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/intercomm_create_f.c b/src/mpi/f77/intercomm_create_f.c index dfda0638d5..badf83d4e8 100644 --- a/src/mpi/f77/intercomm_create_f.c +++ b/src/mpi/f77/intercomm_create_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/intercomm_merge_f.c b/src/mpi/f77/intercomm_merge_f.c index c3583f854f..4fbe1289cb 100644 --- a/src/mpi/f77/intercomm_merge_f.c +++ b/src/mpi/f77/intercomm_merge_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/iprobe_f.c b/src/mpi/f77/iprobe_f.c index d7dc37d466..2fcba924e7 100644 --- a/src/mpi/f77/iprobe_f.c +++ b/src/mpi/f77/iprobe_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #include "mpi/f77/constants.h" #include "errhandler/errhandler.h" @@ -64,7 +63,6 @@ void mpi_iprobe_f(MPI_Fint *source, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *flag, MPI_Fint *status, MPI_Fint *ierr) { MPI_Status *c_status; - int c_err; MPI_Comm c_comm; #if OMPI_SIZEOF_FORTRAN_INT != SIZEOF_INT MPI_Status c_status2; @@ -73,19 +71,7 @@ void mpi_iprobe_f(MPI_Fint *source, MPI_Fint *tag, MPI_Fint *comm, c_comm = MPI_Comm_f2c (*comm); - /* Only check for the bad value if we're checking MPI parameters */ - - if (MPI_PARAM_CHECK) { - if (OMPI_IS_FORTRAN_STATUSES_IGNORE(status)) { - c_err = OMPI_ERRHANDLER_INVOKE(c_comm, MPI_ERR_ARG, - "MPI_RECV"); - *ierr = OMPI_INT_2_FINT(c_err); - return; - } - } - /* See if we got MPI_STATUS_IGNORE */ - if (OMPI_IS_FORTRAN_STATUS_IGNORE(status)) { c_status = MPI_STATUS_IGNORE; } else { diff --git a/src/mpi/f77/irecv_f.c b/src/mpi/f77/irecv_f.c index a40a520b4f..2eb4e8ca1d 100644 --- a/src/mpi/f77/irecv_f.c +++ b/src/mpi/f77/irecv_f.c @@ -16,8 +16,8 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" +#include "mpi/f77/constants.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER #pragma weak PMPI_IRECV = mpi_irecv_f @@ -60,17 +60,17 @@ void mpi_irecv_f(char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *source, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr) { - MPI_Datatype c_type = MPI_Type_f2c(*datatype); - MPI_Request c_req; - MPI_Comm c_comm; + MPI_Datatype c_type = MPI_Type_f2c(*datatype); + MPI_Request c_req; + MPI_Comm c_comm; - c_comm = MPI_Comm_f2c (*comm); + c_comm = MPI_Comm_f2c (*comm); - *ierr = OMPI_INT_2_FINT(MPI_Irecv(buf, OMPI_FINT_2_INT(*count), - c_type, OMPI_FINT_2_INT(*source), - OMPI_FINT_2_INT(*tag), c_comm, &c_req)); + *ierr = OMPI_INT_2_FINT(MPI_Irecv(OMPI_ADDR(buf), OMPI_FINT_2_INT(*count), + c_type, OMPI_FINT_2_INT(*source), + OMPI_FINT_2_INT(*tag), c_comm, &c_req)); - if (MPI_SUCCESS == *ierr) { - *request = MPI_Request_c2f(c_req); - } + if (MPI_SUCCESS == *ierr) { + *request = MPI_Request_c2f(c_req); + } } diff --git a/src/mpi/f77/irsend_f.c b/src/mpi/f77/irsend_f.c index ce8da776a5..9bb0ad1fb2 100644 --- a/src/mpi/f77/irsend_f.c +++ b/src/mpi/f77/irsend_f.c @@ -16,8 +16,8 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" +#include "mpi/f77/constants.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER #pragma weak PMPI_IRSEND = mpi_irsend_f @@ -58,18 +58,18 @@ OMPI_GENERATE_F77_BINDINGS (MPI_IRSEND, void mpi_irsend_f(char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr) { - MPI_Datatype c_type = MPI_Type_f2c(*datatype); - MPI_Request c_req; - MPI_Comm c_comm; + MPI_Datatype c_type = MPI_Type_f2c(*datatype); + MPI_Request c_req; + MPI_Comm c_comm; - c_comm = MPI_Comm_f2c (*comm); + c_comm = MPI_Comm_f2c (*comm); - *ierr = OMPI_INT_2_FINT(MPI_Irsend(buf, OMPI_FINT_2_INT(*count), - c_type, OMPI_FINT_2_INT(*dest), - OMPI_FINT_2_INT(*tag), c_comm, - &c_req)); + *ierr = OMPI_INT_2_FINT(MPI_Irsend(OMPI_ADDR(buf), OMPI_FINT_2_INT(*count), + c_type, OMPI_FINT_2_INT(*dest), + OMPI_FINT_2_INT(*tag), c_comm, + &c_req)); - if (MPI_SUCCESS == *ierr) { - *request = MPI_Request_c2f(c_req); - } + if (MPI_SUCCESS == *ierr) { + *request = MPI_Request_c2f(c_req); + } } diff --git a/src/mpi/f77/is_thread_main_f.c b/src/mpi/f77/is_thread_main_f.c index d0914d7a46..2815444e9f 100644 --- a/src/mpi/f77/is_thread_main_f.c +++ b/src/mpi/f77/is_thread_main_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/isend_f.c b/src/mpi/f77/isend_f.c index fe24253f4d..0d28125c7d 100644 --- a/src/mpi/f77/isend_f.c +++ b/src/mpi/f77/isend_f.c @@ -16,8 +16,8 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" +#include "mpi/f77/constants.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER #pragma weak PMPI_ISEND = mpi_isend_f @@ -58,18 +58,18 @@ OMPI_GENERATE_F77_BINDINGS (MPI_ISEND, void mpi_isend_f(char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr) { - MPI_Datatype c_type = MPI_Type_f2c(*datatype); - MPI_Request c_req; - MPI_Comm c_comm; + MPI_Datatype c_type = MPI_Type_f2c(*datatype); + MPI_Request c_req; + MPI_Comm c_comm; - c_comm = MPI_Comm_f2c (*comm); + c_comm = MPI_Comm_f2c (*comm); - *ierr = OMPI_INT_2_FINT(MPI_Isend(buf, OMPI_FINT_2_INT(*count), - c_type, OMPI_FINT_2_INT(*dest), - OMPI_FINT_2_INT(*tag), - c_comm, &c_req)); + *ierr = OMPI_INT_2_FINT(MPI_Isend(OMPI_ADDR(buf), OMPI_FINT_2_INT(*count), + c_type, OMPI_FINT_2_INT(*dest), + OMPI_FINT_2_INT(*tag), + c_comm, &c_req)); - if (MPI_SUCCESS == *ierr) { - *request = MPI_Request_c2f(c_req); - } + if (MPI_SUCCESS == *ierr) { + *request = MPI_Request_c2f(c_req); + } } diff --git a/src/mpi/f77/issend_f.c b/src/mpi/f77/issend_f.c index d44bb8b1be..9c4ca7e15a 100644 --- a/src/mpi/f77/issend_f.c +++ b/src/mpi/f77/issend_f.c @@ -16,8 +16,8 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" +#include "mpi/f77/constants.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER #pragma weak PMPI_ISSEND = mpi_issend_f @@ -58,18 +58,18 @@ OMPI_GENERATE_F77_BINDINGS (MPI_ISSEND, void mpi_issend_f(char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr) { - MPI_Datatype c_type = MPI_Type_f2c(*datatype); - MPI_Request c_req; - MPI_Comm c_comm; + MPI_Datatype c_type = MPI_Type_f2c(*datatype); + MPI_Request c_req; + MPI_Comm c_comm; - c_comm = MPI_Comm_f2c (*comm); + c_comm = MPI_Comm_f2c (*comm); - *ierr = OMPI_INT_2_FINT(MPI_Issend(buf, OMPI_FINT_2_INT(*count), - c_type, OMPI_FINT_2_INT(*dest), - OMPI_FINT_2_INT(*tag), - c_comm, &c_req)); + *ierr = OMPI_INT_2_FINT(MPI_Issend(OMPI_ADDR(buf), OMPI_FINT_2_INT(*count), + c_type, OMPI_FINT_2_INT(*dest), + OMPI_FINT_2_INT(*tag), + c_comm, &c_req)); - if (MPI_SUCCESS == *ierr) { - *request = MPI_Request_c2f(c_req); - } + if (MPI_SUCCESS == *ierr) { + *request = MPI_Request_c2f(c_req); + } } diff --git a/src/mpi/f77/keyval_create_f.c b/src/mpi/f77/keyval_create_f.c index 42e5295e90..e78e9ba431 100644 --- a/src/mpi/f77/keyval_create_f.c +++ b/src/mpi/f77/keyval_create_f.c @@ -16,9 +16,7 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" -#include "attribute/attribute.h" #include "communicator/communicator.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER @@ -32,7 +30,7 @@ OMPI_GENERATE_F77_BINDINGS (PMPI_KEYVAL_CREATE, pmpi_keyval_create_, pmpi_keyval_create__, pmpi_keyval_create_f, - (void *copy_fn, void *delete_fn, MPI_Fint *keyval, char *extra_state, MPI_Fint *ierr), + (MPI_F_copy_function* copy_fn, MPI_F_delete_function* delete_fn, MPI_Fint *keyval, char *extra_state, MPI_Fint *ierr), (copy_fn, delete_fn, keyval, extra_state, ierr) ) #endif @@ -49,7 +47,7 @@ OMPI_GENERATE_F77_BINDINGS (MPI_KEYVAL_CREATE, mpi_keyval_create_, mpi_keyval_create__, mpi_keyval_create_f, - (void *copy_fn, void *delete_fn, MPI_Fint *keyval, char *extra_state, MPI_Fint *ierr), + (MPI_F_copy_function* copy_fn, MPI_F_delete_function* delete_fn, MPI_Fint *keyval, char *extra_state, MPI_Fint *ierr), (copy_fn, delete_fn, keyval, extra_state, ierr) ) #endif @@ -60,15 +58,16 @@ OMPI_GENERATE_F77_BINDINGS (MPI_KEYVAL_CREATE, static const char FUNC_NAME[] = "MPI_keyval_create_f"; -void mpi_keyval_create_f(void *copy_attr_fn, void *delete_attr_fn, +void mpi_keyval_create_f(MPI_F_copy_function* copy_attr_fn, + MPI_F_delete_function* delete_attr_fn, MPI_Fint *keyval, char *extra_state, MPI_Fint *ierr) { int ret, c_err; ompi_attribute_fn_ptr_union_t copy_fn; ompi_attribute_fn_ptr_union_t del_fn; - copy_fn.attr_F_copy_fn = (MPI_F_copy_function *) copy_attr_fn; - del_fn.attr_F_delete_fn = (MPI_F_delete_function *) delete_attr_fn; + copy_fn.attr_F_copy_fn = copy_attr_fn; + del_fn.attr_F_delete_fn = delete_attr_fn; ret = ompi_attr_create_keyval(COMM_ATTR, copy_fn, del_fn, keyval, extra_state, OMPI_KEYVAL_F77); diff --git a/src/mpi/f77/keyval_free_f.c b/src/mpi/f77/keyval_free_f.c index d945d2b589..7777a00a53 100644 --- a/src/mpi/f77/keyval_free_f.c +++ b/src/mpi/f77/keyval_free_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/lookup_name_f.c b/src/mpi/f77/lookup_name_f.c index 697f879252..888a37a983 100644 --- a/src/mpi/f77/lookup_name_f.c +++ b/src/mpi/f77/lookup_name_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/op_create_f.c b/src/mpi/f77/op_create_f.c index 4b5c917ba1..6b55efbf7e 100644 --- a/src/mpi/f77/op_create_f.c +++ b/src/mpi/f77/op_create_f.c @@ -16,8 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" -#include "op/op.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER @@ -31,7 +29,7 @@ OMPI_GENERATE_F77_BINDINGS (PMPI_OP_CREATE, pmpi_op_create_, pmpi_op_create__, pmpi_op_create_f, - (void *function, MPI_Fint *commute, MPI_Fint *op, MPI_Fint *ierr), + (ompi_op_fortran_handler_fn_t* function, MPI_Fint *commute, MPI_Fint *op, MPI_Fint *ierr), (function, commute, op, ierr) ) #endif @@ -48,7 +46,7 @@ OMPI_GENERATE_F77_BINDINGS (MPI_OP_CREATE, mpi_op_create_, mpi_op_create__, mpi_op_create_f, - (void *function, MPI_Fint *commute, MPI_Fint *op, MPI_Fint *ierr), + (ompi_op_fortran_handler_fn_t* function, MPI_Fint *commute, MPI_Fint *op, MPI_Fint *ierr), (function, commute, op, ierr) ) #endif @@ -57,7 +55,7 @@ OMPI_GENERATE_F77_BINDINGS (MPI_OP_CREATE, #include "mpi/f77/profile/defines.h" #endif -void mpi_op_create_f(void *function, MPI_Fint *commute, +void mpi_op_create_f(ompi_op_fortran_handler_fn_t* function, MPI_Fint *commute, MPI_Fint *op, MPI_Fint *ierr) { MPI_Op c_op; diff --git a/src/mpi/f77/op_free_f.c b/src/mpi/f77/op_free_f.c index a57e894b09..7881145107 100644 --- a/src/mpi/f77/op_free_f.c +++ b/src/mpi/f77/op_free_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/open_port_f.c b/src/mpi/f77/open_port_f.c index f35a154a14..c6d70ef036 100644 --- a/src/mpi/f77/open_port_f.c +++ b/src/mpi/f77/open_port_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/pack_external_f.c b/src/mpi/f77/pack_external_f.c index 0767e3d8dc..ac0556fd48 100644 --- a/src/mpi/f77/pack_external_f.c +++ b/src/mpi/f77/pack_external_f.c @@ -16,8 +16,8 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" +#include "mpi/f77/constants.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER #pragma weak PMPI_PACK_EXTERNAL = mpi_pack_external_f @@ -61,11 +61,11 @@ void mpi_pack_external_f(char *datarep, char *inbuf, MPI_Fint *incount, MPI_Fint *outsize, MPI_Fint *position, MPI_Fint *ierr) { - MPI_Datatype type = MPI_Type_f2c(*datatype); + MPI_Datatype type = MPI_Type_f2c(*datatype); - *ierr = OMPI_INT_2_FINT(MPI_Pack_external(datarep, inbuf, - OMPI_FINT_2_INT(*incount), - type, outbuf, - (MPI_Aint) *outsize, - (MPI_Aint *)position)); + *ierr = OMPI_INT_2_FINT(MPI_Pack_external(datarep, OMPI_ADDR(inbuf), + OMPI_FINT_2_INT(*incount), + type, outbuf, + (MPI_Aint) *outsize, + (MPI_Aint *)position)); } diff --git a/src/mpi/f77/pack_external_size_f.c b/src/mpi/f77/pack_external_size_f.c index dc3f0dc1e4..a915134d2d 100644 --- a/src/mpi/f77/pack_external_size_f.c +++ b/src/mpi/f77/pack_external_size_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER @@ -60,10 +59,9 @@ void mpi_pack_external_size_f(char *datarep, MPI_Fint *incount, MPI_Fint *datatype, MPI_Fint *size, MPI_Fint *ierr) { - MPI_Datatype type = MPI_Type_f2c(*datatype); - - *ierr = OMPI_INT_2_FINT(MPI_Pack_external_size(datarep, - OMPI_FINT_2_INT(*incount), - type, (MPI_Aint *)size)); + MPI_Datatype type = MPI_Type_f2c(*datatype); + *ierr = OMPI_INT_2_FINT(MPI_Pack_external_size(datarep, + OMPI_FINT_2_INT(*incount), + type, (MPI_Aint *)size)); } diff --git a/src/mpi/f77/pack_f.c b/src/mpi/f77/pack_f.c index 58c5da101d..afafd95a4d 100644 --- a/src/mpi/f77/pack_f.c +++ b/src/mpi/f77/pack_f.c @@ -16,8 +16,8 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" +#include "mpi/f77/constants.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER #pragma weak PMPI_PACK = mpi_pack_f @@ -60,19 +60,19 @@ void mpi_pack_f(char *inbuf, MPI_Fint *incount, MPI_Fint *datatype, char *outbuf, MPI_Fint *outsize, MPI_Fint *position, MPI_Fint *comm, MPI_Fint *ierr) { - MPI_Comm c_comm; - MPI_Datatype c_type; - OMPI_SINGLE_NAME_DECL(position); + MPI_Comm c_comm; + MPI_Datatype c_type; + OMPI_SINGLE_NAME_DECL(position); - c_comm = MPI_Comm_f2c(*comm); - c_type = MPI_Type_f2c(*datatype); - OMPI_SINGLE_FINT_2_INT(position); - - *ierr = OMPI_INT_2_FINT(MPI_Pack(inbuf, OMPI_FINT_2_INT(*incount), - c_type, outbuf, - OMPI_FINT_2_INT(*outsize), - OMPI_SINGLE_NAME_CONVERT(position), - c_comm)); + c_comm = MPI_Comm_f2c(*comm); + c_type = MPI_Type_f2c(*datatype); + OMPI_SINGLE_FINT_2_INT(position); + + *ierr = OMPI_INT_2_FINT(MPI_Pack(OMPI_ADDR(inbuf), OMPI_FINT_2_INT(*incount), + c_type, outbuf, + OMPI_FINT_2_INT(*outsize), + OMPI_SINGLE_NAME_CONVERT(position), + c_comm)); - OMPI_SINGLE_INT_2_FINT(position); + OMPI_SINGLE_INT_2_FINT(position); } diff --git a/src/mpi/f77/pack_size_f.c b/src/mpi/f77/pack_size_f.c index ddc39eaef7..1cc76010b6 100644 --- a/src/mpi/f77/pack_size_f.c +++ b/src/mpi/f77/pack_size_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/pcontrol_f.c b/src/mpi/f77/pcontrol_f.c index 5a85463d05..dea6e81199 100644 --- a/src/mpi/f77/pcontrol_f.c +++ b/src/mpi/f77/pcontrol_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/probe_f.c b/src/mpi/f77/probe_f.c index 3b398cd2de..705091d374 100644 --- a/src/mpi/f77/probe_f.c +++ b/src/mpi/f77/probe_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #include "mpi/f77/constants.h" #include "errhandler/errhandler.h" @@ -63,7 +62,6 @@ OMPI_GENERATE_F77_BINDINGS (MPI_PROBE, void mpi_probe_f(MPI_Fint *source, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *status, MPI_Fint *ierr) { MPI_Status *c_status; - int c_err; MPI_Comm c_comm; #if OMPI_SIZEOF_FORTRAN_INT != SIZEOF_INT MPI_Status c_status2; @@ -71,19 +69,7 @@ void mpi_probe_f(MPI_Fint *source, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *stat c_comm = MPI_Comm_f2c (*comm); - /* Only check for the bad value if we're checking MPI parameters */ - - if (MPI_PARAM_CHECK) { - if (OMPI_IS_FORTRAN_STATUSES_IGNORE(status)) { - c_err = OMPI_ERRHANDLER_INVOKE(c_comm, MPI_ERR_ARG, - "MPI_RECV"); - *ierr = OMPI_INT_2_FINT(c_err); - return; - } - } - /* See if we got MPI_STATUS_IGNORE */ - if (OMPI_IS_FORTRAN_STATUS_IGNORE(status)) { c_status = MPI_STATUS_IGNORE; } else { diff --git a/src/mpi/f77/profile/prototypes_pmpi.h b/src/mpi/f77/profile/prototypes_pmpi.h index a195d9d6e4..f865c84700 100644 --- a/src/mpi/f77/profile/prototypes_pmpi.h +++ b/src/mpi/f77/profile/prototypes_pmpi.h @@ -77,8 +77,8 @@ void pmpi_comm_accept_f(char *port_name, MPI_Fint *info, MPI_Fint *root, MPI_Fin void pmpi_comm_call_errhandler_f(MPI_Fint *comm, MPI_Fint *errorcode, MPI_Fint *ierr); void pmpi_comm_compare_f(MPI_Fint *comm1, MPI_Fint *comm2, MPI_Fint *result, MPI_Fint *ierr); void pmpi_comm_connect_f(char *port_name, MPI_Fint *info, MPI_Fint *root, MPI_Fint *comm, MPI_Fint *newcomm, MPI_Fint *ierr); -void pmpi_comm_create_errhandler_f(void *function, MPI_Fint *errhandler, MPI_Fint *ierr); -void pmpi_comm_create_keyval_f(void *comm_copy_attr_fn, void *comm_delete_attr_fn, MPI_Fint *comm_keyval, char *extra_state, MPI_Fint *ierr); +void pmpi_comm_create_errhandler_f(ompi_errhandler_fortran_handler_fn_t* function, MPI_Fint *errhandler, MPI_Fint *ierr); +void pmpi_comm_create_keyval_f(MPI_F_copy_function* comm_copy_attr_fn, MPI_F_delete_function* comm_delete_attr_fn, MPI_Fint *comm_keyval, char *extra_state, MPI_Fint *ierr); void pmpi_comm_create_f(MPI_Fint *comm, MPI_Fint *group, MPI_Fint *newcomm, MPI_Fint *ierr); void pmpi_comm_delete_attr_f(MPI_Fint *comm, MPI_Fint *comm_keyval, MPI_Fint *ierr); void pmpi_comm_disconnect_f(MPI_Fint *comm, MPI_Fint *ierr); @@ -108,7 +108,7 @@ void pmpi_comm_spawn_multiple_f(MPI_Fint *count, char *array_of_commands, char * void pmpi_comm_split_f(MPI_Fint *comm, MPI_Fint *color, MPI_Fint *key, MPI_Fint *newcomm, MPI_Fint *ierr); void pmpi_comm_test_inter_f(MPI_Fint *comm, MPI_Fint *flag, MPI_Fint *ierr); void pmpi_dims_create_f(MPI_Fint *nnodes, MPI_Fint *ndims, MPI_Fint *dims, MPI_Fint *ierr); -void pmpi_errhandler_create_f(void *function, MPI_Fint *errhandler, MPI_Fint *ierr); +void pmpi_errhandler_create_f(ompi_errhandler_fortran_handler_fn_t* function, MPI_Fint *errhandler, MPI_Fint *ierr); void pmpi_errhandler_free_f(MPI_Fint *errhandler, MPI_Fint *ierr); void pmpi_errhandler_get_f(MPI_Fint *comm, MPI_Fint *errhandler, MPI_Fint *ierr); void pmpi_errhandler_set_f(MPI_Fint *comm, MPI_Fint *errhandler, MPI_Fint *ierr); @@ -116,7 +116,7 @@ void pmpi_error_class_f(MPI_Fint *errorcode, MPI_Fint *errorclass, MPI_Fint *ier void pmpi_error_string_f(MPI_Fint *errorcode, char *string, MPI_Fint *resultlen, MPI_Fint *ierr); void pmpi_exscan_f(char *sendbuf, char *recvbuf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *op, MPI_Fint *comm, MPI_Fint *ierr); void pmpi_file_call_errhandler_f(MPI_Fint *fh, MPI_Fint *errorcode, MPI_Fint *ierr); -void pmpi_file_create_errhandler_f(void *function, MPI_Fint *errhandler, MPI_Fint *ierr); +void pmpi_file_create_errhandler_f(ompi_errhandler_fortran_handler_fn_t* function, MPI_Fint *errhandler, MPI_Fint *ierr); void pmpi_file_set_errhandler_f(MPI_Fint *file, MPI_Fint *errhandler, MPI_Fint *ierr); void pmpi_file_get_errhandler_f(MPI_Fint *file, MPI_Fint *errhandler, MPI_Fint *ierr); void pmpi_file_open_f(MPI_Fint *comm, char *filename, MPI_Fint *amode, MPI_Fint *info, MPI_Fint *fh, MPI_Fint *ierr); @@ -188,7 +188,7 @@ void pmpi_graph_neighbors_count_f(MPI_Fint *comm, MPI_Fint *rank, MPI_Fint *nnei void pmpi_graph_neighbors_f(MPI_Fint *comm, MPI_Fint *rank, MPI_Fint *maxneighbors, MPI_Fint *neighbors, MPI_Fint *ierr); void pmpi_graphdims_get_f(MPI_Fint *comm, MPI_Fint *nnodes, MPI_Fint *nedges, MPI_Fint *ierr); void pmpi_grequest_complete_f(MPI_Fint *request, MPI_Fint *ierr); -void pmpi_grequest_start_f(void *query_fn, void *free_fn, void *cancel_fn, char *extra_state, MPI_Fint *request, MPI_Fint *ierr); +void pmpi_grequest_start_f(MPI_F_Grequest_query_function* query_fn, MPI_F_Grequest_free_function* free_fn, MPI_F_Grequest_cancel_function* cancel_fn, char *extra_state, MPI_Fint *request, MPI_Fint *ierr); void pmpi_group_compare_f(MPI_Fint *group1, MPI_Fint *group2, MPI_Fint *result, MPI_Fint *ierr); void pmpi_group_difference_f(MPI_Fint *group1, MPI_Fint *group2, MPI_Fint *newgroup, MPI_Fint *ierr); void pmpi_group_excl_f(MPI_Fint *group, MPI_Fint *n, MPI_Fint *ranks, MPI_Fint *newgroup, MPI_Fint *ierr); @@ -222,10 +222,10 @@ void pmpi_irsend_f(char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *des void pmpi_isend_f(char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr); void pmpi_issend_f(char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr); void pmpi_is_thread_main_f(MPI_Fint *flag, MPI_Fint *ierr); -void pmpi_keyval_create_f(void *copy_fn, void *delete_fn, MPI_Fint *keyval, char *extra_state, MPI_Fint *ierr); +void pmpi_keyval_create_f(MPI_F_copy_function* copy_fn, MPI_F_delete_function* delete_fn, MPI_Fint *keyval, char *extra_state, MPI_Fint *ierr); void pmpi_keyval_free_f(MPI_Fint *keyval, MPI_Fint *ierr); void pmpi_lookup_name_f(char *service_name, MPI_Fint *info, char *port_name, MPI_Fint *ierr); -void pmpi_op_create_f(void *function, MPI_Fint *commute, MPI_Fint *op, MPI_Fint *ierr); +void pmpi_op_create_f(ompi_op_fortran_handler_fn_t* function, MPI_Fint *commute, MPI_Fint *op, MPI_Fint *ierr); void pmpi_open_port_f(MPI_Fint *info, char *port_name, MPI_Fint *ierr); void pmpi_op_free_f(MPI_Fint *op, MPI_Fint *ierr); void pmpi_pack_external_f(char *datarep, char *inbuf, MPI_Fint *incount, MPI_Fint *datatype, char *outbuf, MPI_Fint *outsize, MPI_Fint *position, MPI_Fint *ierr); @@ -273,7 +273,7 @@ void pmpi_type_create_f90_integer_f(MPI_Fint *r, MPI_Fint *newtype, MPI_Fint *ie void pmpi_type_create_f90_real_f(MPI_Fint *p, MPI_Fint *r, MPI_Fint *newtype, MPI_Fint *ierr); void pmpi_type_create_hindexed_f(MPI_Fint *count, MPI_Fint *array_of_blocklengths, MPI_Fint *array_of_displacements, MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr); void pmpi_type_create_hvector_f(MPI_Fint *count, MPI_Fint *blocklength, MPI_Fint *stride, MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr); -void pmpi_type_create_keyval_f(void *type_copy_attr_fn, void *type_delete_attr_fn, MPI_Fint *type_keyval, char *extra_state, MPI_Fint *ierr); +void pmpi_type_create_keyval_f(MPI_F_copy_function* type_copy_attr_fn, MPI_F_delete_function* type_delete_attr_fn, MPI_Fint *type_keyval, char *extra_state, MPI_Fint *ierr); void pmpi_type_create_indexed_block_f(MPI_Fint *count, MPI_Fint *blocklength, MPI_Fint *array_of_displacements, MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr); void pmpi_type_create_struct_f(MPI_Fint *count, MPI_Fint *array_of_block_lengths, MPI_Fint *array_of_displacements, MPI_Fint *array_of_types, MPI_Fint *newtype, MPI_Fint *ierr); void pmpi_type_create_subarray_f(MPI_Fint *ndims, MPI_Fint *size_array, MPI_Fint *subsize_array, MPI_Fint *start_array, MPI_Fint *order, MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr); @@ -310,8 +310,8 @@ void pmpi_waitsome_f(MPI_Fint *incount, MPI_Fint *array_of_requests, MPI_Fint *o void pmpi_win_call_errhandler_f(MPI_Fint *win, MPI_Fint *errorcode, MPI_Fint *ierr); void pmpi_win_complete_f(MPI_Fint *win, MPI_Fint *ierr); void pmpi_win_create_f(char *base, MPI_Fint *size, MPI_Fint *disp_unit, MPI_Fint *info, MPI_Fint *comm, MPI_Fint *win, MPI_Fint *ierr); -void pmpi_win_create_errhandler_f(void *function, MPI_Fint *errhandler, MPI_Fint *ierr); -void pmpi_win_create_keyval_f(void *win_copy_attr_fn, void *win_delete_attr_fn, MPI_Fint *win_keyval, char *extra_state, MPI_Fint *ierr); +void pmpi_win_create_errhandler_f(ompi_errhandler_fortran_handler_fn_t* function, MPI_Fint *errhandler, MPI_Fint *ierr); +void pmpi_win_create_keyval_f(MPI_F_copy_function* win_copy_attr_fn, MPI_F_delete_function* win_delete_attr_fn, MPI_Fint *win_keyval, char *extra_state, MPI_Fint *ierr); void pmpi_win_delete_attr_f(MPI_Fint *win, MPI_Fint *win_keyval, MPI_Fint *ierr); void pmpi_win_fence_f(MPI_Fint *assert, MPI_Fint *win, MPI_Fint *ierr); void pmpi_win_free_f(MPI_Fint *win, MPI_Fint *ierr); @@ -369,8 +369,8 @@ void pmpi_comm_accept(char *port_name, MPI_Fint *info, MPI_Fint *root, MPI_Fint void pmpi_comm_call_errhandler(MPI_Fint *comm, MPI_Fint *errorcode, MPI_Fint *ierr); void pmpi_comm_compare(MPI_Fint *comm1, MPI_Fint *comm2, MPI_Fint *result, MPI_Fint *ierr); void pmpi_comm_connect(char *port_name, MPI_Fint *info, MPI_Fint *root, MPI_Fint *comm, MPI_Fint *newcomm, MPI_Fint *ierr); -void pmpi_comm_create_errhandler(void *function, MPI_Fint *errhandler, MPI_Fint *ierr); -void pmpi_comm_create_keyval(void *comm_copy_attr_fn, void *comm_delete_attr_fn, MPI_Fint *comm_keyval, char *extra_state, MPI_Fint *ierr); +void pmpi_comm_create_errhandler(ompi_errhandler_fortran_handler_fn_t* function, MPI_Fint *errhandler, MPI_Fint *ierr); +void pmpi_comm_create_keyval(MPI_F_copy_function* comm_copy_attr_fn, MPI_F_delete_function* comm_delete_attr_fn, MPI_Fint *comm_keyval, char *extra_state, MPI_Fint *ierr); void pmpi_comm_create(MPI_Fint *comm, MPI_Fint *group, MPI_Fint *newcomm, MPI_Fint *ierr); void pmpi_comm_delete_attr(MPI_Fint *comm, MPI_Fint *comm_keyval, MPI_Fint *ierr); void pmpi_comm_disconnect(MPI_Fint *comm, MPI_Fint *ierr); @@ -395,7 +395,7 @@ void pmpi_comm_spawn_multiple(MPI_Fint *count, char *array_of_commands, char *ar void pmpi_comm_split(MPI_Fint *comm, MPI_Fint *color, MPI_Fint *key, MPI_Fint *newcomm, MPI_Fint *ierr); void pmpi_comm_test_inter(MPI_Fint *comm, MPI_Fint *flag, MPI_Fint *ierr); void pmpi_dims_create(MPI_Fint *nnodes, MPI_Fint *ndims, MPI_Fint *dims, MPI_Fint *ierr); -void pmpi_errhandler_create(void *function, MPI_Fint *errhandler, MPI_Fint *ierr); +void pmpi_errhandler_create(ompi_errhandler_fortran_handler_fn_t* function, MPI_Fint *errhandler, MPI_Fint *ierr); void pmpi_errhandler_free(MPI_Fint *errhandler, MPI_Fint *ierr); void pmpi_errhandler_get(MPI_Fint *comm, MPI_Fint *errhandler, MPI_Fint *ierr); void pmpi_errhandler_set(MPI_Fint *comm, MPI_Fint *errhandler, MPI_Fint *ierr); @@ -403,7 +403,7 @@ void pmpi_error_class(MPI_Fint *errorcode, MPI_Fint *errorclass, MPI_Fint *ierr) void pmpi_error_string(MPI_Fint *errorcode, char *string, MPI_Fint *resultlen, MPI_Fint *ierr); void pmpi_exscan(char *sendbuf, char *recvbuf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *op, MPI_Fint *comm, MPI_Fint *ierr); void pmpi_file_call_errhandler(MPI_Fint *fh, MPI_Fint *errorcode, MPI_Fint *ierr); -void pmpi_file_create_errhandler(void *function, MPI_Fint *errhandler, MPI_Fint *ierr); +void pmpi_file_create_errhandler(ompi_errhandler_fortran_handler_fn_t* function, MPI_Fint *errhandler, MPI_Fint *ierr); void pmpi_file_set_errhandler(MPI_Fint *file, MPI_Fint *errhandler, MPI_Fint *ierr); void pmpi_file_get_errhandler(MPI_Fint *file, MPI_Fint *errhandler, MPI_Fint *ierr); void pmpi_file_open(MPI_Fint *comm, char *filename, MPI_Fint *amode, MPI_Fint *info, MPI_Fint *fh, MPI_Fint *ierr); @@ -475,7 +475,7 @@ void pmpi_graph_neighbors_count(MPI_Fint *comm, MPI_Fint *rank, MPI_Fint *nneigh void pmpi_graph_neighbors(MPI_Fint *comm, MPI_Fint *rank, MPI_Fint *maxneighbors, MPI_Fint *neighbors, MPI_Fint *ierr); void pmpi_graphdims_get(MPI_Fint *comm, MPI_Fint *nnodes, MPI_Fint *nedges, MPI_Fint *ierr); void pmpi_grequest_complete(MPI_Fint *request, MPI_Fint *ierr); -void pmpi_grequest_start(void *query_fn, void *free_fn, void *cancel_fn, char *extra_state, MPI_Fint *request, MPI_Fint *ierr); +void pmpi_grequest_start(MPI_F_Grequest_query_function* query_fn, MPI_F_Grequest_free_function* free_fn, MPI_F_Grequest_cancel_function* cancel_fn, char *extra_state, MPI_Fint *request, MPI_Fint *ierr); void pmpi_group_compare(MPI_Fint *group1, MPI_Fint *group2, MPI_Fint *result, MPI_Fint *ierr); void pmpi_group_difference(MPI_Fint *group1, MPI_Fint *group2, MPI_Fint *newgroup, MPI_Fint *ierr); void pmpi_group_excl(MPI_Fint *group, MPI_Fint *n, MPI_Fint *ranks, MPI_Fint *newgroup, MPI_Fint *ierr); @@ -509,10 +509,10 @@ void pmpi_irsend(char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, void pmpi_isend(char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr); void pmpi_issend(char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr); void pmpi_is_thread_main(MPI_Fint *flag, MPI_Fint *ierr); -void pmpi_keyval_create(void *copy_fn, void *delete_fn, MPI_Fint *keyval, char *extra_state, MPI_Fint *ierr); +void pmpi_keyval_create(MPI_F_copy_function* copy_fn, MPI_F_delete_function* delete_fn, MPI_Fint *keyval, char *extra_state, MPI_Fint *ierr); void pmpi_keyval_free(MPI_Fint *keyval, MPI_Fint *ierr); void pmpi_lookup_name(char *service_name, MPI_Fint *info, char *port_name, MPI_Fint *ierr); -void pmpi_op_create(void *function, MPI_Fint *commute, MPI_Fint *op, MPI_Fint *ierr); +void pmpi_op_create(ompi_op_fortran_handler_fn_t* function, MPI_Fint *commute, MPI_Fint *op, MPI_Fint *ierr); void pmpi_open_port(MPI_Fint *info, char *port_name, MPI_Fint *ierr); void pmpi_op_free(MPI_Fint *op, MPI_Fint *ierr); void pmpi_pack_external(char *datarep, char *inbuf, MPI_Fint *incount, MPI_Fint *datatype, char *outbuf, MPI_Fint *outsize, MPI_Fint *position, MPI_Fint *ierr); @@ -560,7 +560,7 @@ void pmpi_type_create_f90_integer(MPI_Fint *r, MPI_Fint *newtype, MPI_Fint *ierr void pmpi_type_create_f90_real(MPI_Fint *p, MPI_Fint *r, MPI_Fint *newtype, MPI_Fint *ierr); void pmpi_type_create_hindexed(MPI_Fint *count, MPI_Fint *array_of_blocklengths, MPI_Fint *array_of_displacements, MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr); void pmpi_type_create_hvector(MPI_Fint *count, MPI_Fint *blocklength, MPI_Fint *stride, MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr); -void pmpi_type_create_keyval(void *type_copy_attr_fn, void *type_delete_attr_fn, MPI_Fint *type_keyval, char *extra_state, MPI_Fint *ierr); +void pmpi_type_create_keyval(MPI_F_copy_function* type_copy_attr_fn, MPI_F_delete_function* type_delete_attr_fn, MPI_Fint *type_keyval, char *extra_state, MPI_Fint *ierr); void pmpi_type_create_indexed_block(MPI_Fint *count, MPI_Fint *blocklength, MPI_Fint *array_of_displacements, MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr); void pmpi_type_create_struct(MPI_Fint *count, MPI_Fint *array_of_block_lengths, MPI_Fint *array_of_displacements, MPI_Fint *array_of_types, MPI_Fint *newtype, MPI_Fint *ierr); void pmpi_type_create_subarray(MPI_Fint *ndims, MPI_Fint *size_array, MPI_Fint *subsize_array, MPI_Fint *start_array, MPI_Fint *order, MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr); @@ -597,8 +597,8 @@ void pmpi_waitsome(MPI_Fint *incount, MPI_Fint *array_of_requests, MPI_Fint *out void pmpi_win_call_errhandler(MPI_Fint *win, MPI_Fint *errorcode, MPI_Fint *ierr); void pmpi_win_complete(MPI_Fint *win, MPI_Fint *ierr); void pmpi_win_create(char *base, MPI_Fint *size, MPI_Fint *disp_unit, MPI_Fint *info, MPI_Fint *comm, MPI_Fint *win, MPI_Fint *ierr); -void pmpi_win_create_errhandler(void *function, MPI_Fint *errhandler, MPI_Fint *ierr); -void pmpi_win_create_keyval(void *win_copy_attr_fn, void *win_delete_attr_fn, MPI_Fint *win_keyval, char *extra_state, MPI_Fint *ierr); +void pmpi_win_create_errhandler(ompi_errhandler_fortran_handler_fn_t* function, MPI_Fint *errhandler, MPI_Fint *ierr); +void pmpi_win_create_keyval(MPI_F_copy_function* win_copy_attr_fn, MPI_F_delete_function* win_delete_attr_fn, MPI_Fint *win_keyval, char *extra_state, MPI_Fint *ierr); void pmpi_win_delete_attr(MPI_Fint *win, MPI_Fint *win_keyval, MPI_Fint *ierr); void pmpi_win_fence(MPI_Fint *assert, MPI_Fint *win, MPI_Fint *ierr); void pmpi_win_free(MPI_Fint *win, MPI_Fint *ierr); @@ -656,8 +656,8 @@ void pmpi_comm_accept_(char *port_name, MPI_Fint *info, MPI_Fint *root, MPI_Fint void pmpi_comm_call_errhandler_(MPI_Fint *comm, MPI_Fint *errorcode, MPI_Fint *ierr); void pmpi_comm_compare_(MPI_Fint *comm1, MPI_Fint *comm2, MPI_Fint *result, MPI_Fint *ierr); void pmpi_comm_connect_(char *port_name, MPI_Fint *info, MPI_Fint *root, MPI_Fint *comm, MPI_Fint *newcomm, MPI_Fint *ierr); -void pmpi_comm_create_errhandler_(void *function, MPI_Fint *errhandler, MPI_Fint *ierr); -void pmpi_comm_create_keyval_(void *comm_copy_attr_fn, void *comm_delete_attr_fn, MPI_Fint *comm_keyval, char *extra_state, MPI_Fint *ierr); +void pmpi_comm_create_errhandler_(ompi_errhandler_fortran_handler_fn_t* function, MPI_Fint *errhandler, MPI_Fint *ierr); +void pmpi_comm_create_keyval_(MPI_F_copy_function* comm_copy_attr_fn, MPI_F_delete_function* comm_delete_attr_fn, MPI_Fint *comm_keyval, char *extra_state, MPI_Fint *ierr); void pmpi_comm_create_(MPI_Fint *comm, MPI_Fint *group, MPI_Fint *newcomm, MPI_Fint *ierr); void pmpi_comm_delete_attr_(MPI_Fint *comm, MPI_Fint *comm_keyval, MPI_Fint *ierr); void pmpi_comm_disconnect_(MPI_Fint *comm, MPI_Fint *ierr); @@ -682,7 +682,7 @@ void pmpi_comm_spawn_multiple_(MPI_Fint *count, char *array_of_commands, char *a void pmpi_comm_split_(MPI_Fint *comm, MPI_Fint *color, MPI_Fint *key, MPI_Fint *newcomm, MPI_Fint *ierr); void pmpi_comm_test_inter_(MPI_Fint *comm, MPI_Fint *flag, MPI_Fint *ierr); void pmpi_dims_create_(MPI_Fint *nnodes, MPI_Fint *ndims, MPI_Fint *dims, MPI_Fint *ierr); -void pmpi_errhandler_create_(void *function, MPI_Fint *errhandler, MPI_Fint *ierr); +void pmpi_errhandler_create_(ompi_errhandler_fortran_handler_fn_t* function, MPI_Fint *errhandler, MPI_Fint *ierr); void pmpi_errhandler_free_(MPI_Fint *errhandler, MPI_Fint *ierr); void pmpi_errhandler_get_(MPI_Fint *comm, MPI_Fint *errhandler, MPI_Fint *ierr); void pmpi_errhandler_set_(MPI_Fint *comm, MPI_Fint *errhandler, MPI_Fint *ierr); @@ -690,7 +690,7 @@ void pmpi_error_class_(MPI_Fint *errorcode, MPI_Fint *errorclass, MPI_Fint *ierr void pmpi_error_string_(MPI_Fint *errorcode, char *string, MPI_Fint *resultlen, MPI_Fint *ierr); void pmpi_exscan_(char *sendbuf, char *recvbuf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *op, MPI_Fint *comm, MPI_Fint *ierr); void pmpi_file_call_errhandler_(MPI_Fint *fh, MPI_Fint *errorcode, MPI_Fint *ierr); -void pmpi_file_create_errhandler_(void *function, MPI_Fint *errhandler, MPI_Fint *ierr); +void pmpi_file_create_errhandler_(ompi_errhandler_fortran_handler_fn_t* function, MPI_Fint *errhandler, MPI_Fint *ierr); void pmpi_file_set_errhandler_(MPI_Fint *file, MPI_Fint *errhandler, MPI_Fint *ierr); void pmpi_file_get_errhandler_(MPI_Fint *file, MPI_Fint *errhandler, MPI_Fint *ierr); void pmpi_file_open_(MPI_Fint *comm, char *filename, MPI_Fint *amode, MPI_Fint *info, MPI_Fint *fh, MPI_Fint *ierr); @@ -762,7 +762,7 @@ void pmpi_graph_neighbors_count_(MPI_Fint *comm, MPI_Fint *rank, MPI_Fint *nneig void pmpi_graph_neighbors_(MPI_Fint *comm, MPI_Fint *rank, MPI_Fint *maxneighbors, MPI_Fint *neighbors, MPI_Fint *ierr); void pmpi_graphdims_get_(MPI_Fint *comm, MPI_Fint *nnodes, MPI_Fint *nedges, MPI_Fint *ierr); void pmpi_grequest_complete_(MPI_Fint *request, MPI_Fint *ierr); -void pmpi_grequest_start_(void *query_fn, void *free_fn, void *cancel_fn, char *extra_state, MPI_Fint *request, MPI_Fint *ierr); +void pmpi_grequest_start_(MPI_F_Grequest_query_function* query_fn, MPI_F_Grequest_free_function* free_fn, MPI_F_Grequest_cancel_function* cancel_fn, char *extra_state, MPI_Fint *request, MPI_Fint *ierr); void pmpi_group_compare_(MPI_Fint *group1, MPI_Fint *group2, MPI_Fint *result, MPI_Fint *ierr); void pmpi_group_difference_(MPI_Fint *group1, MPI_Fint *group2, MPI_Fint *newgroup, MPI_Fint *ierr); void pmpi_group_excl_(MPI_Fint *group, MPI_Fint *n, MPI_Fint *ranks, MPI_Fint *newgroup, MPI_Fint *ierr); @@ -796,10 +796,10 @@ void pmpi_irsend_(char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest void pmpi_isend_(char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr); void pmpi_issend_(char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr); void pmpi_is_thread_main_(MPI_Fint *flag, MPI_Fint *ierr); -void pmpi_keyval_create_(void *copy_fn, void *delete_fn, MPI_Fint *keyval, char *extra_state, MPI_Fint *ierr); +void pmpi_keyval_create_(MPI_F_copy_function* copy_fn, MPI_F_delete_function* delete_fn, MPI_Fint *keyval, char *extra_state, MPI_Fint *ierr); void pmpi_keyval_free_(MPI_Fint *keyval, MPI_Fint *ierr); void pmpi_lookup_name_(char *service_name, MPI_Fint *info, char *port_name, MPI_Fint *ierr); -void pmpi_op_create_(void *function, MPI_Fint *commute, MPI_Fint *op, MPI_Fint *ierr); +void pmpi_op_create_(ompi_op_fortran_handler_fn_t* function, MPI_Fint *commute, MPI_Fint *op, MPI_Fint *ierr); void pmpi_open_port_(MPI_Fint *info, char *port_name, MPI_Fint *ierr); void pmpi_op_free_(MPI_Fint *op, MPI_Fint *ierr); void pmpi_pack_external_(char *datarep, char *inbuf, MPI_Fint *incount, MPI_Fint *datatype, char *outbuf, MPI_Fint *outsize, MPI_Fint *position, MPI_Fint *ierr); @@ -847,7 +847,7 @@ void pmpi_type_create_f90_integer_(MPI_Fint *r, MPI_Fint *newtype, MPI_Fint *ier void pmpi_type_create_f90_real_(MPI_Fint *p, MPI_Fint *r, MPI_Fint *newtype, MPI_Fint *ierr); void pmpi_type_create_hindexed_(MPI_Fint *count, MPI_Fint *array_of_blocklengths, MPI_Fint *array_of_displacements, MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr); void pmpi_type_create_hvector_(MPI_Fint *count, MPI_Fint *blocklength, MPI_Fint *stride, MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr); -void pmpi_type_create_keyval_(void *type_copy_attr_fn, void *type_delete_attr_fn, MPI_Fint *type_keyval, char *extra_state, MPI_Fint *ierr); +void pmpi_type_create_keyval_(MPI_F_copy_function* type_copy_attr_fn, MPI_F_delete_function* type_delete_attr_fn, MPI_Fint *type_keyval, char *extra_state, MPI_Fint *ierr); void pmpi_type_create_indexed_block_(MPI_Fint *count, MPI_Fint *blocklength, MPI_Fint *array_of_displacements, MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr); void pmpi_type_create_struct_(MPI_Fint *count, MPI_Fint *array_of_block_lengths, MPI_Fint *array_of_displacements, MPI_Fint *array_of_types, MPI_Fint *newtype, MPI_Fint *ierr); void pmpi_type_create_subarray_(MPI_Fint *ndims, MPI_Fint *size_array, MPI_Fint *subsize_array, MPI_Fint *start_array, MPI_Fint *order, MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr); @@ -884,8 +884,8 @@ void pmpi_waitsome_(MPI_Fint *incount, MPI_Fint *array_of_requests, MPI_Fint *ou void pmpi_win_call_errhandler_(MPI_Fint *win, MPI_Fint *errorcode, MPI_Fint *ierr); void pmpi_win_complete_(MPI_Fint *win, MPI_Fint *ierr); void pmpi_win_create_(char *base, MPI_Fint *size, MPI_Fint *disp_unit, MPI_Fint *info, MPI_Fint *comm, MPI_Fint *win, MPI_Fint *ierr); -void pmpi_win_create_errhandler_(void *function, MPI_Fint *errhandler, MPI_Fint *ierr); -void pmpi_win_create_keyval_(void *win_copy_attr_fn, void *win_delete_attr_fn, MPI_Fint *win_keyval, char *extra_state, MPI_Fint *ierr); +void pmpi_win_create_errhandler_(ompi_errhandler_fortran_handler_fn_t* function, MPI_Fint *errhandler, MPI_Fint *ierr); +void pmpi_win_create_keyval_(MPI_F_copy_function* win_copy_attr_fn, MPI_F_delete_function* win_delete_attr_fn, MPI_Fint *win_keyval, char *extra_state, MPI_Fint *ierr); void pmpi_win_delete_attr_(MPI_Fint *win, MPI_Fint *win_keyval, MPI_Fint *ierr); void pmpi_win_fence_(MPI_Fint *assert, MPI_Fint *win, MPI_Fint *ierr); void pmpi_win_free_(MPI_Fint *win, MPI_Fint *ierr); @@ -943,8 +943,8 @@ void pmpi_comm_accept__(char *port_name, MPI_Fint *info, MPI_Fint *root, MPI_Fin void pmpi_comm_call_errhandler__(MPI_Fint *comm, MPI_Fint *errorcode, MPI_Fint *ierr); void pmpi_comm_compare__(MPI_Fint *comm1, MPI_Fint *comm2, MPI_Fint *result, MPI_Fint *ierr); void pmpi_comm_connect__(char *port_name, MPI_Fint *info, MPI_Fint *root, MPI_Fint *comm, MPI_Fint *newcomm, MPI_Fint *ierr); -void pmpi_comm_create_errhandler__(void *function, MPI_Fint *errhandler, MPI_Fint *ierr); -void pmpi_comm_create_keyval__(void *comm_copy_attr_fn, void *comm_delete_attr_fn, MPI_Fint *comm_keyval, char *extra_state, MPI_Fint *ierr); +void pmpi_comm_create_errhandler__(ompi_errhandler_fortran_handler_fn_t* function, MPI_Fint *errhandler, MPI_Fint *ierr); +void pmpi_comm_create_keyval__(MPI_F_copy_function* comm_copy_attr_fn, MPI_F_delete_function* comm_delete_attr_fn, MPI_Fint *comm_keyval, char *extra_state, MPI_Fint *ierr); void pmpi_comm_create__(MPI_Fint *comm, MPI_Fint *group, MPI_Fint *newcomm, MPI_Fint *ierr); void pmpi_comm_delete_attr__(MPI_Fint *comm, MPI_Fint *comm_keyval, MPI_Fint *ierr); void pmpi_comm_disconnect__(MPI_Fint *comm, MPI_Fint *ierr); @@ -969,7 +969,7 @@ void pmpi_comm_spawn_multiple__(MPI_Fint *count, char *array_of_commands, char * void pmpi_comm_split__(MPI_Fint *comm, MPI_Fint *color, MPI_Fint *key, MPI_Fint *newcomm, MPI_Fint *ierr); void pmpi_comm_test_inter__(MPI_Fint *comm, MPI_Fint *flag, MPI_Fint *ierr); void pmpi_dims_create__(MPI_Fint *nnodes, MPI_Fint *ndims, MPI_Fint *dims, MPI_Fint *ierr); -void pmpi_errhandler_create__(void *function, MPI_Fint *errhandler, MPI_Fint *ierr); +void pmpi_errhandler_create__(ompi_errhandler_fortran_handler_fn_t* function, MPI_Fint *errhandler, MPI_Fint *ierr); void pmpi_errhandler_free__(MPI_Fint *errhandler, MPI_Fint *ierr); void pmpi_errhandler_get__(MPI_Fint *comm, MPI_Fint *errhandler, MPI_Fint *ierr); void pmpi_errhandler_set__(MPI_Fint *comm, MPI_Fint *errhandler, MPI_Fint *ierr); @@ -977,7 +977,7 @@ void pmpi_error_class__(MPI_Fint *errorcode, MPI_Fint *errorclass, MPI_Fint *ier void pmpi_error_string__(MPI_Fint *errorcode, char *string, MPI_Fint *resultlen, MPI_Fint *ierr); void pmpi_exscan__(char *sendbuf, char *recvbuf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *op, MPI_Fint *comm, MPI_Fint *ierr); void pmpi_file_call_errhandler__(MPI_Fint *fh, MPI_Fint *errorcode, MPI_Fint *ierr); -void pmpi_file_create_errhandler__(void *function, MPI_Fint *errhandler, MPI_Fint *ierr); +void pmpi_file_create_errhandler__(ompi_errhandler_fortran_handler_fn_t* function, MPI_Fint *errhandler, MPI_Fint *ierr); void pmpi_file_set_errhandler__(MPI_Fint *file, MPI_Fint *errhandler, MPI_Fint *ierr); void pmpi_file_get_errhandler__(MPI_Fint *file, MPI_Fint *errhandler, MPI_Fint *ierr); void pmpi_file_open__(MPI_Fint *comm, char *filename, MPI_Fint *amode, MPI_Fint *info, MPI_Fint *fh, MPI_Fint *ierr); @@ -1049,7 +1049,7 @@ void pmpi_graph_neighbors_count__(MPI_Fint *comm, MPI_Fint *rank, MPI_Fint *nnei void pmpi_graph_neighbors__(MPI_Fint *comm, MPI_Fint *rank, MPI_Fint *maxneighbors, MPI_Fint *neighbors, MPI_Fint *ierr); void pmpi_graphdims_get__(MPI_Fint *comm, MPI_Fint *nnodes, MPI_Fint *nedges, MPI_Fint *ierr); void pmpi_grequest_complete__(MPI_Fint *request, MPI_Fint *ierr); -void pmpi_grequest_start__(void *query_fn, void *free_fn, void *cancel_fn, char *extra_state, MPI_Fint *request, MPI_Fint *ierr); +void pmpi_grequest_start__(MPI_F_Grequest_query_function* query_fn, MPI_F_Grequest_free_function* free_fn, MPI_F_Grequest_cancel_function* cancel_fn, char *extra_state, MPI_Fint *request, MPI_Fint *ierr); void pmpi_group_compare__(MPI_Fint *group1, MPI_Fint *group2, MPI_Fint *result, MPI_Fint *ierr); void pmpi_group_difference__(MPI_Fint *group1, MPI_Fint *group2, MPI_Fint *newgroup, MPI_Fint *ierr); void pmpi_group_excl__(MPI_Fint *group, MPI_Fint *n, MPI_Fint *ranks, MPI_Fint *newgroup, MPI_Fint *ierr); @@ -1083,10 +1083,10 @@ void pmpi_irsend__(char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *des void pmpi_isend__(char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr); void pmpi_issend__(char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr); void pmpi_is_thread_main__(MPI_Fint *flag, MPI_Fint *ierr); -void pmpi_keyval_create__(void *copy_fn, void *delete_fn, MPI_Fint *keyval, char *extra_state, MPI_Fint *ierr); +void pmpi_keyval_create__(MPI_F_copy_function* copy_fn, MPI_F_delete_function* delete_fn, MPI_Fint *keyval, char *extra_state, MPI_Fint *ierr); void pmpi_keyval_free__(MPI_Fint *keyval, MPI_Fint *ierr); void pmpi_lookup_name__(char *service_name, MPI_Fint *info, char *port_name, MPI_Fint *ierr); -void pmpi_op_create__(void *function, MPI_Fint *commute, MPI_Fint *op, MPI_Fint *ierr); +void pmpi_op_create__(ompi_op_fortran_handler_fn_t* function, MPI_Fint *commute, MPI_Fint *op, MPI_Fint *ierr); void pmpi_open_port__(MPI_Fint *info, char *port_name, MPI_Fint *ierr); void pmpi_op_free__(MPI_Fint *op, MPI_Fint *ierr); void pmpi_pack_external__(char *datarep, char *inbuf, MPI_Fint *incount, MPI_Fint *datatype, char *outbuf, MPI_Fint *outsize, MPI_Fint *position, MPI_Fint *ierr); @@ -1134,7 +1134,7 @@ void pmpi_type_create_f90_integer__(MPI_Fint *r, MPI_Fint *newtype, MPI_Fint *ie void pmpi_type_create_f90_real__(MPI_Fint *p, MPI_Fint *r, MPI_Fint *newtype, MPI_Fint *ierr); void pmpi_type_create_hindexed__(MPI_Fint *count, MPI_Fint *array_of_blocklengths, MPI_Fint *array_of_displacements, MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr); void pmpi_type_create_hvector__(MPI_Fint *count, MPI_Fint *blocklength, MPI_Fint *stride, MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr); -void pmpi_type_create_keyval__(void *type_copy_attr_fn, void *type_delete_attr_fn, MPI_Fint *type_keyval, char *extra_state, MPI_Fint *ierr); +void pmpi_type_create_keyval__(MPI_F_copy_function* type_copy_attr_fn, MPI_F_delete_function* type_delete_attr_fn, MPI_Fint *type_keyval, char *extra_state, MPI_Fint *ierr); void pmpi_type_create_indexed_block__(MPI_Fint *count, MPI_Fint *blocklength, MPI_Fint *array_of_displacements, MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr); void pmpi_type_create_struct__(MPI_Fint *count, MPI_Fint *array_of_block_lengths, MPI_Fint *array_of_displacements, MPI_Fint *array_of_types, MPI_Fint *newtype, MPI_Fint *ierr); void pmpi_type_create_subarray__(MPI_Fint *ndims, MPI_Fint *size_array, MPI_Fint *subsize_array, MPI_Fint *start_array, MPI_Fint *order, MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr); @@ -1171,8 +1171,8 @@ void pmpi_waitsome__(MPI_Fint *incount, MPI_Fint *array_of_requests, MPI_Fint *o void pmpi_win_call_errhandler__(MPI_Fint *win, MPI_Fint *errorcode, MPI_Fint *ierr); void pmpi_win_complete__(MPI_Fint *win, MPI_Fint *ierr); void pmpi_win_create__(char *base, MPI_Fint *size, MPI_Fint *disp_unit, MPI_Fint *info, MPI_Fint *comm, MPI_Fint *win, MPI_Fint *ierr); -void pmpi_win_create_errhandler__(void *function, MPI_Fint *errhandler, MPI_Fint *ierr); -void pmpi_win_create_keyval__(void *win_copy_attr_fn, void *win_delete_attr_fn, MPI_Fint *win_keyval, char *extra_state, MPI_Fint *ierr); +void pmpi_win_create_errhandler__(ompi_errhandler_fortran_handler_fn_t* function, MPI_Fint *errhandler, MPI_Fint *ierr); +void pmpi_win_create_keyval__(MPI_F_copy_function* win_copy_attr_fn, MPI_F_delete_function* win_delete_attr_fn, MPI_Fint *win_keyval, char *extra_state, MPI_Fint *ierr); void pmpi_win_delete_attr__(MPI_Fint *win, MPI_Fint *win_keyval, MPI_Fint *ierr); void pmpi_win_fence__(MPI_Fint *assert, MPI_Fint *win, MPI_Fint *ierr); void pmpi_win_free__(MPI_Fint *win, MPI_Fint *ierr); @@ -1421,7 +1421,7 @@ void PMPI_TYPE_CREATE_F90_INTEGER(MPI_Fint *r, MPI_Fint *newtype, MPI_Fint *ierr void PMPI_TYPE_CREATE_F90_REAL(MPI_Fint *p, MPI_Fint *r, MPI_Fint *newtype, MPI_Fint *ierr); void PMPI_TYPE_CREATE_HINDEXED(MPI_Fint *count, MPI_Fint *array_of_blocklengths, MPI_Fint *array_of_displacements, MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr); void PMPI_TYPE_CREATE_HVECTOR(MPI_Fint *count, MPI_Fint *blocklength, MPI_Fint *stride, MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr); -void PMPI_TYPE_CREATE_KEYVAL(void *type_copy_attr_fn, void *type_delete_attr_fn, MPI_Fint *type_keyval, char *extra_state, MPI_Fint *ierr); +void PMPI_TYPE_CREATE_KEYVAL(void *type_copy_attr_fn, MPI_F_delete_function* type_delete_attr_fn, MPI_Fint *type_keyval, char *extra_state, MPI_Fint *ierr); void PMPI_TYPE_CREATE_INDEXED_BLOCK(MPI_Fint *count, MPI_Fint *blocklength, MPI_Fint *array_of_displacements, MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr); void PMPI_TYPE_CREATE_STRUCT(MPI_Fint *count, MPI_Fint *array_of_block_lengths, MPI_Fint *array_of_displacements, MPI_Fint *array_of_types, MPI_Fint *newtype, MPI_Fint *ierr); void PMPI_TYPE_CREATE_SUBARRAY(MPI_Fint *ndims, MPI_Fint *size_array, MPI_Fint *subsize_array, MPI_Fint *start_array, MPI_Fint *order, MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr); diff --git a/src/mpi/f77/prototypes_mpi.h b/src/mpi/f77/prototypes_mpi.h index 374a90a728..0156904fec 100644 --- a/src/mpi/f77/prototypes_mpi.h +++ b/src/mpi/f77/prototypes_mpi.h @@ -79,8 +79,8 @@ void mpi_comm_accept_f(char *port_name, MPI_Fint *info, MPI_Fint *root, MPI_Fint void mpi_comm_call_errhandler_f(MPI_Fint *comm, MPI_Fint *errorcode, MPI_Fint *ierr); void mpi_comm_compare_f(MPI_Fint *comm1, MPI_Fint *comm2, MPI_Fint *result, MPI_Fint *ierr); void mpi_comm_connect_f(char *port_name, MPI_Fint *info, MPI_Fint *root, MPI_Fint *comm, MPI_Fint *newcomm, MPI_Fint *ierr); -void mpi_comm_create_errhandler_f(void *function, MPI_Fint *errhandler, MPI_Fint *ierr); -void mpi_comm_create_keyval_f(void *comm_copy_attr_fn, void *comm_delete_attr_fn, MPI_Fint *comm_keyval, char *extra_state, MPI_Fint *ierr); +void mpi_comm_create_errhandler_f(ompi_errhandler_fortran_handler_fn_t* function, MPI_Fint *errhandler, MPI_Fint *ierr); +void mpi_comm_create_keyval_f(MPI_F_copy_function* comm_copy_attr_fn, MPI_F_delete_function* comm_delete_attr_fn, MPI_Fint *comm_keyval, char *extra_state, MPI_Fint *ierr); void mpi_comm_create_f(MPI_Fint *comm, MPI_Fint *group, MPI_Fint *newcomm, MPI_Fint *ierr); void mpi_comm_delete_attr_f(MPI_Fint *comm, MPI_Fint *comm_keyval, MPI_Fint *ierr); void mpi_comm_disconnect_f(MPI_Fint *comm, MPI_Fint *ierr); @@ -110,7 +110,7 @@ void mpi_comm_spawn_multiple_f(MPI_Fint *count, char *array_of_commands, char *a void mpi_comm_split_f(MPI_Fint *comm, MPI_Fint *color, MPI_Fint *key, MPI_Fint *newcomm, MPI_Fint *ierr); void mpi_comm_test_inter_f(MPI_Fint *comm, MPI_Fint *flag, MPI_Fint *ierr); void mpi_dims_create_f(MPI_Fint *nnodes, MPI_Fint *ndims, MPI_Fint *dims, MPI_Fint *ierr); -void mpi_errhandler_create_f(void *function, MPI_Fint *errhandler, MPI_Fint *ierr); +void mpi_errhandler_create_f(ompi_errhandler_fortran_handler_fn_t* function, MPI_Fint *errhandler, MPI_Fint *ierr); void mpi_errhandler_free_f(MPI_Fint *errhandler, MPI_Fint *ierr); void mpi_errhandler_get_f(MPI_Fint *comm, MPI_Fint *errhandler, MPI_Fint *ierr); void mpi_errhandler_set_f(MPI_Fint *comm, MPI_Fint *errhandler, MPI_Fint *ierr); @@ -118,7 +118,7 @@ void mpi_error_class_f(MPI_Fint *errorcode, MPI_Fint *errorclass, MPI_Fint *ierr void mpi_error_string_f(MPI_Fint *errorcode, char *string, MPI_Fint *resultlen, MPI_Fint *ierr); void mpi_exscan_f(char *sendbuf, char *recvbuf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *op, MPI_Fint *comm, MPI_Fint *ierr); void mpi_file_call_errhandler_f(MPI_Fint *fh, MPI_Fint *errorcode, MPI_Fint *ierr); -void mpi_file_create_errhandler_f(void *function, MPI_Fint *errhandler, MPI_Fint *ierr); +void mpi_file_create_errhandler_f(ompi_errhandler_fortran_handler_fn_t* function, MPI_Fint *errhandler, MPI_Fint *ierr); void mpi_file_set_errhandler_f(MPI_Fint *file, MPI_Fint *errhandler, MPI_Fint *ierr); void mpi_file_get_errhandler_f(MPI_Fint *file, MPI_Fint *errhandler, MPI_Fint *ierr); void mpi_file_open_f(MPI_Fint *comm, char *filename, MPI_Fint *amode, MPI_Fint *info, MPI_Fint *fh, MPI_Fint *ierr); @@ -190,7 +190,7 @@ void mpi_graph_neighbors_count_f(MPI_Fint *comm, MPI_Fint *rank, MPI_Fint *nneig void mpi_graph_neighbors_f(MPI_Fint *comm, MPI_Fint *rank, MPI_Fint *maxneighbors, MPI_Fint *neighbors, MPI_Fint *ierr); void mpi_graphdims_get_f(MPI_Fint *comm, MPI_Fint *nnodes, MPI_Fint *nedges, MPI_Fint *ierr); void mpi_grequest_complete_f(MPI_Fint *request, MPI_Fint *ierr); -void mpi_grequest_start_f(void *query_fn, void *free_fn, void *cancel_fn, char *extra_state, MPI_Fint *request, MPI_Fint *ierr); +void mpi_grequest_start_f(MPI_F_Grequest_query_function* query_fn, MPI_F_Grequest_free_function* free_fn, MPI_F_Grequest_cancel_function* cancel_fn, char *extra_state, MPI_Fint *request, MPI_Fint *ierr); void mpi_group_compare_f(MPI_Fint *group1, MPI_Fint *group2, MPI_Fint *result, MPI_Fint *ierr); void mpi_group_difference_f(MPI_Fint *group1, MPI_Fint *group2, MPI_Fint *newgroup, MPI_Fint *ierr); void mpi_group_excl_f(MPI_Fint *group, MPI_Fint *n, MPI_Fint *ranks, MPI_Fint *newgroup, MPI_Fint *ierr); @@ -224,10 +224,10 @@ void mpi_irsend_f(char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest void mpi_isend_f(char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr); void mpi_issend_f(char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr); void mpi_is_thread_main_f(MPI_Fint *flag, MPI_Fint *ierr); -void mpi_keyval_create_f(void *copy_fn, void *delete_fn, MPI_Fint *keyval, char *extra_state, MPI_Fint *ierr); +void mpi_keyval_create_f(MPI_F_copy_function* copy_fn, MPI_F_delete_function* delete_fn, MPI_Fint *keyval, char *extra_state, MPI_Fint *ierr); void mpi_keyval_free_f(MPI_Fint *keyval, MPI_Fint *ierr); void mpi_lookup_name_f(char *service_name, MPI_Fint *info, char *port_name, MPI_Fint *ierr); -void mpi_op_create_f(void *function, MPI_Fint *commute, MPI_Fint *op, MPI_Fint *ierr); +void mpi_op_create_f(ompi_op_fortran_handler_fn_t* function, MPI_Fint *commute, MPI_Fint *op, MPI_Fint *ierr); void mpi_open_port_f(MPI_Fint *info, char *port_name, MPI_Fint *ierr); void mpi_op_free_f(MPI_Fint *op, MPI_Fint *ierr); void mpi_pack_external_f(char *datarep, char *inbuf, MPI_Fint *incount, MPI_Fint *datatype, char *outbuf, MPI_Fint *outsize, MPI_Fint *position, MPI_Fint *ierr); @@ -275,7 +275,7 @@ void mpi_type_create_f90_integer_f(MPI_Fint *r, MPI_Fint *newtype, MPI_Fint *ier void mpi_type_create_f90_real_f(MPI_Fint *p, MPI_Fint *r, MPI_Fint *newtype, MPI_Fint *ierr); void mpi_type_create_hindexed_f(MPI_Fint *count, MPI_Fint *array_of_blocklengths, MPI_Fint *array_of_displacements, MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr); void mpi_type_create_hvector_f(MPI_Fint *count, MPI_Fint *blocklength, MPI_Fint *stride, MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr); -void mpi_type_create_keyval_f(void *type_copy_attr_fn, void *type_delete_attr_fn, MPI_Fint *type_keyval, char *extra_state, MPI_Fint *ierr); +void mpi_type_create_keyval_f(MPI_F_copy_function* type_copy_attr_fn, MPI_F_delete_function* type_delete_attr_fn, MPI_Fint *type_keyval, char *extra_state, MPI_Fint *ierr); void mpi_type_create_indexed_block_f(MPI_Fint *count, MPI_Fint *blocklength, MPI_Fint *array_of_displacements, MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr); void mpi_type_create_struct_f(MPI_Fint *count, MPI_Fint *array_of_block_lengths, MPI_Fint *array_of_displacements, MPI_Fint *array_of_types, MPI_Fint *newtype, MPI_Fint *ierr); void mpi_type_create_subarray_f(MPI_Fint *ndims, MPI_Fint *size_array, MPI_Fint *subsize_array, MPI_Fint *start_array, MPI_Fint *order, MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr); @@ -313,8 +313,8 @@ void mpi_waitsome_f(MPI_Fint *incount, MPI_Fint *array_of_requests, MPI_Fint *ou void mpi_win_call_errhandler_f(MPI_Fint *win, MPI_Fint *errorcode, MPI_Fint *ierr); void mpi_win_complete_f(MPI_Fint *win, MPI_Fint *ierr); void mpi_win_create_f(char *base, MPI_Fint *size, MPI_Fint *disp_unit, MPI_Fint *info, MPI_Fint *comm, MPI_Fint *win, MPI_Fint *ierr); -void mpi_win_create_errhandler_f(void *function, MPI_Fint *errhandler, MPI_Fint *ierr); -void mpi_win_create_keyval_f(void *win_copy_attr_fn, void *win_delete_attr_fn, MPI_Fint *win_keyval, char *extra_state, MPI_Fint *ierr); +void mpi_win_create_errhandler_f(ompi_errhandler_fortran_handler_fn_t* function, MPI_Fint *errhandler, MPI_Fint *ierr); +void mpi_win_create_keyval_f(MPI_F_copy_function* win_copy_attr_fn, MPI_F_delete_function* win_delete_attr_fn, MPI_Fint *win_keyval, char *extra_state, MPI_Fint *ierr); void mpi_win_delete_attr_f(MPI_Fint *win, MPI_Fint *win_keyval, MPI_Fint *ierr); void mpi_win_fence_f(MPI_Fint *assert, MPI_Fint *win, MPI_Fint *ierr); void mpi_win_free_f(MPI_Fint *win, MPI_Fint *ierr); @@ -388,8 +388,8 @@ void mpi_comm_accept(char *port_name, MPI_Fint *info, MPI_Fint *root, MPI_Fint * void mpi_comm_call_errhandler(MPI_Fint *comm, MPI_Fint *errorcode, MPI_Fint *ierr); void mpi_comm_compare(MPI_Fint *comm1, MPI_Fint *comm2, MPI_Fint *result, MPI_Fint *ierr); void mpi_comm_connect(char *port_name, MPI_Fint *info, MPI_Fint *root, MPI_Fint *comm, MPI_Fint *newcomm, MPI_Fint *ierr); -void mpi_comm_create_errhandler(void *function, MPI_Fint *errhandler, MPI_Fint *ierr); -void mpi_comm_create_keyval(void *comm_copy_attr_fn, void *comm_delete_attr_fn, MPI_Fint *comm_keyval, char *extra_state, MPI_Fint *ierr); +void mpi_comm_create_errhandler(ompi_errhandler_fortran_handler_fn_t* function, MPI_Fint *errhandler, MPI_Fint *ierr); +void mpi_comm_create_keyval(MPI_F_copy_function* comm_copy_attr_fn, MPI_F_delete_function* comm_delete_attr_fn, MPI_Fint *comm_keyval, char *extra_state, MPI_Fint *ierr); void mpi_comm_create(MPI_Fint *comm, MPI_Fint *group, MPI_Fint *newcomm, MPI_Fint *ierr); void mpi_comm_delete_attr(MPI_Fint *comm, MPI_Fint *comm_keyval, MPI_Fint *ierr); void mpi_comm_disconnect(MPI_Fint *comm, MPI_Fint *ierr); @@ -414,7 +414,7 @@ void mpi_comm_spawn_multiple(MPI_Fint *count, char *array_of_commands, char *arr void mpi_comm_split(MPI_Fint *comm, MPI_Fint *color, MPI_Fint *key, MPI_Fint *newcomm, MPI_Fint *ierr); void mpi_comm_test_inter(MPI_Fint *comm, MPI_Fint *flag, MPI_Fint *ierr); void mpi_dims_create(MPI_Fint *nnodes, MPI_Fint *ndims, MPI_Fint *dims, MPI_Fint *ierr); -void mpi_errhandler_create(void *function, MPI_Fint *errhandler, MPI_Fint *ierr); +void mpi_errhandler_create(ompi_errhandler_fortran_handler_fn_t* function, MPI_Fint *errhandler, MPI_Fint *ierr); void mpi_errhandler_free(MPI_Fint *errhandler, MPI_Fint *ierr); void mpi_errhandler_get(MPI_Fint *comm, MPI_Fint *errhandler, MPI_Fint *ierr); void mpi_errhandler_set(MPI_Fint *comm, MPI_Fint *errhandler, MPI_Fint *ierr); @@ -422,7 +422,7 @@ void mpi_error_class(MPI_Fint *errorcode, MPI_Fint *errorclass, MPI_Fint *ierr); void mpi_error_string(MPI_Fint *errorcode, char *string, MPI_Fint *resultlen, MPI_Fint *ierr); void mpi_exscan(char *sendbuf, char *recvbuf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *op, MPI_Fint *comm, MPI_Fint *ierr); void mpi_file_call_errhandler(MPI_Fint *fh, MPI_Fint *errorcode, MPI_Fint *ierr); -void mpi_file_create_errhandler(void *function, MPI_Fint *errhandler, MPI_Fint *ierr); +void mpi_file_create_errhandler(ompi_errhandler_fortran_handler_fn_t* function, MPI_Fint *errhandler, MPI_Fint *ierr); void mpi_file_set_errhandler(MPI_Fint *file, MPI_Fint *errhandler, MPI_Fint *ierr); void mpi_file_get_errhandler(MPI_Fint *file, MPI_Fint *errhandler, MPI_Fint *ierr); void mpi_file_open(MPI_Fint *comm, char *filename, MPI_Fint *amode, MPI_Fint *info, MPI_Fint *fh, MPI_Fint *ierr); @@ -494,7 +494,7 @@ void mpi_graph_neighbors_count(MPI_Fint *comm, MPI_Fint *rank, MPI_Fint *nneighb void mpi_graph_neighbors(MPI_Fint *comm, MPI_Fint *rank, MPI_Fint *maxneighbors, MPI_Fint *neighbors, MPI_Fint *ierr); void mpi_graphdims_get(MPI_Fint *comm, MPI_Fint *nnodes, MPI_Fint *nedges, MPI_Fint *ierr); void mpi_grequest_complete(MPI_Fint *request, MPI_Fint *ierr); -void mpi_grequest_start(void *query_fn, void *free_fn, void *cancel_fn, char *extra_state, MPI_Fint *request, MPI_Fint *ierr); +void mpi_grequest_start(MPI_F_Grequest_query_function* query_fn, MPI_F_Grequest_free_function* free_fn, MPI_F_Grequest_cancel_function* cancel_fn, char *extra_state, MPI_Fint *request, MPI_Fint *ierr); void mpi_group_compare(MPI_Fint *group1, MPI_Fint *group2, MPI_Fint *result, MPI_Fint *ierr); void mpi_group_difference(MPI_Fint *group1, MPI_Fint *group2, MPI_Fint *newgroup, MPI_Fint *ierr); void mpi_group_excl(MPI_Fint *group, MPI_Fint *n, MPI_Fint *ranks, MPI_Fint *newgroup, MPI_Fint *ierr); @@ -528,10 +528,10 @@ void mpi_irsend(char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, void mpi_isend(char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr); void mpi_issend(char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr); void mpi_is_thread_main(MPI_Fint *flag, MPI_Fint *ierr); -void mpi_keyval_create(void *copy_fn, void *delete_fn, MPI_Fint *keyval, char *extra_state, MPI_Fint *ierr); +void mpi_keyval_create(MPI_F_copy_function* copy_fn, MPI_F_delete_function* delete_fn, MPI_Fint *keyval, char *extra_state, MPI_Fint *ierr); void mpi_keyval_free(MPI_Fint *keyval, MPI_Fint *ierr); void mpi_lookup_name(char *service_name, MPI_Fint *info, char *port_name, MPI_Fint *ierr); -void mpi_op_create(void *function, MPI_Fint *commute, MPI_Fint *op, MPI_Fint *ierr); +void mpi_op_create(ompi_op_fortran_handler_fn_t* function, MPI_Fint *commute, MPI_Fint *op, MPI_Fint *ierr); void mpi_open_port(MPI_Fint *info, char *port_name, MPI_Fint *ierr); void mpi_op_free(MPI_Fint *op, MPI_Fint *ierr); void mpi_pack_external(char *datarep, char *inbuf, MPI_Fint *incount, MPI_Fint *datatype, char *outbuf, MPI_Fint *outsize, MPI_Fint *position, MPI_Fint *ierr); @@ -579,7 +579,7 @@ void mpi_type_create_f90_integer(MPI_Fint *r, MPI_Fint *newtype, MPI_Fint *ierr) void mpi_type_create_f90_real(MPI_Fint *p, MPI_Fint *r, MPI_Fint *newtype, MPI_Fint *ierr); void mpi_type_create_hindexed(MPI_Fint *count, MPI_Fint *array_of_blocklengths, MPI_Fint *array_of_displacements, MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr); void mpi_type_create_hvector(MPI_Fint *count, MPI_Fint *blocklength, MPI_Fint *stride, MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr); -void mpi_type_create_keyval(void *type_copy_attr_fn, void *type_delete_attr_fn, MPI_Fint *type_keyval, char *extra_state, MPI_Fint *ierr); +void mpi_type_create_keyval(MPI_F_copy_function* type_copy_attr_fn, MPI_F_delete_function* type_delete_attr_fn, MPI_Fint *type_keyval, char *extra_state, MPI_Fint *ierr); void mpi_type_create_indexed_block(MPI_Fint *count, MPI_Fint *blocklength, MPI_Fint *array_of_displacements, MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr); void mpi_type_create_struct(MPI_Fint *count, MPI_Fint *array_of_block_lengths, MPI_Fint *array_of_displacements, MPI_Fint *array_of_types, MPI_Fint *newtype, MPI_Fint *ierr); void mpi_type_create_subarray(MPI_Fint *ndims, MPI_Fint *size_array, MPI_Fint *subsize_array, MPI_Fint *start_array, MPI_Fint *order, MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr); @@ -616,8 +616,8 @@ void mpi_waitsome(MPI_Fint *incount, MPI_Fint *array_of_requests, MPI_Fint *outc void mpi_win_call_errhandler(MPI_Fint *win, MPI_Fint *errorcode, MPI_Fint *ierr); void mpi_win_complete(MPI_Fint *win, MPI_Fint *ierr); void mpi_win_create(char *base, MPI_Fint *size, MPI_Fint *disp_unit, MPI_Fint *info, MPI_Fint *comm, MPI_Fint *win, MPI_Fint *ierr); -void mpi_win_create_errhandler(void *function, MPI_Fint *errhandler, MPI_Fint *ierr); -void mpi_win_create_keyval(void *win_copy_attr_fn, void *win_delete_attr_fn, MPI_Fint *win_keyval, char *extra_state, MPI_Fint *ierr); +void mpi_win_create_errhandler(ompi_errhandler_fortran_handler_fn_t* function, MPI_Fint *errhandler, MPI_Fint *ierr); +void mpi_win_create_keyval(MPI_F_copy_function* win_copy_attr_fn, MPI_F_delete_function* win_delete_attr_fn, MPI_Fint *win_keyval, char *extra_state, MPI_Fint *ierr); void mpi_win_delete_attr(MPI_Fint *win, MPI_Fint *win_keyval, MPI_Fint *ierr); void mpi_win_fence(MPI_Fint *assert, MPI_Fint *win, MPI_Fint *ierr); void mpi_win_free(MPI_Fint *win, MPI_Fint *ierr); @@ -689,8 +689,8 @@ void mpi_comm_accept_(char *port_name, MPI_Fint *info, MPI_Fint *root, MPI_Fint void mpi_comm_call_errhandler_(MPI_Fint *comm, MPI_Fint *errorcode, MPI_Fint *ierr); void mpi_comm_compare_(MPI_Fint *comm1, MPI_Fint *comm2, MPI_Fint *result, MPI_Fint *ierr); void mpi_comm_connect_(char *port_name, MPI_Fint *info, MPI_Fint *root, MPI_Fint *comm, MPI_Fint *newcomm, MPI_Fint *ierr); -void mpi_comm_create_errhandler_(void *function, MPI_Fint *errhandler, MPI_Fint *ierr); -void mpi_comm_create_keyval_(void *comm_copy_attr_fn, void *comm_delete_attr_fn, MPI_Fint *comm_keyval, char *extra_state, MPI_Fint *ierr); +void mpi_comm_create_errhandler_(ompi_errhandler_fortran_handler_fn_t* function, MPI_Fint *errhandler, MPI_Fint *ierr); +void mpi_comm_create_keyval_(MPI_F_copy_function* comm_copy_attr_fn, MPI_F_delete_function* comm_delete_attr_fn, MPI_Fint *comm_keyval, char *extra_state, MPI_Fint *ierr); void mpi_comm_create_(MPI_Fint *comm, MPI_Fint *group, MPI_Fint *newcomm, MPI_Fint *ierr); void mpi_comm_delete_attr_(MPI_Fint *comm, MPI_Fint *comm_keyval, MPI_Fint *ierr); void mpi_comm_disconnect_(MPI_Fint *comm, MPI_Fint *ierr); @@ -715,7 +715,7 @@ void mpi_comm_spawn_multiple_(MPI_Fint *count, char *array_of_commands, char *ar void mpi_comm_split_(MPI_Fint *comm, MPI_Fint *color, MPI_Fint *key, MPI_Fint *newcomm, MPI_Fint *ierr); void mpi_comm_test_inter_(MPI_Fint *comm, MPI_Fint *flag, MPI_Fint *ierr); void mpi_dims_create_(MPI_Fint *nnodes, MPI_Fint *ndims, MPI_Fint *dims, MPI_Fint *ierr); -void mpi_errhandler_create_(void *function, MPI_Fint *errhandler, MPI_Fint *ierr); +void mpi_errhandler_create_(ompi_errhandler_fortran_handler_fn_t* function, MPI_Fint *errhandler, MPI_Fint *ierr); void mpi_errhandler_free_(MPI_Fint *errhandler, MPI_Fint *ierr); void mpi_errhandler_get_(MPI_Fint *comm, MPI_Fint *errhandler, MPI_Fint *ierr); void mpi_errhandler_set_(MPI_Fint *comm, MPI_Fint *errhandler, MPI_Fint *ierr); @@ -723,7 +723,7 @@ void mpi_error_class_(MPI_Fint *errorcode, MPI_Fint *errorclass, MPI_Fint *ierr) void mpi_error_string_(MPI_Fint *errorcode, char *string, MPI_Fint *resultlen, MPI_Fint *ierr); void mpi_exscan_(char *sendbuf, char *recvbuf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *op, MPI_Fint *comm, MPI_Fint *ierr); void mpi_file_call_errhandler_(MPI_Fint *fh, MPI_Fint *errorcode, MPI_Fint *ierr); -void mpi_file_create_errhandler_(void *function, MPI_Fint *errhandler, MPI_Fint *ierr); +void mpi_file_create_errhandler_(ompi_errhandler_fortran_handler_fn_t* function, MPI_Fint *errhandler, MPI_Fint *ierr); void mpi_file_set_errhandler_(MPI_Fint *file, MPI_Fint *errhandler, MPI_Fint *ierr); void mpi_file_get_errhandler_(MPI_Fint *file, MPI_Fint *errhandler, MPI_Fint *ierr); void mpi_file_open_(MPI_Fint *comm, char *filename, MPI_Fint *amode, MPI_Fint *info, MPI_Fint *fh, MPI_Fint *ierr); @@ -795,7 +795,7 @@ void mpi_graph_neighbors_count_(MPI_Fint *comm, MPI_Fint *rank, MPI_Fint *nneigh void mpi_graph_neighbors_(MPI_Fint *comm, MPI_Fint *rank, MPI_Fint *maxneighbors, MPI_Fint *neighbors, MPI_Fint *ierr); void mpi_graphdims_get_(MPI_Fint *comm, MPI_Fint *nnodes, MPI_Fint *nedges, MPI_Fint *ierr); void mpi_grequest_complete_(MPI_Fint *request, MPI_Fint *ierr); -void mpi_grequest_start_(void *query_fn, void *free_fn, void *cancel_fn, char *extra_state, MPI_Fint *request, MPI_Fint *ierr); +void mpi_grequest_start_(MPI_F_Grequest_query_function* query_fn, MPI_F_Grequest_free_function* free_fn, MPI_F_Grequest_cancel_function* cancel_fn, char *extra_state, MPI_Fint *request, MPI_Fint *ierr); void mpi_group_compare_(MPI_Fint *group1, MPI_Fint *group2, MPI_Fint *result, MPI_Fint *ierr); void mpi_group_difference_(MPI_Fint *group1, MPI_Fint *group2, MPI_Fint *newgroup, MPI_Fint *ierr); void mpi_group_excl_(MPI_Fint *group, MPI_Fint *n, MPI_Fint *ranks, MPI_Fint *newgroup, MPI_Fint *ierr); @@ -829,10 +829,10 @@ void mpi_irsend_(char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, void mpi_isend_(char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr); void mpi_issend_(char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr); void mpi_is_thread_main_(MPI_Fint *flag, MPI_Fint *ierr); -void mpi_keyval_create_(void *copy_fn, void *delete_fn, MPI_Fint *keyval, char *extra_state, MPI_Fint *ierr); +void mpi_keyval_create_(MPI_F_copy_function* copy_fn, MPI_F_delete_function* delete_fn, MPI_Fint *keyval, char *extra_state, MPI_Fint *ierr); void mpi_keyval_free_(MPI_Fint *keyval, MPI_Fint *ierr); void mpi_lookup_name_(char *service_name, MPI_Fint *info, char *port_name, MPI_Fint *ierr); -void mpi_op_create_(void *function, MPI_Fint *commute, MPI_Fint *op, MPI_Fint *ierr); +void mpi_op_create_(ompi_op_fortran_handler_fn_t* function, MPI_Fint *commute, MPI_Fint *op, MPI_Fint *ierr); void mpi_open_port_(MPI_Fint *info, char *port_name, MPI_Fint *ierr); void mpi_op_free_(MPI_Fint *op, MPI_Fint *ierr); void mpi_pack_external_(char *datarep, char *inbuf, MPI_Fint *incount, MPI_Fint *datatype, char *outbuf, MPI_Fint *outsize, MPI_Fint *position, MPI_Fint *ierr); @@ -880,7 +880,7 @@ void mpi_type_create_f90_integer_(MPI_Fint *r, MPI_Fint *newtype, MPI_Fint *ierr void mpi_type_create_f90_real_(MPI_Fint *p, MPI_Fint *r, MPI_Fint *newtype, MPI_Fint *ierr); void mpi_type_create_hindexed_(MPI_Fint *count, MPI_Fint *array_of_blocklengths, MPI_Fint *array_of_displacements, MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr); void mpi_type_create_hvector_(MPI_Fint *count, MPI_Fint *blocklength, MPI_Fint *stride, MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr); -void mpi_type_create_keyval_(void *type_copy_attr_fn, void *type_delete_attr_fn, MPI_Fint *type_keyval, char *extra_state, MPI_Fint *ierr); +void mpi_type_create_keyval_(MPI_F_copy_function* type_copy_attr_fn, MPI_F_delete_function* type_delete_attr_fn, MPI_Fint *type_keyval, char *extra_state, MPI_Fint *ierr); void mpi_type_create_indexed_block_(MPI_Fint *count, MPI_Fint *blocklength, MPI_Fint *array_of_displacements, MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr); void mpi_type_create_struct_(MPI_Fint *count, MPI_Fint *array_of_block_lengths, MPI_Fint *array_of_displacements, MPI_Fint *array_of_types, MPI_Fint *newtype, MPI_Fint *ierr); void mpi_type_create_subarray_(MPI_Fint *ndims, MPI_Fint *size_array, MPI_Fint *subsize_array, MPI_Fint *start_array, MPI_Fint *order, MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr); @@ -917,8 +917,8 @@ void mpi_waitsome_(MPI_Fint *incount, MPI_Fint *array_of_requests, MPI_Fint *out void mpi_win_call_errhandler_(MPI_Fint *win, MPI_Fint *errorcode, MPI_Fint *ierr); void mpi_win_complete_(MPI_Fint *win, MPI_Fint *ierr); void mpi_win_create_(char *base, MPI_Fint *size, MPI_Fint *disp_unit, MPI_Fint *info, MPI_Fint *comm, MPI_Fint *win, MPI_Fint *ierr); -void mpi_win_create_errhandler_(void *function, MPI_Fint *errhandler, MPI_Fint *ierr); -void mpi_win_create_keyval_(void *win_copy_attr_fn, void *win_delete_attr_fn, MPI_Fint *win_keyval, char *extra_state, MPI_Fint *ierr); +void mpi_win_create_errhandler_(ompi_errhandler_fortran_handler_fn_t* function, MPI_Fint *errhandler, MPI_Fint *ierr); +void mpi_win_create_keyval_(MPI_F_copy_function* win_copy_attr_fn, MPI_F_delete_function* win_delete_attr_fn, MPI_Fint *win_keyval, char *extra_state, MPI_Fint *ierr); void mpi_win_delete_attr_(MPI_Fint *win, MPI_Fint *win_keyval, MPI_Fint *ierr); void mpi_win_fence_(MPI_Fint *assert, MPI_Fint *win, MPI_Fint *ierr); void mpi_win_free_(MPI_Fint *win, MPI_Fint *ierr); @@ -990,8 +990,8 @@ void mpi_comm_accept__(char *port_name, MPI_Fint *info, MPI_Fint *root, MPI_Fint void mpi_comm_call_errhandler__(MPI_Fint *comm, MPI_Fint *errorcode, MPI_Fint *ierr); void mpi_comm_compare__(MPI_Fint *comm1, MPI_Fint *comm2, MPI_Fint *result, MPI_Fint *ierr); void mpi_comm_connect__(char *port_name, MPI_Fint *info, MPI_Fint *root, MPI_Fint *comm, MPI_Fint *newcomm, MPI_Fint *ierr); -void mpi_comm_create_errhandler__(void *function, MPI_Fint *errhandler, MPI_Fint *ierr); -void mpi_comm_create_keyval__(void *comm_copy_attr_fn, void *comm_delete_attr_fn, MPI_Fint *comm_keyval, char *extra_state, MPI_Fint *ierr); +void mpi_comm_create_errhandler__(ompi_errhandler_fortran_handler_fn_t* function, MPI_Fint *errhandler, MPI_Fint *ierr); +void mpi_comm_create_keyval__(MPI_F_copy_function* comm_copy_attr_fn, MPI_F_delete_function* comm_delete_attr_fn, MPI_Fint *comm_keyval, char *extra_state, MPI_Fint *ierr); void mpi_comm_create__(MPI_Fint *comm, MPI_Fint *group, MPI_Fint *newcomm, MPI_Fint *ierr); void mpi_comm_delete_attr__(MPI_Fint *comm, MPI_Fint *comm_keyval, MPI_Fint *ierr); void mpi_comm_disconnect__(MPI_Fint *comm, MPI_Fint *ierr); @@ -1016,7 +1016,7 @@ void mpi_comm_spawn_multiple__(MPI_Fint *count, char *array_of_commands, char *a void mpi_comm_split__(MPI_Fint *comm, MPI_Fint *color, MPI_Fint *key, MPI_Fint *newcomm, MPI_Fint *ierr); void mpi_comm_test_inter__(MPI_Fint *comm, MPI_Fint *flag, MPI_Fint *ierr); void mpi_dims_create__(MPI_Fint *nnodes, MPI_Fint *ndims, MPI_Fint *dims, MPI_Fint *ierr); -void mpi_errhandler_create__(void *function, MPI_Fint *errhandler, MPI_Fint *ierr); +void mpi_errhandler_create__(ompi_errhandler_fortran_handler_fn_t* function, MPI_Fint *errhandler, MPI_Fint *ierr); void mpi_errhandler_free__(MPI_Fint *errhandler, MPI_Fint *ierr); void mpi_errhandler_get__(MPI_Fint *comm, MPI_Fint *errhandler, MPI_Fint *ierr); void mpi_errhandler_set__(MPI_Fint *comm, MPI_Fint *errhandler, MPI_Fint *ierr); @@ -1024,7 +1024,7 @@ void mpi_error_class__(MPI_Fint *errorcode, MPI_Fint *errorclass, MPI_Fint *ierr void mpi_error_string__(MPI_Fint *errorcode, char *string, MPI_Fint *resultlen, MPI_Fint *ierr); void mpi_exscan__(char *sendbuf, char *recvbuf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *op, MPI_Fint *comm, MPI_Fint *ierr); void mpi_file_call_errhandler__(MPI_Fint *fh, MPI_Fint *errorcode, MPI_Fint *ierr); -void mpi_file_create_errhandler__(void *function, MPI_Fint *errhandler, MPI_Fint *ierr); +void mpi_file_create_errhandler__(ompi_errhandler_fortran_handler_fn_t* function, MPI_Fint *errhandler, MPI_Fint *ierr); void mpi_file_set_errhandler__(MPI_Fint *file, MPI_Fint *errhandler, MPI_Fint *ierr); void mpi_file_get_errhandler__(MPI_Fint *file, MPI_Fint *errhandler, MPI_Fint *ierr); void mpi_file_open__(MPI_Fint *comm, char *filename, MPI_Fint *amode, MPI_Fint *info, MPI_Fint *fh, MPI_Fint *ierr); @@ -1096,7 +1096,7 @@ void mpi_graph_neighbors_count__(MPI_Fint *comm, MPI_Fint *rank, MPI_Fint *nneig void mpi_graph_neighbors__(MPI_Fint *comm, MPI_Fint *rank, MPI_Fint *maxneighbors, MPI_Fint *neighbors, MPI_Fint *ierr); void mpi_graphdims_get__(MPI_Fint *comm, MPI_Fint *nnodes, MPI_Fint *nedges, MPI_Fint *ierr); void mpi_grequest_complete__(MPI_Fint *request, MPI_Fint *ierr); -void mpi_grequest_start__(void *query_fn, void *free_fn, void *cancel_fn, char *extra_state, MPI_Fint *request, MPI_Fint *ierr); +void mpi_grequest_start__(MPI_F_Grequest_query_function* query_fn, MPI_F_Grequest_free_function* free_fn, MPI_F_Grequest_cancel_function* cancel_fn, char *extra_state, MPI_Fint *request, MPI_Fint *ierr); void mpi_group_compare__(MPI_Fint *group1, MPI_Fint *group2, MPI_Fint *result, MPI_Fint *ierr); void mpi_group_difference__(MPI_Fint *group1, MPI_Fint *group2, MPI_Fint *newgroup, MPI_Fint *ierr); void mpi_group_excl__(MPI_Fint *group, MPI_Fint *n, MPI_Fint *ranks, MPI_Fint *newgroup, MPI_Fint *ierr); @@ -1130,10 +1130,10 @@ void mpi_irsend__(char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest void mpi_isend__(char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr); void mpi_issend__(char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr); void mpi_is_thread_main__(MPI_Fint *flag, MPI_Fint *ierr); -void mpi_keyval_create__(void *copy_fn, void *delete_fn, MPI_Fint *keyval, char *extra_state, MPI_Fint *ierr); +void mpi_keyval_create__(MPI_F_copy_function* copy_fn, MPI_F_delete_function* delete_fn, MPI_Fint *keyval, char *extra_state, MPI_Fint *ierr); void mpi_keyval_free__(MPI_Fint *keyval, MPI_Fint *ierr); void mpi_lookup_name__(char *service_name, MPI_Fint *info, char *port_name, MPI_Fint *ierr); -void mpi_op_create__(void *function, MPI_Fint *commute, MPI_Fint *op, MPI_Fint *ierr); +void mpi_op_create__(ompi_op_fortran_handler_fn_t* function, MPI_Fint *commute, MPI_Fint *op, MPI_Fint *ierr); void mpi_open_port__(MPI_Fint *info, char *port_name, MPI_Fint *ierr); void mpi_op_free__(MPI_Fint *op, MPI_Fint *ierr); void mpi_pack_external__(char *datarep, char *inbuf, MPI_Fint *incount, MPI_Fint *datatype, char *outbuf, MPI_Fint *outsize, MPI_Fint *position, MPI_Fint *ierr); @@ -1181,7 +1181,7 @@ void mpi_type_create_f90_integer__(MPI_Fint *r, MPI_Fint *newtype, MPI_Fint *ier void mpi_type_create_f90_real__(MPI_Fint *p, MPI_Fint *r, MPI_Fint *newtype, MPI_Fint *ierr); void mpi_type_create_hindexed__(MPI_Fint *count, MPI_Fint *array_of_blocklengths, MPI_Fint *array_of_displacements, MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr); void mpi_type_create_hvector__(MPI_Fint *count, MPI_Fint *blocklength, MPI_Fint *stride, MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr); -void mpi_type_create_keyval__(void *type_copy_attr_fn, void *type_delete_attr_fn, MPI_Fint *type_keyval, char *extra_state, MPI_Fint *ierr); +void mpi_type_create_keyval__(MPI_F_copy_function* type_copy_attr_fn, MPI_F_delete_function* type_delete_attr_fn, MPI_Fint *type_keyval, char *extra_state, MPI_Fint *ierr); void mpi_type_create_indexed_block__(MPI_Fint *count, MPI_Fint *blocklength, MPI_Fint *array_of_displacements, MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr); void mpi_type_create_struct__(MPI_Fint *count, MPI_Fint *array_of_block_lengths, MPI_Fint *array_of_displacements, MPI_Fint *array_of_types, MPI_Fint *newtype, MPI_Fint *ierr); void mpi_type_create_subarray__(MPI_Fint *ndims, MPI_Fint *size_array, MPI_Fint *subsize_array, MPI_Fint *start_array, MPI_Fint *order, MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr); @@ -1218,8 +1218,8 @@ void mpi_waitsome__(MPI_Fint *incount, MPI_Fint *array_of_requests, MPI_Fint *ou void mpi_win_call_errhandler__(MPI_Fint *win, MPI_Fint *errorcode, MPI_Fint *ierr); void mpi_win_complete__(MPI_Fint *win, MPI_Fint *ierr); void mpi_win_create__(char *base, MPI_Fint *size, MPI_Fint *disp_unit, MPI_Fint *info, MPI_Fint *comm, MPI_Fint *win, MPI_Fint *ierr); -void mpi_win_create_errhandler__(void *function, MPI_Fint *errhandler, MPI_Fint *ierr); -void mpi_win_create_keyval__(void *win_copy_attr_fn, void *win_delete_attr_fn, MPI_Fint *win_keyval, char *extra_state, MPI_Fint *ierr); +void mpi_win_create_errhandler__(ompi_errhandler_fortran_handler_fn_t* function, MPI_Fint *errhandler, MPI_Fint *ierr); +void mpi_win_create_keyval__(MPI_F_copy_function* win_copy_attr_fn, MPI_F_delete_function* win_delete_attr_fn, MPI_Fint *win_keyval, char *extra_state, MPI_Fint *ierr); void mpi_win_delete_attr__(MPI_Fint *win, MPI_Fint *win_keyval, MPI_Fint *ierr); void mpi_win_fence__(MPI_Fint *assert, MPI_Fint *win, MPI_Fint *ierr); void mpi_win_free__(MPI_Fint *win, MPI_Fint *ierr); diff --git a/src/mpi/f77/publish_name_f.c b/src/mpi/f77/publish_name_f.c index ddc3bb540f..8501434f69 100644 --- a/src/mpi/f77/publish_name_f.c +++ b/src/mpi/f77/publish_name_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/put_f.c b/src/mpi/f77/put_f.c index b67236b883..9439a36607 100644 --- a/src/mpi/f77/put_f.c +++ b/src/mpi/f77/put_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER @@ -61,15 +60,15 @@ void mpi_put_f(char *origin_addr, MPI_Fint *origin_count, MPI_Fint *target_disp, MPI_Fint *target_count, MPI_Fint *target_datatype, MPI_Fint *win, MPI_Fint *ierr) { - MPI_Datatype c_origin_datatype = MPI_Type_f2c(*origin_datatype); - MPI_Datatype c_target_datatype = MPI_Type_f2c(*target_datatype); - MPI_Win c_win = MPI_Win_f2c(*win); + MPI_Datatype c_origin_datatype = MPI_Type_f2c(*origin_datatype); + MPI_Datatype c_target_datatype = MPI_Type_f2c(*target_datatype); + MPI_Win c_win = MPI_Win_f2c(*win); - *ierr = OMPI_INT_2_FINT(MPI_Put(origin_addr, - OMPI_FINT_2_INT(*origin_count), - c_origin_datatype, - OMPI_FINT_2_INT(*target_rank), - (MPI_Aint) *target_disp, - OMPI_FINT_2_INT(*target_count), - c_target_datatype, c_win)); + *ierr = OMPI_INT_2_FINT(MPI_Put(OMPI_ADDR(origin_addr), + OMPI_FINT_2_INT(*origin_count), + c_origin_datatype, + OMPI_FINT_2_INT(*target_rank), + (MPI_Aint) *target_disp, + OMPI_FINT_2_INT(*target_count), + c_target_datatype, c_win)); } diff --git a/src/mpi/f77/query_thread_f.c b/src/mpi/f77/query_thread_f.c index 6c493d92b5..f9f3efee16 100644 --- a/src/mpi/f77/query_thread_f.c +++ b/src/mpi/f77/query_thread_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/recv_f.c b/src/mpi/f77/recv_f.c index 88b01ac99a..311e6ca31f 100644 --- a/src/mpi/f77/recv_f.c +++ b/src/mpi/f77/recv_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #include "mpi/f77/constants.h" #include "errhandler/errhandler.h" @@ -64,51 +63,36 @@ void mpi_recv_f(char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *source, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *status, MPI_Fint *ierr) { - MPI_Status *c_status; - int c_err; + MPI_Status *c_status; #if OMPI_SIZEOF_FORTRAN_INT != SIZEOF_INT - MPI_Status c_status2; + MPI_Status c_status2; #endif - MPI_Comm c_comm = MPI_Comm_f2c(*comm); - MPI_Datatype c_type = MPI_Type_f2c(*datatype); + MPI_Comm c_comm = MPI_Comm_f2c(*comm); + MPI_Datatype c_type = MPI_Type_f2c(*datatype); - /* Only check for the bad value if we're checking MPI parameters */ - - if (MPI_PARAM_CHECK) { - if (OMPI_IS_FORTRAN_STATUSES_IGNORE(status)) { - c_err = OMPI_ERRHANDLER_INVOKE(c_comm, MPI_ERR_ARG, - "MPI_RECV"); - *ierr = OMPI_INT_2_FINT(c_err); - return; - } - } - - /* See if we got MPI_STATUS_IGNORE */ - - if (OMPI_IS_FORTRAN_STATUS_IGNORE(status)) { - c_status = MPI_STATUS_IGNORE; - } else { - - /* If sizeof(int) == sizeof(INTEGER), then there's no - translation necessary -- let the underlying functions write - directly into the Fortran status */ + /* See if we got MPI_STATUS_IGNORE */ + if (OMPI_IS_FORTRAN_STATUS_IGNORE(status)) { + c_status = MPI_STATUS_IGNORE; + } else { + /* If sizeof(int) == sizeof(INTEGER), then there's no + translation necessary -- let the underlying functions write + directly into the Fortran status */ #if OMPI_SIZEOF_FORTRAN_INT == SIZEOF_INT - c_status = (MPI_Status *) status; + c_status = (MPI_Status *) status; #else - c_status = &c_status2; + c_status = &c_status2; #endif - } + } - /* Call the C function */ - - *ierr = OMPI_INT_2_FINT(MPI_Recv(buf, OMPI_FINT_2_INT(*count), c_type, - OMPI_FINT_2_INT(*source), - OMPI_FINT_2_INT(*tag), c_comm, - c_status)); + /* Call the C function */ + *ierr = OMPI_INT_2_FINT(MPI_Recv(OMPI_ADDR(buf), OMPI_FINT_2_INT(*count), + c_type, OMPI_FINT_2_INT(*source), + OMPI_FINT_2_INT(*tag), c_comm, + c_status)); #if OMPI_SIZEOF_FORTRAN_INT != SIZEOF_INT - if (MPI_STATUS_IGNORE != c_status) { - MPI_Status_c2f(c_status, status); - } + if (MPI_STATUS_IGNORE != c_status) { + MPI_Status_c2f(c_status, status); + } #endif } diff --git a/src/mpi/f77/recv_init_f.c b/src/mpi/f77/recv_init_f.c index f46b40fe0b..f8e200cf66 100644 --- a/src/mpi/f77/recv_init_f.c +++ b/src/mpi/f77/recv_init_f.c @@ -16,8 +16,8 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" +#include "mpi/f77/constants.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER #pragma weak PMPI_RECV_INIT = mpi_recv_init_f @@ -60,18 +60,18 @@ void mpi_recv_init_f(char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *source, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr) { - MPI_Datatype c_type = MPI_Type_f2c(*datatype); - MPI_Request c_req; - MPI_Comm c_comm; + MPI_Datatype c_type = MPI_Type_f2c(*datatype); + MPI_Request c_req; + MPI_Comm c_comm; - c_comm = MPI_Comm_f2c (*comm); + c_comm = MPI_Comm_f2c (*comm); - *ierr = OMPI_INT_2_FINT(MPI_Recv_init(buf, OMPI_FINT_2_INT(*count), - c_type, OMPI_FINT_2_INT(*source), - OMPI_INT_2_FINT(*tag), c_comm, - &c_req)); + *ierr = OMPI_INT_2_FINT(MPI_Recv_init(OMPI_ADDR(buf), OMPI_FINT_2_INT(*count), + c_type, OMPI_FINT_2_INT(*source), + OMPI_INT_2_FINT(*tag), c_comm, + &c_req)); - if (MPI_SUCCESS == *ierr) { - *request = MPI_Request_c2f(c_req); - } + if (MPI_SUCCESS == *ierr) { + *request = MPI_Request_c2f(c_req); + } } diff --git a/src/mpi/f77/reduce_f.c b/src/mpi/f77/reduce_f.c index 72039a149d..2736fa5dd3 100644 --- a/src/mpi/f77/reduce_f.c +++ b/src/mpi/f77/reduce_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/reduce_scatter_f.c b/src/mpi/f77/reduce_scatter_f.c index 64a306c8dc..9b51a18a18 100644 --- a/src/mpi/f77/reduce_scatter_f.c +++ b/src/mpi/f77/reduce_scatter_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/register_datarep_f.c b/src/mpi/f77/register_datarep_f.c index d6538a2e6d..75906a9578 100644 --- a/src/mpi/f77/register_datarep_f.c +++ b/src/mpi/f77/register_datarep_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/request_free_f.c b/src/mpi/f77/request_free_f.c index 8021a68fc7..1559c9972b 100644 --- a/src/mpi/f77/request_free_f.c +++ b/src/mpi/f77/request_free_f.c @@ -16,9 +16,8 @@ #include "ompi_config.h" -#include "mpi.h" -#include "request/request.h" #include "mpi/f77/bindings.h" +#include "request/request.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER #pragma weak PMPI_REQUEST_FREE = mpi_request_free_f diff --git a/src/mpi/f77/request_get_status_f.c b/src/mpi/f77/request_get_status_f.c index afcadffb49..c2454860b5 100644 --- a/src/mpi/f77/request_get_status_f.c +++ b/src/mpi/f77/request_get_status_f.c @@ -16,8 +16,8 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" +#include "mpi/f77/constants.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER #pragma weak PMPI_REQUEST_GET_STATUS = mpi_request_get_status_f @@ -63,10 +63,17 @@ void mpi_request_get_status_f(MPI_Fint *request, MPI_Fint *flag, MPI_Request c_req = MPI_Request_f2c( *request ); OMPI_SINGLE_NAME_DECL(flag); - *ierr = OMPI_INT_2_FINT(MPI_Request_get_status(c_req, - OMPI_SINGLE_NAME_CONVERT(flag), - &c_status)); + /* This seems silly, but someone will do it */ - OMPI_SINGLE_INT_2_FINT(flag); - MPI_Status_c2f( &c_status, status ); + if (OMPI_IS_FORTRAN_STATUS_IGNORE(status)) { + *flag = OMPI_INT_2_FINT(0); + *ierr = OMPI_INT_2_FINT(MPI_SUCCESS); + } else { + *ierr = OMPI_INT_2_FINT(MPI_Request_get_status(c_req, + OMPI_SINGLE_NAME_CONVERT(flag), + &c_status)); + + OMPI_SINGLE_INT_2_FINT(flag); + MPI_Status_c2f( &c_status, status ); + } } diff --git a/src/mpi/f77/rsend_f.c b/src/mpi/f77/rsend_f.c index 93128b2abf..b5b835b68f 100644 --- a/src/mpi/f77/rsend_f.c +++ b/src/mpi/f77/rsend_f.c @@ -16,8 +16,8 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" +#include "mpi/f77/constants.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER #pragma weak PMPI_RSEND = mpi_rsend_f @@ -59,12 +59,12 @@ OMPI_GENERATE_F77_BINDINGS (MPI_RSEND, void mpi_rsend_f(char *ibuf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *ierr) { - MPI_Datatype c_type = MPI_Type_f2c(*datatype); - MPI_Comm c_comm; + MPI_Datatype c_type = MPI_Type_f2c(*datatype); + MPI_Comm c_comm; - c_comm = MPI_Comm_f2c (*comm); + c_comm = MPI_Comm_f2c (*comm); - *ierr = OMPI_INT_2_FINT(MPI_Rsend(ibuf, OMPI_FINT_2_INT(*count), - c_type, OMPI_FINT_2_INT(*dest), - OMPI_FINT_2_INT(*tag), c_comm)); + *ierr = OMPI_INT_2_FINT(MPI_Rsend(OMPI_ADDR(ibuf), OMPI_FINT_2_INT(*count), + c_type, OMPI_FINT_2_INT(*dest), + OMPI_FINT_2_INT(*tag), c_comm)); } diff --git a/src/mpi/f77/rsend_init_f.c b/src/mpi/f77/rsend_init_f.c index 5fdd92f6be..87e1f82cc3 100644 --- a/src/mpi/f77/rsend_init_f.c +++ b/src/mpi/f77/rsend_init_f.c @@ -16,8 +16,8 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" +#include "mpi/f77/constants.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER #pragma weak PMPI_RSEND_INIT = mpi_rsend_init_f @@ -61,18 +61,18 @@ void mpi_rsend_init_f(char *buf, MPI_Fint *count, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr) { - MPI_Datatype c_type = MPI_Type_f2c(*datatype); - MPI_Request c_req; - MPI_Comm c_comm; + MPI_Datatype c_type = MPI_Type_f2c(*datatype); + MPI_Request c_req; + MPI_Comm c_comm; - c_comm = MPI_Comm_f2c (*comm); + c_comm = MPI_Comm_f2c (*comm); - *ierr = OMPI_INT_2_FINT(MPI_Rsend_init(buf, OMPI_FINT_2_INT(*count), - c_type, OMPI_FINT_2_INT(*dest), - OMPI_FINT_2_INT(*tag), - c_comm, &c_req)); + *ierr = OMPI_INT_2_FINT(MPI_Rsend_init(OMPI_ADDR(buf), OMPI_FINT_2_INT(*count), + c_type, OMPI_FINT_2_INT(*dest), + OMPI_FINT_2_INT(*tag), + c_comm, &c_req)); - if (MPI_SUCCESS == *ierr) { - *request = MPI_Request_c2f(c_req); - } + if (MPI_SUCCESS == *ierr) { + *request = MPI_Request_c2f(c_req); + } } diff --git a/src/mpi/f77/scan_f.c b/src/mpi/f77/scan_f.c index 27cecca60e..735a5c9513 100644 --- a/src/mpi/f77/scan_f.c +++ b/src/mpi/f77/scan_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/scatter_f.c b/src/mpi/f77/scatter_f.c index 218aa7987e..7a4c1479d4 100644 --- a/src/mpi/f77/scatter_f.c +++ b/src/mpi/f77/scatter_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/scatterv_f.c b/src/mpi/f77/scatterv_f.c index c125eb4b21..d85d8411c8 100644 --- a/src/mpi/f77/scatterv_f.c +++ b/src/mpi/f77/scatterv_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/send_f.c b/src/mpi/f77/send_f.c index 31371a2b8b..4b6f9bc02c 100644 --- a/src/mpi/f77/send_f.c +++ b/src/mpi/f77/send_f.c @@ -16,8 +16,8 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" +#include "mpi/f77/constants.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER #pragma weak PMPI_SEND = mpi_send_f @@ -62,7 +62,7 @@ void mpi_send_f(char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Comm c_comm = MPI_Comm_f2c(*comm); MPI_Datatype c_type = MPI_Type_f2c(*datatype); - *ierr = OMPI_INT_2_FINT(MPI_Send(buf, OMPI_FINT_2_INT(*count), + *ierr = OMPI_INT_2_FINT(MPI_Send(OMPI_ADDR(buf), OMPI_FINT_2_INT(*count), c_type, OMPI_FINT_2_INT(*dest), OMPI_FINT_2_INT(*tag), c_comm)); } diff --git a/src/mpi/f77/send_init_f.c b/src/mpi/f77/send_init_f.c index c1134f799a..f7014b1b68 100644 --- a/src/mpi/f77/send_init_f.c +++ b/src/mpi/f77/send_init_f.c @@ -16,8 +16,8 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" +#include "mpi/f77/constants.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER #pragma weak PMPI_SEND_INIT = mpi_send_init_f @@ -60,18 +60,18 @@ void mpi_send_init_f(char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr) { - MPI_Datatype c_type = MPI_Type_f2c(*datatype); - MPI_Request c_req; - MPI_Comm c_comm; + MPI_Datatype c_type = MPI_Type_f2c(*datatype); + MPI_Request c_req; + MPI_Comm c_comm; - c_comm = MPI_Comm_f2c (*comm); + c_comm = MPI_Comm_f2c (*comm); - *ierr = OMPI_INT_2_FINT(MPI_Send_init(buf, OMPI_FINT_2_INT(*count), - c_type, OMPI_FINT_2_INT(*dest), - OMPI_FINT_2_INT(*tag), - c_comm, &c_req)); - - if (MPI_SUCCESS == *ierr) { - *request = MPI_Request_c2f(c_req); - } + *ierr = OMPI_INT_2_FINT(MPI_Send_init(OMPI_ADDR(buf), OMPI_FINT_2_INT(*count), + c_type, OMPI_FINT_2_INT(*dest), + OMPI_FINT_2_INT(*tag), + c_comm, &c_req)); + + if (MPI_SUCCESS == *ierr) { + *request = MPI_Request_c2f(c_req); + } } diff --git a/src/mpi/f77/sendrecv_f.c b/src/mpi/f77/sendrecv_f.c index ed4660c1fd..28da3403fc 100644 --- a/src/mpi/f77/sendrecv_f.c +++ b/src/mpi/f77/sendrecv_f.c @@ -16,8 +16,8 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" +#include "mpi/f77/constants.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER #pragma weak PMPI_SENDRECV = mpi_sendrecv_f @@ -62,18 +62,23 @@ void mpi_sendrecv_f(char *sendbuf, MPI_Fint *sendcount, MPI_Fint *sendtype, MPI_Fint *source, MPI_Fint *recvtag, MPI_Fint *comm, MPI_Fint *status, MPI_Fint *ierr) { - MPI_Comm c_comm; - MPI_Datatype c_sendtype = MPI_Type_f2c(*sendtype); - MPI_Datatype c_recvtype = MPI_Type_f2c(*recvtype); + MPI_Comm c_comm; + MPI_Datatype c_sendtype = MPI_Type_f2c(*sendtype); + MPI_Datatype c_recvtype = MPI_Type_f2c(*recvtype); + MPI_Status c_status; + + c_comm = MPI_Comm_f2c (*comm); + + *ierr = OMPI_INT_2_FINT(MPI_Sendrecv(OMPI_ADDR(sendbuf), OMPI_FINT_2_INT(*sendcount), + c_sendtype, + OMPI_FINT_2_INT(*dest), + OMPI_FINT_2_INT(*sendtag), + OMPI_ADDR(recvbuf), *recvcount, + c_recvtype, OMPI_FINT_2_INT(*source), + OMPI_FINT_2_INT(*recvtag), + c_comm, &c_status)); - c_comm = MPI_Comm_f2c (*comm); - - *ierr = OMPI_INT_2_FINT(MPI_Sendrecv(sendbuf, OMPI_FINT_2_INT(*sendcount), - c_sendtype, - OMPI_FINT_2_INT(*dest), - OMPI_FINT_2_INT(*sendtag), - recvbuf, *recvcount, - c_recvtype, OMPI_FINT_2_INT(*source), - OMPI_FINT_2_INT(*recvtag), - c_comm, (MPI_Status*)status)); + if (!OMPI_IS_FORTRAN_STATUS_IGNORE(status)) { + MPI_Status_c2f(&c_status, status); + } } diff --git a/src/mpi/f77/sendrecv_replace_f.c b/src/mpi/f77/sendrecv_replace_f.c index 7d93eeaae0..152cbba4d9 100644 --- a/src/mpi/f77/sendrecv_replace_f.c +++ b/src/mpi/f77/sendrecv_replace_f.c @@ -16,8 +16,8 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" +#include "mpi/f77/constants.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER #pragma weak PMPI_SENDRECV_REPLACE = mpi_sendrecv_replace_f @@ -61,17 +61,22 @@ void mpi_sendrecv_replace_f(char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *source, MPI_Fint *recvtag, MPI_Fint *comm, MPI_Fint *status, MPI_Fint *ierr) { - MPI_Datatype c_type = MPI_Type_f2c(*datatype); - MPI_Comm c_comm; + MPI_Datatype c_type = MPI_Type_f2c(*datatype); + MPI_Comm c_comm; + MPI_Status c_status; - c_comm = MPI_Comm_f2c (*comm); + c_comm = MPI_Comm_f2c (*comm); + + *ierr = OMPI_INT_2_FINT(MPI_Sendrecv_replace(OMPI_ADDR(buf), + OMPI_FINT_2_INT(*count), + c_type, + OMPI_FINT_2_INT(*dest), + OMPI_FINT_2_INT(*sendtag), + OMPI_FINT_2_INT(*source), + OMPI_FINT_2_INT(*recvtag), + c_comm, &c_status)); - *ierr = OMPI_INT_2_FINT(MPI_Sendrecv_replace(buf, - OMPI_FINT_2_INT(*count), - c_type, - OMPI_FINT_2_INT(*dest), - OMPI_FINT_2_INT(*sendtag), - OMPI_FINT_2_INT(*source), - OMPI_FINT_2_INT(*recvtag), - c_comm, (MPI_Status*)status)); + if (!OMPI_IS_FORTRAN_STATUS_IGNORE(status)) { + MPI_Status_c2f(&c_status, status); + } } diff --git a/src/mpi/f77/ssend_f.c b/src/mpi/f77/ssend_f.c index 052c819728..07bf14861e 100644 --- a/src/mpi/f77/ssend_f.c +++ b/src/mpi/f77/ssend_f.c @@ -16,8 +16,8 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" +#include "mpi/f77/constants.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER #pragma weak PMPI_SSEND = mpi_ssend_f @@ -60,12 +60,12 @@ void mpi_ssend_f(char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *ierr) { - MPI_Datatype c_type = MPI_Type_f2c(*datatype); - MPI_Comm c_comm; + MPI_Datatype c_type = MPI_Type_f2c(*datatype); + MPI_Comm c_comm; - c_comm = MPI_Comm_f2c (*comm); + c_comm = MPI_Comm_f2c (*comm); - *ierr = OMPI_INT_2_FINT(MPI_Ssend(buf, OMPI_FINT_2_INT(*count), - c_type, OMPI_FINT_2_INT(*dest), - OMPI_FINT_2_INT(*tag), c_comm)); + *ierr = OMPI_INT_2_FINT(MPI_Ssend(OMPI_ADDR(buf), OMPI_FINT_2_INT(*count), + c_type, OMPI_FINT_2_INT(*dest), + OMPI_FINT_2_INT(*tag), c_comm)); } diff --git a/src/mpi/f77/ssend_init_f.c b/src/mpi/f77/ssend_init_f.c index 7b815ba88e..afeab2d4f7 100644 --- a/src/mpi/f77/ssend_init_f.c +++ b/src/mpi/f77/ssend_init_f.c @@ -16,8 +16,8 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" +#include "mpi/f77/constants.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER #pragma weak PMPI_SSEND_INIT = mpi_ssend_init_f @@ -60,18 +60,18 @@ void mpi_ssend_init_f(char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr) { - MPI_Datatype c_type = MPI_Type_f2c(*datatype); - MPI_Request c_req; - MPI_Comm c_comm; + MPI_Datatype c_type = MPI_Type_f2c(*datatype); + MPI_Request c_req; + MPI_Comm c_comm; - c_comm = MPI_Comm_f2c (*comm); + c_comm = MPI_Comm_f2c (*comm); - *ierr = OMPI_INT_2_FINT(MPI_Ssend_init(buf, OMPI_FINT_2_INT(*count), - c_type, OMPI_FINT_2_INT(*dest), - OMPI_FINT_2_INT(*tag), - c_comm, &c_req)); + *ierr = OMPI_INT_2_FINT(MPI_Ssend_init(OMPI_ADDR(buf), OMPI_FINT_2_INT(*count), + c_type, OMPI_FINT_2_INT(*dest), + OMPI_FINT_2_INT(*tag), + c_comm, &c_req)); - if (MPI_SUCCESS == *ierr) { - *request = MPI_Request_c2f(c_req); - } + if (MPI_SUCCESS == *ierr) { + *request = MPI_Request_c2f(c_req); + } } diff --git a/src/mpi/f77/start_f.c b/src/mpi/f77/start_f.c index 641b98e1b8..d3d29f3954 100644 --- a/src/mpi/f77/start_f.c +++ b/src/mpi/f77/start_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/startall_f.c b/src/mpi/f77/startall_f.c index 44b35f9c92..5672091ba4 100644 --- a/src/mpi/f77/startall_f.c +++ b/src/mpi/f77/startall_f.c @@ -19,7 +19,6 @@ #include #include -#include "mpi.h" #include "mpi/f77/bindings.h" #include "errhandler/errhandler.h" #include "communicator/communicator.h" diff --git a/src/mpi/f77/status_set_cancelled_f.c b/src/mpi/f77/status_set_cancelled_f.c index cce364808e..a887adf84c 100644 --- a/src/mpi/f77/status_set_cancelled_f.c +++ b/src/mpi/f77/status_set_cancelled_f.c @@ -16,9 +16,8 @@ #include "ompi_config.h" - -#include "mpi.h" #include "mpi/f77/bindings.h" +#include "mpi/f77/constants.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER #pragma weak PMPI_STATUS_SET_CANCELLED = mpi_status_set_cancelled_f @@ -61,12 +60,18 @@ void mpi_status_set_cancelled_f(MPI_Fint *status, MPI_Fint *flag, MPI_Fint *ierr { MPI_Status c_status; - MPI_Status_f2c( status, &c_status ); + /* This seems silly, but someone will do it */ - *ierr = OMPI_INT_2_FINT(MPI_Status_set_cancelled(&c_status, - OMPI_FINT_2_INT(*flag))); + if (OMPI_IS_FORTRAN_STATUS_IGNORE(status)) { + *ierr = OMPI_INT_2_FINT(MPI_SUCCESS); + } else { + MPI_Status_f2c( status, &c_status ); - if (MPI_SUCCESS == *ierr) { - MPI_Status_c2f(&c_status, status); + *ierr = OMPI_INT_2_FINT(MPI_Status_set_cancelled(&c_status, + OMPI_FINT_2_INT(*flag))); + + if (MPI_SUCCESS == *ierr) { + MPI_Status_c2f(&c_status, status); + } } } diff --git a/src/mpi/f77/status_set_elements_f.c b/src/mpi/f77/status_set_elements_f.c index d39ab6deb0..7199491826 100644 --- a/src/mpi/f77/status_set_elements_f.c +++ b/src/mpi/f77/status_set_elements_f.c @@ -16,8 +16,8 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" +#include "mpi/f77/constants.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER #pragma weak PMPI_STATUS_SET_ELEMENTS = mpi_status_set_elements_f @@ -62,14 +62,21 @@ void mpi_status_set_elements_f(MPI_Fint *status, MPI_Fint *datatype, MPI_Datatype c_type = MPI_Type_f2c(*datatype); MPI_Status c_status; - MPI_Status_f2c( status, &c_status ); + /* This seems silly, but someone will do it */ - *ierr = OMPI_INT_2_FINT(MPI_Status_set_elements(&c_status, c_type, - OMPI_FINT_2_INT(*count))); + if (OMPI_IS_FORTRAN_STATUS_IGNORE(status)) { + *ierr = OMPI_INT_2_FINT(MPI_SUCCESS); + } else { + MPI_Status_f2c( status, &c_status ); - /* If datatype is really being set, then that needs to be converted.... */ - if (MPI_SUCCESS == *ierr) { - MPI_Status_c2f(&c_status, status); + *ierr = OMPI_INT_2_FINT(MPI_Status_set_elements(&c_status, c_type, + OMPI_FINT_2_INT(*count))); + + /* If datatype is really being set, then that needs to be + converted.... */ + if (MPI_SUCCESS == *ierr) { + MPI_Status_c2f(&c_status, status); + } } } diff --git a/src/mpi/f77/test_cancelled_f.c b/src/mpi/f77/test_cancelled_f.c index 33adfb91a6..62aa67dc30 100644 --- a/src/mpi/f77/test_cancelled_f.c +++ b/src/mpi/f77/test_cancelled_f.c @@ -16,8 +16,8 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" +#include "mpi/f77/constants.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER #pragma weak PMPI_TEST_CANCELLED = mpi_test_cancelled_f @@ -61,11 +61,19 @@ void mpi_test_cancelled_f(MPI_Fint *status, MPI_Fint *flag, MPI_Fint *ierr) MPI_Status c_status; OMPI_SINGLE_NAME_DECL(flag); - MPI_Status_f2c( status, &c_status ); + /* This seems silly, but someone will do it */ - *ierr = OMPI_INT_2_FINT(MPI_Test_cancelled(&c_status, - OMPI_SINGLE_NAME_CONVERT(flag) - )); - - OMPI_SINGLE_INT_2_FINT(flag); + if (OMPI_IS_FORTRAN_STATUS_IGNORE(status)) { + *flag = OMPI_INT_2_FINT(0); + *ierr = OMPI_INT_2_FINT(MPI_SUCCESS); + } else { + *ierr = MPI_Status_f2c( status, &c_status ); + + if (MPI_SUCCESS == OMPI_FINT_2_INT(*ierr)) { + *ierr = OMPI_INT_2_FINT(MPI_Test_cancelled(&c_status, + OMPI_SINGLE_NAME_CONVERT(flag))); + + OMPI_SINGLE_INT_2_FINT(flag); + } + } } diff --git a/src/mpi/f77/test_f.c b/src/mpi/f77/test_f.c index d5acc1aed7..3635ea68c4 100644 --- a/src/mpi/f77/test_f.c +++ b/src/mpi/f77/test_f.c @@ -16,9 +16,8 @@ #include "ompi_config.h" -#include "mpi.h" -#include "request/request.h" #include "mpi/f77/bindings.h" +#include "request/request.h" #include "mpi/f77/constants.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/testall_f.c b/src/mpi/f77/testall_f.c index 3b01c3c476..96429dfe14 100644 --- a/src/mpi/f77/testall_f.c +++ b/src/mpi/f77/testall_f.c @@ -19,7 +19,6 @@ #include #include -#include "mpi.h" #include "mpi/f77/bindings.h" #include "mpi/f77/constants.h" #include "errhandler/errhandler.h" @@ -95,7 +94,7 @@ void mpi_testall_f(MPI_Fint *count, MPI_Fint *array_of_requests, MPI_Fint *flag, 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])) { - MPI_Status_c2f(&c_status[i], &array_of_statuses[i * 4]); + MPI_Status_c2f(&c_status[i], &array_of_statuses[i * (sizeof(MPI_Status) / sizeof(int))]); } } } diff --git a/src/mpi/f77/testany_f.c b/src/mpi/f77/testany_f.c index 2f90128b18..f3e57080d5 100644 --- a/src/mpi/f77/testany_f.c +++ b/src/mpi/f77/testany_f.c @@ -18,7 +18,6 @@ #include -#include "mpi.h" #include "mpi/f77/bindings.h" #include "mpi/f77/constants.h" #include "errhandler/errhandler.h" diff --git a/src/mpi/f77/testsome_f.c b/src/mpi/f77/testsome_f.c index 467d3e725a..a91591e12a 100644 --- a/src/mpi/f77/testsome_f.c +++ b/src/mpi/f77/testsome_f.c @@ -19,7 +19,6 @@ #include #include -#include "mpi.h" #include "mpi/f77/bindings.h" #include "mpi/f77/constants.h" #include "errhandler/errhandler.h" diff --git a/src/mpi/f77/topo_test_f.c b/src/mpi/f77/topo_test_f.c index f04c694693..599c2d9224 100644 --- a/src/mpi/f77/topo_test_f.c +++ b/src/mpi/f77/topo_test_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/type_commit_f.c b/src/mpi/f77/type_commit_f.c index 4e0c866005..67cba87032 100644 --- a/src/mpi/f77/type_commit_f.c +++ b/src/mpi/f77/type_commit_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/type_contiguous_f.c b/src/mpi/f77/type_contiguous_f.c index c9f75ef50b..c3e572f6d1 100644 --- a/src/mpi/f77/type_contiguous_f.c +++ b/src/mpi/f77/type_contiguous_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/type_create_darray_f.c b/src/mpi/f77/type_create_darray_f.c index b6d23b806a..67c5020c97 100644 --- a/src/mpi/f77/type_create_darray_f.c +++ b/src/mpi/f77/type_create_darray_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/type_create_f90_complex_f.c b/src/mpi/f77/type_create_f90_complex_f.c index 046e663654..a868bc4f05 100644 --- a/src/mpi/f77/type_create_f90_complex_f.c +++ b/src/mpi/f77/type_create_f90_complex_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/type_create_f90_integer_f.c b/src/mpi/f77/type_create_f90_integer_f.c index a45854c6f3..98a95826f6 100644 --- a/src/mpi/f77/type_create_f90_integer_f.c +++ b/src/mpi/f77/type_create_f90_integer_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/type_create_f90_real_f.c b/src/mpi/f77/type_create_f90_real_f.c index f0b3219311..4c8f4d0ae1 100644 --- a/src/mpi/f77/type_create_f90_real_f.c +++ b/src/mpi/f77/type_create_f90_real_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/type_create_hindexed_f.c b/src/mpi/f77/type_create_hindexed_f.c index ad343fb871..44d6498d09 100644 --- a/src/mpi/f77/type_create_hindexed_f.c +++ b/src/mpi/f77/type_create_hindexed_f.c @@ -19,7 +19,6 @@ #include #include -#include "mpi.h" #include "mpi/f77/bindings.h" #include "errhandler/errhandler.h" #include "communicator/communicator.h" diff --git a/src/mpi/f77/type_create_hvector_f.c b/src/mpi/f77/type_create_hvector_f.c index 996e526cc4..542c8b8f88 100644 --- a/src/mpi/f77/type_create_hvector_f.c +++ b/src/mpi/f77/type_create_hvector_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/type_create_indexed_block_f.c b/src/mpi/f77/type_create_indexed_block_f.c index 228a1d6388..59708e4b95 100644 --- a/src/mpi/f77/type_create_indexed_block_f.c +++ b/src/mpi/f77/type_create_indexed_block_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/type_create_keyval_f.c b/src/mpi/f77/type_create_keyval_f.c index b3d7b8db9a..130d5bea96 100644 --- a/src/mpi/f77/type_create_keyval_f.c +++ b/src/mpi/f77/type_create_keyval_f.c @@ -16,9 +16,7 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" -#include "attribute/attribute.h" #include "communicator/communicator.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER @@ -32,7 +30,7 @@ OMPI_GENERATE_F77_BINDINGS (PMPI_TYPE_CREATE_KEYVAL, pmpi_type_create_keyval_, pmpi_type_create_keyval__, pmpi_type_create_keyval_f, - (void *type_copy_attr_fn, void *type_delete_attr_fn, MPI_Fint *type_keyval, char *extra_state, MPI_Fint *ierr), + (MPI_F_copy_function* type_copy_attr_fn, MPI_F_delete_function* type_delete_attr_fn, MPI_Fint *type_keyval, char *extra_state, MPI_Fint *ierr), (type_copy_attr_fn, type_delete_attr_fn, type_keyval, extra_state, ierr) ) #endif @@ -49,7 +47,7 @@ OMPI_GENERATE_F77_BINDINGS (MPI_TYPE_CREATE_KEYVAL, mpi_type_create_keyval_, mpi_type_create_keyval__, mpi_type_create_keyval_f, - (void *type_copy_attr_fn, void *type_delete_attr_fn, MPI_Fint *type_keyval, char *extra_state, MPI_Fint *ierr), + (MPI_F_copy_function* type_copy_attr_fn, MPI_F_delete_function* type_delete_attr_fn, MPI_Fint *type_keyval, char *extra_state, MPI_Fint *ierr), (type_copy_attr_fn, type_delete_attr_fn, type_keyval, extra_state, ierr) ) #endif @@ -60,7 +58,7 @@ OMPI_GENERATE_F77_BINDINGS (MPI_TYPE_CREATE_KEYVAL, static char FUNC_NAME[] = "MPI_Type_create_keyval_f"; -void mpi_type_create_keyval_f(void *type_copy_attr_fn, void *type_delete_attr_fn, MPI_Fint *type_keyval, char *extra_state, MPI_Fint *ierr) +void mpi_type_create_keyval_f(MPI_F_copy_function* type_copy_attr_fn, MPI_F_delete_function* type_delete_attr_fn, MPI_Fint *type_keyval, char *extra_state, MPI_Fint *ierr) { int ret, c_err; ompi_attribute_fn_ptr_union_t copy_fn; diff --git a/src/mpi/f77/type_create_resized_f.c b/src/mpi/f77/type_create_resized_f.c index 23ef7967e3..6e8b321e6f 100644 --- a/src/mpi/f77/type_create_resized_f.c +++ b/src/mpi/f77/type_create_resized_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/type_create_struct_f.c b/src/mpi/f77/type_create_struct_f.c index 603cf95960..15b27771c4 100644 --- a/src/mpi/f77/type_create_struct_f.c +++ b/src/mpi/f77/type_create_struct_f.c @@ -19,7 +19,6 @@ #include #include -#include "mpi.h" #include "mpi/f77/bindings.h" #include "errhandler/errhandler.h" #include "communicator/communicator.h" diff --git a/src/mpi/f77/type_create_subarray_f.c b/src/mpi/f77/type_create_subarray_f.c index 3a565dbb4c..19957a259c 100644 --- a/src/mpi/f77/type_create_subarray_f.c +++ b/src/mpi/f77/type_create_subarray_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/type_delete_attr_f.c b/src/mpi/f77/type_delete_attr_f.c index 381782ff69..ecc6c6f1ab 100644 --- a/src/mpi/f77/type_delete_attr_f.c +++ b/src/mpi/f77/type_delete_attr_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/type_dup_f.c b/src/mpi/f77/type_dup_f.c index b0f71148fd..00e96db62f 100644 --- a/src/mpi/f77/type_dup_f.c +++ b/src/mpi/f77/type_dup_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/type_extent_f.c b/src/mpi/f77/type_extent_f.c index 541aa19b53..2d5af8b52c 100644 --- a/src/mpi/f77/type_extent_f.c +++ b/src/mpi/f77/type_extent_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/type_free_f.c b/src/mpi/f77/type_free_f.c index bd3b6ba7e6..59475334ea 100644 --- a/src/mpi/f77/type_free_f.c +++ b/src/mpi/f77/type_free_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/type_free_keyval_f.c b/src/mpi/f77/type_free_keyval_f.c index b681a55d43..ea057bdcd6 100644 --- a/src/mpi/f77/type_free_keyval_f.c +++ b/src/mpi/f77/type_free_keyval_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/type_get_attr_f.c b/src/mpi/f77/type_get_attr_f.c index 25b08f0bd5..380992121d 100644 --- a/src/mpi/f77/type_get_attr_f.c +++ b/src/mpi/f77/type_get_attr_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/type_get_contents_f.c b/src/mpi/f77/type_get_contents_f.c index 85890f1294..6383949b5c 100644 --- a/src/mpi/f77/type_get_contents_f.c +++ b/src/mpi/f77/type_get_contents_f.c @@ -19,7 +19,6 @@ #include #include -#include "mpi.h" #include "mpi/f77/bindings.h" #include "errhandler/errhandler.h" #include "communicator/communicator.h" diff --git a/src/mpi/f77/type_get_envelope_f.c b/src/mpi/f77/type_get_envelope_f.c index 86cb42630f..256847b42d 100644 --- a/src/mpi/f77/type_get_envelope_f.c +++ b/src/mpi/f77/type_get_envelope_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/type_get_extent_f.c b/src/mpi/f77/type_get_extent_f.c index 604de7e682..cdbb2f5ca1 100644 --- a/src/mpi/f77/type_get_extent_f.c +++ b/src/mpi/f77/type_get_extent_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/type_get_name_f.c b/src/mpi/f77/type_get_name_f.c index 8a80b79642..40e869f3cd 100644 --- a/src/mpi/f77/type_get_name_f.c +++ b/src/mpi/f77/type_get_name_f.c @@ -16,10 +16,9 @@ #include "ompi_config.h" -#include "mpi.h" +#include "mpi/f77/bindings.h" #include "include/constants.h" #include "errhandler/errhandler.h" -#include "mpi/f77/bindings.h" #include "mpi/f77/strings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/type_get_true_extent_f.c b/src/mpi/f77/type_get_true_extent_f.c index 913763bed0..3f489f3f09 100644 --- a/src/mpi/f77/type_get_true_extent_f.c +++ b/src/mpi/f77/type_get_true_extent_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/type_hindexed_f.c b/src/mpi/f77/type_hindexed_f.c index 4a6cba8392..afdabc215a 100644 --- a/src/mpi/f77/type_hindexed_f.c +++ b/src/mpi/f77/type_hindexed_f.c @@ -19,7 +19,6 @@ #include #include -#include "mpi.h" #include "mpi/f77/bindings.h" #include "errhandler/errhandler.h" #include "communicator/communicator.h" diff --git a/src/mpi/f77/type_hvector_f.c b/src/mpi/f77/type_hvector_f.c index 15be7f1d9b..fbc08637ff 100644 --- a/src/mpi/f77/type_hvector_f.c +++ b/src/mpi/f77/type_hvector_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/type_indexed_f.c b/src/mpi/f77/type_indexed_f.c index 6b0d8e5f10..1c5c0a21ba 100644 --- a/src/mpi/f77/type_indexed_f.c +++ b/src/mpi/f77/type_indexed_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/type_lb_f.c b/src/mpi/f77/type_lb_f.c index 324b9c0fc0..424f0f0112 100644 --- a/src/mpi/f77/type_lb_f.c +++ b/src/mpi/f77/type_lb_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/type_match_size_f.c b/src/mpi/f77/type_match_size_f.c index c2bf6bc803..d8bdb7955a 100644 --- a/src/mpi/f77/type_match_size_f.c +++ b/src/mpi/f77/type_match_size_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #include "mpi/f77/constants.h" #include "datatype/datatype.h" diff --git a/src/mpi/f77/type_set_attr_f.c b/src/mpi/f77/type_set_attr_f.c index 6cb0fac635..3b83e68ce1 100644 --- a/src/mpi/f77/type_set_attr_f.c +++ b/src/mpi/f77/type_set_attr_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/type_set_name_f.c b/src/mpi/f77/type_set_name_f.c index 3103dcedc4..057fd9cea6 100644 --- a/src/mpi/f77/type_set_name_f.c +++ b/src/mpi/f77/type_set_name_f.c @@ -16,11 +16,10 @@ #include "ompi_config.h" -#include "mpi.h" +#include "mpi/f77/bindings.h" #include "include/constants.h" #include "errhandler/errhandler.h" #include "communicator/communicator.h" -#include "mpi/f77/bindings.h" #include "mpi/f77/strings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/type_size_f.c b/src/mpi/f77/type_size_f.c index 4cf60227f5..d2b2d60d31 100644 --- a/src/mpi/f77/type_size_f.c +++ b/src/mpi/f77/type_size_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/type_struct_f.c b/src/mpi/f77/type_struct_f.c index 4455d216c9..f5d1bc8d5e 100644 --- a/src/mpi/f77/type_struct_f.c +++ b/src/mpi/f77/type_struct_f.c @@ -19,7 +19,6 @@ #include #include -#include "mpi.h" #include "mpi/f77/bindings.h" #include "errhandler/errhandler.h" #include "communicator/communicator.h" diff --git a/src/mpi/f77/type_ub_f.c b/src/mpi/f77/type_ub_f.c index 52a2f67a2e..35466b6dd8 100644 --- a/src/mpi/f77/type_ub_f.c +++ b/src/mpi/f77/type_ub_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/type_vector_f.c b/src/mpi/f77/type_vector_f.c index 6b2f3e464b..f42b957017 100644 --- a/src/mpi/f77/type_vector_f.c +++ b/src/mpi/f77/type_vector_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/unpack_external_f.c b/src/mpi/f77/unpack_external_f.c index d3400dc12e..af2a4be0c2 100644 --- a/src/mpi/f77/unpack_external_f.c +++ b/src/mpi/f77/unpack_external_f.c @@ -16,8 +16,8 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" +#include "mpi/f77/constants.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER #pragma weak PMPI_UNPACK_EXTERNAL = mpi_unpack_external_f @@ -61,13 +61,13 @@ void mpi_unpack_external_f (char *datarep, char *inbuf, MPI_Fint *insize, MPI_Fint *outcount, MPI_Fint *datatype, MPI_Fint *ierr) { - MPI_Datatype c_type; - c_type = MPI_Type_f2c(*datatype); + MPI_Datatype c_type; + c_type = MPI_Type_f2c(*datatype); - *ierr = OMPI_INT_2_FINT(MPI_Unpack_external(datarep, inbuf, - (MPI_Aint)*insize, - (MPI_Aint *)position, - outbuf, - OMPI_FINT_2_INT(*outcount), - c_type)); + *ierr = OMPI_INT_2_FINT(MPI_Unpack_external(datarep, inbuf, + (MPI_Aint)*insize, + (MPI_Aint *)position, + OMPI_ADDR(outbuf), + OMPI_FINT_2_INT(*outcount), + c_type)); } diff --git a/src/mpi/f77/unpack_f.c b/src/mpi/f77/unpack_f.c index 7c69b7fc63..620ade4215 100644 --- a/src/mpi/f77/unpack_f.c +++ b/src/mpi/f77/unpack_f.c @@ -16,8 +16,8 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" +#include "mpi/f77/constants.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER #pragma weak PMPI_UNPACK = mpi_unpack_f @@ -60,18 +60,18 @@ void mpi_unpack_f(char *inbuf, MPI_Fint *insize, MPI_Fint *position, char *outbuf, MPI_Fint *outcount, MPI_Fint *datatype, MPI_Fint *comm, MPI_Fint *ierr) { - MPI_Comm c_comm; - MPI_Datatype c_type; - OMPI_SINGLE_NAME_DECL(position); + MPI_Comm c_comm; + MPI_Datatype c_type; + OMPI_SINGLE_NAME_DECL(position); - c_comm = MPI_Comm_f2c(*comm); - c_type = MPI_Type_f2c(*datatype); - OMPI_SINGLE_FINT_2_INT(position); + c_comm = MPI_Comm_f2c(*comm); + c_type = MPI_Type_f2c(*datatype); + OMPI_SINGLE_FINT_2_INT(position); - *ierr = OMPI_INT_2_FINT(MPI_Unpack(inbuf, OMPI_FINT_2_INT(*insize), - OMPI_SINGLE_NAME_CONVERT(position), - outbuf, OMPI_FINT_2_INT(*outcount), - c_type, c_comm)); + *ierr = OMPI_INT_2_FINT(MPI_Unpack(inbuf, OMPI_FINT_2_INT(*insize), + OMPI_SINGLE_NAME_CONVERT(position), + OMPI_ADDR(outbuf), OMPI_FINT_2_INT(*outcount), + c_type, c_comm)); - OMPI_SINGLE_INT_2_FINT(position); + OMPI_SINGLE_INT_2_FINT(position); } diff --git a/src/mpi/f77/unpublish_name_f.c b/src/mpi/f77/unpublish_name_f.c index 1a625103b3..33a76bb10d 100644 --- a/src/mpi/f77/unpublish_name_f.c +++ b/src/mpi/f77/unpublish_name_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/wait_f.c b/src/mpi/f77/wait_f.c index ba157a4a7b..0b60257837 100644 --- a/src/mpi/f77/wait_f.c +++ b/src/mpi/f77/wait_f.c @@ -16,9 +16,8 @@ #include "ompi_config.h" -#include "mpi.h" -#include "request/request.h" #include "mpi/f77/bindings.h" +#include "request/request.h" #include "mpi/f77/constants.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/waitall_f.c b/src/mpi/f77/waitall_f.c index 0a31c661f3..3066e6ffdc 100644 --- a/src/mpi/f77/waitall_f.c +++ b/src/mpi/f77/waitall_f.c @@ -19,7 +19,6 @@ #include #include -#include "mpi.h" #include "mpi/f77/bindings.h" #include "mpi/f77/constants.h" #include "errhandler/errhandler.h" @@ -94,7 +93,7 @@ void mpi_waitall_f(MPI_Fint *count, MPI_Fint *array_of_requests, 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])) { - MPI_Status_c2f( &c_status[i], &array_of_statuses[i * 4]); + MPI_Status_c2f( &c_status[i], &array_of_statuses[i * (sizeof(MPI_Status) / sizeof(int))]); } } } diff --git a/src/mpi/f77/waitany_f.c b/src/mpi/f77/waitany_f.c index cd766a4fab..1f3ea8c87f 100644 --- a/src/mpi/f77/waitany_f.c +++ b/src/mpi/f77/waitany_f.c @@ -19,7 +19,6 @@ #include #include -#include "mpi.h" #include "mpi/f77/bindings.h" #include "mpi/f77/constants.h" #include "errhandler/errhandler.h" diff --git a/src/mpi/f77/waitsome_f.c b/src/mpi/f77/waitsome_f.c index 16eb08cbfc..a106897372 100644 --- a/src/mpi/f77/waitsome_f.c +++ b/src/mpi/f77/waitsome_f.c @@ -19,7 +19,6 @@ #include #include -#include "mpi.h" #include "mpi/f77/bindings.h" #include "mpi/f77/constants.h" #include "errhandler/errhandler.h" diff --git a/src/mpi/f77/win_call_errhandler_f.c b/src/mpi/f77/win_call_errhandler_f.c index a9d6a751d9..23ca16e40c 100644 --- a/src/mpi/f77/win_call_errhandler_f.c +++ b/src/mpi/f77/win_call_errhandler_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/win_complete_f.c b/src/mpi/f77/win_complete_f.c index a39f7863cc..02bf3689ac 100644 --- a/src/mpi/f77/win_complete_f.c +++ b/src/mpi/f77/win_complete_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/win_create_errhandler_f.c b/src/mpi/f77/win_create_errhandler_f.c index f19affe1b7..8b18de019f 100644 --- a/src/mpi/f77/win_create_errhandler_f.c +++ b/src/mpi/f77/win_create_errhandler_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER @@ -30,7 +29,7 @@ OMPI_GENERATE_F77_BINDINGS (PMPI_WIN_CREATE_ERRHANDLER, pmpi_win_create_errhandler_, pmpi_win_create_errhandler__, pmpi_win_create_errhandler_f, - (void *function, MPI_Fint *errhandler, MPI_Fint *ierr), + (ompi_errhandler_fortran_handler_fn_t* function, MPI_Fint *errhandler, MPI_Fint *ierr), (function, errhandler, ierr) ) #endif @@ -47,7 +46,7 @@ OMPI_GENERATE_F77_BINDINGS (MPI_WIN_CREATE_ERRHANDLER, mpi_win_create_errhandler_, mpi_win_create_errhandler__, mpi_win_create_errhandler_f, - (void *function, MPI_Fint *errhandler, MPI_Fint *ierr), + (ompi_errhandler_fortran_handler_fn_t* function, MPI_Fint *errhandler, MPI_Fint *ierr), (function, errhandler, ierr) ) #endif @@ -56,7 +55,7 @@ OMPI_GENERATE_F77_BINDINGS (MPI_WIN_CREATE_ERRHANDLER, #include "mpi/f77/profile/defines.h" #endif -void mpi_win_create_errhandler_f(void *function, +void mpi_win_create_errhandler_f(ompi_errhandler_fortran_handler_fn_t* function, MPI_Fint *errhandler, MPI_Fint *ierr) { MPI_Errhandler c_errhandler; diff --git a/src/mpi/f77/win_create_f.c b/src/mpi/f77/win_create_f.c index 4bfc5328cb..bea5de99c0 100644 --- a/src/mpi/f77/win_create_f.c +++ b/src/mpi/f77/win_create_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/win_create_keyval_f.c b/src/mpi/f77/win_create_keyval_f.c index f1352351b7..49003da79d 100644 --- a/src/mpi/f77/win_create_keyval_f.c +++ b/src/mpi/f77/win_create_keyval_f.c @@ -16,9 +16,7 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" -#include "attribute/attribute.h" #include "communicator/communicator.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER @@ -32,7 +30,7 @@ OMPI_GENERATE_F77_BINDINGS (PMPI_WIN_CREATE_KEYVAL, pmpi_win_create_keyval_, pmpi_win_create_keyval__, pmpi_win_create_keyval_f, - (void *win_copy_attr_fn, void *win_delete_attr_fn, MPI_Fint *win_keyval, char *extra_state, MPI_Fint *ierr), + (MPI_F_copy_function* win_copy_attr_fn, MPI_F_delete_function* win_delete_attr_fn, MPI_Fint *win_keyval, char *extra_state, MPI_Fint *ierr), (win_copy_attr_fn, win_delete_attr_fn, win_keyval, extra_state, ierr) ) #endif @@ -49,7 +47,7 @@ OMPI_GENERATE_F77_BINDINGS (MPI_WIN_CREATE_KEYVAL, mpi_win_create_keyval_, mpi_win_create_keyval__, mpi_win_create_keyval_f, - (void *win_copy_attr_fn, void *win_delete_attr_fn, MPI_Fint *win_keyval, char *extra_state, MPI_Fint *ierr), + (MPI_F_copy_function* win_copy_attr_fn, MPI_F_delete_function* win_delete_attr_fn, MPI_Fint *win_keyval, char *extra_state, MPI_Fint *ierr), (win_copy_attr_fn, win_delete_attr_fn, win_keyval, extra_state, ierr) ) #endif @@ -60,7 +58,9 @@ OMPI_GENERATE_F77_BINDINGS (MPI_WIN_CREATE_KEYVAL, static char FUNC_NAME[] = "MPI_Win_create_keyval"; -void mpi_win_create_keyval_f(void *win_copy_attr_fn, void *win_delete_attr_fn, MPI_Fint *win_keyval, char *extra_state, MPI_Fint *ierr) +void mpi_win_create_keyval_f(MPI_F_copy_function* win_copy_attr_fn, + MPI_F_delete_function* win_delete_attr_fn, + MPI_Fint *win_keyval, char *extra_state, MPI_Fint *ierr) { int ret, c_err; ompi_attribute_fn_ptr_union_t copy_fn; diff --git a/src/mpi/f77/win_delete_attr_f.c b/src/mpi/f77/win_delete_attr_f.c index 83f0469c45..2a2ea22078 100644 --- a/src/mpi/f77/win_delete_attr_f.c +++ b/src/mpi/f77/win_delete_attr_f.c @@ -16,9 +16,7 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" -#include "attribute/attribute.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER #pragma weak PMPI_WIN_DELETE_ATTR = mpi_win_delete_attr_f diff --git a/src/mpi/f77/win_fence_f.c b/src/mpi/f77/win_fence_f.c index ac1cd17034..9ec74887b3 100644 --- a/src/mpi/f77/win_fence_f.c +++ b/src/mpi/f77/win_fence_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/win_free_f.c b/src/mpi/f77/win_free_f.c index 422a33674b..ad87a52706 100644 --- a/src/mpi/f77/win_free_f.c +++ b/src/mpi/f77/win_free_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/win_free_keyval_f.c b/src/mpi/f77/win_free_keyval_f.c index 955e758c74..48e8a1ee57 100644 --- a/src/mpi/f77/win_free_keyval_f.c +++ b/src/mpi/f77/win_free_keyval_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/win_get_attr_f.c b/src/mpi/f77/win_get_attr_f.c index 4135c5ebe5..02f83073f7 100644 --- a/src/mpi/f77/win_get_attr_f.c +++ b/src/mpi/f77/win_get_attr_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/win_get_errhandler_f.c b/src/mpi/f77/win_get_errhandler_f.c index 28ced746af..0337a710b0 100644 --- a/src/mpi/f77/win_get_errhandler_f.c +++ b/src/mpi/f77/win_get_errhandler_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/win_get_group_f.c b/src/mpi/f77/win_get_group_f.c index 4096607f75..1a7944ff34 100644 --- a/src/mpi/f77/win_get_group_f.c +++ b/src/mpi/f77/win_get_group_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/win_get_name_f.c b/src/mpi/f77/win_get_name_f.c index 2d3e235cdf..3d1d885434 100644 --- a/src/mpi/f77/win_get_name_f.c +++ b/src/mpi/f77/win_get_name_f.c @@ -16,10 +16,9 @@ #include "ompi_config.h" -#include "mpi.h" +#include "mpi/f77/bindings.h" #include "include/constants.h" #include "errhandler/errhandler.h" -#include "mpi/f77/bindings.h" #include "mpi/f77/strings.h" diff --git a/src/mpi/f77/win_lock_f.c b/src/mpi/f77/win_lock_f.c index f9c8813e84..2db9494cdd 100644 --- a/src/mpi/f77/win_lock_f.c +++ b/src/mpi/f77/win_lock_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/win_post_f.c b/src/mpi/f77/win_post_f.c index d2e5c44640..240275e018 100644 --- a/src/mpi/f77/win_post_f.c +++ b/src/mpi/f77/win_post_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/win_set_attr_f.c b/src/mpi/f77/win_set_attr_f.c index 283bfd98e6..2abf135043 100644 --- a/src/mpi/f77/win_set_attr_f.c +++ b/src/mpi/f77/win_set_attr_f.c @@ -16,7 +16,6 @@ #include "ompi_config.h" -#include "mpi.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER diff --git a/src/mpi/f77/win_set_errhandler_f.c b/src/mpi/f77/win_set_errhandler_f.c index 7527cae910..916dbb2847 100644 --- a/src/mpi/f77/win_set_errhandler_f.c +++ b/src/mpi/f77/win_set_errhandler_f.c @@ -16,9 +16,8 @@ #include "ompi_config.h" -#include "mpi.h" -#include "errhandler/errhandler.h" #include "mpi/f77/bindings.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER #pragma weak PMPI_WIN_SET_ERRHANDLER = mpi_win_set_errhandler_f diff --git a/src/request/grequest.c b/src/request/grequest.c index 6af4273409..b058b0015c 100644 --- a/src/request/grequest.c +++ b/src/request/grequest.c @@ -22,8 +22,8 @@ static int ompi_grequest_free(ompi_request_t** req) { int rc = OMPI_SUCCESS; ompi_grequest_t* greq = *(ompi_grequest_t**)req; - if(greq->greq_free != NULL) - rc = greq->greq_free(greq->greq_state); + if(greq->greq_free.c_free != NULL) + rc = greq->greq_free.c_free(greq->greq_state); if(rc == OMPI_SUCCESS) { OBJ_RELEASE(greq); *req = MPI_REQUEST_NULL; @@ -35,17 +35,17 @@ static int ompi_grequest_cancel(ompi_request_t* req, int flag) { int rc = OMPI_SUCCESS; ompi_grequest_t* greq = (ompi_grequest_t*)req; - if(greq->greq_cancel != NULL) - rc = greq->greq_cancel(greq->greq_state, flag); + if(greq->greq_cancel.c_cancel != NULL) + rc = greq->greq_cancel.c_cancel(greq->greq_state, flag); return rc; } static void ompi_grequest_construct(ompi_grequest_t* greq) { OMPI_REQUEST_INIT(&greq->greq_base); - greq->greq_base.req_fini = ompi_grequest_free; - greq->greq_base.req_free = ompi_grequest_free; - greq->greq_base.req_cancel = ompi_grequest_cancel; + greq->greq_base.req_fini = ompi_grequest_free; + greq->greq_base.req_free = ompi_grequest_free; + greq->greq_base.req_cancel = ompi_grequest_cancel; greq->greq_base.req_type = OMPI_REQUEST_GEN; } @@ -76,9 +76,9 @@ int ompi_grequest_start( } greq->greq_state = gstate; - greq->greq_query = gquery_fn; - greq->greq_free = gfree_fn; - greq->greq_cancel = gcancel_fn; + greq->greq_query.c_query = gquery_fn; + greq->greq_free.c_free = gfree_fn; + greq->greq_cancel.c_cancel = gcancel_fn; *request = &greq->greq_base; return OMPI_SUCCESS; } @@ -88,8 +88,8 @@ int ompi_grequest_complete(ompi_grequest_t* grequest) int rc = OMPI_SUCCESS; OMPI_THREAD_LOCK(&ompi_request_lock); grequest->greq_base.req_complete = true; - if(grequest->greq_query != NULL) - rc = grequest->greq_query(grequest->greq_state, &grequest->greq_base.req_status); + if(grequest->greq_query.c_query != NULL) + rc = grequest->greq_query.c_query(grequest->greq_state, &grequest->greq_base.req_status); if(ompi_request_waiting) ompi_condition_signal(&ompi_request_cond); OMPI_THREAD_UNLOCK(&ompi_request_lock); diff --git a/src/request/grequest.h b/src/request/grequest.h index fc9f389359..c86d4666a3 100644 --- a/src/request/grequest.h +++ b/src/request/grequest.h @@ -25,12 +25,33 @@ extern "C" { #endif OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_grequest_t); +/* + * Fortran types for the generalized request functions. + */ +typedef void (MPI_F_Grequest_query_function)(void* extra_state, MPI_Status* status, int* ierr ); +typedef void (MPI_F_Grequest_free_function)( void* extra_state, int* err ); +typedef void (MPI_F_Grequest_cancel_function)( void* extra_state, int* complete, int* ierr ); + +typedef union { + MPI_Grequest_query_function* c_query; + MPI_F_Grequest_query_function* f_query; +} MPI_Grequest_query_fct_t; + +typedef union { + MPI_Grequest_free_function* c_free; + MPI_F_Grequest_free_function* f_free; +} MPI_Grequest_free_fct_t; + +typedef union { + MPI_Grequest_cancel_function* c_cancel; + MPI_F_Grequest_cancel_function* f_cancel; +} MPI_Grequest_cancel_fct_t; struct ompi_grequest_t { ompi_request_t greq_base; - MPI_Grequest_query_function *greq_query; - MPI_Grequest_free_function *greq_free; - MPI_Grequest_cancel_function *greq_cancel; + MPI_Grequest_query_fct_t greq_query; + MPI_Grequest_free_fct_t greq_free; + MPI_Grequest_cancel_fct_t greq_cancel; void *greq_state; }; typedef struct ompi_grequest_t ompi_grequest_t; diff --git a/src/request/req_wait.c b/src/request/req_wait.c index f584598474..ad37a2293e 100644 --- a/src/request/req_wait.c +++ b/src/request/req_wait.c @@ -59,8 +59,8 @@ int ompi_request_wait_any( /* give up and sleep until completion */ OMPI_THREAD_LOCK(&ompi_request_lock); + ompi_request_waiting++; do { - ompi_request_waiting++; rptr = requests; num_requests_null_inactive = 0; for (i = 0; i < count; i++, rptr++) { diff --git a/src/request/request.h b/src/request/request.h index 5ca48e9c14..436fda0656 100644 --- a/src/request/request.h +++ b/src/request/request.h @@ -100,7 +100,7 @@ typedef struct ompi_request_t ompi_request_t; /** - * Iniitialize a request. This is a macro to avoid function call + * Initialize a request. This is a macro to avoid function call * overhead, since this is typically invoked in the critical * performance path (since requests may be re-used, it is possible * that we will have to initialize a request multiple times).