diff --git a/examples/oshmem_circular_shift.c b/examples/oshmem_circular_shift.c index f3e409e492d..3ff2d6d0c87 100644 --- a/examples/oshmem_circular_shift.c +++ b/examples/oshmem_circular_shift.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Mellanox Technologies, Inc. + * Copyright (c) 2014-2016 Mellanox Technologies, Inc. * All rights reserved. * $COPYRIGHT$ * @@ -11,17 +11,15 @@ #include #include -#warning This application uses deprecated API see http://www.open-mpi.org/ - int main (void) { static int aaa, bbb; int num_pes, my_pe, peer; - start_pes(0); + shmem_init(); - num_pes = _num_pes(); - my_pe = _my_pe(); + num_pes = shmem_n_pes(); + my_pe = shmem_my_pe(); peer = (my_pe + 1) % num_pes; @@ -30,6 +28,7 @@ int main (void) shmem_barrier_all(); printf("Process %d exiting\n", my_pe); + shmem_finalize(); return 0; } diff --git a/examples/oshmem_max_reduction.c b/examples/oshmem_max_reduction.c index 1bf026292ea..d0dec673af2 100644 --- a/examples/oshmem_max_reduction.c +++ b/examples/oshmem_max_reduction.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Mellanox Technologies, Inc. + * Copyright (c) 2014-2016 Mellanox Technologies, Inc. * All rights reserved. * $COPYRIGHT$ * @@ -15,8 +15,6 @@ #include -#warning This application uses deprecated API see http://www.open-mpi.org/ - long pSync[_SHMEM_BCAST_SYNC_SIZE]; #define N 3 @@ -34,10 +32,10 @@ int main(void) pSync[i] = _SHMEM_SYNC_VALUE; } - start_pes(0); + shmem_init(); - my_pe = _my_pe(); - num_pes = _num_pes(); + my_pe = shmem_my_pe(); + num_pes = shmem_n_pes(); for (i = 0; i < N; i += 1) { src[i] = my_pe + i; @@ -54,6 +52,7 @@ int main(void) } printf("\n"); + shmem_finalize(); return 0; } diff --git a/examples/oshmem_shmalloc.c b/examples/oshmem_shmalloc.c index 2c3f4cb6742..e5f9ab90907 100644 --- a/examples/oshmem_shmalloc.c +++ b/examples/oshmem_shmalloc.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Mellanox Technologies, Inc. + * Copyright (c) 2014-2016 Mellanox Technologies, Inc. * All rights reserved. * $COPYRIGHT$ * @@ -15,16 +15,16 @@ #include -#warning This application uses deprecated API see http://www.open-mpi.org/ - int main(void) { long *x; - start_pes(0); + shmem_init(); + + x = (long *) shmem_malloc(sizeof(*x)); - x = (long *) shmalloc(sizeof(*x)); + shmem_free(x); - shfree(x); + shmem_finalize(); } diff --git a/examples/oshmem_strided_puts.c b/examples/oshmem_strided_puts.c index 5ec24419779..e9f31ddb749 100644 --- a/examples/oshmem_strided_puts.c +++ b/examples/oshmem_strided_puts.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Mellanox Technologies, Inc. + * Copyright (c) 2014-2016 Mellanox Technologies, Inc. * All rights reserved. * $COPYRIGHT$ * @@ -27,16 +27,14 @@ #include #include -#warning This application uses deprecated API see http://www.open-mpi.org/ - int main(void) { short source[10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; static short target[10]; int me; - start_pes(0); - me = _my_pe(); + shmem_init(); + me = shmem_my_pe(); if (me == 0) { /* put 10 words into target on PE 1 */ @@ -51,6 +49,7 @@ int main(void) target[3], target[4] ); } shmem_barrier_all(); /* sync before exiting */ + shmem_finalize(); return 0; } diff --git a/examples/oshmem_symmetric_data.c b/examples/oshmem_symmetric_data.c index 9aaaeabac1a..7c5a1db6b53 100644 --- a/examples/oshmem_symmetric_data.c +++ b/examples/oshmem_symmetric_data.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Mellanox Technologies, Inc. + * Copyright (c) 2014-2016 Mellanox Technologies, Inc. * All rights reserved. * $COPYRIGHT$ * @@ -11,8 +11,6 @@ #include #include -#warning This application uses deprecated API see http://www.open-mpi.org/ - #define SIZE 16 int main(int argc, char* argv[]) @@ -22,10 +20,10 @@ int main(int argc, char* argv[]) int i; int num_pe, my_pe; - start_pes(0); + shmem_init(); - num_pe = _num_pes(); - my_pe = _my_pe(); + num_pe = shmem_n_pes(); + my_pe = shmem_my_pe(); if (my_pe == 0) { /* initialize array */ @@ -52,6 +50,7 @@ int main(int argc, char* argv[]) } shmem_barrier_all(); /* sync before exiting */ + shmem_finalize(); return 0; }