def test_sanity(self): d = get_temp_dir("resolved-tool-contract") tc = load_tool_contract_from(get_data_file(self.FILE_NAME)) rtc = resolve_scatter_tool_contract(tc, self.INPUT_FILES, d, d, self.MAX_NPROC, self.TOOL_OPTIONS, self.MAX_NCHUNKS, self.CHUNK_KEYS) self.assertIsInstance(rtc, ResolvedToolContract) self.assertIsInstance(rtc.task, ResolvedScatteredToolContractTask) self.assertEqual(rtc.task.max_nchunks, 7)
def test_sanity(self): d = get_temp_dir("resolved-tool-contract") tc = load_tool_contract_from(get_tool_contract(self.FILE_NAME)) rtc = resolve_scatter_tool_contract(tc, self.INPUT_FILES, d, d, self.MAX_NPROC, self.TOOL_OPTIONS, self.MAX_NCHUNKS, self.CHUNK_KEYS, False) self.assertIsInstance(rtc, ResolvedToolContract) self.assertIsInstance(rtc.task, ResolvedScatteredToolContractTask) self.assertEqual(rtc.task.max_nchunks, 7) self.assertEqual(rtc.task.is_distributed, False)
def static_scatter_meta_task_to_rtc(static_meta_task, task, task_options, task_dir, tmp_dir, max_nproc, max_nchunks, chunk_keys, is_distributed): rtc = resolve_scatter_tool_contract(static_meta_task.tool_contract, task.input_files, task_dir, tmp_dir, max_nproc, task_options, max_nchunks, chunk_keys, is_distributed) # See the above comment for this rtc.task.output_files = task.output_files rtc.task.nproc = task.nproc task.resources = task.resources return rtc
def static_scatter_meta_task_to_rtc(static_meta_task, task, task_options, task_dir, tmp_dir, max_nproc, max_nchunks, chunk_keys): rtc = resolve_scatter_tool_contract(static_meta_task.tool_contract, task.input_files, task_dir, tmp_dir, max_nproc, task_options, max_nchunks, chunk_keys) # See the above comment for this rtc.task.output_files = task.output_files rtc.task.is_distributed = static_meta_task.is_distributed rtc.task.nproc = task.nproc task.resources = task.resources return rtc
def _to_rtc(self, tc, output_dir, tmp_dir): return resolve_scatter_tool_contract(tc, self.INPUT_FILES, output_dir, tmp_dir, self.MAX_NPROC, self.TASK_OPTIONS, self.MAX_NCHUNKS, self.CHUNK_KEYS, self.IS_DISTRIBUTED)
def _to_rtc(self, tc, output_dir, tmp_dir): return resolve_scatter_tool_contract(tc, self.INPUT_FILES, output_dir, tmp_dir, self.MAX_NPROC, self.TASK_OPTIONS, self.MAX_NCHUNKS, self.CHUNK_KEYS)