Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PyGriffin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
neams-workbench
PyGriffin
Commits
7277d735
Commit
7277d735
authored
3 years ago
by
Patrick Shriwise
Browse files
Options
Downloads
Patches
Plain Diff
Feature: adding detectin of MPI support via libmesh-config
parent
ed474bb4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pygriffin/config.py
+22
-0
22 additions, 0 deletions
pygriffin/config.py
pygriffin/pygriffin.py
+7
-1
7 additions, 1 deletion
pygriffin/pygriffin.py
with
29 additions
and
1 deletion
pygriffin/config.py
+
22
−
0
View file @
7277d735
import
os
from
pathlib
import
Path
import
subprocess
try
:
from
ConfigParser
import
ConfigParser
...
...
@@ -45,6 +46,18 @@ class PyGriffinConfig():
'
of the Griffin executable have failed.
'
)
raise
RuntimeError
(
msg
)
# check libMesh configuration for MPI
libmesh_config
=
self
.
griffin_dir
/
'
moose/libmesh/installed/bin/libmesh-config
'
out
=
subprocess
.
Popen
([
libmesh_config
,
'
--cxx
'
],
stdout
=
subprocess
.
PIPE
)
libmesh_config_out
=
out
.
stdout
.
read
()
if
'
mpi
'
in
libmesh_config_out
.
decode
():
self
.
mpi_enabled
=
True
else
:
self
.
mpi_enabled
=
False
def
get
(
self
,
*
args
,
**
kwargs
):
"""
Attempts to get a configuration option from the .rc file.
...
...
@@ -75,6 +88,15 @@ class PyGriffinConfig():
def
griffin_exec
(
self
):
return
self
.
_griffin_exec
@property
def
mpi_enabled
(
self
):
return
self
.
_mpi_enabled
@mpi_enabled.setter
def
mpi_enabled
(
self
,
val
):
cv
.
check_type
(
'
MPI Enabled
'
,
val
,
bool
)
self
.
_mpi_enabled
=
val
@griffin_exec.setter
def
griffin_exec
(
self
,
exec
):
cv
.
check_type
(
'
Griffin executable path
'
,
exec
,
(
Path
,
str
))
...
...
This diff is collapsed.
Click to expand it.
pygriffin/pygriffin.py
+
7
−
1
View file @
7277d735
...
...
@@ -2,6 +2,7 @@ from numbers import Integral
from
pathlib
import
Path
import
subprocess
from
typing
import
Iterable
import
warnings
import
pygriffin.checkvalue
as
cv
from
pygriffin.config
import
PyGriffinConfig
...
...
@@ -41,7 +42,12 @@ class PyGriffin:
cmd
=
[]
if
self
.
n_procs
>
1
:
cmd
+=
[
'
mpirun
'
,
'
-n
'
,
str
(
self
.
n_procs
)]
if
self
.
config
.
mpi_enabled
:
cmd
+=
[
'
mpirun
'
,
'
-n
'
,
str
(
self
.
n_procs
)]
else
:
msg
=
(
"
MPI is not enabled for this Griffin executable.
"
"
The n_procs argument will be ignored.
"
)
warnings
.
warn
(
msg
)
# add griffin executable to command line
cmd
.
append
(
str
(
self
.
config
.
griffin_exec
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment