This document serves as guide in conducting the UMD verification process of the QCG-Computing installation, especially the job and parallel job criteria. This document is targeted only at the system administrators, not the end users (those should use [http://www.qcgoscosgrid.org/trac/qcg-icon QCG-Icon] or the broker clients), as it relies on low level QCG-Computing interface.
=== JOBEXEC_JOB_1 ===
Execute a simple job in the appliance.
{{{
$ qcg-comp -c -J /usr/share/qcg-comp/doc/examples/jsdl/sleep.xml
Activity Id: 3f6558f5-76af-42cb-ad12-b37df187cf47
$ qcg-comp -s -a 3f6558f5-76af-42cb-ad12-b37df187cf47
status = Executing
$ qcg-comp -s -a 3f6558f5-76af-42cb-ad12-b37df187cf47
status = Executing
$ qcg-comp -s -a 3f6558f5-76af-42cb-ad12-b37df187cf47
status = Finished (exit status = 0)
}}}
=== JOBEXEC_JOB_2 ===
Execute a simple job in the appliance that uses both input and output files.
{{{
$ cat > bash.xml << EOF
JOBEXEC_JOB_2
bash
script.sh
JOBEXEC_JOB_2.out
script.sh
overwrite
script.sh
JOBEXEC_JOB_2.out
overwrite
JOBEXEC_JOB_2.out
1
EOF
$cat > script.sh << EOF
#!/bin/bash
hostname
EOF
$ qcg-comp -i -J bash.xml
Staging file: script.sh
All files staged in.
$ qcg-comp -c -J bash.xml
Activity Id: 72533fe7-764b-4b0c-93f9-b4dc7d73b5d4
$ qcg-comp -s -a 72533fe7-764b-4b0c-93f9-b4dc7d73b5d4
status = Queued
$ qcg-comp -s -a 72533fe7-764b-4b0c-93f9-b4dc7d73b5d4
status = Finished (exit status = 0)
$ qcg-com -o -J bash.xml
-bash: qcg-com: command not found
$ qcg-comp -o -J bash.xml
File JOBEXEC_JOB_2.out staged out.
All files staged out.
$ cat JOBEXEC_JOB_2.out
grass1.man.poznan.pl
}}}
=== JOBEXEC_JOB_3 ===
{{{
$ qcg-comp -c -J /usr/share/qcg-comp/doc/examples/jsdl/sleep.xml
Activity Id: 116c0702-2705-4c64-9d72-51c264061f8c
$ qcg-comp -s -a 116c0702-2705-4c64-9d72-51c264061f8c
status = Queued
$ qcg-comp -s -a 116c0702-2705-4c64-9d72-51c264061f8c
status = Executing
$ qcg-comp -t -a 116c0702-2705-4c64-9d72-51c264061f8c
Activity is being terminated.
$ qcg-comp -s -a 116c0702-2705-4c64-9d72-51c264061f8c #for a very short time after job termination we may still observe the Executing state
status = Executing
$ qcg-comp -s -a 116c0702-2705-4c64-9d72-51c264061f8c
status = Cancelled
}}}
=== JOBEXEC_EXECMNGR_3 ===
Job Execution Appliances must be able to collect information from the underlying
execution manager.
{{{
$qcg-comp -G | xmllint --format - | grep Queue
}}}
=== PARALLEL_JOB_1 ===
Job Execution Appliances that also provide the Parallel Job Capability must allow
users to submit a job requesting more than one execution slot.
{{{
$ cat > parallel-1.xml << EOF
PARALLEL_JOB_1
/bin/sleep
60
2
EOF
$ qcg-comp -c -J parallel-1.xml
Activity Id: 2757fdde-e055-432a-ae28-e627ff8f6aa6
$ qcg-comp -g -a 2757fdde-e055-432a-ae28-e627ff8f6aa6 -x | grep Local
Local job ID: 15297.grass1.man.poznan.pl
$ qstat -f 15297 | grep exec
exec_host = grass1.man.poznan.pl/2+grass1.man.poznan.pl/1
}}}
=== PARALLEL_JOB_2 ===
Job Execution Appliances that also provide the Parallel Job Capability should allow users to submit a job requesting more than one execution slot in a single machine. Here we provide only JSDL:
{{{
PARALLEL_JOB_2
/bin/sleep
60
2
}}}
=== PARALLEL_JOB_3 ===
Job Execution Appliances that also provide the Parallel Job Capability should allow users to submit a job requesting a combination of slots per physical machine. Here we also provide just the JSDL:
{{{
PARALLEL_JOB_2
/bin/sleep
60
2
2
}}}
=== PARALLEL_MPI_1 ===
Parallel Job Appliances must support the execution of MPI jobs.
{{{
$ cat > hello-mpi.c << EOF
#include
#include
int main(int argc, char *argv[]) {
int numprocs, rank, namelen;
char processor_name[MPI_MAX_PROCESSOR_NAME];
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &numprocs);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Get_processor_name(processor_name, &namelen);
printf("Process %d on %s out of %d\n", rank, processor_name, numprocs);
MPI_Finalize();
}
EOF
$ module load openmpi
$ mpicc hello-mpi.c -o hello-mpi
$ cat > bash.xml << EOF
PARALLEL_MPI_1
bash
script.sh
PARALLEL_MPI_1.out
hello-mpi
overwrite
hello-mpi
script.sh
overwrite
script.sh
PARALLEL_MPI_1.out
overwrite
PARALLEL_MPI_1.out
2
EOF
$ cat > script.sh << EOF
#!/bin/bash
chmod a+x hello-mpi
module load openmpi
mpiexec ./hello-mpi
EOF
$ qcg-comp -i -J bash.xml
Staging file: hello-mpi
Staging file: script.sh
All files staged in.
$ qcg-comp -c -J bash.xml
Activity Id: 45caa67c-2973-4bac-93e8-58b331f492c7
$ qcg-comp -s -a 45caa67c-2973-4bac-93e8-58b331f492c7
status = Finished (exit status = 0)
$ qcg-comp -o -J bash.xml
File PARALLEL_MPI_1.out staged out.
All files staged out.
$ cat PARALLEL_MPI_1.out
Process 0 on grass1.man.poznan.pl out of 2
Process 1 on grass1.man.poznan.pl out of 2
}}}
=== PARALLEL_MPI_2 ===
Parallel Job Appliances must support the execution of MPI jobs that are compiled at
submission time.
{{{
$ cat > hello-mpi.c << EOF
#include
#include
int main(int argc, char *argv[]) {
int numprocs, rank, namelen;
char processor_name[MPI_MAX_PROCESSOR_NAME];
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &numprocs);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Get_processor_name(processor_name, &namelen);
printf("Process %d on %s out of %d\n", rank, processor_name, numprocs);
MPI_Finalize();
}
EOF
$ cat > bash.xml << EOF
PARALLEL_MPI_2
bash
script.sh
PARALLEL_MPI_2.out
hello-mpi.c
overwrite
hello-mpi.c
script.sh
overwrite
script.sh
PARALLEL_MPI_2.out
overwrite
PARALLEL_MPI_2.out
2
EOF
$ cat > script.sh << EOF
#!/bin/bash
module load openmpi
mpicc hello-mpi.c -o hello-mpi
mpiexec ./hello-mpi
EOF
$ qcg-comp -i -J bash.xml
Staging file: hello-mpi.c
Staging file: script.sh
All files staged in.
$ qcg-comp -c -J bash.xml
Activity Id: 45caa67c-2973-4bac-93e8-58b331f492c7
$ qcg-comp -s -a 45caa67c-2973-4bac-93e8-58b331f492c7
status = Finished (exit status = 0)
$ qcg-comp -o -J bash.xml
File PARALLEL_MPI_2.out staged out.
All files staged out.
$ cat PARALLEL_MPI_2.out
Process 0 on grass1.man.poznan.pl out of 2
Process 1 on grass1.man.poznan.pl out of 2
}}}
=== PARALLEL_OMP_1 ===
Parallel Job Appliances must support the execution of OpenMP jobs.
{{{
$ cat > bash.xml << EOF
PARALLEL_OMP_1
bash
script.sh
PARALLEL_OMP_1.out
1
hello-omp
overwrite
hello-omp
script.sh
overwrite
script.sh
PARALLEL_OMP_1.out
overwrite
PARALLEL_OMP_1.out
2
EOF
$ cat > script.sh << EOF
#!/bin/bash
chmod a+x hello-omp
./hello-omp
$ cat script.sh
#!/bin/bash
chmod a+x hello-omp
./hello-omp
EOF
$ cat > hello-omp.c << EOF
#include
#include
#include
int main (int argc, char *argv[]) {
int nthreads, tid;
/* Fork a team of threads giving them their own copies of variables */
#pragma omp parallel private(nthreads, tid)
{
/* Obtain thread number */
tid = omp_get_thread_num();
printf("Hello World from thread = %d\n", tid);
/* Only master thread does this */
if (tid == 0)
{
nthreads = omp_get_num_threads();
printf("Number of threads = %d\n", nthreads);
}
} /* All threads join master thread and disband */
}
EOF
$ gcc -fopenmp hello-omp.c -o hello-omp
$ qcg-comp -c -J bash.xml
Activity Id: e2968b9c-64ff-42f2-b500-c4b4c5485a74
$ qcg-comp -s -a e2968b9c-64ff-42f2-b500-c4b4c5485a74
status = Finished (exit status = 0)
$ qcg-comp -o -J bash.xml
File PARALLEL_OMP_1.out staged out.
All files staged out.
$ cat PARALLEL_OMP_1.out
Hello World from thread = 0
Number of threads = 2
Hello World from thread = 1
}}}
=== PARALLEL_OMP_2 ===
An exercise for the reader ;-)