Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow scram_arch and cmssw version manipulation from the ExternalLHEP… #19457

Merged
merged 1 commit into from Jul 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -26,6 +26,8 @@ echo "%MSG-MG5 random seed used for the run = $rnum"
ncpu=${4}
echo "%MSG-MG5 thread count requested = $ncpu"

echo "%MSG-MG5 residual arguments = ${@:5}"

LHEWORKDIR=`pwd`

if [[ -d lheevent ]]
Expand All @@ -40,7 +42,7 @@ mkdir lheevent; cd lheevent
tar -xaf ${path}

#generate events
./runcmsgrid.sh $nevt $rnum $ncpu
./runcmsgrid.sh $nevt $rnum $ncpu ${@:5}

mv cmsgrid_final.lhe $LHEWORKDIR/

Expand Down
Expand Up @@ -225,7 +225,8 @@ ExternalLHEProducer::beginRunProduce(edm::Run& run, edm::EventSetup const& es)

std::ostringstream eventStream;
eventStream << nEvents_;
args_.push_back(eventStream.str());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was actually wrong with using push_back and/or emplace_back?

Copy link
Contributor Author

@perrozzi perrozzi Jun 28, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The string vector args, defined in the job cfg, conventionally only contains the gridpack path (P), so args = [P].
Currently ExternalLHEProducer appends the number of events (N), random seed (S) and number of threads (T) to arg,
producing therfore args* = [P,N,S,T] which is expected by run_generic_tarball_cvmfs.sh in this order.

If one adds other parameters (O) to args in the cfg, args = [P,O] and args* = [P,O,N,S,T] therefore run_generic_tarball_cvmfs.sh breaks.
What I did was to enforce args* = [P,N,S,T,O] in ExternalLHEProducer keeping back-compatibility in run_generic_tarball_cvmfs.sh, further allowing O to be passed (whenever present) to runcmsgrid.sh with
./runcmsgrid.sh $nevt $rnum $ncpu ${@:5}
where ${@:5} means "all the arguments passed to the script starting from the 5th, i.e. O"

I tested and seems to work flawlessly, I hope is clear.
Let me know if you have further comments or questions

// args_.push_back(eventStream.str());
args_.insert(args_.begin() + 1, eventStream.str());

// pass the random number generator seed as last argument

Expand All @@ -239,9 +240,11 @@ ExternalLHEProducer::beginRunProduce(edm::Run& run, edm::EventSetup const& es)
}
std::ostringstream randomStream;
randomStream << rng->mySeed();
args_.push_back(randomStream.str());
// args_.push_back(randomStream.str());
args_.insert(args_.begin() + 2, randomStream.str());

args_.emplace_back(std::to_string(nThreads_));
// args_.emplace_back(std::to_string(nThreads_));
args_.insert(args_.begin() + 3, std::to_string(nThreads_));

for ( unsigned int iArg = 0; iArg < args_.size() ; iArg++ ) {
LogDebug("LHEInputArgs") << "arg [" << iArg << "] = " << args_[iArg];
Expand Down