Exemple #1
0
def optimal_delphi_by_nproc(xdsinp=None,
                            osc_width=None,
                            nframes=None,
                            nproc=None,
                            min_delphi=5):
    if xdsinp is not None:
        kwds = dict(get_xdsinp_keyword(xdsinp))
        osc_width = float(kwds["OSCILLATION_RANGE"])
        data_range = map(int, kwds["DATA_RANGE"].split())
        nframes = data_range[1] - data_range[0] + 1
    if None in (osc_width, nframes):
        print "osc_width and nframes not specified."
        return None

    if nproc is None:
        from yamtbx import util
        nproc = util.get_number_of_processors()

    # TODO check nframes%nproc
    # TODO check if frame chache works (limited to 2^31-1 pixels)

    delphi = nproc * osc_width
    delphi_org = delphi

    fac = 2
    while delphi < min_delphi:
        delphi = delphi_org * fac
        fac += 1

    return delphi
Exemple #2
0
def run(params):
    xds_dirs = []
    print "Found xds directories:"
    for root, dirnames, filenames in os.walk(params.topdir, followlinks=True):
        if "XDS.INP" in filenames:
            print "", os.path.relpath(root, params.topdir)
            xds_dirs.append(root)

    print
    print "Start running.."

    npar = util.get_number_of_processors(
    ) if params.nproc is None else params.nproc

    fun_local = lambda x: evaluate_run(x)  #, params)
    easy_mp.pool_map(fixed_func=fun_local, args=xds_dirs, processes=npar)
def run(params):
    params.topdir = os.path.abspath(params.topdir)

    xds_dirs = []
    print "Found xds directories:"
    for root, dirnames, filenames in os.walk(params.topdir, followlinks=True):
        if "XDS.INP" in filenames:
            if "decision.log" in filenames and params.dont_overwrite:
                print "Already done - skip:", os.path.relpath(
                    root, params.topdir)
                continue
            print "", os.path.relpath(root, params.topdir)
            xds_dirs.append(root)

    print
    print "Start running.."

    import functools
    from yamtbx.dataproc.auto.command_line import run_all_xds_simple

    if params.multiproc:
        npar = util.get_number_of_processors(
        ) if params.nproc is None else params.nproc

        # Override nproc
        if len(xds_dirs) < npar: params.nproc = npar // len(xds_dirs)
        else: params.nproc = 1
        print "nproc=", params.nproc

        if params.parmethod == "sge": npar = len(xds_dirs)

        fun = run_all_xds_simple.xds_runmanager(params)
        easy_mp.parallel_map(func=fun,
                             iterable=map(lambda x: os.path.abspath(x),
                                          xds_dirs),
                             processes=npar,
                             method=params.parmethod,
                             preserve_exception_message=True)
        """
        fun_local = lambda x: xds_sequence(x, params)
        easy_mp.pool_map(fixed_func=fun_local,
                         args=xds_dirs,
                         processes=npar)
        """
    else:
        for root in xds_dirs:
            run_xds_sequence(root, params)
Exemple #4
0
def run(params):
    xds_dirs = []
    print "Found xds directories:"
    for root, dirnames, filenames in os.walk(params.topdir, followlinks=True):
        if "XDS.INP" in filenames:
            print "", os.path.relpath(root, params.topdir)
            xds_dirs.append(root)

    print
    print "Start running.."

    npar = util.get_number_of_processors() if params.nproc is None else params.nproc

    fun_local = lambda x: evaluate_run(x)#, params)
    easy_mp.pool_map(fixed_func=fun_local,
                     args=xds_dirs,
                     processes=npar)
Exemple #5
0
def run(params):
    xds_dirs = []
    print "Found xds directories:"
    for root, dirnames, filenames in os.walk(params.topdir, followlinks=True):
        if "XDS.INP" in filenames:
            if "decision.log" in filenames and params.dont_overwrite:
                print "Already done - skip:", os.path.relpath(root, params.topdir)
                continue
            print "", os.path.relpath(root, params.topdir)
            xds_dirs.append(root)

    print
    print "Start running.."

    import functools
    from yamtbx.dataproc.auto.command_line import run_all_xds_simple

    if params.multiproc:
        npar = util.get_number_of_processors() if params.nproc is None else params.nproc

        # Override nproc
        if len(xds_dirs) < npar: params.nproc  = npar // len(xds_dirs)
        else: params.nproc = 1
        print "nproc=", params.nproc

        if params.parmethod == "sge": npar = len(xds_dirs)

        fun = run_all_xds_simple.xds_runmanager(params)
        easy_mp.parallel_map(func=fun,
                             iterable=map(lambda x: os.path.abspath(x), xds_dirs),
                             processes=npar,
                             method=params.parmethod,
                             preserve_exception_message=True)

        """
        fun_local = lambda x: xds_sequence(x, params)
        easy_mp.pool_map(fixed_func=fun_local,
                         args=xds_dirs,
                         processes=npar)
        """
    else:
        for root in xds_dirs:
            xds_sequence(root, params)
Exemple #6
0
def optimal_delphi_by_nproc(xdsinp=None, osc_width=None, nframes=None, nproc=None, min_delphi=5):
    if xdsinp is not None:
        kwds = dict(get_xdsinp_keyword(xdsinp))
        osc_width = float(kwds["OSCILLATION_RANGE"])
        data_range = map(int, kwds["DATA_RANGE"].split())
        nframes = data_range[1] - data_range[0] + 1
    if None in (osc_width, nframes):
        print "osc_width and nframes not specified."
        return None

    if nproc is None:
        from yamtbx import util
        nproc = util.get_number_of_processors()

    # Need to check nframes%nproc

    delphi = nproc * osc_width

    fac = 2
    while delphi < min_delphi:
        delphi = delphi * fac
        fac += 1

    return delphi