-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add documentation about the functional algorithms #50
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice summary. I was planning on introducing a How-To section where things like functional could go. We can always reshuffle this to that afterwards.
## Setup | ||
We will need Gaudi, k4FWCore and all their dependencies. Installing these by | ||
ourselves is not easy but there are software stacks on cvmfs, see the | ||
{doc}`/setup-and-getting-started/README.md` to set up the key4hep stack. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{doc}`/setup-and-getting-started/README.md` to set up the key4hep stack. | |
{doc}`/setup-and-getting-started/README.md` to set up the key4hep stack. |
Should this be a link?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But that's a link, right? At least we have it like that in other parts of the documentation to link to other parts of the documentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a link should be [text](dest)
. At least the current form doesn't render as a link in the github markdown viewer (maybe it does when run through sphinx?)
## Avoiding const in `operator()` | ||
There is a way of working around `operator()` being const and that is by adding | ||
the keyword `mutable` to our data member. This will allow us to change our data | ||
member inside `operator()` and will cause code that wasn't compiling because of | ||
this to compile. Of course, this is not a good idea because unless the member of | ||
our class is thread-safe, that means that our algorithm is no longer thread-safe | ||
and running with multiple threads can cause different results. Even worse than | ||
that, it's very possible that there are not any errors or crashes but the | ||
results are simply wrong from having several threads changing a member at the | ||
same time, for example. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure whether we should actually mention this. People who need to modify internal state will (most likely) know this, and people who don't know this probably shouldn't be using mutable
;) Maybe, there should rather be a paragraph explaining where setup work can be done (does Functional still have an initialize
?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But hiding it won't make people not use mutable so I'd rather keep it so that if someone reads that at least they know what are the consequences, because people adding mutable
so that the code compiles has already happened in experiments that use Gaudi. On top of that there will be places where it will be necessary to use mutable
, like histogramming
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough.
The documentation is not fully complete; there are other topics like histogramming that I should add at some point but I think for now this is a decent reference |
Yeah, I think this is in a decent shape and we can add more things later. |
BEGINRELEASENOTES
ENDRELEASENOTES