00001 /* ---------------------------------------------------------------- */ 00002 /* (C)Copyright IBM Corp. 2007, 2008 */ 00003 /* ---------------------------------------------------------------- */ 00009 /* File: ad_bgl_pset.h 00010 * 00011 * Defines two structures that keep BG/L PSET specific information and their public interfaces: 00012 * . ADIOI_BGL_ProcInfo_t object keeps specific information to each process 00013 * . ADIOI_BGL_ConfInfo_t object keeps general information for the whole communicator, only kept 00014 * on process 0. 00015 */ 00016 00017 #ifndef AD_BGL_PSET_H_ 00018 #define AD_BGL_PSET_H_ 00019 00020 /* Keeps specific information to each process, will be exchanged among processes */ 00021 typedef struct { 00022 00023 int psetNum; /* which PSET I am in */ 00024 int rank; /* my rank */ 00025 int xInPset; /* my relative coordinates in my PSET */ 00026 int yInPset; 00027 int zInPset; 00028 int cpuid; /* my CPU id -- for virtual node mode (t coord)*/ 00029 int rankInPset; /* my relative rank in my PSET */ 00030 00031 int __pad; /* pad to 16 byte alignment */ 00032 00033 } ADIOI_BGL_ProcInfo_t __attribute__((aligned(16))); 00034 00035 00036 /* Keeps general information for the whole communicator, only on process 0 */ 00037 typedef struct { 00038 00039 int PsetSize; 00040 int nAggrs; 00041 int numPsets; 00042 int isVNM; 00043 int virtualPsetSize; 00044 int nProcs; 00045 float aggRatio; 00046 int cpuidSize; /* how many cpu ids? (t size) */ 00047 00048 } ADIOI_BGL_ConfInfo_t __attribute__((aligned(16))); 00049 00050 00051 #undef MIN 00052 #define MIN(a,b) ((a<b ? a : b)) 00053 00054 00055 /* Default is to choose 8 aggregator nodes in each 32 CN pset. 00056 Also defines default ratio of aggregator nodes in each a pset. 00057 For Virtual Node Mode, the ratio is 8/64 */ 00058 #define ADIOI_BGL_NAGG_PSET_MIN 1 00059 #define ADIOI_BGL_NAGG_PSET_DFLT 8 00060 #define ADIOI_BGL_PSET_SIZE_DFLT 32 00061 00062 00063 /* public funcs for ADIOI_BGL_ProcInfo_t objects */ 00064 ADIOI_BGL_ProcInfo_t * ADIOI_BGL_ProcInfo_new(); 00065 ADIOI_BGL_ProcInfo_t * ADIOI_BGL_ProcInfo_new_n( int n ); 00066 void ADIOI_BGL_ProcInfo_free( ADIOI_BGL_ProcInfo_t *info ); 00067 00068 00069 /* public funcs for ADIOI_BGL_ConfInfo_t objects */ 00070 ADIOI_BGL_ConfInfo_t * ADIOI_BGL_ConfInfo_new (); 00071 void ADIOI_BGL_ConfInfo_free( ADIOI_BGL_ConfInfo_t *info ); 00072 00073 00074 /* public funcs for a pair of ADIOI_BGL_ConfInfo_t and ADIOI_BGL_ProcInfo_t objects */ 00075 void ADIOI_BGL_persInfo_init( ADIOI_BGL_ConfInfo_t *conf, 00076 ADIOI_BGL_ProcInfo_t *proc, 00077 int s, int r, int n_aggrs ); 00078 void ADIOI_BGL_persInfo_free( ADIOI_BGL_ConfInfo_t *conf, 00079 ADIOI_BGL_ProcInfo_t *proc ); 00080 00081 00082 #endif /* AD_BGL_PSET_H_ */