Comments (7)
Hello, Mikhail,
I'm curious in what way this fails. But more to the point I do see a couple things I would change.
First, if you are using MPI_COMM_SELF then every process is performing its own separate eigenvalue solve so they each have global eigenvectors. This means that the GlobalVector() call is not actually necessary. This call allocates a new vector and populates it with data from all processors so that each processor will have a copy of the full vector. Also, since this call allocates a new Vector, technically you should free y after copying it to x (assuming to don't simply eliminate y because it doesn't seem to be needed).
Did you try:
Vector x;
modes.GetColumnReference(i, x);
x =lobpcg->GetEigenvector(i);
I hope this is useful,
Mark
from mfem.
Hello Mark,
Thank you for your reply. I use MPI parallelism on a coarser scale, i.e. I need to solve many eigenproblems - each one within it's own subdomain. The subdomains, nevertheless, can consist of many cells, so the matrices can be quite large and sparse. Therefore, I'd like to use LOBPCG to solve the eigenproblem. The issue is that this solver is implemented for parallel setup only. So, even though I'd like to solve each eigenproblem with one thread, i.e. sequentially, I have to pretend I solve it in parallel to use LOBPCG.
You're right about the deallocation of the vector y, I had it in the code some time ago :)
And, finally, thank you for the suggestion how to fix the issue - that works great!
Cheers,
Mikhail
P.S. But it would be helpful to know why calling GlobalVector() fails. From what I understand it's not prohibited to create a full vector even though only one thread had the whole vector. I mean, it's clearly not necessary, and not efficient, but shouldn't be harmful. But what I saw was segfaults and memory corruption messages, so I'm curious why.
from mfem.
Hello Mark,
And, finally, thank you for the suggestion how to fix the issue - that works great!
In fact, it doesn't - I checked that there were no segfaults and other nasty stuff, but in fact this approach doesn't fill up the matrix:
Vector x;
modes.GetColumnReference(i, x);
x =lobpcg->GetEigenvector(i);
The reason is because lobpcg->GetEigenvector(i)
returns a vector with size = x.size()+1, i.e. one bigger than x, so when x is copy constructed from lobpcg->GetEigenvector(i)
, it is reallocated and no longer connected to the modes
matrix.
Any suggestions?
Thanks,
Mikhail
from mfem.
Hi, Mikhail,
I found an error in how the eigenvectors were being allocated. In the file "linalg/hypre.cpp" the line "part[1]++;" in the HypreLOBPCG::SetOperator() method should be removed.
I've made the change in our local version but I'll need to verify a few things before changing the GitHub version.
Thanks for pointing this out. Have a nice day,
Mark
from mfem.
Hi Mark,
Now it works fine. Thank you for fixing that!
Cheers,
Mikhail
from mfem.
Hi Mihail,
Can we mark this issue as resolved?
Cheers,
Tzanio
from mfem.
Yes, of course. I just thought you'd close it after updating the github repository, but it's sure resolved.
Cheers,
Mikhail
from mfem.
Related Issues (20)
- How to compile a single example HOT 4
- Gauss-Lobatto Basis Affecting Discontinuous Initial Conditions in DG HOT 8
- What does the Trans.Weight() do HOT 4
- Build a MFEM project with an example in qt-creator HOT 4
- Add Support for Higher-Order H1 Pyramid Basis Functions HOT 1
- UniformRefinement() is anisotropic for periodic-segment.mesh HOT 2
- Inconsistent large/nan mass matrix entries HOT 1
- Domainintegrator markers and matrix free gpu HOT 4
- Some question about explicit and implicit time ODE solvers HOT 2
- Standard usage of a BilinearForm
- Is there a example for time-dependet RHS ? HOT 1
- How to compare Gradient created by serial code to Gradient created by parallel code? HOT 1
- Computing the static magnetic field energy HOT 3
- CutFEM in MFEM
- Fails to build against sundials-7 HOT 1
- Dirichelet boundary condition in a time-dependent problem HOT 3
- importing geometry/models HOT 4
- Why is dt updated 3 times in Newmark class HOT 3
- Behavior of `GridFunction::ProjectCoefficient(Coefficient &coeff)` in a Vector `FiniteElementSpace` (VDim > 1) HOT 2
- Moonolith ex1p HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mfem.