def mk_ipolinputs(params):
    """
    Make sorted run name and parameter name & value lists, suitable for passing to prof.Ipol

    params is a dict (actually, prefer OrderedDict) of run_names -> param_vals,
    as returned from read_rundata
    """
    runs = sorted(params.keys())
    if not runs:
        return runs, [], [[]]
    paramnames = params[runs[0]].keys()
    paramslist = [[params[run][pn] for pn in paramnames] for run in runs]
    return runs, paramnames, paramslist