From 61b22a326f6d009df81bf206fd3d96a6267581ab Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Mon, 11 Apr 2022 16:07:28 +0200 Subject: [PATCH] Remove useless python run_ola --- olaflow/processing/run_ola.py | 47 ----------------------------------- 1 file changed, 47 deletions(-) delete mode 100644 olaflow/processing/run_ola.py diff --git a/olaflow/processing/run_ola.py b/olaflow/processing/run_ola.py deleted file mode 100644 index a9338e6..0000000 --- a/olaflow/processing/run_ola.py +++ /dev/null @@ -1,47 +0,0 @@ -import argparse -import configparser -import logging -import os -import pathlib -import shutil -from subprocess import run, STDOUT - -parser = argparse.ArgumentParser(description="Run olaFlow model") -parser.add_argument("-v", "--verbose", action="count", default=0) -parser.add_argument("-c", "--config", default="config.ini") -args = parser.parse_args() - -logging.basicConfig(level=max((10, 20 - 10 * args.verbose))) -log = logging.getLogger("sws_ola") - -log.info("Starting olaFlow model") -config = configparser.ConfigParser() -config.read(args.config) - -root = pathlib.Path(config.get("olaflow", "root")) -out = pathlib.Path(config.get("olaflow", "out")) -logs = out.joinpath("log") - -shutil.copytree(root, out) -logs.mkdir() - -path = config.get("olaflow", "path") -env = {"PATH": f"{path}:{os.environ['PATH']}"} - -def ola_run(cmd): - with logs.joinpath(f"{cmd[0]}.log").open("wt") as logfile: - run( - cmd, - cwd=out, - env=env, - stdout=logfile, - stderr=STDOUT, - ).check_returncode() - -ola_run(("blockMesh",)) -ola_run(("snappyHexMesh", "-overwrite")) -shutil.copytree(root.joinpath("0.org"), root.joinpath("0")) -ola_run(("setFields",)) -ola_run(("decomposePar",)) -ola_run(("mpirun", "-np", "4", "olaFlow", "-parallel")) -ola_run(("reconstructPar",))