13.07.2015 Views

PGAS Programming with UPC and Fortran Coarrays

PGAS Programming with UPC and Fortran Coarrays

PGAS Programming with UPC and Fortran Coarrays

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Side effects of shared dataHolding data in a shared memory space has implications1) the lifetime of shared data needs to extend beyond the scope itwas defined in (unless this is program scope) storage duration2) the shared data needs to be keep up-to-date synchronisation17Storage duration of shared objectsShared objects cannot have automatic storage durationo any variable defined inside a function!Why?SPMD model means a shared variable may be accessedoutside lifetime of the function!Conclusionshared variables must eithero have file scope;o or be declared as static if defined inside a function.189

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!