Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
15 Views

Can MPI be used to parallelize a QuickWin application?

Jump to solution

Hi,

I have a Fortran QuickWin Application called GEMix in which I want to parallelize the computations in a single subroutine with no calls to QuickWin. The code is compiled and built (to GEMix.exe) in Visual Studio 2010 + Fortran Visual Cluster Studio 2016.

When I then open a command window and tries to execute GEM.exe via wmpiexec I get the error message "Can't load dynamic library".

Is it principally impossible to apply MPI to a QuickWin application or can the error be solved by a library reference to e.g. the QuickWin library?

Best regards

Anders S

0 Kudos

Accepted Solutions
Highlighted
Moderator
18 Views

Yours looks effectively identical (system and run differences) to mine as far as I can tell.  I'm concerned that there is a system configuration stopping this from working.  Maybe we can get around that.  Try running with -localroot.

mpiexec -localroot -n 4 testpl.exe

 

View solution in original post

0 Kudos
30 Replies
Highlighted
Black Belt
14 Views

You need to assure that when a new cmd window is opened by MPI, it is set to include the PATH to all needed dll.  This may be the reason why the installation of Intel MPI adds items to the Windows saved environment system path, but this method has disadvantages.   Probably better is to wrap your application into a .bat script which sets the additional required PATH entries.

If you are using Intel MPI, the experts on that hang out on the Cluster forum.

0 Kudos
Highlighted
Beginner
14 Views

Hi Tim,

Thank you for your very rapid reply! I have moved the question to the cluster expertise according to your advice.

Thanks

Anders S

0 Kudos
Highlighted
Moderator
14 Views

You should certainly be able to run a windowed application via MPI.  There is a tool called Dependency Walker which will show you the dependencies of an application, and which files are used to satisfy those dependencies.  I would suggest using that tool to find your missing library.

Also, is this a 32-bit application?  We have removed support for 32-bit applications in the Intel® MPI Library.

0 Kudos
Highlighted
Beginner
14 Views

Hi James T again,

I forgot to tell you that it is a 64-bit application.

Best regards

Anders salwén

0 Kudos
Highlighted
Moderator
14 Views

Are you still having problems?  If so, which library is missing?

0 Kudos
Highlighted
Beginner
14 Views

Greetings James T,

I have taken the MPI test routine named test and added a simple QuickWin based plot routine plotting a red rectangle near the lower right corner on the screen (attached). When I open a QuickWin project in Developer Studio,compile, link and then run MPI in a command window using wmpiexec  the "MPI threading run time library" seem to be missing. My efforts to add library information in wmpiexec were not succesful.

If I on the other hand open a console project, compile, link and then run MPI using wmpiexec the libraries necessary for the QickWin plot apeears to be missing. If I take away the plot routine call, everything works fine with MPI. 

As I have recently started to try to use MPI I would be most grateful if you could show how to combine MPI with QuickWin by making the supplied test routine work.

Bets regards

Anders S

0 Kudos
Highlighted
Moderator
14 Views

I'm encountering a few oddities, but that might be due to my lack of familiarity with QuickWin.  But your program is working for me, through either mpiexec or wmpiexec.

When I ran your program, I didn't see a rectangle drawn.  The program opens one window for each rank, with a blank console in all except rank 0.  Rank 0 has the standard hello world output.

I would put your plot call before MPI_Finalize unless you need to continue work after MPI is finished.

Can you run with mpiexec instead of wmpiexec?  Are you getting an error stating exactly which library is missing?  Have you tried Dependency Walker on your program?

0 Kudos
Highlighted
Beginner
14 Views

Greetings James T,

My real application is a sum of sequential and parallel parts. All plotting is produced in the sequential parts and produces a number of small plots on the screen telling what is happening during the calculations (convergence, minimum search,...). This gives a very good overview of the computational flow and is an excellent tool for error identification.

As there is no need for plotting during the parallel parts, the windows for rank 1,2,3... should be surpressed. Is the window for rank 0 the initial window defined at start? Otherwise, one has to supressed also that window.

What did you do to run the test routine?

I can run both wmpiexec and mpiexec, 

I have also run the test routine as a console project in Visual Studio 2010 with the MPI library references included. By adding /libs:qwin to the compiler options the QuickWin routine calls were resolved but one link error remained (see attached picture).:

error LNK2019: unresolved external symbol for_exit_handler referenced in function_QWFrameWndProc (ifqwin.lib(qwkwnd.obj)

This error may be related to that the project used was a console project. Therefore I could not run the Dependency Walker on the console project.

Best regards

Anders S

0 Kudos
Highlighted
Moderator
14 Views

I'm compiling and running via the command line:

mpiifort test.f90 /libs:qwin
mpiexec -n 2 test.exe

Running with wmpiexec also works.  Are you able to compile the test program via command line?

I would expect that setting /libs:qwin would override the console project settings.  I'm not a Visual Studio expert though, so maybe I'm wrong here.  But you should still be able to use Dependency Walker on a console application.  I've done that in the past with no problems.  Ensure that you are using the 64 bit Dependency Walker.

For the plotting in sequential parts, you can use something like:

if (rank .eq. 0) then
  ! plot work
end if

You'll still have windows opened for every rank though.  If you only want windows opened on the master rank, you'll need to compile the master separately from the workers, and run a heterogeneous job.

0 Kudos
Highlighted
Beginner
14 Views

Greetings James T,

Thank you very much for your answer. I have worked with the command line execution of the test routine testpl.f90 with QuickWin graphics (attached), with a modified placement of the plotted red rectangle.. I got the following results:

1. Compiling and linking with mpiifort according to your instructions:

mpiifort testpl.f90 /libs:qwin to produce the load module testpl.exe. Works OK

2. Running the load module with mpiexec:

mpiexec -n 4 testpl

gave no output (see attachment mpiexec from the task manager) but the computations "hung up".

3. Running the load module with wmpiexec:

gave no output (see attachment wmpiexec4 from the task manager) but the computations "hung up"

4. Execution of testpl.exe in the RTE (no mpi, one thread):

Plot OK with red rectangle (see attachment mpiifort_testpl)

My wish is to have the mpiexec -n 4 testpl work and, ideally, only thread 0 giving a plot.

Best regards

Anders S

 

 

0 Kudos
Highlighted
Beginner
14 Views

Greetings James T again,

I would like to add that if I take away the QwickWin part in the test routine testpl, everything works fine with 

mpiexec -n 4 testpl.exe

and wmpiexec.

So, why could you see plotting windows appear for all threads but I did not?

Best regards

Anders S

0 Kudos
Highlighted
Moderator
14 Views

What version of Windows* are you running?

0 Kudos
Highlighted
Beginner
14 Views

Greetings James T,

I am running Windows 7 Ultimate.

Best regards

Anders S

0 Kudos
Highlighted
Moderator
14 Views

Can you run this?

mpiexec -n 4 hostname
0 Kudos
Highlighted
Beginner
14 Views

Greetings James T,

when I run mpiexec -n 4 hostname

I get

exx-PC

exx-PC

exx-PC

exx-PC.

exx-PC is the name of my computer.

See also attachment

Best regards

Anders S

0 Kudos
Highlighted
Moderator
14 Views

Ok, can you compile and run one of the test programs in C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016\windows\mpi\test with mpiexec -n 4?

0 Kudos
Highlighted
Beginner
14 Views

Greetings James T,

I have now run mpiexec -n 4 test

and the result seems to be OK (see appendices)

Best regards

Anders S

0 Kudos
Highlighted
Moderator
14 Views

Ok, let's go back to your test application.  Try running both of the following.  Capture the text output (if any) from the second one and attach that as a text file.

mpiexec -n 1 testpl.exe
mpiexec -n 4 -verbose -genv I_MPI_DEBUG 5 testpl.exe

 

0 Kudos
Highlighted
Beginner
14 Views

Greetings James T,

I have run the testpl.f90 program according to your suggestions.

After mpiifort testpl.f90 /libs:qwin the first execution

mpiexec -n 4 testpl.exe

hang up and was stopped with the Task Manager.

The second run with debug gave a lot of output and I supply the last part and some part in the interior (see attachments)

0 Kudos