perrette / runner Goto Github PK
View Code? Open in Web Editor NEWSample parameters, run model ensemble over multiple processors
License: MIT License
Sample parameters, run model ensemble over multiple processors
License: MIT License
I would like to use job run ... -p group1.p1=1 group2.p1=2 ...
for the case where the parameter group group1
appears in one namelist file and the parameter group group2
appears in another namelist file.
Typically to modify parameters in a parameter/namelist file I use the following steps:
# Read param file runner.json always written by runner to rundir
rjson = os.path.join(rundir, 'runner.json')
js = json.load(open(rjson))
# Load default namelist parameters
params = nml.load(open(par_path))
# Update default parameters with runner.json parameter values
params.update(js['params'])
# Write updated parameter file to rundir
par_path_new = os.path.join(rundir,os.path.basename(par_path))
nml.dump(params, open(par_path_new, 'w'))
The params.update
step is what takes the given set of parameters and updates it with my command line options. So the simplest method I see, to handle multiple input parameter files is to just call the above lines once per namelist file. It will find the parameter groups and parameters that exist and modify them as needed. However, I've noticed that if a parameter group like group2
does not exist in the first parameter file, then it is added as a new parameter group. This makes the above strategy unworkable, since a bunch of irrelevant parameters may be added to a parameter file needlessly.
So,
(1) Is there a better way to achieve what I want than the strategy above?
(2) Is it possible to modify ext/namelist.py
so that it only writes parameters to the namelist file if it finds that they exist already? Or via an argument?
Thanks!
Alex
Hi Mahé,
Great tool!! I am now using runner
regularly for ensemble simulations. However, as we've discussed, I find myself urgently in need of an additional column in the ensemble summary file, which lists the path associated with a given set of parameter values. You already know that I think this has value in many contexts and is conceptually more complete. But I am learning that it would be especially useful when the run option -a
is used, setting the folder name based on the parameter choices, which sometimes I prefer. Having this column would then let me load the folders easily in R/Python for later analysis. Could you please implement this??
Thanks!
Alex
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.