charts - F# Live Charting Parallel -
charts - F# Live Charting Parallel -
i learning utilize f# live charting , having difficulty making code go parallel.
i have code wrote help examples google searches.
module livechartdata = allow sampleddata (tuple) (t:int) = allow name = tuple |> fst allow stat = tuple |> snd allow x = [for in all.getcolumn<float>((name,stat)).keys -> i.toshortdatestring()] allow y = all.getcolumn<float>((name,stat)) |> series.fillmissingwith 0. |> series.values allow obs = seq { in (seq.zip x y) thread.sleep t yield (i) } |> seq.cache |> seq.observe "" + name + "-" + stat + "",obs allow datasort (id:string) = allow name = all.columnkeys |> seq.map fst |> seq.distinct |> seq.tolist allow stat = all.columnkeys |> seq.map snd |> seq.distinct |> seq.tolist [|for in name j in stat -> (i,j)|] |> array.filter (fun -> (i |> snd) = id) allow prepdata (stats:string) = [|for in (datasort stats) -> i|] |> array.map (fun -> allow info = livechartdata.sampleddata 200 livechart.fastlineincremental(data |> snd,data |> fst)) |> chart.combine allow charting_s= [|for in ["col1"; "col2";"col3";"col4"; "col5"] -> i|] |> array.map (fun -> prepdata i) |> chart.rows
when alter array.map array.parallel.map next error.
system.invalidoperationexception: chart area axes - minimum , maximum axis values have not been specified.
also got
system.invalidoperationexception: collection modified; enumeration operation may not execute.
trying create other parts parallel other errors too. seems problem arises when feeding info livechart.fastlineincremental in parallel. think code benefit sort of async process dont know how incorporate this.
any help appreciated.
this code works fine is, want utilize cores.
try moving array.parallel.map 1 level creating info in parallel, , creating chart lines on same thread.
something this:
let prepdata (stats:string) = [|for in (datasort stats) -> i|] |> array.parallel.map (fun -> livechartdata.sampledata 200) |> array.map (fun info -> livechart.fastlineincremental(data |> snd, info |> fst))
charts parallel-processing f# deedle
Comments
Post a Comment