📄 vmonitor.c
字号:
/* MPICH-V Copyright (C) 2002, 2003 Groupe Cluster et Grid, LRI, Universite de Paris Sud This file is part of MPICH-V. MPICH-V is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. MPICH-V is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with MPICH-V; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA $Id: vmonitor.c,v 1.3 2004/02/17 15:57:46 gk Exp $*/#include "vrun_msg.h"#include "vrun_versions.h"/* This file contains the functions that are necessary to monitor the execution, as it is exactly the same behavior for all the different versions */void monitorExecution(JS *js) { /* What we need to do here is just look at what's going on on the sockets */ if (js->finalizing) { if ((ret = select(FD_SETSIZE, &setOfCN, NULL, NULL, selectTimeout)) < 0) { printf("Error in select\n"); bailout(js); } } else { if ((ret = select(FD_SETSIZE, &setOfCN, NULL, NULL, NULL)) < 0 ) { printf("Error in select\n"); bailout(js); } } currentConencted = js->connectedNodes; while(currentConnected != NULL) { if (FD_ISSET(currentConnected->socket, &setOfCN)) break; currentConnected = currentConnected->next; } if (currentConnected != NULL) { /* We have a node event! */ if (read(currentConnected->socket, &msg, sizeof(int)) == 0) { /* We've got no message -> it's a disconnection */ if (!js->moving[currentConnected->rank]) { fprintf(stdout,"***** A crash was detected *****\n"); fflush(stdout); } if (js->autoRelaunch) { fprintf(stdout,"Relaunching rank %d\n", currentConnected->rank); fflush(stdout); relaunchByRank(currentconnected->rank, js, js->moving[currentConnected->rank]); js->moving[currentConnected->rank] = false; } else { auxCN = js->nodeList; while (auxCN->rank != currentConnected->rank) auxCN = auxCN->next; nodeCommandLine(&commandLine, RESTART, js, *auxCN); fprintf(stdout,"In order to continue execution, you need to relaunch the nmode with the following command:\n\n %s\n\n", commandLine); fflush(stdout); } if (!js->moving[currentConnected->rank]) { fprintf(stdout, "************************************\n"); fflush(stdout); } /* We reconnect to the node that has previously been disconnected */ acceptConnectionFromNode(js, node); } /* If we have a message */ } else { if (msg == FINALIZE_MSG) { js->finalizing = true; removeConnectedNode(currentConnected); } } else if (FD_ISSET(fdFifo, &setOfCN)) { /* Order on the FIFO file! */ n = read(fdFifo, buff, sizeof(buff)-1); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -