@@ -36,14 +36,14 @@ elseif options.FL==Float32
3636end
3737
3838# load image to project
39- file = matopen(joinpath(dirname(pathof(SetIntersectionProjection)), " ../examples/Data/compass_velocity.mat" ))
40- m = read(file, " Data" );close(file)
41- m = m[1 : 341 ,200 : 600 ]
42- m = permutedims(m,[2 ,1 ])
39+ file = matopen(joinpath(dirname(pathof(SetIntersectionProjection)), " ../examples/Data/compass_velocity.mat" ));
40+ m = read(file, " Data" );close(file);
41+ m = m[1 : 341 ,200 : 600 ];
42+ m = permutedims(m,[2 ,1 ]);
4343
4444# set up computational grid (25 and 6 m are the original distances between grid points)
4545comp_grid = compgrid((TF(25.0 ), TF(6.0 )),(size(m,1 ), size(m,2 )))
46- m = convert(Vector{TF},vec(m))
46+ m = convert(Vector{TF},vec(m));
4747
4848# define axis limits and colorbar limits
4949xmax = comp_grid. d[1 ]* comp_grid. n[1 ]
@@ -55,13 +55,13 @@ vma = 4500
5555constraint = Vector{SetIntersectionProjection. set_definitions}()
5656
5757# bounds:
58- m_min = 1500 .0
58+ m_min = 1480 .0
5959m_max = 4500.0
6060set_type = " bounds"
6161TD_OP = " identity"
6262app_mode = (" matrix" ," " )
6363custom_TD_OP = ([],false )
64- push!(constraint, set_definitions(set_type,TD_OP,m_min,m_max,app_mode,custom_TD_OP))
64+ push!(constraint, set_definitions(set_type,TD_OP,m_min,m_max,app_mode,custom_TD_OP));
6565
6666# slope constraints (vertical)
6767m_min = 0.0
@@ -70,11 +70,11 @@ set_type = "bounds"
7070TD_OP = " D_z"
7171app_mode = (" matrix" ," " )
7272custom_TD_OP = ([],false )
73- push!(constraint, set_definitions(set_type,TD_OP,m_min,m_max,app_mode,custom_TD_OP))
73+ push!(constraint, set_definitions(set_type,TD_OP,m_min,m_max,app_mode,custom_TD_OP));
7474
7575options. parallel = false
76- (P_sub,TD_OP,set_Prop) = setup_constraints(constraint,comp_grid,options. FL)
77- (TD_OP,AtA,l,y) = PARSDMM_precompute_distribute(TD_OP,set_Prop,comp_grid,options)
76+ (P_sub,TD_OP,set_Prop) = setup_constraints(constraint,comp_grid,options. FL);
77+ (TD_OP,AtA,l,y) = PARSDMM_precompute_distribute(TD_OP,set_Prop,comp_grid,options);
7878
7979println(" " )
8080println(" PARSDMM serial (bounds and bounds on D_z):" )
@@ -103,14 +103,17 @@ tight_layout()
103103# tight_layout(pad=0.0, w_pad=0.0, h_pad=1.0)
104104savefig(" PARSDMM_logs.png" ,bbox_inches= " tight" )
105105
106+ # print timings in terminal
107+ log_PARSDMM. timing
108+
106109println(" " )
107110println(" PARSDMM parallel (bounds and bounds on D_z):" )
108111options. parallel = true
109- (P_sub,TD_OP,set_Prop) = setup_constraints(constraint,comp_grid,options. FL)
110- (TD_OP,AtA,l,y) = PARSDMM_precompute_distribute(TD_OP,set_Prop,comp_grid,options)
112+ (P_sub,TD_OP,set_Prop) = setup_constraints(constraint,comp_grid,options. FL);
113+ (TD_OP,AtA,l,y) = PARSDMM_precompute_distribute(TD_OP,set_Prop,comp_grid,options);
111114
112115@time (x2,log_PARSDMM) = PARSDMM(m,AtA,TD_OP,set_Prop,P_sub,comp_grid,options);
113- # @time (x ,log_PARSDMM) = PARSDMM(m,AtA,TD_OP,set_Prop,P_sub,comp_grid,options);
116+ @time (x2 ,log_PARSDMM) = PARSDMM(m,AtA,TD_OP,set_Prop,P_sub,comp_grid,options);
114117# @time (x,log_PARSDMM) = PARSDMM(m,AtA,TD_OP,set_Prop,P_sub,comp_grid,options);
115118
116119# plot
@@ -119,6 +122,9 @@ subplot(2,1,1);imshow(permutedims(reshape(m,(comp_grid.n[1],comp_grid.n[2])),[2,
119122subplot(2 ,1 ,2 );imshow(permutedims(reshape(x2,(comp_grid. n[1 ],comp_grid. n[2 ])),[2 ,1 ]),cmap= " jet" ,vmin= vmi,vmax= vma,extent= [0 , xmax, zmax, 0 ]); title(" Projection (bounds and bounds on D_z)" )
120123savefig(" projected_model_ParallelPARSDMM.png" ,bbox_inches= " tight" )
121124
125+ # print timings in terminal
126+ log_PARSDMM. timing
127+
122128# #use multilevel-serial (2-levels)
123129# options.parallel = false
124130
0 commit comments