Questions tagged [petsc]

PETSc, pronounced PET-see (the S is silent), is a suite of data structures and routines for the scalable (parallel) solution of scientific applications modeled by partial differential equations.

145 questions
0
votes
1 answer

Build PETSc matrix with ghost line?

I know PETSc allows its vectors to carry ghost values thanks to VecCreateGhost() or VecMPISetGhost()functions. Does anyone know if there is similar functions to create a matrix with ghost lines ? Thanks, Myriam
0
votes
0 answers

How to convert pyop2.petsc_base.Mat matrix to any of scipy\numpy sparse formats?

Say I have a matrix M: >>> print type(M) >>> dir(M) ['Snapshot', '_Assembly', '_Versioned__version', '__call__', '__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__getitem__',…
Moonwalker
  • 2,180
  • 1
  • 29
  • 48
0
votes
0 answers

PETSC. Run program without using mpiexec

How i can run program, that writen using PETSC, in multiple threads without ./mpiexec -n <>? Maybe i need init MPI separately? Can u get reference to example how init MPI with PetscInitialize() in this case? Thanks!
toodef
  • 125
  • 1
  • 11
0
votes
1 answer

Segfault with operator() for KiFMM when using MPI

I am using KiFMM and PETSc for my code. It had no problems for the serial version, but when I am trying to use MPI with 2 nodes I am now getting an error at (*trgPos)(j,i), which is of type DblNumMat as seen…
M K
  • 69
  • 2
  • 8
0
votes
1 answer

type of expanded C macro

What type and value does PETSC_COMM_WORLD in the following header expand to? Is it just a redefinition for MPI_Comm with extern scope? #define PETSC_EXTERN extern PETSC_VISIBILITY_PUBLIC PETSC_EXTERN MPI_Comm PETSC_COMM_WORLD;
ocramz
  • 816
  • 6
  • 18
0
votes
0 answers

PETSc C macro within struct

In PETSc, a number of common-use structures such as Vec, Mat, IS, etc. are defined similarly, as in the 4 snippets below. Questions: when and how is PETSCHEADER expanded? I am writing the foreign interface from another language, and was wondering…
ocramz
  • 816
  • 6
  • 18
0
votes
1 answer

Unable to generate makefile for basic PETSc program

I have a very basic program using PETSC #include "PETSC/petsc.h" #include "PETSC/petscsys.h" #include "PETSC/petscmat.h" int main(int argc, char *argv[]) { PetscMPIInt rank,size; PetscInitialize(&argc,&argv,0,0); …
M K
  • 69
  • 2
  • 8
0
votes
1 answer

PETSc error for mpicc

I am using a code in C for hydro simulations with radiative transfer. There is need for PETSc, which I got compiled on my local machine. But on compiling my code I get the error message: error: ’__SDIR__’ undeclared (first use in this function). The…
0
votes
1 answer

Replace whole row using MatSetValuesStencil with INSERT_VALUES

I am using Petsc Ksp routines. I construct an operator using MatSetValuesStencil, where in each call of this function I specify one row matrix values of length 5. There is a case where I sometimes need to completely replace a row from a 5 length…
user14416
  • 2,922
  • 5
  • 40
  • 67
0
votes
1 answer

Load matrix from file with use of Octave C++ API

Is it possible to load the matrix in PETSc binary format from external file at runtime with use of Octave C++ API? I've found the Doxygen documentation, but I can't find anything useful among so many items. Usually I use "PetscBinaryRead.m" when I…
Eenoku
  • 2,741
  • 4
  • 32
  • 64
0
votes
0 answers

Error installing petsc with homebrew

I tried installing petsc with homebrew on OSX 10.10.1 with: $brew install petsc I get one error installing one dependency: ==> Installing petsc dependency: hypre ==> Using Homebrew-provided fortran compiler. This may be changed by setting the FC…
ilciavo
  • 3,069
  • 7
  • 26
  • 40
0
votes
0 answers

pseudo-arc length continuation petsc4py

I have been a user of pseudo arc-length continuation, nonlinear solvers... in Trilinos LOCA (c++) for years but I recently come across the python package petsc4py. This simplified a lot my programming for a minor decrease in speed. The only missing…
0
votes
2 answers

PETSc - MatLUFactor - No support for this operation for this object type

I'm trying to program LU decomposition app in PETSc. My idea was, that the program will print the unfactorized matrix, then the factorized matrix and count time taken by a factorization itself. I've written my code according to little information…
Eenoku
  • 2,741
  • 4
  • 32
  • 64
0
votes
1 answer

Using MPI to distribute the job between the processors but all the processors are doing the whole job instead of doing just some part of it

I have a c++ code that can be run in parallel but with shared memory methods. I linked the code to PETSc and PETSc is able to run the code in parallel but with distributed memory method. When I run the code (c++ linked with PETSc) in parallel, it…
Nazi
  • 67
  • 1
  • 7
0
votes
1 answer

Substituting user-defined matrices into PETSc matrices

I have sequential block AIJ matrices which are written in c++ and I am going to use PETSc to create MPI matrices. So, I have to substitute my sparse block AIJ matrices into MPI block AIJ PETSc matrices. Does anyone have any example on how to do…
Nazi
  • 67
  • 1
  • 7
1 2 3
9
10