From ab6a71c9b87dae7b2fd072a68dba5bd25f214437 Mon Sep 17 00:00:00 2001 From: Joungmin Lee Date: Sat, 22 Jun 2019 14:58:19 +0900 Subject: [PATCH 01/52] change codes for julia 1.0+ --- Manifest.toml | 244 ++++++++++++++++++++++++++++++++++++++++++ Project.toml | 31 ++++++ REQUIRE | 12 ++- config/sshCfg.jl | 9 +- src/COBRA.jl | 5 +- src/PALM.jl | 22 ++-- src/checkSetup.jl | 12 +-- src/connect.jl | 20 ++-- src/distributedFBA.jl | 64 +++++------ src/load.jl | 26 ++--- src/tools.jl | 2 +- test/REQUIRE | 8 +- test/getTestModel.jl | 8 +- test/p_all.jl | 36 ++++--- test/p_distinct.jl | 10 +- test/p_range.jl | 8 +- test/runtests.jl | 28 ++--- test/s_all.jl | 6 +- test/s_core.jl | 6 +- test/s_distinct.jl | 12 +-- test/s_fba.jl | 8 +- test/s_tools.jl | 2 - test/z_all.jl | 10 +- 23 files changed, 429 insertions(+), 160 deletions(-) create mode 100644 Manifest.toml create mode 100644 Project.toml diff --git a/Manifest.toml b/Manifest.toml new file mode 100644 index 0000000..c6e37fd --- /dev/null +++ b/Manifest.toml @@ -0,0 +1,244 @@ +# This file is machine-generated - editing it directly is not advised + +[[Base64]] +uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" + +[[BinDeps]] +deps = ["Compat", "Libdl", "SHA", "URIParser"] +git-tree-sha1 = "12093ca6cdd0ee547c39b1870e0c9c3f154d9ca9" +uuid = "9e28174c-4ba2-5203-b857-d8d62c4213ee" +version = "0.8.10" + +[[BinaryProvider]] +deps = ["Libdl", "SHA"] +git-tree-sha1 = "c7361ce8a2129f20b0e05a89f7070820cfed6648" +uuid = "b99e7846-7c00-51b0-8f62-c81ae34c0232" +version = "0.5.4" + +[[Blosc]] +deps = ["BinaryProvider", "CMakeWrapper", "Compat", "Libdl"] +git-tree-sha1 = "71fb23581e1f0b0ae7be8ccf0ebfb3600e23ca41" +uuid = "a74b3585-a348-5f62-a45c-50e91977d574" +version = "0.5.1" + +[[BufferedStreams]] +deps = ["Compat", "Test"] +git-tree-sha1 = "5d55b9486590fdda5905c275bb21ce1f0754020f" +uuid = "e1450e63-4bb3-523b-b2a4-4ffa8c0fd77d" +version = "1.0.0" + +[[CMake]] +deps = ["BinDeps", "Libdl", "Test"] +git-tree-sha1 = "6e39bef3cbb8321e8a464b18a5c20d7cef813938" +uuid = "631607c0-34d2-5d66-819e-eb0f9aa2061a" +version = "1.1.1" + +[[CMakeWrapper]] +deps = ["BinDeps", "CMake", "Libdl", "Parameters", "Test"] +git-tree-sha1 = "16d4acb3d37dc05b714977ffefa8890843dc8985" +uuid = "d5fb7624-851a-54ee-a528-d3f3bac0b4a0" +version = "0.2.3" + +[[Clp]] +deps = ["BinaryProvider", "Compat", "Libdl", "LinQuadOptInterface", "MathOptInterface", "MathProgBase", "Pkg"] +git-tree-sha1 = "46f748413b4234e18319acc7ba87d5ce1fce7681" +uuid = "e2554f3b-3117-50c0-817c-e040a3ddf72d" +version = "0.6.2" + +[[Compat]] +deps = ["Base64", "Dates", "DelimitedFiles", "Distributed", "InteractiveUtils", "LibGit2", "Libdl", "LinearAlgebra", "Markdown", "Mmap", "Pkg", "Printf", "REPL", "Random", "Serialization", "SharedArrays", "Sockets", "SparseArrays", "Statistics", "Test", "UUIDs", "Unicode"] +git-tree-sha1 = "84aa74986c5b9b898b0d1acaf3258741ee64754f" +uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" +version = "2.1.0" + +[[Dates]] +deps = ["Printf"] +uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" + +[[DelimitedFiles]] +deps = ["Mmap"] +uuid = "8bb1440f-4735-579b-a4ab-409b98df4dab" + +[[Distributed]] +deps = ["Random", "Serialization", "Sockets"] +uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" + +[[HDF5]] +deps = ["BinDeps", "Blosc", "Homebrew", "Libdl", "Mmap", "WinRPM"] +git-tree-sha1 = "e6f0c154d01faef0d0831d075aa8f279f95946da" +uuid = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f" +version = "0.11.1" + +[[HTTP]] +deps = ["Base64", "Dates", "Distributed", "IniFile", "MbedTLS", "Random", "Sockets", "Test"] +git-tree-sha1 = "25db0e3f27bd5715814ca7e4ad22025fdcf5cc6e" +uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3" +version = "0.8.0" + +[[HTTPClient]] +deps = ["Compat", "LibCURL"] +git-tree-sha1 = "161d5776ae8e585ac0b8c20fb81f17ab755b3671" +uuid = "0862f596-cf2d-50af-8ef4-f2be67dfa83f" +version = "0.2.1" + +[[Homebrew]] +deps = ["BinDeps", "InteractiveUtils", "JSON", "Libdl", "Test", "Unicode"] +git-tree-sha1 = "f01fb2f34675f9839d55ba7238bab63ebd2e531e" +uuid = "d9be37ee-ecc9-5288-90f1-b9ca67657a75" +version = "0.7.1" + +[[IniFile]] +deps = ["Test"] +git-tree-sha1 = "098e4d2c533924c921f9f9847274f2ad89e018b8" +uuid = "83e8ac13-25f8-5344-8a64-a9f2b223428f" +version = "0.5.0" + +[[InteractiveUtils]] +deps = ["Markdown"] +uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" + +[[JSON]] +deps = ["Dates", "Distributed", "Mmap", "Sockets", "Test", "Unicode"] +git-tree-sha1 = "1f7a25b53ec67f5e9422f1f551ee216503f4a0fa" +uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" +version = "0.20.0" + +[[LibCURL]] +deps = ["BinaryProvider", "Libdl", "Printf", "Test"] +git-tree-sha1 = "d051c8057512ca38a273aaa514145a0b25f24d46" +uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21" +version = "0.5.0" + +[[LibExpat]] +deps = ["Compat"] +git-tree-sha1 = "fde352ec13479e2f90e57939da2440fb78c5e388" +uuid = "522f3ed2-3f36-55e3-b6df-e94fee9b0c07" +version = "0.5.0" + +[[LibGit2]] +uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" + +[[Libdl]] +uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" + +[[Libz]] +deps = ["BufferedStreams", "Random", "Test"] +git-tree-sha1 = "d405194ffc0293c3519d4f7251ce51baac9cc871" +uuid = "2ec943e9-cfe8-584d-b93d-64dcb6d567b7" +version = "1.0.0" + +[[LinQuadOptInterface]] +deps = ["Compat", "MathOptInterface"] +git-tree-sha1 = "d6692a09d0424e34c884cd819b8ed47943eefc20" +uuid = "f8899e07-120b-5979-ab1d-7b97bb9e1a48" +version = "0.6.0" + +[[LinearAlgebra]] +deps = ["Libdl"] +uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" + +[[Logging]] +uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" + +[[MAT]] +deps = ["BufferedStreams", "HDF5", "Libz", "LinearAlgebra", "SparseArrays", "Test"] +git-tree-sha1 = "e7c19d868d482cf62ba33afd2087ccc00de4f7f5" +uuid = "23992714-dd62-5051-b70f-ba57cb901cac" +version = "0.5.0" + +[[Markdown]] +deps = ["Base64"] +uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" + +[[MathOptInterface]] +deps = ["Compat", "Unicode"] +git-tree-sha1 = "5d3de69c9220610d0336ab45d3eb8b6ac7a7c807" +uuid = "b8f27783-ece8-5eb3-8dc8-9495eed66fee" +version = "0.8.4" + +[[MathProgBase]] +deps = ["Compat"] +git-tree-sha1 = "3bf2e534e635df810e5f4b4f1a8b6de9004a0d53" +uuid = "fdba3010-5040-5b88-9595-932c9decdf73" +version = "0.7.7" + +[[MbedTLS]] +deps = ["BinaryProvider", "Dates", "Distributed", "Libdl", "Random", "Sockets", "Test"] +git-tree-sha1 = "2d94286a9c2f52c63a16146bb86fd6cdfbf677c6" +uuid = "739be429-bea8-5141-9913-cc70e7f3736d" +version = "0.6.8" + +[[Mmap]] +uuid = "a63ad114-7e13-5084-954f-fe012c677804" + +[[OrderedCollections]] +deps = ["Random", "Serialization", "Test"] +git-tree-sha1 = "c4c13474d23c60d20a67b217f1d7f22a40edf8f1" +uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" +version = "1.1.0" + +[[Parameters]] +deps = ["Markdown", "OrderedCollections", "REPL", "Test"] +git-tree-sha1 = "70bdbfb2bceabb15345c0b54be4544813b3444e4" +uuid = "d96e819e-fc66-5662-9728-84c9c7592b0a" +version = "0.10.3" + +[[Pkg]] +deps = ["Dates", "LibGit2", "Markdown", "Printf", "REPL", "Random", "SHA", "UUIDs"] +uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" + +[[Printf]] +deps = ["Unicode"] +uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" + +[[REPL]] +deps = ["InteractiveUtils", "Markdown", "Sockets"] +uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" + +[[Random]] +deps = ["Serialization"] +uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" + +[[SHA]] +uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" + +[[Serialization]] +uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" + +[[SharedArrays]] +deps = ["Distributed", "Mmap", "Random", "Serialization"] +uuid = "1a1011a3-84de-559e-8e89-a11a2f7dc383" + +[[Sockets]] +uuid = "6462fe0b-24de-5631-8697-dd941f90decc" + +[[SparseArrays]] +deps = ["LinearAlgebra", "Random"] +uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" + +[[Statistics]] +deps = ["LinearAlgebra", "SparseArrays"] +uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" + +[[Test]] +deps = ["Distributed", "InteractiveUtils", "Logging", "Random"] +uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[[URIParser]] +deps = ["Test", "Unicode"] +git-tree-sha1 = "6ddf8244220dfda2f17539fa8c9de20d6c575b69" +uuid = "30578b45-9adc-5946-b283-645ec420af67" +version = "0.4.0" + +[[UUIDs]] +deps = ["Random", "SHA"] +uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" + +[[Unicode]] +uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" + +[[WinRPM]] +deps = ["BinDeps", "Compat", "HTTPClient", "LibExpat", "Libdl", "Libz", "URIParser"] +git-tree-sha1 = "2a889d320f3b77d17c037f295859fe570133cfbf" +uuid = "c17dfb99-b4f7-5aad-8812-456da1ad7187" +version = "0.4.2" diff --git a/Project.toml b/Project.toml new file mode 100644 index 0000000..5d3735c --- /dev/null +++ b/Project.toml @@ -0,0 +1,31 @@ +name = "COBRA" +uuid = "58298e0b-d05c-52ec-a210-0694647ebfc7" +version = "0.3.0" + +[deps] +Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b" +HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3" +LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" +MAT = "23992714-dd62-5051-b70f-ba57cb901cac" +MathProgBase = "fdba3010-5040-5b88-9595-932c9decdf73" +Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" +SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" + +[extras] +Clp = "e2554f3b-3117-50c0-817c-e040a3ddf72d" +CPLEX = "a076750e-1247-5638-91d2-ce28b192dca0" +GLPK = "60bf3e95-4087-53dc-ae20-288a0d20c6a6" +GLPKMathProgInterface = "3c7084bd-78ad-589a-b5bb-dbd673274bea" +Gurobi = "2e9cd046-0924-5485-92f1-d5272153d98b" +MATLAB = "10e44e05-a98a-55b3-a45b-ba969058deb6" +Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[targets] +test = ["Suppressor", "GLPKMathProgInterface", "GLPK", "Clp", "Test"] + +[compat] +julia = "1" +MathProgBase = ">= 0.7.0" +MAT = ">= 0.5.0" +HTTP = ">= 0.8.0" diff --git a/REQUIRE b/REQUIRE index bed306d..03fb2d3 100644 --- a/REQUIRE +++ b/REQUIRE @@ -1,4 +1,8 @@ -julia 0.6 0.7 -MathProgBase 0.6.1 -MAT 0.3.1 -Requests 0.4.1 +julia 1.0 +MathProgBase 0.7.0 +MAT 0.5.0 +GLPKMathProgInterface 0.2.3 +GLPK 0.3.0 +Clp 0.2.2 +HTTP 0.8.0 +Suppressor 0.1.1 diff --git a/config/sshCfg.jl b/config/sshCfg.jl index ef1942e..20a7d52 100644 --- a/config/sshCfg.jl +++ b/config/sshCfg.jl @@ -7,21 +7,22 @@ #------------------------------------------------------------------------------------------- -sshWorkers = Array{Dict{Any, Any}}(3) +sshWorkers = Array{Dict{Any, Any}}(undef, 3) -sshWorkers[1,:] = Dict( "usernode" => "first.last@server1.com", +# JL: Have a look at the codes below +sshWorkers[1] = Dict( "usernode" => "first.last@server1.com", "procs" => 8, "dir" => `"~"/COBRA.jl/`, "flags" => `-6 -p8022`, "exename"=> "/usr/bin/julia/bin/./julia") -sshWorkers[2,:] = Dict( "usernode" => "first.last@server2.com", +sshWorkers[2] = Dict( "usernode" => "first.last@server2.com", "procs" => 16, "dir" => `"~"/COBRA.jl/`, "flags" => "-p22", "exename"=> "/usr/bin/julia/bin/./julia") -sshWorkers[3,:] = Dict( "usernode" => "first.last@server3.com", +sshWorkers[3] = Dict( "usernode" => "first.last@server3.com", "procs" => 32, "dir" => `"~"/COBRA.jl/`, "flags" => "-4 -p9997", diff --git a/src/COBRA.jl b/src/COBRA.jl index 8b77e52..b603e7f 100644 --- a/src/COBRA.jl +++ b/src/COBRA.jl @@ -17,9 +17,10 @@ The documentation is here: http://opencobra.github.io/COBRA.jl module COBRA # include the load file to load a model of .mat format + using Pkg, SparseArrays, Distributed, LinearAlgebra using MAT using MathProgBase - if sizeof(Pkg.installed("MATLAB")) > 0 + if "MATLAB" in keys(Pkg.installed()) using MATLAB end @@ -30,7 +31,7 @@ module COBRA include("solve.jl") include("distributedFBA.jl") include("tools.jl") - if sizeof(Pkg.installed("MATLAB")) > 0 + if "MATLAB" in keys(Pkg.installed()) include("PALM.jl") end diff --git a/src/PALM.jl b/src/PALM.jl index e5d4770..6b63654 100644 --- a/src/PALM.jl +++ b/src/PALM.jl @@ -46,13 +46,13 @@ See also: `createPool()` and `PALM` function shareLoad(nModels::Int, nMatlab::Int = 2, printLevel::Int=1, dryRun::Bool=false) if printLevel > 0 && dryRun - info("Load sharing is determined without actively changing the number of connected workers (dryRun = true).") + @info "Load sharing is determined without actively changing the number of connected workers (dryRun = true)." end # Make sure that not more processes are launched than there are models (load ratio >= 1) if nMatlab > nModels if printLevel > 0 - warn("Number of workers ($nMatlab) exceeds the number of models ($nModels).") + @warn "Number of workers ($nMatlab) exceeds the number of models ($nModels)." end nMatlab = nModels @@ -65,7 +65,7 @@ function shareLoad(nModels::Int, nMatlab::Int = 2, printLevel::Int=1, dryRun::Bo end if printLevel > 0 - warn("Number of workers reduced to number of models for ideal load distribution.\n") + @warn "Number of workers reduced to number of models for ideal load distribution.\n" end end @@ -94,17 +94,17 @@ function shareLoad(nModels::Int, nMatlab::Int = 2, printLevel::Int=1, dryRun::Bo if quotientModels < remainderModels - 1 || remainderModels < 1 if printLevel > 0 - print_with_color(:red, "\n >> Load sharing is not fair. Consider adjusting the maximum poolsize.\n") + printstyled("\n >> Load sharing is not fair. Consider adjusting the maximum poolsize.\n", color=:red) end else if printLevel > 0 - print_with_color(:yellow, "\n >> Load sharing is almost ideal.\n") + printstyled("\n >> Load sharing is almost ideal.\n", color=:yellow) end end else if printLevel > 0 println(" >> Every worker will run ", quotientModels, " model(s).") - print_with_color(:green, " >> Load sharing is ideal.\n") + printstyled(" >> Load sharing is ideal.\n", color=:green) end end @@ -244,7 +244,7 @@ function PALM(dir, scriptName; nMatlab::Int=2, outputFile::AbstractString="PALM_ dirContent = readdir(dir) if printLevel > 0 - info("Directory with $(length(dirContent)) models read successfully.") + @info "Directory with $(length(dirContent)) models read successfully." end nWorkers, quotientModels, remainderModels = shareLoad(length(dirContent), nMatlab) @@ -295,7 +295,7 @@ function PALM(dir, scriptName; nMatlab::Int=2, outputFile::AbstractString="PALM_ @sync for (p, pid) in enumerate(workers()) if printLevel > 0 - info("Launching MATLAB session on worker $(p+1).") + @info "Launching MATLAB session on worker $(p+1)." end if useCOBRA @@ -310,7 +310,7 @@ function PALM(dir, scriptName; nMatlab::Int=2, outputFile::AbstractString="PALM_ # print an informative message if printLevel > 0 - info("> MATLAB sessions initializing") + @info "> MATLAB sessions initializing" end @sync for (p, pid) in enumerate(workers()) @@ -330,7 +330,7 @@ function PALM(dir, scriptName; nMatlab::Int=2, outputFile::AbstractString="PALM_ localnModels = quotientModels if printLevel > 0 - info("(case1): Worker $(p+1) runs $localnModels models: from $startIndex to $endIndex") + @info "(case1): Worker $(p+1) runs $localnModels models: from $startIndex to $endIndex" end else endIndex = Int((p+1) * quotientModels + remainderModels) @@ -345,7 +345,7 @@ function PALM(dir, scriptName; nMatlab::Int=2, outputFile::AbstractString="PALM_ localnModels = endIndex - startIndex + 1 if printLevel > 0 - info("(case 2): Worker $(p+1) runs $localnModels models: from $startIndex to $endIndex") + @info "(case 2): Worker $(p+1) runs $localnModels models: from $startIndex to $endIndex" end end diff --git a/src/checkSetup.jl b/src/checkSetup.jl index bbba6ea..a194e32 100644 --- a/src/checkSetup.jl +++ b/src/checkSetup.jl @@ -30,12 +30,12 @@ See also: `using`, `isdir()` function checkPackage(pkgName, printLevel::Int=1) try - eval(Expr(:using, pkgName)) + eval(:(using $pkgName)) return true catch if printLevel > 0 - print_with_color(:yellow, "Package ",string(pkgName), " is not installed. ", - "In order to use $pkgName, you must first run `Pkg.add(\"$pkgName\")`\n") + printstyled("Package ",string(pkgName), " is not installed. ", + "In order to use $pkgName, you must first run `Pkg.add(\"$pkgName\")`\n"; color=:yellow) end return false end @@ -64,7 +64,7 @@ See also: `MathProgBase`, `checkPackage()` function checkSysConfig(printLevel::Int=1) if printLevel > 0 - print_with_color(:yellow, "\n >> Checking the system's configuration ...\n\n") + printstyled("\n >> Checking the system's configuration ...\n\n"; color=:yellow) end #initialize a vector for storing the packages @@ -81,7 +81,7 @@ function checkSysConfig(printLevel::Int=1) if checkPackage(pkgName, printLevel) if printLevel > 0 - print_with_color(:green, string(pkgName), " is installed.\n") + printstyled(string(pkgName), " is installed.\n"; color=:green) end push!(packages, pkgName) end @@ -101,7 +101,7 @@ function checkSysConfig(printLevel::Int=1) # print a success message if the solver is installed catch if printLevel > 0 - print_with_color(:green, "\n >> Done. $(length(packages)) solvers are installed and ready to use.\n") + printstyled("\n >> Done. $(length(packages)) solvers are installed and ready to use.\n"; color=:green) end return packages diff --git a/src/connect.jl b/src/connect.jl index 191fb8d..2ee4769 100644 --- a/src/connect.jl +++ b/src/connect.jl @@ -8,7 +8,7 @@ #------------------------------------------------------------------------------------------- if "JENKINS" in keys(ENV) - info("JENKINS CI server detected. Workers will be added with test environment configuration.") + @info "JENKINS CI server detected. Workers will be added with test environment configuration." include("$JULIA_HOME/../share/julia/test/testenv.jl") addprocsCOBRA = addprocs_with_testenv else @@ -68,7 +68,7 @@ function createPool(localWorkers::Int, connectSSH::Bool=false, connectionFile::S include(connectionFile) if printLevel > 0 - print_with_color(:green, "Done.\n") + printstyled("Done.\n"; color=:green) end else error("Connection file (filename: `$connectionFile`) is unreadable or not accessible.") @@ -91,32 +91,32 @@ function createPool(localWorkers::Int, connectSSH::Bool=false, connectionFile::S # connect all required workers if nWorkers <= 1 if printLevel > 0 - info("Sequential version - Depending on the model size, expect long execution times.") + @info "Sequential version - Depending on the model size, expect long execution times." end else if printLevel > 0 - info("Parallel version - Connecting the $nWorkers workers ...") + @info "Parallel version - Connecting the $nWorkers workers ..." end # print a warning for already connected threads if nprocs() > nWorkers if printLevel > 0 - print_with_color(:blue, "$nWorkers workers already connected. No further workers to connect.\n") + printstyled("$nWorkers workers already connected. No further workers to connect.\n"; color=:blue) end end # add local threads if localWorkers > 0 && nworkers() < nWorkers - addprocsCOBRA(localWorkers, topology = :master_slave) + addprocsCOBRA(localWorkers, topology = :master_worker) if printLevel > 0 - print_with_color(:blue, "$(nworkers()) local workers are connected. (+1) on host: $(gethostname())\n") + printstyled("$(nworkers()) local workers are connected. (+1) on host: $(gethostname())\n"; color=:blue) end end # add remote threads if connectSSH && nworkers() < nWorkers && isfile(connectionFile) if printLevel > 0 - info("Connecting SSH nodes ...") + @info "Connecting SSH nodes ..." end # loop through the workers to be connected @@ -132,13 +132,13 @@ function createPool(localWorkers::Int, connectSSH::Bool=false, connectionFile::S # add threads when the SSH login is successful if successConnect - addprocsCOBRA([(sshWorkers[i]["usernode"], sshWorkers[i]["procs"])], topology = :master_slave, + addprocsCOBRA([(sshWorkers[i]["usernode"], sshWorkers[i]["procs"])], topology = :master_worker, tunnel = true, dir = sshWorkers[i]["dir"], sshflags = sshWorkers[i]["flags"], exeflags=`--depwarn=no`, exename = sshWorkers[i]["exename"]) # return a status update if printLevel > 0 - info("Connected ", sshWorkers[i]["procs"], " workers on ", sshWorkers[i]["usernode"]) + @info "Connected ", sshWorkers[i]["procs"], " workers on ", sshWorkers[i]["usernode"] end # increase the counter of remote workers diff --git a/src/distributedFBA.jl b/src/distributedFBA.jl index 1be2f7c..1376300 100644 --- a/src/distributedFBA.jl +++ b/src/distributedFBA.jl @@ -65,12 +65,12 @@ function preFBA!(model, solver, optPercentage::Float64=0.0, osenseStr::String="m # provide a warning when the optPercentage is higher than 90% if optPercentage > OPT_PERCENTAGE if printLevel > 0 - print_with_color(:cyan, "The value of optPercentage is higher than 90%. The solution process might take longer than expected.\n\n") + printstyled("The value of optPercentage is higher than 90%. The solution process might take longer than expected.\n\n"; color=:cyan) end end # determine constraints for the correct space (0-100% of the full space) - if countnz(model.c) > 0 + if count(!iszero, model.c) > 0 hasObjective = true # solve the original LP problem @@ -99,7 +99,7 @@ function preFBA!(model, solver, optPercentage::Float64=0.0, osenseStr::String="m # add a condition if the LP has an extra condition based on the FBA solution if hasObjective if printLevel > 0 - print_with_color(:blue, "preFBA! [osenseStr = $osenseStr]: FBAobj = $FBAobj, optPercentage = $optPercentage, objValue = optPercentage * FBAobj = $objValue, norm(fbaSol) = $(norm(fbaSol)).\n\n") + printstyled("preFBA! [osenseStr = $osenseStr]: FBAobj = $FBAobj, optPercentage = $optPercentage, objValue = optPercentage * FBAobj = $objValue, norm(fbaSol) = $(norm(fbaSol)).\n\n"; color=:blue) end # add a row in the stoichiometric matrix @@ -118,7 +118,7 @@ function preFBA!(model, solver, optPercentage::Float64=0.0, osenseStr::String="m return FBAobj, fbaSol else if printLevel > 0 - print_with_color(:blue, "No objective set (`c` is zero). objValue and fbaSol not defined. optPercentage = $optPercentage.\n\n") + printstyled("No objective set (`c` is zero). objValue and fbaSol not defined. optPercentage = $optPercentage.\n\n"; color=:blue) end return nothing end @@ -177,8 +177,8 @@ function splitRange(model, rxnsList, nWorkers::Int=1, strategy::Int=0, printLeve # output the average load per worker and the splitting strategy if printLevel > 0 - print_with_color(:blue, "Average load per worker: $pRxnsWorker reactions ($nWorkers workers).\n") - print_with_color(:blue, "Splitting strategy is $strategy.\n\n") + printstyled("Average load per worker: $pRxnsWorker reactions ($nWorkers workers).\n"; color=:blue) + printstyled("Splitting strategy is $strategy.\n\n"; color=:blue) end # define indices for each worker p @@ -342,7 +342,7 @@ See also: `distributeFBA()`, `MathProgBase.HighLevelInterface` """ -function loopFBA(m, rxnsList, nRxns::Int, rxnsOptMode=2 + zeros(Int, length(rxnsList)), iRound::Int=0, pid::Int=1, +function loopFBA(m, rxnsList, nRxns::Int, rxnsOptMode=2 .+ zeros(Int, length(rxnsList)), iRound::Int=0, pid::Int=1, resultsDir::String="$(Pkg.dir("COBRA"))/results", logFiles::Bool=false, onlyFluxes::Bool=false, printLevel::Int=1) # initialize vectors and counters @@ -523,7 +523,7 @@ See also: `preFBA!()`, `splitRange()`, `buildCobraLP()`, `loopFBA()`, or `fetch( """ function distributedFBA(model, solver; nWorkers::Int=1, optPercentage::Union{Float64, Int64}=0.0, objective::String="max", - rxnsList=1:length(model.rxns), strategy::Int=0, rxnsOptMode=2 + zeros(Int, length(model.rxns)), + rxnsList=1:length(model.rxns), strategy::Int=0, rxnsOptMode=2 .+ zeros(Int, length(model.rxns)), preFBA::Bool=false, saveChunks::Bool=false, resultsDir::String="$(Pkg.dir("COBRA"))/results", logFiles::Bool=false, onlyFluxes::Bool=false, printLevel::Int=1) @@ -539,19 +539,19 @@ function distributedFBA(model, solver; nWorkers::Int=1, optPercentage::Union{Flo optSol, fbaSol = preFBA!(model, solver, optPercentage, objective) solTime = time() - startTime if printLevel > 0 - print_with_color(:green, "Original FBA solved. Solution time: $solTime s.\n\n") + printstyled("Original FBA solved. Solution time: $solTime s.\n\n"; color=:green) end else # throw a warning message if preFBA = false and optPercentage > 0% if optPercentage > 0.0 - warn("The value of optPercentage is > 0%, but preFBA = false. Set preFBA = true in order to take optPercentage into account.\n\n") + @warn "The value of optPercentage is > 0%, but preFBA = false. Set preFBA = true in order to take optPercentage into account.\n\n" end # define the optSol and fbaSol variables optSol = NaN fbaSol = NaN * zeros(length(model.rxns)) if printLevel > 0 - print_with_color(:blue, "Original FBA. No additional constraints have been added.\n") + printstyled("Original FBA. No additional constraints have been added.\n"; color=:blue) end end @@ -570,14 +570,14 @@ function distributedFBA(model, solver; nWorkers::Int=1, optPercentage::Union{Flo if nRxns > 60000 && !saveChunks && !onlyFluxes saveChunks = true if printLevel > 0 - info("Trying to solve a model of $nRxns reactions. `saveChunks` has been set to `true`.") + @info "Trying to solve a model of $nRxns reactions. `saveChunks` has been set to `true`." end end # set saveChunks to false when only the maxFlux and minFlux arguments are requested if saveChunks && onlyFluxes saveChunks = false - warn("`saveChunks` has been set to `false`.\n") + @warn "`saveChunks` has been set to `false`.\n" end if saveChunks || logFiles @@ -585,11 +585,11 @@ function distributedFBA(model, solver; nWorkers::Int=1, optPercentage::Union{Flo if !isdir("$resultsDir") mkdir("$resultsDir") if printLevel > 0 - print_with_color(:green, "Directory `$resultsDir` created.\n") + printstyled("Directory `$resultsDir` created.\n"; color=:green) end else if printLevel > 0 - print_with_color(:cyan, "Directory `$resultsDir` already exists.\n") + printstyled("Directory `$resultsDir` already exists.\n"; color=:cyan) end end end @@ -598,7 +598,7 @@ function distributedFBA(model, solver; nWorkers::Int=1, optPercentage::Union{Flo if logFiles && !isdir("$resultsDir/logs") mkdir("$resultsDir/logs") if printLevel > 0 - print_with_color(:green, "Directory `$resultsDir/logs` created.\n") + printstyled("Directory `$resultsDir/logs` created.\n"; color=:green) end end @@ -622,7 +622,7 @@ function distributedFBA(model, solver; nWorkers::Int=1, optPercentage::Union{Flo fvamin = NaN * zeros(1, 1) fvamax = NaN * zeros(1, 1) if printLevel > 0 - info("Only the `minFlux` and `maxFlux` vectors will be calculated (solver solution status available in `statussolmin` and `statussolmax`).\n") + @info "Only the `minFlux` and `maxFlux` vectors will be calculated (solver solution status available in `statussolmin` and `statussolmax`).\n" end end @@ -634,33 +634,33 @@ function distributedFBA(model, solver; nWorkers::Int=1, optPercentage::Union{Flo if nRxnsList > nRxns rxnsList = 1:nRxns if printLevel > 0 - warn("The `rxnsList` has more reactions than in the model. `rxnsList` shorted to the maximum number of reactions.") + @warn "The `rxnsList` has more reactions than in the model. `rxnsList` shorted to the maximum number of reactions." end end if nRxns != nRxnsList if printLevel > 0 - println(" >> Only $nRxnsList ", (nRxnsList == 1) ? "reaction" : "reactions", " of $nRxns will be solved (~ $(nRxnsList * 100 / nRxns) \%).\n") + println(" >> Only $nRxnsList ", (nRxnsList == 1) ? "reaction" : "reactions", " of $nRxns will be solved (~ $(nRxnsList * 100 / nRxns) %).\n") end else if printLevel > 0 - println(" >> All $nRxns reactions of the model will be solved (100 \%).\n") + println(" >> All $nRxns reactions of the model will be solved (100 %).\n") end end # sanity checks for large models if nRxnsList > 20000 && nWorkers <= 4 if printLevel > 0 - warn("\nTrying to solve more than 20000 optimization problems on fewer than 4 workers. Memory might be limited.") - info(" >> Try running this analysis on a cluster, or use a larger parallel pool.\n") + @warn "\nTrying to solve more than 20000 optimization problems on fewer than 4 workers. Memory might be limited." + @info " >> Try running this analysis on a cluster, or use a larger parallel pool.\n" end end # sanity check for few reactions on a large pool if nRxnsList < nWorkers if printLevel > 0 - warn("\nThe parallel pool of workers is larger than the number of reactions being solved.") - info(" >> Consider reducing the size of the parallel pool to free system resources.\n") + @warn "\nThe parallel pool of workers is larger than the number of reactions being solved." + @info " >> Consider reducing the size of the parallel pool to free system resources.\n" end end @@ -670,7 +670,7 @@ function distributedFBA(model, solver; nWorkers::Int=1, optPercentage::Union{Flo rxnsKey = splitRange(model, rxnsList, nWorkers, strategy, printLevel) # prepare array for storing remote references - R = Array{Future}(nWorkers, 2) + R = Array{Future}(undef, nWorkers, 2) # distribution across workers @sync for (p, pid) in enumerate(workers()) @@ -723,7 +723,7 @@ function distributedFBA(model, solver; nWorkers::Int=1, optPercentage::Union{Flo # close the 2 file streams close(filemin) close(filemax) - print_with_color(:green, "Done.\n") + printstyled("Done.\n"; color=:green) else fvamin[:, rxnsList[rxnsKey[p]]] = fetch(R[p, 1])[2][:, :] fvamax[:, rxnsList[rxnsKey[p]]] = fetch(R[p, 2])[2][:, :] @@ -784,7 +784,7 @@ function printSolSummary(testFile::String, optSol, maxFlux, minFlux, solTime, nW # print a solution summary if printLevel > 0 println("\n-- Solution summary --\n") - print_with_color(:blue, "$testFile\n") + printstyled("$testFile\n"; color=:blue) if !isnan(optSol) println(" Original FBA obj.val ", optSol) end @@ -866,17 +866,17 @@ function saveDistributedFBA(fileName::String, vars::Array{String,1} = ["minFlux" for i = 1:length(vars) if isdefined(Main, Symbol(vars[i])) if printLevel > 0 - print("Saving $(vars[i]) (T:> $(typeof(eval(Main, Symbol(vars[i]))))) ...") + print("Saving $(vars[i]) (T:> $(typeof(Main.eval(Symbol(vars[i]))))) ...") end # write the variable to the file - write(file, "$(vars[i])", convertUnitRange( eval(Main, Symbol(vars[i])) )) + write(file, "$(vars[i])", convertUnitRange(Main.eval(Symbol(vars[i])) )) # increment the counter countSavedVars = countSavedVars + 1 if printLevel > 0 - print_with_color(:green, "Done.\n") + printstyled("Done.\n"; color=:green) end end end @@ -887,10 +887,10 @@ function saveDistributedFBA(fileName::String, vars::Array{String,1} = ["minFlux" # print a status message if countSavedVars > 0 if printLevel > 0 - print_with_color(:green, "All available variables saved to $fileName.\n") + printstyled("All available variables saved to $fileName.\n"; color=:green) end else - warn("No variables saved.") + @warn "No variables saved." end end diff --git a/src/load.jl b/src/load.jl index cb61ca5..46664d0 100644 --- a/src/load.jl +++ b/src/load.jl @@ -86,7 +86,7 @@ function loadModel(fileName::String, modelName::String="model", printLevel::Int= if size(model["C"]) > (0, 0) && size(model["d"]) > (0, 0) # model is a coupled model if printLevel > 0 - info("The model named $modelName loaded from $fileName is a coupled model.") + @info "The model named $modelName loaded from $fileName is a coupled model." end cdPresent = true S = [model["S"]; model["C"]] @@ -99,7 +99,7 @@ function loadModel(fileName::String, modelName::String="model", printLevel::Int= # load the vector d if modelFields[9] in modelKeys - d = squeeze(model[modelFields[9]], 2) + d = vec(model[modelFields[9]]) else error("The vector `$(modelFields[9])` does not exist in `$modelName`.") end @@ -108,13 +108,13 @@ function loadModel(fileName::String, modelName::String="model", printLevel::Int= # legacy structure if a matrix A is present S = model["A"] if printLevel > 0 - warn("The named $modelName loaded from $fileName is a coupled model, but has a legacy structure.") + @warn "The named $modelName loaded from $fileName is a coupled model, but has a legacy structure." end else # model is an uncoupled model S = model["S"] if printLevel > 0 - info("The model named $modelName loaded from $fileName is a uncoupled model.") + @info "The model named $modelName loaded from $fileName is a uncoupled model." end end end @@ -125,14 +125,14 @@ function loadModel(fileName::String, modelName::String="model", printLevel::Int= # load the upper bound vector ub if modelFields[1] in modelKeys - ub = squeeze(model[modelFields[1]], 2) + ub = vec(model[modelFields[1]]) else error("The vector `$(modelFields[1])` does not exist in `$modelName`.") end # load the lower bound vector lb if modelFields[2] in modelKeys - lb = squeeze(model[modelFields[2]], 2) + lb = vec(model[modelFields[2]]) else error("The vector `$(modelFields[2])` does not exist in `$modelName`.") end @@ -143,20 +143,20 @@ function loadModel(fileName::String, modelName::String="model", printLevel::Int= else osense = -1 if printLevel > 0 - info("The model objective is set to be maximized.\n") + @info "The model objective is set to be maximized.\n" end end # load the objective vector c if modelFields[4] in modelKeys && osense != 0 - c = squeeze(model[modelFields[4]], 2) + c = vec(model[modelFields[4]]) else error("The vector `$(modelFields[4])` does not exist in `$modelName`.") end # load the right hand side vector b if modelFields[5] in modelKeys - b = squeeze(model[modelFields[5]], 2) + b = vec(model[modelFields[5]]) else b = zeros(length(c)) error("The vector `$(modelFields[5])` does not exist in `$modelName`.") @@ -183,20 +183,20 @@ function loadModel(fileName::String, modelName::String="model", printLevel::Int= end else if printLevel > 0 - info("All constraints assumed equality constaints.\n") + @info "All constraints assumed equality constaints.\n" end end # load the reaction names vector if modelFields[7] in modelKeys - rxns = squeeze(model[modelFields[7]], 2) + rxns = vec(model[modelFields[7]]) else error("The vector `$(modelFields[7])` does not exist in `$modelName`.") end # load the metabolites vector if modelFields[8] in modelKeys - mets = squeeze(model[modelFields[8]], 2) + mets = vec(model[modelFields[8]]) else error("The vector `$(modelFields[8])` does not exist in `$modelName`.") end @@ -204,7 +204,7 @@ function loadModel(fileName::String, modelName::String="model", printLevel::Int= if cdPresent # load the contraints vector if modelFields[8] in modelKeys - ctrs = squeeze(model[modelFields[11]], 2) + ctrs = vec(model[modelFields[11]]) else error("The vector `$(modelFields[11])` does not exist in `$modelName`.") end diff --git a/src/tools.jl b/src/tools.jl index bd96cb1..92efd0d 100644 --- a/src/tools.jl +++ b/src/tools.jl @@ -85,7 +85,7 @@ function findRxnIDS(model, rxnsList=model.rxns) # throw an error when no reaction matched any in the model if length(rxnIDsNE) != 0 - warn("Some reaction names are not in the model; their indices in the `rxnsList` are reported in `rxnIDsNE`.\n") + @warn "Some reaction names are not in the model; their indices in the `rxnsList` are reported in `rxnIDsNE`.\n" end return rxnIDs, rxnIDsNE diff --git a/test/REQUIRE b/test/REQUIRE index 4927350..03fb2d3 100644 --- a/test/REQUIRE +++ b/test/REQUIRE @@ -1,8 +1,8 @@ -julia 0.6 -MathProgBase 0.6.1 -MAT 0.3.1 +julia 1.0 +MathProgBase 0.7.0 +MAT 0.5.0 GLPKMathProgInterface 0.2.3 GLPK 0.3.0 Clp 0.2.2 -Requests 0.4.1 +HTTP 0.8.0 Suppressor 0.1.1 diff --git a/test/getTestModel.jl b/test/getTestModel.jl index 9ab5a97..ed0c8d9 100644 --- a/test/getTestModel.jl +++ b/test/getTestModel.jl @@ -2,11 +2,11 @@ function getTestModel() if !isfile("ecoli_core_model.mat") print("Downloading the ecoli_core model ...") - ecoliModel = get("https://github.com/LCSB-BioCore/COBRA.models/raw/master/mat/ecoli_core_model.mat") - save(ecoliModel, "ecoli_core_model.mat") - print_with_color(:green, "Done.\n") + ecoliModel = HTTP.get("https://github.com/LCSB-BioCore/COBRA.models/raw/master/mat/ecoli_core_model.mat") + write("ecoli_core_model.mat", ecoliModel.body) + printstyled("Done.\n"; color=:green) else - info("The ecoli_core model already exists.\n") + @info "The ecoli_core model already exists.\n" end end diff --git a/test/p_all.jl b/test/p_all.jl index 8f77b17..6b0fd2c 100644 --- a/test/p_all.jl +++ b/test/p_all.jl @@ -7,7 +7,6 @@ #------------------------------------------------------------------------------------------- -using Base.Test if !@isdefined includeCOBRA includeCOBRA = true @@ -21,7 +20,7 @@ nWorkers = 4 # create a pool and use the COBRA module if the testfile is run in a loop if includeCOBRA - solverName = :GLPKMathProgInterface + # solverName = :GLPKMathProgInterface # JL: is it really necessary? connectSSHWorkers = false include("$(Pkg.dir("COBRA"))/src/connect.jl") @@ -31,7 +30,7 @@ if includeCOBRA end using COBRA - using Requests + using HTTP include("getTestModel.jl") end @@ -46,7 +45,7 @@ include("$(Pkg.dir("COBRA"))/config/solverCfg.jl") model = loadModel("$(Pkg.dir("COBRA"))/test/ecoli_core_model.mat", "S", "model") # test that no output is produced with printLevel = 0 -info(" > Testing silent $solverName ...") +@info " > Testing silent $solverName ..." solver = changeCobraSolver(solverName, printLevel=0) output = @capture_out minFlux, maxFlux = distributedFBA(model, solver, nWorkers=nWorkers, printLevel=0, rxnsList=1:4) if string(solverName) == "Gurobi" @@ -54,7 +53,7 @@ if string(solverName) == "Gurobi" else @test length(output) == 0 end -info(" > Done testing silent $solverName.") +@info " > Done testing silent $solverName." # change the COBRA solver solver = changeCobraSolver(solverName, solParams) @@ -302,10 +301,12 @@ if solverName != "Mosek" @test abs((model.c' * minFlux)[1] - optSol) < 1e-6 # save the variables to the current directory - saveDistributedFBA("testFile.mat") + # JL: We need to revise the saveDistributedFBA function; + # I think this function must have the result variables as an argument + # saveDistributedFBA("testFile.mat") # Temporaily inactivated # remove the file to clean up - run(`rm testFile.mat`) + # run(`rm testFile.mat`) # Temporaily inactivated # print a solution summary printSolSummary(testFile, optSol, maxFlux, minFlux, solTime, nWorkers, solverName) @@ -325,7 +326,7 @@ strategy = 0 rxnsList = 1:length(model.rxns) # select the reaction optimization mode -rxnsOptMode = 2 + zeros(Int64, length(rxnsList)) +rxnsOptMode = 2 .+ zeros(Int64, length(rxnsList)) minFlux, maxFlux, optSol, fbaSol, fvamin, fvamax, statussolmin, statussolmax = distributedFBA(model, solver, nWorkers=nWorkers, optPercentage=optPercentage, strategy=strategy, preFBA=true, saveChunks=saveChunks) @@ -336,13 +337,13 @@ printSolSummary(testFile, optSol, maxFlux, minFlux, solTime, nWorkers, solverNam try rm("$(Pkg.dir("COBRA"))/results", recursive=true, force=true) catch - info("The directory $(Pkg.dir("COBRA"))/results cannot be removed. Please check permissions.\n") + @info "The directory $(Pkg.dir("COBRA"))/results cannot be removed. Please check permissions.\n" end # create folders if they are not present if !isdir("$(Pkg.dir("COBRA"))/results") mkdir("$(Pkg.dir("COBRA"))/results") - print_with_color(:green, "Directory `results` created.\n\n") + printstyled("Directory `results` created.\n\n"; color=:green) # create a folder for storing the chunks of the fluxes of each minimization if !isdir("$(Pkg.dir("COBRA"))/results/fvamin") @@ -354,7 +355,7 @@ if !isdir("$(Pkg.dir("COBRA"))/results") mkdir("$(Pkg.dir("COBRA"))/results/fvamax") end else - print_with_color(:cyan, "Directory `results` already exists.\n\n") + printstyled("Directory `results` already exists.\n\n", color=:green) end minFlux, maxFlux, optSol, fbaSol, fvamin, fvamax, statussolmin, statussolmax = distributedFBA(model, solver, preFBA=true, saveChunks=true) @@ -379,6 +380,7 @@ minFlux, maxFlux, optSol, fbaSol, fvamin, fvamax, statussolmin, statussolmax = d @test isequal(statussolmin, ones(Int, length(rxnsList))) @test isequal(statussolmax, ones(Int, length(rxnsList))) +# JL: saveDistributedFBA temporarily inactivated saveDistributedFBA("testFile.mat", ["minFlux", "maxFlux"]) # call saveDistributedFBA with no variables @@ -391,7 +393,7 @@ run(`rm testFile.mat`) try rm("$(Pkg.dir("COBRA"))/results", recursive=true, force=true) catch - info("The directory $(Pkg.dir("COBRA"))/results cannot be removed. Please check permissions.\n") + @info "The directory $(Pkg.dir("COBRA"))/results cannot be removed. Please check permissions.\n" end # create the logs folder @@ -401,9 +403,9 @@ if isdir("$resultsDir/logs") try rm("$resultsDir/logs", recursive=true, force=true) catch - info("The directory $resultsDir/logs cannot be removed. Please check permissions.\n") + @info "The directory $resultsDir/logs cannot be removed. Please check permissions.\n" end - print_with_color(:green, "$resultsDir/logs folder created") + printstyled("$resultsDir/logs folder created", color=:green) end # call to create a log files directory @@ -416,7 +418,7 @@ minFlux, maxFlux, optSol, fbaSol, fvamin, fvamax, statussolmin, statussolmax = d try rm("$(Pkg.dir("COBRA"))/results", recursive=true, force=true) catch - info("The directory $(Pkg.dir("COBRA"))/results cannot be removed. Please check permissions.\n") + @info "The directory $(Pkg.dir("COBRA"))/results cannot be removed. Please check permissions.\n" end # call to create a log files directory (throws a warning message) @@ -435,5 +437,5 @@ minFlux, maxFlux, optSol, fbaSol, fvamin, fvamax, statussolmin, statussolmax = d try rm("$(Pkg.dir("COBRA"))/results", recursive=true, force=true) catch - info("The directory $(Pkg.dir("COBRA"))/results cannot be removed. Please check permissions.\n") -end \ No newline at end of file + @info "The directory $(Pkg.dir("COBRA"))/results cannot be removed. Please check permissions.\n" +end diff --git a/test/p_distinct.jl b/test/p_distinct.jl index 8acc492..8321574 100644 --- a/test/p_distinct.jl +++ b/test/p_distinct.jl @@ -7,7 +7,6 @@ #------------------------------------------------------------------------------------------- -using Base.Test if !@isdefined includeCOBRA includeCOBRA = true @@ -21,7 +20,6 @@ nWorkers = 4 # create a pool and use the COBRA module if the testfile is run in a loop if includeCOBRA - solverName = :GLPKMathProgInterface connectSSHWorkers = false include("$(Pkg.dir("COBRA"))/src/connect.jl") @@ -31,7 +29,7 @@ if includeCOBRA end using COBRA - using Requests + using HTTP include("getTestModel.jl") end @@ -52,13 +50,13 @@ model = loadModel("$(Pkg.dir("COBRA"))/test/ecoli_core_model.mat", "S", "model") optPercentage = 90.0 # run all the reactions as a reference -minFlux1, maxFlux1, optSol1, fbaSol1, fvamin1, fvamax1, statussolmin1, statussolmax1 = distributedFBA(model, solver, nWorkers=nWorkers, optPercentage=optPercentage, preFBA=true) +minFlux1, maxFlux1, optSol1, fbaSol1, fvamin1, fvamax1, statussolmin1, statussolmax1 = distributedFBA(model, solver; nWorkers=nWorkers, optPercentage=optPercentage, preFBA=true) rxnsList = [1; 2; 3; 4; 12; 28] rxnsOptMode = [0; 1; 2; 0; 1; 2] # min: 1, 3, 4, 28; max: 2, 3, 12, 28 # run only a few reactions with rxnsOptMode and rxnsList -minFlux, maxFlux, optSol, fbaSol, fvamin, fvamax, statussolmin, statussolmax = distributedFBA(model, solver, nWorkers=nWorkers, preFBA=true, optPercentage=optPercentage, rxnsList=rxnsList, rxnsOptMode=rxnsOptMode) +minFlux, maxFlux, optSol, fbaSol, fvamin, fvamax, statussolmin, statussolmax = distributedFBA(model, solver; nWorkers=nWorkers, preFBA=true, optPercentage=optPercentage, rxnsList=rxnsList, rxnsOptMode=rxnsOptMode) # test the solution status @test isequal(statussolmin[rxnsList], [1, NaN, 1, 1, NaN, 1]) @@ -82,7 +80,7 @@ end # run only the reactions of the rxnsList (both maximizations and minimizations) startTime = time() -minFlux, maxFlux, optSol, fbaSol, fvamin, fvamax, statussolmin, statussolmax = distributedFBA(model, solver, nWorkers=nWorkers, preFBA=true, optPercentage=optPercentage, rxnsList=rxnsList) +minFlux, maxFlux, optSol, fbaSol, fvamin, fvamax, statussolmin, statussolmax = distributedFBA(model, solver; nWorkers=nWorkers, preFBA=true, optPercentage=optPercentage, rxnsList=rxnsList) solTime = time() - startTime @test norm(minFlux1[rxnsList] - minFlux[rxnsList]) < 1e-9 diff --git a/test/p_range.jl b/test/p_range.jl index 6cff052..c1f7a6b 100644 --- a/test/p_range.jl +++ b/test/p_range.jl @@ -7,7 +7,6 @@ #------------------------------------------------------------------------------------------- -using Base.Test if !@isdefined includeCOBRA includeCOBRA = true @@ -21,7 +20,6 @@ nWorkers = 4 # create a pool and use the COBRA module if the testfile is run in a loop if includeCOBRA - solverName = :GLPKMathProgInterface connectSSHWorkers = false include("$(Pkg.dir("COBRA"))/src/connect.jl") @@ -31,7 +29,7 @@ if includeCOBRA end using COBRA - using Requests + using HTTP include("getTestModel.jl") end @@ -52,14 +50,14 @@ model = loadModel("$(Pkg.dir("COBRA"))/test/ecoli_core_model.mat", "S", "model") rxnsList = 1:30 # select the reaction optimization mode -rxnsOptMode = 2 + zeros(Int64, length(rxnsList)) +rxnsOptMode = 2 .+ zeros(Int64, length(rxnsList)) # define an optPercentage value optPercentage = 90.0 # launch the distributedFBA process startTime = time() -minFlux, maxFlux, optSol, fbaSol, fvamin, fvamax = distributedFBA(model, solver, nWorkers=nWorkers, optPercentage=optPercentage, preFBA=true, rxnsList=rxnsList) +minFlux, maxFlux, optSol, fbaSol, fvamin, fvamax = distributedFBA(model, solver; nWorkers=nWorkers, optPercentage=optPercentage, preFBA=true, rxnsList=rxnsList) solTime = time() - startTime # Test numerical values - test on floor as different numerical precision with different solvers diff --git a/test/runtests.jl b/test/runtests.jl index 3cf8d21..e174669 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -7,6 +7,8 @@ #------------------------------------------------------------------------------------------- +using Pkg, Distributed, LinearAlgebra # for Julia ver >= 1.0 + # retrieve all packages that are installed on the system include("$(Pkg.dir("COBRA"))/src/checkSetup.jl") packages = checkSysConfig() @@ -25,8 +27,8 @@ end # use the module COBRA and Base.Test modules on all workers using COBRA -using Base.Test -using Requests +using Test +using HTTP using Suppressor # download the ecoli_core_model @@ -34,8 +36,8 @@ include("getTestModel.jl") getTestModel() # check if MATLAB package is present -if sizeof(Pkg.installed("MATLAB")) > 0 - info("The MATLAB package is present. The tests for PALM.jl will be run.") +if "MATLAB" in keys(Pkg.installed()) + @info "The MATLAB package is present. The tests for PALM.jl will be run." using MAT using MATLAB @@ -94,7 +96,7 @@ if sizeof(Pkg.installed("MATLAB")) > 0 # remove the directory with the test models rm(joinpath(TESTDIR, "testModels"), force=true, recursive=true) else - warn("The MATLAB package is not present. The tests for PALM.jl will not be run.") + @warn "The MATLAB package is not present. The tests for PALM.jl will not be run." end @@ -106,30 +108,30 @@ for i = 1:length(supportedSolvers) print(" > Testing $(supportedSolvers[i]) ... ") if !(supportedSolvers[i] in packages) @test_throws ErrorException changeCobraSolver(string(supportedSolvers[i])) - print_with_color(:red, "Not supported.\n") + printstyled("Not supported.\n"; color=:red) else @test typeof(changeCobraSolver(supportedSolvers[i])) == COBRA.SolverConfig - print_with_color(:green, "Done.\n") + printstyled("Done.\n"; color=:green) end end includeCOBRA = false -for s = 1:length(packages) +for s in packages # define a solvername - solverName = string(packages[s]) + global solverName = string(s) # read out the directory with the test files testDir = readdir(TESTDIR) # print the solver name - print_with_color(:green, "\n\n -- Running $(length(testDir) - 2) tests using the $solverName solver. -- \n\n") + printstyled("\n\n -- Running $(length(testDir) - 2) tests using the $solverName solver. -- \n\n"; color=:green) # evaluate the test file for t = 1:length(testDir) # run only parallel and serial test files - if testDir[t][1:2] == "p_" || testDir[t][1:2] == "s_" || testDir[t][1:2] == "z_" - print_with_color(:green, "\nRunning $(testDir[t]) ...\n\n") + if testDir[t][1:2] in ["p_", "s_", "z_"] + printstyled("\nRunning $(testDir[t]) ...\n\n"; color=:green) include(testDir[t]) end end @@ -146,6 +148,6 @@ if isdir(tmpDir) end # print a status line -print_with_color(:green, "\n -- All tests passed. -- \n\n") +printstyled("\n -- All tests passed. -- \n\n"; color=:green) #------------------------------------------------------------------------------------------- diff --git a/test/s_all.jl b/test/s_all.jl index 46fbabc..9530f11 100644 --- a/test/s_all.jl +++ b/test/s_all.jl @@ -7,7 +7,6 @@ #------------------------------------------------------------------------------------------- -using Base.Test if !@isdefined includeCOBRA includeCOBRA = true @@ -21,7 +20,6 @@ nWorkers = 1 # create a pool and use the COBRA module if the testfile is run in a loop if includeCOBRA - solverName = :GLPKMathProgInterface connectSSHWorkers = false include("$(Pkg.dir("COBRA"))/src/connect.jl") @@ -31,7 +29,7 @@ if includeCOBRA end using COBRA - using Requests + using HTTP include("getTestModel.jl") end @@ -250,7 +248,7 @@ optPercentage = 90.0 # launch the distributedFBA process startTime = time() -minFlux, maxFlux, optSol, fbaSol, fvamin, fvamax, statussolmin, statussolmax = distributedFBA(model, solver, nWorkers=nWorkers, optPercentage=optPercentage, preFBA=true) +minFlux, maxFlux, optSol, fbaSol, fvamin, fvamax, statussolmin, statussolmax = distributedFBA(model, solver; nWorkers=nWorkers, optPercentage=optPercentage, preFBA=true) solTime = time() - startTime # Test numerical values - test on floor as different numerical precision with different solvers diff --git a/test/s_core.jl b/test/s_core.jl index 48d9227..52f1fb0 100644 --- a/test/s_core.jl +++ b/test/s_core.jl @@ -7,7 +7,6 @@ #------------------------------------------------------------------------------------------- -using Base.Test if !@isdefined includeCOBRA includeCOBRA = true @@ -21,7 +20,6 @@ nWorkers = 1 # create a pool and use the COBRA module if the testfile is run in a loop if includeCOBRA - solverName = :GLPKMathProgInterface connectSSHWorkers = false include("$(Pkg.dir("COBRA"))/src/connect.jl") @@ -31,7 +29,7 @@ if includeCOBRA end using COBRA - using Requests + using HTTP include("getTestModel.jl") end @@ -72,7 +70,7 @@ optPercentage = 90.0 # launch the distributedFBA process startTime = time() -minFlux, maxFlux, optSol = distributedFBA(model, solver, nWorkers=nWorkers, optPercentage=optPercentage, preFBA=true) +minFlux, maxFlux, optSol = distributedFBA(model, solver; nWorkers=nWorkers, optPercentage=optPercentage, preFBA=true) solTime = time() - startTime # Test numerical values - test on floor as different numerical precision with different solvers diff --git a/test/s_distinct.jl b/test/s_distinct.jl index aaab519..f937f53 100644 --- a/test/s_distinct.jl +++ b/test/s_distinct.jl @@ -7,7 +7,6 @@ #------------------------------------------------------------------------------------------- -using Base.Test if !@isdefined includeCOBRA includeCOBRA = true @@ -21,7 +20,6 @@ nWorkers = 1 # create a pool and use the COBRA module if the testfile is run in a loop if includeCOBRA - solverName = :GLPKMathProgInterface connectSSHWorkers = false include("$(Pkg.dir("COBRA"))/src/connect.jl") @@ -31,7 +29,7 @@ if includeCOBRA end using COBRA - using Requests + using HTTP include("getTestModel.jl") end @@ -52,13 +50,13 @@ model = loadModel("$(Pkg.dir("COBRA"))/test/ecoli_core_model.mat", "S", "model") optPercentage = 90.0 # run all the reactions as a reference -minFlux1, maxFlux1, optSol1, fbaSol1, fvamin1, fvamax1, statussolmin1, statussolmax1 = distributedFBA(model, solver, nWorkers=nWorkers, optPercentage=optPercentage, preFBA=true) +minFlux1, maxFlux1, optSol1, fbaSol1, fvamin1, fvamax1, statussolmin1, statussolmax1 = distributedFBA(model, solver; nWorkers=nWorkers, optPercentage=optPercentage, preFBA=true) rxnsList = [1; 18; 10; 20:30; 90; 93; 95] -rxnsOptMode = [0; 1; 2; 2 + zeros(Int, length(20:30)); 2; 1; 0] +rxnsOptMode = [0; 1; 2; 2 .+ zeros(Int, length(20:30)); 2; 1; 0] # run only a few reactions with rxnsOptMode and rxnsList -minFlux, maxFlux, optSol, fbaSol, fvamin, fvamax, statussolmin, statussolmax = distributedFBA(model, solver, nWorkers=nWorkers, optPercentage=optPercentage, rxnsList=rxnsList, rxnsOptMode=rxnsOptMode, preFBA=true) +minFlux, maxFlux, optSol, fbaSol, fvamin, fvamax, statussolmin, statussolmax = distributedFBA(model, solver; nWorkers=nWorkers, optPercentage=optPercentage, rxnsList=rxnsList, rxnsOptMode=rxnsOptMode, preFBA=true) # test the solution status @test isequal(statussolmin[rxnsList], [1; NaN; 1; ones(Int, length(20:30)); 1; NaN; 1]) @@ -83,7 +81,7 @@ end # run only the reactions of the rxnsList (both maximizations and minimizations) startTime = time() -minFlux, maxFlux, optSol, fbaSol, fvamin, fvamax, statussolmin, statussolmax = distributedFBA(model, solver, nWorkers=nWorkers, optPercentage=optPercentage, rxnsList=rxnsList, preFBA=true) +minFlux, maxFlux, optSol, fbaSol, fvamin, fvamax, statussolmin, statussolmax = distributedFBA(model, solver; nWorkers=nWorkers, optPercentage=optPercentage, rxnsList=rxnsList, preFBA=true) solTime = time() - startTime @test norm(minFlux1[rxnsList] - minFlux[rxnsList]) < 1e-9 diff --git a/test/s_fba.jl b/test/s_fba.jl index 3f6450a..2767904 100644 --- a/test/s_fba.jl +++ b/test/s_fba.jl @@ -7,7 +7,6 @@ #------------------------------------------------------------------------------------------- -using Base.Test if !@isdefined includeCOBRA includeCOBRA = true @@ -21,7 +20,6 @@ nWorkers = 1 # create a pool and use the COBRA module if the testfile is run in a loop if includeCOBRA - solverName = :GLPKMathProgInterface connectSSHWorkers = false include("$(Pkg.dir("COBRA"))/src/connect.jl") @@ -31,7 +29,7 @@ if includeCOBRA end using COBRA - using Requests + using HTTP include("getTestModel.jl") end @@ -60,7 +58,7 @@ optPercentage = 10.0 for s = 0:2 # launch the distributedFBA process startTime = time() - minFlux, maxFlux, optSol, fbaSol, fvamin, fvamax, statussolmin, statussolmax = distributedFBA(model, solver, nWorkers=nWorkers, optPercentage=optPercentage, objective="min", rxnsList=rxnsList, strategy=s, rxnsOptMode=rxnsOptMode, preFBA=false) + minFlux, maxFlux, optSol, fbaSol, fvamin, fvamax, statussolmin, statussolmax = distributedFBA(model, solver; nWorkers=nWorkers, optPercentage=optPercentage, objective="min", rxnsList=rxnsList, strategy=s, rxnsOptMode=rxnsOptMode, preFBA=false) solTime = time() - startTime # Test numerical values - test on ceil as different numerical precision with different solvers @@ -84,7 +82,7 @@ model = modelOrig # launch the distributedFBA process with only 1 reaction startTime = time() -minFlux, maxFlux, optSol = distributedFBA(model, solver, nWorkers=nWorkers, objective="", rxnsList=rxnsList, rxnsOptMode=rxnsOptMode, preFBA=false); +minFlux, maxFlux, optSol = distributedFBA(model, solver; nWorkers=nWorkers, objective="", rxnsList=rxnsList, rxnsOptMode=rxnsOptMode, preFBA=false); solTime = time() - startTime fbaSolution = solveCobraLP(model, solver) # in the model, objective is assumed to be maximized diff --git a/test/s_tools.jl b/test/s_tools.jl index 2feb2dd..5bc1a52 100644 --- a/test/s_tools.jl +++ b/test/s_tools.jl @@ -7,7 +7,6 @@ #------------------------------------------------------------------------------------------- -using Base.Test if !@isdefined includeCOBRA includeCOBRA = true @@ -21,7 +20,6 @@ nWorkers = 1 # create a pool and use the COBRA module if the testfile is run in a loop if includeCOBRA - solverName = :GLPKMathProgInterface connectSSHWorkers = false include("$(Pkg.dir("COBRA"))/src/connect.jl") diff --git a/test/z_all.jl b/test/z_all.jl index c0e8c39..d953106 100644 --- a/test/z_all.jl +++ b/test/z_all.jl @@ -7,7 +7,6 @@ #------------------------------------------------------------------------------------------- -using Base.Test if !@isdefined includeCOBRA includeCOBRA = true @@ -21,7 +20,6 @@ nWorkers = 1 # create a pool and use the COBRA module if the testfile is run in a loop if includeCOBRA - solverName = :GLPKMathProgInterface connectSSHWorkers = false include("$(Pkg.dir("COBRA"))/src/connect.jl") @@ -31,7 +29,7 @@ if includeCOBRA end using COBRA - using Requests + using HTTP include("getTestModel.jl") end @@ -49,7 +47,7 @@ solver = changeCobraSolver(solverName, solParams) @test_throws ErrorException changeCobraSolver("mySolver") # test some functions that are known to throw errors -print_with_color(:yellow, "\n>> The following tests throw warning messages for testing purposes. <<\n\n") +printstyled("\n>> The following tests throw warning messages for testing purposes. <<\n\n"; color=:yellow) # test if an error is thrown when myModel.mat does not exist @test_throws ErrorException loadModel("myModel.mat") @@ -78,7 +76,7 @@ model = loadModel("$(Pkg.dir("COBRA"))/test/ecoli_core_model.mat") # run a model with more reactions on the reaction list than in the model rxnsList = 1:length(model.rxns) + 1 -minFlux, maxFlux, optSol, fbaSol, fvamin, fvamax, statussolmin, statussolmax = distributedFBA(model, solver, nWorkers=1, optPercentage=90.0, objective="min", rxnsList=rxnsList) +minFlux, maxFlux, optSol, fbaSol, fvamin, fvamax, statussolmin, statussolmax = distributedFBA(model, solver; nWorkers=1, optPercentage=90.0, objective="min", rxnsList=rxnsList) # test preFBA! with min optSol, fbaSol = preFBA!(model, solver, 90.0, "min") @@ -127,4 +125,4 @@ elseif solver.name == "CPLEX" @test isequal(retStat, [4, NaN]) # unbounded and not solved end -print_with_color(:yellow, "\n >> Note: Warnings above are thrown for testing purposes and can be safely ignored.\n") +printstyled("\n >> Note: Warnings above are thrown for testing purposes and can be safely ignored.\n"; color=:yellow) From 8078910f5e09a90603f7fda68941f59ca33cbb6d Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Thu, 29 Aug 2019 17:30:56 +0200 Subject: [PATCH 02/52] add support for julia 1.2 on artenolis --- .artenolis.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.artenolis.yml b/.artenolis.yml index 1276500..3da9168 100644 --- a/.artenolis.yml +++ b/.artenolis.yml @@ -22,21 +22,27 @@ script: # launch the tests - bash .artenolis/runtests.sh - # clean up the build directory - - cd .. && rm -rf COBRA - # clean up the tmp folder - rm -rf ~/tmp after_success: - - if [ "$ARCH" == "Linux" ]; then $ARTENOLIS_SOFT_PATH/julia/$JULIA_VER/bin/julia --color=yes -e 'cd(Pkg.dir("COBRA")); using Coverage; tmp=process_folder(); Codecov.submit(tmp, verbose=false); Coveralls.submit(tmp);'; fi + + # submit coverage report + - if [ "$ARCH" == "Linux" && "$JULIA_VER" = "v1.2.0" ]; then + $ARTENOLIS_SOFT_PATH/julia/$JULIA_VER/bin/julia --color=yes -e 'using Coverage; Codecov.submit(process_folder())'; + fi # set environment variables for documentation deployment - if [[ "$ARCH" == "Linux" && "$JENKINS_PULL_REQUEST" != "True" ]]; then export TRAVIS_BRANCH=$GIT_BRANCH; export TRAVIS_PULL_REQUEST=false; var=$GIT_URL; export TRAVIS_REPO_SLUG=${var:7:${#var}}; - export TRAVIS_OS_NAME="linux"; + export TRAVIS_OS_NAME=$label; export TRAVIS_JULIA_VERSION=$JULIA_VER; - $ARTENOLIS_SOFT_PATH/julia/$JULIA_VER/bin/julia --color=yes -e 'cd(Pkg.dir("COBRA")); include(joinpath("docs", "makeDoc.jl"))'; + $ARTENOLIS_SOFT_PATH/julia/$JULIA_VER/bin/julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'; + $ARTENOLIS_SOFT_PATH/julia/$JULIA_VER/bin/julia --project=docs/ docs/make.jl; fi + +after_script: + # clean up the build directory + - cd .. && rm -rf COBRA \ No newline at end of file From 9d868e891151e9d0b67f7eeff988cf2f6f161eb9 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Thu, 29 Aug 2019 17:31:06 +0200 Subject: [PATCH 03/52] add support for julia 1.0 on travis --- .travis.yml | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/.travis.yml b/.travis.yml index eae055c..8604576 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,13 +4,11 @@ os: - linux julia: - - 0.6 - - 0.7 + - 1.0 - nightly matrix: allow_failures: - - julia: 0.7 - julia: nightly notifications: @@ -25,18 +23,3 @@ addons: - libgmp-dev - libglpk-dev -git: - depth: 99999 - -before_install: - - if [[ -a .git/shallow ]]; then git fetch --unshallow; fi - -script: - # update all packages - - julia --color=yes -e 'Pkg.update();' - - # temporary addition for julia 0.6 until new version of MAT tagged - - julia --color=yes -e 'Pkg.add("MAT"); Pkg.checkout("MAT")' - - # add and test the COBRA module - - julia --color=yes -e 'Pkg.clone(pwd()); Pkg.test("COBRA")' \ No newline at end of file From 162bde86b104661c5948b1de636363a44951c456 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Fri, 30 Aug 2019 10:09:44 +0200 Subject: [PATCH 04/52] remove trigger --- trigger | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 trigger diff --git a/trigger b/trigger deleted file mode 100644 index e69de29..0000000 From 72a67e0cdbe51f8d6e3abbf597c8e9c4debd4c6f Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 2 Sep 2019 16:44:45 +0200 Subject: [PATCH 05/52] add manifest.toml to gitignore --- .gitignore | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 95d41b6..732e04e 100644 --- a/.gitignore +++ b/.gitignore @@ -17,5 +17,5 @@ docs/build/ docs/tutorial/results.mat results/* test/testModels - -docs/src/tutorials.md \ No newline at end of file +Manifest.toml +docs/src/tutorials.md From 095bba7f43c1c5934877a7be7f75cee178de36e9 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 2 Sep 2019 16:44:54 +0200 Subject: [PATCH 06/52] remove manifest.toml file --- Manifest.toml | 244 -------------------------------------------------- 1 file changed, 244 deletions(-) delete mode 100644 Manifest.toml diff --git a/Manifest.toml b/Manifest.toml deleted file mode 100644 index c6e37fd..0000000 --- a/Manifest.toml +++ /dev/null @@ -1,244 +0,0 @@ -# This file is machine-generated - editing it directly is not advised - -[[Base64]] -uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" - -[[BinDeps]] -deps = ["Compat", "Libdl", "SHA", "URIParser"] -git-tree-sha1 = "12093ca6cdd0ee547c39b1870e0c9c3f154d9ca9" -uuid = "9e28174c-4ba2-5203-b857-d8d62c4213ee" -version = "0.8.10" - -[[BinaryProvider]] -deps = ["Libdl", "SHA"] -git-tree-sha1 = "c7361ce8a2129f20b0e05a89f7070820cfed6648" -uuid = "b99e7846-7c00-51b0-8f62-c81ae34c0232" -version = "0.5.4" - -[[Blosc]] -deps = ["BinaryProvider", "CMakeWrapper", "Compat", "Libdl"] -git-tree-sha1 = "71fb23581e1f0b0ae7be8ccf0ebfb3600e23ca41" -uuid = "a74b3585-a348-5f62-a45c-50e91977d574" -version = "0.5.1" - -[[BufferedStreams]] -deps = ["Compat", "Test"] -git-tree-sha1 = "5d55b9486590fdda5905c275bb21ce1f0754020f" -uuid = "e1450e63-4bb3-523b-b2a4-4ffa8c0fd77d" -version = "1.0.0" - -[[CMake]] -deps = ["BinDeps", "Libdl", "Test"] -git-tree-sha1 = "6e39bef3cbb8321e8a464b18a5c20d7cef813938" -uuid = "631607c0-34d2-5d66-819e-eb0f9aa2061a" -version = "1.1.1" - -[[CMakeWrapper]] -deps = ["BinDeps", "CMake", "Libdl", "Parameters", "Test"] -git-tree-sha1 = "16d4acb3d37dc05b714977ffefa8890843dc8985" -uuid = "d5fb7624-851a-54ee-a528-d3f3bac0b4a0" -version = "0.2.3" - -[[Clp]] -deps = ["BinaryProvider", "Compat", "Libdl", "LinQuadOptInterface", "MathOptInterface", "MathProgBase", "Pkg"] -git-tree-sha1 = "46f748413b4234e18319acc7ba87d5ce1fce7681" -uuid = "e2554f3b-3117-50c0-817c-e040a3ddf72d" -version = "0.6.2" - -[[Compat]] -deps = ["Base64", "Dates", "DelimitedFiles", "Distributed", "InteractiveUtils", "LibGit2", "Libdl", "LinearAlgebra", "Markdown", "Mmap", "Pkg", "Printf", "REPL", "Random", "Serialization", "SharedArrays", "Sockets", "SparseArrays", "Statistics", "Test", "UUIDs", "Unicode"] -git-tree-sha1 = "84aa74986c5b9b898b0d1acaf3258741ee64754f" -uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" -version = "2.1.0" - -[[Dates]] -deps = ["Printf"] -uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" - -[[DelimitedFiles]] -deps = ["Mmap"] -uuid = "8bb1440f-4735-579b-a4ab-409b98df4dab" - -[[Distributed]] -deps = ["Random", "Serialization", "Sockets"] -uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" - -[[HDF5]] -deps = ["BinDeps", "Blosc", "Homebrew", "Libdl", "Mmap", "WinRPM"] -git-tree-sha1 = "e6f0c154d01faef0d0831d075aa8f279f95946da" -uuid = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f" -version = "0.11.1" - -[[HTTP]] -deps = ["Base64", "Dates", "Distributed", "IniFile", "MbedTLS", "Random", "Sockets", "Test"] -git-tree-sha1 = "25db0e3f27bd5715814ca7e4ad22025fdcf5cc6e" -uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3" -version = "0.8.0" - -[[HTTPClient]] -deps = ["Compat", "LibCURL"] -git-tree-sha1 = "161d5776ae8e585ac0b8c20fb81f17ab755b3671" -uuid = "0862f596-cf2d-50af-8ef4-f2be67dfa83f" -version = "0.2.1" - -[[Homebrew]] -deps = ["BinDeps", "InteractiveUtils", "JSON", "Libdl", "Test", "Unicode"] -git-tree-sha1 = "f01fb2f34675f9839d55ba7238bab63ebd2e531e" -uuid = "d9be37ee-ecc9-5288-90f1-b9ca67657a75" -version = "0.7.1" - -[[IniFile]] -deps = ["Test"] -git-tree-sha1 = "098e4d2c533924c921f9f9847274f2ad89e018b8" -uuid = "83e8ac13-25f8-5344-8a64-a9f2b223428f" -version = "0.5.0" - -[[InteractiveUtils]] -deps = ["Markdown"] -uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" - -[[JSON]] -deps = ["Dates", "Distributed", "Mmap", "Sockets", "Test", "Unicode"] -git-tree-sha1 = "1f7a25b53ec67f5e9422f1f551ee216503f4a0fa" -uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" -version = "0.20.0" - -[[LibCURL]] -deps = ["BinaryProvider", "Libdl", "Printf", "Test"] -git-tree-sha1 = "d051c8057512ca38a273aaa514145a0b25f24d46" -uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21" -version = "0.5.0" - -[[LibExpat]] -deps = ["Compat"] -git-tree-sha1 = "fde352ec13479e2f90e57939da2440fb78c5e388" -uuid = "522f3ed2-3f36-55e3-b6df-e94fee9b0c07" -version = "0.5.0" - -[[LibGit2]] -uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" - -[[Libdl]] -uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" - -[[Libz]] -deps = ["BufferedStreams", "Random", "Test"] -git-tree-sha1 = "d405194ffc0293c3519d4f7251ce51baac9cc871" -uuid = "2ec943e9-cfe8-584d-b93d-64dcb6d567b7" -version = "1.0.0" - -[[LinQuadOptInterface]] -deps = ["Compat", "MathOptInterface"] -git-tree-sha1 = "d6692a09d0424e34c884cd819b8ed47943eefc20" -uuid = "f8899e07-120b-5979-ab1d-7b97bb9e1a48" -version = "0.6.0" - -[[LinearAlgebra]] -deps = ["Libdl"] -uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" - -[[Logging]] -uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" - -[[MAT]] -deps = ["BufferedStreams", "HDF5", "Libz", "LinearAlgebra", "SparseArrays", "Test"] -git-tree-sha1 = "e7c19d868d482cf62ba33afd2087ccc00de4f7f5" -uuid = "23992714-dd62-5051-b70f-ba57cb901cac" -version = "0.5.0" - -[[Markdown]] -deps = ["Base64"] -uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" - -[[MathOptInterface]] -deps = ["Compat", "Unicode"] -git-tree-sha1 = "5d3de69c9220610d0336ab45d3eb8b6ac7a7c807" -uuid = "b8f27783-ece8-5eb3-8dc8-9495eed66fee" -version = "0.8.4" - -[[MathProgBase]] -deps = ["Compat"] -git-tree-sha1 = "3bf2e534e635df810e5f4b4f1a8b6de9004a0d53" -uuid = "fdba3010-5040-5b88-9595-932c9decdf73" -version = "0.7.7" - -[[MbedTLS]] -deps = ["BinaryProvider", "Dates", "Distributed", "Libdl", "Random", "Sockets", "Test"] -git-tree-sha1 = "2d94286a9c2f52c63a16146bb86fd6cdfbf677c6" -uuid = "739be429-bea8-5141-9913-cc70e7f3736d" -version = "0.6.8" - -[[Mmap]] -uuid = "a63ad114-7e13-5084-954f-fe012c677804" - -[[OrderedCollections]] -deps = ["Random", "Serialization", "Test"] -git-tree-sha1 = "c4c13474d23c60d20a67b217f1d7f22a40edf8f1" -uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" -version = "1.1.0" - -[[Parameters]] -deps = ["Markdown", "OrderedCollections", "REPL", "Test"] -git-tree-sha1 = "70bdbfb2bceabb15345c0b54be4544813b3444e4" -uuid = "d96e819e-fc66-5662-9728-84c9c7592b0a" -version = "0.10.3" - -[[Pkg]] -deps = ["Dates", "LibGit2", "Markdown", "Printf", "REPL", "Random", "SHA", "UUIDs"] -uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" - -[[Printf]] -deps = ["Unicode"] -uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" - -[[REPL]] -deps = ["InteractiveUtils", "Markdown", "Sockets"] -uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" - -[[Random]] -deps = ["Serialization"] -uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" - -[[SHA]] -uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" - -[[Serialization]] -uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" - -[[SharedArrays]] -deps = ["Distributed", "Mmap", "Random", "Serialization"] -uuid = "1a1011a3-84de-559e-8e89-a11a2f7dc383" - -[[Sockets]] -uuid = "6462fe0b-24de-5631-8697-dd941f90decc" - -[[SparseArrays]] -deps = ["LinearAlgebra", "Random"] -uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" - -[[Statistics]] -deps = ["LinearAlgebra", "SparseArrays"] -uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" - -[[Test]] -deps = ["Distributed", "InteractiveUtils", "Logging", "Random"] -uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" - -[[URIParser]] -deps = ["Test", "Unicode"] -git-tree-sha1 = "6ddf8244220dfda2f17539fa8c9de20d6c575b69" -uuid = "30578b45-9adc-5946-b283-645ec420af67" -version = "0.4.0" - -[[UUIDs]] -deps = ["Random", "SHA"] -uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" - -[[Unicode]] -uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" - -[[WinRPM]] -deps = ["BinDeps", "Compat", "HTTPClient", "LibExpat", "Libdl", "Libz", "URIParser"] -git-tree-sha1 = "2a889d320f3b77d17c037f295859fe570133cfbf" -uuid = "c17dfb99-b4f7-5aad-8812-456da1ad7187" -version = "0.4.2" From 5969d6f665ebe12d49cd6b597a040a1fcef3261f Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Tue, 3 Sep 2019 13:43:04 +0200 Subject: [PATCH 07/52] change if conditions on macOS and Linux --- .artenolis/runtests.sh | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/.artenolis/runtests.sh b/.artenolis/runtests.sh index aae9107..9c55d59 100644 --- a/.artenolis/runtests.sh +++ b/.artenolis/runtests.sh @@ -5,24 +5,11 @@ echo "MATLAB_VER = $MATLAB_VER" # launch the test script if [ "$ARCH" == "Linux" ]; then - if [ "$JULIA_VER" == "v0.6.4" ]; then - # remove th julia directory to clean the installation directory - rm -rf $JULIA_PKGDIR/v0.6/COBRA - - # add the COBRA module - $ARTENOLIS_SOFT_PATH/julia/$JULIA_VER/bin/julia --color=yes -e 'Pkg.clone(pwd()); cd(Pkg.dir("COBRA")); Pkg.test(pwd(), coverage=true);' - - elif [ "$JULIA_VER" == "v0.7.0" ]; then - # add the COBRA module - $ARTENOLIS_SOFT_PATH/julia/$JULIA_VER/bin/julia --color=yes -e 'using Pkg; Pkg.clone(pwd())' - fi + $ARTENOLIS_SOFT_PATH/julia/$JULIA_VER/bin/julia --color=yes -e 'import Pkg; Pkg.clone(pwd()); Pkg.test("COBRA", coverage=true); Pkg.rm("COBRA");' elif [ "$ARCH" == "macOS" ]; then - # remove th julia directory to clean the installation directory - rm -rf ~/.julia/v0.6/COBRA - caffeinate -u & - /Applications/Julia-$JULIA_VER.app/Contents/Resources/julia/bin/julia --color=yes -e 'Pkg.clone(pwd()); cd(Pkg.dir("COBRA")); Pkg.test(pwd());' + /Applications/Julia-$JULIA_VER.app/Contents/Resources/julia/bin/julia --color=yes -e 'import Pkg; Pkg.clone(pwd()); Pkg.test("COBRA", coverage=true); Pkg.rm("COBRA");' elif [ "$ARCH" == "windows" ]; then if [ "$JULIA_VER" == "v0.6.4" ]; then From 9728e910e771521d8cff500fc9159f833d70fb54 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Tue, 3 Sep 2019 16:44:43 +0200 Subject: [PATCH 08/52] fix path to testenv --- src/connect.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/connect.jl b/src/connect.jl index 2ee4769..479760b 100644 --- a/src/connect.jl +++ b/src/connect.jl @@ -9,7 +9,7 @@ if "JENKINS" in keys(ENV) @info "JENKINS CI server detected. Workers will be added with test environment configuration." - include("$JULIA_HOME/../share/julia/test/testenv.jl") + include("$ARTENOLIS_SOFT_PATH/julia/$JULIA_VER/share/julia/test/testenv.jl") addprocsCOBRA = addprocs_with_testenv else addprocsCOBRA = addprocs From e60cd8dd1ef2c09c5b4eac880d336cae832c68eb Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Tue, 3 Sep 2019 16:49:22 +0200 Subject: [PATCH 09/52] change of syntax for env vars --- src/connect.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/connect.jl b/src/connect.jl index 479760b..1ec0c24 100644 --- a/src/connect.jl +++ b/src/connect.jl @@ -9,7 +9,7 @@ if "JENKINS" in keys(ENV) @info "JENKINS CI server detected. Workers will be added with test environment configuration." - include("$ARTENOLIS_SOFT_PATH/julia/$JULIA_VER/share/julia/test/testenv.jl") + include(ENV["ARTENOLIS_SOFT_PATH"]*"/julia/"*ENV["JULIA_VER"]*"/share/julia/test/testenv.jl") addprocsCOBRA = addprocs_with_testenv else addprocsCOBRA = addprocs From 239c4b66f51cfa9205b8fc7e749430ef3289b586 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Wed, 4 Sep 2019 19:45:03 +0200 Subject: [PATCH 10/52] change to sys bindir in test --- src/connect.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/connect.jl b/src/connect.jl index 1ec0c24..fdb5199 100644 --- a/src/connect.jl +++ b/src/connect.jl @@ -9,7 +9,7 @@ if "JENKINS" in keys(ENV) @info "JENKINS CI server detected. Workers will be added with test environment configuration." - include(ENV["ARTENOLIS_SOFT_PATH"]*"/julia/"*ENV["JULIA_VER"]*"/share/julia/test/testenv.jl") + include(Sys.BINDIR*"/../share/julia/test/testenv.jl") addprocsCOBRA = addprocs_with_testenv else addprocsCOBRA = addprocs From bc746d452fa0cf7b1eed22f61ae6f2af844603e8 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Wed, 4 Sep 2019 19:58:01 +0200 Subject: [PATCH 11/52] windows compatibility on artenolis --- .artenolis/runtests.sh | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/.artenolis/runtests.sh b/.artenolis/runtests.sh index 9c55d59..b9caa51 100644 --- a/.artenolis/runtests.sh +++ b/.artenolis/runtests.sh @@ -12,19 +12,14 @@ elif [ "$ARCH" == "macOS" ]; then /Applications/Julia-$JULIA_VER.app/Contents/Resources/julia/bin/julia --color=yes -e 'import Pkg; Pkg.clone(pwd()); Pkg.test("COBRA", coverage=true); Pkg.rm("COBRA");' elif [ "$ARCH" == "windows" ]; then - if [ "$JULIA_VER" == "v0.6.4" ]; then - # remove th julia directory to clean the installation directory - rm -rf ~/.julia/v0.6/COBRA + unset Path + nohup "$ARTENOLIS_SOFT_PATH\\julia\\$JULIA_VER\\\bin\\julia.exe" --color=yes -e 'import Base; ENV["MATLAB_HOME"]="D:\\MATLAB\\$(ENV["MATLAB_VER"])"; import Pkg; Pkg.clone(pwd()); cd(Pkg.dir("COBRA")); Pkg.test(pwd());' > output.log & PID=$! - unset Path - nohup "$ARTENOLIS_SOFT_PATH\\julia\\$JULIA_VER\\\bin\\julia.exe" --color=yes -e 'import Base; ENV["MATLAB_HOME"]="D:\\MATLAB\\$(ENV["MATLAB_VER"])"; Pkg.clone(pwd()); cd(Pkg.dir("COBRA")); Pkg.test(pwd());' > output.log & PID=$! + # follow the log file + tail -n0 -F --pid=$! output.log 2>/dev/null - # follow the log file - tail -n0 -F --pid=$! output.log 2>/dev/null - - # wait until the background process is done - wait $PID - fi + # wait until the background process is done + wait $PID fi CODE=$? From 4eb62b818ed340954f3b7793662b03f5797ebb90 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Wed, 4 Sep 2019 20:05:50 +0200 Subject: [PATCH 12/52] fix for windows trigger command --- .artenolis/runtests.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.artenolis/runtests.sh b/.artenolis/runtests.sh index b9caa51..a609d22 100644 --- a/.artenolis/runtests.sh +++ b/.artenolis/runtests.sh @@ -9,11 +9,11 @@ if [ "$ARCH" == "Linux" ]; then elif [ "$ARCH" == "macOS" ]; then caffeinate -u & - /Applications/Julia-$JULIA_VER.app/Contents/Resources/julia/bin/julia --color=yes -e 'import Pkg; Pkg.clone(pwd()); Pkg.test("COBRA", coverage=true); Pkg.rm("COBRA");' + /Applications/Julia-$JULIA_VER.app/Contents/Resources/julia/bin/julia --color=yes -e 'import Pkg; Pkg.clone(pwd()); Pkg.test("COBRA"); Pkg.rm("COBRA");' elif [ "$ARCH" == "windows" ]; then unset Path - nohup "$ARTENOLIS_SOFT_PATH\\julia\\$JULIA_VER\\\bin\\julia.exe" --color=yes -e 'import Base; ENV["MATLAB_HOME"]="D:\\MATLAB\\$(ENV["MATLAB_VER"])"; import Pkg; Pkg.clone(pwd()); cd(Pkg.dir("COBRA")); Pkg.test(pwd());' > output.log & PID=$! + nohup "$ARTENOLIS_SOFT_PATH\\julia\\$JULIA_VER\\\bin\\julia.exe" --color=yes -e 'ENV["MATLAB_HOME"]="D:\\MATLAB\\$(ENV["MATLAB_VER"])"; import Pkg; Pkg.clone(pwd()); Pkg.test("COBRA");' > output.log & PID=$! # follow the log file tail -n0 -F --pid=$! output.log 2>/dev/null From 97942d112ae06493eed35111c9dff5b61c220959 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Wed, 4 Sep 2019 20:15:17 +0200 Subject: [PATCH 13/52] change requirements --- REQUIRE | 3 --- 1 file changed, 3 deletions(-) diff --git a/REQUIRE b/REQUIRE index 03fb2d3..c032867 100644 --- a/REQUIRE +++ b/REQUIRE @@ -1,8 +1,5 @@ julia 1.0 MathProgBase 0.7.0 MAT 0.5.0 -GLPKMathProgInterface 0.2.3 -GLPK 0.3.0 -Clp 0.2.2 HTTP 0.8.0 Suppressor 0.1.1 From a2d337747ac33a6f8139f886ab22b3d28d5b9aeb Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Thu, 5 Sep 2019 15:51:18 +0200 Subject: [PATCH 14/52] remove require files --- REQUIRE | 5 ----- test/REQUIRE | 8 -------- 2 files changed, 13 deletions(-) delete mode 100644 REQUIRE delete mode 100644 test/REQUIRE diff --git a/REQUIRE b/REQUIRE deleted file mode 100644 index c032867..0000000 --- a/REQUIRE +++ /dev/null @@ -1,5 +0,0 @@ -julia 1.0 -MathProgBase 0.7.0 -MAT 0.5.0 -HTTP 0.8.0 -Suppressor 0.1.1 diff --git a/test/REQUIRE b/test/REQUIRE deleted file mode 100644 index 03fb2d3..0000000 --- a/test/REQUIRE +++ /dev/null @@ -1,8 +0,0 @@ -julia 1.0 -MathProgBase 0.7.0 -MAT 0.5.0 -GLPKMathProgInterface 0.2.3 -GLPK 0.3.0 -Clp 0.2.2 -HTTP 0.8.0 -Suppressor 0.1.1 From af961c899dc2a378b3e970729491d098e7665bd4 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Thu, 5 Sep 2019 16:25:47 +0200 Subject: [PATCH 15/52] changes in toml file --- Project.toml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Project.toml b/Project.toml index 5d3735c..3b90c93 100644 --- a/Project.toml +++ b/Project.toml @@ -3,17 +3,27 @@ uuid = "58298e0b-d05c-52ec-a210-0694647ebfc7" version = "0.3.0" [deps] +CPLEX = "a076750e-1247-5638-91d2-ce28b192dca0" +Clp = "e2554f3b-3117-50c0-817c-e040a3ddf72d" Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b" +Gurobi = "2e9cd046-0924-5485-92f1-d5272153d98b" HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" MAT = "23992714-dd62-5051-b70f-ba57cb901cac" MathProgBase = "fdba3010-5040-5b88-9595-932c9decdf73" +Mosek = "6405355b-0ac2-5fba-af84-adbd65488c0e" Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" +[compat] +HTTP = ">= 0.8.0" +MAT = ">= 0.5.0" +MathProgBase = ">= 0.7.0" +julia = "1" + [extras] -Clp = "e2554f3b-3117-50c0-817c-e040a3ddf72d" CPLEX = "a076750e-1247-5638-91d2-ce28b192dca0" +Clp = "e2554f3b-3117-50c0-817c-e040a3ddf72d" GLPK = "60bf3e95-4087-53dc-ae20-288a0d20c6a6" GLPKMathProgInterface = "3c7084bd-78ad-589a-b5bb-dbd673274bea" Gurobi = "2e9cd046-0924-5485-92f1-d5272153d98b" @@ -23,9 +33,3 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] test = ["Suppressor", "GLPKMathProgInterface", "GLPK", "Clp", "Test"] - -[compat] -julia = "1" -MathProgBase = ">= 0.7.0" -MAT = ">= 0.5.0" -HTTP = ">= 0.8.0" From f82577583a20060e618ce6a02bb9ea4cc9ff5ab1 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Thu, 5 Sep 2019 17:04:18 +0200 Subject: [PATCH 16/52] essential changes for solvers --- src/COBRA.jl | 6 +++--- src/checkSetup.jl | 3 +++ src/connect.jl | 2 +- src/solve.jl | 8 ++++---- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/COBRA.jl b/src/COBRA.jl index b603e7f..bdfac87 100644 --- a/src/COBRA.jl +++ b/src/COBRA.jl @@ -17,9 +17,9 @@ The documentation is here: http://opencobra.github.io/COBRA.jl module COBRA # include the load file to load a model of .mat format - using Pkg, SparseArrays, Distributed, LinearAlgebra - using MAT - using MathProgBase + import Pkg + using SparseArrays, Distributed, LinearAlgebra + using MAT, MathProgBase if "MATLAB" in keys(Pkg.installed()) using MATLAB end diff --git a/src/checkSetup.jl b/src/checkSetup.jl index a194e32..f641230 100644 --- a/src/checkSetup.jl +++ b/src/checkSetup.jl @@ -90,6 +90,9 @@ function checkSysConfig(printLevel::Int=1) if string(pkgName) == "GLPKMathProgInterface" checkPackage(:GLPK, printLevel) end + if string(pkgName) == "Mosek" + checkPackage(:MosekTools, printLevel) + end end end diff --git a/src/connect.jl b/src/connect.jl index fdb5199..409683d 100644 --- a/src/connect.jl +++ b/src/connect.jl @@ -54,7 +54,7 @@ See also: `workers()`, `nprocs()`, `addprocs()`, `gethostname()` """ -function createPool(localWorkers::Int, connectSSH::Bool=false, connectionFile::String="$(Pkg.dir("COBRA"))/config/sshCfg.jl", printLevel::Int=1) +function createPool(localWorkers::Int, connectSSH::Bool=false, connectionFile::String=joinpath(dirname(pathof(COBRA)))*"/../config/sshCfg.jl", printLevel::Int=1) # load cores on remote nodes if connectSSH diff --git a/src/solve.jl b/src/solve.jl index 0eb7b5f..acb9cef 100644 --- a/src/solve.jl +++ b/src/solve.jl @@ -108,7 +108,7 @@ function changeCobraSolver(name, params=[]; printLevel::Int=1) if abs(printLevel) > 1 printLevel = 1 end - solver.handle = CplexSolver(CPX_PARAM_SCRIND=printLevel) + solver.handle = CPLEX.Optimizer(CPX_PARAM_SCRIND=printLevel) catch error("The solver `CPLEX` cannot be set using `changeCobraSolver()`.") end @@ -116,9 +116,9 @@ function changeCobraSolver(name, params=[]; printLevel::Int=1) elseif name == "GLPKMathProgInterface" || name == "GLPK" try if length(params) > 1 - solver.handle = GLPKSolverLP(method=params[1], presolve=params[2]) + solver.handle = GLPK.Optimizer(method=params[1], presolve=params[2]) else - solver.handle = GLPKSolverLP() + solver.handle = GLPK.Optimizer() #GLPKSolverLP() end catch error("The solver `GLPK` or `GLPKMathProgInterface` cannot be set using `changeCobraSolver()`.") @@ -155,7 +155,7 @@ function changeCobraSolver(name, params=[]; printLevel::Int=1) if printLevel == 1 printLevel = 10 # default value: https://docs.mosek.com/7.1/toolbox/MSK_IPAR_LOG.html end - solver.handle = MosekSolver(MSK_IPAR_LOG=printLevel) + solver.handle = Mosek.Optimizer(MSK_IPAR_LOG=printLevel) catch error("The solver `Mosek` cannot be set using `changeCobraSolver()`.") end From 73ecc26adf5717f75899384ba883bf5f4f98c314 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Thu, 5 Sep 2019 17:04:32 +0200 Subject: [PATCH 17/52] add deps to toml --- Project.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Project.toml b/Project.toml index 3b90c93..ed29c3f 100644 --- a/Project.toml +++ b/Project.toml @@ -6,12 +6,16 @@ version = "0.3.0" CPLEX = "a076750e-1247-5638-91d2-ce28b192dca0" Clp = "e2554f3b-3117-50c0-817c-e040a3ddf72d" Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b" +GLPK = "60bf3e95-4087-53dc-ae20-288a0d20c6a6" +GLPKMathProgInterface = "3c7084bd-78ad-589a-b5bb-dbd673274bea" Gurobi = "2e9cd046-0924-5485-92f1-d5272153d98b" HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" MAT = "23992714-dd62-5051-b70f-ba57cb901cac" +MathOptInterface = "b8f27783-ece8-5eb3-8dc8-9495eed66fee" MathProgBase = "fdba3010-5040-5b88-9595-932c9decdf73" Mosek = "6405355b-0ac2-5fba-af84-adbd65488c0e" +MosekTools = "1ec41992-ff65-5c91-ac43-2df89e9693a4" Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" From 052dcf8f7d80a583d9d85da12b290a72837aa73e Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Thu, 5 Sep 2019 17:05:10 +0200 Subject: [PATCH 18/52] remove deprecation warning in test --- test/runtests.jl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index e174669..5489bf4 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -8,17 +8,20 @@ #------------------------------------------------------------------------------------------- using Pkg, Distributed, LinearAlgebra # for Julia ver >= 1.0 +import COBRA + +pkgDir = joinpath(dirname(pathof(COBRA))) # retrieve all packages that are installed on the system -include("$(Pkg.dir("COBRA"))/src/checkSetup.jl") +include(pkgDir*"/checkSetup.jl") packages = checkSysConfig() # configure for runnint the tests in batch solverName = :GLPKMathProgInterface #:CPLEX nWorkers = 4 connectSSHWorkers = false -include("$(Pkg.dir("COBRA"))/src/connect.jl") -TESTDIR = "$(Pkg.dir("COBRA"))/test" +include(pkgDir*"/connect.jl") +TESTDIR = pkgDir*"/../test" # create a parallel pool and determine its size if (@isdefined nWorkers) && (@isdefined connectSSHWorkers) From b72b1e4abfb9fd72186bea31a820b076c2807b95 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Thu, 5 Sep 2019 21:07:44 +0200 Subject: [PATCH 19/52] Revert "add deps to toml" This reverts commit 73ecc26adf5717f75899384ba883bf5f4f98c314. --- Project.toml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Project.toml b/Project.toml index ed29c3f..3b90c93 100644 --- a/Project.toml +++ b/Project.toml @@ -6,16 +6,12 @@ version = "0.3.0" CPLEX = "a076750e-1247-5638-91d2-ce28b192dca0" Clp = "e2554f3b-3117-50c0-817c-e040a3ddf72d" Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b" -GLPK = "60bf3e95-4087-53dc-ae20-288a0d20c6a6" -GLPKMathProgInterface = "3c7084bd-78ad-589a-b5bb-dbd673274bea" Gurobi = "2e9cd046-0924-5485-92f1-d5272153d98b" HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" MAT = "23992714-dd62-5051-b70f-ba57cb901cac" -MathOptInterface = "b8f27783-ece8-5eb3-8dc8-9495eed66fee" MathProgBase = "fdba3010-5040-5b88-9595-932c9decdf73" Mosek = "6405355b-0ac2-5fba-af84-adbd65488c0e" -MosekTools = "1ec41992-ff65-5c91-ac43-2df89e9693a4" Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" From 0cf85610af2ff4c82a540d9f209c0b2d42a08064 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Thu, 5 Sep 2019 21:28:44 +0200 Subject: [PATCH 20/52] change of import to using --- test/runtests.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index 5489bf4..3d0cfba 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -8,7 +8,7 @@ #------------------------------------------------------------------------------------------- using Pkg, Distributed, LinearAlgebra # for Julia ver >= 1.0 -import COBRA +using COBRA pkgDir = joinpath(dirname(pathof(COBRA))) @@ -29,7 +29,7 @@ if (@isdefined nWorkers) && (@isdefined connectSSHWorkers) end # use the module COBRA and Base.Test modules on all workers -using COBRA +@everywhere using COBRA using Test using HTTP using Suppressor From 8764cd6cc6a6669ca86f30687b051d7fb4704830 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 9 Sep 2019 15:02:54 +0200 Subject: [PATCH 21/52] temporarily drop Clp and Mosek support --- Project.toml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Project.toml b/Project.toml index 3b90c93..67757a9 100644 --- a/Project.toml +++ b/Project.toml @@ -4,21 +4,19 @@ version = "0.3.0" [deps] CPLEX = "a076750e-1247-5638-91d2-ce28b192dca0" -Clp = "e2554f3b-3117-50c0-817c-e040a3ddf72d" Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b" +GLPK = "60bf3e95-4087-53dc-ae20-288a0d20c6a6" +GLPKMathProgInterface = "3c7084bd-78ad-589a-b5bb-dbd673274bea" Gurobi = "2e9cd046-0924-5485-92f1-d5272153d98b" HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" MAT = "23992714-dd62-5051-b70f-ba57cb901cac" MathProgBase = "fdba3010-5040-5b88-9595-932c9decdf73" -Mosek = "6405355b-0ac2-5fba-af84-adbd65488c0e" -Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" [compat] HTTP = ">= 0.8.0" MAT = ">= 0.5.0" -MathProgBase = ">= 0.7.0" julia = "1" [extras] From 6ba8c3607f598aaa4db9b4bbb3ed0e604c8f36b7 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 9 Sep 2019 15:03:18 +0200 Subject: [PATCH 22/52] temporarily drop Clp and Mosek support in checksetup --- src/checkSetup.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/checkSetup.jl b/src/checkSetup.jl index f641230..622cba7 100644 --- a/src/checkSetup.jl +++ b/src/checkSetup.jl @@ -71,7 +71,7 @@ function checkSysConfig(printLevel::Int=1) packages = [] # initialize a vector with supported LP solvers - LPsolvers = [:Clp, :GLPKMathProgInterface, :Gurobi, :CPLEX, :Mosek] + LPsolvers = [ :GLPKMathProgInterface, :Gurobi, :CPLEX] #:Clp, :Mosek if checkPackage(:MathProgBase, printLevel) From 8c1d4e8ab37a4f420edc6bfbb44494db777223da Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 9 Sep 2019 15:03:54 +0200 Subject: [PATCH 23/52] revert mathoptinterface syntax and drop support for clp and mosek --- src/solve.jl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/solve.jl b/src/solve.jl index acb9cef..14383d5 100644 --- a/src/solve.jl +++ b/src/solve.jl @@ -108,7 +108,7 @@ function changeCobraSolver(name, params=[]; printLevel::Int=1) if abs(printLevel) > 1 printLevel = 1 end - solver.handle = CPLEX.Optimizer(CPX_PARAM_SCRIND=printLevel) + solver.handle = CplexSolver(CPX_PARAM_SCRIND=printLevel) catch error("The solver `CPLEX` cannot be set using `changeCobraSolver()`.") end @@ -116,9 +116,9 @@ function changeCobraSolver(name, params=[]; printLevel::Int=1) elseif name == "GLPKMathProgInterface" || name == "GLPK" try if length(params) > 1 - solver.handle = GLPK.Optimizer(method=params[1], presolve=params[2]) + solver.handle = GLPKSolverLP(method=params[1], presolve=params[2]) else - solver.handle = GLPK.Optimizer() #GLPKSolverLP() + solver.handle = GLPKSolverLP() end catch error("The solver `GLPK` or `GLPKMathProgInterface` cannot be set using `changeCobraSolver()`.") @@ -142,7 +142,7 @@ function changeCobraSolver(name, params=[]; printLevel::Int=1) catch error("The solver `Gurobi` cannot be set using `changeCobraSolver()`.") end - + #= elseif name == "Clp" try solver.handle = ClpSolver() @@ -155,11 +155,11 @@ function changeCobraSolver(name, params=[]; printLevel::Int=1) if printLevel == 1 printLevel = 10 # default value: https://docs.mosek.com/7.1/toolbox/MSK_IPAR_LOG.html end - solver.handle = Mosek.Optimizer(MSK_IPAR_LOG=printLevel) + solver.handle = MosekSolver(MSK_IPAR_LOG=printLevel) catch error("The solver `Mosek` cannot be set using `changeCobraSolver()`.") end - + =# else solver.handle = -1 error("The solver is not supported. Please set the solver name to one the supported solvers.") From 465c1e5710a1fb33cba0de62a1f7b3e277137423 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 9 Sep 2019 15:04:32 +0200 Subject: [PATCH 24/52] fix dep warnings in test suite --- test/p_all.jl | 10 ++++++---- test/runtests.jl | 10 +++++----- test/s_all.jl | 8 +++++--- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/test/p_all.jl b/test/p_all.jl index 6b0fd2c..33d10ab 100644 --- a/test/p_all.jl +++ b/test/p_all.jl @@ -12,6 +12,8 @@ if !@isdefined includeCOBRA includeCOBRA = true end +pkgDir = joinpath(dirname(pathof(COBRA))) + # output information testFile = @__FILE__ @@ -20,9 +22,9 @@ nWorkers = 4 # create a pool and use the COBRA module if the testfile is run in a loop if includeCOBRA - # solverName = :GLPKMathProgInterface # JL: is it really necessary? + solverName = :GLPKMathProgInterface # JL: is it really necessary? connectSSHWorkers = false - include("$(Pkg.dir("COBRA"))/src/connect.jl") + include(pkgDir*"/connect.jl") # create a parallel pool and determine its size if isdefined(:nWorkers) && isdefined(:connectSSHWorkers) @@ -39,10 +41,10 @@ end getTestModel() # include a common deck for running tests -include("$(Pkg.dir("COBRA"))/config/solverCfg.jl") +include(pkgDir*"/../config/solverCfg.jl") # load an external mat file -model = loadModel("$(Pkg.dir("COBRA"))/test/ecoli_core_model.mat", "S", "model") +model = loadModel(pkgDir*"/../test/ecoli_core_model.mat", "S", "model") # test that no output is produced with printLevel = 0 @info " > Testing silent $solverName ..." diff --git a/test/runtests.jl b/test/runtests.jl index 3d0cfba..5cf02cc 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -17,7 +17,7 @@ include(pkgDir*"/checkSetup.jl") packages = checkSysConfig() # configure for runnint the tests in batch -solverName = :GLPKMathProgInterface #:CPLEX +solverName = :GLPKMathProgInterface nWorkers = 4 connectSSHWorkers = false include(pkgDir*"/connect.jl") @@ -29,10 +29,10 @@ if (@isdefined nWorkers) && (@isdefined connectSSHWorkers) end # use the module COBRA and Base.Test modules on all workers -@everywhere using COBRA +using COBRA using Test using HTTP -using Suppressor +#using Suppressor # download the ecoli_core_model include("getTestModel.jl") @@ -104,7 +104,7 @@ end # list all currently supported solvers -supportedSolvers = [:Clp, :GLPKMathProgInterface, :CPLEX, :Gurobi, :Mosek] +supportedSolvers = [:GLPKMathProgInterface, :CPLEX, :Gurobi] #:Clp, :Mosek # test if an error is thrown for non-installed solvers for i = 1:length(supportedSolvers) @@ -133,7 +133,7 @@ for s in packages # evaluate the test file for t = 1:length(testDir) # run only parallel and serial test files - if testDir[t][1:2] in ["p_", "s_", "z_"] + if testDir[t][1:2] in ["s_", "z_"] #"p_", printstyled("\nRunning $(testDir[t]) ...\n\n"; color=:green) include(testDir[t]) end diff --git a/test/s_all.jl b/test/s_all.jl index 9530f11..c439987 100644 --- a/test/s_all.jl +++ b/test/s_all.jl @@ -12,6 +12,8 @@ if !@isdefined includeCOBRA includeCOBRA = true end +pkgDir = joinpath(dirname(pathof(COBRA))) + # output information testFile = @__FILE__ @@ -21,7 +23,7 @@ nWorkers = 1 # create a pool and use the COBRA module if the testfile is run in a loop if includeCOBRA connectSSHWorkers = false - include("$(Pkg.dir("COBRA"))/src/connect.jl") + include(pkgDir*"/connect.jl") # create a parallel pool and determine its size if isdefined(:nWorkers) && isdefined(:connectSSHWorkers) @@ -38,13 +40,13 @@ end getTestModel() # include a common deck for running tests -include("$(Pkg.dir("COBRA"))/config/solverCfg.jl") +include(pkgDir*"/../config/solverCfg.jl") # change the COBRA solver solver = changeCobraSolver(solverName, solParams) # load an external mat file -model = loadModel("$(Pkg.dir("COBRA"))/test/ecoli_core_model.mat", "S", "model") +model = loadModel(pkgDir*"/../test/ecoli_core_model.mat", "S", "model") # select the number of reactions rxnsList = 1:length(model.rxns) From ced512304011939d37043acb0745543fd6fbe758 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 9 Sep 2019 15:09:14 +0200 Subject: [PATCH 25/52] reinstate Pkg --- Project.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Project.toml b/Project.toml index 67757a9..010eecb 100644 --- a/Project.toml +++ b/Project.toml @@ -12,6 +12,7 @@ HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" MAT = "23992714-dd62-5051-b70f-ba57cb901cac" MathProgBase = "fdba3010-5040-5b88-9595-932c9decdf73" +Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" [compat] From 805c63f8c8c399e6ed84ea1eb8e3d78a82ac6c5e Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 9 Sep 2019 19:40:00 +0200 Subject: [PATCH 26/52] change of deps in toml --- Project.toml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Project.toml b/Project.toml index 010eecb..15b8445 100644 --- a/Project.toml +++ b/Project.toml @@ -3,11 +3,9 @@ uuid = "58298e0b-d05c-52ec-a210-0694647ebfc7" version = "0.3.0" [deps] -CPLEX = "a076750e-1247-5638-91d2-ce28b192dca0" Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b" GLPK = "60bf3e95-4087-53dc-ae20-288a0d20c6a6" GLPKMathProgInterface = "3c7084bd-78ad-589a-b5bb-dbd673274bea" -Gurobi = "2e9cd046-0924-5485-92f1-d5272153d98b" HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" MAT = "23992714-dd62-5051-b70f-ba57cb901cac" @@ -22,13 +20,11 @@ julia = "1" [extras] CPLEX = "a076750e-1247-5638-91d2-ce28b192dca0" -Clp = "e2554f3b-3117-50c0-817c-e040a3ddf72d" GLPK = "60bf3e95-4087-53dc-ae20-288a0d20c6a6" GLPKMathProgInterface = "3c7084bd-78ad-589a-b5bb-dbd673274bea" Gurobi = "2e9cd046-0924-5485-92f1-d5272153d98b" MATLAB = "10e44e05-a98a-55b3-a45b-ba969058deb6" -Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["Suppressor", "GLPKMathProgInterface", "GLPK", "Clp", "Test"] +test = ["GLPKMathProgInterface", "GLPK", "Test"] From 7c52a101e03cd4af93daf8e8b250797532bedb7d Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 9 Sep 2019 20:11:25 +0200 Subject: [PATCH 27/52] clean comment --- config/sshCfg.jl | 1 - 1 file changed, 1 deletion(-) diff --git a/config/sshCfg.jl b/config/sshCfg.jl index 20a7d52..10a3829 100644 --- a/config/sshCfg.jl +++ b/config/sshCfg.jl @@ -9,7 +9,6 @@ sshWorkers = Array{Dict{Any, Any}}(undef, 3) -# JL: Have a look at the codes below sshWorkers[1] = Dict( "usernode" => "first.last@server1.com", "procs" => 8, "dir" => `"~"/COBRA.jl/`, From c98cd6a01b61fa8c8fa9335577f44da68287a789 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 9 Sep 2019 20:11:47 +0200 Subject: [PATCH 28/52] reinstantiate saveDistributedFBA in tests --- test/p_all.jl | 10 ++++------ test/runtests.jl | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/test/p_all.jl b/test/p_all.jl index 33d10ab..4edb6a5 100644 --- a/test/p_all.jl +++ b/test/p_all.jl @@ -22,7 +22,8 @@ nWorkers = 4 # create a pool and use the COBRA module if the testfile is run in a loop if includeCOBRA - solverName = :GLPKMathProgInterface # JL: is it really necessary? + # define the name of the default solver + solverName = :GLPKMathProgInterface connectSSHWorkers = false include(pkgDir*"/connect.jl") @@ -303,12 +304,10 @@ if solverName != "Mosek" @test abs((model.c' * minFlux)[1] - optSol) < 1e-6 # save the variables to the current directory - # JL: We need to revise the saveDistributedFBA function; - # I think this function must have the result variables as an argument - # saveDistributedFBA("testFile.mat") # Temporaily inactivated + saveDistributedFBA("testFile.mat") # remove the file to clean up - # run(`rm testFile.mat`) # Temporaily inactivated + run(`rm testFile.mat`) # print a solution summary printSolSummary(testFile, optSol, maxFlux, minFlux, solTime, nWorkers, solverName) @@ -382,7 +381,6 @@ minFlux, maxFlux, optSol, fbaSol, fvamin, fvamax, statussolmin, statussolmax = d @test isequal(statussolmin, ones(Int, length(rxnsList))) @test isequal(statussolmax, ones(Int, length(rxnsList))) -# JL: saveDistributedFBA temporarily inactivated saveDistributedFBA("testFile.mat", ["minFlux", "maxFlux"]) # call saveDistributedFBA with no variables diff --git a/test/runtests.jl b/test/runtests.jl index 5cf02cc..9309f09 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -7,7 +7,7 @@ #------------------------------------------------------------------------------------------- -using Pkg, Distributed, LinearAlgebra # for Julia ver >= 1.0 +using Pkg, Distributed, LinearAlgebra using COBRA pkgDir = joinpath(dirname(pathof(COBRA))) From d3989ff736b1e8efb1dfcecad599a410f1f331d3 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 9 Sep 2019 20:21:10 +0200 Subject: [PATCH 29/52] simplified using statements --- test/runtests.jl | 11 +++-------- test/s_all.jl | 3 +-- test/s_core.jl | 3 +-- test/s_distinct.jl | 3 +-- test/s_fba.jl | 3 +-- 5 files changed, 7 insertions(+), 16 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index 9309f09..c41577c 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -7,8 +7,7 @@ #------------------------------------------------------------------------------------------- -using Pkg, Distributed, LinearAlgebra -using COBRA +using Pkg, Distributed, LinearAlgebra, COBRA pkgDir = joinpath(dirname(pathof(COBRA))) @@ -29,10 +28,7 @@ if (@isdefined nWorkers) && (@isdefined connectSSHWorkers) end # use the module COBRA and Base.Test modules on all workers -using COBRA -using Test -using HTTP -#using Suppressor +using COBRA, Test, HTTP # download the ecoli_core_model include("getTestModel.jl") @@ -42,8 +38,7 @@ getTestModel() if "MATLAB" in keys(Pkg.installed()) @info "The MATLAB package is present. The tests for PALM.jl will be run." - using MAT - using MATLAB + using MAT, MATLAB # load sharing that is not fair nWorkers, quotientModels, remainderModels = COBRA.shareLoad(2) diff --git a/test/s_all.jl b/test/s_all.jl index c439987..b1bcf7f 100644 --- a/test/s_all.jl +++ b/test/s_all.jl @@ -30,8 +30,7 @@ if includeCOBRA workersPool, nWorkers = createPool(nWorkers, connectSSHWorkers) end - using COBRA - using HTTP + using COBRA, HTTP include("getTestModel.jl") end diff --git a/test/s_core.jl b/test/s_core.jl index 52f1fb0..358a6ba 100644 --- a/test/s_core.jl +++ b/test/s_core.jl @@ -28,8 +28,7 @@ if includeCOBRA workersPool, nWorkers = createPool(nWorkers, connectSSHWorkers) end - using COBRA - using HTTP + using COBRA, HTTP include("getTestModel.jl") end diff --git a/test/s_distinct.jl b/test/s_distinct.jl index f937f53..ad98923 100644 --- a/test/s_distinct.jl +++ b/test/s_distinct.jl @@ -28,8 +28,7 @@ if includeCOBRA workersPool, nWorkers = createPool(nWorkers, connectSSHWorkers) end - using COBRA - using HTTP + using COBRA, HTTP include("getTestModel.jl") end diff --git a/test/s_fba.jl b/test/s_fba.jl index 2767904..bb1161d 100644 --- a/test/s_fba.jl +++ b/test/s_fba.jl @@ -28,8 +28,7 @@ if includeCOBRA workersPool, nWorkers = createPool(nWorkers, connectSSHWorkers) end - using COBRA - using HTTP + using COBRA, HTTP include("getTestModel.jl") end From 42f6957fd81391d1fd2bb1f6a63331ceef1af5b1 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 9 Sep 2019 20:26:02 +0200 Subject: [PATCH 30/52] reset the call of distributedFBA in tests - remove semi-colon --- test/p_distinct.jl | 6 +++--- test/p_range.jl | 2 +- test/s_all.jl | 2 +- test/s_core.jl | 2 +- test/s_distinct.jl | 6 +++--- test/s_fba.jl | 4 ++-- test/z_all.jl | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/test/p_distinct.jl b/test/p_distinct.jl index 8321574..9d0603f 100644 --- a/test/p_distinct.jl +++ b/test/p_distinct.jl @@ -50,13 +50,13 @@ model = loadModel("$(Pkg.dir("COBRA"))/test/ecoli_core_model.mat", "S", "model") optPercentage = 90.0 # run all the reactions as a reference -minFlux1, maxFlux1, optSol1, fbaSol1, fvamin1, fvamax1, statussolmin1, statussolmax1 = distributedFBA(model, solver; nWorkers=nWorkers, optPercentage=optPercentage, preFBA=true) +minFlux1, maxFlux1, optSol1, fbaSol1, fvamin1, fvamax1, statussolmin1, statussolmax1 = distributedFBA(model, solver, nWorkers=nWorkers, optPercentage=optPercentage, preFBA=true) rxnsList = [1; 2; 3; 4; 12; 28] rxnsOptMode = [0; 1; 2; 0; 1; 2] # min: 1, 3, 4, 28; max: 2, 3, 12, 28 # run only a few reactions with rxnsOptMode and rxnsList -minFlux, maxFlux, optSol, fbaSol, fvamin, fvamax, statussolmin, statussolmax = distributedFBA(model, solver; nWorkers=nWorkers, preFBA=true, optPercentage=optPercentage, rxnsList=rxnsList, rxnsOptMode=rxnsOptMode) +minFlux, maxFlux, optSol, fbaSol, fvamin, fvamax, statussolmin, statussolmax = distributedFBA(model, solver, nWorkers=nWorkers, preFBA=true, optPercentage=optPercentage, rxnsList=rxnsList, rxnsOptMode=rxnsOptMode) # test the solution status @test isequal(statussolmin[rxnsList], [1, NaN, 1, 1, NaN, 1]) @@ -80,7 +80,7 @@ end # run only the reactions of the rxnsList (both maximizations and minimizations) startTime = time() -minFlux, maxFlux, optSol, fbaSol, fvamin, fvamax, statussolmin, statussolmax = distributedFBA(model, solver; nWorkers=nWorkers, preFBA=true, optPercentage=optPercentage, rxnsList=rxnsList) +minFlux, maxFlux, optSol, fbaSol, fvamin, fvamax, statussolmin, statussolmax = distributedFBA(model, solver, nWorkers=nWorkers, preFBA=true, optPercentage=optPercentage, rxnsList=rxnsList) solTime = time() - startTime @test norm(minFlux1[rxnsList] - minFlux[rxnsList]) < 1e-9 diff --git a/test/p_range.jl b/test/p_range.jl index c1f7a6b..8eb975d 100644 --- a/test/p_range.jl +++ b/test/p_range.jl @@ -57,7 +57,7 @@ optPercentage = 90.0 # launch the distributedFBA process startTime = time() -minFlux, maxFlux, optSol, fbaSol, fvamin, fvamax = distributedFBA(model, solver; nWorkers=nWorkers, optPercentage=optPercentage, preFBA=true, rxnsList=rxnsList) +minFlux, maxFlux, optSol, fbaSol, fvamin, fvamax = distributedFBA(model, solver, nWorkers=nWorkers, optPercentage=optPercentage, preFBA=true, rxnsList=rxnsList) solTime = time() - startTime # Test numerical values - test on floor as different numerical precision with different solvers diff --git a/test/s_all.jl b/test/s_all.jl index b1bcf7f..4ddfb4b 100644 --- a/test/s_all.jl +++ b/test/s_all.jl @@ -249,7 +249,7 @@ optPercentage = 90.0 # launch the distributedFBA process startTime = time() -minFlux, maxFlux, optSol, fbaSol, fvamin, fvamax, statussolmin, statussolmax = distributedFBA(model, solver; nWorkers=nWorkers, optPercentage=optPercentage, preFBA=true) +minFlux, maxFlux, optSol, fbaSol, fvamin, fvamax, statussolmin, statussolmax = distributedFBA(model, solver, nWorkers=nWorkers, optPercentage=optPercentage, preFBA=true) solTime = time() - startTime # Test numerical values - test on floor as different numerical precision with different solvers diff --git a/test/s_core.jl b/test/s_core.jl index 358a6ba..1309f3b 100644 --- a/test/s_core.jl +++ b/test/s_core.jl @@ -69,7 +69,7 @@ optPercentage = 90.0 # launch the distributedFBA process startTime = time() -minFlux, maxFlux, optSol = distributedFBA(model, solver; nWorkers=nWorkers, optPercentage=optPercentage, preFBA=true) +minFlux, maxFlux, optSol = distributedFBA(model, solver, nWorkers=nWorkers, optPercentage=optPercentage, preFBA=true) solTime = time() - startTime # Test numerical values - test on floor as different numerical precision with different solvers diff --git a/test/s_distinct.jl b/test/s_distinct.jl index ad98923..7c4bfb9 100644 --- a/test/s_distinct.jl +++ b/test/s_distinct.jl @@ -49,13 +49,13 @@ model = loadModel("$(Pkg.dir("COBRA"))/test/ecoli_core_model.mat", "S", "model") optPercentage = 90.0 # run all the reactions as a reference -minFlux1, maxFlux1, optSol1, fbaSol1, fvamin1, fvamax1, statussolmin1, statussolmax1 = distributedFBA(model, solver; nWorkers=nWorkers, optPercentage=optPercentage, preFBA=true) +minFlux1, maxFlux1, optSol1, fbaSol1, fvamin1, fvamax1, statussolmin1, statussolmax1 = distributedFBA(model, solver, nWorkers=nWorkers, optPercentage=optPercentage, preFBA=true) rxnsList = [1; 18; 10; 20:30; 90; 93; 95] rxnsOptMode = [0; 1; 2; 2 .+ zeros(Int, length(20:30)); 2; 1; 0] # run only a few reactions with rxnsOptMode and rxnsList -minFlux, maxFlux, optSol, fbaSol, fvamin, fvamax, statussolmin, statussolmax = distributedFBA(model, solver; nWorkers=nWorkers, optPercentage=optPercentage, rxnsList=rxnsList, rxnsOptMode=rxnsOptMode, preFBA=true) +minFlux, maxFlux, optSol, fbaSol, fvamin, fvamax, statussolmin, statussolmax = distributedFBA(model, solver, nWorkers=nWorkers, optPercentage=optPercentage, rxnsList=rxnsList, rxnsOptMode=rxnsOptMode, preFBA=true) # test the solution status @test isequal(statussolmin[rxnsList], [1; NaN; 1; ones(Int, length(20:30)); 1; NaN; 1]) @@ -80,7 +80,7 @@ end # run only the reactions of the rxnsList (both maximizations and minimizations) startTime = time() -minFlux, maxFlux, optSol, fbaSol, fvamin, fvamax, statussolmin, statussolmax = distributedFBA(model, solver; nWorkers=nWorkers, optPercentage=optPercentage, rxnsList=rxnsList, preFBA=true) +minFlux, maxFlux, optSol, fbaSol, fvamin, fvamax, statussolmin, statussolmax = distributedFBA(model, solver, nWorkers=nWorkers, optPercentage=optPercentage, rxnsList=rxnsList, preFBA=true) solTime = time() - startTime @test norm(minFlux1[rxnsList] - minFlux[rxnsList]) < 1e-9 diff --git a/test/s_fba.jl b/test/s_fba.jl index bb1161d..e5b49ae 100644 --- a/test/s_fba.jl +++ b/test/s_fba.jl @@ -57,7 +57,7 @@ optPercentage = 10.0 for s = 0:2 # launch the distributedFBA process startTime = time() - minFlux, maxFlux, optSol, fbaSol, fvamin, fvamax, statussolmin, statussolmax = distributedFBA(model, solver; nWorkers=nWorkers, optPercentage=optPercentage, objective="min", rxnsList=rxnsList, strategy=s, rxnsOptMode=rxnsOptMode, preFBA=false) + minFlux, maxFlux, optSol, fbaSol, fvamin, fvamax, statussolmin, statussolmax = distributedFBA(model, solver, nWorkers=nWorkers, optPercentage=optPercentage, objective="min", rxnsList=rxnsList, strategy=s, rxnsOptMode=rxnsOptMode, preFBA=false) solTime = time() - startTime # Test numerical values - test on ceil as different numerical precision with different solvers @@ -81,7 +81,7 @@ model = modelOrig # launch the distributedFBA process with only 1 reaction startTime = time() -minFlux, maxFlux, optSol = distributedFBA(model, solver; nWorkers=nWorkers, objective="", rxnsList=rxnsList, rxnsOptMode=rxnsOptMode, preFBA=false); +minFlux, maxFlux, optSol = distributedFBA(model, solver, nWorkers=nWorkers, objective="", rxnsList=rxnsList, rxnsOptMode=rxnsOptMode, preFBA=false); solTime = time() - startTime fbaSolution = solveCobraLP(model, solver) # in the model, objective is assumed to be maximized diff --git a/test/z_all.jl b/test/z_all.jl index d953106..80878a4 100644 --- a/test/z_all.jl +++ b/test/z_all.jl @@ -76,7 +76,7 @@ model = loadModel("$(Pkg.dir("COBRA"))/test/ecoli_core_model.mat") # run a model with more reactions on the reaction list than in the model rxnsList = 1:length(model.rxns) + 1 -minFlux, maxFlux, optSol, fbaSol, fvamin, fvamax, statussolmin, statussolmax = distributedFBA(model, solver; nWorkers=1, optPercentage=90.0, objective="min", rxnsList=rxnsList) +minFlux, maxFlux, optSol, fbaSol, fvamin, fvamax, statussolmin, statussolmax = distributedFBA(model, solver, nWorkers=1, optPercentage=90.0, objective="min", rxnsList=rxnsList) # test preFBA! with min optSol, fbaSol = preFBA!(model, solver, 90.0, "min") From b8caca320dc74b93c38c8cc533df3f0ab00d7c95 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 9 Sep 2019 20:35:16 +0200 Subject: [PATCH 31/52] simplified using statements (1) --- test/p_distinct.jl | 3 +-- test/p_range.jl | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/test/p_distinct.jl b/test/p_distinct.jl index 9d0603f..403f408 100644 --- a/test/p_distinct.jl +++ b/test/p_distinct.jl @@ -28,8 +28,7 @@ if includeCOBRA workersPool, nWorkers = createPool(nWorkers, connectSSHWorkers) end - using COBRA - using HTTP + using COBRA, HTTP include("getTestModel.jl") end diff --git a/test/p_range.jl b/test/p_range.jl index 8eb975d..10e357e 100644 --- a/test/p_range.jl +++ b/test/p_range.jl @@ -28,8 +28,7 @@ if includeCOBRA workersPool, nWorkers = createPool(nWorkers, connectSSHWorkers) end - using COBRA - using HTTP + using COBRA, HTTP include("getTestModel.jl") end From 164d8b4f8c9415030a6ad3b2f5068970ddb59382 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Tue, 10 Sep 2019 17:05:18 +0200 Subject: [PATCH 32/52] explicitly add the cplex and gurobi solvers on artenolis --- .artenolis/runtests.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.artenolis/runtests.sh b/.artenolis/runtests.sh index a609d22..52e5fa6 100644 --- a/.artenolis/runtests.sh +++ b/.artenolis/runtests.sh @@ -5,15 +5,15 @@ echo "MATLAB_VER = $MATLAB_VER" # launch the test script if [ "$ARCH" == "Linux" ]; then - $ARTENOLIS_SOFT_PATH/julia/$JULIA_VER/bin/julia --color=yes -e 'import Pkg; Pkg.clone(pwd()); Pkg.test("COBRA", coverage=true); Pkg.rm("COBRA");' + $ARTENOLIS_SOFT_PATH/julia/$JULIA_VER/bin/julia --color=yes -e 'import Pkg; Pkg.add("CPLEX"); Pkg.add("Gurobi"); Pkg.clone(pwd()); Pkg.test("COBRA", coverage=true); Pkg.rm("COBRA");' elif [ "$ARCH" == "macOS" ]; then caffeinate -u & - /Applications/Julia-$JULIA_VER.app/Contents/Resources/julia/bin/julia --color=yes -e 'import Pkg; Pkg.clone(pwd()); Pkg.test("COBRA"); Pkg.rm("COBRA");' + /Applications/Julia-$JULIA_VER.app/Contents/Resources/julia/bin/julia --color=yes -e 'import Pkg; Pkg.add("CPLEX"); Pkg.add("Gurobi"); Pkg.clone(pwd()); Pkg.test("COBRA"); Pkg.rm("COBRA");' elif [ "$ARCH" == "windows" ]; then unset Path - nohup "$ARTENOLIS_SOFT_PATH\\julia\\$JULIA_VER\\\bin\\julia.exe" --color=yes -e 'ENV["MATLAB_HOME"]="D:\\MATLAB\\$(ENV["MATLAB_VER"])"; import Pkg; Pkg.clone(pwd()); Pkg.test("COBRA");' > output.log & PID=$! + nohup "$ARTENOLIS_SOFT_PATH\\julia\\$JULIA_VER\\\bin\\julia.exe" --color=yes -e 'ENV["MATLAB_HOME"]="D:\\MATLAB\\$(ENV["MATLAB_VER"])"; import Pkg; Pkg.clone(pwd()); Pkg.add("CPLEX"); Pkg.add("Gurobi"); Pkg.test("COBRA");' > output.log & PID=$! # follow the log file tail -n0 -F --pid=$! output.log 2>/dev/null From c8a648285cbfdc6a28a621fc7aefe2d762e10b16 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Tue, 10 Sep 2019 17:08:24 +0200 Subject: [PATCH 33/52] explicitly add coverage pkg --- .artenolis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.artenolis.yml b/.artenolis.yml index 3da9168..093134b 100644 --- a/.artenolis.yml +++ b/.artenolis.yml @@ -29,7 +29,7 @@ after_success: # submit coverage report - if [ "$ARCH" == "Linux" && "$JULIA_VER" = "v1.2.0" ]; then - $ARTENOLIS_SOFT_PATH/julia/$JULIA_VER/bin/julia --color=yes -e 'using Coverage; Codecov.submit(process_folder())'; + $ARTENOLIS_SOFT_PATH/julia/$JULIA_VER/bin/julia --color=yes -e 'import Pkg; Pkg.add("Coverage"); using Coverage; Codecov.submit(process_folder())'; fi # set environment variables for documentation deployment From ad76709dcc013cda4f48e058de0189862c9f32e9 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Tue, 10 Sep 2019 17:12:54 +0200 Subject: [PATCH 34/52] Revert "explicitly add the cplex and gurobi solvers on artenolis" This reverts commit 164d8b4f8c9415030a6ad3b2f5068970ddb59382. --- .artenolis/runtests.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.artenolis/runtests.sh b/.artenolis/runtests.sh index 52e5fa6..a609d22 100644 --- a/.artenolis/runtests.sh +++ b/.artenolis/runtests.sh @@ -5,15 +5,15 @@ echo "MATLAB_VER = $MATLAB_VER" # launch the test script if [ "$ARCH" == "Linux" ]; then - $ARTENOLIS_SOFT_PATH/julia/$JULIA_VER/bin/julia --color=yes -e 'import Pkg; Pkg.add("CPLEX"); Pkg.add("Gurobi"); Pkg.clone(pwd()); Pkg.test("COBRA", coverage=true); Pkg.rm("COBRA");' + $ARTENOLIS_SOFT_PATH/julia/$JULIA_VER/bin/julia --color=yes -e 'import Pkg; Pkg.clone(pwd()); Pkg.test("COBRA", coverage=true); Pkg.rm("COBRA");' elif [ "$ARCH" == "macOS" ]; then caffeinate -u & - /Applications/Julia-$JULIA_VER.app/Contents/Resources/julia/bin/julia --color=yes -e 'import Pkg; Pkg.add("CPLEX"); Pkg.add("Gurobi"); Pkg.clone(pwd()); Pkg.test("COBRA"); Pkg.rm("COBRA");' + /Applications/Julia-$JULIA_VER.app/Contents/Resources/julia/bin/julia --color=yes -e 'import Pkg; Pkg.clone(pwd()); Pkg.test("COBRA"); Pkg.rm("COBRA");' elif [ "$ARCH" == "windows" ]; then unset Path - nohup "$ARTENOLIS_SOFT_PATH\\julia\\$JULIA_VER\\\bin\\julia.exe" --color=yes -e 'ENV["MATLAB_HOME"]="D:\\MATLAB\\$(ENV["MATLAB_VER"])"; import Pkg; Pkg.clone(pwd()); Pkg.add("CPLEX"); Pkg.add("Gurobi"); Pkg.test("COBRA");' > output.log & PID=$! + nohup "$ARTENOLIS_SOFT_PATH\\julia\\$JULIA_VER\\\bin\\julia.exe" --color=yes -e 'ENV["MATLAB_HOME"]="D:\\MATLAB\\$(ENV["MATLAB_VER"])"; import Pkg; Pkg.clone(pwd()); Pkg.test("COBRA");' > output.log & PID=$! # follow the log file tail -n0 -F --pid=$! output.log 2>/dev/null From f7297defa73385324faec58bc88099bcd17885a8 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Tue, 10 Sep 2019 17:13:36 +0200 Subject: [PATCH 35/52] add CPLEX and Gurobi as test reqs --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 15b8445..c0a9220 100644 --- a/Project.toml +++ b/Project.toml @@ -27,4 +27,4 @@ MATLAB = "10e44e05-a98a-55b3-a45b-ba969058deb6" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["GLPKMathProgInterface", "GLPK", "Test"] +test = ["GLPKMathProgInterface", "GLPK", "Test", "Gurobi", "CPLEX"] From 25ed82227d65a2964b217dd146777823046e313d Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Wed, 11 Sep 2019 10:19:25 +0200 Subject: [PATCH 36/52] add MATLAB to deps --- Project.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index c0a9220..e029e6d 100644 --- a/Project.toml +++ b/Project.toml @@ -3,12 +3,14 @@ uuid = "58298e0b-d05c-52ec-a210-0694647ebfc7" version = "0.3.0" [deps] +CPLEX = "a076750e-1247-5638-91d2-ce28b192dca0" Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b" GLPK = "60bf3e95-4087-53dc-ae20-288a0d20c6a6" GLPKMathProgInterface = "3c7084bd-78ad-589a-b5bb-dbd673274bea" HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" MAT = "23992714-dd62-5051-b70f-ba57cb901cac" +MATLAB = "10e44e05-a98a-55b3-a45b-ba969058deb6" MathProgBase = "fdba3010-5040-5b88-9595-932c9decdf73" Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" @@ -27,4 +29,4 @@ MATLAB = "10e44e05-a98a-55b3-a45b-ba969058deb6" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["GLPKMathProgInterface", "GLPK", "Test", "Gurobi", "CPLEX"] +test = ["GLPKMathProgInterface", "GLPK", "Test", "MATLAB", "Gurobi", "CPLEX"] From 74122e32fab2d62dad2e3cdc9396c358a7d95572 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Wed, 11 Sep 2019 10:19:37 +0200 Subject: [PATCH 37/52] make PALM.jl julia 1.0 ready --- src/PALM.jl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/PALM.jl b/src/PALM.jl index 6b63654..3370b1d 100644 --- a/src/PALM.jl +++ b/src/PALM.jl @@ -261,19 +261,19 @@ function PALM(dir, scriptName; nMatlab::Int=2, outputFile::AbstractString="PALM_ nCharacteristics = length(varsCharact) # prepare array for storing remote references - R = Array{Future}(nWorkers) + R = Array{Future}(undef, nWorkers, 2) # declare an array to store the indices for each worker - indicesWorkers = Array{Int}(nWorkers, 3) + indicesWorkers = Array{Int}(undef, nWorkers, 3) # declare an empty array for storing a summary of all data - summaryData = Array{Union{Int,Float64,AbstractString}}(nModels + 1, nCharacteristics + 1) + summaryData = Array{Union{Int,Float64,AbstractString}}(undef, nModels + 1, nCharacteristics + 1) # clone the COBRA Toolbox if it is not yet available # Note: there is no need for the submodules to be cloned if !isdir(cobraToolboxDir) cmd = "git clone git@github.com:opencobra/cobratoolbox.git $cobraToolboxDir" - info(cmd) + @info cmd run(`sh -c $cmd`) end @@ -284,7 +284,7 @@ function PALM(dir, scriptName; nMatlab::Int=2, outputFile::AbstractString="PALM_ info(ENV["HOME"]*"/tmp/test-ct-$p") if !isdir(ENV["HOME"]*"/tmp/test-ct-$p") cmd = "git clone $cobraToolboxDir "*ENV["HOME"]*"/tmp/test-ct-$p" - info(cmd) + @info cmd run(`sh -c $cmd`) end end From d3e2f9fd87aa4c8901e379c9916e57f8ed6acef5 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Wed, 11 Sep 2019 11:28:17 +0200 Subject: [PATCH 38/52] add MAT to test dep --- Project.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index e029e6d..061660b 100644 --- a/Project.toml +++ b/Project.toml @@ -25,8 +25,9 @@ CPLEX = "a076750e-1247-5638-91d2-ce28b192dca0" GLPK = "60bf3e95-4087-53dc-ae20-288a0d20c6a6" GLPKMathProgInterface = "3c7084bd-78ad-589a-b5bb-dbd673274bea" Gurobi = "2e9cd046-0924-5485-92f1-d5272153d98b" +MAT = "23992714-dd62-5051-b70f-ba57cb901cac" MATLAB = "10e44e05-a98a-55b3-a45b-ba969058deb6" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["GLPKMathProgInterface", "GLPK", "Test", "MATLAB", "Gurobi", "CPLEX"] +test = ["GLPKMathProgInterface", "GLPK", "Test", "MATLAB", "Gurobi", "CPLEX", "MAT"] From 5cca5025bbb155fc2ed9a2f35f38a33ec0cb8b55 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Wed, 11 Sep 2019 12:00:26 +0200 Subject: [PATCH 39/52] changes in palm.jl for julia1.0 --- src/PALM.jl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/PALM.jl b/src/PALM.jl index 3370b1d..79fe6ed 100644 --- a/src/PALM.jl +++ b/src/PALM.jl @@ -167,7 +167,7 @@ function loopModels(dir, p, scriptName, dirContent, startIndex, endIndex, varsCh #local nModels if endIndex >= startIndex # declaration of local data array - data = Array{Union{Int,Float64,AbstractString}}(localnModels, nCharacteristics + 1) + data = Array{Union{Int,Float64,AbstractString}}(undef, localnModels, nCharacteristics + 1) for k = 1:localnModels PALM_iModel = k #+ (p - 1) * nModels @@ -182,7 +182,7 @@ function loopModels(dir, p, scriptName, dirContent, startIndex, endIndex, varsCh MATLAB.@mput PALM_modelFile MATLAB.@mput PALM_dir MATLAB.@mput PALM_printLevel - eval(parse("MATLAB.mat\"run('$scriptName')\"")) + MATLAB.eval_string("run('" * scriptName * "')") for i = 1:nCharacteristics data[k, i + 1] = MATLAB.get_variable(Symbol(varsCharact[i])) @@ -281,7 +281,7 @@ function PALM(dir, scriptName; nMatlab::Int=2, outputFile::AbstractString="PALM_ if useCOBRA for (p, pid) in enumerate(workers()) @sync @spawnat (p + 1) begin - info(ENV["HOME"]*"/tmp/test-ct-$p") + @info ENV["HOME"]*"/tmp/test-ct-$p" if !isdir(ENV["HOME"]*"/tmp/test-ct-$p") cmd = "git clone $cobraToolboxDir "*ENV["HOME"]*"/tmp/test-ct-$p" @info cmd @@ -302,8 +302,8 @@ function PALM(dir, scriptName; nMatlab::Int=2, outputFile::AbstractString="PALM_ # adding the model directory and eventual subdirectories to the MATLAB path # Note: the fileseparator `/` also works on Windows systems if git Bash has been installed @async R[p] = @spawnat (p+1) begin - eval(parse("mat\"addpath(genpath('"*ENV["HOME"]*"/tmp/test-ct-$p'))\"")) - eval(parse("mat\"run('"*ENV["HOME"]*"/tmp/test-ct-$p/initCobraToolbox.m');\"")) + eval_string("addpath(genpath([getenv('HOME') '/tmp/test-ct-"*string(p)*"']))") + eval_string("run([getenv('HOME') '/tmp/test-ct-$p/initCobraToolbox.m'])") end end end From ba572de8c440d10c71568f993c762e4271bb45ee Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Wed, 11 Sep 2019 12:00:41 +0200 Subject: [PATCH 40/52] everywhere macro --- test/runtests.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/runtests.jl b/test/runtests.jl index c41577c..d85a3eb 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -28,7 +28,7 @@ if (@isdefined nWorkers) && (@isdefined connectSSHWorkers) end # use the module COBRA and Base.Test modules on all workers -using COBRA, Test, HTTP +@everywhere using COBRA, Test, HTTP # download the ecoli_core_model include("getTestModel.jl") From 1b49c634253139b652ddb3b1e1bad56d283a0248 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Wed, 11 Sep 2019 13:42:36 +0200 Subject: [PATCH 41/52] change of MATLAB deps to extras --- Project.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index 061660b..2f7f57c 100644 --- a/Project.toml +++ b/Project.toml @@ -10,7 +10,6 @@ GLPKMathProgInterface = "3c7084bd-78ad-589a-b5bb-dbd673274bea" HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" MAT = "23992714-dd62-5051-b70f-ba57cb901cac" -MATLAB = "10e44e05-a98a-55b3-a45b-ba969058deb6" MathProgBase = "fdba3010-5040-5b88-9595-932c9decdf73" Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" @@ -30,4 +29,4 @@ MATLAB = "10e44e05-a98a-55b3-a45b-ba969058deb6" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["GLPKMathProgInterface", "GLPK", "Test", "MATLAB", "Gurobi", "CPLEX", "MAT"] +test = ["GLPKMathProgInterface", "GLPK", "Test", "MAT", "MATLAB", "Gurobi", "CPLEX"] From d61fd18b72ba3dd1d7b87f5f250982f736fc220e Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Wed, 11 Sep 2019 13:54:50 +0200 Subject: [PATCH 42/52] remove env variable for matlab home on windows --- .artenolis/runtests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.artenolis/runtests.sh b/.artenolis/runtests.sh index a609d22..7a894c5 100644 --- a/.artenolis/runtests.sh +++ b/.artenolis/runtests.sh @@ -13,7 +13,7 @@ elif [ "$ARCH" == "macOS" ]; then elif [ "$ARCH" == "windows" ]; then unset Path - nohup "$ARTENOLIS_SOFT_PATH\\julia\\$JULIA_VER\\\bin\\julia.exe" --color=yes -e 'ENV["MATLAB_HOME"]="D:\\MATLAB\\$(ENV["MATLAB_VER"])"; import Pkg; Pkg.clone(pwd()); Pkg.test("COBRA");' > output.log & PID=$! + nohup "$ARTENOLIS_SOFT_PATH\\julia\\$JULIA_VER\\\bin\\julia.exe" --color=yes -e 'import Pkg; Pkg.clone(pwd()); Pkg.test("COBRA"); Pkg.rm("COBRA");' > output.log & PID=$! # follow the log file tail -n0 -F --pid=$! output.log 2>/dev/null From 3c8f061154c9e40d1ee7f3804e2e406c825d29f7 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Wed, 11 Sep 2019 14:09:27 +0200 Subject: [PATCH 43/52] change home env variable to homedir --- src/PALM.jl | 14 +++++++------- src/distributedFBA.jl | 4 ++-- test/runtests.jl | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/PALM.jl b/src/PALM.jl index 79fe6ed..64873f8 100644 --- a/src/PALM.jl +++ b/src/PALM.jl @@ -215,7 +215,7 @@ Results are saved in the `outputFile`. - `nMatlab`: Number of desired MATLAB sessions (default: 2) - `outputFile`: Name of `.mat` file to save the result table named "summaryData" (default name: "PALM_data.mat") -- `cobraToolboxDir`: Directory of the COBRA Toolbox (default: ENV["HOME"]*"/cobratoolbox") +- `cobraToolboxDir`: Directory of the COBRA Toolbox (default: homedir()*"/cobratoolbox") - `printLevel`: Verbose level (default: 1). Mute all output with `printLevel = 0`. # OUTPUTS @@ -226,19 +226,19 @@ File with the name specified in `outputFile`. - Minimum working example ```julia -julia> PALM(ENV["HOME"]*"/models", "characteristics") +julia> PALM(homedir()*"/models", "characteristics") ``` - Running `PALM` on 12 MATLAB sessions ```julia -julia> PALM(ENV["HOME"]*"/models", "characteristics", 12, "characteristicsResults.mat") +julia> PALM(homedir()*"/models", "characteristics", 12, "characteristicsResults.mat") ``` See also: `loopModels()` and `shareLoad()` """ -function PALM(dir, scriptName; nMatlab::Int=2, outputFile::AbstractString="PALM_data.mat", varsCharact=[], cobraToolboxDir=ENV["HOME"]*Base.Filesystem.path_separator*"cobratoolbox", printLevel::Int=1, useCOBRA::Bool=true) +function PALM(dir, scriptName; nMatlab::Int=2, outputFile::AbstractString="PALM_data.mat", varsCharact=[], cobraToolboxDir=homedir()*Base.Filesystem.path_separator*"cobratoolbox", printLevel::Int=1, useCOBRA::Bool=true) # read the content of the directory dirContent = readdir(dir) @@ -281,9 +281,9 @@ function PALM(dir, scriptName; nMatlab::Int=2, outputFile::AbstractString="PALM_ if useCOBRA for (p, pid) in enumerate(workers()) @sync @spawnat (p + 1) begin - @info ENV["HOME"]*"/tmp/test-ct-$p" - if !isdir(ENV["HOME"]*"/tmp/test-ct-$p") - cmd = "git clone $cobraToolboxDir "*ENV["HOME"]*"/tmp/test-ct-$p" + @info homedir()*"/tmp/test-ct-$p" + if !isdir(homedir()*"/tmp/test-ct-$p") + cmd = "git clone $cobraToolboxDir "*homedir()*"/tmp/test-ct-$p" @info cmd run(`sh -c $cmd`) end diff --git a/src/distributedFBA.jl b/src/distributedFBA.jl index 1376300..aae54b5 100644 --- a/src/distributedFBA.jl +++ b/src/distributedFBA.jl @@ -844,12 +844,12 @@ julia> saveDistributedFBA("myDirectory/myResults.mat") - Home location ```julia -julia> saveDistributedFBA(ENV["HOME"]*"/myResults.mat") +julia> saveDistributedFBA(homedir()*"/myResults.mat") ``` - Save minFlux and maxFlux variables ```julia -julia> saveDistributedFBA(ENV["HOME"]*"/myResults.mat", ["minFlux", "maxFlux"]) +julia> saveDistributedFBA(homedir()*"/myResults.mat", ["minFlux", "maxFlux"]) ``` """ diff --git a/test/runtests.jl b/test/runtests.jl index d85a3eb..adac382 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -89,7 +89,7 @@ if "MATLAB" in keys(Pkg.installed()) "nNz"] # launch PALM with the scriptFile on the 2 models - PALM(joinpath(TESTDIR, "testModels"), "scriptFile", nMatlab=2, outputFile="modelCharacteristics.mat", varsCharact=varsCharact, cobraToolboxDir=ENV["HOME"]*"/tmp/cobratoolbox-cobrajl") + PALM(joinpath(TESTDIR, "testModels"), "scriptFile", nMatlab=2, outputFile="modelCharacteristics.mat", varsCharact=varsCharact, cobraToolboxDir=homedir()*"/tmp/cobratoolbox-cobrajl") # remove the directory with the test models rm(joinpath(TESTDIR, "testModels"), force=true, recursive=true) From 5f6b0a4826df62a42529e459cec4b08e1cde5c9c Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Wed, 11 Sep 2019 15:05:53 +0200 Subject: [PATCH 44/52] change of filesep on windows --- src/PALM.jl | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/PALM.jl b/src/PALM.jl index 64873f8..ae85584 100644 --- a/src/PALM.jl +++ b/src/PALM.jl @@ -281,9 +281,9 @@ function PALM(dir, scriptName; nMatlab::Int=2, outputFile::AbstractString="PALM_ if useCOBRA for (p, pid) in enumerate(workers()) @sync @spawnat (p + 1) begin - @info homedir()*"/tmp/test-ct-$p" - if !isdir(homedir()*"/tmp/test-ct-$p") - cmd = "git clone $cobraToolboxDir "*homedir()*"/tmp/test-ct-$p" + @info homedir()*Base.Filesystem.path_separator*"tmp"*Base.Filesystem.path_separator*"test-ct-$p" + if !isdir(homedir()*Base.Filesystem.path_separator*"tmp"*Base.Filesystem.path_separator*"test-ct-$p") + cmd = "git clone $cobraToolboxDir "*homedir()*Base.Filesystem.path_separator*"tmp"*Base.Filesystem.path_separator*"test-ct-$p" @info cmd run(`sh -c $cmd`) end @@ -300,10 +300,9 @@ function PALM(dir, scriptName; nMatlab::Int=2, outputFile::AbstractString="PALM_ if useCOBRA # adding the model directory and eventual subdirectories to the MATLAB path - # Note: the fileseparator `/` also works on Windows systems if git Bash has been installed @async R[p] = @spawnat (p+1) begin - eval_string("addpath(genpath([getenv('HOME') '/tmp/test-ct-"*string(p)*"']))") - eval_string("run([getenv('HOME') '/tmp/test-ct-$p/initCobraToolbox.m'])") + eval_string("addpath(genpath(["*homedir()*Base.Filesystem.path_separator*"'tmp"*Base.Filesystem.path_separator*"test-ct-"*string(p)*"']))") + eval_string("run(["*homedir()*"'"*Base.Filesystem.path_separator*"tmp"*Base.Filesystem.path_separator*"test-ct-$p"*Base.Filesystem.path_separator*"initCobraToolbox.m'])") end end end From 62826b5ab4470553545a5425972106c60c04a292 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Thu, 12 Sep 2019 12:00:38 +0200 Subject: [PATCH 45/52] remove test deps on certain platforms --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 2f7f57c..98c043e 100644 --- a/Project.toml +++ b/Project.toml @@ -29,4 +29,4 @@ MATLAB = "10e44e05-a98a-55b3-a45b-ba969058deb6" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["GLPKMathProgInterface", "GLPK", "Test", "MAT", "MATLAB", "Gurobi", "CPLEX"] +test = ["GLPKMathProgInterface", "GLPK", "Test"] \ No newline at end of file From 4e5a85808d751276e4942ec8a7dad24926e69500 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Thu, 12 Sep 2019 12:03:35 +0200 Subject: [PATCH 46/52] perl command in .artenolis.yml to change project.toml test deps --- .artenolis.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.artenolis.yml b/.artenolis.yml index 093134b..97d31bb 100644 --- a/.artenolis.yml +++ b/.artenolis.yml @@ -19,6 +19,11 @@ script: # rename the cloned folder - cd .. && cp -r $NODE_LABELS COBRA && cd COBRA + # change the test dependencies on Linux and macOS (ARTENOLIS) + - if [ "$ARCH" == "Linux" && "$ARCH" == "macOS" ]; then + perl -i -pe's/test = \["GLPKMathProgInterface", "GLPK", "Test"\]/test = \["GLPKMathProgInterface", "GLPK", "Test", "MAT", "MATLAB", "Gurobi", "CPLEX"\]/g' Project.toml + fi + # launch the tests - bash .artenolis/runtests.sh From f3349f254c3fef4cbf7c77d683ca13516cd581e2 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Thu, 12 Sep 2019 12:26:20 +0200 Subject: [PATCH 47/52] line ending in yml script --- .artenolis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.artenolis.yml b/.artenolis.yml index 97d31bb..27c401e 100644 --- a/.artenolis.yml +++ b/.artenolis.yml @@ -21,7 +21,7 @@ script: # change the test dependencies on Linux and macOS (ARTENOLIS) - if [ "$ARCH" == "Linux" && "$ARCH" == "macOS" ]; then - perl -i -pe's/test = \["GLPKMathProgInterface", "GLPK", "Test"\]/test = \["GLPKMathProgInterface", "GLPK", "Test", "MAT", "MATLAB", "Gurobi", "CPLEX"\]/g' Project.toml + perl -i -pe's/test = \["GLPKMathProgInterface", "GLPK", "Test"\]/test = \["GLPKMathProgInterface", "GLPK", "Test", "MAT", "MATLAB", "Gurobi", "CPLEX"\]/g' Project.toml; fi # launch the tests From bc84194be66f160fefe5f8cd6baee043ee923593 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Thu, 12 Sep 2019 12:49:00 +0200 Subject: [PATCH 48/52] debugging: display toml --- .artenolis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.artenolis.yml b/.artenolis.yml index 27c401e..3af20d1 100644 --- a/.artenolis.yml +++ b/.artenolis.yml @@ -22,6 +22,7 @@ script: # change the test dependencies on Linux and macOS (ARTENOLIS) - if [ "$ARCH" == "Linux" && "$ARCH" == "macOS" ]; then perl -i -pe's/test = \["GLPKMathProgInterface", "GLPK", "Test"\]/test = \["GLPKMathProgInterface", "GLPK", "Test", "MAT", "MATLAB", "Gurobi", "CPLEX"\]/g' Project.toml; + cat Project.toml; fi # launch the tests From 3b04d34bb4780259e40ad0779f951132ac9b22b9 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Thu, 12 Sep 2019 12:51:55 +0200 Subject: [PATCH 49/52] change if condition --- .artenolis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.artenolis.yml b/.artenolis.yml index 3af20d1..cd5c1b0 100644 --- a/.artenolis.yml +++ b/.artenolis.yml @@ -20,9 +20,8 @@ script: - cd .. && cp -r $NODE_LABELS COBRA && cd COBRA # change the test dependencies on Linux and macOS (ARTENOLIS) - - if [ "$ARCH" == "Linux" && "$ARCH" == "macOS" ]; then + - if [ "$ARCH" == "Linux" ] || [ "$ARCH" == "macOS" ]; then perl -i -pe's/test = \["GLPKMathProgInterface", "GLPK", "Test"\]/test = \["GLPKMathProgInterface", "GLPK", "Test", "MAT", "MATLAB", "Gurobi", "CPLEX"\]/g' Project.toml; - cat Project.toml; fi # launch the tests From 7e6afa54089f21789e839141f494c159dd2cd482 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Thu, 12 Sep 2019 13:03:24 +0200 Subject: [PATCH 50/52] change test deps on windows --- .artenolis.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.artenolis.yml b/.artenolis.yml index cd5c1b0..bd7bbe0 100644 --- a/.artenolis.yml +++ b/.artenolis.yml @@ -19,10 +19,8 @@ script: # rename the cloned folder - cd .. && cp -r $NODE_LABELS COBRA && cd COBRA - # change the test dependencies on Linux and macOS (ARTENOLIS) - - if [ "$ARCH" == "Linux" ] || [ "$ARCH" == "macOS" ]; then - perl -i -pe's/test = \["GLPKMathProgInterface", "GLPK", "Test"\]/test = \["GLPKMathProgInterface", "GLPK", "Test", "MAT", "MATLAB", "Gurobi", "CPLEX"\]/g' Project.toml; - fi + # change the test dependencies + - perl -i -pe's/test = \["GLPKMathProgInterface", "GLPK", "Test"\]/test = \["GLPKMathProgInterface", "GLPK", "Test", "MAT", "MATLAB", "Gurobi", "CPLEX"\]/g' Project.toml; # launch the tests - bash .artenolis/runtests.sh From 5175821e5c4616087f2f2c56496ee2722e3805bd Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Thu, 12 Sep 2019 13:07:14 +0200 Subject: [PATCH 51/52] fix paths in PALM.jl --- src/PALM.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/PALM.jl b/src/PALM.jl index ae85584..dca52cd 100644 --- a/src/PALM.jl +++ b/src/PALM.jl @@ -299,10 +299,11 @@ function PALM(dir, scriptName; nMatlab::Int=2, outputFile::AbstractString="PALM_ end if useCOBRA + slash = Base.Filesystem.path_separator # adding the model directory and eventual subdirectories to the MATLAB path @async R[p] = @spawnat (p+1) begin - eval_string("addpath(genpath(["*homedir()*Base.Filesystem.path_separator*"'tmp"*Base.Filesystem.path_separator*"test-ct-"*string(p)*"']))") - eval_string("run(["*homedir()*"'"*Base.Filesystem.path_separator*"tmp"*Base.Filesystem.path_separator*"test-ct-$p"*Base.Filesystem.path_separator*"initCobraToolbox.m'])") + eval_string("addpath(genpath('"*homedir()*slash*"tmp"*slash*"test-ct-"*string(p)*"'))") + eval_string("run('"*homedir()*slash*"tmp"*slash*"test-ct-$p"*slash*"initCobraToolbox.m')") end end end From 9aab41eea4e18792a7c276942127a67f64a67895 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Thu, 12 Sep 2019 13:10:00 +0200 Subject: [PATCH 52/52] Revert "change test deps on windows" This reverts commit 7e6afa54089f21789e839141f494c159dd2cd482. --- .artenolis.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.artenolis.yml b/.artenolis.yml index bd7bbe0..cd5c1b0 100644 --- a/.artenolis.yml +++ b/.artenolis.yml @@ -19,8 +19,10 @@ script: # rename the cloned folder - cd .. && cp -r $NODE_LABELS COBRA && cd COBRA - # change the test dependencies - - perl -i -pe's/test = \["GLPKMathProgInterface", "GLPK", "Test"\]/test = \["GLPKMathProgInterface", "GLPK", "Test", "MAT", "MATLAB", "Gurobi", "CPLEX"\]/g' Project.toml; + # change the test dependencies on Linux and macOS (ARTENOLIS) + - if [ "$ARCH" == "Linux" ] || [ "$ARCH" == "macOS" ]; then + perl -i -pe's/test = \["GLPKMathProgInterface", "GLPK", "Test"\]/test = \["GLPKMathProgInterface", "GLPK", "Test", "MAT", "MATLAB", "Gurobi", "CPLEX"\]/g' Project.toml; + fi # launch the tests - bash .artenolis/runtests.sh