29 lines · python
1"""2DTLTO local serial distributor.3 4This script parses the Distributed ThinLTO (DTLTO) JSON file and serially5executes the specified code generation tool on the local host to perform each 6backend compilation job. This simple functional distributor is intended to be7used for integration tests.8 9Usage:10 python local.py <json_file>11 12Arguments:13 - <json_file> : JSON file describing the DTLTO jobs.14"""15 16import subprocess17import sys18import json19from pathlib import Path20 21if __name__ == "__main__":22 # Load the DTLTO information from the input JSON file.23 with Path(sys.argv[-1]).open() as f:24 data = json.load(f)25 26 # Iterate over the jobs and execute the codegen tool.27 for job in data["jobs"]:28 subprocess.check_call(data["common"]["args"] + job["args"])29