Open jpata opened 3 years ago
assign reconstruction
New categories assigned: reconstruction
@slava77,@jpata you have been requested to review this Pull request/Issue and eventually sign? Thanks
A new Issue was created by @jpata Joosep Pata.
@Dr15Jones, @perrotta, @dpiparo, @makortel, @smuzaffar, @qliphy can you please review it and eventually sign/assign? Thanks.
cms-bot commands are listed here
there is also a variant with edm::global
module as in #35237
@makortel @Dr15Jones
could you help us understand if std::atomic
is actually required here: https://github.com/cms-sw/cmssw/blob/6d2f66057131baacc2fcbdd203588c41c885b42c/RecoMET/METPUSubtraction/plugins/DeepMETProducer.cc#L12 ?
I don't see any reason why that should be std::atomic
. The graph_def
is written to exactly once (initializeGlobalCache()
), then read once per stream (in edm::stream
module constructor, that are guaranteed to be called serially), and finally destructed once (globalEndJob()
).
The variable could easily be std::unique_ptr<tensorflow::GraphDef>
, and given that tensorflow::createSession()
takes const GraphDef*
, that could even be edm::propagate_const<std::unique_ptr<tensorflow::GraphDef>>
(i.e. the DeepMETProducer
would see "constant pointer to constant GraphDef
").
If the GraphDef
doesn't need to be changed after it is created, then just a std::unique_ptr<const tensorflow::GraphDef>
would work.
I'm checking the various producers to understand if the
tensorflow::GraphDef
andtensorflow::Session
are used correctly, efficiently and coherently across reco modules:Questions:
std::atomic<tensorflow::GraphDef*>
in the global cache object actually required?