atlas_maneframe
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
atlas_maneframe [2015/07/09 10:20] – [Access by External Users] sekula | atlas_maneframe [2016/10/28 08:18] – [SLURM and Resource Management] sekula | ||
---|---|---|---|
Line 23: | Line 23: | ||
**Mailing List** | **Mailing List** | ||
- | External ManeFrame users should request to be added to the mailing list '' | + | External ManeFrame users should request to be added to the mailing list '' |
===== Acknowledgement by External Users ===== | ===== Acknowledgement by External Users ===== | ||
Line 31: | Line 31: | ||
**Acknowledgement Policy** | **Acknowledgement Policy** | ||
- | During the period July - December | + | During the period July 2015 - December |
We do not ask for acknowledgement in public papers, conference notes, or presentations; | We do not ask for acknowledgement in public papers, conference notes, or presentations; | ||
Line 190: | Line 190: | ||
< | < | ||
- | maneframe-run --inDS <input directory> | + | maneframe-run --inDS <input directory> |
| | ||
Line 204: | Line 204: | ||
maneframe-run --inDS / | maneframe-run --inDS / | ||
+ | </ | ||
+ | |||
+ | So an example bash submission script might look like: | ||
+ | < | ||
+ | #!/bin/bash | ||
+ | |||
+ | INPUT=ThisIsYourInputFileDirectoryPATH | ||
+ | OUTPUT=/ | ||
+ | EXECUTABLE=" | ||
+ | EMAIL=" | ||
+ | MAXFILES=10 | ||
+ | MAXTIME=00: | ||
+ | |||
+ | ~sekula/ | ||
</ | </ | ||
Line 250: | Line 264: | ||
</ | </ | ||
+ | so that (keeping with the tutorial' | ||
+ | < | ||
+ | #include " | ||
+ | #include " | ||
+ | #include " | ||
+ | #include " | ||
+ | #include " | ||
+ | #include " | ||
+ | #include " | ||
+ | #include " | ||
+ | #include < | ||
+ | #include < | ||
+ | #include < | ||
+ | #include < | ||
+ | |||
+ | #include " | ||
+ | |||
+ | int main (int argc, char *argv[]) { | ||
+ | // Take the submit directory from the input if provided: | ||
+ | std::string submitDir = " | ||
+ | |||
+ | if (argc > 1) submitDir = argv[1]; | ||
+ | |||
+ | // Set up the job for xAOD access: | ||
+ | xAOD:: | ||
+ | |||
+ | // Construct the samples to run on: | ||
+ | SH:: | ||
+ | |||
+ | // use SampleHandler to scan all of the subdirectories of a directory for particular MC single file: | ||
+ | std::string pathstring = " | ||
+ | |||
+ | if (argc > 2) { | ||
+ | pathstring = static_cast< | ||
+ | } | ||
+ | const char *inputFilePath = gSystem-> | ||
+ | |||
+ | if (TString(inputFilePath).Contains(" | ||
+ | // This is an input.txt file - it contains a CSV list of ROOT files. | ||
+ | // Parse it and add the root files to the job | ||
+ | SH:: | ||
+ | |||
+ | std:: | ||
+ | fs.open(inputFilePath); | ||
+ | |||
+ | if (fs.good() && fs.is_open()) { | ||
+ | while (!fs.eof()) { | ||
+ | std::string line; | ||
+ | getline(fs, line); | ||
+ | |||
+ | TObjArray *rootfilelist = TString(line).Tokenize("," | ||
+ | |||
+ | for (Int_t i = 0; i < rootfilelist-> | ||
+ | TString sampleName = ((TObjString*)rootfilelist-> | ||
+ | sample-> | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | sh.add(sample); | ||
+ | } | ||
+ | else { | ||
+ | SH:: | ||
+ | sh, inputFilePath); | ||
+ | } | ||
+ | |||
+ | // Set the name of the input TTree. It's always " | ||
+ | sh.setMetaString(" | ||
+ | |||
+ | // Print what we found: | ||
+ | sh.print(); | ||
+ | |||
+ | // Create an EventLoop job: | ||
+ | EL::Job job; | ||
+ | job.sampleHandler(sh); | ||
+ | job.options()-> | ||
+ | |||
+ | // Create an output and an assocaited ntuple | ||
+ | EL:: | ||
+ | job.outputAdd(output); | ||
+ | EL:: | ||
+ | job.algsAdd(ntuple); | ||
+ | |||
+ | // Add our analysis to the job: | ||
+ | MyxAODAnalysis* alg = new MyxAODAnalysis(); | ||
+ | job.algsAdd(alg); | ||
+ | |||
+ | alg-> | ||
+ | |||
+ | // Run the job using the local/ | ||
+ | EL:: | ||
+ | driver.submit(job, | ||
+ | |||
+ | return 0; | ||
+ | } // main | ||
+ | </ | ||
+ | |||
+ | === Combining Output Files === | ||
+ | When maneframe-run submits your jobs to ManeFrame it will do so in batches. Each of these will run on ManeFrame and each batch will return output to the OUTPUT directory you passed to maneframe-run. You will now want to combine these outputs to be able to look at the combined results in a single file. The following script will use ROOT's hadd utility to produce a single root file (location and name given by the user) as output: | ||
+ | < | ||
+ | #!/bin/bash | ||
+ | |||
+ | SOURCE=() | ||
+ | TARGET=~This/ | ||
+ | i=0 | ||
+ | |||
+ | # find all the .root files of interest | ||
+ | while IFS= read -r file; do | ||
+ | SOURCE[i]=$file | ||
+ | ((i++)) | ||
+ | done < <(find / | ||
+ | |||
+ | hadd $TARGET ${SOURCE[*]} | ||
+ | </ | ||
+ | |||
+ | === Using the EventLoop (EL) SlurmDriver === | ||
+ | |||
+ | As of about November of 2016, AnalysisBase releases (after 2.4.21) contained a new driver in the EventLoop package, SlurmDriver. Like the other drivers for running code locally or on other batch management systems, the EL:: | ||
+ | |||
+ | The present EL:: | ||
+ | |||
+ | < | ||
+ | EL:: | ||
+ | driver.SetJobName(" | ||
+ | driver.SetAccount(" | ||
+ | driver.SetPartition(" | ||
+ | driver.SetRunTime(" | ||
+ | driver.SetMemory(" | ||
+ | driver.SetConstrain("" | ||
+ | </ | ||
+ | |||
+ | When you create an EL:: | ||
+ | |||
+ | * The Job Name (appears in squeue and labels your individual jobs) | ||
+ | * Account - this is always " | ||
+ | * Partition - the name of the partition where jobs will run, e.g. serial or development, | ||
+ | * RunTime - the maximum running time of the job. Here, the example code uses 30 minutes in HH:MM:SS format | ||
+ | * Memory - the memory limit for your job | ||
+ | * Constrain - this will constrain your job to specific resources, if there are multiple resource options in the partition. | ||
===== Known Issues ===== | ===== Known Issues ===== | ||
atlas_maneframe.txt · Last modified: 2018/10/28 10:28 by sekula