Hello community, here is the log from the commit of package petsc for openSUSE:Factory checked in at 2018-03-14 19:37:23 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/petsc (Old) and /work/SRC/openSUSE:Factory/.petsc.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "petsc" Wed Mar 14 19:37:23 2018 rev:9 rq:585011 version:3.8.3 Changes: -------- --- /work/SRC/openSUSE:Factory/petsc/petsc.changes 2018-02-23 15:31:24.159044174 +0100 +++ /work/SRC/openSUSE:Factory/.petsc.new/petsc.changes 2018-03-14 19:37:23.624706012 +0100 @@ -1,0 +2,23 @@ +Fri Mar 9 12:30:57 UTC 2018 - [email protected] + +- Don't build the serial flavor as the build presently breaks + everywhere (bsc#1084677). + +------------------------------------------------------------------- +Sun Mar 4 09:11:32 UTC 2018 - [email protected] + +- Python-Fix-a-number-of-scripts-to-by-Python-3-compliant.patch: + Fix python scripts - convert to Python 3 (bsc#1082209). +- Restructure package: factor out SAWs stuff. We cannot + support this as SAWs itself isn't available for SUSE. +- Move python files that are not stand-alone out of the + bin directory. +- Fix permissions in bin and other directories. +- Removed some unwanted scripts: + rules - make rules + sendToJenkins - this should probably be modified to print an error message + uncrustify.cfg - used by 'rules' +- Removed win32fe: DLLs for Windows +- Set '-fPIC' on ppc64. + +------------------------------------------------------------------- New: ---- Python-Fix-a-number-of-scripts-to-by-Python-3-compliant.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ petsc.spec ++++++ --- /var/tmp/diff_new_pack.peKatg/_old 2018-03-14 19:37:25.008656855 +0100 +++ /var/tmp/diff_new_pack.peKatg/_new 2018-03-14 19:37:25.012656714 +0100 @@ -172,11 +172,13 @@ Patch2: petsc-3.3-p2-dont-check-for-option-mistakes.patch Patch3: petsc-3.3-fix-error-detection-in-makefile.patch Patch4: petsc-3.7-fix-pastix-detection.patch +Patch5: Python-Fix-a-number-of-scripts-to-by-Python-3-compliant.patch Url: http://www.mcs.anl.gov/petsc/ BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: fdupes BuildRequires: pkg-config BuildRequires: python2 +BuildRequires: python3 %if 0%{?suse_version} >= 1315 BuildRequires: hwloc-devel %endif @@ -275,13 +277,29 @@ %description doc This package contains the documentation for petsc. +%if %{with hpc} +%package saws +Summary: PETsc SAWs infrastructure +#Requires: saws +#Requires: jshon +Group: Productivity/Scientific/Other +Requires: %{libname %_vers} = %{version} + +%description saws +This package contains the files to interface with SAWs +(Scientific Application Web server). SAWs itself is not +yet supported by %{?is_opensuse:open}SUSE. +%endif + %prep + %setup -q -n petsc-%{version} %patch0 -p1 -b .soname %patch1 -p1 -b .rpath %patch2 -p1 -b .option-mistakes %patch3 -p1 -b .error-detect %patch4 -p1 -b .pastix-detect +%patch5 -p1 %if 0 && %{without hpc} cat > %{_sourcedir}/baselibs.conf <<EOF %{libname %_vers} @@ -302,7 +320,7 @@ %hpc_setup module load phdf5 scalapack openblas %endif -%ifarch ppc64le +%ifarch ppc64le ppc64 export ARCHCFLAGS=-fPIC %endif @@ -416,6 +434,42 @@ mv %{buildroot}%{p_base}/lib/pkgconfig %{buildroot}%{p_libdir} fi +for i in update.py \ + bin/FASTMathInstaller.py \ + bin/TOPSGenerator.py \ + bin/petscnagupgrade.py \ + bin/configVars.py bin/update.py \ + lib/petsc/conf/reconfigure-arch-linux2-cxx-opt.py \ + lib/petsc/conf/uninstall.py +do + rm -f %{buildroot}%{p_prefix}/$i +done + +for file in %{hpc_bindir}/parseargs.py \ + %{hpc_bindir}/petsc_conf.py \ + %{hpc_bindir}/PetscBinaryIO.py \ + %{hpc_bindir}/PetscBinaryIOTrajectory.py +do + %{hpc_python_mv_to_sitearch $file} +done +rm -rf %{buildroot}/%{hpc_bindir}/win32fe +rm -f %{buildroot}/%{hpc_bindir}/uncrustify.cfg \ + %{buildroot}/%{hpc_bindir}/sendToJenkins \ + %{buildroot}/%{hpc_libdir}/rules + +%{hpc_shebang_prepend_list %{buildroot}%{hpc_bindir}/*.py} + +%hpc_shebang_sanitize_scripts %{buildroot}%{p_prefix}/bin +%hpc_shebang_sanitize_scripts %{buildroot}%{p_prefix}/lib/petsc + +tmp=$(mktemp /tmp/bad-XXXXXX}) +for file in $(find %{buildroot}%{p_prefix} -name "*.py"); do + %{hpc_verify_python3 $file} || echo "$file" >> $tmp +done +[ -s $tmp ] && { echo "One or more python script not Python 3 compliant!"; cat $tmp; exit 1; } +rm -f $tmp + +pyton_sitesearch_path=%{hpc_python_sitearch_no_singlespec} %hpc_write_modules_files #%%Module1.0##################################################################### @@ -453,6 +507,9 @@ prepend-path PATH %{hpc_bindir} prepend-path LD_LIBRARY_PATH %{hpc_libdir} +if {[file isdirectory $pyton_sitesearch_path]} { +prepend-path PYTHONPATH $pyton_sitesearch_path +} setenv %{hpc_upcase %pname}_DIR %{hpc_prefix} if {[file isdirectory %{hpc_bindir}]} { @@ -518,11 +575,14 @@ %{p_libdir}/*.so.* %{!?with_hpc:%{p_prefix}/lib/*.so.*} %{p_prefix}/share +%{dirname:%{hpc_python_sitearch_no_singlespec}} %exclude %{p_prefix}/share/petsc/examples +%exclude %{p_prefix}/share/petsc/saws %files %{?n_pre}devel %defattr(-,root,root,-) %{p_prefix}/bin +%exclude %{p_prefix}/bin/saws %{p_prefix}/include %{p_prefix}/lib/petsc %{p_prefix}/%{!?with_hpc:lib}%{?with_hpc:%_lib}/pkgconfig @@ -541,4 +601,11 @@ %doc docs/* %endif +%if %{with hpc} +%files saws +%defattr(-,root,root,-) +%{p_prefix}/bin/saws +%{p_prefix}/share/petsc/saws +%endif + %changelog ++++++ Python-Fix-a-number-of-scripts-to-by-Python-3-compliant.patch ++++++ From: Egbert Eich <[email protected]> Date: Sat Feb 24 19:41:46 2018 +0100 Subject: Python: Fix a number of scripts to by Python 3 compliant. Patch-mainline: Not yet Git-commit: 4a44f39b12a255e42cbee85177427b270ceb8889 References: Signed-off-by: Egbert Eich <[email protected]> --- bin/FASTMathInstaller.py | 94 ++++++++++++++++++------------------ bin/PetscBinaryIOTrajectory.py | 2 +- bin/TOPSGenerator.py | 4 +- bin/configVars.py | 12 ++--- bin/parseargs.py | 4 +- bin/petsclogformat.py | 48 +++++++++--------- bin/portabilitycheck.py | 8 +-- bin/saws/SAWs.py | 2 +- bin/taucc.py | 6 +-- bin/update.py | 2 +- src/ts/examples/tutorials/extchem.py | 2 +- 11 files changed, 92 insertions(+), 92 deletions(-) diff --git a/bin/FASTMathInstaller.py b/bin/FASTMathInstaller.py index 49cab5a..9da0594 100755 --- a/bin/FASTMathInstaller.py +++ b/bin/FASTMathInstaller.py @@ -61,13 +61,13 @@ except: sys.exit('Python is NOT installed with Tkinter on this system') if TkVersion < 8.0 : - print "\n" * 3 - print "*"*75 - print "Running Tk version:", TkVersion - print "You must be using Tk version 8.0 or greater to use EasyGui." - print "Terminating." - print "*"*75 - print "\n" * 3 + print("\n" * 3) + print("*"*75) + print("Running Tk version:", TkVersion) + print("You must be using Tk version 8.0 or greater to use EasyGui.") + print("Terminating.") + print("*"*75) + print("\n" * 3) sys.exit(0) @@ -202,10 +202,10 @@ def buttonbox(message="Shall I continue?", title="", choices = ["Button1", "Butt messageWidget.configure(font=(DEFAULT_FONT_FAMILY,fontSize)) messageWidget.pack(side=TOP, expand=YES, fill=X, padx='3m', pady='3m') - if message2: - messageWidget = Message(messageFrame, text=message2, width=len(message)*fontSize+4) - messageWidget.configure(font=(DEFAULT_FONT_FAMILY,DEFAULT_FONT_SIZE)) - messageWidget.pack(expand=YES, fill=X, padx='3m', pady='3m') + if message2: + messageWidget = Message(messageFrame, text=message2, width=len(message)*fontSize+4) + messageWidget.configure(font=(DEFAULT_FONT_FAMILY,DEFAULT_FONT_SIZE)) + messageWidget.pack(expand=YES, fill=X, padx='3m', pady='3m') __put_buttons_in_buttonframe(choices) @@ -311,10 +311,10 @@ def multenterbox(message="Fill in values for the fields." ---------------------------------------------------------------------- """ - if not argListOfFieldNames: - argListOfFieldNames = [''] - for i in range(0,len(argListOfFieldValues)+2): - argListOfFieldNames.append('') + if not argListOfFieldNames: + argListOfFieldNames = [''] + for i in range(0,len(argListOfFieldValues)+2): + argListOfFieldNames.append('') return __multfillablebox( message,title,argListOfFieldNames,argListOfFieldValues,None) @@ -360,9 +360,9 @@ def __multfillablebox(message="Fill in values for the fields." lastWidgetIndex = len(argListOfFieldNames) - 1 - max = 40 - for i in range(len(argListOfFieldNames)): - if len(argListOfFieldValues[i]) > max: max = len(argListOfFieldValues[i])+2 + max = 40 + for i in range(len(argListOfFieldNames)): + if len(argListOfFieldValues[i]) > max: max = len(argListOfFieldValues[i])+2 for widgetIndex in range(len(argListOfFieldNames)): argFieldName = argListOfFieldNames[widgetIndex] argFieldValue = argListOfFieldValues[widgetIndex] @@ -745,8 +745,8 @@ def __choiceboxGetChoice(event): choice_index = choiceboxWidget.curselection() __choiceboxResults = choiceboxWidget.get(choice_index) - # print "Debugging> mouse-event=", event, " event.type=", event.type - # print "Debugging> choice =", choice_index, __choiceboxResults + # print("Debugging> mouse-event=", event, " event.type=", event.type) + # print("Debugging> choice =", choice_index, __choiceboxResults) root.quit() @@ -1093,7 +1093,7 @@ def __put_buttons_in_buttonframe(choices): def _test(): # simple way to clear the console - print "\n" * 100 + print("\n" * 100) # START DEMONSTRATION DATA =================================================== choices_abc = ["This is choice 1", "And this is choice 2"] message = "Pick one! This is a huge choice, and you've got to make the right one " \ @@ -1164,67 +1164,67 @@ for someItem in myListOfStuff: if reply[0] == "msgbox": reply = msgbox("short message", "This is a long title") - print "Reply was:", reply + print("Reply was:", reply) elif reply[0] == "buttonbox": reply = buttonbox() - print "Reply was:", reply + print("Reply was:", reply) reply = buttonbox(message, "Demo of Buttonbox with many, many buttons!", choices) - print "Reply was:", reply + print("Reply was:", reply) elif reply[0] == "boolbox": reply = boolbox() - print "Reply was:", reply + print("Reply was:", reply) elif reply[0] == "integerbox": reply = integerbox( "Enter a number between 3 and 333", "Demo: integerbox WITH a default value", 222, 3, 333) - print "Reply was:", reply + print("Reply was:", reply) reply = integerbox( "Enter a number between 0 and 99", "Demo: integerbox WITHOUT a default value" ) - print "Reply was:", reply + print("Reply was:", reply) elif reply[0] == "diropenbox": title = "Demo of diropenbox" msg = "This is a test of the diropenbox.\n\nPick the directory that you wish to open." d = diropenbox(msg, title) - print "You chose directory...:", d + print("You chose directory...:", d) elif reply[0] == "fileopenbox": f = fileopenbox() - print "You chose to open file:", f + print("You chose to open file:", f) elif reply[0] == "filesavebox": f = filesavebox() - print "You chose to save file:", f + print("You chose to save file:", f) elif reply[0] == "indexbox": title = reply[0] msg = "Demo of " + reply[0] choices = ["Choice1", "Choice2", "Choice3", "Choice4"] reply = indexbox(msg, title, choices) - print "Reply was:", reply + print("Reply was:", reply) elif reply[0] == "enterbox": reply = enterbox("Enter the name of your best friend:", "Love!", "Suzy Smith") - print "Reply was:", str(reply) + print("Reply was:", str(reply)) reply = enterbox("Enter the name of your worst enemy:", "Hate!") - print "Reply was:", str(reply) + print("Reply was:", str(reply)) elif reply[0] == "ynbox": reply = ynbox(message, title) - print "Reply was:", reply + print("Reply was:", reply) elif reply[0] == "ccbox": reply = ccbox(message) - print "Reply was:", reply + print("Reply was:", reply) elif reply[0] == "choicebox": longchoice = "This is an example of a very long option which you may or may not wish to choose."*2 @@ -1233,15 +1233,15 @@ for someItem in myListOfStuff: message = "Pick something. " + ("A wrapable sentence of text ?! "*30) + "\nA separate line of text."*6 reply = choicebox(message, None, listChoices) - print "Reply was:", reply + print("Reply was:", reply) message = "Pick something. " reply = choicebox(message, None, listChoices) - print "Reply was:", reply + print("Reply was:", reply) message = "Pick something. " reply = choicebox("The list of choices is empty!", None, []) - print "Reply was:", reply + print("Reply was:", reply) elif reply[0] == "multchoicebox": listChoices = ["aaa", "bbb", "ccc", "ggg", "hhh", "iii", "jjj", "kkk" @@ -1250,17 +1250,17 @@ for someItem in myListOfStuff: message = "Pick as many choices as you wish." reply = multchoicebox(message,"DEMO OF multchoicebox", listChoices) - print "Reply was:", reply + print("Reply was:", reply) elif reply[0] == "textbox": message = "Here is some sample text. " * 16 reply = textbox(message, "Text Sample", text_snippet) - print "Reply was:", reply + print("Reply was:", reply) elif reply[0] == "codebox": message = "Here is some sample code. " * 16 reply = codebox(message, "Code Sample", code_snippet) - print "Reply was:", reply + print("Reply was:", reply) else: msgbox("Choice\n\n" + choice + "\n\nis not recognized", "Program Logic Error") @@ -1277,10 +1277,10 @@ The software installed is covered by a variety of licenses, please refer to each package's license information before redistributing it. This installer can also install additional packages that are used by the FASTMath packages.""" - result = buttonbox(message=message1, title="FASTMath Software Installer", choices = ["Cancel", "Continue"],fontSize = 20,message2=message2) + result = buttonbox(message=message1, title="FASTMath Software Installer", choices = ["Cancel", "Continue"],fontSize = 20,message2=message2) if result == "Cancel": sys.exit() - result = buttonbox(message='Should you encounter problems please send email\nto [email protected] with all output\n', title="FASTMath Software Installer", choices = ["Cancel", "Continue"]) + result = buttonbox(message='Should you encounter problems please send email\nto [email protected] with all output\n', title="FASTMath Software Installer", choices = ["Cancel", "Continue"]) if result == "Cancel": sys.exit() options = [] @@ -1387,19 +1387,19 @@ can also install additional packages that are used by the FASTMath packages.""" import urllib try: urllib.urlretrieve('http://ftp.mcs.anl.gov/pub/petsc/petsc.tar.gz', os.path.join(reply,'petsc.tar.gz')) - except Exception, e: + except Exception as e: raise RuntimeError('Unable to download PETSc') import commands try: commands.getoutput('cd '+reply+'; gunzip petsc.tar.gz ; tar xf petsc.tar') - except RuntimeError, e: + except RuntimeError as e: raise RuntimeError('Error unzipping petsc.tar.gz'+str(e)) os.unlink(os.path.join(reply, 'petsc.tar')) else: import commands try: commands.getoutput('cd '+reply+'; git clone https://bitbucket.org/petsc/petsc.git') - except RuntimeError, e: + except RuntimeError as e: raise RuntimeError('Error trying to obtain development version of PETSc with git'+str(e)) ldir = os.listdir(reply) for i in ldir: @@ -1422,7 +1422,7 @@ can also install additional packages that are used by the FASTMath packages.""" f.write(' configure_options = '+repr(args)+'\n') f.write(' configure.petsc_configure(configure_options)\n') f.close() - os.chmod(configfile,0755) + os.chmod(configfile,0o755) msgbox('After hitting OK run\n\n cd '+petscroot+'\npython config-'+arch+'.py\n\nto continue the install') print("Execute the following two commands and follow the directions") print('cd '+petscroot) diff --git a/bin/PetscBinaryIOTrajectory.py b/bin/PetscBinaryIOTrajectory.py index b5db184..7985354 100755 --- a/bin/PetscBinaryIOTrajectory.py +++ b/bin/PetscBinaryIOTrajectory.py @@ -41,7 +41,7 @@ def ReadTrajectory(directory): return (t,v,names) def PlotTrajectories(t,v,names,subnames): - print names + print(names) sub = [] for s in subnames: sub.append(names.index(s)) diff --git a/bin/TOPSGenerator.py b/bin/TOPSGenerator.py index c65a673..0767d29 100755 --- a/bin/TOPSGenerator.py +++ b/bin/TOPSGenerator.py @@ -17,10 +17,10 @@ information on TOPS may be found at http://www.tops-scidac.org. \n\n This tool allows you to define the class of algebraic problem you are solving and generates the appropriate "glue" code needed to use the TOPS Solver Components""" - result = buttonbox(message=message1, title=title, choices = ["Cancel", "Continue"],fontSize = 20,message2=message2) + result = buttonbox(message=message1, title=title, choices = ["Cancel", "Continue"],fontSize = 20,message2=message2) if result == "Cancel": sys.exit() - dim = int(buttonbox(message="Dimension of the grid?", title=title, choices = ["1", "2", "3"],fontSize = 20)) + dim = int(buttonbox(message="Dimension of the grid?", title=title, choices = ["1", "2", "3"],fontSize = 20)) lin = buttonbox(message="Type of algebraic problem?", title=title, choices = ["linear", "nonlinear"],fontSize = 20) if lin == "nonlinear": diff --git a/bin/configVars.py b/bin/configVars.py index 73664e7..ee7f5c6 100755 --- a/bin/configVars.py +++ b/bin/configVars.py @@ -21,16 +21,16 @@ class ConfigReader(script.Script): self.setup() framework = self.loadConfigure() mpi = framework.require('config.packages.MPI', None) - print mpi.include, mpi.lib + print(mpi.include, mpi.lib) arch = framework.require('PETSc.options.arch', None) - print arch.arch - print 'Configure is cached:',('configureCache' in self.argDB) + print(arch.arch) + print('Configure is cached:',('configureCache' in self.argDB)) for k in framework.argDB.keys(): if k.startswith('known'): - print k,framework.argDB[k] + print(k,framework.argDB[k]) return if __name__ == '__main__': - print 'Starting' + print('Starting') ConfigReader().run() - print 'Ending' + print('Ending') diff --git a/bin/parseargs.py b/bin/parseargs.py index 8a109bf..c880b2f 100755 --- a/bin/parseargs.py +++ b/bin/parseargs.py @@ -34,8 +34,8 @@ def parseargs(search_arg,return_nargs,arg_list): return 1,None if index+1 == len(arg_list): - print 'Error! Option has no value!' - print 'Expecting value with option: ' + search_arg + print('Error! Option has no value!') + print('Expecting value with option: ' + search_arg) sys.exit() else: ret_arg = arg_list[index+1] diff --git a/bin/petsclogformat.py b/bin/petsclogformat.py index 30e874f..de3598c 100755 --- a/bin/petsclogformat.py +++ b/bin/petsclogformat.py @@ -257,24 +257,24 @@ def ObjectsCompare(a,b): def PrintPercentTable(localTimes,localFlops,localMessages,localMessageLens,localReductions,Stages,Latex = False): ''' Prints a simple table that displays the percent of time, flops, etc for each event in each stage''' if Latex: - print "\documentclass{article}" - print "\\begin{document}" - print "\\begin{table}[!htbp]" - print "\centering" + print("\documentclass{article}") + print("\\begin{document}") + print("\\begin{table}[!htbp]") + print("\centering") if len(localTimes) > 1: - print "\\begin{tabular}{lcccccc}" - print " & & \multicolumn{4}{c}{--------------- Percent of -------------} & \\\\" - print "Event & Count & Time & Flops & Messages & Reductions & Flop rate \\\\" - print "\hline" + print("\\begin{tabular}{lcccccc}") + print(" & & \multicolumn{4}{c}{--------------- Percent of -------------} & \\\\") + print("Event & Count & Time & Flops & Messages & Reductions & Flop rate \\\\") + print("\hline") else: if len(localTimes) > 1: - print " --------- Percent of ------" - print "Event Count Time Flops Messages Reductions Flop rate" - print "============================================================================" + print(" --------- Percent of ------") + print("Event Count Time Flops Messages Reductions Flop rate") + print("============================================================================") else: - print " Percent of" - print "Event Count Time Flops Flop rate" - print "=========================================================" + print(" Percent of") + print("Event Count Time Flops Flop rate") + print("=========================================================") time,flops,numMessages,numMessageLen,numReductions = ComputeTotals(localTimes,localFlops,localMessages,localMessageLens,localReductions) if not numMessages: numMessages = 1 @@ -304,30 +304,30 @@ def PrintPercentTable(localTimes,localFlops,localMessages,localMessageLens,local space = 2 if not seperatoradded: if Latex: - print "--Overlapping events---\\\\" + print("--Overlapping events---\\\\") else: - print "--Overlapping events---" + print("--Overlapping events---") seperatoradded = True if len(localTimes) > 1: values = [100*sumStages[stage][event]["time"]/time,100*sumStages[stage][event]["flops"]/flops,100*sumStages[stage][event]["numMessages"]/numMessages,100*sumStages[stage][event]["numReductions"]/numReductions] if max(values) > .5: if Latex: - print '\\hspace{%1dem}' % space,event,"&",'%6.0f' % sumStages[stage][event]["count"],"&",'%5.0f' % values[0],"&",'%5.0f' % values[1],"&",'%5.0f' % values[2],"&",'%5.0f' % values[3],"&",'%8.0f' % ((sumStages[stage][event]["flops"]/sumStages[stage][event]["time"])/1000000.0),"\\\\" + print('\\hspace{%1dem}' % space,event,"&",'%6.0f' % sumStages[stage][event]["count"],"&",'%5.0f' % values[0],"&",'%5.0f' % values[1],"&",'%5.0f' % values[2],"&",'%5.0f' % values[3],"&",'%8.0f' % ((sumStages[stage][event]["flops"]/sumStages[stage][event]["time"])/1000000.0),"\\\\") else: - print " "[0:space],event.ljust(26-space),'%6.0f' % sumStages[stage][event]["count"]," ",'%5.0f' % values[0],'%5.0f' % values[1],'%5.0f' % values[2],'%5.0f' % values[3]," ",'%8.0f' % ((sumStages[stage][event]["flops"]/sumStages[stage][event]["time"])/1000000.0) + print(" "[0:space],event.ljust(26-space),'%6.0f' % sumStages[stage][event]["count"]," ",'%5.0f' % values[0],'%5.0f' % values[1],'%5.0f' % values[2],'%5.0f' % values[3]," ",'%8.0f' % ((sumStages[stage][event]["flops"]/sumStages[stage][event]["time"])/1000000.0)) else: values = [100*sumStages[stage][event]["time"]/time,100*sumStages[stage][event]["flops"]/flops] if max(values) > .5: if Latex: - print '\\hspace{%1dem}' % space,event,"&",'%6.0f' % sumStages[stage][event]["count"],"&",'%5.0f' % values[0],"&",'%5.0f' % values[1],"&",'%8.0f' % ((sumStages[stage][event]["flops"]/sumStages[stage][event]["time"])/1000000.0),"\\\\" + print('\\hspace{%1dem}' % space,event,"&",'%6.0f' % sumStages[stage][event]["count"],"&",'%5.0f' % values[0],"&",'%5.0f' % values[1],"&",'%8.0f' % ((sumStages[stage][event]["flops"]/sumStages[stage][event]["time"])/1000000.0),"\\\\") else: - print " ",event.ljust(24),'%6.0f' % sumStages[stage][event]["count"]," ",'%5.0f' % values[0],'%5.0f' % values[1]," ",'%8.0f' % ((sumStages[stage][event]["flops"]/sumStages[stage][event]["time"])/1000000.0) + print(" ",event.ljust(24),'%6.0f' % sumStages[stage][event]["count"]," ",'%5.0f' % values[0],'%5.0f' % values[1]," ",'%8.0f' % ((sumStages[stage][event]["flops"]/sumStages[stage][event]["time"])/1000000.0)) if Latex: - print "\end{tabular}" - print "\end{table}" - print "\end{document}" + print("\end{tabular}") + print("\end{table}") + print("\end{document}") if __name__ == '__main__': import sys @@ -339,4 +339,4 @@ if __name__ == '__main__': latex = False if len(sys.argv) > 2: latex = True - PrintPercentTable(data.LocalTimes,data.LocalFlops,data.LocalMessages,data.LocalMessageLens,data.LocalReductions,data.Stages,Latex = latex) \ No newline at end of file + PrintPercentTable(data.LocalTimes,data.LocalFlops,data.LocalMessages,data.LocalMessageLens,data.LocalReductions,data.Stages,Latex = latex) diff --git a/bin/portabilitycheck.py b/bin/portabilitycheck.py index f733730..4fb8478 100755 --- a/bin/portabilitycheck.py +++ b/bin/portabilitycheck.py @@ -13,8 +13,8 @@ def portabilityCheck(filename,includes): pipe = os.popen("nm " + filename) for line in pipe.readlines(): if bad.search(line): - print 'For portability avoid direct read, write, or system commands in file ' + filename - print 'Function: '+ line + print('For portability avoid direct read, write, or system commands in file ' + filename) + print('Function: '+ line) os.unlink(filename) return 1 return 0 @@ -34,8 +34,8 @@ def portabilityCheck(filename,includes): if portabilityCheck(l,sys.argv[2:]): return 1 found = 1 if not found: - print 'For portability avoid direct use of generic system #include files in ' + filename - print 'Line: '+ line + print('For portability avoid direct use of generic system #include files in ' + filename) + print('Line: '+ line) return 1 file.close() return 0 diff --git a/bin/saws/SAWs.py b/bin/saws/SAWs.py index 813b210..2daa0d1 100755 --- a/bin/saws/SAWs.py +++ b/bin/saws/SAWs.py @@ -25,6 +25,6 @@ j = json.loads(r.content) # Example that access the functions in the stack j = j['directories']['SAWs_ROOT_DIRECTORY']['directories']['PETSc']['directories']['Stack']['variables']['functions']['data'] -print j +print(j) diff --git a/bin/taucc.py b/bin/taucc.py index 38a2ec2..5537683 100755 --- a/bin/taucc.py +++ b/bin/taucc.py @@ -19,12 +19,12 @@ import string import tempfile def runcmd(cmd,verbose): if verbose: - print cmd + print(cmd) (status, output) = commands.getstatusoutput(cmd) if status: raise RuntimeError('Unable to run '+cmd+':\n'+output) elif output: - print output + print(output) def getTauFlags(tau_lib_dir): fd,name=tempfile.mkstemp(prefix='taucc-') @@ -161,5 +161,5 @@ def main(): if __name__ == '__main__': try: main() - except Exception, e: + except Exception as e: sys.exit('ERROR: '+str(e)) diff --git a/bin/update.py b/bin/update.py index 566e77e..fc694df 100755 --- a/bin/update.py +++ b/bin/update.py @@ -72,7 +72,7 @@ def updatePatches(): import urllib try: urllib.urlretrieve(patchfile1, patches1) - except Exception, e: + except Exception as e: raise RuntimeError('Unable to download patches. Perhaps you are off the network?\n '+str(e)) else: log.write('Using '+patches1+' for PETSc patches\n') diff --git a/src/ts/examples/tutorials/extchem.py b/src/ts/examples/tutorials/extchem.py index 2800598..52abfc6 100644 --- a/src/ts/examples/tutorials/extchem.py +++ b/src/ts/examples/tutorials/extchem.py @@ -19,6 +19,6 @@ if __name__ == '__main__': # Code is currently hardwired to display certain species only, edit the list below to display the species you want displayed # for i in range(0,len(t)-1): - print t[i],v[i][names.index('Temp')],v[i][names.index('CH4')],v[i][names.index('O2')],v[i][names.index('N2')],v[i][names.index('CO')],v[i][names.index('CO2')],v[i][names.index('O')],v[i][names.index('OH')],v[i][names.index('H2O')] + print (t[i],v[i][names.index('Temp')],v[i][names.index('CH4')],v[i][names.index('O2')],v[i][names.index('N2')],v[i][names.index('CO')],v[i][names.index('CO2')],v[i][names.index('O')],v[i][names.index('OH')],v[i][names.index('H2O')]) ++++++ _multibuild ++++++ --- /var/tmp/diff_new_pack.peKatg/_old 2018-03-14 19:37:25.064654867 +0100 +++ /var/tmp/diff_new_pack.peKatg/_new 2018-03-14 19:37:25.064654867 +0100 @@ -1,5 +1,5 @@ <multibuild> - <package>serial</package> + <!-- <package>serial</package> --> <!-- <package>openmpi</package> --> <package>gnu-openmpi-hpc</package> <package>gnu-openmpi2-hpc</package>
