amlhpc 0.2__tar.gz → 0.2.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: amlhpc
3
- Version: 0.2
3
+ Version: 0.2.2
4
4
  Summary: Emulate Slurm/PBS/LSF HPC scheduler in Azure ML
5
5
  Author: Hugo Meiland
6
6
  Author-email: hugo.meiland@microsoft.com
@@ -82,5 +82,5 @@ optional arguments:
82
82
  -w WRAP, --wrap WRAP command line to be executed, should be enclosed with quotes
83
83
  ```
84
84
 
85
- If you encounter a scenario or option that is not supoprted yet or behaves unexpected, please create an issue and explain the option and the scenario.
85
+ If you encounter a scenario or option that is not supported yet or behaves unexpected, please create an issue and explain the option and the scenario.
86
86
 
@@ -66,4 +66,4 @@ optional arguments:
66
66
  -w WRAP, --wrap WRAP command line to be executed, should be enclosed with quotes
67
67
  ```
68
68
 
69
- If you encounter a scenario or option that is not supoprted yet or behaves unexpected, please create an issue and explain the option and the scenario.
69
+ If you encounter a scenario or option that is not supported yet or behaves unexpected, please create an issue and explain the option and the scenario.
@@ -59,7 +59,7 @@ def sbatch(vargs=None):
59
59
  parser.add_argument('--datamover', default="None", type=str, help='use "simple" for moving the (recursive) data along with the runscript')
60
60
  parser.add_argument('-e', '--environment', default="None", type=str, help='Azure Machine Learning environment, should be enclosed in quotes, may use @latest')
61
61
  parser.add_argument('-N', '--nodes', default=1, type=int, help='amount of nodes to use for the job')
62
- parser.add_argument('-p', '--partition', type=str, required=True,
62
+ parser.add_argument('-p', '--partition', default="None", type=str,
63
63
  help='set compute partition where the job should be run. Use <sinfo> to view available partitions')
64
64
  #parser.add_argument('--parallel', default="single", type=str, help='command line to be executed, should be enclosed with quotes')
65
65
  parser.add_argument('-v', '--verbose', action='count', default=0, help='provide output on found settings and job properties')
@@ -78,6 +78,19 @@ def sbatch(vargs=None):
78
78
  print("Conflict: provide either script to execute as argument or commandline to execute through --wrap option")
79
79
  exit(-1)
80
80
 
81
+ if (args.script != "None"):
82
+ f = open(args.script, "r")
83
+ lines = f.readlines()
84
+ for line in lines:
85
+ if line.startswith('#SBATCH -p ') or line.startswith('#SBATCH --partition '):
86
+ words = list(line.split(" "))
87
+ args.partition = words[2]
88
+ if (args.verbose): print("partition argument from runscript: " + args.partition)
89
+
90
+ if (args.partition == "None"):
91
+ print("Missing: provide partition to run the job, either as -p argument or as configuration in runscript")
92
+ exit(-1)
93
+
81
94
  if (args.container != "None") and (args.environment != "None"):
82
95
  print("Conflict: provide either container or environment, cannot be used together")
83
96
  exit(-1)
@@ -100,8 +113,9 @@ def sbatch(vargs=None):
100
113
  if (args.verbose): print("using environment: " + args.environment)
101
114
 
102
115
  if (args.script != "None"):
116
+ start_command = "chmod +x " + args.script + "; "
103
117
  job_code = pwd + "/" + args.script
104
- job_command = args.script
118
+ job_command = start_command + args.script
105
119
  if (args.verbose):
106
120
  print("provided script to be executed: " + job_code)
107
121
  print("provided script to be uploaded: " + job_code)
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "amlhpc"
3
- version = "0.2"
3
+ version = "0.2.2"
4
4
  authors = [ "Hugo Meiland <hugo.meiland@microsoft.com>", "Utkarsh Ayachit <uayachit@microsoft.com>" ]
5
5
  description = "Emulate Slurm/PBS/LSF HPC scheduler in Azure ML"
6
6
  readme = "README.md"
File without changes
File without changes
File without changes
File without changes
File without changes