Commit 6a1b64ec authored by Michael Salim's avatar Michael Salim
Browse files

update FT

parent f60d282a
......@@ -869,11 +869,15 @@ class TestThreadPlacement(BalsamTestCase):
class TestConcurrentDB(BalsamTestCase):
def setUp(self):
from balsam.service.schedulers import Scheduler
from balsam.launcher import worker
from balsam.launcher.launcher import get_args
config = get_args('--consume-all'.split())
scheduler = Scheduler.scheduler_main
if scheduler.num_workers:
self.num_nodes = scheduler.num_workers
else:
self.num_nodes = 1
group = worker.WorkerGroup(config, host_type=scheduler.host_type,
workers_str=scheduler.workers_str,
workers_file=scheduler.workers_file)
self.num_nodes = len(group.workers)
hello_path = find_spec("tests.ft_apps.concurrent.hello").origin
insert_path = find_spec("tests.ft_apps.concurrent.mpi_insert").origin
......@@ -888,10 +892,20 @@ class TestConcurrentDB(BalsamTestCase):
job = create_job(name="mpi_insert", app='mpi4py-insert',
num_nodes=self.num_nodes, ranks_per_node=16)
num_ranks = job.num_ranks
success = run_launcher_until_state(job, 'JOB_FINISHED', period=2)
self.assertTrue(success)
def check():
jobs = BalsamJob.objects.filter(state='JOB_FINISHED')
return jobs.count() == num_ranks+1
success = run_launcher_until(check, timeout=200)
job.refresh_from_db()
self.assertEqual(job.state, 'JOB_FINISHED')
jobs = BalsamJob.objects.all()
self.assertListEqual(['JOB_FINISHED']*len(jobs), [j.state for j in jobs])
created_jobs = BalsamJob.objects.filter(name__icontains='hello')
self.assertEqual(created_jobs.count(), num_ranks)
print(f"Successfully created {num_ranks} jobs by concurrent insertion")
class TestUserKill(BalsamTestCase):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment