-
Notifications
You must be signed in to change notification settings - Fork 877
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate bigcount interfaces for Fortran and C #12226
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't finished reading / understanding / reviewing both generate_bindings.py scripts yet, but since I'm so late for this and the clock is ticking on @jtronge's availability, I'm going to submit what I have so far.
|
||
# JMS Somehow this variable substitution isn't quite working, and I | ||
# don't have time to figure it out. So just wholesale copy the file | ||
# list. :-( | ||
#pmpi_api_files = $(mpi_api_files:%=profile/p%) | ||
#pmpi_api_files = $(mpi_api_files:%=p%) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you can figure out why this substitution isn't working, go ahead and uncomment it. Otherwise, it would probably be ok to delete this whole commented-out block.
ompi/mpi/c/generate_bindings.py
Outdated
args = parser.parse_args() | ||
|
||
# Always add the header | ||
print('/* THIS FILE WAS AUTOGENERATED BY ompi/mpi/c/abi.py. DO NOT EDIT BY HAND. */') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additionally, it might be better to have a traditional --outfile=FILENAME
kind of CLI arg that indicates the name of the file that you want to write to. This leaves stdout available for info/verbose/debug kinds of output.
ompi/mpi/c/generate_bindings.py
Outdated
* Functions requiring a bigcount implementation should have type COUNT in | ||
place of MPI_Count or int for each count parameter. Bigcount functions will | ||
be generated automatically for any function that includes a COUNT type. | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a larger comment here at the top explaining the purpose of this script, and at least a high-level overview of what it does / how it works. This is a very large script; having an intro to it at the top would be most helpful to the reader (e.g., me).
Should #12033 be closed (if this PR wholly replaces it)? |
/azp run |
8484636
to
90d6570
Compare
6476640
to
569efa1
Compare
60ea322
to
ab496c4
Compare
Oh... how is this PR correct, then? If we have datatype size mismatches, the code isn't going to be correct. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made a bunch of nit-picky comments, some of which will be trivial to fix.
I think probably the only real substantial thing is the question about the compiler warnings / not attempting to address the changes needed by the underlying OMPI datatype functions. We'll need to figure that out -- we can't just ignore that.
@@ -57,436 +484,439 @@ ompi_HEADERS = $(headers) | |||
endif | |||
|
|||
# | |||
# List of all C files that have profile versions | |||
# List of all C files that have profile versions (generated_*.c files were | |||
# generated from prototype_sources above). | |||
# | |||
interface_profile_sources = \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not critical, but is it possible to generate interface_profile_sources
from prototype_sources
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to do that with automake?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jsquyres i think this is the last open conversation. do we need to do something in this PR or can this wait till a followup?
|
||
@Type.add_type('TYPE_COPY_ATTR_FUNCTION', abi_type=['standard']) | ||
class TypeTypeCopyAttrFunctionStandard(Type): | ||
# TODO: This may require a special function to wrap the callback |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All these attribute functions are still marked TODO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also for the standard ABI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deleting the old API files and creating new ones that are 95% identical instead of renaming and altering the renamed file drops access to past history of the MPI API support. What is the reason for taking this approach and is this reason compensating the losing history drawback ?
@@ -33,21 +33,22 @@ | |||
*/ | |||
|
|||
#if OMPI_SIZEOF_FORTRAN_INTEGER == SIZEOF_INT | |||
#define OMPI_ARRAY_NAME_DECL(a) int *c_##a = NULL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new macros are not doing anything.
How is a macro such as OMPI_ARRAY_FINT_2_INT_CLEANUP
supposed to work now ? If I read this code correctly it will test if one of the arguments of the API, which is not allowed to be NULL by the standard, is NULL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is code that was pulled in from PR #10302, and indirectly from a branch by @ggouaillardet.
|
||
MOSTLYCLEANFILES = *.mod | ||
|
||
CLEANFILES += *.i90 | ||
|
||
lib_LTLIBRARIES = lib@OMPI_LIBMPI_NAME@_usempif08.la | ||
noinst_LTLIBRARIES = lib@OMPI_LIBMPI_NAME@_usempif08_profile.la |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to see an answer to your previous question as well. It will be educative for all OMPI developers to understand how will the profiling layer generated and build.
actually one just needs to do
to get the history of a renamed file. |
bfd0681
to
cff5b03
Compare
uh oh. nvidia needs to be more disks! |
to take a count argument of type size_t. related to open-mpi#12226 related to open-mpi#9194 Signed-off-by: Howard Pritchard <howardp@lanl.gov>
to take a count argument of type size_t. related to open-mpi#12226 related to open-mpi#9194 Signed-off-by: Howard Pritchard <howardp@lanl.gov>
to take a count argument of type size_t. related to open-mpi#12226 related to open-mpi#9194 Signed-off-by: Howard Pritchard <howardp@lanl.gov>
related to open-mpi#12226 and open-mpi#9194 remove incorrect and misleading comment about ompi_3buff_op_reduce. See open-mpi#967 Signed-off-by: Howard Pritchard <howardp@lanl.gov>
related to open-mpi#12226 and open-mpi#9194 remove incorrect and misleading comment about ompi_3buff_op_reduce. See open-mpi#967 Signed-off-by: Howard Pritchard <howardp@lanl.gov>
This adds scripts for generating the C API bindings from template files, while also generating bigcount interfaces for those that require them. The binding script also include initial support for the mpi_f08 Fortran bindings, but doesn't yet make any changes to fortran/use-mpi-f08 Python >=3.6 is required for running these scripts, which is only necessary when the binding files have not already been generated. Users of the distribution tarball should not need to generate these files and thus should not require Python. Note that there are additional changes needed to Open MPI for bigcount support. One is that the datatype system needs to be embiggened. This PR includes workarounds for this lack of support that will need to be changed once the datatype system is embiggened. These areas of code are marked with TODO:BIGCOUNT. Co-authored-by: mphinney1100 <mphinney@lanl.gov> Co-authored-by: Howard Pritchard <hppritcha@gmail.com> Signed-off-by: Jake Tronge <jtronge@lanl.gov>
This updates fortran/use-mpi-f08 to generate most of the Fortran bindings from a script and template files. It also adds support for Fortran TS 29113 when possible, allowing for better Fortran array handling that matches the standard. The C files were imported from PR open-mpi#10302 and converted to templates to be fed into the binding script. Co-authored-by: Gilles Gouaillardet <gilles@rist.or.jp> Co-authored-by: Howard Pritchard <howardp@lanl.gov> Signed-off-by: Jake Tronge <jtronge@lanl.gov>
Signed-off-by: Jake Tronge <jtronge@lanl.gov>
This adds scripts for generating the C and Fortran mpi_f08 API bindings from template files, while also generating bigcount interfaces for those that require them. On the Fortran side it also adds support for TS 29113 when possible, allowing for better Fortran array handling that matches the standard (some files were imported from PR #10302).
Python >=3.6 is required for running these scripts, which is only necessary when the binding files have not already been generated. Users of the distribution tarball should not need to generate these files and thus should not require Python.
We used https://github.com/cea-hpc/pcvs-benchmarks and the MPI4PY test suite to help ensure all big count interfaces (C and Fortran) are being generated.
PR #12033 is a previous version of this focused specifically on ABI support.
Note that there are additional changes needed to Open MPI for bigcount support. One is that the datatype system needs to be embiggened. This PR includes workarounds for this lack of support that will need to be changed once the datatype system is embiggened. These areas of code are marked with TODO:BIGCOUNT.