Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Gaudi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
Gaudi
Gaudi
Commits
fe423d35
Commit
fe423d35
authored
2 years ago
by
Marco Clemencic
Browse files
Options
Downloads
Plain Diff
Add support for .json options to Gaudi.exe
See merge request
gaudi/Gaudi!1388
parents
aeb7cf6c
c97e0f4c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1388
Add support for .json options to Gaudi.exe
Pipeline
#4759574
canceled
2 years ago
Stage: pre-build-checks
Stage: build
Stage: test
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GaudiCoreSvc/CMakeLists.txt
+2
-1
2 additions, 1 deletion
GaudiCoreSvc/CMakeLists.txt
GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp
+12
-1
12 additions, 1 deletion
GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp
with
14 additions
and
2 deletions
GaudiCoreSvc/CMakeLists.txt
+
2
−
1
View file @
fe423d35
#####################################################################################
# (c) Copyright 1998-202
1
CERN for the benefit of the LHCb and ATLAS collaborations #
# (c) Copyright 1998-202
2
CERN for the benefit of the LHCb and ATLAS collaborations #
# #
# This software is distributed under the terms of the Apache version 2 licence, #
# copied verbatim in the file "LICENSE". #
...
...
@@ -57,6 +57,7 @@ gaudi_add_module(GaudiCoreSvc
Boost::regex
Boost::system
Boost::thread
nlohmann_json::nlohmann_json
TBB::tbb
${
rt_LIBRARY
}
# UNIX only
${
GAUDI_ATOMIC_LIBS
}
)
...
...
This diff is collapsed.
Click to expand it.
GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp
+
12
−
1
View file @
fe423d35
...
...
@@ -21,6 +21,7 @@
#include
<Gaudi/Property.h>
#include
<GaudiKernel/IProperty.h>
#include
<GaudiKernel/MsgStream.h>
#include
<GaudiKernel/PathResolver.h>
#include
<GaudiKernel/PropertyHolder.h>
#include
<GaudiKernel/Service.h>
#include
<GaudiKernel/StatusCode.h>
...
...
@@ -28,6 +29,7 @@
#include
<algorithm>
#include
<functional>
#include
<memory>
#include
<nlohmann/json.hpp>
#include
<string>
#include
<unordered_map>
#include
<vector>
...
...
@@ -233,10 +235,19 @@ void JobOptionsSvc::fillServiceCatalog( const gp::Catalog& catalog ) {
StatusCode
JobOptionsSvc
::
readOptions
(
std
::
string_view
file
,
std
::
string_view
path
)
{
std
::
string
search_path
=
std
::
string
{
path
};
if
(
search_path
.
empty
()
&&
!
m_dir_search_path
.
empty
()
)
{
search_path
=
m_dir_search_path
;
}
//
if
(
msgLevel
(
MSG
::
DEBUG
)
)
debug
()
<<
"Reading options from the file "
<<
"'"
<<
file
<<
"'"
<<
endmsg
;
if
(
file
.
size
()
>=
5
&&
file
.
substr
(
file
.
size
()
-
5
)
==
".json"
)
{
nlohmann
::
json
opts
;
std
::
ifstream
input
(
System
::
PathResolver
::
find_file
(
std
::
string
(
file
),
std
::
string
(
path
)
)
);
input
>>
opts
;
for
(
auto
item
=
opts
.
begin
();
item
!=
opts
.
end
();
++
item
)
{
set
(
item
.
key
(),
item
.
value
().
get
<
std
::
string
>
()
);
}
return
StatusCode
::
SUCCESS
;
}
gp
::
Messages
messages
(
msgStream
()
);
gp
::
Catalog
catalog
;
gp
::
Units
units
;
...
...
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