"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
Interactive C++ code development using C++Explorer and GitHub Classroom for educational purposes
1. Interactive C++ code development using C++Explorer
and GitHub Classroom for educational purposes1
Patrick Diehl and Steven R. Brandt
Louisiana State Univeristy
pdiehl@cct.lsu.edu, sbrandt@cct.lsu.edu
March, 2022
1
Paper: https://doi.org/10.1002/cpe.6893, Preprint: https://doi.org/10.35542/osf.io/5te23
Patrick Diehl and Steven R. Brandt (LSU) C++Explorer and GitHub classroom March, 2022 1 / 21
2. Motivation
Providing a complete
installation to the students
without the burden of the setup.
Interactive C++ development,
to more rapidly experiment with
different ideas/algorithms.
Introduction to version control
using GitHub classroom
Patrick Diehl and Steven R. Brandt (LSU) C++Explorer and GitHub classroom March, 2022 2 / 21
3. Overview
1 Prior Work
2 Setup
3 Interactive Modes
4 Survey
5 Conclusion & Outlook
Patrick Diehl and Steven R. Brandt (LSU) C++Explorer and GitHub classroom March, 2022 3 / 21
4. Prior Work
Patrick Diehl and Steven R. Brandt (LSU) C++Explorer and GitHub classroom March, 2022 4 / 21
5. Prior Work
GitHub Classroom is widely used in many disciplines, e.g. computer
science, engineering, physics, etc. [4]
JupyterHub/Notebooks are likewise widely used in teaching multiple
disciplines, e.g. meterology, physics, data science, etc. [1, 3–7]
No education papers using Cling exist so far?
Certainly no papers combining these three technologies. 2
2
Steven R. Brandt has used these technologies for tutorials at Supercomputing in
2015 and 2017.
Patrick Diehl and Steven R. Brandt (LSU) C++Explorer and GitHub classroom March, 2022 5 / 21
6. Setup
Patrick Diehl and Steven R. Brandt (LSU) C++Explorer and GitHub classroom March, 2022 6 / 21
7. Setup - Installation
Run a notebook:
S="https://raw.githubusercontent.com/stevenrbrandt"
curl -L $S/CxxExplorer/master/docker-compose.yml
# Edit docker-compose.yml
docker-compose up -d
Run a server:
S="https://raw.githubusercontent.com/stevenrbrandt"
curl -L $S/CxxExplorer/master/docker-compose.server.yml
# Edit docker-compose.server.yml
docker-compose -f docker-compose.server.yml up -d
Create Your Own Login server
OAuth with GitHub — This plugin complements our choice of using
GitHub Classroom.
Can use an accept list to limit users (useful for web-based teaching)
Can use a “secret word” to limit users (useful for in-person teaching)
Patrick Diehl and Steven R. Brandt (LSU) C++Explorer and GitHub classroom March, 2022 7 / 21
8. Setup - C++ Packages
Cling — A C++ interpreter developed at CERN as a tool for
scientists working on the Large Hadron Collider.
HPX — A parallel programming framework developed for general
purpose programming, both of nodes and clusters. Contains
implementations of the latest C++ standards (and proposed
standards) for parallel algorithms.
Blaze — High Performance C++ Math, includes vectorization and
parallel execution. Completely portable.
Patrick Diehl and Steven R. Brandt (LSU) C++Explorer and GitHub classroom March, 2022 8 / 21
9. Setup - Docker Image
Installation of Cling is not trivial
Installation of HPX is not trivial
Special options needed to work with Cling
Special options to work on 64+ cores
Pre-compiled docker image is about 8GB
Build on your server git clone
https://github.com/stevenrbrandt/CxxExplorer.git
# Edit docker-compose.build.yml
docker-compose -f docker-compose.build.yml build --pull
Patrick Diehl and Steven R. Brandt (LSU) C++Explorer and GitHub classroom March, 2022 9 / 21
11. Cling Notebooks
Lets students play with C++ code fragments.
Seeing std::cout << "Hello, world" << std::endl; work is
surreal!
Notebooks extended with %%writefile and %%bash magics.
Bad
Limited by “one definition rule.”
No support for threadlocal in the underlying LLVM means
std::async won’t work, but hpx::async will.
Patrick Diehl and Steven R. Brandt (LSU) C++Explorer and GitHub classroom March, 2022 11 / 21
12. Cling Magic
New interface to Cling
Use Cling from a Python
notebook
replay() function to restore
state if it’s lost for some reason
Pass string data between C++
and Python
Patrick Diehl and Steven R. Brandt (LSU) C++Explorer and GitHub classroom March, 2022 12 / 21
13. Pybind11
Cling is based on Clang version
5.0.0
Maybe you want a newer
compiler?
Idea, provide C++ code in a
doc comment on a Python
function, use a decorator to
extract and compile the code.
Link to Python with Pybind11.
Patrick Diehl and Steven R. Brandt (LSU) C++Explorer and GitHub classroom March, 2022 13 / 21
14. Telegram bot
Execute C++
code snippets
from your phone.
Perform simple
plots.
Run your own
bot from your
laptop or desktop
machine.
Patrick Diehl and Steven R. Brandt (LSU) C++Explorer and GitHub classroom March, 2022 14 / 21
15. Survey
Patrick Diehl and Steven R. Brandt (LSU) C++Explorer and GitHub classroom March, 2022 15 / 21
16. Selected results
Somewhat easy
25%
Very easy
25%
moderate
25%
easy
25%
(a) How difficult was it to set up git?
From start
50%
First quarter
25%
Third quarter
25%
(b) When did you start using the
notebook?
Figure: Selected survey results: (a) usage of git and GitHub Classroom and (b)
start of the usage of the notebooks . Additional results and the raw data is
available here [2].
Patrick Diehl and Steven R. Brandt (LSU) C++Explorer and GitHub classroom March, 2022 16 / 21
17. Selected results
Strongly agree
25%
Agree 50%
Neutral
25%
(a) I used the server/notebook often.
moderate
50%
Strongly agree
25%
Agree
25%
(b) I liked the notebook as an editor.
Figure: Selected survey results: (a) frequency of the usage of the notebooks and
(b) acceptance of the notebook as an editor . Additional results and the raw data
is available here [2].
Patrick Diehl and Steven R. Brandt (LSU) C++Explorer and GitHub classroom March, 2022 16 / 21
18. Conclusion & Outlook
Patrick Diehl and Steven R. Brandt (LSU) C++Explorer and GitHub classroom March, 2022 17 / 21
19. Conclusion & Outlook
Conclusion
A novel teaching environment adapted to teaching parallel C++
programming and source code management
Extensions to the utilized tools to make the notebooks richer and the
interactive experience more complete.
Student’s feedback was mostly positive, but from a small group
Outlook
Add the requested feature, if possible, to the C++Explorer
Redo the survey in the fall 2020 class with 10 students
Patrick Diehl and Steven R. Brandt (LSU) C++Explorer and GitHub classroom March, 2022 18 / 21
20. Open source and open teaching content
Note that we published the C++Explorer on GitHub and the course
material under a creative common license.
C++Explorer3
Examples for the described usage4
Lecture slides5
Exercises6
Course notes7
Feel free to use the C++Explorer and course material in your teaching.
3
https://github.com/stevenrbrandt/CxxExplorer
4
https://github.com/diehlpk/gateways2020
5
https://github.com/diehlpkteaching/ParallelComputationMath
6
https://github.com/diehlpkteaching/ParallelComputationMathExercise
7
https://github.com/diehlpkteaching/ParallelComputationMathScript
Patrick Diehl and Steven R. Brandt (LSU) C++Explorer and GitHub classroom March, 2022 19 / 21
21. References
[1] Miguel A Angulo and Ozgur Aktunc. Using github as a teaching tool for
programming courses. In ASEE Gulf-Southwest Section Annual Meeting 2018
Papers. American Society for Engineering Education, 2019.
[2] Patrick Diehl and Steven R. Brandt. Survey results: Parallel comp math fall 2019,
March 2020.
[3] Jacob Fiksel, Leah R Jager, Johannna S Hardin, and Margaret A Taub. Using github
classroom to teach statistics. Journal of Statistics Education, 27(2):110–119, 2019.
[4] Courtney Hsing and Vanessa Gennarelli. Using github in the classroom predicts
student learning outcomes and classroom experiences: Findings from a survey of
students and teachers. In Proceedings of the 50th ACM Technical Symposium on
Computer Science Education, pages 672–678, 2019.
[5] John Kelleher. Employing git in the classroom. In 2014 World Congress on
Computer Applications and Information Systems (WCCAIS), pages 1–4. IEEE, 2014.
[6] Csaba-Zoltán Kertész. Using github in the classroom-a collaborative learning
experience. In 2015 IEEE 21st International Symposium for Design and Technology
in Electronic Packaging (SIITME), pages 381–386. IEEE, 2015.
[7] Alexey Zagalsky, Joseph Feliciano, Margaret-Anne Storey, Yiyun Zhao, and Weiliang
Wang. The emergence of github as a collaborative platform for education. In
Proceedings of the 18th ACM Conference on Computer Supported Cooperative
Work & Social Computing, pages 1906–1917, 2015.
Patrick Diehl and Steven R. Brandt (LSU) C++Explorer and GitHub classroom March, 2022 20 / 21
22. This work is licensed under a Creative
Commons “Attribution-NonCommercial-
NoDerivatives 4.0 International” license.
Patrick Diehl and Steven R. Brandt (LSU) C++Explorer and GitHub classroom March, 2022 21 / 21