Compiling issue through slurm - ARCHER2 cluster

Hi,

First: In case others will work with MFIX on the UK cluster ARCHER2, here is how to compile:

module swap PrgEnv-cray PrgEnv-gnu
conda activate mfix-22.1.1
FC=ftn
export FCFLAGS="-w -fallow-argument-mismatch -O2"
export FFLAGS="-w -fallow-argument-mismatch -O2"
build_mfixsolver --batch -j --dmp

Hope that saves you a headache!

Now an issue arises when trying to compile with the same lines but in a bashscript, but slurm does not find anaconda3 that I installed on my home directory in archer2.
“/var/spool/slurmd/job1789875/slurm_script: line 29: conda: command not found”

On our UO cluster working with slurm, placing this line before the conda activate fixed it:
eval “$(command conda ‘shell.bash’ ‘hook’ 2> /dev/null)”

but it does not work on archer2.

I also tried something like (and variants of it):

source ~/.bashrc
source /home/n03/n03/ebreard/anaconda3/bin/activate
eval “$(command conda ‘shell.bash’ ‘hook’ 2> /dev/null)”
module swap PrgEnv-cray PrgEnv-gnu
conda activate mfix-22.1.1
FC=ftn
export FCFLAGS="-w -fallow-argument-mismatch -O2"
export FFLAGS="-w -fallow-argument-mismatch -O2"
build_mfixsolver --batch -j –dmp

No success.

I appreciate the help! @jeff.dietiker @cgw

Not sure, I found Conda activate error - Discovery Cluster - USC Advanced Research Computing which looks similar to what you have already tried.

Maybe you can have your HPC support team install mfix as a module on your cluster.

@jeff.dietiker I had noticed it and tried the line they suggested, no success either.

I can ask and see if cluster folks would be willing to do that.

Here is the solution I found (use the lines below in your .sh script, and modify the source path to your own):

module purge
module load-epcc-module
module load gcc/10.2.0
module load craype-x86-rome
module load craype-network-ofi
module load xpmem/2.2.40-7.0.1.0_2.7__g1d7a24d.shasta
module load cray-libsci/21.04.1.1
module load PrgEnv-gnu/8.0.0
module load craype/2.7.6
module load libfabric/1.11.0.4.71
module load perftools-base/21.02.0
module load cray-mpich/8.1.4

source /work/n03/n03/ebreard/anaconda3/bin/activate
eval “$(command conda ‘shell.bash’ ‘hook’ 2> /dev/null)”

dir=$(pwd)
cd $dir
module swap PrgEnv-cray PrgEnv-gnu
conda activate mfix-22.1.1
FC=ftn
export FCFLAGS="-w -fallow-argument-mismatch -O2"
export FFLAGS="-w -fallow-argument-mismatch -O2"
build_mfixsolver --batch -j --dmp

srun ./mfixsolver -f fluid_bed_dem_2d.mfx

The source line was the key to compiling through slurm :slight_smile: and having anaconda installed in /work rather than /home. Hope this helps potential MFIX users in the UK

1 Like