Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hep-workloads
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Christopher Henry Hollowell
hep-workloads
Commits
b15be79f
Commit
b15be79f
authored
5 years ago
by
Andrea Sciaba
Browse files
Options
Downloads
Patches
Plain Diff
Calculating no. of events in input file
parent
c8a50cbf
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cms/digi/cms-digi/cms-digi-bmk.sh
+30
-0
30 additions, 0 deletions
cms/digi/cms-digi/cms-digi-bmk.sh
with
30 additions
and
0 deletions
cms/digi/cms-digi/cms-digi-bmk.sh
+
30
−
0
View file @
b15be79f
...
@@ -36,6 +36,25 @@ function doOne(){
...
@@ -36,6 +36,25 @@ function doOne(){
return
$status
return
$status
}
}
function
getEvents
(){
export
CMSSW_RELEASE
=
CMSSW_10_2_9
export
VO_CMS_SW_DIR
=
/cvmfs/cms.cern.ch
source
$VO_CMS_SW_DIR
/cmsset_default.sh
export
SCRAM_ARCH
=
slc6_amd64_gcc700
[[
!
-e
${
CMSSW_RELEASE
}
]]
&&
scram project CMSSW
${
CMSSW_RELEASE
}
&> /dev/null
(
pushd
${
CMSSW_RELEASE
}
;
eval
`
scramv1 runtime
-sh
`
;
popd
)
&> /dev/null
ln
-s
${
BMKDIR
}
/data/
*
.root
.
evts
=
`
python
-c
"import ROOT;f=ROOT.TFile.Open('gensim.root');print f.Get('Events').GetEntries();"
`
STATUS
=
$?
rm
-rf
${
CMSSW_RELEASE
}
rm
-f
gensim.root
if
[[
$STATUS
!=
0
]]
;
then
return
0
else
return
$evts
fi
}
# Optional function validateInputArguments may be defined in each benchmark
# Optional function validateInputArguments may be defined in each benchmark
# If it exists, it is expected to set NCOPIES, NTHREADS, NEVENTS_THREAD
# If it exists, it is expected to set NCOPIES, NTHREADS, NEVENTS_THREAD
# (based on previous defaults and on user inputs USER_NCOPIES, USER_NTHREADS, USER_NEVENTS_THREADS)
# (based on previous defaults and on user inputs USER_NCOPIES, USER_NTHREADS, USER_NEVENTS_THREADS)
...
@@ -59,6 +78,17 @@ function validateInputArguments(){
...
@@ -59,6 +78,17 @@ function validateInputArguments(){
fi
fi
# Number of events per thread
# Number of events per thread
if
[
"
$USER_NEVENTS_THREAD
"
!=
""
]
;
then
NEVENTS_THREAD
=
$USER_NEVENTS_THREAD
;
fi
if
[
"
$USER_NEVENTS_THREAD
"
!=
""
]
;
then
NEVENTS_THREAD
=
$USER_NEVENTS_THREAD
;
fi
# Extract number of events in input file
getEvents
evts
=
$?
if
[[
$evts
==
0
]]
;
then
s_msg
=
"[ERROR] Cannot extract number of events from input file"
return
1
fi
if
[[
$((
NEVENTS_THREAD
*
NTHREADS
))
-gt
$evts
]]
;
then
s_msg
=
"[ERROR] Requested number of events (
$((
NEVENTS_THREAD
*
NTHREADS
))
) exceeds number of input events (
$evts
)"
return
1
fi
# Return 0 if input arguments are valid, 1 otherwise
# Return 0 if input arguments are valid, 1 otherwise
# Report any issues to parseResults via s_msg
# Report any issues to parseResults via s_msg
export
s_msg
=
"ok"
export
s_msg
=
"ok"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment