Opened 14 years ago
#1037 new Enhancement
BOINC should prepend extra arguments, not append
Reported by: | MattArsenault | Owned by: | |
---|---|---|---|
Priority: | Undetermined | Milestone: | Undetermined |
Component: | Undetermined | Version: | 6.10.58 |
Keywords: | Cc: |
Description
The way BOINC handles added arguments do not follow POSIX conventions (http://www.lkn.ei.tum.de/arbeiten/faq/man/JAVA-tutorial/essential/attributes/_posix.html)
With POSIX compliant command line arguments, options can't follow arguments. For example, in BSD cp, you can't have options such as -r following the source and destination arguments.
BOINC appends the options to the end of the command line, making it difficult to handle an arbitrary number of trailing arguments.
For example with GPUs and multihreaded applications, BOINC appends "--device N" or "--nthreads N" to control which devices to use to the end of the command line. However this is disruptive and makes it more difficult to use standard argument parsing libraries, and to handle in general particularly when several of these kinds of features could be in use at once.
For example, the milkyway@home server sends out a varying number of parameters after the options depending on the parameters being fit in a workunit. The added arguments at the end make it more difficult to figure out what are the actual parameters.
example_program -x 2.3 --sample --args 1.0 2.0 3.0 4.0 5.0 --device 0 --nthreads 4
Here it would be easy to use proper argument parsing to read the --sample and --args flags, and the -x 2.3 option with its argument. Whatever is left after the options would ideally then just be parameters which can vary in number. Figuring out which they are, particularly in the presence of other numbers (such as the arguments to -x and --device) makes it more work to pick out which these should be than if the extra options were in the compliant place at the start of the command line in the first place.
This should be:
example_program --device 0 --nthreads 4 -x 2.3 --sample --args 1.0 2.0 3.0 4.0 5.0