/[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

revision 1388 by trankine, Fri Jan 11 07:45:58 2008 UTC revision 1552 by gross, Thu May 8 08:52:41 2008 UTC
# Line 32  Line 32 
32  Paso_SystemMatrixPattern* Paso_SystemMatrixPattern_unrollBlocks(Paso_SystemMatrixPattern* pattern,  Paso_SystemMatrixPattern* Paso_SystemMatrixPattern_unrollBlocks(Paso_SystemMatrixPattern* pattern,
33                                             int type, dim_t output_block_size,dim_t input_block_size) {                                             int type, dim_t output_block_size,dim_t input_block_size) {
34    Paso_SystemMatrixPattern*out=NULL;    Paso_SystemMatrixPattern*out=NULL;
35    Paso_Pattern *new_mainPattern=NULL, *new_couplePattern=NULL;    Paso_Pattern *new_mainPattern=NULL, *new_col_couplePattern=NULL, *new_row_couplePattern=NULL;
36    Paso_Distribution* new_output_distribution=NULL, *new_input_distribution=NULL;    Paso_Distribution* new_output_distribution=NULL, *new_input_distribution=NULL;
37    Paso_Coupler *new_coupler=NULL;    Paso_Connector *new_col_connector=NULL, *new_row_connector=NULL;
38    
39    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);
40    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);
41      new_row_couplePattern=Paso_Pattern_unrollBlocks(pattern->row_couplePattern,type,output_block_size,input_block_size);
42    new_output_distribution=Paso_Distribution_alloc(pattern->output_distribution->mpi_info,    new_output_distribution=Paso_Distribution_alloc(pattern->output_distribution->mpi_info,
43                                                    pattern->output_distribution->first_component,                                                    pattern->output_distribution->first_component,
44                                                    output_block_size,0);                                                    output_block_size,0);
45    new_input_distribution=Paso_Distribution_alloc(pattern->input_distribution->mpi_info,    new_input_distribution=Paso_Distribution_alloc(pattern->input_distribution->mpi_info,
46                                                    pattern->input_distribution->first_component,                                                    pattern->input_distribution->first_component,
47                                                    input_block_size,0);                                                    input_block_size,0);
48    new_coupler=Paso_Coupler_unroll(pattern->coupler,input_block_size);    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    if (Paso_noError()) {    if (Paso_noError()) {
51       out=Paso_SystemMatrixPattern_alloc(type,       out=Paso_SystemMatrixPattern_alloc(type,
52                                          new_output_distribution,                                          new_output_distribution,
53                                          new_input_distribution,                                          new_input_distribution,
54                                          new_mainPattern,                                          new_mainPattern,
55                                          new_couplePattern,                                          new_col_couplePattern,
56                                          new_coupler);                                          new_row_couplePattern,
57                                            new_col_connector,
58                                            new_row_connector);
59    }    }
60    Paso_Pattern_free(new_mainPattern);    Paso_Pattern_free(new_mainPattern);
61    Paso_Pattern_free(new_couplePattern);    Paso_Pattern_free(new_col_couplePattern);
62      Paso_Pattern_free(new_row_couplePattern);
63    Paso_Distribution_free(new_output_distribution);    Paso_Distribution_free(new_output_distribution);
64    Paso_Distribution_free(new_input_distribution);    Paso_Distribution_free(new_input_distribution);
65    Paso_Coupler_free(new_coupler);    Paso_Connector_free(new_row_connector);
66      Paso_Connector_free(new_col_connector);
67    
68    if (Paso_noError()) {    if (Paso_noError()) {
69       return out;       return out;

Legend:
Removed from v.1388  
changed lines
  Added in v.1552

  ViewVC Help
Powered by ViewVC 1.1.26