[Haskell-cafe] Find out which part of code are causing parallelism?

Vanessa McHale vanessa.mchale at iohk.io
Fri Dec 28 10:11:50 UTC 2018


Does threadscope help? It should be of some use since it is designed for
debugging parallel programs.

Cheers,
Vanessa

On 12/28/18 2:19 AM, ducis wrote:
> Hi all,
>
> I am working on parallelising some program, however I just found out
> that without inserting any parallism manually
> the program is already parallelised, presumably by some of the
> libraries referenced, as long as I enable -threaded
> and +RTS -N8.
>
> Unfortunately this parallism are actually slowing down my program,
> probably due to being of too fine granularity.
> For example, with +RTS -N8 I have   
> 47.03user 38.06system 0:21.68elapsed 392%CPU
> While with +RTS -N1 I have
> 16.57user 0.45system 0:17.02elapsed 100%CPU
>
> In .prof file I can't find whether a function fired a spark or how
> much 'system' time a function used.
> Nor can I find any names of functions/modules browsing through
> eventlog with ghc-events.
> Is there a way to find out which functions/modules are causing any
> parallelism at all?
>
> I am also trailing the post with the imports I used in case anyone
> immediately recognises parallelism by default in the package.
> import Control.DeepSeq
> import GHC.Generics (Generic, Generic1)
> import
> Text.Parsec                                                                        
>
> import
> Data.List                                                                          
>
> import Data.Vector.Unboxed(fromList,
> (!))                                                 
> import qualified Data.Vector as
> V                                                         
> import qualified Data.Map as
> M                                                            
> import qualified Data.Set as
> S                                                            
> import
> Data.Char                                                                          
>
> import
> Control.Applicative((*>),(<*))                                                     
>
> import
> Test.QuickCheck.Monadic                                                            
>
> import
> Test.QuickCheck                                                                    
>
> import
> Control.Monad                                                                      
>
> import Text.Regex                                                  
> import Control.Applicative ((<$>), (<$), (<|>))       
> import GHC.Read (readLitChar)                         
> import Data.Char(isPrint)                             
> import
> Text.ParserCombinators.ReadP                                            
> import
> Text.Show.Pretty                                                                   
>
> import
> Data.Functor                                                                       
>
> import
> Data.Maybe                                                                         
>
> import System.Environment(getArgs)
> import
> Text.Read(readMaybe)                                                               
>
> import
> Text.Printf                                                                               
>
> import
> Data.Dynamic                                                                       
>
> import
> Debug.Trace                                                                        
>
> import
> Data.Ratio                                                                           
>
> import qualified Data.DList as
> D                                                          
> import
> Control.Monad.Trans.Writer.Strict                                                             
>
> import
> Control.Monad.Trans.Class                                                          
>
> import
> Data.Typeable(Typeable)                                                            
>
> import qualified Data.HashMap.Lazy as
> H                                              
>
> Best,
> ducis    
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20181228/a846fcdd/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20181228/a846fcdd/attachment.sig>


More information about the Haskell-Cafe mailing list