Skip to content

Commit

Permalink
[cherry-pick]fix fleetutil get_online_pass_interval bug3 (#60620)
Browse files Browse the repository at this point in the history
* fix fleetutil get_online_pass_interval bug3; test=develop

* fix fleetutil get_online_pass_interval bug3; test=develop

* fix fleetutil get_online_pass_interval bug3; test=develop
  • Loading branch information
danleifeng committed Jan 9, 2024
1 parent 97b65c7 commit bbc13eb
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions python/paddle/incubate/distributed/fleet/fleet_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import logging
import math
import os
import re
import sys
import time

Expand Down Expand Up @@ -1317,25 +1318,12 @@ def get_online_pass_interval(
... is_data_hourly_placed=False)
"""
assert (
"|" not in days
and ";" not in days
and "\\" not in days
and "/" not in days
and "(" not in days
and ")" not in days
and "&" not in days
), r"days should not contain [|,;,\,/,(,),&]"
pattern = r'^\d+|{[0-9]+}|{[0-9]+\.\.[0-9]+}$'
if not re.fullmatch(pattern, str(days)):
raise Exception("days format is not right")
days = os.popen("echo -n " + days).read().split(" ")
assert (
"|" not in hours
and ";" not in hours
and "\\" not in hours
and "/" not in hours
and "(" not in hours
and ")" not in hours
and "&" not in hours
), r"hours should not contain [|,;,\,/,(,),&]"
if not re.fullmatch(pattern, str(hours)):
raise Exception("hours format is not right")
hours = os.popen("echo -n " + hours).read().split(" ")
split_interval = int(split_interval)
split_per_pass = int(split_per_pass)
Expand Down

0 comments on commit bbc13eb

Please sign in to comment.