119 if attribute.ifdefs==[]:
120 copy_statements +=
"""
121result.set{}( static_cast<decltype(result.get{}())>( copy.get{}() ) );
122""".format(attribute.get_accessor_name(),
123 attribute.get_accessor_name(),
124 attribute.get_accessor_name()
127 copy_statements +=
"""
129result.set{}( static_cast<decltype(result.get{}())>( copy.get{}() ) );
131""".format(construct_ifdef_string(attribute.ifdefs),
132 attribute.get_accessor_name(),
133 attribute.get_accessor_name(),
134 attribute.get_accessor_name(),
139void """ + full_qualified_name +
"""::freeForkDatatype() {
140 FlattenedType::freeForkDatatype();
143void """ + full_qualified_name +
"""::freeGlobalCommunciationDatatype() {
144 FlattenedType::freeGlobalCommunciationDatatype();
147void """ + full_qualified_name +
"""::freeJoinDatatype() {
148 FlattenedType::freeJoinDatatype();
151void """ + full_qualified_name +
"""::freeBoundaryExchangeDatatype() {
152 FlattenedType::freeBoundaryExchangeDatatype();
155void """ + full_qualified_name +
"""::freeMultiscaleDataExchangeDatatype() {
156 FlattenedType::freeMultiscaleDataExchangeDatatype();
159int """ + full_qualified_name +
"""::getSenderRank() const {
160 return _senderDestinationRank;
163void """ + full_qualified_name +
"""::initDatatype() {
164 FlattenedType::initDatatype();
167void """ + full_qualified_name +
"""::shutdownDatatype() {
168 FlattenedType::shutdownDatatype();
171void """ + full_qualified_name +
"""::send(const SmartType& buffer, int destination, int tag, MPI_Comm communicator ) {
172 FlattenedType sendReceiveObject( flatten(buffer) );
173 FlattenedType::send( sendReceiveObject, destination, tag, communicator );
176void """ + full_qualified_name +
"""::receive(SmartType& buffer, int source, int tag, MPI_Comm communicator ) {
177 FlattenedType sendReceiveObject;
178 FlattenedType::receive(sendReceiveObject, source, tag, communicator);
179 buffer = unflatten( sendReceiveObject );
180 buffer._senderDestinationRank = sendReceiveObject.getSenderRank();
183void """ + full_qualified_name +
"""::send(
184 const SmartType& buffer,
187 std::function<void()> startCommunicationFunctor,
188 std::function<void()> waitFunctor,
189 MPI_Comm communicator
191 FlattenedType sendReceiveObject( flatten(buffer) );
192 FlattenedType::send( sendReceiveObject, destination, tag, startCommunicationFunctor, waitFunctor, communicator );
195void """ + full_qualified_name +
"""::receive(
199 std::function<void()> startCommunicationFunctor,
200 std::function<void()> waitFunctor,
201 MPI_Comm communicator
203 FlattenedType sendReceiveObject;
204 FlattenedType::receive(sendReceiveObject, source, tag, startCommunicationFunctor, waitFunctor, communicator);
205 buffer = unflatten( sendReceiveObject );
206 buffer._senderDestinationRank = sendReceiveObject.getSenderRank();
210""" + full_qualified_name +
"""::FlattenedType """ + full_qualified_name +
"""::flatten(const SmartType& copy ) {
211 FlattenedType result;
212 """ + copy_statements +
"""
216""" + full_qualified_name +
"""::SmartType """ + full_qualified_name +
"""::unflatten(const FlattenedType& copy ) {
218 """ + copy_statements +
"""