Skip to content

Commit

Permalink
Merge pull request #26278 from davidlange6/pybind11_190328
Browse files Browse the repository at this point in the history
move to pybind11 parameteset reader as default. fix some buildfiles
  • Loading branch information
cmsbuild committed Mar 29, 2019
2 parents e97a97f + 1d97cf3 commit 88fc537
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 18 deletions.
5 changes: 3 additions & 2 deletions FWCore/Framework/bin/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<use name="FWCore/ParameterSet"/>
<use name="FWCore/ParameterSetReader"/>
</bin>
<bin name="cmsRunPyDev" file="cmsRunPyDev.cpp">
<bin name="cmsRunBoostPython" file="cmsRunBoostPython.cpp">
<use name="tbb"/>
<use name="boost"/>
<use name="boost_program_options"/>
Expand All @@ -84,5 +84,6 @@
<use name="FWCore/ServiceRegistry"/>
<use name="FWCore/Utilities"/>
<use name="FWCore/ParameterSet"/>
<use name="FWCore/PyDevParameterSet"/>
<use name="FWCore/PythonParameterSet"/>
<use name="boost_python"/>
</bin>
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ PSet script. See notes in EventProcessor.cpp for details about it.
#include "FWCore/Utilities/interface/ConvertException.h"
#include "FWCore/Utilities/interface/Presence.h"
#include "FWCore/Utilities/interface/TimingServiceBase.h"
#include "FWCore/PyDevParameterSet/interface/MakePyBind11ParameterSets.h"
#include "FWCore/PythonParameterSet/interface/MakeParameterSets.h"
#include "TError.h"

#include "boost/program_options.hpp"
Expand Down Expand Up @@ -277,7 +277,7 @@ int main(int argc, char* argv[]) {
context += fileName;
std::shared_ptr<edm::ProcessDesc> processDesc;
try {
std::unique_ptr<edm::ParameterSet> parameterSet = edm::cmspybind11::readConfig(fileName, argc, argv);
std::unique_ptr<edm::ParameterSet> parameterSet = edm::boost_python::readConfig(fileName, argc, argv);
processDesc.reset(new edm::ProcessDesc(std::move(parameterSet)));
}
catch(cms::Exception& iException) {
Expand Down
2 changes: 1 addition & 1 deletion FWCore/Framework/test/eventprocessor_t.cppunit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ class testeventprocessor: public CppUnit::TestFixture {
CPPUNIT_TEST(beginEndTest);
CPPUNIT_TEST(cleanupJobTest);
CPPUNIT_TEST(activityRegistryTest);
CPPUNIT_TEST(moduleFailureTest);
CPPUNIT_TEST(endpathTest);
CPPUNIT_TEST(serviceConfigSaveTest);
CPPUNIT_TEST(moduleFailureTest);
CPPUNIT_TEST_SUITE_END();

public:
Expand Down
1 change: 1 addition & 0 deletions FWCore/Integration/test/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
<bin file="SwitchProducer_t.cpp">
<use name="FWCore/Framework"/>
<use name="FWCore/ParameterSet"/>
<use name="FWCore/PythonParameterSet"/>
<use name="FWCore/TestProcessor"/>
<use name="DataFormats/Provenance"/>
<use name="catch2"/>
Expand Down
4 changes: 2 additions & 2 deletions FWCore/ParameterSetReader/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<use name="FWCore/ParameterSet"/>
<use name="FWCore/PythonParameterSet"/>
<use name="FWCore/PyDevParameterSet"/>
<export>
<use name="boost_python"/>
<lib name="1"/>
<use name="py2-pybind11"/>
</export>
4 changes: 2 additions & 2 deletions FWCore/ParameterSetReader/interface/ProcessDescImpl.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#ifndef FWCore_Framework_ProcessDescImpl_h
#define FWCore_Framework_ProcessDescImpl_h

#include "FWCore/PythonParameterSet/interface/PythonProcessDesc.h"
#include "FWCore/PyDevParameterSet/interface/PyBind11ProcessDesc.h"

using ProcessDescImpl = PythonProcessDesc;
using ProcessDescImpl = PyBind11ProcessDesc;

#endif

14 changes: 7 additions & 7 deletions FWCore/ParameterSetReader/src/ParameterSetReader.cc
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
#include "FWCore/ParameterSetReader/interface/ParameterSetReader.h"
#include "FWCore/PythonParameterSet/interface/PythonProcessDesc.h"
#include "FWCore/PythonParameterSet/interface/MakeParameterSets.h"
#include "FWCore/PyDevParameterSet/interface/PyBind11ProcessDesc.h"
#include "FWCore/PyDevParameterSet/interface/MakePyBind11ParameterSets.h"

std::unique_ptr<edm::ParameterSet> edm::getPSetFromConfig(const std::string &config) {
return PythonProcessDesc(config).parameterSet();
return PyBind11ProcessDesc(config).parameterSet();
}


//its really the stuff in MakePythonParameterSets that should be in the different namespace
//I'll do that if this setup is ok
std::unique_ptr<edm::ParameterSet> edm::readConfig(std::string const& config, int argc, char* argv[]) {
return edm::boost_python::readConfig(config,argc,argv);
return edm::cmspybind11::readConfig(config,argc,argv);
}

std::unique_ptr<edm::ParameterSet> edm::readConfig(std::string const& config) {
return edm::boost_python::readConfig(config);
return edm::cmspybind11::readConfig(config);
}

void edm::makeParameterSets(std::string const& configtext,
std::unique_ptr<ParameterSet> & main) {
edm::boost_python::makeParameterSets(configtext,main);
edm::cmspybind11::makeParameterSets(configtext,main);
}

std::unique_ptr<edm::ParameterSet> edm::readPSetsFrom(std::string const& fileOrString) {
return edm::boost_python::readPSetsFrom(fileOrString);
return edm::cmspybind11::readPSetsFrom(fileOrString);
}
3 changes: 1 addition & 2 deletions FWCore/TestProcessor/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<use name="FWCore/Framework"/>
<use name="FWCore/PythonParameterSet"/>
<use name="FWCore/ParameterSetReader"/>
<use name="boost"/>
<use name="boost_python"/>
<export>
<lib name="1"/>
</export>

0 comments on commit 88fc537

Please sign in to comment.