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

# PGARunGM(3)

High-level routine to execute the genetic algorithm using the global model. It is called after PGACreate and PGASetup have been called. If a NULL communicator is given, a sequential execution method is used, otherwise, work is divided among the processors in the communicator.

## NAME

PGARunGM - High-level routine to execute the genetic algorithm using the global model.  It is called after PGACreate and PGASetup have been called. If a NULL communicator is given, a sequential execution method is used, otherwise, work is divided among the processors in the communicator.

## INPUT PARAMETERS

- ctx

  \- context variable

- evaluate

  \- a pointer to the user's evaluation function, which must have the calling sequence shown in the example.

- comm

  \- an MPI communicator

## OUTPUT PARAMETERS

- none

  ## SYNOPSIS

```
#include "pgapack.h"
void  PGARunGM(ctx, ctx, comm)
PGAContext *ctx
double (*f)(PGAContext *, int, int)
MPI_Comm comm
```

## LOCATION

parallel.c

## EXAMPLE

```
Example:
PGAContext *ctx;
double f(PGAContext *ctx, int p, int pop);
:
PGARunGM(ctx, f, MPI_COMM_WORLD);
```
