diff --git a/deepmd/pd/entrypoints/main.py b/deepmd/pd/entrypoints/main.py index e5f06a5487..be6643d8c3 100644 --- a/deepmd/pd/entrypoints/main.py +++ b/deepmd/pd/entrypoints/main.py @@ -46,6 +46,7 @@ ) from deepmd.pd.utils.env import ( DEVICE, + LOCAL_RANK, ) from deepmd.pd.utils.finetune import ( get_finetune_rules, @@ -232,7 +233,8 @@ def train( output: str = "out.json", ) -> None: log.info("Configuration path: %s", input_file) - SummaryPrinter()() + if LOCAL_RANK == 0: + SummaryPrinter()() with open(input_file) as fin: config = json.load(fin) # ensure suffix, as in the command line help, we say "path prefix of checkpoint files" diff --git a/deepmd/pt/entrypoints/main.py b/deepmd/pt/entrypoints/main.py index 576c5a1811..db7180e7c1 100644 --- a/deepmd/pt/entrypoints/main.py +++ b/deepmd/pt/entrypoints/main.py @@ -61,6 +61,7 @@ ) from deepmd.pt.utils.env import ( DEVICE, + LOCAL_RANK, ) from deepmd.pt.utils.finetune import ( get_finetune_rules, @@ -254,7 +255,8 @@ def train( output: str = "out.json", ) -> None: log.info("Configuration path: %s", input_file) - SummaryPrinter()() + if LOCAL_RANK == 0: + SummaryPrinter()() with open(input_file) as fin: config = json.load(fin) # ensure suffix, as in the command line help, we say "path prefix of checkpoint files"