Download presentation
Presentation is loading. Please wait.
Published byMuriel Craig Modified over 8 years ago
1
UPC-CompilerCheck High Performance Computing Group Iowa State University Ames, Iowa USA July 26, 2012 Marina Kraeva, James Coyle, Glenn Luecke, Indranil Roy, Elizabeth Kleiman, James Hoekstra
2
9/26/2016Copyright 2012 Iowa State University HPC group http://hpcgroup.public.iastate.edu Previous Related Projects Funded by grants from the US DOD and DOE agencies the ISU HPC Group has developed ● Run-time error message testing tools for Fortran/C/C++ for serial, OpenMP, MPI, UPC ● Error detection tools: ● MPI-CHECK run-time/compile-time ● UPC-CHECK run-time:
3
9/26/2016Copyright 2012 Iowa State University HPC group http://hpcgroup.public.iastate.edu Why UPC? United Parallel C (UPC) : PGAS language. UPC : distributed memory without MPI Programs not restricted to the memory on a single node
4
9/26/2016Copyright 2012 Iowa State University HPC group http://hpcgroup.public.iastate.edu UPC-CompilerCheck Design Goals ● Measurement tool ● Easy to use ● Automated, self-checking/scoring ● Promote improved compile time error ● messages for UPC ● Goal: Improve UPC programmer efficiency
5
9/26/2016Copyright 2012 Iowa State University HPC group http://hpcgroup.public.iastate.edu Scope of UPC-CompilerCheck ● Assume C subset of UPC works ● Focus on errors specific to UPC
6
9/26/2016Copyright 2012 Iowa State University HPC group http://hpcgroup.public.iastate.edu Why Compile time? ● Run-time checking : more robust ● Compile-time : faster for developer.
7
9/26/2016Copyright 2012 Iowa State University HPC group http://hpcgroup.public.iastate.edu Errors in UPC programs ● Explicitly Disallowed Statements ● Array bounds errors: various types ● UPC functions- invalid arguments ● Invalid statement order ● Uninitialized shared variables
8
9/26/2016Copyright 2012 Iowa State University HPC group http://hpcgroup.public.iastate.edu Errors in UPC programs ● Deadlocks ● Race Conditions ● Memory errors ● Undefined UPC operations ● Warnings
9
9/26/2016Copyright 2012 Iowa State University HPC group http://hpcgroup.public.iastate.edu How tests are run ● Tests contain a single error. ● Compile ● Capture error output ● Compare and score
10
9/26/2016Copyright 2012 Iowa State University HPC group http://hpcgroup.public.iastate.edu Scoring ● 0 to 5, 5 is best. ● 0 : Error not found ; erroneous error ● 3 : Correct Error/File/Line# ● 5 : Error Message → Easily fix error
11
9/26/2016Copyright 2012 Iowa State University HPC group http://hpcgroup.public.iastate.edu Example... 29 shared [4] char Arr_A[4*THREADS]; 30 31 int main() { 32 shared [4] char *Ptr_S; 33 char *Ptr_L; 34 ptrdiff_t diff; 35 36 Ptr_S=&Arr A [4*MYTHREAD+1]; 37 Ptr_L=(char *)&Arr_A [4*MYTHREAD]; 38 39 diff = Ptr_S - Ptr_L; 40 41 if(MYTHREAD==0) { 42 print f(“diff = %d\n”,diff); 43 } 44 45 return 0; 46 }
12
9/26/2016Copyright 2012 Iowa State University HPC group http://hpcgroup.public.iastate.edu Recommended Message ERROR: incorrect operands An attempt to apply subtraction binary operator to pointer-to- shared ’Ptr_S’ and pointer-to-local ’Ptr_L’ is made at line 39 in file ’c_A_3_1_a_A.upc’. The pointer ’Ptr_S’ is declared at line 32 in file ’c_A_3_1_a_A.upc’. The pointer ’Ptr_L’ is declared at line 33 in file ’c_A_3_1_a_A.upc’.
13
9/26/2016Copyright 2012 Iowa State University HPC group http://hpcgroup.public.iastate.edu Scores for 4 Compilers Berkeley UPC: Score of 3 c_A_3_1_a_A.upc: In function ‘main’: c_A_3_1_a_A.upc:39: warning: Attempt to take the difference of pointer-to-shared and pointer-to-private GNU UPC: Score of 3 c_A_3_1_a_A.upc: In function ^a: c_A_3_1_a_A.upc:39: error: Attempt to take the difference of shared and nonshared pointers Cray UPC; HP UPC : Score of 0 Did not detect the error.
14
9/26/2016Copyright 2012 Iowa State University HPC group http://hpcgroup.public.iastate.edu Example 2... 28 int main() { 29 shared double *ptr_x; 30 double* ptr_x1; 31 32 if(MYTHREAD==THREADS/2) { 33 ptr_x1=(double*)ptr_x; 34 ptr_x=(shared double*) upc alloc(N*sizeof(double)); 35 ptr_x1- -; 36 printf(“ptr_x=%p; ptr_x1=%p \n”, (double*) ptr_x,(double*) ptr_x1); 37 38 upc free(ptr_x); 39 } 40 41 return 0; 42 }
15
9/26/2016Copyright 2012 Iowa State University HPC group http://hpcgroup.public.iastate.edu Recommended Message ERROR: uninitialized pointer An attempt to assign pointer ’ptr_x’ that is not explicitly initialized to another pointer is made at line 33 in file ’c_H_2_l.upc’. The pointer ’ptr_x’ is declared at line 29 in file ’c_H_2_l.upc’.
16
9/26/2016Copyright 2012 Iowa State University HPC group http://hpcgroup.public.iastate.edu Scores for 4 Compilers Cray UPC: Score of 4 CC-7212 cc: WARNING File = c_H_2_l.upc, Line = 33 Variable ‘‘ptr_x’’ is used before it is defined. HP UPC: Score of 4 ‘‘c_H_2_l.upc’’, line 33: warning: variable ‘‘ptr_x’’ is used before its value is set. ptr_x1=(double*)ptr_x; ^ Berkeley and GNU UPC : Score of 0 Did not detect the error.
17
9/26/2016Copyright 2012 Iowa State University HPC group http://hpcgroup.public.iastate.edu Selected Results
18
9/26/2016Copyright 2012 Iowa State University HPC group http://hpcgroup.public.iastate.edu Conclusions ● All poor, HP currently does the best job ● Disallowed Statements OK over 4 compilers ● UPC is new, expect improvement ● Other compilers check at runtime
19
9/26/2016Copyright 2012 Iowa State University HPC group http://hpcgroup.public.iastate.edu Availability ● UPC-CompilerCheck is freely available in: ● http://hpcgroup.public.iastate.edu/projects.html http://hpcgroup.public.iastate.edu/projects.html
20
9/26/2016Copyright 2012 Iowa State University HPC group http://hpcgroup.public.iastate.edu Questions ?
21
9/26/2016Copyright 2012 Iowa State University HPC group http://hpcgroup.public.iastate.edu Run-Time test results http://rted.public.iastate.edu/UPC/RESULTS/result_table.htm l
22
9/26/2016Copyright 2012 Iowa State University HPC group http://hpcgroup.public.iastate.edu Compile-Time vs. Run-Time
23
9/26/2016Copyright 2012 Iowa State University HPC group http://hpcgroup.public.iastate.edu UPC-CompilerCheck Marina Kraeva, James Coyle, Glenn Luecke, Indranil Roy, Elizabeth Kleiman, James Hoekstra Iowa State Univ.HPC : Improve programming environments; MPI-CHECK, UPC-CHECK United Parallel C (UPC) : PGAS language. UPC : distributed memory without MPI UPC-CompilerCheck Tool : How well does the compiler find errors
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.