[J3] C_PTR not allowed in SEQUENCE types?

Malcolm Cohen malcolm at nag-j.co.jp
Fri Mar 12 00:10:31 UTC 2021


Yes, BIND(C) is necessary for interfacing to C (and thus to other languages that use C-like interfaces). And MPI is at root a C library so one would expect them to be making heavy use of BIND(C).

 

So my question would be why is MPI using SEQUENCE and not using BIND(C)?

 

Perhaps they want derived types in mpif.h? And therefore need SEQUENCE to make them the same derived type in every place that INCLUDEs it?

 

That’s not really a memory layout question (if you want to have the same memory layout as C, well that is what BIND(C) is for). But a question of an “old fashioned programming style” viz not using those new-fangled modules that have only been around for thirty years (more than ten years longer than C_PTR).

 

Cheers,

-- 

..............Malcolm Cohen, NAG Oxford/Tokyo.

 

From: J3 <j3-bounces at mailman.j3-fortran.org> On Behalf Of Bader, Reinhold via J3
Sent: Friday, March 12, 2021 12:02 AM
To: General J3 interest list <j3 at mailman.j3-fortran.org>
Cc: Bader, Reinhold <Reinhold.Bader at lrz.de>
Subject: Re: [J3] C_PTR not allowed in SEQUENCE types?

 


Hi Bill, 

> On a related issue, I'm not really sure why SEQUENCE is not already in the list of Obsolescent features. 

I had a discussion on this recently with Rolf Rabenseifner (from the MPI Forum). Sequence types feature prominently in the 
type API of MPI for the Fortran interface, because the memory layout is not sufficiently specified for non-SEQUENCE / non-BIND(C) types. 

I would assume quite some MPI codes use this, and it would be a significant imposition if SEQUENCE were on the way to be 
removed. 

Cheers
Reinhold



Disclaimer

The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. Please see our Privacy Notice <https://www.nag.co.uk/content/privacy-notice>  for information on how we process personal data and for details of how to stop or limit communications from us.

This e-mail has been scanned for all viruses and malware, and may have been automatically archived by Mimecast Ltd, an innovator in Software as a Service (SaaS) for business.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20210312/6aedd67a/attachment-0001.htm>


More information about the J3 mailing list