Installing MYMPI.c library
Can anyone guide me as开发者_运维技巧 to how can I install MYMPI.c library using linux envirnoment?
I think the question you're asking here is how do you compile an MPI program, here something called MYMPI.c, in a linux environment.
So first off, check to see if you already have MPI installed. Trying to run the command mpicc
would be one way to do this. If there is such a program in your path, it's already installed. If you have it installed, skip the next paragraph.
If you don't, you need to install the MPI library and utilities. How you do that depends a bit on your system. If you have root, you can probably use whatever package manager you use (apt-get, or yum) to install either of OpenMPI or MPICH2. Both are very solid implementations of the MPI specification, and there's no real reason a priori to prefer one over the other; choose whatever installs most easily for you. If you don't have root, you can install either from sources into your home directly easily enough.
Once you have the library and utilities installed, you can compile and run the program. You should be able to do the following:
mpicc -o MYMPI MYMPI.c
mpiexec -n 4 ./MYMPI
精彩评论