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

# PGAGetCommunicator(3)

Returns the default communicator used when PGARun is called.

## NAME

PGAGetCommunicator - Returns the default communicator used when PGARun is called.

## INPUT PARAMETERS

- ctx

  \- context variable

## OUTPUT PARAMETERS

- none

  ## SYNOPSIS

```
#include "pgapack.h"
MPI_Comm  PGAGetCommunicator(ctx)
PGAContext *ctx
```

## LOCATION

parallel.c

## EXAMPLE

```
Example:
MPI_Comm comm;
PGAContext *ctx,
double f(PGAContext *ctx, int p, int pop);
:
ctx = PGACreate(&argc, argv, PGA_DATATYPE_BINARY, 100, PGA_MAXIMIZE);
PGASetUp(ctx);
comm = PGAGetCommunicator(ctx);
```
