<div dir="ltr"><div>Hi all,</div><div><br></div><div>My question is about calling a fortran subroutine inside scilab. I have been doing this for quite some time now, using ilib_for_link, and it works neatly.</div><div><br>

</div><div>Recently I have tried to use a subroutine that does parallel processing using openmp, but scilab just seems to ignore the compiling flag to parallelize calculations. I know the subroutine works because I have used it already, compiling the program into an executable and running it through a terminal. But on scilab, the subroutine runs as if no openmp directives had been called, even though I add the flag -fopenmp when calling ilib_for_link.</div>

<div><br></div><div>Does anyone have an idea why this could be happening? I'll put some of my code below. I'm using linux ubuntu 12.04 32bits and scilab 5.3.3. I also tried using Ubuntu 12.04 64bits without success.</div>

<div><br></div><div>----------------------------------------------------------------------------------------------------------------------</div><div>function principal()</div><div>    </div><div>clear</div><div><br></div>

<div>clc</div><div><br></div><div>ulink()</div><div><br></div><div>stacksize(2.68e8)</div><div><br></div><div>    chdir('./Bibliotecas/Fortran/');</div><div>    </div><div>    link_name = ['fteste_openmp','fteste_openmp2'];</div>

<div>    flag  = "f";</div><div>    files = ['tipos.mod','fteste_openmp.f90','fteste_openmp2.f90'];</div><div>    libs  = [];</div><div>    </div><div>    ilib_for_link(link_name,files,libs,flag,'','floader.sce','','','','-fopenmp','');</div>

<div>    </div><div>    exec floader.sce</div><div>    </div><div>    chdir('../')</div><div>    chdir('../')</div><div>    </div><div>end</div><div><br></div><div>n=100000</div><div><br></div><div>for i=1:n</div>

<div>    vec1(i,:)=[i 2*i 3*i]</div><div>end</div><div><br></div><div>tic()</div><div>//serial processing</div><div>[vec2]=call('fteste_openmp',npanel,1,'i',vec1,2,'d','out',[npanel,3],3,'d');</div>

<div>time=toc()</div><div><br></div><div>mprintf('T: %f s\n',tempo)</div><div><br></div><div>tic()</div><div>//parallel processing</div><div>[vec2]=call('fteste_openmp2',npanel,1,'i',vec1,2,'d','out',[npanel,3],3,'d');</div>

<div>time=toc()</div><div><br></div><div>mprintf('T: %f s\n',tempo)</div><div>    </div><div>endfunction</div><div>-----------------------------------------------------------------------------------------------------------------</div>

<div><br></div><div>Thanks a lot,</div><div><br></div>-- <br>Eduardo Torrecillas<br>AER-09
</div>