Provide a way to query mdb entries for the current machine

Create issue
Issue #917 new
Ian Hinder created an issue

I would like to find out the value of the "basedir" entry in the MDB for the current machine. I currently have to do:

simdir=$(sim print-mdb-entry datura|grep '^[ \t]*basedir[ \t]*=[ \t]\(.*\)[\t ]*$'|awk '{print $3}')

This is quite ugly, and also requires me to know that the current machine is "datura". I would like to be able to do

sim print-mdb-entry basedir

and have it print the value of basedir for the current machine. If I instead specify a different machine,

sim --machine ranger print-mdb-entry basedir

then it could print the value for the other machine. This would be much more intuitive and useful than the current behaviour.


Comments (1)

  1. Ian Hinder reporter
    • removed comment

    I just discovered "sim get-output-dir <sim>". This was what I was trying to ultimately compute.

    [ianhin@login-damiana EinsteinToolkitTests]$ sim get-output-dir EinsteinToolkitTests_f1e7cc6bccfee780c84e05fbb6f2889ea598d7c8_1 Simulation name: EinsteinToolkitTests_f1e7cc6bccfee780c84e05fbb6f2889ea598d7c8_1 Output directory: /lustre/datura/ianhin/simulations/EinsteinToolkitTests_f1e7cc6bccfee780c84e05fbb6f2889ea598d7c8_1/output-0000/

    This is not very useful for use from a script. I would prefer that it just gave me the output directory rather than all that extra information which then needs to be parsed away.

    Still, I think the above would be a useful modification to print-mdb-entry.

  2. Log in to comment