Changes between Initial Version and Version 1 of cypress/Programming/FortranExamples/OpenMpFortran


Ignore:
Timestamp:
May 15, 2015 10:02:07 AM (7 years ago)
Author:
cmaggio
Comment:

migrated content from ccs wiki

Legend:

Unmodified
Added
Removed
Modified
  • cypress/Programming/FortranExamples/OpenMpFortran

    v1 v1  
     1= OpenMP FORTRAN =
     2== Hello World ==
     3{{{#!fortran
     4!hello_omp.f90: display a message on the screen
     5program helloworld
     6  use omp_lib
     7  !
     8  integer::id, nthreads
     9  print *, "F90 Start"
     10  !
     11  !$omp parallel private(id)
     12  id = omp_get_thread_num()
     13  print *,"hello from ", id
     14  !$omp barrier
     15  if (id == 0) then
     16     nthreads = omp_get_num_threads();
     17     print *,nthreads," threads said hello!"
     18  endif
     19  !$omp end parallel
     20  print *, "End"
     21end program helloworld
     22}}}
     23
     24== Compile with GNU Fortran ==
     25{{{gfortran hello_omp.f90 -fopemp}}}
     26
     27== Compile with PGI Fortran ==
     28{{{pgf90 hello_omp.f90 -mp}}}
     29
     30== Compile with Intel Fortran ==
     31{{{ifort hello_omp.f90 -openmp}}}
     32
     33== Examples of Jobscript ==
     34[[https://wiki.hpc.tulane.edu/trac/wiki/cypress/Programming/Cexamples#ExamplesofJobscript|See Example]]