Skip to content
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

MPICommOnly / mpidummy cleanup; no-MPI_Init support #1466

Merged
merged 9 commits into from
Jun 3, 2019

Conversation

germasch
Copy link
Contributor

@germasch germasch commented May 29, 2019

This PR gets rid off ADIOSMPICommOnly.h. This probably dates back to the pre-pimpl cxx11 bindings, but isn't useful anymore. Currently, this header gets installed, but only included in the public (Installed) adios2_c_operator.h, which doesn't need MPI_Comm.

This PR also does some cleanup on mpidummy, including fixing a couple of minor bugs and getting rid of MPI_Error_string, which is never used and also doesn't do what the standard says it should be doing.

ETA: This PR now also includes a new level of MPI wrapping in mpiwrap.{h,cpp}. The functions SMPI_Comm_rank() etc behave like the regular MPI counterpart, but they fall back to mpidummy.h in the case where MPI is not initialized, in order to make ADIOS2 more easily usable from serial code even if ADIOS2 itself has been built with MPI.

@pnorbert
Copy link
Contributor

pnorbert commented May 29, 2019 via email

@pnorbert
Copy link
Contributor

pnorbert commented May 29, 2019 via email

@germasch
Copy link
Contributor Author

Kai, I am working on unifying the parallel and serial builds into one library. It is much more work than I expected so it will come a bit later.

Actually, I have this mostly finished, just needs some cleaning up -- this PR are some preliminary steps. So depending on how much work you've already put into it, I could polish my version and make a PR. I didn't go the class/virtual function route, rather I just explicitly dispatch to the real MPI versus a dummy implementation depending on whether the real MPI has been MPI_Init'd. It could be changed into using derived classes, but I think it's even more code that way. Basically I'm just augmenting the real MPI library to handle one-proc functionality when it's not initialized. I'm also using mpidummy for that, but note that it needs to be compiled with types etc from the real mpi.h in that case, as you've probably found out, too ;)

@pnorbert
Copy link
Contributor

Can you share your branch to look at?

Mine is complicated for sure. Had to change almost every class to use AMPI_Comm instead of MPI_Comm. https://github.com/pnorbert/ADIOS2/tree/AMPI

@pnorbert
Copy link
Contributor

Does your version work in a serial build when MPI is not available?

@germasch
Copy link
Contributor Author

Yes, it does, in that case it just uses mpidummy. In a parallel build, it uses mpi.h. The MPI functions in that case get dispatched to the regular MPI lib if it's initialized, and to the mpidummy implementation otherwise (so mpidummy provides just the implementation in this case, but not the types / constants, which still come from mpi.h)

The changes throughout the code are replacing MPI_Comm_rank with mpi::MPI_Comm_rank etc. This doesn't need to be done throughout, necessarily, but for the pieces which are supposed to work when adios2 is compiled with an actual MPI lib, but runs without MPI_Init.

@germasch germasch changed the title MPICommOnly / mpidummy cleanup [WIP] MPICommOnly / mpidummy cleanup / serial+MPI support May 30, 2019
@germasch
Copy link
Contributor Author

I pushed the changes for the MPI+serial support in here, though it's not in shape to be merged. The last two commits are the actual work.

They provide adios2::mpi::{MPI_Comm_rank,MPI_Comm_size, ...}. These versions can be called (on 1-proc communicators) even if MPI has not been initialized. In the adios2 w/o MPI case, these functions are just the usual mpidummy versions. If compiled with MPI, these functions wrap the actual MPI library calls, but will fall back to the mpiummy versions if the MPI library hasn't been initialized.

The last commit switches a couple of places to use the mpi::MPI_* wrappers instead of the original MPI functions, just enough to make bpls work without MPI_Init/MPI_Finalize.

In some other branch, I have some more changes that provide the serial ADIOS constructors even in the compiled-with-MPI case, add some test, etc.

I will say that I'm not entirely happy with this, but it's the least invasive approach I can come up with. In particular, I would have liked to do this in a way that doesn't require changes throughout the code. I don't think that's possible without resorting to other hacks, though. I was hoping I might be able to put the MPI function wrappers into the adios2:: namespace, so they would get picked up automatically. However, that's not possible because mpi.h defines the original functions extern "C", which means they don't honor namespaces and ambiguity ensues.

I have some other ideas, but don't really like those, either.

  • #define MPI_Comm_rank mpi::MPI_Comm_rank etc in ADIOSMPI.h. That would make the change appear to be transparent, though it's kinda fake.
  • Play some tricks with dynamic loading of a mpidummy shared library instead of the actual MPI lib when indicated. Sounds rather painful to do, in particular considering that you're supporting a wide variety of systems which I'm sure have their quirks.
  • Use the MPI profiling interface to intercept the MPI calls. That's actually quite easy to do, and should be portable if all implementations follow the standard. It's still kind of an abuse of that ability.

Of course one can do a more complete wrapping of MPI, including using virtual base classes, wrapping the data types, etc. I kinda feel that's not the best direction to go, everyone is familiar with MPI and having to learn a different way in adios2 is cumbersome, and 3rd party dependencies won't be covered either way.

Personally, I feel it'd be better to work the other way, ie, use something like this approach to make the adios2 w/o MPI_Init work for what's commonly needed now. For the future, I think it'd be good to avoid needing to use any of those wrappers in the first place. E.g., Transport uses MPI_Comm_rank/size, but FilePOSIX really doesn't care about that. If there is a transport that actually uses MPI (MPI-I/O?), that could call MPI_Comm_rank/size itself, because the presumably requires an actual MPI, or at least I'd say that'd be a reasonable constraint to create. But FilePOSIX just shouldn't make any MPI calls, so there's nothing to wrap there.

@pnorbert
Copy link
Contributor

Note that this branch in this form does not even compile on Titan. CI VMs do the build fine but have failing tests.

[ 32%] Building CXX object source/adios2/CMakeFiles/adios2.dir/core/Attribute.cpp.o
In file included from /ccs/proj/e2e/pnorbert/ADIOS/ADIOS2/source/adios2/helper/mpiwrap.h:12:0,
                 from /ccs/proj/e2e/pnorbert/ADIOS/ADIOS2/source/adios2/ADIOSMPI.h:13,
                 from /ccs/proj/e2e/pnorbert/ADIOS/ADIOS2/source/adios2/helper/adiosMPIFunctions.h:19,
                 from /ccs/proj/e2e/pnorbert/ADIOS/ADIOS2/source/adios2/helper/adiosFunctions.h:15,
                 from /ccs/proj/e2e/pnorbert/ADIOS/ADIOS2/source/adios2/core/Attribute.cpp:14:
/ccs/proj/e2e/pnorbert/ADIOS/ADIOS2/source/adios2/helper/mpidummy.h:125:16: error: 'MPI_Comm' is not a type
                MPI_Comm comm);
                ^~~~~~~~
/ccs/proj/e2e/pnorbert/ADIOS/ADIOS2/source/adios2/helper/mpidummy.h:128:50: error: 'MPI_Comm' is not a type
                 MPI_Datatype recvtype, int root, MPI_Comm comm);
                                                  ^~~~~~~~
/ccs/proj/e2e/pnorbert/ADIOS/ADIOS2/source/adios2/helper/mpidummy.h:131:19: error: 'MPI_Comm' is not a type
                   MPI_Comm comm);
                   ^~~~~~~~
/ccs/proj/e2e/pnorbert/ADIOS/ADIOS2/source/adios2/helper/mpidummy.h:135:17: error: 'MPI_Comm' is not a type
                 MPI_Comm comm);
                 ^~~~~~~~
/ccs/proj/e2e/pnorbert/ADIOS/ADIOS2/source/adios2/helper/mpidummy.h:138:51: error: 'MPI_Comm' is not a type
                  MPI_Datatype recvtype, int root, MPI_Comm comm);
                                                   ^~~~~~~~
/ccs/proj/e2e/pnorbert/ADIOS/ADIOS2/source/adios2/helper/mpidummy.h:141:14: error: 'MPI_Comm' is not a type
              MPI_Comm comm, MPI_Status *status);
              ^~~~~~~~
/ccs/proj/e2e/pnorbert/ADIOS/ADIOS2/source/adios2/helper/mpidummy.h:143:15: error: 'MPI_Comm' is not a type
               MPI_Comm comm, MPI_Request *request);
               ^~~~~~~~
/ccs/proj/e2e/pnorbert/ADIOS/ADIOS2/source/adios2/helper/mpidummy.h:145:23: error: 'MPI_Comm' is not a type
              int tag, MPI_Comm comm);
                       ^~~~~~~~
/ccs/proj/e2e/pnorbert/ADIOS/ADIOS2/source/adios2/helper/mpidummy.h:147:24: error: 'MPI_Comm' is not a type
               int tag, MPI_Comm comm, MPI_Request *request);
                        ^~~~~~~~
/ccs/proj/e2e/pnorbert/ADIOS/ADIOS2/source/adios2/helper/mpidummy.h:153:28: error: expected ')' before 'comm'
 int MPI_File_open(MPI_Comm comm, const char *filename, int amode, MPI_Info info,
                            ^~~~
/ccs/proj/e2e/pnorbert/ADIOS/ADIOS2/source/adios2/helper/mpidummy.h:153:34: error: expected primary-expression before 'const'
 int MPI_File_open(MPI_Comm comm, const char *filename, int amode, MPI_Info info,
                                  ^~~~~
/ccs/proj/e2e/pnorbert/ADIOS/ADIOS2/source/adios2/helper/mpidummy.h:153:56: error: expected primary-expression before 'int'
 int MPI_File_open(MPI_Comm comm, const char *filename, int amode, MPI_Info info,
                                                        ^~~
/ccs/proj/e2e/pnorbert/ADIOS/ADIOS2/source/adios2/helper/mpidummy.h:153:76: error: expected primary-expression before 'info'
 int MPI_File_open(MPI_Comm comm, const char *filename, int amode, MPI_Info info,
                                                                            ^~~~
/ccs/proj/e2e/pnorbert/ADIOS/ADIOS2/source/adios2/helper/mpidummy.h:154:28: error: expected primary-expression before '*' token
                   MPI_File *fh);
                            ^
/ccs/proj/e2e/pnorbert/ADIOS/ADIOS2/source/adios2/helper/mpidummy.h:154:29: error: 'fh' was not declared in this scope
                   MPI_File *fh);
                             ^~
/ccs/proj/e2e/pnorbert/ADIOS/ADIOS2/source/adios2/helper/mpidummy.h:154:31: error: expression list treated as compound expression in initializer [-fpermissive]
                   MPI_File *fh);
                               ^
/ccs/proj/e2e/pnorbert/ADIOS/ADIOS2/source/adios2/helper/mpidummy.h:162:29: error: expected ')' before 'comm'
 int MPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm *comm_out);
                             ^~~~
/ccs/proj/e2e/pnorbert/ADIOS/ADIOS2/source/adios2/helper/mpidummy.h:162:35: error: expected primary-expression before 'int'
 int MPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm *comm_out);
                                   ^~~
/ccs/proj/e2e/pnorbert/ADIOS/ADIOS2/source/adios2/helper/mpidummy.h:162:46: error: expected primary-expression before 'int'
 int MPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm *comm_out);
                                              ^~~
/ccs/proj/e2e/pnorbert/ADIOS/ADIOS2/source/adios2/helper/mpidummy.h:162:65: error: 'comm_out' was not declared in this scope
 int MPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm *comm_out);
                                                                 ^~~~~~~~
/ccs/proj/e2e/pnorbert/ADIOS/ADIOS2/source/adios2/helper/mpidummy.h:162:73: error: expression list treated as compound expression in initializer [-fpermissive]
 int MPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm *comm_out);
                                                                         ^
/ccs/proj/e2e/pnorbert/ADIOS/ADIOS2/source/adios2/helper/mpidummy.h:169:60: error: 'MPI_Comm' is not a type
                MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm);
                                                            ^~~~~~~~
/ccs/proj/e2e/pnorbert/ADIOS/ADIOS2/source/adios2/helper/mpidummy.h:172:53: error: 'MPI_Comm' is not a type
                   MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);

@germasch
Copy link
Contributor Author

I put this up here (as [WIP]) because you asked to take a look at it, not because it's ready (it's clearly not :(). I'll take a look at what's going on on Titan.

germasch added 3 commits May 30, 2019 13:37
It does not appear to be needed anymore.
and use it internally, instead of repeated switch statements.
I'm intentionally using an if-else chain rather than switch in the
implementation, since I want this to work if MPI_Datatype isn't an
integer type in the future.
germasch added 2 commits May 30, 2019 15:57
It's never used, actually incorrectly implemented (it's supposed to just
return string based on the passed-in error code, not maintain
"last error" state), and as seen by a recent bug fix, still has the
potential for buggy behavior.
@germasch
Copy link
Contributor Author

Well, let's see how the CI goes this time...

I added a fix for the Titan build issue, but I couldn't say I understand why that's needed in the first place. I also rebased and fixed some other bugs. In particular, this change that I made to the dummy MPI_Gather broke many things:

@@ -109,7 +109,7 @@ int MPI_Gather(const void *sendbuf, int sendcnt, MPI_Datatype sendtype,
     size_t nsent = 0, nrecv = 0;
     if (!sendbuf && !recvbuf)
     {
-        return ier;
+        return MPI_ERR_BUFFER;
     }
     if (comm == MPI_COMM_NULL || root)
     {

The old behavior returned 0 (success) when either buffer was NULL. I changed the behavior to be the same as what MPI_Scatter does, but apparently there is code that relies on passing NULL buffers to MPI_Gather together with 0 counts. So in this latest version, I accept a NULL buffer as long as the corresponding count is 0.

@germasch
Copy link
Contributor Author

There were a couple more failing tests which I fixed with the latest commit (I think -- we'll see).

The failing tests were calling bpls on HDF5 files. Since bpls now doesn't call MPI_Init (because it's my guinea pig for testing serial use of a parallel adios2 lib), that failed because parallel HDF5 internally MPI_Comm_dups the communicator passed to it. The fix is to not use HDF5 in parallel mode when the communicator encompasses only a single process.

This kinda goes to demonstrate what I was talking about earlier: I think, in the end a cleaner way to solve this problem is to avoid using MPI when it's not needed in the first place, that is, when running on a single proc. This could also be helpful for performance -- for example, MPI_Bcast, MPI_Gather etc on a single proc end up doing a copy, that could be avoided in the serial case in the first place. The cost, of course, is to have two separate code paths to handle serial vs actually parallel cases. I think it's not a lot of code that would change, though. Wrapping MPI in the way we currently do (both @pnorbert's and my approach do that) is a bit of a band-aid, which can be made to work within the core of adios2, but this only goes so far, external libraries can't be handled this way, and within adios2 it means touching a lot of code and replacing a familiar MPI interface by something new.

There could be some value in wrapping MPI in a more C++-ish fashion, OTOH, the MPI standard tried that a long time ago and eventually through in the towel and deprecated its C++ bindings. Of course, I am biased, but in my approach, the use of MPI is just the same as with real MPI, with the exception of having to put the mpi:: namespace prefix, so at least it's still the familiar interface, and overhead is small. A potential drawback with what I've done is that I've only updated selected MPI calls, those that are necessary for bpls to work. In order to make adios2 work without MPI_Init more generally, more calls will need that prefix, and it's not entirely trivial to find all the necessary places. One could, of course, just do a global search and replace, though as I said above, I'd actually be in favor of going the opposite way, that is, avoiding wrapped MPI calls wherever possible instead and aim for getting rid of the band-aid eventually.

@pnorbert
Copy link
Contributor

pnorbert commented May 31, 2019 via email

@williamfgc
Copy link
Contributor

@pnorbert @germasch since you're already handling the C++ side, please keep in mind how this would extent to the internal C parts. C doesn't have a notion of namespace, not sure if this is required (would any "serial" tool use SST?). The only solution I can think of is the use function pointer in C to map to virtual functions.

@germasch
Copy link
Contributor Author

Good point about handling C. It looks like the only thing affected is SST. I'm not sure how important SST w/o MPI_Init is, it'd be nice if someone (@eisenhauer @philip-davis ) could comment on that. A potential use case that I could see is some python analysis script that runs alongside a simulation, connected via SST. In that case, being able to run python without having to deal with MPI would certainly be nice.

I think with my approach, it's not too hard to handle C, I just need to make my wrappers accessible outside of the namespace, using extern "C". So there could be a SMPI_Comm_rank doing the same as mpi::MPI_Comm_rank, etc. Though in that case, maybe I should just always use SMPI_*, even in C++?

@pnorbert
Copy link
Contributor

pnorbert commented May 31, 2019 via email

@germasch germasch force-pushed the pr/mpidummy branch 3 times, most recently from 40f424f to 53b0147 Compare May 31, 2019 17:31
@germasch
Copy link
Contributor Author

SST without MPI is the primary case for in situ viz with VisIt. Visit currently uses both adios installation to build.

So that sounds like a clear reason to include SST support. SST includes its own sstmpidummy.h, presumably because it can't use the existing one because it's C++-only. I'm kinda preparing things to support both C and C++ in this PR, but it'll require more changes to mpidummy.h to make that includable from C code. My preference would be to move that work to a future PR in order to keep thing here manageable.

@germasch
Copy link
Contributor Author

germasch commented Jun 3, 2019

@pnorbert @williamfgc @ax3l: I did the remaining cleanup, so this is ready for review/merging from my side. It doesn't actually change any existing behavior, ie., all the tests / utils are still calling MPI_Init as of now (except the one new test I added), in which case the SMPI_* wrappers just call through the real MPI.

It does, however, expose the serial adios2::ADIOS constructors always, and BP3/BP4/HDF5 access works w/o needing to call MPI_init. There may be more functionality that should be made available w/o initializing MPI, for the most part that should be as easy as changing MPI_* to SMPI_*.

It passes the CI, and I checked that it builds on summit and titan. I organized the PR in manageably sized commits which are best looked at one by one. I even added some descriptions to the commit messages ;)

@germasch germasch changed the title [WIP] MPICommOnly / mpidummy cleanup / serial+MPI support MPICommOnly / mpidummy cleanup; no-MPI_Init support Jun 3, 2019
@pnorbert
Copy link
Contributor

pnorbert commented Jun 3, 2019

Please remove the MPI stuff from bpls. It is a sequential tool and the main point of this refactoring is that bpls can run on the login node (of Titan e.g.) where there is no MPI.

@pnorbert
Copy link
Contributor

pnorbert commented Jun 3, 2019

Make sure you remove the lines to call the ADIOS constructor with a communicator in bpls as well.

@germasch
Copy link
Contributor Author

germasch commented Jun 3, 2019

I added the commit that removes MPI_Init/Finalize, that's enough to make this work on Titan in theory (in practice, however, I get an illegal instruction error on Titan, which I don't think is related, but hold on...).

The other use of MPI in bpls is a bit of a bigger change, since bpls currently uses the internal (core::) interface to ADIOS2, not the actual CXX11 bindings. But that shouldn't affect things working (or not) w/o MPI_Init.

@pnorbert
Copy link
Contributor

pnorbert commented Jun 3, 2019 via email

@germasch
Copy link
Contributor Author

germasch commented Jun 3, 2019

module swap craype-interlagos craype-istanbul will compile a code that can run on the older processors in the login node as well as on the compute nodes.

Thanks, that fixed it.

Even if it works, this code does not belong to a completely serial code:

#ifdef ADIOS2_HAVE_MPI 
    core::ADIOS adios(MPI_COMM_SELF, true, "C++"); 
#else
   core::ADIOS adios(true, "C++"); 
#endif

The idea was that it just simply works with core::ADIOS adios(true, "C++") with any version of the library.

I agree this doesn't belong into bpls, and I fixed it (I updated the commit to use the serial ctor always and force-pushed). In the bigger picture, though, I think the internals (core::) actually should be written to always use communicators, ie., you don't want to have different constructors for core::IO, core::Engine, etc that deal with the MPI/no-MPI case. I don't think that bpls should be using the internal interface in the first place, though. Anyway, not an issue of importance right now.

bpls now works on the head node of Titan. There is still a remaining problem in this PR that I just realized: The TestAdiosNoMPI test gets run with mpiexec -n 4, and since every instance writes/reads the same test.bp file, there are race conditions. If anyone knows how to run that one test without EXEC_WRAPPER, let me know ;)

@germasch
Copy link
Contributor Author

germasch commented Jun 3, 2019

There is still a remaining problem in this PR that I just realized: The TestAdiosNoMPI test gets run with mpiexec -n 4, and since every instance writes/reads the same test.bp file, there are race conditions. If anyone knows how to run that one test without EXEC_WRAPPER, let me know ;)

That one was actually kinda trivial to fix, so disregard...

@pnorbert
Copy link
Contributor

pnorbert commented Jun 3, 2019

Next problem: the python binding is still using MPI. All bindings should use the non-mpi constructor when running serial.

...
Writing /ccs/proj/e2e/pnorbert/ADIOS/ADIOS2/build.titan.gnu/install/bin/adios2-config
/ccs/proj/e2e/pnorbert/ADIOS/ADIOS2/build.titan.gnu

pnorbert@titan-ext4:/ccs/proj/e2e/pnorbert/ADIOS/ADIOS2/build.titan.gnu $ export PYTHONPATH=$PYTHONPATH:/ccs/proj/e2e/pnorbert/ADIOS/ADIOS2/build.titan.gnu/install/lib64/python2.7/site-packages
pnorbert@titan-ext4:/ccs/proj/e2e/pnorbert/ADIOS/ADIOS2/build.titan.gnu $ ldmunge /ccs/proj/e2e/pnorbert/ADIOS/ADIOS2/build.titan.gnu/install/lib64

pnorbert@titan-ext4:/ccs/proj/e2e/pnorbert/ADIOS/ADIOS2/build.titan.gnu $ python
Python 2.7.9 (default, Apr 25 2018, 09:46:03) 
[GCC 4.3.4 [gcc-4_3-branch revision 152973]] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> import adios2
[Mon Jun  3 13:43:35 2019] [unknown] Fatal error in PMPI_Init_thread: Other MPI error, error stack:
MPIR_Init_thread(537): 
MPID_Init(249).......: channel initialization failed
MPID_Init(638).......:  PMI2 init failed: 1 
Aborted (core dumped)

@pnorbert
Copy link
Contributor

pnorbert commented Jun 3, 2019

Also, please don't forget in the parallel build to support both constructors. Rright now this is not the case. On a compute node of Titan this is what I get:

pnorbert@titan-login8:/autofs/nccs-svm1_proj/e2e/pnorbert/ADIOS/ADIOS2/build.titan.gnu $ aprun -n 1 python ../tst.py 
Traceback (most recent call last):
  File "../tst.py", line 4, in <module>
    fr = adios2.open("/ccs/home/pnorbert/prism_schema.bp", "r")
TypeError: open(): incompatible function arguments. The following argument types are supported:
    1. (name: unicode, mode: unicode, comm: MPI4PY_Comm, engine_type: unicode=u'BPFile') -> adios2::py11::File
    2. (name: unicode, mode: unicode, comm: MPI4PY_Comm, config_file: unicode, io_in_config_file: unicode) -> adios2::py11::File

@pnorbert
Copy link
Contributor

pnorbert commented Jun 3, 2019

You can use my script and file to test your builds on Titan. You need to copy them because you can't list them:

/ccs/home/pnorbert/tst.py
/ccs/home/pnorbert/prism_schema.bp

This is the output with a serial shared build of ADIOS, on the login node:

pnorbert@titan-ext4:/ccs/proj/e2e/pnorbert/ADIOS/ADIOS2/build.titan.gnu-nompi-shared $ python ../tst.py 
File has 0 steps
variable_name: cells
	Type: int32_t
	Min: 0
	Max: 8
	AvailableStepsCount: 1
	Shape: 6, 2
	SingleValue: false


variable_name: points
	Type: double
	Min: 0
	Max: 2
	AvailableStepsCount: 1
	Shape: 9, 3
	SingleValue: false


variable_name: pVar
	Type: double
	Min: 0
	Max: 8
	AvailableStepsCount: 1
	Shape: 9
	SingleValue: false


Variable pVar has 9 elements. Read them now...
pVar = [  0.0  1.0  2.0  3.0  4.0  5.0  6.0  7.0  8.0  ]

@germasch
Copy link
Contributor Author

germasch commented Jun 3, 2019

Right, I didn't do anything to the python bindings. They should be converted, too, as I've now done with bpls.

I've been trying to keep the scope limited. This PR is meant to address #1443, which asked for making the serial ADIOS2 constructors available in an MPI build. It does that, and it also makes them actually usable for a subset of ADIOS2 functionality. The original purpose wasn't to make the parallel bpls work on Cray head nodes, or to make the python bindings work without MPI, though those are now things that are possible.

Converting the Python bindings should be straightforward as such, but there are some things to consider, in particular the fact that the Python bindings expose all of ADIOS2, and the existence of a serial constructor may lead users to think that the resulting object is fully usable without MPI, but it is not at this point. In particular, SST has its own separate mpidummy, so the changes in this PR don't affect it, ie., it still won't work without MPI_Init. I'm planning to look into that in the future, but I'm an advocate of an incremental approach. This PR already does touch quite a bit of code (and kinda critical code at that), and achieves a certain set of objectives (cleanup, SMPI wrappers, serial ADIOS ctor, serial bpls). The more gets thrown in with it, the bigger the chance that something will go wrong.

@pnorbert
Copy link
Contributor

pnorbert commented Jun 3, 2019 via email

@germasch
Copy link
Contributor Author

germasch commented Jun 3, 2019

You can try this patch (I don't have things set up on Titan to try it). It's entirely untested, but I'd guess it'll likely work, with the constraints mentioned above (ie, only part of ADIOS2 will actually work without MPI_Init, which isn't really a python binding issue, though).

diff --git a/bindings/Python/py11ADIOS.cpp b/bindings/Python/py11ADIOS.cpp
index 18da959e..afa6147e 100644
--- a/bindings/Python/py11ADIOS.cpp
+++ b/bindings/Python/py11ADIOS.cpp
@@ -29,7 +29,8 @@ ADIOS::ADIOS(MPI4PY_Comm mpiComm, const bool debugMode)
 : ADIOS("", mpiComm, debugMode)
 {
 }
-#else
+#endif
+
 ADIOS::ADIOS(const std::string &configFile, const bool debugMode)
 : m_ADIOS(
       std::make_shared<adios2::core::ADIOS>(configFile, debugMode, "Python"))
@@ -37,7 +38,6 @@ ADIOS::ADIOS(const std::string &configFile, const bool debugMode)
 }

 ADIOS::ADIOS(const bool debugMode) : ADIOS("", debugMode) {}
-#endif

 ADIOS::operator bool() const noexcept { return m_ADIOS ? true : false; }

diff --git a/bindings/Python/py11ADIOS.h b/bindings/Python/py11ADIOS.h
index 0279fe67..9a814baa 100644
--- a/bindings/Python/py11ADIOS.h
+++ b/bindings/Python/py11ADIOS.h
@@ -32,10 +32,9 @@ public:
     ADIOS(const std::string &configFile, MPI4PY_Comm comm,
           const bool debugMode = true);
     ADIOS(MPI4PY_Comm comm, const bool debugMode = true);
-#else
+#endif
     ADIOS(const std::string &configFile, const bool debugMode = true);
     ADIOS(const bool debugMode);
-#endif
     ~ADIOS() = default;

     /** object inspection true: valid object, false: invalid object */

@pnorbert pnorbert merged commit 2ab43e8 into ornladios:master Jun 3, 2019
@germasch
Copy link
Contributor Author

germasch commented Jun 3, 2019

Thanks for merging it. I looked at your tst.py, and I guess it uses the high-level API, that I'm not familiar with -- my patch above for the low-level API won't do anything about it. tst.py works on my laptop as-is, though, which actually makes no sense to me. With adios2+mpi, is it supposed to complain about a adios2.open signature mismatch, or did it complain about MPI_Init not called?

@pnorbert
Copy link
Contributor

pnorbert commented Jun 3, 2019

The python binding also needs changes in the glue code to allow for those functions. However, doing the same trick as in your diff, leads to compiler error. It seems to me the python binding does not allow for overloading function names. Should we rethink the names of the Open() calls in the python binding?

#ifdef ADIOS2_HAVE_MPI

adios2::py11::File Open(const std::string &name, const std::string mode,
                        adios2::py11::MPI4PY_Comm comm,
                        const std::string enginetype)
{
    return adios2::py11::File(name, mode, comm, enginetype);
}

adios2::py11::File OpenConfig(const std::string &name, const std::string mode,
                              adios2::py11::MPI4PY_Comm comm,
                              const std::string &configfile,
                              const std::string ioinconfigfile)
{
    return adios2::py11::File(name, mode, comm, configfile, ioinconfigfile);
}

#endif
adios2::py11::File Open(const std::string &name, const std::string mode,
                        const std::string enginetype)
{
    return adios2::py11::File(name, mode, enginetype);
}

adios2::py11::File OpenConfig(const std::string &name, const std::string mode,
                              const std::string configfile,
                              const std::string ioinconfigfile)
{
    return adios2::py11::File(name, mode, configfile, ioinconfigfile);
}
$ make
...
[ 62%] Building CXX object bindings/Python/CMakeFiles/adios2py.dir/py11glue.cpp.o
/ccs/proj/e2e/pnorbert/ADIOS/ADIOS2/bindings/Python/py11glue.cpp: In function 'void pybind11_init_adios2(pybind11::module&)':
/ccs/proj/e2e/pnorbert/ADIOS/ADIOS2/bindings/Python/py11glue.cpp:154:50: error: no matching function for call to 'pybind11::module::def(const char [5], <unresolved overloaded function type>, const char [33], pybind11::arg, pybind11::arg, pybind11::arg_v)'
           pybind11::arg("engine_type") = "BPFile");
                                                  ^
In file included from /ccs/proj/e2e/pnorbert/ADIOS/ADIOS2/bindings/Python/py11glue.cpp:11:0:
/ccs/proj/e2e/pnorbert/ADIOS/ADIOS2/thirdparty/pybind11/pybind11/include/pybind11/pybind11.h:812:13: note: candidate: template<class Func, class ... Extra> pybind11::module& pybind11::module::def(const char*, Func&&, const Extra& ...)
     module &def(const char *name_, Func &&f, const Extra& ... extra) {
             ^~~
/ccs/proj/e2e/pnorbert/ADIOS/ADIOS2/thirdparty/pybind11/pybind11/include/pybind11/pybind11.h:812:13: note:   template argument deduction/substitution failed:
/ccs/proj/e2e/pnorbert/ADIOS/ADIOS2/bindings/Python/py11glue.cpp:154:50: note:   couldn't deduce template parameter 'Func'
           pybind11::arg("engine_type") = "BPFile");

@williamfgc
Copy link
Contributor

@pnorbert those C++ Open functions without a comm can be renamed OpenNoComm in the glue file. They are not exposed in the Python module, thr user only sees as a single open with different signatures and can specify arguments explicitly. That's one of the strengths of Python APIs.

@germasch
Copy link
Contributor Author

germasch commented Jun 4, 2019

Renaming is definitely the easiest way. Or you can do what's done elsewhere in the py11 glue, that is, select the correct overload by a cast:

diff --git a/bindings/Python/py11ADIOS.h b/bindings/Python/py11ADIOS.h
index 0279fe67..9a814baa 100644
--- a/bindings/Python/py11ADIOS.h
+++ b/bindings/Python/py11ADIOS.h
@@ -32,10 +32,9 @@ public:
     ADIOS(const std::string &configFile, MPI4PY_Comm comm,
           const bool debugMode = true);
     ADIOS(MPI4PY_Comm comm, const bool debugMode = true);
-#else
+#endif
     ADIOS(const std::string &configFile, const bool debugMode = true);
     ADIOS(const bool debugMode);
-#endif
     ~ADIOS() = default;
 
     /** object inspection true: valid object, false: invalid object */
diff --git a/bindings/Python/py11glue.cpp b/bindings/Python/py11glue.cpp
index 9d16e339..89166002 100644
--- a/bindings/Python/py11glue.cpp
+++ b/bindings/Python/py11glue.cpp
@@ -86,7 +86,7 @@ adios2::py11::File OpenConfig(const std::string &name, const std::string mode,
     return adios2::py11::File(name, mode, comm, configfile, ioinconfigfile);
 }
 
-#else
+#endif
 adios2::py11::File Open(const std::string &name, const std::string mode,
                         const std::string enginetype)
 {
@@ -99,7 +99,6 @@ adios2::py11::File OpenConfig(const std::string &name, const std::string mode,
 {
     return adios2::py11::File(name, mode, configfile, ioinconfigfile);
 }
-#endif
 
 PYBIND11_MODULE(adios2, m)
 {
@@ -151,8 +150,13 @@ PYBIND11_MODULE(adios2, m)
         .export_values();
 
 #ifdef ADIOS2_HAVE_MPI
-    m.def("open", &Open, pybind11::arg("name"), pybind11::arg("mode"),
-          pybind11::arg("comm"), pybind11::arg("engine_type") = "BPFile", R"md(
+    m.def("open",
+          (adios2::py11::File(*)(
+              const std::string &name, const std::string mode,
+              adios2::py11::MPI4PY_Comm comm, const std::string enginetype)) &
+              Open,
+          pybind11::arg("name"), pybind11::arg("mode"), pybind11::arg("comm"),
+          pybind11::arg("engine_type") = "BPFile", R"md(
           Simple API MPI open, based on python IO. 
           Allows for passing parameters in source code.
 
@@ -175,9 +179,15 @@ PYBIND11_MODULE(adios2, m)
                   handler to adios File for the simple Python API
     )md");
 
-    m.def("open", &OpenConfig, pybind11::arg("name"), pybind11::arg("mode"),
-          pybind11::arg("comm"), pybind11::arg("config_file"),
-          pybind11::arg("io_in_config_file"), R"md(
+    m.def("open",
+          (adios2::py11::File(*)(
+              const std::string &name, const std::string mode,
+              adios2::py11::MPI4PY_Comm comm, const std::string &configfile,
+              const std::string ioinconfigfile)) &
+              OpenConfig,
+          pybind11::arg("name"), pybind11::arg("mode"), pybind11::arg("comm"),
+          pybind11::arg("config_file"), pybind11::arg("io_in_config_file"),
+          R"md(
           Simple API MPI open, based on python IO. 
           Allows for passing a runtime configuration file in xml format and the
           name of the io element related to the returning File.
@@ -204,16 +214,24 @@ PYBIND11_MODULE(adios2, m)
                   handler to adios File for the simple Python API
     )md");
 
-#else
-    m.def("open", &Open, "High-level API, file object open",
-          pybind11::arg("name"), pybind11::arg("mode"),
-          pybind11::arg("engine_type") = "BPFile");
-
-    m.def("open", &OpenConfig,
-          "High-level API, file object open with a runtime config file",
-          pybind11::arg("name"), pybind11::arg("mode"),
-          pybind11::arg("config_file"), pybind11::arg("io_in_config_file"));
 #endif
+    m.def(
+        "open",
+        (adios2::py11::File(*)(const std::string &name, const std::string mode,
+                               const std::string enginetype)) &
+            Open,
+        "High-level API, file object open", pybind11::arg("name"),
+        pybind11::arg("mode"), pybind11::arg("engine_type") = "BPFile");
+
+    m.def(
+        "open",
+        (adios2::py11::File(*)(const std::string &name, const std::string mode,
+                               const std::string configfile,
+                               const std::string ioinconfigfile)) &
+            OpenConfig,
+        "High-level API, file object open with a runtime config file",
+        pybind11::arg("name"), pybind11::arg("mode"),
+        pybind11::arg("config_file"), pybind11::arg("io_in_config_file"));
 
     pybind11::class_<adios2::py11::ADIOS>(m, "ADIOS")
         // Python 2
@@ -237,7 +255,7 @@ PYBIND11_MODULE(adios2, m)
              "adios2 module starting point, constructs an ADIOS class object",
              pybind11::arg("configFile"), pybind11::arg("comm"),
              pybind11::arg("debugMode") = true)
-#else
+#endif
         .def(pybind11::init<const bool>(),
              "adios2 module starting point "
              "non-MPI, constructs an ADIOS class "
@@ -247,7 +265,6 @@ PYBIND11_MODULE(adios2, m)
              "adios2 module starting point non-MPI, constructs an ADIOS class "
              "object",
              pybind11::arg("configFile"), pybind11::arg("debugMode") = true)
-#endif
         .def("DeclareIO", &adios2::py11::ADIOS::DeclareIO,
              "spawn IO object component returning a IO object with a unique "
              "name, throws an exception if IO with the same name is declared "

@ax3l
Copy link
Contributor

ax3l commented Jun 4, 2019

Thank you so much, that's wonderful! ✨
Since 2.4.0-rc just came out: will we add these refactorings to the 2.4.0 release? cc @franzpoeschel

@williamfgc
Copy link
Contributor

@germasch sounds good. @ax3l yes, this should go into 2.4.0

@germasch germasch deleted the pr/mpidummy branch June 13, 2019 14:15
chuckatkins pushed a commit to chuckatkins/ADIOS2 that referenced this pull request Oct 30, 2020
Code extracted from:

    https://github.com/pybind/pybind11.git

at commit 06a54018c8a9fd9a7be5f5b56414b5da9259f637 (master).

Upstream Shortlog
-----------------

Ahmed Sobhy (1):
      8d8d48c5 fix: do not use abi::__forced_unwind with libc++, even with gcc instead of clang (ornladios#2569)

Andrew J. Hesford (1):
      a3118130 pytypes.h: fix docs generation (ornladios#2220)

Andrey Dorozhkin (1):
      1817d211 Disable defining (v)snprintf as macro in modern Visual Studio

Ashley Whetter (1):
      8e85fadf Render `py::none` as `None` in docstrings

Axel Huebl (2):
      a6355b00 CMake: Add Python 3.8 to pybind11Tools (ornladios#1974)
      6ebfc4b2 Document CMAKE_CXX_STANDARD

B Krishna Chaitanya (1):
      71442438 Refactor: Extract Custom Type Casts related tests

Baljak (2):
      07e22593 Fix compilation with MinGW only (ornladios#2053)
      4f72ef84 Fix the use of MSVC in an MSYS environment (ornladios#2087)

Bjorn (1):
      d4d7ef5d Update pybind11Tools.cmake (ornladios#2419)

Boris Staletic (14):
      fe2a06e3 Pin breathe to 4.13.1
      dc9006db Use newer macOS image for python3 testing
      1376eb0e Free tstate on python 3.7+ on finalize_interpreter (ornladios#2020)
      ae2ee2a4 Avoid using deprecated API in python 3.9
      b2f52225 Rename embedded_module object's name (ornladios#2282)
      8b9eb964 Check for NULL in raw_str on Python3 (ornladios#2290)
      aa982e13 Small fixes in numpy.h (ornladios#2293)
      441e7770 Use new style __init__ in numpy docs (ornladios#2316)
      2819ce64 Avoid attr("__repr__") in initialize_generic (ornladios#2317)
      cc982ac1 fix: allow assignment of time points of resolutions other than that of a system clock (ornladios#2481)
      32bb9071 Avoid C-style casts for pointers in docs (ornladios#2487)
      d3c999c7 fix: rename `pybind11::module` to `pybind11::module_` (ornladios#2489)
      5ebc7816 Allow raw unions without base classes in is_accessible_base_of (ornladios#2320)
      4038542b Remove friend declaration of py::class_ in py::detail::generic_type (ornladios#2613)

Charles Brossollet (1):
      0f1d3bfe Add FAQ entry for dealing with long functions interruption (ornladios#2000)

Chuck Atkins (1):
      d730fbc0 Utilize CMake's language standards abstraction when possible

Ciro Santilli (1):
      b47efd35 Use defined for some preprocessor variables that might be undefined (ornladios#2476)

Clemens Sielaff (1):
      63df87fa Add lvalue ref-qualified cpp_function constructors (ornladios#2213)

Daniel Saxton (1):
      fb0a3a0e Fix broken README link (ornladios#2449)

Dariusz Suchojad (1):
      bed9080c  docs: Updated the link to the PDF docs (ornladios#2603) (ornladios#2605)

David Stone (1):
      5088364b Declare `operator==` and `operator!=` member functions const.

David Vo (1):
      5e6ec496 Add enum value to enum repr (ornladios#2126)

Dekken (1):
      1abc4a9d fix: doc typo, drop second use of 'without' (ornladios#2439)

Dustin Spicuzza (4):
      0dfffcf2 Add is_final to disallow inheritance from Python
      2c4cd841 Add AutoWIG to list of binding generators (ornladios#1990)
      1b0bf352 Throw TypeError when subclasses forget to call __init__ (ornladios#2152)
      6f3470f7 Add robotpy-build to list of tools (ornladios#2359)

Eric Cousineau (10):
      baf69345 Minor modifications to interrupt handling FAQ (ornladios#2007)
      2c30e0a1 cmake: Expose `PYBIND11_TEST_OVERRIDE` (ornladios#2218)
      53095730 operators: Move hash check to before mutations, tweak whitespace
      4e3d9fea operators: Explicitly expose `py::hash(py::self)`
      ebdd0d36 tests: Consolidate version (2 vs. 3) and platform (CPython vs. PyPy) checks (ornladios#2376)
      5a3ff723 ci: Remove "Setup Boost (macOS)" step (ornladios#2395)
      44fa79ca pytypes: Add Gotchas section about default-constructed wrapper types and py::none() (ornladios#2362)
      4e7c08da test_numpy_dtypes: Add test for py::vectorize() (ornladios#2260)
      d74be321 tests: Fix test override execution (ornladios#2512)
      c513b5e3 tests(CMakeLists): robustify against add'l versions of Boost (ornladios#2608)

Erick Matsen (1):
      b32b762c Fixing minor typo in basics.rst (ornladios#1984)

Florian Apolloner (1):
      fe1392d0 Silence Clang 10 compiler warnings. Fixes ornladios#2225. (ornladios#2294)

Francesco Biscani (2):
      deb3cb23 Add exception translation for std::overflow_error. (ornladios#1977)
      bd24155b Aligned allocation fix for clang-cl (ornladios#1988)

Fritz Reese (1):
      e8ad33bb Fix buffer_info for ctypes buffers (pybind#2502) (ornladios#2503)

Griffin Downs (1):
      a4cee36b Add vcpkg installation instructions (ornladios#1936)

Guilherme Dantas (1):
      8908552d typo

Hans Dembinski (2):
      c27a6e13 make builds with python tests and cpp tests fail if either one fails (ornladios#1967)
      bdf6a5e8 Report type names in return value policy-related cast exceptions (ornladios#1965)

Henry Fredrick Schreiner (2):
      11f756f5 fix: type bug intruduced in ornladios#2492
      e3774b76 tests: the condition was too look on xfail

Henry Schreiner (151):
      a38e5331 Fix CI, prepare test on Python 3.9 beta (ornladios#2233)
      d8c7ee00 ci: GHA basic format & pre-commit (ornladios#2309)
      ef057f12 test: support pypy2 7.3
      3d20b73e test: pass through C++ std for cmake test
      49007b7f test: fix warning/error on Python 2 in 14/17 mode
      a59c6de8 test: allow MSVC/Xcode to run the embed test
      73dc9786 style: avoid adding virtual environment directories
      b16347e5 ci: enable GHA testing
      8b0ccf76 style: adding pre-commit check-style.sh
      5c936d4b refactor: issue fixed upstream
      6f3e5e38 ci: keep travis from running twice
      6a80171c ci: Add clang builds & C++17
      e428a7f6 ci: fix clang warnings
      1f53c373 fix: C++17 mode on Clang may error
      44706717 fix: too many braces on clang 3.6
      5927c581 chore: update Catch
      aab70139 ci: cache, build wheels on macOS PyPy3
      78069057 ci: trim down Appveyor
      9521bc56 ci: drop parts from Travis
      1b880dfd ci: download EIGEN
      2ee1bcd9 ci: add GHA badge
      2fbbd510 ci: add gcc
      e450ea05 ci: add docker build to GHA
      249a13bd ci: move docs check to GHA
      ff39ad3f ci: include scipy for tests
      88b3e5c6 ci: nicer naming scheme
      a6324868 ci: Windows 2016 test
      c51b3f43 ci: change caching
      1491c94c ci: cmake Configure test (ornladios#2327)
      6ec1775f feat: drop CMake 3.6 and below, modernize CMake
      1b92cd17 fix: address review points from @YannickJadoul
      f64d5aa6 fix: typo for warning on C++17, support Win + 2.7
      1651c324 update: address review points
      e2a96890 format: add cmake-format to pre-commit
      94db5c5e format: apply cmake-format
      b8047245 fix: uninstall cleanup (ornladios#2346)
      1caf1d06 fix: check list validity and add missing file (ornladios#2352)
      df115977 chore: cleanup
      da803eb0 fix: duplicate target names removed
      ed6de125 format: include .in files
      c664d557 ci: better output / more config
      227170dc fix: better handling of PYBIND11_CPP_STANDARD
      0af7fe6c fix: typo in pybind11_add_module (ornladios#2374)
      f7abac66 fix: boost's include dir was listed first (ornladios#2384)
      1534e17e ci: include Python 3.9 RC1 (ornladios#2387)
      2e2de8c8 fix: add missing signature (ornladios#2363)
      cba4a985 ci: include Boost (ornladios#2393)
      a876aac2 tests: loosen test, not valid on some systems (ornladios#2399)
      4d9024ec tests: cleanup and ci hardening (ornladios#2397)
      64040997 docs: contrib/issue templates (ornladios#2377)
      cf0a6459 fix: throwing repr caused a segfault (ornladios#2389)
      1729aae9 feat: new FindPython support (ornladios#2370)
      04fdc44f tests: avoid putting build products into source directory (ornladios#2353)
      24dffe46 fix: PYBIND11_MASTER_PROJECT always ON (ornladios#2412)
      110e6c12 ci: reduce flakiness a little (ornladios#2418)
      a6887b60 docs: update changelog and versionadded
      2fa18431 docs: pin versions for readthedocs
      f31df738 docs: move CONTRIBUTING (ornladios#2402)
      56df3c46 fix: a couple more places where pybind11 is missing 11 (ornladios#2421)
      c58f7b74 fix: reduce target collision in add_submodule mode (ornladios#2423)
      5b59b7b2 ci: gha annotations (ornladios#2427)
      9b8cb020 fix: respect PYTHON_VERSION if set in classic mode (ornladios#2414)
      3a89bffa ci: harden chrono test, mark another macos 4.9 dev failure (ornladios#2448)
      72b06b86 ci: Eigen moved
      0dbda6e8 feat: py::pos_only (ornladios#2459)
      ce1a07ef fix: use classic extension handling unless otherwise requested (ornladios#2462)
      37f845a1 ci: disallow some common capitalization mistakes (ornladios#2472)
      621906b3 fix: support nvcc and test (ornladios#2461)
      f12ec00d feat: py::type::of<T>() and py::type::of(h) (ornladios#2364)
      8dc31c7b style: clang-tidy: llvm-namespace-comment
      5dfbe6f9 style: clang-tidy: modernize-use-override
      96e6a8d5 style: clang-tidy: readability-container-size-empty
      b342c373 style: clang-tidy: modernize-use-using
      b491b465 style: clang-tidy: modernize-use-equals-default
      ce88e940 style: clang-tidy: modernize-use-auto
      4d786408 style: clang-tidy: modernize-use-emplace
      e7bafc8e style: clang-tidy: default checks and fix bug in iostream deconstruction
      dabbbf31 fix: use OVERRIDE instead of OVERLOAD (ornladios#2490)
      41aa9260 refactor: replace .get_type with type::handle_of (ornladios#2492)
      fd61f503 feat: setup.py redesign and helpers (ornladios#2433)
      e37921d7 refactor: drop mkdoc and update changelog (ornladios#2491)
      dec33c29 docs: installing section (ornladios#2494)
      99ef2b84 docs: read version from pybind11 file (ornladios#2496)
      81555ce6 docs: Use README.rst in docs as home page (ornladios#2500)
      54831a9a fix: use svg to pdf converter instead of original solution
      d753b769 docs: corrected link to documentation
      8fa70e74 ci: fix broken documenation test (works on RtD) (ornladios#2506)
      87828c7e fix: typo in Windows C++17 support (ornladios#2507)
      4a288ab9 fix: Windows C++ latest (ornladios#2508)
      d0ed035c fix: AppleClang 12 warnings (ornladios#2510)
      e01f4924 fix: Add a nice CMake error when Interpreter component is missing. (ornladios#2519)
      3c7ef56b fix: warning on latest AppleClang (ornladios#2522)
      82dbc5b7 ci: releases (ornladios#2530)
      21902462 chore: bump to 2.6.0b1, beta release
      0fc5774c fix: beta does not have a dot in front (ornladios#2539)
      1994691a ci: download artifact issue
      319b9964 fix: metadata was adding quotes to distinfo
      01ad8920 ci: publish in two steps
      6d2d08db fix: conda-forge patch (ornladios#2540)
      b9d00273 feat: parallel compiler (ornladios#2521)
      5f9b1667 ci: label PRs with changelog needed (ornladios#2546)
      1bcd5f0a Update pr_merged.yml
      ca4127ce ci: fix labeler
      3488494a refactor: import check as a common function (ornladios#2526)
      560ed3e3 docs: fix odd spacing
      6bcd220c refactor: module -> module_ with typedef (ornladios#2544)
      2a2f5220 fix: find_import didn't work properly for classic tools (ornladios#2550)
      9a0c96dd feat: py::prepend tag (ornladios#1131)
      00edc300 fix: PYBIND11_OBJECT required pybind11 namespace (regression) (ornladios#2553)
      b6f37f67 docs: minor cleanup (ornladios#2555)
      49c389b7 ci: test on Windows 3.8 and 3.9 (mostly) (ornladios#2560)
      deba040b test: hide segfault (ornladios#2559)
      e4e5c49a docs: known issues (ornladios#2565)
      fae45325 ci: fix labeler
      f385eccd chore: bump to 2.6.0rc1
      c02f0ec6 fix: formatting issue
      fecef388 refactor: simpler followup to ornladios#2569 (ornladios#2572)
      d46f3322 fix: allow cmake varibles from Python calls to be cached (ornladios#2570)
      7d7309b8 ci: monitor dependencies
      cd2c25a2 ci: adjust labeler match pattern
      4f45052d ci: fix ci label
      993495c9 fix: Intel 18+ required (ornladios#2577)
      ae2e5a36 ci: try to get labeler to add needs changelog
      2f746eee ci: original labeler
      7c71dd38 ci: inverted labeler logic
      edda89ba fix: install to DATAROOTDIR instead of hardcoding share (ornladios#2584)
      c99d7f1c docs: PR template (ornladios#2580)
      2a263e08 docs: some final 2.6.0 updates (ornladios#2582)
      526a7733 ci: merged labels still missing
      a8c2e3ee fix: ipo should be off for debug or relwithdebinfo (ornladios#2590)
      645d8381 feat: typing support for helpers (ornladios#2588)
      c4a8b5bb chore: bump to 2.6.0rc2
      63f2deea chore: update Eigen
      f2008325 style: ssize_t -> py::ssize_t
      b72c79f9 fix: std::is_pod -> pybind11::detail::is_pod
      9ac604a3 fix: PyPy windows issue
      6bb71c48 fix: more intp asserts, reinterpret_cast
      ad2fe0ee fix: pypy3 windows extension issue
      a4221153 fix: new line in PYPY_VERSION
      8ae11fbf ci: add more runs
      2e31e466 docs: update for PyPy win 32 issue
      c50f90ec style: use Black everywhere (ornladios#2594)
      064362fb fix: allow the ABI string to be forced (ornladios#2602)
      c16da993 chore: bump to 2.6.0rc3
      09056717 fix: much better pdf (ornladios#2604)
      0b9acc40 fix: chapters in PDF again (ornladios#2606)
      120e2e21 docs: tiny typo
      4d037439 fix: missing identifier for Python 3.9
      ace4deb4 ci: add more jobs (ornladios#2610)
      139c05da ci: test on NumPy + Python 3.9 (ornladios#2628)
      06a54018 fix: min macos (ornladios#2622)

Holger Kohr (1):
      fbc75636 Add py::object casting example to embedding docs (ornladios#2466)

Hyrum Wright (1):
      961b2e62 fix: ensure the GIL is held when copying a function. (ornladios#2545)

Isuru Fernando (3):
      37352491 Install headers using both headers and package_data (ornladios#1995)
      e107fc2a Fix setuptools record of headers
      0d70f0e1 PyPy3 support (ornladios#2146)

JGamache-autodesk (1):
      37d04abd Fixes ornladios#1295: Handle debug interpreter (ornladios#2025)

James R. Barlow (1):
      3618bea2 Add and document py::error_already_set::discard_as_unraisable()

Jason Rhinelander (1):
      be0d8045 Support keyword-only arguments

Jay Soffian (1):
      01453b05 fix (setup_helpers): fix bug in _add_lflags (ornladios#2586)

Jeremy Nimmer (1):
      759221f5 Obey __cpp_sized_deallocation and __cpp_aligned_new

Kota Yamaguchi (1):
      e2488698 Fix undefined memoryview format (ornladios#2223)

Liam Keegan (1):
      c4fd1fd9 CMake improvement: support windows python on msys (ornladios#2312)

Lin Hsu (1):
      d031efe7 Typo

MRocholl (3):
      00c462d1 find library path to libclang.so via glob command in /usr/lib/llvm-* and set it
      9358e30d change set_path to set_file
      b14aeb7c fix typo in sorted function call argument reverse

Mana Borwornpadungkitti (1):
      6edd0e6d fix: Reject keyword argument `None` with `.none(false)` (ornladios#2611)

Marcin Wojdyr (1):
      8e40e389 cast pointer to std::tuple and std::pair (ornladios#2334)

Matthew Dawkins (1):
      6f11347a Prevent cmake error when prefix empty (ornladios#1986)

Matthijs van der Burgh (1):
      b5240089 Deepcopy documentation (ornladios#2242)

Michael Goulding (1):
      fb042d69 Fix warning C26817 on copying in `for (auto vh : value_and_holder(...))` (ornladios#2382)

Mosalam Ebrahimi (1):
      7dd2bdb0 docs: fix typo (ornladios#2405)

Nicholas Musolino (1):
      02c83dba Propagate exceptions in sequence::size() (ornladios#2076)

Nils Berg (1):
      819802da Fix a memory leak when creating Python3 modules. (ornladios#2019)

Nils Leif Fischer (1):
      141e8cc0 Fix uninitialized-variables cmake warnings

Orell Garten (1):
      9ed8b440 Change __init__(self) to __new__(cls)

Paul Fultz II (1):
      69821d9e Disable testing when using BUILD_TESTING (ornladios#1682)

Ralf W. Grosse-Kunstleve (8):
      4697149d Allows users to specialize polymorphic_type_hook with std::enable_if.
      f6e543b1 Adding a default virtual destructor to Animal type in test_tagbased_polymorphic.cpp.
      96c67636 test_builtin_casters.py test_string_view: Python 2 c++17, c++2a compatibility. (ornladios#2314)
      17320463 Adding tests specifically to exercise pybind11::str::raw_str. (ornladios#2366)
      cd856992 Using recently added `pytest.PY2` instead of `str is bytes`. (ornladios#2396)
      3c061f21 Fixing `pybind11::bytes()` ambiguous conversion issue.
      d159a563 static allocation for PyModuleDef, to avoid leak check errors. (ornladios#2413)
      8290a5a0 clang -Wnon-virtual-dtor compatibility (ornladios#2626)

Riccardo Bertossa (1):
      6c29cbf8 misleading comment corrected (strides in buffer_info is bytes and not number of entries) (ornladios#1958)

Rickard Hallerbäck (1):
      5a8ec8e5 Include what is used in pybind11.h (ornladios#2499)

Riyaz Haque (1):
      2b6b98e2 Bugfix/Check actual value when deregistering pybind11 instance (ornladios#2252)

Robert Haschke (2):
      370a2ae2 Declare call_impl() as && (ornladios#2057)
      f2226aef Allow perfect forwarding of method args (ornladios#2048)

Sebastian Gsänger (1):
      a83d69e7 test pair-copyability on C++17 upwards (ornladios#1886)

Sebastian Koslowski (2):
      dc65d661 support for readonly buffers (ornladios#863) (ornladios#1466)
      a86ac538 rename args_kw_only to kwonly

Sergei Izmailov (7):
      22b25040 Render full numpy numeric names (e.g. numpy.int32)
      57070fb0 Render py::iterator/py::iterable as Iterator/Iterable in docstrings
      90d99b56 Render pybind11::array as numpy.ndarray in docstrings
      4f1531c4 Render `py::int_` as `int` in docstrings
      ab323e04 Test py::iterable/py::iterator representation in docstrings
      7b067cc3 Set __hash__ to None for types that defines __eq__, but not __hash__ (ornladios#2291)
      4c36fb7b [DOC] avoid C++ types in docstrings (ornladios#2441)

Simeon Ehrig (1):
      c776e9ef Fix compiler error with MSVC 17 and CUDA 10.2

Takahiro Ishikawa (1):
      3618807d Fix python.lib name

Thomas Köppe (3):
      eeb10448 [common.h] Mark entry point as "unused".
      1e14930d [common.h] Mark another entry point as "unused".
      f2e79986 [common.h] Mark another entry point as "unused". (ornladios#2625)

Valentin Boettcher (1):
      3be085d1 docs: typo prefix -> suffix (ornladios#2593)

Vemund Handeland (1):
      6e39b765 Add C++20 char8_t/u8string support (ornladios#2026)

Wenzel Jakob (22):
      dfde1554 begin working on next version
      61e4f118 numpy.h: minor preprocessor fix suggested by @chaekwan
      a6064822 Revert "numpy.h: minor preprocessor fix suggested by @chaekwan"
      fb910ae9 Revert "Fix a memory leak when creating Python3 modules. (ornladios#2019)"
      b4e5d582 undo #define copysign in pyconfig.h
      f9f3bd71 Use C++17 fold expressions when casting tuples and argument lists (ornladios#2043)
      2fda9d5d Travis CI fix (MacOS, Py3)
      4c206e8c bindings for import_error exception
      bf2b0314 Handle cases where binding code immediately throws py::error_already_set
      bb9c91cc pybind11Tools.cmake: search for Python 3.9
      3b1dbeba v2.5.0 release
      02348716 begin working on next version
      a54eab92 Revert "Change __init__(self) to __new__(cls)"
      8c0cd944 ignore another type of visual studio project file
      fc3a4490 Minor clarification (@AntoinePrv, ornladios#2083)
      36c666f0 pybind11_add_module(): OPT_SIZE target
      064a03a4 main CMakeLists.txt file: be less noisy
      3232e59b Check if module file extension could be queried correctly (ornladios#2538)
      2bc62dc8 updated credits
      7f9445a6 Thanks, Google!
      59a2ac27 v2.6.0 release
      86d3e9eb begin working towards a future v2.6.1 patch release

Wink Saville (1):
      7c26c718 Fix mispelling in basics.rst (ornladios#2614)

Yannick Jadoul (30):
      55ff4642 Fixing SystemError when nb_bool/nb_nonzero sets a Python exception in type_caster<bool>::load (ornladios#1976)
      805c5862 Adding method names to cpp_function constructor calls in enum_base
      d54d6d8c Adding pybind11::cast overload for rvalue references (ornladios#1260)
      f980d76d Change NAMESPACE_* macros into PYBIND11_NAMESPACE_* (ornladios#2283)
      964ab956 Fix DeprecationWarning about 'invalid escape sequence' in tools/docs Python scripts (ornladios#2281)
      3e448c0b Enable py::ellipsis on Python 2 (ornladios#2360)
      4493751a Fix new-style __init__ usage in numpy docs (ornladios#2426)
      b3d8fec0 Adapt code example in advanced/classes.rst to new handling of forgetting to call the superclass __init__ (ornladios#2429)
      43f390ad Add note that VS2017 requires /permissive- to build in C++17 mode (ornladios#2431)
      a2bb297b Throw exception on returning a unique_ptr or shared_ptr nullptr (or any other holder type) from py::init, rather than crashing (ornladios#2430)
      03b3d59d tests: fix CI by including <algorithm> to stop MSVC from complaining about std::count_if in tests/test_sequences_and_iterators.cpp (ornladios#2435)
      6a192781 Fix bug roundtripping datetime.time objects after midnight in eastern hemisphere timezones (ornladios#2417) (ornladios#2438)
      fe9ee86b Add check if `str(handle)` correctly converted the object, and throw py::error_already_set if not (bis) (ornladios#2477)
      9df13835 Stop py::array_t arguments from accepting arrays that do not match the C- or F-contiguity flags (ornladios#2484)
      d65e34d6 Resolve empty statement warning when using PYBIND11_OVERLOAD_PURE_NAME and PYBIND11_OVERLOAD_PURE (ornladios#2325)
      16f199f8 Change base parameter type in register_exception and exception constructor from PyObject* to handle (ornladios#2467)
      c72708a7 Moving tp_class access, and consistent fully-qualified naming for PyPy, to detail::get_tp_name (ornladios#2520)
      07b069a5 Unify Python 2 & 3 py::module constructor, and make contructor with pre-allocated PyModuleDef private (ornladios#2534)
      56784c4f Add unchecked_reference::operator() and operator[] to overload resolution of unchecked_mutable_reference (ornladios#2514)
      9796fe98 feat: vectorize functions with void return type (ornladios#1969)
      b70894df docs: add std::valarray to docs/advanced/cast/stl.rst (ornladios#2547)
      14112077 chore: drop support for PyPy < 7.3.1 and clean up old PyPy workarounds (ornladios#2456)
      f537093a Fail on passing py::object with wrong Python type to py::object subclass using PYBIND11_OBJECT macro (ornladios#2349)
      71aea49b Check scope's __dict__ instead of using hasattr when registering classes and exceptions (ornladios#2335)
      0c5cc031 feat: deprecate public constructors of module_ class (ornladios#2552)
      1914b7d3 Shorten PYBIND11_EMBEDDED_MODULE macro implementation by using PYBIND11_CATCH_INIT_EXCEPTIONS (ornladios#2579)
      99773fc5 fix: throw error_already_set in py::len on failing PyObject_Length (ornladios#2575)
      493649f9 fix: valgrind-detected after-freeing access of PyMethodDef (macOS Python 3.9.0 segfaults) (ornladios#2576)
      6364b732 fix: test_factory_constructors.py failure triggered by test_register_duplicate_class (ornladios#2564)
      3a37d338 Add __builtins__ to globals argument of `py::exec` and `py::eval` if not present (ornladios#2616)

acxz (1):
      6f6e9394 feat: add uninstall target for CMake (ornladios#2265)

andriish (2):
      38370a87 fix: support NVIDIA-PGI HPC SDK (ornladios#2475)
      59323a97 ci: update PGI to 20.9 (ornladios#2566)

fatvlady (4):
      a3daf87d Add failing optional test
      556277d6 Fix optional dereference type deduction
      8c06b954 Fix compile error on GCC4.8
      f99ff736 Add additional check to be more compliant with other casters

fwjavox (1):
      e97c735f stl_bind: add binding for std::vector::clear (ornladios#2074)

jbarlow83 (3):
      4d90f1a1 Add error_scope to py::class_::dealloc() to protect destructor calls (ornladios#2342)
      b8863698 Improve documentation of Python and C++ exceptions (ornladios#2408)
      49cdb70a docs: use sorted(glob()) in example setup.py (ornladios#2561)

marc-chiesa (1):
      830adda8 Modified Vector STL bind initialization from a buffer type with optimization for simple arrays (ornladios#2298)

methylDragon (1):
      d96c3451 Fix docs typo

michalsustr (1):
      3bd0d7a8 Add note about specifying custom base class for Exceptions. (ornladios#2465)

nicolov (1):
      de5a29c0 Fix build with -Wmissing-prototypes (ornladios#1954)

peter (1):
      03f9e4a8 Fix compilation with clang-cl

tuxmaster5000 (1):
      7e0a4fb7 Fix for ornladios#2168 (ornladios#2299)

xkszltl (1):
      134a2ec3 Add `.git` suffix to URL because only GitHub itself works without it. (ornladios#2319)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants