- Removed CPUPolicyManager::init(), it was deprecated
git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@953 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
parent
c30a3674f2
commit
9e61332a12
5 changed files with 7 additions and 37 deletions
|
@ -61,27 +61,10 @@ private:
|
|||
|
||||
|
||||
PythonCPUPolicyManager::PythonCPUPolicyManager()
|
||||
: _initialized(false)
|
||||
{
|
||||
PyEval_InitThreads();
|
||||
}
|
||||
|
||||
|
||||
PythonCPUPolicyManager::~PythonCPUPolicyManager()
|
||||
{
|
||||
for_each(_policies.begin(), _policies.end(), memory::deletor<CPUPolicy>());
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
PythonCPUPolicyManager::init()
|
||||
{
|
||||
if (_initialized)
|
||||
// No-op
|
||||
return;
|
||||
|
||||
Py_Initialize();
|
||||
_initialized = true;
|
||||
|
||||
// The following lines are ugly, but necessary if we use
|
||||
// non-standard installation directories. Theoretically,
|
||||
|
@ -103,6 +86,13 @@ PythonCPUPolicyManager::init()
|
|||
collect_policies();
|
||||
}
|
||||
|
||||
|
||||
PythonCPUPolicyManager::~PythonCPUPolicyManager()
|
||||
{
|
||||
for_each(_policies.begin(), _policies.end(), memory::deletor<CPUPolicy>());
|
||||
}
|
||||
|
||||
|
||||
const vector<CPUPolicy*>&
|
||||
PythonCPUPolicyManager::get_avail_policies()
|
||||
{
|
||||
|
|
|
@ -44,13 +44,6 @@ namespace sgpem
|
|||
PythonCPUPolicyManager();
|
||||
~PythonCPUPolicyManager();
|
||||
|
||||
/** \brief Initialize the Python interpreter.
|
||||
*
|
||||
* If the interpreter has already been initialized, it terminates it, cleanups old policies,
|
||||
* and restarts it.
|
||||
*/
|
||||
void init();
|
||||
|
||||
const std::vector<CPUPolicy*>& get_avail_policies();
|
||||
|
||||
protected:
|
||||
|
@ -60,8 +53,6 @@ namespace sgpem
|
|||
private:
|
||||
PythonCPUPolicyManager(const PythonCPUPolicyManager&);
|
||||
PythonCPUPolicyManager& operator=(const PythonCPUPolicyManager&);
|
||||
|
||||
bool _initialized;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -70,7 +70,6 @@ main(int argc, char** argv)
|
|||
|
||||
// Self-register itself to PoliciesGatekeeper, however we don't care about it
|
||||
PythonCPUPolicyManager polman;
|
||||
polman.init();
|
||||
|
||||
Simulation& sim = Simulation::get_instance();
|
||||
History& his = sim.get_history();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue