File: test_socket_io_mpi_line.py

package info (click to toggle)
python-ase 3.26.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 15,484 kB
  • sloc: python: 148,112; xml: 2,728; makefile: 110; javascript: 47
file content (22 lines) | stat: -rw-r--r-- 744 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# fmt: off
from ase.calculators.abinit import AbinitTemplate
from ase.calculators.espresso import EspressoTemplate
from ase.config import Config


def test_socketio_mpi_generator():
    cfg = Config()
    cfg.parser["espresso"] = {"command": "mpiexec pw.x", "pseudo_dir": "test"}
    cfg.parser["abinit"] = {"command": "mpirun abinit"}

    for temp_class in [EspressoTemplate, AbinitTemplate]:
        template = temp_class()
        profile = template.load_profile(cfg)

        socket_argv = template.socketio_argv(profile, "UNIX:TEST", None)
        profile_command = profile.get_command(
            inputfile=None,
            calc_command=socket_argv
        )

        assert profile_command == [*profile.command.split(), *socket_argv]