Applying Jeff`s comments about proper SHMEM fortran organization of files.
Refs: 3870 This commit was SVN r29651.
Этот коммит содержится в:
родитель
01333813a9
Коммит
ab796052b4
@ -112,7 +112,6 @@ AS_IF([test $OSHMEM_WANT_FORTRAN_BINDINGS -eq 1],
|
|||||||
[AC_MSG_RESULT([no])])
|
[AC_MSG_RESULT([no])])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
AC_DEFUN([OSHMEM_SETUP_CFLAGS],[
|
AC_DEFUN([OSHMEM_SETUP_CFLAGS],[
|
||||||
|
|
||||||
|
|
||||||
|
@ -50,8 +50,8 @@ EXAMPLES = \
|
|||||||
hello_mpifh \
|
hello_mpifh \
|
||||||
hello_usempi \
|
hello_usempi \
|
||||||
hello_usempif08 \
|
hello_usempif08 \
|
||||||
hello_shmem \
|
hello_shmem \
|
||||||
hello_shmemfh \
|
hello_shmemfh \
|
||||||
Hello.class \
|
Hello.class \
|
||||||
ring_c \
|
ring_c \
|
||||||
ring_cxx \
|
ring_cxx \
|
||||||
@ -60,14 +60,16 @@ EXAMPLES = \
|
|||||||
ring_usempif08 \
|
ring_usempif08 \
|
||||||
ring_shmem \
|
ring_shmem \
|
||||||
ring_shmemfh \
|
ring_shmemfh \
|
||||||
ring_shmemf90 \
|
|
||||||
Ring.class \
|
Ring.class \
|
||||||
connectivity_c
|
connectivity_c
|
||||||
|
|
||||||
# Default target. Always build the C example. Only build the others
|
# Default target.
|
||||||
# if Open MPI was build with the relevant language bindings.
|
|
||||||
|
|
||||||
all: hello_c ring_c connectivity_c
|
all: hello_c ring_c connectivity_c
|
||||||
|
|
||||||
|
# Always build the C example. Only build the others
|
||||||
|
# if Open MPI was build with the relevant language bindings.
|
||||||
|
mpi:
|
||||||
|
|
||||||
@ if ompi_info --parsable | grep bindings:cxx:yes >/dev/null; then \
|
@ if ompi_info --parsable | grep bindings:cxx:yes >/dev/null; then \
|
||||||
$(MAKE) hello_cxx ring_cxx; \
|
$(MAKE) hello_cxx ring_cxx; \
|
||||||
fi
|
fi
|
||||||
@ -83,12 +85,17 @@ all: hello_c ring_c connectivity_c
|
|||||||
@ if ompi_info --parsable | grep bindings:java:yes >/dev/null; then \
|
@ if ompi_info --parsable | grep bindings:java:yes >/dev/null; then \
|
||||||
$(MAKE) Hello.class Ring.class; \
|
$(MAKE) Hello.class Ring.class; \
|
||||||
fi
|
fi
|
||||||
@ if ompi_info --parsable | grep mca:shmem >/dev/null; then \
|
|
||||||
|
# Only build if we built OSHMEM support.
|
||||||
|
# Only build the Fortran examples if we have Fortran OSHMEM support.
|
||||||
|
shmem:
|
||||||
|
@ if oshmem_info --parsable | grep oshmem:bindings:c >/dev/null; then \
|
||||||
$(MAKE) hello_shmem; \
|
$(MAKE) hello_shmem; \
|
||||||
$(MAKE) hello_shmemfh; \
|
|
||||||
$(MAKE) ring_shmem; \
|
$(MAKE) ring_shmem; \
|
||||||
|
fi
|
||||||
|
@ if oshmem_info --parsable | grep oshmem:bindings:fort >/dev/null; then \
|
||||||
|
$(MAKE) hello_shmemfh; \
|
||||||
$(MAKE) ring_shmemfh; \
|
$(MAKE) ring_shmemfh; \
|
||||||
$(MAKE) ring_shmemf90; \
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# The usual "clean" target
|
# The usual "clean" target
|
||||||
@ -120,13 +127,11 @@ Ring.class: Ring.java
|
|||||||
|
|
||||||
hello_shmem: hello_shmem_c.c
|
hello_shmem: hello_shmem_c.c
|
||||||
$(SHMEMCC) $(CFLAGS) $^ -o $@
|
$(SHMEMCC) $(CFLAGS) $^ -o $@
|
||||||
hello_shmemfh: hello_shmemfh.f
|
hello_shmemfh: hello_shmemfh.f90
|
||||||
$(SHMEMFC) $(FCFLAGS) $^ -o $@
|
$(SHMEMFC) $(FCFLAGS) $^ -o $@
|
||||||
|
|
||||||
ring_shmem: ring_shmem_c.c
|
ring_shmem: ring_shmem_c.c
|
||||||
$(SHMEMCC) $(CFLAGS) $^ -o $@
|
$(SHMEMCC) $(CFLAGS) $^ -o $@
|
||||||
ring_shmemfh: ring_shmemfh.f
|
ring_shmemfh: ring_shmemfh.f90
|
||||||
$(SHMEMFC) $(FCFLAGS) $^ -o $@
|
|
||||||
ring_shmemf90: ring_shmem.f90
|
|
||||||
$(SHMEMFC) $(FCFLAGS) $^ -o $@
|
$(SHMEMFC) $(FCFLAGS) $^ -o $@
|
||||||
|
|
||||||
|
@ -39,15 +39,14 @@ EXTRA_DIST += \
|
|||||||
examples/hello_usempi.f90 \
|
examples/hello_usempi.f90 \
|
||||||
examples/hello_usempif08.f90 \
|
examples/hello_usempif08.f90 \
|
||||||
examples/hello_shmem_c.c \
|
examples/hello_shmem_c.c \
|
||||||
examples/hello_shmemfh.f \
|
examples/hello_shmemfh.f90 \
|
||||||
examples/ring_c.c \
|
examples/ring_c.c \
|
||||||
examples/ring_cxx.cc \
|
examples/ring_cxx.cc \
|
||||||
examples/ring_mpifh.f \
|
examples/ring_mpifh.f \
|
||||||
examples/ring_usempi.f90 \
|
examples/ring_usempi.f90 \
|
||||||
examples/ring_usempif08.f90 \
|
examples/ring_usempif08.f90 \
|
||||||
examples/ring_shmem_c.c \
|
examples/ring_shmem_c.c \
|
||||||
examples/ring_shmemfh.f \
|
examples/ring_shmemfh.f90 \
|
||||||
examples/ring_shmem.f90 \
|
|
||||||
examples/connectivity_c.c \
|
examples/connectivity_c.c \
|
||||||
examples/Hello.java \
|
examples/Hello.java \
|
||||||
examples/Ring.java
|
examples/Ring.java
|
||||||
|
@ -31,7 +31,7 @@ different MPI interfaces:
|
|||||||
Fortran use mpi_f08: hello_usempif08.f90
|
Fortran use mpi_f08: hello_usempif08.f90
|
||||||
Java: Hello.java
|
Java: Hello.java
|
||||||
C shmem.h: hello_shmem_c.c
|
C shmem.h: hello_shmem_c.c
|
||||||
Fortran shmemfh.f: hello_shmemfh.f
|
Fortran shmem.fh: hello_shmemfh.f90
|
||||||
|
|
||||||
- Send a trivial message around in a ring
|
- Send a trivial message around in a ring
|
||||||
C: ring_c.c
|
C: ring_c.c
|
||||||
@ -41,8 +41,7 @@ different MPI interfaces:
|
|||||||
Fortran use mpi_f08: ring_usempif08.f90
|
Fortran use mpi_f08: ring_usempif08.f90
|
||||||
Java: Ring.java
|
Java: Ring.java
|
||||||
C shmem.h: ring_shmem_c.c
|
C shmem.h: ring_shmem_c.c
|
||||||
Fortran shmemfh.f: ring_shmemfh.f
|
Fortran shmem.fh: ring_shmemfh.f90
|
||||||
F90 shmemfh.f: ring_shmem.f90
|
|
||||||
|
|
||||||
Additionally, there's one further example application, but this one
|
Additionally, there's one further example application, but this one
|
||||||
only uses the MPI C bindings:
|
only uses the MPI C bindings:
|
||||||
|
@ -1,19 +0,0 @@
|
|||||||
C *
|
|
||||||
C * Copyright (c) 2013 Mellanox Technologies, Inc.
|
|
||||||
C * All rights reserved.
|
|
||||||
C * $COPYRIGHT$
|
|
||||||
C *
|
|
||||||
C * Additional copyrights may follow
|
|
||||||
C *
|
|
||||||
C * $HEADER$
|
|
||||||
C *
|
|
||||||
|
|
||||||
program main
|
|
||||||
integer proc, nproc
|
|
||||||
call START_PES(0)
|
|
||||||
proc = MY_PE()
|
|
||||||
nproc = NUM_PES()
|
|
||||||
|
|
||||||
write(*, '("Hello, world, I am ", i2, " of ", i2)')
|
|
||||||
& proc, nproc
|
|
||||||
end
|
|
22
examples/hello_shmemfh.f90
Обычный файл
22
examples/hello_shmemfh.f90
Обычный файл
@ -0,0 +1,22 @@
|
|||||||
|
!
|
||||||
|
! Copyright (c) 2013 Mellanox Technologies, Inc.
|
||||||
|
! All rights reserved.
|
||||||
|
! $COPYRIGHT$
|
||||||
|
!
|
||||||
|
! Additional copyrights may follow
|
||||||
|
!
|
||||||
|
! $HEADER$
|
||||||
|
!
|
||||||
|
program hello_shmem
|
||||||
|
implicit none
|
||||||
|
include 'shmem.fh'
|
||||||
|
|
||||||
|
integer proc, nproc
|
||||||
|
|
||||||
|
call START_PES(0)
|
||||||
|
proc = MY_PE()
|
||||||
|
nproc = NUM_PES()
|
||||||
|
|
||||||
|
write(*, '("Hello, world, I am ", i2, " of ", i2)') proc, nproc
|
||||||
|
end program hello_shmem
|
||||||
|
|
@ -1,64 +0,0 @@
|
|||||||
!
|
|
||||||
! Copyright (c) 2013 Mellanox Technologies, Inc.
|
|
||||||
! All rights reserved.
|
|
||||||
! $COPYRIGHT$
|
|
||||||
!
|
|
||||||
! Additional copyrights may follow
|
|
||||||
!
|
|
||||||
! $HEADER$
|
|
||||||
!
|
|
||||||
|
|
||||||
program ring_shmem_f90
|
|
||||||
implicit none
|
|
||||||
include 'shmem.fh'
|
|
||||||
|
|
||||||
integer*8, save :: rbuf
|
|
||||||
integer*8 :: message
|
|
||||||
integer :: proc, nproc, next
|
|
||||||
! func definitions
|
|
||||||
integer :: my_pe, num_pes
|
|
||||||
|
|
||||||
rbuf = -1
|
|
||||||
message = 10
|
|
||||||
|
|
||||||
call start_pes(0)
|
|
||||||
proc = my_pe()
|
|
||||||
nproc = num_pes()
|
|
||||||
|
|
||||||
! Calculate the PE number of the next process in the ring. Use the
|
|
||||||
! modulus operator so that the last process "wraps around" to PE 0.
|
|
||||||
|
|
||||||
next = mod((proc + 1), nproc)
|
|
||||||
|
|
||||||
if (proc == 0) then
|
|
||||||
write(*, '("Process 0 sending ", i2, " to", i2, " (", i2, " processes in ring)")') message, next, nproc
|
|
||||||
call shmem_put8(rbuf, message, 1, next)
|
|
||||||
write(*, '("Process 0 sent to ", i2)') next
|
|
||||||
end if
|
|
||||||
|
|
||||||
! Pass the message around the ring. The exit mechanism works as
|
|
||||||
! follows: the message (a positive integer) is passed around the
|
|
||||||
! ring. Each time it passes PE 0, it is decremented. When each
|
|
||||||
! processes receives a message containing a 0 value, it passes the
|
|
||||||
! message on to the next process and then quits. By passing the 0
|
|
||||||
! message first, every process gets the 0 message and can quit
|
|
||||||
! normally.
|
|
||||||
|
|
||||||
do while(message > 0)
|
|
||||||
call shmem_int8_wait_until(rbuf, SHMEM_CMP_EQ, message)
|
|
||||||
|
|
||||||
if (proc == 0) then
|
|
||||||
message = message - 1
|
|
||||||
write(*, '("Process 0 decremented value:", i2)') message
|
|
||||||
else
|
|
||||||
message = rbuf
|
|
||||||
end if
|
|
||||||
|
|
||||||
call shmem_put8(rbuf, message, 1, next)
|
|
||||||
end do
|
|
||||||
|
|
||||||
! All done
|
|
||||||
|
|
||||||
write(*, '("Process", i2," exiting.")') proc
|
|
||||||
|
|
||||||
end program
|
|
@ -1,71 +0,0 @@
|
|||||||
C
|
|
||||||
C Copyright (c) 2013 Mellanox Technologies, Inc.
|
|
||||||
C All rights reserved.
|
|
||||||
C $COPYRIGHT$
|
|
||||||
C
|
|
||||||
C Additional copyrights may follow
|
|
||||||
C
|
|
||||||
C $HEADER$
|
|
||||||
C
|
|
||||||
|
|
||||||
program ring_shmem_f77
|
|
||||||
implicit none
|
|
||||||
include 'shmem.fh'
|
|
||||||
|
|
||||||
integer*8 rbuf
|
|
||||||
save rbuf
|
|
||||||
integer*8 message
|
|
||||||
integer proc, nproc, next
|
|
||||||
C func definitions
|
|
||||||
integer my_pe, num_pes
|
|
||||||
|
|
||||||
rbuf = -1
|
|
||||||
message = 10
|
|
||||||
|
|
||||||
call start_pes(0)
|
|
||||||
proc = my_pe()
|
|
||||||
nproc = num_pes()
|
|
||||||
|
|
||||||
C Calculate the PE number of the next process in the ring. Use the
|
|
||||||
C modulus operator so that the last process "wraps around" to PE 0.
|
|
||||||
|
|
||||||
next = mod((proc + 1), nproc)
|
|
||||||
|
|
||||||
if (proc .eq. 0) then
|
|
||||||
write(*, '("Process 0 sending ", i2, " to ", i2,
|
|
||||||
& " (", i2, " processes in ring)")')
|
|
||||||
& message, next, nproc
|
|
||||||
call shmem_put8(rbuf, message, 1, next)
|
|
||||||
write(*, '("Process 0 sent to ", i2)') next
|
|
||||||
end if
|
|
||||||
|
|
||||||
C Pass the message around the ring. The exit mechanism works as
|
|
||||||
C follows: the message (a positive integer) is passed around the
|
|
||||||
C ring. Each time it passes PE 0, it is decremented. When each
|
|
||||||
C processes receives a message containing a 0 value, it passes the
|
|
||||||
C message on to the next process and then quits. By passing the 0
|
|
||||||
C message first, every process gets the 0 message and can quit
|
|
||||||
C normally.
|
|
||||||
|
|
||||||
10 call shmem_int8_wait_until(rbuf, SHMEM_CMP_EQ, message)
|
|
||||||
|
|
||||||
if (proc .eq. 0) then
|
|
||||||
message = message - 1
|
|
||||||
write(*, '("Process 0 decremented value:", i2)') message
|
|
||||||
else
|
|
||||||
message = rbuf
|
|
||||||
end if
|
|
||||||
|
|
||||||
call shmem_put8(rbuf, message, 1, next)
|
|
||||||
|
|
||||||
if (message .gt. 0) then
|
|
||||||
goto 10
|
|
||||||
else
|
|
||||||
goto 20
|
|
||||||
end if
|
|
||||||
|
|
||||||
C All done
|
|
||||||
|
|
||||||
20 write(*, '("Process", i2," exiting.")') proc
|
|
||||||
|
|
||||||
end
|
|
62
examples/ring_shmemfh.f90
Обычный файл
62
examples/ring_shmemfh.f90
Обычный файл
@ -0,0 +1,62 @@
|
|||||||
|
!
|
||||||
|
! Copyright (c) 2013 Mellanox Technologies, Inc.
|
||||||
|
! All rights reserved.
|
||||||
|
! $COPYRIGHT$
|
||||||
|
!
|
||||||
|
! Additional copyrights may follow
|
||||||
|
!
|
||||||
|
! $HEADER$
|
||||||
|
!
|
||||||
|
|
||||||
|
program ring_shmem
|
||||||
|
implicit none
|
||||||
|
include 'shmem.fh'
|
||||||
|
|
||||||
|
integer*8, save :: rbuf
|
||||||
|
integer*8 :: message
|
||||||
|
integer :: proc, nproc, next
|
||||||
|
|
||||||
|
rbuf = -1
|
||||||
|
message = 10
|
||||||
|
|
||||||
|
call start_pes(0)
|
||||||
|
proc = my_pe()
|
||||||
|
nproc = num_pes()
|
||||||
|
|
||||||
|
! Calculate the PE number of the next process in the ring. Use the
|
||||||
|
! modulus operator so that the last process "wraps around" to PE 0.
|
||||||
|
|
||||||
|
next = mod((proc + 1), nproc)
|
||||||
|
|
||||||
|
if (proc == 0) then
|
||||||
|
write(*, '("Process 0 sending ", i2, " to", i2, " (", i2, " processes in ring)")') message, next, nproc
|
||||||
|
call shmem_put8(rbuf, message, 1, next)
|
||||||
|
write(*, '("Process 0 sent to ", i2)') next
|
||||||
|
end if
|
||||||
|
|
||||||
|
! Pass the message around the ring. The exit mechanism works as
|
||||||
|
! follows: the message (a positive integer) is passed around the
|
||||||
|
! ring. Each time it passes PE 0, it is decremented. When each
|
||||||
|
! processes receives a message containing a 0 value, it passes the
|
||||||
|
! message on to the next process and then quits. By passing the 0
|
||||||
|
! message first, every process gets the 0 message and can quit
|
||||||
|
! normally.
|
||||||
|
|
||||||
|
do while(message > 0)
|
||||||
|
call shmem_int8_wait_until(rbuf, SHMEM_CMP_EQ, message)
|
||||||
|
|
||||||
|
if (proc == 0) then
|
||||||
|
message = message - 1
|
||||||
|
write(*, '("Process 0 decremented value:", i2)') message
|
||||||
|
else
|
||||||
|
message = rbuf
|
||||||
|
end if
|
||||||
|
|
||||||
|
call shmem_put8(rbuf, message, 1, next)
|
||||||
|
end do
|
||||||
|
|
||||||
|
! All done
|
||||||
|
|
||||||
|
write(*, '("Process", i2," exiting.")') proc
|
||||||
|
|
||||||
|
end program
|
@ -48,6 +48,8 @@
|
|||||||
integer SHMEM_CMP_GE
|
integer SHMEM_CMP_GE
|
||||||
parameter ( SHMEM_CMP_GE = 5 )
|
parameter ( SHMEM_CMP_GE = 5 )
|
||||||
|
|
||||||
|
integer my_pe
|
||||||
|
integer num_pes
|
||||||
|
|
||||||
logical shmem_pe_accessible
|
logical shmem_pe_accessible
|
||||||
logical shmem_addr_accessible
|
logical shmem_addr_accessible
|
||||||
|
@ -25,6 +25,17 @@ AM_CFLAGS = \
|
|||||||
-DOMPI_BUILD_LIBS="\"@LIBS@\"" \
|
-DOMPI_BUILD_LIBS="\"@LIBS@\"" \
|
||||||
-DOPAL_CC_ABSOLUTE="\"@OPAL_CC_ABSOLUTE@\"" \
|
-DOPAL_CC_ABSOLUTE="\"@OPAL_CC_ABSOLUTE@\"" \
|
||||||
-DOMPI_CXX_ABSOLUTE="\"@OMPI_CXX_ABSOLUTE@\""
|
-DOMPI_CXX_ABSOLUTE="\"@OMPI_CXX_ABSOLUTE@\""
|
||||||
|
if OSHMEM_PROFILING
|
||||||
|
AM_CFLAGS += -DOSHMEM_PROFILING=1
|
||||||
|
else
|
||||||
|
AM_CFLAGS += -DOSHMEM_PROFILING=0
|
||||||
|
endif
|
||||||
|
|
||||||
|
if OSHMEM_WANT_FORTRAN_BINDINGS
|
||||||
|
AM_CFLAGS += -DOSHMEM_WANT_FORTRAN_BINDINGS=1
|
||||||
|
else
|
||||||
|
AM_CFLAGS += -DOSHMEM_WANT_FORTRAN_BINDINGS=0
|
||||||
|
endif
|
||||||
|
|
||||||
include $(top_srcdir)/Makefile.man-page-rules
|
include $(top_srcdir)/Makefile.man-page-rules
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@ void oshmem_info_do_config(bool want_all)
|
|||||||
char *crdebug_support;
|
char *crdebug_support;
|
||||||
char *topology_support;
|
char *topology_support;
|
||||||
char *vt_support;
|
char *vt_support;
|
||||||
|
|
||||||
/* Do a little preprocessor trickery here to figure opal_info_out the
|
/* Do a little preprocessor trickery here to figure opal_info_out the
|
||||||
* tri-state of MPI_PARAM_CHECK (which will be either 0, 1, or
|
* tri-state of MPI_PARAM_CHECK (which will be either 0, 1, or
|
||||||
* ompi_mpi_param_check). The preprocessor will only allow
|
* ompi_mpi_param_check). The preprocessor will only allow
|
||||||
@ -602,5 +602,19 @@ void oshmem_info_do_config(bool want_all)
|
|||||||
opal_info_out("MPI_MAX_DATAREP_STRING", "options:mpi-max-datarep-string",
|
opal_info_out("MPI_MAX_DATAREP_STRING", "options:mpi-max-datarep-string",
|
||||||
"IO interface not provided");
|
"IO interface not provided");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* This block displays all the options with which the current
|
||||||
|
* installation of oshmem was configured. */
|
||||||
|
{
|
||||||
|
char *oshmem_fortran = OSHMEM_WANT_FORTRAN_BINDINGS ? "yes" : "no";
|
||||||
|
char *oshmem_compat = OSHMEM_SPEC_COMPAT ? "yes" : "no";
|
||||||
|
char *oshmem_param_check = OSHMEM_PARAM_CHECK ? "yes" : "no";
|
||||||
|
char *oshmem_profiling = OSHMEM_PROFILING ? "yes" : "no";
|
||||||
|
|
||||||
|
opal_info_out("OSHMEM C bindings", "oshmem:bindings:c", "yes");
|
||||||
|
opal_info_out("OSHMEM Fort shmem.fh", "oshmem:bindings:fort", oshmem_fortran);
|
||||||
|
opal_info_out("OSHMEM SGI/Quadrix compatibility mode", "oshmem:options:spec_compat", oshmem_compat);
|
||||||
|
opal_info_out("OSHMEM API functions parameter checking", "oshmem:options:param_check", oshmem_param_check);
|
||||||
|
opal_info_out("OSHMEM profiling support", "oshmem:options:profiling", oshmem_profiling);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user