#1284: Want stand-alone parameter parser --------------------------+------------------------------------------------- Reporter: eschnett | Owner: Type: enhancement | Status: new Priority: major | Milestone: Component: Cactus | Version: Resolution: | Keywords: --------------------------+-------------------------------------------------
Comment (by hinder):
I'm still not quite sure what you want to use this for, so I can't see what aspects are important. Given just a parameter file, it is not possible to know the parameters and their values, because you need the Cactus source and the thornlist to determine the default values. Do you need this feature just for your own simulations? If so, you can set IO::parfile_write = "generate", in which case you get all parameters (not just those explicitly set) in the parameter file written to the output directory. If you (as I) want to know the values of parameters from simulation output, then you won't necessarily have the Cactus tree and thornlist, which is why I wrote comment:4. If you want to know the parameters for a parameter file when you do still have the source tree etc, a utility or the Cactus executable would be suitable. For this, you would need to be examining the parameter file on a machine where the Cactus executable or utility has been compiled with the correct source tree. I suggest that the code in Cactus which parses the parameter file should not be duplicated but should be reused. Given the discussions about adding high-level features to the parameter file, and the fact that you say you want to know the parameters and their values, a "parser" is not sufficient. You also need something which interprets the parse tree and evaluates expressions etc. If the code in Cactus which performs all this logic (and which reads the CCL files etc) is modular enough, then maybe it could be compiled into a utility, but I doubt that this is the case. Why do we need mpirun to run the cactus executable? Can we not check the command line arguments and then just not call mpi_init if we only want the parameters? The only time I can imagine not being able to run the executable would be if it was cross-compiled.