/[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 1552 - (hide annotations)
Thu May 8 08:52:41 2008 UTC (11 years, 7 months ago) by gross
File MIME type: text/plain
File size: 3302 byte(s)
some changes to make the implementatiopn of a upwind MPI version easier
1 ksteube 1312
2 jgs 150 /* $Id$ */
3    
4 ksteube 1312 /*******************************************************
5     *
6     * Copyright 2003-2007 by ACceSS MNRF
7     * Copyright 2007 by University of Queensland
8     *
9     * http://esscc.uq.edu.au
10     * Primary Business: Queensland, Australia
11     * Licensed under the Open Software License version 3.0
12     * http://www.opensource.org/licenses/osl-3.0.php
13     *
14     *******************************************************/
15 dhawcroft 631
16 jgs 150 /**************************************************************/
17    
18 ksteube 1312 /* Paso: SystemMatrixPattern_unrollBlocks */
19 jgs 150
20     /**************************************************************/
21    
22     /* Author: gross@access.edu.au */
23    
24     /**************************************************************/
25    
26     #include "SystemMatrixPattern.h"
27    
28     /**************************************************************/
29    
30     /* creates SystemMatrixPattern */
31    
32 ksteube 1312 Paso_SystemMatrixPattern* Paso_SystemMatrixPattern_unrollBlocks(Paso_SystemMatrixPattern* pattern,
33     int type, dim_t output_block_size,dim_t input_block_size) {
34 gross 1028 Paso_SystemMatrixPattern*out=NULL;
35 gross 1552 Paso_Pattern *new_mainPattern=NULL, *new_col_couplePattern=NULL, *new_row_couplePattern=NULL;
36 ksteube 1312 Paso_Distribution* new_output_distribution=NULL, *new_input_distribution=NULL;
37 gross 1552 Paso_Connector *new_col_connector=NULL, *new_row_connector=NULL;
38 ksteube 1312
39     new_mainPattern=Paso_Pattern_unrollBlocks(pattern->mainPattern,type,output_block_size,input_block_size);
40 gross 1552 new_col_couplePattern=Paso_Pattern_unrollBlocks(pattern->col_couplePattern,type,output_block_size,input_block_size);
41     new_row_couplePattern=Paso_Pattern_unrollBlocks(pattern->row_couplePattern,type,output_block_size,input_block_size);
42 ksteube 1312 new_output_distribution=Paso_Distribution_alloc(pattern->output_distribution->mpi_info,
43     pattern->output_distribution->first_component,
44     output_block_size,0);
45     new_input_distribution=Paso_Distribution_alloc(pattern->input_distribution->mpi_info,
46     pattern->input_distribution->first_component,
47     input_block_size,0);
48 gross 1552 new_col_connector=Paso_Connector_unroll(pattern->col_connector,input_block_size);
49     new_row_connector=Paso_Connector_unroll(pattern->row_connector,output_block_size);
50 ksteube 1312 if (Paso_noError()) {
51     out=Paso_SystemMatrixPattern_alloc(type,
52     new_output_distribution,
53     new_input_distribution,
54     new_mainPattern,
55 gross 1552 new_col_couplePattern,
56     new_row_couplePattern,
57     new_col_connector,
58     new_row_connector);
59 gross 415 }
60 ksteube 1312 Paso_Pattern_free(new_mainPattern);
61 gross 1552 Paso_Pattern_free(new_col_couplePattern);
62     Paso_Pattern_free(new_row_couplePattern);
63 ksteube 1312 Paso_Distribution_free(new_output_distribution);
64     Paso_Distribution_free(new_input_distribution);
65 gross 1552 Paso_Connector_free(new_row_connector);
66     Paso_Connector_free(new_col_connector);
67 jgs 150
68 ksteube 1312 if (Paso_noError()) {
69     return out;
70     } else {
71     Paso_SystemMatrixPattern_free(out);
72     return NULL;
73 jgs 150 }
74     }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26