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

Problem with restarting from the first spectrum cycle #515

Closed
saultyevil opened this issue May 9, 2019 · 3 comments
Closed

Problem with restarting from the first spectrum cycle #515

saultyevil opened this issue May 9, 2019 · 3 comments

Comments

@saultyevil
Copy link
Collaborator

I'm running into an odd issue when trying to restart from having run no previous spectral cycles with Py83a (9ebbcc7).

Essentially what I'm doing is running the ionisation cycles for a model, checking to see if the model is converged enough to my liking, and if it has, I may reduce the number of photons and restart from the first spectral cycle. But when I do this, I get a lot of errors related to photon transport as in the screenshots below.

This was run using tde_spherical.pf.txt.

Screenshot from 2019-05-09 13-47-32

This was run using tde_agn.pf.txt.

Screenshot from 2019-05-09 14-04-00

I do not have this issue for Py83 (9253bc4) and I do not have these issues when I run both ionisation and spectral cycles without restarting. I also do not see this issue when restarting from halfway through the ionisation cycles, nor do I see it when I restart from a spectral cycle which is not the first. So, it seems to be a problem with restarting from no spectral cycles.

The common error between both models seems to be the trans_phot error about nnscat, which is this if statement when iextract = 1.

if (pextract.nnscat != 1)
          Error
            ("trans_phot: nnscat is %i for photon %i in scatter mode %i! nres %i NLINES %i\n",
             pextract.nnscat, nphot, geo.scatter_mode, pextract.nres, NLINES);

But, I'm not particularly sure how nnscat can be anything other than 1 for an extract photon? Maybe I'm missing something though.

@kslong
Copy link
Collaborator

kslong commented May 9, 2019

I agree this looks odd.

Note that I did add a variable to the geo structure recently (See #511) so you need to check that the original run was made with exact same version as the restart run.

Also, please try a restart with a single processor and see if you get the same result.

@saultyevil
Copy link
Collaborator Author

So, I think I have tracked this down to a specific commit which is 718f3bf. With the previous commit, 9f5b327, I can restart from the first spectrum cycle. But I cannot on 718f3bf. The only meaningful change is this,

                        // This is the new bit: line 654 in python.c
if (geo.pcycles > 0 && geo.run_type != RUN_TYPE_RESTART)
{
    rdpar_comment ("Parameters defining the spectra seen by observers\n");
    ....
}

I'm guessing what is happening is that because the run type is restart, Python is not entering this if statement and the spectypes are not being defined, as well as the observers and probably some other stuff later on not being initialised.

@saultyevil
Copy link
Collaborator Author

I think this should be fixed now. I have changed the if statement above slightly to account for the situations where we are restarting from the first spectrum cycle.

Just to be sure, I have tested a TDE model with multiple restarts to ensure I didn't break anything to fix issue #503, which doesn't seem to be the case.

comp_comparison

saultyevil pushed a commit that referenced this issue May 24, 2019
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