How to have variable number of nodes for different mpi executions in a script file in SLURM?

140 Views Asked by At

I would like to have 4 different mpi executions of same program, with different number of nodes. The outputs should be n_out.txt depends on the nodes. I have tried the following .sh file,

#!/bin/bash
#SBATCH --partition=halley
#SBATCH --job-name=deniz
#SBATCH --output=out.txt
#SBATCH --nodes=16

mpicc parallelTournament.c -o parallelTournament -lm

mpiexec -n 16 --output-filename 16_out.txt ./parallelTournament 16
mpiexec -n 8 --output-filename 8_out.txt ./parallelTournament 16
mpiexec -n 4 --output-filename 4_out.txt ./parallelTournament 16
mpiexec -n 1 --output-filename 1_out.txt ./parallelTournament 16

But it gives an error:

A call to mkdir was unable to create the desired directory:

  Directory: /home/16_out.txt/1
  Error:     Not a directory

Please check to ensure you have adequate permissions to perform
the desired operation.

I understand that I can not specify the output file name with --output-filename, but assign the directory that it should be located.

How can I have n_out.txt as input for all executions?

0

There are 0 best solutions below