天天看點

mpirun mpirexec 的PBS script 是不同的

The preferred means of starting MPI programs on the Linux cluster is mpiexec. The main advantage of using mpiexec over mpirun is that there is no need for sourcing any setup file during the program execution. However, you still must source the setup file before compiling your program. It is a lot easier to write the PBS script file using mpiexec than mpirun. The example MPI program above could be executed with the following PBS script that uses mpiexec.

To run a job, the first step is to source the setup file:

The second step is to compile the program:

The third step is to submit the .pbs file to the queue. When the job submission is successful, the qsub command returns the job's process number:

The output files for the above run are created in the same directory where the qsub command was executed. The output files are created using the same filename as your PBS script filename with an extension that includes "e" for "error" or "o" for "output" followed by the process number. In our example above the file mpitest.pbs.e12240 contains the error messages and the file mpitest.pbs.o12240 contains the output of the program. The output of the program can be viewed by listing the output files:

繼續閱讀