Commit 113de17e authored by Podhorszki, Norbert's avatar Podhorszki, Norbert
Browse files

Implement using timeout in adios_iotest

parent faf14e9b
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -129,7 +129,8 @@ adios2::StepStatus adiosStream::readADIOS(CommandRead *cmdR, Config &cfg,
            std::cout << "latest step from ";
        }

        std::cout << cmdR->streamName << " using the group " << cmdR->groupName;
        std::cout << cmdR->streamName << " with timeout value " << cmdR->timeout_sec
        << " using the group " << cmdR->groupName;
        if (!cmdR->variables.empty())
        {
            std::cout << " with selected variables:  ";
+1 −1
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ app 1
app 2
  steps   over stream_T1.bp   
  # read a & b from stream_T1.bp using io_T2_in definition without blocking wait
  read  next  stream_T1.bp    io_T2_in  0   a   b
  read  next  stream_T1.bp    io_T2_in  1.0   a   b

  # Sleep and write only if read was successful:
  cond stream_T1.bp   sleep   2.0      
+6 −6
Original line number Diff line number Diff line
@@ -28,9 +28,9 @@ CommandWrite::CommandWrite(std::string stream, std::string group)
: Command(Operation::Write), streamName(stream), groupName(group){};
CommandWrite::~CommandWrite(){};

CommandRead::CommandRead(std::string stream, std::string group)
CommandRead::CommandRead(std::string stream, std::string group, const float timeoutSec)
: Command(Operation::Read), stepMode(adios2::StepMode::NextAvailable),
  streamName(stream), groupName(group), timeout_sec(84600){};
  streamName(stream), groupName(group), timeout_sec(timeoutSec){};
CommandRead::~CommandRead(){};

std::vector<std::string> FileToLines(std::ifstream &configfile)
@@ -642,14 +642,14 @@ Config processConfig(const Settings &settings, size_t *currentConfigLineNumber)
                            "It must be either 'next' or 'latest'");
                    }

                    double d = FLT_MAX;
                    double d = -1.0;
                    if (words.size() >= 4)
                    {
                        // next word is timeout
                        d = stringToDouble(words, 4, "read timeout");
                        if (d < 0.0)
                        {
                            d = FLT_MAX;
                            d = -1.0;
                        }
                    }

@@ -658,7 +658,7 @@ Config processConfig(const Settings &settings, size_t *currentConfigLineNumber)
                        std::cout << "--> Command Read mode = " << mode
                                  << "  input = " << words[2]
                                  << "  group = " << groupName << " timeout = ";
                        if (d == FLT_MAX)
                        if (d < 0.0)
                        {
                            std::cout << "forever";
                        }
@@ -669,7 +669,7 @@ Config processConfig(const Settings &settings, size_t *currentConfigLineNumber)
                        std::cout << std::endl;
                    }
                    auto cmd =
                        std::make_shared<CommandRead>(streamName, groupName);
                        std::make_shared<CommandRead>(streamName, groupName, d);
                    cmd->conditionalStream = conditionalStream;
                    cfg.commands.push_back(cmd);
                    cfg.condMap[streamName] = adios2::StepStatus::OK;
+1 −1
Original line number Diff line number Diff line
@@ -74,7 +74,7 @@ public:
    const std::string groupName;
    const float timeout_sec;
    std::vector<std::shared_ptr<VariableInfo>> variables;
    CommandRead(std::string stream, std::string group);
    CommandRead(std::string stream, std::string group, const float timeoutSec=-1.0);
    ~CommandRead();
};