Hydra icon indicating copy to clipboard operation
Hydra copied to clipboard

Develop

Open JuanBSLeite opened this issue 7 years ago • 16 comments

JuanBSLeite avatar Mar 09 '18 17:03 JuanBSLeite

Olá Juan, thanks for this PR.

I see a lot of files in your request. Could you reconfigure the PR and push only your contribution? The file implementing the Flatté. Ideally, please, implement the line-shape in a header file ".h" (as you already did) and add some documentation citing also a reference from where you got the formulae. Then provide one or two examples placed in the folder "examples/phys" and add the target(s) to "examples/phys/CMakeList.txt". Creating the examples/NIPS_HYDRA is not necessary. There are some .xml files, and a .idea subdirectory, I suppose from your IDE (CLION ?). Please exclude then. Change fDaughter3Mass and the corresponding getter/setter members to fBachelorMass. I discovered recently that it keep as fDaughter3Mass can be painfully misleading...

Cheers A.A. .

AAAlvesJr avatar Mar 10 '18 09:03 AAAlvesJr

Hi Augusto,

OK, I'll do the modifications and do the PR again.

Att, Juan Leite


From: Antonio Augusto Alves Junior [email protected] Sent: Saturday, March 10, 2018 9:55 AM To: MultithreadCorner/Hydra Cc: JuanBSLeite; Author Subject: Re: [MultithreadCorner/Hydra] Develop (#25)

Olá Juan, thanks for this PR.

I see a lot of files in your request. Could you reconfigure the PR and push only your contribution? The file implementing the Flatté. Ideally, please, implement the line-shape in a header file ".h" (as you already did) and add some documentation citing also a reference from where you got the formulae. Then provide one or two examples placed in the folder "examples/phys" and add the target(s) to "examples/phys/CMakeList.txt". Creating the examples/NIPS_HYDRA is not necessary. There are some .xml files, and a .idea subdirectory, I suppose from your IDE (CLION ?). Please exclude then. Change fDaughter3Mass and the corresponding getter/setter members to fBachelorMass. I discovered recently that it keep as fDaughter3Mass can be painfully misleading...

Cheers A.A. .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FMultithreadCorner%2FHydra%2Fpull%2F25%23issuecomment-372017942&data=02%7C01%7C%7C86e7b326eb59473c2bcc08d5866d1c38%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636562725538406478&sdata=V0KmABLKemOmLQlDDpQysW%2BMGi0aXn9H9l5I%2Bf216dA%3D&reserved=0, or mute the threadhttps://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAiFoIb5NLuZBC4v1uQXCJaE4Cz8PpNpCks5tc6MlgaJpZM4SkkVn&data=02%7C01%7C%7C86e7b326eb59473c2bcc08d5866d1c38%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636562725538406478&sdata=x0jYy8MIeIhjk1Hk0igKEF7yBAK8sswnPtdHK7qNgFU%3D&reserved=0.

JuanBSLeite avatar Mar 10 '18 14:03 JuanBSLeite

Hi Augusto,

I did the changes you said and updated my fork. I'll do the new PR now.

JuanBSLeite avatar Mar 10 '18 17:03 JuanBSLeite

The PR gets updated automatically based on your branch (including master); on Monday I can show you how to squash and clean your commit history if you'd like.

henryiii avatar Mar 10 '18 17:03 henryiii

Hi Juan, thanks. Tell me one thing, how does this implementation compares to the original code you used as inspiration? Did you tested if they return the same values? Other point: did you compared your implementation to the formulas here described in CERN-EP-PHYS-76-8 ?

AAAlvesJr avatar Mar 10 '18 18:03 AAAlvesJr

Hi Juan, thanks. There are still some minor issues. I commented them inline. please address them and let me know. Thanks.

AAAlvesJr avatar Mar 19 '18 07:03 AAAlvesJr

One more point, I forgot to comment previously. The getter and setters should reflect the names of the members they refer to. For example: double fMass -> void SetMass(double mass){...}

AAAlvesJr avatar Mar 19 '18 09:03 AAAlvesJr

Hi Juan, thanks for this contribution. It looks much better now! Indeed, the EvtGen's implementation is much more reliable... Please, find my comments inline. Cheers A,A,

AAAlvesJr avatar Apr 06 '18 08:04 AAAlvesJr

Hi Juan, let me confess I am a bit intrigued... How does this functor can be running in CUDA, if the member std::array<...> fParams is not copyable in that back-end?

As I told you personally a pair of times, if the thresholds are always fixed parameters, it is not necessary to pass them to the hydra::BaseFunctor interface, only the parameters that need be tracked during a fit need be passed...

Look forward for your feedback... A.A.

AAAlvesJr avatar Apr 16 '18 08:04 AAAlvesJr

Hi Augusto, std::array is a container to simple C array, it allow use iterators and other things, that's why I think it is running . params is not inside the base functor, there is only one parameter there, that is the mean.

BaseFunctor<FlatteLineShape<CHANNEL, ArgIndex>, hydra::complex<double>,1>{mean}

JuanBSLeite avatar Apr 17 '18 11:04 JuanBSLeite

Please, look my last comments.

The CUDA9 Programing Guide, section F.3.8, states:

F.3.8. Standard Library Standard libraries are only supported in host code, but not in device code, unless specified otherwise.

AFAIK, the only Standard Library class supported is std::initializer_list, which is explained in the section F.3.15.2. std::initializer_list.

I am still wondering how your code can run on CUDA...

AAAlvesJr avatar Apr 17 '18 11:04 AAAlvesJr

Can you try to run it in your machine?

JuanBSLeite avatar Apr 17 '18 11:04 JuanBSLeite

I think std::array works if you use --expt-relaxed-constexpr (which you do), since the key methods are constexpr. I'm pretty sure I've used it on device before. I could be wrong, though.

Edit: From looking at the descriptions of std::initializer_list and the CUDA source, I don't see why it would be supported, though...

PS: std::move and std::forward are also explicitly supported (though they are not classes).

henryiii avatar Apr 17 '18 11:04 henryiii

The Standard is clear enough about std::array, as so is the CUDA Programing Guide... Lets not drag ahead this discussion. In summary, the class is not copyable in CUDA. Please, exchange it by a C-style array.

AAAlvesJr avatar Apr 17 '18 12:04 AAAlvesJr

BTW, about relying on --expt-relaxed-constexpr for certain things

Programming Guide - v9.1.85 F.3.15.4. Constexpr functions and function templates

By default, a constexpr function cannot be called from a function with incompatible execution space 14. The experimental nvcc flag --expt-relaxed-constexpr removes this restriction. When this flag is specified, host code can invoke a __device__ constexpr function and device code can invoke a __host__ constexpr function. nvcc will define the macro __CUDACC_RELAXED_CONSTEXPR__ when --expt-relaxed-constexpr has been specified. Note that a function template instantiation may not be a constexpr function even if the corresponding template is marked with the keyword constexpr (C++11 Standard Section [dcl.constexpr.p6]).

AAAlvesJr avatar Apr 17 '18 12:04 AAAlvesJr

ping...

AAAlvesJr avatar Jun 13 '18 10:06 AAAlvesJr