From b2d757a24678df63ec9d170e067646efb21f1a7e Mon Sep 17 00:00:00 2001 From: Petr Krysl Date: Thu, 14 Mar 2024 16:16:40 -0700 Subject: [PATCH] upd for multithreading --- examples/Manifest.toml | 2 +- examples/steady_state/2-d/Poisson_examples.jl | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/examples/Manifest.toml b/examples/Manifest.toml index 8887bda..a807e0a 100644 --- a/examples/Manifest.toml +++ b/examples/Manifest.toml @@ -283,7 +283,7 @@ version = "3.0.5" [[deps.FinEtoolsMultithreading]] deps = ["ChunkSplitters", "FinEtools", "LinearAlgebra", "SparseArrays", "SparseMatricesCSR", "Test"] -git-tree-sha1 = "0651710dcb8582120fe75551bd8ca7e9e33b9930" +git-tree-sha1 = "44287b240318acf33edcd5c226b468a2a59ae74a" repo-rev = "main" repo-url = "https://github.com/PetrKryslUCSD/FinEtoolsMultithreading.jl.git" uuid = "6d2818ca-ed81-4c53-b1fa-1f68c2fd5913" diff --git a/examples/steady_state/2-d/Poisson_examples.jl b/examples/steady_state/2-d/Poisson_examples.jl index 3bb0874..ef50f95 100644 --- a/examples/steady_state/2-d/Poisson_examples.jl +++ b/examples/steady_state/2-d/Poisson_examples.jl @@ -6,7 +6,6 @@ using FinEtoolsHeatDiff using FinEtoolsHeatDiff.AlgoHeatDiffModule import LinearAlgebra: cholesky using FinEtoolsMultithreading.Exports -using FinEtoolsMultithreading: csc_matrix function Poisson_FE_example() println(""" @@ -331,7 +330,9 @@ function Poisson_FE_Q4_parallel_example(N = 100, ntasks = Threads.nthreads(), as conductivity(femm, assembler, geom, Temp) end + t1 = time() n2e = FENodeToFEMap(fes.conn, nnodes(Temp)) + println("Make node to element map = $(time() - t1) [s]") println("Conductivity") t0 = time(); @@ -345,12 +346,8 @@ function Poisson_FE_Q4_parallel_example(N = 100, ntasks = Threads.nthreads(), as println(" Make node to neighbor map = $(time() - t1) [s]") t1 = time() - start, dofs = sparsity_pattern_symmetric(fes, Temp, n2n) - println(" Make sparsity pattern = $(time() - t1) [s]") - - t1 = time() - K = csc_matrix(start, dofs, nalldofs(Temp), zero(eltype(Temp.values))) - println(" Make zero matrix = $(time() - t1) [s]") + K = sparse_symmetric_zero(Temp, n2n, :CSC) + println(" Make sparse zero = $(time() - t1) [s]") t1 = time() add_to_matrix!(K, assembler)