public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Iain Sandoe <iain@sandoe.co.uk>
To: "Nicolas König" <koenigni@student.ethz.ch>,
	"Thomas Koenig" <tkoenig@netcologne.de>
Cc: dhumieres.dominique@free.fr, Fortran List <fortran@gcc.gnu.org>
Subject: Re: Update on shared memory coarrays
Date: Sun, 3 Jan 2021 14:54:30 +0000	[thread overview]
Message-ID: <2007278F-63EE-427A-BFB6-A504E96D3572@sandoe.co.uk> (raw)
In-Reply-To: <5683F724-2723-4EE4-AC50-83FDB598D238@sandoe.co.uk>

Iain Sandoe <iain@sandoe.co.uk> wrote:

> Iain Sandoe <iain@sandoe.co.uk> wrote:
>
>> Iain Sandoe <iain@sandoe.co.uk> wrote:
>>
>>> Nicolas König <koenigni@student.ethz.ch> wrote:
>>> [IIUC what you mean by double-mapping] Allocating the same thing twice  
>>> seems likely to be an accident waiting to happen :) ..
>>
>> So the intent is:
>>
>> shm_allocate
>>
>> size the shm
>>
>> mmap the shm
>>
>> resize the shm

>> will poke some more if I have a chance.
>
> There is an alternate shm interface on Darwin that allows manipulation of  
> the shm object more directly (and mapping/unmapping etc).
>
> It’s not clear if that mechanism will allow the shm object to be resized,  
> it doesn’t say in the man page that one cannot - but it doesn’t say one  
> can either.
>
> If I have a chance, I’ll try to recode the testcase to use that interface  
> and see if it works.

Well .. (with this interface) I can create a half-page shm segment, and  
then expand that to a whole page

.. but it doesn’t seem to allow > 1 page in the segment.  That limitation  
is not spelled out in the man pages (might still be some mistake in my  
usage).

AFAICT it rounds up to a page, which means that the second request can be  
honoured without a reallocation.

It seems that the total shared memory supported by the (configured values)  
in the Darwin kernel might be quite small anyway :

$ sysctl -a |grep shm
kern.sysv.shmmax: 4194304
kern.sysv.shmmin: 1
kern.sysv.shmmni: 32
kern.sysv.shmseg: 8
kern.sysv.shmall: 1024

However shm_open interface *does* appear to allow arbitrary sized segments  
[at least not reporting an error to the first call to ftruncate()] - but to  
deny a resize once created.

seems more background reading will be needed …
Iain


  reply	other threads:[~2021-01-03 14:55 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-29 19:09 dhumieres.dominique
2020-11-30  6:21 ` Thomas Koenig
2020-11-30 15:41   ` dhumieres.dominique
2020-11-30 22:13     ` Thomas Koenig
2020-12-02 17:41       ` dhumieres.dominique
2020-12-03  7:27         ` Thomas Koenig
2020-12-21 12:24           ` dhumieres.dominique
2020-12-21 13:04             ` Thomas Koenig
2020-12-22 12:28               ` dhumieres.dominique
2020-12-22 15:10                 ` Thomas Koenig
2020-12-22 16:12                   ` Paul Richard Thomas
2020-12-23  9:09                     ` Thomas Koenig
2020-12-23  9:38                       ` Paul Richard Thomas
2020-12-23 10:47                         ` Thomas Koenig
2020-12-26 12:10                           ` Paul Richard Thomas
2020-12-26 13:01                             ` Thomas Koenig
2020-12-27 15:38                             ` Thomas Koenig
2020-12-23 16:42                         ` Nicolas König
2020-12-23 17:25                   ` dhumieres.dominique
2020-12-27 17:10                     ` Nicolas König
2021-01-01 13:51                       ` dhumieres.dominique
2021-01-01 16:16                         ` Thomas Koenig
2021-01-01 16:41                           ` dhumieres.dominique
2021-01-02 20:45                             ` Thomas Koenig
2021-01-02 20:55                               ` Iain Sandoe
2021-01-02 21:43                                 ` Thomas Koenig
2021-01-02 22:37                                 ` Nicolas König
2021-01-02 21:44                                   ` Iain Sandoe
2021-01-02 22:09                                     ` Iain Sandoe
2021-01-03 10:46                                       ` Iain Sandoe
2021-01-03 14:54                                         ` Iain Sandoe [this message]
2021-01-03 15:42                                           ` Iain Sandoe
2021-01-03 21:53                                             ` Thomas Koenig
2021-01-04  2:34                                               ` Iain Sandoe
2021-01-04 18:54                                                 ` Nicolas König
2021-01-05 13:11                                                   ` Iain Sandoe
2021-01-05 13:23                                                     ` Iain Sandoe
2021-01-05 13:27                                                     ` Thomas Koenig
2021-01-05 13:34                                                       ` Iain Sandoe
2021-01-05 14:54                                                     ` Nicolas König
2021-01-05 14:28                                                       ` Iain Sandoe
2021-01-05 15:45                                                         ` Nicolas König
     [not found]                                                           ` <BAD6EA1D-BB9F-4905-ADD1-76FA1D6B9591@sandoe.co.uk>
2021-01-05 17:11                                                             ` Nicolas König
2021-01-06 16:56                                                               ` Iain Sandoe
  -- strict thread matches above, loose matches on Subject: below --
2020-11-29 13:10 Nicolas König

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2007278F-63EE-427A-BFB6-A504E96D3572@sandoe.co.uk \
    --to=iain@sandoe.co.uk \
    --cc=dhumieres.dominique@free.fr \
    --cc=fortran@gcc.gnu.org \
    --cc=koenigni@student.ethz.ch \
    --cc=tkoenig@netcologne.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).