fortran 2003/2008 - prace training portal: events · fortran 2003/2008 pekka manninen sami saarinen...

54
Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center for Science Ltd, Finland

Upload: dinhnga

Post on 08-May-2018

220 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

Fortran 2003/2008

Pekka ManninenSami Saarinen

David Henty

September 11-13, 2012PRACE Advanced Training CentreCSC – IT Center for Science Ltd, Finland

Page 2: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

All material (C) 2012 by the authors.This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License, http://creativecommons.org/licenses/by-nc-sa/3.0/

Page 3: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

Agenda

Tuesday

9.00-9.45 Getting started with Fortran

10.00-10.45 Arrays in Fortran

11.00-12.00 Exercises

12.00-13.00 Lunch break

13.00-13.45 Procedures & modules

14.00-16.00 Exercises

Wednesday

9.00-9.45 Derived datatypes

10.00-10.45 File I/O

11.00-12.00 Exercises

12.00-13.00 Lunch break

13.00-13.45 Exercises

14.00-14.45 Other handy Fortran features

15.00-16.00 Exercises

Thursday

9.00-9.45 Coarray programming modeland basic syntax

10.00-11.00 Exercises

11.15-12.00 Further coarray features

12.00-13.00 Lunch break

13.00-14.00 Exercises

14.15-15.00 Advanced coarray features

15.15-16.00 Exercises

Page 4: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

Web resources

CSC’s Fortran95/2003 Guide (in Finnish) for freehttp://www.csc.fi/csc/julkaisut/oppaatFortran wiki: a resource hub for all aspects of Fortran programminghttp://fortranwiki.orgGNU Fortran online documentshttp://gcc.gnu.org/onlinedocs/gcc-4.5.0/gfortranCode exampleshttp://www.nag.co.uk/nagware/examples.asphttp://www.personal.psu.edu/jhm/f90/progref.htmlMistakes in Fortran 90 Programs That Might Surprise Youhttp://www.cs.rpi.edu/~szymansk/OOF90/bugs.html

Page 5: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

ÐßÎÌ ×æ ÙÛÌÌ×ÒÙ ÍÌßÎÌÛÜ É×ÌØ ÚÑÎÌÎßÒ

Ñ«¬´·²»

Ú·®­¬ »²½±«²¬»® ©·¬¸ Ú±®¬®¿²

Ê¿®·¿¾´»­ ¿²¼ ¬¸»·® ¿­­·¹²³»²¬

ݱ²¬®±´ ­¬®«½¬«®»­

ɸ§ ´»¿®² Ú±®¬®¿²á

É»´´ ­«·¬»¼ º±® ²«³»®·½¿´ ½±³°«¬¿¬·±²­

� Ô·µ»´§ ±ª»® ëðû ±º ­½·»²¬·º·½ ¿°°´·½¿¬·±²­ ¿®» ©®·¬¬»² ·²

Ú±®¬®¿²

Ú¿­¬ ½±¼» ø½±³°·´»®­ ½¿² ±°¬·³·¦» ©»´´÷

Ø¿²¼§ ¿®®¿§ ¼¿¬¿ ¬§°»­

Ý´¿®·¬§ ±º ½±¼»

ᮬ¿¾·´·¬§ ±º ½±¼»

Ñ°¬·³·¦»¼ ²«³»®·½¿´ ´·¾®¿®·»­ ¿ª¿·´¿¾´»

Ú±®¬®¿² ¬¸®±«¹¸ ¬¸» ¿¹»­

Ö±¸² Éò Þ¿½µ«­ »¬ ¿´ øïçëì÷æ ̸» ×ÞÓ Ó¿¬¸»³¿¬·½¿´

Ú±®³«´¿ Ì®¿²­´¿¬·²¹ ͧ­¬»³

Û¿®´§ §»¿®­ ¼»ª»´±°³»²¬æ Ú±®¬®¿² ×× øïçëè÷ô Ú±®¬®¿² ×Ê

øïçêï÷ô Ú±®¬®¿² êê ú Þ¿­·½ Ú±®¬®¿² øïçêê÷

Ú±®¬®¿² éé øïçéè÷

Ú±®¬®¿² çð øïççï÷ ³¿¶±® ®»ª·­·±²ô Ú±®¬®¿² çë øïççë÷ ¿

³·²±® ®»ª·­·±² ¬± ·¬

Ú±®¬®¿² ¬¸®±«¹¸ ¬¸» ¿¹»­

Ú±®¬®¿² îððíæ ³¿¶±® ®»ª·­·±²ô ¿¼¼·²¹ »ò¹ò ±¾¶»½¬ó±®·»²¬»¼

º»¿¬«®»­

� �Ú±®¬®¿² çëñîððí� ·­ ¬¸» ½«®®»²¬ ¼» º¿½¬± ­¬¿²¼¿®¼

̸» ´¿¬»­¬ ­¬¿²¼¿®¼ ·­ Ú±®¬®¿² îððè ø¿°°®±ª»¼ îðïð÷ô ¿

³·²±® «°¹®¿¼» ¬± îððí

ê

ÐÎÑÙÎßÓ ­¯«¿®»Á®±±¬Á»¨¿³°´»

ÿ ݱ³³»²¬­ ­¬¿®¬ ©·¬¸ ¿² »¨½´¿³¿¬·±² °±·²¬ò

ÿ DZ« ©·´´ º·²¼ ¼¿¬¿ ¬§°» ¼»½´¿®¿¬·±²­ô ½±«°´» ¿®·¬¸³»¬·½ ±°»®¿¬·±²­

ÿ ¿²¼ ¿² ·²¬»®º¿½» ¬¸¿¬ ©·´´ ¿­µ ¿ ª¿´«» º±® ¬¸»­» ½±³°«¬¿¬·±²­ò

×ÓÐÔ×Ý×Ì ÒÑÒÛ

ÎÛßÔ ææ ¨ô §

×ÒÌÎ×ÒÍ×Ý ÍÏÎÌ ÿ Ú±®¬®¿² ­¬¿²¼¿®¼ °®±ª·¼»­ ³¿²§ ½±³³±²´§ «­»¼ º«²½¬·±²­

ÿ ݱ³³¿²¼ ´·²» ·²¬»®º¿½»ò ß­µ ¿ ²«³¾»® ¿²¼ ®»¿¼ ·¬ ·²

ÉÎ×ÌÛ øöôö÷ ùÙ·ª» ¿ ª¿´«» ø²«³¾»®÷ º±® ¨æù

ÎÛßÜ øöôö÷ ¨

§ã¨ööîõï ÿ б©»® º«²½¬·±² ¿²¼ ¿¼¼·¬·±² ¿®·¬¸³»¬·½

ÉÎ×ÌÛ øöôö÷ ù¹·ª»² ª¿´«» º±® ¨æùô ¨

ÉÎ×ÌÛ øöôö÷ ù½±³°«¬»¼ ª¿´«» ±º ¨ööî õ ïæùô §

ÿ Ю·²¬ ¬¸» ­¯«¿®» ®±±¬ ±º ¬¸» ¿®¹«³»²¬ § ¬± ­½®»»²

ÉÎ×ÌÛ øöôö÷ ù½±³°«¬»¼ ª¿´«» ±º ÍÏÎÌø¨ööî õ ï÷æùô ÍÏÎÌø§÷

ÛÒÜ ÐÎÑÙÎßÓ ­¯«¿®»Á®±±¬Á»¨¿³°´»

Ô±±µ ú Ú»»´

½±³°·´»®

´·²µ»®

­±«®½» ½±¼»

³±¼«´»­

±¾¶»½¬ ½±¼»

´·¾®¿®·»­

»¨»½«¬¿¾´»

×ÒÝÔËÜÛ

º·´»­ ½±³°·´»® ±«¬°«¬

ø±°¬·±²¿´÷

´·²µ»® ±«¬°«¬

ø±°¬·±²¿´÷

ݱ³°·´·²¹ ¿²¼ ´·²µ·²¹

×ÓÐÔ×Ý×Ì ÒÑÒÛ

×ÒÌÛÙÛÎ ææ ²ð

ÎÛßÔ ææ ¿ô ¾

ÎÛßÔ ææ ®ïãðòð

ÝÑÓÐÔÛÈ ææ ½

ÝÑÓÐÔÛÈ ææ ·³¿¹Á²«³¾»®ãøðòïô ïòð÷

ÝØßÎßÝÌÛÎøÔÛÒãèð÷ ææ °´¿½»

ÝØßÎßÝÌÛÎøÔÛÒãèð÷ ææ ²¿³»ãùÖ¿³»­ Þ±²¼ù

ÔÑÙ×ÝßÔ ææ ¬»­¬ð ã òÌÎËÛò

ÔÑÙ×ÝßÔ ææ ¬»­¬ï ã òÚßÔÍÛò

ÎÛßÔô ÐßÎßÓÛÌÛÎ ææ °·ãíòïìïëç

Ê¿®·¿¾´»­

ݱ²­¬¿²¬­ ¼»º·²»¼ ©·¬¸ ¬¸»

ÐßÎßÓÛÌÛÎ ½´¿«­» � ¬¸»§ ½¿²²±¬ ¾»

¿´¬»®»¼ ¿º¬»® ¬¸»·® ¼»½´¿®¿¬·±²

Ê¿®·¿¾´»­ ³«­¬ ¾» ¼»½´¿®»¼ ¿¬ ¬¸»

¾»¹·²²·²¹ ±º ¬¸» °®±¹®¿³ ±®

°®±½»¼«®»

̸»§ ½¿² ¿´­± ¾» ¹·ª»² ¿ ª¿´«» ¿¬

¼»½´¿®¿¬·±²

̸» ·²¬®·²­·½ ¼¿¬¿ ¬§°»­ ·² Ú±®¬®¿² ¿®»

×ÒÌÛÙÛÎô ÎÛßÔô ÝÑÓÐÔÛÈô

ÝØßÎßÝÌÛÎ ¿²¼ ÔÑÙ×ÝßÔ

Page 6: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

ÐÎÑÙÎßÓ ²«³¾»®­

×ÓÐÔ×Ý×Ì ÒÑÒÛ

×ÒÌÛÙÛÎ ææ ·

ÎÛßÔ ææ ®

ÝÑÓÐÔÛÈ ææ ½ô ½½

· ã é

® ã ïòêïèðíì

½ ã îòéïèîèïè ÿ­¿³» ¿­ ½ ã ÝÓÐÔÈøîòéïèîèïè÷

½½ ã ®öøïôï÷

ÝÓÐÔÈø®÷

ÉÎ×ÌÛ øöôö÷ ·ô ®ô ½ô ½½

ÛÒÜ ÐÎÑÙÎßÓ

Ñ«¬°«¬ ø±²» ·²¬»¹»® ¿²¼ ®»¿´ ¿²¼ ¬©± ½±³°´»¨ ª¿´«»­÷ æ

é ïòêïèðíì øîòéïèîèîô ðòðððððð÷ øïòêïèðíìô ïòêïèðíì÷

ß­­·¹²³»²¬ ­¬¿¬»³»²¬­

ر© ½¿² × ½±²ª»®¬ ²«³¾»®­ ¬±

½¸¿®¿½¬»® ­¬®·²¹­ ¿²¼ ª·½» ª»®­¿á Í»»

�×ÒÌÛÎÒßÔ ×ñÑ� ·² ¬¸» Ú·´» ×ñÑ ´»½¬«®»ò

ß«¬±³¿¬·½ ½¸¿²¹» ±º ®»°®»­»²¬¿¬·±²ô

©±®µ­ ¾»¬©»»² ¿´´ ²«³»®·½ ·²¬®·²­·½

¼¿¬¿ ¬§°»­

ß®·¬¸³»¬·½ ±°»®¿¬±®­ÎÛßÔ ææ ¨ô§

×ÒÌÛÙÛÎ ææ · ã ïð

¨ãîòðööøó·÷ ÿ°±©»® º«²½¬·±² ¿²¼ ²»¹¿¬·±² °®»½»¼»²½»æ º·®­¬

¨ã¨öÎÛßÔø·÷ ÿ³«´¬·°´·½¿¬·±² ¿²¼ ¬§°» ½¸¿²¹» °®»½»¼»²½»æ ­»½±²¼

¨ã¨ñîòð ÿ¼·ª·­·±² °®»½»¼»²½»æ ­»½±²¼

·ã·õï ÿ¿¼¼·¬·±² °®»½»¼»²½»æ ¬¸·®¼

·ã·óï ÿ­«¾¬®¿½¬·±² °®»½»¼»²½»æ ¬¸·®¼

λ´¿¬·±²¿´ ±°»®¿¬±®­òÔÌò ±® ä ÿ´»­­ ¬¸¿²

òÔÛò ±® äã ÿ´»­­ ¬¸¿² ±® »¯«¿´ ¬±

òÛÏò ±® ãã ÿ»¯«¿´ ¬±

òÒÛò ±® ñã ÿ²±¬ »¯«¿´ ¬±

òÙÌò ±® â ÿ¹®»¿¬»® ¬¸¿²

òÙÛò ±® âã ÿ¹®»¿¬»® ¬¸¿² ±® »¯«¿´ ¬±

Ô±¹·½¿´ ±°»®¿¬±®­òÒÑÌò ÿ´±¹·½¿´ ²»¹¿¬·±² °®»½»¼»²½»æ º·®­¬

òßÒÜò ÿ´±¹·½¿´ ½±²¶«²½¬·±² °®»½»¼»²½»æ ­»½±²¼

òÑÎò ÿ´±¹·½¿´ ·²½´«­·ª» ¼·­¶«²½¬·±² °®»½»¼»²½»æ ¬¸·®¼

Ñ°»®¿¬±®­

ß®®¿§­

×ÒÌÛÙÛÎô ÐßÎßÓÛÌÛÎ ææ Ó ã ïððô Ò ã ëðð

×ÒÌÛÙÛÎ ææ ·¼¨øÓ÷

ÎÛßÔ ææ ª»½¬±®øðæÒóï÷

ÎÛßÔ ææ ³¿¬®·¨øÓô Ò÷

ÝØßÎßÝÌÛÎ ø´»² ã èð÷ ææ ­½®»»² ø îì÷

ÿ ±®

×ÒÌÛÙÛÎô Ü×ÓÛÒÍ×ÑÒøïæÓ÷ ææ ·¼¨

ÎÛßÔô Ü×ÓÛÒÍ×ÑÒøðæÒóï÷ ææ ª»½¬±®

ÎÛßÔô Ü×ÓÛÒÍ×ÑÒøÓô Ò÷ ææ ³¿¬®·¨

ÝØßÎßÝÌÛÎø´»²ãèð÷ô ¼·³»²­·±²øîì÷ ææ ­½®»»²

Þ§ ¼»º¿«´¬ô ·²¼»¨·²¹ ­¬¿®¬­ º®±³ ï

ݱ²¬®±´ ­¬®«½¬«®»­æ ½±²¼·¬·±²¿´­

ÐÎÑÙÎßÓ ¬»­¬Á·º

×ÓÐÔ×Ý×Ì ÒÑÒÛ

ÎÛßÔ ææ ¨ô§ô»°­ô¬

ÉÎ×ÌÛøöôö÷ù Ù·ª» ¨ ¿²¼ § æù

ÎÛßÜøöôö÷ ¨ô §

»°­ ã ÛÐÍ×ÔÑÒø¨÷

×Ú øßÞÍø¨÷ â »°­÷ ÌØÛÒ

¬ã§ñ¨

ÛÔÍÛ

ÉÎ×ÌÛøöôö÷ù¼·ª·­·±² ¾§ ¦»®±ù

¬ãðòð

ÛÒÜ ×Ú

ÉÎ×ÌÛøöôö÷ù §ñ¨ ã ùô¬

ÛÒÜ ÐÎÑÙÎßÓÚ±®¬®¿²çë

ÿ ÜÑ ´±±° ©·¬¸ ¿² ·²¬»¹»® ½±«²¬»® ø½±«²¬ ½±²¬®±´´»¼÷

×ÒÌÛÙÛÎ ææ ·ô ­¬»°­·¦»ô Ò«³¾»®ÑºÐ±·²¬­

×ÒÌÛÙÛÎô ÐßÎßÓÛÌÛÎ ææ ³¿¨Á°±·²¬­ãïððððð

ÎÛßÔ ææ ¨Á½±±¼·²¿¬»ø³¿¨Á°±·²¬­÷ô ¨ô ¬±¬¿´­«³

òòò

­¬»°­·¦»ãî

ÜÑ · ã ïô Ò«³¾»®ÑºÐ±·²¬­ô ­¬»°­·¦»

¨Á½±±®¼·²¿¬»ø·÷ ã ·ö­¬»°­·¦»öðòðë

ÛÒÜ ÜÑ

ÿ ݱ²¼·¬·±² ½±²¬®±´´»¼ ´±±° øÜÑ ÉØ×ÔÛ÷

¬±¬¿´­«³ ã ðòð

ÎÛßÜøöôö÷ ¨

ÜÑ ÉØ×ÔÛ ø¨ â ð÷

¬±¬¿´­«³ ã ¬±¬¿´­«³ õ ¨

ÎÛßÜøöôö÷ ¨

ÛÒÜ ÜÑÚ±®¬®¿²çë

ݱ²¬®±´ ­¬®«½¬«®»­æ ´±±°­

ÿ ÜÑ ´±±° ©·¬¸±«¬ ´±±° ½±²¬®±´

ÎÛßÔ ææ ¨ô ¬±¬¿´­«³ô »°­

¬±¬¿´­«³ ã ðòð

ÜÑ

ÎÛßÜøöôö÷ ¨

×Ú ø¨ ä ð÷ ÌØÛÒ

ÛÈ×Ì ÿ »¨·¬ ¬¸» ´±±°

ÛÔÍÛ ×Ú ø¨ â «°°»®´·³·¬÷ ÌØÛÒ

ÝÇÝÔÛ ÿ ¼± ²±¬ »¨»½«¬» ¿²§ ­¬¿¬»³»²¬­ ¾«¬

ÿ ½§½´» ¾¿½µ ¬± ¬¸» ¾»¹·²²·²¹ ±º ¬¸» ´±±°

ÛÒÜ ×Ú

¬±¬¿´­«³ ã ¬±¬¿´­«³ õ ¨

ÛÒÜ ÜÑ

Ú±®¬®¿²çë

ݱ²¬®±´ ­¬®«½¬«®»­æ ´±±°­

òòò

×ÒÌÛÙÛÎ ææ ·

ÔÑÙ×ÝßÔ ææ ·­Á°®·³»Á²«³¾»®ô

¬»­¬Á°®·³»Á²«³¾»®

òòò

ÍÛÔÛÝÌ ÝßÍÛ ø·÷

ÝßÍÛ øîôíôëôé÷

·­Á°®·³»Á²«³¾»® ã òÌÎËÛò

ÝßÍÛ øïôìôêôèæïð÷

·­Á°®·³»Á²«³¾»® ã òÚßÔÍÛò

ÝßÍÛ ÜÛÚßËÔÌ

·­Á°®·³»Á²«³¾»®ã¬»­¬Á°®·³»Á²«³¾»®ø·÷

ÛÒÜ ÍÛÔÛÝÌ

òòò

Ú±®¬®¿²çë

ݱ²¬®±´ ­¬®«½¬«®»­æ ­»´»½¬ ½¿­»

ÍÛÔÛÝÌ ÝßÍÛ ­¬¿¬»³»²¬­

³¿¬½¸»­ ¬¸» »²¬®·»­ ±º ¿

´·­¬ ¿¹¿·²­¬ ¬¸» ½¿­» ·²¼»¨

� Ѳ´§ ±²» º±«²¼ ³¿¬½¸ ·­

¿´´±©»¼

� Ë­«¿´´§ ¿®¹«³»²¬­ ¿®»

½¸¿®¿½¬»® ­¬®·²¹­ ±®

·²¬»¹»®­

� ÜÛÚßËÔÌ ¾®¿²½¸ ·º ²±

³¿¬½¸ º±«²¼

ÐÎÑÙÎßÓ ¹½¼

ÿ ݱ³°«¬»­ ¬¸» ¹®»¿¬»­¬ ½±³³±² ¼·ª·­±®ô Û«½´·¼»¿² ¿´¹±®·¬¸³

×ÓÐÔ×Ý×Ì ÒÑÒÛ

×ÒÌÛÙÛÎ ææ ³ô ²ô ¬

ÉÎ×ÌÛøöôö÷ù Ù·ª» °±­·¬·ª» ·²¬»¹»®­ ³ ¿²¼ ² æù

ÎÛßÜøöôö÷ ³ô ²

ÉÎ×ÌÛøöôö÷ù³æùô ³ôù ²æùô ²

°±­·¬·ª»Á½¸»½µæ ×Ú ø³ â ð òßÒÜò ² â ð÷ ÌØÛÒ

³¿·²Á¿´¹±®·¬¸³æ ÜÑ ÉØ×ÔÛ ø² ñã ð÷

¬ ã ÓÑÜø³ô²÷

³ ã ²

² ã ¬

ÛÒÜ ÜÑ ³¿·²Á¿´¹±®·¬¸³

ÉÎ×ÌÛøöôö÷ùÙ®»¿¬»­¬ ½±³³±² ¼·ª·­±®æ ùô³

ÛÔÍÛ

ÉÎ×ÌÛøöôö÷ùÒ»¹¿¬·ª» ª¿´«» »²¬»®»¼ù

ÛÒÜ ×Ú °±­·¬·ª»Á½¸»½µ

ÛÒÜ ÐÎÑÙÎßÓ ¹½¼ Ú±®¬®¿²çë

ݱ²¬®±´ ­¬®«½¬«®»­ »¨¿³°´»

Ô¿¾»´­ ½¿² ¾» ¹·ª»² ¬±

½±²¬®±´ ­¬®«½¬«®»­ ¿²¼ «­»¼

·² ½±²¶«²½¬·±² ©·¬¸ »ò¹ò »¨·¬

¿²¼ ½§½´» ­¬¿¬»³»²¬­

Page 7: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

ÐÎÑÙÎßÓ °´¿½»¬»­¬

×ÓÐÔ×Ý×Ì ÒÑÒÛ

ÔÑÙ×ÝßÔ ææ ·²Á­¯«¿®»ïô ·²Á­¯«¿®»î

ÎÛßÔ ææ ¨ô§

ÉÎ×ÌÛøöôö÷ ùÙ·ª» °±·²¬ ½±±®¼·²¿¬»­ ¨ ¿²¼ §ù

ÎÛßÜ øöôö÷ ¨ô §

·²Á­¯«¿®»ï ã ø¨ âã ðò òßÒÜò ¨ äã îò òßÒÜò § âã ðò òßÒÜò § äã îò÷

·²Á­¯«¿®»î ã ø¨ âã ïò òßÒÜò ¨ äã íò òßÒÜò § âã ïò òßÒÜò § äã íò÷

×Ú ø·²Á­¯«¿®»ï òßÒÜò ·²Á­¯«¿®»î÷ ÌØÛÒ ÿ ·²­·¼» ¾±¬¸

ÉÎ×ÌÛøöôö÷ �б·²¬ ©·¬¸·² ¾±¬¸ ­¯«¿®»­�

ÛÔÍÛ ×Ú ø·²Á­¯«¿®»ï÷ ÌØÛÒ ÿ ·²­·¼» ­¯«¿®» ï ±²´§

ÉÎ×ÌÛøöôö÷ �б·²¬ ·²­·¼» ­¯«¿®» ï�

ÛÔÍÛ ×Ú ø·²Á­¯«¿®»î÷ ÌØÛÒ ÿ ·²­·¼» ­¯«¿®» î ±²´§

ÉÎ×ÌÛøöôö÷ �б·²¬ ·²­·¼» ­¯«¿®» î�

ÛÔÍÛ ÿ ¾±¬¸ ¿®» òÚßÔÍÛò

ÉÎ×ÌÛøöôö÷ �б·²¬ ±«¬­·¼» ¾±¬¸ ­¯«¿®»­�

ÛÒÜ ×Ú

ÛÒÜ ÐÎÑÙÎßÓ °´¿½»¬»­¬Ú±®¬®¿²çë

ß²±¬¸»® »¨¿³°´»

ï

î

ï

îîîî

ͱ«®½» ½±¼» ®»³¿®µ­

ß ª¿®·¿¾´» ²¿³» ½¿² ¾» ²± ´±²¹»® ¬¸¿² íï ½¸¿®¿½¬»®­

ø½±²¬¿·²·²¹ ±²´§ ´»¬¬»®­ô ¼·¹·¬­ ±® «²¼»®­½±®»ô ³«­¬ ­¬¿®¬

©·¬¸ ¿ ´»¬¬»®÷

Ó¿¨·³«³ ®±© ´»²¹¬¸ ·­ ïíî ½¸¿®¿½¬»®­

̸»®» ½¿² ¾» ³¿¨ íç ½±²¬·²«¿¬·±² ´·²»­

� ·º ¿ ´·²» ·­ »²¼»¼ ©·¬¸ ¿³°»®­¿²¼ øú÷ô ¬¸» ´·²» ½±²¬·²«»­

±²¬± ¬¸» ²»¨¬ ´·²»ò

Ò± ¼·­¬·²½¬·±² ¾»¬©»»² ´±©»® ¿²¼ «°°»®½¿­» ½¸¿®¿½¬»®­

� ݸ¿®¿½¬»® ­¬®·²¹­ ¿®» ½¿­» ­»²­·¬·ª»

ÿ ݸ¿®¿½¬»® ­¬®·²¹­ ¿®» ½¿­» ­»²­·¬·ª»

ÝØßÎßÝÌÛÎøÔÛÒãíî÷ ææ ½¸ïô ½¸î

Ô±¹·½¿´ ææ ¿²­

½¸ï ã ù¿ù

½¸î ã ùßù

¿²­ ã ½¸ï òÛÏò ½¸î

ÉÎ×ÌÛøöôö÷ ¿²­ ÿ ÑËÌÐËÌ º®±³ ¬¸¿¬ ÉÎ×ÌÛ ­¬¿¬»³»²¬ ·­æ Ú

ÿ ɸ»² ­¬®·²¹­ ¿®» ½±³°¿®»¼

ÿ ¬¸» ­¸±®¬»® ­¬®·²¹ ·­ »¨¬»²¼»¼ ©·¬¸ ¾´¿²µ­

ÉÎ×ÌÛøöôö÷ ùßù òÛÏò ùß ù ÿÑËÌÐËÌæ Ì

ÉÎ×ÌÛøöôö÷ ùßù òÛÏò ù ßù ÿÑËÌÐËÌæ Ú

ÿ ͬ¿¬»³»²¬ ­»°¿®¿¬·±²æ ²»©´·²» ¿²¼ ­»³·½±´±²ô å

ÿ Í»³·½±´±² ¿­ ¿ ­¬¿¬»³»²¬ ­»°¿®¿¬±®

¿ ã ¿ ö ¾å ½ ã ¼öö¿

ÿ ̸» ¿¾±ª» ·­ »¯«·ª¿´»²¬ ¬± º±´´±©·²¹ ¬©± ´·²»­

¿ ã ¿ ö ¾

½ ã ¼öö¿

Ú±®¬®¿²çë

ͱ«®½» ½±¼» ®»³¿®µ­

Í«³³¿®§

Ú±®¬®¿² çëñîððí ·­ � ¼»­°·¬» ·¬­ ´±²¹ ¸·­¬±®§ ó ¿ ³±¼»®²

°®±¹®¿³³·²¹ ´¿²¹«¿¹» »­°»½·¿´´§ º±® ­½·»²¬·º·½

½±³°«¬·²¹

� Ê»®­¿¬·´»ô ¯«·¬» »¿­§ ¬± ´»¿®²ô °±©»®º«´

ײ ±«® º·®­¬ »²½±«²¬»®ô ©» ¼·­½«­­»¼

� Ê¿®·¿¾´»­ ú ¼¿¬¿ ¬§°»­

� ݱ²¬®±´ ­¬®«½¬«®»­æ ´±±°­ ú ½±²¼·¬·±²¿´­

� Ñ°»®¿¬±®­

7

Page 8: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

8

Page 9: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

ÐßÎÌ ××æ ÚÑÎÌÎßÒ ßÎÎßÇÍ

Ñ«¬´·²»

Í·¹²·º·½¿²½» ±º Ú±®¬®¿² ¿®®¿§­

ß®®¿§ ­§²¬¿¨ ú ¿®®¿§ ­»½¬·±²­

ܧ²¿³·½ ³»³±®§ ¿´´±½¿¬·±²

ß®®¿§ ·²¬®·²­·½ º«²½¬·±²­

Í·¹²·º·½¿²½» ±º Ú±®¬®¿² ¿®®¿§­

Ú±®¬®¿² ¿®®¿§­ »²¿¾´» ¿ ²¿¬«®¿´ ¿²¼ ª»®­¿¬·´» ©¿§ ¬±

¿½½»­­ ³«´¬·ó¼·³»²­·±²¿´ ¼¿¬¿ ¼«®·²¹ ½±³°«¬¿¬·±²

� Ó¿¬®·½»­ô ª»½¬±®­ôòòò

� ß®®¿§ ¸¿­ °¿®¬·½«´¿® ¼¿¬¿ ¬§°» ø­¿³» º±® ¿´´ »´»³»²¬­÷

� Ü·³»²­·±² ­°»½·º·»¼ ·² ¬¸» ª¿®·¿¾´» ¼»½´¿®¿¬·±²

� Ú±®¬®¿² ­«°°±®¬­ «° ¬± é ¼·³»²­·±²¿´ ¿®®¿§­

ß®®¿§ ¼»½´¿®¿¬·±²

ײ¼»¨·²¹ ­¬¿®¬­ º®±³ ï ¾§ ¼»º¿«´¬

Ü·ºº»®»²¬ ·²¼»¨·²¹ ½¿² ¾» ¼»º·²»¼ ·² ¼»½´¿®¿¬·±²

×ÒÌÛÙÛÎô ÐßÎßÓÛÌÛÎ ææ Ó ã ïððô Ò ã ëðð

×ÒÌÛÙÛÎ ææ ·¼¨øÓ÷ô ´³­øóîæî÷

ÎÛßÔ ææ ³¿¬®·¨øÓô Ò÷

ÿ ±®

×ÒÌÛÙÛÎô Ü×ÓÛÒÍ×ÑÒøÓ÷ ææ ·¼¨ô ·¼¨îô ·¼¨í

ß®®¿§ ­§²¬¿¨

ײ ±´¼»® Ú±®¬®¿²ô ¿®®¿§­ ©»®» ¬®¿¼·¬·±²¿´´§ ¿½½»­­»¼

»´»³»²¬ó¾§ó»´»³»²¬ ¾¿­·­

Ó±¼»®² Ú±®¬®¿² ¸¿­ ¿ ©¿§ ±º ¿½½»­­·²¹ ­»ª»®¿´ »´»³»²¬­

·² ±²» ¹± ¿®®¿§ ­§²¬¿¨

§øæ÷ ã §øæ÷ õ ßøæ ô Ö÷ ö ¨øÖ÷

ß®®¿§ ­§²¬¿¨ °±¬»²¬·¿´´§ ·³°®±ª»­ ½±¼» ®»¿¼¿¾·´·¬§

ß®®¿§ ­§²¬¿¨ ³¿§ ¿´­± ¹·ª» ¬¸» Ú±®¬®¿² ½±³°·´»® ¿ ½¸¿²½»

º±® ¾»¬¬»® °»®º±®³¿²½» ±°¬·³·¦¿¬·±²

ß®®¿§ ­§²¬¿¨

ß®®¿§ ­§²¬¿¨ ¿´´±©­ º±® ´»­­ »¨°´·½·¬ ÜÑ ´±±°­

×ÒÌÛÙÛÎô ÐßÎßÓÛÌÛÎ ææ Ó ã ìô Ò ã ë

ÎÛßÔ øµ·²¼ ã è÷ ææ ßøÓôÒ÷ ô ¨øÒ÷ô §øÓ÷

×ÒÌÛÙÛÎ ææ × ô Ö

§øæ÷ ã ð

ÑËÌÛÎÁÔÑÑÐ æ ¼± Ö ã ïô Ò

×ÒÒÛÎÁÔÑÑÐ æ ¼± × ã ïô Ó

§øæ÷ ã §øæ÷ õ ßøæ ô Ö÷ ö ¨øÖ÷

»²¼ ¼± ×ÒÒÛÎÁÔÑÑÐ

»²¼ ¼± ÑËÌÛÎÁÔÑÑÐ

ß®®¿§ ­§²¬¿¨

Û´»³»²¬ó¾§ó»´»³»²¬ ·²·¬·¿´·¦¿¬·±²

Ë­·²¹ ¿®®¿§ ­§²¬¿¨ ·² ·²·¬·¿´·¦¿¬·±²

¼± ¶ ã ðô ïð

ª»½¬±® ø¶÷ ã ð

·¼¨ ø¶÷ ã ¶

»²¼ ¼±

ª»½¬±® ã ð

ÿ ±®

ª»½¬±®øæ÷ ã ð

·¼¨øðæïð÷ ã øñ ø¶ô ¶ ã ðô ïð÷ ñ÷

ß®®¿§ ­»½¬·±²­

É·¬¸ Ú±®¬®¿² ¿®®¿§ ­§²¬¿¨ ©» ½¿² ¿½½»­­ ¿ °¿®¬ ±º ¿²

¿®®¿§ ·² ¿ °®»¬¬§ ·²¬«·¬·ª» ©¿§æ ¿®®¿§ ­»½¬·±²­

Í»½¬·±²­ »²¿¾´» «­ ¬± ®»º»® ¬± ø­¿§÷ ¿ ­«¾ó¾´±½µ ±º ¿

³¿¬®·¨ô ±® ¿ ­«¾ó½«¾» ±º ¿ íÜó¿®®¿§æ

Í«¾ÁÊ»½¬±® ø íæÒõè÷ ã ð

Ûª»®§Á̸·®¼ ø ïæíöÒõï æ í ÷ ã ï

Ü·¿¹ÁÞ´±½µ ø ·�ïæ·õïô ¶�îæ¶õî ÷ ã µ

ÎÛßÔøµ·²¼ ã è÷ ææ ß ø ïðððô ïððð÷

×ÒÌÛÙÛÎ øµ·²¼ ã î÷ ææ °·¨»´ÁíÜøîëêô îëêô îëê÷

ßøîæëððô íæíððæí÷ ã ìòð

°·¨»´ÁíÜ øïîèæïëðô ëêæèðô ïæîëêæè÷ ã íîððð

9

Page 10: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

ß®®¿§ ­»½¬·±²­

Þ» ¿©¿®» ±ºæ ©¸»² ½±°§·²¹ ¿®®¿§ ­»½¬·±²­ô ¬¸»² ¾±¬¸ ´»º¬

¿²¼ ®·¹¸¬ ¸¿²¼ ­·¼»­ ±º ¬¸» ¿­­·¹²³»²¬ ­¬¿¬»³»²¬ ¸¿­ ¬±

¸¿ª» ½±²º±®³·²¹ ¼·³»²­·±²­ æ

ÔØÍøïæíô ðæç÷ ã ÎØÍøóîæðô îðæîç÷ ÿ ̸·­ ·­ ÑÕ

ÿ ¾«¬ ¸»®» ·­ ¿² »®®±® æ

ÔØÍøïæîô ðæç÷ ã ÎØÍøóîæðô îðæîç÷

ܧ²¿³·½ ³»³±®§ ¿´´±½¿¬·±²

ͱ º¿® ·² ±«® »¨¿³°´»­ ¬¸» ¿®®¿§ ¼·³»²­·±²­ ¸¿ª» ¾»»²

¼»½´¿®»¼ ¿¬ ½±³°·´» ¬·³»æ

� ³»³±®§ ¿´´±½¿¬·±² ·­ ­¬¿¬·½

׺ ¿² ¿®®¿§ ­·¦» ¼»°»²¼­ ±² ¬¸» ·²°«¬ ¬± °®±¹®¿³ô ·¬­

³»³±®§ ­¸±«´¼ ¾» ¿´´±½¿¬»¼ ¿¬ ®«²¬·³»æ

� ³»³±®§ ¿´´±½¿¬·±² ¾»½±³»­ ¼§²¿³·½

ܧ²¿³·½ ³»³±®§ ¿´´±½¿¬·±²

Ú±®¬®¿² °®±ª·¼»­ ¬©± ¼·ºº»®»²¬ ³»½¸¿²·­³­ ¬± ¿´´±½¿¬»

³»³±®§ ¼§²¿³·½¿´´§ ¬¸®±«¹¸ ¿®®¿§­æ

� ß®®¿§ ª¿®·¿¾´» ¼»½´¿®¿¬·±² ¸¿­ ¿² ßÔÔÑÝßÌßÞÔÛ ø±® ¿

ÐÑ×ÒÌÛÎ÷ ¿¬¬®·¾«¬»ô ¿²¼ ³»³±®§ ·­ ¿´´±½¿¬»¼ ¬¸®±«¹¸ ¬¸»

ßÔÔÑÝßÌÛ ­¬¿¬»³»²¬ô ¿²¼ º®»»¼ ¬¸®±«¹¸ ÜÛßÔÔÑÝßÌÛ

� ß ª¿®·¿¾´»ô ©¸·½¸ ·­ ¼»½´¿®»¼ ·² ¬¸» °®±½»¼«®» ©·¬¸ ­·¦»

·²º±®³¿¬·±² ½±³·²¹ º®±³ ¬¸» ¿®¹«³»²¬ ́ ·­¬ ±® º®±³ ¿

³±¼«´»ô ·­ ¿² ¿«¬±³¿¬·½ ¿®®¿§ ó ²± ßÔÔÑÝßÌÛ ·­ ²»»¼»¼ô

²»·¬¸»® ÜÛßÔÔÑÝßÌÛ

ܧ²¿³·½ ³»³±®§ ¿´´±½¿¬·±²

×ÒÌÛÙÛÎ ææ Óô Òô ¿´´±½Á­¬¿¬

×ÒÌÛÙÛÎô ßÔÔÑÝßÌßÞÔÛ ææ ·¼¨øæ÷

ÎÛßÔøµ·²¼ ã è÷ô ßÔÔÑÝßÌßÞÔÛ ææ ³¿¬øæôæ÷

Ó ã ïðð

Ò ã îðð

ßÔÔÑÝßÌÛ ø ·¼¨ øðæÓ�ï÷ ô ÍÌßÌã¿´´±½Á­¬¿¬ ÷

×Ú ø¿´´±½Á­¬¿¬ ñã ð÷ ÝßÔÔ ¿¾±®¬ø÷

ßÔÔÑÝßÌÛ ø ³¿¬ øÓôÒ÷ ô ÍÌßÌã¿´´±½Á­¬¿¬ ÷

×Ú ø¿´´±½Á­¬¿¬ ñã ð÷ ÝßÔÔ ¿¾±®¬ø÷

òòò

ÜÛßÔÔÑÝßÌÛ ø·¼¨ ô ³¿¬÷ д»¿­» ¼± ®»³»³¾»® ¿ ÜÛßÔÔÑÝßÌÛ

º±® »ª»®§ ßÔÔÑÝßÌÛ ­¬¿¬»³»²¬ «­»¼ ÿÿ

Ó»³±®§ ¿´´±½¿¬·±² ©·¬¸ ¿«¬±³¿¬·½ ¿®®¿§­

ÍËÞÎÑËÌ×ÒÛ ÝßÔÝËÔßÌÛøÓô Ò÷

×ÒÌÛÙÛÎô ×ÒÌÛÒÌø×Ò÷ ææ Óô Ò ÿ ײ¬»²¼»¼ ¼·³»²­·±²­ ±º ¬¸» ¿®®¿§­

×ÒÌÛÙÛÎ ææ ·¼¨øðæÓóï÷ ÿ ß² ¿«¬±³¿¬·½ ¿®®¿§

ÎÛßÔøµ·²¼ ã è÷ ææ ³¿¬øÓôÒ÷ ÿ ß² ¿«¬±³¿¬·½ ¿®®¿§

ÿ Ò± »¨°´·½·¬ ßÔÔÑÝßÌÛ � ¾«¬ ²± ½¸»½µ­ «°±² º¿·´«®» »·¬¸»®

ÿ Ë­» ·¼¨ ú ³¿¬ ¿«¬±³¿¬·½ ¿®®¿§­ ¸»®»

ÝßÔÔ ÜÑÁÍÑÓÛÌØ×ÒÙøÓô Òô ·¼¨ô ³¿¬÷

ÿ Ò± »¨°´·½·¬ ÜÛßÔÔÑÝßÌÛ ó ³»³±®§ ¹»¬­ ®»½´¿·³»¼ ¿«¬±³¿¬·½¿´´§

ÛÒÜ ÍËÞÎÑËÌ×ÒÛ ÝßÔÝËÔßÌÛ

ß®®¿§ ·²¬®·²­·½ º«²½¬·±²­

Þ«·´¬ó·² º«²½¬·±²­ ½¿² ¿°°´§ ª¿®·±«­ ±°»®¿¬·±²­ ±² ©¸±´»

¿®®¿§ô ²±¬ ¶«­¬ ¿®®¿§ »´»³»²¬­

ß­ ¿ ®»­«´¬ »·¬¸»® ¿²±¬¸»® ¿®®¿§ ±® ¶«­¬ ¿ ­½¿´¿® ª¿´«» ·­

®»¬«®²»¼

ß ­«¾­»¬ ­»´»½¬·±² ¬¸®±«¹¸ ³¿­µ·²¹ ·­ °±­­·¾´»

� Ó¿­µ·²¹ ¿²¼ «­» ±º ¿®®¿§ ø·²¬®·²­·½÷ º«²½¬·±²­ ·­ ±º¬»²

¿½½±³°¿²·»¼ ©·¬¸ «­» ±º ÚÑÎßÔÔ ¿²¼ ÉØÛÎÛ ¿®®¿§

­¬¿¬»³»²¬­

ß®®¿§ ·²¬®·²­·½ º«²½¬·±²­

Í×ÆÛ ø¿®®¿§ Åô ¼·³Ã÷ ®»¬«®²­ ý ±º »´»³»²¬­ ·² ¬¸» ¿®®¿§ô

±°¬·±²¿´´§ ¿´±²¹ ¬¸» ­°»½·º·»¼ ¼·³»²­·±²

ÍØßÐÛ ø¿®®¿§÷ ®»¬«®²­ ¿² ×ÒÌÛÙÛÎ ª»½¬±® ½±²¬¿·²·²¹ Í×ÆÛ

±º ¿®®¿§ ©·¬¸ ®»­°»½¬ ¬± »¿½¸ ±º ·¬­ ¼·³»²­·±²

ÝÑËÒÌ øÔÁ¿®®¿§ Åô¼·³Ã÷ ®»¬«®²­ ¬¸» ½±«²¬ ±º »´»³»²¬­

©¸·½¸ ¿®» òÌÎËÛò ·² ¬¸» ÔÑÙ×ÝßÔ ÔÁ¿®®¿§

ÍËÓ ø¿®®¿§Åô ¼·³ÃÅô ³¿­µÃ÷ æ ­«³ ±º ¬¸» »´»³»²¬­ô

±°¬·±²¿´´§ ¿´±²¹ ¿ ¼·³»²­·±²ô ¿²¼ ±°¬·±²¿´´§ «²¼»® ³¿­µ

ß®®¿§ ·²¬®·²­·½ º«²½¬·±²­

ßÒÇ øÔÁ¿®®¿§ Åô ¼·³Ã÷ ®»¬«®²­ ¿ ­½¿´¿® ª¿´«» ±º òÌÎËÛò ·º

¿²§ ª¿´«» ·² ÔÑÙ×ÝßÔ ÔÁ¿®®¿§ ·­ º±«²¼ ¬± ¾» òÌÎËÛò

ßÔÔ øÔÁ¿®®¿§ Åô ¼·³Ã÷ ®»¬«®²­ ¿ ­½¿´¿® ª¿´«» ±º òÌÎËÛò ·º ¿´´

ª¿´«»­ ·² ÔÑÙ×ÝßÔ ÔÁ¿®®¿§ ¿®» òÌÎËÛò

Ó×ÒÊßÔ ñÓßÈÊßÔ ø¿®®¿§ Åô¼·³Ã Åô ³¿­µÃ÷ ®»¬«®² ¬¸»

³·²·³«³ñ³¿¨·³«³ ª¿´«» ·² ¿ ¹·ª»² ¿®®¿§ Å¿´±²¹

­°»½·º·»¼ ¼·³»²­·±²Ã Åô «²¼»® ³¿­µÃ

Ó×ÒÔÑÝñÓßÈÔÑÝ ø¿®®¿§ Åô ³¿­µÃ÷ ®»¬«®² ¿ ª»½¬±® ±º

´±½¿¬·±²ø­÷ Åô «²¼»® ³¿­µÃô ©¸»®» ¬¸»

³·²·³«³ñ³¿¨·³«³ ª¿´«»ø­÷ ·­ñ¿®» º±«²¼

10

Page 11: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

ß®®¿§ ·²¬®·²­·½ º«²½¬·±²­

×ÒÌÛÙÛÎ ææ Óô Ò

ÎÛßÔ ææ ÈøÓôÒ÷ô ÊøÒ÷

ÐÎ×ÒÌ öôÍ×ÆÛøÈ÷ô Í×ÆÛøÊ÷ ÿ Óô Òô

Ò

ÐÎ×ÒÌ öôÍØßÐÛøÈ÷ ÿ Óô Ò

ÐÎ×ÒÌ öôÍ×ÆÛøÍØßÐÛøÈ÷÷ ÿ î

ÐÎ×ÒÌ öôÝÑËÒÌøÈ âã ð÷

ÐÎ×ÒÌ öôÍËÓøÈô Ü×Óãîô ÓßÍÕãÈ ä ï÷ÐÎ×ÒÌ öôßÒÇøÊ â óï ò¿²¼ò Ê ä ï÷

ÐÎ×ÒÌ öôßÔÔøÈ âã ðô Ü×Óãï÷

ÐÎ×ÒÌ öôÓ×ÒÊßÔøÊ÷ô ÓßÈÊßÔøÊ÷

ÐÎ×ÒÌ öôÓ×ÒÔÑÝøÊ÷ô ÓßÈÔÑÝøÊ÷

ß®®¿§ ·²¬®·²­·½ º«²½¬·±²­

ÎÛÍØßÐÛ ø¿®®¿§ô ­¸¿°»÷ ®»¬«®²­ ¿ ®»½±²­¬®«½¬»¼ ¿®®¿§

©·¬¸ ¼·ºº»®»²¬ ­¸¿°» ¬¸¿² ·² ¬¸» ·²°«¬ ¿®®¿§ô º±® »¨¿³°´»æ

� Ý¿² ¾» «­»¼ ¿­ ¿ ­·²¹´» ´·²» ­¬¿¬»³»²¬ ¬± ·²·¬·¿´·¦» ¿² ¿®®¿§

ø±º¬»² ·² »¨°»²­» ±º ®»¿¼¿¾·´·¬§÷

� Ý®»¿¬» º®±³ ¿² Óó¾§óÒ ³¿¬®·¨ ¿ ª»½¬±® ±º ´»²¹¬¸ Ó¨Ò

×ÒÌÛÙÛÎ ææ Óô Ò

ÎÛßÔ ææ ßøÓô Ò÷ô ÊøÓöÒ÷

ÿ �Ý¿®¾±²�ó½±°§ ß ¬± Ê ©·¬¸±«¬ ´±±°­

Ê ã ÎÛÍØßÐÛøßô ÍØßÐÛøÊ÷÷

ß®®¿§ ·²¬®·²­·½ º«²½¬·±²­

ͱ³» ¿®®¿§ º«²½¬·±²­ ³¿²·°«´¿¬» ª»½¬±®­ñ³¿¬®·½»­ »ºº»½¬·ª»´§ æ

� ÜÑÌÁÐÎÑÜËÝÌ ø¿ô ¾÷ ®»¬«®²­ ¿ ¼±¬ °®±¼«½¬ ±º ¬©± ª»½¬±®­

� ÓßÌÓËÔ ø¿ô ¾÷ ®»¬«®²­ ³¿¬®·¨ ³«´¬·°´§ ±º ¬©± ³¿¬®·½»­

� ÌÎßÒÍÐÑÍÛ ø¿÷ ®»¬«®²­ ¬®¿²­°±­»¼ ±º ¬¸» ·²°«¬ ³¿¬®·¨

×ÒÌÛÙÛÎ ææ Ôô Óô Ò

ÎÛßÔ ææ ßøÔôÓ÷ô ÞøÓôÒ÷ô ÝøÔôÒ÷

ÎÛßÔ ææ ßÁ¬®øÓôÔ÷

ÎÛßÔ ææ ÊïøÒ÷ô ÊîøÒ÷ô ÜÑÌÐ

ßÁ¬® ã ÌÎßÒÍÐÑÍÛøß÷

Ý ã ÓßÌÓËÔøßô Þ÷

ÜÑÌÐ ã ÜÑÌÁÐÎÑÜËÝÌøÊïô Êî÷

ß®®¿§ ·²¬®·²­·½ º«²½¬·±²­

ß®®¿§ ½±²¬®±´ ­¬¿¬»³»²¬­ ÚÑÎßÔÔ ¿²¼ ÉØÛÎÛ ¿®»

½±³³±²´§ «­»¼ ·² ¬¸» ½±²¬»¨¬ ±º ³¿²·°«´¿¬·²¹ ¿®®¿§­

� ̸»­» ¿®» º®¿²µ´§ ­°»¿µ·²¹ ²±¬ ¿®®¿§ ·²¬®·²­·½ º«²½¬·±²­ô

¾«¬ ª»®§ ½´±­»´§ ®»´¿¬»¼ ¬±

̸»§ ½¿² °®±ª·¼» ¿ ³¿­µ»¼ ¿­­·¹²³»²¬ ±º ª¿´«»­ «­·²¹

»ºº»½¬·ª» ª»½¬±® ±°»®¿¬·±²­

Û¨¿³°´»­ ±º ¿®®¿§ ½±²¬®±´ ­¬¿¬»³»²¬­

×ÒÌÛÙÛÎ ææ ¶

ÎÛßÔ ææ ¿øïððôïðð÷ô ¾øïðð÷ô ½øïðð÷

ÿ Ú·´´ ·² ¼·¿¹±²¿´ ³¿¬®·¨

ÚÑÎßÔÔ ø¶ãïæïðð÷ ¿ø¶ô¶÷ ã ¾ø¶÷

ÿ Ú·´´ ·² ´±©»® ¾·ó¼·¿¹±²¿´ ³¿¬®·¨

ÚÑÎßÔÔ ø¶ãîæïðð÷ ¿ø¶ô¶óï÷ ã ½ø¶÷

ß®®¿§ ·²¬®·²­·½ º«²½¬·±²­

×ÒÌÛÙÛÎ ææ ¶ô ·¨øë÷

·¨øæ÷ ã øñ ø¶ô ¶ãïô­·¦»ø·¨÷÷ ñ÷

ÉØÛÎÛ ø·¨ ãã ð÷ ·¨ ã óçççç

ÉØÛÎÛ ø·¨ ä ð÷

·¨ ã ó·¨

ÛÔÍÛÉØÛÎÛ

·¨ ã ð

ÛÒÜ ÉØÛÎÛ

Í«³³¿®§

ß®®¿§­ ³¿µ» Ú±®¬®¿² ´¿²¹«¿¹» ¿ ª»®§ ª»®­¿¬·´» ª»¸·½´» º±®

½±³°«¬¿¬·±²¿´´§ ·²¬»²­·ª» °®±¹®¿³ ¼»ª»´±°³»²¬

Ë­·²¹ ·¬­ ¿®®¿§ ­§²¬¿¨ô ª»½¬±®­ ¿²¼ ³¿¬®·½»­ ½¿² ¾»

·²·¬·¿´·¦»¼ ¿²¼ «­»¼ ·² ¿ ª»®§ ·²¬«·¬·ª» ©¿§

ܧ²¿³·½ ³»³±®§ ¿´´±½¿¬·±² »²¿¾´»­ ­·¦·²¹ ±º ¿®®¿§­

¿½½±®¼·²¹ ¬± °¿®¬·½«´¿® ²»»¼­

ß®®¿§ ·²¬®·²­·½ º«²½¬·±²­ º«®¬¸»® ­·³°´·º§ ½±¼·²¹ »ºº±®¬

¿²¼ ·³°®±ª» ½±¼» ®»¿¼¿¾·´·¬§

11

Page 12: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

12

Page 13: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

ÐßÎÌ ×××æ ÐÎÑÝÛÜËÎÛÍ ú ÓÑÜËÔÛÍ

Ñ«¬´·²»

ͬ®«½¬«®»¼ °®±¹®¿³³·²¹

Ю±½»¼«®»­æ º«²½¬·±²­ ¿²¼ ­«¾®±«¬·²»­

Ю±½»¼«®» ¿®¹«³»²¬­

Ó±¼«´»­

ͬ®«½¬«®»¼ °®±¹®¿³³·²¹

ͬ®«½¬«®»¼ °®±¹®¿³³·²¹ ¾¿­»¼ ±² °®±¹®¿³ ­«¾ó«²·¬­

øº«²½¬·±²­ô ­«¾®±«¬·²»­ ¿²¼ ³±¼«´»­÷ »²¿¾´»­

� ¬»­¬·²¹ ¿²¼ ¼»¾«¹¹·²¹ ­»°¿®¿¬»´§

� ®»ó«­» ±º ½±¼»

� ·³°®±ª»¼ ®»¿¼¿¾·´·¬§

� ®»ó±½½«®®·²¹ ¬¿­µ­

ɸ¿¬ ¿®» °®±½»¼«®»­á

É·¬¸ °®±½»¼«®»­ ©» ³»¿² ­«¾®±«¬·²»­ ¿²¼ º«²½¬·±²­

Í«¾®±«¬·²»­ »¨½¸¿²¹» ¼¿¬¿ ¬¸®±«¹¸ ·¬­ ¿®¹«³»²¬ ´·­¬­

±²´§

Ú«²½¬·±²­ ®»¬«®² ¿ ª¿´«» ¿½½±®¼·²¹ ¬± ·¬­ ¼»½´¿®»¼ ¼¿¬¿

¬§°»

Ю±½»¼«®» ¬§°»­

ײ¬»®²¿´ô »¨¬»®²¿´ô ¿²¼ ³±¼«´» °®±½»¼«®»­

� ײ¬»®²¿´ °®±½»¼«®»æ ©·¬¸·² ¬¸» °®±¹®¿³ ­¬®«½¬«®»

� Û¨¬»®²¿´ °®±½»¼«®»æ ·²¼»°»²¼»²¬´§ ¼»½´¿®»¼ô ³¿§ ¾» ±²

±¬¸»® ´¿²¹«¿¹»

� Ó±¼«´» °®±½»¼«®»æ ¼»º·²»¼ ·² ¿ ³±¼«´»

ײ¬»®²¿´ ¿²¼ ³±¼«´» °®±½»¼«®»­ °®±ª·¼» ¿ ¼»º·²»¼

·²¬»®º¿½»ô ½±³°·´»® «­»­ ¬¸·­ ¬± ½¸»½µ ¿®¹«³»²¬­

Ò± ¬§°» ½±²ª»®­·±²­ ©·´´ ±½½«® ¼«®·²¹ ¬¸» °®±½»¼«®» ½¿´´æ

¬¸» ¼¿¬¿ ¬§°» ±º ¿² ¿®¹«³»²¬ ±² ¬¸» ½¿´´ ­·¬» ¿²¼ ·² ¬¸»

°®±½»¼«®» ³«­¬ ³¿¬½¸

Ю±¹®¿³ «²·¬­

Ó±¼«´» °®±½»¼«®»­ ײ¬»®²¿´ °®±½»¼«®»­

Ó±¼«´»­Ó¿·² °®±¹®¿³

Û¨¬»®²¿´

°®±½»¼«®»­

Ü»½´¿®¿¬·±²

Ú«²½¬·±²

ÅÌÇÐÛà ÚËÒÝÌ×ÑÒ º«²½øßÎÙÍ÷

ÅÎÛÍËÔÌø¿®¹÷Ã

ż»½´¿®¿¬·±²­Ã

Å­¬¿¬»³»²¬­Ã

ÛÒÜ ÚËÒÝÌ×ÑÒ º«²½

Ý¿´´ ½±²ª»²¬·±²®»­ ã º«²½øßÎÙÍ÷

Í«¾®±«¬·²»

ÍËÞÎÑËÌ×ÒÛ ­«¾ø¿®¹«³»²¬­÷

ż»½´¿®¿¬·±²­Ã

Å­¬¿¬»³»²¬­Ã

ÛÒÜ ÍËÞÎÑËÌ×ÒÛ ­«¾

Ý¿´´ ½±²ª»²¬·±²ÝßÔÔ ­«¾ø¿®¹«³»²¬­÷

×ÒÌÛÙÛÎ ÚËÒÝÌ×ÑÒ ¬»­¬ø­÷

×ÓÐÔ×Ý×Ì ÒÑÒÛ

×ÒÌÛÙÛÎ ææ ­

¬»­¬ãïðö­

ÛÒÜ ÚËÒÝÌ×ÑÒ ¬»­¬

ÐÎÑÙÎßÓ ¼±Á­±³»¬¸·²¹

òòò

®»­«´¬ã¬»­¬ø­÷

òòò

ÍËÞÎÑËÌ×ÒÛ ¬»­¬ø­ô¬»­¬÷

×ÓÐÔ×Ý×Ì ÒÑÒÛ

×ÒÌÛÙÛÎ ææ ­ô ¬»­¬

¬»­¬ãïðö­

ÛÒÜ ÍËÞÎÑËÌ×ÒÛ ¬»­¬

ÐÎÑÙÎßÓ ¼±Á­±³»¬¸·²¹

òòò

½¿´´ ¬»­¬ø­ô®»­«´¬÷

òòò

Ü»½´¿®¿¬·±²

Page 14: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

ײ¬»®²¿´ °®±½»¼«®»­

Û¿½¸ °®±¹®¿³ «²·¬ ø°®±¹®¿³ñ­«¾®±«¬·²»ñº«²½¬·±²÷ ³¿§

½±²¬¿·² ·²¬»®²¿´ °®±½»¼«®»­

Ü»½´¿®»¼ ¿¬ ¬¸» »²¼ ±º ¿ °®±¹®¿³ «²·¬ ¿º¬»® ¬¸»

ÝÑÒÌß×ÒÍ ­¬¿¬»³»²¬

� Ò»­¬»¼ ÝÑÒÌß×ÒÍ ­¬¿¬»³»²¬­ ²±¬ ¿´´±©»¼

ײ¸»®·¬­ ª¿®·¿¾´»­ ¿²¼ ±¾¶»½¬­ º®±³ ¬¸» °®±¹®¿³ «²·¬

Û¨¬»®²¿´ °®±½»¼«®»­

Ü»½´¿®»¼ ·² ¿ ­»°¿®¿¬» °®±¹®¿³ «²·¬

� λº»®®»¼ ¬± ©·¬¸ ¬¸» ÛÈÌÛÎÒßÔ µ»§©±®¼

� Ø¿ª» ¬± ¾» ½±³°·´»¼ ­»°¿®¿¬»´§ ¿²¼ ´·²µ»¼

ܱ ²±¬ «­» ¬¸»³ ©·¬¸·² ¿ °®±¹®¿³æ ³±¼«´»­ ¿®» ³«½¸

»¿­·»® ¿²¼ ³±®» ®±¾«­¬

Û¨¬»®²¿´ °®±½»¼«®»­ ²»»¼»¼ ©¸»² «­·²¹

� °®±½»¼«®»­ ©®·¬¬»² ©·¬¸ ¼·ºº»®»²¬ °®±¹®¿³³·²¹ ´¿²¹«¿¹»

� ´·¾®¿®§ ®±«¬·²»­ ø»ò¹ò ÞÔßÍ÷

Ю±½»¼«®» ¿®¹«³»²¬­

Ý¿´´ ¾§ ®»º»®»²½»æ ¿²§ ½¸¿²¹» ¬± ¿®¹«³»²¬�­ ª¿´«»

½¸¿²¹»­ ¬¸» ¿½¬«¿´ ¿®¹«³»²¬

Þ»¸¿ª·±® ±º ¬¸» ¿®¹«³»²¬­ ½¿² ¾» ½±²¬®±´´»¼ ©·¬¸ ¬¸»

×ÒÌÛÒÌ µ»§©±®¼

ݱ³°·´»® ½¸»½µ­ ¬¸» ¿®¹«³»²¬­ ·º ¬¸» ·²¬»®º¿½» ±º

°®±½»¼«®» ·­ µ²±©² ¿¬ ½±³°·´¿¬·±² ¬·³» ø·² ·²¬»®²¿´ ¿²¼

³±¼«´» °®±½»¼«®»­÷

� Ú±® »¨¬»®²¿´ ®±«¬·²»­ ·¬ ½¿² ¾» ¼»½´¿®»¼ ©·¬¸ ¬¸»

×ÒÌÛÎÚßÝÛ ¾´±½µ

×ÒÌÛÒÌ µ»§©±®¼

Ü»½´¿®»­ ¸±© º±®³¿´

¿®¹«³»²¬ ·­ ·²¬»²¼»¼ º±®

¬®¿²­º»®®·²¹ ¿ ª¿´«»

� ·²

� ±«¬

� ·²±«¬ ø¼»º¿«´¬÷

ݱ³°·´»® «­»­ ×ÒÌÛÒÌ º±®

»®®±® ½¸»½µ·²¹ ¿²¼

±°¬·³·¦¿¬·±²

ÍËÞÎÑËÌ×ÒÛ º±±ø¨ô§ô¦÷

×ÓÐÔ×Ý×Ì ÒÑÒÛ

ÎÛßÔô×ÒÌÛÒÌø·²÷ ææ ¨

ÎÛßÔô×ÒÌÛÒÌø·²±«¬÷ ææ §

ÎÛßÔô×ÒÌÛÒÌø±«¬÷ææ ¦

¨ãïð ÿ ݱ³°·´¿¬·±² »®®±®

§ãïð ÿ ݱ®®»½¬

¦ã§ö¨ ÿ ݱ®®»½¬

ÛÒÜ ÍËÞÎÑËÌ×ÒÛ º±±

Ю±½»¼«®» ¿®¹«³»²¬­

É» ³¿§ °¿­­ ·²¬±

°®±½»¼«®»­ ¿´­± ±¬¸»®

°®±½»¼«®»­ ø·ò»òô ²±¬ ±²´§

¼¿¬¿÷

ײ¬»®²¿´ °®±½»¼«®»­

½¿²²±¬ ¾» «­»¼ ¿­

¿®¹«³»²¬­

ÐÎÑÙÎßÓ ¼»¹¬»­¬

×ÓÐÔ×Ý×Ì ÒÑÒÛ

×ÒÌÎ×ÒÍ×Ý ßÍ×Òô ßÝÑÍô ßÌßÒ

ÉÎ×ÌÛ øöôö÷ �¿®½­·²øðòë÷æ �ô ¼»¹øßÍ×Òôðòë÷

ÉÎ×ÌÛ øöôö÷ �¿®½½±­øðòë÷æ �ô ¼»¹øßÝÑÍôðòë÷

ÉÎ×ÌÛ øöôö÷ �¿®½¬¿²øïòð÷æ �ô ¼»¹øßÌßÒôïòð÷

ÝÑÒÌß×ÒÍ

ÎÛßÔ ÚËÒÝÌ×ÑÒ ¼»¹øºô ¨÷

×ÓÐÔ×Ý×Ì ÒÑÒÛ

×ÒÌÎ×ÒÍ×Ý ßÌßÒ

ÎÛßÔô ÛÈÌÛÎÒßÔ ææ º

ÎÛßÔô ×ÒÌÛÒÌø×Ò÷ ææ ¨

¼»¹ ã ìëöºø¨÷ñßÌßÒøïòð÷

ÛÒÜ ÚËÒÝÌ×ÑÒ ¼»¹

ÛÒÜ ÐÎÑÙÎßÓ ¼»¹¬»­¬

п­­·²¹ ¿®®¿§ ¿®¹«³»²¬­

Ì©± ©¿§­ ¬± °¿­­ ¿®®¿§­ ¬± °®±½»¼«®»­

� Û¨°´·½·¬ ­¸¿°» ¿®®¿§ ø¼·³»²­·±²­ °¿­­»¼ »¨°´·½·¬´§÷­«¾®±«¬·²» º±±ø­·¦»ïô ­·¦»îô òòòô ³¿¬®·¨ô òòò÷

òòò

®»¿´ô ¼·³»²­·±²ø­·¦»ïô­·¦»î÷ ææ ³¿¬®·¨

� ß­­«³»¼ ø·³°´·½·¬÷ ­¸¿°» ¿®®¿§®»¿´ô ¼·³»²­·±²øæôæ÷ ææ ³¿¬®·¨

ײ¬»®º¿½» ¼»º·²·¬·±²

׬ ·­ ¿ ¹±±¼ °®¿½¬·½» ¬±

¼»º·²» ¬¸» ·²¬»®º¿½»­

º±® »¨¬»®²¿´

°®±½»¼«®»­

� Û²¿¾´»­ ½±³°·´¿¬·±²

¬·³» »®®±® ½¸»½µ·²¹

̸» ×ÒÌÛÎÚßÝÛ ¾´±½µ

½¿² ¾» ¿´­± «­»¼ º±®

¼»º·²·²¹ ­½ò ¹»²»®·½

°®±½»®«¼»­

ÍËÞÎÑËÌ×ÒÛ ²¿¹Á®¿²¼ø¬¿¾´»÷

×ÒÌÛÎÚßÝÛ

ÍËÞÎÑËÌ×ÒÛ ¹ð뺿ºø¿ô ¾ô ²ô ¨÷

ÎÛßÔô ×ÒÌÛÒÌø×Ò÷ ææ ¿

ÎÛßÔô ×ÒÌÛÒÌø×Ò÷ ææ ¾

×ÒÌÛÙÛÎô ×ÒÌÛÒÌø×Ò÷ ææ ²

ÎÛßÔô ×ÒÌÛÒÌøÑËÌ÷ô Ü×ÓÛÒÍ×ÑÒø²÷ ææ ¨

ÛÒÜ ÍËÞÎÑËÌ×ÒÛ ¹ð뺿º

ÛÒÜ ×ÒÌÛÎÚßÝÛ

ÎÛßÔô Ü×ÓÛÒÍ×ÑÒøæ÷ô ×ÒÌÛÒÌøÑËÌ÷ ææ ¬¿¾´»

ÝßÔÔ ¹ð뺿ºøóïòðô ïòðô Í×ÆÛø¬¿¾´»÷ô ¬¿¾´»÷

ÛÒÜ ÍËÞÎÑËÌ×ÒÛ ²¿¹Á®¿²¼

Ü»º·²·²¹ ¿² ·²¬»®º¿½» º±® ¬¸» ¹ð뺿º

­«¾®±«¬·²» ±º ¬¸» ÒßÙ ´·¾®¿®§

ø¹»²»®¿¬»­ ¿ ­»¬ ±º ®¿²¼±³ ²«³¾»®­÷

Ó±¼«´¿® °®±¹®¿³³·²¹

Ó±¼«´¿®·¬§ ³»¿²­ ¼·ª·¼·²¹ ¿ °®±¹®¿³ ·²¬± ­³¿´´

³·²·³¿´´§ ¼»°»²¼»²¬ ³±¼«´»­

ß¼ª¿²¬¿¹»­

� ݱ²­¬¿²¬­ô ª¿®·¿¾´»­ô ¼¿¬¿ ¬§°»­ ¿²¼ °®±½»¼«®»­ ½¿² ¾»

¼»º·²»¼ ·² ³±¼«´»­

� Ó¿µ»­ ·¬ °±­­·¾´» ¬± ¼·ª·¼» °®±¹®¿³ ·²¬± ­³¿´´»® ­»´ºó

½±²¬¿·²»¼ «²·¬­

Page 15: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

Ë­»º«´²»­­ ±º Ú±®¬®¿² ³±¼«´»­

Ù´±¾¿´ ¼»º·²·¬·±²­

� ̸» ­¿³» °®±½»¼«®»­ ¿²¼ ¼¿¬¿ ¬§°»­ ¿ª¿·´¿¾´» ·² ¼·ºº»®»²¬

°®±¹®¿³ «²·¬­

ݱ³°·´»ó¬·³» »®®±® ½¸»½µ­

Ø·¼» ·³°´»³»²¬¿¬·±² ¼»¬¿·´­ ø±¾¶»½¬ ±®·»²¬»¼

°®±¹®¿³³·²¹÷

Ù®±«° ®±«¬·²»­ ¿²¼ ¼¿¬¿ ­¬®«½¬«®»­

Ü»º·²» ¹»²»®·½ °®±½»¼«®»­ ¿²¼ ½«­¬±³ ±°»®¿¬±®­

Ó±¼«´» °®±½»¼«®»­

Ю±½»¼«®»­ ¼»º·²»¼ ·² ³±¼«´»­ ½¿² ¾» «­»¼ ·² ¿²§ ±¬¸»®

°®±¹®¿³ «²·¬

д¿½·²¹ °®±½»¼«®»­ ·² ³±¼«´»­ ¸»´°­ ½±³°·´»® ¬± ¼»¬»½¬

°®±¹®¿³³·²¹ »®®±®­ ¿²¼ ¬± ±°¬·³·¦» ¬¸» ½±¼»

Ó±¼«´» °®±½»¼«®»­ ¿®» ¼»½´¿®»¼ ¿º¬»® ¬¸» ÝÑÒÌß×ÒÍ

­¬¿¬»³»²¬

Ë­·²¹ ³±¼«´»­

Ü»½´¿®¿¬·±²

ÓÑÜËÔÛ ½¸»½µ

×ÓÐÔ×Ý×Ì ÒÑÒÛ

×ÒÌÛÙÛÎô ÐßÎßÓÛÌÛÎ ææ ú

·²¬° ã ÍÛÔÛÝÌÛÜÁ×ÒÌÁÕ×ÒÜøè÷

ÝÑÒÌß×ÒÍ

ÚËÒÝÌ×ÑÒ ½¸»½µÁ¬¸·­ø¨÷ ÎÛÍËÔÌø¦÷

×ÒÌÛÙÛÎø·²¬°÷ææ ¨ô ¦

òòò

ÛÒÜ ÚËÒÝÌ×ÑÒ

ÛÒÜ ÓÑÜËÔÛ ½¸»½µ

Ë­¿¹»

ÐÎÑÙÎßÓ ¬»­¬°®±¹

ËÍÛ ½¸»½µ

×ÓÐÔ×Ý×Ì ÒÑÒÛ

×ÒÌÛÙÛÎøÕ×ÒÜã·²¬°÷ ææ ¨ô¬»­¬

¬»­¬ã½¸»½µÁ¬¸·­ø¨÷

ÛÒÜ ÐÎÑÙÎßÓ ¬»­¬°®±¹

ß ¹±±¼ ¸¿¾·¬ËÍÛ ¿½½«®¿½§ô ÑÒÔÇæ ®»¿´°

ݱ³³±² ª¿®·¿¾´»­ ©·¬¸ ³±¼«´»­

ײ ³¿²§ Ú±®¬®¿² éé ½±¼»­ô ­± ½¿´´»¼ ½±³³±² ¾´±½µ­ ¿®»

«­»¼

� λº»®»²½»¼ ¿²¼ñ±® ³±¼·º·»¼ ¿²§©¸»®» ·² ¬¸» °®±¹®¿³ÝÑÓÓÑÒñÛÏñÒôÒÌÑÌ

ÝÑÓÓÑÒñÌÑÔñßÞÍÌÑÔôÎÛÔÌÑÔ

̸» Ú±®¬®¿² çëñîððí ©¿§ ¬± ¼± ·¬ ·­ ©·¬¸ ³±¼«´»­ÓÑÜËÔÛ ½±³³±²­

×ÒÌÛÙÛÎô ÐßÎßÓÛÌÛÎ ææ ® ã ðòìî

×ÒÌÛÙÛÎô ÍßÊÛ ææ ²ô ²¬±¬

ÎÛßÔô ÍßÊÛ ææ ¿¾­¬±´ô ®»´¬±´

ÛÒÜ ÓÑÜËÔÛ ½±³³±²­

Ê·­·¾·´·¬§ ±º ±¾¶»½¬­

Ê¿®·¿¾´»­ ¿²¼ °®±½»¼«®»­ ·² ³±¼«´»­ ½¿² ¾» ÐÎ×ÊßÌÛ ±®

ÐËÞÔ×Ý

� ÐËÞÔ×Ý ã ª·­·¾´» º±® ¿´´ °®±¹®¿³ «²·¬­ «­·²¹ ¬¸» ³±¼«´»

ø¼»º¿«´¬÷

� ÐÎ×ÊßÌÛ ©·´´ ¸·¼» ¬¸» ±¾¶»½¬­ º®±³ ±¬¸»® °®±¹®¿³ «²·¬­×ÒÌÛÙÛÎô ÐÎ×ÊßÌÛ ææ ¨

×ÒÌÛÙÛÎô ÐËÞÔ×Ý ææ §

Í«³³¿®§

Ю±½»¼«®¿´ °®±¹®¿³³·²¹ ³¿µ»­ ¬¸» ½±¼» ³±®» ®»¿¼¿¾´»

¿²¼ »¿­·»® ¬± ³±¼·º§

� Ю±½»¼«®»­ »²½¿°­«´¿¬» ­±³» °·»½» ±º ©±®µ ¬¸¿¬ ³¿µ»­

­»²­» ¿²¼ ³¿§ ¾» ©±®¬¸ ®»ó«­·²¹ »´­»©¸»®»

� Ú±®¬®¿² «­»­ º«²½¬·±²­ ¿²¼ ­«¾®±«¬·²»­

� Ê¿´«»­ ±º °®±½»¼«®» ¿®¹«³»²¬­ ³¿§ ¾» ½¸¿²¹»¼ «°±²

½¿´´·²¹ ¬¸» °®±½»¼«®»

Ú±®¬®¿² ³±¼«´»­ ¿®» «­»¼ º±® ³±¼«´¿® °®±¹®¿³³·²¹ ¿²¼

¼¿¬¿ »²½¿°­«´¿¬·±²

15

Page 16: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

16

Page 17: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

ÐßÎÌ ×Êæ ÜÛÎ×ÊÛÜ ÜßÌß ÌÇÐÛÍ

Ñ«¬´·²»

λ½¿´´·²¹ Ú±®¬®¿² ¾«·´¬ó·² ¼¿¬¿ ¬§°»­

ο¬·±²¿´» ¾»¸·²¼ ¼»®·ª»¼ ¼¿¬¿ ¬§°»­

Ü¿¬¿ ¬§°» ¼»½´¿®¿¬·±² ¿²¼ ª·­·¾·´·¬§ ©·¬¸ »¨¿³°´»­

Ú±®¬®¿² ¾«·´¬ó·² ¬§°»­

ͬ¿²¼¿®¼ Ú±®¬®¿² ¿´®»¿¼§ ­«°°±®¬­ ¿ ©·¼» ª¿®·»¬§ ±º

º«²¼¿³»²¬¿´ ¼¿¬¿ ¬§°»­ ¬± ®»°®»­»²¬ ·²¬»¹»®­ô º´±¿¬·²¹

°±·²¬ ²«³¾»®­ ø®»¿´÷ô ¬®«¬¸ ª¿´«»­ ø´±¹·½¿´÷ ¿²¼ ª¿®·¿¾´»

´»²¹¬¸ ½¸¿®¿½¬»® ­¬®·²¹­

ײ ¿¼¼·¬·±² »¿½¸ ±º ¬¸»­» ¾«·´¬ó·² ¬§°»­ ³¿§ ¸¿ª»

¼»½´¿®»¼ ¿­ ³«´¬·ó¼·³»²­·±²¿´ ¿®®¿§

Ú«®¬¸»®³±®»ô ®»¿´­ ¿²¼ ·²¬»¹»®­ ½¿² ¾» ¼»½´¿®»¼ ¬±

½±²­«³» ´»­­ ³»³±®§ ·² »¨°»²­» ±º ®»¼«½»¼ ²«³»®·½¿´

°®»½·­·±² ¬¸®±«¹¸ µ·²¼ °¿®¿³»¬»® ø»ò¹ò è ±® ì÷

̸» ª¿®·¿¾´» ®»°®»­»²¬¿¬·±² ³»¬¸±¼ ø°®»½·­·±²÷ ³¿§ ¾»

¼»½´¿®»¼ «­·²¹ ¬¸» Õ×ÒÜ ­¬¿¬»³»²¬

ÿ ÍÛÔÛÝÌÛÜÁ×ÒÌÁÕ×ÒÜø®÷

ÿ ÍÛÔÛÝÌÛÜÁÎÛßÔÁÕ×ÒÜø°÷

ÿ ÍÛÔÛÝÌÛÜÁÎÛßÔÁÕ×ÒÜø°ô®÷

×ÒÌÛÙÛÎô ÐßÎßÓÛÌÛÎ ææ ­¸±®¬ãÍÛÔÛÝÌÛÜÁ×ÒÌÁÕ×ÒÜøì÷

×ÒÌÛÙÛÎô ÐßÎßÓÛÌÛÎ ææ ¼±«¾´»ãÍÛÔÛÝÌÛÜÁÎÛßÔÁÕ×ÒÜøïîôïðð÷

×ÒÌÛÙÛÎ øÕ×ÒÜã­¸±®¬÷ ææ ·²¼»¨

ÎÛßÔ øÕ×ÒÜã¼±«¾´»÷ ææ ¨ô§ô¦

ÝÑÓÐÔÛÈ øÕ×ÒÜã¼±«¾´»÷ ææ ½

¨ãïòðÁ¼±«¾´»å §ãîòðÁ¼±«¾´» ö ßÝÑÍø¨÷

ײ¬»¹»® ¾»¬©»»² óïð® ä ² ä ïð®

λ¿´ ²«³¾»® ¿½½«®¿¬» ¬± ° ¼»½·³¿´­

ß ®»¿´ ²«³¾»® ¾»¬©»»²

óïðïðð ä ¨ ä ïðïððô ¿½½«®¿¬» ¬± ïî

¼»½·³¿´­

ß º»© ©±®¼­ ¿¾±«¬ ²«³»®·½¿´ °®»½·­·±²

ÐÎÑÙÎßÓ Ð®»½·­·±²ÁÌ»­¬

×ÓÐÔ×Ý×Ì ÒÑÒÛ

×ÒÌÛÙÛÎô ÐßÎßÓÛÌÛÎ ææ ­° ã ÍÛÔÛÝÌÛÜÁÎÛßÔÁÕ×ÒÜøêôíð÷ô ú

¼° ã ÍÛÔÛÝÌÛÜÁÎÛßÔÁÕ×ÒÜøïðôîðð÷

ÎÛßÔøÕ×ÒÜã­°÷ ææ ¿

ÎÛßÔøÕ×ÒÜã¼°÷ ææ ¾

ÉÎ×ÌÛøöôö÷ ­°ô ¼°ô Õ×ÒÜøïòð÷ô Õ×ÒÜøïòðÁ¼°÷

ÉÎ×ÌÛøöôö÷ Õ×ÒÜø¿÷ô ØËÙÛø¿÷ô Ì×ÒÇø¿÷ô ÎßÒÙÛø¿÷ô ÐÎÛÝ×Í×ÑÒø¿÷

ÉÎ×ÌÛøöôö÷ Õ×ÒÜø¾÷ô ØËÙÛø¾÷ô Ì×ÒÇø¾÷ô ÎßÒÙÛø¾÷ô ÐÎÛÝ×Í×ÑÒø¾÷

ÛÒÜ ÐÎÑÙÎßÓ Ð®»½·­·±²ÁÌ»­¬

Ñ«¬°«¬æ

ì è ì è

ì íòìðîèîíëÛõíè ïòïéëìçììÛóíè íé ê

è ïòéçéêçíïíìèêîíïêÛõíðè îòîîëðéíèëèëðéîðïÛóíðè íðé ïë

Ò«³»®·½¿´ °®»½·­·±²

Ѭ¸»® ·²¬®·²­·½ º«²½¬·±²­ ®»´¿¬»¼ ¬± ²«³»®·½¿´ °®»½·­·±²

Õ×ÒÜøß÷ 묫®²­ ¬¸» µ·²¼ ±º ¬¸» ­«°°´·»¼ ¿®¹«³»²¬

Ì×ÒÇøß÷ ̸» ­³¿´´»­¬ °±­·¬·ª» ²«³¾»®

ØËÙÛøß÷ ̸» ´¿®¹»­¬ °±­·¬·ª» ²«³¾»®

ÛÐÍ×ÔÑÒøß÷ ̸» ­³¿´´»­¬ °±­·¬·ª» ²«³¾»® ¿¼¼»¼ ¬± ïòð

®»¬«®²­ ¿ ²«³¾»® ¶«­¬ ¹®»¿¬»® ¬¸¿² ïòð

ÐÎÛÝ×Í×ÑÒøß÷ Ü»½·³¿´ °®»½·­·±²

Ü×Ù×ÌÍøß÷ Ò«³¾»® ±º ­·¹²·º·½¿²¬ ¼·¹·¬­

ÎßÒÙÛøß÷ Ü»½·³¿´ »¨°±²»²¬

ÓßÈÛÈÐÑÒÛÒÌøß÷ Ô¿®¹»­¬ »¨°±²»²¬ ø±º ¬¸» µ·²¼øß÷÷

Ó×ÒÛÈÐÑÒÛÒÌøß÷ ͳ¿´´»­¬ »¨°±²»²¬ ø±º ¬¸» µ·²¼øß÷÷

Ò«³»®·½¿´ °®»½·­·±²

ɸ¿¬ ·­ ¼»®·ª»¼ ¼¿¬¿ ¬§°» á

Ü»®·ª»¼ ¼¿¬¿ ¬§°» ·­ ¿ ¼¿¬¿ ­¬®«½¬«®» ©¸·½¸ ·­ ¼»º·²»¼ ¾§

¬¸» °®±¹®¿³³»®

� Û¯«·ª¿´»²¬ ¬± ­¬®«½¬­ ·² Ý °®±¹®¿³³·²¹ ´¿²¹«¿¹»

� ݱ²­·­¬­ ±º ±¬¸»® ¼¿¬¿ ¬§°»­ � ·²½´«¼·²¹ ±¬¸»® ¼»®·ª»¼ ¬§°»­

Ü»®·ª»¼ ¬§°» ·­ ¼»º·²»¼ ·² ¬¸» ª¿®·¿¾´» ¼»½´¿®¿¬·±² ­»½¬·±²

±º °®±¹®¿³³·²¹ «²·¬

� Ò±¬ ª·­·¾´» ¬± ±¬¸»® °®±¹®¿³³·²¹ «²·¬­

˲´»­­ ¼»º·²»¼ ·² ³±¼«´»­ ¿²¼ «­»¼ ª·¿ ËÍÛ ½´¿«­»

Ü»®·ª»¼ ¼¿¬¿ ¬§°»­ � ®¿¬·±²¿´»

ß ©»´´ ­¬®«½¬«®»¼ ¿²¼ ®»¿¼¿¾´» °®±¹®¿³ ­¸±«´¼ ¬®§ ¬±

»¨°®»­­ ·¬­ ª¿®·¿¾´»­ ¿­ ±¾¶»½¬­

Ê¿®·¿¾´»­ «­»¼ ·² ¬¸» ­¿³» ½±²¬»¨¬ ­¸±«´¼ ¾» ¹®±«°»¼

¬±¹»¬¸»® � ¬¸·­ ³¿µ»­ ¬¸» °®±¹®¿³ º´±© »¿­·»® ¬±

«²¼»®­¬¿²¼ ¿²¼ ´»­­ °®±²» ¬± »®®±®­

Ü»®·ª»¼ ¼¿¬¿ ¬§°»­ ·­ ¿ º»¿¬«®» ©¸·½¸ ¿´´±©­ °®±¹®¿³³»®

¬± ³¿µ» ±¾¶»½¬ ¹®±«°·²¹ °±­­·¾´»

17

Page 18: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

Ü¿¬¿ ¬§°» ¼»½´¿®¿¬·±²

̧°» ¼»½´¿®¿¬·±²æÌÇÐÛ °´¿§»®¬§°»

ÝØßÎßÝÌÛÎ øÔÛÒãíð÷ ææ ²¿³»

×ÒÌÛÙÛÎ ææ ²«³¾»®

ÎÛßÔ ææ ®¿¬·²¹

ÛÒÜ ÌÇÐÛ °´¿§»®¬§°»

Ü»½´¿®·²¹ ª¿®·¿¾´»­ «­·²¹ ¿ ¼»®·ª»¼ ¼¿¬¿ ¬§°»æÌÇÐÛø°´¿§»®¬§°»÷ ææ ¶±¸²ô ´«·¦

ÌÇÐÛø°´¿§»®¬§°»÷ô Ü×ÓÛÒÍ×ÑÒøïð÷ ææ °´¿§»®­

ß½½»­­·²¹ ¼¿¬¿ ¬§°»­

ײ·¬·¿´·¦¿¬·±²¶±¸²û²¿³» ã ùÖ±¸²ù

¶±¸²û²«³¾»® ã ïï

¶±¸²û®¿¬·²¹ ã éòí

ß´¬»®²¿¬·ª»´§ Ô«·¦ ã °´¿§»®¬§°»øùÔ«·¦ùô èô êòì÷

Ê»½¬±® ±º ¼»®·ª»¼ ¼¿¬¿ ¬§°»æ »´»³»²¬ó©·­» ¿¼¼®»­­·²¹°´¿§»®­øï÷û²¿³» ã ùи·´ù

°´¿§»®­øï÷û²«³¾»® ã ì

°´¿§»®­øï÷û®¿¬·²¹ ã ëòë

Ò»­¬»¼ ¼¿¬¿ ¬§°»­

Ü»½´¿®¿¬·±² ±º ¿ ¼¿¬¿ ¬§°» «­·²¹ ¿²±¬¸»® ¼¿¬¿ ¬§°»æÌÇÐÛ º±±¬¾¿´´¬»¿³

ÝØßÎßÝÌÛÎ øÔÛÒãèð÷ ææ ²¿³»

ÌÇÐÛø°´¿§»®¬§°»÷ ææ °´¿§»®øïï÷

ÛÒÜ ÌÇÐÛ º±±¬¾¿´´¬»¿³

Ü»½´¿®·²¹ ª¿®·¿¾´»­æÌÇÐÛøº±±¬¾¿´´¬»¿³÷ ææ ³¿²«ô ¿®­»²¿´ô ®»¿¼·²¹

ײ·¬·¿´·¦¿¬·±² ñ ¿½½»­­ »¨¿³°´»æ³¿²«û²¿³» ã ùÓ¿²½¸»­¬»® ˲·¬»¼ù

³¿²«û°´¿§»®øï÷û²¿³» ã ùα¾·² ª¿² л®­·»ù

³¿²«û°´¿§»®øï÷û²«³¾»® ã îð

Ê·­·¾·´·¬§ ±º ¼»®·ª»¼ ¼¿¬¿ ¬§°»­

ɸ»² ¼»½´¿®»¼ ·² ¬¸» ­¿³» °®±¹®¿³³·²¹ «²·¬ øª¿®·¿¾´»

¼»½´¿®¿¬·±² ­»½¬·±²÷ ¼»®·ª»¼ ¼¿¬¿ ¬§°»­ ¿®» ª·­·¾´» ¬± ¬¸¿¬

«²·¬ ±²´§ ø¿²¼ ­«¾ó«²·¬­ «²¼»® ÝÑÒÌß×ÒÍ ­¬¿¬»³»²¬÷ æ

ÍËÞÎÑËÌ×ÒÛ ÍËÞ

ÌÇÐÛ ÓÇÁÌÇÐÛ

×ÒÌÛÙÛÎ ææ ÚÑÑ

ÛÒÜ ÌÇÐÛ ÓÇÁÌÇÐÛ

ÌÇÐÛøÓÇÁÌÇÐÛ÷ ææ ÊßÎ

ÊßÎûÚÑÑ ã é

ÝßÔÔ ÝßÔÝ

ÝÑÒÌß×ÒÍ

òòò

òòò

ÍËÞÎÑËÌ×ÒÛ ÝßÔÝ

ÌÇÐÛøÓÇÁÌÇÐÛ÷ ææ ÒÛÉÊßÎ

ÒÛÉÊßÎ ã ÊßÎ

ÐÎ×ÒÌ öôÒÛÉÊßÎ

ÛÒÜ ÍËÞÎÑËÌ×ÒÛ ÝßÔÝ

ÛÒÜ ÍËÞÎÑËÌ×ÒÛ ÍËÞ

Ê·­·¾·´·¬§ ±º ¼»®·ª»¼ ¼¿¬¿ ¬§°»­

ɸ»² ¼»½´¿®»¼ ·² ¿ ³±¼«´» «²·¬ô ¿ ¼»®·ª»¼ ¼¿¬¿ ¬§°» ½¿²

¾» ¿½½»­­»¼ ±«¬­·¼» ¬¸» ³±¼«´» ¬¸®±«¹¸ ËÍÛ󭬿¬»³»²¬æ

ÍËÞÎÑËÌ×ÒÛ ÍËÞ

ËÍÛ ÌÇÐÛÓÑÜô ÑÒÔÇ æ ÓÇÁÌÇÐÛ

ÌÇÐÛøÓÇÁÌÇÐÛ÷ ææ ÊßÎ

ÊßÎûÚÑÑ ã é

ÝßÔÔ ÝßÔÝ øÊßÎ÷

ÛÒÜ ÍËÞÎÑËÌ×ÒÛ ÍËÞ

ÍËÞÎÑËÌ×ÒÛ ÝßÔÝ øÒÛÉÊßÎ÷

ËÍÛ ÌÇÐÛÓÑÜô ÑÒÔÇ æ ÓÇÁÌÇÐÛ

ÌÇÐÛøÓÇÁÌÇÐÛ÷ ææ ÒÛÉÊßÎ

ÐÎ×ÒÌ öôÒÛÉÊßÎ

ÛÒÜ ÍËÞÎÑËÌ×ÒÛ ÝßÔÝ

ÓÑÜËÔÛ ÌÇÐÛÓÑÜ

ÌÇÐÛ ÓÇÁÌÇÐÛ

×ÒÌÛÙÛÎ ææ ÚÑÑ

ÛÒÜ ÌÇÐÛ ÓÇÁÌÇÐÛ

ÐËÞÔ×Ý ææ ÓÇÁÌÇÐÛ

ÛÒÜ ÓÑÜËÔÛ ÌÇÐÛÓÑÜ

ß ´·²µ»¼ ´·­¬

ß ½¸¿·² ±º ¼¿¬¿ »´»³»²¬­ ·² ¿ ¼§²¿³·½¿´´§ »¨¬»²¼¿¾´» ´·­¬

Ú±® »¨¿³°´»ÌÇÐÛ ´·­¬Á±ºÁ¬»¿³­

ÌÇÐÛøº±±¬¾¿´´¬»¿³÷ ææ ¬»¿³

ÌÇÐÛø´·­¬Á±ºÁ¬»¿³­÷ô ÐÑ×ÒÌÛÎ ææ ²»¨¬Á¬»¿³ ãâ ÒËÔÔø÷

ÛÒÜ ÌÇÐÛ ´·­¬Á±ºÁ¬»¿³­

Ô·²µ»¼

´·­¬

ß ¾·²¿®§ ¬®»»

Ü¿¬¿ »´»³»²¬­ ·² ¿ ¾·²¿®§ ¬®»» ±ºº»® ­«°»®¾ ­»¿®½¸ ­°»»¼ ·²

¶«­¬ ±øÒ ´±¹î Ò÷ ±°»®¿¬·±²­

ݱ²­·­¬­ ±º ´»º¬ ¿²¼ ®·¹¸¬ ´»¿º­ÌÇÐÛ ¾·²¿®§Á¬®»»

ÌÇÐÛø³§Á¼¿¬¿Á¬§°»÷ ææ ¼¿¬¿

ÌÇÐÛø¾·²¿®§Á¬®»»÷ô ÐÑ×ÒÌÛÎ ææ ´»º¬ ãâ ÒËÔÔø÷

ÌÇÐÛø¾·²¿®§Á¬®»»÷ô ÐÑ×ÒÌÛÎ ææ ®·¹¸¬ ãâ ÒËÔÔø÷

ÛÒÜ ÌÇÐÛ ¾·²¿®§Á¬®»»

Þ·²¿®§

¬®»»

Í«³³¿®§

Ü»®·ª»¼ ¼¿¬¿ ¬§°»­ »²¿¾´»­ ¹®±«°·²¹ ±º ¼¿¬¿ ¬± º±®³

´±¹·½¿´ ±¾¶»½¬­

ß Ú±®¬®¿² °®±¹®¿³ ¾»½±³»­ ³±®» ®»¿¼¿¾´» ¿²¼ ³±¼«´¿®

©·¬¸ ­»²­·¾´» «­» ±º ¼»®·ª»¼ ¼¿¬¿ ¬§°»­

Ø¿²¼´·²¹ ±º ´·²µ»¼ ´·­¬­ ±® ¾·²¿®§ ¬®»»­ ¾»½±³»­ ³±®»

³¿²¿¹»¿¾´» ©·¬¸ «­» ±º ¼¿¬¿ ­¬®«½¬«®»­

18

Page 19: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

ÐßÎÌ Êæ Ú×ÔÛ ×ñÑ

Ñ«¬´·²»

ײ°«¬ñ±«¬°«¬ º±®³¿¬¬·²¹

Ú·´» ±°»²·²¹ ¿²¼ ½´±­·²¹

É®·¬·²¹ ¿²¼ ®»¿¼·²¹ ¬±ñº®±³ ¿ º·´»

Ú±®³¿¬¬»¼ ¿²¼ «²º±®³¿¬¬»¼ º·´»­

ͬ®»¿³ ×ñÑ

ײ¬»®²¿´ ×ñÑ

ײ°«¬ñÑ«¬°«¬ º±®³¿¬¬·²¹

̱ °®»¬¬·º§ ±«¬°«¬ ¿²¼ ¬± ³¿µ» ·¬ ¸«³¿² ®»¿¼¿¾´»ô «­»

ÚÑÎÓßÌ ¼»­½®·°¬±®­ ·² ½±²²»½¬·±² ©·¬¸ ¬¸» ÉÎ×ÌÛ

­¬¿¬»³»²¬

ß´¬¸±«¹¸ ´»­­ ±º¬»² «­»¼ ²±©¿¼¿§­ô ·¬ ½¿² ¿´­± ¾» «­»¼

©·¬¸ ÎÛßÜ ¬± ·²°«¬ ¼¿¬¿ ¿¬ º·¨»¼ ´·²» °±­·¬·±²­ ¿²¼ «­·²¹

°®»¼»º·²»¼ º·»´¼ ´»²¹¬¸­

Ë­» »·¬¸»® ¬¸®±«¹¸ ÚÑÎÓßÌ ­¬¿¬»³»²¬­ô ÝØßÎßÝÌÛÎ

ª¿®·¿¾´» ±® »³¾»¼¼»¼ ·² ÎÛßÜ ñ ÉÎ×ÌÛ º³¬ µ»§©±®¼

Ü¿¬¿ ¬§°» ÚÑÎÓßÌ ¼»­½®·°¬±®­ Û¨¿³°´»­

ײ¬»¹»® שô שò³ ÉÎ×ÌÛøöôùø×ë÷ù÷ ÖÉÎ×ÌÛøöôùø×ëòí÷ù÷ ÖÉÎ×ÌÛøöôùø×ð÷ù÷ Ö

λ¿´ ø¼»½·³¿´ ¿²¼ »¨°±²»²¬·¿´ º±®³­ô¿«¬±ó­½¿´·²¹÷

Ú©ò¼Û©ò¼ô Û©ò¼Û»ïÐôÙ©ò¼

ÉÎ×ÌÛøöôùøÚéòì÷ù÷ ÎÉÎ×ÌÛøöôùøÛïîòíÛì÷ù÷ ÎÉÎ×ÌÛøöôùøïÐôÙîðòïí÷ù÷ Î

ݸ¿®¿½¬»® ßô ß© ÉÎ×ÌÛøöôùøß÷ù÷ Ý

Ô±¹·½¿´ Ô© ÉÎ×ÌÛøöôùøÔî÷ù÷ Ô

©ã©·¼¬¸ ±º ¬¸» ±«¬°«¬ º·»´¼ô ¼ã²«³¾»® ±º ¼·¹·¬­ ¬± ¬¸» ®·¹¸¬ ±º ¼»½·³¿´ °±·²¬ô ³ã³·²·³«³ ²«³¾»® ±º ½¸¿®¿½¬»®­ ¬± ¾» «­»¼ô »ã²«³¾»® ±º ¼·¹·¬­ ·² ¬¸» »¨°±²»²¬ò Ê¿®·¿¾´»­æ ײ¬»¹»® ææ Öô λ¿´ ææ Îô ݸ¿®¿½¬»® ææ Ýô Ô±¹·½¿´ ææ Ô

Ñ«¬°«¬ º±®³¿¬¬·²¹

Ñ«¬°«¬ º±®³¿¬¬·²¹æ ³·­½»´´¿²»±«­

É·¬¸ ½±³°´»¨ ²«³¾»®­ °®±ª·¼» º±®³¿¬ º±® ¾±¬¸ ®»¿´ ¿²¼

·³¿¹·²¿®§ °¿®¬­æÝÑÓÐÔÛÈ ææ Æ

ÉÎ×ÌÛ øöôùøÚêòíôîÈôÚêòí÷ù÷ Æ

Ô·²» ¾®»¿µ ¿²¼ ¬¿¾¾·²¹æÉÎ×ÌÛ øöôùøÚêòíôñôÚêòí÷ù÷ Èô Ç

ÉÎ×ÌÛ øöôùø×ëôÌîðô×ë÷ù÷ ×ô Ö

׬ ·­ °±­­·¾´» ¬¸¿¬ ¿² »¼·¬ ¼»­½®·°¬±® ©·´´ ¾» ®»°»¿¬»¼ ¿

­°»½·º·»¼ ²«³¾»® ±º ¬·³»­ÉÎ×ÌÛ øöôùøë×è÷ù÷

ÉÎ×ÌÛ øöôùøíø×ëôÚèòí÷÷ù÷

Ñ°»²·²¹ ú ½´±­·²¹ º·´»­ æ ¾¿­·½ ½±²½»°¬­

É®·¬·²¹ ¬± ±® ®»¿¼·²¹ º®±³ ¿ º·´» ·­ ­·³·´¿® ¬± ©®·¬·²¹ ±²¬±

¿ ¬»®³·²¿´ ­½®»»² ±® ®»¿¼·²¹ º®±³ ¿ µ»§¾±¿®¼

Ü·ºº»®»²½»­

� Ú·´» ³«­¬ ¾» ±°»²»¼ ©·¬¸ ¿² ÑÐÛÒ ­¬¿¬»³»²¬ô ·² ©¸·½¸ ¬¸»

«²·¬ ²«³¾»® ¿²¼ ø±°¬·±²¿´´§÷ ¬¸» º·´» ²¿³» ¿®» ¹·ª»²

� Í«¾­»¯«»²¬ ©®·¬»­ ø±® ®»¿¼­÷ ³«­¬ ¬± ®»º»® ¬± ¬¸» ¹·ª»²

«²·¬ ²«³¾»®

� Ú·´» ­¸±«´¼ ¾» ½´±­»¼ ¿¬ ¬¸» »²¼

Ñ°»²·²¹ ú ½´±­·²¹ ¿ º·´»

̸» ­§²¬¿¨ ·­ ø¬¸» ¾®¿½µ»¬­ Å Ã ·²¼·½¿¬» ±°¬·±²¿´ µ»§©±®¼­

±® ¿®¹«³»²¬­÷ æ

ÑÐÛÒøÅ«²·¬ã÷«ô º·´»ãù²¿³»ù Åô ±°¬·±²­Ã÷

ÝÔÑÍÛøÅ«²·¬ã÷« Åô ±°¬·±²­Ã÷

Ú±® »¨¿³°´» æÑÐÛÒøïðô º·´»ã ù±«¬°«¬ò¼¿¬ùô ­¬¿¬«­ãù²»©ù÷

ÝÔÑÍÛø«²·¬ãïðô ­¬¿¬«­ãùµ»»°ù÷

Ñ°»²·²¹ ú ½´±­·²¹ ¿ º·´»

̸» º·®­¬ °¿®¿³»¬»® ·­ ¬¸» «²·¬ ²«³¾»®

̸» µ»§©±®¼ «²·¬ã ½¿² ¾» ±³·¬¬»¼

̸» «²·¬ ²«³¾»®­ ðô ë ¿²¼ ê ¿®» °®»¼»º·²»¼

� ð ·­ ±«¬°«¬ º±® ­¬¿²¼¿®¼ ø­§­¬»³÷ »®®±® ³»­­¿¹»­

� ë ·­ º±® ­¬¿²¼¿®¼ ø«­»®÷ ·²°«¬

� ê ·­ º±® ­¬¿²¼¿®¼ ø«­»®÷ ±«¬°«¬

� ̸»­» «²·¬­ ¿®» ±°»²»¼ ¾§ ¼»º¿«´¬ ¿²¼ ­¸±«´¼ ²±¬ ¾» ®»ó

±°»²»¼ ²±® ½´±­»¼ ¾§ ¬¸» «­»®

Page 20: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

Ñ°»²·²¹ ú ½´±­·²¹ ¿ º·´»

̸» ¼»º¿«´¬ ±«¬°«¬ñ·²°«¬ «²·¬ ½¿² ¾» ®»º»®®»¼ ©·¬¸ ¿ ­¬¿®æ

ÉÎ×ÌÛøöô òòò÷

ÎÛßÜøöô òòò÷

� Ò±¬» ¬¸¿¬ ¬¸»­» ¿®» ²±¬ ²»½»­­¿®·´§ ¬¸» ­¿³» ¿­ ¬¸» ­¬¼±«¬

¿²¼ ­¬¼·² «²·¬ ²«³¾»®­ ê ¿²¼ ë

׺ ¬¸» º·´» ²¿³» ·­ ±³·¬¬»¼ ·² ¬¸» ÑÐÛÒô ¬¸» º·´» ²¿³» ©·´´

¾¿­»¼ ±² «²·¬ ²«³¾»® ¾»·²¹ ±°»²»¼ô »ò¹ò º±® «²·¬ãïî ¬¸·­

«­«¿´´§ ³»¿²­ ¬¸» º·´»²¿³» �º±®¬òïî� ø±² ˲·¨ñÓßÝ÷

Ú·´» ±°»²·²¹ ±°¬·±²­

­¬¿¬«­ æ »¨·­¬»²½» ±º ¬¸» º·´»

� ù±´¼ùô ù²»©ùô ù®»°´¿½»ùô ù­½®¿¬½¸ùô ù«²µ²±©²ù

°±­·¬·±² æ ±ºº­»¬ô ©¸»®» ¬± ­¬¿®¬ ©®·¬·²¹

� ù¿°°»²¼ù

¿½¬·±² æ º·´» ±°»®¿¬·±² ³±¼»

� ù©®·¬»ùô ù®»¿¼ùô ù®»¿¼©®·¬»ù

º±®³ æ ¬»¨¬ ±® ¾·²¿®§ º·´»

� ùº±®³¿¬¬»¼ùô ù«²º±®³¿¬¬»¼ù

Ú·´» ±°»²·²¹ ±°¬·±²­

¿½½»­­ æ ¼·®»½¬ ±® ­»¯«»²¬·¿´ º·´» ¿½½»­­

� ù¼·®»½¬ùô ù­»¯«»²¬·¿´ùô ù­¬®»¿³ùô

·±­¬¿¬ æ »®®±® ·²¼·½¿¬±®ô ø±«¬°«¬÷ ·²¬»¹»®

� Ò±²ó¦»®± ±²´§ «°±² ¿² »®®±®

»®® æ ¬¸» ´¿¾»´ ²«³¾»® ¬± ¶«³° «°±² »®®±®

®»½´ æ ®»½±®¼ ´»²¹¬¸ô ø·²°«¬÷ ·²¬»¹»®

� Ú±® ¼·®»½¬ ¿½½»­­ º·´»­ ±²´§

� É¿®²·²¹ ø½¸»½µ÷æ ³¿§ ¾» ·² ¾§¬»­ ±® ©±®¼­

Ú·´» ±°»²·²¹æ º·´» °®±°»®¬·»­

Ë­» ×ÒÏË×ÎÛ ­¬¿¬»³»²¬ ¬± º·²¼ ±«¬ ·²º±®³¿¬·±² ¿¾±«¬

� º·´» »¨·­¬»²½»

� º·´» «²·¬ ±°»² ­¬¿¬«­

� ª¿®·±«­ º·´» ¿¬¬®·¾«¬»­

̸» ­§²¬¿¨ ¸¿­ ¬©± º±®³­ô ±²» ¾¿­»¼ ±² º·´» ²¿³»ô ¬¸»

±¬¸»® º±® «²·¬ ²«³¾»®×ÒÏË×ÎÛøº·´»ã�²¿³»�ô ±°¬·±²­ òòò÷

×ÒÏË×ÎÛø«²·¬ã·«ô ±°¬·±²­ òòò÷

Ú·´» ±°»²·²¹æ º·´» °®±°»®¬·»­

»¨·­¬ æ ¼±»­ º·´» »¨·­¬ á øÔÑÙ×ÝßÔ÷

±°»²»¼ æ ·­ º·´» ñ «²·¬ ±°»²»¼ á øÔÑÙ×ÝßÔ÷

º±®³ æ �º±®³¿¬¬»¼� ±® �«²º±®³¿¬¬»¼� øÝØßÎ÷

¿½½»­­ æ �­»¯«»²¬·¿´� ±® �¼·®»½¬� ±® �­¬®»¿³� øÝØßÎ÷

¿½¬·±² æ �®»¿¼�ô �©®·¬»�ô �®»¿¼©®·¬»� øÝØßÎ÷

®»½´ æ ®»½±®¼ ´»²¹¬¸ ø×ÒÌÛÙÛÎ÷

­·¦» æ º·´» ­·¦» ·² ¾§¬»­ ø×ÒÌÛÙÛÎ÷

Ú·´» ±°»²·²¹æ º·´» °®±°»®¬·»­

Ú·²¼ ±«¬ ¿¾±«¬ »¨·­¬»²½» ±º ¿ º·´»

ÔÑÙ×ÝßÔ ææ º·´»Á»¨·­¬

×ÒÏË×ÎÛ øÚ×ÔÛãùº±±ò¼¿¬ùô ÛÈ×ÍÌ㺷´»Á»¨·­¬÷

×Ú øòÒÑÌò º·´»Á»¨·­¬÷ ÌØÛÒ

ÉÎ×ÌÛøöôö÷ ù̸» º·´» ¼±»­ ²±¬ »¨·­¬ù

ÛÔÍÛ

ÿ ܱ ­±³»¬¸·²¹ ©·¬¸ ¬¸» º·´» ùº±±ò¼¿¬ù

ÛÒÜ×Ú

Ú·´» ©®·¬·²¹ ¿²¼ ®»¿¼·²¹

É®·¬·²¹ ¬± ¿²¼ ®»¿¼·²¹ º®±³ ¿ º·´» ·­ ¼±²» ¾§ ¹·ª·²¹ ¬¸»

½±®®»­°±²¼·²¹ «²·¬ ²«³¾»® ø·«÷ ¿­ ¿ °¿®¿³»¬»® æÉÎ×ÌÛø·«ôö÷ ­¬®

ÉÎ×ÌÛø«²·¬ã·«ô º³¬ãö÷ ­¬®

ÎÛßÜø·«ôö÷ ­¬®

ÎÛßÜø«²·¬ã·«ô º³¬ãö÷ ­¬®

Ú±®³¿¬­ ¿²¼ ±¬¸»® ±°¬·±²­ ½¿² ¾» «­»¼ ¿­ ²»»¼»¼

׺ µ»§©±®¼ ù«²·¬ù «­»¼ô ¿´­± ùº³¬ù µ»§©±®¼ ³«­¬ ¾» «­»¼

øùº³¬ù ·­ ¿°°´·½¿¾´» ¬± º±®³¿¬¬»¼ô ¬»¨¬ º·´»­ ±²´§÷

̸» ­¬¿® º±®³¿¬ øö÷ ·²¼·½¿¬»­ ´·­¬ó

¼·®»½¬»¼ ±«¬°«¬ ø·ò»ò °®±¹®¿³³»® ¼±»­

²±¬ ½¸±±­» ¬¸» ·²°«¬ñ±«¬°«¬ ­¬§´»­÷

Ú±®³¿¬¬»¼ ª­ò «²º±®³¿¬¬»¼ º·´»­

Ì»¨¬ ±® º±®³¿¬¬»¼ º·´»­ ¿®»

� Ø«³¿² ®»¿¼¿¾´»

� ᮬ¿¾´» ·ò»ò ³¿½¸·²» ·²¼»°»²¼»²¬

Þ·²¿®§ ±® «²º±®³¿¬¬»¼ º·´»­ ¿®»

� Ó¿½¸·²» ®»¿¼¿¾´» ±²´§ô ²±¬ °±®¬¿¾´»

� Ó«½¸ º¿­¬»® ¬± ¿½½»­­ ¬¸¿² º±®³¿¬¬»¼ º·´»­

� Í«·¬¿¾´» º±® ´¿®¹» ¿³±«²¬ ±º ¼¿¬¿ ¼«» ¬± ®»¼«½»¼ º·´» ­·¦»­

� ײ¬»®²¿´ ¼¿¬¿ ®»°®»­»²¬¿¬·±² «­»¼ º±® ²«³¾»®­ô ¬¸«­ ²± ²«³¾»®

½±²ª»®­·±²ô ²± ®±«²¼·²¹ ±º »®®±®­ ½±³°¿®»¼ ¬± º±®³¿¬¬»¼ ¼¿¬¿

Page 21: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

˲º±®³¿¬¬»¼ ×ñÑ

É®·¬» ¬± ¿ ­»¯«»²¬·¿´ ¾·²¿®§ º·´»ÎÛßÔ ®ª¿´

ÝØßÎßÝÌÛÎø´»² ã êð÷ ­¬®·²¹

ÑÐÛÒøïðôº·´»ãùº±±ò¼¿¬ùôº±®³ãù«²º±®³¿¬¬»¼ù÷

ÉÎ×ÌÛøïð÷ ®ª¿´

ÉÎ×ÌÛøïð÷ ­¬®·²¹

ÝÔÑÍÛøïð÷

Ò± ÚÑÎÓßÌ ¼»­½®·°¬±®­ ¿´´±©»¼

λ¿¼·²¹ ­·³·´¿®´§ÎÛßÜøïð÷ ®ª¿´

ÎÛßÜøïð÷ ­¬®·²¹

ͬ®»¿³ ×ñÑ

ß ¾·²¿®§ º·´» ©®·¬» ¿¼¼­ »¨¬®¿ ®»½±®¼ ¼»´·³·¬»®­ ø¸·¼¼»²

º®±³ °®±¹®¿³³»®÷ ¬± ¬¸» ¾»¹·²²·²¹ ¿²¼ »²¼ ±º ®»½±®¼­

ײ Ú±®¬®¿²îððí «­·²¹ ¿½½»­­ ³»¬¸±¼ ù­¬®»¿³ù ¿ª±·¼­ ¬¸·­

¿²¼ ·³°´»³»²¬­ øº·²¿´´§ÿ÷ ¿ Ýó°®±¹®¿³³·²¹ ´·µ» ¿°°®±¿½¸

Ý®»¿¬» ¿ ­¬®»¿³ ø¾·²¿®§÷ º·´»ÎÛßÔ ¼¾¸»¿¼»®øîð÷ô ¼¾¼¿¬¿øíðð÷

ÑÐÛÒøïðôº·´»ãù³§Á¼¿¬¿¾¿­»ò¼¿¬ùô¿½½»­­ãù­¬®»¿³ù÷

ÉÎ×ÌÛøïð÷ ¼¾¸»¿¼»®

ÉÎ×ÌÛøïð÷ ¼¾¼¿¬¿

ÝÔÑÍÛøïð÷

λ¿¼·²¹ ­·³·´¿®´§

ײ¬»®²¿´ ×ñÑ

Ѻ¬»² ·¬ ·­ ²»½»­­¿®§ ¬± º·´¬»® ±«¬ ¼¿¬¿ º®±³ ¿ ¹·ª»²

½¸¿®¿½¬»® ­¬®·²¹

Ñ® ¬± °¿½µ ª¿´«»­ ·²¬± ¿ ½¸¿®¿½¬»® ­¬®·²¹

Ú±®¬®¿² ·²¬»®²¿´ ×ñÑ ©·¬¸ ÎÛßÜ ú ÉÎ×ÌÛ ¾»½±³»­ ¸¿²¼§

Ò± ¿½¬«¿´ ø°¸§­·½¿´÷ º·´»­ ¿®» ·²ª±´ª»¼ ¿¬ ¿´´

ײ¬»®²¿´ ×ñÑ æ Û¨¿³°´»­

Û¨¬®¿½¬ ¿ ²«³¾»® º®±³ ¿ ¹·ª»² ½¸¿®¿½¬»® ­¬®·²¹ æ

ÝØßÎßÝÌÛÎøÔÛÒãïí÷ ææ ÝÔ ãùÌ·³» ­¬»°ý ïðù

×ÒÌÛÙÛÎ ææ ×ÍÌÛÐ

ÎÛßÜøÝÔôº³¬ãùøïðÈô×í÷ù÷ ×ÍÌÛÐ

É®·¬» ¬»¨¬ ¿²¼ ¼¿¬¿ ¬± ¿ ½¸¿®¿½¬»® ­¬®·²¹æÝØßÎßÝÌÛÎøÔÛÒãêð÷ ÝÔ

ÉÎ×ÌÛøÝÔôº³¬ãùøßô×ð÷ù÷ ù̸» ²«³¾»® ±º ¶±¾­ ½±³°´»¬»¼ ã ùôïðð

Í«³³¿®§

ײ°«¬ñÑ«¬°«¬ º±®³¿¬¬·²¹

Ú·´»­æ ½±³³«²·½¿¬·±² ¾»¬©»»² ¿ °®±¹®¿³ ¿²¼ ¬¸»

±«¬­·¼» ©±®´¼

� Ñ°»²·²¹ ¿²¼ ½´±­·²¹ ¿ º·´»

� Ü¿¬¿ ®»¿¼·²¹ ú ©®·¬·²¹

Ë­» «²º±®³¿¬¬»¼ ø¾·²¿®§÷ ×ñÑ º±® ¿´´ »¨½»°¬ ¬»¨¬ º·´»­

ͬ®»¿³ ×ñÑ

ײ¬»®²¿´ ×ñÑ

21

Page 22: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

22

Page 23: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

ÐßÎÌ Ê×æ ÑÌØÛÎ ØßÒÜÇ ÚÑÎÌÎßÒ çëñîððí

ÚÛßÌËÎÛÍ

Ñ«¬´·²»

б·²¬»® ¿´·¿­·²¹

Ù»²»®·½ °®±½»¼«®»­

Í°»½·¿´ °®±½»¼«®» ¿¬¬®·¾«¬»­ ú ±°¬·±²¿´ °®±½»¼«®»

¿¬¬®·¾«¬»­

ݱ³³¿²¼ó´·²» ¿®¹«³»²¬­

б·²¬»®­ ¬± ¿®®¿§­

̸» ÐÑ×ÒÌÛÎ ¿¬¬®·¾«¬» »²¿¾´»­ ¬± ½®»¿¬» ¿®®¿§ ø±® ­½¿´¿®÷

¿´·¿­·²¹ ª¿®·¿¾´»­

б·²¬»® ª¿®·¿¾´»­ ¿®» «­«¿´´§ »³°´±§»¼ ¬± ®»º»® ¬±

¿²±¬¸»® ¿®®¿§ ±® ¿®®¿§ ­»½¬·±²

ß °±·²¬»® ª¿®·¿¾´» ½¿² ¿´­± ¾» ¿ ­±´» ª¿®·¿¾´» ·¬­»´ºô ¾«¬

®»¯«·®»­ ßÔÔÑÝßÌÛ

� ̸·­ ·­ ²±¬ ¿ ®»½±³³»²¼»¼ °®¿½¬·½» � «­» ¬¸»

ßÔÔÑÝßÌßÞÔÛ ¿¬¬®·¾«¬» ¿²¼ »³°´±§ ÐÑ×ÒÌÛέ º±® ¿´·¿­·²¹

±²´§

Ý °®±¹®¿³³»®­æ ¿ �°±·²¬»®� ¸¿­ ¿ ­´·¹¸¬´§ ¼·ºº»®»²¬

³»¿²·²¹ ·² Ý ¿²¼ Ú±®¬®¿²

б·²¬»®­ ¬± ¿®®¿§­

ß ÐÑ×ÒÌÛÎ ½¿² ®»º»® ¬± ¿² ¿´®»¿¼§ ¿´´±½¿¬»¼ ³»³±®§

®»¹·±²

×ÒÌÛÙÛÎô ÐÑ×ÒÌÛÎ ææ °Á¨øæ÷ ãâ ÒËÔÔø÷

×ÒÌÛÙÛÎô ÌßÎÙÛÌ ææ ¨øïððð÷

òòò

°Á¨ ãâ ¨

°Á¨ ãâ ¨ ø î æ íðð ÷

°Á¨ ãâ ¨ ø ï æ ïððð æ ë ÷

òòò

°Á¨øï÷ ã ð

ÒËÔÔ×ÚÇø°Á¨÷

Ü·­½±²²»½¬­ °Á¨�­ ½±²²»½¬·±² ¬± ¨

ײ·¬·¿´·¦»¼ ¬± °±·²¬ ¬± ²±¬¸·²¹

̸·­ ©±«´¼ ½¸¿²¹» ¿´­± ¨øï÷ ¬± ð

б·²¬»®­ °®±ª·¼» ¿ ²»¿¬ ©¿§ º±® ¿®®¿§

­»½¬·±²­

Ù»²»®·½ °®±½»¼«®»­

Ю±½»¼«®»­ ©¸·½¸ °»®º±®³ ­·³·´¿® ¿½¬·±²­ ¾«¬ º±®

¼·ºº»®»²¬ ¼¿¬¿ ¬§°»­ ½¿² ¾» ¼»º·²»¼ ¿­ ¹»²»®·½

°®±½»¼«®»­

Ю±½»¼«®»­ ¿®» ½¿´´»¼ «­·²¹ ¬¸» ¹»²»®·½ ²¿³» ¿²¼

½±³°·´»® «­»­ ¬¸» ½±®®»½¬ °®±½»¼«®» ¾¿­»¼ ±² ¬¸»

¿®¹«³»²¬ ²«³¾»®ô ¬§°» ¿²¼ ¼·³»²­·±²­

� ݱ³°¿®» ©·¬¸ �±ª»®´±¿¼·²¹� ·² Ýõõ

Ù»²»®·½ ²¿³» ·­ ¼»º·²»¼ ·² ×ÒÌÛÎÚßÝÛ ­»½¬·±²

ÓÑÜËÔÛ ­©¿°³±¼

×ÓÐÔ×Ý×Ì ÒÑÒÛ

×ÒÌÛÎÚßÝÛ ­©¿°

ÓÑÜËÔÛ ÐÎÑÝÛÜËÎÛ ­©¿°Á®»¿´ô ­©¿°Á½¸¿®

ÛÒÜ ×ÒÌÛÎÚßÝÛ

ÝÑÒÌß×ÒÍ

ÍËÞÎÑËÌ×ÒÛ ­©¿°Á®»¿´ø¿ô ¾÷

ÎÛßÔô ×ÒÌÛÒÌø×ÒÑËÌ÷ ææ ¿ô ¾

ÎÛßÔ ææ ¬»³°

¬»³° ã ¿å ¿ ã ¾å ¾ ã ¬»³°

ÛÒÜ ÍËÞÎÑËÌ×ÒÛ

ÍËÞÎÑËÌ×ÒÛ ­©¿°Á½¸¿®ø¿ô ¾÷

ÝØßÎßÝÌÛÎô ×ÒÌÛÒÌø×ÒÑËÌ÷ ææ ¿ô ¾

ÝØßÎßÝÌÛÎ ææ ¬»³°

¬»³° ã ¿å ¿ ã ¾å ¾ ã ¬»³°

ÛÒÜ ÍËÞÎÑËÌ×ÒÛ

ÛÒÜ ÓÑÜËÔÛ ­©¿°³±¼

Ù»²»®·½ °®±½»¼«®»­ »¨¿³°´»

ÐÎÑÙÎßÓ ­©·¬½¸

ËÍÛ ­©¿°³±¼

×ÓÐÔ×Ý×Ì ÒÑÒÛ

ÝØßÎßÝÌÛÎ ææ ²ô­

ÎÛßÔ ææ ¨ô§

² ã ùÖù

­ ã ùÍù

¨ãïð

§ãîð

ÐÎ×ÒÌ öô¨ô§

ÐÎ×ÒÌ öô²ô­

ÝßÔÔ ­©¿°ø²ô­÷

ÝßÔÔ ­©¿°ø¨ô§÷

ÐÎ×ÒÌ öô¨ô§

ÐÎ×ÒÌ öô²ô­

ÛÒÜ ÐÎÑÙÎßÓ

Í°»½·¿´ ¿¬¬®·¾«¬»­ º±® °®±½»¼«®»­æ ÎÛÝËÎÍ×ÊÛ

뽫®­·±² ³»¿²­ ½¿´´·²¹ ¿ °®±½»¼«®» ©·¬¸·² ·¬­»´º

Ì®·¹¹»®»¼ ª·¿ ÎÛÝËÎÍ×ÊÛ µ»§©±®¼

ÎÛÝËÎÍ×ÊÛ ÚËÒÝÌ×ÑÒ º¿½¬±®·¿´ø²÷ ÎÛÍËÔÌøº¿½÷

×ÒÌÛÙÛÎô ×ÒÌÛÒÌø×Ò÷ ææ ²

×ÒÌÛÙÛÎ ææ º¿½

×Ú ø²ããð÷ ÌØÛÒ

º¿½ãï

ÛÔÍÛ

º¿½ã²öº¿½¬±®·¿´ø²óï÷

ÛÒÜ ×Ú

ÛÒÜ ÚËÒÝÌ×ÑÒ º¿½¬±®·¿´

Í°»½·¿´ ¿¬¬®·¾«¬»­ º±® °®±½»¼«®»­æ ÐËÎÛ

ÐËÎÛ µ»§©±®¼ ·²¼·½¿¬»­ ¬¸¿¬ ¬¸» º«²½¬·±² ·­ º®»» ±º ­·¼»

»ºº»½¬­

� Í«½¸ ¿­ ¿ ½¸¿²¹» ·² ª¿´«» ±º ¿² ·²°«¬ ¿®¹«³»²¬ ±® ¹´±¾¿´

ª¿®·¿¾´»

ײ¬®·²­·½ º«²½¬·±²­ ¿®» ¿´©¿§­ °«®»

Ò± ø»¨¬»®²¿´÷ ×ñÑ ·­ ¿´´±©»¼ ·² ÐËÎÛ °®±½»¼«®»­

Ы®» °®±½»¼«®» ³«­¬ ­°»½·º§ ·²¬»²¬­ ±º ·¬­ ¿´´ ¿®¹«³»²¬­

̸» ³±¬·ª¿¬·±² ·­ »ºº·½·»²½§æ Û²¿¾´»­ ³±®» ¿¹¹®»­­·ª»

½±³°·´»® ±°¬·³·¦¿¬·±² ¿²¼ °¿®¿´´»´·¦¿¬·±² ©·¬¸ »ò¹ò

Ñ°»²ÓÐ

23

Page 24: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

Í°»½·¿´ ¿¬¬®·¾«¬»­ º±® °®±½»¼«®»­æ ÛÔÛÓÛÒÌßÔ

̸» ÛÔÛÓÛÒÌßÔ ¿¬¬®·¾«¬»

¿´´±©­ º±® ¼»½´¿®·²¹

°®±½»¼«®»­ ¬¸¿¬ ±°»®¿¬»

»´»³»²¬ó¾§ó»´»³»²¬

̸» ¿®¹«³»²¬ ½¿² ¾» ¿ ­½¿´¿®

±® ¿² ¿®®¿§ ±º ¿²§ ­¸¿°»

̸·­ ·­ ¿²±¬¸»® ©¿§ º±®

¼»º·²·²¹ ³±®» ¹»²»®¿´

°®±½»¼«®»­

ÛÔÛÓÛÒÌßÔ ÎÛßÔ ÚËÒÝÌ×ÑÒ ºø¨ô§÷

ÎÛßÔô ×ÒÌÛÒÌø×Ò÷ ææ ¨ô §

º ã ÍÏÎÌø¨ööî õ §ööî÷

ÛÒÜ ÚËÒÝÌ×ÑÒ º

òòò

ÎÛßÔô Ü×ÓÛÒÍ×ÑÒø²ô²÷ ææ ¿ô ¾ô ½

ÎÛßÔô Ü×ÓÛÒÍ×ÑÒø²÷ ææ ¬ô «ô ª

òòò

½ ã ºø¿ô¾÷

ª ã ºø¬ô«÷

ÍßÊÛ¼ ª¿®·¿¾´»­

Þ§ ¼»º¿«´¬ ±¾¶»½¬­ ·² °®±½»¼«®»­ ¿®» ¼§²¿³·½¿´´§

¿´´±½¿¬»¼ «°±² ·²ª±½¿¬·±²

Ѳ´§ ­¿ª»¼ ª¿®·¿¾´»­ µ»»° ¬¸»·® ª¿´«» º®±³ ±²» ½¿´´ ¬± ¬¸»

²»¨¬

� ÍßÊÛ ¿¬¬®·¾«¬»ÎÛßÔô ÍßÊÛ ææ ¿

� Ê¿®·¿¾´»­ ¿­­·¹²»¼ ©·¬¸ ¿ ª¿´«» «°±² ¼»½´¿®¿¬·±² ¿®» »¯«¿´

¬± ÍßÊÛ ¿¬¬®·¾«¬» øÝ °®±¹®¿³³»®­ ­¸±«´¼ ²±¬» ¬¸·­ÿ÷ÎÛßÔ ææ ¿ ã ïòð

Ñ°¬·±²¿´ °®±½»¼«®» ¿®¹«³»²¬­

Ю±½»¼«®» ¿®¹«³»²¬­

½¿² ¾» ¼»º·²»¼ ¿­

±°¬·±²¿´ô ·ò»òô «­·²¹

­±³» °®»¼»º·²»¼ ª¿´«»

º±® ¿®¹«³»²¬­ ²±¬

°®±ª·¼»¼

ÎÛßÔ ÚËÒÝÌ×ÑÒ ¿ª»®¿¹»ø¨ô ´±©ô «°÷

×ÓÐÔ×Ý×Ì ÒÑÒÛ

ÎÛßÔô Ü×ÓÛÒÍ×ÑÒøæ÷ô ×ÒÌÛÒÌø×Ò÷ ææ ¨

ÎÛßÔô ×ÒÌÛÒÌø×Ò÷ô ÑÐÌ×ÑÒßÔ ææ ´±©ô «°

ÎÛßÔ ææ ¿ô ¾

×ÒÌÛÙÛÎ ææ ·ô ·½±«²¬

¿ ã óØËÙÛø¿÷

¾ ã ØËÙÛø¾÷

×Ú øÐÎÛÍÛÒÌø´±©÷÷ ¿ ã ´±©

×Ú øÐÎÛÍÛÒÌø«°÷÷ ¾ ã «°

¿ª»®¿¹» ã ðòð

·½±«²¬ ã ð

ÜÑ · ã ïô Í×ÆÛø¨÷

×Ú ø¨ø·÷ âã ¿ òßÒÜò ¨ø·÷ äã ¾÷ ÌØÛÒ

¿ª»®¿¹» ã ¿ª»®¿¹» õ ¨ø·÷

·½±«²¬ ã ·½±«²¬ õ ï

ÛÒÜ ×Ú

ÛÒÜ ÜÑ

¿ª»®¿¹» ã ¿ª»®¿¹»ñ·½±«²¬

ÛÒÜ ÚËÒÝÌ×ÑÒ ¿ª»®¿¹»

ݱ«²¬·²¹ ¿² ¿ª»®¿¹» ±º ¿ ­»¬

±º ®»¿´ ²«³¾»®­ � ±°¬·±²¿´́ § ²«³¾»®­

±«¬­·¼» Å´±©ô«°Ã ½¿² ¾» ±³·¬¬»¼ º®±³

¬¸» ¿ª»®¿¹»ò ̸» º«²½¬·±² ½¿² ¾» ½¿´´»¼

©·¬¸ »·¬¸»® ïô î ±® í ¿®¹«³»¬­ô ¾«¬ ¬¸» ­»¬

±º ²«³¾»®­ ¸¿­ ¬± ¾» °®±ª·¼»¼ò

ݱ³³¿²¼ ´·²» ·²°«¬

ײ ³¿²§ ½¿­»­ô ·¬ ·­ ½±²ª»²·»²¬ ¬± ¹·ª» °¿®¿³»¬»®­ º±® ¬¸»

°®±¹®¿³ ¼·®»½¬´§ ¼«®·²¹ °®±¹®¿³ ´¿«²½¸

� ײ­¬»¿¼ ±º «­·²¹ ¿ °¿®­»®ô ®»¿¼·²¹ º®±³ ¿² ·²°«¬ º·́ » »¬½ò

Ú±®¬®¿² îððí °®±ª·¼»­ ¿ ©¿§ º±® ¬¸·­

� ÝÑÓÓßÒÜÁßÎÙËÓÛÒÌÁÝÑËÒÌø÷ æ ½±³°«¬» ¬¸» ²«³¾»® ±º

«­»®ó°®±ª·¼»¼ ¿®¹«³»²¬­

� ÙÛÌÁÝÑÓÓßÒÜÁßÎÙËÓÛÒÌø·²¬»¹»® ·ô ½¸¿®¿½¬»®

¿®¹ø·÷÷ »¨¬®¿½¬ ¬¸» ¿®¹«³»²¬ º®±³ °±­·¬·±² ·

� DZ« ©·´´ ²»»¼ ·²¬»®²¿´ ×ñÑ ¬± ½±²ª»®¬ »ò¹ò ·²¬»¹»®óª¿´«»¼

¿®¹«³»²¬­ ·²¬± ª¿´«»­ ±º ·²¬»¹»® ª¿®·¿¾´»­

ݱ³³¿²¼ ´·²» ·²°«¬

Û¨¿³°´»æ ®»¿¼·²¹ ·²

¬©± ·²¬»¹»® ª¿´«»­

º®±³ ¬¸» ½±³³¿²¼

´·²»

̸» øº«´´÷ °®±¹®¿³

­¸±«´¼ ¾» ´¿«²½¸»¼ ¿­

ø»ò¹ò÷û òñ¿ò±«¬ ïðð ïðð

­«¾®±«¬·²» ®»¿¼Á½±³³¿²¼Á´·²»ø¸»·¹¸¬ô ©·¼¬¸÷

·²¬»¹»®ô ·²¬»²¬ø±«¬÷ ææ ¸»·¹¸¬ô ©·¼¬¸

½¸¿®¿½¬»®ø´»²ãïð÷ ææ ¿®¹­øî÷

·²¬»¹»® ææ ²Á¿®¹­ô ·

²Á¿®¹­ ã ½±³³¿²¼Á¿®¹«³»²¬Á½±«²¬ø÷

·º ø ²Á¿®¹­ ñã î ÷ ¬¸»²

©®·¬»øöôö÷ ù Ë­¿¹» æ òñ»¨» ¸»·¹¸¬ ©·¼¬¸ ù

½¿´´ ¿¾±®¬ø÷

»²¼ ·º

¼± · ã ïô î

½¿´´ ¹»¬Á½±³³¿²¼Á¿®¹«³»²¬ø·ô¿®¹­ø·÷÷

¿®¹­ø·÷ ã ¬®·³ø¿¼¶«­¬´ø¿®¹­ø·÷÷÷

»²¼ ¼±

®»¿¼ø¿®¹­øï÷ôö÷ ¸»·¹¸¬

®»¿¼ø¿®¹­øî÷ôö÷ ©·¼¬¸

»²¼ ­«¾®±«¬·²» ®»¿¼Á½±³³¿²¼Á´·²»

Ú±®¬®¿² çëñîððí ½®¿­¸ ½±«®­» ­«³³¿®§

Ê¿®·¿¾´»­ô

½±²¬®±´

­¬®«½¬«®»­

ß®®¿§­ô ¿®®¿§

·²¬®·²­·½­

б·²¬»®

¿´·¿­·²¹

Ю±½»¼«®»­

ú Ó±¼«´»­

Ù»²»®·½

°®±½»¼«®»­

ú ­°»½·¿´

¿¬¬®·¾«¬»­

Ú·´» ×ñÑ

Ü»®·ª»¼

¬§°»­

̱©¿®¼­ Ú±®¬®¿² îððè

̸» Ú±®¬®¿² îððè ­¬¿²¼¿®¼ º»¿¬«®»­ »ò¹ò ¬¸» º±´´±©·²¹

½¿°¿¾·´·¬·»­ ±² ¬±° ±º Ú±®¬®¿² îððí

� Í«¾³±¼«´»­

� ݱ¿®®¿§ Ú±®¬®¿² � ¿ °¿®¿´´»´ »¨»½«¬·±² ³±¼»´

Ü·­½«­­»¼ ¬±³±®®±©

� ̸» ÜÑ ÝÑÒÝËÎÎÛÒÌ ½±²­¬®«½¬

� ̸» ÝÑÒÌ×ÙËÑËÍ ¿¬¬®·¾«¬»

� ̸» ÞÔÑÝÕ ½±²­¬®«½¬

̱©¿®¼­ Ú±®¬®¿² îððè

þݱ¿®®¿§­ ©»®» ¼»­·¹²»¼ ¬± ¿²­©»® ¬¸» ¯«»­¬·±²æ �ɸ¿¬

·­ ¬¸» ­³¿´´»­¬ ½¸¿²¹» ®»¯«·®»¼ ¬± ½±²ª»®¬ Ú±®¬®¿² ·²¬± ¿

®±¾«­¬ ¿²¼ »ºº·½·»²¬ °¿®¿´´»´ ´¿²¹«¿¹»á�

̸» ¿²­©»®æ ¿ ­·³°´» ­§²¬¿½¬·½ »¨¬»²­·±²ò

׬ ´±±µ­ ¿²¼ º»»´­ ´·µ» Ú±®¬®¿² ¿²¼ ®»¯«·®»­ Ú±®¬®¿²

°®±¹®¿³³»®­ ¬± ´»¿®² ±²´§ ¿ º»© ²»© ®«´»­òþ Ö±¸² λ·¼ô

×ÍÑ Ú±®¬®¿² ݱ²ª»²»®

24

Page 25: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

̱©¿®¼­ Ú±®¬®¿² îððè

Í»» ¸¬¬°æññº±®¬®¿²©·µ·ò±®¹ñº±®¬®¿²ñ­¸±©ñÚ±®¬®¿²õîððèõ­¬¿¬«­

25

Page 26: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

26

Page 27: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

Parallel Programming with Fortran Coarrays Delivered at PRACE Advanced Training Centre, CSC IT Center for Science Ltd, Finland, September 13, 2012 David Henty, Alan Simpson (EPCC) Harvey Richardson, Bill Long (Cray)

Tutorial Overview

The Fortran Programming Model in context Basic coarray features Practical Session 1 Further coarray features Practical Session 2 Advanced coarray features Practical Session 3 Experiences with coarrays

2

The Fortran Programming Model in context

Motivation

Fortran now supports parallelism as a full first-class feature of the language Changes are minimal Performance is maintained Flexibility in expressing communication patterns

4

Programming models for HPC

The challenge is to efficiently map a problem to the architecture we have

Take advantage of all computational resources Manage distributed memories etc. Optimal use of any communication networks

The HPC industry has long experience in parallel programming Vector, threading, data-parallel, message-passing etc.

We would like to have models or combinations that are efficient safe easy to learn and use

5

Why consider new programming models?

Next-generation architectures bring new challenges: Very large numbers of processors with many cores Complex memory hierarchy even today (2011) we are at 500k cores

Parallel programming is hard, need to make this simpler Some of the models we currently use are

bolt-ons to existing languages as APIs or directives Hard to program for underlying architecture unable to scale due to overheads

So, is there an alternative to the models prevalent today? Most popular are OpenMP

6

Shared-memory directives and OpenMP

memory

threads

7

OpenMP: work distribution

memory

threads

!$OMP PARALLEL DO do i=1,32 a(i)=a(i)*2 end do

1-8 9-16 17-24 25-32

8 27

Page 28: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

OpenMP implementation

memory

threads

cpus

process

9

Shared Memory Directives

Multiple threads share global memory Most common variant: OpenMP Program loop iterations distributed to threads, more recent task features

Each thread has a means to refer to private objects within a parallel context

Terminology Thread, thread team

Implementation Threads map to user threads running on one SMP node Extensions to distributed memory not so successful

OpenMP is a good model to use within a node

10

Cooperating Processes Models

11

processes

PROBLEM

Message Passing, MPI

memory

cpu

memory

cpu

memory

cpu

12

process

MPI

memory

cpu

process 0

memory

cpu

MPI_Send

process 1

MPI_Recv

13

Message Passing

Participating processes communicate using a message-passing API Remote data can only be communicated (sent or received) via the API MPI (the Message Passing Interface) is the standard Implementation: MPI processes map to processes within one SMP node or across multiple networked nodes API provides process numbering, point-to-point and collective messaging operations Mostly used in two-sided way, each endpoint coordinates in sending and receiving

14

SHMEM

memory

cpu

process 0

memory

cpu

shmem_put(a,b

process 1

15

SHMEM

Participating processes communicate using an API Fundamental operations are based on one-sided PUT and GET Need to use symmetric memory locations Remote side of communication does not participate Can test for completion Barriers and collectives Popular on Cray and SGI hardware, also Blue Gene version To make sense needs hardware support for low-latency RDMA-type operations

16 28

Page 29: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

UPC

memory

cpu

thread

memory

cpu

memory

cpu

thread thread

17

UPC

memory

cpu

thread

memory

cpu

memory

cpu

thread thread

18

upc_forall(i=0;i<32;i++;affinity){ a[i]=a[i]*2; }

UPC

Extension to ISO C99 threads

New shared data structures shared pointers to distributed data (block or cyclic) pointers to shared data local to a thread Synchronization

Language constructs to divide up work on shared data upc_forall() to distribute iterations of for() loop

Extensions for collectives Both commercial and open source compilers available

Cray, HP, IBM Berkeley UPC (from LBL), GCC UPC

19

Fortran 2008 coarray model

Example of a Partitioned Global Address Space (PGAS) model Set of participating processes like MPI Participating processes have access to local memory via standard program mechanisms Access to remote memory is directly supported by the language

20

Fortran coarray model

memory

cpu

process

memory

cpu

memory

cpu

process process

21

Fortran coarray model

memory

cpu

process

memory

cpu

memory

cpu

process process

22

a = b[3]

Fortran coarrays

Remote access is a full feature of the language: Type checking Opportunity to optimize communication

No penalty for local memory access Single-sided programming model more natural for some algorithms

and a good match for modern networks with RDMA

23

Fortran coarrays Basic Features

29

Page 30: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

Coarray Fortran

"Coarrays were designed to answer the question: What is the smallest change required to convert Fortran

into a robust and efficient parallel language?

The answer: a simple syntactic extension. It looks and feels like Fortran and requires

Fortran programmers to learn only a few new rules."

John Reid, ISO Fortran Convener

25

Some History

Introduced in current form by Numrich and Reid in 1998 as a simple extension to Fortran 95 for parallel processing

Many years of experience, mainly on Cray hardware

A set of core features are now part of the Fortran standard ISO/IEC 1539-1:2010

Additional features are expected to be published in a Technical Specification in due course.

26

How Does It Work?

SPMD - Single Program, Multiple Data single program replicated a fixed number of times

Each replication is called an image

Images are executed asynchronously execution path may differ from image to image some situations cause images to synchronize

Images access remote data using coarrays

Normal rules of Fortran apply

27

Arrays or scalars that can be accessed remotely images can access data objects on any other image

Additional Fortran syntax for coarrays Specifying a codimension declares a coarray

these are equivalent declarations of a array x of size 10 on each image x is now remotely accessible coarrays have the same size on each image!

What are coarrays?

28

real, dimension(10), codimension[*]:: x real :: x(10)[*]

Accessing coarrays

integer arrays a and b declared to be size 4 on all images copy array a from remote image n into local array b () for local access [] for remote access e.g. for two images and n = 2:

29

integer :: a(4)[*], b(4)[*] !declare coarrays b(:) = a(:)[n] ! copy

image 1 image 2

a

b b

a 1 2 3 4

8 7 6 5 10 11 12 13

7 3 9 2

2 9 3 7 2 9 3 7

Be careful when updating coarrays: If we get remote data was it valid? Could another process send us data and overwrite something we have not yet used? How do we know that data sent to us has arrived?

Fortran provides synchronisation statements For example, barrier for synchronisation of all images: do not make assumptions about execution timing on images

unless executed after synchronisation Note there is implicit synchronisation at program start

Synchronisation

30

sync all

Two intrinsics provide index of this image and number of images

this_image() (image indexes start at 1) num_images()

Retrieving information about images

31

real :: x[*] if(this_image() == 1) then read *,x do image = 2,num_images() x[image] = x end do end if sync all

Making remote references

We used a loop over images

32

Note that array indexing within the coindex is not allowed so we can not write

do image = 2,num_images() x[image] = x end do

x[2:num_images()] = x ! illegal

30

Page 31: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

Data usage

coarrays have the same size on every image Declarations:

round brackets () describe rank, shape and extent of local data square brackets [] describe layout of images that hold local data

Many HPC problems have physical quantities mapped to n-dimensional grids You need to implement your view of global data from the local coarrays as Fortran does not provide the global view

You can be flexible with the coindexing (see later) You can use any access pattern you wish

33

Data usage

processors 4 elements per processor = 4 coarrays on 4 images

34

A

image 1 image 2 image 3 image 4

ca(1:4)[1] ca(1:4)[2] ca(1:4)[3] ca(1:4)[4]

integer :: ca(4)[*] do image=1,num_images() print *,ca(:)[image] end do

1D cyclic data access

coarray declarations remain unchanged but we use a cyclic access pattern

35

A

image 1 image 2 image 3 image 4

... ... ... ...

integer :: ca(4)[*] do i=1,4 do image=1,num_images() print *,ca(i)[image] end do end do

Synchronisation

code execution on images is independent programmer has to control execution using synchronisation

synchronise before accessing coarrays ensure content is not updated from remote images before you can use it

synchronise after accessing coarrays ensure new content is available to all images

implicit synchronisation after variable declarations at first executable statement

guarantees coarrays exist on all images when your first program statement is executed

We will revisit this topic later

36

Example: maximum of array

real :: a(10) real :: maximum[*] call random_number(a) maximum = maxval(a) sync all if (this_image() == 1) then do image = 2, num_images() maximum = max(maximum, maximum[image]) end do do image = 2, num_images() maximum[image] = maximum end do end if sync all

37

implicit synchronisation

ensure all images set local maximum

ensure all images have copy of maximum value

Recap

We now know the basics of coarrays declarations references with [] this_image() and num_images() sync all

Now consider a full program example...

38

Example2: Calculate density of primes

39

program pdensity implicit none integer, parameter :: n=10000000, nimages=8 integer start,end,i integer, dimension(nimages) :: nprimes[*] real density start = (this_image()-1) * n/num_images() + 1 end = start + n/num_images() - 1 nprimes(this_image())[1] = num_primes(start,end) sync all

Example2: Calculate density of primes

40

if (this_image()==1) then nprimes(1)=sum(nprimes) density=real(nprimes(1))/n print *,"Calculating prime density on", & & num_images(),"images" print *,nprimes(1),'primes in',n,'numbers' write(*,'(" density is ",2Pf0.2,"%")')density write(*,'(" asymptotic theory gives ", & & 2Pf0.2,"%")')1.0/(log(real(n))-1.0) end if

31

Page 32: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

Example2: Calculate density of primes

41

Calculating prime density on 2 images 664580 primes in 10000000 numbers density is 6.65% asymptotic theory gives 6.61%

Launching a coarray program

The Fortran standard does not specify how a program is launched The number of images may be set at compile, link or run-time A compiler could optimize for a single image

Examples on Linux Cray XE aprun n 16000 solver g95 ./solver --g95 -images=2

42

Observations so far on coarrays

Natural extension, easy to learn Makes parallel parts of program obvious (syntax) Part of Fortran language (type checking, etc) No mapping of data to buffers (or copying) or creation of complex types (as we might have with MPI) Compiler can optimize for communication More observations later...

43

Exercise Session 1

Look at the Exercise Notes document for full details

number of images Extend the simple Fortran code provided in order to perform operations on parts of a picture using coarrays

44

Backup Slides HPF model

45

High Performance Fortran (HPF)

Data Parallel programming model Single thread of control Arrays can be distributed and operated on in parallel Loosely synchronous Parallelism mainly from Fortran 90 array syntax, FORALL and intrinsics. This model popular on SIMD hardware (AMT DAP, Connection Machines) but extended to clusters where control thread is replicated

46

HPF

47

memory

pe

memory

cpu

memory

pe

memory

pe

memory

pe

HPF

48

memory

pe

memory

cpu

memory

pe

memory

pe

memory

pe

A=SQRT(A)

A (distributed)

32

Page 33: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

More Coarray Features Parallel Programming with Fortran Coarrays Delivered at PRACE Advanced Training Centre, CSC IT Center for Science Ltd, Finland, September 13, 2012 David Henty, Alan Simpson (EPCC) Harvey Richardson, Bill Long (Cray)

Overview

Multiple Dimensions and Codimensions Allocatable Coarrays and Components of Coarray Structures Coarrays and Procedures

2

Mapping data to images

3

images

PROBLEM

PRESSURE Physical quantity

images

P(m,n) Variables/arrays

P(m,n)[*]

P(m,n)[k,*]

2D Data

- assemble rather than distribute

- Can assemble a 2D data structure from 1D arrays integer :: ca(4)[*]

4

image 1

image 2

image 3

image 4

5

2D Data

However, images are not restricted to a 1D arrangement For example, we can arrange images in 2x2 grid

coarrays with 2 codimensions integer :: ca(4)[2,*]

image 1 image 2 image 3 image 4

ca(:)[1,1] ca(:)[1,2]

ca(:)[2,1] ca(:)[2,2]

2D Local Array on 2D Grid

6

A

image 1

ca(1:4,1:4)[1,1]

image 2

image 3

image 4

ca(1:4,1:4)[1,2]

ca(1:4,1:4)[2,1] ca(1:4,1:4)[2,2]

global access: ca(3,1)[2,2] local access: ca(3,1)

Coarray Subscripts

Fortran arrays defined by rank, bounds and shape integer, dimension(10,4) :: array

rank 2 lower bounds 1, 1; upper bounds 10, 4 shape [10, 4]

Coarray Fortran adds corank, cobounds and coshape integer :: array(10,4)[3,*]

corank 2 lower cobounds 1, 1; upper cobounds 3, m coshape [3, m] m would be ceiling(num_images()/3)

7

Multiple Codimensions

Coarrays with multiple Codimensions: character :: a(4)[2, *] !2D grid of images

for 4 images, grid is 2x2; for 16 images, grid is 2x8

real :: b(8,8,8)[10,5,*] !3D grid of images 8x8x8 local array; with 150 images, grid is 10x5x3

integer :: c(6,5)[0:9,0:*] !2D grid of images lower cobounds [ 0, 0 ]; upper cobounds [ 9,n] useful if you want to interface with MPI or want C like coding

Sum of rank and corank should not exceed 15 Flexibility with cobounds

can set all but final upper cobound as required

8

Page 34: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

Codimensions: What They Mean

for that coarray only

A map so an image can find the coarray on any other image access the coarray using its grid coordinates

e.g. character a(4)[2, *] on 6 images gives a 2 x 3 image grid usual Fortran subscript order to determine image index

9

image 1

3 2 1

1

2 image 6

image 3

image 2 image 4

image 5

a(2)[2,3]

a(4)[1,2]

Axis 1

Axis 2

10

Codimensions and Array-Element Order

Storage order for multi-dimensional Fortran arrays

real p(2,3,8)

Location Element 1 p(1,1,1) 2 p(2,1,1) 3 p(1,2,1) 4 p(2,2,1) 5 p(1,3,1) 6 p(2,3,1) 7 p(1,1,2) 8 p(2,1,2) 48 p(2,3,8)

Ordering of images in multi-dimensional cogrids

real q(4)[2,3,*]

Image Elements 1 q(1:4)[1,1,1] 2 q(1:4)[2,1,1] 3 q(1:4)[1,2,1] 4 q(1:4)[2,2,1] 5 q(1:4)[1,3,1] 6 q(1:4)[2,3,1] 7 q(1:4)[1,1,2] 8 q(1:4)(2,1,2] 48 q(1:4)[2,3,8]

Multi Codimensions: An Example Domain Decomposition

() gives local domain size [] provides image grid and easy access to other images

2D domain decomposition of Braveheart

Global data is 360 x 192

Domain decomposition on 8 images with 4 x 2 grid local array size: (360 / 4) x (192 / 2) = 90 x 96 declaration = real :: localPic(90,96)[4,*]

11

360

192

Axis 1

Axis 2

Multi Codimensions: An Example Domain Decomposition

() gives local domain size [] provides image grid and easy access to other images

2D domain decomposition of Braveheart

Global data is 360 x 192

Domain decomposition on 8 images with 4 x 2 grid local array size: (360 / 4) x (192 / 2) = 90 x 96 declaration = real :: localPic(90,96)[4,*]

12

image 1

image 3

image 4

image 5

image 6

image 7

image 8

image 2

90

96 3

2 1

1

2

4

3

2 1

1

2

4

Axis 1

Axis 2

this_image() & image_index()

this_image()

returns the image index, i.e., number between 1 and num_images()

this_image(z)

returns the rank-one integer array of cosubscripts for the calling image corresponding to the coarray z this_image(z, dim) returns cosubscript of codimension dim of z

image_index(z, sub) returns image index with cosubscripts sub for coarray z sub is a rank-one integer array

13

Example 1

14

PROGRAM CAF_Intrinsics

real :: b(90,96)[4,*]

this_image()

this_image(b)

image_index(b,[3,2])

END PROGRAM CAF_Intrinsics

3

2 1

1

2

4

this_image() = 2

this_image(b) = [2, 1]

image_index(b,[3,2]) = 7

this_image() = 5

this_image(b) = [1, 2]

image_index(b,[3,2]) = 7

this_image() = 7

this_image(b) = [3, 2]

image_index(b,[3,2]) = 7

Axis 1

Axis 2

Example 2

15

PROGRAM CAF_Intrinsics

real :: c(4,4,4)[5,-1:4,*]

this_image()

this_image(c)

image_index(c,[1,0,4])

END PROGRAM CAF_Intrinsics this_image() = 13

this_image(c) = [3, 1, 1]

image_index(c,[1,0,4]) = 96 this_image() = 90

this_image(c) = [5, 4, 3]

image_index(c,[1,0,4]) = 96

this_image() = 96

this_image(c) = [1, 0, 4]

image_index(c,[1,0,4]) = 96

Axis 1

Axis 2

Axis 3

Boundary Swapping PROGRAM CAF_HaloSwap integer, parameter :: nximages = 4, nyimages = 2 integer, parameter :: nxlocal = 90, nylocal = 96 real :: pic(0:nxlocal+1, 0:nylocal+1)[nximages,*] ! Declare coarray with halos integer :: myimage(2) ! Array for my row & column coordinates myimage = this_image(pic) ! Find my row & column coordinates

! Initialise pic on each image

sync all ! Halo swap if (myimage(1) > 1) & pic(0,1:nylocal) = pic(nxlocal,1:nylocal)[myimage(1)-1,myimage(2)] if (myimage(1) < nximages) & pic(nxlocal+1,1:nylocal) = pic(1,1:nylocal)[myimage(1)+1,myimage(2)] if (myimage(2) > 1) & pic(1:nxlocal,0) = pic(1:nxlocal,nylocal)[myimage(1),myimage(2)-1] if (myimage(2) < nyimages) pic(1:nxlocal,nylocal+1) = pic(1:nxlocal,1)[myimage(1),myimage(2)+1] sync all

! Update pic on each image

END PROGRAM CAF_HaloSwap

16

Find cosubscripts

Ensures pic initialised before accessed by other images

Ensures all images have got old values before pic is updated

Page 35: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

Allocatable Coarrays

Can have allocatable Coarrays real, allocatable :: x(:)[:], s[:,:] n = num_images() allocate(x(n)[*], s[4,*])

Must specify cobounds in allocate statement The size and value of each bound and cobound must be same on all images.

allocate(x(this_image())[*]) ! Not allowed

allocate statement involving coarrays

deallocate statements involving coarrays

17

Differently Sized Coarray Components A coarray structure component can vary in size per image Declare a coarray of derived type with a component that is

18

!Define data type with allocatable component

type diffSize

real, allocatable :: data(:)

end type diffSize

!Declare coarray of type diffSize

type(diffSize) :: x[*]

! Allocate x%data to a different size on each image

allocate(x%data(this_image())

Pointer Coarray Structure Components

We are allowed to have a coarray that contains components that are pointers Note that the pointers have to point to local data We can then access one of the pointers on a remote image to get at the data it points to This technique is useful when adding coarrays into an existing MPI code

We can insert coarray code deep in call tree without changing many subroutine argument lists

Example follows... 19

Pointer Coarray Structure Components... Existing non-coarray arrays u,v,w Create a type (coords) to hold pointers (x,y,z) that we use to point to x,y,z. We can use the vects coarray to access u, v, w.

20

subroutine calc(u,v,w)

real, intent(in), target, dimension(100) :: u,v,w

type coords

real, pointer, dimension(:) :: x,y,z

end type coords

type(coords), save :: vects[*]

vects%x => u ; vects%y => v ; vects%z => w

sync all

firstx = vects[1]%x(1)

Coarrays and Procedures

An explicit interface is required if a dummy argument is a coarray Dummy argument associated with coarray, not a copy

avoids synchronisation on entry and return Other restrictions on passing coarrays are:

the actual argument should be contiguous a(:,2) is OK, but a(2,:) is not contiguous

or the dummy argument should be assumed shape ... to avoid copying

Function results cannot be coarrays

21 21

Coarrays as Dummy Arguments

As with standard Fortran arrays, the coarray dummy arguments in procedures can be:

Explicit shape: each dimension of a coarray declared with explicit value Assumed shape: extents and bounds determined by actual array Assumed size: only size determined from actual array Allocatable: the size and shape can be determined at run-time

22 22

subroutine s(n, a, b, c, d)

integer :: n

real :: a(n) [n,*] ! explicit shape - permitted

real :: b(:,:) [*] ! assumed shape - permitted

real :: c(n,*) [*] ! assumed size - permitted

real, allocatable :: d(:) [:,:] ! allocatable - permitted

23

Assumed Size Coarrays Allow the coshape to be remapped to corank 1 program cmax real, codimension[8,*] :: a(100), amax

a = [ (i, i=1,100) ] * this_image() / 100.0

amax = maxval( a ) sync all

amax = AllReduce_max(amax) ...

contains real function AllReduce_max(r) result(rmax) real :: r[*] sync all rmax = r do i=1,num_images() rmax = max( rmax, r[i] )

end do sync all

end function AllReduce_max

24

Coarrays Local to a Procedure Coarrays declared in procedures must have save attribute

unless they are dummy arguments or allocatable save attribute: retains value between procedure calls avoids synchronisation on entry and return

Automatic coarrays are not permitted Automatic array: local array whose size depends on dummy arguments would require synchronisation for memory allocation and deallocation would need to ensure coarrays have same size on all images

subroutine t(n)

integer :: n

real :: temp(n)[*] ! automatic - not permitted

integer, save :: x(4)[*] ! coarray with save attribute

integer :: y(4)[*] ! not saved not permitted

35

Page 36: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

Summary

Coarrays with multiple codimensions used to create a grid of images

() gives local domain information [] gives an image grid with easy access to other images

Can be used in various ways to assemble a multi-dimensional data set this_image() and image_index()

are intrinsic functions that give information about the images in an multi-codimension grid

Flexibility from non-coarray allocatable and pointer components of coarray structures Coarrays can be allocatable, can be passed as arguments to procedures, and can be dummy arguments

25

36

Page 37: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

Advanced Features Parallel Programming with Fortran Coarrays Delivered at PRACE Advanced Training Centre, CSC IT Center for Science Ltd, Finland, September 13, 2012 David Henty, Alan Simpson (EPCC) Harvey Richardson, Bill Long (Cray)

Advanced Features: Overview

Execution segments and Synchronisation Non-global Synchronisation Critical Sections Visibility of changes to memory Other Intrinsics Miscellaneous features Future developments

2

More on Synchronisation

We have to be careful with one-sided updates If we read remote data, was it valid? Could another process send us data and overwrite something we have not yet used? How do we know when remote data has arrived?

The standard introduces execution segments to deal with this: segments are bounded by image control statements

The standard can be summarized as follows: If a variable is defined in a segment, it must not be referenced, defined, or become undefined in another segment unless the segments are ordered John Reid

3

Execution Segments

4

iimage synchronisation points

program hot double precision :: a(n) double precision :: temp(n)[*] !... if (this_image() == 1) then do i=1, num_images() read *,a temp(:)[i] = a end do end if temp = temp + 273d0 sync all

call ensemble(temp)

double precision :: temp(n)[*]!...

temp = temp + 273d0sync all

image 1

2

program hot double precision :: a(n) double precision :: temp(n)[*] !... if (this_image() == 1) then do i=1, num_images() read *,a temp(:)[i] = a end do end if temp = temp + 273d0 sync all

call ensemble(temp)

double precision :: temp(n)[*]

temp = temp + 273d0sync all

image 2

ordering

Synchronisation mistakes

This code is wrong

5

subroutine allreduce_max_getput(v,vmax) double precision, intent(in) :: v[*] double precision, intent(out) :: vmax[*] integer i sync all vmax=v if (this_image()==1) then do i=2,num_images() vmax=max(vmax,v[i]) end do do i=2,num_images() vmax[i]=vmax end do end if sync all

Synchronisation mistakes

It breaks the rules

6

subroutine allreduce_max_getput(v,vmax) double precision, intent(in) :: v[*] double precision, intent(out) :: vmax[*] integer i sync all vmax=v if (this_image()==1) then do i=2,num_images() vmax=max(vmax,v[i]) end do do i=2,num_images() vmax[i]=vmax end do end if sync all

Synchronisation mistakes

This is ok

7

subroutine allreduce_max_getput(v,vmax) double precision, intent(in) :: v[*] double precision, intent(out) :: vmax[*] integer i sync all if (this_image()==1) then vmax=v do i=2,num_images() vmax=max(vmax,v[i]) end do do i=2,num_images() vmax[i]=vmax end do end if sync all

More about sync all

Usually all images execute the same sync all statement But this is not a requirement...

Images execute different code with different sync all statements All images execute the first sync all they come across

this may match an arbitrary sync all on another image causing incorrect execution and/or deadlock

wrong answers

8 37

Page 38: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

More about sync all e.g. Image practical: wrong answer

9

All images NOT executing this sync all

! Do halo swap, taking care at the upper and lower picture boundaries if (myimage < numimage) then oldpic(1:nxlocal, nylocal+1) = oldpic(1:nxlocal, 1)[myimage+1] sync all end if ! ... and the same for down halo ! Now update the local values of newpic ... ! Need to synchronise to ensure that all images have finished reading the ! oldpic halo values on this image before overwriting it with newpic oldpic(1:nxlocal,1:nylocal) = newpic(1:nxlocal,1:nylocal) ! Need to synchronise to ensure that all images have finished updating ! their oldpic arrays before this image reads any halo data from them sync all

sync all

All images ARE executing this sync all

10

More about sync all sync images(imageList)

Performs a synchronisation of the image executing sync images with each of the images specified in imageList

imageList can be an array or a scalar if (myimage < numimage) then oldpic(1:nxlocal, nylocal+1) = oldpic(1:nxlocal, 1)[myimage+1] end if if (myimage > 1) then oldpic(1:nxlocal, 0) = oldpic(1:nxlocal, nylocal)[myimage-1] end if ! Now perform local pairwise synchronisations if (myimage == 1 ) then sync images( 2 ) else if (myimage == numimage) then sync images( numimage-1 ) else sync images( (/ myimage-1, myimage+1 /) ) end if

11

Other Synchronisation

Critical sections

Limit execution of a piece of code to one image at a time

e.g. calculating global sum on master image

integer :: a(100)[*]

integer :: globalSum[*] = 0, localSum

... ! Initialise a on each image

localSum = SUM(a) !Find localSum of a on each image

critical

globalSum[1] = globalSum[1] + localSum

end critical

12

Other Synchronisation

sync memory

Coarray data held in caches/registers made visible to all images

requires some other synchronisation to be useful

unlikely to be used in most coarray codes

Example usage: Mixing MPI and coarrays loop: coarray operations sync memory call MPI_Allreduce(...)

sync memory implied for sync all and sync images

13

Other Synchronisation

lock and unlock statements

Control access to data defined or referenced by more than one image

as opposed to critical which controls access to lines of code

USE iso_fortran_env module and define coarray of type(lock_type)

e.g. to lock data on image 2

type(lock_type) :: qLock[*]

lock(qLock[2])

!access data on image 2

unlock(qLock[2])

Other Intrinsic functions lcobound(z)

Returns lower cobounds of the coarray z lcobound(z,dim) returns lower cobound for codimension dim of z

ucobound(z) Returns upper cobounds of the coarray z lcobound(z,dim) returns upper cobound for codimension dim of z

real :: array(10)[4,0:*] on 16 images lcobound(array) returns [ 1, 0 ] ucobound(array) returns [ 4, 3 ]

14

More on Cosubscripts

integer :: a[*] on 8 images cosubscript a[9] is not valid

real :: b(10)[3,*] on 8 images ucobound(b) returns [ 3, 3 ] cosubscript b[2,3]

cosubscript b[3,3] is invalid (image 9) Programmer needs to make sure that cosubscripts are valid

image_index returns 0 for invalid cosubscripts

15

16

Assumed Size Coarrays Codimensions can be remapped to corank greater than 1

useful for determining optimal extents at runtime program 2d real, codimension[*] :: picture(100,100) integer :: numimage, numimagex, numimagey numimage = num_images() call get_best_2d_decomposition(numimage,& numimagex, numimagey) ! Assume this ensures numimage=numimagex*numimagey call dothework(picture, numimagex, numimagey) ... contains

subroutine dothework(array, m, n) real, codimension[m,*] :: array(100,100)

... end subroutine dothework

38

Page 39: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

I/O

Each image has its own set of input/output units units are independent on each image Default input unit is preconnected on image 1 only

, Default output unit is available on all images

, It is expected that the implementation will merge records from each image into one stream

17

Program Termination

STOP or END PROGRAM statements initiate normal termination which includes a synchronisation step

normal termination Other images can test for this using STAT= specifier to synchronisation calls or allocate/deallocate

test for STAT_STOPPED_IMAGE (defined in ISO_FORTRAN_ENV module)

The ERROR STOP statement initiates error termination and it is expected all images will be terminated.

18

Coarray Technical Specification

Additional coarray features may be described in a Technical Specification (TS) Developed as part of the official ISO standards process Work in progress and the areas of discussion are:

image teams collective intrinsics for coarrays atomics

19

TS: Teams

Often useful to consider subsets of processes e.g. MPI communicators

Subsets not currently supported in Fortran, e.g. sync all: all images sync images: pairwise mutual synchronisation

Extension involves TEAMS of images user creates teams specified as an argument to various functions

20

TS: Teams...

To define a set of images as a team call form_team(oddteam,[ (i,i=1,n,2) ])

To synchronise the team

sync team(oddteam)

To determine images that constitute a team:

oddimages=team_images(oddteam)

21

TS: Collectives

Collective operations a key part of real codes broadcast global sum ...

Supported in other parallel models OpenMP reductions MPI_Allreduce

Not currently supported for coarrays efficient implementation by hand is difficult calling external MPI routines rather ugly

22

TS: Collective intrinsic subroutines

Collectives, with in/out arguments, invoked by same statement on all images (or team of images) Routines

CO_BCAST CO_SUM and other reduction operations basically reproduce the MPI functionality

Arguments include SOURCE, RESULT, TEAM Still discussion on need for implicit synchronisation and argument types (for example non-coarray arguments)

23

TS: Atomic operations

Critical or lock synchronisation sometimes overkill counter[1] = counter[1] + 1

Simple atomic operations can be optimised e.g. OpenMP atomic

!$OMP atomic sharedcounter = sharedcounter + 1

New variable types and operations for coarrays

24 39

Page 40: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

TS: Atomic variables

Fortran already includes some atomic support (define,ref) TS expands on this to supports atomic compare and swap,

integer (atomic_int_kind) :: counter[*] call atomic_define(counter[1],0) call atomic_add(counter[1],1) call atomic_ref(countval,counter[1])

25

40

Page 41: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

Experiences with Coarrays Parallel Programming with Fortran Coarrays Delivered at PRACE Advanced Training Centre, CSC IT Center for Science Ltd, Finland, September 13, 2012 David Henty, Alan Simpson (EPCC) Harvey Richardson, Bill Long (Cray

Overview

Implementations Performance considerations Where to use the coarray model Coarray benchmark suite Examples of coarrays in practice References Wrapup

2

Implementation Status

History of coarrays dates back to Cray implementations Expect support from vendors as part of Fortran 2008 G95 had multi-image support in 2010

has not been updated for some time gfortran

Introduced single-image support at version 4.6 Intel: multi-process coarray support in Intel Composer XE 2011 (based on Fortran 2008 draft) Runtimes are SMP, GASNet and compiler/vendor runtimes

GASNet has support for multiple environments (IB, Myrinet, MPI, UDP and Cray/IBM systems) so could be an option for new implementations

3

Implementation Status (Cray)

Cray has supported coarrays and UPC on various architectures over the last decade (from T3E) Full PGAS support on the Cray XT/XE

Cray Compiling Environment 7.0 Dec 2008 Current release is Cray Compiler Environment 7.4 Full Fortran 2008 coarray support Full Fortran 2003 with some Fortran 2008 features

Fully integrated with the Cray software stack Same compiler drivers, job launch tools, libraries Integrated with Craypat Cray performance tools Can mix MPI and coarrays

4

Implementations we have used

Cray X1/X2 Hardware supports communication by direct load/store Very efficient with low overhead

Cray XT PGAS (UPC,CAF) layered on GASNet/portals (so messaging) Not that efficient

Cray XE PGAS layered on DMAPP portable layer over Gemini network hardware Intermediate between XT and X1/2

Intel Composer XE 2011 SMP and message-passing runtimes

5

Implementations we have used...

g95 on shared-memory Using cloned process images on Linux This is not being actively developed

6

Intel XE on Ubuntu VM

7

When to use coarrays

Two obvious contexts Complete application using coarrays Mixed with MPI

As an incremental addition to a (potentially large) serial code As an incremental addition to an MPI code (allowing reuse of most of the existing code) Use coarrays for some of the communication

opportunity to express communication much more simply opportunity to overlap communication

For subset synchronisation Work-sharing schemes

8 41

Page 42: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

Adding coarrays to existing applications

Constrain use of coarrays to part of application Move relevant data into coarrays Implement parallel part with coarray syntax Move data back to original structures

Use coarray structures to contain pointers to existing data Place relevant arrays in global scope (modules)

avoids multiple declarations Declare existing arrays as coarrays at top level and through the complete call tree (some effort but only requires changes to declarations)

9

Performance Considerations

What is the latency? Do you need to avoid strided transfers? Is the compiler optimising the communication for target architecture?

Is it using blocking communication within a segment when it does no need to? Is it optimising strided communication? Can it pattern-match loops to single communication primitives or collectives?

10

Performance: Communication patterns

Try to avoid creating traffic jams on the network, such as all images storing to a single image. The following examples show two ways to implement an ALLReduce() function using coarrays

11

AllReduce (everyone gets)

All images get data from others simultaneously

12

function allreduce_max_allget(v) result(vmax) double precision :: vmax, v[*] integer i sync all vmax=v do i=1,num_images() vmax=max(vmax,v[i]) end do

AllReduce (everyone gets, optimized)

All images get data from others simultaneously but this is optimized so communication is more balanced

13

Have seen this much faster

!... sync all vmax=v do i=this_image()+1,num_images() vmax=max(vmax,v[i]) end do do i=1,this_image()-1 vmax=max(vmax,v[i]) end do

Synchronization

For some algorithms (finite- sync all but pairwise synchronization using sync images(image)

14

Synchronization (one to many)

Often one image will be communicating with a set of images In general not a good thing to do but assume we are... Tempting to use sync all

15

Synchronisation (one to many)

If this is all images then could do if ( this_image() == 1) then sync images(*) else sync images(1) end if

Note that sync all is likely to be fast so is an alternative

16 42

Page 43: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

Synchronisation (one to many)

For a subset use this if ( this_image() == image_list(1)) then sync images(image_list) else sync images(image_list(1)) end if

instead of sync images(image_list) for all of them which is likely to be slower 17

Collective Operations

If you need scalability to a large number of images you may need to temporarily work around current lack of collectives

Use MPI for the collectives if MPI+coarrays is supported Implement your own but this might be hard

For reductions of scalars a tree will be the best to try For reductions of more data you would have to experiment and this may depend on the topology

Coarrays can be good for collective operations where there is an unusual communication pattern that does not match what MPI collectives provide there is opportunity to overlap communication with computation

18

Tools: debugging and profiling

Tool support should improve once coarray takeup increases Cray Craypat tool supports coarrays Totalview works with coarray programs on Cray systems Allinea DDT

support for coarrays and UPC for a number of compilers is in public beta and will be in DDT 3.1

Scalasca

Currently investigating how PGAS support can be incorporated.

19

Debugging Synchronisation problems

One-sided model is tricky because subtle synchronisation errors change data TRY TO GET IT RIGHT FIRST TIME

look carefully at the remote operations in the code Think about synchronisation of segments especially look for early arriving communications trashing your data at the start of loops (this one is easy to miss)

One way to test is to put sleep() calls in the code Delay one or more images Delay master image, or other images for some patterns

20

Coarray Benchmark Suite

Developed by David Henty at EPCC Aims to test fundamental features of a coarray implementation

We can test basic language syntax for communication of data and synchronization Need to choose communication pattern and data access There is some scope for a given communication pattern:

array syntax, loops over array elements inline code or use subroutines Choices can reveal compiler capabilities

21

Initial Benchmark

Single contiguous point-to-point read and write Multiple contiguous point-to-point read and write Strided point-to-point read and write All basic synchronization operations Various representative communication patterns Halo-swap in multi-dimensional regular domain decomposition All communications include synchronisation cost

use double precision (8-byte) values as the basic type use Fortran array syntax

Synchronisations overhead measured separately as overhead = (delay + sync) delay 22

Platforms

Limited compiler support at present results presented from Cray systems

Cray Compiler Environment (CCE) 7.4.1

Cray XT6 MPP with dual 12-core Opteron Magny-Cours nodes and Cray Seastar2+ torus interconnect. Coarrays implemented using GASNET. Cray XE6 Same nodes as XT6 but with Gemini torus interconnect which support RDMA

23

Pingpong

24

0

2000

4000

6000

8000

1 10 100 1000 10000 100000 1000000 10000000message length (doubles)

Point-to-point comms

XE6 put

XT6 put

XT6 MPI

XE6 MPI

Page 44: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

Pingpong (small message regime)

25

sync images put latency MPI latency XT6 33.1 45.3 7.4 XE6 3.0 3.7 1.6

0

20

40

60

80

1 4 16 64 256 1024 4096message length (doubles)

Point-to-point comms

XE6 put

XT6 put

XE6 MPI

XT6 MPI

Global Synchronisation

26

XT coarray implementation not keeping up with MPI

0

1000

2000

3000

16 32 64 128 256 512 1024 2048images

XT6 Synchronisation

sync allMPI Barrier * 100

Global Synchronisation

27

Much faster than the previous XT results

0

10

20

30

40

50

4 16 64 256 1024 4096 16384images

XE6 Synchronisation

XE6 sync all

XE6 MPI_Barrier

Global Synchronisation

28

Also measured sync images various point-to-point patterns

Observed that sync images is usually faster than sync all on more than 512 images

3D Halo Swap on XE6 (weak scaling V=50^3)

29

0

50

100

150

8 32 128 512 2048 8192 32768images

put p2p

put all

get p2p

get all

Examples of coarrays in practice

Puzzles Distributed Remote Gather HIMENO Halo-Swap Gyrokinetic Fusion Code

30

Solving Sudoku Puzzles

31

Going Parallel

Started with serial code Changed to read in all 125,000 puzzles at start Choose work-sharing strategy

One image (1) holds a queue of puzzles to solve Each image picks work from the queue and writes result back to queue

Arbitrarily decide to parcel work as blocksize = npuzzles /( 8* num_images() )

32

Page 45: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

Data Structures

33

use,intrinsic iso_fortran_env type puzzle integer :: input(9,9) integer :: solution(9,9) end type puzzle type queue type (lock_type) :: lock integer :: next_available = 1 type(puzzle),allocatable :: puzzles(:) end type queue type(queue),save :: workqueue[*] type(puzzle) :: local_puzzle integer,save :: npuzzles[*],blocksize[*]

Input

34

if (this_image() == 1) then ! After file Setup. inquire (unit=inunit,size=nbytes) nrecords = nbytes/10 npuzzles = nrecords/9 blocksize = npuzzles / (num_images()*8)

write (*,*) "Found ", npuzzles allocate (workqueue%puzzles(npuzzles)) do i = 1, npuzzles call read_puzzles( & & workqueue%puzzles(i)%input,inunit, &

& error) end do close(inunit)

Core program structure

35

! After coarray data loaded sync all blocksize = blocksize[1] npuzzles = npuzzles[1] done = .false. workloop: do ! Acquire lock and claim work

! Solve our puzzles end do workloop

Acquire lock and claim work

36

! Reserve the next block of puzzles lock (workqueue[1]%lock) next = workqueue[1]%next_available if (next <= npuzzles) then istart = next iend = min(npuzzles, next+blocksize-1) workqueue[1]%next_available = iend+1 else done = .true. end if unlock (workqueue[1]%lock) if (done) exit workloop

Solve the puzzles and write back

37

! Solve those puzzles do i = istart,iend

local_puzzle%input = & & workqueue[1]%puzzles(i)%input call sudoku_solve & & (local_puzzle%input,local_puzzle%solution) workqueue[1]%puzzles(i)%solution = & & local_puzzle%solution end do

Output the solutions

38

! Need to synchronize puzzle output updates sync all if (this_image() == 1) then open (outunit,file=outfile,iostat=error) do i = 1, npuzzles call write_puzzle & & (workqueue%puzzles(i)%input, & & workqueue%puzzles(i)%solution,outunit,error)

end do

More on the Locking

We protected access to the queue state by lock and unlock During this time no other image can acquire the lock

We need to have discipline to only access data within the window when we have the lock There is no connection with the lock variable and the other elements of the queue structure

The unlock is acting like sync memory If one image executes an unlock... Another image getting the lock is ordered after the first image

39

Summary and Commentary

We implemented solving the puzzles using a work-sharing scheme with coarrays Scalability limited by serial work done by image 1 I/O

Parallel I/O (deferred to TS) with multiple images running distributed work queues. Defer the character-integer format conversion to the solver, which is executed in parallel.

Lock contention Could use distributed work queues, each with its own lock.

40 45

Page 46: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

Distributed remote gather

The problem is how to implement the following gather loop on a distributed memory system

41

The array table is distributed across the processors, while index and buffer are replicated

access patterns

REAL :: table(n), buffer(nelts) INTEGER :: index(nelts) ! nelts << n ... DO i = 1, nelts buffer(i) = table(index(i)) ENDDO

Remote gather: MPI implementation

42

IF (mype.eq.0)THEN isum=0 ! PE0 gathers indices to send out to individual PEs DO i=1,nelts pe =(index(i)-1)/nloc isum(pe)=isum(pe)+1 who(isum(pe),pe) = index(i) ENDDO ! send out count and indices to PEs DO i = 1, npes-1 CALL MPI_SEND(isum(i),1,MPI_INTEGER,i,10. IF(isum(i).gt.0)THEN CALL MPI_SEND(who(1,i),isum(i),... ENDIF ENDDO ! now wait to receive values and scatter them. DO i = 1,isum(0) offset = mod(who(i,0)-1,nloc)+1 buff(i,0) = mpi_table(offset) ENDDO DO i = 1,npes-1 IF(isum(i).gt.0)THEN CALL MPI_RECV(buff(1,i),isum(i),... ENDIF ENDDO

DO i=nelts,1,-1 pe =(index(i)-1)/nloc offset = isum(pe) mpi_buffer(i) = buff(offset,pe) isum(pe) = isum(pe) 1 ENDDO ELSE !IF my_rank.ne.0 ! Each PE gets the list and sends the values to PE0 CALL MPI_RECV(my_sum,1,MPI_INTEGER,... IF(my_sum.gt.0)THEN CALL MPI_RECV(index,my_sum,MPI_INTEGER,... DO i = 1, my_sum offset = mod(index(i)-1,nloc)+1 mpi_buffer(i) = mpi_table(offset) ENDDO CALL MPI_SEND(mpi_buffer,my_sum,... ENDIF ENDIF

MPI rank 0 controls the index and receives the values from the other ranks

Remote gather: coarray implementation (get)

43

IF (myimg.eq.1) THEN DO i=1,nelts pe =(index(i)-1)/nloc+1 offset = MOD(index(i)-1,nloc)+1 caf_buffer(i) = caf_table(offset)[pe] ENDDO ENDIF

Image 1 gets the values from the other images

Remote gather: coarray vs MPI

Coarray implementations are much simpler Coarray syntax allows the expression of remote data in a natural way no need of complex protocols Coarray implementation is orders of magnitude faster for small numbers of indices

44

1

10

100

1000

Number of Elements (nelts)

MPI to coarray ratio (1024 PEs)

HIMENO

HIMENO Halo-Swap benchmark

Looked at a distributed implementation for GPUs When distributed this gives a stencil computation and halo-swap communication.

Used draft OpenMP GPU directives stencil computation used MPI or coarrays for halo-swap between processes

Coarray code for halo-swap was simple and was best performing of the optimized versions There is still scope to optimize the coarray version (reduce extra data copy)

45

HIMENO

46

0

1

2

3

4

5

6

7

0 32 64 96 128 160 192 224 256

Number of nodes

Himeno Benchmark - XL configurationMPI/ACC Opt CAF/ACC Opt

Gyrokinetic Fusion Code

Particle in Cell (PIC) approach to simulate motion of confined particles Motion caused by electromagnetic force on particle

Timestep chosen to limit travel to 4 cells away Departing particles stored in a buffer and when this is full the

Force fields recomputed once particles are redistributed Coarrays used to avoid coordinating the receive of the data SC11 paper

47

References

R. Ansaloni, A. Hart, Parco 2011 (to appear).

Himeno Ryutaro Himeno, http://accc.riken.jp/HPC_e/himenobmt_e.html.

Gyrokinetic Fusion Applications on Ultra-Robert Preissl, Nathan Wichmann, Bill Long, John Shalf, Stephane Ethier, Alice Koniges, SC11 best paper finalist

48 46

Page 47: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

References

http://lacsi.rice.edu/software/caf/downloads/documentation/nrRAL98060.pdf- Co-array Fortran for parallel programming, Numrich and Reid, 1998 ftp://ftp.nag.co.uk/sc22wg5/N1801-N1850/N1824.pdf Coarrays

Ashby, J.V. and Reid, J.K (2008). Migrating a scientific application from MPI to coarrays. CUG 2008 Proceedings. RAL-TR-2008-015 See http://www.numerical.rl.ac.uk/reports/reports.shtml http://upc.gwu.edu/ - Unified Parallel C at George Washington University http://upc.lbl.gov/ - Berkeley Unified Parallel C Project

49

Tutorial Wrapup

Remember our first Motivation slide? Fortran now supports parallelism as a full first-class feature of the language Changes are minimal Performance is maintained Flexibility in expressing communication patterns

We hope you learned something and have success with coarrays in the future

50

Acknowledgements

The material for this tutorial is based on original content developed by EPCC of The University of Edinburgh for use in teaching their MSc in High-Performance Computing. The following people contributed to its development: Alan Simpson, Michele Weiland, Jim Enright and Paul Graham The material was subsequently developed by EPCC and Cray to form this tutorial with contributions from the following people: David Henty, Alan Simpson ( EPCC) Harvey Richardson, Bill Long, Roberto Ansaloni, Jef Dawson, Nathan Wichmann (Cray) This material is Copyright © 2011 by The University of Edinburgh and Cray Inc.

47

Page 48: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

48

Page 49: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

EXERCISE ASSIGNMENTS

49

Page 50: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

Practicalities

Computing serversWe will use CSC’s Cray supercomputer Louhi for the exercises. Log onto Louhi using the providedtnrgXX username and password, e.g.% ssh –X [email protected] Alteratively, feel free to use the local workstations or your own Linux/Mac laptop and GNU compiler, but for the Co-Array Fortran features we will need to use the Cray Fortran compiler. To enable the Cray compiler, we need to do (once on Louhi)% module swap PrgEnv-pgi PrgEnv-crayOther compilers (GNU, PGI, Pathscale, and Intel) are also available in CSC’s computing servers. The compiler can be changed via (for example)% module swap PrgEnv-cray PrgEnv-gnuFor editing Fortran program files you can use e.g. Emacs editor with or without (the option –nw) X-Windows:emacs –nw prog.f90emacs prog.f90Also other popular editors (vim, nano) are available.

Simple compilationExample program test.f90program test

implicit noneinteger, parameter :: result = 42print *, ‘hello world!’print *, ‘the result is’, result

end program testCompilation and execution are done via the ftn wrapper and the aprun scheduler:% ftn test.f90 -o test% aprun –n 1 ./testHello world!The result is 42

50

Page 51: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

1. Playing around with control structures and arraysa. Declare an integer array of dimensions 100 by 100 and initialize it to zero otherwise but

where the first index is equal to 50 or the second index is equal to 50 the array elements geta value of 1.

b. Then initialize another array with the same dimensions, but its values are computed from the first array such that

• The cells with exactly two elements equal to 1 in the first array get the same value in the new array as in the first array.

• Any cell with exactly three neighbors with value 1 gets the value 1 in the new array.

• Otherwise, i.e. new array cells with less than two or more than three neighbors withvalue 1 in the old array get a value 0.

At this stage, just run the indices from 2 to 99, i.e. not referencing to the boundaries at all.

c. Modify the program from exercise 1b such that the array becomes periodic – that is, the boundaries depend on the cells on the other side of the array. The solutions for all threeitems of Exercise 1 is provided in ex1_arrays.f90.

2. Getting acquainted with proceduresa. Modify the program such that you can produce new arrays iteratively, i.e. taking the array

from the previous iteration and obtaining a new array by applying the same rules for it.

b. Modify the exercise 2a so that it uses a function or a subroutine to produce the new array.

c. Change the initialization of the board such that the board starts from a randomconfiguration. The intrinsic procedure is called RANDOM_NUMBER.Wrap also this boardinitialization into its own procedure. The solutions for all three items of Exercise 2 is providedin ex2_procedures.f90.

Fortran 95/2003 exercises

Value 1 on the black rows, value 0elsewhere

51

Page 52: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

Fortran 95/2003 exercises

3. Game of LifeThe Game of Life (GoL) is a cellular automaton devised by John Horton Conway in 1970, see http://en.wikipedia.org/wiki/Conway's_Game_of_Life.

You can compile a reference executable (since the file ex3_gol.f90 will contain the solution) with% ftn –o gol gol_io.f90 ex3_gol.f90

Run the program of e.g. 200x200 board for 100 iterations. With the command xview oreog you can view the images (.pbm) and see how the automaton looks like after those. You can also animate the board development by first using convert as% convert -delay 40 -geometry 512x512 life_*.pbm life.gif(on a single line) and then displaying the animation with% animate life.gif

a. See the file ex3_gol0.f90, get acquainted with the program and complete the missing parts of the code (search: “TODO”). Refer back to assignments 1 and 2.

b. Experiment, how the game evolves if you replace the starting pattern (‘plus’, c.f. exercise 1a) to a random one (c.f. Exercise 2c).

c. Modify the GoL program such that the board is manipulated through a derived datatypeGoL_board,which contains the actual board, its dimensions as well as how many iterations it has gone through. No solution has been prepared.

d. Now we will examine the I/O module of the Game of Life program. It visualizes the board in the netpbm image format, see http://en.wikipedia.org/wiki/Netpbm_format. Implement the writing of the board as pbm images - or in some other image format if you want to go your own way. Consult the gol_io.f90 when in trouble. Shortcut: study the draw subroutine in gol_io.f90 and make sure you understand the piece of code.

e. Modify the program such that the user input is read directly from the command line instead of parsering, i.e. the program is launched as ./gol (# iterations) (board height) (board width), for example% ./gol 200 100 100The answer is provided in gol_io.f90.

52

Page 53: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

More bonus exercises

Fortran Quiza. Are the following Fortran statements written correctly?

character_string = ’Awake in the morning,& asleep in the evening.’

x = 0.4-6answer = ’True & false’low-limit = 0.0005E10y = E6

b. Are the following declarations legimate in Fortran?DOUBLE :: xCHARACTER(LEN=*), PARAMETER :: "Name" REAL :: pi = 22/7REAL :: x = 2., y = -3REAL :: pii = 22.0/7.0REAL x = 1.0

c. What are the iteration counts of the following DO loops, the values of loop variable i inside the loop, and the value of the loop variable after the DO construct?

DO i = 1, 5

DO i = 5, 0, -1

DO i = 10, 1, -2

DO i = 0, 30, 7

DO i = 3, 2, 1

Derived typesa. Declare the derived type which can save the birth date in the form:

21 01 1990This derived type thus contains three integers, which have different KIND values: SELECTED_INT_KIND(2) and SELECTED_INT_KIND(4).

b. Add the field the for a name to the derived type. Write a function, which returns the name and date in a character string in the following formCharlie Brown (01.01.1999)

RecursionWrite a recursive function, which calculates ”Tribonacci numbers”:

Calculate x12. Carry out the computation also using a loop structure.

53

Page 54: Fortran 2003/2008 - Prace Training Portal: Events · Fortran 2003/2008 Pekka Manninen Sami Saarinen David Henty September 11-13, 2012 PRACE Advanced Training Centre CSC – IT Center

Parallel Programming with Fortran Coarrays: Overview of Exercises Delivered at PRACE Advanced Training Centre, CSC IT Center for Science Ltd, Finland, September 13, 2012 David Henty, Alan Simpson (EPCC) Harvey Richardson, Bill Long (Cray)

Exercise 1

Hello world example check you can log on, compile, submit and run

Writing arrays as pictures declare and manipulate coarrays write out arrays in PGM picture format view them using display from ImageMagick use both remote reads and remote writes

2

Sample output on 4 images

3

Exercise 2

Perform simple edge detection of features in a picture halo communication between 1D grid of images

Reconstruct picture from supplied edges an iterative algorithm computationally intensive so worth parallelising

Terminate based on some stopping criterion requires global sums

Use global or point-to-point synchronisation Look at scalability

Edge detection and picture reconstruction

5

single pass

hundreds of iterations

Exercise 3 (unlikely to get here today!)

Decompose picture across a 2D grid of images using multiple codimensions

Documentation

Full instructions in exercise notes PDF copy in doc/ subdirectory

Go at your own pace no direct dependencies between practicals & lectures each exercise follows on from the last

questions then please ask us!

54