Ejemplo n.º 1
0
    def test_modak_egi_xthi(self):
        print("Test MODAK")
        m = MODAK()
        dsl_file = SCRIPT_DIR / "input" / "mpi_test_egi.json"
        model = JobModel.parse_raw(dsl_file.read_text())
        job_link = m.optimise(model.job)

        self.assertEqual(
            _tsreplaced(SCRIPT_DIR.joinpath("input/mpi_test_egi.sh").read_text()),
            _tsreplaced(pathlib.Path(job_link.jobscript).read_text()),
        )
Ejemplo n.º 2
0
    def test_modak_ai(self):
        print("Test MODAK")
        m = MODAK()
        dsl_file = SCRIPT_DIR / "input" / "tf_snow.json"
        model = JobModel.parse_raw(dsl_file.read_text())
        job_link = m.optimise(model.job)

        self.assertEqual(
            _tsreplaced(
                SCRIPT_DIR.joinpath("input/skyline-extraction-training.sh").read_text()
            ),
            _tsreplaced(pathlib.Path(job_link.jobscript).read_text()),
        )
Ejemplo n.º 3
0
async def optimise(model: JobModel):
    m = MODAK()
    model.job.job_script, model.job.build_script = m.optimise(model.job)
    return model
Ejemplo n.º 4
0
#!/usr/bin/env python3

import pathlib
import sys

sys.path.append(".")

from MODAK.MODAK import MODAK  # noqa:E402
from MODAK.model import JobModel  # noqa:E402

m = MODAK()
dsl_file = pathlib.Path("test/input/mpi_test.json")
dsl_content = dsl_file.read_text()
model = JobModel.parse_raw(dsl_content)
link = m.optimise(model.job)

print(link)