Newer
Older
/**
* @file MpiUncertainty_exc.h
* @brief The MpiUncertainty BarbequeRTRM application
*
* Description: to be done...
*
* @author Name Surname (nickname), your@email.com
*
* Company Politecnico di Milano
* Copyright Copyright (c) 20XX, Name Surname
*
* This source code is released for free distribution under the terms of the
* GNU General Public License as published by the Free Software Foundation.
* =====================================================================================
*/
#ifndef MPIUNCERTAINTY_EXC_H_
#define MPIUNCERTAINTY_EXC_H_
#include <bbque/bbque_exc.h>
#include <cstring>
#include "bbque/utils/timer.h"
#include "Uncertainity.h"
namespace bu = bbque::utils;
using bbque::rtlib::BbqueEXC;
class MpiUncertainty : public BbqueEXC {
int32_t m_threadsNumber = 1;
int m_accelerate = 0;
// number of MC samples and timeframe for each of 4 FWL (Flood Warning Level)
uint32_t m_jobsNumber[4] = {1, 1, 1, 1};
int m_timeFrame[4];
uint32_t m_jobsDone = 0;
std::unique_ptr<math1d_cl::Uncertainity> m_uncertainty;
std::string m_configXmlPath;
bu::Timer m_timer;
double m_avgTimePerSimulation;
// Holds rank of current process and total number of processes
int m_rank = -1;
int m_numProc = -1;
int m_master = -1;
int m_threadsNumberTotal = 1;
int m_workDone = 0;
public:
MpiUncertainty(std::string const & name,
std::string const & uncertaintyConfigXmlPath,
std::string const & recipe,
RTLIB_Services_t *rtlib);
private:
RTLIB_ExitCode_t onSetup();
RTLIB_ExitCode_t onConfigure(int8_t awm_id);
RTLIB_ExitCode_t onRun();
RTLIB_ExitCode_t onMonitor();
RTLIB_ExitCode_t onRelease();
};
#endif // MPIUNCERTAINTY_EXC_H_