Skip to content

Commit fcb2a20

Browse files
author
hochunlin
committed
Update to v0.5.0
1 parent 0d6c294 commit fcb2a20

10 files changed

+82
-42
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name = "MESTI"
22
uuid = "8d7f31fa-9986-4e1d-8c81-72752476e54d"
33
license = "GPL-3.0"
44
authors = ["Ho-Chun Lin<hochunlin0508@gmail.com>, Shiyu Li<lishiyu@usc.edu>, Zeyu Wang<wangzeyu@usc.edu>, and Chia Wei Hsu<cwhsu@usc.edu>"]
5-
version = "0.4.4"
5+
version = "0.5.0"
66

77
[deps]
88
GeometryPrimitives = "17051e67-205e-509e-8301-03b320b998e6"

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ export PATH=".../julia-1.9.3/bin/"
6666

6767
where <code>...</code> is the path to your Julia.
6868

69-
Before installing MESTI.jl, the user first needs to install the parallel version of the sparse linear solver [MUMPS](https://mumps-solver.org/index.php). Without MUMPS, MESTI.jl can still run but cannot use the APF method and will only use a conventional method with the built-in linear solver, which can be orders of magnitude slower and uses much more memory (especially in 3D and for large 2D systems). See this [MUMPS installation](./mumps) page for steps to install MUMPS. For this MESTI (v0.4.4) version, it is compatible with MUMPS versions between v5.3.3 and v5.6.2. It is not compatible with MUMPS versions v5.7.0 or v5.7.1.
69+
Before installing MESTI.jl, the user first needs to install the parallel version of the sparse linear solver [MUMPS](https://mumps-solver.org/index.php). Without MUMPS, MESTI.jl can still run but cannot use the APF method and will only use a conventional method with the built-in linear solver, which can be orders of magnitude slower and uses much more memory (especially in 3D and for large 2D systems). See this [MUMPS installation](./mumps) page for steps to install MUMPS. For this MESTI (v0.5.0), it is compatible with MUMPS versions 5.7.0 and 5.7.1, but not with versions earlier than 5.7.0. We highly recommend using the latest version of MUMPS.
7070

71-
After the MUMPS installation, if you have a clean Julia environment (*i.e.* have not installed any Julia package before or have not installed new version of [Makie.jl](https://github.com/MakieOrg/Makie.jl)(v0.20 and v0.21) and [GeometryPrimitives.jl](https://github.com/stevengj/GeometryPrimitives.jl)(v0.5.0), you can install MESTI.jl (v0.4.4) by opening the command-line interface of Julia and typing:
71+
After the MUMPS installation, if you have a clean Julia environment (*i.e.* have not installed any Julia package before or have not installed new version of [Makie.jl](https://github.com/MakieOrg/Makie.jl)(v0.20 and v0.21) and [GeometryPrimitives.jl](https://github.com/stevengj/GeometryPrimitives.jl)(v0.5.0), you can install MESTI.jl (v0.5.0) by opening the command-line interface of Julia and typing:
7272

7373
```julia
7474
import Pkg; Pkg.add("MESTI")
@@ -80,7 +80,7 @@ On the other hand, if you have installed these two Julia packages: the new versi
8080
import Pkg; Pkg.add(Pkg.PackageSpec(;name="Makie", version="0.19.12")); Pkg.add("GeometryPrimitives"); Pkg.add("MESTI")
8181
```
8282

83-
to downgrade them to the old version compatible with our MESTI.jl and then install MESTI.jl(v0.4.4).
83+
to downgrade them to the old version compatible with our MESTI.jl and then install MESTI.jl(v0.5.0).
8484

8585
After installing MESTI.jl, if the user happens to run the command to upgrade every Julia package to the latest version, such as *Pkg.update()*, it would install the latest version of Makie.jl and make MESTI.jl not compatible with it. So please rerun the line above to downgrade to the compatible version and reinstall MESTI.jl.
8686

@@ -93,7 +93,7 @@ import Pkg; Pkg.status("MESTI")
9393
If you want our latest MESTI.jl, it should show
9494

9595
```julia
96-
[8d7f31fa] MESTI v0.4.4
96+
[8d7f31fa] MESTI v0.5.0
9797
```
9898

9999
## Tests

mumps/README.md

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$LMETISDIR
3737
After installing METIS, if you set <code>opts.use_METIS = true</code> in <code>mesti()</code> or <code>mesti2s()</code>, MUMPS will use METIS for matrix ordering. From our experience, in 2D, AMD is usually faster when using the APF method, but METIS can sometimes reduce memory usage. In 3D, METIS is strongly recommended, which is much faster than AMD. By default, 2D systems use AMD, while 3D systems use METIS (if it is available).
3838

3939
## Compile MUMPS
40-
Suppose you downloaded the 5.6.2 version of MUMPS to your ~/Downloads/ folder. Then, go to the folder where you want to compile MUMPS, and enter
40+
Suppose you downloaded the 5.7.1 version of MUMPS to your ~/Downloads/ folder. Then, go to the folder where you want to compile MUMPS, and enter
4141
```shell
42-
tar zxvf ~/Downloads/MUMPS_5.6.2.tar.gz
43-
cd MUMPS_5.6.2
42+
tar zxvf ~/Downloads/MUMPS_5.7.1.tar.gz
43+
cd MUMPS_5.7.1
4444
```
4545
in terminal.
4646

@@ -51,8 +51,8 @@ Read the file <code>INSTALL</code>, copy the closest <code>Makefile.inc</code> f
5151
- <code>LAPACK</code>: how the Fortran compiler can link to the LAPACK library
5252
- <code>SCALAP</code>: how the Fortran compiler can link to the ScaLAPACK library
5353
- <code>LIBBLAS</code>: how the Fortran compiler can link to the BLAS library
54-
- <code>RPATH_OPT</code>: the path to shared libraries that will be built up, such as <code>.../MUMPS_5.6.2/lib/</code>
55-
where <code>...</code> is the path to MUMPS_5.6.2 folder.
54+
- <code>RPATH_OPT</code>: the path to shared libraries that will be built up, such as <code>.../MUMPS_5.7.1/lib/</code>
55+
where <code>...</code> is the path to MUMPS_5.7.1 folder.
5656

5757
Note that from our experience, <code>RPATH_OPT</code> must be specified to successfully install the parallel version of MUMPS on Linux and Windows.
5858

@@ -86,10 +86,10 @@ After compiling the parallel version of MUMPS, in <code>startup.jl</code> we sho
8686

8787
```shell
8888
mkdir ~/.julia/config
89-
echo 'ENV["MUMPS_PREFIX"] = ".../MUMPS_5.6.2/lib"' >> ~/.julia/config/startup.jl
89+
echo 'ENV["MUMPS_PREFIX"] = ".../MUMPS_5.7.1/lib"' >> ~/.julia/config/startup.jl
9090
```
9191

92-
where <code>...</code> is the path to MUMPS_5.6.2 folder.
92+
where <code>...</code> is the path to MUMPS_5.7.1 folder.
9393

9494

9595
When we run Julia interface for MUMPS, the machine may not find the libraries by itself. To solve those issues, please follow the steps depending on your OS:
@@ -112,16 +112,19 @@ export LD_PRELOAD=$LD_PRELOAD:$MKLROOT/lib/intel64/libmkl_scalapack_lp64.so
112112

113113
or
114114

115-
- macOS
115+
- <a name="mpi-config"></a> macOS
116116

117-
We can configure [MPI.jl](https://juliaparallel.org/MPI.jl/stable/configuration/) before running MUMPS in Julia. The steps are straightforward using MPIPreferences.jl. First, install MPIPreferences.jl by entering
117+
To use MUMPS.jl, we need to install and [configure](https://juliaparallel.org/MPI.jl/stable/configuration/) MPI.jl. Begin by installing MPI.jl and MPIPreferences.jl with the following command in Julia:
118118
```
119-
julia --project -e 'using Pkg; Pkg.add("MPIPreferences")'
119+
using Pkg; Pkg.add(["MPI", "MPIPreferences"])
120120
```
121-
in terminal. Then run <code>MPIPreferences.use_system_binary()</code> in Julia or through the command line:
121+
Once the installation is complete, run the following command in Julia to configure MPI.jl:
122122
```
123-
julia --project -e 'using MPIPreferences; MPIPreferences.use_system_binary()'
123+
using MPIPreferences; MPIPreferences.use_system_binary()
124124
```
125-
This should automatically find the OpenMPI installed in macOS.
125+
This will automatically find the OpenMPI library installed by Homebrew. If MPIPreferences cannot locate the library, you need to specify the library path manually:
126126

127+
```
128+
MPIPreferences.use_system_binary(; library_names=["/path/to/open-mpi/5.x.x/lib/libmpi"])
129+
```
127130
Now, you are ready to install MESTI.jl. Please go back to [install MESTI.jl](../#installation).

mumps/linux/Makefile.inc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#
2-
# This file is part of MUMPS 5.6.2, released
3-
# on Wed Oct 11 09:36:25 UTC 2023
2+
# This file is part of MUMPS 5.7.1, released
3+
# on Thu May 2 10:15:09 UTC 2024
44
#
55
################################################################################
66
#
@@ -55,7 +55,7 @@
5555

5656
LPORDDIR = $(topdir)/PORD/lib/
5757
IPORD = -I$(topdir)/PORD/include/
58-
LPORD = -L$(LPORDDIR) -lpord
58+
LPORD = -L$(LPORDDIR) -lpord$(PLAT)
5959

6060
# The following is the path of the METIS on Hsu's group in USC Discovery cluster.
6161
# Please modify the path based on your machine.
@@ -104,7 +104,7 @@ SONAME = -soname
104104
# Adapt/uncomment RPATH_OPT to avoid modifying
105105
# LD_LIBRARY_PATH in case of shared libraries
106106
# The following is the path of the MUMPS shared libraries on Hsu's group in USC Discovery cluster:
107-
RPATH_OPT = -Wl,-rpath,/project/cwhsu_38/shared/software/mumps-5.6.2-par/lib/
107+
RPATH_OPT = -Wl,-rpath,/project/cwhsu_38/shared/software/mumps-5.7.1-par/lib/
108108
OUTC = -o
109109
OUTF = -o
110110
# RM : remove files
@@ -152,7 +152,7 @@ SCALAP = -L$(MKLROOT)/lib/intel64 -lmkl_scalapack_lp64 -lmkl_blacs_intelmpi_lp64
152152
LIBPAR = $(SCALAP) $(LAPACK)
153153

154154
INCSEQ = -I$(topdir)/libseq
155-
LIBSEQ = $(LAPACK) -L$(topdir)/libseq -lmpiseq
155+
LIBSEQ = $(LAPACK) -L$(topdir)/libseq -lmpiseq$(PLAT)
156156

157157
# DEFINE HERE YOUR BLAS LIBRARY
158158
# BLAS library is under the folder of $(MKLROOT)/lib/intel64

mumps/macOS/Makefile.inc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#
2-
# This file is part of MUMPS 5.6.2, released
3-
# on Wed Oct 11 09:36:25 UTC 2023
2+
# This file is part of MUMPS 5.7.1, released
3+
# on Thu May 2 10:15:09 UTC 2024
44
#
55
################################################################################
66
#
@@ -9,7 +9,7 @@
99
# This defines some parameters dependent on your platform; you should
1010
# look for the approriate file in the directory ./Make.inc/ and copy it
1111
# into a file called Makefile.inc. For example, from the MUMPS root
12-
# directory, use
12+
# directory, use
1313
# "cp Make.inc/Makefile.inc.generic ./Makefile.inc"
1414
# (see the main README file for details)
1515
#

mumps/macOS/README.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,27 @@ MUMPS requires the ScaLAPACK, MPI and OpenMP libraries, which can be installed v
4141
brew install scalapack open-mpi llvm
4242
```
4343

44-
The <code>clang</code> compiler from Apple does not support OpenMP by default and we need to use the <code>clang</code> compiler from LLVM instead. After installing LLVM, enter
44+
The <code>clang</code> compiler from Apple does not support OpenMP and we need to use the <code>clang</code> compiler from LLVM instead. After installing LLVM, enter
4545

4646
```
4747
export PATH=/opt/homebrew/opt/llvm/bin:$PATH
4848
```
49-
to override the <code>clang</code> compiler from Apple.
49+
to override the <code>clang</code> compiler from Apple.
50+
51+
## Troubleshooting
52+
53+
### Issue 1: "clang: error: unsupported option '-fopenmp'"
54+
This error occurs if you compile with the default <code>clang</code> compiler from Apple. Make sure you are using the <code>clang</code> compiler from LLVM by running the following command in terminal:
55+
```
56+
which clang
57+
```
58+
The output should be <code>/path/to/llvm/bin/clang</code>. If this is not the case, you need to override the <code>clang</code> compiler from Apple by running the following command in terminal:
59+
```
60+
export PATH=/opt/homebrew/opt/llvm/bin:$PATH
61+
```
62+
63+
### Issue 2: The tests from MESTI.jl take a very long time to run
64+
The tests in <code>MESTI.jl/test</code> and <code>MESTI.jl/examples</code> should complete in a few seconds. If the test keeps running without outputting any errors, ensure that MPI.jl is configured properly by following those [steps](../README.md#Running-MUMPS-in-Julia).
65+
66+
### Issue 3: "shmem: mmap: an error occurred while determining whether or not /var/folders/.../sm_segment.xxx could be created."
67+
If you are using OpenMPI v5.0.3 or later, you may encounter this error while using MESTI.jl. The code can still complete but segmentation fault or deadlock may occur in some [cases](https://github.com/open-mpi/ompi/issues/12307). If those issues occur, you can downgrade OpenMPI to v5.0.2

mumps/windows/Makefile.inc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#
2-
# This file is part of MUMPS 5.6.2, released
3-
# on Wed Oct 11 09:36:25 UTC 2023
2+
# This file is part of MUMPS 5.7.1, released
3+
# on Thu May 2 10:15:09 UTC 2024
44
#
55
################################################################################
66
#
@@ -55,7 +55,7 @@
5555

5656
LPORDDIR = $(topdir)/PORD/lib/
5757
IPORD = -I$(topdir)/PORD/include/
58-
LPORD = -L$(LPORDDIR) -lpord
58+
LPORD = -L$(LPORDDIR) -lpord$(PLAT)
5959

6060
# The following is the path of the METIS by default installation.
6161
# You may need to modify the path based on your machine.
@@ -103,7 +103,7 @@ FPIC_OPT = -fPIC
103103
SONAME = -soname
104104
# Adapt/uncomment RPATH_OPT to avoid modifying
105105
# LD_LIBRARY_PATH in case of shared libraries
106-
RPATH_OPT = -Wl,-rpath,/home/usc/Downloads/MUMPS_5.6.2/lib/
106+
RPATH_OPT = -Wl,-rpath,/home/usc/Downloads/MUMPS_5.7.1/lib/
107107
OUTC = -o
108108
OUTF = -o
109109
# RM : remove files
@@ -151,7 +151,7 @@ SCALAP = -L$(MKLROOT)/lib/intel64 -lmkl_scalapack_lp64 -lmkl_blacs_intelmpi_lp64
151151
LIBPAR = $(SCALAP) $(LAPACK)
152152

153153
INCSEQ = -I$(topdir)/libseq
154-
LIBSEQ = $(LAPACK) -L$(topdir)/libseq -lmpiseq
154+
LIBSEQ = $(LAPACK) -L$(topdir)/libseq -lmpiseq$(PLAT)
155155

156156
# DEFINE HERE YOUR BLAS LIBRARY
157157
# BLAS library is under the folder of $(MKLROOT)/lib/intel64

src/mesti_matrix_solver.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1030,7 +1030,9 @@ function MUMPS_analyze_and_factorize(A::Union{SparseMatrixCSC{Int64, Int64},Spar
10301030
if opts.use_L0_threads
10311031
# Utilize L0-threads feature.
10321032
# This typically improves the time performance, but marginally increases the memory usage in full multithread.
1033-
set_keep!(id,401,1)
1033+
set_icntl!(id,48,1;displaylevel=0)
1034+
else
1035+
set_icntl!(id,48,0;displaylevel=0)
10341036
end
10351037
set_job!(id,1) # what to do: analysis
10361038
if opts.use_given_ordering

src/mumps3_struc.jl

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# this file mirros the relevant content of the "[sdcz]mumps_c.h" file of MUMPS 5.3.3
1+
# this file mirros the relevant content of the "[sdcz]mumps_c.h" file of MUMPS 5.7.1
22
# `gc_haven`, contains Julia references to protect the pointers passed to C
33
# from gargage collection.
44
export Mumps
55

6-
const MUMPS_VERSION = "5.6.2"
6+
const MUMPS_VERSION = "5.7.1"
77
const MUMPS_VERSION_MAX_LEN = 30
88

99
# mirror of structre in [sdcz]mumps_c.h
@@ -53,16 +53,26 @@ mutable struct Mumps{TC,TR}
5353
colsca_from_mumps::MUMPS_INT
5454
rowsca_from_mumps::MUMPS_INT
5555

56+
colsca_loc::Ptr{TR}
57+
rowsca_loc::Ptr{TR}
58+
59+
rowind::Ptr{MUMPS_INT}
60+
colind::Ptr{MUMPS_INT}
61+
pivots::Ptr{TC}
62+
5663
rhs::Ptr{TC}
5764
redrhs::Ptr{TC}
5865
rhs_sparse::Ptr{TC}
5966
sol_loc::Ptr{TC}
6067
rhs_loc::Ptr{TC}
68+
rhsintr::Ptr{TC}
6169

6270
irhs_sparse::Ptr{MUMPS_INT}
6371
irhs_ptr::Ptr{MUMPS_INT}
6472
isol_loc::Ptr{MUMPS_INT}
6573
irhs_loc::Ptr{MUMPS_INT}
74+
glob2loc_rhs::Ptr{MUMPS_INT}
75+
glob2loc_sol::Ptr{MUMPS_INT}
6676

6777
nrhs::MUMPS_INT
6878
lrhs::MUMPS_INT
@@ -71,6 +81,7 @@ mutable struct Mumps{TC,TR}
7181
lsol_loc::MUMPS_INT
7282
nloc_rhs::MUMPS_INT
7383
lrhs_loc::MUMPS_INT
84+
nsol_loc::MUMPS_INT
7485

7586
schur_mloc::MUMPS_INT
7687
schur_nloc::MUMPS_INT
@@ -80,6 +91,7 @@ mutable struct Mumps{TC,TR}
8091
nblock::MUMPS_INT
8192
nprow::MUMPS_INT
8293
npcol::MUMPS_INT
94+
ld_rhsintr::MUMPS_INT
8395

8496
info::NTuple{80,MUMPS_INT}
8597
infog::NTuple{80,MUMPS_INT}
@@ -90,23 +102,26 @@ mutable struct Mumps{TC,TR}
90102
deficiency::MUMPS_INT
91103
pivnul_list::Ptr{MUMPS_INT}
92104
mapping::Ptr{MUMPS_INT}
105+
singular_values::Ptr{TR}
106+
93107

94108
size_schur::MUMPS_INT
95109
listvar_schur::Ptr{MUMPS_INT}
96110
schur::Ptr{TC}
97111

98-
instance_number ::MUMPS_INT
99112
wk_user ::Ptr{TC}
100113

101114
version_number ::NTuple{MUMPS_VERSION_MAX_LEN+1+1,Cchar}
102-
ooc_tmpdir ::NTuple{256,Cchar}
103-
ooc_prefix ::NTuple{64,Cchar}
104-
write_problem ::NTuple{256,Cchar}
115+
ooc_tmpdir ::NTuple{1024,Cchar}
116+
ooc_prefix ::NTuple{256,Cchar}
117+
write_problem ::NTuple{1024,Cchar}
105118
lwk_user ::MUMPS_INT
106-
save_dir ::NTuple{256,Cchar}
119+
save_dir ::NTuple{1024,Cchar}
107120
save_prefix ::NTuple{256,Cchar}
108121

109122
metis_options::NTuple{40,MUMPS_INT}
123+
124+
instance_number::MUMPS_INT
110125

111126
_gc_haven::Array{Ref,1}
112127
_finalized::Bool

src/mumps3_types.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# this file mirrors the "mumps_c_types.h" header file of MUMPS 5.2.2
1+
# this file mirrors the "mumps_c_types.h" header file of MUMPS 5.7.1
22

33
const MUMPS_INT = Cint
44
const MUMPS_INT8 = Int64
@@ -28,3 +28,5 @@ const MUMPS_ARITH_REAL = ( MUMPS_ARITH_s | MUMPS_ARITH_d )
2828
const MUMPS_ARITH_CMPLX = ( MUMPS_ARITH_c | MUMPS_ARITH_z )
2929
const MUMPS_ARITH_SINGLE = ( MUMPS_ARITH_s | MUMPS_ARITH_c )
3030
const MUMPS_ARITH_DBL = ( MUMPS_ARITH_d | MUMPS_ARITH_z )
31+
32+
const MUMPS_OFF_T = MUMPS_INT8

0 commit comments

Comments
 (0)