在 2017年6月6日星期二 UTC-7下午12:07:18,Wolfgang Bangerth写道:
>
> On 06/06/2017 12:10 PM, Weixiong Zheng wrote: 
> > It runs in serial. The error occurs when using multiple processors. 
>
>
To answer if it really happens when I call compress (), I added a bit of 
tracking:
for (unsigned int k=0; k<n_dir; ++k)
{
  std::cout << "loc_to_glob mapping cell " << cell->id() << " component " 
<< k 
    << " on proc " << Utilities::MPI::this_mpi_process (mpi_communicator) 
<< std::endl;
  local_radio (os.str());
  sys_mats[k]->add (local_dof_indices,
                    local_dof_indices,
                    local_mats[k]);
}

and

for (unsigned int k=0; k<n_dir; ++k)
{
  std::cout << "compress sys_mats begins component " << k 
    << " on proc " << Utilities::MPI::this_mpi_process (mpi_communicator) 
<< std::endl;
  sys_mats[k]->compress (VectorOperation::add);
  std::cout << "compress sys_mats ends component " << k 
    << " on proc " << Utilities::MPI::this_mpi_process (mpi_communicator) 
<< std::endl;
}

To test, I added 2-component test with 4 cells using 2 processors. Here is 
the tracking before error messages:

loc_to_glob mapping cell 2_0: component 0 on proc 1

loc_to_glob mapping cell 2_0: component 1 on proc 1

loc_to_glob mapping cell 0_0: component 0 on proc 0

loc_to_glob mapping cell 0_0: component 1 on proc 0

loc_to_glob mapping cell 1_0: component 0 on proc 0

loc_to_glob mapping cell 1_0: component 1 on proc 0

compress sys_mats begins component 0 on proc 0

loc_to_glob mapping cell 3_0: component 0 on proc 1

loc_to_glob mapping cell 3_0: component 1 on proc 1

compress sys_mats begins component 0 on proc 1

compress sys_mats ends component 0 on proc 1

compress sys_mats begins component 1 on proc 1

It looks like compress only gets through for direction-0 on processor 0.
 

> And it really happens when you call `compress()`? 
>
> The only thing I can think of is that you didn't set up the sparsity 
> pattern correctly. Can you show us the code that sets up the sparsity 
> pattern of these matrices? 
>
> Best 
>   W. 
>
> -- 
> ------------------------------------------------------------------------ 
> Wolfgang Bangerth          email:                 bang...@colostate.edu 
> <javascript:> 
>                             www: http://www.math.colostate.edu/~bangerth/ 
>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to