Thursday, December 27, 2012

Prepending number of lines to standard output using nl

nl copies files to standard output, with lines added. It is very flexible as it can prepend numbers to non blank lines and even justify left or right.

Usage 1: To add lines to standard output
$ nl -ba /etc/hosts.allow 

     1  #
     2  # hosts.allow   This file describes the names of the hosts which are
     3  #               allowed to use the local INET services, as decided
     4  #               by the '/usr/sbin/tcpd' server.
     5  #
     6
where -ba => prepend numbers to all lines

Usage 2: To add lines to non-blank text
$ nl -bt /etc/hosts.allow
     
     1  #
     2  # hosts.allow   This file describes the names of the hosts which are
     3  #               allowed to use the local INET services, as decided
     4  #               by the '/usr/sbin/tcpd' server.
     5  #
where -bt => prepend lines to non-blank lines

Usage 3: Format the numbering to Left Justify
$ nl - bt -nln /etc/hosts.allow

1       #
2       # hosts.allow   This file describes the names of the hosts which are
3       #               allowed to use the local INET services, as decided
4       #               by the '/usr/sbin/tcpd' server.
5       #
where -bt => prepend lines to non-blank lines
-nln => format the number to be left-justify

Usage 4: Format the numbering to Right Justify
 $ nl -bt -nrn /etc/hosts.allow

     1  #
     2  # hosts.allow   This file describes the names of the hosts which are
     3  #               allowed to use the local INET services, as decided
     4  #               by the '/usr/sbin/tcpd' server.
     5  #

Wednesday, December 26, 2012

Switching between Ethernet and Infiniband using Virtual Protocol Interconnect (VPI)

This short writeup is a summary of the article Switching between Ethernet and Infiniband using Virtual Protocol Interconnect (VPI). Of course you will need to use the QSA Adapter (QSFP+ to SFP+ adapter) which is the world's first solution for the QSFP to SFP+ conversion challenge for 40GB/Infiniband to 10G/1G. For more information, see Quad to Serial Small Form Factor Pluggable (QSA) Adapter to allow for the hardware


For the full article, see Switching between Ethernet and Infiniband using Virtual Protocol Interconnect (VPI)

Overview
mlx4 is the low level driver implementation for the ConnectX adapters designed by Mellanox Technologies. The ConnectX can operate as an InfiniBand adapter, as an Ethernet NIC, or as a Fibre Channel HBA. The driver in OFED 1.4 supports Infiniband and Ethernet NIC configurations. To accommodate the supported configurations, the driver is split into three modules:
  1. mlx4_core
    Handles low-level functions like device initialization and firmware commands processing. Also controls resource allocation so that the InfiniBand and Ethernet functions can share the device without interfering with each other.
  2. mlx4_ib
    Handles InfiniBand-specific functions and plugs into the InfiniBand midlayer
  3. mlx4_en
    A new 10G driver named mlx4_en was added to drivers/net/mlx4. It handles Ethernet specific functions and plugs into the netdev mid-layer.
Using Virtual Protocol Interconnect (VPI) to switch between Ethernet and Infiniband
Loading Drivers
  1. The VPI driver is a combination of the Mellanox ConnectX HCA Ethernet and Infiniband drivers. It supplies the user with the ability to run Infiniband and Ethernet protocols on the same HCA.
  2. Check the MLX4 Driver is loaded, ensure that the
    # vim /etc/infiniband/openib.conf
    # Load MLX4_EN module
    MLX4_EN_LOAD=yes
  3. If the MLX4_EN_LOAD=no, the Ethernet Driver can be loaded by running
    # /sbin/modprobe mlx4_en
Port Management / Driver Switching
  1. Show Port Configuration
    # /sbin/connectx_port_config -s
    --------------------------------
    Port configuration for PCI device: 0000:16:00.0 is:
    eth
    eth
    --------------------------------
  2. Looking at saved configuration
    # vim /etc/infiniband/connectx.conf
  3. Switching between Ethernet and Infiniband
    # /sbin/connectx_port_config
  4. Configuration supported by VPI
    - The following configurations are supported by VPI:
     Port1 = eth   Port2 = eth
     Port1 = ib    Port2 = ib
     Port1 = auto  Port2 = auto
     Port1 = ib    Port2 = eth
     Port1 = ib    Port2 = auto
     Port1 = auto  Port2 = eth
    
      Note: the following options are not supported:
     Port1 = eth   Port2 = ib
     Port1 = eth   Port2 = auto
     Port1 = auto  Port2 = ib
For more information, see
  1. ConnectX -3 VPI Single and Dual QSFP+ Port Adapter Card User Manual (pdf)
  2. Open Fabrics Enterprise Distribution (OFED) ConnectX driver (mlx4) in OFED 1.4 Release Notes

Friday, December 21, 2012

Quad to Serial Small Form Factor Pluggable (QSA) Adapter


Quad to Serial Small Form Factor Pluggable (QSA) Adapter designed by Mellanox Technologies is the world’s first solution for the QSFP to SFP+ conversion challenge.

The QSA enables smooth, cost-effective, connections between Virtual Protocol Interconnect® (VPI) or 40 Gigabit Ethernet adapters using contemporary QSFP ports and 1 or 10 Gigabit Ethernet networks using existing SFP or SFP+ based cabling. Similarly Ethernet switches with 40Gb/s QSFP ports can connect to servers with 10Gb/s Ethernet NIC ports using QSA.

For more information, see Quad to Serial Small Form Factor Pluggable (QSA) Adapter from Mellanox

Thursday, December 20, 2012

Using getent to query /etc/nsswitch.conf

getent program is useful for querying information setup on the /etc/nsswitch.conf. Some of the usage includes

Example 1: To get the user1 entry at /etc/passwd, you will do something like 
# getent passwd user1
user1:x:604:100:User 1:/home/user1:/bin/bash

Example 2: To get the hosts entry at /etc/hosts, you will do something like
# getent hosts node1
192.168.1.5     node1.private.mycluster.com node1

Example 3: To get the groups at /etc/group, you will do something like
# getent group gaussian
gaussian:x:501:user1,user2

For more information, see getent Linux manual pages

Wednesday, December 19, 2012

Information for configuring Microsoft HPC Server

If you are looking to configure the Microsoft Server HPC Server 2008 R2. You may want to take a look at the resources here

  1. Windows HPC Server 2008 R2  - Step by Step (pdf) (Resource Kit)
  2. Windows HPC Server 2008 R2