MAJ terminée. Nous sommes passés en version 14.6.2 . Pour consulter les "releases notes" associées c'est ici :

https://about.gitlab.com/releases/2022/01/11/security-release-gitlab-14-6-2-released/
https://about.gitlab.com/releases/2022/01/04/gitlab-14-6-1-released/

Commit 9198d347 authored by KLOCZKO Thibaud's avatar KLOCZKO Thibaud
Browse files

Merge master.

parent 90a62a35
......@@ -3,9 +3,9 @@
* Author: Julien Wintz
* Created: Fri Feb 8 16:20:47 2013 (+0100)
* Version:
* Last-Updated: Thu Feb 28 15:50:06 2013 (+0100)
* By: Julien Wintz
* Update #: 66
* Last-Updated: 2013 Thu Feb 28 20:00:19 (+0100)
* By: Thibaud Kloczko
* Update #: 67
*/
/* Change Log:
......
......@@ -21,7 +21,7 @@ class dtkDistributedCommunicator;
//
// /////////////////////////////////////////////////////////////////
template<typename T> dtkDistributedArray<T>::dtkDistributedArray(const qlonglong& count, dtkDistributedWorker *worker) : m_handler(new dtkDistributedArrayHandler<T>(count, worker))
template<typename T> dtkDistributedArray<T>::dtkDistributedArray(const qlonglong& count, dtkDistributedWorker *worker) : m_handler(new dtkDistributedArrayHandler<T>(this, count, worker))
{
}
......
......@@ -28,7 +28,7 @@ class dtkDistributedWorker;
template <typename T> class dtkDistributedArrayHandler
{
public:
inline dtkDistributedArrayHandler(const qlonglong& count, dtkDistributedWorker *worker);
inline dtkDistributedArrayHandler(dtkDistributedArray<T> *array, const qlonglong& count, dtkDistributedWorker *worker);
inline ~dtkDistributedArrayHandler(void);
public:
......@@ -129,6 +129,7 @@ private:
private:
friend class dtkDistributedArray<T>;
dtkDistributedArray<T> *m_array;
};
// ///////////////////////////////////////////////////////////////////
......
......@@ -22,7 +22,7 @@
//
// /////////////////////////////////////////////////////////////////
template <typename T> dtkDistributedArrayHandler<T>::dtkDistributedArrayHandler(const qlonglong& count, dtkDistributedWorker *worker) : m_mapper(new dtkDistributedMapper), m_worker(worker), m_wid(worker->wid()), m_count(count), m_comm(worker->communicator())
template <typename T> dtkDistributedArrayHandler<T>::dtkDistributedArrayHandler(dtkDistributedArray<T> *array, const qlonglong& count, dtkDistributedWorker *worker) : m_mapper(new dtkDistributedMapper), m_worker(worker), m_wid(worker->wid()), m_count(count), m_comm(worker->communicator()), m_array(array)
{
this->initialize();
}
......@@ -31,15 +31,19 @@ template <typename T> dtkDistributedArrayHandler<T>::~dtkDistributedArrayHandler
{
m_comm->deallocate( m_wid, m_buffer_id);
m_worker->unrecord(m_array);
if (m_mapper)
delete m_mapper;
}
template <typename T> void dtkDistributedArrayHandler<T>::initialize(void)
{
m_worker->record(m_array);
m_mapper->setMapping(m_count, m_comm->size());
m_buffer_count = m_mapper->count(m_wid);
m_buffer_id = m_worker->containerId();
m_buffer_id = m_worker->containerId(m_array);
m_buffer = static_cast<T*>(m_comm->allocate(m_buffer_count, sizeof(T), m_wid, m_buffer_id));
}
......
......@@ -78,7 +78,9 @@ void dtkDistributedCommunicator::uninitialize(void)
void dtkDistributedCommunicator::spawn(QStringList hostnames, qlonglong np, dtkDistributedWorker& worker)
{
qDebug() << "PROUT";
}
void dtkDistributedCommunicator::unspawn(void)
{
}
......@@ -95,6 +97,8 @@ void dtkDistributedCommunicator::barrier(void)
int dtkDistributedCommunicator::pid(void)
{
qDebug() << "Default impl.";
return 0;
}
......
......@@ -67,7 +67,7 @@ public:
dtkDistributedCommunicatorPrivate *d;
};
DTK_DECLARE_OBJECT(dtkDistributedCommunicator)
DTK_DECLARE_OBJECT(dtkDistributedCommunicator*)
DTK_DECLARE_PLUGIN(dtkDistributedCommunicator)
DTK_DECLARE_PLUGIN_FACTORY(dtkDistributedCommunicator)
DTK_DECLARE_PLUGIN_MANAGER(dtkDistributedCommunicator)
......
......@@ -14,30 +14,45 @@
#pragma once
#include <dtkDistributed>
#include "dtkDistributedWorker.h"
class dtkDistributedMode;
class dtkDistributedPolicy;
// /////////////////////////////////////////////////////////////////
// dtkDistributedContainerBase interface
// /////////////////////////////////////////////////////////////////
template<typename T> class dtkDistributedIterator;
class dtkDistributedContainerBase
{
public:
virtual ~dtkDistributedContainerBase(void) { ;}//w->unrecord(this); }
public:
//virtual void setMode(const dtkDistributed::Mode& mode) = 0;
public:
inline void record(dtkDistributedWorker *worker);
private:
dtkDistributedWorker *w;
};
void dtkDistributedContainerBase::record(dtkDistributedWorker *worker)
{
w = worker;
worker->record(this);
};
// /////////////////////////////////////////////////////////////////
// dtkDistributedContainer interface
// /////////////////////////////////////////////////////////////////
class dtkDistributedCommunicator;
class dtkDistributedMapper;
template<typename T> class dtkDistributedIterator;
template<typename T> class dtkDistributedContainer
template<typename T> class dtkDistributedContainer : public dtkDistributedContainerBase
{
public:
dtkDistributedContainer(void) {;}
virtual ~dtkDistributedContainer(void) {;}
public:
// virtual void setMode(dtkDistributedMode *mode) { Q_UNUSED(mode); }
// virtual void setPolicy(dtkDistributedPolicy *policy) { Q_UNUSED(policy); }
public:
virtual void clear(void) = 0;
......@@ -52,7 +67,7 @@ public:
// virtual qlonglong count(const T& value) const = 0;
public:
// virtual dtkDistributedIterator<T>& iterator(void) = 0;
virtual dtkDistributedIterator<T> iterator(void) = 0;
};
// ///////////////////////////////////////////////////////////////////
......
......@@ -65,10 +65,12 @@ void dtkDistributedPolicy::setType(dtkDistributedPolicy::Type type)
case dtkDistributedPolicy::MP :
qDebug() << "create mpi communicator";
d->comm = dtkDistributed::communicator::pluginFactory().create("mpi");
qDebug() << d->comm->pid();
break;
case dtkDistributedPolicy::MT :
qDebug() << "create qthread communicator";
d->comm = dtkDistributed::communicator::pluginFactory().create("qthread");
qDebug() << d->comm->pid();
break;
default:
qDebug() << "unkwown policy ";
......
......@@ -22,7 +22,6 @@ class dtkDistributedCommunicator;
class dtkDistributedPolicy : public QObject
{
Q_OBJECT
public:
......
......@@ -30,7 +30,10 @@ class dtkDistributedWorkerPrivate
public:
qlonglong wid;
qlonglong wct;
qlonglong container_id;
qlonglong container_count;
public:
QHash<dtkDistributedContainerBase*, qlonglong> containers;
public:
dtkDistributedCommunicator *comm;
......@@ -48,7 +51,7 @@ dtkDistributedWorker::dtkDistributedWorker(void) : QRunnable(), d(new dtkDistrib
d->work = NULL;
d->wid = -1;
d->wct = 0;
d->container_id = 0;
d->container_count = 0;
this->setAutoDelete(false);
}
......@@ -70,7 +73,7 @@ dtkDistributedWorker::dtkDistributedWorker(const dtkDistributedWorker& other): Q
d->comm = other.d->comm;
d->work = NULL;
this->setAutoDelete(false);
d->container_id = 0; // do not share containers id
d->container_count = 0; // do not share containers count
}
dtkDistributedWorker& dtkDistributedWorker::operator = (const dtkDistributedWorker& other)
......@@ -78,7 +81,7 @@ dtkDistributedWorker& dtkDistributedWorker::operator = (const dtkDistributedWork
d->wid = other.d->wid;
d->wct = other.d->wct;
d->comm = other.d->comm;
d->container_id = 0; // do not share containers id
d->container_count = 0; // do not share containers count
return (*this);
}
......@@ -107,9 +110,19 @@ qlonglong dtkDistributedWorker::wct(void)
return d->wct;
}
qlonglong dtkDistributedWorker::containerId(void)
void dtkDistributedWorker::record(dtkDistributedContainerBase *container)
{
d->containers.insert(container, d->container_count++);
}
void dtkDistributedWorker::unrecord(dtkDistributedContainerBase *container)
{
d->containers.remove(container);
}
qlonglong dtkDistributedWorker::containerId(dtkDistributedContainerBase *container)
{
return d->container_id++;
return d->containers.value(container);
}
void dtkDistributedWorker::setWork(dtkDistributedWork *work)
......
......@@ -18,6 +18,7 @@
#include <QtCore>
class dtkDistributedCommunicator;
class dtkDistributedContainerBase;
class dtkDistributedWork;
class dtkDistributedWorkerPrivate;
......@@ -48,7 +49,10 @@ public:
qlonglong wct(void);
public:
qlonglong containerId(void);
void record(dtkDistributedContainerBase *container);
void unrecord(dtkDistributedContainerBase *container);
qlonglong containerId(dtkDistributedContainerBase *container);
public:
bool master(void);
......
......@@ -289,9 +289,9 @@ void dtkDistributedContainerTestCase::testAll(void)
manager.spawn();
manager.exec(work);
manager.exec(work2);
//manager.exec(work2);
manager.exec(work3);
//manager.exec(work3);
manager.unspawn();
......
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