---
name: "slurm_clear_trigger"
section: "3"
platform: "linux"
package: "libslurm-dev"
version: "20.11.7+really20.11.4-2+deb11u1"
release: "Debian 11 (Bullseye)"
platforms: ["linux"]
url: "https://new.carta.tech/slurm_clear_trigger"
---

# slurm\_clear\_trigger(3)

Slurm event trigger management functions

## NAME

slurm\_init\_trigger\_msg, slurm\_clear\_trigger, slurm\_free\_trigger\_msg,  slurm\_get\_triggers, slurm\_set\_trigger - Slurm event trigger management functions

## SYNTAX

\#include \<slurm/slurm.h\>

int **slurm\_set\_trigger** (\
\
 	trigger\_info\_t \**trigger\_info*\
 );

int **slurm\_clear\_trigger** (\
\
 	trigger\_info\_t \**trigger\_info*\
 );

int **slurm\_get\_triggers** (\
\
 	trigger\_info\_msg\_t \*\**trigger\_info\_msg*\
 );

int **slurm\_free\_trigger** (\
\
 	trigger\_info\_msg\_t \**trigger\_info\_msg*\
 );

int **slurm\_init\_trigger\_msg** (\
\
 	trigger\_info\_msg\_t \**trigger\_info\_msg*\
 );

## ARGUMENTS

- *trigger\_info*

  Information about one event trigger including trigger ID, type, time offset, etc. See *slurm.h* for details.

- *trigger\_info\_msg*

  A data structure including an array of *trigger\_info* structures  plus their count. See *slurm.h* for details.

## DESCRIPTION

**slurm\_set\_trigger** Create a new event trigger. Note that any trigger ID specified in *trigger\_info* is unused.

**slurm\_clear\_trigger** Clear or remove existing event triggers. If a trigger ID is specified then only that one trigger will be cleared.  If a job ID or node name is specified, then all triggers associated with  that resource are cleared.

**slurm\_get\_triggers** Get information about all currently configured event triggers. To avoid memory leaks, always follow this with a call to the **slurm\_free\_trigger** function.

**slurm\_free\_trigger** Release the memory allocated for the array  returned by the **slurm\_get\_triggers** function.

**slurm\_init\_trigger\_msg** Initialize the data structure to be used in subsequent call to **slurm\_set\_trigger** or **slurm\_clear\_trigger**.

## RETURN VALUE

**SLURM\_SUCCESS** is returned on successful completion,  otherwise an error code is returned as described below.

## ERRORS

**EINVAL** Invalid argument

**ESLURM\_ACCESS\_DENIED** Attempt by non-privileged user to set an  event trigger.

**ESLURM\_ALREADY\_DONE** Attempt to set an event trigger for a job which  has already completed.

**ESLURM\_INVALID\_NODE\_NAME** Attempt to set an event trigger for a node  name which is invalid.

**ESLURM\_INVALID\_JOB\_ID** the specified job id does not exist.

**ESLURM\_TRIGGER\_DUP** there is already an identical event trigger.

## NOTE

These functions are included in the libslurm library, which must be linked to your process for use (e.g. "cc -lslurm myprog.c").

## COPYING

Copyright (C) 2010 Lawrence Livermore National Security. Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). Portions Copyright (C) 2014 SchedMD LLC.

This file is part of Slurm, a resource management program. For details, see \<https://slurm.schedmd.com/\>.

Slurm is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Slurm is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.

## SEE ALSO

[**strigger**(1)](/strigger/1.md), [**slurm\_get\_errno**(3)](/slurm_get_errno/3.md), [**slurm\_perror**(3)](/slurm_perror/3.md), [**slurm\_strerror**(3)](/slurm_strerror/3.md)
