Commit 68d81e7b authored by Julien Wintz's avatar Julien Wintz
Browse files

Better handling of mpi depency

parent 89d8a760
......@@ -4,9 +4,9 @@
* Copyright (C) 2012 - Nicolas Niclausse, Inria.
* Created: 2012/02/14 13:59:57
* Version: $Id$
* Last-Updated: ven. avril 13 16:25:15 2012 (+0200)
* By: Nicolas Niclausse
* Update #: 321
* Last-Updated: Wed May 16 15:18:53 2012 (+0200)
* By: Julien Wintz
* Update #: 327
*/
/* Commentary:
......@@ -17,13 +17,17 @@
*
*/
#include <dtkConfig.h>
#include "dtkComposerGraphNodeBegin.h"
#include "dtkComposerGraphNode.h"
#include "dtkComposerNode.h"
#include "dtkComposerNodeControl.h"
#include "dtkComposerNodeComposite.h"
#if defined(DTK_HAVE_MPI)
#include "dtkComposerNodeRemote.h"
#endif
#include <dtkLog/dtkLog.h>
......@@ -35,7 +39,9 @@ public:
public:
bool is_remote;
#if defined(DTK_HAVE_MPI)
dtkComposerNodeRemote *remote;
#endif
public:
dtkComposerGraphNode *end;
......@@ -46,11 +52,13 @@ dtkComposerGraphNodeBegin::dtkComposerGraphNodeBegin(dtkComposerNode *cnode, con
{
d->is_remote = false;
if (!dynamic_cast<dtkComposerNodeControl *>(cnode)) {
#if defined(DTK_HAVE_MPI)
if (dtkComposerNodeRemote *remote = dynamic_cast<dtkComposerNodeRemote *>(cnode)) {
d->is_remote = true;
d->remote = remote ;
//We can't call isSlave() now
}
#endif
d->composite = dynamic_cast<dtkComposerNodeComposite *>(cnode);
d->control_node = NULL;
} else {
......@@ -101,6 +109,7 @@ void dtkComposerGraphNodeBegin::setEnd(dtkComposerGraphNode *end)
dtkComposerGraphNodeList dtkComposerGraphNodeBegin::successors(void)
{
#if defined(DTK_HAVE_MPI)
if (d->is_remote && !d->remote->isSlave()) {
dtkDebug() << "we are running the begin statement of a remote node on a controller, successor is only the end statement";
dtkComposerGraphNodeList list;
......@@ -109,6 +118,9 @@ dtkComposerGraphNodeList dtkComposerGraphNodeBegin::successors(void)
} else {
return dtkComposerGraphNode::successors();
}
#else
return dtkComposerGraphNode::successors();
#endif
}
......@@ -4,9 +4,9 @@
* Copyright (C) 2012 - Nicolas Niclausse, Inria.
* Created: 2012/02/14 13:59:57
* Version: $Id$
* Last-Updated: ven. avril 13 16:29:45 2012 (+0200)
* By: Nicolas Niclausse
* Update #: 175
* Last-Updated: Wed May 16 15:18:29 2012 (+0200)
* By: Julien Wintz
* Update #: 183
*/
/* Commentary:
......@@ -17,13 +17,17 @@
*
*/
#include <dtkConfig.h>
#include "dtkComposerGraphNode.h"
#include "dtkComposerGraphNodeEnd.h"
#include "dtkComposerNode.h"
#include "dtkComposerNodeControl.h"
#include "dtkComposerNodeComposite.h"
#if defined(DTK_HAVE_MPI)
#include "dtkComposerNodeRemote.h"
#endif
#include <dtkLog/dtkLog.h>
......@@ -35,7 +39,9 @@ public:
public:
bool is_remote;
#if defined(DTK_HAVE_MPI)
dtkComposerNodeRemote *remote;
#endif
public:
dtkComposerGraphNode *begin;
......@@ -46,11 +52,13 @@ dtkComposerGraphNodeEnd::dtkComposerGraphNodeEnd(dtkComposerNode *cnode, const Q
{
d->is_remote = false;
if (!dynamic_cast<dtkComposerNodeControl *>(cnode)) {
#if defined(DTK_HAVE_MPI)
if (dtkComposerNodeRemote *remote = dynamic_cast<dtkComposerNodeRemote *>(cnode)) {
d->is_remote = true;
d->remote = remote ;
//We can't call isSlave() now
}
#endif
d->composite = dynamic_cast<dtkComposerNodeComposite *>(cnode);
d->control_node = NULL;
} else {
......@@ -94,6 +102,7 @@ void dtkComposerGraphNodeEnd::setBegin(dtkComposerGraphNode *begin)
dtkComposerGraphNodeList dtkComposerGraphNodeEnd::predecessors(void)
{
#if defined(DTK_HAVE_MPI)
if (d->is_remote && !d->remote->isSlave()) {
dtkDebug() << "we are running the end statement of a remote node on a controller, predecessor is only the begin statement";
dtkComposerGraphNodeList list;
......@@ -102,6 +111,9 @@ dtkComposerGraphNodeList dtkComposerGraphNodeEnd::predecessors(void)
} else {
return dtkComposerGraphNode::predecessors();
}
#else
return dtkComposerGraphNode::predecessors();
#endif
}
......@@ -4,9 +4,9 @@
* Copyright (C) 2008-2011 - Julien Wintz, Inria.
* Created: Fri Feb 3 14:01:41 2012 (+0100)
* Version: $Id$
* Last-Updated: Thu May 10 12:16:35 2012 (+0200)
* Last-Updated: Wed May 16 15:21:12 2012 (+0200)
* By: Julien Wintz
* Update #: 846
* Update #: 855
*/
/* Commentary:
......@@ -17,6 +17,8 @@
*
*/
#include <dtkConfig.h>
#include "dtkComposerNodeComposite.h"
#include "dtkComposerSceneEdge.h"
#include "dtkComposerSceneNode.h"
......@@ -26,12 +28,14 @@
#include "dtkComposerScenePort.h"
#include "dtkComposerWriter.h"
#if defined(DTK_HAVE_MPI)
#include "dtkComposerNodeRemote.h"
#endif
#include <dtkLog/dtkLog.h>
#include <dtkConfig.h>
#include "dtkComposerNodeRemote.h"
#include <dtkDistributed/dtkDistributedController.h>
#include <dtkDistributed/dtkDistributedMimeData.h>
......@@ -599,12 +603,14 @@ void dtkComposerSceneNodeComposite::paint(QPainter *painter, const QStyleOptionG
void dtkComposerSceneNodeComposite::dragEnterEvent(QGraphicsSceneDragDropEvent *event)
{
#if defined(DTK_HAVE_MPI)
dtkComposerNodeRemote *remote = dynamic_cast<dtkComposerNodeRemote *>(this->wrapee());
if(!remote) {
event->ignore();
return;
}
#endif
if (event->mimeData()->hasText())
event->acceptProposedAction();
......@@ -619,12 +625,14 @@ void dtkComposerSceneNodeComposite::dragLeaveEvent(QGraphicsSceneDragDropEvent *
void dtkComposerSceneNodeComposite::dragMoveEvent(QGraphicsSceneDragDropEvent *event)
{
#if defined(DTK_HAVE_MPI)
dtkComposerNodeRemote *remote = dynamic_cast<dtkComposerNodeRemote *>(this->wrapee());
if(!remote) {
event->ignore();
return;
}
#endif
if (event->mimeData()->hasText())
event->acceptProposedAction();
......@@ -634,12 +642,14 @@ void dtkComposerSceneNodeComposite::dragMoveEvent(QGraphicsSceneDragDropEvent *e
void dtkComposerSceneNodeComposite::dropEvent(QGraphicsSceneDragDropEvent *event)
{
#if defined(DTK_HAVE_MPI)
dtkComposerNodeRemote *remote = dynamic_cast<dtkComposerNodeRemote *>(this->wrapee());
if(!remote) {
event->ignore();
return;
}
#endif
const dtkDistributedMimeData *data = qobject_cast<const dtkDistributedMimeData *>(event->mimeData());
......
......@@ -4,9 +4,9 @@
* Copyright (C) 2011 - Thibaud Kloczko, Inria.
* Created: Tue Feb 14 12:56:04 2012 (+0100)
* Version: $Id$
* Last-Updated: Wed May 16 12:04:05 2012 (+0200)
* By: tkloczko
* Update #: 220
* Last-Updated: Wed May 16 14:20:43 2012 (+0200)
* By: Julien Wintz
* Update #: 226
*/
/* Commentary:
......@@ -25,6 +25,8 @@
#include <dtkCore/dtkGlobal.h>
#include <QtCore>
// /////////////////////////////////////////////////////////////////
// dtkComposerTransmitterReceiver implementation
// /////////////////////////////////////////////////////////////////
......@@ -208,7 +210,9 @@ template <typename T> bool dtkComposerTransmitterReceiver<T>::connect(dtkCompose
if (transmitter->kind() == Emitter) {
if ((emitter = dynamic_cast<dtkComposerTransmitterEmitter<T> *>(transmitter))) {
if (!emitters.contains(emitter)) {
emitters << emitter;
active_emitter = emitter;
active_variant = NULL;
......
......@@ -4,9 +4,9 @@
* Copyright (C) 2008-2011 - Julien Wintz, Inria.
* Created: Mon Jan 30 23:42:34 2012 (+0100)
* Version: $Id$
* Last-Updated: Thu Apr 26 15:11:21 2012 (+0200)
* Last-Updated: Wed May 16 12:50:21 2012 (+0200)
* By: Julien Wintz
* Update #: 484
* Update #: 486
*/
/* Commentary:
......@@ -52,8 +52,6 @@ public:
int id;
};
dtkComposerWriter::dtkComposerWriter(void) : d(new dtkComposerWriterPrivate)
{
d->id = 0;
......@@ -379,8 +377,6 @@ QDomElement dtkComposerWriter::writeEdge(dtkComposerSceneEdge *edge, QDomElement
tag.appendChild(source);
tag.appendChild(destin);
// element.appendChild(tag);
return tag;
}
......
Supports Markdown
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