daphne-eu / daphne

DAPHNE: An Open and Extensible System Infrastructure for Integrated Data Analysis Pipelines
Apache License 2.0
67 stars 62 forks source link

Config.json values are always overwritten by default cli arguments #765

Open aristotelis96 opened 5 months ago

aristotelis96 commented 5 months ago

Users can configure daphne either via cli arguments or providing a .json configuration file: ./bin/daphne --config=UserConfig.json ...

In daphne.cpp we setup the configuration object with values from the config.json file (if provided) and then we replace them in case the user provides command line arguments. However for a lot of cases we overwrite the values from the .json file with the default cli values, that have not been actually provided as CLI arguments by the user. E.g.:

// Initialize user_config object with values from the .json file.
...
...
 static opt<QueueTypeOption> queueSetupScheme("queue_layout",
            cat(schedulingOptions), desc("Choose queue setup scheme:"),
            values(
                clEnumVal(CENTRALIZED, "One queue (default)"),
                clEnumVal(PERGROUP, "One queue per CPU group"),
                clEnumVal(PERCPU, "One queue per CPU core")
            ),
            init(CENTRALIZED)
    );
... // Default queueSetupScheme is CENTRALIZED
...
user_config.queueSetupScheme = queueSetupScheme;

We always replace the existing queueSetupScheme which at this point could be a parsed value from the configuration file.