Commit 4c84f9bd authored by Maiterth, Matthias's avatar Maiterth, Matthias
Browse files

Updated Multi-part-sim and updated minor nuances.

- Set default replay of npz to --fastfoward 0 if argumet is not given
- fixed multipart sim to use fastforward and time to get the correct
  timestep_start timestep_end as needed in run_stepwise
- Updated default policy to replay in default schedulers
- Added System name indicator in System Panel (e.g. for replay with other systems.)
- Re-enabled the heterogeneous system test in the smoke tests.
parent 012af1fa
Loading
Loading
Loading
Loading
+0 −13
Original line number Diff line number Diff line
@@ -58,16 +58,3 @@ parser.add_argument('--accounts-json', type=str, help='Json of account stats gen
args = parser.parse_args()
args_dict = vars(args)
print(args_dict)

# Determine the default policy based on --replay
policy_specified = args.policy is not None  # was policy set explicitly

if not policy_specified:
    if args.replay:  # if --replay is provided, default to "replay"
        args.policy = "replay"
        print(f"No policy specified, using default for replay: {args.policy}")
    else:  # otherwise, default to "fcfs"
        args.policy = policies[0]
        print(f"No policy specified, using default: {args.policy}")

print("Final policy:", args.policy)
+5 −5
Original line number Diff line number Diff line
@@ -93,15 +93,15 @@ if args.replay:
    if args.replay[0].endswith(".npz"):  # Replay .npz file
        print(f"Loading {args.replay[0]}...")
        jobs, timestep_start_from_file, timestep_end_from_file, args_from_file = td.load_snapshot(args.replay[0])
        print("Intended to run with:" +\
        if args_from_file.fastforward is None:
            args_from_file.fastforward = 0
        print("File was generated with:" +\
              f"\n--system {args_from_file.system} " +\
              f"-ff {args_from_file.fastforward} " +\
              f"-t {args_from_file.time}\n" +\
              f"All Args:\n{args_from_file}"
              )
        if args.time is None:
            print("Set --time (necessary) and possibly --fasforward, to run .npz replay successfully!")
            exit()
        timestep_end = timestep_end_from_file

        if args.scale:
            for job in tqdm(jobs, desc=f"Scaling jobs to {args.scale} nodes"):
+8 −1
Original line number Diff line number Diff line
@@ -79,13 +79,20 @@ for i, config in enumerate(configs):
    layout_managers[config['system_name']] = LayoutManager(args.layout, engine=sc, debug=args.debug, **config)

# Set simulation timesteps
if args.fastforward:
    fastfoward = convert_to_seconds(args.fastforward)
else:
    fastforward = 0
if args.time:
    timesteps = convert_to_seconds(args.time)
else:
    timesteps = 88200  # Default to 24 hours

timestep_start = fastforward
timestep_end = timestep_start + timesteps

# Create generators for each layout manager
generators = {name: lm.run_stepwise(jobs_by_partition[name], timesteps=timesteps)
generators = {name: lm.run_stepwise(jobs_by_partition[name], timestep_start=timestep_start, timestep_end=timestep_end)
              for name, lm in layout_managers.items()}

# Step through all generators in lockstep
+5 −3
Original line number Diff line number Diff line
@@ -59,8 +59,8 @@ class Engine:

        # Get scheduler type from command-line args or default
        scheduler_type = kwargs.get('scheduler', 'default')
        policy_type = kwargs.get('policy', None)
        backfill_type = kwargs.get('backfill', None)
        policy_type = kwargs.get('policy')
        backfill_type = kwargs.get('backfill')

        self.scheduler = load_scheduler(scheduler_type)(
            config=self.config,
@@ -68,7 +68,9 @@ class Engine:
            bfpolicy=kwargs.get('backfill'),
            resource_manager=self.resource_manager
        )
        print(f"Using scheduler: {scheduler_type}, with policy {policy_type} and backfill {backfill_type}")
        print(f"Using scheduler: {str(self.scheduler.__class__).split('.')[2]}"\
              f", with policy {self.scheduler.policy.value} "\
              f"and backfill {self.scheduler.bfpolicy.value}")


    def add_running_jobs_to_queue(self, jobs_to_submit: List):
+2 −0
Original line number Diff line number Diff line
@@ -12,6 +12,8 @@ class Scheduler:

    def __init__(self, config, policy, bfpolicy=None, resource_manager=None):
        self.config = config
        if policy is None:  # policy is passed as policy=None, therefore default is not choosen
            policy = "replay"
        self.policy = PolicyType(policy)
        self.bfpolicy = BackfillType(bfpolicy)
        if resource_manager is None:
Loading