Results 1 to 17 of 17

Thread: Qt + MPI

  1. #1
    Join Date
    Feb 2009
    Posts
    32
    Thanks
    3
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Qt + MPI

    Hi guy i have a question
    can i use Qt creator and library of Open-MPI ???

  2. #2
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt + MPI

    why would u wanna use QT creator for open MPI..does it have any QT connection? if not anything else, its at least a C++ editor i think

  3. #3
    Join Date
    Feb 2009
    Posts
    32
    Thanks
    3
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: Qt + MPI

    i do a program for my thesis

    i make it in c++ for the interface i use qt and now the teacher saying me for operation in parallel use MPI ....

  4. #4
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt + MPI

    well, QT creator should be usable for that purpose, u'll be programming rest in C++, u'd just hv to add ur open mpi libraries in the project settings and all..usual c++ stuff

  5. #5
    Join Date
    Feb 2009
    Posts
    32
    Thanks
    3
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: Qt + MPI

    thank for all

  6. #6
    Join Date
    Feb 2009
    Posts
    32
    Thanks
    3
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: Qt + MPI

    ok ... now i install MPI ...

    how to configure qtcreator for compile my file the example is:

    Qt Code:
    1. #include "mpi.h"
    2. #include <iostream>
    3.  
    4. int main(int argc, char **argv)
    5. {
    6. int rank, size;
    7.  
    8. MPI::Init();
    9. rank = MPI::COMM_WORLD.Get_rank();
    10. size = MPI::COMM_WORLD.Get_size();
    11. std::cout << "Hello, world! I am " << rank << " of " << size << std::endl;
    12. MPI::Finalize();
    13.  
    14. return 0;
    15. }
    To copy to clipboard, switch view to plain text mode 

  7. #7
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt + MPI

    u should include the corresponding paths of include directories and the lib directories in the project to resolve all linking issues

  8. #8
    Join Date
    Feb 2009
    Posts
    32
    Thanks
    3
    Qt products
    Qt4
    Platforms
    MacOS X

    Unhappy Re: Qt + MPI

    i write in my project.pro this

    Qt Code:
    1. LIBS += -L/usr/lib/openmpi/
    2.  
    3. INCLUDEPATH += /usr/include/openmpi/ompi/mpi/cxx
    To copy to clipboard, switch view to plain text mode 

    but don't work ... sorry for my low capacity

    i read that for compiling mpi program the command is...

    Qt Code:
    1. shell$ mpic++ hello.cpp
    To copy to clipboard, switch view to plain text mode 

    but in qt
    Last edited by zeeb100; 13th February 2009 at 14:58.

  9. #9
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt + MPI

    does that mean mpi uses a different compiler??if so, then u'll have to make some changes in the makefile of ur project

  10. #10
    Join Date
    Feb 2009
    Posts
    32
    Thanks
    3
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: Qt + MPI

    can i compile file1.cpp use MPI library and file2.cpp use Qt library and merge file1.o and file2.o in compiling???


    and you can help me to configure the section qmake of qCreator to do this... ???

    sorry for my english

  11. #11
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt + MPI

    This page explains what OpenMPI requires : http://www.open-mpi.org/faq/?category=mpi-apps

    And qmake docs will show you how to get it working in a qmake project file.

    I see two possible (and hopefully simple) ways of getting this to work :

    * changing the compiler (recommended by OpenMPI docs) using QMAKE_CC, QMAKE_CXX variables :
    Qt Code:
    1. QMAKE_CC = mpicc
    2. QMAKE_CXX = mpic++
    To copy to clipboard, switch view to plain text mode 

    * adjusting flags using QMAKE_CFLAGS, QMAKE_CXX_FLAGS and QMAKE_LFLAGS variables :
    Qt Code:
    1. QMAKE_CC = $$system(mpicc --showme:compile)
    2. QMAKE_CXX = $$system(mpic++ --showme:compile)
    3. QMAKE_LFLAGS = $$system(mpic++ --showme:link)
    To copy to clipboard, switch view to plain text mode 
    Current Qt projects : QCodeEdit, RotiDeCode

  12. #12
    Join Date
    Feb 2009
    Posts
    32
    Thanks
    3
    Qt products
    Qt4
    Platforms
    MacOS X

    Smile Re: Qt + MPI

    thanks for help

  13. #13
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt + MPI

    There is a typo in my previous post (and I cannot edit it anymore...), shouldn't be hard to figure out how to correct it but just in case :
    Qt Code:
    1. QMAKE_CFLAGS = $$system(mpicc --showme:compile)
    2. QMAKE_CXXFLAGS = $$system(mpic++ --showme:compile)
    3. QMAKE_LFLAGS = $$system(mpic++ --showme:link)
    To copy to clipboard, switch view to plain text mode 
    Current Qt projects : QCodeEdit, RotiDeCode

  14. #14
    Join Date
    Feb 2009
    Posts
    32
    Thanks
    3
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: Qt + MPI

    i do it thanks

  15. #15

    Default Re: Qt + MPI

    i have add my open mpi libraries in the project settings ,but i have got the message: mpi.h , no such file or directory, who can help me ?

  16. #16
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt + MPI

    How did you add the libraries to the project settings?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  17. #17
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Qt + MPI

    Also, where did you install mpi? If you look on your include path and can't find mpi.h yourself, you may have installed it somewhere else.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.