Opened 5 years ago

Closed 4 years ago

#42 closed defect (fixed)

Result of foldAllP isn't forced.

Reported by: benl Owned by:
Priority: normal Milestone:
Component: library Version: 3.2.2
Keywords: Cc:

Description

Report from Chris Reade:

That is why I expected this code to work without the explicit seq , but these are needed to avoid the "Performing nested parallel computation sequentially" problem.

writeHeatMapBMP :: String 
                -> Array U DIM2 Double
                -> IO()
writeHeatMapBMP filename arr
  = do maxVal <- foldAllP max 0.0 arr
       minVal <- foldAllP min 0.0 arr
       arrImageOut <- minVal `seq` maxVal `seq`
                      computeP
                      $  R.map rgb8OfDouble
                      $  R.map (rampColorHotToCold minVal maxVal) arr
       writeImageToBMP filename arrImageOut

The implementation of foldAllP should ensure that the result is evaluated before it returns.

Change History (1)

comment:1 Changed 4 years ago by benl

  • Milestone 4.0.0 deleted
  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.