-
Notifications
You must be signed in to change notification settings - Fork 591
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
adjoint simulation crash upon calling "run" #2309
Comments
BTW I forgot to mention, the conda pymeep version which produces the error is linux mpich 1.24.0 with python 3.10 . Is |
The Conda package is for version 1.24 (July 2022). Currently, there is no Conda package for nightly builds. We will do a version 1.25 tarball release this week which includes #2251. This will be followed shortly thereafter by an update to the Conda package. |
Hello there, |
Hello,
I hope this can help... |
This means the simulation wasn't initialized properly. You have to be careful with how you set up the adjoint run "manually". if you're trying to do this yourself, I suggest you carefully go through the |
I'll give a look, thanks. But in any case the problem appears when throwing the call on the Optimization object ("opt" here) with initial parameters, which starts a forward and an adjoint run under the hood from what I see. Already at this first adjoint run the problem appears. The manual setup you see below in the snippet was just debug trials on the problem... |
The tests on I would start with one of those tests, and gradually modify it to your current example. This way you can systematically identify the issue. |
Ok this is definitely a bug. I encountered it myself while running something similar to the above. There's an easy (temporary) fix though. The problem is that the forward run, which is when the simulation object is generated, only allocates certain DFT field components because of the polarity in 2D. When you move to do an adjoint simulation, the mode source that's generated isn't always perfectly polarized (there's some noise) unless you specify a parity (e.g. In theory, it shouldn't be a problem if we run an adjoint source with additional field components... it's not clear to me why |
Hi @smartalecH , |
Hello,
I am experiencing a reproducible core dump on the latest mpi-enabled conda pymeep package:
The issue is that the adjoint simulation immediately crashes when the "run" method is called on it. This doesnt happen when I tweak the adjoint simulation not to have active sources, by replacing "if np.any(dJ) by a constant False; in this case the adjoint simulation in fact starts and runs correctly, making me think is something related to a divergence; but at the same time it's strange that the crash is immediate on the run call and doesn't depend on the resolution, making me think this is not about a divergence during the timestep.
Could this be somehow related to the calculation of the adjoint source itself?
Here the code:
If I use the plot2D on the adjoint simulation object before calling the run, I see the adjoint source is correctly placed where the EigenModeCoeficient monitor was:
The text was updated successfully, but these errors were encountered: