Hi Bill,
Sure, your ideas for timer sound OK. I only wanted to avoid having
"timer" prove to be a hangup of any sort, as I don't see it as a very
high priority.
-- Joe
On 12/18/2015 11:05 AM, Bill Somerville wrote:
> On 18/12/2015 15:41, Joe Taylor wrote:
>> Your proposed course of action looks good. An alternative to your item
>> (4) would be for the decoding routines write directly to std out when
>> called from the standalone program. This seems simpler to me; it would
>> need only a flag to indicate whether being called from within WSJT-X or
>> from the command-line program.
> Both options can be allowed for by writing to stdout when the callback
> function pointer is NULL (.not. associated). I.e. use teh functin
> pointer itself as the flag.
>>
>> As for the timer routine: those calls can be useful when we're
>> optimizing for speed, but I think it's not worth a lot of design time to
>> make them all-purpose. We will probably once more want a way to
>> determine where most of the execution time is being spent. That should
>> be possible in a number of fairly simple ways.
> I still like the callback idea. The time module uses a single function
> for all logging so adding a single callback function pointer to the
> decoder interface with a default of NULL for no callbacks would suffice.
> That way the instrumentation points in the decoders code can remain for
> use when needed. The change would be to make each timer call into:
>
> ! in decoder start interface
>
> ! callback is a C interoperable abstract interface
> procedure(callback), pointer :: timer
>
> ! convert c/b to to Fortran pointer
> ! ctimer_callback is C interoperable c/b
> call c_f_procedure(ctimer_callback,timer)
>
> ! then pass around 'timer' to where it's needed
>
> if (associated(timer)) then ! this check is the only runtime cost
> call timer('place ',0)
> endif
>
> 73
> Bill
> G4WJS.
>
> ------------------------------------------------------------------------------
> _______________________________________________
> wsjt-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wsjt-devel
------------------------------------------------------------------------------
_______________________________________________
wsjt-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wsjt-devel