public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Thomas Koenig <tkoenig@netcologne.de>
To: "fortran@gcc.gnu.org" <fortran@gcc.gnu.org>,
	gcc-patches <gcc-patches@gcc.gnu.org>
Subject: [patch, coarray_native, committed] Increase initial size on Darwin
Date: Sun, 17 Jan 2021 20:13:18 +0100	[thread overview]
Message-ID: <80ee02cc-0571-0417-1729-cd7403cad703@netcologne.de> (raw)

[-- Attachment #1: Type: text/plain, Size: 801 bytes --]

Hello world,

the patch (committed after Nicolas' OK) should make it possible
to go one step further in testing with Darwin.

So, it might now be possible to do another round of testing,
to see if there are any other walls to hit :-)

Best regards

	Thomas

Use an initial shared memory size of 256 GB on Apple.

This implements an idea that Nicolas had to overcome the Darwin
problem that it is not possible to extend a shared memory segment
on that system.

The remedy is simple: Use a memory segment that is larger than
what can reasonably be used. This should only waste a few page
table entries, while providing the functionality, at least for
further testing.

libgfortran/ChangeLog:

         * caf_shared/shared_memory.c (shared_memory_init): On Apple,
         use an initial size of 256 GB.

[-- Attachment #2: p.txt --]
[-- Type: text/plain, Size: 743 bytes --]

diff --git a/libgfortran/caf_shared/shared_memory.c b/libgfortran/caf_shared/shared_memory.c
index b64e40a3ded..0c0b36c663d 100644
--- a/libgfortran/caf_shared/shared_memory.c
+++ b/libgfortran/caf_shared/shared_memory.c
@@ -190,7 +190,16 @@ shared_memory_init (shared_memory_act **pmem)
 {
   shared_memory_act *mem;
   int fd;
+
+  /* Darwin does not appear to be able to grow shared memory segments.  Choose
+     256 GB; that will likely be enough.  If not, the ftruncate will fail
+     noisily.  */
+
+#ifdef __APPLE__
+  size_t initial_size = ((size_t) 1) << 38;
+#else
   size_t initial_size = round_to_pagesize (sizeof (global_shared_memory_meta));
+#endif
 
   mem = malloc (get_shared_memory_act_size (1));
   fd = get_shmem_fd ();

             reply	other threads:[~2021-01-17 19:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-17 19:13 Thomas Koenig [this message]
2021-01-18 17:32 dhumieres.dominique
2021-01-18 17:36 ` Thomas Koenig
2021-01-19  9:38   ` dhumieres.dominique

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=80ee02cc-0571-0417-1729-cd7403cad703@netcologne.de \
    --to=tkoenig@netcologne.de \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    /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).