【正文】
,如果之前有設(shè)置 PATH,那么在命令行中敲入 mpirun –np [進(jìn)程數(shù) ] [程序名 ],即可啟動(dòng)該 mpi程序。 6. char processor_name[MPI_MAX_PROCESSOR_NAME]。argc, amp。 // Initialize the MPI environment 8. // Get the size of process in the current process group 9. MPI_Comm_size( MPI_COMM_WORLD, amp。 10. // Get the rank of the current process 11. MPI_Comm_rank( MPI_COMM_WORLD, amp。 12. // Get the name of the processor which is running this process 13. MPI_Get_processor_name(processor_name, amp。 14. // Say hello world 15. printf(Hello World! Process %d of %d on %s\n, myid, numprocs, 16. processor_name)。 // Exit the MPI environment 18. return