Use new naming scheme
This commit is contained in:
@@ -36,7 +36,7 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <roc_shmem/roc_shmem.hpp>
|
||||
#include <rocshmem/rocshmem.hpp>
|
||||
|
||||
using namespace rocshmem;
|
||||
|
||||
@@ -47,49 +47,49 @@ int main(int argc, char *argv[]) {
|
||||
int i, num_pes;
|
||||
int failed = 0;
|
||||
|
||||
roc_shmem_init();
|
||||
rocshmem_init();
|
||||
|
||||
target = (long *)roc_shmem_malloc(sizeof(long) * 10);
|
||||
flag = (int *)roc_shmem_malloc(sizeof(int));
|
||||
target = (long *)rocshmem_malloc(sizeof(long) * 10);
|
||||
flag = (int *)rocshmem_malloc(sizeof(int));
|
||||
if (!flag) {
|
||||
fprintf(stderr, "ERR - null flag pointer\n");
|
||||
roc_shmem_global_exit(1);
|
||||
rocshmem_global_exit(1);
|
||||
}
|
||||
*flag = 0;
|
||||
|
||||
num_pes = roc_shmem_n_pes();
|
||||
num_pes = rocshmem_n_pes();
|
||||
|
||||
if (target) {
|
||||
memset(target, 0, sizeof(long) * 10);
|
||||
} else {
|
||||
fprintf(stderr, "ERR - null target pointer\n");
|
||||
roc_shmem_global_exit(1);
|
||||
rocshmem_global_exit(1);
|
||||
}
|
||||
|
||||
roc_shmem_barrier_all();
|
||||
rocshmem_barrier_all();
|
||||
|
||||
if (roc_shmem_my_pe() == 0) {
|
||||
if (rocshmem_my_pe() == 0) {
|
||||
for (i = 0; i < num_pes; i++) {
|
||||
roc_shmem_long_put_nbi(target, source, 10, i);
|
||||
roc_shmem_fence();
|
||||
roc_shmem_int64_atomic_inc((int64_t *)flag, i);
|
||||
rocshmem_long_put_nbi(target, source, 10, i);
|
||||
rocshmem_fence();
|
||||
rocshmem_int64_atomic_inc((int64_t *)flag, i);
|
||||
}
|
||||
}
|
||||
|
||||
roc_shmem_int_wait_until(flag, ROC_SHMEM_CMP_EQ, 1);
|
||||
rocshmem_int_wait_until(flag, ROCSHMEM_CMP_EQ, 1);
|
||||
|
||||
for (i = 0; i < 10; i++) {
|
||||
if (target[i] != source[i]) {
|
||||
fprintf(stderr, "[%d] target[%d] = %ld, expected %ld\n",
|
||||
roc_shmem_my_pe(), i, target[i], source[i]);
|
||||
rocshmem_my_pe(), i, target[i], source[i]);
|
||||
failed = 1;
|
||||
}
|
||||
}
|
||||
|
||||
roc_shmem_free(target);
|
||||
roc_shmem_free(flag);
|
||||
rocshmem_free(target);
|
||||
rocshmem_free(flag);
|
||||
|
||||
roc_shmem_finalize();
|
||||
rocshmem_finalize();
|
||||
|
||||
return failed;
|
||||
}
|
||||
|
||||
مرجع در شماره جدید
Block a user