Last change
on this file since 2278 was
1377,
checked in by ymipsl, 7 years ago
|
- Add more debugging information at info_level 100
- Enforce synchronisation check for event on client side, using parameter "check_event_sync" at true
YM
|
-
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.6 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" |
---|
[1377] | 7 | #include "cxios.hpp" |
---|
[300] | 8 | |
---|
[335] | 9 | namespace xios |
---|
[300] | 10 | { |
---|
[814] | 11 | 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] | 12 | |
---|
[814] | 13 | |
---|
[731] | 14 | CEventClient::CEventClient(int classId_, int typeId_) |
---|
[300] | 15 | { |
---|
[731] | 16 | classId = classId_; |
---|
| 17 | typeId = typeId_; |
---|
[300] | 18 | } |
---|
[731] | 19 | |
---|
| 20 | void CEventClient::push(int rank, int nbSender, CMessage& msg) |
---|
[300] | 21 | { |
---|
[731] | 22 | nbSenders.push_back(nbSender); |
---|
| 23 | ranks.push_back(rank); |
---|
| 24 | messages.push_back(&msg); |
---|
[300] | 25 | } |
---|
| 26 | |
---|
| 27 | bool CEventClient::isEmpty(void) |
---|
| 28 | { |
---|
[731] | 29 | return ranks.empty(); |
---|
[300] | 30 | } |
---|
| 31 | |
---|
[731] | 32 | std::list<int> CEventClient::getRanks(void) |
---|
[300] | 33 | { |
---|
[731] | 34 | return ranks; |
---|
[300] | 35 | } |
---|
[731] | 36 | |
---|
| 37 | std::list<int> CEventClient::getSizes(void) |
---|
[300] | 38 | { |
---|
[731] | 39 | std::list<CMessage*>::iterator it; |
---|
| 40 | std::list<int> sizes; |
---|
| 41 | |
---|
| 42 | for (it = messages.begin(); it != messages.end(); ++it) sizes.push_back((*it)->size() + headerSize); |
---|
| 43 | return sizes; |
---|
[300] | 44 | } |
---|
[731] | 45 | |
---|
| 46 | void CEventClient::send(size_t timeLine, const std::list<int>& sizes, std::list<CBufferOut*>& buffers) |
---|
[300] | 47 | { |
---|
[731] | 48 | std::list<CBufferOut*>::iterator itBuff = buffers.begin(); |
---|
| 49 | std::list<int>::const_iterator itSizes = sizes.begin(), itSenders = nbSenders.begin(); |
---|
| 50 | std::list<CMessage*>::iterator itMsg = messages.begin(); |
---|
| 51 | |
---|
[1377] | 52 | if (CXios::checkEventSync) info(100)<<"Send event "<<timeLine<<" classId : "<<classId<<" typeId : "<<typeId<<endl ; |
---|
[731] | 53 | for (; itBuff != buffers.end(); ++itBuff, ++itSizes, ++itSenders, ++itMsg) |
---|
[300] | 54 | { |
---|
[731] | 55 | **itBuff << *itSizes << timeLine << *itSenders << classId << typeId << **itMsg; |
---|
[300] | 56 | } |
---|
| 57 | } |
---|
| 58 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.