Skip to content

Commit 43d4e23

Browse files
authored
Whitespace fixes (#235)
1 parent 18db175 commit 43d4e23

File tree

9 files changed

+20
-25
lines changed

9 files changed

+20
-25
lines changed

Diff for: LICENSE.md

-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,3 @@ ClusterManagers.jl is licensed under the MIT License:
2121
> LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
2222
> OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
2323
> WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24-

Diff for: README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ julia> From worker 2: compute-6
9393
From worker 3: compute-6
9494
```
9595

96-
Some clusters require the user to specify a list of required resources.
96+
Some clusters require the user to specify a list of required resources.
9797
For example, it may be necessary to specify how much memory will be needed by the job - see this [issue](https://github.com/JuliaLang/julia/issues/10390).
9898
The keyword `qsub_flags` can be used to specify these and other options.
9999
Additionally the keyword `wd` can be used to specify the working directory (which defaults to `ENV["HOME"]`).
@@ -176,10 +176,10 @@ ElasticManager:
176176
Active workers : []
177177
Number of workers to be added : 0
178178
Terminated workers : []
179-
Worker connect command :
179+
Worker connect command :
180180
/home/user/bin/julia --project=/home/user/myproject/Project.toml -e 'using ClusterManagers; ClusterManagers.elastic_worker("4cOSyaYpgSl6BC0C","127.0.1.1",36275)'
181181
```
182182

183-
By default, the printed command uses the absolute path to the current Julia executable and activates the same project as the current session. You can change either of these defaults by passing `printing_kwargs=(absolute_exename=false, same_project=false))` to the first form of the `ElasticManager` constructor.
183+
By default, the printed command uses the absolute path to the current Julia executable and activates the same project as the current session. You can change either of these defaults by passing `printing_kwargs=(absolute_exename=false, same_project=false))` to the first form of the `ElasticManager` constructor.
184184

185-
Once workers are connected, you can print the `em` object again to see them added to the list of active workers.
185+
Once workers are connected, you can print the `em` object again to see them added to the list of active workers.

Diff for: slurm_test.jl

-3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,3 @@ ClusterManagers.addprocs_slurm(4; exeflags=["--project=.", "--color=yes"], job_f
1616
end
1717
end
1818
end
19-
20-
21-

Diff for: src/affinity.jl

-1
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,3 @@ function manage(manager::LocalAffinityManager, id::Integer, config::WorkerConfig
5050
kill(get(config.process), 2)
5151
end
5252
end
53-

Diff for: src/elastic.jl

+5-5
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ struct ElasticManager <: ClusterManager
2626
error("Failed to automatically get host's IP address. Please specify `addr=` explicitly.")
2727
end
2828
end
29-
29+
3030
l_sock = listen(addr, port)
3131

3232
lman = new(Dict{Int, WorkerConfig}(), Channel{TCPSocket}(typemax(Int)), Set{Int}(), topology, getsockname(l_sock), printing_kwargs)
@@ -125,7 +125,7 @@ function Base.show(io::IO, mgr::ElasticManager)
125125

126126
println(iob, " Worker connect command : ")
127127
print(iob, " ", get_connect_cmd(mgr; mgr.printing_kwargs...))
128-
128+
129129
print(io, String(take!(iob)))
130130
end
131131

@@ -140,17 +140,17 @@ function elastic_worker(cookie, addr="127.0.0.1", port=9009; stdout_to_master=tr
140140
end
141141

142142
function get_connect_cmd(em::ElasticManager; absolute_exename=true, same_project=true)
143-
143+
144144
ip = string(em.sockname[1])
145145
port = convert(Int,em.sockname[2])
146146
cookie = cluster_cookie()
147147
exename = absolute_exename ? joinpath(Sys.BINDIR, Base.julia_exename()) : "julia"
148148
project = same_project ? ("--project=$(Pkg.API.Context().env.project_file)",) : ()
149-
149+
150150
join([
151151
exename,
152152
project...,
153153
"-e 'using ClusterManagers; ClusterManagers.elastic_worker(\"$cookie\",\"$ip\",$port)'"
154154
]," ")
155-
155+
156156
end

Diff for: src/lsf.jl

+6-6
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,21 @@ function lsf_bpeek(manager::LSFManager, jobid, iarray)
4040
worker_started, bytestr, host, port = parse_host_port(stream)
4141
worker_started && return stream, host, port
4242

43-
for retry_delay in retry_delays
44-
# isempty is for the case when -f flag is not used to handle the case when
43+
for retry_delay in retry_delays
44+
# isempty is for the case when -f flag is not used to handle the case when
4545
# the << output from ... >> message is printed but the julia worker has not
4646
# yet printed the ip and port nr
4747
if isempty(bytestr) || occursin("Not yet started", bytestr)
4848
# bpeek process would have stopped
49-
# stream starts spewing out empty strings after this (in julia != 1.6)
49+
# stream starts spewing out empty strings after this (in julia != 1.6)
5050
# instead of trying to handle that we just close it and open a new stream
5151
wait(streamer_proc)
5252
close(stream)
5353
stream = Base.BufferStream()
5454

5555
# Try bpeeking again after the retry delay
5656
sleep(retry_delay)
57-
streamer_proc = run(pipeline(streamer_cmd; stdout=stream, stderr=stream); wait=false)
57+
streamer_proc = run(pipeline(streamer_cmd; stdout=stream, stderr=stream); wait=false)
5858
elseif occursin("<< output from stdout >>", bytestr) || occursin("<< output from stderr >>", bytestr)
5959
# ignore this bpeek output decoration and continue to read the next line
6060
mark(stream)
@@ -63,7 +63,7 @@ function lsf_bpeek(manager::LSFManager, jobid, iarray)
6363
close(stream)
6464
throw(LSFException(bytestr))
6565
end
66-
66+
6767
worker_started, bytestr, host, port = parse_host_port(stream)
6868
worker_started && break
6969
end
@@ -111,7 +111,7 @@ function launch(manager::LSFManager, params::Dict, launched::Array, c::Condition
111111
asyncmap((i)->lsf_launch_and_monitor(manager, launched, c, jobid, i),
112112
1:np;
113113
ntasks=manager.throttle)
114-
114+
115115
catch e
116116
println("Error launching workers")
117117
println(e)

Diff for: src/qsub.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function launch(manager::Union{PBSManager, SGEManager, QRSHManager},
4141
for i in 1:np
4242
config = WorkerConfig()
4343
config.io, io_proc = stream_proc[i]
44-
config.userdata = Dict{Symbol, Any}(:task => i,
44+
config.userdata = Dict{Symbol, Any}(:task => i,
4545
:process => io_proc)
4646
push!(instances_arr, config)
4747
notify(c)

Diff for: test/runtests.jl

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ qsub_is_installed() = !isnothing(Sys.which("qsub"))
2828

2929
@testset "ClusterManagers.jl" begin
3030
include("elastic.jl")
31-
31+
3232
if slurm_is_installed()
3333
@info "Running the Slurm tests..." Sys.which("sbatch")
3434
include("slurm.jl")
@@ -41,7 +41,7 @@ qsub_is_installed() = !isnothing(Sys.which("qsub"))
4141
@test_skip false
4242
end
4343
end
44-
44+
4545
if lsf_is_installed()
4646
@info "Running the LSF tests..." Sys.which("bsub")
4747
include("lsf.jl")
@@ -54,7 +54,7 @@ qsub_is_installed() = !isnothing(Sys.which("qsub"))
5454
@test_skip false
5555
end
5656
end
57-
57+
5858
if qsub_is_installed()
5959
@info "Running the SGE (via qsub) tests..." Sys.which("qsub")
6060
include("slurm.jl")

Diff for: test/slurm.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
rmprocs(p)
1111
@test nprocs() == 1
1212
@test workers() == [1]
13-
13+
1414
# Check that `outfile` exists:
1515
@test isfile(outfile)
1616
# Check that `outfile` is not empty:

0 commit comments

Comments
 (0)