Date_and_time fortran intrinsic function in nvfortran


I wish to compile with nvfortran22.2 a function A() in which the fortran date_and_time intrinsic function is called.

Function A()

!$ACC Routine

call date_and_time(dates,times,zones,ivalue).

A= …

The function A() calling the date-and-time function is called inside an OpenACC parallel region and is thus equiped with the !$ACC ROUTINE clause (as requested by the compiler).
When the !$ACC ROUTINE line is inserted in A() function, the nvhpc22.2 compiler issues an error as:

NVFORTRAN-S-1058-Call to PGI runtime function not supported - pghpf_dandta_i8

(I guess dandta means date and time)

date_and_time seems to be tolerated by the nvfortran outside acc parallel regions (in other parts of the code using date_and_time), not inside acc parallel regions.
Is there a trick to overcome this?

Thank you

Hi Laurent,

Sorry but the GPU doesn’t support many system calls including OS calls to get the date and time which is what the Fortran date_and_time uses.

You’ll need to remove this call or guard it with the “_OPENACC” macro. Something like:

#ifndef _OPENACC
call date_and_time(dates,times,zones,ivalue)
... set the variables if they are used later ...