how to multiplication large number using mpi?

Can you do it without MPI? Try that first.

You can use the Karatsuba Fast Multiplication algorithm for this purpose. We normally employ this algorithm for cryptographic systems, where we need to multiply large numbers in the range of several thousand digits. Please refer to Wikipedia for the algorithm. You can also read this tutorial better understanding -

Following is a source code that I found after googling. It shows how MPI can be used to perform Karatsuba Multiplication Algorithm in parallel. The code appears in GnuPG as a MPI helper function. Here is the link of the post

There are many other large number multiplication algorithms (source: Wikipedia) that you could use like

* Gauss's complex multiplication algorithm.
* Toom–Cook.
* Fourier transform methods.
* Linear time multiplication.
* Quarter square multiplier.
* Polynomial multiplication.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.