LU Factorisation #10 issue and Histogram #5 issue #32
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes in LU_factorisation.cpp:-
1-Accepted size of array from user instead of manually entering it as 2
2-Instead of manually entering matrix A we receive matrix a from user so that we can work with any size matrices
3-Also freed the dynamically allocated memory after the end of the program
Changes is histo.cpp
1-Dynamic allocation of arr based on Points_per_process :- Instead of statically allocating arr[100] instead malloc is used to allocate it dynamically based on Points_per_process
2-Finding max_value dynamically using std::max_element- Used the algoritihm library to calculate the maximum element in p array
3-Corrected range comparison logic for bar division-The range check was corrected to properly identify the bar a point belongs to.
4-Optimized MPI_Bcast and MPI_Scatter logic- The second version broadcasts the Range variable, while the first version only broadcasts the size, Bars, and Points_per_process as Range is now a variable which needs to be shared across processes