pbs_connect.3B 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. .\" Copyright (C) 1994-2018 Altair Engineering, Inc.
  2. .\" For more information, contact Altair at www.altair.com.
  3. .\"
  4. .\" This file is part of the PBS Professional ("PBS Pro") software.
  5. .\"
  6. .\" Open Source License Information:
  7. .\"
  8. .\" PBS Pro is free software. You can redistribute it and/or modify it under the
  9. .\" terms of the GNU Affero General Public License as published by the Free
  10. .\" Software Foundation, either version 3 of the License, or (at your option) any
  11. .\" later version.
  12. .\"
  13. .\" PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
  14. .\" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  15. .\" FOR A PARTICULAR PURPOSE.
  16. .\" See the GNU Affero General Public License for more details.
  17. .\"
  18. .\" You should have received a copy of the GNU Affero General Public License
  19. .\" along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. .\"
  21. .\" Commercial License Information:
  22. .\"
  23. .\" For a copy of the commercial license terms and conditions,
  24. .\" go to: (http://www.pbspro.com/UserArea/agreement.html)
  25. .\" or contact the Altair Legal Department.
  26. .\"
  27. .\" Altair’s dual-license business model allows companies, individuals, and
  28. .\" organizations to create proprietary derivative works of PBS Pro and
  29. .\" distribute them - whether embedded or bundled with other software -
  30. .\" under a commercial license agreement.
  31. .\"
  32. .\" Use of Altair’s trademarks, including but not limited to "PBS™",
  33. .\" "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
  34. .\" trademark licensing policies.
  35. .\"
  36. .TH pbs_connect 3B "18 March 2015" Local "PBS Professional"
  37. .SH NAME
  38. pbs_connect - connect to a PBS batch server
  39. .SH SYNOPSIS
  40. #include <pbs_error.h>
  41. .br
  42. #include <pbs_ifl.h>
  43. .sp
  44. .B int pbs_connect(\^char *server\^)
  45. .RS 6
  46. extern char *pbs_server;
  47. .RE
  48. .SH DESCRIPTION
  49. A virtual stream (TCP/IP) connection is established with the server
  50. specified by
  51. .I server.
  52. .LP
  53. This function must be called before any of the other
  54. .B pbs_
  55. functions.
  56. They will transmit their batch requests over the connection established
  57. by this function.
  58. Multiple requests may be issued over the connection before it is closed.
  59. .LP
  60. The connection should be closed by a call to \f3pbs_disconnect\f1()
  61. when all requests have been sent to the server.
  62. .LP
  63. The parameter called
  64. .I "server"
  65. is of the form:
  66. .RS 4
  67. .I host_name[:port].
  68. .RE
  69. If
  70. .I port
  71. is not specified, the standard PBS port number will be used.
  72. .LP
  73. If the parameter,
  74. .I server,
  75. is either the null string or a null pointer,
  76. a connection will be opened to the default server.
  77. The default server is defined
  78. by (a) the setting of the environment
  79. variable
  80. .B PBS_DEFAULT
  81. which contains a destination, or (b) by adding the parameter
  82. .B PBS_SERVER
  83. to the global configuration file /etc/pbs.conf.
  84. .LP
  85. The variable
  86. .I pbs_server,
  87. declared in pbs_ifl.h,
  88. is set on return to point to the server
  89. name to which pbs_connect() connected or attempted to connect.
  90. .B pbs_connect()
  91. determines whether or not the complex has a failover server configured.
  92. It also determines which server is the primary and which is the secondary.
  93. .B pbs_connect()
  94. is called by client commands, and directs traffic to the correct server.
  95. In order to use
  96. .B pbs_connect
  97. with Windows, initialize the network
  98. library and link with
  99. .B winsock2.
  100. To do this, call
  101. .B winsock_init()
  102. before calling
  103. .B pbs_connect(),
  104. and link against the
  105. .B ws2_32.lib
  106. library.
  107. .SH SEE ALSO
  108. qsub(1B),
  109. pbs_alterjob(3B), pbs_deljob(3B), pbs_disconnect(3B), pbs_geterrmsg(3B),
  110. pbs_holdjob(3B), pbs_locjob(3B), pbs_manager(3B), pbs_movejob(3B),
  111. pbs_msgjob(3B), pbs_rerunjob(3B), pbs_rlsjob(3B), pbs_runjob(3B),
  112. pbs_selectjob(3B), pbs_selstat(3B), pbs_sigjob(3B), pbs_statjob(3B),
  113. pbs_statque(3B), pbs_statserver(3B), pbs_submit(3B), pbs_terminate(3B),
  114. pbs_server(8B),
  115. and the PBS Professional Programmer's Guide
  116. .SH DIAGNOSTICS
  117. When the connection to batch server
  118. has been successfully created, the routine will return a connection
  119. identifier which is positive.
  120. Otherwise, a negative value is returned. The error number is set
  121. in pbs_errno.