Scatterv Piece:
Код: Выделить всё
MPI.COMM_WORLD.Scatterv(sendbuf, displs[myrank], sendcounts, displs, MPI.INT,
localWeight, 0, sendcounts[myrank], MPI.INT, SOURCE);
Код: Выделить всё
public static void singleSource(int n, int[] wgt, int[] lengths, int[] displs, int myrank) throws MPIException {
int nlocal = lengths.length;
int firstvtx = displs[myrank];
int lastvtx = firstvtx + nlocal - 1;
int[] marker = new int[nlocal];
System.arraycopy(wgt, 0, lengths, 0, nlocal);
Arrays.fill(marker, 1);
if (SOURCE >= firstvtx && SOURCE
Подробнее здесь: [url]https://stackoverflow.com/questions/78476236/how-do-i-speedup-dijkstras-algorithm-in-mpi-mpjexpress[/url]