コード例 #1
0
ファイル: mpifft.py プロジェクト: gmrigna/abipy
def build_flow(options):
    template = make_template()

    flow = abilab.AbinitFlow(workdir="bench_mpifft")
    # Instantiate the TaskManager.
    manager = abilab.TaskManager.from_user_config() if not options.manager else \
              abilab.TaskManager.from_file(options.manager)

    mpi_list = [2]
    fftalg_list = [312, 402, 401]
    ecut_list = list(range(400, 410, 10))

    for fftalg in fftalg_list:
        work = abilab.Workflow()
        for npfft in mpi_list:
            manager.set_mpi_procs(npfft)
            for inp in abilab.input_gen(template,
                                        fftalg=fftalg,
                                        npfft=npfft,
                                        ecut=ecut_list):
                manager.set_autoparal(0)
                #manager.set_mpi_procs(mpi_procs)
                work.register(inp, manager=manager)
        flow.register_work(work)

    return flow.allocate()
コード例 #2
0
def build_flow(options):
    fftalg_list = [312, 402, 401]
    ecut_list = list(range(200, 610, 100))
    ecut_list = [
        400,
    ]

    if options.mpi_list is None: mpi_list = [2, 4, 6, 8]
    if options.verbose: print("Using mpi_list:", mpi_list)

    template = make_input()
    flow = BenchmarkFlow(workdir=options.get_workdir(__file__),
                         remove=options.remove)

    omp_threads = 1
    for fftalg in fftalg_list:
        work = flowtk.Work()
        for npfft in mpi_list:
            if not options.accept_mpi_omp(npfft, omp_threads): continue
            manager = options.manager.new_with_fixed_mpi_omp(
                npfft, omp_threads)
            for inp in abilab.input_gen(template,
                                        fftalg=fftalg,
                                        npfft=npfft,
                                        ecut=ecut_list):
                work.register_scf_task(inp, manager=manager)
        flow.register_work(work)

    return flow.allocate()
コード例 #3
0
def build_flow(options):
    # Working directory (default is the name of the script with '.py' removed and "run_" replaced by "flow_")
    workdir = options.workdir
    if not options.workdir:
        workdir = os.path.basename(__file__).replace(".py", "").replace(
            "run_", "flow_")

    # Get our templates
    scf_inp, nscf_inp, scr_inp, sig_inp = make_inputs()

    ecuteps_list = np.arange(2, 8, 2)
    max_ecuteps = max(ecuteps_list)

    flow = abilab.Flow(workdir=workdir,
                       manager=options.manager,
                       remove=options.remove)

    # Band structure work to produce the WFK file
    bands = abilab.BandStructureWork(scf_inp, nscf_inp)
    flow.register_work(bands)

    # Build a work made of two SCR runs with different value of nband
    # Use max_ecuteps for the dielectric matrix (sigma tasks will
    # read a submatrix when we test the convergence wrt to ecuteps.
    scr_work = abilab.Work()

    for inp in abilab.input_gen(scr_inp, nband=[10, 15]):
        inp.set_vars(ecuteps=max_ecuteps)
        scr_work.register_scr_task(inp, deps={bands.nscf_task: "WFK"})

    flow.register_work(scr_work)

    # Do a convergence study wrt ecuteps, each work is connected to a
    # different SCR file computed with a different value of nband.

    # Build a list of sigma inputs with different ecuteps
    sigma_inputs = list(abilab.input_gen(sig_inp, ecuteps=ecuteps_list))

    for scr_task in scr_work:
        sigma_conv = abilab.SigmaConvWork(wfk_node=bands.nscf_task,
                                          scr_node=scr_task,
                                          sigma_inputs=sigma_inputs)
        flow.register_work(sigma_conv)

    return flow
コード例 #4
0
def build_flow(options):
    # Working directory (default is the name of the script with '.py' removed and "run_" replaced by "flow_")
    workdir = options.workdir
    if not options.workdir:
        workdir = os.path.basename(__file__).replace(".py", "").replace("run_","flow_") 

    # Instantiate the TaskManager.
    manager = abilab.TaskManager.from_user_config() if not options.manager else \
              abilab.TaskManager.from_file(options.manager)

    # Get our templates
    scf_inp, nscf_inp, scr_inp, sig_inp = make_inputs()
    
    ecuteps_list = np.arange(2, 8, 2)
    max_ecuteps = max(ecuteps_list)

    flow = abilab.AbinitFlow(workdir=workdir, manager=manager)

    # Band structure workflow to produce the WFK file
    bands = abilab.BandStructureWorkflow(scf_inp, nscf_inp)
    flow.register_work(bands)

    # Build a workflow made of two SCR runs with different value of nband
    # Use max_ecuteps for the dielectric matrix (sigma tasks will 
    # read a submatrix when we test the convergence wrt to ecuteps.
    scr_work = abilab.Workflow()

    for inp in abilab.input_gen(scr_inp, nband=[10, 15]):
        inp.set_variables(ecuteps=max_ecuteps)
        scr_work.register(inp, deps={bands.nscf_task: "WFK"})

    flow.register_work(scr_work)

    # Do a convergence study wrt ecuteps, each workflow is connected to a
    # different SCR file computed with a different value of nband.

    # Build a list of sigma inputs with different ecuteps
    sigma_inputs = list(abilab.input_gen(sig_inp, ecuteps=ecuteps_list))

    for scr_task in scr_work:
        sigma_conv = abilab.SigmaConvWorkflow(wfk_node=bands.nscf_task, scr_node=scr_task, sigma_inputs=sigma_inputs)
        flow.register_work(sigma_conv)

    return flow.allocate()
コード例 #5
0
ファイル: bench_pfft.py プロジェクト: GkAntonius/abipy
def build_flow():
    template = make_template()

    #policy = dict(autoparal=0, max_ncpus=mpi_ncpus)
    #manager = abilab.TaskManager.simple_mpi(mpi_ncpus=1, policy=policy)
    manager = abilab.TaskManager.from_user_config()
    flow = abilab.AbinitFlow(workdir="gs_pfft", manager=manager)

    #ncpus = [1, 2, 4, 8]
    ncpu_list = [4]
    fftalg_list = [312, 402, 401]
    ecut_list = list(range(400, 410, 10)) 

    for fftalg in fftalg_list: 
        work = abilab.Workflow()
        for npfft in ncpu_list:
            manager.set_mpi_ncpus(npfft)
            for inp in abilab.input_gen(template, fftalg=fftalg, npfft=npfft, ecut=ecut_list):
                work.register(inp, manager=manager)
        flow.register_work(work)

    return flow.allocate()
コード例 #6
0
ファイル: gs_mpifft.py プロジェクト: davidwaroquiers/abipy
def build_flow(options):
    fftalg_list = [312, 402, 401]
    ecut_list = list(range(200, 610, 100)) 
    ecut_list = [400,]

    if options.mpi_list is None: mpi_list = [2, 4, 6, 8]
    print("Using mpi_list:", mpi_list)

    template = make_input()
    flow = BenchmarkFlow(workdir=options.get_workdir(__file__), remove=options.remove)

    omp_threads = 1
    for fftalg in fftalg_list: 
        work = abilab.Work()
        for npfft in mpi_list:
            if not options.accept_mpi_omp(npfft, omp_threads): continue
            manager = options.manager.new_with_fixed_mpi_omp(npfft, omp_threads)
            for inp in abilab.input_gen(template, fftalg=fftalg, npfft=npfft, ecut=ecut_list):
                work.register_scf_task(inp, manager=manager)
        flow.register_work(work)

    return flow.allocate()
コード例 #7
0
ファイル: mpifft.py プロジェクト: akakcolin/abipy
def build_flow(options):
    template = make_template()

    flow = abilab.AbinitFlow(workdir="bench_mpifft")
    # Instantiate the TaskManager.
    manager = abilab.TaskManager.from_user_config() if not options.manager else \
              abilab.TaskManager.from_file(options.manager)

    mpi_list = [2]
    fftalg_list = [312, 402, 401]
    ecut_list = list(range(400, 410, 10)) 

    for fftalg in fftalg_list: 
        work = abilab.Workflow()
        for npfft in mpi_list:
            manager.set_mpi_procs(npfft)
            for inp in abilab.input_gen(template, fftalg=fftalg, npfft=npfft, ecut=ecut_list):
                manager.set_autoparal(0)
                #manager.set_mpi_procs(mpi_procs)
                work.register(inp, manager=manager)
        flow.register_work(work)

    return flow.allocate()