/[escript]/trunk/paso/src/SystemMatrixPattern_unrollBlocks.c
ViewVC logotype

Annotation of /trunk/paso/src/SystemMatrixPattern_unrollBlocks.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1811 - (hide annotations)
Thu Sep 25 23:11:13 2008 UTC (11 years, 1 month ago) by ksteube
File MIME type: text/plain
File size: 3267 byte(s)
Copyright updated in all files

1 ksteube 1312
2     /*******************************************************
3 ksteube 1811 *
4     * Copyright (c) 2003-2008 by University of Queensland
5     * Earth Systems Science Computational Center (ESSCC)
6     * http://www.uq.edu.au/esscc
7     *
8     * Primary Business: Queensland, Australia
9     * Licensed under the Open Software License version 3.0
10     * http://www.opensource.org/licenses/osl-3.0.php
11     *
12     *******************************************************/
13 dhawcroft 631
14 ksteube 1811
15 jgs 150 /**************************************************************/
16    
17 ksteube 1312 /* Paso: SystemMatrixPattern_unrollBlocks */
18 jgs 150
19     /**************************************************************/
20    
21     /* Author: gross@access.edu.au */
22    
23     /**************************************************************/
24    
25     #include "SystemMatrixPattern.h"
26    
27     /**************************************************************/
28    
29     /* creates SystemMatrixPattern */
30    
31 ksteube 1312 Paso_SystemMatrixPattern* Paso_SystemMatrixPattern_unrollBlocks(Paso_SystemMatrixPattern* pattern,
32     int type, dim_t output_block_size,dim_t input_block_size) {
33 gross 1028 Paso_SystemMatrixPattern*out=NULL;
34 gross 1552 Paso_Pattern *new_mainPattern=NULL, *new_col_couplePattern=NULL, *new_row_couplePattern=NULL;
35 ksteube 1312 Paso_Distribution* new_output_distribution=NULL, *new_input_distribution=NULL;
36 gross 1552 Paso_Connector *new_col_connector=NULL, *new_row_connector=NULL;
37 ksteube 1312
38     new_mainPattern=Paso_Pattern_unrollBlocks(pattern->mainPattern,type,output_block_size,input_block_size);
39 gross 1552 new_col_couplePattern=Paso_Pattern_unrollBlocks(pattern->col_couplePattern,type,output_block_size,input_block_size);
40     new_row_couplePattern=Paso_Pattern_unrollBlocks(pattern->row_couplePattern,type,output_block_size,input_block_size);
41 ksteube 1312 new_output_distribution=Paso_Distribution_alloc(pattern->output_distribution->mpi_info,
42     pattern->output_distribution->first_component,
43     output_block_size,0);
44     new_input_distribution=Paso_Distribution_alloc(pattern->input_distribution->mpi_info,
45     pattern->input_distribution->first_component,
46     input_block_size,0);
47 gross 1552 new_col_connector=Paso_Connector_unroll(pattern->col_connector,input_block_size);
48     new_row_connector=Paso_Connector_unroll(pattern->row_connector,output_block_size);
49 ksteube 1312 if (Paso_noError()) {
50     out=Paso_SystemMatrixPattern_alloc(type,
51     new_output_distribution,
52     new_input_distribution,
53     new_mainPattern,
54 gross 1552 new_col_couplePattern,
55     new_row_couplePattern,
56     new_col_connector,
57     new_row_connector);
58 gross 415 }
59 ksteube 1312 Paso_Pattern_free(new_mainPattern);
60 gross 1552 Paso_Pattern_free(new_col_couplePattern);
61     Paso_Pattern_free(new_row_couplePattern);
62 ksteube 1312 Paso_Distribution_free(new_output_distribution);
63     Paso_Distribution_free(new_input_distribution);
64 gross 1552 Paso_Connector_free(new_row_connector);
65     Paso_Connector_free(new_col_connector);
66 jgs 150
67 ksteube 1312 if (Paso_noError()) {
68     return out;
69     } else {
70     Paso_SystemMatrixPattern_free(out);
71     return NULL;
72 jgs 150 }
73     }

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26