From 29e42143e058797bd9e0c54b7655392e218af37f Mon Sep 17 00:00:00 2001
From: Pramod Kumbhar <pramod.s.kumbhar@gmail.com>
Date: Thu, 8 Dec 2016 10:01:02 +0100
Subject: [PATCH] fix for  bluegene-q platform (#1980)

* fix for  bluegene-q platform

* change powerpc to ppc64

* change CNK to cnk
---
 lib/spack/spack/operating_systems/cnk.py | 17 +++++++++++++++++
 lib/spack/spack/platforms/bgq.py         | 21 ++++++++++++++++++---
 2 files changed, 35 insertions(+), 3 deletions(-)
 create mode 100644 lib/spack/spack/operating_systems/cnk.py

diff --git a/lib/spack/spack/operating_systems/cnk.py b/lib/spack/spack/operating_systems/cnk.py
new file mode 100644
index 0000000000..981d5e705c
--- /dev/null
+++ b/lib/spack/spack/operating_systems/cnk.py
@@ -0,0 +1,17 @@
+from spack.architecture import OperatingSystem
+
+
+class Cnk(OperatingSystem):
+    """ Compute Node Kernel (CNK) is the node level operating system for
+    the IBM Blue Gene series of supercomputers. The compute nodes of the
+    Blue Gene family of supercomputers run CNK, a lightweight kernel that
+    runs on each node and supports one application running for one user
+    on that node."""
+
+    def __init__(self):
+        name = 'cnk'
+        version = '1'
+        super(Cnk, self).__init__(name, version)
+
+    def __str__(self):
+        return self.name
diff --git a/lib/spack/spack/platforms/bgq.py b/lib/spack/spack/platforms/bgq.py
index 91afdd04db..1d4e02e15a 100644
--- a/lib/spack/spack/platforms/bgq.py
+++ b/lib/spack/spack/platforms/bgq.py
@@ -1,17 +1,32 @@
 import os
 from spack.architecture import Platform, Target
+from spack.operating_systems.linux_distro import LinuxDistro
+from spack.operating_systems.cnk import Cnk
 
 
 class Bgq(Platform):
     priority    = 30
     front_end   = 'power7'
-    back_end    = 'powerpc'
-    default     = 'powerpc'
+    back_end    = 'ppc64'
+    default     = 'ppc64'
 
     def __init__(self):
+        ''' IBM Blue Gene/Q system platform.'''
+
         super(Bgq, self).__init__('bgq')
+
         self.add_target(self.front_end, Target(self.front_end))
-        self.add_target(self.back_end, Target(self.back_end,))
+        self.add_target(self.back_end, Target(self.back_end))
+
+        front_distro = LinuxDistro()
+        back_distro = Cnk()
+
+        self.front_os = str(front_distro)
+        self.back_os = str(back_distro)
+        self.default_os = self.back_os
+
+        self.add_operating_system(str(front_distro), front_distro)
+        self.add_operating_system(str(back_distro), back_distro)
 
     @classmethod
     def detect(self):
-- 
GitLab