Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MPI Triangular Topology

I have some computation to do over an (upper-)triangular matrix and I was thinking using MPI for that. It seems that it would be convenient to define a proper topology for that. The Cartesian topology goes in that direction but not quite what I need yet. I would need a topology that gives me the rank of the process on the strict upper triangular matrix, i.e. strictly above the diagonal.

The type of triangular topology I would need would look as follows (say for 3x3 cartesian grid):

i       j      rank     
0       0      NULL       
0       1       1 
0       2       2
1       0      NULL       
1       1      NULL
1       2       3
2       0      NULL       
2       1      NULL    
2       2      NULL

Thanks for your help!

like image 981
SumItUp Avatar asked Jun 25 '26 10:06

SumItUp


1 Answers

MPI does not provide the type of topology that you are asking for. It provides either the Cartesian one or a general graph topology. With the general graph topology, each rank has a list of neighbouring ranks, but it's hard to map a half grid onto that.

You might want to write your own set of routines to manage such kind of topology. What you actually have to reimplement are the functions to map coordinates to rank and vice versa, as well as the functions to find the neighbours of a given rank. You can precompute the mapping and cache it in the corresponding communicator as attributes, namely using the MPI_COMM_GET_ATTR and MPI_COMM_SET_ATTR calls.

like image 124
Hristo Iliev Avatar answered Jun 26 '26 23:06

Hristo Iliev



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!