Giter Club home page Giter Club logo

Comments (3)

beddalumia avatar beddalumia commented on July 27, 2024

Side note: apparently ifort has no problems whatsoever

1. it embeds MPI functionality, so explicitly selecting mpif90 is not needed for a fully functional MPI build

click to see details
$ export FC=ifort
$ ifort --version
ifort (IFORT) 19.1.3.304 20200925
Copyright (C) 1985-2020 Intel Corporation.  All rights reserved.
$ cmake -GNinja ..
-- The Fortran compiler identification is Intel 19.1.3.20200925
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: /opt/sissa/compiler/intel/2020.4/compilers_and_libraries_2020.4.304/linux/bin/intel64/ifort - skipped
-- OS: Linux 3.10.0-1062.el7.x86_64
-- BUILD_TYPE=RELEASE
-- Found MPI_Fortran: /opt2/ohpc/pub/mpi/openmpi3-intel/3.1.4/lib/libmpi_usempif08.so (found version "3.1") 
-- Found MPI: TRUE (found version "3.1")  
-- Set Fortran compiler FC to /opt/ohpc/pub/mpi/openmpi3-intel/3.1.4/bin/mpif90, ID=Intel
-- Looking for Fortran sgemm
-- Looking for Fortran sgemm - not found
-- Looking for Fortran sgemm
-- Looking for Fortran sgemm - found
-- Looking for Fortran cheev
-- Looking for Fortran cheev - found
-- BLAS found as: /usr/lib64/libblas.so
-- LAPACK found as: /usr/lib64/liblapack.so;/usr/lib64/libblas.so
-- Finding SCALAPACK
-- Fortran Compiler id   = Intel
-- Fortran Compiler ver. = 19.1.3.20200925
-- Fortran Compiler options = -fpp -O3 -ftz
-- Found Git: /opt/rh/rh-git218/root/usr/bin/git (found version "2.18.4") 
-- Git SHA1: 4f49e7d81a3067c84dcaf8ee6bf9b768e7665a3e
-- Git branch: master
-- Git tag: 4.9.6
-- Testing P-ARPACK patch: zdotc.patch
-- Patch applied: zdotc.patch
-- SF compilation lines: -L${libdir} -lscifor /usr/lib64/liblapack.so /usr/lib64/libblas.so
-- Version file: /home/gbellomi/QcmPlab/SciFortran/build_intel/etc/modules/scifor/intel/.version
-- Module file: scifor/intel/4.9.6
-- Library version: 4.9.6
-- Library will be installed in: /home/gbellomi/opt/scifor/intel/4.9.6
-- 
>> TO CONCLUDE INSTALLATION <<
Compile with:
$ make
Install with:
$ make install

Uninstall with:
$ make uninstall

-- Configuring done
-- Generating done
-- Build files have been written to: /home/gbellomi/QcmPlab/SciFortran/build_intel

$ ninja
[521/543] Building Fortran object src/SF_OPTIMIZE/CMakeFiles/SF_OPTIMIZELIB.dir/lbfgsb.f.o
src/SF_OPTIMIZE/CMakeFiles/SF_OPTIMIZELIB.dir//home/gbellomi/QcmPlab/SciFortran/src/SF_OPTIMIZE/lbfgsb.f(2802): remark #8291: Recommended relationship between field width 'W' and the number of fractional digits 'D' in this edit descriptor is 'W>=D+7'.
 3001 format(2(1x,i4),2(1x,i5),2x,a3,1x,i4,1p,2(2x,d7.1),1p,2(1x,d10.3))
----------------------------------------------------^
src/SF_OPTIMIZE/CMakeFiles/SF_OPTIMIZELIB.dir//home/gbellomi/QcmPlab/SciFortran/src/SF_OPTIMIZE/lbfgsb.f(2893): remark #8291: Recommended relationship between field width 'W' and the number of fractional digits 'D' in this edit descriptor is 'W>=D+7'.
 3002 format(2(1x,i4),2(1x,i5),2x,a3,1x,i4,1p,2(2x,d7.1),6x,'-',10x,'-')
----------------------------------------------------^
[543/543] Linking Fortran static library libscifor.a

2. even if we request -DUSE_MPI=false it somehow manages to compile

click to see details
$ cmake -GNinja -DUSE_MPI=false ..
-- The Fortran compiler identification is Intel 19.1.3.20200925
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: /opt/sissa/compiler/intel/2020.4/compilers_and_libraries_2020.4.304/linux/bin/intel64/ifort - skipped
-- OS: Linux 3.10.0-1062.el7.x86_64
-- BUILD_TYPE=RELEASE
-- Looking for Fortran sgemm
-- Looking for Fortran sgemm - not found
-- Looking for Fortran sgemm
-- Looking for Fortran sgemm - found
-- Looking for Fortran cheev
-- Looking for Fortran cheev - found
-- BLAS found as: /usr/lib64/libblas.so
-- LAPACK found as: /usr/lib64/liblapack.so;/usr/lib64/libblas.so
-- Finding SCALAPACK
-- Fortran Compiler id   = Intel
-- Fortran Compiler ver. = 19.1.3.20200925
-- Fortran Compiler options = -fpp -O3 -ftz
-- Found Git: /opt/rh/rh-git218/root/usr/bin/git (found version "2.18.4") 
-- Git SHA1: 4f49e7d81a3067c84dcaf8ee6bf9b768e7665a3e
-- Git branch: master
-- Git tag: 4.9.6
-- Testing P-ARPACK patch: zdotc.patch
-- Patch applied: zdotc.patch
-- SF compilation lines: -L${libdir} -lscifor /usr/lib64/liblapack.so /usr/lib64/libblas.so
-- Version file: /home/gbellomi/QcmPlab/SciFortran/build_intel/etc/modules/scifor/intel/.version
-- Module file: scifor/intel/4.9.6
-- Library version: 4.9.6
-- Library will be installed in: /home/gbellomi/opt/scifor/intel/4.9.6
-- 
>> TO CONCLUDE INSTALLATION <<
Compile with:
$ make
Install with:
$ make install

Uninstall with:
$ make uninstall

-- Configuring done
-- Generating done
-- Build files have been written to: /home/gbellomi/QcmPlab/SciFortran/build_intel

$ ninja
[454/475] Building Fortran object src/SF_OPTIMIZE/CMakeFiles/SF_OPTIMIZELIB.dir/lbfgsb.f.o
src/SF_OPTIMIZE/CMakeFiles/SF_OPTIMIZELIB.dir//home/gbellomi/QcmPlab/SciFortran/src/SF_OPTIMIZE/lbfgsb.f(2802): remark #8291: Recommended relationship between field width 'W' and the number of fractional digits 'D' in this edit descriptor is 'W>=D+7'.
 3001 format(2(1x,i4),2(1x,i5),2x,a3,1x,i4,1p,2(2x,d7.1),1p,2(1x,d10.3))
----------------------------------------------------^
src/SF_OPTIMIZE/CMakeFiles/SF_OPTIMIZELIB.dir//home/gbellomi/QcmPlab/SciFortran/src/SF_OPTIMIZE/lbfgsb.f(2893): remark #8291: Recommended relationship between field width 'W' and the number of fractional digits 'D' in this edit descriptor is 'W>=D+7'.
 3002 format(2(1x,i4),2(1x,i5),2x,a3,1x,i4,1p,2(2x,d7.1),6x,'-',10x,'-')
----------------------------------------------------^
[475/475] Linking Fortran static library libscifor.a

(this is a mistery to me, is it maybe buiding an MPI-aware library nonentheless? Note that the total number of targets has gone from 543 to 475, so the CMake option is indeed being recognized...)

from scifortran.

beddalumia avatar beddalumia commented on July 27, 2024

No ok, they do not seem to be a lot, except for PARPACK, that is already handled by:

https://github.com/QcmPlab/SciFortran/blob/4f49e7d81a3067c84dcaf8ee6bf9b768e7665a3e/src/arpack/CMakeLists.txt#L187-L192

In fact grep tells us that:

$ git grep "USE MPI"
src/SF_MPI/SF_MPI.f90:  ! USE MPI
$ git grep mpif.h
click to see the long output
src/SF_LINALG/linalg_blacs_aux.f90:  include 'mpif.h'
src/SF_LINALG/linalg_blacs_aux.f90:  include 'mpif.h'
src/SF_LINALG/linalg_blacs_aux.f90:  include 'mpif.h'
src/SF_LINALG/linalg_blacs_aux.f90:  include 'mpif.h'
src/SF_MPI/SF_MPI.f90:  include 'mpif.h'
src/SF_SP_LINALG/SF_SP_LINALG.f90:  include 'mpif.h'
src/arpack/parpack/src/pcgetv0.f:      include   'mpif.h'
src/arpack/parpack/src/pcnaitr.f:      include   'mpif.h'
src/arpack/parpack/src/pcnaup2.f:      include   'mpif.h'
src/arpack/parpack/src/pcnaupd.f:      include  'mpif.h'
src/arpack/parpack/src/pdgetv0.f:      include   'mpif.h'
src/arpack/parpack/src/pdlamch10.f:      include "mpif.h"
src/arpack/parpack/src/pdlarnv.f:      include  'mpif.h'
src/arpack/parpack/src/pdnaitr.f:      include   'mpif.h'
src/arpack/parpack/src/pdnaup2.f:      include   'mpif.h'
src/arpack/parpack/src/pdnaupd.f:      include  'mpif.h'
src/arpack/parpack/src/pdnorm2.f:      include   'mpif.h'
src/arpack/parpack/src/pdsaitr.f:      include   'mpif.h'
src/arpack/parpack/src/pdsapps.f:      include  'mpif.h'
src/arpack/parpack/src/pdsaup2.f:      include   'mpif.h'
src/arpack/parpack/src/pdsaupd.f:      include  'mpif.h'
src/arpack/parpack/src/pdznorm2.f:      include   'mpif.h'
src/arpack/parpack/src/pscnorm2.f:      include   'mpif.h'
src/arpack/parpack/src/psgetv0.f:      include   'mpif.h'
src/arpack/parpack/src/pslamch10.f:      include "mpif.h"
src/arpack/parpack/src/pslarnv.f:      include  'mpif.h'
src/arpack/parpack/src/psnaitr.f:      include   'mpif.h'
src/arpack/parpack/src/psnaup2.f:      include   'mpif.h'
src/arpack/parpack/src/psnaupd.f:      include  'mpif.h'
src/arpack/parpack/src/psnorm2.f:      include   'mpif.h'
src/arpack/parpack/src/pssaitr.f:      include   'mpif.h'
src/arpack/parpack/src/pssaup2.f:      include   'mpif.h'
src/arpack/parpack/src/pssaupd.f:      include  'mpif.h'
src/arpack/parpack/src/pzgetv0.f:      include   'mpif.h'
src/arpack/parpack/src/pznaitr.f:      include   'mpif.h'
src/arpack/parpack/src/pznaup2.f:      include   'mpif.h'
src/arpack/parpack/src/pznaupd.f:      include  'mpif.h'
src/arpack/parpack/util/pcmout.f:      include  'mpif.h'
src/arpack/parpack/util/pcvout.f:      include  'mpif.h'
src/arpack/parpack/util/pdmout.f:      include  'mpif.h'
src/arpack/parpack/util/pdvout.f:      include  'mpif.h'
src/arpack/parpack/util/pivout.f:      include  'mpif.h'
src/arpack/parpack/util/psmout.f:      include  'mpif.h'
src/arpack/parpack/util/psvout.f:      include  'mpif.h'
src/arpack/parpack/util/pzmout.f:      include  'mpif.h'
src/arpack/parpack/util/pzvout.f:      include  'mpif.h'

Only src/SF_LINALG/linalg_blacs_aux.f90, src/SF_MPI/SF_MPI.f90 and src/SF_SP_LINALG/SF_SP_LINALG.f90 include mpif.h (other than PARPACK) and the latter two resolve the issue by preprocessor directives:

https://github.com/QcmPlab/SciFortran/blob/4f49e7d81a3067c84dcaf8ee6bf9b768e7665a3e/src/SF_MPI/SF_MPI.f90#L3-L6

https://github.com/QcmPlab/SciFortran/blob/4f49e7d81a3067c84dcaf8ee6bf9b768e7665a3e/src/SF_SP_LINALG/SF_SP_LINALG.f90#L5-L11

So probably we just need to add an #ifdef _MPI outer block here:

https://github.com/QcmPlab/SciFortran/blob/4f49e7d81a3067c84dcaf8ee6bf9b768e7665a3e/src/SF_LINALG/SF_LINALG.f90#L506-L508

from scifortran.

beddalumia avatar beddalumia commented on July 27, 2024

Of course this was also needed:

https://github.com/QcmPlab/SciFortran/blob/03228bcdf93859d31417c0df6038b5daa04e51a7/src/SF_LINALG/SF_LINALG.f90#L358-L370

Now I manage to compile with both gfortran and ifort, so the issue appears to be solved.

from scifortran.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.