pbs_connect(3B)

๐Ÿ“ฆ version 6.1.3, in epel 9, nixos 26.05, nixpkgs unstable

Bestie, this is pbs_connect(3B) from the PBS manual โ€” yes, the batch-server PBS โ€” and itโ€™s literally the โ€œopen the connection firstโ€ moment of the whole API. ๐Ÿซถโœจ

๐Ÿ’– NAME ๐Ÿ’–

pbs_connect โ€” connect to a pbs batch server. Thatโ€™s the whole vibe: youโ€™re linking up to the batch server so the rest of the pbs_ girlies can do their thing. ๐Ÿ’…

๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

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

int pbs_connect(char *server)

extern char *pbs_server;

โœจ DESCRIPTION โœจ

Okay so hereโ€™s the tea: a virtual stream (TCP/IP) connection gets established with the server specified by server. Thatโ€™s the whole point of pbs_connect() โ€” connection era, no cap. ๐ŸŒˆ

๐Ÿšจ Bestie, listen: this function must be called before any of the other pbs_ functions. They will transmit their batch requests over the connection established by this function. So yes, pbs_connect() is the main character, and everyone else is riding the connection it opened.

Multiple requests may be issued over the connection before it is closed. So you can absolutely send a little group chat of batch requests, not just one message. ๐Ÿ’ฌ

The connection should be closed by a call to pbs_disconnect() when all requests have been sent to the server. Thatโ€™s the โ€œokay bye, love youโ€ of this whole situation. ๐Ÿซถ

The parameter, server, is of the form host_name[:port], see section 2.7.9. If port is not specified, the standard PBS port number will be used. ๐ŸŽ€

If the parameter, server, is either the null string or a null pointer, a connection will be opened to the default server. The default server is defined by:

  • (a) the setting of the environment variable PBS_DEFAULT, which contains a destination, or
  • (b) the destination in the batch administrator established file {PBS_DIR}/default_destn.

So like, blank server doesnโ€™t mean โ€œnowhereโ€ โ€” it means โ€œdefault server, please and thank you.โ€ ๐Ÿ’–

The variable pbs_server, declared in pbs_ifl.h, is set on return to point to the server name to which pbs_connect() connected or attempted to connect. Yes, even the attempted-to-connect case keeps that pointer pointed at the server name, bestie. ๐Ÿ‘‘

๐ŸŒธ SEE ALSO ๐ŸŒธ

Go read these next, because the PBS lore is deep and honestly kind of iconic:

  • qsub(1B)
  • pbs_alterjob(3B)
  • pbs_deljob(3B)
  • pbs_disconnect(3B)
  • pbs_geterrmsg(3B)
  • pbs_holdjob(3B)
  • pbs_locate(3B)
  • pbs_manager(3B)
  • pbs_movejob(3B)
  • pbs_msgjob(3B)
  • pbs_rerunjob(3B)
  • pbs_rlsjob(3B)
  • pbs_runjob(3B)
  • pbs_selectjob(3B)
  • pbs_selstat(3B)
  • pbs_sigjob(3B)
  • pbs_statjob(3B)
  • pbs_statque(3B)
  • pbs_statserver(3B)
  • pbs_submit(3B)
  • pbs_terminate(3B)
  • pbs_server(8B)
  • and the PBS External Reference Specification

๐Ÿ’€ DIAGNOSTICS ๐Ÿ’€

When the connection to batch server has been successfully created, the routine will return a connection identifier which is positive. Slay. Positive number = connection created, bestie. โœ…

Otherwise, a negative value is returned. Not slay. โŒ

The error number is set in pbs_errno. So if it goes negative, check pbs_errno for the details โ€” thatโ€™s where the drama is documented. ๐Ÿ”ฅ


xoxo, from the Local edition of pbs_connect(3B) ๐Ÿ’… โ€” the source footerโ€™s date slot is blank, so Iโ€™m not inventing a date, bestie. ๐ŸŽ€โœจ

๐Ÿ“ฆ where this page comes from