You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

run_job_edit_costs.repeats.ratios.bipartite.py 1.2 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. """
  4. Created on Tue Nov 3 20:23:25 2020
  5. @author: ljia
  6. """
  7. import os
  8. import re
  9. def get_job_script(arg):
  10. script = r"""
  11. #!/bin/bash
  12. #SBATCH --exclusive
  13. #SBATCH --job-name="st.rep.""" + arg + r""".bp"
  14. #SBATCH --partition=tlong
  15. #SBATCH --mail-type=ALL
  16. #SBATCH --mail-user=jajupmochi@gmail.com
  17. #SBATCH --output="outputs/output_edit_costs.repeats.ratios.bipartite.""" + arg + """.txt"
  18. #SBATCH --error="errors/error_edit_costs.repeats.ratios.bipartite.""" + arg + """.txt"
  19. #
  20. #SBATCH --ntasks=1
  21. #SBATCH --nodes=1
  22. #SBATCH --cpus-per-task=1
  23. #SBATCH --time=300:00:00
  24. #SBATCH --mem-per-cpu=4000
  25. srun hostname
  26. srun cd /home/2019015/ljia02/graphkit-learn/gklearn/experiments/ged/stability
  27. srun python3 edit_costs.repeats.ratios.bipartite.py """ + arg
  28. script = script.strip()
  29. script = re.sub('\n\t+', '\n', script)
  30. script = re.sub('\n +', '\n', script)
  31. return script
  32. if __name__ == '__main__':
  33. ds_list = ['MAO', 'Monoterpenoides', 'MUTAG', 'AIDS_symb']
  34. for ds_name in [ds_list[i] for i in [0, 1, 2, 3]]:
  35. job_script = get_job_script(ds_name)
  36. command = 'sbatch <<EOF\n' + job_script + '\nEOF'
  37. # print(command)
  38. os.system(command)
  39. # os.popen(command)
  40. # output = stream.readlines()

A Python package for graph kernels, graph edit distances and graph pre-image problem.