-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathsubmit_locally.py
More file actions
77 lines (62 loc) · 1.89 KB
/
Copy pathsubmit_locally.py
File metadata and controls
77 lines (62 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# -*- coding: utf-8 -*-
from __future__ import print_function
"""
This example uses the marconi cluster
to submit a force and energy calculation of a subset of 10 configurations
from the simple ensemble
"""
import ase
import cellconstructor as CC
import cellconstructor.Phonons
from cellconstructor.calculators import Espresso
import sscha
import sscha.Ensemble
import sscha.Cluster
# Load the dynamical matrix
dyn = CC.Phonons.Phonons("dyn")
ens = sscha.Ensemble.Ensemble(dyn, 0)
# Generate a random ensemble
ens.generate(10)
# Prepare the espresso calculator
# NOTE: these files should be located in the cluster $HOME/espresso/pseudo directory
pseudo = {"H": "H.upf",
"O": "O.upf"}
input_data = {
"control" : {
"disk_io" : "none",
"tprnfor" : True,
"tstress" : True,
},
"system" : {
"ecutwfc" : 45,
"input_dft" : "pbe",
"ecutrho" : 45*8,
"occupations" : "fixed"},
"electrons" : {
"conv_thr" : 1e-8
}
}
KPTS = (3,3,2) # K points
calc = Espresso(input_data = input_data, pseudopotentials = pseudo, kpts = KPTS)
# Prepare the cluster
# marconi (setted from .ssh_config) => pippo@login.marconi.cineca.it
# No pwd, login with private key
cluster = sscha.LocalCluster.LocalCluster("localhost",
binary="pw.x -npool NPOOL -i PREFIX.pwi > PREFIX.pwo")
# Setup the working directory
cluster.workdir = "$SCRATCH/sscha_prova"
cluster.n_nodes = 1
cluster.n_cpu = 32
cluster.account_name = "IscrC_TDSTO"
cluster.n_pool = 4
cluster.partition_name = "g100_usr_prod"
cluster.load_modules = """
module load profile/chem-phys
module load autoload qe
export OMP_NUM_THREADS=1
"""
cluster.setup_workdir()
print("Sending the ensemble for the calculation.")
cluster.compute_ensemble(ens, calc)
ens.save_bin(".")
print("Ensemble saved.")