Skip to content

Commit

Permalink
sessions: fixup example code compilation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
David Ozog committed Apr 29, 2024
1 parent 839bf8d commit 4a38b7b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/spec-example/shmem_session_example.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
*/

#include <shmem.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>

#define N_UPDATES (1lu << 18)
#define N_INDICES (1lu << 10)
Expand All @@ -27,18 +27,18 @@ int main(void) {
shmem_global_exit(1);
}

shmem_config_t config;
shmem_session_config_t config;
long config_mask;
config.total_ops = N_UPDATES;
config_mask = SHMEM_SESSION_TOTAL_OPS;

shmem_session_start(ctx, SHMEM_SESSION_SAME_AMO, config, config_mask);
shmem_session_start(ctx, SHMEM_SESSION_SAME_AMO, &config, config_mask);

for (size_t i = 0; i < N_UPDATES; i++) {
int random_pe = rand() % npes;
size_t random_idx = rand() % N_INDICES;
uint64_t random_val = rand() % N_VALUES;
shmem_uint64_atomic_xor(ctx, &table[random_idx], random_val, random_pe);
shmem_ctx_uint64_atomic_xor(ctx, &table[random_idx], random_val, random_pe);
}

shmem_session_stop(ctx);
Expand Down

0 comments on commit 4a38b7b

Please sign in to comment.