Mise à jour terminée. Pour connaître les apports de la version 13.8.4 par rapport à notre ancienne version vous pouvez lire les "Release Notes" suivantes :
https://about.gitlab.com/releases/2021/02/11/security-release-gitlab-13-8-4-released/
https://about.gitlab.com/releases/2021/02/05/gitlab-13-8-3-released/

Commit a440037f authored by NICLAUSSE Nicolas's avatar NICLAUSSE Nicolas

fix dtkComposerEvaluator

parent f84dc3bb
......@@ -21,6 +21,7 @@ add_executable(${PROJECT_NAME}
${${PROJECT_NAME}_SOURCES})
target_link_libraries(${PROJECT_NAME}
dtkCoreSupport
dtkComposer
dtkDistributed
dtkLog
......
......@@ -18,67 +18,69 @@
#include <dtkDistributed>
#include <dtkComposer>
#include <dtkCore>
#include <dtkCoreSupport/dtkPluginManager.h>
#include <dtkCoreSupport/dtkAbstractProcessFactory.h>
#include <QtConcurrent>
int main(int argc, char **argv)
{
dtkDistributedApplication *application = dtkDistributed::create(argc, argv);
application->setApplicationName("dtkComposerEvaluator");
application->setApplicationVersion("1.0.0");
application->setOrganizationName("inria");
application->setOrganizationDomain("fr");
bool no_gui = dtkDistributed::app()->noGui();
bool useGUI = false;
QApplication application(argc, argv, useGUI);
application.setApplicationName("dtkComposerEvaluator");
application.setApplicationVersion("1.0.0");
application.setOrganizationName("inria");
application.setOrganizationDomain("fr");
QCommandLineParser *parser = application->parser();
parser->setApplicationDescription("DTK composer evaluator. Run the given compostion (XML file).");
QCommandLineOption pgOption("pg", "enable profiling");
parser->addOption(pgOption);
application->initialize();
// plugins
dtkDistributedSettings settings;
settings.beginGroup("communicator");
qDebug() << "initialize plugin manager "<< settings.value("plugins").toString();
dtkDistributed::communicator::pluginManager().initialize(settings.value("plugins").toString());
qDebug() << "initialization done ";
settings.endGroup();
QStringList args = parser->positionalArguments();
qDebug() << dtkDistributed::communicator::pluginManager().plugins();
qDebug() << dtkDistributed::communicator::pluginFactory().keys();
QStringList args = QCoreApplication::arguments();
if(args.count() < 2) {
qDebug() << "argv" << args;
if (args.isEmpty()) {
qDebug() << "Usage: " << argv[0] << "--spawn | [-pg] <composition> ";
return 0;
return 1;
}
dtkComposerNodeFactory *factory = new dtkComposerNodeFactory;
// /////////////////////////////////////////////////////////////////
// Old Plugin manager initialization
// /////////////////////////////////////////////////////////////////
if (args[1] == "--spawn") {
QSettings *main_settings = application->settings();
main_settings->beginGroup("plugins");
// FIXME: don't hardcode plugin
dtkDistributedPolicy policy;
//FIXME: don't use manager
// dtkDistributedWorkerManager manager;
// policy.setType("mpi3");
// manager.setPolicy(&policy);
if (main_settings->contains("path")) {
dtkPluginManager::instance()->setPath(main_settings->value("path").toString());
}
dtkComposerEvaluatorProcess p;
if (parser->isSet("verbose")) {
dtkPluginManager::instance()->setVerboseLoading(true);
}
QStringList hosts;
// dtkDistributedCommunicator *comm = manager.spawn();
// dtkDistributedCommunicator *comm ;
//manager.spawn();
main_settings->endGroup();
dtkPluginManager::instance()->initialize();
// p.setInternalCommunicator(comm);
p.setParentCommunicator(policy.communicator());
p.setFactory(factory);
p.setApplication("dtkComposerEvaluator");
dtkComposerFactory *factory = new dtkComposerFactory;
int value;
do { value = p.exec(); } while (value == 0);
// if (args[1] == "--spawn") {
return value;
}
// dtkComposerEvaluatorProcess p;
// // p.setInternalCommunicator(comm);
// p.setParentCommunicator(policy.communicator());
// p.setFactory(factory);
// p.setApplication("dtkComposerEvaluator");
// int value;
// do { value = p.exec(); } while (value == 0);
// return value;
// }
dtkComposerScene *scene = new dtkComposerScene;
dtkComposerStack *stack = new dtkComposerStack;
......@@ -97,23 +99,20 @@ int main(int argc, char **argv)
reader->setScene(scene);
reader->setGraph(graph);
int index= 1;
if (args[1] == "-pg") {
index = 2;
if (parser->isSet(pgOption)) {
evaluator->setProfiling(true);
}
if (!reader->read(argv[index])) {
qDebug() << "read failure for " << argv[index];
if (!reader->read(args.first())) {
dtkError() << "read failure for " << args.first();
return 1;
}
if (no_gui) {
evaluator->run_static();
} else {
QObject::connect(evaluator,SIGNAL(evaluationStopped()),&application, SLOT(quit()));
QObject::connect(evaluator,SIGNAL(evaluationStopped()),qApp, SLOT(quit()));
QtConcurrent::run(evaluator, &dtkComposerEvaluator::run_static, false);
application.exec();
// dtkPluginManager::instance()->uninitialize();
qApp->exec();
}
dtkPluginManager::instance()->uninitialize();
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment