Coverage for gpaw/test/big/test_systems/agts.py: 0%

19 statements  

« prev     ^ index     » next       coverage.py v7.7.1, created at 2025-07-08 00:17 +0000

1from myqueue.workflow import run 

2from gpaw.test.big.test_systems.create import create_test_systems 

3from gpaw import GPAW, PW, MixerFull 

4from ase.optimize import BFGS 

5 

6 

7CORES = [1, 4, 8, 16, 14, 40, 48, 56, 72, 96, 120, 168] 

8 

9 

10def workflow(): 

11 for name, (atoms, params) in create_test_systems().items(): 

12 if name == 'biimtf': 

13 continue 

14 cores = len(atoms)**2 / 10 

15 # Find best match: 

16 _, cores = min((abs(cores - c), c) for c in CORES) 

17 run(function=calculate, args=[name, atoms, params], 

18 name=name, 

19 cores=cores, 

20 tmax='1d') 

21 # run(function=relax, args=[name, atoms, params], 

22 # name=name + '-R', 

23 # cores=cores, 

24 # tmax='1d') 

25 

26 

27def calculate(name, atoms, params): 

28 """Do one-shot energy calculation.""" 

29 atoms.calc = GPAW(**params, 

30 mixer=MixerFull(), 

31 txt=name + '.txt') 

32 atoms.get_potential_energy() 

33 

34 

35def relax(name, atoms, params): 

36 """Relax with PW-mode.""" 

37 kwargs = {k: v for k, v in params.items() if k in ['charge', 'spinpol']} 

38 atoms.calc = GPAW( 

39 xc='PBE', 

40 mode=PW(600), 

41 kpts=dict(density=4.0), 

42 mixer=MixerFull(), 

43 txt=name + '-R.txt', 

44 **kwargs) 

45 BFGS(atoms, 

46 logfile=name + '-R.log', 

47 trajectory=name + '-R.traj').run(fmax=0.02)