[Os-project-managers] Updates to OSoL schema

Kipp Martin kmartin at chicagobooth.edu
Fri Aug 10 12:48:33 EDT 2012


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.
>
> As you can anticipate, this is going to create a bit of a performance
> hit, especially for the higher print levels. This is why I have
> advocated from the start that all print statements above a certain
> cutoff be hidden behind
>
> #ifdef _DEBUG
> OS_Print(...)
> #endif
>
> constructs. The production code never sees them, but the debug version
> can use them.
>
>
>>>> default print level 1
>>>> if printLevel < 100, global print level (for all areas)
>>>> otherwise printLevel div 100 gives the number of an area (we need to
>>>> use enumerations for these things, anyway), and printLevel mod 100
>>>> gives the print level in that area. (Same for filePrintLevel.)
>>>>
>>>> So
>>>>
>>>> filePrintLevel 3
>>>>
>>>> says: use global print level 3 in all areas;
>>>>
>>>> filePrintLevel 512
>>>>
>>>> says: use the default print level in all areas, but use print level 12
>>>> in area 5, etc.
>>
>> I don't understand the above at all.
>
> Fair enough. I will try again. Let`s say there are three areas:
>
> 1 - OSiL parser
> 2 - OSoL parser
> 3 - solver interface
>
> and let`s just use three print levels
>
> 0 - no output (let`s pretend that this is the default)
> 1 - a little output
> 2 - everything
>
> A user might want to see a little output on the terminal and also save
> this stuff in a file for later use. This can be done by specifying
> something like
>
> printLevel 1 \
> outputFile usersFileName \
> filePrintLevel 1
>
> on the command line.
>
> Gus might be developing the OSoL parser and might want to have no output
> except in the OSoL parser (area 2). So I would put
>
> outputFile myFileName \
> filePrintLevel 202
>
> The first `2` in the filePrintLevel sets the print level for area 2
> only, and the second `2` sets it to "everything".
>
> In short, the user is happy, and I get my debug statements without
> having to put print statements in that have to be commented out later,
> and without
>
> #defining DEBUG_OSOLPARSER
>
> which I will then forget to #undef before I commit the next release. So
> everyone is happy.
>
>>>> Comments? Do you think this can work? Is it too baroque? Overkill?
>>>> What do you say?
>>
>> Definitely baroque for me. But the big thing is how this gets
>> implemented.
>
> 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?

2) Can we have more than 10 areas?

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

4) in

filePrintLevel 202

what is the 0? Is 0 being used as a separator?

Cheers



-- 
Kipp Martin
Professor of Operations Research
and Computing Technology
Booth School of Business
University of Chicago
5807 South Woodlawn Avenue
Chicago, IL 60637
773-702-7456
kmartin at chicagobooth.edu
http://www.chicagobooth.edu/faculty/bio.aspx?person_id=12825325568
http://projects.coin-or.org/OS

Sent without Blackberry, Droid, iPhone, or any other
wireless device.
-- 


More information about the Os-project-managers mailing list