Skip to content

Commit

Permalink
DPL: drop some more code from the main header
Browse files Browse the repository at this point in the history
  • Loading branch information
ktf committed Mar 8, 2024
1 parent 96e0e44 commit 473b958
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
10 changes: 2 additions & 8 deletions Framework/Core/include/Framework/runDataProcessing.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#include "Framework/StructToTuple.h"

#include <vector>
#include <cstring>

namespace o2::framework
{
Expand Down Expand Up @@ -211,6 +210,7 @@ int mainNoCatch(int argc, char** argv)
}

int callMain(int argc, char** argv, int (*)(int, char**));
char *getIdString(int argc, char** argv);

int main(int argc, char** argv)
{
Expand All @@ -219,13 +219,7 @@ int main(int argc, char** argv)

int result = callMain(argc, argv, mainNoCatch);

char* idstring = nullptr;
for (int argi = 0; argi < argc; argi++) {
if (strcmp(argv[argi], "--id") == 0 && argi + 1 < argc) {
idstring = argv[argi + 1];
break;
}
}
char* idstring = getIdString(argc, argv);
o2::framework::OnWorkflowTerminationHook onWorkflowTerminationHook;
UserCustomizationsHelper::userDefinedCustomization(onWorkflowTerminationHook, 0);
onWorkflowTerminationHook(idstring);
Expand Down
9 changes: 9 additions & 0 deletions Framework/Core/src/runDataProcessing.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,15 @@ void doBoostException(boost::exception& e, const char*);
void doDPLException(o2::framework::RuntimeErrorRef& ref, char const*);
void doUnknownException(std::string const& s, char const*);

char *getIdString(int argc, char** argv) {
for (int argi = 0; argi < argc; argi++) {
if (strcmp(argv[argi], "--id") == 0 && argi + 1 < argc) {
return argv[argi + 1];
}
}
return nullptr;
}

int callMain(int argc, char** argv, int (*mainNoCatch)(int, char**))
{
static bool noCatch = getenv("O2_NO_CATCHALL_EXCEPTIONS") && strcmp(getenv("O2_NO_CATCHALL_EXCEPTIONS"), "0");
Expand Down

0 comments on commit 473b958

Please sign in to comment.