Skip to content
Snippets Groups Projects
MpiUncertainty_exc.h 1.68 KiB
Newer Older
  • Learn to ignore specific revisions
  • Radim Vavřík's avatar
    Radim Vavřík committed
    /**
     *       @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 {
    
    
    int m_accelerate = 0;
    // number of MC samples and timeframe for each of 4 FWL (Flood Warning Level)
    
    Radim Vavřík's avatar
    Radim Vavřík committed
    uint32_t m_jobsNumber[4] = {1, 1, 1, 1};
    int m_timeFrame[4];
    uint32_t m_jobsDone = 0;
    
    int m_qosMode = -1;
    
    Radim Vavřík's avatar
    Radim Vavřík committed
    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;
    
    
    Radim Vavřík's avatar
    Radim Vavřík committed
    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);
    
    Radim Vavřík's avatar
    Radim Vavřík committed
    	RTLIB_ExitCode_t onRun();
    	RTLIB_ExitCode_t onMonitor();
    	RTLIB_ExitCode_t onRelease();
    };
    
    #endif // MPIUNCERTAINTY_EXC_H_