Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
Slurm API(3)		   Slurm host list functions		  Slurm	API(3)

NAME
       slurm_hostlist_create,  slurm_hostlist_shift,  slurm_hostlist_destroy -
       Slurm host list support functions

SYNTAX
       #include	<slurm/slurm.h>

       hostlist_t slurm_hostlist_create	(
	    char *node_list
       );

       char * slurm_hostlist_shift (
	    hostlist_t host_list
       );

       void slurm_hostlist_destroy (
	    hostlist_t host_list
       );

ARGUMENTS
       node_list
	      A	list of	nodes as returned by the  slurm_job_step_create	 func-
	      tions.  The  returned value may include a	simple range format to
	      describe numeric ranges of values	and/or multiple	numeric	values
	      (e.g.  "linux[1-3,6]"  represents	 "linux1", "linux2", "linux3",
	      and "linux6").

       host_list
	      A	hostlist created by the	slurm_hostlist_create function.

DESCRIPTION
       slurm_hostlist_create creates a database	of node	 names	from  a	 range
       format  describing  node	 names.	 Use slurm_hostlist_destroy to release
       storage associated with the database when no longer required.

       slurm_hostlist_shift extracts the first entry from the host list	 data-
       base created by the slurm_hostlist_create function.

       slurm_hostlist_destroy releases storage associated with a database cre-
       ated by slurm_hostlist_create when no longer required.

RETURN VALUE
       slurm_hostlist_create returns the host list database or NULL if	memory
       can not be allocated for	the database.

       slurm_hostlist_shift  returns  a	character string or NULL if no entries
       remain in the database.

EXAMPLE
       #include	<stdio.h>
       #include	<hostlist.h>
       #include	<slurm.h>

       int main	(int argc, char	*argv[])
       {
	    hostlist_t my_hostlist;
	    char *hostnames, *host;

	    /* generate	a list of hostnames, possibly using a */
	    /*	  slurm	job step creation function */

	    my_hostlist	= slurm_hostlist_create	(hostnames);
	    if (my_hostlist == NULL) {
		 fprintf (stderr, "No memory\n");
		 exit (1);
	    }

	    while ( (host = slurm_hostlist_shift(my_hostlist)) )
		 printf	("host = %s\n",	host);

	    slurm_hostlist_destroy (my_hostlist) ;
	    exit (0);
       }

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)  2002-2006  The Regents of the University	of California.
       Produced	at Lawrence Livermore National	Laboratory  (cf,  DISCLAIMER).
       CODE-OCEC-09-009. All rights reserved.

       This  file  is  part  of	Slurm, a resource management program.  For de-
       tails, 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  op-
       tion) 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
       slurm_get_job_steps(3), slurm_load_jobs(3), slurm_load_partitions(3)

April 2015		   Slurm host list functions		  Slurm	API(3)

NAME | SYNTAX | ARGUMENTS | DESCRIPTION | RETURN VALUE | EXAMPLE | NOTE | COPYING | SEE ALSO

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=slurm_hostlist_create&sektion=3&manpath=FreeBSD+12.0-RELEASE+and+Ports>

home | help