public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: dhumieres.dominique@free.fr
To: Thomas Koenig <tkoenig@netcologne.de>
Cc: "Nicolas König" <koenigni@student.ethz.ch>, fortran@gcc.gnu.org
Subject: Re: Update on shared memory coarrays
Date: Fri, 01 Jan 2021 17:41:02 +0100	[thread overview]
Message-ID: <d984c82527cba976fff8674f44e76dbb@free.fr> (raw)
In-Reply-To: <86fa53e3-155d-1912-8b88-b0789323ee09@netcologne.de>

Le 2021-01-01 17:16, Thomas Koenig a écrit :
> Hi Dominique,
> 
> Happy new year to you, too, and to everybody else!
> 
>> Now the test fails with
>> 
>> mmap failed: Invalid argument
>> 
>> AFAICT this happens on the second call to map_memory.
> 
> A quick question.
> 
> Could you try the following diagnostic patch
> 
> diff --git a/libgfortran/caf_shared/shared_memory.c
> b/libgfortran/caf_shared/shared_memory.c
> index b64e40a3ded..03990550f59 100644
> --- a/libgfortran/caf_shared/shared_memory.c
> +++ b/libgfortran/caf_shared/shared_memory.c
> @@ -79,6 +79,11 @@ map_memory (int fd, size_t size, off_t offset)
>  {
>    void *ret
>        = mmap (NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 
> offset);
> +  fprintf (stderr, "map_memory image %d size %lx offset %lx pagesize 
> %lx\n",
> +          this_image.image_num + 1, (unsigned long) size,
> +          (unsigned long) offset,
> +          (unsigned long) pagesize);
> +
>    if (ret == MAP_FAILED)
>      {program main
>   real, dimension(:), allocatable :: a[:]
>   real, dimension(:), allocatable :: b[:]
>   allocate (a(1000)[*])
>   allocate (b(2000)[3:*])
> end program main
>        perror ("mmap failed");
> 
> 
> to make sure that mmap is indeed getting the right parameters?
> 
> On my Linux box, the output looks like
> 
> map_memory image 0 size 1000 offset 0 pagesize 1000
> map_memory image 4 size 5000 offset 0 pagesize 1000
> map_memory image 2 size 5000 offset 0 pagesize 1000
> map_memory image 1 size 5000 offset 0 pagesize 1000
> map_memory image 3 size 5000 offset 0 pagesize 1000
> map_memory image 3 size d000 offset 0 pagesize 1000
> map_memory image 2 size d000 offset 0 pagesize 1000
> map_memory image 1 size d000 offset 0 pagesize 1000
> map_memory image 4 size d000 offset 0 pagesize 1000
> 
> 
> for the following little program:
> 
> program main
>   real, dimension(:), allocatable :: a[:]
>   real, dimension(:), allocatable :: b[:]
>   allocate (a(1000)[*])
>   allocate (b(2000)[3:*])
> end program main
> 
> Best regards
> 
> 	Thomas

I get

map_memory image 0 size 1000 offset 0 pagesize 1000
map_memory image 0 size 2000 offset 0 pagesize 1000
mmap failed: Invalid argument

Best regards

Dominique

  reply	other threads:[~2021-01-01 16:41 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 [this message]
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
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=d984c82527cba976fff8674f44e76dbb@free.fr \
    --to=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).