Source code for esm_utilities.pool_sync

"""
Syncs pools between two supercomputers
"""
import pathlib
import subprocess

from loguru import logger

from esm_tools import read_config_file


[docs]def get_pool_for_machine(machine): """Determines the pool directory for a particular HPC. Returns ------- Pathlib.path or None : The pool directory """ machine_config = read_config_file(f"machines/{machine}") try: return pathlib.Path(machine_config["pool_dir"]) except KeyError: logger.warning(f"No pool defined for {machine}") return None
[docs]def main(): """Main function to sync between two computers"""
if __name__ == "__main__": main()