Merge lp:~als88/fenics-plasticity/plasticity_with_local_size into lp:fenics-plasticity

Proposed by Antony Siahaan
Status: Merged
Merge reported by: Garth Wells
Merged at revision: not available
Proposed branch: lp:~als88/fenics-plasticity/plasticity_with_local_size
Merge into: lp:fenics-plasticity
Diff against target: 43 lines (+7/-4)
2 files modified
src/IPData.cpp (+3/-2)
src/IPData.h (+4/-2)
To merge this branch: bzr merge lp:~als88/fenics-plasticity/plasticity_with_local_size
Reviewer Review Type Date Requested Status
Garth Wells Pending
Review via email: mp+153325@code.launchpad.net

Commit message

MPI is now working in fenics-plasticity.

Description of the change

Change in IPData.cpp and IPData.h to enable parallel execution :
- using local_size() method instead of size() method for vector object.
- using get_local() method instead of gather() method for vector object.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/IPData.cpp'
2--- src/IPData.cpp 2013-02-26 11:20:02 +0000
3+++ src/IPData.cpp 2013-03-14 10:55:25 +0000
4@@ -46,7 +46,7 @@
5 void HistoryData::get_old_values(dolfin::GenericVector& vector)
6 {
7 // Check that size are equal becore setting values.
8- assert(vector.size() == _old_vals.size());
9+ assert(vector.local_size() == _old_vals.size());
10 vector.set(&_old_vals[0], _old_vals.size(), &_dofs[0]);
11 }
12 //-----------------------------------------------------------------------------
13@@ -204,7 +204,8 @@
14 _element_dofs = _u_dofmap.cell_dofs(cell.index());
15
16 // Get displacements at nodes on element
17- _vector.gather(_element_vals, _element_dofs);
18+ //_vector.gather(_element_vals, _element_dofs);
19+ _vector.get_local(&(_element_vals[0]), _element_dofs.size(), &(_element_dofs[0]));
20
21 // Tabulate coordinates of quadrature points on current cell
22 _q_dofmap.tabulate_coordinates(_coordinates, _ufc_cell);
23
24=== modified file 'src/IPData.h'
25--- src/IPData.h 2012-12-30 12:20:58 +0000
26+++ src/IPData.h 2013-03-14 10:55:25 +0000
27@@ -89,13 +89,15 @@
28 /// Update local armadillo data structure from associated function vector
29 void update_arma(arma::mat& matrix) const
30 {
31- _vector.gather(_ip_values, _ip_dofs);
32+ // _vector.gather(_ip_values, _ip_dofs);
33+ _vector.get_local(&(_ip_values[0]), _ip_dofs.size(), &(_ip_dofs[0]));
34 local_to_arma(matrix);
35 }
36
37 void update_arma(arma::vec& vector) const
38 {
39- _vector.gather(_ip_values, _ip_dofs);
40+ //_vector.gather(_ip_values, _ip_dofs);
41+ _vector.get_local(&(_ip_values[0]), _ip_dofs.size(), &(_ip_dofs[0]));
42 local_to_arma(vector);
43 }
44

Subscribers

People subscribed via source and target branches