Skip to content

feat: Copy/archive input XML files into the output directory#4030

Open
kdrienCG wants to merge 26 commits intodevelopfrom
feature/kdrienCG/archiveInputDeck
Open

feat: Copy/archive input XML files into the output directory#4030
kdrienCG wants to merge 26 commits intodevelopfrom
feature/kdrienCG/archiveInputDeck

Conversation

@kdrienCG
Copy link
Copy Markdown

@kdrienCG kdrienCG commented Apr 16, 2026

(Previously #4003)

This PR proposes to archive the XML input deck to the output directory, so that every set of results is accompanied by the exact input that produced it.

When GEOS is run with the new archive command line option (-a LEVEL), all XML input files (and every files that are included via the <Included> XML tag) are flattened into a single file in a timestamped directory.

Following suggestions from @rrsettgast and @bd713, the XML input files are "flattened" into a single XML file.

The following command line argument is added to specifiy the level of archiving wanted:

-a, --archive,  Archiving strategy's level:
                  0 = no archiving,
                  1 = XML inputs only (default),
                  2 = XML inputs and the XSD schema

Given a run like:

geosx -i foo.xml -o OUTPUT/ -a 2

The following is created:

.
└─ OUTPUT/   
   └─ archive_inputFiles/
      └─ 20260320_103034/
         ├─ input.xml
         └─ schema.xsd

Previous proposition

This PR proposes to automatically archive the XML input deck to the output directory, so that every set of results is accompanied by the exact input that produced it.

When GEOS is run with an output directory specified (-o <dir>), all XML input files (and every files that are included via the <Included> XML tag) are copied into the output directory with a timestamp.


Given a run like:

geosx -i foo.xml -o OUTPUT/

The following is created:

.
└─ OUTPUT/   
   └─ archive_inputFiles/
      └─ 20260320_103034/
         ├─ foo.xml
         │
         ├─ include1.xml
         │
         └─ some_subdir/
            └─ include2.xml

When included files are "behind" the input tree of the main XML, the following structure is proposed:

.
└─ OUTPUT/   
   └─ archive_inputFiles/
      └─ 20260320_103034/
         ├─ foo.xml
         │
         ├─ __one_level_behind_include.xml
         │
         ├─ __one_level_behind_folder/           
         |  └─ baz.xml
         │
         └─ ____two_level_behind_folder/      
            └─ buzz.xml

Files outside the input tree (reached via ../) are prefixed with __ for every ../ from foo.xml.

kdrienCG and others added 20 commits March 20, 2026 09:23
Rename the archive output directory "archive_inputFiles" instead of "inputFiles".
This prevents the archived XML files to unintentionally overwrite the standard "inputFiles" in GEOS/ when running with `-o .` where '.' is GEOS/ location
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
ProblemManager::generateDocumentation() used to create the XSD schema has undesired side-effects on the Problem. To mitigate this, the archiving has been moved after the basicSetup() in the main.cpp, and creates an isolated ProblemManager (like the tests) that will not propagate the side-effects, and make us able to copy the XSD schema to the archive.
@kdrienCG kdrienCG self-assigned this Apr 16, 2026
@kdrienCG kdrienCG added type: feature New feature or request type: new A new issue has been created and requires attention labels Apr 16, 2026
@kdrienCG kdrienCG added the ci: run integrated tests Allows to run the integrated tests in GEOS CI label Apr 16, 2026
@kdrienCG kdrienCG marked this pull request as ready for review April 16, 2026 09:17
Apparently, writing < and > between an existing XML tag in a code comment, like <Included> causes the doxygen test to fail.
@kdrienCG kdrienCG removed the ci: run integrated tests Allows to run the integrated tests in GEOS CI label Apr 16, 2026
@kdrienCG kdrienCG added ci: run CUDA builds Allows to triggers (costly) CUDA jobs ci: run integrated tests Allows to run the integrated tests in GEOS CI ci: run code coverage enables running of the code coverage CI jobs labels Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci: run code coverage enables running of the code coverage CI jobs ci: run CUDA builds Allows to triggers (costly) CUDA jobs ci: run integrated tests Allows to run the integrated tests in GEOS CI type: feature New feature or request type: new A new issue has been created and requires attention

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant