---
name: "PGAUpdateGeneration"
section: "3"
platform: "linux"
package: "pgapack"
version: "1.0.0.1-3"
release: "Debian 3.1 (Sarge)"
platforms: ["linux"]
url: "https://new.carta.tech/PGAUpdateGeneration/3"
---

# PGAUpdateGeneration(3)

updates internal data structures for the next genetic algorithm iteration, and checks if the termination conditions, both user and PGAPack, have been met. This routine must be called by both master and slave processes at the end of each GA generation.

## NAME

PGAUpdateGeneration - updates internal data structures for the next genetic algorithm iteration, and checks if the termination conditions, both user and PGAPack, have been met.  This routine must be called by both master and slave processes at the end of each GA generation.

## INPUT PARAMETERS

- ctx

  \- context variable

- comm

  \- an MPI communicator

## OUTPUT PARAMETERS

- none

  ## SYNOPSIS

```
#include "pgapack.h"
void  PGAUpdateGeneration(ctx, comm)
PGAContext *ctx
MPI_Comm comm
```

## LOCATION

pga.c

## EXAMPLE

```
Example:
PGAContext *ctx;
:
PGAUpdateGeneration(ctx, MPI_COMM_WORLD);
```
