1

I am trying to run a simple script on a Linux HPC, where I am looping over a number of RNA-seq files and want to call fastQC, a Java based program, on each of the files. In the script I'm calling a wrapper script that runs the Java fastQC-program.

The script I wrote is as follows:

#!/bin/bash

#SBATCH -t 00:30:00
#SBATCH -n 1
#SBATCH --mail-type=end
#SBATCH --clusters=serial
#SBATCH --partition=serial_std
#SBATCH --mem=6gb

echo "Starting to run fastQC..."

FILENAMES_TXT=*filenames_path*/small_test_sample_filenames.txt
DIR_DATA=*data_directory*
IPPG=*roote_directory on the cluster dss*

FILENAMES_PATH=$IPPG/$FILENAMES_TXT
DATA_PATH=$IPPG/$DIR_DATA

LINES=$(cat $FILENAMES_PATH)

for LINE in $LINES
do
        FILE=$DATA_PATH/$LINE
        echo $FILE

        *home_directory_path*/FastQC/fastqc $FILE
done

echo "fastQC is done!"

When I submit this job using sbatch, the SLURM error message is: Can't exec "java": No such file or directory

Running the script on a single sample on the HPC-Login-Node worked fine, so I think the script published by fastQC is fine, and the problem only arises, when the script is submitted to the SLURM system with sbatch.

Apparently, the fastQC-script cannot find JAVA in the SLURM system, after it was called in my Bash-script. Can anybody with HPC / SLURM experience tell me, how to import Java into the environment when submitting a job (I am not sure if that question is phrased correctly, but I hope somebody can understand)?

Ben Wendel
  • 11
  • 1
  • This is the error that `sbatch` returns??? – Poshi Mar 08 '22 at 12:04
  • It's the error message that's printed into the slurm-xxx.out file, that's produced by every slurm job. – Ben Wendel Mar 08 '22 at 12:47
  • Then you just need to make sure that `java` is available on `$PATH`. And any other enviroment variable needed. How do you "load" java in your interactive environment? – Poshi Mar 08 '22 at 12:56
  • Put this at the beginning of your script `java -version` and share us the result – JRichardsz Mar 08 '22 at 14:16
  • Adding 'java -version' to the script produced this error message: */var/slurmd-serial/job2522565/slurm_script: line 11: java: command not found* @Poshi: I tried using 'module load java' before, but also only yielded an error. – Ben Wendel Mar 08 '22 at 16:38
  • @Poshi: On my login node, 'java' is in '$PATH' under '/usr/bin'. I think that's why it worked on the login node, but the path environment seems to be different on the compute nodes of the SLURM system. – Ben Wendel Mar 08 '22 at 16:44
  • 1
    Then, you have to configure your environment in the jobs for any of your installed java versions. How to do it? Ask your administrator. – Poshi Mar 08 '22 at 19:30
  • Will do and post the result once I have an answer, thank you for your help! :) – Ben Wendel Mar 10 '22 at 12:37

1 Answers1

0

Solution was found through the system administrator:

module load openjdk

Ben Wendel
  • 11
  • 1