Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

CO_BROADCAST polymoprhic components

everythingfunctional
870 Views

I'm not 100% sure this is where the problem lies, but it seems that way. I'm trying to implement a 2-sided communication library using teams and co_broadcast, but I get a segfault in a weird place.

 

The example can be found here: https://gitlab.com/everythingfunctional/communicator

 

but running it I get:

 

```

$ fpm run --example --compiler ifx --profile debug --flag -coarray (main)
communicator.f90 done.
libcommunicator.a done.
hello_world.f90 done.
hello_world done.
[100%] Project compiled successfully.
On image 4 received: Hello, from image 4
forrtl: severe (174): SIGSEGV, segmentation fault occurred
In coarray image 3
Image PC Routine Line Source
libc.so.6 00007F97DC362AB0 Unknown Unknown Unknown
libc.so.6 00007F97DC47FB62 Unknown Unknown Unknown
hello_world 0000000000405F8E hello_world 19 hello_world.f90
hello_world 000000000040533D Unknown Unknown Unknown
libc.so.6 00007F97DC34C850 Unknown Unknown Unknown
libc.so.6 00007F97DC34C90A __libc_start_main Unknown Unknown
hello_world 0000000000405255 Unknown Unknown Unknown

```

1 Solution
Barbara_P_Intel
Moderator
436 Views

The issue you reported using coarrays is fixed in the 2024.1 release of ifx and ifort. It was made available last week.

Please try it out!



View solution in original post

7 Replies
Barbara_P_Intel
Moderator
826 Views

Please attach your reproducer here. I'm not sure how to use what's on your GitLab site or what fpm is.

 

0 Kudos
everythingfunctional
822 Views

fpm is the Fortran Package Manger. It's a build and dependency management system (https://fpm.fortran-lang.org/). But at any rate, the example's not so complicated to do manually.

 

$ ifx -c -coarray communicator.f90 -o communicator.o                                                                                                                                                                                                                $ ifx -c -coarray hello_world.f90 -o hello_world.o                                                                                                                                                                                                                  $ ifx -coarray communicator.o hello_world.o -o hello_world                                                                                                                                                                                                          $ ./hello_world                                                                                                                                                                                                                                                     On image            4  received: Hello, from image  4
forrtl: severe (174): SIGSEGV, segmentation fault occurred
In coarray image 3
Image              PC                Routine            Line        Source             
libc.so.6          00007F1B9813BAB0  Unknown               Unknown  Unknown
libc.so.6          00007F1B98258B62  Unknown               Unknown  Unknown
hello_world        00000000004061F4  Unknown               Unknown  Unknown
hello_world        000000000040531D  Unknown               Unknown  Unknown
libc.so.6          00007F1B98125850  Unknown               Unknown  Unknown
libc.so.6          00007F1B9812590A  __libc_start_main     Unknown  Unknown
hello_world        0000000000405235  Unknown               Unknown  Unknown
0 Kudos
Barbara_P_Intel
Moderator
818 Views

Thank you. Let me see what's up.

 

0 Kudos
Barbara_P_Intel
Moderator
793 Views

With that simple reproducer, I am able to reproduce the issue. I filed a bug report, CMPLRLLVM-49827. I'll post here when there's a fix.



0 Kudos
everythingfunctional
790 Views

Perfect. Thanks.

0 Kudos
Barbara_P_Intel
Moderator
437 Views

The issue you reported using coarrays is fixed in the 2024.1 release of ifx and ifort. It was made available last week.

Please try it out!



everythingfunctional
430 Views

It appears to be working with my initial tests. Thanks!

0 Kudos
Reply