Message Boards Message Boards

0
|
5319 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

Execute a wls file in a terminal window started by Wolfram Engine?

Posted 3 years ago

HI,

I downloaded and installed the Wolfram Engine for Developers. Practically it is the unrestricted backend and the developer is passing instructions to it from a terminal window. I also have a Mathematica 12.1.1 installed in the same director where I installed the Wolfram Engine but this Mathematica is NOT running. When I start the Wolfram Engine it puts two processes into the Activity Monitor on my MacPro: one "wolframscript" and one "wolframKernel". It also opens a terminal window with the title "WolframKernel * wolframscript" with the content: Wolfram Language 12.1.1 Engine for Mac OS X x86 (64-bit) Copyright 1988-2020 Wolfram Research, Inc.

In[1]:=

So far so good. The question is now, how do I execute a .wls file at this prompt?
The difficulty is, that if I ignore this window and open a normal Terminal window and execute the wolframscript -file sp500.wls there, then it uses NOT the just started Wolfram engine licence, but rather the installed and NOT running Mathematica 12.1.1 backend licence to execute the command. To prove it, I execute the LaunchKernels[12] command in the WE /Wolfram Engine/ induced Terminal window and voila I get 12 kernels running in the Activity Monitor:

In[1]:= LaunchKernels[12]                                                       

Out[1]= {KernelObject[1, local], KernelObject[2, local], 
 >    KernelObject[3, local], KernelObject[4, local], KernelObject[5, local], 
 >    KernelObject[6, local], KernelObject[7, local], KernelObject[8, local], 
 >    KernelObject[9, local], KernelObject[10, local], KernelObject[11, local], 
 >    KernelObject[12, local]}

Going back to the normal terminal window and execute the .wls file there with wolframscript -file sp500.wls, where the file contain a Kernels[] check gives me this output:

janos@MacPro Stocks % wolframscript -file sp500.wls

/Volumes/Home/janos/Library/Mathematica/Licensing/mathpass:3: Mathematica 12.1.1 Kernel license you are using has expired. Please contact Wolfram Research or an authorized Wolfram product distributor to extend your license and obtain a new password.

/Volumes/Home/janos/Library/Mathematica/Licensing/mathpass:3: Mathematica 12.1.1 Kernel license you are using has expired. Please contact Wolfram Research or an authorized Wolfram product distributor to extend your license and obtain a new password.

/Volumes/Home/janos/Library/Mathematica/Licensing/mathpass:3: Mathematica 12.1.1 Kernel license you are using has expired. Please contact Wolfram Research or an authorized Wolfram product distributor to extend your license and obtain a new password.

/Volumes/Home/janos/Library/Mathematica/Licensing/mathpass:3: Mathematica 12.1.1 Kernel license you are using has expired. Please contact Wolfram Research or an authorized Wolfram product distributor to extend your license and obtain a new password.

/Volumes/Home/janos/Library/Mathematica/Licensing/mathpass:3: Mathematica 12.1.1 Kernel license you are using has expired. Please contact Wolfram Research or an authorized Wolfram product distributor to extend your license and obtain a new password.

/Volumes/Home/janos/Library/Mathematica/Licensing/mathpass:3: Mathematica 12.1.1 Kernel license you are using has expired. Please contact Wolfram Research or an authorized Wolfram product distributor to extend your license and obtain a new password.

/Volumes/Home/janos/Library/Mathematica/Licensing/mathpass:3: Mathematica 12.1.1 Kernel license you are using has expired. Please contact Wolfram Research or an authorized Wolfram product distributor to extend your license and obtain a new password.

LinkObject::linkw: Unable to write data to closed link LinkObject['/Volumes/Apps/Mathematica12.1.1.6958981.app/Contents/MacOS/WolframKernel' -subkernel -noinit -nopaclet -wstp, 117, 6].

LinkObject::linkw: Unable to write data to closed link LinkObject['/Volumes/Apps/Mathematica12.1.1.6958981.app/Contents/MacOS/WolframKernel' -subkernel -noinit -nopaclet -wstp, 118, 7].

LinkObject::linkw: Unable to write data to closed link LinkObject['/Volumes/Apps/Mathematica12.1.1.6958981.app/Contents/MacOS/WolframKernel' -subkernel -noinit -nopaclet -wstp, 119, 8].

General::stop: Further output of LinkObject::linkw will be suppressed during this calculation.

/Volumes/Home/janos/Library/Mathematica/Licensing/mathpass:3: Mathematica 12.1.1 Kernel license you are using has expired. Please contact Wolfram Research or an authorized Wolfram product distributor to extend your license and obtain a new password.

LinkObject::linkd: Unable to communicate with closed link LinkObject['/Volumes/Apps/Mathematica12.1.1.6958981.app/Contents/MacOS/WolframKernel' -subkernel -noinit -nopaclet -wstp, 117, 6].

LinkObject::linkd: Unable to communicate with closed link LinkObject['/Volumes/Apps/Mathematica12.1.1.6958981.app/Contents/MacOS/WolframKernel' -subkernel -noinit -nopaclet -wstp, 118, 7].

LinkObject::linkd: Unable to communicate with closed link LinkObject['/Volumes/Apps/Mathematica12.1.1.6958981.app/Contents/MacOS/WolframKernel' -subkernel -noinit -nopaclet -wstp, 119, 8].

General::stop: Further output of LinkObject::linkd will be suppressed during this calculation.

ParallelDeveloperConnectKernel::failinit: 8 of 12 kernels failed to initialize. {KernelObject[ParallelKernelsPrivatebk[SubKernelsLocalKernelslocalKernel[SubKernelsLocalKernelsPrivatelk[LinkObject['/Volumes/Apps/Mathematica12.1.1.6958981.app/Contents/MacOS/WolframKernel' -subkernel -noinit -nopaclet -wstp, 113, 2], {'/Volumes/Apps/Mathematica12.1.1.6958981.app/Contents/MacOS/WolframKernel' -subkernel -noinit -nopaclet -wstp, SubKernelsLocalKernelsLowerPriority -> True}, SubKernelsLocalKernelsPrivatespeed$1184, SubKernelsLocalKernelsPrivatepreemptive$1184]], ParallelKernelsPrivateid$1199, ParallelKernelsPrivatename$1199, ParallelKernelsPrivatesubProps$1199], ParallelKernelsPrivateek[ParallelKernelsPrivatenev$1200, ParallelKernelsPrivatepb$1200, ParallelKernelsPrivaterd$1200], ParallelKernelsPrivatesk[ParallelKernelsPrivateq$1201, ParallelKernelsPrivaten0$1201, ParallelKernelsPrivaten1$1201]], KernelObject[ParallelKernelsPrivatebk[SubKernelsLocalKernelslocalKernel[SubKernelsLocalKernelsPrivatelk[LinkObject['/Volumes/Apps/Mathematica12.1.1.6958981.app/Contents/MacOS/WolframKernel' -subkernel -noinit -nopaclet -wstp, 114, 3], {'/Volumes/Apps/Mathematica12.1.1.6958981.app/Contents/MacOS/WolframKernel' -subkernel -noinit -nopaclet -wstp, SubKernelsLocalKernelsLowerPriority -> True}, SubKernelsLocalKernelsPrivatespeed$1185, SubKernelsLocalKernelsPrivatepreemptive$1185]], ParallelKernelsPrivateid$1203, ParallelKernelsPrivatename$1203, ParallelKernelsPrivatesubProps$1203], ParallelKernelsPrivateek[ParallelKernelsPrivatenev$1204, ParallelKernelsPrivatepb$1204, ParallelKernelsPrivaterd$1204], ParallelKernelsPrivatesk[ParallelKernelsPrivateq$1205, ParallelKernelsPrivaten0$1205, ParallelKernelsPrivaten1$1205]], KernelObject[ParallelKernelsPrivatebk[SubKernelsLocalKernelslocalKernel[SubKernelsLocalKernelsPrivatelk[LinkObject['/Volumes/Apps/Mathematica12.1.1.6958981.app/Contents/MacOS/WolframKernel' -subkernel -noinit -nopaclet -wstp, 115, 4], {'/Volumes/Apps/Mathematica12.1.1.6958981.app/Contents/MacOS/WolframKernel' -subkernel -noinit -nopaclet -wstp, SubKernelsLocalKernelsLowerPriority -> True}, SubKernelsLocalKernelsPrivatespeed$1186, SubKernelsLocalKernelsPrivatepreemptive$1186]], ParallelKernelsPrivateid$1207, ParallelKernelsPrivatename$1207, ParallelKernelsPrivatesubProps$1207], ParallelKernelsPrivateek[ParallelKernelsPrivatenev$1208, ParallelKernelsPrivatepb$1208, ParallelKernelsPrivaterd$1208], ParallelKernelsPrivatesk[ParallelKernelsPrivateq$1209, ParallelKernelsPrivaten0$1209, ParallelKernelsPrivaten1$1209]], KernelObject[ParallelKernelsPrivatebk[SubKernelsLocalKernelslocalKernel[SubKernelsLocalKernelsPrivatelk[LinkObject['/Volumes/Apps/Mathematica12.1.1.6958981.app/Contents/MacOS/WolframKernel' -subkernel -noinit -nopaclet -wstp, 116, 5], {'/Volumes/Apps/Mathematica12.1.1.6958981.app/Contents/MacOS/WolframKernel' -subkernel -noinit -nopaclet -wstp, SubKernelsLocalKernelsLowerPriority -> True}, SubKernelsLocalKernelsPrivatespeed$1187, SubKernelsLocalKernelsPrivatepreemptive$1187]], ParallelKernelsPrivateid$1211, ParallelKernelsPrivatename$1211, ParallelKernelsPrivatesubProps$1211], ParallelKernelsPrivateek[ParallelKernelsPrivatenev$1212, ParallelKernelsPrivatepb$1212, ParallelKernelsPrivaterd$1212], ParallelKernelsPrivatesk[ParallelKernelsPrivateq$1213, ParallelKernelsPrivaten0$1213, ParallelKernelsPrivaten1$1213]]}

By watching the Activity Monitor only ONE wolframKernel is doing all the work although the script has a few ParallelTables. Any good hint is appreciated. János

POSTED BY: Janos Lobb
Posted 3 years ago
Attachments:
POSTED BY: Janos Lobb
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract