diff --git a/examples/hello_oshmem_c.c b/examples/hello_oshmem_c.c index 079e5d4970..edef057b55 100644 --- a/examples/hello_oshmem_c.c +++ b/examples/hello_oshmem_c.c @@ -15,13 +15,18 @@ int main(int argc, char* argv[]) { int proc, nproc; + char name[SHMEM_MAX_NAME_LEN]; + int major, minor; - start_pes(0); - nproc = _num_pes(); - proc = _my_pe(); + shmem_init(); + nproc = shmem_n_pes(); + proc = shmem_my_pe(); + shmem_info_get_name(name); + shmem_info_get_version(&major, &minor); - printf("Hello, world, I am %d of %d\n", - proc, nproc); + printf("Hello, world, I am %d of %d: %s (version: %d.%d)\n", + proc, nproc, name, major, minor); + shmem_finalize(); return 0; } diff --git a/examples/hello_oshmemfh.f90 b/examples/hello_oshmemfh.f90 index 283697bad3..09404c3bb8 100644 --- a/examples/hello_oshmemfh.f90 +++ b/examples/hello_oshmemfh.f90 @@ -13,11 +13,17 @@ program hello_oshmem include 'shmem.fh' integer proc, nproc - integer my_pe, num_pes + integer shmem_my_pe, shmem_n_pes + integer major, minor, len + character(len=SHMEM_MAX_NAME_LEN) name - call START_PES(0) - proc = MY_PE() - nproc = NUM_PES() + call SHMEM_INIT() + proc = SHMEM_MY_PE() + nproc = SHMEM_N_PES() + call SHMEM_INFO_GET_VERSION(major, minor) + call SHMEM_INFO_GET_NAME(name) + + write(*, '("Hello, world, I am ", i2, " of ", i2, ": (version: ", i0, ".", i0, ")")') proc, nproc, major, minor + call SHMEM_FINALIZE() - write(*, '("Hello, world, I am ", i2, " of ", i2)') proc, nproc end program hello_oshmem