Platform
We deployed virtual machines in the cloud at VirtualData. To ensure that everyone observes the same system performance phenomena during the practicals, it is strongly suggested that you do them on the Linux server that you have been given access. All instructions given in this document will assume that you are doing so, and may not work as expected on another computer.
Network connexion
At least one of the academic institutions with which you work likely provides you with access to eduroam. Be sure to set it up and try it out in advance: you may need help from your local computing service as the configuration procedure is institution-specific. Here’s the documentation for IJCLab members.
In case you experience last-minute issues with eduroam, you will alternatively be able to use our public Wi-Fi network. You will need to be physically at IJCLab to set up this one, so no advance preparation is possible in this configuration.
Server configuration
The practical servers are configured in the following manner:
- Each server is running an AlmaLinux OS (Alma 9).
- The username to connect is
student
, and you should use the password given at the start of the lecture. - All necessary tools to compile and execute scripts are installed and accessible in the server. If this is not the case, please ask one of the teachers.
- When you connect to the server, you are automatically put in a Python
virtual environment (called
robprog
). This environment contains all necessary packages to perform the work. If you deactivated it, just log out from the server and reconnect, or executesource /opt/.venv/bin/activate
.
Finally keep in mind that
- You should not use the server for other purposes than this lecture.
- The server will be available until the 12th April, then it will be
reallocated to other work and all data will be removed. This should give you
enough time to finish the second homework, but please remember to
scp
any file you care about away from the server!
SSH shortcuts
At the beginning of the course, you have been provided with the IP address of the server
that you will be working on, as well as your user name on it. However, IP
addresses are unwieldy to remember and user names are boring to specify on every
connexion, so you may want to add something like the following to your SSH
config file (~/.ssh/config
on Linux and macOS)…
# Robust programming training
Host robust-programming
User <username>
HostName <server IP address>
…where you replace the <bits between brackets>
with the matching information
from the registration e-mail that you have received. Once that is done
ssh robust-programming
will connect you directly to the practicals platform,
with the right user name, and directly ask you for your password.
Source code
First of all, you should download the source code for the practicals. It is located inside of this archive, which you can download and unpack in your home directory using this script:
#!/bin/bash
FOLDER_NAME="robust-programming"
BASE_URL="https://informatique-des-deux-infinis.pages.in2p3.fr/pheniics"
cd ~
# Keep a copy of the current
# folder if it exists
if test -d ${FOLDER_NAME}; then
SUFFIX=`date +"%Y%m%d_%s"`
BACKUP=${FOLDER_NAME}_${SUFFIX}
echo "Found existing ${FOLDER_NAME} folder"
echo "Keeping a copy under ${BACKUP} and redownloading it..."
mv ${FOLDER_NAME} ${BACKUP}
fi
curl ${BASE_URL}/${FOLDER_NAME}/${FOLDER_NAME}.tar.gz | tar -xz
If, for some reason, you get one of these files into an undesirable state (e.g.
accidentally delete it), you can get back a fresh copy of it in its initial
state by re-running the script. It will save your current work, and download
again the robust-programming
directory in which you will find the original
source files.
Eventually, your home directory ~/robust-programming
directory containing the
source code for all practicals. For demonstrations, this will be the final
source code at the end of the demonstration. You can compile C++ programs using
the provided Makefile:
make -j$(nproc)
Some Makefiles also have additional options, such as make test
for running the
test binaries (if any) or make doc
for building Doxygen documentation. Please
feel free to check the contents of the Makefiles for more info about what they
do.
Local file access
One drawback of using an SSH-based remote configuration is that it seemingly
forces you into using archaic terminal-based code editors like vi
or emacs
,
instead of more modern alternatives like Sublime Text or Visual Studio Code.
Thankfully, there are ways to mount a remote directory that you have access
to via SSH as a local directory on your laptop, so that you can manipulate files
in it locally with your preferred text editor.
- For a general way to do this, please check out this sshfs
tutorial
that Hadrien wrote as part of the documentation of
srv-calcul-ambulant
, another compute server that he administrates. Translating these instructions for a different server should be straightforward (you only need to change the server name), but do get back to us if you encounter any issue. - If you are using Visual Studio Code specifically, it has its own support for
operating over SSH
connections that you
may prefer over
sshfs
.
Of course, this access is only good for editing source code, and you should not try build programs or execute them on your local machine: you may not have the required prerequisites installed and even if you do, your local system is probably not as well tuned for reliable and reproducible performance benchmarking as the remote one.