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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

temp_trunk_copy/paso/src/SystemMatrixPattern_unrollBlocks.c revision 1384 by phornby, Fri Jan 11 02:29:38 2008 UTC trunk/paso/src/SystemMatrixPattern_unrollBlocks.c revision 1811 by ksteube, Thu Sep 25 23:11:13 2008 UTC
# Line 1  Line 1 
1    
 /* $Id$ */  
   
2  /*******************************************************  /*******************************************************
3   *  *
4   *           Copyright 2003-2007 by ACceSS MNRF  * Copyright (c) 2003-2008 by University of Queensland
5   *       Copyright 2007 by University of Queensland  * Earth Systems Science Computational Center (ESSCC)
6   *  * http://www.uq.edu.au/esscc
7   *                http://esscc.uq.edu.au  *
8   *        Primary Business: Queensland, Australia  * Primary Business: Queensland, Australia
9   *  Licensed under the Open Software License version 3.0  * Licensed under the Open Software License version 3.0
10   *     http://www.opensource.org/licenses/osl-3.0.php  * http://www.opensource.org/licenses/osl-3.0.php
11   *  *
12   *******************************************************/  *******************************************************/
13    
14    
15  /**************************************************************/  /**************************************************************/
16    
# Line 32  Line 31 
31  Paso_SystemMatrixPattern* Paso_SystemMatrixPattern_unrollBlocks(Paso_SystemMatrixPattern* pattern,  Paso_SystemMatrixPattern* Paso_SystemMatrixPattern_unrollBlocks(Paso_SystemMatrixPattern* pattern,
32                                             int type, dim_t output_block_size,dim_t input_block_size) {                                             int type, dim_t output_block_size,dim_t input_block_size) {
33    Paso_SystemMatrixPattern*out=NULL;    Paso_SystemMatrixPattern*out=NULL;
34    Paso_Pattern *new_mainPattern=NULL, *new_couplePattern=NULL;    Paso_Pattern *new_mainPattern=NULL, *new_col_couplePattern=NULL, *new_row_couplePattern=NULL;
35    Paso_Distribution* new_output_distribution=NULL, *new_input_distribution=NULL;    Paso_Distribution* new_output_distribution=NULL, *new_input_distribution=NULL;
36    Paso_Coupler *new_coupler=NULL;    Paso_Connector *new_col_connector=NULL, *new_row_connector=NULL;
37    
38    new_mainPattern=Paso_Pattern_unrollBlocks(pattern->mainPattern,type,output_block_size,input_block_size);    new_mainPattern=Paso_Pattern_unrollBlocks(pattern->mainPattern,type,output_block_size,input_block_size);
39    new_couplePattern=Paso_Pattern_unrollBlocks(pattern->couplePattern,type,output_block_size,input_block_size);    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    new_output_distribution=Paso_Distribution_alloc(pattern->output_distribution->mpi_info,    new_output_distribution=Paso_Distribution_alloc(pattern->output_distribution->mpi_info,
42                                                    pattern->output_distribution->first_component,                                                    pattern->output_distribution->first_component,
43                                                    output_block_size,0);                                                    output_block_size,0);
44    new_input_distribution=Paso_Distribution_alloc(pattern->input_distribution->mpi_info,    new_input_distribution=Paso_Distribution_alloc(pattern->input_distribution->mpi_info,
45                                                    pattern->input_distribution->first_component,                                                    pattern->input_distribution->first_component,
46                                                    input_block_size,0);                                                    input_block_size,0);
47    new_coupler=Paso_Coupler_unroll(pattern->coupler,input_block_size);    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    if (Paso_noError()) {    if (Paso_noError()) {
50       out=Paso_SystemMatrixPattern_alloc(type,       out=Paso_SystemMatrixPattern_alloc(type,
51                                          new_output_distribution,                                          new_output_distribution,
52                                          new_input_distribution,                                          new_input_distribution,
53                                          new_mainPattern,                                          new_mainPattern,
54                                          new_couplePattern,                                          new_col_couplePattern,
55                                          new_coupler);                                          new_row_couplePattern,
56                                            new_col_connector,
57                                            new_row_connector);
58    }    }
59    Paso_Pattern_free(new_mainPattern);    Paso_Pattern_free(new_mainPattern);
60    Paso_Pattern_free(new_couplePattern);    Paso_Pattern_free(new_col_couplePattern);
61      Paso_Pattern_free(new_row_couplePattern);
62    Paso_Distribution_free(new_output_distribution);    Paso_Distribution_free(new_output_distribution);
63    Paso_Distribution_free(new_input_distribution);    Paso_Distribution_free(new_input_distribution);
64    Paso_Coupler_free(new_coupler);    Paso_Connector_free(new_row_connector);
65      Paso_Connector_free(new_col_connector);
66    
67    if (Paso_noError()) {    if (Paso_noError()) {
68       return out;       return out;

Legend:
Removed from v.1384  
changed lines
  Added in v.1811

  ViewVC Help
Powered by ViewVC 1.1.26