SWIFTSIM / SWIFT

Modern astrophysics and cosmology particle-based code. Mirror of gitlab developments at https://gitlab.cosma.dur.ac.uk/swift/swiftsim
http://www.swiftsim.com
GNU Lesser General Public License v3.0
88 stars 58 forks source link

Restart without feedback #15

Closed FilipHusko closed 2 years ago

FilipHusko commented 3 years ago

Hi,

When I try to restart a SWIFT run without stellar feedback (both the initial run and the restart are without feedback, and even without stars), I get the following error:

'feedback/EAGLE/yield_tables.h:read_yield_tables():101: unable to open file /SNIa.hdf5'

The reason this happens, I'm guessing, is that the path to the yield tables is empty (since the path isn't read from the parameter file, if feedback is turned off). The larger issue is why does the code even try to read the yield tables with feedback turned off?

MatthieuSchaller commented 3 years ago

Can you show a reproducible example of the problem?

i.e. how did you configure? how did you run? what is in your parameter file?

FilipHusko commented 3 years ago

Sure, I'm basically running a modified version of the isolated galaxy example, so the parameter file is the same as provided. I configured with

./configure--with-parmetis --enable-ipo --with-tbbmalloc --with-subgrid=EAGLE-XL --with-hydro=sphenix --with-kernel=wendland-C2 --with-ext-potential=nfw

and ran with

./swift --black-holes --hydro --temperature --self-gravity --external-gravity --threads=28 --limiter --sync --pin isolated_galaxy.yml

Could it be because I configured with feedback, but am running without it? I will try configuring without.

MatthieuSchaller commented 3 years ago

Yes, that is a rather unusual configuration.

Compiling without feedback would work.

But there is a genuine bug hidden in there. The code should indeed not attempt to read the feedback data upon restart when we are running without feedback. Irrespective of how it as compiled.

FilipHusko commented 3 years ago

I tried configuring without stellar feedback (and stars), but a separate issue pops up. This is my configuration command:

./configure --with-parmetis --enable-ipo --with-tbbmalloc --with-cooling=COLIBRE --with-black-holes=EAGLE --with-tracers=EAGLE --with-chemistry=EAGLE --with-hydro=sphenix --with-kernel=wendland-C2 --with-ext-potential=nfw

Just a bit of context: I'm trying to do a run with just a gas halo and a black hole which does some feedback. The chemistry command is there for cooling to be correctly compiled, and tracers are there for AGN feedback to work. This is the error that pops up when I try compiling with that configuration:

In file included from part.h(120), from space.h(36), from space.c(40): ./black_holes/EAGLE/black_holes_part.h(312): error: incomplete type is not allowed struct ray_data rays[eagle_blackhole_number_of_rays];

I'm thinking about circumventing both of these issues by compiling with the full model, running with feedback, but effectively not having any stellar feedback if I don't have stars in my ICs (and if none are formed). The only problem there is that I don't know if the code can be run with stellar feedback but without star formation. Will try it out.

Edit: Confirmed that this does indeed work. I ran with feedback and stars turned on, butwithout star formation. Since no stars are present in ICs, no feedback is done. But the feedback info is correctly read from the parameter file, and the restart goes on without issue.

MatthieuSchaller commented 3 years ago

Ok, I see.

That's a bug I need to fix then. Might not be super high priority, but I'll look at it. Ideally we should be able to mix&match modules.

What you can do otherwise is run with the full model but switch off stellar feedback in the feedback section of the parameter file. . In that way the code still executes but does nothing.

Yes, you should be able to run with feedback but without SF. Now... there might be a similar issue when restarting... It's hard to test all possible combinations but I'll try to fix the ones that you report as clearly they are used by at least one person. :)

MatthieuSchaller commented 3 years ago

I haven't forgotten about this.

Could you give me a list of the combinations that you'd like to run? I can then start with these.

FHusko commented 3 years ago

So far I have mostly been doing runs without stars but with gas and black holes, since I'm doing simple tests with a new feedback scheme (kinetic jets launched from black holes). So I think the simplest version would be just with hydrodynamics, and then with black holes added on.

Of course, the simplest option would just be to not compile with full physics, but then we run into the problem that I describe in my last post above. Just from a cursory look it seems to me like the ray data for AGN and stellar feedback are not decoupled, so one cannot compile with just one of those forms of feedback.

And just to note: I have been using the plaster fix (running with stars and feedback, but no star formation and no stars in ICs); this works for my purposes right now so you don't have to feel pressure to solve this in x amount of time just because I had this issue. :)

MatthieuSchaller commented 3 years ago

Ok. I have pushed an updated version of the code, where you can now compiler with just EAGLE black holes + COLIBRE cooling + EAGLE chemistry.

./configure --with-black-holes=EAGLE --with-chemistry=EAGLE --with-cooling=COLIBRE

I can't make it less than that as the EAGLE BH model needs this cooling internally.

You could compile with just black holes if you implemented your own independent model.

MatthieuSchaller commented 2 years ago

@FHusko any updates on this? Did it work for you?

FHusko commented 2 years ago

Sorry for no update in a while! This compiles and works correctly only if I don't use the tracers to track when/which particles were kicked/heated (since the functions in tracers/none don't do anything). However, I filled those out with what I need and it works! Thanks.