pbs_qsub_performance.py 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. # coding: utf-8
  2. # Copyright (C) 1994-2018 Altair Engineering, Inc.
  3. # For more information, contact Altair at www.altair.com.
  4. #
  5. # This file is part of the PBS Professional ("PBS Pro") software.
  6. #
  7. # Open Source License Information:
  8. #
  9. # PBS Pro is free software. You can redistribute it and/or modify it under the
  10. # terms of the GNU Affero General Public License as published by the Free
  11. # Software Foundation, either version 3 of the License, or (at your option) any
  12. # later version.
  13. #
  14. # PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
  15. # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  16. # FOR A PARTICULAR PURPOSE.
  17. # See the GNU Affero General Public License for more details.
  18. #
  19. # You should have received a copy of the GNU Affero General Public License
  20. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  21. #
  22. # Commercial License Information:
  23. #
  24. # For a copy of the commercial license terms and conditions,
  25. # go to: (http://www.pbspro.com/UserArea/agreement.html)
  26. # or contact the Altair Legal Department.
  27. #
  28. # Altair’s dual-license business model allows companies, individuals, and
  29. # organizations to create proprietary derivative works of PBS Pro and
  30. # distribute them - whether embedded or bundled with other software -
  31. # under a commercial license agreement.
  32. #
  33. # Use of Altair’s trademarks, including but not limited to "PBS™",
  34. # "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
  35. # trademark licensing policies.
  36. from tests.performance import *
  37. class TestQsubPerformance(TestPerformance):
  38. """
  39. This test suite contains tests of qsub performance
  40. """
  41. def setUp(self):
  42. TestPerformance.setUp(self)
  43. attr = {'scheduling': 'False'}
  44. self.server.manager(MGR_CMD_SET, SERVER, attr)
  45. @timeout(400)
  46. def test_submit_large_env(self):
  47. """
  48. submission of 1000 jobs
  49. before and after exporting variable
  50. to check submission performance
  51. """
  52. start_time1 = time.time()
  53. for _ in range(1000):
  54. j = Job(TEST_USER)
  55. self.server.submit(j)
  56. end_time1 = time.time()
  57. os.environ['VARIABLE'] = 'b' * 130000
  58. start_time2 = time.time()
  59. for _ in range(1000):
  60. j1 = Job(TEST_USER)
  61. self.server.submit(j1)
  62. end_time2 = time.time()
  63. sub_time1 = int(end_time1 - start_time1)
  64. sub_time2 = int(end_time2 - start_time2)
  65. self.logger.info(
  66. "Submission time without env is %d and with env is %d sec"
  67. % (sub_time1, sub_time2))