dnl $Id$ dnl dnl Copyright 1989-2016 MINES ParisTech dnl dnl This file is part of PIPS. dnl dnl PIPS is free software: you can redistribute it and/or modify it dnl under the terms of the GNU General Public License as published by dnl the Free Software Foundation, either version 3 of the License, or dnl any later version. dnl dnl PIPS is distributed in the hope that it will be useful, but WITHOUT ANY dnl WARRANTY; without even the implied warranty of MERCHANTABILITY or dnl FITNESS FOR A PARTICULAR PURPOSE. dnl dnl See the GNU General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with PIPS. If not, see . dnl /* a set a functions to print the host and node status in PVM, * called from a Fortran subroutine. * Portability based on pvm m4 macros. * * Fabien Coelho, 1993-1994-1995-1996 */ #include #include #include #include "pvm3.h" /* PVM 3.2 / PVMe compatibility: managed by m4 * - pvmhostinfo -> hostinfo * - pvmtaskinfo -> taskinfo (also adds ti_pid) */ ifdef(`_HPFC_NO_PVM_VERSION_', char * pvm_version() { return "special pvm on PVM_ARCH";} ) /* quick checking of PVM function returns */ #define check(var, msg) if(var<0)fprintf(stderr,"Error %d (%s)\n",var,msg); /* returns the host name from its number and the table of hosts. * ??? I guess I should abort if not found... */ static char * host_name( int ti_host, /* the host number we are looking for */ int nhost, /* the number of hosts */ struct pvmhostinfo *hostp) /* the struct in which the information is */ { int i; for(i=0 ; iti_host, nhost, hostp) : "not found"); fprintf(stderr, "%d nodes:\n", (*number)); for( i=0 ; i<(*number) ; i++ ) { found = which_task(tids[i], ntask, taskp); fprintf(stderr, "%d running on %s\n", i+1, found ? host_name(found->ti_host, nhost, hostp) : "not found"); } fprintf(stderr, "\n"); } /* That's all */