jueves, 5 de diciembre de 2013

Parallel Processing

Parallel processing is the ability to carry out multiple operations or tasks simultaneously. The term is used in the contexts of both human cognition, particularly in the ability of the brain to simultaneously process incoming stimuli, and in parallel computing by machines.


Parallel processing in computers:


Parallel computing is the simultaneous use of more than CPU or processor core to execute a program or multiple computational threads. Ideally, parallel processing makes programs run faster because there are more engines(CPUS or Cores) running it. In practice, it is often difficult to divide a program in such a way that separate CPUs or cores can execute different portions without interfering with each other.

Most computers have just one CPU, but some models have several, and multi-core processor chips are becoming  the norm. There are even computers with thousands of CPUs.

Parallel Computing in the World

The near future will see the increased use of parallel computing technologies at all levels of mainstream computing. Computing hardware increasingly employs parallel techniques to improve computing power for the solution of large scale and computer intensive applications. Cluster and grid technologies make possible high speed computing facilities at vastly reduce costs.


 Tianhe-2

It's a 33.86 petaflops supercomputer located in Guangzhou, China. It was developed by the team of 1300 scientists and engineers.


It is the world's fastest supercomputer according to the TOP500 list for June and November 2013.




domingo, 1 de diciembre de 2013

OPENMP

Hi!

Open Multi-Processing is an application programming interface that supports multi-plataform shared memory multiprocessing programming in C,C++ and fortran on most processor architectures and operating systems, including Solaris, AIX,HP-UX, GNU/Linux, Mac OS X and windows plataforms. It consists of a set of compiler directives, library routines, and environment variables that influence run-time behavior.



 In this picture we can see a process using OPENMP. In this case all 4 CPUs work, but only one is the master CPU ..

Simpson and Montecarlo


Hi!
Before showing the results of my work in parallel will talk a little about Simpson and montecarlo's method  because I needed to know to solve it : Homework

Homero
Simpson's rule:

In numerical analysis, Simpson's rule is a method for numerical integration, the numerical approximation of definite intregals.
Let the following approximation:

\(\small \displaystyle \int_{a}^{b}f(x) \approx \frac{b-a}{6}[f(a) +4f(\frac{a+b}{2}) + f(b)]\)


We assume a cuadratic function f(x) :


How can we obtain a cuadratic function?

Lagrange Interpolation:

With this the curve approximates a parabola P(x):
$$\small \displaystyle P(x)= f(a)\frac{(x-c)(x-b)}{(a-c)(a-b)} + f(c)\frac{(x-a)(x-b)}{(c-a)(c-b)} + f(b)\frac{(x-a)(x-c)}{(b-a)(b-c)}$$

If i integrate P(x), obtain: \(\displaystyle \int_{a}^{b}P(x) = \frac{b-a}{6}[f(a) +4f(\frac{a+b}{2}) + f(b)]\)

The error in this approximation is proportional to: \(\displaystyle \frac{1}{90}(\frac{b-a}{2})^{5}\)


Monte Carlo method:

Monte Carlo methods are especially useful for simulating systems with many coupled degrees of freedom, such as fluids, disordered materials, strongly coupled solids, and cellular structures.



The result of the last Homework is: 1.881185e+009