[Os-project-managers] Updates to OSoL schema

Horand Gassmann Horand.Gassmann at dal.ca
Fri Aug 10 14:05:42 EDT 2012


Kipp Martin <kmartin at chicagobooth.edu> wrote:

> Hi Gus:
>>
>> Inside the OS_Print method there is a loop which for each defined
>> journal checks to see whether the print level allows the stuffToPrint to
>> be "printed" to the journal.
>
> Wouldn't some sort of hash map be a lot clearer.

I do not think so, because each print statement (or output string, if  
you prefer) can potentially be sent to multiple output streams. A hash  
table won't help, as far as I can see.

[...]

>> I would implement along these lines: The command line parser sees
>>
>> outputFile myFileName \
>> filePrintLevel 202
>>
>> and calls the journalist API to register a journal "myFileName" with an
>> array of print levels that looks like (0, 2, 0).
>>
>
> I definitely don't understand the above. A few more questions:
>
> 1) Can we have a print level above 9?

Yes; the scheme above was offered just as a suggestion. In this scheme  
we can support print levels up to 99. If we need three digits, we can  
use 2002 instead of 202, and everything will work the same.

> 2) Can we have more than 10 areas?

Sure; same principle. Let's say the OSrL parser is area 53. If we  
allow up to 99 print levels, then code 5302 does the same for the OSrL  
parser as 202 did for the OSoL parser. (And if we have more than 99  
print levels, we can go to code 53002 instead.)

> 3) How would I specify different print levels for different areas?

You can't at the command line level, unfortunately, unless you allow  
multiple fileOutputLevel commands, and then it would be very difficult  
to match the print levels with the correct stream. This is an accident  
waiting to happen. On the bright side, the restriction is no different  
from the functionality in Ipopt. In fact, being able to single out  
*one* area for special treatment is an improvement over Ipopt.


> 4) in
>
> filePrintLevel 202
>
> what is the 0? Is 0 being used as a separator?

No. I actually assumed we have more than ten print levels. So the area  
would be (printLevel div 100) and the actual print level would be  
(printLevel mod 100) --- we would make sure that the print levels we  
define and the computations match up properly, perhaps by adding or  
subtracting 1 somewhere. I want to do the parsing of the print level  
using arithmetic, not a character reader. It just feels "better".

Hope that helps.

Cheers

gus
-------------------------------------------------------

Horand I. Gassmann, Professor

School of Business Administration, Dalhousie University
6100 University Avenue, PO Box 15000
Halifax, Nova Scotia, Canada, B3H 4R2
ph. (902) 494-1844
fax (902) 494-1107

http://myweb.dal.ca/gassmann/



More information about the Os-project-managers mailing list