def build_flow(options): gs_inp, ph_inp = make_inputs() flow = BenchmarkFlow(workdir=options.get_workdir(__file__), remove=options.remove) gs_work = abilab.Work() gs_work.register_scf_task(gs_inp) flow.register_work(gs_work) flow.exclude_from_benchmark(gs_work) # Get the list of possible parallel configurations from abinit autoparal. max_ncpus, min_eff = options.max_ncpus, options.min_eff print("Getting all autoparal confs up to max_ncpus: ", max_ncpus, " with efficiency >= ", min_eff) pconfs = ph_inp.abiget_autoparal_pconfs(max_ncpus, autoparal=1) print(pconfs) work = abilab.Work() for conf, omp_threads in product(pconfs, options.omp_list): if not options.accept_conf(conf, omp_threads): continue manager = options.manager.new_with_fixed_mpi_omp( conf.mpi_procs, omp_threads) inp = ph_inp.new_with_vars(conf.vars) work.register_phonon_task(inp, manager=manager, deps={gs_work[0]: "WFK"}) print("Found %d configurations" % len(work)) flow.register_work(work) return flow.allocate()
def build_flow(options): gs_inp, nscf_inp, ddk_inp = make_inputs() flow = BenchmarkFlow(workdir=options.get_workdir(__file__), remove=options.remove) ebands_work = flowtk.BandStructureWork(gs_inp, nscf_inp) flow.register_work(ebands_work) flow.exclude_from_benchmark(ebands_work) # Get the list of possible parallel configurations from abinit autoparal. max_ncpus, min_eff = options.max_ncpus, options.min_eff print("Getting all autoparal confs up to max_ncpus: ",max_ncpus," with efficiency >= ",min_eff) pconfs = ddk_inp.abiget_autoparal_pconfs(max_ncpus, autoparal=1) if options.verbose: print(pconfs) work = flowtk.Work() for conf, omp_threads in product(pconfs, options.omp_list): mpi_procs = conf.mpi_ncpus if not options.accept_conf(conf, omp_threads): continue manager = options.manager.new_with_fixed_mpi_omp(mpi_procs, omp_threads) inp = ddk_inp.new_with_vars(conf.vars) work.register_ddk_task(inp, manager=manager, deps={ebands_work[1]: "WFK"}) print("Found %d configurations" % len(work)) flow.register_work(work) return flow.allocate()
def build_flow(options): """ Build an `AbinitWorkflow` used for benchmarking ABINIT. """ gs_inp, bse_inp = make_inputs(paw=options.paw) flow = BenchmarkFlow(workdir=options.get_workdir(__file__), remove=options.remove) gs_work = flowtk.Work() gs_work.register_scf_task(gs_inp) flow.register_work(gs_work) flow.exclude_from_benchmark(gs_work) mpi_list = options.mpi_list if options.mpi_list is None: nkpt = len(gs_inp.abiget_ibz().points) ntrans = (2 * 2 * nkpt)**2 mpi_list = [p for p in range(1, 1 + ntrans) if ntrans % p == 0] if options.verbose: print("Using mpi_list:", mpi_list) bse_work = flowtk.Work() for mpi_procs, omp_threads in product(mpi_list, options.omp_list): if not options.accept_mpi_omp(mpi_procs, omp_threads): continue manager = options.manager.new_with_fixed_mpi_omp( mpi_procs, omp_threads) bse_work.register_bse_task(bse_inp, manager=manager, deps={gs_work[0]: "WFK"}) flow.register_work(bse_work) return flow.allocate()
def build_flow(options): """ Build an `AbinitWorkflow` used for benchmarking ABINIT. """ gs_inp, nscf_inp, scr_inp = make_inputs(paw=options.paw) flow = BenchmarkFlow(workdir=options.get_workdir(__file__), remove=options.remove) bands = flowtk.BandStructureWork(gs_inp, nscf_inp) flow.register_work(bands) flow.exclude_from_benchmark(bands) #for nband in [200, 400, 600]: for nband in [600]: scr_work = flowtk.Work() inp = scr_inp.new_with_vars(nband=nband) mpi_list = options.mpi_list if mpi_list is None: # Cannot call autoparal here because we need a WFK file. print("Using hard coded values for mpi_list") mpi_list = [np for np in range(1, nband+1) if abs((nband - 4) % np) < 1] if options.verbose: print("Using nband %d and mpi_list: %s" % (nband, mpi_list)) for mpi_procs, omp_threads in product(mpi_list, options.omp_list): if not options.accept_mpi_omp(mpi_procs, omp_threads): continue manager = options.manager.new_with_fixed_mpi_omp(mpi_procs, omp_threads) scr_work.register_scr_task(inp, manager=manager, deps={bands.nscf_task: "WFK"}) flow.register_work(scr_work) return flow.allocate()
def build_flow(options): """ Build an `AbinitWorkflow` used for benchmarking ABINIT. """ gs_inp, bse_inp = make_inputs(paw=options.paw) flow = BenchmarkFlow(workdir=options.get_workdir(__file__), remove=options.remove) gs_work = flowtk.Work() gs_work.register_scf_task(gs_inp) flow.register_work(gs_work) flow.exclude_from_benchmark(gs_work) mpi_list = options.mpi_list if options.mpi_list is None: nkpt = len(gs_inp.abiget_ibz().points) ntrans = (2*2*nkpt)**2 mpi_list = [p for p in range(1, 1 + ntrans) if ntrans % p == 0] if options.verbose: print("Using mpi_list:", mpi_list) bse_work = flowtk.Work() for mpi_procs, omp_threads in product(mpi_list, options.omp_list): if not options.accept_mpi_omp(mpi_procs, omp_threads): continue manager = options.manager.new_with_fixed_mpi_omp(mpi_procs, omp_threads) bse_work.register_bse_task(bse_inp, manager=manager, deps={gs_work[0]: "WFK"}) flow.register_work(bse_work) return flow.allocate()
def build_flow(options): gs_inp, ph_inp = make_inputs() flow = BenchmarkFlow(workdir=options.get_workdir(__file__), remove=options.remove) gs_work = flowtk.Work() gs_work.register_scf_task(gs_inp) flow.register_work(gs_work) flow.exclude_from_benchmark(gs_work) # Get the list of possible parallel configurations from abinit autoparal. max_ncpus, min_eff = options.max_ncpus, options.min_eff print("Getting all autoparal confs up to max_ncpus:", max_ncpus, "with efficiency >=", min_eff) pconfs = ph_inp.abiget_autoparal_pconfs(max_ncpus, autoparal=1) if options.verbose: print(pconfs) omp_threads = 1 work = flowtk.Work() for conf in pconfs: mpi_procs = conf.mpi_ncpus if not options.accept_mpi_omp(mpi_procs, omp_threads): continue if min_eff is not None and conf.efficiency < min_eff: continue if options.verbose: print(conf) manager = options.manager.new_with_fixed_mpi_omp(mpi_procs, omp_threads) inp = ph_inp.new_with_vars(conf.vars) work.register_phonon_task(inp, manager=manager, deps={gs_work[0]: "WFK"}) print("Found %d configurations" % len(work)) flow.register_work(work) return flow.allocate()
def make_base_flow(options): multi = abilab.MultiDataset(structure=data.structure_from_ucell("GaAs"), pseudos=data.pseudos("31ga.pspnc", "33as.pspnc"), ndtset=5) # Global variables kmesh = dict(ngkpt=[4, 4, 4], nshiftk=4, shiftk=[[0.5, 0.5, 0.5], [0.5, 0.0, 0.0], [0.0, 0.5, 0.0], [0.0, 0.0, 0.5]]) paral_kgb = 1 global_vars = dict(ecut=2, paral_kgb=paral_kgb) global_vars.update(kmesh) multi.set_vars(global_vars) # Dataset 1 (GS run) multi[0].set_vars( tolvrs=1e-6, nband=4, ) # NSCF run with large number of bands, and points in the the full BZ multi[1].set_vars( iscf=-2, nband=20, nstep=25, kptopt=1, tolwfr=1.e-9, #kptopt=3, ) # Fourth dataset: ddk response function along axis 1 # Fifth dataset: ddk response function along axis 2 # Sixth dataset: ddk response function along axis 3 for dir in range(3): rfdir = 3 * [0] rfdir[dir] = 1 multi[2 + dir].set_vars( iscf=-3, nband=20, nstep=1, nline=0, prtwf=3, kptopt=3, nqpt=1, qpt=[0.0, 0.0, 0.0], rfdir=rfdir, rfelfd=2, tolwfr=1.e-9, ) scf_inp, nscf_inp, ddk1, ddk2, ddk3 = multi.split_datasets() # Initialize the flow. flow = BenchmarkFlow(workdir=options.get_workdir(__file__), remove=options.manager) bands_work = flowtk.BandStructureWork(scf_inp, nscf_inp) flow.register_work(bands_work) flow.exclude_from_benchmark(bands_work) ddk_work = flowtk.Work() for inp in [ddk1, ddk2, ddk3]: ddk_work.register_ddk_task(inp, deps={bands_work.nscf_task: "WFK"}) flow.register_work(ddk_work) flow.exclude_from_benchmark(ddk_work) return flow
def make_base_flow(options): multi = abilab.MultiDataset(structure=data.structure_from_ucell("GaAs"), pseudos=data.pseudos("31ga.pspnc", "33as.pspnc"), ndtset=5) # Global variables kmesh = dict(ngkpt=[4, 4, 4], nshiftk=4, shiftk=[[0.5, 0.5, 0.5], [0.5, 0.0, 0.0], [0.0, 0.5, 0.0], [0.0, 0.0, 0.5]] ) paral_kgb = 1 global_vars = dict(ecut=2, paral_kgb=paral_kgb) global_vars.update(kmesh) multi.set_vars(global_vars) # Dataset 1 (GS run) multi[0].set_vars( tolvrs=1e-6, nband=4, ) # NSCF run with large number of bands, and points in the the full BZ multi[1].set_vars( iscf=-2, nband=20, nstep=25, kptopt=1, tolwfr=1.e-9, #kptopt=3, ) # Fourth dataset: ddk response function along axis 1 # Fifth dataset: ddk response function along axis 2 # Sixth dataset: ddk response function along axis 3 for dir in range(3): rfdir = 3 * [0] rfdir[dir] = 1 multi[2+dir].set_vars( iscf=-3, nband=20, nstep=1, nline=0, prtwf=3, kptopt=3, nqpt=1, qpt=[0.0, 0.0, 0.0], rfdir=rfdir, rfelfd=2, tolwfr=1.e-9, ) scf_inp, nscf_inp, ddk1, ddk2, ddk3 = multi.split_datasets() # Initialize the flow. flow = BenchmarkFlow(workdir=options.get_workdir(__file__), remove=options.manager) bands_work = flowtk.BandStructureWork(scf_inp, nscf_inp) flow.register_work(bands_work) flow.exclude_from_benchmark(bands_work) ddk_work = flowtk.Work() for inp in [ddk1, ddk2, ddk3]: ddk_work.register_ddk_task(inp, deps={bands_work.nscf_task: "WFK"}) flow.register_work(ddk_work) flow.exclude_from_benchmark(ddk_work) return flow
def make_flow_ephinp(options): # Preparatory run for E-PH calculations. # The sequence of datasets makes the ground states and # all of the independent perturbations of the single Al atom # for the irreducible qpoints in a 4x4x4 grid. # Note that the q-point grid must be a sub-grid of the k-point grid (here 8x8x8) pseudos = abidata.pseudos("Al.oncvpsp") if not options.paw else \ abidata.pseudos("Al.GGA_PBE-JTH-paw.xml") structure = abilab.Structure.from_abivars( acell=3*[7.5], rprim=[0.0, 0.5, 0.5, 0.5, 0.0, 0.5, 0.5, 0.5, 0.0], typat=1, xred=[0.0, 0.0, 0.0], ntypat=1, znucl=13, ) gs_inp = abilab.AbinitInput(structure, pseudos) gs_inp.set_vars( nsppol=1, prtpot=1, istwfk="*1", ecut=12.0, nband=5, occopt=7, # include metallic occupation function with a small smearing tsmear=0.04, tolvrs=1e-7, timopt=-1, ) # The kpoint grid is minimalistic to keep the calculation manageable. gs_inp.set_kmesh( ngkpt=[8, 8, 8], kptopt=3, shiftk=[0.0, 0.0, 0.0], ) # Phonon calculation with 4x4x4 qpoints = np.reshape([ 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 2.50000000e-01, 0.00000000e+00, 0.00000000e+00, 5.00000000e-01, 0.00000000e+00, 0.00000000e+00, 2.50000000e-01, 2.50000000e-01, 0.00000000e+00, 5.00000000e-01, 2.50000000e-01, 0.00000000e+00, -2.50000000e-01, 2.50000000e-01, 0.00000000e+00, 5.00000000e-01, 5.00000000e-01, 0.00000000e+00, -2.50000000e-01, 5.00000000e-01, 2.50000000e-01, ], (-1,3)) flow = BenchmarkFlow(workdir=options.get_workdir(__file__), remove=options.remove) work0 = flow.register_task(gs_inp, task_class=abilab.ScfTask) flow.exclude_from_benchmark(work0) ph_work = abilab.PhononWork.from_scf_task(work0[0], qpoints) flow.register_work(ph_work) flow.exclude_from_benchmark(ph_work) # Build input file for E-PH run. eph_inp = gs_inp.new_with_vars( optdriver=7, #ddb_ngqpt=[1, 1, 1], # q-mesh used to produce the DDB file (must be consisten with DDB data) ddb_ngqpt=[4, 4, 4], # q-mesh used to produce the DDB file (must be consisten with DDB data) eph_intmeth=2, # Tetra eph_fsewin="0.8 eV", # Energy window around Ef eph_mustar=0.12, # mustar parameter # q-path for phonons and phonon linewidths. ph_ndivsm=20, ph_nqpath=3, ph_qpath= [ 0 , 0 , 0, 0.5, 0 , 0, 0.5, 0.5, 0,], # phonon DOS obtained via Fourier interpolation ph_intmeth=2, # Tetra for phonon DOS and A2F ph_smear="0.001 eV", ph_wstep="0.0001 eV", ph_ngqpt=[16, 16, 16], # q-mesh for Fourier interpolatation of IFC and a2F(w) ph_nqshift=1, ph_qshift=[0, 0, 0], ) return flow, eph_inp