Browse Source

initializing

Tosin Akinwale Adesuyi 3 năm trước cách đây
mục cha
commit
cfc5c14eb4
21 tập tin đã thay đổi với 413 bổ sung181 xóa
  1. 9 32
      hpc/nways/Dockerfile
  2. 54 0
      hpc/nways/Dockerfile_python
  3. 31 6
      hpc/nways/README.md
  4. 59 0
      hpc/nways/Singularity_python
  5. 1 1
      hpc/nways/nways_labs/nways_MD/English/Python/jupyter_notebook/Final_Remarks.ipynb
  6. 17 17
      hpc/nways/nways_labs/nways_MD/English/Python/jupyter_notebook/cupy/cupy_RDF.ipynb
  7. 1 1
      hpc/nways/nways_labs/nways_MD/English/Python/jupyter_notebook/cupy/cupy_guide.ipynb
  8. 15 15
      hpc/nways/nways_labs/nways_MD/English/Python/jupyter_notebook/cupy/serial_RDF.ipynb
  9. 17 17
      hpc/nways/nways_labs/nways_MD/English/Python/jupyter_notebook/numba/numba_RDF.ipynb
  10. 4 4
      hpc/nways/nways_labs/nways_MD/English/Python/jupyter_notebook/numba/numba_guide.ipynb
  11. 16 16
      hpc/nways/nways_labs/nways_MD/English/Python/jupyter_notebook/numba/serial_RDF.ipynb
  12. 1 1
      hpc/nways/nways_labs/nways_MD/English/Python/jupyter_notebook/serial/rdf_overview.ipynb
  13. 18 18
      hpc/nways/nways_labs/nways_MD/English/Python/source_code/cupy/cupy_rdf.py
  14. 2 2
      hpc/nways/nways_labs/nways_MD/English/Python/source_code/input/dataset.py
  15. 16 16
      hpc/nways/nways_labs/nways_MD/English/Python/source_code/numba/numba_rdf.py
  16. 18 15
      hpc/nways/nways_labs/nways_MD/English/Python/source_code/serial/nways_serial.py
  17. BIN
      hpc/nways/nways_labs/nways_MD/English/Python/source_code/serial/serial_cpu_rdf.qdrep
  18. 4 16
      hpc/nways/nways_labs/nways_MD/English/nways_MD_start.ipynb
  19. 109 0
      hpc/nways/nways_labs/nways_MD/English/nways_MD_start_python.ipynb
  20. 18 2
      hpc/nways/nways_labs/nways_MD/README.md
  21. 3 2
      hpc/nways/nways_labs/nways_start.ipynb

+ 9 - 32
hpc/nways/Dockerfile

@@ -1,4 +1,3 @@
-
 # Copyright (c) 2021 NVIDIA Corporation.  All rights reserved. 
 
 # To build the docker container, run: $ sudo docker build -t nways-labs:latest .
@@ -6,24 +5,14 @@
 # Finally, open http://localhost:8888/
 
 #FROM nvcr.io/nvidia/nvhpc:20.11-devel-cuda_multi-ubuntu20.04
-FROM nvidia/cuda:11.2.2-devel-ubuntu20.04
-#FROM nvcr.io/nvidia/nvhpc:21.3-devel-cuda_multi-ubuntu20.04
-
-
+FROM nvcr.io/nvidia/nvhpc:21.3-devel-cuda_multi-ubuntu20.04
 
 RUN apt-get -y update && \
-        DEBIAN_FRONTEND=noninteractive apt-get -yq install --no-install-recommends \
-        python3-dev \  
-        python3-pip python3-setuptools nginx zip make build-essential libtbb-dev && \
-        rm -rf /var/lib/apt/lists/*
-
-RUN pip3 install --no-cache-dir -U install setuptools pip
-RUN pip3 install gdown
-RUN pip3 install --no-cache-dir jupyter
-RUN pip3 install --no-cache-dir "cupy-cuda112==8.6.0" \
-    numba numpy scipy 
-RUN pip3 install --no-cache-dir MDAnalysis       
-        
+        DEBIAN_FRONTEND=noninteractive apt-get -yq install --no-install-recommends python3-pip python3-setuptools nginx zip make build-essential libtbb-dev && \
+        rm -rf /var/lib/apt/lists/* && \
+        pip3 install --upgrade pip &&\
+        pip3 install --no-cache-dir jupyter &&\
+        pip3 install gdown
 
 ############################################
 # NVIDIA nsight-systems-2020.5.1 ,nsight-compute-2
@@ -36,9 +25,6 @@ RUN apt-get update -y && \
         apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys F60F4B3D7FA2AF80 && \
         echo "deb https://developer.download.nvidia.com/devtools/repos/ubuntu2004/amd64/ /" >> /etc/apt/sources.list.d/nsight.list &&\
         apt-get update -y
-        #wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh  && \
-        #bash Miniconda3-latest-Linux-x86_64.sh -b -p /opt/anaconda3  && \
-        #rm Miniconda3-latest-Linux-x86_64.sh
 
 RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends nsight-systems-2020.5.1 nsight-compute-2020.2.1 
 
@@ -46,21 +32,12 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ns
 COPY nways_labs/ /labs/
 
 RUN python3 /labs/nways_MD/English/C/source_code/dataset.py
-#RUN python3 /labs/nways_MD/English/Fortran/source_code/dataset.py
-RUN python3 /labs/nways_MD/English/Python/source_code/dataset.py
+RUN python3 /labs/nways_MD/English/Fortran/source_code/dataset.py
 
 #################################################
-#ENV LD_LIBRARY_PATH="/usr/local/lib:/opt/nvidia/hpc_sdk/Linux_x86_64/21.3/cuda/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}"
-#ENV PATH="/opt/nvidia/nsight-systems/2020.5.1/bin:/opt/nvidia/nsight-compute/2020.2.1:/opt/nvidia/hpc_sdk/Linux_x86_64/21.3/compilers/bin:/usr/local/bin:/opt/anaconda3/bin:/usr/bin${PATH:+:${PATH}}"
-
-ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib:/opt/nvidia/hpc_sdk/Linux_x86_64/21.3/cuda/11.2/lib64:/opt/nvidia/hpc_sdk/Linux_x86_64/21.3/cuda/lib64:/usr/local/lib/python3.8/dist-packages"
-ENV PATH="/opt/nvidia/nsight-systems/2020.5.1/bin:/opt/nvidia/nsight-compute/2020.2.1:/opt/nvidia/hpc_sdk/Linux_x86_64/21.3/cuda/11.2/include:/opt/nvidia/hpc_sdk/Linux_x86_64/21.3/cuda/bin:/opt/nvidia/hpc_sdk/Linux_x86_64/21.3/compilers/bin:/usr/local/bin:/opt/anaconda3/bin:/opt/anaconda3/lib:/usr/bin:$PATH"
+ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib:/opt/nvidia/hpc_sdk/Linux_x86_64/21.3/cuda/11.3/lib64/"
+ENV PATH="/opt/nvidia/nsight-systems/2020.5.1/bin:/opt/nvidia/nsight-compute/2020.2.1:/opt/nvidia/hpc_sdk/Linux_x86_64/21.3/cuda/11.2/include:/usr/local/bin:/opt/anaconda3/bin:/usr/bin:$PATH"
 #################################################
-#########################################
- 
-     
-     
-########################################
 
 ADD nways_labs/ /labs
 WORKDIR /labs

+ 54 - 0
hpc/nways/Dockerfile_python

@@ -0,0 +1,54 @@
+
+# Copyright (c) 2021 NVIDIA Corporation.  All rights reserved. 
+
+# To build the docker container, run: $ sudo docker build -t nways-labs:latest .
+# To run: $ sudo docker run --rm -it --runtime nvidia -p 8888:8888 nways-labs:latest
+# Finally, open http://localhost:8888/
+
+#FROM nvcr.io/nvidia/nvhpc:20.11-devel-cuda_multi-ubuntu20.04
+FROM nvidia/cuda:11.2.2-devel-ubuntu20.04
+
+
+RUN apt-get -y update && \
+        DEBIAN_FRONTEND=noninteractive apt-get -yq install --no-install-recommends \
+        python3-dev \  
+        python3-pip python3-setuptools nginx zip make build-essential libtbb-dev && \
+        rm -rf /var/lib/apt/lists/*
+
+RUN pip3 install --no-cache-dir -U install setuptools pip
+RUN pip3 install gdown
+RUN pip3 install --no-cache-dir jupyter
+RUN pip3 install --no-cache-dir "cupy-cuda112==8.6.0" \
+    numba numpy scipy 
+       
+        
+############################################
+# NVIDIA nsight-systems-2020.5.1 ,nsight-compute-2
+RUN apt-get update -y && \
+        DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
+        apt-transport-https \
+        ca-certificates \
+        gnupg \
+        wget && \
+        apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys F60F4B3D7FA2AF80 && \
+        echo "deb https://developer.download.nvidia.com/devtools/repos/ubuntu2004/amd64/ /" >> /etc/apt/sources.list.d/nsight.list &&\
+        apt-get update -y
+        
+
+RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends nsight-systems-2020.5.1 nsight-compute-2020.2.1 
+
+# TO COPY the data
+COPY nways_labs/ /labs/
+
+
+RUN python3 /labs/nways_MD/English/Python/source_code/dataset.py
+
+#################################################
+ENV LD_LIBRARY_PATH="/usr/local/lib:/usr/local/lib/python3.8/dist-packages:/usr/local/cuda/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}"
+ENV PATH="/opt/nvidia/nsight-systems/2020.5.1/bin:/opt/nvidia/nsight-compute/2020.2.1:/usr/local/bin:/bin:/usr/local/cuda/bin:/usr/bin${PATH:+:${PATH}}"
+
+RUN pip3 install --no-cache-dir MDAnalysis
+
+ADD nways_labs/ /labs
+WORKDIR /labs
+CMD service nginx start && jupyter notebook --no-browser --allow-root --ip=0.0.0.0 --port=8888 --NotebookApp.token="" --notebook-dir=/labs

+ 31 - 6
hpc/nways/README.md

@@ -1,10 +1,25 @@
 # Nways to GPU programming
-This repository contains mini applications for GPU Bootcamps (**Tested on NVIDIA driver 440.82**). This labs comprises Nways to GPU programming and contains below topics:
+This repository contains mini applications for GPU Bootcamps (**Tested on NVIDIA driver 440.82**). This labs comprises Nways to GPU programming implemented with the following programning approaches:
+
+**C programming language **
   - OpenACC
   - Kokkos
   - PSTL
   - OpenMP
   - CUDA C
+  
+  
+  
+**Fortran programming language**
+  - do-concurrent
+  - OpenACC
+  - OpenMP
+  - CUDA Fortran
+  
+  
+**Python programming language**
+  - CuPy
+  - Numba
 
 We showcase above ways using mini applications in MD domain and CFD.
 
@@ -18,13 +33,20 @@ To run this tutorial you will need a machine with NVIDIA GPU.
 To start with, you will have to build a Docker or Singularity container.
 
 ### Docker Container
-To build a docker container, run: 
+To build a docker container for **C & Fortran**, run: 
 `sudo docker build -t <imagename>:<tagnumber> .`
 
-For instance:
+For instance :
 `sudo docker build -t myimage:1.0 .`
 
-The code labs have been written using Jupyter notebooks and a Dockerfile has been built to simplify deployment. In order to serve the docker instance for a student, it is necessary to expose port 8000 from the container, for instance, the following command would expose port 8000 inside the container as port 8000 on the lab machine:
+While in the case of **Python** you have to specify the dockerfile name using flag **"-f"**, therefore run:
+`sudo docker build -f <dockerfile name> -t <imagename>:<tagnumber> .`
+
+For example :
+`sudo docker build -f Dockerfile_python -t myimage:1.0 .`
+
+
+For C, Fortran, and Python, the code labs have been written using Jupyter notebooks and a Dockerfile has been built to simplify deployment. In order to serve the docker instance for a student, it is necessary to expose port 8000 from the container, for instance, the following command would expose port 8000 inside the container as port 8000 on the lab machine:
 
 `sudo docker run --rm -it --gpus=all -p 8888:8888 myimage:1.0`
 
@@ -40,10 +62,13 @@ Once inside the container, open the jupyter notebook in browser: http://localhos
 
 ### Singularity Container
 
-To build the singularity container, run: 
+To build the singularity container for **C & Fortran**, run: 
 `singularity build nways.simg Singularity`
 
-and copy the files to your local machine to make sure changes are stored locally:
+While in the case of **Python**, run:
+`singularity build nways.simg Singularity_python`
+
+Thereafter, for C, Fortran, and Python, copy the files to your local machine to make sure changes are stored locally:
 `singularity run nways.simg cp -rT /labs ~/labs`
 
 Then, run the container:

+ 59 - 0
hpc/nways/Singularity_python

@@ -0,0 +1,59 @@
+# Copyright (c) 2021 NVIDIA Corporation.  All rights reserved. 
+
+Bootstrap: docker
+#FROM: nvcr.io/nvidia/nvhpc:20.11-devel-cuda_multi-ubuntu20.04
+FROM:  nvidia/cuda:11.2.2-devel-ubuntu20.04
+
+%environment
+    export XDG_RUNTIME_DIR=
+    export PATH="$PATH:/usr/local/bin:/opt/anaconda3/bin:/usr/bin"
+    export PATH=/opt/nvidia/nsight-systems/2020.5.1/bin:/opt/nvidia/nsight-compute/2020.2.1:/bin:/usr/local/cuda/bin$PATH
+    export LD_LIBRARY_PATH="/usr/local/lib:/usr/local/lib/python3.8/dist-packages:/usr/local/cuda/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}"
+
+%post
+    build_tmp=$(mktemp -d) && cd ${build_tmp}
+
+    apt-get -y update
+    apt-get -y dist-upgrade 
+    DEBIAN_FRONTEND=noninteractive apt-get -yq install --no-install-recommends \
+	    m4 vim-nox emacs-nox nano zip\
+ 	    python3-pip python3-setuptools git-core inotify-tools \
+	    curl git-lfs \
+	    build-essential libtbb-dev
+    rm -rf /var/lib/apt/cache/* 
+
+    pip3 install --no-cache-dir -U install setuptools pip
+    pip3 install gdown
+    pip3 install --no-cache-dir jupyter
+    pip3 install --no-cache-dir "cupy-cuda112==8.6.0" \
+    numba numpy scipy
+    pip3 install --no-cache-dir MDAnalysis
+
+    apt-get install --no-install-recommends -y build-essential 
+
+    python3 /labs/nways_MD/English/Python/source_code/dataset.py
+
+
+# NVIDIA nsight-systems-2020.5.1 ,nsight-compute-2
+    apt-get update -y   
+    DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends apt-transport-https ca-certificates gnupg wget
+    apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys F60F4B3D7FA2AF80
+    echo "deb https://developer.download.nvidia.com/devtools/repos/ubuntu2004/amd64/ /" >> /etc/apt/sources.list.d/nsight.list 
+    apt-get update -y 
+    DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends nsight-systems-2020.5.1 nsight-compute-2020.2.1 
+    apt-get install --no-install-recommends -y build-essential
+
+    wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh 
+    bash Miniconda3-latest-Linux-x86_64.sh -b -p /opt/anaconda3 
+    rm Miniconda3-latest-Linux-x86_64.sh 
+    
+    cd /
+    rm -rf ${build_tmp}
+
+%files
+    nways_labs/ /labs
+%runscript
+    "$@"
+
+%labels
+    AUTHOR Tosin

+ 1 - 1
hpc/nways/nways_labs/nways_MD/English/Python/jupyter_notebook/Final_Remarks.ipynb

@@ -66,7 +66,7 @@
     "\n",
     "-----\n",
     "\n",
-    "# <div style=\"text-align: center ;border:3px; border-style:solid; border-color:#FF0000  ; padding: 1em\">[HOME](../../nways_MD_start.ipynb)</div>\n",
+    "# <div style=\"text-align: center ;border:3px; border-style:solid; border-color:#FF0000  ; padding: 1em\">[HOME](../../nways_MD_start_python.ipynb)</div>\n",
     "\n",
     "-----\n",
     "\n",

+ 17 - 17
hpc/nways/nways_labs/nways_MD/English/Python/jupyter_notebook/cupy/cupy_RDF.ipynb

@@ -141,10 +141,10 @@
     "    ########## Input Details ###########\n",
     "    global xbox, ybox, zbox\n",
     "    inconf = 10\n",
-    "    nbin   =np.int(2000)\n",
-    "    xbox   = np.float(0)\n",
-    "    ybox   =np.float(0)\n",
-    "    zbox   = np.float(0)\n",
+    "    nbin   =np.int32(2000)\n",
+    "    xbox   = np.float32(0)\n",
+    "    ybox   =np.float32(0)\n",
+    "    zbox   = np.float32(0)\n",
     "    \n",
     "    fileDir = os.path.dirname(os.path.realpath('__file__'))\n",
     "    dataRoot = Path(fileDir).parents[1]\n",
@@ -198,16 +198,16 @@
     "    d_g2 = cp.asnumpy(d_g2)\n",
     "    nvtx.RangePop()  # pop for Pair Calculation\n",
     "    #############################################################################################\n",
-    "    pi = math.acos(np.long(-1.0))\n",
+    "    pi = math.acos(np.int64(-1.0))\n",
     "    rho = (numatm) / (xbox * ybox * zbox)\n",
-    "    norm = (np.long(4.0) * pi * rho) / np.long(3.0)\n",
+    "    norm = (np.int64(4.0) * pi * rho) / np.int64(3.0)\n",
     "    g2 = np.zeros(nbin, dtype=np.float32)\n",
-    "    s2 =np.long(0.0); s2bond = np.long(0.0)\n",
-    "    lngrbond = np.float(0.0)\n",
+    "    s2 =np.int64(0.0); s2bond = np.int64(0.0)\n",
+    "    lngrbond = np.float32(0.0)\n",
     "    box = min(xbox, ybox)\n",
     "    box = min(box, zbox)\n",
-    "    _del =box / (np.long(2.0) * nbin)\n",
-    "    gr = np.float(0.0)\n",
+    "    _del =box / (np.int64(2.0) * nbin)\n",
+    "    gr = np.float32(0.0)\n",
     "    # loop to calculate entropy\n",
     "    nvtx.RangePush(\"Entropy_Calculation\")\n",
     "    for i in range(nbin):\n",
@@ -219,20 +219,20 @@
     "        temp = (i + 0.5) * _del\n",
     "        pairfile.write(str(temp) + \" \" + str(g2[i]) + \"\\n\")\n",
     "\n",
-    "        if r < np.long(2.0):\n",
-    "            gr = np.long(0.0)\n",
+    "        if r < np.int64(2.0):\n",
+    "            gr = np.int64(0.0)\n",
     "        else:\n",
     "            gr = g2[i]\n",
     "        if gr < 1e-5:\n",
-    "            lngr = np.long(0.0)\n",
+    "            lngr = np.int64(0.0)\n",
     "        else:\n",
     "            lngr = math.log(gr)\n",
     "        if g2[i] < 1e-6:\n",
-    "            lngrbond = np.long(0.0)\n",
+    "            lngrbond = np.int64(0.0)\n",
     "        else:\n",
     "            lngrbond = math.log(g2[i])\n",
-    "        s2 = s2 - (np.long(2.0) * pi * rho * ((gr * lngr) - gr + np.long(1.0)) * _del * r * r)\n",
-    "        s2bond = s2bond - np.long(2.0) * pi * rho * ((g2[i] * lngrbond) - g2[i] + np.long(1.0)) * _del * r * r\n",
+    "        s2 = s2 - (np.int64(2.0) * pi * rho * ((gr * lngr) - gr + np.int64(1.0)) * _del * r * r)\n",
+    "        s2bond = s2bond - np.int64(2.0) * pi * rho * ((g2[i] * lngrbond) - g2[i] + np.int64(1.0)) * _del * r * r\n",
     "\n",
     "    nvtx.RangePop()  # pop for entropy Calculation\n",
     "    stwo.writelines(\"s2 value is {}\\n\".format(s2))\n",
@@ -275,7 +275,7 @@
     "\n",
     "---\n",
     "\n",
-    "# <p style=\"text-align:center;border:3px; border-style:solid; border-color:#FF0000  ; padding: 1em\"> <a href=../../../nways_MD_start.ipynb>HOME</a></p>\n",
+    "# <p style=\"text-align:center;border:3px; border-style:solid; border-color:#FF0000  ; padding: 1em\"> <a href=../../../nways_MD_start_python.ipynb>HOME</a></p>\n",
     "\n",
     "---\n",
     "\n",

+ 1 - 1
hpc/nways/nways_labs/nways_MD/English/Python/jupyter_notebook/cupy/cupy_guide.ipynb

@@ -719,7 +719,7 @@
     "\n",
     "---\n",
     "\n",
-    "# <p style=\"text-align:center;border:3px; border-style:solid; border-color:#FF0000  ; padding: 1em\"> <a href=../../../nways_MD_start.ipynb>HOME</a></p>\n",
+    "# <p style=\"text-align:center;border:3px; border-style:solid; border-color:#FF0000  ; padding: 1em\"> <a href=../../../nways_MD_start_python.ipynb>HOME</a></p>\n",
     "\n",
     "---\n",
     "\n",

+ 15 - 15
hpc/nways/nways_labs/nways_MD/English/Python/jupyter_notebook/cupy/serial_RDF.ipynb

@@ -194,17 +194,17 @@
     "    nvtx.RangePop() #pop for Pair Calculation\n",
     "    ######################################################################\n",
     "    \n",
-    "    pi = math.acos(np.long(-1.0))\n",
+    "    pi = math.acos(np.int64(-1.0))\n",
     "    rho = (numatm) / (xbox * ybox * zbox)\n",
-    "    norm = (np.long(4.0) * pi * rho) / np.long(3.0)\n",
+    "    norm = (np.int64(4.0) * pi * rho) / np.int64(3.0)\n",
     "    g2 = np.zeros(nbin, dtype=np.float32)\n",
-    "    s2 = np.long(0.0);\n",
-    "    s2bond = np.long(0.0)\n",
-    "    lngrbond = np.float(0.0)\n",
+    "    s2 = np.int64(0.0);\n",
+    "    s2bond = np.int64(0.0)\n",
+    "    lngrbond = np.int64(0.0)\n",
     "    box = min(xbox, ybox)\n",
     "    box = min(box, zbox)\n",
-    "    _del = box / (np.long(2.0) * nbin)\n",
-    "    gr = np.float(0.0)\n",
+    "    _del = box / (np.int64(2.0) * nbin)\n",
+    "    gr = np.float32(0.0)\n",
     "    # loop to calculate entropy\n",
     "    nvtx.RangePush(\"Entropy_Calculation\")\n",
     "    for i in range(nbin):\n",
@@ -218,20 +218,20 @@
     "        #writing to file\n",
     "        pairfile.write(str(temp) + \" \" + str(g2[i]) + \"\\n\")\n",
     "\n",
-    "        if r < np.long(2.0):\n",
-    "            gr = np.long(0.0)\n",
+    "        if r < np.int64(2.0):\n",
+    "            gr = np.int64(0.0)\n",
     "        else:\n",
     "            gr = g2[i]\n",
     "        if gr < 1e-5:\n",
-    "            lngr = np.long(0.0)\n",
+    "            lngr = np.int64(0.0)\n",
     "        else:\n",
     "            lngr = math.log(gr)\n",
     "        if g2[i] < 1e-6:\n",
-    "            lngrbond = np.long(0.0)\n",
+    "            lngrbond = np.int64(0.0)\n",
     "        else:\n",
     "            lngrbond = math.log(g2[i])\n",
-    "        s2 = s2 - (np.long(2.0) * pi * rho * ((gr * lngr) - gr + np.long(1.0)) * _del * r * r)\n",
-    "        s2bond = s2bond - np.long(2.0) * pi * rho * ((g2[i] * lngrbond) - g2[i] + np.long(1.0)) * _del * r * r\n",
+    "        s2 = s2 - (np.int64(2.0) * pi * rho * ((gr * lngr) - gr + np.int64(1.0)) * _del * r * r)\n",
+    "        s2bond = s2bond - np.int64(2.0) * pi * rho * ((g2[i] * lngrbond) - g2[i] + np.int64(1.0)) * _del * r * r\n",
     "\n",
     "    nvtx.RangePop() # pop for entropy Calculation\n",
     "    \n",
@@ -332,7 +332,7 @@
     " \n",
     "\n",
     "---\n",
-    "### [View Solution](../../source_code/cupy/cupy_rdf.py)\n",
+    "### [View ](../../source_code/cupy/cupy_rdf.py) or [Run](../../jupyter_notebook/cupy/cupy_RDF.ipynb) Solution\n",
     "---\n",
     "\n",
     "\n",
@@ -365,7 +365,7 @@
     "\n",
     "---\n",
     "\n",
-    "# <p style=\"text-align:center;border:3px; border-style:solid; border-color:#FF0000  ; padding: 1em\"> <a href=../../../nways_MD_start.ipynb>HOME</a></p>\n",
+    "# <p style=\"text-align:center;border:3px; border-style:solid; border-color:#FF0000  ; padding: 1em\"> <a href=../../../nways_MD_start_python.ipynb>HOME</a></p>\n",
     "\n",
     "---\n",
     "\n",

+ 17 - 17
hpc/nways/nways_labs/nways_MD/English/Python/jupyter_notebook/numba/numba_RDF.ipynb

@@ -125,10 +125,10 @@
     "    ########## Input Details ###########\n",
     "    global xbox, ybox, zbox\n",
     "    inconf = 10\n",
-    "    nbin   =np.int(2000)\n",
-    "    xbox   = np.float(0)\n",
-    "    ybox   =np.float(0)\n",
-    "    zbox   = np.float(0)\n",
+    "    nbin   =np.int32(2000)\n",
+    "    xbox   = np.float32(0)\n",
+    "    ybox   =np.float32(0)\n",
+    "    zbox   = np.float32(0)\n",
     "    \n",
     "    fileDir = os.path.dirname(os.path.realpath('__file__'))\n",
     "    dataRoot = Path(fileDir).parents[1]\n",
@@ -184,16 +184,16 @@
     "    d_g2  = d_g2.copy_to_host() ## numba copy to host\n",
     "    nvtx.RangePop()  # pop for Pair Calculation\n",
     "\n",
-    "    pi = math.acos(np.long(-1.0))\n",
+    "    pi = math.acos(np.int64(-1.0))\n",
     "    rho = (numatm) / (xbox * ybox * zbox)\n",
-    "    norm = (np.long(4.0) * pi * rho) / np.long(3.0)\n",
+    "    norm = (np.int64(4.0) * pi * rho) / np.int64(3.0)\n",
     "    g2 = np.zeros(nbin, dtype=np.float32)\n",
-    "    s2 =np.long(0.0); s2bond = np.long(0.0)\n",
-    "    lngrbond = np.float(0.0)\n",
+    "    s2 =np.int64(0.0); s2bond = np.int64(0.0)\n",
+    "    lngrbond = np.float32(0.0)\n",
     "    box = min(xbox, ybox)\n",
     "    box = min(box, zbox)\n",
-    "    _del =box / (np.long(2.0) * nbin)\n",
-    "    gr = np.float(0.0)\n",
+    "    _del =box / (np.int64(2.0) * nbin)\n",
+    "    gr = np.float32(0.0)\n",
     "    # loop to calculate entropy\n",
     "    nvtx.RangePush(\"Entropy_Calculation\")\n",
     "    for i in range(nbin):\n",
@@ -205,20 +205,20 @@
     "        temp = (i + 0.5) * _del\n",
     "        pairfile.write(str(temp) + \" \" + str(g2[i]) + \"\\n\")\n",
     "\n",
-    "        if r < np.long(2.0):\n",
-    "            gr = np.long(0.0)\n",
+    "        if r < np.int64(2.0):\n",
+    "            gr = np.int64(0.0)\n",
     "        else:\n",
     "            gr = g2[i]\n",
     "        if gr < 1e-5:\n",
-    "            lngr = np.long(0.0)\n",
+    "            lngr = np.int64(0.0)\n",
     "        else:\n",
     "            lngr = math.log(gr)\n",
     "        if g2[i] < 1e-6:\n",
-    "            lngrbond = np.long(0.0)\n",
+    "            lngrbond = np.int64(0.0)\n",
     "        else:\n",
     "            lngrbond = math.log(g2[i])\n",
-    "        s2 = s2 - (np.long(2.0) * pi * rho * ((gr * lngr) - gr + np.long(1.0)) * _del * r * r)\n",
-    "        s2bond = s2bond - np.long(2.0) * pi * rho * ((g2[i] * lngrbond) - g2[i] + np.long(1.0)) * _del * r * r\n",
+    "        s2 = s2 - (np.int64(2.0) * pi * rho * ((gr * lngr) - gr + np.int64(1.0)) * _del * r * r)\n",
+    "        s2bond = s2bond - np.int64(2.0) * pi * rho * ((g2[i] * lngrbond) - g2[i] + np.int64(1.0)) * _del * r * r\n",
     "\n",
     "    nvtx.RangePop()  # pop for entropy Calculation\n",
     "    stwo.writelines(\"s2 value is {}\\n\".format(s2))\n",
@@ -264,7 +264,7 @@
     "\n",
     "---\n",
     "\n",
-    "# <p style=\"text-align:center;border:3px; border-style:solid; border-color:#FF0000  ; padding: 1em\"> <a href=../../../nways_MD_start.ipynb>HOME</a></p>\n",
+    "# <p style=\"text-align:center;border:3px; border-style:solid; border-color:#FF0000  ; padding: 1em\"> <a href=../../../nways_MD_start_python.ipynb>HOME</a></p>\n",
     "\n",
     "---\n",
     "\n",

+ 4 - 4
hpc/nways/nways_labs/nways_MD/English/Python/jupyter_notebook/numba/numba_guide.ipynb

@@ -135,9 +135,9 @@
     "\n",
     "\n",
     "        \n",
-    "array_A = np.arange(N, dtype=np.int)\n",
-    "array_B = np.arange(N, dtype=np.int)\n",
-    "array_out = np.zeros(N, dtype=np.int)\n",
+    "array_A = np.arange(N, dtype=np.int32)\n",
+    "array_B = np.arange(N, dtype=np.int32)\n",
+    "array_out = np.zeros(N, dtype=np.int32)\n",
     "\n",
     "blockpergrid  = N + (threadsperblock - 1) // threadsperblock\n",
     "\n",
@@ -541,7 +541,7 @@
     "\n",
     "---\n",
     "\n",
-    "# <p style=\"text-align:center;border:3px; border-style:solid; border-color:#FF0000  ; padding: 1em\"> <a href=../../../nways_MD_start.ipynb>HOME</a></p>\n",
+    "# <p style=\"text-align:center;border:3px; border-style:solid; border-color:#FF0000  ; padding: 1em\"> <a href=../../../nways_MD_start_python.ipynb>HOME</a></p>\n",
     "\n",
     "---\n",
     "\n",

+ 16 - 16
hpc/nways/nways_labs/nways_MD/English/Python/jupyter_notebook/numba/serial_RDF.ipynb

@@ -195,17 +195,17 @@
     "    nvtx.RangePop() #pop for Pair Calculation\n",
     "    ######################################################################\n",
     "    \n",
-    "    pi = math.acos(np.long(-1.0))\n",
+    "    pi = math.acos(np.int64(-1.0))\n",
     "    rho = (numatm) / (xbox * ybox * zbox)\n",
-    "    norm = (np.long(4.0) * pi * rho) / np.long(3.0)\n",
+    "    norm = (np.int64(4.0) * pi * rho) / np.int64(3.0)\n",
     "    g2 = np.zeros(nbin, dtype=np.float32)\n",
-    "    s2 = np.long(0.0);\n",
-    "    s2bond = np.long(0.0)\n",
-    "    lngrbond = np.float(0.0)\n",
+    "    s2 = np.int64(0.0);\n",
+    "    s2bond = np.int64(0.0)\n",
+    "    lngrbond = np.int64(0.0)\n",
     "    box = min(xbox, ybox)\n",
     "    box = min(box, zbox)\n",
-    "    _del = box / (np.long(2.0) * nbin)\n",
-    "    gr = np.float(0.0)\n",
+    "    _del = box / (np.int64(2.0) * nbin)\n",
+    "    gr = np.float32(0.0)\n",
     "    # loop to calculate entropy\n",
     "    nvtx.RangePush(\"Entropy_Calculation\")\n",
     "    for i in range(nbin):\n",
@@ -219,20 +219,20 @@
     "        #writing to file\n",
     "        pairfile.write(str(temp) + \" \" + str(g2[i]) + \"\\n\")\n",
     "\n",
-    "        if r < np.long(2.0):\n",
-    "            gr = np.long(0.0)\n",
+    "        if r < np.int64(2.0):\n",
+    "            gr = np.int64(0.0)\n",
     "        else:\n",
     "            gr = g2[i]\n",
     "        if gr < 1e-5:\n",
-    "            lngr = np.long(0.0)\n",
+    "            lngr = np.int64(0.0)\n",
     "        else:\n",
     "            lngr = math.log(gr)\n",
     "        if g2[i] < 1e-6:\n",
-    "            lngrbond = np.long(0.0)\n",
+    "            lngrbond = np.int64(0.0)\n",
     "        else:\n",
     "            lngrbond = math.log(g2[i])\n",
-    "        s2 = s2 - (np.long(2.0) * pi * rho * ((gr * lngr) - gr + np.long(1.0)) * _del * r * r)\n",
-    "        s2bond = s2bond - np.long(2.0) * pi * rho * ((g2[i] * lngrbond) - g2[i] + np.long(1.0)) * _del * r * r\n",
+    "        s2 = s2 - (np.int64(2.0) * pi * rho * ((gr * lngr) - gr + np.int64(1.0)) * _del * r * r)\n",
+    "        s2bond = s2bond - np.int64(2.0) * pi * rho * ((g2[i] * lngrbond) - g2[i] + np.int64(1.0)) * _del * r * r\n",
     "\n",
     "    nvtx.RangePop() # pop for entropy Calculation\n",
     "    \n",
@@ -254,7 +254,7 @@
     "    \n",
     "\n",
     "if __name__ == \"__main__\":\n",
-    "    main()  "
+    "    #main()  "
    ]
   },
   {
@@ -332,7 +332,7 @@
     "From the profile report, we can see that the pair_gpu function now takes miliseconds to run as compared to the serial version which takes more than 3 seconds as shown [here](../serial/rdf_overview.ipynb). \n",
     "\n",
     "---\n",
-    "### [View Solution](../../source_code/numba/numba_rdf.py)\n",
+    "### [View](../../source_code/numba/numba_rdf.py) or [Run](../../jupyter_notebook/numba/numba_RDF.ipynb)  Solution \n",
     "--- \n",
     "\n",
     "## Post-Lab Summary\n",
@@ -363,7 +363,7 @@
     "\n",
     "---\n",
     "\n",
-    "# <p style=\"text-align:center;border:3px; border-style:solid; border-color:#FF0000  ; padding: 1em\"> <a href=../../../nways_MD_start.ipynb>HOME</a></p>\n",
+    "# <p style=\"text-align:center;border:3px; border-style:solid; border-color:#FF0000  ; padding: 1em\"> <a href=../../../nways_MD_start_python.ipynb>HOME</a></p>\n",
     "\n",
     "---\n",
     "\n",

+ 1 - 1
hpc/nways/nways_labs/nways_MD/English/Python/jupyter_notebook/serial/rdf_overview.ipynb

@@ -79,7 +79,7 @@
     "\n",
     "-----\n",
     "\n",
-    "# <div style=\"text-align: center ;border:3px; border-style:solid; border-color:#FF0000  ; padding: 1em\">[HOME](../../../nways_MD_start.ipynb)</div> \n",
+    "# <div style=\"text-align: center ;border:3px; border-style:solid; border-color:#FF0000  ; padding: 1em\">[HOME](../../../nways_MD_start_python.ipynb)</div> \n",
     "-----\n",
     "\n",
     "\n",

+ 18 - 18
hpc/nways/nways_labs/nways_MD/English/Python/source_code/cupy/cupy_rdf.py

@@ -46,10 +46,10 @@ def main():
     ########## Input Details ###########
     global xbox, ybox, zbox
     inconf = 10
-    nbin   =np.int(2000)
-    xbox   = np.float(0)
-    ybox   =np.float(0)
-    zbox   = np.float(0)
+    nbin   =np.int32(2000)
+    xbox   = np.float32(0)
+    ybox   =np.float32(0)
+    zbox   = np.float32(0)
 
     ########use on jupyter notebook#######
     fileDir = os.path.dirname(os.path.realpath('__file__'))
@@ -83,8 +83,8 @@ def main():
     d_x = cp.asarray(d_x)
     d_y = cp.asarray(d_y)
     d_z = cp.asarray(d_z)
-    d_g2 = cp.zeros(sizebin, dtype=cp.int64)
-
+    d_g2 = np.zeros(sizebin, dtype=np.int64)
+    d_g2 = cp.asarray(d_g2)
     ############################## RAW KERNEL #################################################
     nthreads = 128;
     near2 = nthreads * (int(0.5 * numatm * (numatm - 1) / nthreads) + 1);
@@ -106,16 +106,16 @@ def main():
     d_g2 = cp.asnumpy(d_g2)
     nvtx.RangePop()  # pop for Pair Calculation
     ######################################################################
-    pi = math.acos(np.long(-1.0))
+    pi = math.acos(np.int64(-1.0))
     rho = (numatm) / (xbox * ybox * zbox)
-    norm = (np.long(4.0) * pi * rho) / np.long(3.0)
+    norm = (np.int64(4.0) * pi * rho) / np.int64(3.0)
     g2 = np.zeros(nbin, dtype=np.float32)
-    s2 =np.long(0.0); s2bond = np.long(0.0)
-    lngrbond = np.float(0.0)
+    s2 =np.int64(0.0); s2bond = np.int64(0.0)
+    lngrbond = np.float32(0.0)
     box = min(xbox, ybox)
     box = min(box, zbox)
-    _del =box / (np.long(2.0) * nbin)
-    gr = np.float(0.0)
+    _del =box / (np.int64(2.0) * nbin)
+    gr = np.float32(0.0)
     # loop to calculate entropy
     nvtx.RangePush("Entropy_Calculation")
     for i in range(nbin):
@@ -127,20 +127,20 @@ def main():
         temp = (i + 0.5) * _del
         pairfile.write(str(temp) + " " + str(g2[i]) + "\n")
 
-        if r < np.long(2.0):
-            gr = np.long(0.0)
+        if r < np.int64(2.0):
+            gr = np.int64(0.0)
         else:
             gr = g2[i]
         if gr < 1e-5:
-            lngr = np.long(0.0)
+            lngr = np.int64(0.0)
         else:
             lngr = math.log(gr)
         if g2[i] < 1e-6:
-            lngrbond = np.long(0.0)
+            lngrbond = np.int64(0.0)
         else:
             lngrbond = math.log(g2[i])
-        s2 = s2 - (np.long(2.0) * pi * rho * ((gr * lngr) - gr + np.long(1.0)) * _del * r * r)
-        s2bond = s2bond - np.long(2.0) * pi * rho * ((g2[i] * lngrbond) - g2[i] + np.long(1.0)) * _del * r * r
+        s2 = s2 - (np.int64(2.0) * pi * rho * ((gr * lngr) - gr + np.int64(1.0)) * _del * r * r)
+        s2bond = s2bond - np.int64(2.0) * pi * rho * ((g2[i] * lngrbond) - g2[i] + np.int64(1.0)) * _del * r * r
 
     nvtx.RangePop()  # pop for entropy Calculation
     stwo.writelines("s2 value is {}\n".format(s2))

+ 2 - 2
hpc/nways/nways_labs/nways_MD/English/Python/source_code/input/dataset.py

@@ -5,5 +5,5 @@ import os
 
 ## alk.traj.dcd input file 
 url = 'https://drive.google.com/uc?id=1WZ0rtXZ-uMLfy7htT0gaU4EQ_Rq61QTF&export=download'
-output = '/labs/nways_MD/English/C/source_code/input/alk.traj.dcd'
-gdown.download(url, output, quiet=False,proxy=None)
+output_fortran = '/labs/nways_MD/English/Python/source_code/input/alk.traj.dcd'
+gdown.download(url, output_fortran, quiet=False,proxy=None)

+ 16 - 16
hpc/nways/nways_labs/nways_MD/English/Python/source_code/numba/numba_rdf.py

@@ -41,10 +41,10 @@ def main():
     ########## Input Details ###########
     global xbox, ybox, zbox
     inconf = 10
-    nbin   =np.int(2000)
-    xbox   = np.float(0)
-    ybox   =np.float(0)
-    zbox   = np.float(0)
+    nbin   =np.int32(2000)
+    xbox   = np.float32(0)
+    ybox   =np.float32(0)
+    zbox   = np.float32(0)
 
     ########use on jupyter notebook#######
     fileDir = os.path.dirname(os.path.realpath('__file__'))
@@ -104,16 +104,16 @@ def main():
     d_g2  = d_g2.copy_to_host() ## numba copy to host
     nvtx.RangePop()  # pop for Pair Calculation
 
-    pi = math.acos(np.long(-1.0))
+    pi = math.acos(np.int64(-1.0))
     rho = (numatm) / (xbox * ybox * zbox)
-    norm = (np.long(4.0) * pi * rho) / np.long(3.0)
+    norm = (np.int64(4.0) * pi * rho) / np.int64(3.0)
     g2 = np.zeros(nbin, dtype=np.float32)
-    s2 =np.long(0.0); s2bond = np.long(0.0)
-    lngrbond = np.float(0.0)
+    s2 =np.int64(0.0); s2bond = np.int64(0.0)
+    lngrbond = np.float32(0.0)
     box = min(xbox, ybox)
     box = min(box, zbox)
-    _del =box / (np.long(2.0) * nbin)
-    gr = np.float(0.0)
+    _del =box / (np.int64(2.0) * nbin)
+    gr = np.float32(0.0)
     # loop to calculate entropy
     nvtx.RangePush("Entropy_Calculation")
     for i in range(nbin):
@@ -125,20 +125,20 @@ def main():
         temp = (i + 0.5) * _del
         pairfile.write(str(temp) + " " + str(g2[i]) + "\n")
 
-        if r < np.long(2.0):
-            gr = np.long(0.0)
+        if r < np.int64(2.0):
+            gr = np.int64(0.0)
         else:
             gr = g2[i]
         if gr < 1e-5:
-            lngr = np.long(0.0)
+            lngr = np.int64(0.0)
         else:
             lngr = math.log(gr)
         if g2[i] < 1e-6:
-            lngrbond = np.long(0.0)
+            lngrbond = np.int64(0.0)
         else:
             lngrbond = math.log(g2[i])
-        s2 = s2 - (np.long(2.0) * pi * rho * ((gr * lngr) - gr + np.long(1.0)) * _del * r * r)
-        s2bond = s2bond - np.long(2.0) * pi * rho * ((g2[i] * lngrbond) - g2[i] + np.long(1.0)) * _del * r * r
+        s2 = s2 - (np.int64(2.0) * pi * rho * ((gr * lngr) - gr + np.int64(1.0)) * _del * r * r)
+        s2bond = s2bond - np.int64(2.0) * pi * rho * ((g2[i] * lngrbond) - g2[i] + np.int64(1.0)) * _del * r * r
 
     nvtx.RangePop()  # pop for entropy Calculation
     stwo.writelines("s2 value is {}\n".format(s2))

+ 18 - 15
hpc/nways/nways_labs/nways_MD/English/Python/source_code/serial/nways_serial.py

@@ -42,11 +42,14 @@ def main():
     inconf = 10
     nbin   = 2000
     global xbox, ybox, zbox
-    
+    ######## for jupyter notebook ########################
     fileDir = os.path.dirname(os.path.realpath('__file__'))
     dataRoot = Path(fileDir).parents[1]
     file = os.path.join(dataRoot, 'source_code/input/alk.traj.dcd')
-    
+
+    ######## local computer #############
+    #file = "input/alk.traj.dcd"
+
     infile = DCDFile(file)
     pairfile = open("RDF.dat", "w+")
     stwo     = open("Pair_entropy.dat", "w+")
@@ -73,17 +76,17 @@ def main():
     h_g2 = pair_gpu(h_x, h_y, h_z, h_g2, numatm, nconf, xbox, ybox, zbox, nbin)
     nvtx.RangePop() #pop for Pair Calculation
     ######################################################################
-    pi = math.acos(np.long(-1.0))
+    pi = math.acos(np.int64(-1.0))
     rho = (numatm) / (xbox * ybox * zbox)
-    norm = (np.long(4.0) * pi * rho) / np.long(3.0)
+    norm = (np.int64(4.0) * pi * rho) / np.int64(3.0)
     g2 = np.zeros(nbin, dtype=np.float32)
-    s2 = np.long(0.0);
-    s2bond = np.long(0.0)
-    lngrbond = np.float(0.0)
+    s2 = np.int64(0.0);
+    s2bond = np.int64(0.0)
+    lngrbond = np.float32(0.0)
     box = min(xbox, ybox)
     box = min(box, zbox)
-    _del = box / (np.long(2.0) * nbin)
-    gr = np.float(0.0)
+    _del = box / (np.int64(2.0) * nbin)
+    gr = np.float32(0.0)
     # loop to calculate entropy
     nvtx.RangePush("Entropy_Calculation")
     for i in range(nbin):
@@ -95,20 +98,20 @@ def main():
         temp = (i + 0.5) * _del
         pairfile.write(str(temp) + " " + str(g2[i]) + "\n")
 
-        if r < np.long(2.0):
-            gr = np.long(0.0)
+        if r < np.int64(2.0):
+            gr = np.int64(0.0)
         else:
             gr = g2[i]
         if gr < 1e-5:
-            lngr = np.long(0.0)
+            lngr = np.int64(0.0)
         else:
             lngr = math.log(gr)
         if g2[i] < 1e-6:
-            lngrbond = np.long(0.0)
+            lngrbond = np.int64(0.0)
         else:
             lngrbond = math.log(g2[i])
-        s2 = s2 - (np.long(2.0) * pi * rho * ((gr * lngr) - gr + np.long(1.0)) * _del * r * r)
-        s2bond = s2bond - np.long(2.0) * pi * rho * ((g2[i] * lngrbond) - g2[i] + np.long(1.0)) * _del * r * r
+        s2 = s2 - (np.int64(2.0) * pi * rho * ((gr * lngr) - gr + np.int64(1.0)) * _del * r * r)
+        s2bond = s2bond - np.int64(2.0) * pi * rho * ((g2[i] * lngrbond) - g2[i] + np.int64(1.0)) * _del * r * r
 
     nvtx.RangePop() # pop for entropy Calculation
     stwo.writelines("s2 value is {}\n".format(s2))

BIN
hpc/nways/nways_labs/nways_MD/English/Python/source_code/serial/serial_cpu_rdf.qdrep


+ 4 - 16
hpc/nways/nways_labs/nways_MD/English/nways_MD_start.ipynb

@@ -11,7 +11,7 @@
     "* Standard: C++ stdpar, Fortran Do-Concurrent\n",
     "* Directives: OpenACC, OpenMP\n",
     "* Frameworks: Kokkos\n",
-    "* Programming Language Extension: CUDA C, CUDA Fortran, Python Cupy, Python Numba\n",
+    "* Programming Language Extension: CUDA C, CUDA Fortran\n",
     "\n",
     "Let's start with testing the CUDA Driver and GPU you are running the code on in this lab:"
    ]
@@ -29,7 +29,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "<!--**IMPORTANT**: Before we start please download the input file needed for this application from the [Google drive](https://drive.google.com/drive/folders/1aQ_MFyrjBIDMhCczse0S2GQ36MlR6Q_s?usp=sharing) and upload it to the input folder. From the top menu, click on *File*, and *Open* and navigate to `C/source_code/input` or `Python/source_code/input` directory and copy paste the downloaded input file (`alk.traj.dcd`).-->\n",
+    "<!--**IMPORTANT**: Before we start please download the input file needed for this application from the [Google drive](https://drive.google.com/drive/folders/1aQ_MFyrjBIDMhCczse0S2GQ36MlR6Q_s?usp=sharing) and upload it to the input folder. From the top menu, click on *File*, and *Open* and navigate to `C/source_code/input` directory and copy paste the downloaded input file (`alk.traj.dcd`).-->\n",
     "\n",
     "\n",
     "### Tutorial Outline\n",
@@ -72,19 +72,7 @@
     "3. [OpenMP](Fortran/jupyter_notebook/openmp/nways_openmp.ipynb) \n",
     "4. [CUDA Fortran](Fortran/jupyter_notebook/cudafortran/nways_cuda.ipynb) \n",
     "\n",
-    "To finish the lab let us go through some final [remarks](Fortran/jupyter_notebook/Final_Remarks.ipynb)\n",
-    "\n",
-    "\n",
-    "#### Python Programming Language\n",
-    "\n",
-    "Please read the [RDF Overview](Python/jupyter_notebook/serial/rdf_overview.ipynb) to get familiar with how this application works.\n",
-    "\n",
-    "To get started, click on the following GPU programming approaches in python:\n",
-    "\n",
-    "1. [CuPy](./Python/jupyter_notebook/cupy/cupy_guide.ipynb)\n",
-    "2. [Numba](./Python/jupyter_notebook/numba/numba_guide.ipynb)\n",
-    "\n",
-    "To round up this tutorial, see some final [remarks on Python](Python/jupyter_notebook/Final_Remarks.ipynb)"
+    "To finish the lab let us go through some final [remarks](Fortran/jupyter_notebook/Final_Remarks.ipynb)"
    ]
   },
   {
@@ -102,7 +90,7 @@
     "### Target Audience and Prerequisites\n",
     "The target audience for this lab is researchers/graduate students and developers who are interested in learning about programming various ways to programming GPUs to accelerate their scientific applications.\n",
     "\n",
-    "Basic experience with C/C++ or Python or Fortran programming is needed. No GPU programming knowledge is required.\n",
+    "Basic experience with C/C++ or Fortran programming is needed. No GPU programming knowledge is required.\n",
     "\n",
     "-----\n",
     "\n",

+ 109 - 0
hpc/nways/nways_labs/nways_MD/English/nways_MD_start_python.ipynb

@@ -0,0 +1,109 @@
+{
+ "cells": [
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## N Ways to GPU Programming - MD\n",
+    "\n",
+    "## Learning objectives\n",
+    "With the release of CUDA in 2007, different approaches to programming GPUs have evolved. Each approach has its own advantages and disadvantages. By the end of this bootcamp session, students will have a broader perspective on GPU programming approaches to help them select a programming model that better fits their applications' needs and constraints. The bootcamp will teach how to accelerate a popular algorithm of Radial Distribution Function (RDF) using the following methods:\n",
+    "\n",
+    "* Programming Language Extension: Cupy and Numba\n",
+    "\n",
+    "Let's start with testing the CUDA Driver and GPU you are running the code on in this lab:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "!nvidia-smi"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "<!--**IMPORTANT**: Before we start please download the input file needed for this application from the [Google drive](https://drive.google.com/drive/folders/1aQ_MFyrjBIDMhCczse0S2GQ36MlR6Q_s?usp=sharing) and upload it to the input folder. From the top menu, click on *File*, and *Open* and navigate to `C/source_code/input` or `Python/source_code/input` directory and copy paste the downloaded input file (`alk.traj.dcd`).-->\n",
+    "\n",
+    "\n",
+    "### Tutorial Outline\n",
+    "\n",
+    " We will be following the cycle of Analysis - Parallelization - Optimization cycle throughout. To start with let us understand the Nsight tool ecosystem:   \n",
+    "\n",
+    "- [Introduction to Profiling](../../profiler/English/jupyter_notebook/profiling.ipynb)\n",
+    "    - Overview of Nsight profiler tools\n",
+    "    - Introduction to Nsight Systems\n",
+    "    - How to use NVTX APIs\n",
+    "    - Introduction to Nsight Compute\n",
+    "    - Optimization Steps to parallel programming \n",
+    "    \n",
+    "We will be working on porting a radial distribution function (RDF) to GPUs. Please choose one approach within the Python programming language to proceed working on RDF. \n",
+    "\n",
+    "\n",
+    "#### Python Programming Language\n",
+    "\n",
+    "Please read the [RDF Overview](Python/jupyter_notebook/serial/rdf_overview.ipynb) to get familiar with how this application works.\n",
+    "\n",
+    "To get started, click on the following GPU programming approaches in python:\n",
+    "\n",
+    "1. [CuPy](./Python/jupyter_notebook/cupy/cupy_guide.ipynb)\n",
+    "2. [Numba](./Python/jupyter_notebook/numba/numba_guide.ipynb)\n",
+    "\n",
+    "To round up this tutorial, see some final [remarks on Python](Python/jupyter_notebook/Final_Remarks.ipynb)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "\n",
+    "\n",
+    "### Tutorial Duration\n",
+    "The lab material will be presented in a 8hr session. Link to material is available for download at the end of the lab.\n",
+    "\n",
+    "### Content Level\n",
+    "Beginner, Intermediate\n",
+    "\n",
+    "### Target Audience and Prerequisites\n",
+    "The target audience for this lab is researchers/graduate students and developers who are interested in learning about programming various ways to programming GPUs to accelerate their scientific applications.\n",
+    "\n",
+    "Basic experience with Python programming is needed. No GPU programming knowledge is required.\n",
+    "\n",
+    "-----\n",
+    "\n",
+    "# <div style=\"text-align: center ;border:3px; border-style:solid; border-color:#FF0000  ; padding: 1em\">[HOME](../../nways_start.ipynb)</div> \n",
+    "-----\n",
+    "\n",
+    "\n",
+    "## Licensing \n",
+    "\n",
+    "This material is released by NVIDIA Corporation under the Creative Commons Attribution 4.0 International (CC BY 4.0). "
+   ]
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Python 3",
+   "language": "python",
+   "name": "python3"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": "3.8.5"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 4
+}

+ 18 - 2
hpc/nways/nways_labs/nways_MD/README.md

@@ -11,13 +11,23 @@ To run this tutorial you will need a machine with NVIDIA GPU.
 To start with, you will have to build a Docker or Singularity container.
 
 ### Docker Container
+
+#### C & Fortran
 To build a docker container, run: 
 `sudo docker build -t <imagename>:<tagnumber> .`
 
 For instance:
 `sudo docker build -t myimage:1.0 .`
 
-The code labs have been written using Jupyter notebooks and a Dockerfile has been built to simplify deployment. In order to serve the docker instance for a student, it is necessary to expose port 8000 from the container, for instance, the following command would expose port 8000 inside the container as port 8000 on the lab machine:
+#### Python
+To build a docker container, you have to specify the dockerfile name using flag **"-f"**, hence run: 
+`sudo docker build -f <dockerfile name> -t <imagename>:<tagnumber> .`
+
+For example :
+`sudo docker build -f Dockerfile_python -t myimage:1.0 .`
+
+
+For C, Fortran, and Python, the code labs have been written using Jupyter notebooks and a Dockerfile has been built to simplify deployment. In order to serve the docker instance for a student, it is necessary to expose port 8000 from the container, for instance, the following command would expose port 8000 inside the container as port 8000 on the lab machine:
 
 `sudo docker run --rm -it --gpus=all -p 8888:8888 myimage:1.0`
 
@@ -33,10 +43,16 @@ Once inside the container, open the jupyter notebook in browser: http://localhos
 
 ### Singularity Container
 
+#### C & Fortran
 To build the singularity container, run: 
 `singularity build nways.simg Singularity`
 
-and copy the files to your local machine to make sure changes are stored locally:
+#### Python
+To build the singularity container, run: 
+`singularity build nways.simg Singularity_python`
+
+
+For C, Fortran, and Python, copy the files to your local machine to make sure changes are stored locally:
 `singularity run nways.simg cp -rT /labs ~/labs`
 
 Then, run the container:

+ 3 - 2
hpc/nways/nways_labs/nways_start.ipynb

@@ -31,9 +31,10 @@
    "source": [
     "### Tutorial Outline\n",
     "\n",
-    "During this lab, we will be working on porting mini applications in Molecular Simulation (MD) domain to GPUs. You can choose to work with either of this application. Please click on one of the below links to start:\n",
+    "During this lab, we will be working on porting mini applications in Molecular Simulation (MD) domain to GPUs. You can choose to work with either of this application. Please click on one of the below links to start N Ways to GPU Programming in **MD** for:\n",
     "\n",
-    "- N Ways to GPU Programming in [MD](nways_MD/English/nways_MD_start.ipynb) domain\n"
+    "- [ C and Fortran ](nways_MD/English/nways_MD_start.ipynb) domain\n",
+    "- [Python ](nways_MD/English/nways_MD_start_python.ipynb) domain\n"
    ]
   },
   {