Created
December 19, 2013 21:19
-
-
Save illerucis/8046435 to your computer and use it in GitHub Desktop.
Testing module for parallel computing.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module TestIt | |
export test_call | |
function test_call() | |
test() | |
end | |
function test() | |
rec = {"test_type" => "test_type"} | |
data = [1, 2, 3, 4] | |
function red(i...) | |
times = [i...] | |
return times | |
end | |
times = @parallel (red) for i = 1:10 | |
reptimes = Dict{String, Float64}() | |
gc() | |
data_copy = copy(data) | |
reptimes["Bob"] = 1.2 | |
sorted = @elapsed sort!(data_copy) | |
@assert issorted(data_copy) | |
merge(rec, reptimes) | |
end | |
println( times ) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment