oshmem: Align OSHMEM API with spec v1.2 (Update man pages)
Этот коммит содержится в:
родитель
396f8dcf71
Коммит
4213886822
@ -9,18 +9,28 @@
|
||||
|
||||
include $(top_srcdir)/Makefile.ompi-rules
|
||||
|
||||
shmem_api_man_pages = \
|
||||
shmem/man/man3/intro_shmem.3 \
|
||||
shmem/man/man3/OpenSHMEM.3 \
|
||||
shmem_legacy_api_man_pages = \
|
||||
shmem/man/man3/start_pes.3 \
|
||||
shmem/man/man3/_num_pes.3 \
|
||||
shmem/man/man3/_my_pe.3 \
|
||||
shmem/man/man3/shmem_pe_accessible.3 \
|
||||
shmem/man/man3/shmem_addr_accessible.3 \
|
||||
shmem/man/man3/shmalloc.3 \
|
||||
shmem/man/man3/shmemalign.3 \
|
||||
shmem/man/man3/shrealloc.3 \
|
||||
shmem/man/man3/shfree.3 \
|
||||
shmem/man/man3/shfree.3
|
||||
|
||||
shmem_api_man_pages = \
|
||||
shmem/man/man3/intro_shmem.3 \
|
||||
shmem/man/man3/OpenSHMEM.3 \
|
||||
shmem/man/man3/shmem_init.3 \
|
||||
shmem/man/man3/shmem_finalize.3 \
|
||||
shmem/man/man3/shmem_n_pes.3 \
|
||||
shmem/man/man3/shmem_my_pe.3 \
|
||||
shmem/man/man3/shmem_pe_accessible.3 \
|
||||
shmem/man/man3/shmem_addr_accessible.3 \
|
||||
shmem/man/man3/shmem_malloc.3 \
|
||||
shmem/man/man3/shmem_align.3 \
|
||||
shmem/man/man3/shmem_realloc.3 \
|
||||
shmem/man/man3/shmem_free.3 \
|
||||
shmem/man/man3/shmem_ptr.3 \
|
||||
shmem/man/man3/shmem_char_p.3 \
|
||||
shmem/man/man3/shmem_short_p.3 \
|
||||
@ -174,10 +184,15 @@ shmem_api_man_pages = \
|
||||
shmem/man/man3/shmem_set_cache_inv.3 \
|
||||
shmem/man/man3/shmem_set_cache_line_inv.3 \
|
||||
shmem/man/man3/shmem_clear_cache_inv.3 \
|
||||
shmem/man/man3/shmem_clear_cache_line_inv.3
|
||||
shmem/man/man3/shmem_clear_cache_line_inv.3 \
|
||||
shmem/man/man3/shmem_info_get_name.3 \
|
||||
shmem/man/man3/shmem_info_get_version.3 \
|
||||
shmem/man/man3/shmem_global_exit.3
|
||||
|
||||
if PROJECT_OSHMEM
|
||||
nodist_man_MANS += $(shmem_api_man_pages)
|
||||
nodist_man_MANS += $(shmem_legacy_api_man_pages)
|
||||
endif # PROJECT_OSHMEM
|
||||
EXTRA_DIST += $(shmem_api_man_pages:.3=.3in)
|
||||
EXTRA_DIST += $(shmem_legacy_api_man_pages:.3=.3in)
|
||||
|
||||
|
@ -1,41 +1 @@
|
||||
.\" -*- nroff -*-
|
||||
.\" Copyright (c) 2015 University of Houston. All rights reserved.
|
||||
.\" Copyright (c) 2015 Mellanox Technologies, Inc.
|
||||
.\" $COPYRIGHT$
|
||||
.de Vb
|
||||
.ft CW
|
||||
.nf
|
||||
..
|
||||
.de Ve
|
||||
.ft R
|
||||
|
||||
.fi
|
||||
..
|
||||
.TH "MY\\_PE" "3" "#OMPI_DATE#" "#PACKAGE_VERSION#" "#PACKAGE_NAME#"
|
||||
.SH NAME
|
||||
|
||||
my_pe, _my_pe, shmem_my_pe \- Returns the virtual PE number of the calling PE.
|
||||
.SH SYNOPSIS
|
||||
|
||||
C or C++:
|
||||
.Vb
|
||||
#include <mpp/shmem.h>
|
||||
int _my_pe (void);
|
||||
int shmem_my_pe (void);
|
||||
.Ve
|
||||
Fortran:
|
||||
.Vb
|
||||
include 'mpp/shmem.fh'
|
||||
I = MY_PE ()
|
||||
I = SHMEM_MY_PE ()
|
||||
.Ve
|
||||
.SH DESCRIPTION
|
||||
|
||||
my_pe() or shmem_my_pe() return the processing element (PE) number of the calling PE. It accepts no
|
||||
arguments. The result is an integer between 0 and npes \- 1, where npes is the total
|
||||
number of PEs executing the current program.
|
||||
.SH SEE ALSO
|
||||
|
||||
\fIintro_shmem\fP(3),
|
||||
\fInum_pes\fP(3),
|
||||
\fIstart_pes\fP(3)
|
||||
.so man3/shmem_my_pe.3
|
||||
|
@ -1,39 +1 @@
|
||||
.\" -*- nroff -*-
|
||||
.\" Copyright (c) 2015 University of Houston. All rights reserved.
|
||||
.\" Copyright (c) 2015 Mellanox Technologies, Inc.
|
||||
.\" $COPYRIGHT$
|
||||
.de Vb
|
||||
.ft CW
|
||||
.nf
|
||||
..
|
||||
.de Ve
|
||||
.ft R
|
||||
|
||||
.fi
|
||||
..
|
||||
.TH "NUM\\_PES" "3" "#OMPI_DATE#" "#PACKAGE_VERSION#" "#PACKAGE_NAME#"
|
||||
.SH NAME
|
||||
|
||||
num_pes, _num_pes, shmem_n_pes \- Returns the number of processing elements (PEs) used to run the application.
|
||||
.SH SYNOPSIS
|
||||
|
||||
C or C++:
|
||||
.Vb
|
||||
#include <mpp/shmem.h>
|
||||
int _num_pes (void);
|
||||
int shmem_n_pes (void);
|
||||
.Ve
|
||||
Fortran:
|
||||
.Vb
|
||||
include 'mpp/shmem.fh'
|
||||
I = NUM_PES ()
|
||||
I = SHMEM_N_PES ()
|
||||
.Ve
|
||||
.SH DESCRIPTION
|
||||
|
||||
num_pes() or shmem_n_pes() return the total number of PEs running in an application.
|
||||
.SH SEE ALSO
|
||||
|
||||
\fIintro_shmem\fP(3),
|
||||
\fImy_pe\fP(3),
|
||||
\fIstart_pes\fP(3)
|
||||
.so man3/shmem_n_pes.3
|
||||
|
@ -1259,14 +1259,14 @@ main() {
|
||||
long source[10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
|
||||
static long target[10];
|
||||
|
||||
start_pes(0);
|
||||
if (_my_pe() == 0) {
|
||||
shmem_init();
|
||||
if (shmem_my_pe() == 0) {
|
||||
/* put 10 elements into target on PE 1 */
|
||||
shmem_long_put(target, source, 10, 1);
|
||||
}
|
||||
shmem_barrier_all(); /* sync sender and receiver */
|
||||
if (_my_pe() == 1)
|
||||
printf("target[0] on PE %d is %d\\n", _my_pe(), target[0]);
|
||||
if (shmem_my_pe() == 1)
|
||||
printf("target[0] on PE %d is %d\\n", shmem_my_pe(), target[0]);
|
||||
}
|
||||
.Ve
|
||||
.SH SEE ALSO
|
||||
@ -1305,8 +1305,7 @@ specific man pages for implementation information.
|
||||
\fIshmem_xor\fP(3),
|
||||
\fIshmem_pe_accessible\fP(3),
|
||||
\fIshmem_addr_accessible\fP(3),
|
||||
\fIstart_pes\fP(3),
|
||||
\fIshmalloc\fP(3C),
|
||||
\fIshpalloc\fP(3F),
|
||||
\fIMY_PE\fP(3I),
|
||||
\fINUM_PES\fP(3I)
|
||||
\fIshmem_init\fP(3),
|
||||
\fIshmem_malloc\fP(3C),
|
||||
\fIshmem_my_pe\fP(3I),
|
||||
\fIshmem_n_pes\fP(3I)
|
||||
|
@ -1 +1 @@
|
||||
.so man3/shmalloc.3
|
||||
.so man3/shmem_malloc.3
|
||||
|
1
oshmem/shmem/man/man3/shmem_align.3in
Обычный файл
1
oshmem/shmem/man/man3/shmem_align.3in
Обычный файл
@ -0,0 +1 @@
|
||||
.so man3/shmem_malloc.3
|
@ -44,7 +44,7 @@ functions such as \fIshmem_put32\fP(3)\&.
|
||||
.Vb
|
||||
setup_data()
|
||||
{
|
||||
if (_my_pe() == 0) {
|
||||
if (shmem_my_pe() == 0) {
|
||||
setup();
|
||||
}
|
||||
|
||||
@ -56,4 +56,4 @@ setup_data()
|
||||
.SH SEE ALSO
|
||||
|
||||
\fIshmem_barrier\fP(3),
|
||||
\fIstart_pes\fP(3)
|
||||
\fIshmem_init\fP(3)
|
||||
|
@ -195,16 +195,16 @@ main()
|
||||
{
|
||||
long source[10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
|
||||
static long target[10];
|
||||
start_pes(2);
|
||||
shmem_init();
|
||||
|
||||
if (_my_pe() == 0) {
|
||||
if (shmem_my_pe() == 0) {
|
||||
/* put 10 words into target on PE 1 */
|
||||
shmem_long_put(target, source, 10, 1);
|
||||
}
|
||||
shmem_barrier_all(); /* sync sender and receiver */
|
||||
if (_my_pe() == 1)
|
||||
if (shmem_my_pe() == 1)
|
||||
shmem_udcflush(); /* not required on Altix systems */
|
||||
printf("target[0] on PE %d is %d\\n", _my_pe(), target[0]);
|
||||
printf("target[0] on PE %d is %d\\n", shmem_my_pe(), target[0]);
|
||||
}
|
||||
.Ve
|
||||
.SH SEE ALSO
|
||||
|
47
oshmem/shmem/man/man3/shmem_finalize.3in
Обычный файл
47
oshmem/shmem/man/man3/shmem_finalize.3in
Обычный файл
@ -0,0 +1,47 @@
|
||||
.\" -*- nroff -*-
|
||||
.\" Copyright (c) 2015 University of Houston. All rights reserved.
|
||||
.\" Copyright (c) 2015 Mellanox Technologies, Inc.
|
||||
.\" $COPYRIGHT$
|
||||
.de Vb
|
||||
.ft CW
|
||||
.nf
|
||||
..
|
||||
.de Ve
|
||||
.ft R
|
||||
|
||||
.fi
|
||||
..
|
||||
.TH "SHMEM\\_FINALIZE" "3" "#OMPI_DATE#" "#PACKAGE_VERSION#" "#PACKAGE_NAME#"
|
||||
.SH NAME
|
||||
|
||||
shmem_finalize
|
||||
\- A collective operation that releases resources used by the OpenSHMEM library.
|
||||
This only terminates the Open-SHMEM portion of a program, not the entire program.
|
||||
.SH SYNOPSIS
|
||||
|
||||
C or C++:
|
||||
.Vb
|
||||
#include <mpp/shmem.h>
|
||||
void shmem_finalize(void);
|
||||
.Ve
|
||||
Fortran:
|
||||
.Vb
|
||||
include 'mpp/shmem.fh'
|
||||
CALL SHMEM_FINALIZE
|
||||
.Ve
|
||||
.SH DESCRIPTION
|
||||
|
||||
shmem_finalize
|
||||
is a collective operation that ends the OpenSHMEM portion of a program previously initialized
|
||||
by shmem_init and releases resources used by the OpenSHMEM library. This collective operation requires
|
||||
all PEs to participate in the call. There is an implicit global barrier in shmem_finalize so that pending
|
||||
communication is completed, and no resources can be released until all PEs have entered shmem_finalize.
|
||||
shmem_finalize must be the last OpenSHMEM library call encountered in the OpenSHMEM portion of
|
||||
a program. A call to shmem_finalize will release any resources initialized by a corresponding call to
|
||||
shmem_init. All processes and threads that represent the PEs will still exist after the call to shmem_finalize
|
||||
returns, but they will no longer have access to any resources that have been released.
|
||||
.SH SEE ALSO
|
||||
|
||||
\fIintro_shmem\fP(3),
|
||||
\fIshmem_my_pe\fP(3),
|
||||
\fIshmem_init\fP(3)
|
1
oshmem/shmem/man/man3/shmem_free.3in
Обычный файл
1
oshmem/shmem/man/man3/shmem_free.3in
Обычный файл
@ -0,0 +1 @@
|
||||
.so man3/shmem_malloc.3
|
47
oshmem/shmem/man/man3/shmem_global_exit.3in
Обычный файл
47
oshmem/shmem/man/man3/shmem_global_exit.3in
Обычный файл
@ -0,0 +1,47 @@
|
||||
.\" -*- nroff -*-
|
||||
.\" Copyright (c) 2015 University of Houston. All rights reserved.
|
||||
.\" Copyright (c) 2015 Mellanox Technologies, Inc.
|
||||
.\" $COPYRIGHT$
|
||||
.de Vb
|
||||
.ft CW
|
||||
.nf
|
||||
..
|
||||
.de Ve
|
||||
.ft R
|
||||
|
||||
.fi
|
||||
..
|
||||
.TH "SHMEM\\_GLOBAL\\_EXIT" "3" "#OMPI_DATE#" "#PACKAGE_VERSION#" "#PACKAGE_NAME#"
|
||||
.SH NAME
|
||||
|
||||
shmem_global_exit
|
||||
\- A routine that allows any PE to force termination of an entire program.
|
||||
.SH SYNOPSIS
|
||||
|
||||
C or C++:
|
||||
.Vb
|
||||
#include <mpp/shmem.h>
|
||||
void shmem_global_exit(int status);
|
||||
.Ve
|
||||
Fortran:
|
||||
.Vb
|
||||
include 'mpp/shmem.fh'
|
||||
INTEGER STATUS
|
||||
CALL SHMEM_GLOBAL_EXIT(status)
|
||||
.Ve
|
||||
.SH DESCRIPTION
|
||||
|
||||
shmem_global_exit()
|
||||
shmem_global_exit is a non-collective routine that allows any one PE to force termination of an Open-
|
||||
SHMEM program for all PEs, passing an exit status to the execution environment. This routine terminates
|
||||
the entire program, not just the OpenSHMEM portion. When any PE calls shmem_global_exit, it results in
|
||||
the immediate notification to all PEs to terminate. shmem_global_exit flushes I/O and releases resources
|
||||
in accordance with C/C++/Fortran language requirements for normal program termination. If more than
|
||||
one PE calls shmem_global_exit, then the exit status returned to the environment shall be one of the values
|
||||
passed to shmem_global_exit as the status argument. There is no return to the caller of shmem_global_exit;
|
||||
control is returned from the OpenSHMEM program to the execution environment for all PEs.
|
||||
.SH SEE ALSO
|
||||
|
||||
\fIintro_shmem\fP(3),
|
||||
\fIshmem_my_pe\fP(3),
|
||||
\fIshmem_init\fP(3)
|
48
oshmem/shmem/man/man3/shmem_info_get_name.3in
Обычный файл
48
oshmem/shmem/man/man3/shmem_info_get_name.3in
Обычный файл
@ -0,0 +1,48 @@
|
||||
.\" -*- nroff -*-
|
||||
.\" Copyright (c) 2015 University of Houston. All rights reserved.
|
||||
.\" Copyright (c) 2015 Mellanox Technologies, Inc.
|
||||
.\" $COPYRIGHT$
|
||||
.de Vb
|
||||
.ft CW
|
||||
.nf
|
||||
..
|
||||
.de Ve
|
||||
.ft R
|
||||
|
||||
.fi
|
||||
..
|
||||
.TH "SHMEM\\_INFO\\_GET\\_NAME" "3" "#OMPI_DATE#" "#PACKAGE_VERSION#" "#PACKAGE_NAME#"
|
||||
.SH NAME
|
||||
|
||||
shmem_info_get_name
|
||||
\- This routine returns the vendor defined character string.
|
||||
.SH SYNOPSIS
|
||||
|
||||
C or C++:
|
||||
.Vb
|
||||
#include <mpp/shmem.h>
|
||||
void shmem_info_get_name(char *name);
|
||||
.Ve
|
||||
Fortran:
|
||||
.Vb
|
||||
include 'mpp/shmem.fh'
|
||||
SHMEM_INFO_GET_NAME(NAME)
|
||||
CHARACTER *(*)NAME
|
||||
.Ve
|
||||
.SH DESCRIPTION
|
||||
|
||||
shmem_info_get_name()
|
||||
This routine returns the vendor defined character string of size defined by the constant SHMEM_MAX_NAME_LEN.
|
||||
The program calling this function prepares the memory of size SHMEM_MAX_NAME_LEN, and the implementation
|
||||
copies the string of size at most SHMEM_MAX_NAME_LEN. In C, the string is terminated
|
||||
by a null character. In Fortran, the string of size less than SHMEM_MAX_NAME_LEN is padded with
|
||||
blank characters up to size SHMEM_MAX_NAME_LEN. The implementation copying a string of size
|
||||
greater than SHMEM_MAX_NAME_LEN results in an undefined behavior. Multiple invocations of the
|
||||
routine in an OpenSHMEM program always return the same string. For a given library implementation,
|
||||
the major and minor version returned by these calls is consistent with the compile-time constants defined
|
||||
in its shmem.h.
|
||||
.SH SEE ALSO
|
||||
|
||||
\fIintro_shmem\fP(3),
|
||||
\fIshmem_my_pe\fP(3),
|
||||
\fIshmem_init\fP(3)
|
43
oshmem/shmem/man/man3/shmem_info_get_version.3in
Обычный файл
43
oshmem/shmem/man/man3/shmem_info_get_version.3in
Обычный файл
@ -0,0 +1,43 @@
|
||||
.\" -*- nroff -*-
|
||||
.\" Copyright (c) 2015 University of Houston. All rights reserved.
|
||||
.\" Copyright (c) 2015 Mellanox Technologies, Inc.
|
||||
.\" $COPYRIGHT$
|
||||
.de Vb
|
||||
.ft CW
|
||||
.nf
|
||||
..
|
||||
.de Ve
|
||||
.ft R
|
||||
|
||||
.fi
|
||||
..
|
||||
.TH "SHMEM\\_INFO\\_GET\\_VERSION" "3" "#OMPI_DATE#" "#PACKAGE_VERSION#" "#PACKAGE_NAME#"
|
||||
.SH NAME
|
||||
|
||||
shmem_info_get_version
|
||||
\- Returns the major and minor version of the library implementation.
|
||||
.SH SYNOPSIS
|
||||
|
||||
C or C++:
|
||||
.Vb
|
||||
#include <mpp/shmem.h>
|
||||
void shmem_info_get_version(int *major, int *minor);
|
||||
.Ve
|
||||
Fortran:
|
||||
.Vb
|
||||
include 'mpp/shmem.fh'
|
||||
SHMEM_INFO_GET_VERSION(MAJOR, MINOR)
|
||||
INTEGER MAJOR, MINOR
|
||||
.Ve
|
||||
.SH DESCRIPTION
|
||||
|
||||
shmem_info_get_version()
|
||||
This routine returns the major and minor version of the OpenSHMEM standard in use. For a given library
|
||||
implementation, the major and minor version returned by these calls is consistent with the compile-time
|
||||
constants, SHMEM_MAJOR_VERSION and SHMEM_MINOR_VERSION, defined in its shmem.h. The
|
||||
valid major version value is 1, and the valid minor version value is 2.
|
||||
.SH SEE ALSO
|
||||
|
||||
\fIintro_shmem\fP(3),
|
||||
\fIshmem_my_pe\fP(3),
|
||||
\fIshmem_init\fP(3)
|
84
oshmem/shmem/man/man3/shmem_init.3in
Обычный файл
84
oshmem/shmem/man/man3/shmem_init.3in
Обычный файл
@ -0,0 +1,84 @@
|
||||
.\" -*- nroff -*-
|
||||
.\" Copyright (c) 2015 University of Houston. All rights reserved.
|
||||
.\" Copyright (c) 2015 Mellanox Technologies, Inc.
|
||||
.\" $COPYRIGHT$
|
||||
.de Vb
|
||||
.ft CW
|
||||
.nf
|
||||
..
|
||||
.de Ve
|
||||
.ft R
|
||||
|
||||
.fi
|
||||
..
|
||||
.TH "SHMEM\\_INIT" "3" "#OMPI_DATE#" "#PACKAGE_VERSION#" "#PACKAGE_NAME#"
|
||||
.SH NAME
|
||||
|
||||
shmem_init, start_pes
|
||||
\- Allocates a block of memory from the symmetric heap.
|
||||
.SH SYNOPSIS
|
||||
|
||||
C or C++:
|
||||
.Vb
|
||||
void shmem_init(void);
|
||||
void start_pes(int npes);
|
||||
.Ve
|
||||
Fortran:
|
||||
.Vb
|
||||
CALL SHMEM_INIT()
|
||||
CALL START_PES(npes)
|
||||
.Ve
|
||||
.SH DESCRIPTION
|
||||
|
||||
The start_pes routine should be the first statement in a SHMEM parallel program.
|
||||
.PP
|
||||
The start_pes routine accepts the following argument:
|
||||
.TP
|
||||
npes
|
||||
Unused. Should be set to 0.
|
||||
.PP
|
||||
This routine initializes the SHMEM API, therefore it must be called before calling any
|
||||
other SHMEM routine.
|
||||
This routine is responsible inter alia for setting up the symmetric heap on the calling PE, and
|
||||
the creation of the virtual PE numbers. Upon successful return from this routine, the calling PE
|
||||
will be able to communicate with and transfer data to other PEs.
|
||||
.PP
|
||||
Multiple calls to this function are not allowed.
|
||||
.PP
|
||||
For an overview of programming with SHMEM communication routines, example SHMEM
|
||||
programs, and instructions for compiling SHMEM programs, see the \fIintro_shmem\fP(3)
|
||||
man page.
|
||||
.SH EXAMPLES
|
||||
|
||||
This is a simple program that calls \fIshmem_integer_put\fP(3):
|
||||
.Vb
|
||||
PROGRAM PUT
|
||||
INCLUDE "mpp/shmem.fh"
|
||||
|
||||
INTEGER TARG, SRC, RECEIVER, BAR
|
||||
COMMON /T/ TARG
|
||||
PARAMETER (RECEIVER=1)
|
||||
|
||||
CALL SHMEM_INIT()
|
||||
IF (MY_PE() .EQ. 0) THEN
|
||||
SRC = 33
|
||||
CALL SHMEM_INTEGER_PUT(TARG, SRC, 1, RECEIVER)
|
||||
ENDIF
|
||||
CALL SHMEM_BARRIER_ALL ! SYNCHRONIZES SENDER AND RECEIVER
|
||||
IF (MY_PE() .EQ. RECEIVER) THEN
|
||||
PRINT *,'PE ', MY_PE(),' TARG=',TARG,' (expect 33)'
|
||||
ENDIF
|
||||
END
|
||||
.Ve
|
||||
.SH NOTES
|
||||
|
||||
If the start_pes call is not the first statement in a program, unexpected results may occur on
|
||||
some architectures.
|
||||
.SH SEE ALSO
|
||||
|
||||
\fIintro_shmem\fP(3),
|
||||
\fIshmem_barrier\fP(3),
|
||||
\fIshmem_barrier_all\fP(3),
|
||||
\fIshmem_put\fP(3),
|
||||
\fImy_pe\fP(3I),
|
||||
\fIshmem_n_pes\fP(3I)
|
@ -114,10 +114,10 @@ main()
|
||||
static int race_winner = \-1;
|
||||
int oldval;
|
||||
|
||||
start_pes(2);
|
||||
oldval = shmem_int_cswap(&race_winner, \-1, _my_pe(), 0);
|
||||
shmem_init();
|
||||
oldval = shmem_int_cswap(&race_winner, \-1, shmem_my_pe(), 0);
|
||||
if (oldval == \-1)
|
||||
printf("pe %d was first\\n",_my_pe());
|
||||
printf("pe %d was first\\n",shmem_my_pe());
|
||||
}
|
||||
.Ve
|
||||
.SH SEE ALSO
|
||||
|
113
oshmem/shmem/man/man3/shmem_malloc.3in
Обычный файл
113
oshmem/shmem/man/man3/shmem_malloc.3in
Обычный файл
@ -0,0 +1,113 @@
|
||||
.\" -*- nroff -*-
|
||||
.\" Copyright (c) 2015 University of Houston. All rights reserved.
|
||||
.\" Copyright (c) 2015 Mellanox Technologies, Inc.
|
||||
.\" $COPYRIGHT$
|
||||
.de Vb
|
||||
.ft CW
|
||||
.nf
|
||||
..
|
||||
.de Ve
|
||||
.ft R
|
||||
|
||||
.fi
|
||||
..
|
||||
.TH "SHMALLOC" "3" "#OMPI_DATE#" "#PACKAGE_VERSION#" "#PACKAGE_NAME#"
|
||||
.SH NAME
|
||||
|
||||
\fIshmem_malloc\fP(3),
|
||||
\fIshmem_free\fP(3),
|
||||
\fIshmem_align\fP(3),
|
||||
\fIshmem_realloc\fP(3)
|
||||
\fIshmalloc\fP(3),
|
||||
\fIshfree\fP(3),
|
||||
\fIshmemalign\fP(3),
|
||||
\fIshrealloc\fP(3)
|
||||
\- Symmetric heap memory management functions.
|
||||
.SH SYNOPSIS
|
||||
|
||||
C or C++:
|
||||
.Vb
|
||||
#include <mpp/shmem.h>
|
||||
|
||||
void *shmem_malloc(size_t size);
|
||||
void *shmalloc(size_t size);
|
||||
|
||||
void shmem_free(void *ptr);
|
||||
void shfree(void *ptr);
|
||||
|
||||
void *shmem_realloc(void *ptr, size_t size);
|
||||
void *shrealloc(void *ptr, size_t size);
|
||||
|
||||
void *shmem_align(size_t alignment, size_t size);
|
||||
void *shmemalign(size_t alignment, size_t size);
|
||||
|
||||
extern long malloc_error;
|
||||
.Ve
|
||||
.SH DESCRIPTION
|
||||
|
||||
The \fBshmem_malloc\fP
|
||||
function returns a pointer to a block of at least size bytes
|
||||
suitably aligned for any use. This space is allocated from the symmetric heap (in contrast
|
||||
to \fImalloc\fP(3C),
|
||||
which allocates from the private heap).
|
||||
.PP
|
||||
The \fBshmem_align\fP
|
||||
function allocates a block in the symmetric heap that has a
|
||||
byte alignment specified by the alignment argument.
|
||||
.PP
|
||||
The \fBshmem_free\fP
|
||||
function causes the block to which ptr points to, to be deallocated,
|
||||
that is, made available for further allocation. If ptr is a null pointer, no action
|
||||
occurs; otherwise, if the argument does not match a pointer earlier returned by a symmetric
|
||||
heap function, or if the space has already been deallocated, malloc_error is set to indicate the
|
||||
error, and shfree returns.
|
||||
.PP
|
||||
The \fBshmem_realloc\fP
|
||||
function changes the size of the block to which ptr points to, to the
|
||||
size (in bytes) specified by size.
|
||||
.PP
|
||||
The contents of the block are unchanged up to the lesser of the new and old sizes. If the new
|
||||
size is larger, the value of the newly allocated portion of the block is indeterminate. If ptr is a
|
||||
null pointer, the shrealloc function behaves like the shmalloc function for the specified size. If
|
||||
size is 0 and ptr is not a null pointer, the block to which it points to is freed. Otherwise, if ptr
|
||||
does not match a pointer earlier returned by a symmetric heap function, or if the space has
|
||||
already been deallocated, the malloc_error variable is set to indicate the error, and shrealloc
|
||||
returns a null pointer. If the space cannot be allocated, the block to which ptr points to is
|
||||
unchanged.
|
||||
.PP
|
||||
The shmem_malloc, shmem_free, and shmem_realloc functions are provided so that multiple PEs in an
|
||||
application can allocate symmetric, remotely accessible memory blocks. These memory
|
||||
blocks can then be used with (shmem) communication routines. Each of these functions call
|
||||
the \fIshmem_barrier_all\fP(3)
|
||||
function before returning; this ensures that all PEs
|
||||
participate in the memory allocation, and that the memory on other PEs can be used as soon
|
||||
as the local PE returns.
|
||||
.PP
|
||||
The user is responsible for calling these functions with identical argument(s) on all PEs; if
|
||||
differing size arguments are used, subsequent calls may not return the same symmetric heap
|
||||
address on all PEs.
|
||||
.PP
|
||||
.SH NOTES
|
||||
|
||||
The total size of the symmetric heap is determined at job startup. One can adjust the size of
|
||||
the heap using the SHMEM_SYMMETRIC_HEAP_SIZE environment variable. See the
|
||||
\fIintro_shmem\fP(3)
|
||||
man page for futher details.
|
||||
The shmem_malloc, shmem_free, and shmem_realloc functions differ from the private heap allocation functions
|
||||
in that all PEs in an application must call them (a barrier is used to ensure this).
|
||||
.PP
|
||||
.SH RETURN VALUES
|
||||
|
||||
The \fBshmem_malloc\fP
|
||||
function returns a pointer to the allocated space (which should
|
||||
be identical on all PEs); otherwise, it returns a null pointer (with malloc_error set).
|
||||
The \fBshmem_free\fP
|
||||
function returns no value.
|
||||
The \fBshmem_realloc\fP
|
||||
function returns a pointer to the allocated space (which
|
||||
may have moved); otherwise, it returns a null pointer (with malloc_error set).
|
||||
.SH SEE ALSO
|
||||
|
||||
\fIintro_shmem\fP(3),
|
||||
\fIshmem_my_pe\fP(3I),
|
||||
\fIshmem_init\fP(3)
|
41
oshmem/shmem/man/man3/shmem_my_pe.3in
Обычный файл
41
oshmem/shmem/man/man3/shmem_my_pe.3in
Обычный файл
@ -0,0 +1,41 @@
|
||||
.\" -*- nroff -*-
|
||||
.\" Copyright (c) 2015 University of Houston. All rights reserved.
|
||||
.\" Copyright (c) 2015 Mellanox Technologies, Inc.
|
||||
.\" $COPYRIGHT$
|
||||
.de Vb
|
||||
.ft CW
|
||||
.nf
|
||||
..
|
||||
.de Ve
|
||||
.ft R
|
||||
|
||||
.fi
|
||||
..
|
||||
.TH "SHMEM\\_MY\\_PE" "3" "#OMPI_DATE#" "#PACKAGE_VERSION#" "#PACKAGE_NAME#"
|
||||
.SH NAME
|
||||
|
||||
shmem_my_pe, my_pe, _my_pe \- Returns the virtual PE number of the calling PE.
|
||||
.SH SYNOPSIS
|
||||
|
||||
C or C++:
|
||||
.Vb
|
||||
#include <mpp/shmem.h>
|
||||
int shmem_my_pe (void);
|
||||
int my_pe (void);
|
||||
.Ve
|
||||
Fortran:
|
||||
.Vb
|
||||
include 'mpp/shmem.fh'
|
||||
I = SHMEM_MY_PE ()
|
||||
I = MY_PE ()
|
||||
.Ve
|
||||
.SH DESCRIPTION
|
||||
|
||||
my_pe() or shmem_my_pe() return the processing element (PE) number of the calling PE. It accepts no
|
||||
arguments. The result is an integer between 0 and npes \- 1, where npes is the total
|
||||
number of PEs executing the current program.
|
||||
.SH SEE ALSO
|
||||
|
||||
\fIintro_shmem\fP(3),
|
||||
\fIshmem_n_pes\fP(3),
|
||||
\fIshmem_init\fP(3)
|
39
oshmem/shmem/man/man3/shmem_n_pes.3in
Обычный файл
39
oshmem/shmem/man/man3/shmem_n_pes.3in
Обычный файл
@ -0,0 +1,39 @@
|
||||
.\" -*- nroff -*-
|
||||
.\" Copyright (c) 2015 University of Houston. All rights reserved.
|
||||
.\" Copyright (c) 2015 Mellanox Technologies, Inc.
|
||||
.\" $COPYRIGHT$
|
||||
.de Vb
|
||||
.ft CW
|
||||
.nf
|
||||
..
|
||||
.de Ve
|
||||
.ft R
|
||||
|
||||
.fi
|
||||
..
|
||||
.TH "SHMEM\\_N\\_PES" "3" "#OMPI_DATE#" "#PACKAGE_VERSION#" "#PACKAGE_NAME#"
|
||||
.SH NAME
|
||||
|
||||
num_pes, _num_pes, shmem_n_pes \- Returns the number of processing elements (PEs) used to run the application.
|
||||
.SH SYNOPSIS
|
||||
|
||||
C or C++:
|
||||
.Vb
|
||||
#include <mpp/shmem.h>
|
||||
int _num_pes (void);
|
||||
int shmem_n_pes (void);
|
||||
.Ve
|
||||
Fortran:
|
||||
.Vb
|
||||
include 'mpp/shmem.fh'
|
||||
I = NUM_PES ()
|
||||
I = SHMEM_N_PES ()
|
||||
.Ve
|
||||
.SH DESCRIPTION
|
||||
|
||||
num_pes() or shmem_n_pes() return the total number of PEs running in an application.
|
||||
.SH SEE ALSO
|
||||
|
||||
\fIintro_shmem\fP(3),
|
||||
\fIshmem_my_pe\fP(3),
|
||||
\fIshmem_init\fP(3)
|
@ -95,15 +95,15 @@ main()
|
||||
int *ptr;
|
||||
int i;
|
||||
|
||||
start_pes(0);
|
||||
if (_my_pe() == 0) {
|
||||
shmem_init();
|
||||
if (shmem_my_pe() == 0) {
|
||||
/* initialize PE 1's bigd array */
|
||||
ptr = shmem_ptr(bigd, 1);
|
||||
for (i=0; i<100; i++)
|
||||
*ptr++ = i+1;
|
||||
}
|
||||
shmem_barrier_all();
|
||||
if (_my_pe() == 1) {
|
||||
if (shmem_my_pe() == 1) {
|
||||
printf("bigd on PE 1 is:\\n");
|
||||
for (i=0; i<100; i++)
|
||||
printf(" %d\\n",bigd[i]);
|
||||
|
1
oshmem/shmem/man/man3/shmem_realloc.3in
Обычный файл
1
oshmem/shmem/man/man3/shmem_realloc.3in
Обычный файл
@ -0,0 +1 @@
|
||||
.so man3/shmem_malloc.3
|
@ -197,15 +197,15 @@ main()
|
||||
6, 7, 8, 9, 10 };
|
||||
static short target[10];
|
||||
|
||||
start_pes(2);
|
||||
if (_my_pe() == 0) {
|
||||
shmem_init();
|
||||
if (shmem_my_pe() == 0) {
|
||||
/* put 10 words into target on PE 1 */
|
||||
shmem_short_iput(target, source, 1, 2, 5, 1);
|
||||
}
|
||||
shmem_barrier_all(); /* sync sender and receiver */
|
||||
if (_my_pe() == 1) {
|
||||
if (shmem_my_pe() == 1) {
|
||||
shmem_udcflush(); /* not required on IRIX systems */
|
||||
printf("target on PE %d is %d %d %d %d %d0, _my_pe(),
|
||||
printf("target on PE %d is %d %d %d %d %d0, shmem_my_pe(),
|
||||
(int)target[0], (int)target[1], (int)target[2],
|
||||
(int)target[3], (int)target[4] );
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
.so man3/shmalloc.3
|
||||
.so man3/shmem_malloc.3
|
||||
|
@ -1 +1 @@
|
||||
.so man3/shmalloc.3
|
||||
.so man3/shmem_malloc.3
|
||||
|
@ -1,82 +1 @@
|
||||
.\" -*- nroff -*-
|
||||
.\" Copyright (c) 2015 University of Houston. All rights reserved.
|
||||
.\" Copyright (c) 2015 Mellanox Technologies, Inc.
|
||||
.\" $COPYRIGHT$
|
||||
.de Vb
|
||||
.ft CW
|
||||
.nf
|
||||
..
|
||||
.de Ve
|
||||
.ft R
|
||||
|
||||
.fi
|
||||
..
|
||||
.TH "START\\_PES" "3" "#OMPI_DATE#" "#PACKAGE_VERSION#" "#PACKAGE_NAME#"
|
||||
.SH NAME
|
||||
|
||||
\fIstart_pes\fP(3)
|
||||
\- Allocates a block of memory from the symmetric heap.
|
||||
.SH SYNOPSIS
|
||||
|
||||
C or C++:
|
||||
.Vb
|
||||
void start_pes(int npes);
|
||||
.Ve
|
||||
Fortran:
|
||||
.Vb
|
||||
CALL START_PES(npes)
|
||||
.Ve
|
||||
.SH DESCRIPTION
|
||||
|
||||
The start_pes routine should be the first statement in a SHMEM parallel program.
|
||||
.PP
|
||||
The start_pes routine accepts the following argument:
|
||||
.TP
|
||||
npes
|
||||
Unused. Should be set to 0.
|
||||
.PP
|
||||
This routine initializes the SHMEM API, therefore it must be called before calling any
|
||||
other SHMEM routine.
|
||||
This routine is responsible inter alia for setting up the symmetric heap on the calling PE, and
|
||||
the creation of the virtual PE numbers. Upon successful return from this routine, the calling PE
|
||||
will be able to communicate with and transfer data to other PEs.
|
||||
.PP
|
||||
Multiple calls to this function are not allowed.
|
||||
.PP
|
||||
For an overview of programming with SHMEM communication routines, example SHMEM
|
||||
programs, and instructions for compiling SHMEM programs, see the \fIintro_shmem\fP(3)
|
||||
man page.
|
||||
.SH EXAMPLES
|
||||
|
||||
This is a simple program that calls \fIshmem_integer_put\fP(3):
|
||||
.Vb
|
||||
PROGRAM PUT
|
||||
INCLUDE "mpp/shmem.fh"
|
||||
|
||||
INTEGER TARG, SRC, RECEIVER, BAR
|
||||
COMMON /T/ TARG
|
||||
PARAMETER (RECEIVER=1)
|
||||
|
||||
CALL START_PES(0)
|
||||
IF (MY_PE() .EQ. 0) THEN
|
||||
SRC = 33
|
||||
CALL SHMEM_INTEGER_PUT(TARG, SRC, 1, RECEIVER)
|
||||
ENDIF
|
||||
CALL SHMEM_BARRIER_ALL ! SYNCHRONIZES SENDER AND RECEIVER
|
||||
IF (MY_PE() .EQ. RECEIVER) THEN
|
||||
PRINT *,'PE ', MY_PE(),' TARG=',TARG,' (expect 33)'
|
||||
ENDIF
|
||||
END
|
||||
.Ve
|
||||
.SH NOTES
|
||||
|
||||
If the start_pes call is not the first statement in a program, unexpected results may occur on
|
||||
some architectures.
|
||||
.SH SEE ALSO
|
||||
|
||||
\fIintro_shmem\fP(3),
|
||||
\fIshmem_barrier\fP(3),
|
||||
\fIshmem_barrier_all\fP(3),
|
||||
\fIshmem_put\fP(3),
|
||||
\fImy_pe\fP(3I),
|
||||
\fInum_pes\fP(3I)
|
||||
.so man3/shmem_init.3
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user