CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Has any one tried AmgX on OpenFOAM

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 24, 2015, 03:25
Post Has any one tried AmgX on OpenFOAM
  #1
New Member
 
Suraj Salvi
Join Date: Jul 2015
Posts: 3
Rep Power: 10
surajsalvip@gmail.com is on a distinguished road
Has any one configured AmgX library with OpenFOAM or any one knows how to configure a third party library with OpenFOAM please help

Last edited by surajsalvip@gmail.com; November 24, 2015 at 04:38.
surajsalvip@gmail.com is offline   Reply With Quote

Old   January 10, 2023, 07:36
Default AmgX on OpenFOAM
  #2
New Member
 
Join Date: Dec 2022
Posts: 23
Rep Power: 3
Nitish25 is on a distinguished road
Quote:
Originally Posted by surajsalvip@gmail.com View Post
Has any one configured AmgX library with OpenFOAM or any one knows how to configure a third party library with OpenFOAM please help
hey can u kindly help me to integrate AmgX library with OpenFOAM.
Nitish25 is offline   Reply With Quote

Old   January 10, 2023, 13:22
Default
  #3
Senior Member
 
Domenico Lahaye
Join Date: Dec 2013
Posts: 722
Blog Entries: 1
Rep Power: 17
dlahaye is on a distinguished road
What kind of help do you require?

Did you manage to install AMGX on your system? Can you run AMFX on some tutorial example?
dlahaye is offline   Reply With Quote

Old   January 10, 2023, 23:34
Default
  #4
New Member
 
Join Date: Dec 2022
Posts: 23
Rep Power: 3
Nitish25 is on a distinguished road
Quote:
Originally Posted by dlahaye View Post
What kind of help do you require?

Did you manage to install AMGX on your system? Can you run AMFX on some tutorial example?
yes i have installed amgx and able to run example of amgx on GPU.
I want to Know how to integrate amgx to OpenFOAM to run case(e.g Motorbike ) on GPU.
Nitish25 is offline   Reply With Quote

Old   January 11, 2023, 03:36
Default
  #5
Senior Member
 
Domenico Lahaye
Join Date: Dec 2013
Posts: 722
Blog Entries: 1
Rep Power: 17
dlahaye is on a distinguished road
You need to extract the matrix and rhs-vector from OpenFoam and plug it into AMGX.

Have you already looked into the OpenFoam matrix format, see e.g. https://www.linkedin.com/pulse/openf...menico-lahaye/?

What matrix format does AMGX require?

EDIT: AMGX seems to require the compressed row storage (CRS) format for the sparse matrix. It thus amounts to converting the LDU matrix format to the CRS format. This conversion has been implemented before. It is present in e.g. the PARALUTION software, see http://github.com/openparalution/Paralution-Open-Source

Alternative is to write the linear system to file using the ofgdb debugger and to take it from here.

Last edited by dlahaye; January 11, 2023 at 09:35. Reason: Typo
dlahaye is offline   Reply With Quote

Old   January 11, 2023, 04:51
Smile
  #6
New Member
 
Join Date: Dec 2022
Posts: 23
Rep Power: 3
Nitish25 is on a distinguished road
Quote:
Originally Posted by dlahaye View Post
You need to extract the matrix and rhs-vector from OpenFoam and plug it into AMGX.

Have you already looked into the OpenFoam matrix format, see e.g. https://www.linkedin.com/pulse/openf...menico-lahaye/?

What matrix format does AMGX require?
can u help me with steps, how to extract the matrix and rhs-vector from OpenFoam and plug it into AMGX,
basically I want to calculate performance on gpu of hpc motorbike case.
for that we know that we hv to use gpu solver to solve on gpu.
so I hv installed openfoam-1912 and able to run on cpu.
and for running on gpu, I hv installed and build amgx library in same location where openfoam present parallelly(in amgx directory there is examples directory in which there is some cuda program that i am able to execute on gpu).
also cuda/11.2
kindly reply
Nitish25 is offline   Reply With Quote

Old   January 13, 2023, 07:48
Default
  #7
Senior Member
 
Domenico Lahaye
Join Date: Dec 2013
Posts: 722
Blog Entries: 1
Rep Power: 17
dlahaye is on a distinguished road
Greetings,

The motorbike tutorial is a tutorial for the simpleFoam solver. I humbly suggest to start from the flange tutorial for the laplacianFoam solver.

I suggest to copy the laplacianFoam solver from src/application to working dir, rename into myLaplacianFoam, compile and run it.

In a next step, I suggest to copy the AMGX tutorial into myLaplacianFoam, compile, link with AMGX and run it.

In a next-next, we can discuss extracting matrix and right-hand vector from the fvScalarMatrix that myLaplacianFoam generates, and plug it into AMGX.

I happy to look into simpleFoam later.

Does this make sense?
dlahaye is offline   Reply With Quote

Old   January 18, 2023, 06:18
Default
  #8
New Member
 
Join Date: Dec 2022
Posts: 23
Rep Power: 3
Nitish25 is on a distinguished road
Quote:
Originally Posted by dlahaye View Post
Greetings,

The motorbike tutorial is a tutorial for the simpleFoam solver. I humbly suggest to start from the flange tutorial for the laplacianFoam solver.

I suggest to copy the laplacianFoam solver from src/application to working dir, rename into myLaplacianFoam, compile and run it.

In a next step, I suggest to copy the AMGX tutorial into myLaplacianFoam, compile, link with AMGX and run it.

In a next-next, we can discuss extracting matrix and right-hand vector from the fvScalarMatrix that myLaplacianFoam generates, and plug it into AMGX.

I happy to look into simpleFoam later.

Does this make sense?
hello, I hv completed first three statements that u hv suggested, can u kindly tell me the next step(In a next-next, we can discuss extracting matrix and right-hand vector from the fvScalarMatrix that myLaplacianFoam generates, and plug it into AMGX. ), meaning and how can I proceed to run this case on GPU.
kindly reply.
Nitish25 is offline   Reply With Quote

Old   January 18, 2023, 07:15
Default
  #9
Senior Member
 
Domenico Lahaye
Join Date: Dec 2013
Posts: 722
Blog Entries: 1
Rep Power: 17
dlahaye is on a distinguished road
Congrats for the progress!

I need to be brief now.

You can, however, copy what the paralution package does.

Download paralution from https://github.com/openparalution/Pa...n-1.1.0.tar.gz, and navigate to src/plug-inns/OPENFOAM to see how paralution resolves the issue that you raise.

Please give it a look. I am happy to provide more elaborate input where required.
dlahaye is offline   Reply With Quote

Old   January 19, 2023, 02:01
Default
  #10
New Member
 
Join Date: Dec 2022
Posts: 23
Rep Power: 3
Nitish25 is on a distinguished road
Quote:
Originally Posted by dlahaye View Post
Congrats for the progress!

I need to be brief now.

You can, however, copy what the paralution package does.

Download paralution from https://github.com/openparalution/Pa...n-1.1.0.tar.gz, and navigate to src/plug-inns/OPENFOAM to see how paralution resolves the issue that you raise.

Please give it a look. I am happy to provide more elaborate input where required.
hey, i hv download paralution:u can see the attachment.
but I am confused how to integrate Openfoam into Amgx . so that i can run our case on gpu.
kindly reply
Attached Images
File Type: jpg Screenshot 2023-01-19 105324.jpg (104.1 KB, 17 views)
Nitish25 is offline   Reply With Quote

Old   January 19, 2023, 03:26
Default
  #11
Senior Member
 
Domenico Lahaye
Join Date: Dec 2013
Posts: 722
Blog Entries: 1
Rep Power: 17
dlahaye is on a distinguished road
Well done on the download.

I do not understand your question.

My understanding is that we want to proceed as follows:

1/ extract linear system from laplacianFoam;

2/ plug linear system into AmgX;

3/ solve linear system using AmgX;

Do we have an agreement on these steps? If not, could you please explain your doubts more elaborately.
dlahaye is offline   Reply With Quote

Old   January 19, 2023, 04:17
Default
  #12
New Member
 
Join Date: Dec 2022
Posts: 23
Rep Power: 3
Nitish25 is on a distinguished road
Quote:
Originally Posted by dlahaye View Post
Well done on the download.

I do not understand your question.

My understanding is that we want to proceed as follows:

1/ extract linear system from laplacianFoam;

2/ plug linear system into AmgX;

3/ solve linear system using AmgX;

Do we have an agreement on these steps? If not, could you please explain your doubts more elaborately.
hello
see what i hv done till now is :
I hv install and build amgx library(we know that Amgx is GPU-accelerated linear solver package.)
and also install openFOAM-v2112(a CFD tool).
i want, when i run case on openFoam, it should not run on CPU but on GPU.

from ur suggestion what i hv done till now is:
I hv copied the laplacianFoam solver from OpenFOAM/OpenFOAM-v2112/applications/solvers
to working dir, rename into myLaplacianFoam, and in Make/option file i hv added the amgx library and compile and run it. Now i able to see new myLaplacianFoam file in bin directory.

and also i hv copied the flange tutorial for the laplacianFoam solver
(OpenFOAM/OpenFOAM-v2112/tutorials/basic/laplacianFoam/flange)
in fvSolution file when i gave solver name to myLaplacianFoam it is running.(but not on GPU).

Kindly reply

for getting better performance I want to run on GPU
Nitish25 is offline   Reply With Quote

Old   January 19, 2023, 06:42
Default
  #13
Senior Member
 
Domenico Lahaye
Join Date: Dec 2013
Posts: 722
Blog Entries: 1
Rep Power: 17
dlahaye is on a distinguished road
Thx for update.

Go back to Item #7 in above list and try to copy AMGX tutorial into myLaplacianFoam, compile, link with AMGX library by editing Make/files appropriate and run.

Talk soon.
dlahaye is offline   Reply With Quote

Old   January 19, 2023, 23:40
Default
  #14
New Member
 
Join Date: Dec 2022
Posts: 23
Rep Power: 3
Nitish25 is on a distinguished road
Quote:
Originally Posted by dlahaye View Post
Thx for update.

Go back to Item #7 in above list and try to copy AMGX tutorial into myLaplacianFoam, compile, link with AMGX library by editing Make/files appropriate and run.

Talk soon.
hlo
I did not get u.
Inside the amgx directory there is no tutorial directory.
can we connect on meet , where I can show my screen.
kindly reply.
Attached Images
File Type: jpg Screenshot 2023-01-20 100957.jpg (47.6 KB, 7 views)
Nitish25 is offline   Reply With Quote

Old   January 20, 2023, 03:41
Default
  #15
Senior Member
 
Domenico Lahaye
Join Date: Dec 2013
Posts: 722
Blog Entries: 1
Rep Power: 17
dlahaye is on a distinguished road
1/ In Item #4 above you confirm that you ran an example of AMGX. What example is this? Where is the code of this example?

2/ How did you compile this example? Can you show me the output of the compiler?

3/ How do like this link this example with the AMGX library? Can you show me the output of the linker?

4/ Please confirm that you see a subdirectory called Make in the directory called myLaplacianFoam. Please confirm that you see the files called files and options within the Make directory. Please confirm that it is your understand that EXE_INC should be extended with the above output of the compiler and that EXE_LIBS should be extended with the above output of the linker.

5/ Please let me know in what time zone you live in such a way to set-up an appropriate online meeting.
dlahaye is offline   Reply With Quote

Old   January 20, 2023, 03:55
Default
  #16
New Member
 
Join Date: Dec 2022
Posts: 23
Rep Power: 3
Nitish25 is on a distinguished road
Quote:
Originally Posted by dlahaye View Post
1/ In Item #4 above you confirm that you ran an example of AMGX. What example is this? Where is the code of this example?

2/ How did you compile this example? Can you show me the output of the compiler?

3/ How do like this link this example with the AMGX library? Can you show me the output of the linker?

4/ Please confirm that you see a subdirectory called Make in the directory called myLaplacianFoam. Please confirm that you see the files called files and options within the Make directory. Please confirm that it is your understand that EXE_INC should be extended with the above output of the compiler and that EXE_LIBS should be extended with the above output of the linker.

5/ Please let me know in what time zone you live in such a way to set-up an appropriate online meeting.

Sir Can u meet now (I am from india (GMT +5:30)) if you free now i will send the meeting link
(Google meet)
Thanks & Regards
Nitish25 is offline   Reply With Quote

Old   January 20, 2023, 04:23
Default
  #17
Senior Member
 
Domenico Lahaye
Join Date: Dec 2013
Posts: 722
Blog Entries: 1
Rep Power: 17
dlahaye is on a distinguished road
Let us talk very briefly now and find a slot to talk more extensively next week.

Please send me link for Google meet either here or on private cfdonline address.

Dhanyavaad.
dlahaye is offline   Reply With Quote

Old   January 20, 2023, 04:40
Default
  #18
New Member
 
Join Date: Dec 2022
Posts: 23
Rep Power: 3
Nitish25 is on a distinguished road
Quote:
Originally Posted by dlahaye View Post
Let us talk very briefly now and find a slot to talk more extensively next week.

Please send me link for Google meet either here or on private cfdonline address.

Dhanyavaad.
Sir please join this link(GMT 9:45 )20-01-2023
https://meet.google.com/goe-qnus-mbo

Thanks
Nitish25 is offline   Reply With Quote

Old   January 20, 2023, 14:54
Default
  #19
Senior Member
 
Klaus
Join Date: Mar 2009
Posts: 250
Rep Power: 22
klausb will become famous soon enough
Hello,

the external-solver extension which is also called "petsc4Foam" comes with the recent OpenFOAM releases from openfoam.com . With this extension, it's possible to use the Petsc linear algebra solvers as OpenFOAM solvers. You could link this external-solver extension "petsc4Foam" to AmgX using the AmgXWrapper:

OpenFOAM > external-solver extension "petsc4Foam" (linking OpenFOAM with Petsc) > AmgXWrapper (linking Petsc with AmgX) > AmgX

https://github.com/barbagroup/AmgXWrapper

AmgXWrapper library details from the Author:

https://on-demand.gputechconf.com/gt...-cfd-codes.pdf

You can find the external-solver under: OpenFOAM-v2206/modules/external-solver




There are also three other ways to run Petsc solvers on GPUs, see: https://petsc.org/release/overview/gpu_roadmap/




Klaus
dlahaye likes this.

Last edited by klausb; January 20, 2023 at 15:26. Reason: There are three other ways to run Petsc solvers on GPUs
klausb is offline   Reply With Quote

Old   January 23, 2023, 01:20
Default
  #20
New Member
 
Join Date: Dec 2022
Posts: 23
Rep Power: 3
Nitish25 is on a distinguished road
Quote:
Originally Posted by klausb View Post
Hello,

the external-solver extension which is also called "petsc4Foam" comes with the recent OpenFOAM releases from openfoam.com . With this extension, it's possible to use the Petsc linear algebra solvers as OpenFOAM solvers. You could link this external-solver extension "petsc4Foam" to AmgX using the AmgXWrapper:

OpenFOAM > external-solver extension "petsc4Foam" (linking OpenFOAM with Petsc) > AmgXWrapper (linking Petsc with AmgX) > AmgX

https://github.com/barbagroup/AmgXWrapper

AmgXWrapper library details from the Author:

https://on-demand.gputechconf.com/gt...-cfd-codes.pdf

You can find the external-solver under: OpenFOAM-v2206/modules/external-solver




There are also three other ways to run Petsc solvers on GPUs, see: https://petsc.org/release/overview/gpu_roadmap/




Klaus
hello Klaus
can you kindly tell how to link the AmgxWrapper with the petsc4Foam , as
i have link petsc4Foam with openfoam and have also successfully build
amgx and amgxwrapper ,
Attached Images
File Type: jpg petsc4Foam.jpg (36.1 KB, 12 views)
Nitish25 is offline   Reply With Quote

Reply

Tags
amgx, gpu, library, nvidia, openfoam 2.2.x


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Frequently Asked Questions about Installing OpenFOAM wyldckat OpenFOAM Installation 3 November 14, 2023 11:58
OpenFOAM Foundation releases OpenFOAMŪ 3.0.0 CFDFoundation OpenFOAM Announcements from OpenFOAM Foundation 1 November 7, 2015 15:16
OpenFOAM Foundation Releases OpenFOAM v2.3.0 opencfd OpenFOAM Announcements from OpenFOAM Foundation 3 December 23, 2014 03:43
Suggestion for a new sub-forum at OpenFOAM's Forum wyldckat Site Help, Feedback & Discussions 20 October 28, 2014 09:04
64bitrhel5 OF installation instructions mirko OpenFOAM Installation 2 August 12, 2008 18:07


All times are GMT -4. The time now is 20:55.