Skip to content

Sorting of config folder - #542

Open
AndersenFred wants to merge 13 commits into
masterfrom
config-clean
Open

AndersenFred wants to merge 13 commits into
masterfrom
config-clean

Conversation

@AndersenFred

Copy link
Copy Markdown
Contributor

I started to sort the config folder, by moving all tunes to their own folder and sorted the configs for each class into categories

@AndersenFred

AndersenFred commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor Author

I'm done, it works but while doing this I found that the file BertuzzoDNuCOHfPXSec.xml from the DarkNeutrino model does not exist.

Additionally some algs were present multiple times (all linking the same xml file) which are removed now

@AndersenFred
AndersenFred marked this pull request as ready for review October 11, 2026 13:19
@AndersenFred

Copy link
Copy Markdown
Contributor Author

Those file still in config I left there on purpose as either multiple Models use them or they are not linked at all in the master config

@nusense

nusense commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

It's admirable to want to clean up the config directory; it was large and unwieldy. It would have been good to have brought the idea up in a forum (either a Core Developers meeting, or on slack) before you put all the effort into implementing it. This might have allowed others to make useful suggestions.

The are a few minor things and one big show stopper.

  • I would push GNuMIFlux.xml into a Flux directory
  • If things are going to be sorted into directories, I don't like that there are a smattering (other than master_config.xml) still at the config level; it seems weird
  • There are some whitespace issues that I'd like to see cleaned up

The fundamental problem is changing master_config.xml from things like

  <config alg="genie::LocalFGM">           LocalFGM.xml                    </config>

to

   <config alg="genie::LocalFGM">          NuclearState/LocalFGM.xml        </config>

This very dangerously, and silently breaks many/most of the tunes. Take a representative tune: N24_20i_02_11b (chosen because it's not too complex and can easily demonstrate the problem). It has a directory structure:

N24_20i
N24_20i/N24_20i_02_11b
N24_20i/N24_20i_02_11b/CommonParam.xml
N24_20i/MECInteractionListGenerator.xml
N24_20i/TuneGeneratorList.xml
N24_20i/NucDeExcitationSim.xml
N24_20i/README.md
N24_20i/LocalFGM.xml
N24_20i/ModelConfiguration.xml

With the new master_config.xml , for instance, the N24_20i/LocalFGM.xml isn't going to be found. This is because it would need to be located as N24_20i/NuclearState/LocalFGM.xml. But instead GENIE's search for XML files will bypass the one in the tune and pick up the default one in config/NuclearState/LocalFGM.xml ... quietly with no indication that it has now picked up the wrong one.
You can verify this quiet behavior by renaming the default files in situ and then run gmkspl with that tune. Because it can't find either the tune's XML files nor the default one it will crash and burn.

One "solution" would be to make the change to the directory structure in the tune, but:

  • That just looks very messy
  • Importantly, this isn't what users expect so we'd be setting them up for (quiet) failure

I think a more workable approach would be to revert master_config.xml and add to XmlParserUtils GetXMLPathList() all the new subdirectories like you do for:

 pathlist += ":$GENIE/config/tunes";
 

This would allow a reorganization of our plethora of XML files, but leave the tune structure unchanged. Additionally, I'd remove the GNuMINtuple addition that's there.

One additional thining I'd like to see (not your fault, but wildly overdue) is clearer documentation of the search order without having to read the code. The order currently is:

- directories in $GXMLPATH
- directories in $GXMLPATHS [deprecated]
- directories in $GALCONF [deprecated]
- fully specified "tune" directory (if not _00_000)
- CMC directory
- GetXMLDefaultPath() -- in class header as { return "$GENIE/config""; }
- $GENIE_REWEIGHT/config
- $GENIE/src/Tools/Flux/GNuMINtuple [ should remove]
- $GENIE/config/tunes [in this PR]
- [to be added] $GENIE/config/&lt;new-subdir1&gt;
- [to be added] $GENIE/config/&lt;new-subdir2&gt;  [etc]

@nusense nusense left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Have a conversation with the wider collaboration.
See the above comment for current problems.

@jtenavidal

Copy link
Copy Markdown
Contributor

Thanks Robert, let's discuss this at the next meeting!

@AndersenFred

Copy link
Copy Markdown
Contributor Author

I have adapted the changes

@AndersenFred
AndersenFred marked this pull request as draft November 18, 2026 20:57
@AndersenFred
AndersenFred marked this pull request as ready for review November 18, 2026 21:03
@AndersenFred
AndersenFred requested a review from nusense November 18, 2026 21:03
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