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

Feature/thrift vmec restart #312

Merged
merged 13 commits into from
Dec 3, 2024
Merged

Feature/thrift vmec restart #312

merged 13 commits into from
Dec 3, 2024

Conversation

lazersos
Copy link
Collaborator

This pulls request does the following:

  • Merges changes from ORNL-fusion/PARVMEC
  • Fixes VMEC restart feature to work when more than one processor is requested
  • VMEC restarting is implemented in THRIFT.

@lazersos lazersos added bug Something isn't working enhancement New feature or request labels Nov 27, 2024
@lazersos lazersos requested a review from ajchcoelho November 27, 2024 17:31
@lazersos lazersos self-assigned this Nov 27, 2024
Copy link
Collaborator

@ajchcoelho ajchcoelho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When running this branch with the input files in BENCHMARKS/THRIFT_TEST (profiles_analytical.h5 and input.analytical), the code crashes with a segmentation fault error at t=12.5s, substep=12.

I tracked it down to line 38 of file thrift_run_equil.f90. The phi variable suddenly is not allocated. I don't understand how it runs for more than 12 time iterations and then this error pops up.

THRIFT/Sources/thrift_paraexe.f90 Show resolved Hide resolved
@lazersos
Copy link
Collaborator Author

I've added a feature to allow the user to control use of the VMEC 'reset' feature -vmec_reset.

@lazersos
Copy link
Collaborator Author

The issue you're experiencing is because the VMEC equilibria is failing to converge. At which point ier_paraexe=-1, which we don't handle. From that point on the code basically stops calculating VMEC equilibria which eventually leads to a crash. A check needs to be implemneted so that once VMEC fails to converge, the code exits out with the proper message.

@lazersos
Copy link
Collaborator Author

The code has been updated so that if VMEC fails to converge in reset mode then it'll attempt a second run in the normal mode of operation.

@lazersos
Copy link
Collaborator Author

lazersos commented Dec 1, 2024

@ajchcoelho I've updated the code so that the wout_reset_file.nc files are only written after THRIFT successfully converges on a total current. This seems to fix the issue I had where at t=2.5 s in the BENCHMARKS case the code would seemling fail to converge the equilibria. The idea being here that wout_reset_file.nc should always be the previous timestep not the previous iteration. I also added some initializations which VMEC wasn't doing.

@lazersos lazersos requested a review from ajchcoelho December 1, 2024 09:46
Copy link
Collaborator

@ajchcoelho ajchcoelho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I've made a comparison for the analytical case, with restart and w/o restart at different times:

image

In terms of timing, as already expected there is no time improvement: THRIFT spends 25 minutes running the equilibrium code (VMEC) in both situations (with and without restart mode)

@lazersos lazersos merged commit 991c691 into develop Dec 3, 2024
2 checks passed
@lazersos lazersos deleted the feature/THRIFT_VMEC_RESTART branch December 3, 2024 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants