LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   error in mpi (https://www.linuxquestions.org/questions/linux-newbie-8/error-in-mpi-4175468821/)

sryzdn 07-08-2013 12:08 AM

error in mpi
 
Hi,

I have installed a code under mpich, blas, blacks, lapack and scalapack. The code itself is running with no problem. But one of its utilities is giving me the following error while I want to "make" it:

Quote:

../Gen-basis/../../Src/timer.F:139: undefined reference to `__mpi__r8_v_MOD_mpi_reduce_t'
Is there any way to solve this problem?

adelabarra 07-08-2013 06:39 AM

Dear sryzdn:
May be it is an undefined type.
Try to grep for `__mpi__r8_v_MOD_mpi_reduce_t' and send the results to a file.
May be you find a header file that is not in the path. (Which defines the type)
Also you can try to guess the type yourself. (But you have to see the source)
If you've got many errors lkike this it is probably you lack a header file.

Regards.

Alejandro.

sryzdn 07-08-2013 07:28 AM

Dear Alejandro,

Thanks for the reply.

The code I have compiled, works under mpich2, lapack,blas, scalapack and blacks. The code itself has no problem in parallel execution, only this utility cannot be "made" and the complete error list I receive is as enclosed.

Please let me know what header file should be changed?

Quote:

[home@localhost Gen-basis]$ make
/usr/local/bin/mpif90 -o gen-basis \
alloc.o basis_types.o precision.o recipes.o parallel.o parsing.o xcmod.o basis_io.o chemical.o atm_transfer.o atm_types.o atmparams.o old_atmfuncs.o radial.o io.o paste.o flib_spline.o bessph.o m_filter.o basis_specs.o atom.o memoryinfo.o memory.o periodic_table.o pseudopotential.o pxf.o dot.o xc.o atom_options.o arw.o sys.o timer.o xml.o m_walltime.o gen-basis.o nag.o libfdf.a /home/home/Packages/scalapack-2.0.2/libscalapack.a /home/home/Packages/BLACS/LIB/blacsCinit_MPI-LINUX-0.a /home/home/Packages/BLACS/LIB/blacsF77init_MPI-LINUX-0.a /home/home/Packages/BLACS/LIB/blacs_MPI-LINUX-0.a /home/home/Packages/lapack-3.4.2/liblapack.a /home/home/Packages/BLAS/blas_LINUX.a
alloc.o: In function `print_report':
/home/home/Packages/siesta-TEST-3.2/Util/Gen-basis/../../Src/alloc.F90:1705: undefined reference to `__mpi__r8_s_MOD_mpi_reduce_t'
/home/home/Packages/siesta-TEST-3.2/Util/Gen-basis/../../Src/alloc.F90:1707: undefined reference to `__mpi__r8_v_MOD_mpi_reduce_t'
/home/home/Packages/siesta-TEST-3.2/Util/Gen-basis/../../Src/alloc.F90:1711: undefined reference to `__mpi__integer_s_MOD_mpi_bcast_t'
/home/home/Packages/siesta-TEST-3.2/Util/Gen-basis/../../Src/alloc.F90:1723: undefined reference to `__mpi__r8_s_MOD_mpi_recv_t'
/home/home/Packages/siesta-TEST-3.2/Util/Gen-basis/../../Src/alloc.F90:1718: undefined reference to `__mpi__r8_s_MOD_mpi_send_t'
alloc.o: In function `__alloc_MOD_alloc_report':
/home/home/Packages/siesta-TEST-3.2/Util/Gen-basis/../../Src/alloc.F90:318: undefined reference to `__mpi__integer_s_MOD_mpi_bcast_t'
/home/home/Packages/siesta-TEST-3.2/Util/Gen-basis/../../Src/alloc.F90:319: undefined reference to `__mpi__integer_s_MOD_mpi_bcast_t'
/home/home/Packages/siesta-TEST-3.2/Util/Gen-basis/../../Src/alloc.F90:320: undefined reference to `__mpi__character_s_MOD_mpi_bcast_t'
xcmod.o: In function `__xcmod_MOD_setxc':
/home/home/Packages/siesta-TEST-3.2/Util/Gen-basis/../../Src/xcmod.F:136: undefined reference to `__mpi__integer_s_MOD_mpi_bcast_t'
/home/home/Packages/siesta-TEST-3.2/Util/Gen-basis/../../Src/xcmod.F:138: undefined reference to `__mpi__character_v_MOD_mpi_bcast_t'
/home/home/Packages/siesta-TEST-3.2/Util/Gen-basis/../../Src/xcmod.F:140: undefined reference to `__mpi__character_v_MOD_mpi_bcast_t'
/home/home/Packages/siesta-TEST-3.2/Util/Gen-basis/../../Src/xcmod.F:142: undefined reference to `__mpi__r8_v_MOD_mpi_bcast_t'
/home/home/Packages/siesta-TEST-3.2/Util/Gen-basis/../../Src/xcmod.F:144: undefined reference to `__mpi__r8_v_MOD_mpi_bcast_t'
memory.o: In function `printmemory_':
/home/home/Packages/siesta-TEST-3.2/Util/Gen-basis/../../Src/memory.F:144: undefined reference to `__mpi__integer_s_MOD_mpi_allreduce_t'
/home/home/Packages/siesta-TEST-3.2/Util/Gen-basis/../../Src/memory.F:167: undefined reference to `__mpi__integer_sv_MOD_mpi_gather_t'
timer.o: In function `timer1_':
/home/home/Packages/siesta-TEST-3.2/Util/Gen-basis/../../Src/timer.F:117: undefined reference to `__mpi__r8_s_MOD_mpi_allreduce_t'
/home/home/Packages/siesta-TEST-3.2/Util/Gen-basis/../../Src/timer.F:164: undefined reference to `__mpi__r8_v_MOD_mpi_reduce_t'
/home/home/Packages/siesta-TEST-3.2/Util/Gen-basis/../../Src/timer.F:139: undefined reference to `__mpi__r8_v_MOD_mpi_reduce_t'
collect2: error: ld returned 1 exit status
make: *** [gen-basis] Error 1

knudfl 07-08-2013 11:20 AM

http://icmab.cat/leem/siesta/CodeAcc...downloads.html
> Siesta 3.2 > http://icmab.cat/leem/siesta/CodeAcc...siesta-3.2.tgz
cd siesta-3.2/Obj/ && sh ../Src/obj_setup.sh && ../Src/configure && make : OK.

cd ../Util/Gen-basis/ && make : No errors. The executable etc. created OK.

? What is "siesta-TEST-3.2" ?

-

sryzdn 07-08-2013 11:42 AM

Quote:

Originally Posted by knudfl (Post 4986307)
? What is "siesta-TEST-3.2" ?

-

Hi,

I have installed siesta in parallel in Packages directory and since two days ago I have this trouble with Gen-Basis, I just decided to do whatever I want on a TEST siesta.
The errors I get above are the ones that sow themselves during the parallel installation of siesta.

Here is the error I get by following your suggestion exactly:

Quote:

f95 -o gen-basis \
alloc.o basis_types.o precision.o recipes.o parallel.o parsing.o xcmod.o basis_io.o chemical.o atm_transfer.o atm_types.o atmparams.o old_atmfuncs.o radial.o io.o paste.o flib_spline.o bessph.o m_filter.o basis_specs.o atom.o memoryinfo.o memory.o periodic_table.o pseudopotential.o pxf.o dot.o xc.o atom_options.o arw.o sys.o timer.o xml.o m_walltime.o gen-basis.o nag.o libfdf.a dc_lapack.a liblapack.a libblas.a
f95: error: dc_lapack.a: No such file or directory
f95: error: liblapack.a: No such file or directory
f95: error: libblas.a: No such file or directory
make: *** [gen-basis] Error 1
why should it ask for dc lapack in serial form?!?!?

knudfl 07-08-2013 03:00 PM

Quote:

why should it ask for dc lapack ... ..
? May be you didn't create 'dc_lapack.a' ? Or it's in a wrong location ?

$ cd siesta-3.2/
$ find . -name dc_lapack.a : The reply is : ./Obj/dc_lapack.a

$ locate liblapack.a : Reply : /usr/lib/liblapack.a

$ locate libblas.a : /usr/lib/libblas.a

-

sryzdn 07-09-2013 12:43 AM

Quote:

Originally Posted by knudfl (Post 4986463)
$ find . -name dc_lapack.a : The reply is : ./Obj/dc_lapack.a
$ locate liblapack.a : Reply : /usr/lib/liblapack.a
$ locate libblas.a : /usr/lib/libblas.a
-

I have the said libraries in different places:

$ find . -name dc_lapack.a
Quote:

./Obj/dc_lapack.a
$ locate liblapack.a
Quote:

/home/Siesta-Serial/siesta-3.2/Obj/liblapack.a
$ locate libblas.a
Quote:

/home/Siesta-Serial/siesta-3.2/Obj/libblas.a

knudfl 07-09-2013 04:12 AM

Which OS are you using ?
$ cat /etc/*release* <Enter>
$ uname -m <Enter>

I didn't manage to make a setup that will fail ..
$ cd siesta-3.2/Util/Gen-basis/ && make : OK.
$ cd renamed-siesta-3.2/Util/Gen-basis/ && make : OK.

Why are you building the internal libblas.a / liblapack.a ?

-

sryzdn 07-09-2013 05:27 AM

I did everything from scratch today. I installed mpich, lapack, blas and ... again and tested them all for their correct installation (I also again downloaded them from netlib and the relevant links)
It did not change anything in parallel siesta and again I received those "undefined references" !!!!~~~~
But in the siesta serial installation I just made a link of the said libraries in Gen-basis directory and it was made finally ~~~

Now back to your questions:

Quote:

Which OS are you using ?
fedora 19
Quote:

$ cat /etc/*release* <Enter>
Fedora release 19 (Schrödinger’s Cat)
NAME=Fedora
VERSION="19 (Schrödinger’s Cat)"
ID=fedora
VERSION_ID=19
PRETTY_NAME="Fedora 19 (Schrödinger’s Cat)"
ANSI_COLOR="0;34"
CPE_NAME="cpe:/o:fedoraproject:fedora:19"
Fedora release 19 (Schrödinger’s Cat)
Fedora release 19 (Schrödinger’s Cat)
cpe:/o:fedoraproject:fedora:19
Quote:

$ uname -m <Enter>
x86_64

Quote:

Why are you building the internal libblas.a / liblapack.a ?
I don't know how to build them externally. I just follow the installation guide. Please tell me how to do it.

By the way, I also tried to make an FC_SERIAL symbol (f95 or gfortran) in the arch.make so that gen-basis can compile with serial compiler. Didn't work out in parallel siesta.

knudfl 07-09-2013 07:29 AM

# 9 : Fedora 19 - x86_64.
Quote:

I don't know how to build them externally
You don't :
libblas.a, liblapack.a can be installed with #yum install blas-static lapack-static
.. But they were not asked for, when making Gen-basis on Fedora :

# yum install \
blacs-mpich2-devel.x86_64 scalapack-mpich2-devel.x86_64 mpich2-devel.x86_64 lapack-devel.x86_64

$ cd siesta-3.2/Obj/ && sh ../Src/obj_setup.sh && ../Src/configure && make
$ cd ../Util/Gen-basis/ && make : No errors.
Code:

[knudfl@localhost Obj]$ cd ../Util/Gen-basis/
[knudfl@localhost Gen-basis]$ make
(cd fdf ; make -f /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/fdf/makefile "FC=f95        " "VPATH=/home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/fdf" \
                          "ARCH_MAKE=../../../Obj/arch.make" \
                          "INCFLAGS=-I /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/fdf  " "FFLAGS=-g -O2" module)
make[1]: Entering directory `/home/knudfl/tmp/siesta-3.2/Util/Gen-basis/fdf'
In fdf, INCFLAGS is: -I /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/fdf 
f95          -c -g -O2 -I /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/fdf    /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/fdf/fdf.f
f95          -c -g -O2 -I /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/fdf    /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/fdf/parse.f
f95          -c -g -O2 -I /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/fdf    /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/fdf/fdf_mod.f
ar  cru libfdf.a fdf.o fdf_mod.o parse.o
ranlib libfdf.a
cp libfdf.a ..
make[1]: Leaving directory `/home/knudfl/tmp/siesta-3.2/Util/Gen-basis/fdf'
f95          -c -g -O2    /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/parallel.f
f95          -c -g -O2  -UMPI -DFC_HAVE_FLUSH -DFC_HAVE_ABORT    /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/precision.F
f95          -c -g -O2  -UMPI -DFC_HAVE_FLUSH -DFC_HAVE_ABORT    /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/sys.F
f95          -c -g -O2  -UMPI -DFC_HAVE_FLUSH -DFC_HAVE_ABORT  /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/alloc.F90
f95          -c -g -O2    /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/atmparams.f
f95          -c -g -O2  -UMPI -DFC_HAVE_FLUSH -DFC_HAVE_ABORT  /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/atom_options.F90
f95          -c -g -O2    /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/flib_spline.f90
f95          -c -g -O2    /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/pseudopotential.f
f95          -c -g -O2    /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/basis_types.f
f95          -c -g -O2    /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/recipes.f
f95          -c -g -O2    /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/parsing.f
f95          -c -g -O2  -UMPI -DFC_HAVE_FLUSH -DFC_HAVE_ABORT    /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/xcmod.F
f95          -c -g -O2    /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/xml.f
f95          -c -g -O2    /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/radial.f
f95          -c -g -O2    /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/atm_types.f
f95          -c -g -O2    /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/chemical.f
f95          -c -g -O2  -UMPI -DFC_HAVE_FLUSH -DFC_HAVE_ABORT    /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/basis_io.F
f95          -c -g -O2    /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/old_atmfuncs.f
f95          -c -g -O2    /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/periodic_table.f
f95          -c -g -O2    /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/atm_transfer.f
f95          -c -g -O2    /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/io.f
f95          -c -g -O2    /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/paste.f
f95          -c -g -O2    /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/bessph.f
f95          -c -g -O2    /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/m_filter.f90
f95          -c -g -O2    /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/basis_specs.f
f95          -c -g -O2    /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/atom.f
f95          -c -g -O2  -UMPI -DFC_HAVE_FLUSH -DFC_HAVE_ABORT    /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/memoryinfo.F
f95          -c -g -O2  -UMPI -DFC_HAVE_FLUSH -DFC_HAVE_ABORT    /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/memory.F
f95          -c -g -O2  -UMPI -DFC_HAVE_FLUSH -DFC_HAVE_ABORT  /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/pxf.F90
f95          -c -g -O2    /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/dot.f
f95          -c -g -O2    /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/xc.f
f95          -c -g -O2    /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/arw.f
f95          -c -g -O2    /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/m_walltime.f90
f95          -c -g -O2  -UMPI -DFC_HAVE_FLUSH -DFC_HAVE_ABORT    /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/timer.F
f95          -c -g -O2  -UMPI -DFC_HAVE_FLUSH -DFC_HAVE_ABORT    gen-basis.F
f95          -c -g -O2    /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/nag.f
f95          -o gen-basis \
        alloc.o basis_types.o precision.o recipes.o parallel.o parsing.o xcmod.o basis_io.o  chemical.o atm_transfer.o atm_types.o atmparams.o old_atmfuncs.o radial.o io.o paste.o  flib_spline.o bessph.o  m_filter.o basis_specs.o atom.o memoryinfo.o memory.o periodic_table.o pseudopotential.o pxf.o dot.o xc.o  atom_options.o arw.o sys.o timer.o  xml.o m_walltime.o gen-basis.o nag.o libfdf.a    -llapack -lblas
f95          -c -g -O2  -UMPI -DFC_HAVE_FLUSH -DFC_HAVE_ABORT  /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/f2kcli.F90
f95          -c -g -O2    /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/m_getopts.f90
f95          -c -g -O2    /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/spher_harm.f
f95          -c -g -O2    /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/atmfuncs.f
f95          -c -g -O2    ioncat.f
f95          -c -g -O2    /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/chkdim.f
f95          -c -g -O2  -UMPI -DFC_HAVE_FLUSH -DFC_HAVE_ABORT    /home/knudfl/tmp/siesta-3.2/Util/Gen-basis/../../Src/m_memory.F
f95          -o ioncat \
        f2kcli.o m_getopts.o ioncat.o basis_types.o precision.o  parallel.o parsing.o xcmod.o alloc.o atom_options.o basis_io.o  atm_types.o atmparams.o radial.o io.o memory.o chkdim.o paste.o pseudopotential.o chemical.o basis_specs.o memoryinfo.o  m_memory.o periodic_table.o pxf.o xc.o flib_spline.o atmfuncs.o spher_harm.o sys.o timer.o  xml.o m_walltime.o nag.o libfdf.a


sryzdn 07-09-2013 07:44 AM

Thank you, I just did not use "yum" to install them, but linking them in the serial installation helped and I ran it.
But still it bothers me that I could not make it in parallel installation. No idea how to get rid of those "undefined references"!!!!

adelabarra 07-09-2013 09:40 AM

Quote:

-------
`__mpi__integer_s_MOD_mpi_bcast_t'
/home/home/Packages/siesta-TEST-3.2/Util/Gen-basis/../../Src/alloc.F90:320: undefined reference to `__mpi__character_s_MOD_mpi_bcast_t'
xcmod.o: In function `__xcmod_MOD_setxc':
/home/home/Packages/siesta-TEST-3.2/Util/Gen-basis/../../Src/xcmod.F:136: undefined reference to `__mpi__integer_s_MOD_mpi_bcast_t'
--------
Dear sryzdn:
May be it's not practical, but when I was compiling some module for the emc2, I did something like this:

1) Open the files alloc.F90 and xcmod.F and see if there are some common headers.
If there are, there should be the: "typedef sometype __mpi__integer_s_MOD_mpi_bcast_t".

If you could guess the type, could give it a try. For example, if somewhere says: if __mpi__integer_s_MOD_mpi_bcast_t..., you could guess it is an integer or a boolean...

Then add to the header:
typedef unsigned __mpi__integer_s_MOD_mpi_bcast_t

2)If all this fails, you can do:

grep -rl "__mpi__integer_s_MOD_mpi_bcast_t" $PWD > myfile

Means find every file who has "__mpi__integer_s_MOD_mpi_bcast_t" and send the result to a file. Copy the list by hand if it is not very long.

3) When your balls arrive the floor and the operation is finished, open the file "myfile" and see if there is any header file. And the type definition, obviously.

For example: ../ /myworkingdirectory/placeimpossibletofind/hidden.inc or .h

3) Add it to the include path and try again.

knudfl 07-09-2013 11:39 AM

# 11 .
Quote:

No idea how to get rid of those "undefined references" !
Probably use the Fedora packages. ( Post # 10.)
That would be one way of insuring a package combination,
where the versions are meant to work together.

Which commands are you using for the "parallel builds" ?
I don't think you have show those commands yet ?

-

sryzdn 07-09-2013 12:22 PM

1 Attachment(s)
adelabarra,
Thanks for your reply. I really like to tackle problems I have in linux this way that teaches me even more.
I will test your suggestion and will post the result.

knudfl
Thanks so much for helping me a lot.
Your question:

Quote:

Which commands are you using for the "parallel builds" ?
I don't think you have show those commands yet?
I just go through the configuration just like what you mentioned, after the "arch.make" is made I edit it as follows and will type "make" Then the mpirun will execute the input files.

sryzdn 07-09-2013 11:52 PM

adelabarra,

I put some time on your post and found the equivalent for typedef in F90 and could remove the "__mpi__integer_s_MOD_mpi_bcast_t".
I don't know how to remove r8. But I will give it a double try.


All times are GMT -5. The time now is 07:04 AM.