Skip to content

Commit 3c79d7a

Browse files
Removed Domain from interal flush, made Domain and Mask selectable
1 parent d5885e3 commit 3c79d7a

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

src/multio/action/aggregate/Aggregate.cc

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,22 @@ auto Aggregate::flushCount(const Message& msg) {
6161
bool Aggregate::handleFlush(const Message& msg) {
6262
// Initialise if need be
6363
util::ScopedTiming timing{statistics_.actionTiming_};
64+
// to allow flushes coming without a domain to direclty pass through.
65+
auto domain = msg.metadata().getOpt<std::string>("domain");
66+
if(!domain) {
67+
return true;
68+
}
69+
// get domain info if existant
70+
const auto& domainMap = domain::Mappings::instance().get(*domain);
6471

65-
const auto& domainMap = domain::Mappings::instance().get(msg.domain());
6672
auto flCount = flushCount(msg);
6773

68-
return domainMap.isComplete() && flCount == domainMap.size();
74+
if((domainMap.isComplete() && flCount == domainMap.size()) == true){
75+
//if complete, pass through and reset counter
76+
flushes_.erase(msg.fieldId());
77+
return true;
78+
}
79+
return false;
6980
}
7081

7182
bool Aggregate::allPartsArrived(const Message& msg) const {

src/multio/action/select/Select.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Select::Select(const ComponentConfiguration& compConf) :
2828

2929
void Select::executeImpl(Message msg) {
3030
//pass through action for everything that is not a field, e.g. Flush
31-
if (matches(msg) || (msg.tag() != message::Message::Tag::Field)) {
31+
if (matches(msg) || ((msg.tag() != message::Message::Tag::Field) || (msg.tag() != message::Message::Tag::Mask) || (msg.tag() != message::Message::Tag::Domain)) ) {
3232
executeNext(std::move(msg));
3333
}
3434
}

src/multio/api/c/multio_capi.cc

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -460,11 +460,6 @@ int multio_delete_handle(multio_handle_t* mio) {
460460
return wrapApiFunction([mio]() {
461461
ASSERT(mio);
462462

463-
multio::message::Metadata md;
464-
md.set("flushKind", "end-of-simulation");
465-
466-
mio->dispatch(std::move(md), eckit::Buffer{0}, Message::Tag::Flush);
467-
468463
// TODO add sleep
469464
delete mio;
470465
});
@@ -508,8 +503,8 @@ int multio_close_connections(multio_handle_t* mio) {
508503
ASSERT(mio);
509504

510505
multio::message::Metadata md;
511-
md.set("flushKind", "end-of-simulation");
512-
506+
md.set("flushKind", "close-connection");
507+
md.set("toAllServers",true);
513508
mio->dispatch(std::move(md), eckit::Buffer{0}, Message::Tag::Flush);
514509

515510
mio->closeConnections();
@@ -526,7 +521,6 @@ int multio_flush(multio_handle_t* mio, multio_metadata_t* md) {
526521
[mio, md]() {
527522
ASSERT(mio);
528523
ASSERT(md);
529-
530524
mio->dispatch(md->md, multio::message::PayloadReference{nullptr, 0}, Message::Tag::Flush);
531525
},
532526
mio);

0 commit comments

Comments
 (0)