Hi Bruno
That seems to have fixed the issue, glad I included the scoping.
Thanks
Nkosi
On Monday, March 6, 2017 at 3:31:35 PM UTC+2, Bruno Turcksin wrote:
>
> Nkosi,
>
> it is hard to tell what is going on without seeing the code but you
> probably don't want to do the compress in the for loop. compress needs to
> be called by all the processors at the same time. This is not the case with
> the code you show if the processors don't own the same number of cells.
> What happens if you move residual.compress (VectorOperation::add); to
> after the for loop?
>
> Best,
>
> Bruno
>
> On Monday, March 6, 2017 at 5:39:32 AM UTC-5, Nkosilathi Vundla wrote:
>>
>> Hi All
>>
>> I'm getting an error when I run my code. I get the following error when
>> the number of cells is not a multiple of the number processors I run with
>> (even if n_cells >> n_proc):
>>
>> ------------------------
>>
>> An error occurred in line <216> of file
>> <........./unpack/deal.II-v8.4.1/source/lac/trilinos_vector_base.cc> in
>> function
>> void
>> dealii::TrilinosWrappers::VectorBase::compress(dealii::VectorOperation::values)
>> The violated condition was:
>> result.max-result.min<1e-5
>> The name and call sequence of the exception was:
>> ExcMessage ("Not all processors agree whether the last operation on "
>> "this vector was an addition or a set operation. This will " "prevent the
>> compress() operation from succeeding.")
>> Additional Information:
>> Not all processors agree whether the last operation on this vector was an
>> addition or a set operation. This will prevent the compress() operation
>> from succeeding.
>>
>> Stacktrace:
>> -----------
>> #0 /home/nkosi/deal.ii-candi/deal.II-v8.4.1/lib/libdeal_II.g.so.8.4.1:
>> dealii::TrilinosWrappers::VectorBase::compress(dealii::VectorOperation::values)
>> #1 ./oldroydb:
>> fe_problem<2>::compute_residual(dealii::TrilinosWrappers::MPI::Vector
>> const&)
>> #2 ./oldroydb: fe_problem<2>::run()
>> #3 ./oldroydb: main
>> ------------------------
>>
>>
>> The vector is question is used in the following way:
>>
>> ------------------------
>> ........
>>
>> TrilinosWrappers::MPI::Vector residual;
>>
>> setup system
>> {
>> ........
>>
>> dof_handler.distribute_dofs (fe_cg);
>> locally_owned_dofs = dof_handler.locally_owned_dofs ();
>>
>> ........
>>
>> residual.reinit (locally_owned_dofs, mpi_communicator);
>>
>> .......
>>
>> }
>>
>> compute_residual
>> {
>> .......
>>
>> typename DoFHandler<dim>::active_cell_iterator cell =
>> dof_handler.begin_active (), endc = dof_handler.end ();
>> for (; cell != endc; ++cell)
>> {
>> if (cell->is_locally_owned ())
>> {
>> ......
>>
>> constraints.distribute_local_to_global (local_rhs,
>> local_dof_indices,
>> residual);
>>
>> for (unsigned int face_no = 0;
>> face_no < GeometryInfo<dim>::faces_per_cell; ++face_no)
>> {
>> typename DoFHandler<dim>::face_iterator face = cell->face (
>> face_no);
>>
>> ........
>>
>> residual[local_dof_indices[i]] -=ui_vi_vector (i);
>> residual[dofs_neighbor[i]] -= ui_ve_vector (i);
>>
>> ........
>>
>> }
>>
>> ......
>>
>> residual.compress (VectorOperation::add);
>>
>> }
>>
>> ------------------------
>>
>>
>> I hope you will be able to help me find a way around this.
>>
>> Thanks
>> Nkosi
>>
>>
>>
>>
>>
>>
>>
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.