MATLAB Answers

Mark
3

Error opening matlabpool

Asked by Mark
on 7 Nov 2011
Latest activity Answered by Gerald
on 26 Nov 2014
I'm receiving the following error when attempting to issue a matlabpool open command:
Error using matlabpool (line 126) Java exception occurred: java.net.UnknownHostException: bob: bob at java.net.InetAddress.getLocalHost(Unknown Source)
Let's assume for the moment that the name of the Linux box running Matlab is bob. It's running Fedora with a current Java install (1.6.0_22) and the most recent version of the Parallel Computing Toolbox.
I get a similar error when attempting to query the current computer name using java.net.InetAddress.getLocalHost.getHostName. Fiddling with the hostname in dctconfig or pctconfig does not produce any useful results.
I'm sure this is just a newb java-matlab communication problem. Any tips out there?

  2 Comments

Thomas
on 25 Nov 2011
Are you running matlabpool on a local configuration (local machine) or do you have a parallel configuration for a cluster?
Mark
on 29 Nov 2011
Local.

Sign in to comment.

6 Answers

Answer by Titus Edelhofer on 29 Nov 2011
 Accepted Answer

Could you try to add localhost with 127.0.0.1 to your /etc/hosts file?
Titus

  7 Comments

Mark
on 29 Nov 2011
But, the etc/hosts file does seem to be the key. I duplicated the 127.0.0.1 line but changed the host information, so the first two lines now read:
127.0.0.1 localhost.localdomain localhost
127.0.0.1 bob.localdomain bob
and matlabpool open works just fine. Thanks to everyone for the tips for getting me headed in the right direction.
Titus Edelhofer on 29 Nov 2011
Hi Mark,
I'm glad to hear it's running!
Titus
Clayton
on 6 Aug 2014
I also had this problem (running linux RHEL 6 and Matlab R2014a).
>> parpool('local')
Error using parpool (line 99)
Java exception occurred:
java.net.UnknownHostException: EMS-GJDZW12: EMS-GJDZW12: Name or service not
known
at java.net.InetAddress.getLocalHost(Unknown Source)
Caused by: java.net.UnknownHostException: EMS-GJDZW12: Name or service not known
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$1.lookupAllHostAddr(Unknown Source)
at java.net.InetAddress.getAddressesFromNameService(Unknown Source)
... 1 more
I tested by pinging my hostname and localhost. Only the latter worked.
[clayton@myMachine ~]$ ping myMachine
ping: unknown host myMachine
[clayton@myMachine ~]$ ping localhost
PING localhost (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.048 ms
64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.029 ms
Then added third line to my /etc/hosts file so it looks like:
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
127.0.0.1 myMachine.localdomain myMachine
And then I could ping my hostname and start parpool with no problems.
[clayton@myMachine ~]$ ping myMachine
PING myMachine.localdomain (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.035 ms
64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.037 ms
64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.036 ms

Sign in to comment.


Answer by Michal Kvasnicka on 24 Nov 2011

Same error on openSUSE 12.1 with Matlab R2011b.
Any hints???

  0 Comments

Sign in to comment.


Daniel Shub
Answer by Daniel Shub
on 29 Nov 2011

Works fine for me on r2011a and Arch:
>> matlabpool open
Starting matlabpool using the 'local' configuration ... connected to 8 labs.
MATLAB Version 7.12.0.635 (R2011a) Operating System: Linux 3.1.0-4-ARCH #1 SMP PREEMPT Mon Nov 7 22:47:18 CET 2011 x86_64 Java VM Version: Java 1.6.0_17-b04 with Sun Microsystems Inc. Java HotSpot™ 64-Bit Server VM mixed mode
I also get a meaningful result with:
java.net.InetAddress.getLocalHost.getHostName
I do have 127.0.0.1 in my /etc/hosts file.

  0 Comments

Sign in to comment.


Thomas
Answer by Thomas
on 29 Nov 2011

Can you try validating your local parallel configuration.
Parallel > Manage Configuration> select 'local'> Start Validation.
What results do you get?
Your output should be;
Validation Details
Configuration: "local"
Type: local
--------------------------------------
Stage: Find Resource
Status: Passed
Description: Validation passed
Command Line Output: (none)
--------------------------------------
--------------------------------------
Stage: Distributed Job
Status: Passed
Description: Validation passed
Command Line Output: (none)
--------------------------------------
--------------------------------------
Stage: Parallel Job
Status: Passed
Description: Validation passed
Command Line Output: (none)
--------------------------------------
--------------------------------------
Stage: Matlabpool
Status: Passed
Description: Validation passed
Command Line Output:
Starting matlabpool using the 'local' configuration ... Checking parallel job status.
Checking parallel job status.
Checking parallel job status.
Received a socket connection.
Received a socket connection.
Received a socket connection.
Received a socket connection.
Received a socket connection.
Received a socket connection.
Received a socket connection.
Received a socket connection.
connected to 8 labs.Sending a stop signal to all the labs ... stopped.
Did not find any pre-existing parallel jobs created by matlabpool.

  4 Comments

Show 1 older comment
Thomas
on 29 Nov 2011
This error means that it cannot find the ip address or hostname of the machine:
what output does the following command provide?
system('hostname')
Titus Edelhofer on 29 Nov 2011
Hi Thomas,
seems either not on the path or not installed, see Marks comment to my answer above ...
Mark
on 29 Nov 2011
Actually hostname by itself was working fine, but without the additional line in /etc/hosts hostname -a was failing. In any case adding the line in etc/hosts has solved this problem for me -- hopefully it will do the same for others. Thanks to both of you for the help.

Sign in to comment.


Josh
Answer by Josh
on 23 Apr 2013

For me, running openSUSE, I fixed the issue in Yast->Network Settings->Hostname/DNS. Make sure the "Assign Hostname to Loopback IP" is checked. That did it for me.

  0 Comments

Sign in to comment.


Gerald
Answer by Gerald
on 26 Nov 2014

I'm receiving the following error when attempting to issue a parpool open command in Matlab 2014b based on Debian system
Error using parpool (line 99) Java exception occurred: java.net.UnknownHostException: (none): (none): Name or service not known at java.net.InetAddress.getLocalHost(Unknown Source) at com.mathworks.jmi.NativeMatlab.SendMatlabMessage(Native Method) at com.mathworks.jmi.NativeMatlab.sendMatlabMessage(NativeMatlab.java:266) at com.mathworks.jmi.MatlabLooper.sendMatlabMessage(MatlabLooper.java:120) at com.mathworks.jmi.Matlab.mtFevalConsoleOutput(Matlab.java:1690) at com.mathworks.jmi.MatlabWorker.feval(MatlabWorker.java:195) at com.mathworks.toolbox.distcomp.ui.desk.ParallelStatusIndicator$ParallelStatusIndicatorUI$9$1.runOnMatlabThread(ParallelStatusIndicator.java:772) at com.mathworks.jmi.MatlabWorker$2.run(MatlabWorker.java:79) at com.mathworks.jmi.NativeMatlab.dispatchMTRequests(NativeMatlab.java:475) Caused by: java.net.UnknownHostException: (none): Name or service not known at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) at java.net.InetAddress$1.lookupAllHostAddr(Unknown Source) at java.net.InetAddress.getAddressesFromNameService(Unknown Source) ... 9 more
Error in parallel.internal.ui.PoolHelper.startPool (line 11) parpool();
I already changed the hosts files as described above and can ping localhost and myMachine. However, parpool still does not work.
Any tips out there?

  0 Comments

Sign in to comment.