Changeset a7b97b9 for memlog.cpp
- Timestamp:
- 05/30/15 23:54:09 (9 years ago)
- Branches:
- master
- Children:
- 22f928f
- Parents:
- 518793d
- git-author:
- Hal Finkel <hfinkel@…> (05/30/15 23:54:09)
- git-committer:
- Hal Finkel <hfinkel@…> (05/30/15 23:54:09)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
memlog.cpp
rf715c76 ra7b97b9 27 27 #include <dlfcn.h> 28 28 29 #ifdef __bgq__ 30 #include <spi/include/kernel/location.h> 31 #endif 32 29 33 using namespace std; 30 34 … … 46 50 uname(&u); 47 51 52 int id = (int) getpid(); 53 #ifdef __bgq__ 54 // If we're really running on a BG/Q compute node, use the job rank instead 55 // of the pid because the node name might not really be globally unique. 56 if (!strcmp(u.sysname, "CNK") && !strcmp(u.machine, "BGQ")) 57 id = (int) Kernel_GetRank(); 58 #endif 59 48 60 char log_name[PATH_MAX+1]; 49 snprintf(log_name, PATH_MAX+1, "%s.%d.memlog", u.nodename, getpid());61 snprintf(log_name, PATH_MAX+1, "%s.%d.memlog", u.nodename, id); 50 62 log_file = fopen(log_name, "w"); 51 63 if (!log_file)
Note: See TracChangeset
for help on using the changeset viewer.