Skip to content

Commit

Permalink
Warn if user tries to run on CPU without enabling multi-threading
Browse files Browse the repository at this point in the history
  • Loading branch information
rkierulf committed Jul 11, 2024
1 parent 405f8d1 commit 3bce915
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions KomaMRICore/src/simulation/SimulatorCore.jl
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,13 @@ function simulate(
)
#Simulation parameter unpacking, and setting defaults if key is not defined
sim_params = default_sim_params(sim_params)
#Warn if user is trying to run on CPU without enabling multi-threading
if (!sim_params["gpu"] && Threads.nthreads() == 1)
@info """
Simulation will be run on the CPU with only 1 thread. To
enable multi-threading, start julia with --threads=auto.
""" maxlog=1
end
# Simulation init
seqd = discretize(seq; sampling_params=sim_params) # Sampling of Sequence waveforms
parts, excitation_bool = get_sim_ranges(seqd; Nblocks=sim_params["Nblocks"]) # Generating simulation blocks
Expand Down

0 comments on commit 3bce915

Please sign in to comment.