{ #include // Needed for ROOT 3.10. // Load the dataset and DIAL libraries. gROOT->ProcessLine(".X load_dial.cxx+"); // Load the macro for opening HBOOK files. gROOT->LoadMacro("open_hbook.C"); // Instantiate XML parser and create DTD. XmlParser parser; DtdRegistry::instance("dataset").write(); DtdRegistry::instance("dial").write(); // Define location of Unique ID generator files. string dial_uids = Environment::current().value("DIAL_UIDS"); UniqueIdGenerator::base_directory(dial_uids); // Instantiate access to the dataset repository (DR). // This is used to fetch a dataset with a dataset ID. dset::DatasetRepository& dr = dset::DatasetRepository::default_instance(); // Instantiate access to the dataset selection catalog (DSC). // This is used to fetch a dataset ID with a dataset name. dset::DatasetSelectionCatalog& dsc = dset::DatasetSelectionCatalog::default_instance(); // Instantiate access to the dataset replica catalog (DSC). // This is used to fetch the nonvirtual datasets mapped to // a virtual dataset. dset::DatasetReplicaCatalog& drc = dset::DatasetReplicaCatalog::default_instance(); // Job creator specifies the type of jobs. // Select one. { string host = gSystem->HostName(); bool is_lxplus = host.size()>6 && host.substr(0,6)=="lxplus"; bool is_acas = host.size()>4 && host.substr(0,4)=="acas"; string lsfqueue = "dial"; if ( is_lxplus ) { lsfqueue = "8nm"; } } string lscom = "/usr/lsf/bin/lsrun"; string dlscom = Environment::initial().value("DIAL_SETUP_DIR") + "/bin/dial_lsrun"; string dlxcom = Environment::initial().value("DIAL_SETUP_DIR") + "/bin/dial_lxrun"; //dial::ProcessJobCreator cre; // Local subprocess (fork) dial::LsfJobCreator cre(lsfqueue); // LSF; argument is queue name //dial::CondorJobCreator cre; // Condor //dial::ProcessJobCreator cre(lscom); // Vanilla lsrun //dial::ProcessJobCreator cre(dlscom); // lsrun with random node selection //dial::ProcessJobCreator cre(dlxcom); // lsrun for CERN // Create local scheduler. // Master scheduler hands requests to the local scheduler. bool local_cleanup = true; dial::LocalScheduler lsch(cre, local_cleanup); // Create dataset splitter. // This maps virtual to non-virtual and creates one sub-dataset for each file. dset::SimpleEventDatasetSplitter split; // Tuning paramters for the scheduler. // Keep maxjobs small for ProcessJobCreator. // Increaese maxjobs to the # available processors. //unsigned int maxjobs = 4; // Max # concurrent jobs unsigned int maxjobs = 100; // Max # concurrent jobs unsigned int maxstart = 10; // Max # jobs to start at one time. // No effect if > maxjobs // Create master scheduler. bool auto_update = true; bool master_cleanup = false; dial::MasterScheduler msch(split, lsch, auto_update, master_cleanup, maxjobs, maxstart); // Load scripts gROOT->ProcessLine(".L submit.C"); gROOT->ProcessLine(".L evloop.C"); // Define global job ID. dial::JobId jid; // Welcome message. cout << "Welcome to DIAL demo 2" << endl; cout << " To submit a job: root> submit(appname, dataset_name)" << endl; //cout << " To monitor a job: root> evloop()" << endl; cout << " To display job: root> cout << msch.job(jid) << endl;" << endl; cout << " To fetch results: root> open_hbook()" << endl; //cout << " To monitor a job: root> evloop()" << endl; cout << "See README for more information" << endl; cout << "Questions or problems to dladams@bnl.gov" << endl; // Check the job ID generator. if ( dial::JobId::generator() == 0 || ! dial::JobId::generator()->is_global() ) { cout << "Job ID generator is absent or local" << endl; cout << "Please resolve problem before job submission" << endl; } // Check the dataset ID generator. if ( ! dset::BaseDataset::id_generator().is_valid() || ! dset::BaseDataset::id_generator()->is_global() ) { cout << "Dataset ID generator is invalid or local" << endl; cout << "Please resolve problem before job submission" << endl; } // Check the task ID generator. if ( ! dial::Task::generator().is_valid() || ! dial::Task::generator()->is_global() ) { cout << "Task ID generator is invalid or local" << endl; cout << "Please resolve problem before creating tasks" << endl; } }