From 5d03dd400d8fcdead92abebdba5c766343c2c916 Mon Sep 17 00:00:00 2001 From: Antonio De Lucreziis Date: Mon, 17 Mar 2025 10:14:46 +0000 Subject: [PATCH] changes from cluster --- experiment-1.sh | 4 ++-- experiment-single.sh | 6 +++--- experiment-template.sh | 8 ++++++++ matrices/laplacian/julia-laplaciano.jl | 14 +++++++++----- 4 files changed, 22 insertions(+), 10 deletions(-) create mode 100644 experiment-template.sh diff --git a/experiment-1.sh b/experiment-1.sh index 3f07ff7..4a74176 100644 --- a/experiment-1.sh +++ b/experiment-1.sh @@ -1,12 +1,12 @@ #!/bin/bash #SBATCH --job-name=experiment-1 #SBATCH --nodes=20 -#SBATCH --output=%x_%j.log +#SBATCH --output=%x.log for i in {1..20} do echo "Node Count: $i" - srun --nodes=$i ./build/arnoldi -l 25 + mpirun -d3 -np $i ./build/arnoldi -l 25 sleep 1 done diff --git a/experiment-single.sh b/experiment-single.sh index 857b5c5..c6d273c 100644 --- a/experiment-single.sh +++ b/experiment-single.sh @@ -1,6 +1,6 @@ #!/bin/bash -#SBATCH --job-name=experiment-single -#SBATCH --nodes=20 +#SBATCH --job-name=experiment-NUM +#SBATCH --nodes=NUM #SBATCH --output=%x_%j.log -srun ./build/arnoldi -l 25 +mpirun ./build/arnoldi -l 25 diff --git a/experiment-template.sh b/experiment-template.sh new file mode 100644 index 0000000..aa776e1 --- /dev/null +++ b/experiment-template.sh @@ -0,0 +1,8 @@ +#!/bin/bash +#SBATCH --job-name=exp_ID +#SBATCH --nodes=NUM +#SBATCH --output=%x.log + +hostname +mpirun ./build/arnoldi -l 25 -matrix_path laplacian_SIZE.mat + diff --git a/matrices/laplacian/julia-laplaciano.jl b/matrices/laplacian/julia-laplaciano.jl index 0e87c4d..6ca4fcb 100644 --- a/matrices/laplacian/julia-laplaciano.jl +++ b/matrices/laplacian/julia-laplaciano.jl @@ -1,10 +1,12 @@ using SparseArrays using MAT -# 20 x 20 x 20 grid -nx = 20 - 1 -ny = 20 - 1 -nz = 20 - 1 +N = parse(Int, ARGS[1]) +println("Generating 3D Laplacian for size $N") + +nx = N +ny = N +nz = N ex = fill(1, nx) ey = fill(1, ny) @@ -20,4 +22,6 @@ Iz = spdiagm(0 => [ez; 1]) L = kron(Dxx, Iy, Iz) + kron(Ix, Dyy, Iz) + kron(Ix, Iy, Dzz) -matwrite("laplacian-discretization-3d.mat", Dict("A" => L)) +display(sparse(L)) + +matwrite("laplacian_$N.mat", Dict("A" => L))