Closed steven-murray closed 6 years ago
Interestingly, just doing $21CMMC spin 7 -z 1.2
works fine.
Having a brief look at the C code, it seems to be that the Tk_spline isn't filled and then is used... ideas?
Running the same as you, I did not receive a segfault. Instead I received the following:
Traceback (most recent call last):
File "/Users/bradleygreig/anaconda3/envs/hybrid21CMMC-develop-brad/bin/21CMMC", line 11, in
I note however, that the average values that I am outputting (for debugging) return "nan". Which I suspect is the same issue, just in a different form. That is, my compiler might be dealing accessing different (existing) memory space.
I think you might be right regarding the non-initialisation of the interpolation.
Line 179 of SpinTemperatureBox.c is the logic statement defining whether or not to initialise the X-ray heating tables. This condition is failing when $21CMMC coeval 7 --do-spin -z 1.2
is called.
This condition needs to be passed for the code to function properly
I just tried removing that condition at line 179, but that didn't fix the problem. Mostly likely because that same condition is required several other times.
Actually, I forced first_box to be true (changing it within C) and the nan values were gone. So, I think this is indeed the problem.
Hmm, nope, this can't be the issue. I'll dig deeper...
Regardless though, that Python error is consistent. AttributeError: 'TsBox' object has no attribute 'ffi'
Not sure what is going on there.
Yeah, I eventually got that error too. It is fixed now (in my branch).
When I run, it does the first spin box fine (at z=36 or so), then fails on the next spin box (at z=30 or so). It should be doing the init_heat() on the first box, right? So then it shouldn't fail on the second box given it's in the same session.
in heating_helper_progs... is the tkin_spline variable local?
I have fixed the "nan" issue, but I am not sure if that solves the overall issue. I now get sensible numbers up until I receive the Python error.
Have you pushed your fix?
yes.
Ok, I pulled your fix, and ran it with my fix and it "mostly" worked. I have pushed my fix.
Expect the following error though:
Traceback (most recent call last):
File "/Users/bradleygreig/anaconda3/envs/hybrid21CMMC-develop-brad/bin/21CMMC", line 11, in <module>
load_entry_point('py21cmmc', 'console_scripts', '21CMMC')()
File "/Users/bradleygreig/anaconda3/envs/hybrid21CMMC-develop-brad/lib/python3.6/site-packages/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/Users/bradleygreig/anaconda3/envs/hybrid21CMMC-develop-brad/lib/python3.6/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/Users/bradleygreig/anaconda3/envs/hybrid21CMMC-develop-brad/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/bradleygreig/anaconda3/envs/hybrid21CMMC-develop-brad/lib/python3.6/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/bradleygreig/anaconda3/envs/hybrid21CMMC-develop-brad/lib/python3.6/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/Users/bradleygreig/anaconda3/envs/hybrid21CMMC-develop-brad/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/Users/bradleygreig/Documents/21cmMC/Hybrid21CMMC/GitVersion/Hybrid21CM/src/py21cmmc/cli.py", line 318, in coeval
regenerate=regen, write=True, direc=direc, match_seed=match_seed
File "/Users/bradleygreig/Documents/21cmMC/Hybrid21CMMC/GitVersion/Hybrid21CM/src/py21cmmc/_21cmfast/wrapper.py", line 1252, in run_coeval
bt += [brightness_temperature(ib, perturb[minarg], st if do_spin_temp else None)]
File "/Users/bradleygreig/Documents/21cmMC/Hybrid21CMMC/GitVersion/Hybrid21CM/src/py21cmmc/_21cmfast/wrapper.py", line 1114, in brightness_temperature
spin_temp(), ionized_box(), perturb_field(), box())
TypeError: cdata 'struct TsBox *' is not callable
And I am going home! :)
okay, awesome, thanks! I think I can fix that :-)
this seems to all be fixed as of f4336230c030105ed51f01d2d0966addf393843d
The command
$21CMMC coeval 7 --do-spin -z 1.2
fails with a segfault. The output from valgrind is