Hello everyone! I am trying to run slurm using python in the environment, but the base is overwriting it and due to which the tool is not running.
#!/bin/bash#SBATCH --ntasks-per-node=1#SBATCH --mem-per-cpu=100G#SBATCH --time=100:00:00#SBATCH --job-name=celloracle#SBATCH --output=celloracle-%J.log# Load the same python as used for installation#module load python3
module load R/4.1.2
source /home/user/env/lib/python3.7
#source activate evn_for_Rpython celloracle_issue.py
however, it is still not working. Has anyone ever encountered same situation? Any help is highly appreciated.
I encourage to use everything via sconda or a container rather than modules. Modules can change over time, making them (strictly speaking) not reproducible.
While not addressing your problem directly, I highly recommend wrapping your conda environment in a Singularity container. This has many advantages, mainly:
speed (Python envs are comprised of many small module files and simply loading those can introduce an IO bottleneck)
ease of management (you just use a single container file which you run with a single command, as opposed to tens or hundreds of thousand of files for a single conda env, which can quickly take a large chunk of your file quota)
and the fact that the environment is now "frozen" (you can't modify it by mistake and it's more reproducible).
If you haven't used Singularity before, the basic idea is rather simple: All your software dependencies (not limited to Python packages) are stored inside a single file, which you can think of as a "virtual machine" (well, a lightweight one, but just for the intuition).
Using it is very simple, just: singularity exec my_container.sif python my_script.py