Skip to content

Commit 257d57f

Browse files
Merge branch 'master' into asr_1d
2 parents 2bb5323 + b48055c commit 257d57f

18 files changed

Lines changed: 1008 additions & 178 deletions

.github/workflows/build.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Build and Test
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v3
11+
12+
- name: Setup Python
13+
uses: actions/setup-python@v4
14+
with:
15+
python-version: 3.12
16+
17+
- name: Install system dependencies
18+
run: |
19+
sudo apt-get update
20+
sudo apt-get install -y libblas-dev liblapack-dev gfortran pkg-config
21+
22+
- name: Install Python dependencies
23+
run: |
24+
pip install meson ninja meson-python numpy scipy ase pytest
25+
26+
- name: Setup build directory
27+
run: meson setup builddir
28+
29+
- name: Compile
30+
run: meson compile -C builddir
31+
32+
33+
# - name: Install package
34+
# run: meson install -C builddir
35+
36+
# - name: Run tests
37+
# run: meson test -C builddir

.github/workflows/python-testsuite.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,13 @@ jobs:
5151
run: |
5252
sudo apt-get update
5353
sudo apt-get install git gfortran libblas-dev liblapack-dev
54-
git clone https://github.com/mesonepigreco/CellConstructor.git
54+
git clone https://github.com/SSCHAcode/CellConstructor.git
55+
pip install meson meson-python ninja
5556
cd CellConstructor
56-
python setup.py install --user
57+
pip install --no-build-isolation .
5758
cd ..
5859
59-
python setup.py install --user
60+
pip install --no-build-isolation .
6061
6162
# Install julia requirements
6263
python -c 'import julia; julia.install()'
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# -*- coding: utf-8 -*-
2+
from __future__ import print_function
3+
"""
4+
This example uses the marconi cluster
5+
to submit a force and energy calculation of a subset of 10 configurations
6+
from the simple ensemble
7+
"""
8+
9+
import ase
10+
11+
import cellconstructor as CC
12+
import cellconstructor.Phonons
13+
14+
from cellconstructor.calculators import Espresso
15+
16+
import sscha
17+
import sscha.Ensemble
18+
import sscha.Cluster
19+
20+
# Load the dynamical matrix
21+
dyn = CC.Phonons.Phonons("dyn")
22+
ens = sscha.Ensemble.Ensemble(dyn, 0)
23+
24+
# Generate a random ensemble
25+
ens.generate(10)
26+
27+
# Prepare the espresso calculator
28+
# NOTE: these files should be located in the cluster $HOME/espresso/pseudo directory
29+
pseudo = {"H": "H.upf",
30+
"O": "O.upf"}
31+
32+
input_data = {
33+
"control" : {
34+
"disk_io" : "none",
35+
"tprnfor" : True,
36+
"tstress" : True,
37+
},
38+
"system" : {
39+
"ecutwfc" : 45,
40+
"input_dft" : "pbe",
41+
"ecutrho" : 45*8,
42+
"occupations" : "fixed"},
43+
"electrons" : {
44+
"conv_thr" : 1e-8
45+
}
46+
}
47+
KPTS = (3,3,2) # K points
48+
49+
calc = Espresso(input_data = input_data, pseudopotentials = pseudo, kpts = KPTS)
50+
51+
# Prepare the cluster
52+
# marconi (setted from .ssh_config) => pippo@login.marconi.cineca.it
53+
# No pwd, login with private key
54+
cluster = sscha.LocalCluster.LocalCluster("localhost",
55+
binary="pw.x -npool NPOOL -i PREFIX.pwi > PREFIX.pwo")
56+
57+
# Setup the working directory
58+
cluster.workdir = "$SCRATCH/sscha_prova"
59+
cluster.n_nodes = 1
60+
cluster.n_cpu = 32
61+
cluster.account_name = "IscrC_TDSTO"
62+
cluster.n_pool = 4
63+
cluster.partition_name = "g100_usr_prod"
64+
cluster.load_modules = """
65+
module load profile/chem-phys
66+
module load autoload qe
67+
68+
export OMP_NUM_THREADS=1
69+
"""
70+
71+
cluster.setup_workdir()
72+
73+
print("Sending the ensemble for the calculation.")
74+
cluster.compute_ensemble(ens, calc)
75+
76+
ens.save_bin(".")
77+
print("Ensemble saved.")

0 commit comments

Comments
 (0)