![]() |
Computational Science Based on HPC
|
This file contains the implementation of the parallel versions of the oscillation simulation in 1D and 2D. More...
Go to the source code of this file.
Functions | |
| char * | _simulate_damped_os_parallel_mpi_omp (double max_amplitude, double length, double mass, double gravity, double k, double Ao, double Vo, double FI, double time_limit, double step_size, double damping_coefficent, int number_of_files) |
| function simulates simple harmonic motion (Simple Spring Motion). | |
| int | _execution_time_damped_os_parallel_mpi_omp (double max_amplitude, double length, double mass, double gravity, double k, double Ao, double Vo, double FI, double time_limit, double step_size, double damping_coefficent, int number_of_files) |
| This function calculate the execution time of simulating simple harmonic motion (Simple Spring Motion). | |
| char * | _simulate_damped_os_parallel_mpi (double max_amplitude, double length, double mass, double gravity, double k, double Ao, double Vo, double FI, double time_limit, double step_size, double damping_coefficent, int number_of_files) |
| This function simulates simple harmonic motion (Simple Spring Motion). | |
| int | _execution_time_damped_os_parallel_mpi (double max_amplitude, double length, double mass, double gravity, double k, double Ao, double Vo, double FI, double time_limit, double step_size, double damping_coefficent, int number_of_files) |
| function calculate execution time simulating simple harmonic motion (Simple Spring Motion). | |
| double | _execution_time_damped_os_parallel_omp (double max_amplitude, double length, double mass, double gravity, double k, double Ao, double Vo, double FI, double time_limit, double step_size, double damping_coefficent, int number_of_files, int num_of_threads) |
| This function calculate execution time simulating simple harmonic motion (Simple Spring Motion). | |
This file contains the implementation of the parallel versions of the oscillation simulation in 1D and 2D.
| int _execution_time_damped_os_parallel_mpi | ( | double | max_amplitude, |
| double | length, | ||
| double | mass, | ||
| double | gravity, | ||
| double | k, | ||
| double | Ao, | ||
| double | Vo, | ||
| double | FI, | ||
| double | time_limit, | ||
| double | step_size, | ||
| double | damping_coefficent, | ||
| int | number_of_files | ||
| ) |
function calculate execution time simulating simple harmonic motion (Simple Spring Motion).
using numerical solution of stepwise precision using equation (e^(-damping_coefficent / (2 * mass)) * t)*sin(wt+fi)), where this equation calculates the displacement of mass on y-axis, this function also calculates the acceleration and velocity in each time step. This function is implemented using MPI, The Number of iteration are divided upon number of processes using MPI.
| max_amplitude | starting position of the mass where the simulation will start |
| length | the maximum length of the spring (uncompressed spring) |
| mass | mass of bob |
| gravity | |
| k | stiffness of the spring |
| Ao | initial acceleration |
| Vo | initial velocity |
| FI | FI constant which will be added to the (wt) inside the sine calculation |
| time_limit | the time when the simulation will stop |
| step_size | how much the simulation will skip per iteration |
| damping_coefficent | damping factor affecting on the system |
| number_of_files |
| int _execution_time_damped_os_parallel_mpi_omp | ( | double | max_amplitude, |
| double | length, | ||
| double | mass, | ||
| double | gravity, | ||
| double | k, | ||
| double | Ao, | ||
| double | Vo, | ||
| double | FI, | ||
| double | time_limit, | ||
| double | step_size, | ||
| double | damping_coefficent, | ||
| int | number_of_files | ||
| ) |
This function calculate the execution time of simulating simple harmonic motion (Simple Spring Motion).
using numerical solution of stepwise precision using equation (e^(-damping_coefficent / (2 * mass)) * t)*sin(wt+fi)), where this equation calculates the displacement of mass on y-axis, this function also calculates the acceleration and velocity in each time step. This function is implemented using MPI and Openmp together, The Number of iteration are divided upon number of processes using MPI, while each processes is calculating its values Openmp used to run the calculations per process in parallel way
| max_amplitude | starting position of the mass where the simulation will start |
| length | the maximum length of the spring (uncompressed spring) |
| mass | mass of bob |
| gravity | |
| k | stiffness of the spring |
| Ao | initial acceleration |
| Vo | initial velocity |
| FI | FI constant which will be added to the (wt) inside the sine calculation |
| time_limit | the time when the simulation will stop |
| step_size | how much the simulation will skip per iteration |
| damping_coefficent | damping factor affecting on the system |
| number_of_files |
| double _execution_time_damped_os_parallel_omp | ( | double | max_amplitude, |
| double | length, | ||
| double | mass, | ||
| double | gravity, | ||
| double | k, | ||
| double | Ao, | ||
| double | Vo, | ||
| double | FI, | ||
| double | time_limit, | ||
| double | step_size, | ||
| double | damping_coefficent, | ||
| int | number_of_files, | ||
| int | num_of_threads | ||
| ) |
This function calculate execution time simulating simple harmonic motion (Simple Spring Motion).
using numerical solution of stepwise precision using equation (e^(-damping_coefficent / (2 * mass)) * t)*sin(wt+fi)), where this equation calculates the displacement of mass on y-axis, this function also calculates the acceleration and velocity in each time step. This function is implemented using Openmp, The for loop is divided upon multiple threads.
| max_amplitude | starting position of the mass where the simulation will start |
| length | the maximum length of the spring (uncompressed spring) |
| mass | mass of bob |
| gravity | |
| k | stiffness of the spring |
| Ao | initial acceleration |
| Vo | initial velocity |
| FI | FI constant which will be added to the (wt) inside the sine calculation |
| time_limit | the time when the simulation will stop |
| step_size | how much the simulation will skip per iteration |
| damping_coefficent | damping factor affecting on the system |
| number_of_files | |
| num_of_threads | number of threads needed to execute the code |
| char * _simulate_damped_os_parallel_mpi | ( | double | max_amplitude, |
| double | length, | ||
| double | mass, | ||
| double | gravity, | ||
| double | k, | ||
| double | Ao, | ||
| double | Vo, | ||
| double | FI, | ||
| double | time_limit, | ||
| double | step_size, | ||
| double | damping_coefficent, | ||
| int | number_of_files | ||
| ) |
This function simulates simple harmonic motion (Simple Spring Motion).
using numerical solution of stepwise precision using equation (e^(-damping_coefficent / (2 * mass)) * t)*sin(wt+fi)), where this equation calculates the displacement of mass on y-axis, this function also calculates the acceleration and velocity in each time step. This function is implemented using MPI, The Number of iteration are divided upon number of processes using MPI.
| max_amplitude | starting position of the mass where the simulation will start |
| length | the maximum length of the spring (uncompressed spring) |
| mass | mass of bob |
| gravity | |
| k | stiffness of the spring |
| Ao | initial acceleration |
| Vo | initial velocity |
| FI | FI constant which will be added to the (wt) inside the sine calculation |
| time_limit | the time when the simulation will stop |
| step_size | how much the simulation will skip per iteration |
| damping_coefficent | damping factor affecting on the system |
| number_of_files |
| char * _simulate_damped_os_parallel_mpi_omp | ( | double | max_amplitude, |
| double | length, | ||
| double | mass, | ||
| double | gravity, | ||
| double | k, | ||
| double | Ao, | ||
| double | Vo, | ||
| double | FI, | ||
| double | time_limit, | ||
| double | step_size, | ||
| double | damping_coefficent, | ||
| int | number_of_files | ||
| ) |
function simulates simple harmonic motion (Simple Spring Motion).
using numerical solution of stepwise precision using equation (e^(-damping_coefficent / (2 * mass)) * t)*sin(wt+fi)), where this equation calculates the displacement of mass on y-axis, this function also calculates the acceleration and velocity in each time step. This function is implemented using MPI and Openmp together, The Number of iteration are divided upon number of processes using MPI, while each processes is calculating its values Openmp used to run the calculations per process in parallel way
| max_amplitude | starting position of the mass where the simulation will start |
| length | the maximum length of the spring (uncompressed spring) |
| mass | mass of bob |
| gravity | |
| k | stiffness of the spring |
| Ao | initial acceleration |
| Vo | initial velocity |
| FI | FI constant which will be added to the (wt) inside the sine calculation |
| time_limit | the time when the simulation will stop |
| step_size | how much the simulation will skip per iteration |
| damping_coefficent | damping factor affecting on the system |
| number_of_files |