# Problem with assign in parallel

**URL:** <https://fenicsproject.discourse.group/t/problem-with-assign-in-parallel/989>\
**Category:** Uncategorized\
**Created:** [June 12, 2019, 11:32am UTC](https://fenicsproject.discourse.group/t/problem-with-assign-in-parallel/989 "2019-06-12T11:32:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![KoenFranse](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/koenfranse/32/198_2.png) [@KoenFranse](https://fenicsproject.discourse.group/u/KoenFranse)\
**Post date:** [June 12, 2019, 11:32am UTC](https://fenicsproject.discourse.group/t/problem-with-assign-in-parallel/989/1 "2019-06-12T11:32:58Z")

</div>

Hello,

I am working with an advection-diffusion problem that works fine when running it in serial. However, when running it in serial with the following command:

```
mpirun -n 6 python NSfracStep.py problem=TayCyl

```

It the following error:

```
*** Error: Unable to successfully call PETSc function 'VecCopy'.
*** Reason: PETSc error code is: 73. (Object is in wrong state).
*** Where: This error was encountered inside /build/dolfin-fyfCiA/dolfin-2017.2.0.post0/dolfin/la/PETScVector.cpp.

```

in this line:

```
 cp_n.assign(cp)

```

in which cp is the solution function that is just solved, which I am assigning to cp\_n which is the solution of the previous timestep.

Does anyone know how to fix this problem in parallel?

---

<div class="post-metadata">

**Author:** ![dparsons](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@dparsons](https://fenicsproject.discourse.group/u/dparsons)\
**Post date:** [June 18, 2019, 3:28pm UTC](https://fenicsproject.discourse.group/t/problem-with-assign-in-parallel/989/2 "2019-06-18T15:28:06Z")

</div>

Would it help to use the `assign` function rather than class method?

```auto
assign(cp_n, cp)

```

Alternatively, `copy` instead of `assign`

```auto
cp_n = cp.copy()

```

or

```auto
cp_n = cp.copy(deepcopy=True)

```
