How to use Techila's Fortran 90 module?

How to use Techila's Fortran 90 module?

Postby e88 » 2014-03-26 07:18:47

I have a Fortran code, which I would like to try with Techila. Techila Fundamentals document in the SDK talks briefly about Techila with Fortran, and I see that there is a F90 module in the SDK, too. Unfortunately, I can't find any coding example, which I could use to get a quick start. Does anyone have a snippet which could be shared here?
Posts: 59
Joined: 2013-05-23 06:41:34

Re: How to use Techila's Fortran 90 module?

Postby e151761 » 2014-03-26 07:44:29

Here is a Local Control Code which I created based on an actual code which I have been using. - This is the Worker Code, which will be executed on the Workers and takes three input parameters (techila_peach_putexeextras).

Code: Select all
program example

use, intrinsic :: iso_c_binding

use techila

integer*4 :: status, ph, r, l, projecthandle, pid
character*255 :: fn

character(len=100), dimension(1), target :: jobfilenames
type(c_ptr), dimension(1) :: jobfileptrs

status = techila_init()
ph = techila_peach_handle()

r = techila_peach_setname(ph, "fortran_example" // char(0))
r = techila_peach_addexefile(ph, "exe" // char(0), "" // char(0), "Linux" // char(0), char(0))

r = techila_peach_putexeextras(ph, "Parameters" // char(0), "%P(jobidx) 2 %O(output)" // char(0))

r = techila_peach_addoutputfile(ph, "output;file=techila_output" // char(0))

r = techila_peach_setjobs(ph, 3)
r = techila_peach_setstream(ph, 1)

r = techila_peach_execute(ph)

pid = techila_peach_getprojectid(ph)

   l = 255
   r = techila_peach_nextfile(ph, fn, l)
   if (l .eq. 0) exit
   print *,r
   print *,fn(1:l)
   print *,l
end do

r = techila_peach_done(ph)
r = techila_unload()

Posts: 25
Joined: 2013-05-23 07:05:33

Return to FORTRAN