Strumenti Utente

Strumenti Sito


oph:cluster:openfoam

Differenze

Queste sono le differenze tra la revisione selezionata e la versione attuale della pagina.

Link a questa pagina di confronto

Entrambe le parti precedenti la revisioneRevisione precedente
oph:cluster:openfoam [2024/07/16 10:48] carlo.cintolesi@unibo.itoph:cluster:openfoam [2024/07/16 10:49] (versione attuale) – versione precedente ripristinata (2023/08/18 08:35) carlo.cintolesi@unibo.it
Linea 1: Linea 1:
-====== JupyterHub  ====== +====== Brief guide for OpenFoam usage ======
-by  //[[elena.bianco3@unibo.it|Elena Bianco]] 16/07/2024 //+
  
 +Some versions of OpenFOAM have been installed on the cluster and other utilities and versions can be implemented. At present, a module for OpenFOAM has not been created, but the source code has been compiled directly. It is recommended that modules be created in the future or that the container[[oph:cluster:apptainer|Apptainer]] will be used for maximum stability and compatibility of the different versions.
  
-[[https://github.com/jupyterhub/jupyterhub-tutorial|JupyterLab]] is a web-based interactive interface for notebooks and code (e.g., Python, R, Julia), that can be used to use interactive jobs in python in the cluster OPH. +=== Which OpenFOMA is installed? ===
  
-The Jupyter environment can be used on the OPH cluster by creating a specific container for its installation and configurationJupyterHub can be launched on a cluster node using the job queue systemand the user can work interactively with Python notebooks using the allocated resources+Installed versions of OpenFOAM can be found in ''/home/software/atmos/OpenFOAM/'' and are continuously being updatedThe following versions of the [[https://openfoam.org/|OpenFOAM Foundation]] fork are currently installed: 
 +  * OpenFOAM 6 (with ThirdParty) 
 +  * OpenFOAM 9 (with ThirdParty) 
 +For any version updates or installation of additional softwareplease contact [[carlo.cintolesi@unibo.it|Dr CCintolesi]]
  
 +=== How to load and use OpenFOAM ===
  
 +OpenFOAM modules must be loaded into the configuration file ''.bashrc'' located in your personal home directory on the cluster. It is recommended to load a current use version by default by adding the following string:
  
-=== 1. Create a container with Apptainer  ===+   source /home/software/atmos/OpenFOAM/OpenFOAM-9/etc/bashrc
  
-The user can either create a new container from scratch or build it from an existing Docker imageas done [[https://hub.docker.com/r/jupyterhub/jupyterhub|here]]. The predefined Docker image only includes a baseline deployment of JupyterHubbut additional configuration can be specified by the user. +whichfor example, loads version 9For other versionssubstitute the desired version number.  
 +It is also recommended to load the configuration file of all versions by adding the following line:
  
-  apptainer build --sandbox container_namedocker://jupyterhub/jupyterhub  +   source /home/software/atmos/OpenFOAM/loadOF.sh
  
-The ''--sandbox'' option creates an editable directory that mimics the Linux-Ubuntu file structure, containing usual directories (home, tmp, media, etc.). Replace ''container_name'' with the desired container name+so that you can switch from one version to another via the following aliases: ''goOF6'' (version 6and ''goOF9'' (version 9)
  
-Find directories within the sandbox that are not writable and make them writable  
  
-  find container_name -type d -not -writable -exec chmod +w {} +  
- 
-Enter the container shell (from the path where the container is located).  
- 
-  apptainer shell --writable container_name  
- 
-Check the version of installed packages (e.g., JupyterHub)   
- 
-  apptainer exec --writable container_name jupyterhub --version  
- 
-Packages can be updated or installed manually within the container, if they are not already available in the baseline configuration.   
- 
-  pip install jupyter notebook jupyterlab  
- 
-Use 'exit' to go back to the main shell.  
- 
- 
-=== 2. Run Jupyter from containers  === 
- 
-When using Jupyter for data analysis or any other task requiring computational resources, the user must first request and allocate resources on a compute node before launching the Hub. This can be done using the ''salloc'' command from the cluster login node using the job queue system (the line below can be adjusted to specific job requests)  
- 
-  salloc -N 1 --cpus-per-task=1 --time=02:00:00 --mem=2G --constraint=blade  
- 
-Once the resources have been allocated, enter the container shell and launch JupyterLab  
- 
-  apptainer shell --writable container_name  
-  jupyter lab --ip=0.0.0.0 --port=8000 --no-browser  
- 
-In a separate terminal window, login to the cluster frontend, and then connect to the allocated node (the node is displayed after running the ''salloc'' command). Here, 2010 is chosen as the local port.  
- 
-  ssh -N -L 2010:localhost:8000 username@node  
- 
-In a new terminal window from the local machine, connect to the cluster with  
- 
-  ssh -N -L 2010:localhost:8000 username@137.204.50.71  
- 
-Where ''2010'' is the chosen local port and ''8000'' is the remote port specified in the first terminal window.  
- 
-Finally, navigate to ''localhost:2010'' on the computer browser and a window should appear with the Jupyter interface. To authenticate, insert the token provided in the first terminal window.  
- 
-Use ''ctlr+C'' to end the connection and go back to the Apptainer shell.   
oph/cluster/openfoam.1721126887.txt.gz · Ultima modifica: 2024/07/16 10:48 da carlo.cintolesi@unibo.it

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki