A New Java Runtime for a Parallel World Christoph Reichenbach, Yannis Smaragdakis University of Massachusetts, Amherst 1
P ARALLELIZABILITY ACCORDING TO C OMPLEXITY T HEORY Serial Code degree of parallelizability . . . FOL + transitive closure FOL + simple reduce (count, majority...) FOL (First-Order Logic): parallel map N EW J AVA R UNTIME FOR P ARALLEL W ORLD C. R EICHENBACH , Y. S MARAGDAKIS (UM ASS ) 2
O UR G OAL : U LTIMATE P ARALLEL L ANGUAGE • Declarative language to express – “everything” efficiently parallelizable – only programs that are efficiently parallelizable • Seamlessly integrated in Java List<Person> ps = forall Area a. find p: p in a.people && p.name == "Waldo"; int AB[i][j] = reduce (+) ( forall k. A[i][k] ∗ B[k][j]); • Program consists of parallel and sequential “phases” – over same data N EW J AVA R UNTIME FOR P ARALLEL W ORLD C. R EICHENBACH , Y. S MARAGDAKIS (UM ASS ) 3
O UR G OAL : U LTIMATE P ARALLEL L ANGUAGE • Declarative language to express – “everything” efficiently parallelizable – only programs that are efficiently parallelizable • Seamlessly integrated in Java List<Person> ps = forall Area a. find p: p in a.people && p.name == "Waldo"; int AB[i][j] = reduce (+) ( forall k. A[i][k] ∗ B[k][j]); • Program consists of parallel and sequential “phases” – over same data N EW J AVA R UNTIME FOR P ARALLEL W ORLD C. R EICHENBACH , Y. S MARAGDAKIS (UM ASS ) 4
O UR G OAL : U LTIMATE P ARALLEL L ANGUAGE • Declarative language to express – “everything” efficiently parallelizable – only programs that are efficiently parallelizable • Seamlessly integrated in Java List<Person> ps = forall Area a. find p: p in a.people && p.name == "Waldo"; int AB[i][j] = reduce (+) ( forall k. A[i][k] ∗ B[k][j]); • Program consists of parallel and sequential “phases” – over same data N EW J AVA R UNTIME FOR P ARALLEL W ORLD C. R EICHENBACH , Y. S MARAGDAKIS (UM ASS ) 5
F OR R ANDOM -A CCESS S TRUCTURES , P ARALLELIZING I S E ASY ArrayList <...> people; ... = ... find p: p in people ... people Core Core #1 #0 Core Core #2 #3 N EW J AVA R UNTIME FOR P ARALLEL W ORLD C. R EICHENBACH , Y. S MARAGDAKIS (UM ASS ) 6
F OR R ANDOM -A CCESS S TRUCTURES , P ARALLELIZING I S E ASY ArrayList <...> people; ... = ... find p: p in people ... people � � Core Core #1 #0 � Core Core #2 #3 � N EW J AVA R UNTIME FOR P ARALLEL W ORLD C. R EICHENBACH , Y. S MARAGDAKIS (UM ASS ) 7
C HALLENGE : P ARELLELIZE P ROCESSING OF A LL J AVA D ATA Support any user-defined data structure • Arbitrary object references • “Sequential” library structures (e.g., linked lists) Core Core . . . #1 #0 ? Core Core #2 #3 N EW J AVA R UNTIME FOR P ARALLEL W ORLD C. R EICHENBACH , Y. S MARAGDAKIS (UM ASS ) 8
I DEA : F ROM OO H EAP TO R ELATIONAL H EAP e2 " Wilma " e0 e1 " Waldo " " Waldina " e3 " Werner " class E { String name; E boss; E partner; name boss partner } e0 e0 e3 e0 e1 "Waldo" e1 e1 e3 e1 e0 "Waldina" e2 e2 e1 e2 e5 "Wilma" e3 e3 e3 e17 "Werner" — . . . . . . . . . N EW J AVA R UNTIME FOR P ARALLEL W ORLD C. R EICHENBACH , Y. S MARAGDAKIS (UM ASS ) 9
I DEA : F ROM OO H EAP TO R ELATIONAL H EAP e2 " Wilma " e0 e1 " Waldo " " Waldina " e3 " Werner " class E { String name; E boss; E partner; name boss partner } e0 e0 e3 e0 e1 "Waldo" e1 e1 e3 e1 e0 "Waldina" e2 e2 e1 e2 e5 "Wilma" e3 e3 e3 e17 "Werner" — . . . . . . . . . N EW J AVA R UNTIME FOR P ARALLEL W ORLD C. R EICHENBACH , Y. S MARAGDAKIS (UM ASS ) 10
I DEA : F ROM OO H EAP TO R ELATIONAL H EAP e2 " Wilma " e0 e1 " Waldo " " Waldina " e3 " Werner " class E { String name; E boss; E partner; name boss partner } e0 e0 e3 e0 e1 "Waldo" e1 e1 e3 e1 e0 "Waldina" e2 e2 e1 e2 e5 "Wilma" e3 e3 e3 e17 "Werner" — . . . . . . . . . N EW J AVA R UNTIME FOR P ARALLEL W ORLD C. R EICHENBACH , Y. S MARAGDAKIS (UM ASS ) 11
I DEA : F ROM OO H EAP TO R ELATIONAL H EAP e2 " Wilma " e0 e1 " Waldo " " Waldina " e3 " Werner " class E { String name; E boss; Migrate E partner; name boss partner } e0 e0 e3 e0 e1 "Waldo" e1 e1 e3 e1 e0 "Waldina" e2 e2 e1 e2 e5 "Wilma" e3 e3 e3 e17 "Werner" — . . . . . . . . . N EW J AVA R UNTIME FOR P ARALLEL W ORLD C. R EICHENBACH , Y. S MARAGDAKIS (UM ASS ) 12
C HALLENGE : R EPRESENTATION M IGRATION Ideas: • Migrate dynamically between representations at sequential-parallel switch – cost comparable to GC per switch • Maintain relational heap throughout execution – incurs > 10 × overhead for sequential execution ... • Hybrid representation (relational+cache) • Hybrid + incremental migration (write barrier) – ask us for our preliminary numbers N EW J AVA R UNTIME FOR P ARALLEL W ORLD C. R EICHENBACH , Y. S MARAGDAKIS (UM ASS ) 13
C HALLENGE : R EPRESENTATION M IGRATION Ideas: • Migrate dynamically between representations at sequential-parallel switch – cost comparable to GC per switch • Maintain relational heap throughout execution – incurs > 10 × overhead for sequential execution ... • Hybrid representation (relational+cache) • Hybrid + incremental migration (write barrier) – ask us for our preliminary numbers N EW J AVA R UNTIME FOR P ARALLEL W ORLD C. R EICHENBACH , Y. S MARAGDAKIS (UM ASS ) 14
C HALLENGE : R EPRESENTATION M IGRATION Ideas: • Migrate dynamically between representations at sequential-parallel switch – cost comparable to GC per switch • Maintain relational heap throughout execution – incurs > 10 × overhead for sequential execution ... • Hybrid representation (relational+cache) • Hybrid + incremental migration (write barrier) – ask us for our preliminary numbers N EW J AVA R UNTIME FOR P ARALLEL W ORLD C. R EICHENBACH , Y. S MARAGDAKIS (UM ASS ) 15
C HALLENGE : R EPRESENTATION M IGRATION Ideas: • Migrate dynamically between representations at sequential-parallel switch – cost comparable to GC per switch • Maintain relational heap throughout execution – incurs > 10 × overhead for sequential execution ... • Hybrid representation (relational+cache) • Hybrid + incremental migration (write barrier) – ask us for our preliminary numbers N EW J AVA R UNTIME FOR P ARALLEL W ORLD C. R EICHENBACH , Y. S MARAGDAKIS (UM ASS ) 16
C HALLENGE : R EPRESENTATION M IGRATION Ideas: • Migrate dynamically between representations at sequential-parallel switch – cost comparable to GC per switch • Maintain relational heap throughout execution – incurs > 10 × overhead for sequential execution ... • Hybrid representation (relational+cache) • Hybrid + incremental migration (write barrier) – ask us for our preliminary numbers N EW J AVA R UNTIME FOR P ARALLEL W ORLD C. R EICHENBACH , Y. S MARAGDAKIS (UM ASS ) 17
C HALLENGE : R EPRESENTATION M IGRATION Ideas: • Migrate dynamically between representations at sequential-parallel switch – cost comparable to GC per switch • Maintain relational heap throughout execution – incurs > 10 × overhead for sequential execution ... • Hybrid representation (relational+cache) • Hybrid + incremental migration (write barrier) – Ask us for our preliminary numbers! N EW J AVA R UNTIME FOR P ARALLEL W ORLD C. R EICHENBACH , Y. S MARAGDAKIS (UM ASS ) 18
C HALLENGE : R EPRESENTATION M IGRATION Ideas: • Migrate dynamically between representations at sequential-parallel switch – cost comparable to GC per switch • Maintain relational heap throughout execution – incurs > 10 × overhead for sequential execution ... • Hybrid representation (relational+cache) • Hybrid + incremental migration (write barrier) Ask us for our preliminary numbers! N EW J AVA R UNTIME FOR P ARALLEL W ORLD C. R EICHENBACH , Y. S MARAGDAKIS (UM ASS ) 19
C ONCLUSION • The relational heap is a great basis for parallelism • Relational and traditional heaps can coexist in many ways N EW J AVA R UNTIME FOR P ARALLEL W ORLD C. R EICHENBACH , Y. S MARAGDAKIS (UM ASS ) 20
Recommend
More recommend