Skip to content

Error in generic selection for shmem_g #3968

@nspark

Description

@nspark

Background information

Problem: There is essentially a typo in the generic selection expression for shmem_g in shmem.h.in. The macro for shmem_g accepts the arguments addr and pe, however, the controlling expression for the generic selection uses dst.

Resolution: Replace dst with addr on line 301 of shmem.h.in.

What version of Open MPI are you using?

v2.1.1

Describe how Open MPI was installed

From source tarball

Please describe the system on which you are running

  • Operating system/version: Ubuntu 16.04 LTS
  • Computer hardware: MacBook Pro

Details of the problem

The OpenSHMEM Specification example codes that use shmem_g fail to compile with OSHMEM. For example, see shmem_g_example.c.

$ oshcc -Wall -Wextra -o shmem_g_example.cx shmem_g_example.c
In file included from shmem_g_example.c:2:0:
shmem_g_example.c: In function ‘main’:
/opt/oshmem/2.1.1/include/shmem.h:302:17: error: ‘dst’ undeclared (first use in this function)
     _Generic(&*(dst),                                        \
                 ^
shmem_g_example.c:12:11: note: in expansion of macro ‘shmem_g’
       y = shmem_g(&x, npes-1);
           ^
/opt/oshmem/2.1.1/include/shmem.h:302:17: note: each undeclared identifier is reported only once for each function it appears in
     _Generic(&*(dst),                                        \
                 ^
shmem_g_example.c:12:11: note: in expansion of macro ‘shmem_g’
       y = shmem_g(&x, npes-1);
           ^

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions