coding environment infrastructure for efficient parallel computing

11
Coding environment infrastructure for efficient parallel computing Industrial Project - 234313

Upload: libby-meadows

Post on 02-Jan-2016

25 views

Category:

Documents


4 download

DESCRIPTION

Industrial Project - 234313. Coding environment infrastructure for efficient parallel computing. Team. Developers: Vlad Krasnov Ady Abraham Supervisor: Dr. Roee Engelberg , LSI. Goals. Make programming with asynchronous non-blocking APIs intuitive. Preserve maximal efficiency. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Coding environment infrastructure for efficient parallel computing

Coding environment infrastructure for efficientparallel computing

Industrial Project - 234313

Page 2: Coding environment infrastructure for efficient parallel computing

Team

Developers:

Vlad Krasnov

Ady Abraham

Supervisor:

Dr. Roee Engelberg, LSI

Page 3: Coding environment infrastructure for efficient parallel computing

Goals

Make programming with asynchronous non-blocking APIs intuitive.

Preserve maximal efficiency.

A()

B() C()

F T

A(){ //some code here... some_async_IO(decision1);}decision1(){ if(...) C(); else B();}B(){ //some code here... some_async_IO(A);}C(){ //some code here... some_async_IO(exit_func);}exit_func(){ return;}

Legacy model: The Project’s Goal:

START(EXAMPLE); ASYNC(A); WHILE(...) ASYNC(B); ASYNC(A); ENDWHILE; ASYNC(C); END;

// execution pointEXEC(EXAMPLE);

Page 4: Coding environment infrastructure for efficient parallel computing

Methodology

Define abstract computation modelSyntax definition.Framework implementation in order to

run the required flow.Debug and validation.

Page 5: Coding environment infrastructure for efficient parallel computing

Achievements

Framework with MACRO based syntax that provides Turing-complete semantics.Second tier API with debugging capabilities.

Natural easy-to-use easy-to-read syntax.No training required.

Page 6: Coding environment infrastructure for efficient parallel computing

Achievements

Supports:Synchronous functions.Asynchronous functions. IfWhileBreakGoto / LabelsExit

Page 7: Coding environment infrastructure for efficient parallel computing

Example (legacy code)

void GetAddressForWrite(void* ctx){ read_map(ctx, Continue1, ctx); // top snapshot}

void Continue1(void* ctx){ if(error_occured(ctx)){ give_up_chunk(ctx); return; } if(map_exists(ctx)){ // in top snapshot update_address(ctx); return; } Loop(ctx);}

void Loop(void* ctx){ if(!map_does_not_exist(ctx)){ ContinueFromLoop(ctx); return; } get_next_snapshot(ctx); read_map(ctx, Continue2, ctx); // of next snapshot}

void Continue2(void* ctx){ if(error_occured(ctx)){ give_up_chunk(ctx); return; } Loop(ctx);}

void ContinueFromLoop(void* ctx){ get_new_chunk(ctx); init_new_chunk(ctx, Continue3, ctx);}

Page 8: Coding environment infrastructure for efficient parallel computing

Example (legacy code) cont.

void Continue3(void* ctx){ if(error_occured(ctx)){ give_up_chunk(ctx); return; } update_map(ctx, Continue4, ctx); // of top

snapshot}

void Continue4(void* ctx){ if(error_occured(ctx)){ give_up_chunk(ctx); return; } update_address(ctx); Done(ctx);}

Page 9: Coding environment infrastructure for efficient parallel computing

Example

START(GET_ADDRESS_FOR_WRITE); ASYNC(read_map); // top snapshot IF(error_occured); GOTO(bail); ENDIF; IF(map_exists); // in top snapshot SYNC(update_address); EXIT; ENDIF; WHILE(map_does_not_exist); SYNC(get_next_snapshot); ASYNC(read_map); // of next snapshot IF(error_occured); GOTO(bail); ENDIF; ENDWHILE;

SYNC(get_new_chunk); ASYNC(init_new_chunk); IF(error_occured); GOTO(bail); ENDIF;

ASYNC(update_map); // of top snapshot IF(error_occured); GOTO(bail); ENDIF;

SYNC(update_address); EXIT;

LABEL(bail); SYNC(give_up_chunk); // only if was allocated SYNC(set_error); EXIT; END;

EXEC(GET_ADDRESS_FOR_WRITE, ctx, Done);

Page 10: Coding environment infrastructure for efficient parallel computing

Example Output

ASYNC: read_mapDone with async...map_exists(): FALSEmap_does_not_exist(): TRUESYNC: get_next_snapshotASYNC: read_mapDone with async...map_does_not_exist(): TRUESYNC: get_next_snapshotASYNC: read_mapDone with async...map_does_not_exist(): TRUESYNC: get_next_snapshotASYNC: read_mapDone with async...map_does_not_exist(): FALSESYNC: get_new_chunkASYNC: init_new_chunkDone with async...ASYNC: update_mapDone with async...SYNC: update_addressFlow terminated

Page 11: Coding environment infrastructure for efficient parallel computing

Conclusions

The project is more user friendly and useful than was expected at first.

Writing code with async function has now became easy!

No reason to be afraid of programming with async functions anymore.