mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-28 16:10:24 -05:00
Add support for custom mpirun path in preferences
This commit is contained in:
1 parent
0f55899ba9
commit
816e1b0980
3 files changed
+16
-1
No files matched your search
@@ -40,6 +40,10 @@ RiaPreferencesOpm::RiaPreferencesOpm()
|
||||
CAF_PDM_InitField( &m_useMpi, "useMpi", false, "Use MPI to run Opm Flow" );
|
||||
CAF_PDM_InitField( &m_mpiProcesses, "mpiProcesses", 4, "Number of MPI processes to use" );
|
||||
|
||||
CAF_PDM_InitField( &m_mpirunCommand, "mpirunCommand", QString( "/usr/bin/mpirun" ), "Path to mpirun command" );
|
||||
m_mpirunCommand.uiCapability()->setUiEditorTypeName( caf::PdmUiFilePathEditor::uiEditorTypeName() );
|
||||
m_mpirunCommand.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::TOP );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_wslDistribution, "wslDistribution", "WSL Distribution to use:" );
|
||||
m_wslDistribution.uiCapability()->setUiEditorTypeName( caf::PdmUiComboBoxEditor::uiEditorTypeName() );
|
||||
m_availableWslDists = RiaWslTools::wslDistributionList();
|
||||
@@ -75,6 +79,7 @@ void RiaPreferencesOpm::appendItems( caf::PdmUiOrdering& uiOrdering )
|
||||
if ( m_useMpi() )
|
||||
{
|
||||
opmGrp->add( &m_mpiProcesses );
|
||||
opmGrp->add( &m_mpirunCommand );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,6 +109,14 @@ QString RiaPreferencesOpm::opmFlowCommand() const
|
||||
return m_opmFlowCommand;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaPreferencesOpm::mpirunCommand() const
|
||||
{
|
||||
return m_mpirunCommand;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -42,6 +42,7 @@ public:
|
||||
bool useWsl() const;
|
||||
bool useMpi() const;
|
||||
int mpiProcesses() const;
|
||||
QString mpirunCommand() const;
|
||||
|
||||
protected:
|
||||
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;
|
||||
@@ -52,6 +53,7 @@ private:
|
||||
caf::PdmField<QString> m_wslDistribution;
|
||||
caf::PdmField<bool> m_useMpi;
|
||||
caf::PdmField<int> m_mpiProcesses;
|
||||
caf::PdmField<QString> m_mpirunCommand;
|
||||
|
||||
QStringList m_availableWslDists;
|
||||
};
|
||||
@@ -526,7 +526,7 @@ QStringList RimOpmFlowJob::command()
|
||||
|
||||
if ( opmPref->useMpi() )
|
||||
{
|
||||
cmd.append( "/usr/bin/mpirun" );
|
||||
cmd.append( opmPref->mpirunCommand() );
|
||||
cmd.append( QString( "-np" ) );
|
||||
cmd.append( QString( "%1" ).arg( opmPref->mpiProcesses() ) );
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user