<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
Hi there,<br>&nbsp;<br>I was not able to parallelize the below code by "parListChunk" <br>strategy. Actually, code works fine without ant mistake in the<br>result but no improvement in the performance handled.<br><br>Threadscope demonstrates that parallelization happens after <br>the sequential run of the program which is meaningless. In short,<br>parListChunk is not working as intended. As far as I know, it should<br>divide an arbitrarily given list into its chunks and then apply the given <br>function to each sub-list (chunk) in parallel with reducing the evaluation <br>of each element of each chunk into head normal form, if you use <br>"rdeepseq" as the input strategy. <br><br>In the below code, I want to divide the given list into 2000 chunks and then<br>apply "ersa" function to each chunk in parallel with evaluating each element<br>into its head normal form in serial internally. However, as I wrote, it first runs <br>in serial after than the parallel scenario I admire to happen at the beginning<br>happens.<br><br>How can I solve this problem?<br><br>Thanks in advance,<br>Burak.<br><br><font style="" color="#FF0000"><br></font><font style="" color="#FF0000">ersa :: RSAPublicKey -&gt; [Integer] -&gt; [Integer]</font><font style="" color="#FF0000"><br></font><font style="" color="#FF0000">ersa (PUB n e) (x:xs) = ersa (PUB n e) (xs) ++ [expm n x e]</font><font style="" color="#FF0000"><br></font><font style="" color="#FF0000">ersa (PUB n e) []&nbsp;&nbsp;&nbsp;&nbsp; = []</font><font style="" color="#FF0000"><br></font><font style="" color="#FF0000">&nbsp;</font><font style="" color="#FF0000"><br></font><font style="" color="#FF0000">splitToEnc :: RSAPublicKey -&gt; [Integer] -&gt; [Integer]</font><font style="" color="#FF0000"><br></font><font style="" color="#FF0000">splitToEnc (PUB n e) []&nbsp;&nbsp;&nbsp;&nbsp; = []</font><font style="" color="#FF0000"><br></font><font style="" color="#FF0000">splitToEnc (PUB n e) (x:xs) =&nbsp; (ersa (PUB n e) (x:xs)) `using` parListChunk 2000 rdeepseq</font><br>                                               </div></body>
</html>