<html><head></head><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div id="yui_3_16_0_ym19_1_1482253183047_3051" dir="ltr">Hi,</div><div id="yui_3_16_0_ym19_1_1482253183047_3051" dir="ltr"><br></div><div id="yui_3_16_0_ym19_1_1482253183047_3051" dir="ltr">I am running several simulation in which I have to get eigenvalues several times: the process seems to be easy to paralelize as any calculation is independent from the others.</div><div id="yui_3_16_0_ym19_1_1482253183047_3051" dir="ltr"><br></div><div id="yui_3_16_0_ym19_1_1482253183047_3051" dir="ltr">How ever I am getting errors when using "parallel_run" : </div><div id="yui_3_16_0_ym19_1_1482253183047_3051" dir="ltr"><br></div><div id="yui_3_16_0_ym19_1_1482253183047_3051" dir="ltr">I manage to create a simple example of the problem:</div><div id="yui_3_16_0_ym19_1_1482253183047_3051" dir="ltr"><br></div><div id="yui_3_16_0_ym19_1_1482253183047_3051" dir="ltr">"<span style="font-family: Monospaced; white-space: pre-wrap; color: rgb(176, 24, 19);" id="yui_3_16_0_ym19_1_1482253183047_6665">function</span><span style="font-family: Monospaced; white-space: pre-wrap;" id="yui_3_16_0_ym19_1_1482253183047_6666"> </span><span style="font-family: Monospaced; white-space: pre-wrap; color: rgb(131, 67, 16); font-weight: bold;" id="yui_3_16_0_ym19_1_1482253183047_6667">output</span><span style="font-family: Monospaced; white-space: pre-wrap; color: rgb(92, 92, 92);" id="yui_3_16_0_ym19_1_1482253183047_6668">=</span><span style="font-family: Monospaced; white-space: pre-wrap; text-decoration: underline;" id="yui_3_16_0_ym19_1_1482253183047_6669">ThisFunctionDoesWork</span><span style="font-family: Monospaced; white-space: pre-wrap; color: rgb(74, 85, 219);" id="yui_3_16_0_ym19_1_1482253183047_6670">(</span><span style="font-family: Monospaced; white-space: pre-wrap; color: rgb(131, 67, 16); font-weight: bold;" id="yui_3_16_0_ym19_1_1482253183047_6671">i</span><span style="font-family: Monospaced; white-space: pre-wrap; color: rgb(74, 85, 219);" id="yui_3_16_0_ym19_1_1482253183047_6672">)</span></div><pre style="font-family: Monospaced;" id="yui_3_16_0_ym19_1_1482253183047_6673">    eig_values <span style="color:rgb(92,92,92);" id="yui_3_16_0_ym19_1_1482253183047_6674">=</span> <span style="color:rgb(50,185,185);" id="yui_3_16_0_ym19_1_1482253183047_6675">spec</span><span style="color:rgb(74,85,219);" id="yui_3_16_0_ym19_1_1482253183047_6676">(</span><span style="color:rgb(50,185,185);" id="yui_3_16_0_ym19_1_1482253183047_6677">rand</span><span style="color:rgb(74,85,219);" id="yui_3_16_0_ym19_1_1482253183047_6678">(</span><span style="color:rgb(188,143,143);" id="yui_3_16_0_ym19_1_1482253183047_6679">10</span>,<span style="color:rgb(188,143,143);" id="yui_3_16_0_ym19_1_1482253183047_6680">10</span><span style="color:rgb(74,85,219);" id="yui_3_16_0_ym19_1_1482253183047_6681">)</span><span style="color:rgb(74,85,219);" id="yui_3_16_0_ym19_1_1482253183047_6682">)</span>;
    <span style="color:rgb(131,67,16);font-weight:bold;" id="yui_3_16_0_ym19_1_1482253183047_6683">output</span> <span style="color:rgb(92,92,92);" id="yui_3_16_0_ym19_1_1482253183047_6684">=</span> <span style="color:rgb(74,85,219);" id="yui_3_16_0_ym19_1_1482253183047_6685">(</span><span style="color:rgb(188,143,143);" id="yui_3_16_0_ym19_1_1482253183047_6686">1</span><span style="color:rgb(255,170,0);" id="yui_3_16_0_ym19_1_1482253183047_6687">:</span><span style="color:rgb(188,143,143);" id="yui_3_16_0_ym19_1_1482253183047_6688">10</span><span style="color:rgb(74,85,219);" id="yui_3_16_0_ym19_1_1482253183047_6689">)</span><span style="color:rgb(92,92,92);" id="yui_3_16_0_ym19_1_1482253183047_6690">'</span>;
<span style="color:rgb(176,24,19);" id="yui_3_16_0_ym19_1_1482253183047_6691">endfunction</span>

<span style="color:rgb(176,24,19);" id="yui_3_16_0_ym19_1_1482253183047_6692">function</span> <span style="color:rgb(131,67,16);font-weight:bold;" id="yui_3_16_0_ym19_1_1482253183047_6693">output</span><span style="color:rgb(92,92,92);" id="yui_3_16_0_ym19_1_1482253183047_6694">=</span><span style="text-decoration: underline;" id="yui_3_16_0_ym19_1_1482253183047_6695">ThisFunctionDoesNOTWork</span><span style="color:rgb(74,85,219);" id="yui_3_16_0_ym19_1_1482253183047_6696">(</span><span style="color:rgb(131,67,16);font-weight:bold;" id="yui_3_16_0_ym19_1_1482253183047_6697">i</span><span style="color:rgb(74,85,219);" id="yui_3_16_0_ym19_1_1482253183047_6698">)</span>
    eig_values <span style="color:rgb(92,92,92);" id="yui_3_16_0_ym19_1_1482253183047_6699">=</span> <span style="color:rgb(50,185,185);" id="yui_3_16_0_ym19_1_1482253183047_6700">spec</span><span style="color:rgb(74,85,219);" id="yui_3_16_0_ym19_1_1482253183047_6701">(</span><span style="color:rgb(50,185,185);" id="yui_3_16_0_ym19_1_1482253183047_6702">rand</span><span style="color:rgb(74,85,219);" id="yui_3_16_0_ym19_1_1482253183047_6703">(</span><span style="color:rgb(188,143,143);" id="yui_3_16_0_ym19_1_1482253183047_6704">10</span>,<span style="color:rgb(188,143,143);" id="yui_3_16_0_ym19_1_1482253183047_6705">10</span><span style="color:rgb(74,85,219);" id="yui_3_16_0_ym19_1_1482253183047_6706">)</span><span style="color:rgb(74,85,219);" id="yui_3_16_0_ym19_1_1482253183047_6707">)</span>;
    <span style="color:rgb(131,67,16);font-weight:bold;" id="yui_3_16_0_ym19_1_1482253183047_6708">output</span> <span style="color:rgb(92,92,92);" id="yui_3_16_0_ym19_1_1482253183047_6709">=</span> eig_values; 
<span style="color:rgb(176,24,19);" id="yui_3_16_0_ym19_1_1482253183047_6710">endfunction</span>

<span style="text-decoration: underline;" id="yui_3_16_0_ym19_1_1482253183047_6711">ThisFunctionDoesWork</span><span style="color:rgb(74,85,219);" id="yui_3_16_0_ym19_1_1482253183047_6712">(</span><span style="color:rgb(188,143,143);" id="yui_3_16_0_ym19_1_1482253183047_6713">1</span><span style="color:rgb(74,85,219);" id="yui_3_16_0_ym19_1_1482253183047_6714">)</span>
<span style="text-decoration: underline;" id="yui_3_16_0_ym19_1_1482253183047_6715">ThisFunctionDoesNOTWork</span><span style="color:rgb(74,85,219);" id="yui_3_16_0_ym19_1_1482253183047_6716">(</span><span style="color:rgb(188,143,143);" id="yui_3_16_0_ym19_1_1482253183047_6717">1</span><span style="color:rgb(74,85,219);" id="yui_3_16_0_ym19_1_1482253183047_6718">)</span>

<span style="color:rgb(50,185,185);" id="yui_3_16_0_ym19_1_1482253183047_6719">parallel_run</span><span style="color:rgb(74,85,219);" id="yui_3_16_0_ym19_1_1482253183047_6720">(</span><span style="color:rgb(188,143,143);" id="yui_3_16_0_ym19_1_1482253183047_6721">1</span><span style="color:rgb(255,170,0);" id="yui_3_16_0_ym19_1_1482253183047_6722">:</span><span style="color:rgb(188,143,143);" id="yui_3_16_0_ym19_1_1482253183047_6723">4</span>,<span style="text-decoration: underline;" id="yui_3_16_0_ym19_1_1482253183047_6724">ThisFunctionDoesWork</span>,<span style="color:rgb(188,143,143);" id="yui_3_16_0_ym19_1_1482253183047_6725">10</span><span style="color:rgb(74,85,219);" id="yui_3_16_0_ym19_1_1482253183047_6726">)</span>
<span style="color:rgb(50,185,185);" id="yui_3_16_0_ym19_1_1482253183047_6727">parallel_run</span><span style="color:rgb(74,85,219);" id="yui_3_16_0_ym19_1_1482253183047_6728">(</span><span style="color:rgb(188,143,143);" id="yui_3_16_0_ym19_1_1482253183047_6729">1</span><span style="color:rgb(255,170,0);" id="yui_3_16_0_ym19_1_1482253183047_6730">:</span><span style="color:rgb(188,143,143);" id="yui_3_16_0_ym19_1_1482253183047_6731">4</span>,<span style="text-decoration: underline;" id="yui_3_16_0_ym19_1_1482253183047_6732">ThisFunctionDoesNOTWork</span>,<span style="color:rgb(188,143,143);" id="yui_3_16_0_ym19_1_1482253183047_6733">10</span><span style="color:rgb(74,85,219);" id="yui_3_16_0_ym19_1_1482253183047_6734">)"</span></pre><pre style="font-family: Monospaced;" id="yui_3_16_0_ym19_1_1482253183047_6673"><span style="color:rgb(74,85,219);"><br></span></pre><pre style="font-family: Monospaced;" id="yui_3_16_0_ym19_1_1482253183047_6673"> I get the following output:<br></pre><pre style="font-family: Monospaced;" id="yui_3_16_0_ym19_1_1482253183047_6673"><br></pre><pre style="font-family: Monospaced;" id="yui_3_16_0_ym19_1_1482253183047_6673">">ThisFunctionDoesWork(1)
 ans  =
 
    1.   
    2.   
    3.   
    4.   
    5.   
    6.   
    7.   
    8.   
    9.   
    10.  
 
-->ThisFunctionDoesNOTWork(1)
 ans  =
 
    4.6702874               
    0.5256414 + 0.5235705i  
    0.5256414 - 0.5235705i  
    0.1415384 + 0.6023968i  
    0.1415384 - 0.6023968i  
  - 0.5172448 + 0.4635569i  
  - 0.5172448 - 0.4635569i  
    0.1193317               
  - 0.3188852 + 0.0144623i  
  - 0.3188852 - 0.0144623i  
 
-->parallel_run(1:4,ThisFunctionDoesWork,10)
 ans  =
 
    1.     1.     1.     1.   
    2.     2.     2.     2.   
    3.     3.     3.     3.   
    4.     4.     4.     4.   
    5.     5.     5.     5.   
    6.     6.     6.     6.   
    7.     7.     7.     7.   
    8.     8.     8.     8.   
    9.     9.     9.     9.   
    10.    10.    10.    10.  
  </pre><pre id="yui_3_16_0_ym19_1_1482253183047_6673"><font face="Monospaced" id="yui_3_16_0_ym19_1_1482253183047_6809">->parallel_run(1:4,ThisFunctionDoesNOTWork,10)
                                             !--error 42 
A fatal error has been detected by Scilab.
Your instance will probably quit unexpectedly soon.
If a graphic feature has been used, this might be caused by the system graphic drivers.
Please try to update them and run this feature again.
You can report a bug on http://bugzilla.scilab.org/ with:
* a sample code which reproduces the issue
* the result of [a, b] = getdebuginfo()
* the following information:
[emartini-Dell-System-Inspiron-N4110:31486] Signal: Segmentation fault (11)
[emartini-Dell-System-Inspiron-N4110:31486] Signal code: Address not mapped (1)
[emartini-Dell-System-Inspiron-N4110:31486] Failing at address: (nil)
 
Call stack:
   1: 0x8bb2f9 <JVM_handle_linux_signal>        (/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
   2: 0x8af1f8 < >                              (/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
   3: 0x11390  < >                              (/lib/x86_64-linux-gnu/libpthread.so.0)
   4: 0x9ec90  < >                              (/lib/x86_64-linux-gnu/libc.so.6)
   5: 0x2eba   < >                              (/usr/lib/scilab/libsciparallel.so)
   6: 0x495e   <sci_parallel_run>               (/usr/lib/scilab/libsciparallel.so)
   7: 0x21ba   <gw_parallel>                    (/usr/lib/scilab/libsciparallel.so)
   8: 0x1586a2 <callDynamicGateway>             (/usr/lib/scilab/libscilab-cli.so.0)
   9: 0x15d26b <gw_dynamic_generic>             (/usr/lib/scilab/libscilab-cli.so.0)
  10: 0x158af8 <callinterf_>                    (/usr/lib/scilab/libscilab-cli.so.0)
  11: 0x16c266 <scirun_>                        (/usr/lib/scilab/libscilab-cli.so.0)
  12: 0x1671aa <realmain>                       (/usr/lib/scilab/libscilab-cli.so.0)
  13: 0x14d5   < >                              (/usr/bin/scilab-bin)
  14: 0x20830  <__libc_start_main>              (/lib/x86_64-linux-gnu/libc.so.6)
  15: 0x1829   < >                              (/usr/bin/scilab-bin)
End of stack


 
                                             !--error 999 
Aborting current computation
 
 "<br></font></pre><pre id="yui_3_16_0_ym19_1_1482253183047_6673"><font face="Monospaced"><br></font></pre><pre id="yui_3_16_0_ym19_1_1482253183047_6673"><font face="Monospaced"><br></font></pre><pre id="yui_3_16_0_ym19_1_1482253183047_6673"><font face="Monospaced" id="yui_3_16_0_ym19_1_1482253183047_6864">I am lost... I can even "disp" the eig_values, but no luck in having them as output variables.</font></pre><pre id="yui_3_16_0_ym19_1_1482253183047_6673"><font face="Monospaced" id="yui_3_16_0_ym19_1_1482253183047_6879">I am doing something wrong?</font></pre><pre id="yui_3_16_0_ym19_1_1482253183047_6673"><font face="Monospaced"><br></font></pre><pre id="yui_3_16_0_ym19_1_1482253183047_6673"><font face="Monospaced">Thanks a lot for any help! ;)</font></pre><pre id="yui_3_16_0_ym19_1_1482253183047_6673"><br></pre></div></body></html>