Changeset 638 for XIOS/trunk/src/node/field.cpp
- Timestamp:
- 07/17/15 13:58:12 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/node/field.cpp
r632 r638 10 10 #include "xios_spl.hpp" 11 11 #include "type.hpp" 12 #include "timer.hpp" 12 13 #include "context_client.hpp" 13 14 #include "context_server.hpp" … … 202 203 203 204 for (list< CArray<double,1>* >::iterator it = list_data.begin(); it != list_data.end(); it++) delete *it; 205 } 206 207 void CField::sendUpdateData(const CArray<double,1>& data) 208 { 209 CTimer::get("XIOS Send Data").resume(); 210 211 CContext* context = CContext::getCurrent(); 212 CContextClient* client = context->client; 213 214 CEventClient event(getType(), EVENT_ID_UPDATE_DATA); 215 216 map<int, CArray<int,1>* >::iterator it; 217 list<CMessage> list_msg; 218 list<CArray<double,1> > list_data; 219 220 if (!grid->doGridHaveDataDistributed()) 221 { 222 if (0 == client->clientRank) 223 { 224 for (it = grid->storeIndex_toSrv.begin(); it != grid->storeIndex_toSrv.end(); it++) 225 { 226 int rank = (*it).first; 227 CArray<int,1>& index = *(it->second); 228 229 list_msg.push_back(CMessage()); 230 list_data.push_back(CArray<double,1>(index.numElements())); 231 232 CArray<double,1>& data_tmp = list_data.back(); 233 for (int n = 0; n < data_tmp.numElements(); n++) data_tmp(n) = data(index(n)); 234 235 list_msg.back() << getId() << data_tmp; 236 event.push(rank, 1, list_msg.back()); 237 } 238 client->sendEvent(event); 239 } else client->sendEvent(event); 240 } 241 else 242 { 243 for (it = grid->storeIndex_toSrv.begin(); it != grid->storeIndex_toSrv.end(); it++) 244 { 245 int rank = (*it).first; 246 CArray<int,1>& index = *(it->second); 247 248 list_msg.push_back(CMessage()); 249 list_data.push_back(CArray<double,1>(index.numElements())); 250 251 CArray<double,1>& data_tmp = list_data.back(); 252 for (int n = 0; n < data_tmp.numElements(); n++) data_tmp(n) = data(index(n)); 253 254 list_msg.back() << getId() << data_tmp; 255 event.push(rank, grid->nbSenders[rank], list_msg.back()); 256 } 257 client->sendEvent(event); 258 } 259 260 CTimer::get("XIOS Send Data").suspend(); 204 261 } 205 262
Note: See TracChangeset
for help on using the changeset viewer.