Skip to content
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

[WIP] [QC-1176] Display a warning for developers if a registered object is not mergeable #2400

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

justonedev1
Copy link
Collaborator

this is just a draft with an idea, how to do it compile time, I am not sure, that you like it. It does not build, it would need a bit more work. Otherwise I don't know how to do this compile time and it would need to be done run time via dynamic_cast

@justonedev1 justonedev1 changed the title [QC-1176] Display a warning for developers if a registered object is not mergeable WIP [QC-1176] Display a warning for developers if a registered object is not mergeable Aug 28, 2024
@justonedev1 justonedev1 changed the title WIP [QC-1176] Display a warning for developers if a registered object is not mergeable [WIP] [QC-1176] Display a warning for developers if a registered object is not mergeable Aug 28, 2024
@knopers8
Copy link
Collaborator

For the record, we discussed in person, the agreed improvements are:

  • move the type handling logic to Mergers
  • find a way to avoid including all of the complete types that are checked (typically, the user will include what they need)
  • fail the compilation if the type is not mergeable, but add another method like "startPublishingNotMergeable" to allow expert users to do what they want.

Also marked all unwanted occurances of mergeable with ignore flag
@justonedev1
Copy link
Collaborator Author

I think that I addressed everything that we talked about, but a bit different way. If you would prefer something else, I can do that.

Copy link
Collaborator

@knopers8 knopers8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, just some details to sort out, but in general the idea is good.

Do I understand correctly that the inclusion order of ObjectManager.h and PostProcessingInterface.h should not matter because the template is put in place after both?

@@ -70,6 +70,9 @@ void ObjectsManager::startPublishing(TObject* object, PublicationPolicy publicat
ILOG(Warning, Support) << "Object is already being published (" << object->GetName() << "), will remove it and add the new one" << ENDM;
stopPublishing(object->GetName());
}
if (mergers::isMergeable(object)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be also disabled by the presence of QUALITYCONTROL_POSTPROCESSINTERFACE_H and IgnoreMergable==true, otherwise we will see a lot of spurious warnings.

Copy link
Collaborator

@knopers8 knopers8 Oct 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@justonedev1 can you explain how your most recent changes make QUALITYCONTROL_POSTPROCESSINTERFACE_H disable this warning? I'm not convinced they do.

@@ -70,6 +70,9 @@ void ObjectsManager::startPublishing(TObject* object, PublicationPolicy publicat
ILOG(Warning, Support) << "Object is already being published (" << object->GetName() << "), will remove it and add the new one" << ENDM;
stopPublishing(object->GetName());
}
if (mergers::isMergeable(object)) {
ILOG(Warning, Support) << "Object '" + std::string(object->GetName()) + "' with type '" + std::string(object->ClassName()) + "' is not one of the mergeable types, it might cause issues during publishing";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ILOG(Warning, Support) << "Object '" + std::string(object->GetName()) + "' with type '" + std::string(object->ClassName()) + "' is not one of the mergeable types, it might cause issues during publishing";
ILOG(Warning, Support) << "Object '" + std::string(object->GetName()) + "' with type '" + std::string(object->ClassName()) + "' is not one of the mergeable types, it will not be correctly merged in distributed setups, such as P2 and Grid" << ENDM;

missing ENDM and rephrasing

@@ -257,7 +257,7 @@ void TrendingTask::generatePlots()
}
auto c = drawPlot(plotConfig);
mPlots[plotConfig.name].reset(c);
getObjectsManager()->startPublishing(c, PublicationPolicy::Once);
getObjectsManager()->startPublishing<true>(c, PublicationPolicy::Once);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should not need <true> in TrendingTask and SliceTrendingTask anymore, after you disabled the check for postprocessing tasks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants