# Tag Info

## Hot answers tagged mpi

30

There is one real and one practical reason. First, MPI was developed at a time when machines had exactly one processor core and when we wanted to couple different machines. It is today used on clusters of tens of thousands of machines, each of which happens to have many cores but the point is that it's still separate machines. Now, a processor core on ...

9

Wolfgang Bangerth's answer is totally correct, and I only want to add one practical aspect. Portability across hardware Let's say you write a research code from scratch. You have a powerful multi-core shared memory machine at your department which can do the job. If you start out with a thread-based implementation, you can reach good performance on this ...

2

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 could do the following: mpirun -np 8 program_script where program_script: #!/bin/bash your_program > program.out\$PMPI_RANK and then for i in seq 1 8 ;...

2

If you're looking for an example, take a look at the MatrixBase class here: https://github.com/dealii/dealii/blob/master/include/deal.II/lac/petsc_matrix_base.h https://github.com/dealii/dealii/blob/master/source/lac/petsc_matrix_base.cc

1

MPI solves a different problem than multithreading, whether it's done via pthreads or OpenMP: Multithreading is designed to take advantage of a single, big machine, but is restricted to that one machine. If you server only has 64 processor cores, that's the max. amount of threads that can be run (if you care for performance, that is). MPI is designed to ...

1

It's possible to use VTK library and its parallel IO built-in mechanism to write the files from each rank to different file and ParaView could combine them again to show you the visualization. Also, I should say I don't have a FORTRAN example and unfortunately VTK doesn't support FORTRAN officially. So, I'll show you a C++ example, which I'm not sure how ...

1

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 looks correct, but you're obscuring one crucial detail: how is your "v" array allocated? Are you using explicit lower bounds for that? You specify "real" has the ...

1

The whole point of the guru interface is to do complicated FFTs without copying the data into contiguous arrays. This advantage is not very important if data needs to be communicated through MPI anyway. Taking advantage of a guru like interface would be complicated and ineffective in an MPI setting. In other words, if your data is not in the expected MPIFFTW ...

Only top voted, non community-wiki answers of a minimum length are eligible