add env var debugging

This commit is contained in:
Bryce Allen
2020-03-31 14:31:11 -04:00
parent 74b23dff0b
commit df9a3a79a8
3 changed files with 54 additions and 4 deletions

View File

@@ -64,7 +64,6 @@ void set_rank_device(int n_ranks, int rank) {
int main(int argc, char **argv) {
int n = 1024;
int world_size, world_rank;
double a = 2.0;
@@ -73,6 +72,8 @@ int main(int argc, char **argv) {
double *x, *y, *d_x, *d_y;
double *m_x, *m_y;
char *mb_per_core;
MPI_Init(NULL, NULL);
MPI_Comm_size(MPI_COMM_WORLD, &world_size);
@@ -91,10 +92,21 @@ int main(int argc, char **argv) {
}
for (int i=0; i<n; i++) {
x[i] = i+1;
x[i] = i+1;
y[i] = -i-1;
}
// DEBUG weirdness on summit where GENE can't see MEMORY_PER_CORE,
// possibly because the system spectrum mpi uses it in some way.
if (world_rank == 0) {
mb_per_core = getenv("MEMORY_PER_CORE");
if (mb_per_core == NULL) {
printf("MEMORY_PER_CORE is not set\n");
} else {
printf("MEMORY_PER_CORE=%s\n", mb_per_core);
}
}
set_rank_device(world_size, world_rank);
//CHECK("setDevice", cudaSetDevice(0));