Files
ResInsight/ApplicationLibCode/ProjectDataModel/Jobs/RimSingleJob.h
T
JJ 6c39729e77 Support submitting opm flow jobs to Slurm or LSF (#14943)
Add preferences for HPC/Batch scheduler
Add Slurm and LSF support
Add batch job monitor
Support launcher specific user settings
Use internal timer to refresh job state
Add some more options to batch monitor
Improve naming
Add tests for job lists
Change WSL handling for processes.
2026-10-21 18:14:13 +02:00

77 lines
2.4 KiB
C++

/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2026 Equinor ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RimGenericJob.h"
#include "cafPdmUiTreeAttributes.h"
#include "cafPdmPointer.h"
#include <QString>
#include <QStringList>
#include <map>
#include <memory>
class RimProcess;
class RimBatchQueue;
//==================================================================================================
///
///
//==================================================================================================
class RimSingleJob : public RimGenericJob
{
CAF_PDM_HEADER_INIT;
public:
RimSingleJob();
~RimSingleJob() override;
bool execute() override;
void stop() override;
double percentageDone() const override;
const QStringList jobLog() const override;
bool matchesKeyValue( const QString& key, const QString& value ) const override = 0;
void setFinished( bool runOk ) override;
void setStarted() override;
protected:
std::vector<caf::PdmUiTreeViewItemTag> treeItemTags() override;
virtual QStringList command() = 0;
virtual QString workingDirectory() const = 0;
virtual bool onPrepare() = 0;
virtual bool onRun() = 0;
virtual void onCompleted( bool success ) = 0;
virtual void onProgress( double percentageDone ) = 0;
virtual bool shouldUseWsl() = 0;
virtual int numberOfProcesses() = 0;
protected:
double m_percentageDone;
int m_warningsDetected;
int m_errorsDetected;
private:
std::shared_ptr<RimProcess> m_process;
std::shared_ptr<RimBatchQueue> m_queue;
};