I am working on parallelizing some code.
I use the ROOT::TProcessExecutor class.
In particular, I define a struct called PACK that is used in the parallelized section :
struct PACK{
double _nodtmaxeffs, _dnodtmaxeffs, _maxeffs, _dmaxeffs;
vector _maxincleffs, _dmaxincleffs;
};
There is no problem at compilation, but when I run the program
I get the following error :
“Error in : [E] Could not find cling definition for class 4PACK”
You need to teach cling about the struct. One way is to explicitly load the header file (gInterpreter->LoadFile("PACK.h");) Another way is to generate/request a [ROOT] dictionary for the struct (via rootcling/LinkDef or genreflex/Selection.xml).
I forgot to precise that I have defined the struct PACK in the same file as in the one I use it (simply above the main method); there is no PACK.h header file.
Plus their are some classes defined in the same code file without any associated header file; the difference with PACK is that they inherit from other classes defined in some separate files (for which I include the associated headers).
Moreover the code is compiled and not interpreted. Why would cling be involved ?
Is PACK one of the structure that is supposed to be shared among the process is order to parallelize your code? If this is the case, in order to transfer the PACK object from one process to another we need to serialize it via ROOT I/O; in order to do we must have a dictionary for PACK.
If this is not the case, the we will really need to see the code in order to understand why it would complain about it (it should not).
Yes PACK is a struct that is used in the parallelized section of the code. More specifically, PACK is the return type of the function called in the Map.
How should I proceed to add the PACK struct to dictionnary?
I am sorry, my answer was not accurate enough :
PACK is NOT shared among the process but it is simply the return type of the function to run in parallel.
Moreover, here is some piece of code that provides the exact same issue.