CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

some question about unstructured grids

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 2, 2011, 08:46
Default some question about unstructured grids
  #1
Member
 
L.Y LIN
Join Date: Mar 2010
Posts: 49
Rep Power: 16
iilw1314 is on a distinguished road
hi guys,i'm wondering how to parallelize the code for unstructured grids with adaption and can implicit scheme aply to code for unstructured grids with adpation.any suggestion or any guid ?thank you very much!
iilw1314 is offline   Reply With Quote

Old   March 2, 2011, 09:25
Default
  #2
Senior Member
 
Join Date: Nov 2009
Posts: 411
Rep Power: 20
DoHander is on a distinguished road
A simple and effective approach will be to parallelize your main loops by using OpenMP or CUDA threads. This works for a multicore computer or for a computer with one or more graphic cards.

If you plan to use more computers for the task, you will need to decompose your grid in pieces and solve each piece on a separate computer using MPI. I have more experience with the first approach so I can't give you more advice for domain decomposition and MPI.

Do
DoHander is offline   Reply With Quote

Old   March 3, 2011, 22:24
Default
  #3
Member
 
L.Y LIN
Join Date: Mar 2010
Posts: 49
Rep Power: 16
iilw1314 is on a distinguished road
your reply is appreciated.thank you.OPENMP seems useless because i can only parallelize 90% of my code.MPI seems difficult with unstructured grids especially with adaption,i have not found any paper that describle how to do it with MPI.
thank you again.
iilw1314 is offline   Reply With Quote

Old   March 4, 2011, 22:27
Default
  #4
Senior Member
 
Martin Hegedus
Join Date: Feb 2011
Posts: 500
Rep Power: 19
Martin Hegedus is on a distinguished road
I'd suggest starting from the basics and moving to more complex methodologies. Start with pthreads. Write a simple example code with that. It is relatively easy to do for CFD codes as long as you are diligent about threads not clobbering each others memory. Luckily, CFD codes are very systematic and organized. User interfaces are orders of magnitude more difficult. One tip is to ensure that the memory you are using to perform a calculation is not the memory you are writing to, i.e. results_memory_set_b = f(memory_set_a). Then, if you want, move on to OpenMP. I guess I'm not sure why OpenMP is useless for your application. Granted, I use pthreads for my multithreading work since it is straight forward. But OpenMP works too. Then move onto MPI if you want a multi-machine appliction.
Martin Hegedus is offline   Reply With Quote

Old   March 7, 2011, 18:28
Default
  #5
Member
 
L.Y LIN
Join Date: Mar 2010
Posts: 49
Rep Power: 16
iilw1314 is on a distinguished road
thank you for your answers,my code actually can only be parallelized up to about 70%~80% of it,it means that you will not get good efficiency for the bottleneck ,do u know any method or information about how to parallelize the code with adaptive grids with MPI?
iilw1314 is offline   Reply With Quote

Old   March 7, 2011, 19:52
Default
  #6
Senior Member
 
Martin Hegedus
Join Date: Feb 2011
Posts: 500
Rep Power: 19
Martin Hegedus is on a distinguished road
Sorry, I do not know of a detailed "How To" guide for converting an adaptive grid methodology for use with MPI. I assume it is implementation specific. I assume you have taken a look at other software out there in regards to this.

Out of curiosity, what are the 20%-30% parts of the code that you can not parallelize?
Is it the adaptation method? I assume you are using an explicit solver. Or does your reference to implicit solver in your first question mean your code is an implicit solver? Note, I am neglecting issues of memory bandwidth.

Unfortunately, in the end, if you can not parallelize your code for multiple threads then MPI may not help you out either. After all, if you can break up your problem for MPI, you should be able to break up your problem for efficient solution with multiple threads. Again, this is neglecting issues of memory bandwidth.
Martin Hegedus is offline   Reply With Quote

Old   March 8, 2011, 08:52
Default
  #7
Member
 
L.Y LIN
Join Date: Mar 2010
Posts: 49
Rep Power: 16
iilw1314 is on a distinguished road
well,the 20%-30% part can not be parallelized because ,you know in OPENMP the main work to parallelize the code is to treat the "do loop",and some varibles in this loop have conection,so you can not parallelize it.maybe i did not make it clear ,if you are interested in why so difficult ,you should look into some books about OPENMP.

And my code is explicit,and i am trying to use explicit-implicity method in my code right now.you know it is very difficult to do it on unstructured grids.i am trying.

thank you for your reply so much.
iilw1314 is offline   Reply With Quote

Old   March 8, 2011, 10:56
Default
  #8
Senior Member
 
Martin Hegedus
Join Date: Feb 2011
Posts: 500
Rep Power: 19
Martin Hegedus is on a distinguished road
Sorry, just trying to help.

Yes, creating an implicit unstructured solver is a challenging task.

From my own work, parallelizing the creation of the LH and RH matrix for an unstructured solver was straight forward. However, parallelizing the inversion of the LHS matrix for an unstructured solver is implementation dependent. It could be somewhat easy or it could be hard. The devil is in the details. None of my CFD development work explicitly involved grid adaptation, so I can not comment on that aspect of it.

Also, for me, parallelizing an explicit unstructured solver was straight forward.

So I guess you are asking how to parallelize the implicit matrix solving scheme. Sorry, until now, that was not clear for me. Don't get me wrong, I understood going into this that it was an area of possible difficulty. But you could have been new at multithreading, could have been having problems in other areas of your code, or you could have been asking a general question. I had no way of knowing what your level of experience with multi-threading is. And, since you did not provide much detail, I assumed it was on the "get started" level. I will now assume you are very knowledgeable about it. Therefore, your knowledge either exceeds, or is on par with, mine. I probably can not provide much assistance.

I also assume you know that the memory bandwidth bottle neck, resulting from the randomness of the memory storage of an implicit unstructured solver, is a hurdle. In general, the access to main memory is very slow in comparison to the CPU speed and memory is constantly being sent back and forth between the cache and main memory for larger sized unstructured problems. Well, that has been my personal experience. Unfortunately that experience is a few years old and I assume new techniques have been developed to address this. I assume you have much more knowledge of these issues than I.

Once again, I apologize.
Martin Hegedus is offline   Reply With Quote

Old   March 9, 2011, 07:08
Default
  #9
Member
 
L.Y LIN
Join Date: Mar 2010
Posts: 49
Rep Power: 16
iilw1314 is on a distinguished road
well,thank you again.
iilw1314 is offline   Reply With Quote

Old   March 9, 2011, 10:10
Default
  #10
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,290
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
Quote:
Originally Posted by iilw1314 View Post
well,the 20%-30% part can not be parallelized because ,you know in OPENMP the main work to parallelize the code is to treat the "do loop",and some varibles in this loop have conection,so you can not parallelize it.maybe i did not make it clear ,if you are interested in why so difficult ,you should look into some books about OPENMP.

And my code is explicit,and i am trying to use explicit-implicity method in my code right now.you know it is very difficult to do it on unstructured grids.i am trying.

thank you for your reply so much.

It depends on your algorithm, that you will decide how you want do to make it parallel.

You should spent time thinking how you could do or make it parallel, rather than singing that 20-30% of code is impossible to make parallel by openmp.

PS: I have my unstructured grid solver written with openmp and 100% parallel. There is nothing that it does not do in parallel.
arjun is offline   Reply With Quote

Reply

Tags
implicit, parallel, unstructured mesh


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
T.J.Barth/ Aspects of unstructured grids. john Main CFD Forum 1 October 3, 2006 08:00
Script for unstructured grids w2 Main CFD Forum 1 August 17, 2006 08:46
Cell face values computation un unstructured grids Sergio Rossi Main CFD Forum 2 May 28, 2006 11:04
FVM on Unstructured grids for shallow water flows WLH Main CFD Forum 0 June 15, 2005 09:48
Plotting unstructured grids in FAST ?? Radhika Gupta Main CFD Forum 4 December 9, 2001 20:24


All times are GMT -4. The time now is 17:22.