Open chimengqiaoyu opened 6 months ago
When you create your ArgumentParser, you should do
argparse.ArgumentParser(parents=opentuner.argparsers())
parents=opentuner.argparsers()
will add all the needed OpenTuner args, including default values.
If you don't want the opentuner args on your own program's command line, you can create a separate ArgumentParser
instance for opentuner and use the args=[...]
option to parse_args
.
For more see https://docs.python.org/3/library/argparse.html#argparse.ArgumentParser.parse_args
I have resolved it, thank you very much!!!
Hello,
I am currently using OpenTuner to optimize some configurations and encountered an issue related to command-line arguments. I'm trying to ensure that I have set up all the necessary command-line parameters that OpenTuner's main method requires, but I faced a
TypeError
related to missing command-line arguments, specificallyparallel_compile
.While attempting to run my tuning script, I encountered the following error:
Traceback (most recent call last): File "tune.py", line 37, in
MpiTuner.main(args)
File "/path/to/opentuner/measurement/interface.py", line 300, in main
return TuningRunMain(cls(args, *pargs, **kwargs), args).main()
File "/path/to/opentuner/measurement/interface.py", line 63, in init
self.parallel_compile = args.parallel_compile
AttributeError: 'Namespace' object has no attribute 'parallel_compile'