Commit 230a3195 authored by Alessandro Mirone's avatar Alessandro Mirone Committed by mirone

further tested python3

ritestando python2 su OAR. Preparato ptython3 oar

correzione

again strange things from python3

indentation

correzione from. import tempfile

cercando di far ripartire i tests

allargando test per python3

ritorno a testare tutto

ritesto BIG

again BIG

tecnica del move

move

.info ancora illeggibile

era il repertorio delle references

su un set ridotto

solo su un test

corretto test

riaggiunto le references a multiring nel direttori dei risultati confronto
parent a41070a2
......@@ -23,11 +23,9 @@ testnslino3:
- python setup.py install
# - python run_tests.py -v --testcase nslino
- python run_tests.py -v --testcase nslinogpu
- deactivate
after_script:
- pwd
......@@ -146,3 +144,23 @@ testOAR2gpu:
after_script:
- pwd
testOARgpu:
stage: test
only:
- testoargpupython3
tags:
- scisoft12
script:
- chmod u+x ./test_script_for_oar_gpu_python3.sh
- myoid=`oarsub -l"cpu=1,walltime=24:00:0" -p" gpu = 'YES' " ./test_script_for_oar_gpu_python3.sh`
- echo $myoid
- myoid=`python extract_oarid.py "$myoid"`
- echo $myoid
- oarsub -a $myoid -I ; pwd
- code=`oarstat -f -j $myoid | grep exit`
- echo $code
- python check_oar_status.py "$code"
after_script:
- pwd
......@@ -187,8 +187,10 @@ machinefile_name="machinefile"
try:
args=["oarprint", "host", "-P", "host,cpu", "-F", "'% %'" ]
if (sys.version_info > (3, 0)):
if (sys.version_info > (3, 6)):
p = sub.Popen(args=args ,stdout=sub.PIPE,stderr=sub.PIPE, text=True)
elif (sys.version_info > (3, 0)):
p = sub.Popen(args=args, stdout=sub.PIPE,stderr=sub.PIPE, universal_newlines=True)
else:
p = sub.Popen(args=args ,stdout=sub.PIPE,stderr=sub.PIPE)
......@@ -259,8 +261,14 @@ else:
##
try:
args=["oarprint", "host", "-P", "host,gpu_num", "-F", "'% %'" ]
if (sys.version_info > (3, 0)):
if (sys.version_info > (3, 6)):
p = sub.Popen(args=args ,stdout=sub.PIPE,stderr=sub.PIPE, text=True)
elif (sys.version_info > (3, 0)):
p = sub.Popen(args=args ,stdout=sub.PIPE,stderr=sub.PIPE, universal_newlines=True)
else:
p = sub.Popen(args=args ,stdout=sub.PIPE,stderr=sub.PIPE)
......@@ -347,8 +355,14 @@ if(sys.argv[0][-12:]!="sphinx-build"):
mpi_extra=" --byslot "
comando = 'mpirun -V'
if (sys.version_info > (3, 0)):
if (sys.version_info > (3, 6)):
p1 = sub.Popen(args= comando.split( " ") ,stdin=sub.PIPE,stdout=sub.PIPE,stderr=sub.PIPE, text=True)
elif (sys.version_info > (3, 0)):
p1 = sub.Popen(args= comando.split( " ") ,stdin=sub.PIPE,stdout=sub.PIPE,stderr=sub.PIPE, universal_newlines=True)
else:
p1 = sub.Popen(args= comando.split( " ") ,stdin=sub.PIPE,stdout=sub.PIPE,stderr=sub.PIPE)
......@@ -411,7 +425,7 @@ if(sys.argv[0][-12:]!="sphinx-build"):
if P.MULTI_PAGANIN_PARS is None:
callpyhst( inputfile )
else:
from . import tempfile
import tempfile
steps = [1,1,1,1,1,1,1]
files_to_cancel = []
......
......@@ -72,8 +72,10 @@ def getCoresOrdered():
comando = 'lscpu'
if (sys.version_info > (3, 0)):
if (sys.version_info > (3, 6)):
p1 = sub.Popen(args=comando.split( " ") ,stdin=sub.PIPE,stdout=sub.PIPE,stderr=sub.PIPE, text=True)
elif (sys.version_info > (3, 0)):
p1 = sub.Popen(args=comando.split( " ") ,stdin=sub.PIPE,stdout=sub.PIPE,stderr=sub.PIPE, universal_newlines=True)
else:
p1 = sub.Popen(args=comando.split( " ") ,stdin=sub.PIPE,stdout=sub.PIPE,stderr=sub.PIPE)
# comando = 'grep node'
......
......@@ -64,8 +64,13 @@ def setCpuSet(maxnargs=3):
import subprocess as sub
comando = 'taskset -cp %d'%(os.getpid())
if (sys.version_info > (3, 0)):
if (sys.version_info > (3, 6)):
p = sub.Popen(args=comando.split( " ") ,stdout=sub.PIPE,stderr=sub.PIPE, text=True)
elif (sys.version_info > (3, 0)):
p = sub.Popen(args= comando.split( " ") ,stdout=sub.PIPE,stderr=sub.PIPE, universal_newlines=True)
else:
p = sub.Popen(args=comando.split( " ") ,stdout=sub.PIPE,stderr=sub.PIPE)
......@@ -76,20 +81,41 @@ def setCpuSet(maxnargs=3):
Ntotal_cores_on_host = multiprocessing.cpu_count()
comando = 'grep#physical id#/proc/cpuinfo'
if (sys.version_info > (3, 0)):
if (sys.version_info > (3, 6)):
p1 = sub.Popen(args=comando.split( "#") ,stdout=sub.PIPE,stderr=sub.PIPE, text=True )
elif (sys.version_info > (3, 0)):
p1 = sub.Popen(args= comando.split( "#") ,stdout=sub.PIPE,stderr=sub.PIPE, universal_newlines=True)
else:
p1 = sub.Popen(args=comando.split( "#") ,stdout=sub.PIPE,stderr=sub.PIPE)
comando = 'sort -u'
if (sys.version_info > (3, 0)):
if (sys.version_info > (3, 6)):
p2 = sub.Popen(args=comando.split( " ") ,stdin=p1.stdout,stdout=sub.PIPE,stderr=sub.PIPE, text=True)
elif (sys.version_info > (3, 0)):
p2 = sub.Popen(args=comando.split( " ") ,stdin=p1.stdout,stdout=sub.PIPE,stderr=sub.PIPE, universal_newlines=True)
else:
p2 = sub.Popen(args=comando.split( " ") ,stdin=p1.stdout,stdout=sub.PIPE,stderr=sub.PIPE)
comando = 'wc -l'
if (sys.version_info > (3, 0)):
if (sys.version_info > (3, 6)):
p3 = sub.Popen(args=comando.split( " ") ,stdin=p2.stdout,stdout=sub.PIPE,stderr=sub.PIPE, text=True)
elif (sys.version_info > (3, 0)):
p3 = sub.Popen(args=comando.split( " ") ,stdin=p2.stdout,stdout=sub.PIPE,stderr=sub.PIPE, universal_newlines=True)
else:
p3 = sub.Popen(args=comando.split( " ") ,stdin=p2.stdout,stdout=sub.PIPE,stderr=sub.PIPE)
......@@ -97,8 +123,15 @@ def setCpuSet(maxnargs=3):
nofprocessors=string.atoi(nofprocessors)
comando = "grep MemTotal /proc/meminfo"
if (sys.version_info > (3, 0)):
if (sys.version_info > (3, 6)):
p1 = sub.Popen(args=comando.split( " ") ,stdout=sub.PIPE,stderr=sub.PIPE, text=True)
elif (sys.version_info > (3, 0)):
p1 = sub.Popen(args=comando.split( " ") ,stdout=sub.PIPE,stderr=sub.PIPE, universal_newlines=True)
else:
p1 = sub.Popen(args=comando.split( " ") ,stdout=sub.PIPE,stderr=sub.PIPE)
......@@ -186,8 +219,14 @@ def setCpuSet(maxnargs=3):
comando = 'taskset -pc %s %d'%( s, os.getpid())
if (sys.version_info > (3, 0)):
if (sys.version_info > (3, 6)):
p = sub.Popen(args=comando.split( " ") ,stdout=sub.PIPE,stderr=sub.PIPE, text=True)
elif (sys.version_info > (3, 0)):
p = sub.Popen(args=comando.split( " ") ,stdout=sub.PIPE,stderr=sub.PIPE, universal_newlines=True)
else:
p = sub.Popen(args=comando.split( " ") ,stdout=sub.PIPE,stderr=sub.PIPE)
......
......@@ -80,6 +80,7 @@ def compara_vols(ref, new , tol ):
class parInfo:
LOWBYTEFIRST=1
os.system("sync")
s = open(ref+".info").read()
s=s.replace("!","#")
exec( s )
......@@ -133,13 +134,13 @@ def compara_edfs(ref, new , tol ):
miz=-1
done =0
NN = len( zip (ref, new ))
NN = len( list(zip (ref, new )))
err_list=[]
assert( len(ref) == len(new) )
for iz,(rname, nname) in enumerate(zip (ref, new )) :
for iz,(rname, nname) in enumerate(list(zip (ref, new ))) :
done=1
r = fabio.open(rname).data
......@@ -199,6 +200,7 @@ def class_provider ( testcase,case_subdir , skip_check=False ) :
if self.my_testcase =="achille":
LAUNCHING_INSTRUCTION = "%s input.par " %PROJECT
if self.my_testcase =="achillegpu":
LAUNCHING_INSTRUCTION = "%s input.par achille,0" %PROJECT
......@@ -231,6 +233,8 @@ def class_provider ( testcase,case_subdir , skip_check=False ) :
savedPath = os.getcwd()
os.chdir( direttorio_output)
os.system( LAUNCHING_INSTRUCTION )
os.system("sync")
# os.system("sleep 60")
os.chdir(savedPath)
ress_ref = get_results(direttorio_reference)
......@@ -240,17 +244,17 @@ def class_provider ( testcase,case_subdir , skip_check=False ) :
print ( direttorio_reference )
if self.my_skip_check :
print ("The reference directory contains no results!! " )
print ("The reference directory contains no results!! " +direttorio_reference)
else:
raise Exception("The reference directory contains no results!! ")
raise Exception("The reference directory contains no results!! "+direttorio_reference)
if ( len(ress_new["vol"])==0 and len(ress_new["edf"])==0 ):
print(direttorio_output)
if self.my_skip_check :
print ("The OUTPUT directory contains no results!! " )
print ("The OUTPUT directory contains no results!! " +direttorio_output )
else:
raise Exception("NO DATA PRODUCED!! ")
raise Exception("NO DATA PRODUCED!! " +direttorio_output)
if len(ress_ref["vol"]):
assert( len(ress_ref["vol"])==1)
......@@ -282,25 +286,25 @@ def class_provider ( testcase,case_subdir , skip_check=False ) :
def test_classes(testcase):
myclassi={}
casi = {
"CRAYON/TESTS/" : ( False , 0,[ "abs_solo_tutte", "abs_solo_unaslice", "pag_molte_edf", "pag_tutte", "pag_una"]),
"HELICOIDAL/TESTS/" : ( False , 0,[ "abs_solo_una"]),
"ID11_SNOW/TESTS/" : ( False , 1,[ "chambolle_pock"]),
"SINO_THRESHOLD/TESTS/" : ( False , 1,[ "threshold_unsharp"]), # provvisoriamente tolta da nslino
"HEIKKI/TESTS/" : ( False , 1,[ "big"]), # provvisoriamente tolta da nslino
"MULTIPAGANIN/TESTS/" : ( False , 1,[ "volume"]),
# "SIRT_LENA/TESTS/" : ( True , 1,[ "oneslice_sirt"]),
"PATCHES_VECTORIAL/TESTS/" : ( False , 1,[ "patches", "patches_preconditioned"]),
"LENA/TESTS/" : ( False , 1,[ "dictio"]),
"LENA_MULTIRING/TESTS/" : ( False , 1,[ "multiring"]),
"MOUSSE/TESTS/" : ( False , 1,[ "DL"]),
"NANOPOINTS/TESTS/" : ( False , 1,[ "DL"]),
"BIG/TESTS/" : ( False , 1,[ "pag_tutte"]),
"NNFBP/TESTS/CRAYON/" : ( True , 1 ,[ "phase1"]), # provvisoriamente tolta da nslino
"NNFBP/TESTS/CRAYON/" : ( True , 1 ,[ "phase2"]), # provvisoriamente tolta da nslino
"NNFBP/TESTS/CRAYON/" : ( False, 1 ,[ "phase3"]), # provvisoriamente tolta da nslino
# "CRAYON/TESTS/" : ( False , 0,[ "abs_solo_tutte", "abs_solo_unaslice", "pag_molte_edf", "pag_tutte", "pag_una"]),
# "HELICOIDAL/TESTS/" : ( False , 0,[ "abs_solo_una"]),
# "ID11_SNOW/TESTS/" : ( False , 1,[ "chambolle_pock"]),
# # "SINO_THRESHOLD/TESTS/" : ( False , 1,[ "threshold_unsharp"]), # provvisoriamente tolta da nslino
# # "HEIKKI/TESTS/" : ( False , 1,[ "big"]), # provvisoriamente tolta da nslino
# "MULTIPAGANIN/TESTS/" : ( False , 1,[ "volume"]),
# # "SIRT_LENA/TESTS/" : ( True , 1,[ "oneslice_sirt"]),
# # "PATCHES_VECTORIAL/TESTS/" : ( False , 1,[ "patches", "patches_preconditioned"]),
# "PATCHES_VECTORIAL/TESTS/" : ( False , 1,[ "patches_preconditioned"]),
# "LENA/TESTS/" : ( False , 1,[ "dictio"]),
"LENA_MULTIRINGS/TESTS/" : ( False , 1,[ "multiring"]),
# # "MOUSSE/TESTS/" : ( False , 1,[ "DL"]),
# # "NANOPOINTS/TESTS/" : ( False , 1,[ "DL"]),
# "BIG/TESTS/" : ( False , 1,[ "pag_tutte"])
# ##### "NNFBP/TESTS/CRAYON/" : ( True , 1 ,[ "phase1"]), # provvisoriamente tolta da nslino
# # "NNFBP/TESTS/CRAYON/" : ( True , 1 ,[ "phase2"]), # provvisoriamente tolta da nslino
# # "NNFBP/TESTS/CRAYON/" : ( False, 1 ,[ "phase3"]), # provvisoriamente tolta da nslino
}
for case , (skip_check, level, subdirs) in casi.items():
print ( " SKIP testcase ??", testcase )
......
#!python
# -*- coding: utf-8 -*-
#
# Project: High Speed Tomography
# https://forge.epn-campus.eu/projects/PyHST
#
# File: "$Id$"
#
# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
#
# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
#
# This program 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 3 of the License, or
# (at your option) any later version.
#
# This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
#
"""
vol2hdf5
A tool for converting PyHST volumes into hdf5 datasets.
"""
__author__ = "Jerome Kieffer"
__contact__ = "Jerome.Kieffer@ESRF.eu"
__license__ = "GPLv3+"
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
__date__ = "26/03/2013"
__satus__ = "development"
import sys, os
import numpy, h5py
......
echo 'current dir is '
pwd
unset PYTHONPATH
export PATH=/usr/local/bin:/usr/bin:/bin:/opt/oar/utilities:/sbin:/usr/bin/X11:.::.
unset LDFLAGS
unset CPPFLAGS
unset LD_LIBRARY_PATH
rm -rf /tmp/software/chst_python3
virtualenv --python=python3 /tmp/software/chst_python3
source /tmp/software/chst_python3/bin/activate
pip install setuptools --upgrade
pip install pip --upgrade
pip install numpy
pip install -r requirements.txt
python setup.py install
python run_tests.py -v --testcase oargpu
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment