Victor Eijkhout
  • Member for 8 years, 9 months
  • Last seen more than a week ago
Why my parallel code using MPI is much slower than the serial one?
6 votes

The first thing you need to ask yourself: is your problem big enough that the overhead of MPI messaging is less than the work that you save. Your problem size is 10k which is small, but on the other ...

View answer
How to address numerical non-associativity for parallel reduction?
6 votes

For the most part I ditto Jed's answer. However, there is a different way out: Given the size of normal floating point numbers, you can store every number in a 4000-or-so bit fixed point number. So if ...

View answer
Parallelize Scipy iterative methods for linear equation systems(bicgstab) in Python
5 votes

Take a look at the PETSc library, which has a python interface. That allows you to use MPI parallelism which scales up arbitrarily. https://www.mcs.anl.gov/petsc/ It has several variants of the ...

View answer
Distributed (MPI) matrix matrix multiplication
5 votes

You say that you want an MPI version. Then you need to study the literature, as the distributed memory variant of matrix-matrix product are not a simple parallellization of the sequential version. ...

View answer
Searching for recent code source for "Parallel scientific computing in C++ and MPI "
Accepted answer
4 votes

First of all, the book you mention is very old. In fact, it misses the last two MPI standards (3 and 4), and every C++ standard from C++11 on. Secondly, know that MPI has officially no C++ bindings, ...

View answer
simulation outputs differ across hardware platforms
4 votes

How identical are your two runs? Same number of processors at least? If you're doing a parallel reduction then one platform can use a different algorithm, so because of lack of associativity you get ...

View answer
MapReduce with MPI question
Accepted answer
4 votes

As Wolfgang observed, you are basically transposing a connectivity matrix: every process $i$ knows row $i$ that states which $j$ values you're sending to. What you're interested in is the columns: the ...

View answer
Affecting parts of an array outside MPI process efficiently
3 votes

The basic model of MPI is "two-sided communication": you have a sender who knows where to send, and a receiver who knows from where to expect something. In your description that is not the ...

View answer
Send Petsc sequential matrix to another MPI rank
Accepted answer
3 votes

I don't think PETSc supports it. PETSc really thinks in parallel, so it converts at most between distributed matrices and sequential matrices through submatrix taking operations. I would MatGetArray ...

View answer
Parallelizing FEM for elliptical PDEs with n >1
3 votes

I think you've identified some of the major issues. Yes, Finite Element methods are very parallel, because you have all these elements that can often be treated in parallel, but the devil is in the ...

View answer
How to store a TB size array in C++ on a cluster
2 votes

Really the only way to run simulations on a multi-node cluster is to use MPI. And you don't distribute data because that would mean it would start out in one place. With MPI everything is distributed ...

View answer
Parallel output in ASCII-format with MPI
2 votes

The problem with output from parallel processes is that they all go through ssh tunnels, and there is no guarantee in what order they will arrive. Even if you use Send/Recv to sequentialize them. You ...

View answer
CPU usage when a MPI rank waits during a blocking communication
Accepted answer
2 votes

I can confirm that with blocking waits the receiving processes are spinning at 100 percent. They are probably in a polling loop of sorts. With non-blocking receives you get exactly the same behavior: ...

View answer
Why PETSc/MPI uses only 1 processor a number of times, rather than using several as prescribed by mpiexec
2 votes

This behavior typically results from using the wrong mpiexec. It has to be the one from the MPI that you used to install petsc. For instance, if you did --download-mpich during installation it's the ...

View answer
Level scheduling of triangular sparse matrices
Accepted answer
2 votes

You can try to discover parallelism in L and U, but a better approach is to reorder the original matrix. Luby & Jones/Plassman describe this scheme: you can generate a multi-colouring in parallel, ...

View answer
How does MPI differentiate between two computers?
2 votes

Everything Bill Barth wrote is correct. You are confused by MPI processes (or "ranks") and computers. If you do "mpirun -np 18 yourprogram" on a 4-core machine that is not connected to anything, then ...

View answer
Passing in user inputs with mpirun
1 votes

Input from the console may work on process zero, if that runs locally, but will certainly not work on other ranks. However, I wouldn't even do interactive input on process zero. #!/bin/bash if [ $...

View answer
How to begin writing scientific codes in C++ in Trilinos or PETSC style?
Accepted answer
1 votes

Ed Bueler just wrote the perfect book for you: "PETSc for Partial Differential Equations: Numerical Solutions in C and Python" https://epubs.siam.org/isbn/978-1-61197-630-4

View answer
OpenMP: parallelizing calculation of pair interaction forces
Accepted answer
1 votes

So I decided to implement this, and of course I found a bunch of factors that I didn't foresaw in my earlier answer, which I deleted because it contained some patent nonsense. Sequential code ...

View answer
MPI_Test not progressing MPI_Isend/MPI_Irecv requests
1 votes

MPI_Test is a local operation. Do MPI_Iprobe instead. It can also be that your MPI allows you to control asynchronous progress with enviroment variables. Intel MPI does that, I don't know about others....

View answer
Can one safely use an OpenMP parallel loop with Armadillo?
1 votes

Nested used of OpenMP is allowed. However, by default the second level will only get a single thread. If that's ok with you, you're good now. If you want the embedded level to be parallel too, set the ...

View answer
On the reordering of sparse matrices
1 votes

You have found Cuthill McKee, but there is also the "minimum degree" method as well as a bunch of others. Here are some considerations. You state that these method improve caching. Well, ...

View answer
How to compute the mean 2D slice of a 3D set of data in MPI
1 votes

You're doing the right thing by first doing a local reduction and then reducing that single scalar. You're using Reduce followed by Bcast: you should really be using Allreduce. Your code otherwise ...

View answer
How to compute 16 different simulations on parallel with pbs script on the same machine
1 votes

If you system does not have a job launcher facility (or if PBS does not have that built in) you can do a couple of things. Start all 16 processes, and hope that the OS will nicely spread them over ...

View answer
Writing a parallel version of an algorithm. Only which someparts are worth distributing
1 votes

Since you tagged this with "MPI": there is no master node. The stuff that is too trivial should be done redundantly on every process. Bear in mind that even sending a single byte through an MPI ...

View answer
How do I interpret the results from MPI_Wtime()?
1 votes

There can be any number of reasons for different times on different processes. If one process has lots of local work after the last MPI communication, it will report a longer running time. If one ...

View answer
C - OpenMP, MPI, Serial Program
1 votes

Let's say for simplicity that you have a 1D problem, and you discretize it over N grid points. Your code will have a bunch of loops from 1 to N that do stencil operations -- assuming you're not doing ...

View answer
Petsc Mat object in class
0 votes

Put the MatDestroy in your destructor. Your logic for setting elements is completely wrong. The easiest solution is: // stuff for ( .... i .... ) for ( ... j ... ) for ( .... l ... ) ...

View answer
Guaranteed equality between binary results with increasing MPI processes
0 votes

The associativity issue is address in other answers (and see my comment); it mostly plays in collectives. Another thing to watch out for it not to use wildcard receives. If the order of incoming ...

View answer
When is MPI_Wait necessary for non-blocking calls?
0 votes

You are right that there are situations where you can determine by reasoning that an Isend or Irecv has been concluded, and so you don't have to do a Wait semantically. In that case, the only reason ...

View answer