oshmem: Align OSHMEM API with spec v1.2 (change examples)
ring_oshmem_c.c and hello_oshmem_c.c support new api other examples support legacy api but warning message is provided during compilation
Этот коммит содержится в:
родитель
e8b11500d5
Коммит
07e79441b3
@ -12,6 +12,10 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "shmem.h"
|
#include "shmem.h"
|
||||||
|
|
||||||
|
#if !defined(OSHMEM_SPEC_VERSION) || OSHMEM_SPEC_VERSION < 10200
|
||||||
|
#error This application uses API 1.2 and up
|
||||||
|
#endif
|
||||||
|
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
int proc, nproc;
|
int proc, nproc;
|
||||||
|
@ -11,6 +11,8 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <shmem.h>
|
#include <shmem.h>
|
||||||
|
|
||||||
|
#warning This application uses deprecated API see http://www.open-mpi.org/
|
||||||
|
|
||||||
int main (void)
|
int main (void)
|
||||||
{
|
{
|
||||||
static int aaa, bbb;
|
static int aaa, bbb;
|
||||||
|
@ -15,6 +15,8 @@
|
|||||||
|
|
||||||
#include <shmem.h>
|
#include <shmem.h>
|
||||||
|
|
||||||
|
#warning This application uses deprecated API see http://www.open-mpi.org/
|
||||||
|
|
||||||
long pSync[_SHMEM_BCAST_SYNC_SIZE];
|
long pSync[_SHMEM_BCAST_SYNC_SIZE];
|
||||||
|
|
||||||
#define N 3
|
#define N 3
|
||||||
|
@ -15,6 +15,8 @@
|
|||||||
|
|
||||||
#include <shmem.h>
|
#include <shmem.h>
|
||||||
|
|
||||||
|
#warning This application uses deprecated API see http://www.open-mpi.org/
|
||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
long *x;
|
long *x;
|
||||||
|
@ -27,6 +27,8 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <shmem.h>
|
#include <shmem.h>
|
||||||
|
|
||||||
|
#warning This application uses deprecated API see http://www.open-mpi.org/
|
||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
short source[10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
|
short source[10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
|
||||||
|
@ -11,6 +11,8 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <shmem.h>
|
#include <shmem.h>
|
||||||
|
|
||||||
|
#warning This application uses deprecated API see http://www.open-mpi.org/
|
||||||
|
|
||||||
#define SIZE 16
|
#define SIZE 16
|
||||||
|
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
|
@ -11,15 +11,19 @@
|
|||||||
#include <shmem.h>
|
#include <shmem.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#if !defined(OSHMEM_SPEC_VERSION) || OSHMEM_SPEC_VERSION < 10200
|
||||||
|
#error This application uses API 1.2 and up
|
||||||
|
#endif
|
||||||
|
|
||||||
int main (int argc, char * argv[])
|
int main (int argc, char * argv[])
|
||||||
{
|
{
|
||||||
static int rbuf = -1;
|
static int rbuf = -1;
|
||||||
int proc, nproc, next;
|
int proc, nproc, next;
|
||||||
int message = 10;
|
int message = 10;
|
||||||
|
|
||||||
start_pes(0);
|
shmem_init();
|
||||||
proc = _my_pe();
|
nproc = shmem_n_pes();
|
||||||
nproc = _num_pes();
|
proc = shmem_my_pe();
|
||||||
|
|
||||||
/* Calculate the PE number of the next process in the ring. Use the
|
/* 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. */
|
modulus operator so that the last process "wraps around" to PE 0. */
|
||||||
@ -51,6 +55,7 @@ int main (int argc, char * argv[])
|
|||||||
--message;
|
--message;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
shmem_finalize();
|
||||||
|
|
||||||
/* All done */
|
/* All done */
|
||||||
|
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user