Mentions légales du service

Skip to content
Snippets Groups Projects
Commit a1a188ff authored by PRUVOST Florent's avatar PRUVOST Florent
Browse files

add plasma to chameleon conversion scripts

parent a978e988
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
###
#
# @copyright (c) 2009-2015 The University of Tennessee and The University
# of Tennessee Research Foundation.
# All rights reserved.
# @copyright (c) 2012-2016 Inria. All rights reserved.
# @copyright (c) 2012-2015 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
#
#
###
#
# @file callGeneration.bash
#
# @project MORSE
# MORSE is a software package provided by:
# Inria Bordeaux - Sud-Ouest,
# Univ. of Tennessee,
# King Abdullah Univesity of Science and Technology
# Univ. of California Berkeley,
# Univ. of Colorado Denver.
#
# @version 1.0.0
# @author Cedric Castagnede
# @author Emmanuel Agullo
# @author Mathieu Faverge
# @author Florent Pruvost
# @date 30-11-2015
#
###
# plasma release to download
plasma_relname=2.8.0
plasma_rel=plasma_$plasma_relname.tar.gz
plasma_url=http://icl.cs.utk.edu/projectsfiles/plasma/pubs/$plasma_rel
if [[ ! -e $plasma_rel ]]; then
echo "$plasma_rel does not exists, y to download it"
wget $plasma_url
fi
if [[ ! -e plasma_$plasma_relname ]]; then
tar zxf $plasma_rel
fi
# Define the paths
# ----------------
# where the script is called
plasma_conv_dir="$PWD"
# source files of the conversion (plasma -> chameleon)
plasma_dir="$PWD/plasma_$plasma_relname"
# source of the licence
licence_dir="$PWD/insert-licence"
# source of the original chameleon
# ex in this plasma_conversion directory: svn checkout https://scm.gforge.inria.fr/anonscm/svn/morse/trunk/chameleon
morse_dir="$PWD/.."
# source of the converted chameleon
morse_tmp="$PWD/chameleon"
if [[ ! -e $plasma_dir ]]; then
echo "plasma_dir is set to $plasma_dir which does not exist, please set the variable plasma_dir in the script $0"
exit $?
fi
if [[ ! -e $licence_dir ]]; then
echo "licence_dir is set to $licence_dir which does not exist, please set the variable licence_dir in the script $0"
exit $?
fi
if [[ ! -e $morse_dir ]]; then
echo "morse_dir is set to $morse_dir which does not exist, try to download it"
svn export svn+ssh://fpruvost@scm.gforge.inria.fr/svnroot/morse/trunk/chameleon
if [[ ! -e $morse_dir ]]; then
echo "morse_dir is set to $morse_dir which does not exist, please set the variable morse_dir in the script $0 and check that this path exists"
exit $?
fi
fi
if [[ ! -e $morse_tmp ]]; then
echo "morse_tmp is set to $morse_tmp which does not exist, lets create it"
mkdir $morse_tmp
if [[ ! -e $morse_tmp ]]; then
echo "morse_tmp is set to $morse_tmp which does not exist, please set the variable morse_tmp in the script $0"
exit $?
fi
fi
# Definition of files list
# ------------------------
list_file="
include/core_zblas.h
include/core_zcblas.h
include/plasma_z.h
include/plasma_zc.h
control/compute_z.h
control/workspace_z.c
control/plasma_zcf90.F90
control/plasma_zf77.c
control/plasma_zf90.F90
control/plasma_zf90_wrappers.F90
core_blas/core_dzasum.c
core_blas/core_zgemm.c
core_blas/core_zgessq.c
core_blas/core_zhemm.c
core_blas/core_zhessq.c
core_blas/core_zher2k.c
core_blas/core_zherk.c
core_blas/core_zpemv.c
core_blas/core_zsymm.c
core_blas/core_zsyr2k.c
core_blas/core_zsyrk.c
core_blas/core_zsyssq.c
core_blas/core_ztrasm.c
core_blas/core_ztrmm.c
core_blas/core_ztrsm.c
core_blas/core_ztrssq.c
core_blas/core_zgeadd.c
core_blas/core_zgelqt.c
core_blas/core_zgeqrt.c
core_blas/core_zgessm.c
core_blas/core_zgetrf.c
core_blas/core_zgetrf_incpiv.c
core_blas/core_zgetf2_nopiv.c
core_blas/core_zgetrf_nopiv.c
core_blas/core_zlacpy.c
core_blas/core_zlag2c.c
core_blas/core_zlange.c
core_blas/core_zlanhe.c
core_blas/core_zlansy.c
core_blas/core_zlantr.c
core_blas/core_zlaset2.c
core_blas/core_zlaset.c
core_blas/core_zlauum.c
core_blas/core_zpamm.c
core_blas/core_zparfb.c
core_blas/core_zplghe.c
core_blas/core_zplgsy.c
core_blas/core_zplrnt.c
core_blas/core_zpltmg.c
core_blas/core_zpotrf.c
core_blas/core_zssssm.c
core_blas/core_ztrtri.c
core_blas/core_ztslqt.c
core_blas/core_ztsmlq.c
core_blas/core_ztsmqr.c
core_blas/core_ztsqrt.c
core_blas/core_ztstrf.c
core_blas/core_zttlqt.c
core_blas/core_zttmlq.c
core_blas/core_zttmqr.c
core_blas/core_zttqrt.c
core_blas/core_zunmlq.c
core_blas/core_zunmqr.c
core_blas-qwrapper/qwrapper_dzasum.c
core_blas-qwrapper/qwrapper_zgemm.c
core_blas-qwrapper/qwrapper_zgessq.c
core_blas-qwrapper/qwrapper_zhemm.c
core_blas-qwrapper/qwrapper_zher2k.c
core_blas-qwrapper/qwrapper_zherk.c
core_blas-qwrapper/qwrapper_zpemv.c
core_blas-qwrapper/qwrapper_zplssq.c
core_blas-qwrapper/qwrapper_zhessq.c
core_blas-qwrapper/qwrapper_zsymm.c
core_blas-qwrapper/qwrapper_zsyr2k.c
core_blas-qwrapper/qwrapper_zsyrk.c
core_blas-qwrapper/qwrapper_zsyssq.c
core_blas-qwrapper/qwrapper_ztrasm.c
core_blas-qwrapper/qwrapper_ztrmm.c
core_blas-qwrapper/qwrapper_ztrsm.c
core_blas-qwrapper/qwrapper_ztrssq.c
core_blas-qwrapper/qwrapper_zgeadd.c
core_blas-qwrapper/qwrapper_zgelqt.c
core_blas-qwrapper/qwrapper_zgeqrt.c
core_blas-qwrapper/qwrapper_zgessm.c
core_blas-qwrapper/qwrapper_zgetrf.c
core_blas-qwrapper/qwrapper_zgetrf_incpiv.c
core_blas-qwrapper/qwrapper_zgetf2_nopiv.c
core_blas-qwrapper/qwrapper_zgetrf_nopiv.c
core_blas-qwrapper/qwrapper_zlacpy.c
core_blas-qwrapper/qwrapper_zlag2c.c
core_blas-qwrapper/qwrapper_zlange.c
core_blas-qwrapper/qwrapper_zlanhe.c
core_blas-qwrapper/qwrapper_zlansy.c
core_blas-qwrapper/qwrapper_zlantr.c
core_blas-qwrapper/qwrapper_zlaset2.c
core_blas-qwrapper/qwrapper_zlaset.c
core_blas-qwrapper/qwrapper_zlauum.c
core_blas-qwrapper/qwrapper_zpamm.c
core_blas-qwrapper/qwrapper_zparfb.c
core_blas-qwrapper/qwrapper_zplghe.c
core_blas-qwrapper/qwrapper_zplgsy.c
core_blas-qwrapper/qwrapper_zplrnt.c
core_blas-qwrapper/qwrapper_zpltmg.c
core_blas-qwrapper/qwrapper_zpotrf.c
core_blas-qwrapper/qwrapper_zssssm.c
core_blas-qwrapper/qwrapper_ztrtri.c
core_blas-qwrapper/qwrapper_ztslqt.c
core_blas-qwrapper/qwrapper_ztsmlq.c
core_blas-qwrapper/qwrapper_ztsmqr.c
core_blas-qwrapper/qwrapper_ztsqrt.c
core_blas-qwrapper/qwrapper_ztstrf.c
core_blas-qwrapper/qwrapper_zttlqt.c
core_blas-qwrapper/qwrapper_zttmlq.c
core_blas-qwrapper/qwrapper_zttmqr.c
core_blas-qwrapper/qwrapper_zttqrt.c
core_blas-qwrapper/qwrapper_zunmlq.c
compute/pzgemm.c
compute/pzhemm.c
compute/pzher2k.c
compute/pzherk.c
compute/pzsymm.c
compute/pzsyr2k.c
compute/pzsyrk.c
compute/pztrmm.c
compute/pztrsm.c
compute/pztrsmpl.c
compute/pzgeadd.c
compute/pzgelqf.c
compute/pzgelqfrh.c
compute/pzgeqrf.c
compute/pzgeqrfrh.c
compute/pzgetrf_incpiv.c
compute/pzgetrf_nopiv.c
compute/pzlacpy.c
compute/pzlag2c.c
compute/pzlange.c
compute/pzlanhe.c
compute/pzlansy.c
compute/pzlantr.c
compute/pzlaset2.c
compute/pzlaset.c
compute/pzlauum.c
compute/pzplghe.c
compute/pzplgsy.c
compute/pzpltmg.c
compute/pzpotrf.c
compute/pztrtri.c
compute/pzunglq.c
compute/pzunglqrh.c
compute/pzungqr.c
compute/pzungqrrh.c
compute/pzunmlq.c
compute/pzunmlqrh.c
compute/pzunmqr.c
compute/pzunmqrrh.c
compute/zgels.c
compute/zgelqs.c
compute/zgelqf.c
compute/zgemm.c
compute/zgeqrf.c
compute/zgeqrs.c
compute/zgetrf_incpiv.c
compute/zgetrf_nopiv.c
compute/zgetrs_incpiv.c
compute/zgesv_incpiv.c
compute/zhemm.c
compute/zher2k.c
compute/zherk.c
compute/zsymm.c
compute/zsyr2k.c
compute/zsyrk.c
compute/ztrmm.c
compute/ztrsm.c
compute/ztrsmpl.c
compute/zlacpy.c
compute/zlange.c
compute/zlanhe.c
compute/zlansy.c
compute/zlantr.c
compute/zlaset.c
compute/zlauum.c
compute/zplghe.c
compute/zplgsy.c
compute/zplrnt.c
compute/zpltmg.c
compute/zposv.c
compute/zpotrf.c
compute/zpotri.c
compute/zpotrs.c
compute/ztrtri.c
compute/zunglq.c
compute/zungqr.c
compute/zunmlq.c
compute/zunmqr.c
testing/testing_zgemm.c
testing/testing_zhemm.c
testing/testing_zher2k.c
testing/testing_zherk.c
testing/testing_zlange.c
testing/testing_zsymm.c
testing/testing_zsyr2k.c
testing/testing_zsyrk.c
testing/testing_ztrmm.c
testing/testing_ztrsm.c
testing/testing_zpemv.c
testing/testing_zposv.c
testing/testing_zpotri.c
testing/testing_zgels.c
testing/testing_zgesv_incpiv.c
timing/time_zgemm.c
timing/time_zgemm_tile.c
timing/time_ztrsm.c
timing/time_zgels.c
timing/time_zgels_tile.c
timing/time_zgeqrf.c
timing/time_zgeqrf_tile.c
timing/time_zgetrf_incpiv.c
timing/time_zgetrf_incpiv_tile.c
timing/time_zgetrf_nopiv.c
timing/time_zgetri_tile.c
timing/time_zposv.c
timing/time_zposv_tile.c
timing/time_zpotrf.c
timing/time_zpotrf_tile.c
timing/time_zpotri_tile.c
timing/time_zgesv_incpiv.c
timing/time_zgesv_incpiv_tile.c
"
# COREBLAS not used
# -----------------
#core_blas/core_zbrdalg.c
#core_blas/core_zgbelr.c
#core_blas/core_zgblrx.c
#core_blas/core_zgbrce.c
#core_blas/core_zgessq.c
#core_blas/core_zgetrip.c
#core_blas/core_zgetrf_reclap.c
#core_blas/core_zgetrf_rectil.c
#core_blas/core_zhbelr.c
#core_blas/core_zhblrx.c
#core_blas/core_zhbrce.c
#core_blas/core_zhbtype1cb.c
#core_blas/core_zhbtype2cb.c
#core_blas/core_zhbtype3cb.c
#core_blas/core_zhegst.c
#core_blas/core_zherfb.c
#core_blas/core_zlarfb_gemm.c
#core_blas/core_zlarfx_tbrd.c
#core_blas/core_zlarfy.c
#core_blas/core_zlaswp.c
#core_blas/core_zlatro.c
#core_blas/core_zshift.c
#core_blas/core_zswpab.c
#core_blas/core_ztrdalg.c
#core_blas/core_ztsmlq_corner.c
#core_blas/core_ztsmlq_hetra1.c
#core_blas/core_ztsmqr_corner.c
#core_blas/core_ztsmqr_hetra1.c
#core_blas/core_ztsrfb.c
# PCOMPUTE not used
# -----------------
#compute/pzgebrd_ge2tb.c
#compute/pzgebrd_tb2bd.c
#compute/pzgetmi2.c
#compute/pzgetrf_reclap.c
#compute/pzgetrf_rectil.c
#compute/pzhbcpy_t2bl.c
#compute/pzhegst.c
#compute/pzherbt.c
#compute/pzhetrd_hb2st.c
#compute/pzhetrd_he2hb.c
#compute/pzlarft_blgtrd.c
#compute/pzlaswp.c
#compute/pzlaswpc.c
#compute/pztrsmrv.c
#compute/pzunmqr_blgtrd.c
#
#compute/pzbarrier.c
#compute/pzpack.c
#compute/pzshift.c
# COMPUTE not used
# ----------------
#compute/zgetrf.c
#compute/zgetri.c
#compute/zcgels.c
#compute/zcgesv.c
#compute/zcposv.c
#compute/zcungesv.c
#compute/zgebrd.c
#compute/zgecfi2.c
#compute/zgecfi2.h
#compute/zgecfi.c
#compute/zgesv.c
#compute/zgesvd.c
#compute/zgetmi.c
#compute/zgetrs.c
#compute/zheev.c
#compute/zheevd.c
#compute/zhegst.c
#compute/zhegv.c
#compute/zhegvd.c
#compute/zhetrd.c
#compute/zlaswp.c
#compute/zlaswpc.c
#compute/ztrsmrv.c
# TIMING not used
# ---------------
#timing/time_zgetrf.c
#timing/time_zgetrf_tile.c
#timing/time_zcgesv.c
#timing/time_zcgesv_tile.c
#timing/time_zcposv.c
#timing/time_zcposv_tile.c
#timing/time_zgebrd_tile.c
#timing/time_zgetrf_reclap.c
#timing/time_zgetrf_rectil.c
#timing/time_zgecfi.c
#timing/time_zgesvd_tile.c
#timing/time_zheevd_tile.c
#timing/time_zheev_tile.c
#timing/time_zhegv_tile.c
#timing/time_zlapack2tile.c
#timing/time_zgesv.c
#timing/time_zgesv_tile.c
# TESTING not used
# ----------------
#testing/testing_zcgels.c
#testing/testing_zcgesv.c
#testing/testing_zcposv.c
#testing/testing_zcungesv.c
#testing/testing_zgecfi.c
#testing/testing_zgesv.c
#testing/testing_zgesvd.c
#testing/testing_zgetmi.c
#testing/testing_zgetri.c
#testing/testing_zheev.c
#testing/testing_zheevd.c
#testing/testing_zhegst.c
#testing/testing_zhegv.c
#testing/testing_zhegvd.c
#testing/testing_zlange.c
# TIMING not used
# ----------------
#timing/zauxiliary.h
#timing/zauxiliary.c
# Génération des sources
# ----------------------
python ${plasma_conv_dir}/generate_morseSrc.py -o ${morse_tmp} -p ${plasma_dir} -f "${list_file}" --force
# Copie de la licence en entête des fichiers générés
current_dir=$PWD
cd ${morse_tmp}
${licence_dir}/insert-licence-chameleon.sh
cd ${current_dir}
# Recopie de magma_morse
# ----------------------
python ${plasma_conv_dir}/generate_morseSrc.py -o ${morse_dir} -m ${morse_tmp} --force
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###
#
# -- Inria
# -- (C) Copyright 2012
#
# This software is a computer program whose purpose is to process
# Matrices Over Runtime Systems @ Exascale (MORSE). More information
# can be found on the following website: http://www.inria.fr/en/teams/morse.
#
# This software is governed by the CeCILL-C license under French law and
# abiding by the rules of distribution of free software. You can use,
# modify and/ or redistribute the software under the terms of the CeCILL-C
# license as circulated by CEA, CNRS and INRIA at the following URL
# "http://www.cecill.info".
#
# As a counterpart to the access to the source code and rights to copy,
# modify and redistribute granted by the license, users are provided only
# with a limited warranty and the software's author, the holder of the
# economic rights, and the successive licensors have only limited
# liability.
#
# In this respect, the user's attention is drawn to the risks associated
# with loading, using, modifying and/or developing or reproducing the
# software by the user in light of its specific status of free software,
# that may mean that it is complicated to manipulate, and that also
# therefore means that it is reserved for developers and experienced
# professionals having in-depth computer knowledge. Users are therefore
# encouraged to load and test the software's suitability as regards their
# requirements in conditions enabling the security of their systems and/or
# data to be ensured and, more generally, to use and operate it in the
# same conditions as regards security.
#
# The fact that you are presently reading this means that you have had
# knowledge of the CeCILL-C license and that you accept its terms.
#
###
#
# @file fileConversion.py
#
# @project MORSE
# MORSE is a software package provided by:
# Inria Bordeaux - Sud-Ouest,
# Univ. of Tennessee,
# King Abdullah Univesity of Science and Technology
# Univ. of California Berkeley,
# Univ. of Colorado Denver.
#
# @version 1.0.0
# @author Cedric Castagnede
# @author Emmanuel Agullo
# @author Mathieu Faverge
# @date 13-07-2012
#
###
import sys;
import os;
import string;
import re;
import shutil;
from rulesSubstitutions import subs;
def read_file(file):
fd = open(file, 'r')
filedata = fd.read()
fd.close()
return filedata
def write_file(file, filedata):
fd = open(file, 'w')
fd.write(filedata)
fd.close()
def update_file(file, filedata):
# read previous data
fd = open(file, 'r')
data = fd.read()
fd.close()
# write new + previous data
fd = open(file, 'w')
fd.write(filedata + data)
fd.close()
def create_path(path):
path = os.path.abspath(path)
if os.path.exists(path) is False:
print 'create:',path
os.makedirs(path)
def substitute_file(srcfilepath, dstfilepath, filetype):
print 'substitute : apply >>>',filetype,'<<< dictionnary'
print ' for',dstfilepath
# Initialize filedata
filedata = read_file(srcfilepath)
# Subsitute in data
work = subs[filetype]
for pattern in work:
condition = pattern[0]
search = pattern[1]
replace = pattern[2]
if not search:
continue
if condition == 'u':
filedata = re.sub(re.compile(search, re.M), replace, filedata)
if condition == 'r':
data_p = re.sub(re.compile(search, re.M), replace, filedata)
while data_p != filedata:
filedata = data_p
data_p = re.sub(re.compile(search, re.M), replace, filedata)
filedata = data_p
# calll the last treatment to remove tabulation
filedata = re.sub(re.compile('\t', re.M), ' ', filedata)
# Write file
write_file(dstfilepath, filedata)
def change_file(srcfile, dstfile, filetype, mode):
if os.path.exists(srcfile):
create_path(os.path.dirname(dstfile))
if os.path.exists(dstfile):
print 'already exists:',dstfile
if mode is True:
ask = "y"
else:
ask = ""
while (ask != "y") and (ask != "n"):
ask = raw_input('overwrite (y/n)? ')
if ask == "y":
print 'overwrite:',dstfile
substitute_file(srcfile, dstfile, filetype)
if ask == "n":
print 'stop overwrite::',dstfile
sys.exit(0)
else:
print 'write: from',srcfile
print ' into',dstfile
substitute_file(srcfile, dstfile, filetype)
else:
print 'error:',srcfile,'does not exist'
sys.exit(1)
return;
def convert_file(file, plasma_src, prefix, mode):
srcpath = os.path.abspath(plasma_src)
dstpath = os.path.join(os.path.abspath(prefix),'')
filename = os.path.basename(file)
filetype = file[:- len(filename)-1]
srcfilepath = os.path.join(srcpath,file)
dstfilepath = os.path.join(dstpath,filetype)
if filetype == 'core_blas':
# coreblas
dstpath_core = os.path.join(dstpath, 'coreblas/compute')
dstfilepath_core = os.path.join(dstpath_core, filename)
change_file(srcfilepath, dstfilepath_core, 'coreblas', mode)
change_file(dstfilepath_core, dstfilepath_core, 'all_end', True)
elif filetype == 'core_blas-qwrapper':
# coreblas path
dstpath_core = os.path.join(dstpath, 'coreblas/compute')
dstfilepath_core = os.path.join(dstpath_core, filename)
if filename == 'qwrapper_zgetf2_nopiv.c' or \
filename == 'qwrapper_zpemv.c' or \
filename == 'qwrapper_zparfb.c':
print 'CODELET:', filename, 'do not need to be generated'
else:
# codelet for quark
filename = filename.replace('qwrapper', 'codelet')
dstpath_quark = os.path.join(dstpath, 'runtime/quark/codelets')
dstfilepath_quark = os.path.join(dstpath_quark, filename)
change_file(srcfilepath, dstfilepath_quark, 'codelet_quark', mode)
# codelet for starpu
filename = filename.replace('core', 'codelet')
dstpath_starpu = os.path.join(dstpath, 'runtime/starpu/codelets')
dstfilepath_starpu = os.path.join(dstpath_starpu, filename)
change_file(dstfilepath_quark, dstfilepath_starpu, 'codelet_starpu', mode)
# codelet for starpu with WS
if filename == 'codelet_zgelqt.c' or \
filename == 'codelet_zgeqrt.c' or \
filename == 'codelet_ztslqt.c' or \
filename == 'codelet_ztsmlq.c' or \
filename == 'codelet_ztsmqr.c' or \
filename == 'codelet_ztsqrt.c' or \
filename == 'codelet_ztstrf.c' or \
filename == 'codelet_zttlqt.c' or \
filename == 'codelet_zttmlq.c' or \
filename == 'codelet_zttmqr.c' or \
filename == 'codelet_zttqrt.c' or \
filename == 'codelet_zunmlq.c' or \
filename == 'codelet_zunmqr.c':
change_file(dstfilepath_starpu, dstfilepath_starpu, 'codelet_starpu_ws', True)
# codelet for starpu with cuda
if filename == 'codelet_zgemm.c' or \
filename == 'codelet_zhemm.c' or \
filename == 'codelet_zherk.c' or \
filename == 'codelet_zher2k.c' or \
filename == 'codelet_zsymm.c' or \
filename == 'codelet_zsyrk.c' or \
filename == 'codelet_zsyr2k.c' or \
filename == 'codelet_ztrsm.c' or \
filename == 'codelet_ztrmm.c' or \
filename == 'codelet_zlauum.c' or \
filename == 'codelet_ztrtri.c' or \
filename == 'codelet_zpotrf.c':
change_file(dstfilepath_starpu, dstfilepath_starpu, 'codelet_starpu_cuda', True)
change_file(dstfilepath_quark, dstfilepath_quark, 'all_end', True)
change_file(dstfilepath_starpu, dstfilepath_starpu, 'all_end', True)
elif filetype == 'compute':
# drivers (2 treatments is necessary)
dstfilepath = os.path.join(dstfilepath,filename)
change_file(srcfilepath, dstfilepath, 'all_compute', mode)
if filename[0:2] == 'pz':
change_file(dstfilepath, dstfilepath, 'pcompute', True)
# specific transformation
if filename == 'pzgebrd_tb2bd.c':
change_file(dstfilepath, dstfilepath, filename, True)
if filename == 'pzgetrf_reclap.c':
change_file(dstfilepath, dstfilepath, filename, True)
if filename == 'pzgelqfrh.c':
change_file(dstfilepath, dstfilepath, filename, True)
if filename == 'pzgeqrfrh.c':
change_file(dstfilepath, dstfilepath, filename, True)
if filename == 'pzunglq.c':
change_file(dstfilepath, dstfilepath, filename, True)
if filename == 'pzunglqrh.c':
change_file(dstfilepath, dstfilepath, filename, True)
if filename == 'pzungqr.c':
change_file(dstfilepath, dstfilepath, filename, True)
if filename == 'pzungqrrh.c':
change_file(dstfilepath, dstfilepath, filename, True)
if filename == 'pzunmlqrh.c':
change_file(dstfilepath, dstfilepath, filename, True)
if filename == 'pzunmqrrh.c':
change_file(dstfilepath, dstfilepath, filename, True)
# specific transformation to add workspace
if filename == 'pzgelqf.c' or \
filename == 'pzgelqfrh.c' or \
filename == 'pzgeqrf.c' or \
filename == 'pzgeqrfrh.c' or \
filename == 'pzgetmi2.c' or \
filename == 'pzgetrf_incpiv.c' or \
filename == 'pzhetrd_hb2st.c' or \
filename == 'pzlange.c' or \
filename == 'pzlanhe.c' or \
filename == 'pzlansy.c' or \
filename == 'pzpack.c' or \
filename == 'pzshift.c' or \
filename == 'pzunglq.c' or \
filename == 'pzunglqrh.c' or \
filename == 'pzungqr.c' or \
filename == 'pzungqrrh.c' or \
filename == 'pzunmlq.c' or \
filename == 'pzunmlqrh.c' or \
filename == 'pzunmqr_blgtrd.c' or \
filename == 'pzunmqr.c' or \
filename == 'pzunmqrrh.c':
# codelet for starpu
change_file(dstfilepath, dstfilepath, 'pcompute_ws', True)
else:
change_file(dstfilepath, dstfilepath, 'compute', True)
change_file(dstfilepath, dstfilepath, 'all_end', True)
elif filetype == 'include':
if filename == 'core_zblas.h' or filename == 'core_zcblas.h':
# include for coreblas
filetype = 'include_coreblas'
dstfilename = filename.replace('core_', 'coreblas_')
dstfilename = dstfilename.replace('blas.h', '.h')
dstfilepath = os.path.join(dstpath,'coreblas/include')
dstfilepath = os.path.join(dstfilepath,dstfilename)
change_file(srcfilepath, dstfilepath, filetype, mode)
change_file(dstfilepath, dstfilepath, 'all_end', True)
# include for runtime (insert_task)
filetype = 'include_runtime'
dstfilepath = os.path.join(dstpath,'include')
newfile = re.sub('core', 'runtime', filename)
newfile = re.sub('blas', '', newfile)
dstfilepath = os.path.join(dstfilepath,newfile)
change_file(srcfilepath, dstfilepath, filetype, mode)
change_file(dstfilepath, dstfilepath, 'all_end', True)
# include quark_blas
filetype = 'include_quarkblas'
dstfilepath = os.path.join(dstpath,'runtime/quark/include')
newfile = re.sub('core', 'quark', filename)
dstfilepath = os.path.join(dstfilepath,newfile)
change_file(srcfilepath, dstfilepath, filetype, mode)
change_file(dstfilepath, dstfilepath, 'all_end', True)
elif filename == 'plasma_z.h' or filename == 'plasma_zc.h':
# include for drivers
filetype = 'include_morse'
dstfilepath = os.path.join(dstpath,'include')
newfile = re.sub('plasma', 'morse', filename)
dstfilepath = os.path.join(dstfilepath,newfile)
change_file(srcfilepath, dstfilepath, filetype, mode)
change_file(dstfilepath, dstfilepath, 'all_end', True)
else:
print '% >>>>>>>>>>>>>>>>>>>>>>>>>>>'
print '% What do you think you do...'
print '% <<<<<<<<<<<<<<<<<<<<<<<<<<<'
sys.exit(1)
elif filetype == 'control':
newfile = re.sub('plasma', 'morse', filename)
dstfilepath = os.path.join(dstfilepath,newfile)
change_file(srcfilepath, dstfilepath, filetype, mode)
change_file(dstfilepath, dstfilepath, 'all_end', True)
else:
# others files (timing, testing...)
dstfilepath = os.path.join(dstfilepath,filename)
change_file(srcfilepath, dstfilepath, filetype, mode)
change_file(dstfilepath, dstfilepath, 'all_end', True)
return;
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###
#
# -- Inria
# -- (C) Copyright 2012
#
# This software is a computer program whose purpose is to process
# Matrices Over Runtime Systems @ Exascale (MORSE). More information
# can be found on the following website: http://www.inria.fr/en/teams/morse.
#
# This software is governed by the CeCILL-C license under French law and
# abiding by the rules of distribution of free software. You can use,
# modify and/ or redistribute the software under the terms of the CeCILL-C
# license as circulated by CEA, CNRS and INRIA at the following URL
# "http://www.cecill.info".
#
# As a counterpart to the access to the source code and rights to copy,
# modify and redistribute granted by the license, users are provided only
# with a limited warranty and the software's author, the holder of the
# economic rights, and the successive licensors have only limited
# liability.
#
# In this respect, the user's attention is drawn to the risks associated
# with loading, using, modifying and/or developing or reproducing the
# software by the user in light of its specific status of free software,
# that may mean that it is complicated to manipulate, and that also
# therefore means that it is reserved for developers and experienced
# professionals having in-depth computer knowledge. Users are therefore
# encouraged to load and test the software's suitability as regards their
# requirements in conditions enabling the security of their systems and/or
# data to be ensured and, more generally, to use and operate it in the
# same conditions as regards security.
#
# The fact that you are presently reading this means that you have had
# knowledge of the CeCILL-C license and that you accept its terms.
#
###
#
# @file fileCopy.py
#
# @project MORSE
# MORSE is a software package provided by:
# Inria Bordeaux - Sud-Ouest,
# Univ. of Tennessee,
# King Abdullah Univesity of Science and Technology
# Univ. of California Berkeley,
# Univ. of Colorado Denver.
#
# @version 1.0.0
# @author Cedric Castagnede
# @author Emmanuel Agullo
# @author Mathieu Faverge
# @date 13-07-2012
#
###
import sys;
import os;
import shutil;
import string;
def copyDirectoryTree(directory, destination, mode):
pattern = shutil.ignore_patterns('.svn', '*~', 'plasma-conversion', 'insert-licence')
for entry in os.listdir(directory):
entryPath = os.path.join(directory, entry)
destPath = os.path.join(destination, entry)
if os.path.isdir(entryPath):
if entry == '.svn' or \
entry == 'insert-licence' or \
entry == 'plasma-conversion':
continue
else:
if os.path.exists(destPath):
copyDirectoryTree(entryPath, destPath, mode)
else:
print 'write:',destPath
shutil.copytree(entryPath, destPath, ignore=pattern)
else:
#if not os.path.exists(destPath):
if entry == 'plasma_2.6.0.tar.gz':
continue
else:
print 'write:',destPath
shutil.copy(entryPath, destination)
#else:
#print 'not write:',destPath
#print 'already exists:',destPath
#if mode is True:
# ask = "y"
#else:
# ask = ""
#while (ask != "y") and (ask != "n"):
# ask = raw_input('overwrite (y/n)? ')
#if ask == "y":
# print 'overwrite:',destPath
# shutil.copy(entryPath, destination)
#if ask == "n":
# print 'stop overwrite:',destPath
# sys.exit(0)
def copy_file(srcpath, dstpath, mode):
if os.path.exists(srcpath) is True:
dstpath2 = os.path.join(dstpath, '')
copyDirectoryTree(srcpath, dstpath2, mode)
else:
print 'error:',srcpath,'does not exist'
sys.exit(1)
return;
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###
#
# -- Inria
# -- (C) Copyright 2012
#
# This software is a computer program whose purpose is to process
# Matrices Over Runtime Systems @ Exascale (MORSE). More information
# can be found on the following website: http://www.inria.fr/en/teams/morse.
#
# This software is governed by the CeCILL-C license under French law and
# abiding by the rules of distribution of free software. You can use,
# modify and/ or redistribute the software under the terms of the CeCILL-C
# license as circulated by CEA, CNRS and INRIA at the following URL
# "http://www.cecill.info".
#
# As a counterpart to the access to the source code and rights to copy,
# modify and redistribute granted by the license, users are provided only
# with a limited warranty and the software's author, the holder of the
# economic rights, and the successive licensors have only limited
# liability.
#
# In this respect, the user's attention is drawn to the risks associated
# with loading, using, modifying and/or developing or reproducing the
# software by the user in light of its specific status of free software,
# that may mean that it is complicated to manipulate, and that also
# therefore means that it is reserved for developers and experienced
# professionals having in-depth computer knowledge. Users are therefore
# encouraged to load and test the software's suitability as regards their
# requirements in conditions enabling the security of their systems and/or
# data to be ensured and, more generally, to use and operate it in the
# same conditions as regards security.
#
# The fact that you are presently reading this means that you have had
# knowledge of the CeCILL-C license and that you accept its terms.
#
###
#
# @file generate_morseSrc.py
#
# @project MORSE
# MORSE is a software package provided by:
# Inria Bordeaux - Sud-Ouest,
# Univ. of Tennessee,
# King Abdullah Univesity of Science and Technology
# Univ. of California Berkeley,
# Univ. of Colorado Denver.
#
# @version 1.0.0
# @author Cedric Castagnede
# @author Emmanuel Agullo
# @author Mathieu Faverge
# @date 13-07-2012
#
###
import sys;
import shutil;
from optparse import OptionParser,OptionGroup;
from fileConversion import *;
from fileCopy import *;
def main(argv):
# Create the options parser for detecting options on the command line.
parser = OptionParser(usage="Usage: %prog [options]");
group = OptionGroup(parser,"Printing Options","These options control generate_morseSrc.py.");
group.add_option("-y","--force" , help=': Force overwrite all files' , action='store_true', dest='force' , default=False);
group.add_option("-o","--prefix" , help=': install files in PREFIX.' , action='store' , dest='prefix' , type='string', default=False);
group.add_option("-p","--plasma-dir", help=': Specify the top directory of PLASMA.' , action='store' , dest='pdir' , type='string', default=False);
group.add_option("-m","--morse-dir" , help=': Specify the top directory of MORSE.' , action='store' , dest='mdir' , type='string', default=False);
group.add_option("-f","--file" , help=': Specify a file(s) on which to operate.', action='store' , dest='flist' , type='string', default=False);
parser.add_option_group(group);
(options, args) = parser.parse_args();
# Create files from PLASMA
if options.prefix and options.pdir and options.flist:
print '\n#####################'
print '\nCONVERT PLASMA FILES '
print '\n#####################'
for file in options.flist.split():
convert_file(file, options.pdir, options.prefix, options.force)
# Copy file from MORSE
if options.prefix and options.mdir:
print '\n#####################'
print '\nCOPY NEEDED SVN MORSE'
print '\n#####################'
copy_file(options.mdir, options.prefix, options.force)
# Exit
return 0
if "__main__" == __name__:
sys.exit(main(sys.argv))
/**
*
* @copyright (c) 2009-2015 The University of Tennessee and The University
* of Tennessee Research Foundation.
* All rights reserved.
* @copyright (c) 2012-2016 Inria. All rights reserved.
* @copyright (c) 2012-2015 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
*
**/
!!!
!
! @copyright (c) 2009-2015 The University of Tennessee and The University
! of Tennessee Research Foundation.
! All rights reserved.
! @copyright (c) 2012-2016 Inria. All rights reserved.
! @copyright (c) 2012-2015 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
!
!!!
#!/bin/bash
###
#
# -- Inria
# -- (C) Copyright 2016
#
# This software is a computer program whose purpose is to process
# Matrices Over Runtime Systems @ Exascale (MORSE). More information
# can be found on the following website: http://www.inria.fr/en/teams/morse.
#
# This software is governed by the CeCILL-C license under French law and
# abiding by the rules of distribution of free software. You can use,
# modify and/ or redistribute the software under the terms of the CeCILL-C
# license as circulated by CEA, CNRS and INRIA at the following URL
# "http://www.cecill.info".
#
# As a counterpart to the access to the source code and rights to copy,
# modify and redistribute granted by the license, users are provided only
# with a limited warranty and the software's author, the holder of the
# economic rights, and the successive licensors have only limited
# liability.
#
# In this respect, the user's attention is drawn to the risks associated
# with loading, using, modifying and/or developing or reproducing the
# software by the user in light of its specific status of free software,
# that may mean that it is complicated to manipulate, and that also
# therefore means that it is reserved for developers and experienced
# professionals having in-depth computer knowledge. Users are therefore
# encouraged to load and test the software's suitability as regards their
# requirements in conditions enabling the security of their systems and/or
# data to be ensured and, more generally, to use and operate it in the
# same conditions as regards security.
#
# The fact that you are presently reading this means that you have had
# knowledge of the CeCILL-C license and that you accept its terms.
#
###
#
# @file insert-licence.sh
#
# @project MORSE
# MORSE is a software package provided by:
# Inria Bordeaux - Sud-Ouest,
# Univ. of Tennessee,
# King Abdullah Univesity of Science and Technology
# Univ. of California Berkeley,
# Univ. of Colorado Denver.
#
# @version 1.0.0
# @author Cedric Castagnede
# @author Emmanuel Agullo
# @author Mathieu Faverge
# @author Florent Pruvost
# @date 13-07-2012
#
###
for i in $(find . -name "*.c" -or -name "*.h" -not -path "*svn*" -not -name "morse_fortran.h")
do
cat $(dirname $0)/chameleon_c.licence > $(dirname $0)/buffer.tmp
cat $i >> $(dirname $0)/buffer.tmp
cat $(dirname $0)/buffer.tmp > $i
rm $(dirname $0)/buffer.tmp
done
for i in $(find . -name "*.f" -or -name "*.F" -or -name "*.f77" -or -name "*.F77" -or -name "*.f90" -or -name "*.F90" -or -name "morse_fortran.h")
do
cat $(dirname $0)/chameleon_f.licence > $(dirname $0)/buffer.tmp
cat $i >> $(dirname $0)/buffer.tmp
cat $(dirname $0)/buffer.tmp > $i
rm $(dirname $0)/buffer.tmp
done
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment