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

rocALUTION for fortran #163

Closed
pelyakim opened this issue Jan 31, 2023 · 12 comments
Closed

rocALUTION for fortran #163

pelyakim opened this issue Jan 31, 2023 · 12 comments
Assignees

Comments

@pelyakim
Copy link

Hello, I would like to use rocALUTION for a CFD code to use it on the new machine of CINES (France) Adastra (AMD processors and graphics cards). I would like to solve a pseudo 3D fish equation with the CG solver and an algebraic multi grid preconditioner (SA-AMG). Would you have a fortran interface to use rocALUTION ? Thanks for your answer.

@ntrost57
Copy link
Contributor

ntrost57 commented Jan 31, 2023

Hi @pelyakim
Currently, we do not have an interface for Fortran.

@pelyakim
Copy link
Author

Thank you for your answer. Do you think you can help me to interface my problem in Fortran?

@pelyakim
Copy link
Author

I am currently using the cg-amg.cpp example that I am trying to interface to fortran.

@ntrost57
Copy link
Contributor

ntrost57 commented Jan 31, 2023

There is currently no official support.
However, you could take a look at the PARALUTION library rocALUTION is based on. It contains a FORTRAN plugin and you should be able to convert it for your usage. Check out the tarball and files in src/examples/fortran/ as well as plug-ins/paralution_fortran.cpp.

@pelyakim
Copy link
Author

Thank you for this information. I'm already on it actually! I've got it right on target.

@pelyakim
Copy link
Author

In the code on which I work, we solve a linear system representing a 3D Poisson pseudo equation at each time iteration.
In the fortran code, I have the matrix of this system in CSR format represented by the arrays row_offset, col and val which does not change for the single phase simulation. When I try to use rocALUTION I use the SetDataPtrCSR function to build the matrix that is used in the solver. However, I can't keep this matrix for the next iteration and the values I put in argument (row_offset, col and val) are deallocated I have the impression. What do you advise me to do? Is SetDataPtrCSR the right function to do what I want ? Thank you for your answers and your help. Pierre

@ntrost57
Copy link
Contributor

ntrost57 commented Feb 7, 2023

SetDataPtrCSR() will invalidate the original pointers. The data is not lost, but put inside the rocALUTION object. If you need raw pointer access again, you can use LeaveDataPtrCSR(). Be aware, that calling this functionality will return the data pointers on what ever backend the rocALUTION object was current located at. If you need your pointers on host, you might have to call MoveToHost() prior to LeaveDataPtrCSR(). Also, please note that calling LeaveDataPtrCSR() will invalidate/clear the rocALUTION object. Once you have modified your data, you can however put it back to rocALUTION (SetDataPtrCSR()). That way, you will avoid copying data and just set/get raw pointers.
Does this answer your question?

@pelyakim
Copy link
Author

Thanks for your reply, I used intermediate arrays and the SetDataPtrCSR function with them for building the system matrix. Now I have another problem with the code for use with MPI, we compiled rocALUTION with the option -DSUPPORT_MPI=ON but when running a test case we have in the output logs the function info_rocalution(); returns "Multinode support disabled". In the code, moreover I give the communicator mpi_com_world of MPI_init(). Where do you think the problem comes from? Thanks for your answer. Sincerely, Pierre

@ntrost57
Copy link
Contributor

Are you linking to the correct lib.so file? "Multinode support disabled" tells me you are running with an MPI disabled library.

@pelyakim
Copy link
Author

Normally yes, I checked with ldd myexe and we link well on rocALUTION compiled with the option -DSUPPORT_MPI=ON, is it enough to have MPI support or should we do something else? Moreover, I have an error as soon as I get to the declaration of a GlobalMatrix type.

@ntrost57
Copy link
Contributor

This all tells me, something goes wrong with the linking. Can you make sure, there is no other copy of rocalution installed on the system (e.g. in /opt/rocm/)?

@pelyakim
Copy link
Author

Thanks a lot for your advice, there was indeed another rocalution in /opt/rocm2.3. I fixed the problem by filling the LD_LIBRARY_PATH. Thanks again.

ROCmMathLibrariesBot pushed a commit that referenced this issue Apr 19, 2023
ntrost57 added a commit that referenced this issue May 31, 2023
ROCmMathLibrariesBot pushed a commit that referenced this issue Jul 19, 2023
* updated CHANGELOG

* Revert "Remove RPATH/RUNPATH from ROCm libraries and binaries (#158)" (#159) (#162)

This reverts commit 7969840.

* update expired license (#132)

Co-authored-by: jsandham <james.sandham@amd.com>

* reenable uaamg_double tests (#131)

* add --version|-v option to rocalution-test (#130)

* add --version|-v option to rocalution-test

* removed -v option

* Revert "Remove RPATH/RUNPATH from ROCm libraries and binaries (#158)" (#159)

This reverts commit 7969840.

* fix compilation failures after deprecated functions removed from rocsparse (#135)

Co-authored-by: jsandham <james.sandham@amd.com>

* Fix xnack failures (#134)

* add stream sync after rocblas dot product calls

* fix xnack failures

Co-authored-by: jsandham <james.sandham@amd.com>

* typo in doc (#138)

* removed compiler optimization as it might break when cross compiling (#147)

* shrinking test size to run on 8GB cards (#150)

* weaking bicgstabl test tolerance to make it pass with wf32 mode (#151)

* changelog

* Revert "fix compilation failures after deprecated functions removed from rocsparse (#135)"

This reverts commit 8c56390.

* Fix failing HSA_XNACK=1 tests (#162) (#171)

* Fix failing HSA_XNACK=1 tests (#162)

* Fix failing HS_XNACK=1 tests when converting from csr2ell on the device

* add HSA_XNACK=1 CI testing to rocalution

* fix copywrite

---------

Co-authored-by: jsandham <james.sandham@amd.com>

* use stream 0 in hipStramSynchronize as we dont have HIPSTREAM(backend->HIP_stream_current) in 5.6 yet

---------

Co-authored-by: jsandham <james.sandham@amd.com>

* msvs omp fix (#163)

* changelog updated

* Documentation cherrypick 5.7 (#185)

* Standardize rocALUTION documentation builds (#156)

* Remove old configuration files (#157)

* remove old config

* remove old requirements file

* Removes old scripts to build docs replaced by rocm-docs-core and commands to use old scripts in Jenkins static analysis

* Add dependabot config and pin rocm-docs-core (#160)

* Update dependabot config (#164)

Co-authored-by: samjwu <samjwu@users.noreply.github.com>

* Bump rocm-docs-core from 0.2.0 to 0.6.0 in /docs/.sphinx (#165)

Bumps [rocm-docs-core](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.2.0 to 0.6.0.
- [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases)
- [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/commits/v0.6.0)

---
updated-dependencies:
- dependency-name: rocm-docs-core
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump rocm-docs-core from 0.6.0 to 0.7.1 in /docs/.sphinx (#167)

Bumps [rocm-docs-core](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.6.0 to 0.7.1.
- [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases)
- [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md)
- [Commits](ROCm/rocm-docs-core@v0.6.0...v0.7.1)

---
updated-dependencies:
- dependency-name: rocm-docs-core
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump rocm-docs-core from 0.7.1 to 0.8.0 in /docs/.sphinx (#170)

Bumps [rocm-docs-core](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.7.1 to 0.8.0.
- [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases)
- [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md)
- [Commits](ROCm/rocm-docs-core@v0.7.1...v0.8.0)

---
updated-dependencies:
- dependency-name: rocm-docs-core
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update documentation requirements (#173)

Co-authored-by: samjwu <samjwu@users.noreply.github.com>

* Bump rocm-docs-core from 0.11.0 to 0.11.1 in /docs/.sphinx (#177)

Bumps [rocm-docs-core](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.11.0 to 0.11.1.
- [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases)
- [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md)
- [Commits](ROCm/rocm-docs-core@v0.11.0...v0.11.1)

---
updated-dependencies:
- dependency-name: rocm-docs-core
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump rocm-docs-core from 0.11.1 to 0.13.1 in /docs/.sphinx (#181)

Bumps [rocm-docs-core](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.11.1 to 0.13.1.
- [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases)
- [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md)
- [Commits](ROCm/rocm-docs-core@v0.11.1...v0.13.1)

---
updated-dependencies:
- dependency-name: rocm-docs-core
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump rocm-docs-core from 0.13.1 to 0.13.2 in /docs/.sphinx (#182)

Bumps [rocm-docs-core](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.13.1 to 0.13.2.
- [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases)
- [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md)
- [Commits](ROCm/rocm-docs-core@v0.13.1...v0.13.2)

---
updated-dependencies:
- dependency-name: rocm-docs-core
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump rocm-docs-core from 0.13.2 to 0.13.3 in /docs/.sphinx (#183)

Bumps [rocm-docs-core](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.13.2 to 0.13.3.
- [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases)
- [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md)
- [Commits](ROCm/rocm-docs-core@v0.13.2...v0.13.3)

---
updated-dependencies:
- dependency-name: rocm-docs-core
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump rocm-docs-core from 0.13.3 to 0.13.4 in /docs/.sphinx (#184)

Bumps [rocm-docs-core](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.13.3 to 0.13.4.
- [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases)
- [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md)
- [Commits](ROCm/rocm-docs-core@v0.13.3...v0.13.4)

---
updated-dependencies:
- dependency-name: rocm-docs-core
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Sam Wu <sjwu@ualberta.ca>
Co-authored-by: Sam Wu <samwu103@amd.com>
Co-authored-by: samjwu <samjwu@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* added support for gfx940,gfx941,gfx942

* Get CI dependencies from same branch

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: James Sandham <33790278+jsandham@users.noreply.github.com>
Co-authored-by: jsandham <james.sandham@amd.com>
Co-authored-by: Angelo Gonzales <48339672+Angeloo01@users.noreply.github.com>
Co-authored-by: Sam Wu <sjwu@ualberta.ca>
Co-authored-by: Sam Wu <samwu103@amd.com>
Co-authored-by: samjwu <samjwu@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Eiden Yoshida <eiden.yoshida@amd.com>
Co-authored-by: Eiden Yoshida <47196116+eidenyoshida@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants