Skip to content
Snippets Groups Projects
Commit 8a3d47b5 authored by Nate Rini's avatar Nate Rini Committed by Albert Gil
Browse files

Testsuite - Add port of v0.0.36 to v0.0.37 on test41.2

Bug 11954
parent 920e68cb
No related branches found
No related tags found
No related merge requests found
#!/bin/env python3
import time
import os
import openapi_client
from openapi_client.rest import ApiException
from openapi_client.models import V0037JobSubmission as jobSubmission
from openapi_client.models import V0037JobProperties as jobProperties
from openapi_client.api import SlurmApi as slurm
from pprint import pprint
s = slurm(openapi_client.ApiClient(openapi_client.Configuration()))
env = {
"PATH": os.getenv("PATH", "/usr/local/bin:/bin:/usr/bin/:/usr/local/bin/"),
"LD_LIBRARY_PATH": os.getenv("LD_LIBRARY_PATH", "/usr/local/lib64:/usr/local/lib/:/lib/:/lib64/:/usr/local/lib"),
"SHELL": os.getenv("SHELL", "/bin/sh")
}
script = "#!/bin/env sh\nsrun uptime"
job = jobSubmission(script=script)
job.job = jobProperties(
environment=env,
current_working_directory=os.getcwd(),
nodes=[2,9999],
array="1-100%2",
)
try:
njob = s.slurmctld_submit_job(job)
pprint(njob)
pprint(s.slurmctld_get_job(njob.job_id))
pprint(s.slurmctld_cancel_job(njob.job_id, signal="KILL"))
pprint(s.slurmctld_get_job(njob.job_id))
except ApiException as e:
print("Exception when calling: %s\n" % e)
os._exit(1)
os._exit(0)
#!/bin/env python3
import time
import os
import openapi_client
from openapi_client.rest import ApiException
from openapi_client.models import V0037JobSubmission as jobSubmission
from openapi_client.models import V0037JobProperties as jobProperties
from openapi_client.api import SlurmApi as slurm
from pprint import pprint
s = slurm(openapi_client.ApiClient(openapi_client.Configuration()))
env = {
"PATH": os.getenv("PATH", "/usr/local/bin:/bin:/usr/bin/:/usr/local/bin/"),
"LD_LIBRARY_PATH": os.getenv("LD_LIBRARY_PATH", "/usr/local/lib64:/usr/local/lib/:/lib/:/lib64/:/usr/local/lib"),
"SHELL": os.getenv("SHELL", "/bin/sh")
}
script = "#!/bin/env sh\nsrun sleep 100"
job = jobSubmission(script=script)
job.job = jobProperties(
environment=env,
current_working_directory=os.getcwd(),
nodes=[2,3],
array="1000",
dependency="singleton"
)
try:
njob = s.slurmctld_submit_job(job)
pprint(njob)
except ApiException as e:
print("Exception when calling: %s\n" % e)
os._exit(1)
#!/bin/env python3
import time
import os
import openapi_client
from openapi_client.rest import ApiException
from openapi_client.models import V0037JobSubmission as jobSubmission
from openapi_client.models import V0037JobProperties as jobProperties
from openapi_client.api import SlurmApi as slurm
from pprint import pprint
s = slurm(openapi_client.ApiClient(openapi_client.Configuration()))
env = {
"PATH": os.getenv("PATH", "/usr/local/bin:/bin:/usr/bin/:/usr/local/bin/"),
"LD_LIBRARY_PATH": os.getenv("LD_LIBRARY_PATH", "/usr/local/lib64:/usr/local/lib/:/lib/:/lib64/:/usr/local/lib"),
"SHELL": os.getenv("SHELL", "/bin/sh")
}
script = "#!/bin/env sh\nsrun uptime"
job = jobSubmission(script=script)
job.jobs = [
jobProperties(
environment=env,
current_working_directory=os.getcwd(),
nodes=[2,3],
),
jobProperties(
environment=env,
current_working_directory=os.getcwd(),
nodes=[2,4],
),
jobProperties(
environment=env,
current_working_directory=os.getcwd(),
nodes=[2,5],
),
]
try:
njob = s.slurmctld_submit_job(job)
pprint(njob)
except ApiException as e:
print("Exception when calling: %s\n" % e)
os._exit(1)
#!/bin/env python3
import time
import os
import openapi_client
from openapi_client.rest import ApiException
from openapi_client.models import V0037JobSubmission as jobSubmission
from openapi_client.models import V0037JobProperties as jobProperties
from openapi_client.api import SlurmApi as slurm
from pprint import pprint
s = slurm(openapi_client.ApiClient(openapi_client.Configuration()))
env = {
"PATH": os.getenv("PATH", "/usr/local/bin:/bin:/usr/bin/:/usr/local/bin/"),
"LD_LIBRARY_PATH": os.getenv("LD_LIBRARY_PATH", "/usr/local/lib64:/usr/local/lib/:/lib/:/lib64/:/usr/local/lib"),
"SHELL": os.getenv("SHELL", "/bin/sh")
}
script = "#!/bin/env sh\nsrun uptime"
job = jobSubmission(script=script)
job.job = jobProperties(
environment=env,
current_working_directory=os.getcwd(),
nodes=[2,9999],
standard_error="/tmp/job.log",
)
try:
njob = s.slurmctld_submit_job(job)
pprint(njob)
except ApiException as e:
print("Exception when calling: %s\n" % e)
os._exit(1)
os._exit(0)
#!/bin/env python3
import time
import os
import openapi_client
from openapi_client.rest import ApiException
from openapi_client.api import SlurmApi as slurm
from pprint import pprint
s = slurm(openapi_client.ApiClient(openapi_client.Configuration()))
try:
pprint(s.slurmctld_diag())
except ApiException as e:
print("Exception when calling: %s\n" % e)
os._exit(1)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment