Skip to content

Commit d56790f

Browse files
authored
Merge pull request #70 from jabelic/rls/fix-to-auto-merge-010
Rls/fix to auto merge 010
2 parents 74ef2fa + 3579c53 commit d56790f

File tree

8 files changed

+67
-204
lines changed

8 files changed

+67
-204
lines changed

Project.toml

-3
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,8 @@ CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
99
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
1010
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
1111
Luxor = "ae8d54c2-7ccd-5906-9d76-62fc9837b5bc"
12-
PackageCompiler = "9b87118b-4619-50d2-8e1e-99f35a4d4d9d"
13-
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
1412
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"
1513
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
16-
TimerOutputs = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f"
1714

1815
[compat]
1916
BenchmarkTools = "1"

init

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/sh
2+
3+
init(){
4+
if [ "$(uname)" = 'Darwin' ] && [ "$SHELL" = "/bin/zsh" ]; then
5+
echo "export JULIA_NUM_THREADS=`sysctl -n hw.logicalcpu`" >> ~/.zshrc
6+
elif [ "$SHELL" = "/bin/bash" ] && [ "$SHELL" = "/bin/zsh" ]; then
7+
echo "export JULIA_NUM_THREADS=`sysctl -n hw.logicalcpu`" >> ~/.bashrc
8+
elif [ "$(expr substr $(uname -s) 1 5)"='Linux' ] && [ "$SHELL" = "/bin/bash" ]; then
9+
THREADS=`fgrep 'processor' /proc/cpuinfo | wc -l`
10+
echo "export JULIA_NUM_THREADS=$THREADS" >> ~/.bashrc
11+
else
12+
echo "Your platform ($(uname -a)) is not supported."
13+
exit 1
14+
fi
15+
julia src/settings.jl -t auto
16+
}
17+
18+
init

src/environments.jl

+2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
JULIA_MULTI_PROCESS = true
22
L = 1.5
3+
# dev | rls
4+
STAGE = "rls"

src/sdistance.jl

+8-3
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,17 @@ include("./distance_function.jl")
33
include("./floodfill.jl")
44
include("./utils/utils.jl")
55
include("./environments.jl")
6+
67
import .DistanceFunction: create_signed_distance_function_multiprocess, create_signed_distance_function, distanceToCurve, create_distance_function, create_distance_function_multiprocess
78
import .Floodfill: signining_field
89
import .Utils: is_jordan_curve, interpolation
9-
import CSV, DataFrames, Plots, DelimitedFiles, Luxor, BenchmarkTools, TimerOutputs
10-
using CSV, DataFrames, Plots, DelimitedFiles, Luxor, BenchmarkTools, TimerOutputs
11-
const tmr = TimerOutput()
10+
import CSV, DataFrames, DelimitedFiles, Luxor, BenchmarkTools
11+
using CSV, DataFrames, DelimitedFiles, Luxor, BenchmarkTools
12+
if STAGE == "dev"
13+
import Plots, TimerOutputs
14+
using Plots, TimerOutputs
15+
const tmr = TimerOutput()
16+
end
1217

1318
"""
1419
benchmark用method

src/settings.jl

+10-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
#= Sysimage for Developers. Sysimage.so must be written on .gitignore because it is so large file! =#
2+
include("./environments.jl")
3+
24
using Pkg
3-
Pkg.add("PackageCompiler")
45
Pkg.add("DelimitedFiles")
5-
Pkg.add("TimerOutputs")
66
Pkg.add("Test")
7-
Pkg.add("Plots")
8-
using PackageCompiler
97

10-
PackageCompiler.create_sysimage([:CSV, :DataFrames, :Plots, :Luxor, :BenchmarkTools, :TimerOutputs, :Test]; sysimage_path="Sysimage.so")
8+
if STAGE == "dev"
9+
Pkg.add("PackageCompiler")
10+
Pkg.add("TimerOutputs")
11+
Pkg.add("Plots")
12+
using PackageCompiler
13+
PackageCompiler.create_sysimage([:CSV, :DataFrames, :Plots, :Luxor, :BenchmarkTools, :TimerOutputs, :Test]; sysimage_path="Sysimage.so")
14+
end
15+
1116
# >> You can use packages with 'import and using'
1217
# $ julia -JSysimage.so

test/APT.jl

-113
This file was deleted.

test/draw.jl

-54
This file was deleted.

test/main.jl

+29-26
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,38 @@
11
using DataFrames, CSV
22
using Profile
3-
include("../src/sdistance.jl") # 必ずダブルクオーテーション
4-
include("../test/draw.jl")
5-
include("../src/SignedDistanceFunction.jl")
63
include("../src/environments.jl")
7-
include("../test/APT.jl")
8-
import .Draw: parformance_graphs
9-
using .SignedDistanceFunction
10-
using .APT
4+
if STAGE == "dev"
5+
include("../src/sdistance.jl") # 必ずダブルクオーテーション
6+
include("../test/draw.jl")
7+
include("../src/SignedDistanceFunction.jl")
8+
include("../test/APT.jl")
9+
import .Draw: parformance_graphs
10+
using .SignedDistanceFunction
11+
using .APT
1112

12-
# This script run by test.sh
1313

14-
# ====== Debug ======
15-
# p = signedDistance2D("./test/mock_csv_data/interface.csv", parse(Int, ARGS[1]))
16-
# DataFrame(p, :auto) |> CSV.write("./test/result/interface_result_n"*ARGS[1]*".csv", header=false)
17-
# p = signedDistance2D("./test/mock_csv_data/interface.csv", parse(Int, ARGS[1]), "multi")
18-
# DataFrame(p, :auto) |> CSV.write("./test/result/interface_floodfill_result_n"*ARGS[1]*".csv", header=false)
19-
# p = signedDistance2D("./test/mock_csv_data/multiple_curves.csv", parse(Int, ARGS[1]), "multi")
20-
# DataFrame(p, :auto) |> CSV.write("./test/result/multiple_curves_result_n"*ARGS[1]*".csv", header=false)
14+
# This script run by test.sh
2115

22-
# ====== profiling =======
16+
# ====== Debug ======
17+
# p = signedDistance2D("./test/mock_csv_data/interface.csv", parse(Int, ARGS[1]))
18+
# DataFrame(p, :auto) |> CSV.write("./test/result/interface_result_n"*ARGS[1]*".csv", header=false)
19+
# p = signedDistance2D("./test/mock_csv_data/interface.csv", parse(Int, ARGS[1]), "multi")
20+
# DataFrame(p, :auto) |> CSV.write("./test/result/interface_floodfill_result_n"*ARGS[1]*".csv", header=false)
21+
# p = signedDistance2D("./test/mock_csv_data/multiple_curves.csv", parse(Int, ARGS[1]), "multi")
22+
# DataFrame(p, :auto) |> CSV.write("./test/result/multiple_curves_result_n"*ARGS[1]*".csv", header=false)
2323

24-
# @profile signedDistance2D("./test/mock_csv_data/interface.csv",parse(Int, ARGS[1]))
25-
# @profile signedDistance2D("./test/mock_csv_data/interface.csv",parse(Int, ARGS[1]), "multi")
26-
# Profile.print()
27-
# open("prof.txt", "w") do s
28-
# Profile.print(IOContext(s, :displaysize => (24, 500)))
29-
# end
24+
# ====== profiling =======
3025

31-
# ====== memory size =======
32-
p = @allocated signedDistance2D("./test/mock_csv_data/interface.csv", parse(Int, ARGS[1]), "multi")
33-
# p = @allocated signedDistance2D("./test/mock_csv_data/multiple_curves.csv", parse(Int, ARGS[1]), "multi")
34-
println("\nUsed memory size: ",p/(1024*1024), " MB")
26+
# @profile signedDistance2D("./test/mock_csv_data/interface.csv",parse(Int, ARGS[1]))
27+
# @profile signedDistance2D("./test/mock_csv_data/interface.csv",parse(Int, ARGS[1]), "multi")
28+
# Profile.print()
29+
# open("prof.txt", "w") do s
30+
# Profile.print(IOContext(s, :displaysize => (24, 500)))
31+
# end
3532

33+
# ====== memory size =======
34+
p = @allocated signedDistance2D("./test/mock_csv_data/interface.csv", parse(Int, ARGS[1]), "multi")
35+
# p = @allocated signedDistance2D("./test/mock_csv_data/multiple_curves.csv", parse(Int, ARGS[1]), "multi")
36+
println("\nUsed memory size: ",p/(1024*1024), " MB")
37+
38+
end

0 commit comments

Comments
 (0)