Skip to content

Adding customizable hook to be executed on workflow termination - #2196

Merged
ktf merged 1 commit into
AliceO2Group:devfrom
matthiasrichter:dev-custom-workflow-termination-hook
Jul 15, 2019
Merged

Adding customizable hook to be executed on workflow termination#2196
ktf merged 1 commit into
AliceO2Group:devfrom
matthiasrichter:dev-custom-workflow-termination-hook

Conversation

@matthiasrichter

Copy link
Copy Markdown
Collaborator

This defines a function callback OnWorkflowTerminationHook with signature
void (const char*) and allows to set the hook using the customize mechanism
of DPL workflows. The callback hook is invoked just before processes terminate.
The hook is invoked for all childs and the main driver, the id string is passed
as parameter to customize the callback action. For the main driver, the nullptr
is passed.

This is a simple mechanism to allow for deterministic actions at the end of the workflow or parts of it.
An example use case is [O2-778] https://alice.its.cern.ch/jira/browse/O2-778

This defines a function callback `OnWorkflowTerminationHook` with signature
`void (const char*)` and allows to set the hook using the `customize` mechanism
of DPL workflows. The callback hook is invoked just before processes terminate.
The hook is invoked for all childs and the main driver, the id string is passed
as parameter to customize the callback action. For the main driver, the nullptr
is passed.
@matthiasrichter
matthiasrichter requested a review from ktf July 11, 2019 20:44

@davidrohr davidrohr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks like a useful feature for me, just have one comment below:

}

char* idstring = nullptr;
for (int argi = 0; argi < argc; argi++) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is --id a new option needed for this hook? I think not?
In that case, perhaps the id parameter is already available from somewhere else, and does not need to be parsed from the cmdline again?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The --id parameter is added by the main driver so that every child process knows it's role in the workflow. So it is there already. The parsing of all the options is done in doMain in the cxx file. The customization happens in the header file because of some template trick, so one would need to pass the function as another parameter to do main.

Using this id parameter allows to customize the hook depending on the position of a process in the workflow.

I decided not to do this and implement some simple parsing. But well, that can be changed.

@matthiasrichter matthiasrichter changed the title [WIP] Adding customizable hook to be executed on workflow termination Adding customizable hook to be executed on workflow termination Jul 15, 2019
@ktf

ktf commented Jul 15, 2019

Copy link
Copy Markdown
Member

LGTM.

@matthiasrichter

Copy link
Copy Markdown
Collaborator Author

@davidrohr , cuda CI fails in two unit tests

The following tests FAILED:
	196 - Detectors/TPC/monitor/macro/RunFindAdcError.C_compiled (Failed)
	198 - Detectors/TPC/monitor/macro/RunSimpleEventDisplay.C_compiled (Failed)

Du you also think its unrelated? I can find anything suspicious in the log

@davidrohr

Copy link
Copy Markdown
Collaborator

Hi @matthiasrichter : I have no idea what is the problem, but I have also seen cuda CI fail random tests in the last days. I would assume something is wrong with that CI in general. In any case, I do not think it is related to this PR.

@ktf
ktf merged commit a341176 into AliceO2Group:dev Jul 15, 2019
@matthiasrichter
matthiasrichter deleted the dev-custom-workflow-termination-hook branch July 19, 2019 07:37
MichaelLettrich pushed a commit that referenced this pull request Jul 24, 2019
This defines a function callback `OnWorkflowTerminationHook` with signature
`void (const char*)` and allows to set the hook using the `customize` mechanism
of DPL workflows. The callback hook is invoked just before processes terminate.
The hook is invoked for all childs and the main driver, the id string is passed
as parameter to customize the callback action. For the main driver, the nullptr
is passed.
knopers8 pushed a commit to knopers8/AliceO2 that referenced this pull request Oct 23, 2019
…eO2Group#2196)

This defines a function callback `OnWorkflowTerminationHook` with signature
`void (const char*)` and allows to set the hook using the `customize` mechanism
of DPL workflows. The callback hook is invoked just before processes terminate.
The hook is invoked for all childs and the main driver, the id string is passed
as parameter to customize the callback action. For the main driver, the nullptr
is passed.
carlos-soncco pushed a commit to carlos-soncco/AliceO2 that referenced this pull request Oct 28, 2019
…eO2Group#2196)

This defines a function callback `OnWorkflowTerminationHook` with signature
`void (const char*)` and allows to set the hook using the `customize` mechanism
of DPL workflows. The callback hook is invoked just before processes terminate.
The hook is invoked for all childs and the main driver, the id string is passed
as parameter to customize the callback action. For the main driver, the nullptr
is passed.
EmilGorm pushed a commit to EmilGorm/AliceO2 that referenced this pull request Apr 15, 2023
…up#2196)

* [PWGLF] LightNucleiSpectra - Add DCA custom cut

* [PWGLF] LightNucleiTask - Improve PID cuts

* [PWGLF] LightNucleiTask - Add flags to optimize subwagons
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.

3 participants