diff --git a/HySoP/Froggy_Env.sh b/HySoP/Froggy_Env.sh new file mode 100644 index 0000000000000000000000000000000000000000..5b98a27bfdeaaf0a59cd3a5270a719eea1e500d8 --- /dev/null +++ b/HySoP/Froggy_Env.sh @@ -0,0 +1,16 @@ +## Source this file to get a clean working environment on Froggy +## It uses the binaries and libraries from /home/perignon +source /applis/site/env.bash +module load gcc/4.8.1_gcc-4.4.6 +module load cmake/2.8.11.2_gcc-4.4.6 +. /home/perignon/MyPython/bin/activate +export PATH=/home/perignon/install-gnu-4.8/bin/:${PATH} +export LD_LIBRARY_PATH=/home/perignon/install-gnu-4.8/lib/:/applis/site/stow/gcc_4.4.6/gcc_4.8.1/lib64:${LD_LIBRARY_PATH} +export PYTHONPATH=~/.local/lib/python2.7/site-packages:/home/perignon/MyPython/lib/python2.7/site-packages:/home/perignon/install-gnu-4.8/lib/python2.7/site-packages +export CC=mpicc CXX=mpic++ FC=mpif90 +unset LDFLAGS +unset CFLAGS + +## Build parmes helping cmake to find FFTW headers: +# cmake path-to-Parmes -Dfftw_DIR=/home/perignon/install-gnu-4.8/ +# make install -j 8 diff --git a/HySoP/opencl_explore.py b/HySoP/opencl_explore.py index 4c920c633853646bde035c1979d51045c81963bb..6c3dc0547d90da58bfa9151cfa929a34b43d16ee 100644 --- a/HySoP/opencl_explore.py +++ b/HySoP/opencl_explore.py @@ -9,7 +9,7 @@ import pyopencl as cl def size_human(s): """Converts size in Bytes into human readable size""" c = ['b', 'Kb', 'Mb', 'Gb'] - i=0 + i = 0 while s >= 1024: s /= 1024 i += 1 @@ -28,43 +28,44 @@ def get_defaults(device_type=cl.device_type.GPU): default_device = j default_platform = i except cl.LogicError: - print (" -- Warning : You are running for a non-OpenCL place " + - "such as a frontend. Using a default id") + import sys + sys.stderr.write("WARNING : You are running for a non-OpenCL place " + + "such as a frontend. Using a default id: 0 0") return default_platform, default_device def explore(device_type=cl.device_type.GPU): """Explore platforms and devices""" p_data, d_data = {}, {} - platforms = cl.get_platforms() - platforms_info = ["name ", - "version ", - "vendor "] - all_devices = [] - unchanged = lambda x: x - boolean = lambda b: 'Yes' if b else 'No' - type_str = cl.device_type.to_string - devices_info = [("name ", unchanged), - ("version ", unchanged), - ("vendor ", unchanged), - ("profile ", unchanged), - ("type ", type_str), - ("compiler_available ", boolean), - ("double_fp_config ", boolean), - ("single_fp_config ", boolean), - ("global_mem_size ", size_human), - ("local_mem_size ", size_human), - ("max_compute_units ", unchanged), - ("max_mem_alloc_size ", size_human), - ("max_work_group_size ", unchanged), - ("max_work_item_dimensions", unchanged), - ("max_work_item_sizes ", unchanged), - ("extensions ", unchanged), - ] - p_str_max = [] - d_str_max = {} - out = "" try: + platforms = cl.get_platforms() + platforms_info = ["name ", + "version ", + "vendor "] + all_devices = [] + unchanged = lambda x: x + boolean = lambda b: 'Yes' if b else 'No' + type_str = cl.device_type.to_string + devices_info = [("name ", unchanged), + ("version ", unchanged), + ("vendor ", unchanged), + ("profile ", unchanged), + ("type ", type_str), + ("compiler_available ", boolean), + ("double_fp_config ", boolean), + ("single_fp_config ", boolean), + ("global_mem_size ", size_human), + ("local_mem_size ", size_human), + ("max_compute_units ", unchanged), + ("max_mem_alloc_size ", size_human), + ("max_work_group_size ", unchanged), + ("max_work_item_dimensions", unchanged), + ("max_work_item_sizes ", unchanged), + ("extensions ", unchanged), + ] + p_str_max = [] + d_str_max = {} + out = "" for i, plt in enumerate(platforms): p_str_max.append(0) devices = plt.get_devices() @@ -133,4 +134,4 @@ if __name__ == "__main__": p_id, d_id = get_defaults(device_type=cl.device_type.CPU) else: p_id, d_id = get_defaults() - print str(p_id) + ' ' + str(d_id) + print (str(p_id) + ' ' + str(d_id))