[Scilab-Dev] Scilab 6.0.1 and OMP

Pedro Arthur bygrandao at gmail.com
Mon Jan 14 14:15:12 CET 2019


Em seg, 14 de jan de 2019 às 10:44, mobile_ghost <kostrov65 at yandex.ru> escreveu:
>
> There is a very simple Fortran progmam calculating
> gravity, in which I used OMP code ( grav3d_omp.f90
> <https://drive.google.com/file/d/1ytver7e3yY6rKGSy7_XFMUc7NlCmTXY5/view?usp=sharing>
> )
> Here is a row in .bashrc
> export OMP_NUM_THREADS=8
>
> I ran grav3d_omp from a terminal window and
> htop shows (Figure  htop_2019-01-14_16-36-52.png
> <https://drive.google.com/file/d/1Ab_XeUFN0WdpozxZhP_yNy8smIXpcZ4i/view?usp=sharing>
> ) that OMP works OK.
>
> The same program I ran from Scilab 6.0.1 command window
>
> --> unix("bin/grav3d_omp");
> and saw that OMP does not work (screen shot
> htop_scilab_2019-01-14_16-41-29.png
> <https://drive.google.com/file/d/1Rj8cHwbDy6LHdxLAmOrn9xv2sd5exgYF/view?usp=sharing>
> )
>
>
> My OS is Ubuntu 16.04
> nick@:$ uname -a
> Linux ghost7 4.15.0-43-lowlatency #46-Ubuntu SMP PREEMPT Thu Dec 6 17:28:08
> UTC
> 2018 x86_64 x86_64 x86_64 GNU/Linux
>
> nick@:$ ifort -v
> ifort version 17.0.4
> nick@:$
>
> The same behavior (as shown on figure  htop_scilab_2019-01-14_16-41-29.png
> <https://drive.google.com/file/d/1Rj8cHwbDy6LHdxLAmOrn9xv2sd5exgYF/view?usp=sharing>
> )
> you can see if you make so-module
> ifort -qopenmp -FPIC -shared grav3d_omp.f90 -o grav3d_omp.so
> and then
> link it to Scilab  and call it
> a29=link('modules/gravda_omp.so','gravda','f');
>  [mgrdm]=call("gravda",a_cells,1,"d",ipar,2,"i",...

There is no function named gravda in the code you provide. I'm
supposing the function name is GRA.
It seems that your OMP directives are in the program (lines 158-160)
and not inside the function. If you want the function to be
parallelized you have to use the directives in a loop inside the
function.



More information about the dev mailing list