Professional Documents
Culture Documents
KFUPM
HPC-KFUPM
Then login using your username and password provided by the Administrator. After login user will see
the screen as shown below
http://hpc.kfupm.edu.sa
HPC-KFUPM
http://hpc.kfupm.edu.sa
HPC-KFUPM
#include<mpi.h>
#include<stdio.h>
main(int argc, char**argv)
{
int numtasks, rank;
MPI_Init(&argc,&argv);
MPI_Comm_size(MPI_COMM_WORLD,&numtasks);
MPI_Comm_rank(MPI_COMM_WORLD,&rank);
printf("Hello World from process %d of %d\n",rank,numtasks);
MPI_Finalize();
}
Save the file and exit (esc+shift :, then wq to save the file)
Now type the following command to compile your program
$mpiicc -o hello_MPI_c hello.c
http://hpc.kfupm.edu.sa
HPC-KFUPM
This will create an executable file by the name hello_MPI_c, user can check by typing ls command.
#PBS -N MPI_c
#PBS -l nodes=2:ppn=4
mpirun -np 8 -r ssh ./hello_MPI_c > MPI_c_output
http://hpc.kfupm.edu.sa
HPC-KFUPM
Save the file and exit (esc+shift :, then wq to save the file)
5) Submitting job:
Users can submit their jobs by using qsub command followed by pbsscript name, as shown below
http://hpc.kfupm.edu.sa
HPC-KFUPM
User can use qstat command to check his job as shown below, basic commands related to PBS can
be found here.
User can check if their job is running or not by typing qstat command, if he doesnt find his job in the
list it means his job has completed, now he can check his result file with the name MPI_c_output in
his home folder, user can open this file in vi editor or can copy this file from his home folder to his
local machine using winscp.
http://hpc.kfupm.edu.sa
HPC-KFUPM
OUTPUT:
http://hpc.kfupm.edu.sa