diff --git a/src/controller.jl b/src/controller.jl index 28023a5..596771f 100644 --- a/src/controller.jl +++ b/src/controller.jl @@ -25,7 +25,7 @@ is_job_queue_empty(controller::Controller) = isempty(controller.job_queue) any_pending_jobs(controller::Controller) = !isempty(controller.pending_jobs) function any_jobs_left(controller::Controller) - !is_job_queue_empty(controller) || any_pending_jobs(controller) + return !is_job_queue_empty(controller) || any_pending_jobs(controller) end function _pick_job_to_send!(controller::Controller) @@ -97,7 +97,8 @@ function send_termination_message(controller::Controller) end requests = Vector{JobRequest}() for worker in 1:controller.n_workers - request = MPI.isend(Job(controller.last_job_id, TerminationMessage()), _mpi_comm(); dest = worker, tag = worker + 32) + request = + MPI.isend(Job(controller.last_job_id, TerminationMessage()), _mpi_comm(); dest = worker, tag = worker + 32) controller.worker_status[worker] = WORKER_AVAILABLE push!(requests, JobRequest(worker, request)) end diff --git a/src/job.jl b/src/job.jl index e103058..bfaba0b 100644 --- a/src/job.jl +++ b/src/job.jl @@ -5,7 +5,7 @@ Base.@kwdef mutable struct Job{T} <: AbstractJob message::T end - mutable struct JobAnswer{T} <: AbstractJob +mutable struct JobAnswer{T} <: AbstractJob job_id::Int message::T end diff --git a/src/pmap.jl b/src/pmap.jl index b327a95..8048841 100644 --- a/src/pmap.jl +++ b/src/pmap.jl @@ -71,5 +71,5 @@ function pmap(f::Function, jobs::Vector, data_defined_in_process = nothing) end return result end - error("Should never get here") + return error("Should never get here") end \ No newline at end of file diff --git a/src/worker.jl b/src/worker.jl index 295f1e1..941fffb 100644 --- a/src/worker.jl +++ b/src/worker.jl @@ -15,7 +15,7 @@ mutable struct Worker end function has_job(worker::Worker) - MPI.Iprobe(_mpi_comm(); source = controller_rank(), tag = worker.rank + 32) + return MPI.Iprobe(_mpi_comm(); source = controller_rank(), tag = worker.rank + 32) end """