Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup SOS Tests #44

Open
markbrown314 opened this issue May 16, 2024 · 0 comments
Open

Cleanup SOS Tests #44

markbrown314 opened this issue May 16, 2024 · 0 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@markbrown314
Copy link
Collaborator

markbrown314 commented May 16, 2024

  1. There are some cases in the code base where memory allocations shmem_malloc() returns are not checked for NULL results. That should be fixed.

e.g.

web.c:174:    channels = shmem_malloc(n_threads*sizeof(channel));
web.c-175-    memset(channels,0,n_threads*sizeof(channel));
web.c-176-

spam.c:452:    pSync = (long*) shmem_malloc( 2 * sizeof(long) * SHMEM_COLLECT_SYNC_SIZE );
spam.c-453-    pSync1 = &pSync[SHMEM_COLLECT_SYNC_SIZE];

shmem_team_ptr.c:85:    shr_heap = shmem_malloc(sizeof(int));
shmem_team_ptr.c-86-    *shr_heap = me;
  1. Deprecated tests are interleaved with active tests and separated through conditional compilation. These deprecated tests should be moved to their own C files and then be compiled with the build system rather than using conditional compilation within the same file. It would improve readability at the cost of code duplication.

e.g.

119:#ifdef ENABLE_DEPRECATED_TESTS
120-    shmem_int_and_to_all(NULL, NULL, 0, 0, 0, npes, pwrk, reduce_psync);
121-#else
122-    shmem_uint_and_reduce(SHMEM_TEAM_WORLD, NULL, NULL, 0);
123-#endif
124-    shmem_barrier_all();
125:#ifdef ENABLE_DEPRECATED_TESTS
126-    shmem_int_or_to_all(NULL, NULL, 0, 0, 0, npes, pwrk, reduce_psync);
127-#else
128-    shmem_uint_or_reduce(SHMEM_TEAM_WORLD, NULL, NULL, 0);
129-#endif
130-    shmem_barrier_all();
131:#ifdef ENABLE_DEPRECATED_TESTS
132-    shmem_int_xor_to_all(NULL, NULL, 0, 0, 0, npes, pwrk, reduce_psync);
133-#else
134-    shmem_uint_xor_reduce(SHMEM_TEAM_WORLD, NULL, NULL, 0);
135-#endif
136-    shmem_barrier_all();
137:#ifdef ENABLE_DEPRECATED_TESTS
138-    shmem_int_min_to_all(NULL, NULL, 0, 0, 0, npes, pwrk, reduce_psync);
139-#else
140-    shmem_int_min_reduce(SHMEM_TEAM_WORLD, NULL, NULL, 0);
141-#endif
142-    shmem_barrier_all();
143:#ifdef ENABLE_DEPRECATED_TESTS
144-    shmem_int_max_to_all(NULL, NULL, 0, 0, 0, npes, pwrk, reduce_psync);
145-#else
146-    shmem_int_max_reduce(SHMEM_TEAM_WORLD, NULL, NULL, 0);
147-#endif
148-    shmem_barrier_all();
149:#ifdef ENABLE_DEPRECATED_TESTS
150-    shmem_int_sum_to_all(NULL, NULL, 0, 0, 0, npes, pwrk, reduce_psync);
151-#else
152-    shmem_int_sum_reduce(SHMEM_TEAM_WORLD, NULL, NULL, 0);
153-#endif

I might add some more items to this list as I come across them.

@markbrown314 markbrown314 added bug Something isn't working enhancement New feature or request labels May 16, 2024
@markbrown314 markbrown314 self-assigned this May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant