Main Page | Class List | File List | Class Members | File Members

bginfo.h

Go to the documentation of this file.
00001 
00103 #ifndef __BGINFO_H_DEFINED__
00104 #define __BGINFO_H_DEFINED__
00105 
00106 /* including for struct in_addr and inet_* family */
00107 #include <sys/socket.h>
00108 #include <netinet/in.h>
00109 #include <arpa/inet.h>
00110 
00111 /* including for rts_get_personality(), struct BGLPersonality and
00112    BGLPersonality_* family */
00113 #include "rts.h"   
00114 
00115 
00119 typedef struct
00120 {
00121   int            rank;  
00122   struct in_addr addr;  
00123 } bginfo_rank_ip_pair;
00124 
00130 typedef struct {
00131   struct in_addr addr;  
00132   int sp;               
00133   int ep;               
00134 } bginfo_ion_vec;
00135 
00143 typedef struct
00144 {
00145   int is_map_created;                 
00147   bginfo_rank_ip_pair* rank_ip_map;   
00148   int rank_ip_map_size;               
00150   bginfo_ion_vec* ions;               
00151   int n_ions;                         
00153   int ci_ratio;                       
00154   int ratio_uneven;                   
00156   BGLPersonality   p;    
00159 } bginfo_struct;
00160 
00161 
00162 
00163 
00179 void bginfo_print_info_full(); 
00180 
00181 
00191 void bginfo_print_info();
00192 
00201 
00210 int bginfo_init();
00211 
00212 
00217 bginfo_struct* bginfo_get_struct(); 
00218 
00222 /*======================================================================
00223   Version macro and functions
00224   ======================================================================*/
00225 
00229 #define BGINFO_VERSION       "0.6"
00230 
00231 
00239 int bginfo_driver_version(char* buf, int len);
00240 
00241 
00249 int bginfo_zepto_version(char* buf, int len);
00250 
00251 
00252 
00253 /*======================================================================
00254   BG/L personality related functions
00255   ======================================================================*/
00273 
00277 int    bginfo_is_virtualnodemode();
00278 
00282 int    bginfo_num_computenodes();
00283 
00287 int    bginfo_num_ionodes();
00288 
00293 size_t bginfo_memorysize_per_node();
00294 
00308 int bginfo_personality_get_valstr(const char* key,
00309                                   char* valstr, size_t valstrsize );
00310 
00311 
00312 
00313 
00314 
00315 /*======================================================================
00316   ION CN mapping functions
00317   ======================================================================*/
00318 
00319 
00326 int bginfo_uneven_ci_ratio();
00327 
00331 int bginfo_ci_ratio();
00332 
00336 int bginfo_n_ions();
00337 
00347 char* bginfo_ion_ipstr( int ion_idx );
00348 
00355 int bginfo_find_ion(int rank);
00356 
00357 
00358 
00365 const char* bginfo_bglmpi_mapping();
00366 
00367 
00368 /*======================================================================
00369   Misc
00370   ======================================================================*/
00376 
00384 int bginfo_ion_proc_readline(const char* fn, char* buf, int len);
00385 
00392 int bginfo_get_valstr_from_file(const char* fn,
00393                                 const char* key,
00394                                 char* valstr, size_t valstrsize );
00395 
00396 void _bginfo_perror(const char* msg, int lno, char* fn);
00397 
00398 #define bginfo_perror(msg)   _bginfo_perror((msg),__LINE__,__FILE__)
00399 
00403 #endif

Generated on Mon Jan 30 15:51:34 2006 for bginfo by  doxygen 1.4.4