calcoloscientifico:cluster:softwareapplicativo:conda
Differenze
Queste sono le differenze tra la revisione selezionata e la versione attuale della pagina.
| Entrambe le parti precedenti la revisioneRevisione precedenteProssima revisione | Revisione precedente | ||
| calcoloscientifico:cluster:softwareapplicativo:conda [23/10/2021 17:32] – [Table] fabio.spataro | calcoloscientifico:cluster:softwareapplicativo:conda [05/07/2024 10:04] (versione attuale) – federico.prost | ||
|---|---|---|---|
| Linea 42: | Linea 42: | ||
| Available versions of the " | Available versions of the " | ||
| - | ^ condaenv | + | ^ condaenv |
| | statistical-genetics | | statistical-genetics | ||
| | statistical-genetics-2020.03.14 | | statistical-genetics-2020.03.14 | ||
| Linea 75: | Linea 75: | ||
| </ | </ | ||
| - | Now we will see how to run the scripts that you find on the [[calcoloscientifico: | + | Now we will see how to run the scripts that you find on the [[calcoloscientifico: |
| Script '' | Script '' | ||
| Linea 88: | Linea 88: | ||
| #SBATCH --mem=512M | #SBATCH --mem=512M | ||
| #SBATCH --partition=vrt | #SBATCH --partition=vrt | ||
| + | #SBATCH --qos=vrt | ||
| #SBATCH --time=0-00: | #SBATCH --time=0-00: | ||
| ##SBATCH --account=< | ##SBATCH --account=< | ||
| Linea 102: | Linea 103: | ||
| </ | </ | ||
| - | Script '' | + | Script '' |
| - | <code bash slurm-statistical-genetics-bdw.sh> | + | <code bash slurm-statistical-genetics-cpu.sh> |
| #!/bin/bash | #!/bin/bash | ||
| #SBATCH --job-name=loop | #SBATCH --job-name=loop | ||
| Linea 112: | Linea 113: | ||
| #SBATCH --ntasks-per-node=4 | #SBATCH --ntasks-per-node=4 | ||
| #SBATCH --mem=512M | #SBATCH --mem=512M | ||
| - | #SBATCH --partition=bdw | + | #SBATCH --partition=cpu |
| + | #SBATCH --qos=cpu | ||
| #SBATCH --time=0-00: | #SBATCH --time=0-00: | ||
| ##SBATCH --account=< | ##SBATCH --account=< | ||
| Linea 129: | Linea 131: | ||
| ==== Virtualenv " | ==== Virtualenv " | ||
| - | Main packages included: | + | Main packages included |
| < | < | ||
| conda install: | conda install: | ||
| - | cudatoolkit pip mpi4py h5py keras opencv opencv-python-headless tensorflow torchvision easydict pytorch | + | |
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | - statsmodels | ||
| + | - flax | ||
| + | - transformers | ||
| pip install: | pip install: | ||
| - | keras.datasets sklearn | + | |
| + | | ||
| </ | </ | ||
| Available versions of the " | Available versions of the " | ||
| - | ^ machine-learning-cuda | + | ^ condaenv |
| - | | machine-learning-cuda-11.2.2 | + | | machine-learning-cuda-11.6.0 |
| - | | machine-learning-cuda-11.2.2-2021.10.23 | 2021.10.23 | | + | | machine-learning-cuda-11.6.0-2022.05.20 |
| - | | machine-learning-cuda-11.2.1 | + | | machine-learning-cuda-11.6.0-2022.03.09 |
| - | | machine-learning-cuda-11.2.1-2021.10.23 | 2021.10.23 | | + | | machine-learning-cuda-11.4.2 |
| - | | machine-learning-cuda-11.2.0 | + | | machine-learning-cuda-11.4.2-2022.05.20 |
| - | | machine-learning-cuda-11.2.0-2021.10.23 | 2021.10.23 | | + | | machine-learning-cuda-11.4.2-2022.03.09 |
| - | | machine-learning-cuda-11.1 | + | |
| - | | machine-learning-cuda-11.1-2021.10.22 | + | Main packages included in 2021 condaenvs: |
| - | | machine-learning-cuda-11.0 | + | |
| - | | machine-learning-cuda-11.0-2021.10.23 | + | < |
| - | | machine-learning-cuda-10.2 | + | conda install: |
| - | | machine-learning-cuda-10.2-2021.10.22 | + | - cudatoolkit |
| - | | machine-learning-cuda-10.1 | + | - pip |
| - | | machine-learning-cuda-10.1-2021.10.23 | + | - mpi4py |
| - | | machine-learning-cuda-10.0 | + | - h5py |
| - | | machine-learning-cuda-10.0-2021.10.23 | + | - keras |
| - | | machine-learning-cuda-9.0 | + | - opencv |
| - | | machine-learning-cuda-9.0-2019.10.22 | + | - opencv-python-headless |
| - | | machine-learning-cuda-8.0 | + | - tensorflow |
| - | | machine-learning-cuda-8.0-2019.10.22 | + | - torchvision |
| + | - easydict | ||
| + | - pytorch | ||
| + | |||
| + | pip install: | ||
| + | - keras.datasets | ||
| + | - sklearn | ||
| + | </ | ||
| + | |||
| + | Available versions of the " | ||
| + | |||
| + | ^ condaenv | ||
| + | | machine-learning-cuda-11.2.2 | ||
| + | | machine-learning-cuda-11.2.2-2021.10.23 | ||
| + | | machine-learning-cuda-11.2.1 | ||
| + | | machine-learning-cuda-11.2.1-2021.10.23 | ||
| + | | machine-learning-cuda-11.2.0 | ||
| + | | machine-learning-cuda-11.2.0-2021.10.23 | ||
| + | | machine-learning-cuda-11.1 | ||
| + | | machine-learning-cuda-11.1-2021.10.22 | ||
| + | | machine-learning-cuda-11.0 | ||
| + | | machine-learning-cuda-11.0-2021.10.23 | ||
| + | | machine-learning-cuda-10.2 | ||
| + | | machine-learning-cuda-10.2-2021.10.22 | ||
| + | | machine-learning-cuda-10.1 | ||
| + | | machine-learning-cuda-10.1-2021.10.23 | ||
| + | | machine-learning-cuda-10.0 | ||
| + | | machine-learning-cuda-10.0-2021.10.23 | ||
| + | | machine-learning-cuda-9.0 | ||
| + | | machine-learning-cuda-9.0-2019.10.22 | ||
| + | | machine-learning-cuda-8.0 | ||
| + | | machine-learning-cuda-8.0-2019.10.22 | ||
| Creation scripts: | Creation scripts: | ||
| Linea 205: | Linea 252: | ||
| #SBATCH --nodes=1 | #SBATCH --nodes=1 | ||
| #SBATCH --ntasks-per-node=1 | #SBATCH --ntasks-per-node=1 | ||
| - | #SBATCH --gres=gpu:tesla:1 | + | #SBATCH --gres=gpu:p100:1 |
| #SBATCH --partition=gpu | #SBATCH --partition=gpu | ||
| + | #SBATCH --qos=gpu | ||
| #SBATCH --mem=16G | #SBATCH --mem=16G | ||
| #SBATCH --time=0-00: | #SBATCH --time=0-00: | ||
| Linea 226: | Linea 274: | ||
| Available versions of the " | Available versions of the " | ||
| - | ^ cryolo-cpu | + | | **condaenv** |
| - | | 2020.09.18 | | + | | cryolo-cpu |
| + | | cryolo-cpu-2020.09.18 | ||
| Enable the default version of the " | Enable the default version of the " | ||
| Linea 268: | Linea 317: | ||
| #SBATCH --mem=1G | #SBATCH --mem=1G | ||
| #SBATCH --partition=vrt | #SBATCH --partition=vrt | ||
| + | #SBATCH --qos=vrt | ||
| #SBATCH --time=0-01: | #SBATCH --time=0-01: | ||
| ##SBATCH --account=< | ##SBATCH --account=< | ||
| Linea 285: | Linea 335: | ||
| </ | </ | ||
| - | Script '' | + | Script '' |
| - | <code bash slurm-cryolo-bdw.sh> | + | <code bash slurm-cryolo-cpu.sh> |
| #!/bin/bash | #!/bin/bash | ||
| #SBATCH --job-name=cryolo | #SBATCH --job-name=cryolo | ||
| Linea 295: | Linea 345: | ||
| #SBATCH --ntasks-per-node=4 | #SBATCH --ntasks-per-node=4 | ||
| #SBATCH --mem=4G | #SBATCH --mem=4G | ||
| - | #SBATCH --partition=bdw | + | #SBATCH --partition=cpu |
| + | #SBATCH --qos=cpu | ||
| #SBATCH --time=0-01: | #SBATCH --time=0-01: | ||
| ##SBATCH --account=< | ##SBATCH --account=< | ||
| Linea 317: | Linea 368: | ||
| Available versions of the " | Available versions of the " | ||
| - | ^ cryolo-gpu | + | ^ condaenv |
| - | | 2020.09.18 | | + | | cryolo-gpu |
| + | | cryolo-gpu-2020.09.18 | ||
| Enable the default version of the " | Enable the default version of the " | ||
| Linea 377: | Linea 429: | ||
| </ | </ | ||
| + | ==== Virtualenv " | ||
| + | Available versions of the " | ||
| + | |||
| + | ^ condaenv | ||
| + | | mdanalysis | ||
| + | | mdanalysis-2.3.0 | ||
| + | |||
| + | Enable the default version of the " | ||
| + | |||
| + | < | ||
| + | module load miniconda3 | ||
| + | source " | ||
| + | conda activate mdanalysis | ||
| + | </ | ||
| + | |||
| + | Enable the 2.3.0 version of the " | ||
| + | |||
| + | < | ||
| + | module load miniconda3 | ||
| + | source " | ||
| + | conda activate mdanalysis-2.3.0 | ||
| + | </ | ||
| + | |||
| + | Packages in the " | ||
| + | |||
| + | < | ||
| + | conda list | ||
| + | </ | ||
| + | |||
| + | Disable the " | ||
| + | |||
| + | < | ||
| + | conda deactivate | ||
| + | </ | ||
| + | |||
| + | Script '' | ||
| + | |||
| + | <code bash slurm-mdanalysis-cpu.sh> | ||
| + | #!/bin/bash | ||
| + | #SBATCH --job-name=mdanalysis | ||
| + | #SBATCH --output=%x.o%j | ||
| + | #SBATCH --error=%x.e%j | ||
| + | #SBATCH --nodes=1 | ||
| + | #SBATCH --ntasks-per-node=4 | ||
| + | #SBATCH --mem=20G | ||
| + | #SBATCH --qos=cpu | ||
| + | #SBATCH --partition=cpu | ||
| + | #SBATCH --time=0-01: | ||
| + | ##SBATCH --account=< | ||
| + | |||
| + | module load gnu7/7.3.0 | ||
| + | module load python/ | ||
| + | |||
| + | module load miniconda3 | ||
| + | source " | ||
| + | conda activate mdanalysis-2.3.0 | ||
| + | |||
| + | python --version | ||
| + | python3 Dihedral_analysis-MDA.py | ||
| + | |||
| + | conda deactivate | ||
| + | </ | ||
| + | |||
| + | |||
| + | Script '' | ||
| + | |||
| + | <code pyton Dihedral_analysis-MDA.py> | ||
| + | # | ||
| + | |||
| + | |||
| + | import numpy as np | ||
| + | import MDAnalysis as MDA | ||
| + | from matplotlib import pyplot as plt | ||
| + | #from MDAnalysis import analysis as MDAa | ||
| + | from MDAnalysis.analysis.dihedrals import Dihedral as MDAaD | ||
| + | import MDAnalysis.lib.distances as MDAld | ||
| + | |||
| + | |||
| + | ## EDIT HERE the resname and traj-file-name(no dcd) | ||
| + | resn=' | ||
| + | trajfn=' | ||
| + | # number of frames to skip | ||
| + | nskip=500 | ||
| + | |||
| + | # loading trajectory | ||
| + | u=MDA.Universe(resn+' | ||
| + | # | ||
| + | |||
| + | nmols=512 | ||
| + | nframes=len(u.trajectory) | ||
| + | |||
| + | # | ||
| + | #for i, ttr in enumerate(u.trajectory[:: | ||
| + | # print(i, | ||
| + | |||
| + | if resn==' | ||
| + | dh_atoms=[[" | ||
| + | elif resn==' | ||
| + | dh_atoms=[[" | ||
| + | elif resn==' | ||
| + | dh_atoms=[[" | ||
| + | # add PCZ case here | ||
| + | | ||
| + | ndhs=len(dh_atoms) | ||
| + | print(ndhs) | ||
| + | |||
| + | fig, ax = plt.subplots(ndhs, | ||
| + | |||
| + | print(' | ||
| + | print(len(u.trajectory[:: | ||
| + | |||
| + | dhs=np.zeros( (len(u.trajectory[:: | ||
| + | |||
| + | bindh=np.linspace(-180, | ||
| + | |||
| + | |||
| + | for kkd, a4dh in enumerate(dh_atoms): | ||
| + | |||
| + | dA1=[res.atoms.select_atoms(" | ||
| + | dA2=[res.atoms.select_atoms(" | ||
| + | dA3=[res.atoms.select_atoms(" | ||
| + | dA4=[res.atoms.select_atoms(" | ||
| + | |||
| + | for i1, ts in enumerate(u.trajectory[:: | ||
| + | #for d11 in d1: | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | for jj in range(nmols): | ||
| + | x1=MDAld.calc_dihedrals(dA1[jj], | ||
| + | dhs[i1, | ||
| + | # | ||
| + | |||
| + | # | ||
| + | | ||
| + | ax[kkd].hist(dhs[:,:, | ||
| + | ax[kkd].legend() | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | np.savetxt(' | ||
| + | |||
| + | print(' | ||
| + | print(dhs) | ||
| + | print() | ||
| + | print(' | ||
| + | print(dhs.reshape(-1, | ||
| + | dhsnew = [] | ||
| + | dhsresh = dhs.reshape(-1, | ||
| + | print(len(dhsresh[:, | ||
| + | for i in range(0, | ||
| + | if dhsresh[i, | ||
| + | dhsnew = np.append(dhsnew, | ||
| + | |||
| + | dhsnew = np.reshape(dhsnew, | ||
| + | # | ||
| + | |||
| + | fig.suptitle(resn, | ||
| + | fig.savefig(' | ||
| + | |||
| + | </ | ||
| + | |||
| + | ==== Virtualenv " | ||
| + | |||
| + | Available versions of the " | ||
| + | |||
| + | ^ condaenv | ||
| + | | bioconda-ngs | ||
| + | | bioconda-ngs-py3.11 | ||
| + | |||
| + | Enable the default version of the " | ||
| + | |||
| + | < | ||
| + | module load miniconda3 | ||
| + | source " | ||
| + | conda activate bioconda-ngs | ||
| + | </ | ||
| + | |||
| + | Enable the py3.11 version of the " | ||
| + | |||
| + | < | ||
| + | module load miniconda3 | ||
| + | source " | ||
| + | conda activate bioconda-ngs-py3.11 | ||
| + | </ | ||
| + | |||
| + | Packages in the " | ||
| + | |||
| + | < | ||
| + | conda list | ||
| + | </ | ||
| + | |||
| + | Disable the " | ||
| + | |||
| + | < | ||
| + | conda deactivate | ||
| + | </ | ||
| + | |||
| + | Script '' | ||
| + | |||
| + | <code bash slurm-bioconda-ngs-cpu.sh> | ||
| + | #!/bin/bash | ||
| + | #SBATCH --job-name=mdanalysis | ||
| + | #SBATCH --output=%x.o%j | ||
| + | #SBATCH --error=%x.e%j | ||
| + | #SBATCH --nodes=1 | ||
| + | #SBATCH --ntasks-per-node=4 | ||
| + | #SBATCH --mem=20G | ||
| + | #SBATCH --qos=cpu | ||
| + | #SBATCH --partition=cpu | ||
| + | #SBATCH --time=0-01: | ||
| + | ##SBATCH --account=< | ||
| + | |||
| + | module load miniconda3 | ||
| + | source " | ||
| + | conda activate bioconda-ngs | ||
| + | |||
| + | conda list | ||
| + | |||
| + | conda deactivate | ||
| + | </ | ||
| + | |||
| + | ==== Virtualenv " | ||
| + | |||
| + | Available versions of the " | ||
| + | |||
| + | ^ condaenv | ||
| + | | pennylane | ||
| + | | pennylane-gpu | ||
| + | |||
| + | Enable the default version of the " | ||
| + | |||
| + | < | ||
| + | module load miniconda3 | ||
| + | source " | ||
| + | conda activate pennylane | ||
| + | </ | ||
| + | |||
| + | Enable the gpu version of the " | ||
| + | |||
| + | < | ||
| + | module load miniconda3 | ||
| + | source " | ||
| + | conda activate pennylane-gpu | ||
| + | </ | ||
| + | |||
| + | Packages in the " | ||
| + | |||
| + | < | ||
| + | conda list | ||
| + | </ | ||
| + | |||
| + | Disable the " | ||
| + | |||
| + | < | ||
| + | conda deactivate | ||
| + | </ | ||
| + | |||
| + | Script '' | ||
| + | |||
| + | <code bash slurm-pennylane-gpu.sh> | ||
| + | #!/bin/bash | ||
| + | #SBATCH --job-name=plExample | ||
| + | #SBATCH --output=%x.o%j | ||
| + | #SBATCH --error=%x.e%j | ||
| + | #SBATCH --nodes=1 | ||
| + | #SBATCH --partition=gpu | ||
| + | #SBATCH --qos=gpu | ||
| + | #SBATCH --gres=gpu: | ||
| + | #SBATCH --mem=8G | ||
| + | #SBATCH --time=0-10: | ||
| + | #SBATCH --ntasks-per-node 4 | ||
| + | #SBATCH --account=< | ||
| + | |||
| + | module load miniconda3 | ||
| + | source " | ||
| + | conda activate pennylane-gpu | ||
| + | |||
| + | PYTHON_VERSION=$(python -V | awk '{ print $2 }') | ||
| + | echo $PYTHON_VERSION | ||
| + | |||
| + | python -u ./ | ||
| + | |||
| + | conda deactivate | ||
| + | </ | ||
| + | |||
| + | |||
| + | Script '' | ||
| + | |||
| + | <code pyton plExample.py> | ||
| + | # | ||
| + | |||
| + | # Simple example where we train a parameterized quantum circuit | ||
| + | # to minimize the expectation value of a Pauli-Z operator. | ||
| + | import pennylane as qml | ||
| + | from pennylane import numpy as np | ||
| + | |||
| + | # Define a quantum device with one qubit | ||
| + | dev = qml.device(" | ||
| + | |||
| + | # Define a variational quantum circuit | ||
| + | @qml.qnode(dev) | ||
| + | def circuit(params): | ||
| + | qml.RX(params[0], | ||
| + | qml.RY(params[1], | ||
| + | return qml.expval(qml.PauliZ(0)) | ||
| + | |||
| + | # Define the cost function to minimize | ||
| + | def cost(params): | ||
| + | return circuit(params) | ||
| + | |||
| + | # Initialize parameters | ||
| + | init_params = np.array([0.01, | ||
| + | |||
| + | # Set up the optimizer | ||
| + | opt = qml.GradientDescentOptimizer(stepsize=0.1) | ||
| + | |||
| + | # Number of optimization steps | ||
| + | steps = 100 | ||
| + | |||
| + | # Optimize the circuit parameters | ||
| + | params = init_params | ||
| + | for i in range(steps): | ||
| + | params = opt.step(cost, | ||
| + | if (i + 1) % 10 == 0: | ||
| + | print(f" | ||
| + | |||
| + | print(f" | ||
| + | print(f" | ||
| + | |||
| + | </ | ||
calcoloscientifico/cluster/softwareapplicativo/conda.1635003172.txt.gz · Ultima modifica: da fabio.spataro
