Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

coarray giving mpd error

roddur
Beginner
2,046 Views

Hello,

I am just trying to learn coarray. The code, from Steve Blair-Chappell's is:

$ cat hello.f90 

!This is file : hello

Program  hello

Implicit None

write(*,*)"Hello", this_image()

End Program  hello

and compiled it using

 ifort -coarray hello.f90

But I am getting error:

$ ./a.out 
mpdallexit: cannot connect to local mpd (/tmp/mpd2.console_rudra_ICAF_2735); possible causes:
1. no mpd is running on this host
2. an mpd is running but was started without a "console" (-n option)

The error is correct, as there is no mpd running.
But do I really need mpi to run coarray?
my fortran is :

$ ifort -vifort version 13.1.3

 

0 Kudos
27 Replies
Lorri_M_Intel
Employee
490 Views

roddur - That is excellent news!  And no, never a waste of time.  Happy CAF'ing :-)

Casey, thank you for your help.

                  --Lorri

0 Kudos
roddur
Beginner
490 Views

Hi Lorri and others,

I have found the (apperant) reason of the problem I have stated.

if I change my machine-name (using hostnamectl) to something other then localhost.localdomain, then the caf programs failed:

$ sudo hostnamectl set-hostname roddur
[rudra@roddur ~]$ ./a.out 
mpdallexit: cannot connect to local mpd (/tmp/mpd2.console_rudra_ICAF_19938); possible causes:
  1. no mpd is running on this host
  2. an mpd is running but was started without a "console" (-n option)
$ sudo hostnamectl set-hostname localhost.localdomain
[rudra@roddur ~]$ ./a.out 
Enter your name: Ru
Hello Ru from image 1Hello Ru from image 3Hello Ru from image 7Hello Ru from image 5Hello Ru from image 2Hello Ru from image 6Hello Ru from image 4Hello Ru from image 8

0 Kudos
Casey
Beginner
490 Views

Roddur,

   This suggests that your networking is not setup correctly.  I dont use a distro that uses hostnamectl but reading its man page it appears all it does is set your machine name but is unrelated to name resolution.  When you set your hostname to roddur, what does the command "ping roddur" do?  If it does not work, then that is your issue.  A quick fix is to open your /etc/hosts file and add "roddur" to the line that starts with "127.0.0.1", which will cause roddur  to be mapped to localhost.  If you have another ip you want that name to resolve to, you can just add a new line for it.  When you get "ping roddur" to work, then your coarray code should also work.

0 Kudos
FlyingHermes
New Contributor I
490 Views

Hi, I'm having the same error with the following cod:

[fortran]Program hello
  implicit none
  write(*,*) "Hello from image ", this_image()
End Program[/fortran]

which leads to

[bash]$  ifort -coarray hello.f90; ./a.out
mpdallexit: cannot connect to local mpd (/tmp/mpd2.console_Lopez_ICAF_2879); possible causes:
  1. no mpd is running on this host
  2. an mpd is running but was started without a "console" (-n option)[/bash]

Here is some information:

[bash]$  uname -a
Linux dell17 3.8.8-202.fc18.x86_64 #1 SMP Wed Apr 17 23:25:17 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux


$ ifort -V
Intel(R) Fortran Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 13.1.3.192 Build 20130607
Copyright (C) 1985-2013 Intel Corporation.  All rights reserved.
FOR NON-COMMERCIAL USE ONLY

$ mpd --version
Intel(R) MPI Library for Linux, 64-bit applications, Version 4.1  Build 20120831
Copyright (C) 2003-2012 Intel Corporation.  All rights reserved.

$ python --version
Python 2.7.3
$ which mpd
/opt/intel/composer_xe_2013.5.192/mpirt/bin/intel64/mpd


$  which mpiexec
/opt/intel/composer_xe_2013.5.192/mpirt/bin/intel64/mpiexec


$  mpd --daemon
dell17_42934: mpd_uncaught_except_tb handling:
  <type 'exceptions.AttributeError'>: 'MPD' object has no attribute 'myIP'
    /opt/intel/composer_xe_2013.5.192/mpirt/bin/intel64/mpd  1677  run
        myIP=self.myIP,
    /opt/intel/composer_xe_2013.5.192/mpirt/bin/intel64/mpd  3676  <module>
        mpd.run()[/bash]

This last command return an error, as for Roddur.

I've also tried

[bash]  ifort -coarray -switch no_launch hello.f90; mpiexec.hydra a.out[/bash]
which does not generate any error nor output.

Any other clues to how could I fix this ?

Thanks

0 Kudos
roddur
Beginner
490 Views

flying_hermes wrote:

Hi, I'm having the same error with the following cod:

Hi,

Possibly I know the reason. You (probably) don't have dell17 in your /etc/hosts.

just append the line starts with 127.0.0.1 with the name dell17 (as this is the name of your machine,) and that will work.

0 Kudos
FlyingHermes
New Contributor I
490 Views

It works !!!

Thanks a lot roddur.

Any idea why the trick is required?

0 Kudos
Casey
Beginner
489 Views

Lorri, 

I have done some testing after the last post and confimed this exception is thrown when hostname resolution fails.  

I'm attaching a simple patch to the mpd python script that will detect this condition and then print an error message and raise a generic exception to halt mpd.  How you choose to handle a hostname failing to resolve (defaulting to localhost or aborting) is up to you, but I would reccomend at least applying this patch (or something based on it) to better catch and inform the user of the problem with host networking.

[plain]

*** mpd Tue Aug 20 16:56:31 2013
--- mpd-new Tue Aug 20 16:56:21 2013
***************
*** 1647,1652 ****
--- 1647,1656 ----
if self.parmdb['MPD_MY_IP'] :
self.myIP = self.parmdb['MPD_MY_IP'] # variable for convenience

+ if not hasattr(self,'myIP'):
+ print "Error: Your hostname '", self.myIfhn, "' does not resolve to an IP address."
+ raise Exception("Hostname resoultion failure")
+

self.ncpusTable = {}
self.ncpusEquality = 0

[/plain]

Note: mpd.diff is renamed to mpd.diff.txt so the uploader will accept it.  

0 Kudos
Reply