How to add an user class to TSelector::fOutput?

Hello,

I have a problem adding my own example class (called myClass) object to mySelector::fOutput when running on PROOF.
myClass is inherited from TObject and its rootcint dictionary is also generated. Please, have a look to myClass.h, myClass.C and the makefile (.h is a dummy extension) in the attachment.

Now, I do the following: In myTSelector::SlaveBegin() I create myClass object and add it to fOutput. In the Terminate()-method I unsuccessfully try to retrieve it: myClass * mc = (myClass*) fOutput->FindObject(“myClass”). Looking in the master log I can see the following errors:

[quote]15:33:11 19221 Mst-0 | Error in TClass::Load: dictionary of class myClass not found
15:33:11 19221 Mst-0 | Error in TClass::Load: dictionary of class myClass not found[/quote]

Here is the way how I include myClass shared library in the main-script:

proof->Exec("gSystem->Load(\"libMyClass.so\")"); chain->Process("myTSelector.C+");

Could someone help me to understand what I’m missing? Thanks much in advance.

Cheers, Gia
myClass.C (91 Bytes)
myClass.h (162 Bytes)
makefile.h (772 Bytes)

Hello,

I solved the problem and just want to report how I did that in case somebody else needs to do the same.

I simply made myClass.par package similar to event.par existing in the root proof tutorial: http://root.cern.ch/viewvc/trunk/tutorials/proof/?pathrev=29492 . I used the same MakeFile(.arch) just needed to adjust the names and add -I./ to CXXFLAGS in order to see the local myClass.h. And it worked. Now, I am able to add and later retrieve myClass objects from TSelector::fOutput list.

One more comment, which might worth mentioning is that one should not have a package and its archive in the same directory if your master and slave nodes are the same machine (actually I don’t know what happens if they are on remote hosts). It will have a package uploading problem and will trow a message like this:

This happened because myClass-directory (untarzip event.par to see its similar structure) and its archive myClass.par both lived in /my/prog/location/myProg -directory. I created /my/prog/location/myProg/run - directory, copied myClass.par and myMain.cxx into it and run myMain.cxx (which calls proof and uploads myClass.par) staying in run/. This helps.

Cheers,
Gia

[quote=“gia”]Hello,

I have a problem adding my own example class (called myClass) object to mySelector::fOutput when running on PROOF.
myClass is inherited from TObject and its rootcint dictionary is also generated. Please, have a look to myClass.h, myClass.C and the makefile (.h is a dummy extension) in the attachment.

Now, I do the following: In myTSelector::SlaveBegin() I create myClass object and add it to fOutput. In the Terminate()-method I unsuccessfully try to retrieve it: myClass * mc = (myClass*) fOutput->FindObject(“myClass”). Looking in the master log I can see the following errors:

[quote]15:33:11 19221 Mst-0 | Error in TClass::Load: dictionary of class myClass not found
15:33:11 19221 Mst-0 | Error in TClass::Load: dictionary of class myClass not found[/quote]

Here is the way how I include myClass shared library in the main-script:

proof->Exec("gSystem->Load("libMyClass.so")"); chain->Process("myTSelector.C+");

Could someone help me to understand what I’m missing? Thanks much in advance.

Cheers, Gia[/quote][/url]

Dear Gia,

Another way to do it with simple classes is to use TProof::Load(…) (see also root.cern.ch/drupal/content/prep … l-software)

proof->Load("MyClass.C+");
chain->Process("myTSelector.C+");

But of course the PAR solution is more general and allows you to manage real packages.

This happens because PROOF creates a local symlink to the PAR file directory named after the PAR package; this allows to use includes in the form

#include "mypar/MyFirstClass.h"
#include "mypar/MySecondClass.h"

in the selector files.
But, of course, if locally you have already a directory with the same name the symlink cannot be created. The suggestion is to the PAR files sources under a different path, e.g. /MyFirstPAR.par, /MySecondPAR.par; you can then upload them directly from there

proof->UploadPackage("<mypars>/MyFirstPAR")
proof->EnablePackage("MyFirstPAR")

and you should not have any problem with the symlink any longer.

G. Ganis