Skip to content

Commit 0cabe32

Browse files
authored
Merge pull request #174 from mfem/mfem_452_dev
PyMFEM4.5.2
2 parents e0e2867 + 4767c62 commit 0cabe32

File tree

9 files changed

+41
-19
lines changed

9 files changed

+41
-19
lines changed

.github/workflows/test_with_MFEM_release.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ jobs:
106106
if [ "${USE_FLAGS}" = "000" ]; then
107107
# test workflow to manually run swig
108108
python setup.py clean --swig
109-
python setup.py install --ext-only --with-gslib --mfem-branch=coefficient-unneeded-using --verbose
110-
python setup.py install --swig --with-gslib --mfem-branch=coefficient-unneeded-using --verbose
111-
python setup.py install --skip-ext --skip-swig --with-gslib --mfem-branch=coefficient-unneeded-using --verbose
109+
python setup.py install --ext-only --with-gslib --verbose
110+
python setup.py install --swig --with-gslib --verbose
111+
python setup.py install --skip-ext --skip-swig --with-gslib --verbose
112112
fi
113113
if [ "${USE_FLAGS}" = "010" ]; then
114114
python setup.py install --with-gslib --with-parallel --prefix=$SANDBOX

mfem/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ def debug_print(message):
2020

2121
print(message)
2222

23-
__version__ = '4.5.0.2rc2'
23+
__version__ = '4.5.2.0rc0'
2424

mfem/_par/globals.i

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import_array();
1111
%include "exception.i"
1212
%include "../common/typemap_macros.i"
1313
%include "../common/exception.i"
14+
%include "../common/mfem_config.i"
1415

1516
%include "std_string.i"
1617

mfem/_par/tmop_tools.i

+3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ import_array();
2323

2424
%include "../common/typemap_macros.i"
2525

26+
#ifdef MFEM_USE_GSLIB
27+
%import gslib.i
28+
#endif
2629
%import tmop.i
2730
%import bilinearform.i
2831
%import pbilinearform.i

mfem/_ser/globals.i

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import_array();
1111
%include "exception.i"
1212
%include "../common/typemap_macros.i"
1313
%include "../common/exception.i"
14+
%include "../common/mfem_config.i"
1415

1516
%include "std_string.i"
1617

mfem/_ser/tmop_tools.i

+5
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,16 @@
1111
import_array();
1212
%}
1313

14+
%include "../common/mfem_config.i"
15+
1416
%include "exception.i"
1517
%import "../common/exception_director.i"
1618

1719
%include "../common/typemap_macros.i"
1820

21+
#ifdef MFEM_USE_GSLIB
22+
%import gslib.i
23+
#endif
1924
%import tmop.i
2025
%import bilinearform.i
2126
%import solvers.i

mfem/common/mfem_config.i

+1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
%ignore MFEM_SOURCE_DIR;
44
%ignore MFEM_INSTALL_DIR;
55
%ignore MFEM_TIMER_TYPE;
6+
%include "config/_config.hpp" // include mfem MACRO
67
%include "config/config.hpp" // include mfem MACRO

setup.py

+20-10
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
# "metis": "https://github.com/KarypisLab/METIS/archive/refs/tags/v5.1.1-DistDGL-v0.5.tar.gz",
5050
# "metis": "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/metis-5.1.0.tar.gz",
5151
"metis": "https://github.com/mfem/tpls/raw/gh-pages/metis-5.1.0.tar.gz",
52-
"hypre": "https://github.com/hypre-space/hypre/archive/v2.27.0.tar.gz",
52+
"hypre": "https://github.com/hypre-space/hypre/archive/v2.28.0.tar.gz",
5353
"libceed": "https://github.com/CEED/libCEED/archive/refs/tags/v0.11.0.tar.gz",
5454
"gslib": "https://github.com/Nek5000/gslib/archive/refs/tags/v1.0.8.tar.gz"}
5555

@@ -58,8 +58,8 @@
5858
"gklib": "https://github.com/KarypisLab/GKlib",
5959
"metis": "https://github.com/KarypisLab/METIS", }
6060
repos_sha = {
61-
"mfem": "2f6eb8838f8f5e8359abba0dd3434c8cc7147012", # version 4.5 with a few fix
62-
#"mfem": "b7a4b61b5ce80b326a002aebccf7da7ad2432556", # version 4.5
61+
# "mfem": "2f6eb8838f8f5e8359abba0dd3434c8cc7147012",
62+
"mfem": "00b2a0705f647e17a1d4ffcb289adca503f28d42", # version 4.5.2
6363
"gklib": "a7f8172703cf6e999dd0710eb279bba513da4fec",
6464
"metis": "94c03a6e2d1860128c2d0675cbbb86ad4f261256", }
6565

@@ -244,7 +244,7 @@ def external_install_prefix(verbose=True):
244244
os.makedirs(path)
245245
path = os.path.join(path, 'mfem', 'external')
246246
return path
247-
247+
248248
else:
249249
# when prefix is given...let's borrow pip._internal to find the location ;D
250250
import pip._internal.locations
@@ -295,20 +295,28 @@ def make_call(command, target='', force_verbose=False):
295295

296296
if dry_run:
297297
return
298-
kwargs = {}
298+
kwargs = {'universal_newlines': True}
299299

300300
myverbose = verbose or force_verbose
301301
if not myverbose:
302302
kwargs['stdout'] = DEVNULL
303303
kwargs['stderr'] = DEVNULL
304+
# else:
305+
# kwargs['stdout'] = subprocess.PIPE
306+
# kwargs['stderr'] = subprocess.STDOUT
304307

305-
try:
306-
subprocess.check_call(command, **kwargs)
307-
except subprocess.CalledProcessError:
308+
p = subprocess.Popen(command, **kwargs)
309+
p.communicate()
310+
if p.returncode != 0:
308311
if target == '':
309312
target = " ".join(command)
310313
print("Failed when calling command: " + target)
311-
raise
314+
raise subprocess.CalledProcessError(p.returncode,
315+
" ".join(command))
316+
317+
#subprocess.check_call(command, **kwargs)
318+
# except subprocess.CalledProcessError:
319+
# print(stdout)
312320

313321

314322
def chdir(path):
@@ -1089,6 +1097,8 @@ def update_header_exists(mfem_source):
10891097
mp_pool = Pool(max((multiprocessing.cpu_count() - 1, 1)))
10901098
with mp_pool:
10911099
mp_pool.map(make_call, commands)
1100+
# for c in commands:
1101+
# make_call(c)
10921102

10931103
os.chdir(pwd)
10941104

@@ -1574,7 +1584,7 @@ def initialize_options(self):
15741584
self.with_suitesparse = False
15751585
self.suitesparse_prefix = ''
15761586

1577-
self.with_lapack = False
1587+
self.with_lapack = False
15781588
self.blas_libraries = ""
15791589
self.lapack_libraries = ""
15801590

test/test_numba.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,15 @@
1313
if len(sys.argv) > 1 and sys.argv[1] == '-p':
1414
import mfem.par as mfem
1515
use_parallel = True
16-
from mfem.common.mpi_debug import nicePrint as print
16+
from mfem.common.mpi_debug import nicePrint
1717
from mpi4py import MPI
1818
myid = MPI.COMM_WORLD.rank
1919

2020
else:
2121
import mfem.ser as mfem
2222
use_parallel = False
2323
myid = 0
24+
nicePrint = print
2425

2526

2627
class s_coeff(mfem.PyCoefficient):
@@ -321,23 +322,23 @@ def m_func5(p):
321322
end = time.time()
322323
a3.Finalize()
323324
M3 = a3.SpMat()
324-
print("Numba (simpler interface) (matrix)", end - start)
325+
nicePrint("Numba (simpler interface) (matrix)", end - start)
325326

326327
start = time.time()
327328
m_func4_complex.SetTime(3.0)
328329
a4.Assemble()
329330
end = time.time()
330331
a4.Finalize()
331332
M4 = a4.SpMat()
332-
print("Numba (complex dependency as complex) (matrix)", end - start)
333+
nicePrint("Numba (complex dependency as complex) (matrix)", end - start)
333334

334335
start = time.time()
335336
m_func4_split.SetTime(3.0)
336337
a5.Assemble()
337338
end = time.time()
338339
a5.Finalize()
339340
M5 = a5.SpMat()
340-
print("Numba (complex dependency as decomposed) (matrix)", end - start)
341+
nicePrint("Numba (complex dependency as decomposed) (matrix)", end - start)
341342

342343
#from mfem.commmon.sparse_utils import sparsemat_to_scipycsr
343344
#csr1 = sparsemat_to_scipycsr(M1, float)
@@ -360,7 +361,7 @@ def compare_mat(M1o, M2o):
360361
compare_mat(M1, M5)
361362

362363
# print(m_func3.SpaceDimension())
363-
print("PASSED")
364+
nicePrint("PASSED")
364365

365366

366367
if __name__ == '__main__':

0 commit comments

Comments
 (0)