Script xalt_generate_assembly_in_py
[hide private]
[frames] | no frames]

Source Code for Script script-xalt_generate_assembly_in_py

 1  # -*- python -*- 
 2  # 
 3  # Git Version: @git@ 
 4   
 5  #----------------------------------------------------------------------- 
 6  # XALT: A tool that tracks users jobs and environments on a cluster. 
 7  # Copyright (C) 2013-2014 University of Texas at Austin 
 8  # Copyright (C) 2013-2014 University of Tennessee 
 9  #  
10  # This library is free software; you can redistribute it and/or modify 
11  # it under the terms of the GNU Lesser General Public License as 
12  # published by the Free Software Foundation; either version 2.1 of  
13  # the License, or (at your option) any later version.  
14  # 
15  # This library is distributed in the hope that it will be useful, 
16  # but WITHOUT ANY WARRANTY; without even the implied warranty of 
17  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 
18  # Lesser  General Public License for more details.  
19  # 
20  # You should have received a copy of the GNU Lesser General Public 
21  # License along with this library; if not, write to the Free 
22  # Software Foundation, Inc., 59 Temple Place, Suite 330, 
23  # Boston, MA 02111-1307 USA 
24  #----------------------------------------------------------------------- 
25   
26  from __future__ import print_function 
27  import os, sys, time, platform 
28   
29  dirNm, execName = os.path.split(os.path.realpath(sys.argv[0])) 
30  sys.path.insert(1,os.path.realpath(os.path.join(dirNm, "../libexec"))) 
31  sys.path.insert(1,os.path.realpath(os.path.join(dirNm, "../site"))) 
32   
33  from xalt_util  import config_logger, extract_compiler 
34   
35  logger = config_logger() 
36   
73       
74   
75 -def main():
76 """ Generate XALT assembly code """ 77 try: 78 uuid = sys.argv[1] 79 syshost = sys.argv[2] 80 pstree = sys.argv[3] 81 fn = sys.argv[4] 82 version = "@version@" 83 epochStr = str(time.time()) 84 85 compiler = extract_compiler(pstree) 86 87 print_assembly(uuid, fn, version, syshost, compiler, epochStr) 88 89 print(epochStr) 90 except: 91 logger.exception("XALT_EXCEPTION:xalt_generate_assembly")
92 93 94 if ( __name__ == '__main__'): main() 95