diff options
author | jan.reininghaus <jan.reininghaus@8e3bb3c2-eed4-f18f-5264-0b6c94e6926d> | 2013-06-07 12:41:23 +0000 |
---|---|---|
committer | jan.reininghaus <jan.reininghaus@8e3bb3c2-eed4-f18f-5264-0b6c94e6926d> | 2013-06-07 12:41:23 +0000 |
commit | bf64faab7dd9da8683484971a64c6c87f40a89a3 (patch) | |
tree | e06b71e240c3820c776f973ccecdd34982bc0ece | |
parent | 8fa5020a3710161bb0ddfda1b9003a369b3b2174 (diff) |
performance improvements through OpenMP
git-svn-id: https://phat.googlecode.com/svn/trunk@88 8e3bb3c2-eed4-f18f-5264-0b6c94e6926d
-rw-r--r-- | include/phat/boundary_matrix.h | 1 | ||||
-rw-r--r-- | include/phat/helpers/dualize.h | 10 |
2 files changed, 7 insertions, 4 deletions
diff --git a/include/phat/boundary_matrix.h b/include/phat/boundary_matrix.h index 7be14d8..1bdee61 100644 --- a/include/phat/boundary_matrix.h +++ b/include/phat/boundary_matrix.h @@ -176,6 +176,7 @@ namespace phat { const index nr_of_columns = (index)input_matrix.size();
this->set_num_cols( nr_of_columns );
column temp_col;
+ #pragma omp parallel for private( temp_col )
for( index cur_col = 0; cur_col < nr_of_columns; cur_col++ ) {
this->set_dim( cur_col, (dimension)input_dims[ cur_col ] );
diff --git a/include/phat/helpers/dualize.h b/include/phat/helpers/dualize.h index e3ae9ed..3ffedf8 100644 --- a/include/phat/helpers/dualize.h +++ b/include/phat/helpers/dualize.h @@ -40,13 +40,13 @@ namespace phat { for( index cur_col = 0; cur_col < nr_of_columns; cur_col++ ) {
boundary_matrix.get_col( cur_col, temp_col );
for( index idx = 0; idx < (index)temp_col.size(); idx++)
- dual_sizes[ nr_of_columns - 1 - temp_col[ idx ] ]++;
+ dual_sizes[ nr_of_columns - 1 - temp_col[ idx ] ]++;
}
- for( index cur_col = 0; cur_col < nr_of_columns; cur_col++ ) {
+ #pragma omp parallel for
+ for( index cur_col = 0; cur_col < nr_of_columns; cur_col++ )
dual_matrix[cur_col].reserve(dual_sizes[cur_col]);
- }
-
+
for( index cur_col = 0; cur_col < nr_of_columns; cur_col++ ) {
boundary_matrix.get_col( cur_col, temp_col );
for( index idx = 0; idx < (index)temp_col.size(); idx++)
@@ -54,9 +54,11 @@ namespace phat { }
const dimension max_dim = boundary_matrix.get_max_dim();
+ #pragma omp parallel for
for( index cur_col = 0; cur_col < nr_of_columns; cur_col++ )
dual_dims[ nr_of_columns - 1 - cur_col ] = max_dim - boundary_matrix.get_dim( cur_col );
+ #pragma omp parallel for
for( index cur_col = 0; cur_col < nr_of_columns; cur_col++ )
std::reverse( dual_matrix[ cur_col ].begin(), dual_matrix[ cur_col ].end() );
|