# Computing ## Local resources **GRICAD** is the Grenoble computing centre and serves the local community, there website can be found [here](https://gricad.univ-grenoble-alpes.fr/gricad/) and their wiki is [here](https://gricad-doc.univ-grenoble-alpes.fr/en/). Instructions on how to create an account can be found [here](https://gricad-doc.univ-grenoble-alpes.fr/en/services/). ### GUIX https://gricad-doc.univ-grenoble-alpes.fr/en/hpc/softenv/guix/ To enter the GUIX environment, use this: ```bash source /applis/site/guix-start.sh ``` .. note:: It is not recommended to put this into `.bashrc` ### Kraken-CPU Information about the machine: https://gricad-doc.univ-grenoble-alpes.fr/en/hpc/kraken/kraken/ #### QuantumESPRESSO First you need to set up the DIAMOND GUIX channel by following the instructions here: https://gricad-gitlab.univ-grenoble-alpes.fr/diamond/guix/guix-channel Next, you can install QE using: ```bash guix install quantum-espresso guix install openmpi-kraken ``` Here is an example submission script (note you may need to update your project) ```bash #!/bin/bash #OAR -n lammps_test #OAR -O stdout.txt #OAR -E stderr.txt #OAR -l /nodes=1/core=192,walltime=48:00:00 #OAR --project pr-atosimul source /applis/site/guix-start.sh guix install quantum-espresso guix install openmpi-kraken GUIX_PROFILE="/home/uhrinm/.guix-profile" . "$GUIX_PROFILE/etc/profile" cd "$OAR_WORKDIR" export OMP_NUM_THREADS=1 mpirun -np 192 pw.x -npool 8 -in < pwscf.in > pwscf.out ``` ### Shared conda environments You can get access to the natively installed `conda` using: ``` source /applis/environments/conda.sh ``` then we store shared environments in `/bettik/uhrinm/camml/envs`, so for example you can access the shared `allegro` environment by using: ``` conda activate /bettik/uhrinm/camml/envs/allegro ``` be careful when `pip install`ing to make sure whatever you install does not conflict with what is already there, or you make break the environment for everyone else. ## National resources The entry point t o accessing the national resources is GENCI's DARI platform found [here](https://www.edari.fr/). To create your account: 1. Click on this [link](https://www.edari.fr/user/login), in the top right you can change the language to English, and then click on the big button below 'Connection via Education-Research Federation'. 2. Select Grenoble-INP (or CNRS if they are your employer) and log in using your standard details. ### IDRIS To access IDRIS, make sure it appears among the HPC facilities listed on your personal eDari page, which you can view by accessing [here](https://www.edari.fr/user/login). Also, on the same page, verify that one of the listed IP addresses is 129.88.196.128, which corresponds to the domain ''rotule.univ-grenoble-alpes.fr''. If this is the case, it will be very useful, since you will not be able to connect directly from your laptop to IDRIS. Instead, rotule will act as an intermediate proxy machine: you will first connect to rotule via ''ssh'', and from rotule you will then connect via ''ssh'' to IDRIS. If you have access to IDRIS, you should have received an email from ''gestutil@idris.fr'' containing your user login (a 7-character alphanumeric ID) and the first part of your password (a 14-character string composed of letters, numbers, and symbols). Please note that this first part of the password expires after 20 days; if you do not log in within this period, you will need to request a new initial password by emailing ''assist@idris.fr'' (in English or French). Additionally, on your eDari page, under the "Informations de sécurité" section, you will find the second part of your password i.e., an 8-character code that you chose during the subscription process. At this point you are ready for accessing to IDRIS: 1. Open a terminal and type ''ssh @rotule.univ-grenoble-alpes.fr'', where, instead of '''' you should type your agalan username. Usually it corresponds to the surname followed by the first letter of your name (so John Smith becomes ''ssh smithj@rotule.univ-grenoble-alpes.fr''). 2. It asks you for the password: it's your agalan password (not the IDRIS one). 3. Now you should be in agalan@rotule. Type ''ssh @jean-zay.idris.fr'', where the '''' is your user login for IDRIS received by e-mail. 4. Now you are asked for the password, which is the concatenation of the two parts explained above. At the first login, you will be asked to change it with a new one and to repeat it twice. More details about the procedure and about the requirements of the password are in the Section "Passwords" of [this page](http://www.idris.fr/static/intro/doc_nouvel_utilisateur-eng.html). Now you should see a message like //Ceci est un serveur de calcul de l'IDRIS. Tout acces au systeme doit etre specifiquement autorise par l'IDRIS. Si vous tentez de ...//. You are in IDRIS. #### From IDRIS to camml-codes Now that you are in IDRIS, you may need to run our Python libraries under the [''camml-codes''](https://github.com/camml-lab/camml-codes). If this is the case, you will need to set up a proper Conda environment and then to clone the repo in that environment. To this end, you will not need to install Conda, since miniforge is already available on the cluster. However, you will need to follow some good practices. In particular, when a new Conda environment is created, all files are stored by default in ''$HOME/.conda''. This is far from ideal, as ''$HOME'' is limited in both space and inodes. It is therefore preferable to store everything in ''$WORK/.conda'' and create a symbolic link in ''$HOME'' that points to the target directory. So, if ''$HOME/.conda'' exists already, type ```bash mv $HOME/.conda $WORK ln -s $WORK/.conda $HOME ``` otherwise ```bash mkdir $WORK/.conda ln -s $WORK/.conda $HOME ``` Further details are [here](http://www.idris.fr/eng/jean-zay/gpu/jean-zay-gpu-python-env-eng.html). To list the available miniforge versions, type ''module avail miniforge'', and load miniforge with a command like ```bash module load miniforge/25.9.1 ``` At this point, on the left of your user login, it should have appeared a ''(base)'', similar to the following: ```bash (base) [@jean-zay1: ~]$ ``` Now you are ready to create a Conda environment, with the usual command ```bash conda create -n python= ``` Once the new environment is created and activated via ''conda activate '', you need to git clone the ''camml-codes'' on it. However, some of the repos listed therein may be private. On a local machine, this would be solved by generating a key and linking it to your GitHub account. Unfortunately, this will not work here, as IDRIS cannot be ssh'ed on GitHub; indeed, the command ''ssh -T git@github.com'' would give ''ssh: connect to host github.com port 22: Connection timed out''. A workaround for this is the creation of a classic token on GitHub. In particular, access to your GitHub account in your browser. By clicking on your profile image (the small one at the top right of the screen), click then on ''Settings'' -> ''Developer settings'' -> ''Personal access tokens'' -> ''Tokens (classic)'' and generate a new classic token. You will be asked to give a short description in the ''Note'' field, choose an expiration date, and select the scopes; for this last purpose, select only ''repo'' and generate the token. Now you should see the token itself: this is the last time you will see it, so copy it somewhere else. Now that you have your token, you can use it as the password when cloning private repositories. Go back to your terminal (inside your Conda environment on IDRIS) and run: ```bash git config --global credential.helper store ``` This will save your credentials after the first successful authentication, so you won’t need to re-enter the token again until it expires. Then, proceed as usual ```bash git clone https://github.com/camml-lab/camml-codes.git cd camml-codes chmod +x codes ./codes init ``` As far as the first private repo of the list in ''camml-codes'' occurs, you will be asked to type user and password. As user, type your username in GitHub; as password, type the token. At the end, you should see a message like ''Submodule checkout complete! All accessible codes checked out.'' End up with ```bash ./codes install ``` Remember that, every time you access to IDRIS, you will need to load ''miniforge'', as the ''conda'' command does not exist by default; after that, you'll be able to ''conda activate ''. Please, notice that you cannot use the ''Remote-SSH'' feature from VSCode on IDRIS because of some security restrictions; however, you can use [JupyterHub](http://www.idris.fr/eng/jean-zay/pre-post/jean-zay-jupyterhub-eng.html). #### Jean-Zay To get an interactive session on Jean-Zay on the A100 partition you can use something like: ``` salloc --nodes=1 --ntasks-per-node=1 --cpus-per-task=1 --gres=gpu:1 --hint=nomultithread -A iop@a100 -C a100 --time=00:30:00 bash ``` This will give you 1 GPU on 1 node with 1 associated CPU for 30 minutes. You can change these if you need something different. Also, make sure that the account (`-A`) is correct, as you may be on a different project.