Skip to content

Commit

Permalink
print hostname if out of shm space
Browse files Browse the repository at this point in the history
  • Loading branch information
abagusetty authored and ajaypanyala committed Nov 20, 2023
1 parent 6154261 commit c716434
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions comex/src-mpi-pr/comex.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ sicm_device_list nill;
#define STR(x) XSTR(x)
#define MIN(a, b) (((b) < (a)) ? (b) : (a))

#ifndef HOST_NAME_MAX
#define HOST_NAME_MAX 256
#endif

/* data structures */

typedef enum {
Expand Down Expand Up @@ -7576,9 +7580,11 @@ STATIC void check_devshm(int fd, size_t size){
#endif
}
if ( newspace > devshm_fs_left ) {
fprintf(stderr, "[%d] /dev/shm fs has size %ld new shm area has size %ld need to increase /dev/shm by %ld Mbytes\n",
g_state.rank, devshm_fs_left/CONVERT_TO_M, newspace/CONVERT_TO_M, (newspace - devshm_fs_left)/CONVERT_TO_M);
perror("check_devshm: /dev/shm out of space");
char hostname[HOST_NAME_MAX+1];
gethostname(hostname, HOST_NAME_MAX+1);
fprintf(stderr, "hostname: %s, [%d] /dev/shm fs has size %ld bytes left, new shm area has size %ld need to increase /dev/shm by %ld Mbytes\n", hostname, g_state.rank, devshm_fs_left/CONVERT_TO_M, newspace/CONVERT_TO_M, (newspace - devshm_fs_left)/CONVERT_TO_M);

perror("check_devshm: /dev/shm out of space");
// _free_semaphore();
comex_error("check_devshm: /dev/shm out of space", -1);

Expand Down

0 comments on commit c716434

Please sign in to comment.