1
$\begingroup$

I had previously been using a cluster with SLURM to run parallel computations with ParallelTable. However, it has randomly stopped working and I now receive the error:

LinkOpen::string: String expected at position 1 in 
LinkOpen[StringRiffle[{/apps/mathematica/13.2.1/Executables/wolfram, -noinit, -subkernel, -wstp}], 
LinkProtocol -> Automatic, LinkHost -> , 
LinkMode -> Launch, LinkOptions -> 256].

Followed by a LinkObject::linkv error, then finally

Timeout for subkernels. Received only 0 of 8 connections.

I am submitting with the following:

#!/bin/bash
#
#SBATCH --job-name=submit
#SBATCH -p Partition   # partition 
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --cpus-per-task 8
#SBATCH -o slurm.%N.%j.out # STDOUT 
#SBATCH -e slurm.%N.%j.err # STDERR 

wolframscript -file code.wl

and code.wl contains:

CloseKernels[];
LaunchKernels[];

result = Table[i^2, {i, 1, 10}];

Print["Results: ", result];

CloseKernels[];
Quit[];

Oddly enough, the system admin has no trouble when running this code so it seems linked with my login.

Any help would be appreciated.

Edit I:

So, if I use math -script code.wl then the problem disappears.

However, I was using wolframscript because this was the only way I could load in command line arguments. In other words if I try

math -script code.wl 4

then Mathematica returns {} if I include $ScriptCommandLine in the code. I am not sure how I reconcile these two issues.

Edit II:

I've discovered that if I use

MYARG=4 math -script code.wl

then I can read in this value using

envVar = Environment["MYARG"];
Print["MYARG = ", envVar]; 

While this gets things functionally working again, it feels more like a work around than a solution.

$\endgroup$
3
  • $\begingroup$ #SBATCH --cpus-per-task 8 shouldn't this be #SBATCH --cpus-per-task= 8 with an equal to sign? $\endgroup$ Commented Aug 2 at 7:52
  • $\begingroup$ The submission seems to work with or without the equal sign, but the error remains. $\endgroup$ Commented Aug 2 at 8:22
  • $\begingroup$ Sometimes when using SLURM I've been having random issues with the cluster blocking the job throwing similar errors due to problems with the licensing server. I'm not sure this is the problem in your case, but it might be worth exploring. $\endgroup$ Commented Aug 2 at 17:54

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.