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

# PGASetRandomSeed(3)

set a seed for the random number generator. The default is to use a random seed. Specifying a seed exlicitly allows for reproducibility of runs.

## NAME

PGASetRandomSeed - set a seed for the random number generator.  The default is to use a random seed.  Specifying a seed exlicitly allows for reproducibility of runs.

## INPUT PARAMETERS

- ctx

  \- context variable

- seed

  \- seed  for the random number generator

## OUTPUT PARAMETERS

- none

  ## SYNOPSIS

```
#include "pgapack.h"
void  PGASetRandomSeed(ctx, seed)
PGAContext *ctx
int seed
```

## LOCATION

random.c

## EXAMPLE

```
Example:
PGAContext *ctx;
:
PGASetRandomSeed(ctx,1);
```
