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

FreeBSD Manual Pages

  
 
  

home | help
pbs_rescquery(3B)		      PBS		     pbs_rescquery(3B)

NAME
       pbs_rescquery, avail, totpool, usepool -	query resource availability

SYNOPSIS
       #include	<pbs_error.h>
       #include	<pbs_ifl.h>

       int pbs_rescquery(int connect, char **resourcelist, int arraysize,
       int *available, int *allocated, int *reserved, int *down	)

       char *avail(int connect,	char *resc)

       int totpool(int connect,	int update)

       int usepool(int connect,	int update)

DESCRIPTION
       pbs_rescquery
	 Issue	a request to the batch server to query the availability	of re-
	 sources.  connect is the connection returned by  pbs_connect().   re-
	 sourcelist  is	 an  array  of	one or more strings specifying the re-
	 sources to be queried.	 arraysize is the is the number	of strings  in
	 resourcelist.	 available,  allocated,	reserved, and down are integer
	 arrays	of size	arraysize.  The	amount of resource  specified  in  the
	 corresponding	resourcelist  string which is available, already allo-
	 cated,	reserved, and down/off-line is returned	in the integer arrays.

	 At the	present	time the only resources	 which	may  be	 specified  is
	 "nodes".  It may be specified as
	     nodes
	     nodes=
	     nodes=specification
	 where	specification is what a	user specifies in the -l option	argue-
	 ment list for nodes, see qsub(1B) and the various pbs_resource_*  man
	 pages.

	 Where	the  node  resourcelist	 is  a	simple	type, such as "nodes",
	 "nodes=", or "nodes=type", the	numbers	returned  reflect  the	actual
	 number	 of  nodes  (of	the specified type) which are available, allo-
	 cated,	reserved, or down.

	 For  a	 more  complex	node  resourcelist,  such  as	"nodes=2"   or
	 "nodes=type1:type2",  only  the value returned	in available has mean-
	 ing.  If the number in	available is positive, it  is  the  number  of
	 nodes	requried  to satisified	the specification and that some	set of
	 nodes are available which will	satisify it, see  avail	 ().   If  the
	 number	in available is	zero, some number of nodes requried to satisi-
	 fied the specification	are currently unavailable,  the	request	 might
	 be  satisifed	at  a later time.  If the number in available is nega-
	 tive, no combination of known nodes can satisified the	specification.

       avail
	 The avail () call is provided as conversion aid for scheduler written
	 for early versions of PBS.   The avail() routine uses pbs_rescquery()
	 and returns a character string	answer.	 connect is the	connection re-
	 turned	 by pbs_connect().  resc is a single node=specification	speci-
	 fication as discussed above.  If the nodes to satisify	the specifica-
	 tion  are  currently  available,  the	return	value is the character
	 string	yes .  If the nodes are	currently unavailable, the  return  is
	 the  character	string no .  If	the specification could	never be sati-
	 fied, the return is the string	never .	 An error in the specification
	 returns the character string ?	.

       totpool
	 The totpool ()	function returns the total number of nodes know	to the
	 PBS server.  This is the sum of the number of nodes available,	 allo-
	 cated,	 reserved,  and	down.  The parameter connection	is the connec-
	 tion returned by pbs_connect().  The parameter	 update	 if  non-zero,
	 causes	 totpool() to issue a pbs_rescquery() call to obtain fresh in-
	 formation.   If zero, numbers	from  the  prior  pbs_rescquery()  are
	 used.

       usepool
	 usepool  ()  returns the number of nodes currently in use, the	sum of
	 allocated, reserved, and down.	 The parameter connection is the  con-
	 nection returned by pbs_connect().  The parameter update if non-zero,
	 causes	totpool() to issue a pbs_rescquery() call to obtain fresh  in-
	 formation.    If  zero,  numbers  from	 the prior pbs_rescquery() are
	 used.

SEE ALSO
       qsub(1B), pbs_connect(3B), pbs_disconnect(3B), pbs_rescreserve(3B)  and
       pbs_resources(7B)

DIAGNOSTICS
       When  the  batch	 request generated by the pbs_rescquery() function has
       been completed successfully by a	batch server, the routine will	return
       0  (zero).   Otherwise, a non zero error	is returned.  The error	number
       is also set in pbs_errno.

       The functions usepool() and totpool() return -1 on error.

Local							     pbs_rescquery(3B)

NAME | SYNOPSIS | DESCRIPTION | SEE ALSO | DIAGNOSTICS

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

home | help