Let me peel this one question about config const/var help off separately:

>> For example, given:
>>
>>      config var m = 10,
>>                 n = m;
>> 
>> would you prefer ./a.out --help to say:
>>
>>      m = 10
>>      n = m
>> 
>> or:
>>
>>      m = 10
>>      n = 10
>
> The second is fine.  It's mostly so the user can see what value a
> variable would have if it's not provided on the command line.

So then the follow-up question is:  Does the second form here suggest to 
you that if I run:

        ./a.out --help

and see:

        m = 10
        n = 10

that if you run:

        ./a.out --m=100

then n will still be 10?  (because it won't, it'll actually be 100). This 
is what made me ask about the first form.


On the other hand, the first form has the downside that if you have a 
complicated initializer like:

        config var n = computeProblemSize(Locales, m, pi);

then seeing the following in your help message:

        n = computeProblemSize(Locales, m, pi)

isn't actually very helpful.  So maybe you actually want both to avoid 
both of these pitfalls.  :(


The other challenge/downside to printing out the values (m=10, n=10) is 
that it requires a potentially non-trivial amount of code to execute in 
order to print out the help message.  For example, we have benchmarks 
today that do a computeProblemSize() routine like the above that queries 
the memory of all the locales on which the program is running, adds them 
up using a reduction, and computes the problem size based on the result. 
This suggests that running ./a.out --help would require launching the job 
across a number of nodes (potentially waiting in a queue before getting 
the opportunity to do so if running on a shared resource) before printing 
its result.

For this reason, if I had to pick just one of these two approaches, I'd 
probably pick the one that prints the initializing expression since it 
reduces the chances of confusion and doesn't require executing any of the 
program to accomplish.  If combined with user-supplied help text for each 
variable, it seems like one could avoid cases where the initializing 
expressions alone were too confusing.

Any other reactions?

Thanks,
-Brad

------------------------------------------------------------------------------
_______________________________________________
Chapel-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-users

Reply via email to