Just using the name without prefix, e.g. MPI_Send -> send.txt, resulting
in duplicated filenames between MPI_/MPI_T_/MPIX_ functions, and they
overwrite each other. This resulted in certain man pages missing. For
example, MPI_Finalize and MPI_Init_thread man pages were missing because
they were overwritten by the MPI_T_ correspondents.
Add MPIX_{Comm,Win,File,Session}_create_errhandler_x.
Similar to MPIX_Op_create, the _x versions allow users to attach an
extra state and the callback accepts scalar input rather than the
pointer versions for Fortran style.
Differences from MPI_Op_create or MPI_Op_create_c:
* User function accepts a void * extra_state as user context.
* User function accepts count and datatype as scalar input.
* User function accepts count as MPI_Count.
* There is a destructor callback called upon Op free.
The extra_state is for binding layer to store per-op information if a
proxy function is used. The destructor allow the extra_state to be
freed.
Previous commit [4d96f728e] did not compile because it was missing the
MPI_UNDEFINED symbol in the wrapper function. Make sure to add it to
"uses" so it is accessible.
Same fix as pmodels/mpich#6403 applied to the mpi_f08. MPI_UNDEFINED
should not be adjusted by 1 because it is a special value and not an
index. Fixespmodels/mpich#6989.
The single source option generates huge c_binding.c. It may be desirable
to opt for multiple source files instead.
TODO: I still think we should do -single-source by default, but it is nice
to have the option.
There are functions removed or deprecated with replacement functions,
which we implemented by calling MPI_xxx_internal functions. Thus
we need generate all replaced functions together to avoid making those
static internal functions external.
We neglected to check error from cdesc_create_datatype, which resulted
in silent error for case such as:
call MPI_Isend( A(1:30:3,1:20:2), size(A(1:30:3,1:20:2))-1,
MPI_INTEGER, me, 99, MPI_COMM_WORLD, r(1))
comm: Use PMPI routines for rank/size/remote-size.
array: Do not malloc unless size is larger than zero.
MPI_Comm_spawn: access info only at root.
MPI_Comm_spawn_multiple: access array_of_info only at root.
The autoconf .in files have to generated inside the source tree. Thus we
cannot generate them during configure.
Also, use AC_CONFIG_COMMANDS_PRE to run python scripts inside configure,
thus will abort configure upon errors.
Three routines are defined in ROMIO, potentially using ABI header. We
need handler conversion to use inside MPICH.
Only include mpir_ext.h in the code that needs it. With BUILD_MPI_ABI,
we need alter the function parameter types for conversions.
Since we no longer include mpir_ext.h in the binding files, we need
explicitly declare them. We can treat them as void pointers to avoid the
distinction between ABI and non-ABI versions.
Custom clean up code (ref. MPI_Comm_spawn_multiple) are loaded in
func['code-clean_up']. We need avoid overwriting this attribute or we
will lose the custom cleanup code then function is being processed
twice.
Similar to previous commit, we replace the perl script that generates
src/binding/fortran/use_mpi_f08/mpi_f08_compile_constants.f90.in in
gen_binding_f08.py.
This also added the missing MPI 4.0/4.1 symbols including:
MPI_COMBINER_VALUE_INDEX
MPI_COMM_TYPE_HW_GUIDED
MPI_COMM_TYPE_HW_UNGUIDED
MPI_COMM_TYPE_RESOURCE_GUIDED
MPI_ERRORS_ABORT
MPI_SESSION_NULL
MPI_MAX_PSETNAME_LEN
MPI_MAX_STRINGTAG_LEN
In addition, previous perl script failed to account for the "MAX"
constants need to be 1-less than the C correspondent to account for the
terminating NUL in C string.
The perl script src/binding/fortran/mpif_h/buildiface generates
mpif.h.in from scraping mpi.h.in and mpio.h.in. The old script has
become difficult to maintain and it is missing a few newly added symbols
including -
MPI_COMBINER_VALUE_INDEX
MPI_COMM_TYPE_HW_GUIDED
MPI_COMM_TYPE_HW_UNGUIDED
MPI_COMM_TYPE_RESOURCE_GUIDED
MPI_ERRORS_ABORT
MPI_MAX_PSET_NAME_LEN
MPI_MAX_STRINGTAG_LEN
MPI_SESSION_NULL
In addition, it needs declare all functions that does not return
INTEGER. It was missing MPI_Aint_add and MPI_Aint_diff.
The cptr functions are missing prototype declarations and causing
"-wmissing-prototypes" warnings. Extend "dump_profiling" routine to
cover cptr versions.
Commit 804badf added cptr generic interface for MPI_Alloc_mem, but we
are missing MPI_Win_allocate, MPI_Win_allocate_shared, and
MPI_Win_shared_query. Enhance the binding layer to generate all
functions with C_BUFFER kind output parameter.
For MPI_{Test,Wait}_{all,any,some}, free the completed requests and set
to MPI_REQUEST_NULL in the binding layer. This prepares for
MPI_Get_status_{all,any,some} that are added in MPI 4.1.
We also convert all request pointers for MPI_Testall and MPI_Waitall.
MPI_Waitall will need to convert all pointers anyway, so there shouldn't
be performance difference -- if any, should be better. MPI_Testall has
no impact for count < 64, the batch size. The impact of large testall
request arrays will be negligible compared to the overhead of running
progress.
It was a bug previously but it did not trigger test failures due to not
using generic interfaces. Now we it triggers compile error that we
switched all functions to generic interfaces.
We need PMPI_Wtime and PMPI_Wtick since otherwise the compiler doesn't
know the function return type. We need PMPI interfaces for other
functions for the same reason that we need MPI interfaces.
Enable MPI Group routines that operate on a single group
to use the error handler of the session to which they
belong (if any). If a group does not belong to a session
(world model), the error return falls back to comm error
return as before.
The fortran interface uses ierror for the return argument rather than
ierr. This matters if user call with explicit keyword e.g.
call MPI_Init(ierror=status)
, where status is the actual variable to use.
To do collective v-array swap, we need the communicator size and rank.
Expand the code to accommodate thread communicators.
Rather than repeat the regex pattern multiple times, check the regex at
the beginning and save as func["_need_coll_v_swap"] and
func["_need_type_create_swap"].
Section 19.2 of MPI-4.0 specifies for large count routines:
The other specific procedure has the same name followed by "_c", and
then suffixed by the token specified in Table 19.1 for USE mpi_f08.
Fixespmodels/mpich#6575.
To mark selected functions to support threadcomm, add "threadcomm" to
the "extra" flags in custom api files, e.g. src/binding/c/comm_api.txt.
The binding layer will generate code to check if the comm parameter is
a thread communicator, and if yes, call the threadcomm impl functions.
This method allows a separate MPIR_Threadcomm_xxx_impl function to
handle threadcomm and leave the existing MPIR_xxx_impl unchanged to
handle normal communicators.
Alternatively, if we just add a little extra handling in the existing
implementation, we can skip the binding-layer hack and directly add
`if (comm->threadcomm)` branch into the existing impl functions. For
example, we'll extend `MPI_Comm_{set,get}_attr` the latter way.