Rate This Document
Findability
Accuracy
Completeness
Readability

Configuring the sudo Permission

During the HPC cluster consistency check, if you run mpirun as a common user and want to collect data that can only be collected by privileged users, configure the sudo permission for the common user.

  1. Go to the corresponding directory.
    cd /etc/sudoers.d
  2. Create a sudoers file.

    Name the sudoers file as required, for example, mpi_sudoers.

    vim mpi_sudoers
  3. Edit the sudoers file.

    Add the following configuration information to the file. mpi2test is the user configured for the current server.

    1 mpi2test    ALL=(root)      NOPASSWD:/usr/sbin/dmidecode -t bios
    2 mpi2test    ALL=(root)      NOPASSWD:/usr/sbin/lshw -class memory -json
    3 mpi2test    ALL=(root)      NOPASSWD:/usr/sbin/dmidecode -t memory
    4 mpi2test    ALL=(root)      NOPASSWD:/usr/sbin/lshw -class network -json
    5 mpi2test    ALL=(root)      NOPASSWD:/usr/sbin/cma_roce_tos
    6 mpi2test    ALL=(root)      NOPASSWD:/usr/sbin/lshw -class bridge -class storage -class disk -json

    Press Esc and run :wq! to save the settings and exit.

  4. (Optional) Repeat the preceding steps on servers where you, as a common user, want to collect data that can only be collected by privileged users.