Page MenuHomec4science

synchronizer_impl.hh
No OneTemporary

File Metadata

Created
Sat, May 4, 02:57

synchronizer_impl.hh

/**
* @file synchronizer_impl.hh
*
* @author Nicolas Richart <nicolas.richart@epfl.ch>
*
* @date Wed Aug 24 13:26:47 2016
*
* @brief Implementation of the generic part of synchronizers
*
* @section LICENSE
*
* Copyright (©) 2010-2011 EPFL (Ecole Polytechnique Fédérale de Lausanne)
* Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides)
*
* Akantu is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version.
*
* Akantu is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
* A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Akantu. If not, see <http://www.gnu.org/licenses/>.
*
*/
/* -------------------------------------------------------------------------- */
#include "communications.hh"
#include "synchronizer.hh"
/* -------------------------------------------------------------------------- */
#ifndef __AKANTU_SYNCHRONIZER_IMPL_HH__
#define __AKANTU_SYNCHRONIZER_IMPL_HH__
namespace akantu {
template <class Entity> class SynchronizerImpl : public Synchronizer {
/* ------------------------------------------------------------------------ */
/* Constructors/Destructors */
/* ------------------------------------------------------------------------ */
public:
SynchronizerImpl(
const ID & id = "synchronizer", MemoryID memory_id = 0,
StaticCommunicator & comm = StaticCommunicator::getStaticCommunicator());
virtual ~SynchronizerImpl(){};
/* ------------------------------------------------------------------------ */
/* Methods */
/* ------------------------------------------------------------------------ */
public:
/// asynchronous synchronization of ghosts
virtual void
asynchronousSynchronizeImpl(DataAccessor<Entity> & data_accessor,
const SynchronizationTag & tag);
/// wait end of asynchronous synchronization of ghosts
virtual void waitEndSynchronizeImpl(DataAccessor<Entity> & data_accessor,
const SynchronizationTag & tag);
/// compute all buffer sizes
virtual void computeAllBufferSizes(DataAccessor<Entity> & data_accessor);
/// compute buffer size for a given tag and data accessor
virtual void computeBufferSizeImpl(DataAccessor<Entity> & data_accessor,
const SynchronizationTag & tag);
/* ------------------------------------------------------------------------ */
virtual void synchronizeImpl(DataAccessor<Entity> & data_accessor,
const SynchronizationTag & tag) {
this->asynchronousSynchronizeImpl(data_accessor, tag);
this->waitEndSynchronizeImpl(data_accessor, tag);
}
/* ------------------------------------------------------------------------ */
virtual UInt sanityCheckDataSize(const Array<Entity> & elements,
const SynchronizationTag & tag) const;
virtual void
packSanityCheckData(CommunicationDescriptor<Entity> & comm_desc) const;
virtual void
unpackSanityCheckData(CommunicationDescriptor<Entity> & comm_desc) const;
public:
AKANTU_GET_MACRO(Communications, communications, const Communications<Entity> &);
protected:
AKANTU_GET_MACRO_NOT_CONST(Communications, communications, Communications<Entity> &);
/* ------------------------------------------------------------------------ */
/* Class Members */
/* ------------------------------------------------------------------------ */
protected:
/// information on the communications
Communications<Entity> communications;
};
} // akantu
#include "synchronizer_impl_tmpl.hh"
#endif /* __AKANTU_SYNCHRONIZER_IMPL_HH__ */

Event Timeline