Files
secondo/bin/Scripts/testDistAlgA.sec
2026-01-23 17:03:45 +08:00

114 lines
2.9 KiB
Plaintext

# Test file for Distributed Algebra 2
# next 2 lines to be adapted
restore WORKERS from Workers12
let NSlots = 40
##################################################################
# 6.1 Random Partitioning
let RoadsB1 = Roads feed dfdistribute3["RoadsB1", NSlots, TRUE, WORKERS]
##################################################################
# 6.2 Hash Partitioning
let RoadsB2 = Roads feed ddistribute4["RoadsB2", hashvalue(.Osm_id, 999997), NSlots, WORKERS]
##################################################################
# 6.3 Range Partitioning
query Roads feed filter[isdefined(.Name)] count
let S = Roads feed filter[isdefined(.Name)] nth[119, FALSE]
project[Name] sortby[Name] consume
let Boundaries = S feedproject[Name] nth[100, TRUE]
addcounter[D, 1] project[Name, D] consume
query Boundaries inserttuple['', 0] consume
query memclear()
# query Boundaries feed letmconsume["Boundaries"] mcreateAVLtree[Name]
let BoundariesM = Boundaries feed mconsume
let BoundariesM_Name = BoundariesM mcreateAVLtree[Name]
let RoadsB3 = Roads feed filter[isdefined(.Name)]
ddistribute4["RoadsB3", BoundariesM_Name BoundariesM
matchbelow[.Name] extract[D], NSlots, WORKERS]
# Creating the full sorted order
let RoadsB3S = RoadsB3 dmap["RoadsB3S", . feed sortby[Name]]
##################################################################
# 6.4 Spatial Partitioning
query
Buildings feed projectextend[; Box: bbox(.GeoData)]
Landuse feed projectextend[; Box: bbox(.GeoData)] concat
Natural feed projectextend[; Box: bbox(.GeoData)] concat
Places feed projectextend[; Box: bbox(.GeoData)] concat
Points feed projectextend[; Box: bbox(.GeoData)] concat
Railways feed projectextend[; Box: bbox(.GeoData)] concat
Roads feed projectextend[; Box: bbox(.GeoData)] concat
Waterways feed projectextend[; Box: bbox(.GeoData)] concat
transformstream collect_box[TRUE]
let grid = [const cellgrid2d value (5.8 50.1 0.2 0.2 20)]
let RoadsB4 = Roads feed
extendstream[Cell: cellnumber(bbox(.GeoData), grid)]
dfdistribute2["RoadsB4", Cell, NSlots, WORKERS]
# let BuildingsB4 = Buildings feed
# extend[EnlargedBox: enlargeRect(bbox(.GeoData), 0.01, 0.01)]
# extendstream[Cell: cellnumber(.EnlargedBox, grid)]
# extend[Original: .Cell = cellnumber(.EnlargedBox, grid)
# transformstream extract[Elem] ]
# ddistribute2["BuildingsB4", Cell, NSlots, WORKERS]
let BuildingsB1 = Buildings feed dfdistribute3["BuildingsB1", NSlots, TRUE, WORKERS]
query share("grid", TRUE, WORKERS)
let BuildingsB4 = BuildingsB1 partitionF["",
. feed extend[EnlargedBox: enlargeRect(bbox(.GeoData), 0.01, 0.01)]
extendstream[Cell: cellnumber(.EnlargedBox, grid)]
extend[Original: .Cell = cellnumber(.EnlargedBox, grid)
transformstream extract[Elem] ],
..Cell, 0]
collect2["BuildingsB4a", 1238]
##################################################################
# 6.5 Replication
query share("Roads", FALSE, WORKERS)