SystemsGenetics / KINC

Knowledge Independent Network Construction
MIT License
11 stars 4 forks source link

Seemingly random "Maximum" values #152

Open JohnHadish opened 4 years ago

JohnHadish commented 4 years ago

When using the KINC help documentation, "maximum" values for --bsize, --gsize, and --lsize are set to 2147483647:

--bsize <value>
Value Type: Integer
Minimum Value: 0
Maximum Value: 2147483647
Default Value: 0
Number of pairs to process in each work block.

--gsize <value>
Value Type: Integer
Minimum Value: 1
Maximum Value: 2147483647
Default Value: 4096
The global work size for each OpenCL worker.

--lsize <value>
Value Type: Integer
Minimum Value: 1
Maximum Value: 2147483647
Default Value: 32
The local work size for each OpenCL worker.

I am sure there is an interesting reason for this number, but to me, it makes it look like the KINC documentation is glitching. I suggest that we remove this "maximum" value from the documentation, as it realistically provides no useful information .

Rather than have this value be mentioned in the documentation, KINC could simply send an error in the unlikley event that a user chooses a number greater than 2147483647:

Error: Maximum Value for `--lsize` is 2147483647. Please choose a smaller value.

Proposed new documentation for these parameters:

--bsize <value>
Value Type: Integer
Minimum Value: 0
Default Value: 0
Number of pairs to process in each work block.

--gsize <value>
Value Type: Integer
Minimum Value: 1
Default Value: 4096
The global work size for each OpenCL worker.

--lsize <value>
Value Type: Integer
Minimum Value: 1
Default Value: 32
The local work size for each OpenCL worker.
spficklin commented 4 years ago

Perhaps we should specify a real limit instead of using the maximum integer size.

spficklin commented 4 years ago

@4ctrl-alt-del can you suggest some reasonable limits for these options?

bentsherman commented 4 years ago

@JohnHadish @spficklin The maximum limits for these options will vary from system to system depending on things like amount of RAM and the GPU model. In other words they are limited by the underlying hardware. So there are really no sensible software-imposed limits that we could use, other than the integer limits.

If you don't like the help text because it seems ugly, I suppose we could remove the maximum settings from the code. I've never tried it but I think ACE just wouldn't check against a maximum. In that case the user would be able to specify some huge number and I'm not sure what would happen, ACE might throw a parsing error or might allow the number to overflow which would be a silent error. Of course the user will probably never come close to such large numbers for these particular parameters... right?