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

Intel 64 vs x86

Alexandre_M_1
Beginner
1,373 Views

This might seem pretty stupid but that's where I am stuck.

I am trying to build a Fortran application for a parallel machine using the Parallel Studio XE 2016 Cluster Edition on top on the MS Visual Studio Entreprise 2015. All works fine until I try to use the Intel MPI libraries, either the one embeded on the cluster edition or the MPI library 5.1.

Before submitting the code to the high performance machine, I would like to debug it locally.

My local machine is running Win8 64bits, x64-based processor, 8GB. When I installed the Fortran package, it installed itself in the Program Files (x86)\IntelSWTools folder but all mpi libraries are either intel64 or em64t. It does not matter how many Fortran mpi libraries I install, they all seem to be x64. I would expect things to not work, as they do not at the present.

Must I find, download ans install a x64 Fortran? I was never "told" that the Fortran I was installing was x86.

Any suggestions?

Thanks,.

0 Kudos
16 Replies
mecej4
Honored Contributor III
1,373 Views

Let us set aside MPI and SMP/OpenMP issues as a first step.

On your desktop machine running Windows, do you have the 64-bit VS and Intel Parallel Studio (Composer or Professional) components installed? Can you build any 64-bit EXE using Intel Fortran? In the Start menu, under Intel Parallel Studio, do you see a shortcut to CMD for 64-bit development?

 

0 Kudos
Alexandre_M_1
Beginner
1,373 Views

Many thanks for your reply. Does this picture answer what you are asking me?

 

 

0 Kudos
Alexandre_M_1
Beginner
1,373 Views

In short, I think that's the problem. I have Intel Fortran's student version and I have no clue on how to check if it can produce x64 console applications...

0 Kudos
mecej4
Honored Contributor III
1,373 Views

Sorry, that image does not help pinpoint the problem. Go to the Windows Start menu (button at lower left corner of desktop, in default desktop configuration, or press the Windows key). Click on Intel Parallel Studio, and when the sub-menu gets expanded, take a screenshot and post here.

The Student version is identical to the Professional/Composer versions except for license terms and certain additional components that are not central to building local programs.

0 Kudos
Alexandre_M_1
Beginner
1,373 Views

I hope this is what you wanted...  many thanks!

0 Kudos
mecej4
Honored Contributor III
1,373 Views

Almost there! Please click-expand the "Compiler and Performance Libraries" that you showd in Intel02.png. You should see two shortcuts to CMD.exe, one for 32-bit and one for 64-bit.

0 Kudos
Alexandre_M_1
Beginner
1,373 Views

Not very clear in the limited space so here are the short-cuts, top to bottom:

Command Prompt with Intel Compiler 16.0 Update 3:

C:\Windows\SysWOW64\cmd.exe /E:ON /V:ON /K ""C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.3.207\windows\bin\ipsxe-comp-vars.bat" ia32 vs2015"

C:\Windows\System32\cmd.exe /E:ON /V:ON /K ""C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.3.207\windows\bin\ipsxe-comp-vars.bat" intel64 vs2015"


Command Prompt with Intel Compiler 16.0 Update 4:

C:\Windows\SysWOW64\cmd.exe /E:ON /V:ON /K ""C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.4.246\windows\bin\ipsxe-comp-vars.bat" ia32 vs2015"

C:\Windows\System32\cmd.exe /E:ON /V:ON /K ""C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.4.246\windows\bin\ipsxe-comp-vars.bat" intel64 vs2015"

0 Kudos
Alexandre_M_1
Beginner
1,373 Views

From the installation folder:

0 Kudos
mecej4
Honored Contributor III
1,373 Views

The presence of the shortcut ""C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.4.246\windows\bin\ipsxe-comp-vars.bat" intel64 vs2015"

 is proof that you have the necessary compiler tools installed for development. Please try compiling a "Hello World" program into a 64-bit EXE using that command prompt, or using Visual Studio and selecting to target X64.

There are many on-line guides for using Intel Fortran with Visual Studio (I have not tried any). I suspect that it is just a matter of your negotiating the menus in Visual Studio.

0 Kudos
Alexandre_M_1
Beginner
1,373 Views

Many thanks - I feel a total idiot because I cannot use the two tools properly. I am currently away from the university and don't have anyone I could beg for help. I will try to use your kind advise to solve it. Many many thanks.

0 Kudos
Alexandre_M_1
Beginner
1,373 Views

Well, it only took me months to understand the problem - your help was fundamental!

It is not solved yet but I think it is a matter of time now...  many many many thanks!

 

Build Log
   
 

Build started: Project: ex2, Configuration: Debug|x64

Output
   
Linking...
Link /OUT:"x64\Debug\ex2.exe" /INCREMENTAL:NO /NOLOGO /MANIFEST /MANIFESTFILE:"x64\Debug\ex2.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"D:\_1 - shared\_Arquivos\Alexandre\_Tecnicos\Pós-Doutorado\Exercicios MPI\ex2\ex2\ex2\x64\Debug\ex2.pdb" /SUBSYSTEM:CONSOLE /IMPLIB:"D:\_1 - shared\_Arquivos\Alexandre\_Tecnicos\Pós-Doutorado\Exercicios MPI\ex2\ex2\ex2\x64\Debug\ex2.lib" "x64\Debug\test.obj"
ipo: warning #11082: D:\_1 - shared\_Arquivos\Alexandre\_Tecnicos\Pós-Doutorado\Exercicios MPI\ex2\ex2\ex2\x64\Debug\test.obj: locally defined symbol __imp_MPIFCMB5 imported
ipo: warning #11082: D:\_1 - shared\_Arquivos\Alexandre\_Tecnicos\Pós-Doutorado\Exercicios MPI\ex2\ex2\ex2\x64\Debug\test.obj: locally defined symbol __imp_MPIFCMB9 imported
ipo: warning #11082: D:\_1 - shared\_Arquivos\Alexandre\_Tecnicos\Pós-Doutorado\Exercicios MPI\ex2\ex2\ex2\x64\Debug\test.obj: locally defined symbol __imp_MPIPRIV1 imported
ipo: warning #11082: D:\_1 - shared\_Arquivos\Alexandre\_Tecnicos\Pós-Doutorado\Exercicios MPI\ex2\ex2\ex2\x64\Debug\test.obj: locally defined symbol __imp_MPIPRIV2 imported
ipo: warning #11082: D:\_1 - shared\_Arquivos\Alexandre\_Tecnicos\Pós-Doutorado\Exercicios MPI\ex2\ex2\ex2\x64\Debug\test.obj: locally defined symbol __imp_MPIPRIVC imported
test.obj : warning LNK4049: locally defined symbol MPIFCMB5 imported
test.obj : warning LNK4049: locally defined symbol MPIFCMB9 imported
test.obj : warning LNK4049: locally defined symbol MPIPRIV1 imported
test.obj : warning LNK4049: locally defined symbol MPIPRIV2 imported
test.obj : warning LNK4049: locally defined symbol MPIPRIVC imported
test.obj : error LNK2019: unresolved external symbol MPI_INIT referenced in function MAIN__
test.obj : error LNK2019: unresolved external symbol MPI_COMM_SIZE referenced in function MAIN__
test.obj : error LNK2019: unresolved external symbol MPI_COMM_RANK referenced in function MAIN__
test.obj : error LNK2019: unresolved external symbol MPI_GET_PROCESSOR_NAME referenced in function MAIN__
test.obj : error LNK2019: unresolved external symbol MPI_RECV referenced in function MAIN__
test.obj : error LNK2019: unresolved external symbol MPI_SEND referenced in function MAIN__
test.obj : error LNK2019: unresolved external symbol MPI_FINALIZE referenced in function MAIN__
x64\Debug\ex2.exe : fatal error LNK1120: 7 unresolved externals


ex2 - 8 error(s), 10 warning(s)
0 Kudos
Alexandre_M_1
Beginner
1,373 Views

PS:   the code is from Intel:

=================================================================

!
! Copyright 2003-2013 Intel Corporation.  All Rights Reserved.
!
! The source code contained or described herein and all documents
! related to the source code ("Material") are owned by Intel Corporation
! or its suppliers or licensors.  Title to the Material remains with
! Intel Corporation or its suppliers and licensors.  The Material is
! protected by worldwide copyright and trade secret laws and treaty
! provisions.  No part of the Material may be used, copied, reproduced,
! modified, published, uploaded, posted, transmitted, distributed, or
! disclosed in any way without Intel's prior express written permission.
!
! No license under any patent, copyright, trade secret or other
! intellectual property right is granted to or conferred upon you by
! disclosure or delivery of the Materials, either expressly, by
! implication, inducement, estoppel or otherwise.  Any license under
! such intellectual property rights must be express and approved by
! Intel in writing.
!
        program main
        use mpi
        implicit none

        integer i, size, rank, namelen, ierr
        character (len=MPI_MAX_PROCESSOR_NAME) :: name
        integer stat(MPI_STATUS_SIZE)

        call MPI_INIT (ierr)

        call MPI_COMM_SIZE (MPI_COMM_WORLD, size, ierr)
        call MPI_COMM_RANK (MPI_COMM_WORLD, rank, ierr)
        call MPI_GET_PROCESSOR_NAME (name, namelen, ierr)

        if (rank.eq.0) then

            print *, 'Hello world: rank ', rank, ' of ', size, ' running on ', name

            do i = 1, size - 1
                call MPI_RECV (rank, 1, MPI_INTEGER, i, 1, MPI_COMM_WORLD, stat, ierr)
                call MPI_RECV (size, 1, MPI_INTEGER, i, 1, MPI_COMM_WORLD, stat, ierr)
                call MPI_RECV (namelen, 1, MPI_INTEGER, i, 1, MPI_COMM_WORLD, stat, ierr)
                name = ''
                call MPI_RECV (name, namelen, MPI_CHARACTER, i, 1, MPI_COMM_WORLD, stat, ierr)
                print *, 'Hello world: rank ', rank, ' of ', size, ' running on ', name
            enddo

        else

            call MPI_SEND (rank, 1, MPI_INTEGER, 0, 1, MPI_COMM_WORLD, ierr)
            call MPI_SEND (size, 1, MPI_INTEGER, 0, 1, MPI_COMM_WORLD, ierr)
            call MPI_SEND (namelen, 1, MPI_INTEGER, 0, 1, MPI_COMM_WORLD, ierr)
            call MPI_SEND (name, namelen, MPI_CHARACTER, 0, 1, MPI_COMM_WORLD, ierr)

        endif

        call MPI_FINALIZE (ierr)

        end

0 Kudos
mecej4
Honored Contributor III
1,373 Views

My suggestion is that you use a "divide-and-conquer" strategy. Just as you should sharpen and clean your arms before going to battle or get all the ingredients ready before baking a 50-lb loaf of bread, see if you can (i) reduce your problem size, (ii) run on a single processor with one thread and obtain results that are reasonable. After that is done, you can parallelize your code for SMP, and then step up to MPI and clusters.

The build-log that you showed in #12 shows only the error messages. Usually, to diagnose what went wrong, one needs to know the commands/settings/steps used in the build attempt that failed.

0 Kudos
Alexandre_M_1
Beginner
1,373 Views

Once more, many thanks.

I am trying to do as suggested, I hope, using Intel's own code.

I think the paths things was sorted, but now I am stuck trying to understand IF I put the right path and why it does not see the mpi headers. As they say, a day at a time...

0 Kudos
Steve_Lionel
Honored Contributor III
1,373 Views

A couple of comments that may or may not be helpful:

1) Intel MPI currently provides only 64-bit support. You're building (it would seem) for x64, so that should be ok.

2) There is a dedicated Intel forum for MPI and other cluster-related things. If you need more help with Intel MPI, that's a great place to ask.

0 Kudos
Kevin_D_Intel
Employee
1,373 Views

Refer to https://software.intel.com/en-us/forums/intel-visual-fortran-compiler-for-windows/topic/712760 for continued discussion on building/running the MPI example cited in post #13.

0 Kudos
Reply