<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel rdf:about="https://community.wolfram.com">
    <title>Community RSS Feed</title>
    <link>https://community.wolfram.com</link>
    <description>RSS Feed for Wolfram Community showing questions tagged with Tuning and Debugging with no replies sorted by most viewed.</description>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/245858" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/428854" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1008706" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/428815" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/488594" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/376972" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/909649" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/997434" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/977819" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/485513" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2305316" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1241974" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/199314" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/827004" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/381593" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1761974" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1861910" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2171196" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/846592" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/948518" />
      </rdf:Seq>
    </items>
  </channel>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/245858">
    <title>CellularAutomaton function speed</title>
    <link>https://community.wolfram.com/groups/-/m/t/245858</link>
    <description>has anyone done a speed comparion of Gosper&amp;#039;s Golly program/app (http://golly.sourceforge.net) and the CellularAutomaton function? it would be interesting because e.g. the Game of Life program implemented in CellularAutomaton function (http://www.wolfram.com/language/gallery/implement-conways-game-of-life/) is very fast - much faster than the 3 versions i wrote in the final section of my turorial notes set (http://library.wolfram.com/infocenter/MathSource/5216)/) which surprised me becuase in one of those programs i made direct use of all of the 512 update rules which i expectedd to be quite fast since it directly uses the rule-based, pattern-matching nature of WL). if anyone knows of, or can do, a speed omparision, i&amp;#039;d like to know the results (you&amp;#039;ll need to look at the effect of both the grid size and  the number of time steps  - and possibly the initial number of empty (i.e. dead) sites as well - because the relative speed of execution of the various programs can change as a function of these parameter values.. </description>
    <dc:creator>Richard Gaylord</dc:creator>
    <dc:date>2014-05-01T15:25:59Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/428854">
    <title>Speeding up  a simulation</title>
    <link>https://community.wolfram.com/groups/-/m/t/428854</link>
    <description>Hi All,&#xD;
&#xD;
   I have tried my best to speed up the simulation below. Could it be made more time efficient ?  Please ignore the LV function for now.&#xD;
&#xD;
        &#xD;
    TFinal = 0.5;&#xD;
    NN = 10;&#xD;
    r = 0;&#xD;
    dt = TFinal/NN;&#xD;
    (*Initial Stock*)&#xD;
    (*All the parameters should be easily extractable from the files \&#xD;
    available*)&#xD;
    S0 = 1;&#xD;
    &#xD;
    Num = 100000;&#xD;
    &#xD;
    (**)&#xD;
    &#xD;
    Tmin = 0.01;&#xD;
    T = Tmin;&#xD;
    LV = Compile[{{x, _Real}}, 0.8];&#xD;
    (******************)&#xD;
    &#xD;
    &#xD;
    &#xD;
    ParallelEvaluate[Off[InterpolatingFunction::dmval]];&#xD;
    &#xD;
    (*Initial Simulation Block*)&#xD;
    SimPathsLV = Transpose[Reap[&#xD;
          Sow[ParallelTable[S0, {Num}]];&#xD;
          Sow[&#xD;
           SamplePaths2 = &#xD;
            ParallelTable[&#xD;
             Nest[(a = RandomVariate[NormalDistribution[0, 1]]; #*&#xD;
                 Exp[((r - 0.5*(LV[#])^2)*dt + (LV[#])*Sqrt[dt]*a)]) &amp;amp;, &#xD;
              S0, 1], {Num}]];&#xD;
          For[k = 0, T &amp;lt; TFinal, k++,&#xD;
           T = T + dt;&#xD;
           Sow[&#xD;
            SamplePaths2 = &#xD;
             ParallelTable[&#xD;
              Nest[(a = RandomVariate[NormalDistribution[0, 1]]; #*&#xD;
                  Exp[((r - 0.5*(LV[#])^2)*dt + (LV[#])*Sqrt[dt]*a)]) &amp;amp;, &#xD;
               SamplePaths2[[i]], 1], {i, 1, Num}]]&#xD;
           (*Appending out iteration of the simulation*)&#xD;
           ]][[2, 1]]] // Timing;&#xD;
    &#xD;
    SimPathsLV[[1]]</description>
    <dc:creator>Nabeel Butt</dc:creator>
    <dc:date>2015-01-26T19:53:49Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1008706">
    <title>Convert Crandall&amp;#039;s Mma MRB Constant code to C, C++ or Turbo C++</title>
    <link>https://community.wolfram.com/groups/-/m/t/1008706</link>
    <description>The late Richard Crandall worked to develop the following robust Mathematica code for calculating many digits of the MRB constant.&#xD;
Just before he died he did something with it to increase it&amp;#039;s speed many fold! as seen in [Try to Beat these MRB Constant Records!][1] .  After much consideration I decided he converted it to a low level language like  C, C++ or Turbo C++. Unfortunately he died before he could share it with enough people.&#xD;
Can anyone here translate the code into one or more of those languages for the world?&#xD;
&#xD;
It has two flavors: first plain and then multi threaded.&#xD;
&#xD;
First:&#xD;
&#xD;
    (*Newer loop with Newton interior.*)prec = 5000;(*Number of required \&#xD;
    decimals.*)expM[pr_] := Module[{a, d, s, k, b, c}, n = Floor[1.32 pr];&#xD;
      Print[&amp;#034;Iterations required: &amp;#034;, n];&#xD;
      d = N[(3 + Sqrt[8])^n, pr + 10];&#xD;
      d = Round[1/2 (d + 1/d)];&#xD;
      {b, c, s} = {-1, -d, 0};&#xD;
      T0 = SessionTime[];&#xD;
      Do[c = b - c;&#xD;
       x = N[E^(Log[k + 1]/(k + 1)), iprec = Ceiling[prec/128]];&#xD;
       pc = iprec;&#xD;
       Do[nprec = Min[2 pc, pr];&#xD;
        x = SetPrecision[x, nprec];(*Adjust precision*)&#xD;
        x = N[x - x/(k + 1) + 1/x^k, nprec];&#xD;
        pc *= 2;&#xD;
        If[nprec &amp;gt;= pr, Break[]], {ct, 1, 19}];&#xD;
       s += c*(x - 1);&#xD;
       b *= 2 (k + n) (k - n)/((k + 1) (2 k + 1));&#xD;
       If[Mod[k, 1000] == 0, &#xD;
        Print[&amp;#034;Iterations: &amp;#034;, k, &amp;#034;    Cumulative time (sec): &amp;#034;, &#xD;
          SessionTime[] - T0];], {k, 0, n - 1}];&#xD;
      N[-s/d, pr]];&#xD;
    &#xD;
    MRBtest2 = expM[prec]&#xD;
&#xD;
Then for the adventures,&#xD;
&#xD;
    (*Fastest (at RC&amp;#039;s end) as of 30 Nov 2012.*)prec = 500000;(*Number of \&#xD;
    required decimals.*)ClearSystemCache[];&#xD;
    T0 = SessionTime[];&#xD;
    expM[pre_] := &#xD;
      Module[{a, d, s, k, bb, c, n, end, iprec, xvals, x, pc, cores = 4, &#xD;
        tsize = 2^7, chunksize, start = 1, ll, ctab, &#xD;
        pr = Floor[1.02 pre]}, chunksize = cores*tsize;&#xD;
       n = Floor[1.32 pr];&#xD;
       end = Ceiling[n/chunksize];&#xD;
       Print[&amp;#034;Iterations required: &amp;#034;, n];&#xD;
       Print[&amp;#034;end &amp;#034;, end];&#xD;
       Print[end*chunksize];&#xD;
       d = N[(3 + Sqrt[8])^n, pr + 10];&#xD;
       d = Round[1/2 (d + 1/d)];&#xD;
       {b, c, s} = {SetPrecision[-1, 1.1*n], -d, 0};&#xD;
       iprec = Ceiling[pr/27];&#xD;
       Do[xvals = Flatten[ParallelTable[Table[ll = start + j*tsize + l;&#xD;
            x = N[E^(Log[ll]/(ll)), iprec];&#xD;
            pc = iprec;&#xD;
            While[pc &amp;lt; pr, pc = Min[3 pc, pr];&#xD;
             x = SetPrecision[x, pc];&#xD;
             y = x^ll - ll;&#xD;
             x = x (1 - 2 y/((ll + 1) y + 2 ll ll));];(*N[Exp[Log[ll]/ll],&#xD;
            pr]*)x, {l, 0, tsize - 1}], {j, 0, cores - 1}, &#xD;
           Method -&amp;gt; &amp;#034;EvaluationsPerKernel&amp;#034; -&amp;gt; 1]];&#xD;
        ctab = Table[c = b - c;&#xD;
          ll = start + l - 2;&#xD;
          b *= 2 (ll + n) (ll - n)/((ll + 1) (2 ll + 1));&#xD;
          c, {l, chunksize}];&#xD;
        s += ctab.(xvals - 1);&#xD;
        start += chunksize;&#xD;
        Print[&amp;#034;done iter &amp;#034;, k*chunksize, &amp;#034; &amp;#034;, SessionTime[] - T0];, {k, 0,&#xD;
          end - 1}];&#xD;
       N[-s/d, pr]];&#xD;
    &#xD;
    t2 = Timing[MRBtest2 = expM[prec];];&#xD;
    MRBtest2 - MRBtest3&#xD;
&#xD;
MRBtest3 is any known decimal expansion of the MRB constant.&#xD;
You can use the above Mathematica code to calculate as many trial digits for MRBtest3 as you wish. I have absolute confidence that the code gives accurate results for anywhere from 5000 to 2,000,000 digits.&#xD;
&#xD;
As far as interpeting the code is concerned I noted that&#xD;
`x = N[E^(Log[ll]/(ll)), iprec];` Gives k^(1/k) to only 1 decimal place; they are either 1.0, 1.1, 1.2, 1.3 or 1.4 (usually 1.1 or 1.0).&#xD;
 On the other hand,&#xD;
&#xD;
    While[pc &amp;lt; pr, pc = Min[3 pc, pr];&#xD;
     x = SetPrecision[x, pc];&#xD;
     y = x^ll - ll;&#xD;
     x = x (1 - 2 y/((ll + 1) y + 2 ll ll));],&#xD;
&#xD;
takes the short precision x and gives it the necessary precision and accuracy for k^(1/k) (k Is ll there.) It actually computes k^(1/k). &#xD;
Then he remarks, &amp;#034;(N[Exp[Log[ll]/ll], pr]).&amp;#034;&#xD;
&#xD;
After finding a fast way to compute k^(1/k) to necessary precision he uses Cohen&amp;#039;s algorithm 1, found at [Henri Cohen, Fernando Rodriguez Villegas, and Don Zagier,s Convergence Acceleration of Alternating Series][2], to accelerate convergence of Sum[(-1)^k*(k^(1/k) - 1), {k, 1, Infinity}].&#xD;
&#xD;
Looking at Cohen&amp;#039;s paper:&#xD;
&#xD;
![enter image description here][3]&#xD;
![enter image description here][4]&#xD;
![enter image description here][5]&#xD;
&#xD;
we see the $a_n$&amp;#039;s are multiplied over the c&amp;#039;s. There Crandall craftily took advantage of Mathematica&amp;#039;s dot product advantages. &#xD;
&#xD;
So `s += ctab.(xvals - 1);`is in place of ![enter image description here][6].&#xD;
&#xD;
&#xD;
  [1]: http://community.wolfram.com/groups/-/m/t/366628?p_p_auth=rwE8taHU&#xD;
  [2]: http://people.mpim-bonn.mpg.de/zagier/files/exp-math-9/fulltext.pdf&#xD;
  [3]: http://community.wolfram.com//c/portal/getImageAttachment?filename=68211.JPG&amp;amp;userId=366611&#xD;
  [4]: http://community.wolfram.com//c/portal/getImageAttachment?filename=93142.JPG&amp;amp;userId=366611&#xD;
  [5]: http://community.wolfram.com//c/portal/getImageAttachment?filename=93013.JPG&amp;amp;userId=366611&#xD;
  [6]: http://community.wolfram.com//c/portal/getImageAttachment?filename=36464.JPG&amp;amp;userId=366611</description>
    <dc:creator>Marvin Ray Burns A.G.S. (cum laude)</dc:creator>
    <dc:date>2017-02-05T19:55:23Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/428815">
    <title>Speeding up Interpolated function computation?</title>
    <link>https://community.wolfram.com/groups/-/m/t/428815</link>
    <description>I am interested to know if there is a way I could speed up computation involving an interpolated function ( does the kernel generate an internally compiled code?) . Generally Compile works well for most types of problems not involving interpolation. In this case what is the suggested approach without using parallelization ?&#xD;
The relevant code is below:&#xD;
&#xD;
    fi = Interpolation[Table[{i, Sin[i]}, {i, 0, 1, 0.1}]];&#xD;
    a1 = Table[fi[0.35], {100000}] // Timing;&#xD;
    a2 = Table[Sin[0.35], {i, 1, 100000}] // Timing;&#xD;
    a1[[1]]&#xD;
    a2[[1]]</description>
    <dc:creator>Nabeel Butt</dc:creator>
    <dc:date>2015-01-26T18:54:55Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/488594">
    <title>Debug Source Lookup</title>
    <link>https://community.wolfram.com/groups/-/m/t/488594</link>
    <description>When I run the workbench in debug, I get the following error.  &#xD;
&#xD;
&amp;#034;An internal error occurred during: &amp;#034;Debug Source Lookup&amp;#034;.&#xD;
Path must include project and resource name: /ball3.m&amp;#034;&#xD;
&#xD;
I&amp;#039;ve spent hours trying to figure this one out.  The workbench will not debug any code.</description>
    <dc:creator>Thomas Dobroth</dc:creator>
    <dc:date>2015-04-29T17:22:54Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/376972">
    <title>Speeding up plot for numerical optimization</title>
    <link>https://community.wolfram.com/groups/-/m/t/376972</link>
    <description>Hi,&#xD;
&#xD;
I am sorry that if this does not have a short piece of code, trying to explain what I want to achieve. But I will try to explain in words as straight forward as possible.&#xD;
&#xD;
First of all, if you run the two files I have written, one with all the functions I have written (main_func.m) and one with all the data (data.m).&#xD;
The syntax goes like this&#xD;
&#xD;
    Import[&amp;#034;data.m&amp;#034;];&#xD;
    Import[&amp;#034;main_func.m&amp;#034;];&#xD;
    closepop[B1997,kB1997,&amp;#034;LNB&amp;#034;]&#xD;
    closepop[B1998,kB1998,&amp;#034;LNB&amp;#034;]&#xD;
    closepop[B1999,kB1999,&amp;#034;LNB&amp;#034;]&#xD;
    closepop[housemice,khousemice,&amp;#034;LNB&amp;#034;]&#xD;
&#xD;
The first three inputs are required, with the first two from data.m, and third one is one of the following,&#xD;
&amp;#034;Bin&amp;#034;,&amp;#034;TwoBin&amp;#034;,&amp;#034;BetaBin&amp;#034;,&amp;#034;BBB&amp;#034;,&amp;#034;LNB&amp;#034;,&amp;#034;BinLNB&amp;#034; or &amp;#034;LogGamma&amp;#034;.&#xD;
They are different models, I aim to fit to the data.&#xD;
&#xD;
For most of the datasets, the model &amp;#034;Bin&amp;#034;,&amp;#034;TwoBin&amp;#034;,&amp;#034;BetaBin&amp;#034; runs fine.&#xD;
See res_Bin.pdf for example, this is really a simple model, the output looks fine for all datasets.&#xD;
It also runs &amp;#034;reasonably&amp;#034; fast, just under 20 mintues to finish the whole file.&#xD;
&#xD;
The main problem is that for other models, it runs really really slow. &#xD;
I hope to make it more efficient, and faster if possible.&#xD;
&#xD;
&#xD;
The bit that is slowing it down, which I think is the &amp;#034;plot&amp;#034;.&#xD;
The points are obtained by calculating 20 points (from line 439 in main_func.pdf). That is, only 20 optimization is done, to plot the graph.&#xD;
&#xD;
The function PIfun[] is used to calculate the plot, but it depends on the optimization, which is really really time consuming.&#xD;
The final plot (what&amp;#039;s really plotted) just adds some constant to the graph, see line 521-539.&#xD;
&#xD;
Another problem with the code is, &#xD;
![enter image description here][1]&#xD;
&#xD;
This was produced by &#xD;
&#xD;
    closepop[voles2,kvoles2,&amp;#034;BBB&amp;#034;,0,20]&#xD;
&#xD;
The last two values sets the range to plot the graph. I am expecting some kind of concave smooth curve, but because I used only 20ish points to plot the graph, it seems that the optimization was not very good at some of the points, even with 200 random points (which was set for NMaximize in the method of &amp;#034;RandomSearch&amp;#034;).&#xD;
&#xD;
&#xD;
I am really new to mathemtica. So if you have the time, please have a look, and help me improve my code to run faster.&#xD;
&#xD;
Thanks!&#xD;
&#xD;
&#xD;
  [1]: /c/portal/getImageAttachment?filename=voles2--BBB.jpg&amp;amp;userId=223692</description>
    <dc:creator>Casper YC</dc:creator>
    <dc:date>2014-10-26T16:53:12Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/909649">
    <title>How faster is native C-code in comparison to C-code in Mathematica?</title>
    <link>https://community.wolfram.com/groups/-/m/t/909649</link>
    <description>I successfully compiled a function to C-code in Mathematica. As a consequence, it became almost 3 times faster than the normal compiled code. So I wonder if it is worth to write the function directly in C and to compile it with VisualStudio. Will this still boost the speed? It should increase about 10 times otherwise it is not worth as I can parallelize it in Mathematica, while in VisualStudio I don&amp;#039;t know how to parallelize.</description>
    <dc:creator>Ulrich Utiger</dc:creator>
    <dc:date>2016-08-20T15:55:17Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/997434">
    <title>Avoid problem with GeoLabels on Mathematica v11?</title>
    <link>https://community.wolfram.com/groups/-/m/t/997434</link>
    <description>Hello,&#xD;
&#xD;
is anyone facing similar bug while using GeoLabels?&#xD;
&#xD;
    $Version&#xD;
    11.0.1 for Mac OS X x86 (64-bit) (September 21, 2016)&#xD;
&#xD;
![GeoLabels Bug][1]&#xD;
&#xD;
&#xD;
  [1]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-01-18at2.21.47AM.png&amp;amp;userId=791995</description>
    <dc:creator>Manjunath Babu</dc:creator>
    <dc:date>2017-01-18T07:24:01Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/977819">
    <title>Handle and report errors in Mathematica?</title>
    <link>https://community.wolfram.com/groups/-/m/t/977819</link>
    <description>I would like to start a discussion on how to best handle errors in Mathematica.&#xD;
&#xD;
You are writing a package that many people will use. They may use your functions interactively, or they may use them inside larger functions they define.  There is an error condition in your functionincorrect input, can&amp;#039;t solve the problem, unexpected failure, etc.  What should your function do?&#xD;
&#xD;
There is already a great post by Leonid about this here:&#xD;
&#xD;
 * http://mathematica.stackexchange.com/a/29323/12&#xD;
&#xD;
I thought it was time to revisit the topic and share some thoughts about how each of us typically handles errors.&#xD;
&#xD;
To get the discussion started, here are some things to think about:&#xD;
&#xD;
 - The error should be communicated in a user-friendly manner to interactive users&#xD;
 - There should be an easy way to catch and handle the error programmatically&#xD;
 - It should be easy to track down where the error occurred in a large code block (e.g. function `X` should associate its messages with `X`)&#xD;
&#xD;
Typical ways used by builtins:&#xD;
&#xD;
 - Issue a message and stay unevaluated (e.g. `Integral`) (not friendly to programmatic error handling)&#xD;
 - Return `$Failed`, with or without an accompanying message&#xD;
 - Return `Failure[...]` (e.g. `Interpreter`)&#xD;
 - `Throw` something (not friendly to interactive users)&#xD;
 - Some functions are designed in such a way as to never error out, e.g. most `Q` functions, like `OddQ`, will always return `True` or `False` and just return `False` for input that one might consider inappropriate.&#xD;
&#xD;
There are multiple challenges to implementing each, as well as handling each type of error.</description>
    <dc:creator>Szabolcs Horvát</dc:creator>
    <dc:date>2016-12-10T17:59:32Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/485513">
    <title>Does mma debugger in v10 work for others?</title>
    <link>https://community.wolfram.com/groups/-/m/t/485513</link>
    <description>The debugger from mma version 10.0 to 10.1.0 is broken for me. I have Windows 8.1 64-bit. When I step through a function using the debugger then the function is run several times. This problem didn&amp;#039;t happen in previous mma versions. For example:&#xD;
&#xD;
    f[]:=Module[{},&#xD;
    x=1;&#xD;
    i++;&#xD;
    x=2;];&#xD;
&#xD;
If I then run&#xD;
&#xD;
    i=0;&#xD;
    f[];&#xD;
    i&#xD;
&#xD;
I get 1.&#xD;
&#xD;
But if I turn on the debugger, and put a breakpoint at line x=1, and then continue after the debugger stops, my result is 2. And if I step through the function, my result is 5. This means the function f is run 5 times, just by me stepping through the function once using the debugger!&#xD;
&#xD;
Does anyone else have this problem? Is it just Windows, or windows 64 bit versions of mma? Is there a known way to avoid this problem?</description>
    <dc:creator>Vilis Nams</dc:creator>
    <dc:date>2015-04-24T00:33:13Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2305316">
    <title>Shared-memory parallelism with large data</title>
    <link>https://community.wolfram.com/groups/-/m/t/2305316</link>
    <description>I was hoping to seek the advise of others that may have tackled (or been tackled by) the problem of having a large dataset to query in Mathematica.&#xD;
&#xD;
My situation is that I have a large association (ByteCount 100Gb constructed from sequences in the human genome) that I am using as a hash table because the performance combination of Lookup with Associations is spectacular.  Even with the amazing performance mentioned, I still expect the querying of the association to be a bottleneck because of the number of queries to the association that is needed to process multiple datasets of experimental data.&#xD;
&#xD;
My experience with ParallelTable and friends in Mathematica is that you get the best performance benefit if you are transmitting very little data back and forth between kernels.  If this condition is not met, then the performance of parallel constructs is often worse that their equivalent serial peers.&#xD;
&#xD;
Questions that come to mind:&#xD;
&#xD;
A. Is there any known way of use parallel constructs to query an association that avoids the need for each parallel kernel to have it&amp;#039;s own copy of the association?  (I am looking for concurrent hash table functionality in Mathematica.)&#xD;
&#xD;
B. Since I suspect the answer to Question A is &amp;#034;no&amp;#034;, does anyone know if the good folks at Wolfram are working to improve the capabilities / performance of parallel functionality in Mathematica?  I am not looking for deep insider secrets, but it does seem that attention to this functionality had waned as documentation reveals the last revision for many parallel commands was in 2010.&#xD;
&#xD;
C. Has anyone used an external concurrent hash table in their own projects that they linked back into Mathematica?  Would you be willing to share your experience?&#xD;
&#xD;
I appreciate your thoughts and advice.&#xD;
&#xD;
Todd</description>
    <dc:creator>Todd Allen</dc:creator>
    <dc:date>2021-07-04T21:18:10Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1241974">
    <title>Bug with Block &amp;amp; Lookup: Scope Variable Leak.</title>
    <link>https://community.wolfram.com/groups/-/m/t/1241974</link>
    <description>After debugging a large chunk of code, I could identify this [MWE](https://en.wikipedia.org/wiki/Minimal_Working_Example).&#xD;
&#xD;
    ClearAll@test&#xD;
    test[var_String]:= Block[{association},&#xD;
        association = &amp;lt;|&amp;#034;x&amp;#034;-&amp;gt; &amp;lt;|&amp;#034;key01&amp;#034;-&amp;gt; &amp;#034;ok&amp;#034;|&amp;gt;|&amp;gt;[var];&#xD;
        Lookup[association,&amp;#034;key01&amp;#034;,{}]&#xD;
    ]&#xD;
&#xD;
If I evaluate:&#xD;
&#xD;
    test[&amp;#034;x&amp;#034;]&#xD;
    test[&amp;#034;y&amp;#034;]&#xD;
    test[&amp;#034;x&amp;#034;]&#xD;
&#xD;
I get an error evaluating the last `test[&amp;#034;x&amp;#034;]`. What is very strange, I expected to find an error just in the evaluation of `test[&amp;#034;y&amp;#034;]`.&#xD;
&#xD;
The same error does not occur if we change from Block to Module. In the Block case, we have some sort of unexpected scope leak.&#xD;
Looks like a bug in `Lookup`.&#xD;
&#xD;
Tested in Mathematica version 11.3  &#xD;
[Cross post](https://mathematica.stackexchange.com/questions/161616) in Stack Exchange</description>
    <dc:creator>Rodrigo Murta</dc:creator>
    <dc:date>2017-12-08T21:32:33Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/199314">
    <title>How can BetweennessCentrality be generalized?</title>
    <link>https://community.wolfram.com/groups/-/m/t/199314</link>
    <description>Hi.
I am using the BetweennessCentrality function and I want to see it if is possible to weight the nodes in some form. For example, if nodes are warehouses and not all of them have the same size, then I might want to calculate the importance of a node by a combination of the &amp;#034;betweenness&amp;#034; and the size of the source and the destination in the form of a weighted sum instead of a simple sum.
The following code is very very veeeeery slow and memory intensive (my graph has 3000 vertices and 9000 edges) and the original BetweennessCentrality function takes around 2 seconds. So if anyone can help me I would really appreciate it.
[mcode]Do[(
sp = FindShortestPath[graf, node];
   If[(shortpath = sp[#]; Length &amp;gt; 2), occurrences[[shortpath[[2 ;; -2]]]] = 
         occurrences[[shortpath[[2 ;; -2]]]] + warehousesize[[node]]]&amp;amp;/@Range[n]
), {node, n}][/mcode]
Thanks

Fernando</description>
    <dc:creator>Fernando Perez</dc:creator>
    <dc:date>2014-02-12T03:20:59Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/827004">
    <title>Splice has been superseded by FileTemplate</title>
    <link>https://community.wolfram.com/groups/-/m/t/827004</link>
    <description>I have read  since Version 10.0 (released in 2014), Splice has been superseded by FileTemplate.&#xD;
[Splice Doumentation][1].&#xD;
I used splice to create C-functions in easy way by calling Mathematica functions.&#xD;
I have taken the next example from  [CForm Documentation][2]:&#xD;
&#xD;
    ifile = FileNameJoin[{&amp;#034;ExampleData&amp;#034;, &amp;#034;splicefile.mc&amp;#034;}];&#xD;
    FilePrint[ifile]&#xD;
    &#xD;
    #include &amp;#034;mdefs.h&amp;#034;&#xD;
    double f(double x)&#xD;
    {&#xD;
    double y;&#xD;
    y=&amp;lt;*Integrate[Sin[x]^5.x]*&amp;gt;&#xD;
    return(2*y-1);&#xD;
    }&#xD;
&#xD;
    ofile = FileNameJoin[{$TemporaryDirectory, &amp;#034;spliceoutput.c&amp;#034;}];&#xD;
    Splice[ifile, ofile]&#xD;
    FilePrint[ofile]&#xD;
&#xD;
    #include &amp;#034;mdefs.h&amp;#034;&#xD;
    double f(double x)&#xD;
    {&#xD;
    double y;&#xD;
    y=(-5+Cos(x)/8. + (5+Cos(3*x)/48.- Cos(5+x)/80;&#xD;
    return(2*y-1);&#xD;
    }&#xD;
&#xD;
How can I use &amp;#034;Filetemplate&amp;#034; to do the same?&#xD;
&#xD;
&#xD;
  [1]: https://reference.wolfram.com/language/ref/Splice.html&#xD;
  [2]: https://reference.wolfram.com/language/ref/CForm.html</description>
    <dc:creator>Mikel Antoñana</dc:creator>
    <dc:date>2016-03-21T10:06:47Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/381593">
    <title>Has anyone experienced a package file showing up blank in the editor?</title>
    <link>https://community.wolfram.com/groups/-/m/t/381593</link>
    <description>I copied a .m package file that I wrote on a Windows machine to my Mac running OSX 10.9. I can see the contents in a text editor and I can load it into a notebook and the functions run correctly. But if I attempt to open the file in the Mathematica editor the file shows up as blank. Has anyone else had this problem and, if so, how can I fix it? I can include the file if it will help.&#xD;
&#xD;
Edit: Additional information&#xD;
&#xD;
I initially transferred the file by mailing it from the Windows machine to the Mac. Today I decided to transfer it again using a thumb drive and this time the file contents show up in the editor so the problem is solved. But if anyone has an idea as to what caused the file to show blank in the editor I would be interested in the answer.</description>
    <dc:creator>Mike Luntz</dc:creator>
    <dc:date>2014-11-01T00:57:07Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1761974">
    <title>Update neural network package in Mathematica?</title>
    <link>https://community.wolfram.com/groups/-/m/t/1761974</link>
    <description>When running Predict with the method being NeuralNetwork, Mathematica starts an update procedure that attempts to update the neural network package. However, the installation failed while encountering the following errors:&#xD;
&#xD;
    PacletManager`CreatePaclet::badppi: The paclet     &#xD;
    C:\Users\Jerry\AppData\Roaming\WolframDesktop\Paclets\Temporary\MXNetLink2- &#xD;
    12.0.25696873.paclet does not have a properly formatted PacletInfo.m or PacletInfo.wl file. You &#xD;
     can use the VerifyPaclet function to get more detailed information about the error.&#xD;
&#xD;
    PacletManager`PacletInstall::instl: An error occurred installing paclet from file &#xD;
    C:\Users\Jerry\AppData\Roaming\WolframDesktop\Paclets\Temporary\MXNetLink2- &#xD;
    12.0.25696873.paclet: Not a valid paclet. &#xD;
&#xD;
 Can anyone make sense of what&amp;#039;s going on?</description>
    <dc:creator>Bohan Lu</dc:creator>
    <dc:date>2019-08-13T10:43:34Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1861910">
    <title>Right syntax to launch multiple kernels on a SLURM based cluster</title>
    <link>https://community.wolfram.com/groups/-/m/t/1861910</link>
    <description>I have access to a SLURM based cluster where I allocate 2 nodes, each with 12 processors. I am looking for a way to launch all 24 kernels to utilize the resources to the maximum for parallel computation.&#xD;
&#xD;
    nodes = ReadList[&amp;#034;!scontrol show hostname $SLURM_JOB_NODELIST&amp;#034;,String];&#xD;
    cores = ConstantArray[ToExpression@Environment[&amp;#034;SLURM_CPUS_PER_TASK&amp;#034;], Length@nodes];&#xD;
    dir = Directory[];&#xD;
    &#xD;
    Block[{$ContextPath}, Needs[&amp;#034;SubKernels`RemoteKernels`&amp;#034;]];&#xD;
    &#xD;
    kernelLaunch = &amp;#034;wolfram -wstp -linkmode connect `4` -linkname `2` -subkernel -noinit &amp;gt;&amp;amp;/dev/null &amp;amp;&amp;#034;;&#xD;
    &#xD;
    HPCKernel[nodes_,cores_]:= MapThread[&#xD;
    LaunchKernels[RemoteMachine[#1,&amp;#034;ssh -x -f &amp;#034;&amp;lt;&amp;gt;#1&amp;lt;&amp;gt;&amp;#034; \&amp;#034;&amp;#034;&amp;lt;&amp;gt;kernelLaunch&amp;lt;&amp;gt;&amp;#034;\&amp;#034;&amp;#034;,#2]]&amp;amp;,&#xD;
    {nodes,cores}];&#xD;
    &#xD;
    res = HPCKernel[nodes,cores];&#xD;
    corecount = $KernelCount;&#xD;
    &#xD;
    Save[&amp;#034;results.wl&amp;#034;, {nodes,cores,dir,res,corecount}]&#xD;
    &#xD;
In the `results.wl` I get the following outputs:&#xD;
&#xD;
    nodes = {&amp;#034;wm8&amp;#034;, &amp;#034;wm9&amp;#034;}&#xD;
    &#xD;
    cores = {12, 12}&#xD;
    &#xD;
    dir = &amp;#034;/work/ah1&amp;#034;&#xD;
    &#xD;
    res = {$Failed, $Failed}&#xD;
    &#xD;
    corecount = 0&#xD;
&#xD;
We can see that **res** and hence **HPCKernel** has failed to launch any kernel. In fact the **corecount** remains 0. I have success in allocating appropriate resources, however I have no idea how to launch all available kernels. Where am I going wrong with this? Any help will be highly appreciated.&#xD;
&#xD;
&#xD;
&#xD;
&#xD;
I have asked a similar question on StackExchange:&#xD;
https://mathematica.stackexchange.com/questions/213046/right-syntax-to-launch-multiple-kernels-on-slurm-cluster</description>
    <dc:creator>Ali Hashmi</dc:creator>
    <dc:date>2020-01-17T16:17:43Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2171196">
    <title>CUDA working but NetTrain[~,&amp;#034;TargetDevice&amp;#034;-&amp;gt;&amp;#034;GPU&amp;#034;] doesn&amp;#039;t</title>
    <link>https://community.wolfram.com/groups/-/m/t/2171196</link>
    <description>Am I supposed to do a different command within NetTrain[] to use CUDA or is &amp;#034;TargetDevice&amp;#034;-&amp;gt;&amp;#034;GPU&amp;#034; still supposed to work? (CUDA examples evaluate successfully.)&#xD;
&#xD;
The net gets trained but CPU spikes to 56% from a baseline of 1% while the NetTrain is evaluated and GPU does not seem to get used.&#xD;
&#xD;
Gfx: Nvidia 2080Ti&#xD;
CPU: AMD 3950x&#xD;
Wolfram v. 12.2&#xD;
&#xD;
Never mind: I think it is working now.</description>
    <dc:creator>Renay Oshop</dc:creator>
    <dc:date>2021-01-23T13:25:47Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/846592">
    <title>High CPU use by system interrupts when Mathematica runs in Windows 10</title>
    <link>https://community.wolfram.com/groups/-/m/t/846592</link>
    <description>I&amp;#039;m wondering why system interrupts shows a constant high (relative to other processes) CPU use of between about 1.8% - 3% when Mathematica runs. The increase in CPU use occurs with just a blank notebook. I&amp;#039;m using Windows 10 64 bit. When I exit Mathematica, the CPU used by system interrupts drops to about 0.75% - 0.9%, which is the typical background level. This increase has the effect of keeping the fan in my notebook always on, which is quite annoying.</description>
    <dc:creator>Adrian Sampaleanu</dc:creator>
    <dc:date>2016-04-27T06:38:26Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/948518">
    <title>Better approach to compute a large tree of posterior distributions?</title>
    <link>https://community.wolfram.com/groups/-/m/t/948518</link>
    <description>So I&amp;#039;ve gotten access to a large computing cluster, and I&amp;#039;m reworking some old MMA code to&#xD;
 1. exploit the parallel computing capabilities of the cluster, and&#xD;
 2. compute a large dataset of a certain system dynamics for subsequent study.&#xD;
&#xD;
Specifically, for any input I need to compute and store `2^T` probability distributions, each of which is a list (vector of probabilities) of the same length. Previously, I&amp;#039;ve imagined the nodes `&amp;#034;{start&amp;#034;, &amp;#034;0&amp;#034;,&amp;#034;1&amp;#034;,&amp;#034;00&amp;#034;,&amp;#034;01&amp;#034;,&amp;#034;10&amp;#034;,&amp;#034;11&amp;#034;,...}` of a binary tree of depth `T` being associated to to each distribution, and I&amp;#039;d like to work with this framework unless it&amp;#039;s too memory demanding. Finally, each probability list only depends on its &amp;#034;parent&amp;#034; probability list for computation. So, if `B` is this function, then `pAssc[&amp;#034;0101&amp;#034;] = B[1,pAssc[&amp;#034;010&amp;#034;]]`.&#xD;
&#xD;
To utilize the parallel processors on the cluster, my current idea is essentially to maintain a &amp;#034;queue&amp;#034; of jobs, and then export it immediately after it&amp;#039;s no longer needed for subsequent computation. Something like&#xD;
&#xD;
    `queue={&amp;#034;0&amp;#034;,&amp;#034;1&amp;#034;};&#xD;
    While[EmptyQ[queue],&#xD;
    node={#&amp;lt;&amp;gt;&amp;#034;0&amp;#034;,#&amp;lt;&amp;gt;&amp;#034;1&amp;#034;}&amp;amp;@(Key@Top[queue]);&#xD;
    Table[ParallelSubmit[{r},EnQueue[queue,&amp;lt;|node[[r]]-&amp;gt;B[r,Value[Top[queue]]]|&amp;gt;],{r,0,1}];&#xD;
    WriteString[&amp;#034;file.txt&amp;#034;,Top[queue]];&#xD;
    DeQueue[queue];&#xD;
    ]`&#xD;
&#xD;
I want to ask if anyone has any good/better ideas on how to handle this kind of situation.The documentation on the Queue package is scant, the myriad of considerations around making Parallel Computation work, as well as how to actually work with (i.e. query, compute, etc.) the resulting dataset once it&amp;#039;s generated all remain as ominous uncertainties.&#xD;
&#xD;
So, Mathematica wizards, any clever ideas? Well-known frameworks? Etc? Any and all ideas much appreciated!</description>
    <dc:creator>Crescent Curtis</dc:creator>
    <dc:date>2016-10-22T22:09:07Z</dc:date>
  </item>
</rdf:RDF>

