Last change
on this file since 1322 was
814,
checked in by mhnguyen, 9 years ago
|
Correcting a bug on compilation with Intel whose version < 13.1
+) Use sizeof with type.
Test
+) On Curie
+) Compilation succeds with Intel: 12.1.9, 13.1.3 and version > 14
|
-
Property copyright set to
Software name : XIOS (Xml I/O Server) http://forge.ipsl.jussieu.fr/ioserver Creation date : January 2009 Licence : CeCCIL version2 see license file in root directory : Licence_CeCILL_V2-en.txt or http://www.cecill.info/licences/Licence_CeCILL_V2-en.html Holder : CEA/LSCE (Laboratoire des Sciences du CLimat et de l'Environnement) CNRS/IPSL (Institut Pierre Simon Laplace) Project Manager : Yann Meurdesoif yann.meurdesoif@cea.fr
-
Property svn:eol-style set to
native
|
File size:
1.5 KB
|
Rev | Line | |
---|
[591] | 1 | #include "xios_spl.hpp" |
---|
[300] | 2 | #include "event_client.hpp" |
---|
| 3 | #include "buffer_out.hpp" |
---|
| 4 | #include "message.hpp" |
---|
| 5 | #include "type.hpp" |
---|
[382] | 6 | #include "mpi.hpp" |
---|
[300] | 7 | |
---|
[335] | 8 | namespace xios |
---|
[300] | 9 | { |
---|
[814] | 10 | const size_t CEventClient::headerSize = sizeof(int) + sizeof(size_t) + sizeof(int) + sizeof(int) + sizeof(int); // The two last one signify sizeof(classId) and sizeof(typeId) |
---|
[731] | 11 | |
---|
[814] | 12 | |
---|
[731] | 13 | CEventClient::CEventClient(int classId_, int typeId_) |
---|
[300] | 14 | { |
---|
[731] | 15 | classId = classId_; |
---|
| 16 | typeId = typeId_; |
---|
[300] | 17 | } |
---|
[731] | 18 | |
---|
| 19 | void CEventClient::push(int rank, int nbSender, CMessage& msg) |
---|
[300] | 20 | { |
---|
[731] | 21 | nbSenders.push_back(nbSender); |
---|
| 22 | ranks.push_back(rank); |
---|
| 23 | messages.push_back(&msg); |
---|
[300] | 24 | } |
---|
| 25 | |
---|
| 26 | bool CEventClient::isEmpty(void) |
---|
| 27 | { |
---|
[731] | 28 | return ranks.empty(); |
---|
[300] | 29 | } |
---|
| 30 | |
---|
[731] | 31 | std::list<int> CEventClient::getRanks(void) |
---|
[300] | 32 | { |
---|
[731] | 33 | return ranks; |
---|
[300] | 34 | } |
---|
[731] | 35 | |
---|
| 36 | std::list<int> CEventClient::getSizes(void) |
---|
[300] | 37 | { |
---|
[731] | 38 | std::list<CMessage*>::iterator it; |
---|
| 39 | std::list<int> sizes; |
---|
| 40 | |
---|
| 41 | for (it = messages.begin(); it != messages.end(); ++it) sizes.push_back((*it)->size() + headerSize); |
---|
| 42 | return sizes; |
---|
[300] | 43 | } |
---|
[731] | 44 | |
---|
| 45 | void CEventClient::send(size_t timeLine, const std::list<int>& sizes, std::list<CBufferOut*>& buffers) |
---|
[300] | 46 | { |
---|
[731] | 47 | std::list<CBufferOut*>::iterator itBuff = buffers.begin(); |
---|
| 48 | std::list<int>::const_iterator itSizes = sizes.begin(), itSenders = nbSenders.begin(); |
---|
| 49 | std::list<CMessage*>::iterator itMsg = messages.begin(); |
---|
| 50 | |
---|
| 51 | for (; itBuff != buffers.end(); ++itBuff, ++itSizes, ++itSenders, ++itMsg) |
---|
[300] | 52 | { |
---|
[731] | 53 | **itBuff << *itSizes << timeLine << *itSenders << classId << typeId << **itMsg; |
---|
[300] | 54 | } |
---|
| 55 | } |
---|
| 56 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.