00001 00005 00011 #include "manager.h" 00012 #include "CentralLB.h" 00013 #include "converse.h" 00014 #include "conv-ccs.h" 00015 00016 #if CMK_SHRINK_EXPAND 00017 realloc_state pending_realloc_state; 00018 char * se_avail_vector; 00019 extern "C" int numProcessAfterRestart; 00020 extern "C" CcsDelayedReply shrinkExpandreplyToken; 00021 extern "C" char willContinue=0; 00022 #endif 00023 extern int load_balancer_created; 00024 static void handler(char *bit_map) 00025 { 00026 #if CMK_SHRINK_EXPAND 00027 shrinkExpandreplyToken = CcsDelayReply(); 00028 bit_map += CmiMsgHeaderSizeBytes; 00029 pending_realloc_state = REALLOC_MSG_RECEIVED; 00030 00031 if((CkMyPe() == 0) && (load_balancer_created)) 00032 LBDatabaseObj()->set_avail_vector(bit_map); 00033 00034 se_avail_vector = (char *)malloc(sizeof(char) * CkNumPes()); 00035 LBDatabaseObj()->get_avail_vector(se_avail_vector); 00036 00037 numProcessAfterRestart = *((int *)(bit_map + CkNumPes())); 00038 #endif 00039 } 00040 00041 void manager_init(){ 00042 #if CMK_SHRINK_EXPAND 00043 static int inited = 0; 00044 willContinue = 0; 00045 if (inited) return; 00046 CcsRegisterHandler("set_bitmap", (CmiHandler) handler); 00047 inited = 1; 00048 pending_realloc_state = NO_REALLOC; 00049 #endif 00050 } 00051 00052