Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot find lgrid2grid #84

Closed
yaoyi92 opened this issue Apr 12, 2021 · 11 comments
Closed

cannot find lgrid2grid #84

yaoyi92 opened this issue Apr 12, 2021 · 11 comments
Assignees
Labels
docs enhancement New feature or request

Comments

@yaoyi92
Copy link

yaoyi92 commented Apr 12, 2021

Dear developers, I am trying to link against COSMA via the USE COSMA in 30 seconds. However, it tells me grid2grid is not found. I saw you updated grid2grid to COSTA. Should the linking libs also update? If yes, what's the correct lib to be linked? I saw libcosta.a, libcosta_prefixed_scalapack.a, and libcosta_scalapack.a.

Thank you so much.

@kabicm
Copy link
Collaborator

kabicm commented Apr 12, 2021

Dear Yi, thanks for spotting this! You are totally right, grid2grid was changed to COSTA and this will be corrected in the README soon, we are preparing a new release for both COSTA and COSMA.

In your case, you should link to libcosta_scalapack.a, because of this line:

costa_scalapack

Let me know if it works for you!

@kabicm
Copy link
Collaborator

kabicm commented Apr 12, 2021

In general, if you use pure cosma library (without pxgemm wrappers) then you link to costa. If you use cosma_pxgemm then you link to costa_scalapack. Pay attention that costa_scalapack overwrites scalapack's pxtran (transpose) and pxgemr2d (layout transformation) functions. So, by using cosma_pxgemm you are implicitly also using our implementations of pxtran and pxgemr2d provided by COSTA. We do this on purpose, as COSTA offers great speedups.

@kabicm kabicm self-assigned this Apr 12, 2021
@kabicm kabicm added the docs label Apr 12, 2021
@yaoyi92
Copy link
Author

yaoyi92 commented Apr 13, 2021

Dear Marko,

Thank you so much.

So, I end up using these commands to compile a Fortran test file. It seems the -qopenmp and -lstdc++ are necessary here. Is this the correct way to do the linking?

mpiifort -O3 -g -traceback -ip -fp-model precise -xCORE-AVX2 -qopenmp -c Scalapack.f90
mpiifort -qopenmp -lstdc++ Scalapack.o -L/nas/longleaf/home/yiy/softwares-dogwood/cosma/COSMA/install_2/lib64 -lcosma_pxgemm -lcosma -lcosta_scalapack -lcosta -L${MKLROOT}/lib/intel64 -lmkl_scalapack_lp64 -lmkl_blacs_intelmpi_lp64 -lmkl_intel_lp64 -lmkl_gnu_thread -lmkl_sequential -lmkl_core

The test file is

Scalapack.f90

program test
  call pdgemm
end program

@yaoyi92
Copy link
Author

yaoyi92 commented Apr 13, 2021

Dear Marko,

However, if I tried this test file

Scalapack.f90

program test
  call pdgemr2d
end program

It gave me

/nas/longleaf/home/yiy/softwares-dogwood/cosma/COSMA/install_2/lib64/libcosta_scalapack.a(pxgemr2d.cpp.o): In function `pigemr2d':
pxgemr2d.cpp:(.text+0x4d): undefined reference to `void costa::pxgemr2d<int>(int, int, int const*, int, int, int const*, int*, int, int, int const*, int)'
/nas/longleaf/home/yiy/softwares-dogwood/cosma/COSMA/install_2/lib64/libcosta_scalapack.a(pxgemr2d.cpp.o): In function `pigemr2d_':
pxgemr2d.cpp:(.text+0x3ad): undefined reference to `void costa::pxgemr2d<int>(int, int, int const*, int, int, int const*, int*, int, int, int const*, int)'
/nas/longleaf/home/yiy/softwares-dogwood/cosma/COSMA/install_2/lib64/libcosta_scalapack.a(pxgemr2d.cpp.o): In function `pigemr2d__':
pxgemr2d.cpp:(.text+0x58d): undefined reference to `void costa::pxgemr2d<int>(int, int, int const*, int, int, int const*, int*, int, int, int const*, int)'
/nas/longleaf/home/yiy/softwares-dogwood/cosma/COSMA/install_2/lib64/libcosta_scalapack.a(pxgemr2d.cpp.o): In function `PIGEMR2D':
pxgemr2d.cpp:(.text+0x76d): undefined reference to `void costa::pxgemr2d<int>(int, int, int const*, int, int, int const*, int*, int, int, int const*, int)'

Am I missing anything?

@kabicm
Copy link
Collaborator

kabicm commented Apr 13, 2021

Dear Yi, thanks for checking. The latter caused by COSMA using an outdated version of COSTA. I have just updated the COSTA submodule in COSMA. Can you git clone recursively again the whole COSMA repo and try again? The latter should now be fixed.

@kabicm
Copy link
Collaborator

kabicm commented Apr 13, 2021

Sorry, I would need some more time, I have to adapt few more things in COSMA to the latest COSTA version before it can work.

@yaoyi92
Copy link
Author

yaoyi92 commented Apr 13, 2021

I see. No worry. Thank you for letting me know.

@kabicm
Copy link
Collaborator

kabicm commented Apr 14, 2021

The latest commit should fix the issues with the latest version of COSTA. Since the COSTA library was also modified, it would be best to get a fresh new git clone of COSMA.

To answer your question regarding the OpenMP: you are right, we require it. However, most user codes already have OpenMP as a dependency (especially if they use a multithreaded versions of scalapack/lapack/blas). Your way of linking seems correct to me.

Let me know if this works for you and if you have any other issues!

@kabicm kabicm added the enhancement New feature or request label Apr 14, 2021
@kabicm
Copy link
Collaborator

kabicm commented Apr 16, 2021

Hi Yi (@yaoyi92), i just wanted to follow up on my previous comment: does it work for you now?

@yaoyi92
Copy link
Author

yaoyi92 commented Apr 17, 2021

Yes, it works! Thank you so much!

@kabicm
Copy link
Collaborator

kabicm commented Apr 22, 2021

Great, thanks for the feedback, I am glad it works now! The README will be improved soon, so I will now close this issue.

@kabicm kabicm closed this as completed Apr 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants