From b229c92d30655f30f445bd99a4f89636af10098d Mon Sep 17 00:00:00 2001 From: Antonio De Lucreziis Date: Thu, 13 Mar 2025 13:50:46 +0100 Subject: [PATCH] griejipger --- .vscode/settings.json | 2 ++ arnoldi.c | 5 +++-- matrices/laplacian/julia-laplaciano.jl | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 3e5f9e5..00f9e85 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -10,9 +10,11 @@ "LAPACKE", "MATDENSE", "MATMPIAIJ", + "matwrite", "PETSC", "PETSCVIEWERHDF", "Reorthogonalization", + "spdiagm", "VECMPI" ] } diff --git a/arnoldi.c b/arnoldi.c index b956510..1b13f9d 100644 --- a/arnoldi.c +++ b/arnoldi.c @@ -194,9 +194,10 @@ int main(int argc, char **argv) { PetscErrorCode ArnoldiIteration(Mat A, Vec b, PetscInt n, PetscInt m, Vec *Q, double *h) { PetscFunctionBeginUser; - int rank; + int rank, total; MPI_Comm_rank(PETSC_COMM_WORLD, &rank); - printf("Rank %d\n", rank); + MPI_Comm_size(PETSC_COMM_WORLD, &total); + printf("Process %d of %d\n", rank, total); PetscScalar eps = 1e-12; diff --git a/matrices/laplacian/julia-laplaciano.jl b/matrices/laplacian/julia-laplaciano.jl index dcc29bd..f38becc 100644 --- a/matrices/laplacian/julia-laplaciano.jl +++ b/matrices/laplacian/julia-laplaciano.jl @@ -2,8 +2,8 @@ using SparseArrays using MAT # 11 x 16 -nx = 10 -ny = 15 +nx = 11 - 1 +ny = 16 - 1 ex = fill(1, nx) ey = fill(1, ny) Dxx = spdiagm(-1 => ex, 0 => -2 * ex, +1 => ex)