---
name: "icetCopyState"
section: "3"
platform: "linux"
package: "paraview"
version: "5.13.2+dfsg-3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/icetCopyState"
---

# icetCopyState(3)

## NAME

**icetCopyState -- copy state machine of one context to another.**

## Synopsis

\#include \<IceT.h\>

| | | |
| --- | --- | --- |
| void **icetCopyState**( | **IceTContext** | *dest*, |
|  | const **IceTContext** | *src* ); |

## Description

The **icetCopyState** function replaces the state of *dest* with the current state of *src*. This function can be used to quickly duplicate a context.

The **IceTCommunicator** object associated with *dest* is *not* changed (nor can it ever be). Consequently, the following state values are not copied either, since they refer to process ids that are directly tied to the **IceTCommunicator** object: **ICET\_RANK**, **ICET\_NUM\_PROCESSES**, **ICET\_DATA\_REPLICATION\_GROUP**, **ICET\_DATA\_REPLICATION\_GROUP\_SIZE**, **ICET\_COMPOSITE\_ORDER**, and **ICET\_PROCESS\_ORDERS**. However, every other state parameter is copied.

## Errors

None.

## Warnings

None.

## Bugs

The state is copied blindly. It is therefore possible to copy states that are invalid for a context's communicator. For example, a display rank may not refer to a valid process id.

## Notes

Behavior is undefined if *dest* or *src* has never been created or has already been destroyed.

## Copyright

Copyright (C)2003 Sandia Corporation

Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain rights in this software.

This source code is released under the New BSD License.

## See Also

[*icetCreateContext*(3)](/icetCreateContext/3.md), [*icetGetContext*(3)](/icetGetContext/3.md), [*icetSetContext*(3)](/icetSetContext/3.md)
