From T3_KR_KNU
Jump to: navigation, search

JupyterHub

소개

  • jupyterhub는 jupyter notebook을 다중 사용자가 사용할 수 있도록 만들어진 환경입니다.
  • 아래 주소를 이용하여 경북대 Tier3 jupyterhub에 접속할 수 있습니다.
  • https://cms.knu.ac.kr:8000

커널

  • 노트북 커널은 노트북 문서에 포함 된 코드를 실행하는 "계산 엔진"입니다.

기본 제공 커널

Python 3
  • python 3.9.25
Python 3 + PyROOT
  • python 3.11.9
  • ROOT 6.32.02

사용자 커널 추가하기

  • 커널 디렉토리 생성
mkdir -p ~/.local/share/jupyter/kernels/python3-pyroot-user
  • kernel.json 생성
cat > ~/.local/share/jupyter/kernels/python3-pyroot-user/kernel.json <<'EOF'  
{  
"argv": [  
"bash",  
"-lc",  
"source /cvmfs/sft.cern.ch/lcg/views/LCG_106/x86_64-el9-gcc13-opt/setup.sh && exec /opt/jupyterhub/user/bin/python -m ipykernel_launcher -f {connection_file}"  
],  
"display_name": "Python 3 + PyROOT (user)",  
"language": "python"  
}  
EOF
  • 확인
jupyter kernelspec list
  • 커널 삭제
jupyter kernelspec uninstall mykernel

HTCondor Python API

ROOT

  • C++ ROOT
TCanvas c;
TH1F h("h","ROOT Histo;X;Y",64,-4,4);
h.FillRandom("gaus");
h.Draw();
c.Draw();

  • Python ROOT
import ROOT
c = ROOT.TCanvas("c")
h = ROOT.TH1F("h","ROOT Histo;X;Y",64,-4,4)
%%cpp
h->FillRandom("gaus");
h->Draw();
c->Draw();

tensorflow

  • 현재 jupyterhub에서는 tensoflow cpu 만 사용할 수 있습니다.
  • tensorflow gpu의 사용을 위해서는 기존과 같이 htcondor를 이용해야합니다.

기타

단축키