---
name: "pmiEnd"
section: "3"
platform: "linux"
package: "pcp"
version: "7.2.2-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/pmiEnd"
---

# pmiEnd(3)

finish up a LOGIMPORT archive

## NAME

**pmiEnd** - finish up a LOGIMPORT archive

## C SYNOPSIS

**#include \<pcp/pmapi.h\>**\
 **#include \<pcp/import.h\>**

**int pmiEnd(void);**

**cc ... -lpcp\_import -lpcp**

## Perl SYNOPSIS

**use PCP::LogImport;**

**pmiEnd();**

## Python SYNOPSIS

**from pcp import pmi**

**log.pmiEnd()**

## DESCRIPTION

As part of the Performance Co-Pilot Log Import API (see [**LOGIMPORT**(3)](/LOGIMPORT/3.md)), **pmiEnd** closes the current context, forcing the trailer records to be written to the PCP archive files, and then these files are closed.

In normal operations, an application would include a call to **pmiEnd** at the end of processing for each context created with a call to [**pmiStart**(3)](/pmiStart/3.md).

## DIAGNOSTICS

**pmiEnd** returns zero on success else a negative value that can be turned into an error message by calling [**pmiErrStr**(3)](/pmiErrStr/3.md).

## SEE ALSO

[**LOGIMPORT**(3)](/LOGIMPORT/3.md) and [**pmiStart**(3)](/pmiStart/3.md).
