Skip to content
Snippets Groups Projects

Merge in error-checking from lalsuite version

3 unresolved threads

This merges in the changes requested by @leo-singer in lalsuite!474 (merged). This is mainly related to catching GSL errors when possible in the distance integrator.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
307 326 log_offset = 0;
308 327
309 328 params.scale = -log_offset;
310
311 {
329 size_t n = 64;
330 double abstol = 1e-8;
331 double reltol = 1e-8;
332 int relaxed=0;
333 do {
312 334 /* Maximum number of subdivisions for adaptive integration. */
313 static const size_t n = 64;
  • Why was this moved?

  • I had to remove the "const" keyword so that n can be increased in the section below.

  • Would you please add to bayestar_test a case of interest for your analysis that breaks the old tolerance and subdivision limit?

    If possible, I would rather keep n and reltol as constants but increase their literal values, because this doubling of the number of subdivisions is very similar to what the qagp integrator itself does.

  • Increasing the maximum number of iterations is not appropriate for BAYESTAR because the code is designed for low-latency operation, and must complete in a predictable amount of time.

  • Please register or sign in to reply
  • 221 221 const double b = integrand_params->b;
    222 222 const int k = integrand_params->k;
    223 223 double ret = scale - gsl_pow_2(p / r - 0.5 * b / p);
    224 int retval=GSL_SUCCESS;
    225 gsl_sf_result result;
    226 gsl_error_handler_t *old_handler = gsl_set_error_handler_off();
    227
    224 228 if (integrand_params->cosmology)
    225 229 ret += log_dVC_dVL(r);
    230 retval = gsl_sf_exp_mult_e(
    • Do these error handling changes actually have any effect? Upon an underflow error, won't the result be 0 anyway?

    • I ran into cases where GSL was throwing it as an error and causing the code to abort.

    • Generally speaking if the default error handler is turned off (which is recommended for production code) then you have to check the return codes anyway.

    • I think that I almost always run the code with the error handler turned off. Is this not what LALInference does?

      In this case, if the error handler is turned off, checking gsl_errno is not necessary because on underflow the return value is just 0.0, as expected.

    • Indeed, I haven't turned it off before. That would explain why I was finding a problem. If this is all un-necessary then we can scrub this merge request.

    • Well, currently it is my Python wrapper that is setting the error handler. So probably the LALInference likelihood should set it.

    • Please register or sign in to reply
  • 307 326 log_offset = 0;
    308 327
    309 328 params.scale = -log_offset;
    310
    311 {
    329 size_t n = 64;
    330 double abstol = 1e-8;
  • added 1 commit

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • By the way, in the LALInference version I added a line to log_radial_integrator_init(),

    if(cosmology) dVC_dVL_init();

    Not sure if that is being initialised elsewhere in this version so I didn't add it, but you may find it to be a bug if not.

  • By the way, in the LALInference version I added a line to log_radial_integrator_init(),

    if(cosmology) dVC_dVL_init();

    Not sure if that is being initialised elsewhere in this version so I didn't add it, but you may find it to be a bug if not.

    It's called by bayestar_init().

  • added 1 commit

    • 9f909483 - Set absolute tolerance back to DBL_MIN

    Compare with previous version

  • @john-veitch, this merge request is a year old now. Are you still interested in merging it?

  • Patch seems abandoned.

  • closed

  • Please register or sign in to reply
    Loading