mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-05 05:06:55 -05:00
Work in progress
This commit is contained in:
1 parent
5b6901c956
commit
d56a1ecf5b
2 files changed
+24
-10
No files matched your search
@@ -28,13 +28,9 @@ namespace
|
||||
|
||||
QStringList runUtilityCommand( QString cmdStr, QStringList arguments )
|
||||
{
|
||||
bool useWsl = RiaPreferencesOpm::current()->useWsl();
|
||||
|
||||
RimProcess proc( false );
|
||||
|
||||
QStringList cmdList;
|
||||
|
||||
if ( useWsl )
|
||||
if ( RiaPreferencesOpm::current()->useWsl() )
|
||||
{
|
||||
cmdList.append( RiaWslTools::wslCommand() );
|
||||
cmdList.append( RiaPreferencesOpm::current()->wslOptions() );
|
||||
@@ -43,6 +39,8 @@ QStringList runUtilityCommand( QString cmdStr, QStringList arguments )
|
||||
cmdList.append( cmdStr );
|
||||
cmdList.append( arguments );
|
||||
|
||||
RimProcess proc( false /*no logging*/ );
|
||||
|
||||
QString cmd = cmdList.takeFirst();
|
||||
proc.setCommand( cmd );
|
||||
if ( !cmdList.isEmpty() ) proc.addParameters( cmdList );
|
||||
@@ -65,11 +63,7 @@ namespace RiaHpcTools
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QStringList availableQueues( RiaDefines::BatchSchedulerType scheduler )
|
||||
{
|
||||
if ( scheduler == RiaDefines::BatchSchedulerType::LOCAL_COMPUTER )
|
||||
{
|
||||
return {};
|
||||
}
|
||||
else if ( scheduler == RiaDefines::BatchSchedulerType::SLURM )
|
||||
if ( scheduler == RiaDefines::BatchSchedulerType::SLURM )
|
||||
{
|
||||
auto rawOutput = runUtilityCommand( "sinfo", { "-a" } );
|
||||
return decodeSlurmQueues( rawOutput );
|
||||
@@ -156,4 +150,20 @@ QStringList decodeLsfQueues( QStringList stdOut )
|
||||
return retList;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void stopLsfJob( QString jobId )
|
||||
{
|
||||
runUtilityCommand( "bkill", { jobId } );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void stopSlurmJob( QString jobId )
|
||||
{
|
||||
runUtilityCommand( "scancel", { jobId } );
|
||||
}
|
||||
|
||||
} // namespace RiaHpcTools
|
||||
@@ -32,6 +32,10 @@ namespace RiaHpcTools
|
||||
{
|
||||
QStringList availableQueues( RiaDefines::BatchSchedulerType scheduler );
|
||||
|
||||
void stopLsfJob( QString jobId );
|
||||
void stopSlurmJob( QString jobId );
|
||||
|
||||
// helpers
|
||||
QStringList decodeSlurmQueues( QStringList stdOut );
|
||||
QStringList decodeLsfQueues( QStringList stdOut );
|
||||
|
||||
|
||||
Reference in new issue
Block a user