-
Notifications
You must be signed in to change notification settings - Fork 129
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
Segmentation fault when using AMR and passive scalars with user-defined boundary functions #609
Comments
We cannot tell what is causing the problem without seeing your code. I suggest you to run the code with gdb (or analyze dumped core file with it) to identify where it died. It is a bit tricky to run gdb with MPI but you can google it. |
My apologies, I forgot to attach my problem generator I will look into running gdb with MPI. Thank you for the suggestion. |
I could not catch anything causing the segmentation fault, but I'm afraid that your boundary conditions probably cause another problems. You are directly accessing the passive scalar array in the boundary functions, but with AMR we need to apply the boundary conditions on what we call coarser buffer for AMR prolongation. @c-white @felker do you remember the correct way to apply the boundary conditions on the scalar variables? |
This cannot be hacked in the code in the way shown in the attached pgen file. |
To elaborate, the user-defined boundary functions get called during the prolongation step of refinement in athena/src/bvals/bvals_refine.cpp Lines 451 to 459 in 185473d
You'll note that
won't work. The function needs to be made generic enough to apply to a function parameter for e.g. Or you can follow @yanfeij's lead in #492 and have separate user-defined boundary functions for passive scalars like he made for the radiation intensity: Lines 667 to 690 in 185473d
Since your user-defined boundary functions are mostly outflow, I would try hardcoding calling the built-in outflow functions for only the passive scalars in |
Thanks @tomidakn and @felker -- this was sort of working with an earlier version of the codebase, but perhaps that was just luck. At least there are a couple ways forward for fixing the passive scalar boundaries. @sunnywong314 I can help pursuing one of them. For this project, I'm inclined to do some quick and dirty pointer comparisons, so that only the pgen file needs to be modified, but I'll spend a little time having a closer look at the code. |
@tomidakn @felker @c-white Many thanks for looking into this! Passive scalars didn't cause the segmentation fault, but it is good to know that the hack in the boundary function doesn't work. I removed all passive-scalar-related lines from the problem generator for clarity : I get a segmentation fault if I configure with : However, if I configure without MPI: The segmentation fault also goes away if I configure with the I tracked down 9d763ac as the first commit that gave me the segmentation fault. All earlier commits that I tested up to 2bd7c69 from Mar 2021 were alright. I haven't learned how to run a debugger with MPI so I don't know which line of the code gave me the segmentation fault. Here are the modules I have:
The modules are the same at compile time and at run time. mpicxx --version : |
OK, it sounds like my fault. I'll take a look. Can you try it with nghost=2? |
nghost = 2 still gives the segmentation fault (note: previous runs used xorder = 3, and for this I change to xorder = 2) |
I could reproduce your issue with g++ (8.5.0) + Intel MPI, but not with icpc (2023) + Intel MPI. So this issue seems to be g++ specific. |
@sunnywong314 To try this on Popeye:
In your submission script, try either |
I tested the latest code with g++ and Intel MPI but with another pgen and it ran smoothly. So I'm afraid this issue is very subtle but specific to your pgen. |
Prerequisite checklist
Place an X in between the brackets on each line as you complete these checks:
Summary of issue
I am running my own problem generator (based on code by @c-white) where supernova ejecta enters the box (as a user boundary condition) and interacts with a companion star. When running with AMR, the code exits with segmentation fault (with the input provided, at cycle 332, code time 0.38). I am relatively new to Athena++ so any help/pointers are greatly appreciated.
Steps to reproduce
Configure:
python configure.py --prob test_eos_ejecta3 --coord cartesian --flux hllc --nghost 4 --grav mg -mpi -hdf5
Compile and run:
make clean; make
mpirun -n 40 bin/athena -i inputs/model.athinput time/tlim=2.0
Input files (placed in
input
folder, and please remove .txt) :donor_1p0_0p21_4p0_0.08.data.txt,
model.athinput.txt
Version info
The text was updated successfully, but these errors were encountered: