X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/37ed1e2ac9e7416ee058409b4541138dd7bb81dc..fba44e13f2b2b7fb3f99030e5a59cd1eb721d558:/examples/python/comm-waitallfor/comm-waitallfor.py diff --git a/examples/python/comm-waitallfor/comm-waitallfor.py b/examples/python/comm-waitallfor/comm-waitallfor.py index 207b3272b1..0f387951d2 100644 --- a/examples/python/comm-waitallfor/comm-waitallfor.py +++ b/examples/python/comm-waitallfor/comm-waitallfor.py @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2022. The SimGrid Team. All rights reserved. +# Copyright (c) 2010-2023. The SimGrid Team. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the license (GNU LGPL) which comes with this package. @@ -14,9 +14,9 @@ This example implements the following scenario: from argparse import ArgumentParser from dataclasses import dataclass +from typing import List from uuid import uuid4 import sys -import typing from simgrid import Actor, Comm, Engine, Host, Mailbox, PyGetAsync, this_actor @@ -25,7 +25,7 @@ SIMULATED_JOB_SIZE_BYTES = 1024 SIMULATED_RESULT_SIZE_BYTES = 1024 * 1024 -def parse_requests(requests_str: str) -> typing.List[float]: +def parse_requests(requests_str: str) -> List[float]: return [float(item.strip()) for item in requests_str.split(",")] @@ -34,6 +34,7 @@ def create_parser() -> ArgumentParser: parser.add_argument( '--platform', type=str, + required=True, help='path to the platform description' ) parser.add_argument( @@ -89,7 +90,7 @@ class AsyncJobResult: return "complete" if self.complete else "pending" -def client(client_id: str, jobs: typing.List[float], wait_timeout: float): +def client(client_id: str, jobs: List[float], wait_timeout: float): worker_mailbox: Mailbox = Mailbox.by_name("worker") this_actor.info(f"{client_id} started") async_job_results: list[AsyncJobResult] = []