pgf90io_fmtw_init and function inlining

Hi,

I’m getting this error when trying to compile my Fortran program. The executable is created, but it is just skipping the code within the “accelerated” block.

Any ideas on how to fix it?

Thanks,

Chris

pgfortran tblock-07-5.f90 -o tblock-07-5 -ta=nvidia,time -Minfo=accel,ccff -fast -mcmodel=medium 
/tmp/pgaccxwjbfCJOVw66.gpu(272): error: identifier "__pgf90io_src_info03" is undefined

1 error detected in the compilation of "/tmp/pgnvdxGjbf94JpPV8.nv0".
PGF90-W-0155-Compiler failed to translate accelerator region (see -Minfo messages): Device compiler exited with error status code (tblock-07-5.f90: 7424)
set_xlength:
   7424, Generating present_or_copyin(mixl_type(:))
         Generating present_or_copyin(rt(:,:,:,:))
         Generating present_or_copyin(r(:,:,:,:))
         Generating present_or_copyin(x(:,:,:,:))
         Generating present_or_copyin(ni(:))
         Generating present_or_copyin(nj(:))
         Generating present_or_copyin(nk(:))
         Generating present_or_copyin(area_max(:))
         Generating present_or_copyin(vol_total(:))
         Generating present_or_copyout(difmin(:))
   7426, Loop is parallelizable
         Accelerator kernel generated
       7426, !$acc loop gang ! blockidx%x
       7442, !$acc loop vector(128) ! threadidx%x
       7453, !$acc loop vector(128) ! threadidx%x
       7463, !$acc loop vector(128) ! threadidx%x
   7441, Loop is parallelizable
   7442, Loop is parallelizable
   7452, Loop is parallelizable
   7453, Loop is parallelizable
   7463, Loop is parallelizable
   7464, Loop is parallelizable
  0 inform,   1 warnings,   0 severes, 0 fatal for set_xlength

Hi Chris,

Check if you have a write or print statement in your accelerator compute region. These will need to be removed or guarded by a preprocessor macro.

  • Mat

Hi Mat,

Linked to the previous post, I’m getting a compiler error:

Accelerator restriction: unsupported call to support routine 'pgf90io_fmtw_init'

The line number points to a WRITE statement, so I’m presuming this is a error linked to a WRITE statement as in the first post. I was just wondering if I’d be able to solve this with preprocessor macros?

On a slightly unrelated note, I’m having trouble with function inlining and OpenAcc. The compiler is saying that “function/procedure calls are not supported”, but I’m using the -Minline flag that reports that all the function calls within the region have been inlined succesfully. Is there something obvious I’m missing?

Thanks for your time,

Chris

  13246, Accelerator region ignored
  13248, Accelerator restriction: function/procedure calls are not supported
  13372, exbconds_gpu inlined, size=586, file tblock-07.5.f90 (14010)
  13378, set_visforce_gpu inlined, size=1334, file tblock-07.5.f90 (14477)
  13380, set_visforce_gpu inlined, size=1334, file tblock-07.5.f90 (14477)
  13470, Accelerator restriction: unsupported call to support routine 'pgf90io_fmtw_init'
  13592, sumas inlined, size=373, file tblock-07.5.f90 (10129)
  13607, sumflux inlined, size=434, file tblock-07.5.f90 (5221)
  13608, sumflux_dts inlined, size=426, file tblock-07.5.f90 (5624)
  13913, hfromt inlined, size=5, file tblock-07.5.f90 (13101)
  13919, hfromt inlined, size=5, file tblock-07.5.f90 (13101)

Sorry to keep posting under the same thread. Having removed all the PRINT statements, I’m getting these compiler error messages.

The routine “sumflux” is called 5 times in total, and it inlined successfully twice, but not the third time (and then it stops thereafter). Is there a particular reason for this?

Chris

 13365, Accelerator region ignored
  13367, Accelerator restriction: function/procedure calls are not supported
  13491, exbconds_gpu inlined, size=586, file tblock-07.5.f90 (14157)
  13497, set_visforce_gpu inlined, size=1288, file tblock-07.5.f90 (14624)
  13499, set_visforce_gpu inlined, size=1288, file tblock-07.5.f90 (14624)
  13693, sumas inlined, size=373, file tblock-07.5.f90 (10248)
  13760, sumflux inlined, size=578, file tblock-07.5.f90 (5221)
  13800, sumflux inlined, size=578, file tblock-07.5.f90 (5221)
  13845, Accelerator restriction: unsupported call to 'sumflux'
  14060, hfromt inlined, size=5, file tblock-07.5.f90 (13220)
  14066, hfromt inlined, size=5, file tblock-07.5.f90 (13220)

The line number points to a WRITE statement, so I’m presuming this is a error linked to a WRITE statement as in the first post. I was just wondering if I’d be able to solve this with preprocessor macros?

I/O statements can’t be used in OpenACC compute regions. You can put “#ifdef _OPENACC” around these statements to they are not compiled when targeting OpenACC

On a slightly unrelated note, I’m having trouble with function inlining and OpenAcc. The compiler is saying that “function/procedure calls are not supported”, but I’m using the -Minline flag that reports that all the function calls within the region have been inlined succesfully. Is there something obvious I’m missing?

Some routines can’t be automatically inlined. In this case, it’s the call to the I/O runtime routine, “pgf90io_fmtw_init”, so removing the I/O statement will work around this issue.

Is there a particular reason for this?

I’d need to see the code. Though, mostly likely it’s the arguments being passed to it. What’s different about this call to ‘sumflux’?

  • Mat

Hi Mat,

Thanks for your prompt reply. Am I using the #ifdef statement correctly in Fortran?

#ifdef _OPENACC
WRITE(,) blah blah
#endif

I’m getting the following compiler errors:

PGF90-W-0025-Illegal character (#) - ignored (tblock-07.5.f90: 13623)
PGF90-S-0034-Syntax error at or near identifier def (tblock-07.5.f90: 13623)
PGF90-S-0034-Syntax error at or near integer constant 14 (tblock-07.5.f90: 13636)

There are no differences between the sumflux calls, apart from the different arrays that are passed as parameters (all are the same size)

      IF (IF_UNST(NBLCK).NE.1) CALL SUMFLUX(NBLCK,RO,DELRO)
      IF (IF_UNST(NBLCK).NE.1) CALL SUMFLUX(NBLCK,ROE,DELROE)
      IF (IF_UNST(NBLCK).NE.1) CALL SUMFLUX(NBLCK,ROVX,DELROVX)
      IF (IF_UNST(NBLCK).NE.1) CALL SUMFLUX(NBLCK,RORVT,DELRORVT)
      IF (IF_UNST(NBLCK).NE.1) CALL SUMFLUX(NBLCK,ROVR,DELROVR)

Chris

Hi Chris,

Am I using the #ifdef statement correctly in Fortran?

Yes, but you need to compile with “-Mpreprocess” or rename your file to use the “.F90” suffix. (files with capitals are automatically pre-processed).

There are no differences between the sumflux calls, apart from the different arrays that are passed as parameters (all are the same size)

I’m not sure then. Are there any informational messages from “-Minfo=inline -Mneginfo=inline” that indicate why it’s not getting inlined?

  • Mat

Compiling with those flags yields no extra information

  13368, Accelerator region ignored
  13370, Accelerator restriction: function/procedure calls are not supported
  13494, exbconds_gpu inlined, size=586, file tblock-07.5.f90 (14168)
  13500, set_visforce_gpu inlined, size=1334, file tblock-07.5.f90 (14635)
  13502, set_visforce_gpu inlined, size=1334, file tblock-07.5.f90 (14635)
  13696, sumas inlined, size=373, file tblock-07.5.f90 (10251)
  13767, sumflux inlined, size=578, file tblock-07.5.f90 (5221)
  13807, sumflux inlined, size=578, file tblock-07.5.f90 (5221)
  13852, Accelerator restriction: unsupported call to 'sumflux'
  14071, hfromt inlined, size=5, file tblock-07.5.f90 (13223)
  14077, hfromt inlined, size=5, file tblock-07.5.f90 (13223)
  0 inform,   1 warnings,   0 severes, 0 fatal for set_flux_gpu

Sorry, I’m not sure then. Can you send a reproducing example to PGI Customer Service (trs@pgroup.com) and ask them to forward it to me?

Thanks,
Mat

Hi Mat,

I’ve sent the source files and the makefile off to that email. Please let me know if anything in there is unclear (it’s very poorly laid out as I’ve been working on it and learning Fortran at the same time!)

Thanks,

Chris

I tried to inline the first SUMFLUX call manually and it’s compiling fine, but then when I try and run (without the accelerator), I get the following memory error:

0: ALLOCATE: 186097157120 bytes requested; not enough memory

Before inlining the call, I declared all the arrays that would be necessary and it compiled and ran fine. Only after inlining the code (and not declaring any extra arrays) did I get this memory error.

Any ideas?

Chris[/code]

Hi Chris,

First on the inlining problem. There’s hard limit on the amount of code that can be inlined into a section of code and since you have many routines, not just sumflux, that are being inlined, you’re running into this limit. If too much gets inlined, it can have a detrimental effect on performance.

Your choices here are to manually inline some of the routines, wait for the OpenACC 2.0 “routine” directive (which will allow for calling routines), or split your loop into multiple smaller loops.

For the allocation error, this looks like an uninitialized variable is being used for the size of the array. Check that you correctly changed the variables that were being used to size your automatic arrays. You might have missed changing one or forgot to declare one. You can compile with the flag “-Mdclchk” to see if missed declaring a variable.

  • Mat

That’s great, found it.

Thanks Mat.