1 /* -*- C -*- 2 * 3 * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana 4 * University Research and Technology 5 * Corporation. All rights reserved. 6 * Copyright (c) 2004-2005 The University of Tennessee and The University 7 * of Tennessee Research Foundation. All rights 8 * reserved. 9 * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, 10 * University of Stuttgart. All rights reserved. 11 * Copyright (c) 2004-2005 The Regents of the University of California. 12 * All rights reserved. 13 * Copyright (c) 2016-2017 Research Organization for Information Science 14 * and Technology (RIST). All rights reserved. 15 * Copyright (c) 2011 Cisco Systems, Inc. All rights reserved. 16 * $COPYRIGHT$ 17 * 18 * Additional copyrights may follow 19 * 20 * $HEADER$ 21 */ 22 23 #ifndef ORTE_UTIL_HOSTFILE_LEX_H_ 24 #define ORTE_UTIL_HOSTFILE_LEX_H_ 25 26 #include "orte_config.h" 27 28 #ifdef malloc 29 #undef malloc 30 #endif 31 #ifdef realloc 32 #undef realloc 33 #endif 34 #ifdef free 35 #undef free 36 #endif 37 38 #include <stdio.h> 39 40 typedef union { 41 int ival; 42 char* sval; 43 } orte_hostfile_value_t; 44 45 extern int orte_util_hostfile_lex(void); 46 extern FILE *orte_util_hostfile_in; 47 extern int orte_util_hostfile_line; 48 extern bool orte_util_hostfile_done; 49 extern orte_hostfile_value_t orte_util_hostfile_value; 50 extern int orte_util_hostfile_lex_destroy (void ); 51 52 /* 53 * Make lex-generated files not issue compiler warnings 54 */ 55 #define YY_STACK_USED 0 56 #define YY_ALWAYS_INTERACTIVE 0 57 #define YY_NEVER_INTERACTIVE 0 58 #define YY_MAIN 0 59 #define YY_NO_UNPUT 1 60 #define YY_SKIP_YYWRAP 1 61 62 #define ORTE_HOSTFILE_DONE 0 63 #define ORTE_HOSTFILE_ERROR 1 64 #define ORTE_HOSTFILE_QUOTED_STRING 2 65 #define ORTE_HOSTFILE_EQUAL 3 66 #define ORTE_HOSTFILE_INT 4 67 #define ORTE_HOSTFILE_STRING 5 68 #define ORTE_HOSTFILE_CPU 6 69 #define ORTE_HOSTFILE_COUNT 7 70 #define ORTE_HOSTFILE_SLOTS 8 71 #define ORTE_HOSTFILE_SLOTS_MAX 9 72 #define ORTE_HOSTFILE_USERNAME 10 73 #define ORTE_HOSTFILE_IPV4 11 74 #define ORTE_HOSTFILE_HOSTNAME 12 75 #define ORTE_HOSTFILE_NEWLINE 13 76 #define ORTE_HOSTFILE_IPV6 14 77 #define ORTE_HOSTFILE_SLOT 15 78 #define ORTE_HOSTFILE_RELATIVE 16 79 #define ORTE_HOSTFILE_BOARDS 17 80 #define ORTE_HOSTFILE_SOCKETS_PER_BOARD 18 81 #define ORTE_HOSTFILE_CORES_PER_SOCKET 19 82 /* ensure we can handle a rank_file input */ 83 #define ORTE_HOSTFILE_RANK 20 84 #define ORTE_HOSTFILE_PORT 21 85 86 #endif 87