Skip to content

Performance slowdown in sample_get_x from the checks for warnings at the end #968

@valassi

Description

@valassi

I am doing a few tests with sample_get_x towards vectorising it, see #963

I realised that there is a relatively large overhead there from some checks for warnings at the end. In a cuda only build of DY+3jets (CMS #943 from @choij1589) this seems to take around 15 to 20% for some subprocesses.

The question is whether these checks must be kept and in which form. I actually realised becase I removed them in my vectorization tests. This type of checks is likely to be difficult to vectorize. I agree some checks are needed, but maybe this could be reviewed.

This is these checks here (by the way there may be a minor bug as icount is not SAVEd)

c
c     Simple checks to see if we got the right point note 1e-3 corresponds
c     to the fact that the grids are required to be separated by 1e-14. Since
c     double precision is about 18 digits, we expect things to agree to
c     3 digit accuracy.
c
      if (abs(ddum(j)-xbin(x,ij))/(ddum(j)+1d-22) .gt. 1e-3) then
         if (icount .lt. 5) then
            write(*,'(a,i4,2e14.6,1e12.4)')
     &           'Warning xbin not returning correct x', ij,
     &           ddum(j),xbin(x,ij),xo
         elseif (icount .eq. 5) then
            write(*,'(a,a)')'Warning xbin still not working well. ',
     &           'Last message this iteration.'
         endif
         icount=icount+1
      endif

@oliviermattelaer any feedback? Thanks Andrea

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions