Program Listing for File MPISimRunner.h

Return to documentation for file (include/flamegpu/simulation/detail/MPISimRunner.h)

#ifndef INCLUDE_FLAMEGPU_SIMULATION_DETAIL_MPISIMRUNNER_H_
#define INCLUDE_FLAMEGPU_SIMULATION_DETAIL_MPISIMRUNNER_H_

#include <atomic>
#include <memory>
#include <mutex>
#include <queue>
#include <condition_variable>
#include <vector>
#include <map>

#include "flamegpu/simulation/detail/AbstractSimRunner.h"
#include "flamegpu/defines.h"
#include "flamegpu/simulation/LogFrame.h"

namespace flamegpu {
struct ModelData;
class LoggingConfig;
class StepLoggingConfig;
class RunPlanVector;
class CUDAEnsemble;
namespace detail {

class MPISimRunner : public AbstractSimRunner {
 public:
    enum Signal : unsigned int {
        // MPISimRunner sets this to notify manager that it wants a new job
        RequestJob = UINT_MAX,
        RunFailed = UINT_MAX-1,
    };
    MPISimRunner(const std::shared_ptr<const ModelData> _model,
        std::atomic<unsigned int> &_err_ct,
        std::atomic<unsigned int> &_next_run,
        const RunPlanVector &_plans,
        std::shared_ptr<const StepLoggingConfig> _step_log_config,
        std::shared_ptr<const LoggingConfig> _exit_log_config,
        int _device_id,
        unsigned int _runner_id,
        flamegpu::Verbosity _verbosity,
        std::map<unsigned int, RunLog> &run_logs,
        std::queue<unsigned int> &log_export_queue,
        std::mutex &log_export_queue_mutex,
        std::condition_variable &log_export_queue_cdn,
        std::vector<ErrorDetail> &err_detail_local,
        unsigned int _total_runners,
        bool _isSWIG);
    void main() override;
};

}  // namespace detail
}  // namespace flamegpu

#endif  // INCLUDE_FLAMEGPU_SIMULATION_DETAIL_MPISIMRUNNER_H_