1
1

oshmem: Align OSHMEM API with spec v1.2 (change examples)

Этот коммит содержится в:
Igor Ivanov 2015-11-19 16:34:15 +02:00
родитель 2dc2159b4c
Коммит af6ce46f6b
2 изменённых файлов: 21 добавлений и 10 удалений

Просмотреть файл

@ -15,13 +15,18 @@
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
int proc, nproc; int proc, nproc;
char name[SHMEM_MAX_NAME_LEN];
int major, minor;
start_pes(0); shmem_init();
nproc = _num_pes(); nproc = shmem_n_pes();
proc = _my_pe(); proc = shmem_my_pe();
shmem_info_get_name(name);
shmem_info_get_version(&major, &minor);
printf("Hello, world, I am %d of %d\n", printf("Hello, world, I am %d of %d: %s (version: %d.%d)\n",
proc, nproc); proc, nproc, name, major, minor);
shmem_finalize();
return 0; return 0;
} }

Просмотреть файл

@ -13,11 +13,17 @@ program hello_oshmem
include 'shmem.fh' include 'shmem.fh'
integer proc, nproc 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) call SHMEM_INIT()
proc = MY_PE() proc = SHMEM_MY_PE()
nproc = NUM_PES() 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 end program hello_oshmem