def generate_jacobians(argdict):

    # Add fixed values to argument dictionary
    dict2 = {'-driver' : 'llg',
            '-ms-method' : 'disabled',
            '-output-jac' : 'always',
            '-solver' : 'gmres',
            '-prec' : 'amg',
            '-doc-interval' : '0'}
    argdict.update(dict2)

    # Get the arguments as a list
    arglist, binary_path, _ = mm.argdict2list(argdict)

    # Make sure the output dir exists and is clean
    outdir = argdict['-outdir']
    mm.cleandir(outdir)

    # Run the driver with the given arguments
    err_code = mm.run_driver(arglist, outdir)

    # Return sucess/failure
    if err_code != 0:
        print("FAILED", ' '.join(arglist))
        return False
    else:
        return True
def generate_jacobians(argdict):

    # Add fixed values to argument dictionary
    dict2 = {
        "-driver": "llg",
        "-ms-method": "disabled",
        "-output-jac": "always",
        "-solver": "gmres",
        "-prec": "amg",
        "-doc-interval": "0",
    }
    argdict.update(dict2)

    # Get the arguments as a list
    arglist, binary_path, _ = mm.argdict2list(argdict)

    # Make sure the output dir exists and is clean
    outdir = argdict["-outdir"]
    mm.cleandir(outdir)

    # Run the driver with the given arguments
    err_code = mm.run_driver(arglist, outdir)

    # Return sucess/failure
    if err_code != 0:
        print("FAILED", " ".join(arglist))
        return False
    else:
        return True
def selftestrun(argdict):

    outdir = argdict.get("-outdir")
    if outdir is None:
        outdir = pjoin("Validation", argdict['-ts'] + str(argdict.get('-ms-method')))
        argdict['-outdir'] = outdir

    arglist, _, _ = mm.argdict2list(argdict)

    mm.cleandir(outdir)
    flag = mm.run_driver(arglist, outdir)

    try:
        data = mm.parse_trace_file(pjoin(outdir, "trace"))
    except IOError:
        data = None

    return data, outdir, flag