Commit 577564ad authored by Marco Govoni's avatar Marco Govoni
Browse files

Merged forpy

parents 28152a3c dbac7f42
......@@ -11,3 +11,4 @@
*.out
doc/_build/
Modules/west_version.f90
*/__pycache__
......@@ -26,7 +26,9 @@ stages:
- git clone -b 'qe-6.1.0' --single-branch --depth 1 https://gitlab.com/QEF/q-e.git QEDIR
- cd QEDIR
- git describe
- ./configure
- pip list
- echo $PYTHON_PATH
- ./configure --with-scalapack --enable-openmp LDFLAGS="-g -pthread -fopenmp `python3-config --ldflags`"
- make -j pw
- ls bin
- git clone -b $CI_COMMIT_REF_NAME $CI_REPOSITORY_URL West
......@@ -41,7 +43,7 @@ stages:
- git clone -b 'qe-6.1.0' --single-branch --depth 1 https://gitlab.com/QEF/q-e.git QEDIR
- cd QEDIR
- git describe
- ./configure
- ./configure --with-scalapack --enable-openmp LDFLAGS="-g -pthread -fopenmp `python3-config --ldflags`"
- make -j pw
- ls bin
- git clone -b $CI_COMMIT_REF_NAME $CI_REPOSITORY_URL West
......
......@@ -5,6 +5,7 @@ include ../../make.inc
# location of needed modules
MODFLAGS= $(MOD_FLAG)../../iotk/src $(MOD_FLAG)../../Modules $(MOD_FLAG)../../LAXlib \
$(MOD_FLAG)../../FFTXlib $(MOD_FLAG)../../PW/src \
$(MOD_FLAG)../Libraries/Forpy \
$(MOD_FLAG)../Libraries/Json \
$(MOD_FLAG)../Libraries/Base64 \
$(MOD_FLAG)../Modules \
......@@ -28,7 +29,7 @@ wfreq_io.o \
wfreq_restart.o
PWOBJS = ../../PW/src/libpw.a
QEMODS = ../../Modules/libqemod.a ../../FFTXlib/libqefft.a ../../LAXlib/libqela.a ../Libraries/Json/libjson.a ../Libraries/Base64/libbase64.a
QEMODS = ../../Modules/libqemod.a ../../FFTXlib/libqefft.a ../../LAXlib/libqela.a ../Libraries/Forpy/libforpy.a ../Libraries/Json/libjson.a ../Libraries/Base64/libbase64.a
TLDEPS= bindir mods libs pw
......
......@@ -2,7 +2,7 @@
default: all
all: title forpy_do json_do base64_do
all: title forpy_do json_do base64_do
test: json_test_do
......
......@@ -5,6 +5,7 @@ include ../../make.inc
# location of needed modules
MODFLAGS= $(MOD_FLAG)../../iotk/src $(MOD_FLAG)../../Modules $(MOD_FLAG)../../LAXlib \
$(MOD_FLAG)../../FFTXlib $(MOD_FLAG)../../PW/src \
$(MOD_FLAG)../Libraries/Forpy \
$(MOD_FLAG).
IFLAGS=
......@@ -14,7 +15,7 @@ west_version.o \
westcom.o
PWOBJS = ../../PW/src/libpw.a
QEMODS = ../../Modules/libqemod.a ../../FFTXlib/libqefft.a ../../LAXlib/libqela.a
QEMODS = ../../Modules/libqemod.a ../../FFTXlib/libqefft.a ../../LAXlib/libqela.a ../Libraries/Forpy/libforpy.a
TLDEPS= bindir mods libs pw
......@@ -22,6 +23,7 @@ all : title tldeps libmodules.a
tldeps:
test -n "$(TLDEPS)" && ( cd ../.. ; $(MAKE) $(MFLAGS) $(TLDEPS) || exit 1) || :
./update_west_version ${TOPDIR}
libmodules.a : $(MODULES_OBJS)
$(AR) $(ARFLAGS) $@ $?
......
#!/bin/sh
top_dir=$1
echo "TOPDIR = " $top_dir
# check if svn info available (do not write anything)
svn info 2> /dev/null > /dev/null
git remote -v 2> /dev/null > /dev/null
if [ $? = 0 ] ; then
# svn info available: get svn revision
svn_rev=$(svnversion -n)
git_rev=$(git describe)
else
# svn info available: revert to no info
svn_rev=unknown
git_rev=unknown
fi
echo "GITREV = " $git_rev
# write svn into file version_tmp.f90
cat west_version.f90.in | sed 's/unknown/'$svn_rev'/' > west_version.f90.tmp
cat west_version.f90.in | sed "s/unknown/$git_rev/;s&unset&$top_dir&" > west_version.f90.tmp
# check if a previous version.f90 file exists
if test -f west_version.f90 ; then
......
......@@ -12,11 +12,39 @@
MODULE west_version
!-----------------------------------------------------------------------
!
USE forpy_mod, ONLY: list
!
IMPLICIT NONE
!
SAVE
!
CHARACTER (LEN=6) :: west_version_number = '3.1.1'
CHARACTER (LEN=12) :: west_svn_revision = 'unknown'
CHARACTER (LEN=512) :: west_git_revision = 'unknown'
CHARACTER (LEN=512) :: west_forpy_path = 'unset'
TYPE(list) :: paths
!
CONTAINS
!
SUBROUTINE start_forpy()
USE forpy_mod, ONLY: forpy_initialize, get_sys_path
IMPLICIT NONE
INTEGER :: IERR
!
IERR = forpy_initialize()
IF(IERR/=0) CALL errore('forpy','Err: cannot init forpy',1)
!
IERR = get_sys_path(paths)
IF(IERR/=0) CALL errore('forpy','Err: cannot get_sys_path',1)
!
IERR = paths%append(TRIM(ADJUSTL(west_forpy_path))//"West/Tools")
IF(IERR/=0) CALL errore('forpy','Err: cannot append paths',1)
END SUBROUTINE
!
SUBROUTINE end_forpy()
USE forpy_mod, ONLY: forpy_finalize
IMPLICIT NONE
CALL paths%destroy()
CALL forpy_finalize()
END SUBROUTINE
!
END MODULE
......@@ -85,8 +85,8 @@ MODULE westin
CHARACTER(LEN=512) :: west_prefix
CHARACTER(LEN=512) :: qe_prefix
CHARACTER(LEN=512) :: savedir ! outdir/west_prefix.code.save
CHARACTER(LEN=512) :: main_input_file ! input file (json format)
CHARACTER(LEN=512) :: logfile ! savedir/logfile.json
CHARACTER(LEN=512) :: main_input_file ! input file
CHARACTER(LEN=:), ALLOCATABLE :: logfile ! savedir/logfile.xml
!
END MODULE
!
......
......@@ -5,6 +5,7 @@ include ../../make.inc
# location of needed modules
MODFLAGS= $(MOD_FLAG)../../iotk/src $(MOD_FLAG)../../Modules $(MOD_FLAG)../../LAXlib \
$(MOD_FLAG)../../FFTXlib $(MOD_FLAG)../../PW/src \
$(MOD_FLAG)../Libraries/Forpy \
$(MOD_FLAG)../Libraries/Json \
$(MOD_FLAG)../Libraries/Base64 \
$(MOD_FLAG)../Modules \
......@@ -14,6 +15,7 @@ IFLAGS=
TOOLS_OBJS = \
io_push.o \
logfile.o \
fetch_input.o \
set_dirs.o \
west_print_clocks.o \
......@@ -41,7 +43,7 @@ read_pwout.o \
bar.o
PWOBJS = ../../PW/src/libpw.a
QEMODS = ../../Modules/libqemod.a ../../FFTXlib/libqefft.a ../../LAXlib/libqela.a ../Libraries/Json/libjson.a ../Libraries/Base64/libbase64.a
QEMODS = ../../Modules/libqemod.a ../../FFTXlib/libqefft.a ../../LAXlib/libqela.a ../Libraries/Forpy/libforpy.a ../Libraries/Json/libjson.a ../Libraries/Base64/libbase64.a
TLDEPS= bindir mods libs pw
......
!
! Copyright (C) 2015-2017 M. Govoni
! This file is distributed under the terms of the
! GNU General Public License. See the file `License'
! GNU General Public License. See the file License
! in the root directory of the present distribution,
! or http://www.gnu.org/copyleft/gpl.txt .
!
......@@ -264,7 +264,7 @@ SUBROUTINE fetch_input( num_drivers, driver, verbose )
CALL mp_bcast(qe_prefix,root,world_comm)
prefix=qe_prefix
CALL mp_bcast(west_prefix,root,world_comm)
tmp_dir = trimcheck (outdir)
tmp_dir = trimcheck (TRIM(ADJUSTL(outdir)))
CALL mp_bcast(tmp_dir,root,world_comm)
!
ENDIF
......@@ -595,3 +595,310 @@ SUBROUTINE add_intput_parameters_to_json_file( num_drivers, driver, json )
ENDIF
!
END SUBROUTINE
SUBROUTINE fetch_input1( num_drivers, driver, debug )
!
USE west_version, ONLY : start_forpy, end_forpy
USE io_push, ONLY : io_push_title,io_push_value,io_push_bar,io_push_es0,io_push_c512
USE forpy_mod, ONLY: call_py, call_py_noret, import_py, module_py
USE forpy_mod, ONLY: tuple, tuple_create
USE forpy_mod, ONLY: dict, dict_create
USE forpy_mod, ONLY: list, list_create
USE forpy_mod, ONLY: object, cast
USE forpy_mod, ONLY : exception_matches, KeyError, err_clear, err_print
USE westcom
USE io_files, ONLY : tmp_dir, prefix
USE io_global, ONLY : stdout
USE mp, ONLY : mp_bcast
USE mp_world, ONLY : mpime,root,world_comm
USE mp_global, ONLY : nimage
USE gvect, ONLY : ecutrho
USE start_k, ONLY : nk1, nk2, nk3
USE control_flags, ONLY : gamma_only
USE json_module, ONLY : json_file
!
IMPLICIT NONE
!
! I/O
!
INTEGER, INTENT(IN) :: num_drivers
INTEGER, INTENT(IN) :: driver(num_drivers)
LOGICAL, INTENT(IN) :: debug
!
INTEGER :: IERR
TYPE(tuple) :: args
TYPE(dict) :: kwargs
TYPE(module_py) :: pymod
TYPE(object) :: return_obj, tmp_obj
TYPE(dict) :: return_dict
TYPE(list) :: tmp_list
INTEGER :: list_len
INTEGER :: i
INTEGER :: nq
INTEGER :: numsp
CHARACTER(LEN=512), EXTERNAL :: trimcheck
CHARACTER(LEN=:),ALLOCATABLE :: cvalue
TYPE(json_file) :: json
INTEGER :: iunit
!
CALL start_clock('fetch_input')
!
IF ( mpime==root ) THEN
!
IERR = import_py(pymod, "fetch_input")
!
IF ( ANY(driver(:)==1) ) THEN
!
IERR = tuple_create(args, 2)
IERR = args%setitem(0, TRIM(ADJUSTL(main_input_file)) )
IERR = args%setitem(1, "input_west" )
IERR = dict_create(kwargs)
!
IERR = call_py(return_obj, pymod, "read_keyword_from_file", args, kwargs)
IERR = cast(return_dict, return_obj)
!
CALL args%destroy
CALL kwargs%destroy
CALL return_obj%destroy
!
IERR = return_dict%getitem(cvalue, "qe_prefix"); qe_prefix = TRIM(ADJUSTL(cvalue))
IERR = return_dict%getitem(cvalue, "west_prefix"); west_prefix = TRIM(ADJUSTL(cvalue))
IERR = return_dict%getitem(cvalue, "outdir"); outdir = TRIM(ADJUSTL(cvalue))
!
CALL return_dict%destroy
!
ENDIF
!
IF ( ANY(driver(:)==2) ) THEN
!
IF ( gamma_only ) THEN
nq = 1
ELSE
nq = nk1*nk2*nk3
ENDIF
!
IERR = tuple_create(args, 2)
IERR = args%setitem(0, TRIM(ADJUSTL(main_input_file)) )
IERR = args%setitem(1, "wstat_control" )
IERR = dict_create(kwargs)
IERR = kwargs%setitem("nq",nq)
!
IERR = call_py(return_obj, pymod, "read_keyword_from_file", args, kwargs)
IERR = cast(return_dict, return_obj)
!
CALL args%destroy
CALL kwargs%destroy
CALL return_obj%destroy
!
IERR = return_dict%getitem(cvalue, "wstat_calculation"); wstat_calculation = TRIM(ADJUSTL(cvalue))
IERR = return_dict%getitem(n_pdep_eigen, "n_pdep_eigen")
IERR = return_dict%getitem(n_pdep_times, "n_pdep_times")
IERR = return_dict%getitem(n_pdep_maxiter, "n_pdep_maxiter")
IERR = return_dict%getitem(n_dfpt_maxiter, "n_dfpt_maxiter")
IERR = return_dict%getitem(n_pdep_read_from_file, "n_pdep_read_from_file")
IERR = return_dict%getitem(trev_pdep, "trev_pdep")
IERR = return_dict%getitem(trev_pdep_rel, "trev_pdep_rel")
IERR = return_dict%getitem(tr2_dfpt, "tr2_dfpt")
IERR = return_dict%getitem(l_kinetic_only, "l_kinetic_only")
IERR = return_dict%getitem(l_minimize_exx_if_active, "l_minimize_exx_if_active")
IERR = return_dict%getitem(l_use_ecutrho, "l_use_ecutrho")
IERR = return_dict%getitem(tmp_obj, "qlist")
IERR = cast(tmp_list,tmp_obj)
IERR = tmp_list%len(list_len)
IF( ALLOCATED(qlist) ) DEALLOCATE(qlist)
ALLOCATE(qlist(list_len))
DO i = 0, list_len-1 ! Python indices start at 0
IERR = tmp_list%getitem(qlist(i+1), i) ! Fortran indices start at 1
ENDDO
!
CALL return_dict%destroy
CALL tmp_obj%destroy
CALL tmp_list%destroy
!
ENDIF
!
CALL pymod%destroy
!
ENDIF
!
! BCAST & CHECKS
!
IF ( ANY(driver(:)==1) ) THEN
!
CALL mp_bcast(qe_prefix,root,world_comm); prefix=qe_prefix
CALL mp_bcast(west_prefix,root,world_comm)
CALL mp_bcast(outdir,root,world_comm); tmp_dir = trimcheck (outdir)
!
ENDIF
!
IF ( ANY(driver(:)==2) ) THEN
!
CALL mp_bcast(wstat_calculation,root,world_comm)
CALL mp_bcast(n_pdep_eigen,root,world_comm)
CALL mp_bcast(n_pdep_times,root,world_comm)
CALL mp_bcast(n_pdep_maxiter,root,world_comm)
CALL mp_bcast(n_dfpt_maxiter,root,world_comm)
CALL mp_bcast(n_pdep_read_from_file,root,world_comm)
CALL mp_bcast(trev_pdep,root,world_comm)
CALL mp_bcast(trev_pdep_rel,root,world_comm)
CALL mp_bcast(tr2_dfpt,root,world_comm)
CALL mp_bcast(l_kinetic_only,root,world_comm)
CALL mp_bcast(l_minimize_exx_if_active,root,world_comm)
CALL mp_bcast(l_use_ecutrho,root,world_comm)
IF(mpime == root) nq = SIZE(qlist)
CALL mp_bcast(nq,root,world_comm)
IF(mpime /= root) THEN
IF( ALLOCATED(qlist) ) DEALLOCATE(qlist)
ALLOCATE(qlist(nq))
ENDIF
CALL mp_bcast(qlist,root,world_comm)
!
! CHECKS
!
SELECT CASE(wstat_calculation)
CASE('r','R','s','S')
CASE DEFAULT
CALL errore('fetch_input','Err: wstat_calculation /= S or R',1)
END SELECT
!
IF( n_pdep_times < 2 ) CALL errore('fetch_input','Err: n_pdep_times<2',1)
IF( n_pdep_eigen < 1 ) CALL errore('fetch_input','Err: n_pdep_eigen<1',1)
IF( n_pdep_eigen*n_pdep_times < nimage ) CALL errore('fetch_input','Err: n_pdep_eigen*n_pdep_times<nimage',1)
IF( n_pdep_maxiter < 1 ) CALL errore('fetch_input','Err: n_pdep_maxiter<1',1)
IF( n_dfpt_maxiter < 1 ) CALL errore('fetch_input','Err: n_dfpt_maxiter<1',1)
IF( n_pdep_read_from_file < 0 ) CALL errore('fetch_input','Err: n_pdep_read_from_file<0',1)
IF( n_pdep_read_from_file > n_pdep_eigen ) CALL errore('fetch_input','Err: n_pdep_read_from_file>n_pdep_eigen',1)
IF(tr2_dfpt<=0._DP) CALL errore('fetch_input','Err: tr2_dfpt<0.',1)
IF(trev_pdep<=0._DP) CALL errore('fetch_input','Err: trev_pdep<0.',1)
IF(trev_pdep_rel<=0._DP) CALL errore('fetch_input','Err: trev_pdep_rel<0.',1)
IF(gamma_only) THEN
IF (SIZE(qlist)/=1) CALL errore('fetch_input','Err: SIZE(qlist)/=1.',1)
ELSE
IF (SIZE(qlist)>nk1*nk2*nk3) CALL errore('fetch_input','Err: SIZE(qlist)>nk1*nk2*nk3.',1)
ENDIF
!
ENDIF
!
! REPORT
!
IF ( debug ) THEN
!
IF ( ANY(driver(:)==1) ) THEN
!
! REPORT
!
CALL io_push_title("I/O Summary : input_west")
!
numsp = 14
CALL io_push_c512('qe_prefix',qe_prefix,numsp)
CALL io_push_c512('west_prefix',west_prefix,numsp)
CALL io_push_c512('outdir',outdir,numsp)
!
CALL io_push_bar()
!
ENDIF
!
IF ( ANY(driver(:)==2) ) THEN
!
! REPORT
!
CALL io_push_title('I/O Summary : wstat_control')
!
numsp=30
CALL io_push_value('wstat_calculation',wstat_calculation,numsp)
CALL io_push_value('n_pdep_eigen',n_pdep_eigen,numsp)
CALL io_push_value('n_pdep_times',n_pdep_times,numsp)
CALL io_push_value('n_pdep_maxiter',n_pdep_maxiter,numsp)
CALL io_push_value('n_dfpt_maxiter',n_dfpt_maxiter,numsp)
CALL io_push_value('n_pdep_read_from_file',n_pdep_read_from_file,numsp)
CALL io_push_es0('trev_pdep',trev_pdep,numsp)
CALL io_push_es0('trev_pdep_rel',trev_pdep_rel,numsp)
CALL io_push_es0('tr2_dfpt',tr2_dfpt,numsp)
CALL io_push_value('l_kinetic_only',l_kinetic_only,numsp)
CALL io_push_value('l_minimize_exx_if_active',l_minimize_exx_if_active,numsp)
CALL io_push_value('l_use_ecutrho',l_use_ecutrho,numsp)
DO i = 1, SIZE(qlist)
CALL io_push_value('qlist',qlist(i),numsp)
ENDDO
!
CALL io_push_bar()
!
ENDIF
!
IF ( ANY(driver(:)==3) ) THEN
!
! REPORT
!
CALL io_push_title('I/O Summary : wfreq_control')
!
numsp=40
CALL io_push_value('wfreq_calculation',wfreq_calculation,numsp)
CALL io_push_value('n_pdep_eigen_to_use',n_pdep_eigen_to_use,numsp)
CALL io_push_value('qp_bandrange(1)',qp_bandrange(1),numsp)
CALL io_push_value('qp_bandrange(2)',qp_bandrange(2),numsp)
CALL io_push_value('macropol_calculation',macropol_calculation,numsp)
CALL io_push_value('n_lanczos',n_lanczos,numsp)
CALL io_push_value('n_imfreq',n_imfreq,numsp)
CALL io_push_value('n_refreq',n_refreq,numsp)
CALL io_push_value('ecut_imfreq [Ry]',ecut_imfreq,numsp)
CALL io_push_value('ecut_refreq [Ry]',ecut_refreq,numsp)
CALL io_push_value('wfreq_eta [Ry]',wfreq_eta,numsp)
CALL io_push_value('n_secant_maxiter',n_secant_maxiter,numsp)
CALL io_push_value('trev_secant [Ry]',trev_secant,numsp)
CALL io_push_value('l_enable_lanczos',l_enable_lanczos,numsp)
CALL io_push_value('l_enable_gwetot',l_enable_gwetot,numsp)
CALL io_push_value('o_restart_time [min]',o_restart_time,numsp)
CALL io_push_value('ecut_spectralf(1) [Ry]',ecut_spectralf(1),numsp)
CALL io_push_value('ecut_spectralf(2) [Ry]',ecut_spectralf(2),numsp)
CALL io_push_value('n_spectralf',n_spectralf,numsp)
!
CALL io_push_bar()
!
ENDIF
!
IF ( ANY(driver(:)==4) ) THEN
!
! REPORT
!
CALL io_push_title('I/O Summary : westpp_control')
!
numsp=40
CALL io_push_value('westpp_calculation',westpp_calculation,numsp)
CALL io_push_value('westpp_range(1)',westpp_range(1),numsp)
CALL io_push_value('westpp_range(2)',westpp_range(2),numsp)
CALL io_push_value('westpp_format',westpp_format,numsp)
CALL io_push_value('westpp_sign',westpp_sign,numsp)
CALL io_push_value('westpp_n_pdep_eigen_to_use',westpp_n_pdep_eigen_to_use,numsp)
CALL io_push_value('westpp_r0(1)',westpp_r0(1),numsp)
CALL io_push_value('westpp_r0(2)',westpp_r0(2),numsp)
CALL io_push_value('westpp_r0(3)',westpp_r0(3),numsp)
CALL io_push_value('westpp_nr',westpp_nr,numsp)
CALL io_push_value('westpp_rmax',westpp_rmax,numsp)
CALL io_push_value('westpp_epsinfty',westpp_epsinfty,numsp)
!
CALL io_push_bar()
!
ENDIF
!
!
ENDIF
!
IF( mpime == root ) THEN
!
CALL json%initialize()
CALL json%load_file(filename=TRIM(logfile))
!
CALL add_intput_parameters_to_json_file( num_drivers, driver, json )
!
OPEN( NEWUNIT=iunit, FILE=TRIM(logfile) )
CALL json%print_file( iunit )
CLOSE( iunit )
CALL json%destroy()
!
ENDIF
!
CALL stop_clock('fetch_input')
!
END SUBROUTINE
#!/usr/bin/python3
# File: fetch_input.py
# Test: python3 fetch_input.py
from __future__ import print_function
import sys
import os
import yaml
import json
#########################
# STATIC DEFAULT VALUES #
#########################
default = {}
# input_west
default["input_west"] = {}
default["input_west"]["qe_prefix"] = "pwscf"
default["input_west"]["west_prefix"] = "west"
default["input_west"]["outdir"] = "./"
# wstat_control
default["wstat_control"] = {}
default["wstat_control"]["wstat_calculation"] = "S"
default["wstat_control"]["n_pdep_eigen"] = 1
default["wstat_control"]["n_pdep_times"] = 4
default["wstat_control"]["n_pdep_maxiter"] = 100
default["wstat_control"]["n_dfpt_maxiter"] = 250
default["wstat_control"]["n_pdep_read_from_file"] = 0
default["wstat_control"]["trev_pdep"] = 1.e-3
default["wstat_control"]["trev_pdep_rel"] = 1.e-1
default["wstat_control"]["tr2_dfpt"] = 1.e-12
default["wstat_control"]["l_kinetic_only"] = False
default["wstat_control"]["l_minimize_exx_if_active"] = False
default["wstat_control"]["l_use_ecutrho"] = False
default["wstat_control"]["qlist"] = [ 1 ]
############################
# DYNAMICAL DEFAULT VALUES #
############################
def update_default_values(key,kwargs) :
assert key in default.keys()
#
if key == "wstat_control" :
assert("nq") in kwargs.keys()
nq = kwargs["nq"]
default[key]["qlist"] = [ i+1 for i in range(nq) ]
def open_and_parse_file(fileName="west.in") :
"""Opens a file and parses it using the YAML sintax
:param fileName: name of the file
:type fileName: ``string``
:return: parsed data
:rtype: ``dict``
"""
data = {}
try :
with open(fileName, 'r') as stream:
try:
data = yaml.load(stream,Loader=yaml.SafeLoader)
except:
print("Cannot parse file")
except :
print("Cannot open file : ",fileName)
#
return data
def print_bar(prefix="",nmarks=92) :
"""Prints bar.
:param prefix: prefix
:type prefix: ``string``
:param nmarks: number of marks
:type nmarks: ``int``
"""
#
s = prefix
for i in range(nmarks) :
s+="-"
print(s)
def check_dict(parsed_data={}, default_data={}) :
"""Check data: returns a dictionary with the same keys of default_data. If keys are matching, values of default_data are replaced with those of parsed_data.
:param parsed_data: parsed data
:type parsed_data: ``dict``
:param default_data: default data
:type default_data: ``dict``