-
Notifications
You must be signed in to change notification settings - Fork 63
Description
Problem
Lunching jacobi.py using legate with the flag --num does not change the size of the matrix A in the Jacobi example.
Steps to reproduce
- Install both
legate.coreandlegate.numpy - Go to the example folder of
legate.numpy - Run the
jacobi.pycode withlegatewithlegate --cpus 1 --omps 1 --ompthreads 1 ./jacobi.py --num 1234
Expected and actual results
The log message should say "Generating 1234x1234 system...", However, the actual message says "Generating 100x100 system..."
Diagnosis
When running the example code of the Jacobi solver, the jacobi.py allows a command-line argument called --num. However, if launching jacobi.py using legate, legate steals the value of --num, saves it to numamem, and never actually passes it to jacobi.py.
This is because, by default, an ArgumentParser allows implicit abbreviations for long arguments. When executing legate <some flags> ./jacobi.py --num 1234, the argument parser of legate.py (line 549-807 here) sees --num as a abbreviation of the flag --numamem.
Solution
A quick solution is to disable the implicit abbreviation by changing line 549 in legate.py from
parser = argparse.ArgumentParser(description="Legate Driver.")to
parser = argparse.ArgumentParser(description="Legate Driver.", allow_abbrev=False)But I believe eventually there should be a better solution to separate the arguments of legate.py from a target application. Otherwise, if a target application has some overlapped arguments with legate.py (i.e., the same argument names), this conflict can not be resolved by simply disabling allow_abbrev.