GlobalArrays / ga

Partitioned Global Address Space (PGAS) library for distributed arrays
http://hpc.pnl.gov/globalarrays/
Other
97 stars 38 forks source link

Disk Resident Arrays Fortran to C interface #266

Closed edoapra closed 2 years ago

edoapra commented 2 years ago

When using Disk Resident Arrays on the latest MacOS Monterey on M1 CPUs, the current Fortran to C interface fails to detect the length of string variables.
The current Fortran to C interface uses the hidden argument string length approach that has always worked up to this case.
I have generated a workaround that uses strlen() when the string length is passed as zero.
A better solution would be to use Fortran90 ISO C binding.

bjpalmer commented 2 years ago

Anyone know if DRA is actually being used anywhere?

edoapra commented 2 years ago

Anyone know if DRA is actually being used anywhere?

Yes, unfortunately we use them (not sure why) in NWChem. E.g. https://github.com/nwchemgit/nwchem/blob/92e30f0323ab29e41db84db1e5826bd0d17d4a6d/src/nwdft/lr_tddft/tddft_energy.F#L264

It was running NWChem that I have discovered this issue.

jeffhammond commented 2 years ago

It would be interesting to profile usage to see if there would be any negative impact of just replacing DRA with GA everywhere.

We could certainly remove the usage in TCE. It has no value there.

edoapra commented 2 years ago

It would be interesting to profile usage to see if there would be any negative impact of just replacing DRA with GA everywhere.

We could certainly remove the usage in TCE. It has no value there.

Yes, I believe the same could be said of its use in the TDDFT and Hessian code. We still use DRA there because

  1. its I/O & communication performance is not critical (DRA never impressed on this front ...) ,
  2. we have never written to code to replace DRA