Changeset a7b97b9


Ignore:
Timestamp:
05/30/15 23:54:09 (9 years ago)
Author:
Hal Finkel <hfinkel@…>
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)
Message:

use kernel rank on the bgq instead of pid

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Makefile

    r510af01 ra7b97b9  
    22CXXFLAGS = -std=gnu++0x -O3 -g 
    33 
    4 CPPFLAGS = 
     4# When compiling with CXX=powerpc64-bgq-linux-g++, we need these: 
     5CPPFLAGS = -I/bgsys/drivers/ppcfloor -I/bgsys/drivers/ppcfloor/spi/include/kernel/cnk 
     6 
    57LDFLAGS = -lpthread -ldl 
    68 
  • memlog.cpp

    rf715c76 ra7b97b9  
    2727#include <dlfcn.h> 
    2828 
     29#ifdef __bgq__ 
     30#include <spi/include/kernel/location.h> 
     31#endif 
     32 
    2933using namespace std; 
    3034 
     
    4650  uname(&u); 
    4751 
     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 
    4860  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); 
    5062  log_file = fopen(log_name, "w"); 
    5163  if (!log_file) 
Note: See TracChangeset for help on using the changeset viewer.