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

Clean exit for "simulation fields are NaN or Inf" #1183

Closed
smartalecH opened this issue Apr 15, 2020 · 3 comments
Closed

Clean exit for "simulation fields are NaN or Inf" #1183

smartalecH opened this issue Apr 15, 2020 · 3 comments

Comments

@smartalecH
Copy link
Collaborator

#922 stops the simulation if a NaN or Inf is detected. Unfortunately, this also kills the process.

Is there a way to stop the simulation at this point without killing the process? This is problematic when optimizing over several simulations and a geometry is chosen that blows up the fields. Rather than kill everything (and lose progress) it would be better to stop the simulation early so the optimizer knows this is a poor route to pursue.

@stevengj
Copy link
Collaborator

stevengj commented Apr 16, 2020

Doesn't our Python API intercept this and turn it into an exception?

@smartalecH
Copy link
Collaborator Author

smartalecH commented Apr 18, 2020

Yes you're right. Seems like a try, except block should take care of this.

@hyounghankwon
Copy link

Hi, all.

I am Hyounghan Kwon who is doing reasearch about nanophotnoics.
Thank a lot for the development of the MEEP. It is really useful for my research.
I have a one question regarding the "simulation fields are NaN or Inf" issue.

I am using pmp (parallel meep) and try to solve eigenfrequency solver. (solve_eigfreq)
In that case, the try and except block seems not working.
I tested one processor without parallelization and multi-processors for this issue.
For one processor, it can nicely go to the exception block.
For many professors, "try and except" block doesn't work and the entire processes are killed when one of them encounters nan or inf field.
Is there anyway to circumvent the "simulation fields are NaN or Inf" issue when we are using the parallel meep and solve_eigfreq?

Thanks a lot and stay healthy!
Best
Han

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

No branches or pull requests

3 participants