Skip to content

Commit

Permalink
unlink the number of tasks form the number of threads
Browse files Browse the repository at this point in the history
  • Loading branch information
PetrKryslUCSD committed Feb 10, 2024
1 parent d2c763b commit c9e6fbd
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions examples/steady_state/3-d/Poisson_examples.jl
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ function Poisson_FE_T4_example(N = 25)
true
end # Poisson_FE_T4_example

function Poisson_FE_H20_parass_tasks_example(N = 25)
function Poisson_FE_H20_parass_tasks_example(N = 25, ntasks = Base.Threads.nthreads() - 1)
@assert ntasks >= 1
@info "Starting"

A = 1.0 # dimension of the domain (length of the side of the square)
Expand Down Expand Up @@ -312,8 +313,6 @@ function Poisson_FE_H20_parass_tasks_example(N = 25)
ndofs_row = nalldofs(Temp)
ndofs_col = nalldofs(Temp)
startassembly!(a, elem_mat_nrows * elem_mat_ncols * elem_mat_nmatrices, ndofs_row, ndofs_col)
ntasks = Base.Threads.nthreads() - 1
@assert ntasks >= 1
iend = 0
Threads.@sync begin
for ch in chunks(1:count(fes), ntasks)
Expand Down Expand Up @@ -366,7 +365,8 @@ function Poisson_FE_H20_parass_tasks_example(N = 25)
true
end # Poisson_FE_H20_parass_tasks_example

function Poisson_FE_H20_parass_threads_example(N = 25)
function Poisson_FE_H20_parass_threads_example(N = 25, ntasks = Base.Threads.nthreads() - 1)
@assert ntasks >= 1
@info "Starting"

A = 1.0 # dimension of the domain (length of the side of the square)
Expand Down Expand Up @@ -453,7 +453,6 @@ function Poisson_FE_H20_parass_threads_example(N = 25)
ndofs_col = nalldofs(Temp)
startassembly!(a, elem_mat_nrows * elem_mat_ncols * elem_mat_nmatrices, ndofs_row, ndofs_col)
@info "Creating thread structures $(time() - start)"
ntasks = Base.Threads.nthreads()
_a = []
_r = []
iend = 0
Expand Down

0 comments on commit c9e6fbd

Please sign in to comment.