Virgo Logbook
UTC--:--:--
GPS-
Reports
AdV-DAQ›Software Framework #50257

Photodiode server - elapsed_time jumps

Since the upgrade of the rtpc filesystem occurred the November23,2020 and an update the December03,2020 to recover the part of the realtime performance, there is some jump in the elapsed time of the ACL photodiode servers: see this plot and the zoom. There is maybe less gliches on the SPRB_photodiodes as the demodulation phases are available as DOUBLE64 on this photodiodes servers instead of  FLOAT32 on the others

The elaspsed time glitches were already observerd in the case of LSC_ACl with the acosine function.

To investigate this issue, we have setup a monitoring of the elapsed time for all the ACL objects used by the SIB2_Photodiodes_new  ACL server, a clone of the SIB2_photodiodes one but without DAQ report. This allowed to identify that the elapsed time jumps occurs in the sinus and cosine computation of the demodulation phases.

The 2 last plots compare  the elapsed time for the sincos function call and  the sin and then cos function calls in ACL on 2 rtpcs running at 3GHz

  • for each plot:
    • the first line show the  elapsed time distribution in a 1D histogram, the elapsed time as a function of the angle in a 2D histogram for the sin and the cos function calls
    • the same thing for the second line for the sincos function call
  • on rtpcotpics rtpc with the previous filesytem : Linux-x86_64-SL6-2.6.32.11-x86_64-hal-2.6-03-rtai-3.8.1 (parameters): no elapsed time jumps for the sincos function, elapsed time jumps only for sin and cos functions
  • on the rtpc10 rtpc with the new filesytem : Linux-x86_64-CL7-4.9.80-hal-4-rtai-5.1 (parameters) : elapsed time jumps for the sincos function and the sin and cos functions

 

The mathtematical librairy has changed between the 2 systems and clearely the sincos function was compatible for real-time applications with the previous version(glibc-2.12-1.166.el6_7.7.x86_64) and not anymore now (glibc-2.17-307.el7.1.x86_64).

Investigations in-progress to find a new implementation of the sincos function compliant with real-time constraints and the others  mathematical functions often used in ACL servers: cos, sin,sincos, atan2, sqrt, cbrt and pow.

Thank to the optical lab team that allow to use the rtpcoptics to perform the comparison tests

1 comment

letendre, masserot, pacaud · 21 Dec 2020 · 16:10 #50294

We tested a new implementation of the sincos function extracted from the musl libc library  The tests were made of the rtpc10(new operating system) and an the rtpcoptics (previous operating system)

Tests on rtpc10 :

  • computation elapsed time:  this plot show
    • at the top the elapsed time for the sin and con function from the glibm mathematical library,
    • at the middle the elapsed time for the sincos function  from the glibm mathematical library
    • at the bottom the  he elapsed time for the sincos function  from the musl mathematical libray
  • precision: this plot show the difrerence of sin and cos and the returns values of the  sincos function (top) or the mul_sincos function(botton):
    • there is no error between sin and cos functions and sincos function leading to think that sincos function calls directly the sin and cos functions
  • There is no more jumps of computation elapsed time using the musl_sincos implementation and the error between the musl_sincos and sin/cos is lower that 0.2e-15.

Precision Tests on rtpcoptics:

  • this plot show the difrerence of sin and cos and the returns values of the  sincos function (top) or the mul_sincos function(botton) .In these 2 cases  there is roughly the same error with the sincos function or the musl_sincos function conpared to the sin and cos function.

Thanks to the results of these tests, we will use the musl_sincos implementation  in the Acl software .  The same kind of test will be done on cos,sin,atan,atan2,srqt, cbrt and pow mathematical functions to check if the musl implementation is more reliable for real-time point of view..