Fortran program call in Scilab 6.01: OMP does not work!

classic Classic list List threaded Threaded
2 messages Options
mobile_ghost mobile_ghost
Reply | Threaded
Open this post in threaded view
|

Fortran program call in Scilab 6.01: OMP does not work!

Hello!
I wrote a parallel routine in Fortran using OMP (Intel compiler v.17.0.4)
and link it to Scilab 6.01. To my surprise the program uses only one CPU
core from 8 available. Besides, the same stand-alone code uses 8 cores.
*Does anybody know what the bug (if any) in Scialab 6.01 and how to bypass
it? *

My system is Ubuntu 18.04. Intel compiler
(ifort version 17.0.4) command is
ifort -fPIC -shared -qopenmp grav3d_omp.f90 -o gravda_omp.so

Scilab link and call command are:
 a29=link('modules/gravda_omp.so','gravda','f');
[mgrdm]=call("gravda",a_cells,1,"d",ipar,2,"i",...
                 xgrd,3,"d",ygrd,4,"d", zgrd,5,"d",...
                 mgrdm,6,"d",indsub,7,"i",...
                 frm3d,8,"d",srf,9,"i",logfiles3d,10,"i",...
         "out",[nr_mgrdm,nc_mgrdm],6,"d");

I made a standalone version
ifort -qopenmp grav3d_omp.f90 -o gravda_omp
of the same progam and run it from Scilab 6.01
unix_w("gravda_omp");
with the same result: ONLY ONE CPU CORE is used!
BUT, when I run it from a terminal window it works fine. Every CPU core busy
100%.
What's the matter? Is there a solution?

Thanks in advance.

Nick



--
Sent from: http://mailinglists.scilab.org/Scilab-developers-Mailing-Lists-Archives-f2574944.html
_______________________________________________
dev mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/dev
PedroArthur PedroArthur
Reply | Threaded
Open this post in threaded view
|

Re: Fortran program call in Scilab 6.01: OMP does not work!

Hi,

Em qua, 26 de dez de 2018 às 12:09, mobile_ghost <[hidden email]> escreveu:
>
> Hello!
> I wrote a parallel routine in Fortran using OMP (Intel compiler v.17.0.4)
> and link it to Scilab 6.01. To my surprise the program uses only one CPU
> core from 8 available. Besides, the same stand-alone code uses 8 cores.
> *Does anybody know what the bug (if any) in Scialab 6.01 and how to bypass
> it? *
Did you set the number of threads to use at runtime [1]? if not the
application may use whatever default value is set.

[1] - https://software.intel.com/en-us/mkl-linux-developer-guide-changing-the-number-of-openmp-threads-at-run-time

Best regards,
Pedro.

>
> My system is Ubuntu 18.04. Intel compiler
> (ifort version 17.0.4) command is
> ifort -fPIC -shared -qopenmp grav3d_omp.f90 -o gravda_omp.so
>
> Scilab link and call command are:
>  a29=link('modules/gravda_omp.so','gravda','f');
> [mgrdm]=call("gravda",a_cells,1,"d",ipar,2,"i",...
>                  xgrd,3,"d",ygrd,4,"d", zgrd,5,"d",...
>                  mgrdm,6,"d",indsub,7,"i",...
>                  frm3d,8,"d",srf,9,"i",logfiles3d,10,"i",...
>          "out",[nr_mgrdm,nc_mgrdm],6,"d");
>
> I made a standalone version
> ifort -qopenmp grav3d_omp.f90 -o gravda_omp
> of the same progam and run it from Scilab 6.01
> unix_w("gravda_omp");
> with the same result: ONLY ONE CPU CORE is used!
> BUT, when I run it from a terminal window it works fine. Every CPU core busy
> 100%.
> What's the matter? Is there a solution?
>
> Thanks in advance.
>
> Nick
>
>
>
> --
> Sent from: http://mailinglists.scilab.org/Scilab-developers-Mailing-Lists-Archives-f2574944.html
> _______________________________________________
> dev mailing list
> [hidden email]
> http://lists.scilab.org/mailman/listinfo/dev
_______________________________________________
dev mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/dev