Back to the top page

Reading /proc/version at BG/L compute node?!


As you may know, a small OS is running on BG/L compute node.
It's not Linux. BLRTS stands for BGL Run Time Supervisor and
developed by IBM. single task and single user. very small OS.
approx 64Kb in size.

/proc/version is obvisouly Linux filesystem which shows Linux kernel
version and other information
It shouldn't be read from the compute node process, right?
However, the compute node process can open and read /proc/version.

The trick is that BLRTS forwards all I/O system call to I/O node
and the forwarded system calls are executed at I/O node.
Linux is running on I/O node. Actually, BLRTS doesn't have any local filesystem.

makes sense?  but it's still strange because the compute node kernel seems linux :->

Anyway, we are planning to run Linux on the BG/L compute node.
If realized, a program like hey.c will tell you the version of the compute kernel :->


Here is a demonstration (tested only on Argonne BG/L)

# mpicc -o hey hey.c
# cqsub -q short -n 32 -c 1 -C hey ./hey

(after your job gets finished)

# cat hey.output
Hey! Let me try to read /proc/version.
Linux version 2.4.19bgl-ZeptoOS-V1 (kazutomo@login2) (gcc version 3.2) #1 Tue Jul 19 13:04:46 CDT 2005
Isn't it surprising?




[hey.c]
#include <stdio.h>
#include <unistd.h>

static void print_kernel_version()
{
  FILE* fp;
  char buf[256];

  fp = fopen( "/proc/version", "r" );
  if( !fp ) {
    printf("can\'t read /proc version. it's sad\n");
    return;
  }
  if( fgets(buf, sizeof(buf), fp) ) {
    printf(buf);
    puts("Isn't it surprising?");
  }
  fclose(fp);
}

int main()
{
  puts("Hey! Let me try to read /proc/version.");
  print_kernel_version();
  sleep(10);
  return 0;
}


---
Kazutomo Yoshii <kazutomo@mcs.anl.gov>