<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic __cilkrts_param_set bug in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/cilkrts-param-set-bug/m-p/741344#M557</link>
    <description>__cilkrts_param_set return 4(/**&amp;lt; Too late to change parameter value *).&lt;BR /&gt;Reinitialization of the library can not be completed, cause __cilkrts_end_cilk return "Attempt to shut down Cilk while Cilk is still runningAborted"&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 13 Mar 2012 13:33:41 GMT</pubDate>
    <dc:creator>proukornew</dc:creator>
    <dc:date>2012-03-13T13:33:41Z</dc:date>
    <item>
      <title>__cilkrts_param_set bug</title>
      <link>https://community.intel.com/t5/Software-Archive/cilkrts-param-set-bug/m-p/741344#M557</link>
      <description>__cilkrts_param_set return 4(/**&amp;lt; Too late to change parameter value *).&lt;BR /&gt;Reinitialization of the library can not be completed, cause __cilkrts_end_cilk return "Attempt to shut down Cilk while Cilk is still runningAborted"&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 13 Mar 2012 13:33:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/cilkrts-param-set-bug/m-p/741344#M557</guid>
      <dc:creator>proukornew</dc:creator>
      <dc:date>2012-03-13T13:33:41Z</dc:date>
    </item>
    <item>
      <title>__cilkrts_param_set bug</title>
      <link>https://community.intel.com/t5/Software-Archive/cilkrts-param-set-bug/m-p/741345#M558</link>
      <description>&lt;P&gt;I'm not exactly sure what the issue is here. What exactly are you passing to __cilkrts_set_param()? &lt;/P&gt;&lt;P&gt;To call __cilkrts_end_cilk(), You must have exited the function that contains the cilk_spawn. Consider the basic "fib" application: &lt;/P&gt;&lt;PRE&gt;int fib(int n)
{
    int x, y;
    if (n &amp;lt; 2)
        return n;
    x = cilk_spawn fib(n-1);
    y = fib(n-2);
    cilk_sync;
    return x+y;
}

int main(int argc, char **argv)
{
    int n = 30;
    printf ("fib(%d) = %d\n", n fib(n));
}

&lt;/PRE&gt;&lt;P&gt;You can call __cilkrts_end_cilk() in main() because you've exited all functions containing a cilk_spawn. If main() was modified to spawn fib(n), then __cilkrts_end_cilk() would return an error. &lt;/P&gt;&lt;P&gt;- Barry&lt;/P&gt;</description>
      <pubDate>Tue, 13 Mar 2012 14:15:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/cilkrts-param-set-bug/m-p/741345#M558</guid>
      <dc:creator>Barry_T_Intel</dc:creator>
      <dc:date>2012-03-13T14:15:40Z</dc:date>
    </item>
    <item>
      <title>__cilkrts_param_set bug</title>
      <link>https://community.intel.com/t5/Software-Archive/cilkrts-param-set-bug/m-p/741346#M559</link>
      <description>ok. i missed that. I wrote a wrapper function.&lt;BR /&gt;void wrapper_workerbody()&lt;BR /&gt;{&lt;BR /&gt; for(int i = 0; i &amp;lt; workers; i++) {&lt;BR /&gt;  cilk_spawn workerbody();&lt;BR /&gt; }&lt;BR /&gt; cilk_sync;&lt;BR /&gt;}&lt;BR /&gt;and call it from main.&lt;BR /&gt;but __cilkrts_end_cilk() in main still aborted program with "Attempt to shut down Cilk while Cilk is still runningAborted". (CILK_NWORKERS is unset)</description>
      <pubDate>Tue, 13 Mar 2012 14:53:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/cilkrts-param-set-bug/m-p/741346#M559</guid>
      <dc:creator>proukornew</dc:creator>
      <dc:date>2012-03-13T14:53:01Z</dc:date>
    </item>
    <item>
      <title>__cilkrts_param_set bug</title>
      <link>https://community.intel.com/t5/Software-Archive/cilkrts-param-set-bug/m-p/741347#M560</link>
      <description>&lt;P&gt;The following program works as expected: &lt;/P&gt;&lt;PRE&gt;#include &lt;CILK&gt;
#include &lt;CILK&gt;
#include &lt;STDIO.H&gt;

int fib(int n)
{
    int x,y;
    if (n &amp;lt; 2)
        return n;
    x = cilk_spawn fib(n-1);
    y = fib(n-2);
    cilk_sync;
    return x+y;
}

int main(int argc, char **argv)
{
    int n = 30;
    int result;
    int err;

    err = __cilkrts_set_param("nworkers", "13");
    printf("__cilkrts_set_param("nworkers", "13") returned %d\n", err);

#ifdef SPAWN_IN_MAIN
    result = cilk_spawn fib(n);
    cilk_sync;
#else
    result = fib(n);
#endif

    printf("fib(%d)=%d\n", n, result);

    __cilkrts_end_cilk();

    return 0;
}


&lt;/STDIO.H&gt;&lt;/CILK&gt;&lt;/CILK&gt;&lt;/PRE&gt;&lt;P&gt;If I compile it with SPAWN_IN_MAIN defined, __cilkrts_end_cilk() prints the message "Attempt to shut down Cilk while Cilk is still running". If I compile it without defining SPAWN_IN_MAIN, it completes normally.&lt;/P&gt;&lt;P&gt;If you can give me a program that's misbehaving, I'll take a look at it.&lt;/P&gt;&lt;P&gt;- Barry&lt;/P&gt;</description>
      <pubDate>Tue, 13 Mar 2012 15:25:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/cilkrts-param-set-bug/m-p/741347#M560</guid>
      <dc:creator>Barry_T_Intel</dc:creator>
      <dc:date>2012-03-13T15:25:14Z</dc:date>
    </item>
    <item>
      <title>__cilkrts_param_set bug</title>
      <link>https://community.intel.com/t5/Software-Archive/cilkrts-param-set-bug/m-p/741348#M561</link>
      <description>thx, i've fixed program.</description>
      <pubDate>Tue, 13 Mar 2012 15:48:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/cilkrts-param-set-bug/m-p/741348#M561</guid>
      <dc:creator>proukornew</dc:creator>
      <dc:date>2012-03-13T15:48:58Z</dc:date>
    </item>
  </channel>
</rss>

