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

FPE failure when sim.stopTime_ = 0.0 #721

Open
chongchonghe opened this issue Aug 27, 2024 · 4 comments
Open

FPE failure when sim.stopTime_ = 0.0 #721

chongchonghe opened this issue Aug 27, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@chongchonghe
Copy link
Contributor

chongchonghe commented Aug 27, 2024

Describe the bug
FPE failure when sim.stopTime_ = 0.0.

To Reproduce
Steps to reproduce the behavior:

  1. Compile any problem, e.g. RadStreaming, and see it passes.
  2. Set sim.maxTimesteps_ = 0 or sim.stopTime_ = 0.0 and observe it failed. The error message is copied below:
SIGILL Invalid, privileged, or ill-formed instruction
See Backtrace.0 file for details
  1. Alternatively, comment out this line: sim.evolve();, compile and run. See the same error message.

Additional context

The same test ran without a problem a few month ago. I speculate it started to fail after the FPE commit.

Contents of Backtrace.0:

 0: amrex::BLBackTrace::print_backtrace_info(__sFILE*) (in test_radiation_streaming) + 64

 1: amrex::BLBackTrace::handler(int) (in test_radiation_streaming) + 644

 2: _sigtramp (in libsystem_platform.dylib) + 56

 3: QuokkaSimulation<StreamingProblem>::computeAfterEvolve(amrex::Vector<double, std::__1::allocator<double>>&) (in test_radiation_streaming) + 1256

 4: AMRSimulation<StreamingProblem>::evolve() (in test_radiation_streaming) + 1444

 5: problem_main() (in test_radiation_streaming) + 168

 6: main (in test_radiation_streaming) + 172

 7: start (in dyld) + 2476

Line 1256 of QuokkaSimulation is: amrex::Gpu::streamSynchronizeAll(); // just in case

@chongchonghe chongchonghe added the bug Something isn't working label Aug 27, 2024
@BenWibking
Copy link
Collaborator

I suppose this is technically a bug, but also: is there a reason to support running a simulation with a stopTime or maxTimesteps of 0?

@BenWibking
Copy link
Collaborator

The + some_integer here does not refer to a line number:

 3: QuokkaSimulation<StreamingProblem>::computeAfterEvolve(amrex::Vector<double, std::__1::allocator<double>>&) (in test_radiation_streaming) + 1256

Instead it refers to a byte offset in the binary file. To get line numbers, you have to compile it in debug mode (or at least with -g to get debugging information embedded in the binary).

@BenWibking
Copy link
Collaborator

The problem is from this line that divides by stopTime_:

amrex::Print() << "\nCoarse STEP " << step + 1 << " at t = " << cur_time << " (" << (cur_time / stopTime_) * 100. << "%) starts ..."

@chongchonghe
Copy link
Contributor Author

OK then, it's an easy fix.

I want to support stopTime_=0, because that's the easiest way to plot the initial condition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants