Hi,
I'm using a trying to run a precompiled Matlab 2014B executable, which simply calls parallel cluster information and test the multithreading, in centos6. The code is very simple but it failed unexpectedly on the training express lane. I wonder if multithreading in matlab is supported on the remote computer.
```
function dream_pipeline()
parcluster()
par_start=tic;
parpool();
par_time=toc(par_start);
poolobj=gcp('nocreate');
fprintf('%d worker threads established in %.3f seconds!\n', poolobj.NumWorkers, par_time);
```
And the code was compiled with command:
```
mcc -m -R -nosplash -R -nodisplay
```
Expected result is:
```
ans =
Local Cluster
Properties:
Profile: local
Modified: false
Host: mycomputer
NumWorkers: 3
JobStorageLocation: /scratch/dreamdm/mcrCache-065406c84731e2530999e1bc10030690/.mcrCache8.4/dream_0/local_cluster_jobs/R2014b
RequiresMathWorksHostedLicensing: false
Associated Jobs:
Number Pending: 0
Number Queued: 0
Number Running: 0
Number Finished: 0
Starting parallel pool (parpool) using the 'local' profile ... connected to 3 workers.
3 worker threads established in 22.157 seconds!
```
But what I got from the training express lane is
```
STDERR: 2017-03-02T22:51:33.250020044Z Error using parcluster (line 53)
STDERR: 2017-03-02T22:51:33.250046158Z Java exception occurred:
STDERR: 2017-03-02T22:51:33.250050347Z java.net.UnknownHostException: dd4bd7793689: dd4bd7793689: Temporary failure in name resolution
STDERR: 2017-03-02T22:51:33.250053795Z at java.net.InetAddress.getLocalHost(Unknown Source)
STDERR: 2017-03-02T22:51:33.250057622Z Caused by: java.net.UnknownHostException: dd4bd7793689: Temporary failure in name resolution
STDERR: 2017-03-02T22:51:33.250060944Z at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
STDERR: 2017-03-02T22:51:33.250064116Z at java.net.InetAddress$1.lookupAllHostAddr(Unknown Source)
STDERR: 2017-03-02T22:51:33.250067208Z at java.net.InetAddress.getAddressesFromNameService(Unknown Source)
STDERR: 2017-03-02T22:51:33.250070503Z ... 1 more
STDERR: 2017-03-02T22:51:33.250073401Z
STDERR: 2017-03-02T22:51:33.250076188Z Error in dream_pipeline (line 4)
STDERR: 2017-03-02T22:51:33.250079325Z
STDERR: 2017-03-02T22:51:33.250081954Z
STDERR: 2017-03-02T22:51:33.250084657Z
STDERR: 2017-03-02T22:51:33.250543746Z MATLAB:Java:GenericException
```
Any help is appreciated.
Thanks,
Michael
Created by Michael Hsieh michaelhsieh Now we know how Matlab manages internally the threads, and distributes jobs across nodes and processors...
Good luck.
:-D The following is what I got from docker execution with your suggestion.
```
ifconfig
STDOUT: 2017-03-03T15:48:04.899466001Z lo Link encap:Local Loopback
STDOUT: 2017-03-03T15:48:04.899474083Z inet addr:127.0.0.1 Mask:255.0.0.0
STDOUT: 2017-03-03T15:48:04.899477678Z inet6 addr: ::1/128 Scope:Host
STDOUT: 2017-03-03T15:48:04.899480590Z UP LOOPBACK RUNNING MTU:65536 Metric:1
STDOUT: 2017-03-03T15:48:04.899483576Z RX packets:0 errors:0 dropped:0 overruns:0 frame:0
STDOUT: 2017-03-03T15:48:04.899486568Z TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
STDOUT: 2017-03-03T15:48:04.899489493Z collisions:0 txqueuelen:1
STDOUT: 2017-03-03T15:48:04.899492511Z RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
```
```
cat /etc/hosts
```
Adding the following to the file does resolve the issue.
```
echo -e "127.0.0.1\tlocalhost" >> /etc/hosts
echo -e "::1\tlocalhost" >> /etc/hosts
echo -e "127.0.0.1\t`hostname`" >> /etc/hosts
```
Now the code runs. Thanks a lot!
```
STDOUT: 2017-03-03T17:51:53.387091253Z Original hosts are:
STDOUT: 2017-03-03T17:51:53.389365029Z New hosts are:
STDOUT: 2017-03-03T17:51:53.389973241Z 127.0.0.1 localhost
STDOUT: 2017-03-03T17:51:53.389990174Z ::1 localhost
STDOUT: 2017-03-03T17:51:53.389994379Z 127.0.0.1 4075c00c44ca
STDOUT: 2017-03-03T17:51:53.389998059Z Running dream_pipeline with 15 CPU Cores
STDOUT: 2017-03-03T17:52:00.623079286Z
STDOUT: 2017-03-03T17:52:00.623102197Z ans =
STDOUT: 2017-03-03T17:52:00.623105834Z
STDOUT: 2017-03-03T17:52:00.623109240Z local
STDOUT: 2017-03-03T17:52:00.623112368Z
STDOUT: 2017-03-03T17:52:01.317098312Z
STDOUT: 2017-03-03T17:52:01.317120757Z ans =
STDOUT: 2017-03-03T17:52:01.317124185Z
STDOUT: 2017-03-03T17:52:01.322299669Z Local Cluster
STDOUT: 2017-03-03T17:52:01.323059088Z
STDOUT: 2017-03-03T17:52:01.323067554Z Properties:
STDOUT: 2017-03-03T17:52:01.323071083Z
STDOUT: 2017-03-03T17:52:01.386708390Z Profile: local
STDOUT: 2017-03-03T17:52:01.390647801Z Modified: false
STDOUT: 2017-03-03T17:52:01.391386705Z Host: 4075c00c44ca
STDOUT: 2017-03-03T17:52:01.411581121Z NumWorkers: 15
STDOUT: 2017-03-03T17:52:01.412223849Z
STDOUT: 2017-03-03T17:52:01.414357208Z JobStorageLocation: /root/.mcrCache8.4/dream_0/local_cluster_jobs/R2014b
STDOUT: 2017-03-03T17:52:01.415086652Z RequiresMathWorksHostedLicensing: false
STDOUT: 2017-03-03T17:52:01.419997156Z
STDOUT: 2017-03-03T17:52:01.420006575Z Associated Jobs:
STDOUT: 2017-03-03T17:52:01.420010405Z
STDOUT: 2017-03-03T17:52:01.608219207Z Number Pending: 0
STDOUT: 2017-03-03T17:52:01.609690886Z Number Queued: 0
STDOUT: 2017-03-03T17:52:01.610867744Z Number Running: 0
STDOUT: 2017-03-03T17:52:01.611922365Z Number Finished: 0
STDOUT: 2017-03-03T17:52:01.612336902Z
STDOUT: 2017-03-03T17:52:11.997030359Z Starting parallel pool (parpool) using the 'local' profile ... connected to 12 workers.
STDOUT: 2017-03-03T17:52:12.102824140Z 12 worker threads established in 10.479 seconds!
```
The only thing I can tell you from the output es that the program is using Java to try to connect somewhere. So all my comments must be treated fast 'reverse' engineering of the problem with no so many more clues.
May be even localhost is disabled, but:
```
STDERR: 2017-03-02T22:51:33.250053795Z at java.net.InetAddress.getLocalHost(**Unknown Source**)
```
does not help. Seems also that is something you are not producing intencionality.
As you are playing in dockers the behavior and configurations of the network may vary depending on the situation.
In ideal conditions should be an interesting security issue, if the container could connect outside. I think this is one of the situations when somebody should notify about a security breach, so I guess that system managers are quite smart and they should block this, and this is one of the roots of your problem.
I must assume the program is not tyng to connect to outside (ie Matlab, or Oracle)
At this point may be the thread system used by your program is trying to open some kind of thread dispatcher (is only my guess, because i don't find any other explanation to a IP connection), and is tryng to conenct simply to '**localhost**'.
Add in /etc/hosts
```
127.0.0.1 localhost
::1 localhost
```
and:
```
echo 127.0.0.1 `hostname` >> /etc/hosts
```
Just to be sure the local loopback interface is pointing to your machine
And pray to get from the good of the system-manager-administrator about the ability of using the address 127.0.0.1 inside this docker machine.
(command /sbin/ifconfig should give you clues about the availiabes interfaces in this mode)
Thanks for your reply.
However, it's pre-compiled and run with MCR. I've got all the required licenses to run and compile my code. There should be no license issue. Or maybe I'm missing something? Seems your code is internally trying to connect oustide.
Looks like issues of proprietary software, an licenses.
Drop files to upload
Error in multithreading using matlab 2014B page is loading…