Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 21 additions & 9 deletions tests/integration-tests/tests/schedulers/test_slurm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1539,19 +1539,31 @@ def _wait_compute_cloudinit_done(remote_command_executor, compute_node):
assert_that(compute_cloudinit_status_output).contains("status: done")


@retry(wait_fixed=seconds(10), stop_max_attempt_number=4)
def _check_mpi_process(remote_command_executor, slurm_commands, num_nodes, after_completion):
"""Submit script and check for MPI processes."""
# Clean up old datafiles
remote_command_executor.run_remote_command("rm -f /shared/check_proc.out")
result = slurm_commands.submit_command("ps aux | grep IMB | grep MPI >> /shared/check_proc.out", nodes=num_nodes)
def _assert_mpi_process_completion(
remote_command_executor, slurm_commands, num_nodes, after_completion, check_proc_file
):
result = slurm_commands.submit_command(
f'ps aux | grep "mpiexec.hydra.*sleep" | grep -v "grep" >> {check_proc_file}', nodes=num_nodes
)
job_id = slurm_commands.assert_job_submitted(result.stdout)
slurm_commands.wait_job_completed(job_id)
proc_track_result = remote_command_executor.run_remote_command("cat /shared/check_proc.out")
proc_track_result = remote_command_executor.run_remote_command(f"cat {check_proc_file}")
if after_completion:
assert_that(proc_track_result.stdout).does_not_contain("IMB-MPI1")
assert_that(proc_track_result.stdout).does_not_match(".*mpiexec.hydra.*sleep")
else:
assert_that(proc_track_result.stdout).contains("IMB-MPI1")
assert_that(proc_track_result.stdout).matches(".*mpiexec.hydra.*sleep")


def _check_mpi_process(remote_command_executor, slurm_commands, num_nodes, after_completion):
"""Submit script and check for MPI processes."""
# Clean up old datafiles
check_proc_file = "/shared/check_proc.out"

# Check completion status of MPI process using the shared datafile
remote_command_executor.run_remote_command(f"rm -f {check_proc_file}")
retry(wait_fixed=seconds(10), stop_max_attempt_number=4)(_assert_mpi_process_completion)(
remote_command_executor, slurm_commands, num_nodes, after_completion, check_proc_file
)


def _test_cluster_gpu_limits(slurm_commands, partition, instance_type, max_count, gpu_per_instance, gpu_type):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
#SBATCH --output=runscript.out

module load intelmpi
mpirun -n 6 IMB-MPI1 Alltoall -npmin 2
mpirun -n 6 bash -c 'sleep 300' -npmin 2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we do this we are not using MPI at all because each node will launch a process that will sleep for a fixed amount of time, but no interaction will happen between the nodes.

Let's sync up about this.

Copy link
Contributor Author

@EddyMM EddyMM Aug 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test involves checking if cancellation of an MPI process does not leave any stray processes. The message exchange may not be needed but as discussed, this test "implicitly" covers IntelMPI tests so this PR has been opened pending follow up on reviewing the timing issue on Ubuntu2204: #5666