How to setup VS Code for MPI based on C | Parallel Programming in VS Code | MS-MPI setup in Windows

Поділитися
Вставка
  • Опубліковано 18 вер 2024

КОМЕНТАРІ • 78

  • @SKMTutorialsHub
    @SKMTutorialsHub  Рік тому +4

    Those who are facing the issue "sal.h dependency not found" or something like that, uninstall the MinGW compiler and follow this video - ua-cam.com/video/_-O94qsnOLk/v-deo.html
    Program used in video - github.com/sandy2802/MPI_C/blob/main/first.c

    • @talltests7391
      @talltests7391 7 місяців тому +1

      I'm still getting the same sal.h error after installing msys2

    • @SKMTutorialsHub
      @SKMTutorialsHub  7 місяців тому

      I recently installed it on my other laptop and I had no errors. Maybe you try uninstalling and do a fresh install.

  • @cakebox_
    @cakebox_ 2 місяці тому +1

    I followed another guide and was having trouble figuring out the error at the end. Thank you for explaining that thing with directory names. After a few hours I am finally up and running!

  • @vadrif-draco
    @vadrif-draco Рік тому +4

    On powershell on VS Code, the following command worked for me with default installation paths (the ones with spaces):
    *gcc file.c -I $env:MSMPI_INC.TrimEnd('\') -L $env:MSMPI_LIB64.TrimEnd('\') -lmsmpi*
    Or alternatively
    *gcc file.c -I $env:MSMPI_INC\ -L $env:MSMPI_LIB64\ -lmsmpi*
    The trick has to do with how the paths in the environment variables end with an escape character (the '\'), that's what actually breaks the command, not the spaces in the path (on VS Code's powershell terminal). You can either trim it like in the first command, or manually add another escape character at the end of the environment variable. Thank you for the video though!

    • @vadrif-draco
      @vadrif-draco Рік тому +1

      And on cmd this is another way (instead of trimming the '\' I just add another '\' to escape it before the quotes, quotes which are necessary to get around spaces in the path...):
      *gcc file.c -I "%MSMPI_INC%\" -L "%MSMPI_LIB64%\" -lmsmpi*

    • @SKMTutorialsHub
      @SKMTutorialsHub  Рік тому

      Thanks for the information 👍

    • @zeus3590
      @zeus3590 6 місяців тому

      thanks for the note, changing the tasks.json arguments like that fixed it for me.
      ```
      "args": [
      "-fdiagnostics-color=always",
      "-g",
      "${file}",
      "-I",
      "C:\\Program Files (x86)\\Microsoft SDKs\\MPI\\Include",
      "-L",
      "C:\\Program Files (x86)\\Microsoft SDKs\\MPI\\Lib\\x64",
      "-lmsmpi",
      "-o",
      "${fileDirname}\\${fileBasenameNoExtension}.exe"
      ],
      ```

  • @organic_panic813
    @organic_panic813 11 місяців тому +1

    Hello, I just wanted to thank you for this tutorial, it worked perfectly for me!

  • @raihanazemouchi8904
    @raihanazemouchi8904 4 місяці тому +1

    this is very helpful , thank you so much. It would be even better if it was without the background music though. Thank you

  • @dianabazagaperez1486
    @dianabazagaperez1486 27 днів тому +1

    If when you execute set msmpi the variables don't appear, you can restart your computer. It worked for me. In case it's useful for someone.

  • @dinhthuyvynguyen2062
    @dinhthuyvynguyen2062 3 місяці тому

    @SKMTutorialsHub thank you a lot! This is very useful, and I also like the background music. Btw I have a question. I see that we are able to use mpiexec to execute the programs because mpiexec.exe is in bin. But I dont want to execute, but only compile the programs with mpicc, however I do not see any mpicc.exe. So how do we just compile the files using mpicc? Looking forward to your answer.

    • @dinhthuyvynguyen2062
      @dinhthuyvynguyen2062 3 місяці тому

      Oh i think i got it. Is mpiexec for execute mpi c.files for non-root users and mpicc for root users?

    • @SKMTutorialsHub
      @SKMTutorialsHub  3 місяці тому

      mpiexec is for execution and compilation is done when we are clicking run build task.

  • @ismailsaleh3536
    @ismailsaleh3536 4 місяці тому +1

    Why using sad music :) ur doing great job right here!

  • @elianfoyou5191
    @elianfoyou5191 Рік тому +1

    merci pour la video ellem'a bien aider

  • @walschwab2069
    @walschwab2069 Рік тому +1

    thanks very much!!

  • @sulaimanabdullah8349
    @sulaimanabdullah8349 11 місяців тому +1

    I'm following the same steps but after clicking edit "icludePath" setting , it tells me to open a folder first to configure so do i need to create a folder and create the c file inside it then continue the steps or am i missing something else?
    also if i create a folder with the file and continue following the steps it doesn't work so I'm really confused

    • @SKMTutorialsHub
      @SKMTutorialsHub  11 місяців тому +1

      Create a folder for MPI programs first then open vs code just like in the video "open with vs code"

    • @sulaimanabdullah8349
      @sulaimanabdullah8349 11 місяців тому +1

      @@SKMTutorialsHub thank you very much

    • @SKMTutorialsHub
      @SKMTutorialsHub  11 місяців тому

      Most welcome 😄

  • @user-ei9wz7vl9p
    @user-ei9wz7vl9p 5 місяців тому +1

    not worked, also deleted and can not install because of "again error code 50. a version of mpi that is the same or newer is already installed."

    • @SKMTutorialsHub
      @SKMTutorialsHub  5 місяців тому

      You can use an uninstaller software like revo uninstaller to uninstall or remove the leftover files of mpi

  • @user-lc1jh3wm3p
    @user-lc1jh3wm3p Рік тому +1

    I have error, the library mpi is working when call all function mpi but I face this error when runing.
    Test.c:3:10: fatal error: mpi.h: No such file or directory
    3 | #include
    | ^~~~~~~
    compilation terminated.

  • @Casino-bp2om
    @Casino-bp2om Рік тому +1

    Cmd doesn’t print “MSMPI_INC-D”. Other lines print. Can u help, please?

    • @SKMTutorialsHub
      @SKMTutorialsHub  Рік тому

      Make sure you downloaded all the setup files and installed them

  • @user-lc1jh3wm3p
    @user-lc1jh3wm3p Рік тому +1

    hi
    how can solve this error :cannot open source file "sal.h" (dependency of "mpi.h")

    • @SKMTutorialsHub
      @SKMTutorialsHub  Рік тому

      Yeah sure. That's very easy to fix. Just read the pinned comment first. Try that. Your problem will be solved.

  • @emiletshomba6060
    @emiletshomba6060 Рік тому +1

    Hi, I followed all the instructions but when I tried to run the code it gave me this error "first.c:2:10: fatal error: mpi.h: No such file or directory 2 | #include "mpi.h" " how can I fix this??

    • @SKMTutorialsHub
      @SKMTutorialsHub  Рік тому +1

      Only from the error I am not sure what the problem is. You can cross check the folders where MPI is installed to check if the path and all are correct.

    • @emiletshomba6060
      @emiletshomba6060 Рік тому

      Thank you for responding

  • @VersionMismatched
    @VersionMismatched 8 місяців тому +2

    "set msmpi" command gives blank output.

    • @SKMTutorialsHub
      @SKMTutorialsHub  8 місяців тому

      Did you follow the previous steps of installation correctly?

  • @saireddy5198
    @saireddy5198 Рік тому +2

    I'm facing a issuse as sal.h depency not found in mpi.h
    do u have a solution for this?

    • @SKMTutorialsHub
      @SKMTutorialsHub  Рік тому +1

      Yes actually one of my friends also faced the same problem. The Mingw installation process has been changed. Now you have to install it through the software called Msys2.

    • @SKMTutorialsHub
      @SKMTutorialsHub  Рік тому +1

      First reinstall Mingw through msys2 then the remaining process is same.

    • @SKMTutorialsHub
      @SKMTutorialsHub  Рік тому

      If you face any problem you can ask in my Instagram

    • @saireddy5198
      @saireddy5198 Рік тому +1

      @@SKMTutorialsHub thank u , it worked

    • @SKMTutorialsHub
      @SKMTutorialsHub  Рік тому

      You're most welcome

  • @GCD0980
    @GCD0980 Рік тому +1

    How do I change from the default path if its already installed

    • @SKMTutorialsHub
      @SKMTutorialsHub  Рік тому

      Default path of mpi you are asking?
      You have to uninstall and reinstall the two setups.

    • @user-cs5ni1xm5h
      @user-cs5ni1xm5h 11 місяців тому

      I remove the mpi files and install those again, but I get the error that ms mpi installation failed with error code 50. a version of mpi that is the same or newer is already installed. So how do I solve this problem, as I install the mpi in the default location at first, so I need to install again.@@SKMTutorialsHub

  • @schooze5504
    @schooze5504 4 місяці тому +1

    Cannot Find : /${MSMPI_INC} in C Configuration

  • @user-cs5ni1xm5h
    @user-cs5ni1xm5h 11 місяців тому

    I remove the mpi files and install those again, but I get the error that ms mpi installation failed with error code 50. a version of mpi that is the same or newer is already installed. So how do I solve this problem, as I install the mpi in the default location at first, so I need to install again.

    • @SKMTutorialsHub
      @SKMTutorialsHub  11 місяців тому

      Use revo uninstaller to remove all the files of ms mpi

  • @abhishekudeniyan6541
    @abhishekudeniyan6541 6 місяців тому +1

    It shows error ------ system cannot find file specified

  • @sksolaimanabdullah5076
    @sksolaimanabdullah5076 8 місяців тому +1

    I followed all instructions, still
    #include not found

    • @SKMTutorialsHub
      @SKMTutorialsHub  8 місяців тому

      Recheck the folders where mpi is installed

    • @sksolaimanabdullah5076
      @sksolaimanabdullah5076 8 місяців тому +1

      I only have c drive.
      I installed MPI in a desktop folder called Microsoft MPI
      @@SKMTutorialsHub

    • @SKMTutorialsHub
      @SKMTutorialsHub  8 місяців тому

      When you run the set msmpi command did it give the required output

    • @sksolaimanabdullah5076
      @sksolaimanabdullah5076 8 місяців тому

      Yes. All five lines are outputting correctly.@@SKMTutorialsHub

  • @Gubernatorrr
    @Gubernatorrr 6 місяців тому +1

    When I run the program like that: mpiexec -n 4 hello, it shows
    Rank: 0/4
    Rank: 1/4
    Rank: 2/4
    Rank: 3/4
    And in any variation of code. What is wrong?

    • @SKMTutorialsHub
      @SKMTutorialsHub  6 місяців тому

      Check the line of printing

    • @Gubernatorrr
      @Gubernatorrr 6 місяців тому

      It may be because of the printing line? But it's your code. You used it in the video

    • @SKMTutorialsHub
      @SKMTutorialsHub  6 місяців тому

      Okay so you have used the code of the video. Still go through the printing lines

    • @Gubernatorrr
      @Gubernatorrr 6 місяців тому +1

      @@SKMTutorialsHub even if i'm not printing anything, it shows me Rank: then random num of the number i typed. For example:
      $ mpiexec -n 3 hello
      Rank: 0/3
      Rank: 1/3
      Rank: 2/3
      $ mpiexec -n 4 hello
      Rank: 0/4
      Rank: 3/4
      Rank: 1/4
      Rank: 2/4

    • @SKMTutorialsHub
      @SKMTutorialsHub  6 місяців тому

      Try a different program and see if the problem exists.

  • @amira__tarek
    @amira__tarek 9 місяців тому +1

    music is soooo noisy but thanxx

  • @athacyrsouzaferreira3529
    @athacyrsouzaferreira3529 Рік тому +1

    Não funcionou

  • @arpitmishra160
    @arpitmishra160 Рік тому +4

    It's not working. Totally waste of time

    • @SKMTutorialsHub
      @SKMTutorialsHub  Рік тому

      What's the error?

    • @RahulSharma-yr4gu
      @RahulSharma-yr4gu Рік тому +1

      @@SKMTutorialsHub cannot open source file "sal.h" (dependency of "mpi.h") after reinstalling mingw it's even the same problem

    • @SKMTutorialsHub
      @SKMTutorialsHub  Рік тому

      See the comments of this video, you will find the solution in one of the comments. Try that and let me know if it works.

    • @JayakumarV
      @JayakumarV Рік тому

      Check sal.h header file is present in you base MINGW installation /include folder@@RahulSharma-yr4gu

    • @dinhthuyvynguyen2062
      @dinhthuyvynguyen2062 3 місяці тому

      This is untrue. I have done installing everything from zero thanks to his instructions. There were many times I had to reinstall/uninstall other apps like mingw again, but it did work. I also had all types of error that are mentioned in this chat, but @SKMTutotialsHub did offer related videos to solve the problems.

  • @ivan88842_
    @ivan88842_ Рік тому +2

    cannot open source file "sal.h" (dependency of "mpi.h")
    Can you help?

    • @SKMTutorialsHub
      @SKMTutorialsHub  Рік тому +1

      See the other comments. You will find the solution. If it doesn't work then tell me again.

    • @ivan88842_
      @ivan88842_ Рік тому +1

      @@SKMTutorialsHub
      What PATH should I specify in Environment variable?
      D:\MSYS2\mingw64\bin, the bin folder empty.

    • @SKMTutorialsHub
      @SKMTutorialsHub  Рік тому +1

      Check the folder msys2/ucrt64/bin