3
$\begingroup$

Context

I am interested in doing parallel computation on a linux machine.

Odd behaviour

When I chose explicitly the number of kernels

(~)> math
Mathematica 12.0.0 Kernel for Linux x86 (64-bit)
Copyright 1988-2019 Wolfram Research, Inc.

In[1]:= LaunchKernels[8]

(* {KernelObject[1, local], KernelObject[2, local], …. , KernelObject[8, local]} *)

Whereas if I don't specify the number of Kernels

In[1]:= LaunchKernels[]

I get

wolfram: Command not found.

wolfram: Command not found.

...

wolfram: Command not found.

Question

Could anyone please reproduce what seems to be a (admittedly minor) Bug?

This seems to hold true for Mathematica 10.3 and 12.


Note that If one does not bother explicitly launching the kernels it does not work either

(~)> math
Mathematica 12.0.0 Kernel for Linux x86 (64-bit)
Copyright 1988-2019 Wolfram Research, Inc.

In[1]:= ParallelTable[Pause[1],{4}]//AbsoluteTiming
Launching kernels...

I get again

wolfram: Command not found.

wolfram: Command not found.


Finally note that on a mac it works as it should

In[1]:= ParallelTable[Pause[1], {4}] // AbsoluteTiming

Out[1]= {2.78291,{Null,Null,Null,Null}}

$\endgroup$
1
  • $\begingroup$ Did you ever configure any kernels manually? Check $ConfiguredKernels (or $ConfiguredKernels // InputForm if needed). Kernel configuration can be done through the preferences dialog, so you may have set it even if you never used $ConfiguredKernel. $\endgroup$
    – Szabolcs
    Jan 12, 2020 at 9:46

2 Answers 2

2
$\begingroup$

One difference between LaunchKernel[n] and LaunchKernels[] is that LaunchKernels[n] will launch n kernels on the local machine while LaunchKernels[] will launch whatever is in $ConfiguredKernels.

Most likely, you have configured subkernels manually through the graphical interface (Preferences dialog), and that configuration is no longer valid.

You can check/set the kernel configuration programmatically though $ConfiguredKernels or graphically in the preferences.

$\endgroup$
7
  • $\begingroup$ Thanks for your reply. I don't use the frontend for this test. If I type In[1]:= $ConfiguredKernels Out[1]= {16 local kernels, 32 kernels on b6}. So this is not inconsistent with LaunchKernel[32] in principle, but in practice it seems to be. $\endgroup$
    – chris
    Jan 12, 2020 at 11:51
  • $\begingroup$ I should also say that this is not consistent with the number of cores available which is 40. In[9]:= RunProcess["lscpu", "StandardOutput"] Out[9]= Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 40 $\endgroup$
    – chris
    Jan 12, 2020 at 12:04
  • 1
    $\begingroup$ This confirms that you (or someone else) created a subkernel configuration manually. Notice the presence of non-local kernels. Revert this configuration to the default. reference.wolfram.com/language/ParallelTools/tutorial/… I am not sure how to permanently change the configuration without the front end, but assuming that it was changed manually, the same steps could be used to revert it ... $\endgroup$
    – Szabolcs
    Jan 12, 2020 at 15:25
  • 1
    $\begingroup$ One thought: Are you using the Lightweight Grid or some similar technology which automatically discovers available kernels on the network? I have never used it and have no experience with it. If you really did not ever change the subkernel configuration, maybe such a system did. Also: does the computer named b6 have the same version of Mathematica that you are using here, or a much older one that uses math instead of wolfram? $\endgroup$
    – Szabolcs
    Jan 12, 2020 at 16:04
  • 1
    $\begingroup$ @chris, rather than deleting, I would encourage you to self-answer with the likely problem, for future reference. $\endgroup$
    – MarcoB
    Jan 13, 2020 at 5:00
0
$\begingroup$

As pointed by the accepted answer the problem arose because of artefacts from a (forgotten) past lightweight grid setting hidden within the .Mathematica directory .

The solution is to displace this directory and after a restart copy the mathpass back to License .

Incidentally it explains recurent misuses of the cluster which did not impress our system manager!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.