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

CarpetX: Change the implementation to Driver. #305

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open

Conversation

rhaas80
Copy link
Member

@rhaas80 rhaas80 commented Aug 30, 2024

This involves adding a parameter "periodic" whose only allowed value is "no."
This involves adding a parameter "periodic" that must be set to "yes" for any periodicity to be active.
It also involves modifying parameter files, file names, and source files where the name "CarpetX" needs to be replaced by "Driver." to account for the fact that the regrid_error grid function moved from CarpetX to CarpetRegridX.

Parameter files may, but not have to use Driver::periodic instead of CarpetX::periodic since the parameter file parser accepts both implementation and thorn names for restricted parameters.

ActiveThorns = PUGH

PUGH::periodic = yes
Driver::periodic_x = no

This picks up the work in #299

@rhaas80
Copy link
Member Author

rhaas80 commented Aug 30, 2024

WaveToyX/par/standing.par Show resolved Hide resolved
WaveToyX/test/presync.par Show resolved Hide resolved
CarpetX/param.ccl Show resolved Hide resolved
CarpetXRegrid/README Outdated Show resolved Hide resolved
SpacetimeWaveToyX/par/standing.par Show resolved Hide resolved
SpacetimeWaveToyX/test/standing/standing.par Outdated Show resolved Hide resolved
StaggeredWaveToyX/par/standing.par Show resolved Hide resolved
StaggeredWaveToyX/test/standing/standing.par Outdated Show resolved Hide resolved
TestODESolvers/test/test-rkf78.par Outdated Show resolved Hide resolved
@rhaas80
Copy link
Member Author

rhaas80 commented Sep 2, 2024

Will need to add CarpetXRegrid to the thornlist used by the CI testing.

@rhaas80 rhaas80 force-pushed the carpetx-driver branch 3 times, most recently from ff5e7da to 46874bf Compare September 3, 2024 20:36
@eschnett
Copy link
Collaborator

"This involves adding a parameter "periodic" whose only allowed value is "no."". is that still true?

@rhaas80
Copy link
Member Author

rhaas80 commented Sep 10, 2024

"This involves adding a parameter "periodic" whose only allowed value is "no."". is that still true?

not true anymore. It does introduce a parameter periodic but it must be set to "yes" for any periodicity to be applied.

Copy link
Collaborator

@eschnett eschnett left a comment

Choose a reason for hiding this comment

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

There should be checkpoint/recovery tests as well. I think the respective checkpoint files need to be regenerated.

@@ -3,6 +3,7 @@ ActiveThorns = "
CarpetX
CoordinatesX
IOUtil
CarpetXRegrid
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you sort thorn names alphabetically?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes

@@ -2,7 +2,7 @@

REQUIRES AMReX IOUtil MPI yaml_cpp zlib

REQUIRES Arith Loop
REQUIRES Arith Loop CarpetXRegrid
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you sort requirements alphabetically?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes

IMPLEMENTS: CarpetX

INHERITS: IO
IMPLEMENTS: Driver
Copy link
Collaborator

Choose a reason for hiding this comment

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

That's it! That's the core of the change! Yay!


BOOLEAN periodic_y "Periodic"
BOOLEAN periodic_x "Periodic boundary conditions in x-direction"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you add "only takes effect if also periodic = yes or similar?


PRIVATE:

#TODO: reliminate in favor of regrid_error being a ture/false field
Copy link
Collaborator

Choose a reason for hiding this comment

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

Two typos: reliminate, ture.

@@ -0,0 +1,6 @@
# Schedule definitions for thorn CarpetXRegrid
SCHEDULE CarpetX_InitError AT basegrid
Copy link
Collaborator

Choose a reason for hiding this comment

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

The function name prefix should be CarpetXRegrid.

CarpetX::periodic_x = yes
CarpetX::periodic_y = yes
CarpetX::periodic_z = yes
Driver::periodic_x = yes
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is a Driver::periodic = yes missing here?

Copy link
Member Author

Choose a reason for hiding this comment

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

That's in the output directory. The parfile should be deleted there.

CarpetX::periodic_x = yes
CarpetX::periodic_y = yes
CarpetX::periodic_z = yes
Driver::periodic_x = yes
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is a Driver::periodic = yes missing here?

Copy link
Member Author

Choose a reason for hiding this comment

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

That's in the output directory. The parfile should be deleted there.

@rhaas80
Copy link
Member Author

rhaas80 commented Sep 10, 2024

"This involves adding a parameter "periodic" whose only allowed value is "no."". is that still true?

not true anymore. It does introduce a parameter periodic but it must be set to "yes" for any periodicity to be applied.

Turns out that (see updated description) the "adapt to CarpetX implementation change" commits aren't actually required since the parameter file parser will accept both implementation and thorn names for restricted parameters (and private ones as well, which is a bug...).

@rhaas80
Copy link
Member Author

rhaas80 commented Sep 10, 2024

There should be checkpoint/recovery tests as well. I think the respective checkpoint files need to be regenerated.

The TestOuptut/recover-openpmd test passes:

  [10] recover-openpmd
       CarpetX/TestOutput/test/recover-openpmd.par
  Choose test: [0] 
   --> 10

------------------------------------------------------------------------

  Test TestOutput: recover-openpmd
    "CarpetX/TestOutput/test/recover-openpmd.par"

  Issuing mpirun -np 2 /data/rhaas/postdoc/gr/cactus/ET_trunk/exe/cactus_sim /data/rhaas/postdoc/gr/cactus/ET_trunk/arrangements/CarpetX/TestOutput/test/recover-openpmd.par

  Success: 40 files identical

Looking at file md.0 it only has settings for parameters:

CarpetX::periodic_x = no
CarpetX::periodic_y = no
CarpetX::periodic_z = no

which are apparently acceptable (not sure why, http://einsteintoolkit.org/referencemanual/ReferenceManual.html#x1-156000A2 clearly says it needs to be the implementation name "Driver").

The missing Driver::periodic is not caught because it is a new parameter.

stevenrbrandt and others added 12 commits September 12, 2024 13:55
This involves adding a parameter "periodic" whose default value is "no."
It also involves modifying parameter files, file names, and source files
where the name "CarpetX" needs to be replaced by "Driver."
required due to CarpetX implemting "Driver"
required due to CarpetX implemting "Driver"
required due to CarpetX implemting "Driver"
required due to CarpetX implemting "Driver"
required due to CarpetX implemting "Driver"
required due to CarpetX implemting "Driver"
required due to CarpetX implemting "Driver"
required due to CarpetX implemting "Driver"
required due to CarpetX implemting "Driver"
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

Successfully merging this pull request may close these issues.

3 participants