utils_data¶
Utilities for Dataset Module .
- utils_data.bisectionConcat(index_start, index_end, dim_input, cache_label_path, data_name)¶
Concat fragments of dataset by bisection method with compuation cost \(O(logN)\). Assume that there is a sequence of datasets in the directory Cache: subdata0.npy, subdata1.npy, …, subdata99.npy, and then data_name is subdata, cache_label_path is Cache.
- Parameters
- Returns
data – Final dataset concated by all the fragments.
- Return type
- utils_data.mpiSplitData(sample_num, cpu_id, cpu_size)¶
The size will be splitted into cpu_size parts and the index of the cpu_id part will be returned.
- Parameters
- Returns
Split_array_index – The index of the cpu_id-th part.
- Return type
- utils_data.allowConcatForMPI(batch_num, cache_path, data_name, time_out=72000)¶
Circularly check whether all the sub-datasets have been created. If so, return True.
- Parameters
- Returns
flag – Whether all the sub-datasets have been created.
- Return type
- utils_data.writeMech(file_name, mech_path)¶
Change mechanism in the target file. Used for CanteraTools.py and SampleMethod.py.
- utils_data.setGlobalMech(mech_path)¶
Set mechanism in SampleMethod.py and CanteraTools.py
- utils_data.mpiClearCache()¶
Use MPI parallelization to clear cache folders including CacheManifold*, CacheManifoldBatch*, CacheBatchData* and CacheLabel Data* .
- utils_data.clearLog()¶
Clear the /log/ folder.