---
name: "sc_MTMPIMemoryGrp"
section: "3"
platform: "linux"
package: "libsc-doc"
version: "2.3.1-22"
release: "Debian 12 (Bookworm)"
platforms: ["linux"]
url: "https://new.carta.tech/sc_MTMPIMemoryGrp"
---

# sc\_MTMPIMemoryGrp(3)

This MemoryGrp class requires a MT-safe MPI implementation.

## NAME

sc::MTMPIMemoryGrp - This **MemoryGrp** class requires a MT-safe MPI implementation.

## SYNOPSIS

`#include <memmtmpi.h>`

Inherits **sc::ActiveMsgMemoryGrp**.

### Public Member Functions

**MTMPIMemoryGrp** (const **Ref**\< **MessageGrp** \> &msg, const **Ref**\< **ThreadGrp** \> &th, MPI\_Comm comm=MPI\_COMM\_WORLD)\
 Construct a **MTMPIMemoryGrp** given a **MessageGrp**, **ThreadGrp**, and an MPI communicator.  **MTMPIMemoryGrp** (const **Ref**\< **KeyVal** \> &)\
 Construct a **MTMPIMemoryGrp** given a **KeyVal** input object.  void **activate** ()\
 Activate is called before the memory is to be used.  void **deactivate** ()\
 Deactivate is called after the memory has been used.  void **sync** ()\
 Synchronizes all the nodes.

### Friends

class **MTMPIThread**\

### Additional Inherited Members

## Detailed Description

This **MemoryGrp** class requires a MT-safe MPI implementation.

The default **MessageGrp** must be a **MPIMessageGrp**. MPI must be safe with respect to the default **ThreadGrp**. Alternately, a **MessageGrp** and a **ThreadGrp** can be passed to the constructor. \

## Constructor & Destructor Documentation

### sc::MTMPIMemoryGrp::MTMPIMemoryGrp (const Ref\< MessageGrp \> & msg, const Ref\< ThreadGrp \> & th, MPI\_Comm comm = `MPI_COMM_WORLD`)

Construct a **MTMPIMemoryGrp** given a **MessageGrp**, **ThreadGrp**, and an MPI communicator. The communicator can be a subset of MPI\_COMM\_WORLD, in which case, the **MessageGrp** must refer to the same subset.

### sc::MTMPIMemoryGrp::MTMPIMemoryGrp (const Ref\< KeyVal \> &)

Construct a **MTMPIMemoryGrp** given a **KeyVal** input object. A fully thread safe MPI is needed (MPI\_THREAD\_MULTIPLE).

## Member Function Documentation

### void sc::MTMPIMemoryGrp::activate ()` [virtual]`

Activate is called before the memory is to be used.

Reimplemented from **sc::MemoryGrp**.

### void sc::MTMPIMemoryGrp::deactivate ()` [virtual]`

Deactivate is called after the memory has been used.

Reimplemented from **sc::MemoryGrp**.

### void sc::MTMPIMemoryGrp::sync ()` [virtual]`

Synchronizes all the nodes. This is useful after remote memory writes to be certain that all of the writes have completed and the data can be accessed locally, for example.

Reimplemented from **sc::MsgMemoryGrp**.

## Author

Generated automatically by Doxygen for MPQC from the source code.
