147 questions
0
votes
0
answers
12
views
PETSc-MUMPS Not Responding To Command-Line Option
I have instaled PETSc and MUMPS (MacOS 15.6.1, M2), and confirmed that they seem to work fine; i.e., I run the exceutable from the command line:
./mypetscapp
and it runs without issue.
However, after ...
5
votes
1
answer
107
views
Use Petsc-Library in Go
I am trying to use the PETSc (Portable, Extensible Toolkit for Scientific Computation) library in Go over cgo. After the call of PetscInitialize, the program will crash at a random point with the ...
4
votes
0
answers
79
views
Open-MPI and MPICH failing on simple test scripts in MacOS, regardless of install method
I cannot run open-mpi or mpich on my machine (macOS (Darwin 24.5.0, macOS Sequoia 15.5) with an Intel (x86_64) processor), and I suspect there is something seriously wrong with my compilers or ...
0
votes
0
answers
48
views
Which type of parallel sparse matrix in PETSc should I use if the row indices in different processors are not continuous?
Genearlly, the type MATMPIAIJ requires that the row indices for different processors are continuous, e.g. processor 0 handles row 0 and 1, processor 1 handles row 2 and 3. But what if I need processor ...
0
votes
1
answer
211
views
Reading PETSc binary matrix in Python
I am trying to read a sparse PETSc matrix saved from a Fortran code into a binary file like so:
CALL PetscViewerBinaryOpen(PETSC_COMM_SELF, TRIM(ADJUSTL(filename)), FILE_MODE_WRITE, viewer2, ier)
CALL ...
0
votes
0
answers
837
views
Error while installing petsc4py "Could not build wheels for petsc"
I'm trying to install petsc4py for python. I'm currently using WSL (Ubuntu) but I've tried in Windows as well and the result is always the same.
The installation of e.g. numpy or pandas worked as ...
0
votes
0
answers
122
views
Solving ODEs with PETSc4py?
I'm trying to get started with PETSc to solve ODEs in Python. In this code I try to solve a simple y'=-ky however it is outputting just 0s as solution. I canont see where the mistake is and neither ...
0
votes
0
answers
63
views
How to write a makeFile to install primme and slepc?
I want to execute multiple files and two libraries (primme and slepc) using my makeFile. My makeFile looks like :
# Compiler
CC = gcc
# Directories
SLEPC_DIR = /home/student/Documents/projet/...
0
votes
0
answers
278
views
(PETSc4py) Creating Distributed Sparse Block Matrix with `createAIJWithArrays'
I am trying to create a sparse block matrix in PETSc4py using local matrices assembled with SciPy. Below is a simple example code with comments
import numpy as np
import petsc4py
from petsc4py import ...
0
votes
1
answer
143
views
Why does setting the values of a PETSc solution Vector not affect the result of DMDAVecGetArray?
The following program is meant to set the value of the internally defined vector in petsc, which can then be read by DMDAVecGetArray:
#include <petscdmda.h>
#include <iostream>
int main(...
2
votes
0
answers
235
views
Proper way to compile and link against petsc using cmake
I followed the configuration and installation of PETSc according to https://petsc.org/release/install/install/#installing-with-open-mpi-with-shared-mpi-libraries as a user not root. The basic check ...
-1
votes
1
answer
235
views
Why the PETSC code run in 1 process and doesn't run in 2 processes?
This is a simple code from the book PETSc for Partial Differential Equations: Numerical Solutions in C and Python. It computes the zero of atan(x). If I run it in one process, it runs properly. ...
0
votes
0
answers
424
views
'symbol lookup error: undefined symbol' after change of module system on cluster
after the operating system of the cluster I am running my application on with PETSC (Version 3.19) has been changed from CentOS 7 to Rocky Linux 8 and also the module system has been changed to Lmod, ...
0
votes
0
answers
101
views
Ex1_5 test error during PETSc make all test
I am installing PETSc on Ubuntu 16.04 to later on build CrunchTope. The installation goes fine using the process defined on the PETSC website. When I run make all check, I get a positive reply that ...
0
votes
1
answer
438
views
Install PetSc on Windows
Hello I'm trying to install PetSc on Windows11 with MSyS2 using the tutorial. But when I'm trying to do the last step of the installation using this line :
" $ /usr/bin/python ./configure --with-...
2
votes
0
answers
131
views
PETSc: OMP+MKL in MatShell
I am trying to use a custom matvec operator with PETSc MatShell in Fortran and inside of it, I want to use a mix of OpenMP and MKL multithreading (blas).
The OpenMP and MKL threads are indeed launched,...
0
votes
1
answer
128
views
Writing the eigenvectors, obtained using SLEPc, to a file in C
I have recently started using SLEPc for diagonalizing large sparse matrices, taking advantage of MPI. Everything works fine, except at the end when I want to write the eigenvectors to a file. I do ...
0
votes
1
answer
779
views
How do you correctly define the dependencies to FFTW in a cmake file?
I want to use fftw in my c++ program.
For this, I have installed petsc alongside the --download-fftw option, since I want to be using Petsc in the future as well. I simply downloaded the most recent ...
0
votes
1
answer
86
views
PETsc mpiaij matrix is shrinking with added number of processprs
I am trying to do some matrix matrix multiplication using PETsc but if I increase the number of processes using the mpiexec -n, the matrix would be smaller than expected by the factor of number of ...
1
vote
1
answer
70
views
Thetis example North Sea AttributeError: 'VectorElement' object has no attribute '__dict__'
I have tried to fix this error for quiet some time but can't find how to fix it. Is there someone who could help me out? It is an error when running the nort sea 2d model from thetis. [https://...
0
votes
0
answers
655
views
cannot open shared object file: No such file or directory, even after modifying LD_LIBRARY_PATH variable
I have been trying to use PETSc for some MPI enhanced matrix operations, but I keep getting this error when I submit the job using slurm on a supercomputer:
ERROR: ERROR: LoadError: LoadError: could ...
0
votes
1
answer
250
views
Fortran declarations using PETSc's key words not recognized in VSCode
I'm using VSCode with Modern Fortran+fortls to write Fortran code with PETSc library. The declaration using PETSc's key words seems not being recognized at all. I tried to include the path of PETSc ...
0
votes
0
answers
205
views
Fortran arrays to PETSc vector/matrix conversion
I am working on a computational fluid dynamics code, and most of the primary design of the code is already written in Fortran.
I intend to switch the linear algebra solver to use some PETSc utilities, ...
1
vote
1
answer
275
views
How to use PETSc to calculate the first k eigenpair of symmetric Compressed Sparse Row Matrix?
I need to decompose the eigenvalues of the large-scale(such as 10M*10M) sparse matrix as quickly as possible.I try Spectra but it is slow,It seems that Blaze cannot be used for the first k eigenpair ...
2
votes
1
answer
646
views
Convert a list of Vector to a matrix with petsc4py
I have a list of vectors that I want to gather in a single matrix Z. Here is the code I tried to use :
import sys, slepc4py
slepc4py.init(sys.argv)
from petsc4py import PETSc
from slepc4py import ...
0
votes
1
answer
213
views
Mac OSX 12.4 (Monterey). Trying to compile an old Python code. Configure: error: set PETSC_DIR to point at PETSc installation. Related to gfortran?
I have been trying to compile an old Python code. A couple of days ago I posted a question that described problems with accessing Python and gfortran. I solved the Python problem, then the question ...
1
vote
1
answer
271
views
Unable to compile PETSc programs in visual Studio 2019 after linking libraries
I am trying to compile a simple PETSc program (Which works when compiled in Cygwin) in Visual Studio 2019. But I am unable to compile it in VS2019 even after linking all the necessary library files. I ...
1
vote
0
answers
792
views
hwloc/linux warning and PETSc Segmentation Violation error
I am trying to run a program using mpirun command (as shown below).
mpirun -np 4 python test.py
But I am getting following warning first:
hwloc/linux: Ignoring PCI device with non-16bit domain.
Pass -...
1
vote
0
answers
213
views
PETSc configure and building with Intel compilers with cygwin
i'm trying to configure and build PETSC library to use in my project, in the website of PETSC they recommend cygwin to install the library on windows.
with Intel compilers they provide a file "...
0
votes
1
answer
1k
views
Cannot install petsc4py on Ubuntu 20.04
After successfully installing and testing PETSc I went ahead and tried to install petsc4py with:
$ sudo python3 -m pip install petsc4py
but got loads of errors. Here are the messages:
Collecting ...
0
votes
0
answers
137
views
Error while downloading PETSc and SLEPc with cygwin
I try to install PETSc and SLEPc with cygwin on Windows following a manual. It says:
mkdir petsc
mkdir slepc
git clone -b maint https://bitbucket.org/petsc/petsc petsc
git clone -b maint https://...
0
votes
0
answers
274
views
Using PETSc for a CFD problem where calculation of matrix elements is computationally expensive
I am trying to use PETSc as a solver for a multiphase CFD code. The code is based on finite volume estimation. The calculation of matrix coefficients by themselves is time consuming, almost the same ...
1
vote
0
answers
161
views
PETSc - MatLUFactor - Problem for `mpiaij` matrix and replace by SuperLU
I am a beginner in using PETSc and I am trying to develop a function to reverse a PETSc matrix. However, as I am using a mpiaij matrix, PETSc shows no support for this type.
[0]PETSC ERROR: No support ...
1
vote
1
answer
2k
views
compiling cpp code includes PETSc with Cmake
I want to use PETSc in a cpp code. I installed PETScand when run the cmd echo $PETSC_DIRI got the path to the library.
I make a hello world code and
#include "petsc.h"
#include <iostream&...
0
votes
2
answers
558
views
Configure debug setting for PETSc in VScode
This will be a long shot, but I would like to know if anyone in the community has the .json setting for running PETSc in VScode (for debbuging).
Best Regards
0
votes
2
answers
879
views
Compiling a C++ code including PETSc libraries. make: No rule to make target error message
I am interested in using the open source code discussed here. The framework and some instruction on how to run the code is discussed here. To be able to use the code one should first install PETSc. I ...
1
vote
1
answer
127
views
PETSc memory corruption on using DMDAVecGetArray
I'm trying to use PETSc's DMDA Vectors with 2 degrees of freedom and access them using struct, like in the manual.
However, when I try to use DMDAVecGetArray even with one degree of freedom (like in ...
-1
votes
1
answer
61
views
compile error related to "in expansion of macro ‘CHKERRQ"’
I have this compiler error related to "in expansion of macro ‘CHKERRQ’" from PETSC whenever I call "CHKERRQ", I am not sure what causes it, could anyone please give any advice?
...
1
vote
1
answer
90
views
PETSc vectorize operations with neighboring vector values
I'm implementing finite difference algorithm from uFDTD book. Many FDM equations involve operations on adjoined vector elements.
For example, an update equation for electric field
ez[m] = ez[m] + (hy[...
1
vote
1
answer
611
views
How to link to PETSc from a C++ (with armadillo) code?
I have a piece of C++ code (main.cpp) which uses armadillo to prepare a very LARGE sparse matrix and its r.h.s, to be solved like x = A\b.
Problem: In armadillo, no parallel-iterative-linear sparse ...
0
votes
1
answer
177
views
Library doesn't properly link at command 'make'
I am trying to use some open-source CFD code, and it uses PETSC and some other libraries, so I installed them. But when I try to compile program useing 'make', it seems like libraries are not properly ...
0
votes
0
answers
80
views
Using boost-odeint within MPI context without using mpi_state results in different time steps for adaptive stepper
I'm trying to upgrade an existing code which uses odeint to be able to use MPI for calculating the right hand side function more efficiently. It is possible to combine boost::odeint with MPI based on ...
1
vote
1
answer
2k
views
Header files not found by 'make'
The make instruction is not finding the libraries required for compilation. They are in other folder than the usual /usr/include folder.
I'm complying a simulation software called magnum.fe I already ...
0
votes
1
answer
186
views
Applying 1d-FFT over each row in PETSc-matrix
I have a PETSc-matrix, and would like to apply a 1d-FFT on each row of that matrix, preferably while keeping the possibility having the matrix distributed over several nodes. Based on the ...
1
vote
0
answers
74
views
CVODE PETSc interface gives a memory corruption error
I'm trying to figure out how CVODE interfaces with PETSc since I've been getting a memory corruption error when running the examples. I've isolated a minimal reproducible example below
running this
...
1
vote
0
answers
332
views
Detecting some strange errors in installation of PETSc on centOS
I met 2 problems when I build PETSc as follows:
./configure --prefix=/home/lengjun/softwares/petsc_install
make PETSC_DIR=/home/lengjun/softwares/petsc-3.14.1 PETSC_ARCH=arch-linux2-c-debug all
make ...
0
votes
1
answer
636
views
What is the meaning of using COMM_WORLD or COMM_SELF to instantiate a TS, DMDA, Vec, etc
I'm looking at several examples from PETSc and petsc4py and looking at the PDF user manual of PETSc. The manual states:
For those not familiar with MPI, acommunicatoris a way of indicating a ...
-1
votes
1
answer
473
views
Compile petsc included code using a makefile, failed for '.f90' but passed for '.F90'
I'm leaning petsc (3.13.1) on a Linux virtual machine.
The compiler is mpich-3.2.1 compiled with gfortran.
While going through the tutorials I found the extensinos are .F90,
the files did not work ...
0
votes
1
answer
235
views
How to pass array of PETSc Vec to a function
I am trying to pass an array of Vec's in PETSc to a function, modify it internally and retrieve the results. A pseudocode is as follows:
PetscErrorCode foo(Vec *y, int n) {
// ...
...
2
votes
1
answer
738
views
Attempting to compile through MacOS Terminal: "No such file or directory"
I'm trying to compile this project from DTU. This project requires that PETSc be installed.
I have installed PETSc to /Users/hornymoose/petsc-3.13.3/
I have extracted the zip from GitHub to /Users/...