base.py

Define base operations for PETGEM such as: check init params, data types, import files and timers.

petgem.base.base.checkDictionaryConsistencyMaster(rank, in_dict, file_name, dir_name)[source]

Check if dictionary consistency match with PETGEM requirements. (master task)

Params int rank:
 MPI rank.
Params dict in_dict:
 input dictionary to be tested.
Params str file_name:
 parameters file name.
Params str dir_name:
 parent directory of file_name
Returns:csem modelling dictionary after test.
Return type:csem_modelling dictionary.
petgem.base.base.checkDictionaryConsistencySlave(rank, in_dict, file_name, dir_name)[source]

Check if dictionary consistency match with PETGEM requirements. (slave task)

Params int rank:
 MPI rank.
Params dict in_dict:
 input dictionary to be tested.
Params str file_name:
 parameters file name.
Params str dir_name:
 parent directory of file_name
Returns:csem modelling dictionary after test.
Return type:csem_modelling dictionary.
petgem.base.base.checkDirectoryPath(in_directory_path)[source]

Determine if exists a directory.

Params str in_directory_path:
 directory name to be checked.
Returns:success.
Return type:bool
petgem.base.base.checkFilePath(in_file_path)[source]

Determine if exists a file.

Params str in_file_path:
 file name to be checked.
Returns:success.
Return type:bool
petgem.base.base.checkNumberParams(init_params)[source]

Check number of initial kernel parameters.

Parameters:init_params (list) – list of initial kernel parameters.
Returns:a parameters file name.
Return type:str.

Note

if the number of init_params is different to 2, PETGEM kernel will stop.

petgem.base.base.readUserParams(input_params, rank)[source]

Read a kernel input, namely a parameters file name.

Params list input_params:
 user input parameters.
Parameters:rank (int) – MPI rank.
Returns:a modelling dictionary.
Return type:dict of type modelling.
petgem.base.base.unitary_test()[source]

Unitary test for base.py script.