Skip to content

Instantly share code, notes, and snippets.

View vivek-bala's full-sized avatar

Vivekanandan (Vivek) Balasubramanian vivek-bala

View GitHub Profile
#!/bin/bash
# edited by andre@merzky.net
# original at https://gist.github.com/Mark-Booth/5058384
# forked from https://gist.github.com/lth2h/4177524 @ ae184f1 by mark.booth
# forked from https://gist.github.com/jehiah/1288596 @ e357c1e by lth2h
# ideas from https://github.com/kortina/bakpak/blob/master/bin/git-branches-vs-origin-master
# this prints out some branch status
# (similar to the '... ahead' info you get from git status)

Testing jsrun in layout mode on Summitdev

1) Task needs to be assigned node 1, physical core 1, HW thread 1

Status: Done

$ cat resource-file
RS 0: { host: 1, cpu: 0}
$ export OMP_NUM_THREADS=1
$ jsrun -n 1 -a 1 -U /ccs/home/vivekb/resource-file-1 /ccs/proj/csc190/Hello_jsrun/jsrun_layout
*** MPI Ranks: 1, OpenMP Threads: 1, GPUs per Resource Set: 0 ***
# Single process, single thread
```
$ cat resource-file-1
RS 0: { host: 1, cpu: 0}
$ export OMP_NUM_THREADS=1
$ jsrun -n 1 -a 1 -U /ccs/home/vivekb/resource-file-1 /ccs/proj/csc190/Hello_jsrun/jsrun_layout
########################################################################
*** MPI Ranks: 1, OpenMP Threads: 1, GPUs per Resource Set: 0 ***
========================================================================
(ve-test) -bash-4.2$ pip install pyzmq
Collecting pyzmq
Using cached https://files.pythonhosted.org/packages/b9/6a/bc9277b78f5c3236e36b8c16f4d2701a7fd4fa2eb697159d3e0a3a991573/pyzmq-17.1.2.tar.gz
Building wheels for collected packages: pyzmq
Running setup.py bdist_wheel for pyzmq ... error
Complete output from command /autofs/nccs-svm1_home1/vivekb/ves/ve-test/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-nMhGh8/pyzmq/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-XdYpDf --python-tag cp27:
running bdist_wheel
running build
running build_py
creating build

OpenMP (env variables)=4, smt level=4:

#BSUB -alloc_flags 'gpumps smt4' 
$ export  OMP_NUM_THREADS=4
$ jsrun -n 1 -a 1 -c 4 -g 1 /ccs/proj/csc190/Hello_jsrun/jsrun_layout
*** MPI Ranks: 1, OpenMP Threads: 4, GPUs per Resource Set: 1 ***
========================================================================
MPI Rank 000, OMP_thread 00 on HWThread 001 of Node summitdev-r0c1n03 - RT_GPU_id 0 : GPU_id 0
MPI Rank 000, OMP_thread 01 on HWThread 002 of Node summitdev-r0c1n03 - RT_GPU_id 0 : GPU_id 0

OpenMP (env variables)=4, smt level=4:

jsrun -n1 -a1 -c4 -g1 /ccs/home/vivekb/tools/Hello_jsrun/jsrun_layout
########################################################################

*** MPI Ranks: 1, OpenMP Threads: 4, GPUs per Resource Set: 1 ***
========================================================================
MPI Rank 000, OMP_thread 00 on HWThread 002 of Node summitdev-r0c2n02 - RT_GPU_id 0 : GPU_id 0 
MPI Rank 000, OMP_thread 03 on HWThread 000 of Node summitdev-r0c2n02 - RT_GPU_id 0 : GPU_id 0 
MPI Rank 000, OMP_thread 01 on HWThread 003 of Node summitdev-r0c2n02 - RT_GPU_id 0 : GPU_id 0 
mpirun(1) General Commands Manual mpirun(1)
NAME
mpirun - Runs MPI programs
SYNOPSIS
mpirun [global_options] hp_spec [:hp_spec ...]
from mpi4py import MPI
import socket
import subprocess
import sys
if __name__ == '__main__':
threads = sys.argv[1]
duration = sys.argv[2]
> Ask for 1 node, use alloc_flags to set gpumps and smt levels
Cmd:
```
jd.executable = 'jsrun'
jd.arguments = ['-n','1','-a','6','-c','1','-g','1','-bpacked:4','/ccs/proj/csc190/Hello_jsrun/jsrun_layout','|','sort','&>','/ccs/proj/csc190/Hello_jsrun/op.txt']
jd.total_cpu_count = 42
jd.alloc_flags = ['gpumps','smt4']
```
> CC=gcc gmake
gmake -f Makefile.config
autoconfig: using wchar.h
autoconfig: using -lz
autoconfig: using -lcrypt
autoconfig: using -lrt
autoconfig: using -lpthread
autoconfig: using pthread spinlock
autoconfig: using keyutils.h
autoconfig: using float decimal support