Skip to content

Commit

Permalink
test LSFManager if bsub present
Browse files Browse the repository at this point in the history
  • Loading branch information
bjarthur committed Aug 23, 2020
1 parent 582ec89 commit 2b96e2c
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using Test
using ClusterManagers

TIMEOUT = 10.
using Distributed

@testset "ElasticManager" begin
TIMEOUT = 10.

em = ElasticManager(addr=:auto, port=0)

Expand All @@ -15,4 +15,28 @@ TIMEOUT = 10.
length(em.active) == 1
end

wait(rmprocs(workers()))
end


@static if Sys.iswindows()
windows_which(command) = `powershell.exe -Command Get-Command $command`
is_lsf_installed() = success(windows_which("bsub.exe"))
else
is_lsf_installed() = success(`which bsub`)
end

if is_lsf_installed()

@testset "LSFManager" begin
p = addprocs_lsf(1, bsub_flags=`-P scicompsoft`)
@test nprocs() == 2
@test workers() == p
@test fetch(@spawnat :any myid()) == p[1]
@test remotecall_fetch(+,p[1],1,1) == 2
rmprocs(p)
@test nprocs() == 1
@test workers() == [1]
end

end

0 comments on commit 2b96e2c

Please sign in to comment.