This commit is contained in:
		
							parent
							
								
									75558700b4
								
							
						
					
					
						commit
						dc8ae85cc8
					
				|  | @ -44,7 +44,7 @@ def get_conf_stage( | ||||||
| 
 | 
 | ||||||
| def get_parser_handler_map( | def get_parser_handler_map( | ||||||
|     task_stage: task.Stage, |     task_stage: task.Stage, | ||||||
|     diff_executor_config: result.Executor, |     executor: result.Executor, | ||||||
|     base_dir: Path, |     base_dir: Path, | ||||||
| ) -> Dict[ParserEnum, Tuple[Callable[[Any, result.Parser], None], Any]]: | ) -> Dict[ParserEnum, Tuple[Callable[[Any, result.Parser], None], Any]]: | ||||||
|     return { |     return { | ||||||
|  | @ -60,7 +60,7 @@ def get_parser_handler_map( | ||||||
|             partial( |             partial( | ||||||
|                 fix_diff, |                 fix_diff, | ||||||
|                 task_stage=task_stage, |                 task_stage=task_stage, | ||||||
|                 diff_executor_config=diff_executor_config, |                 executor=executor, | ||||||
|                 base_dir=base_dir, |                 base_dir=base_dir, | ||||||
|             ), |             ), | ||||||
|             task_stage.diff, |             task_stage.diff, | ||||||
|  | @ -156,9 +156,9 @@ def fix_file(file_parser_config: task.ParserFile, file_parser: result.Parser) -> | ||||||
| 
 | 
 | ||||||
| def fix_diff( | def fix_diff( | ||||||
|     _: task.ParserDiff, |     _: task.ParserDiff, | ||||||
|     diff_parser_config: result.Parser, |     diff_parser: result.Parser, | ||||||
|     task_stage: task.Stage, |     task_stage: task.Stage, | ||||||
|     diff_executor_config: result.Executor, |     executor: result.Executor, | ||||||
|     base_dir: Path, |     base_dir: Path, | ||||||
| ) -> None: | ) -> None: | ||||||
|     valid_cases = ( |     valid_cases = ( | ||||||
|  | @ -169,8 +169,7 @@ def fix_diff( | ||||||
|     stage_cases = [] |     stage_cases = [] | ||||||
|     parser_cases = [] |     parser_cases = [] | ||||||
|     for case, case_stage in valid_cases: |     for case, case_stage in valid_cases: | ||||||
|         stage_cases.append( |         cmd = result.OptionalCmd( | ||||||
|             result.OptionalCmd( |  | ||||||
|             stdin=result.LocalFile( |             stdin=result.LocalFile( | ||||||
|                 src=str(base_dir / (case_stage.in_ or f"{case}.in")) |                 src=str(base_dir / (case_stage.in_ or f"{case}.in")) | ||||||
|             ), |             ), | ||||||
|  | @ -180,9 +179,18 @@ def fix_diff( | ||||||
|             memory_limit=case_stage.limit.mem, |             memory_limit=case_stage.limit.mem, | ||||||
|             proc_limit=50, |             proc_limit=50, | ||||||
|         ) |         ) | ||||||
|         ) |         if cmd.args == executor.with_.default.args: | ||||||
|         parser_cases.append( |             cmd.args = None | ||||||
|             result.DiffCasesConfig( |         if cmd.cpu_limit == executor.with_.default.cpu_limit: | ||||||
|  |             cmd.cpu_limit = None | ||||||
|  |         if cmd.clock_limit == executor.with_.default.clock_limit: | ||||||
|  |             cmd.clock_limit = None | ||||||
|  |         if cmd.memory_limit == executor.with_.default.memory_limit: | ||||||
|  |             cmd.memory_limit = None | ||||||
|  |         if cmd.proc_limit == executor.with_.default.proc_limit: | ||||||
|  |             cmd.proc_limit = None | ||||||
|  |         stage_cases.append(cmd) | ||||||
|  |         parser_case = result.DiffCasesConfig( | ||||||
|             outputs=[ |             outputs=[ | ||||||
|                 result.DiffOutputConfig( |                 result.DiffOutputConfig( | ||||||
|                     score=case_stage.diff.output.score, |                     score=case_stage.diff.output.score, | ||||||
|  | @ -194,6 +202,6 @@ def fix_diff( | ||||||
|                 ) |                 ) | ||||||
|             ] |             ] | ||||||
|         ) |         ) | ||||||
|         ) |         parser_cases.append(parser_case) | ||||||
|     diff_executor_config.with_.cases = stage_cases |     executor.with_.cases = stage_cases | ||||||
|     diff_parser_config.with_ = result.DiffConfig(name="diff", cases=parser_cases) |     diff_parser.with_ = result.DiffConfig(name="diff", cases=parser_cases) | ||||||
|  |  | ||||||
|  | @ -712,17 +712,13 @@ | ||||||
|                                 }, |                                 }, | ||||||
|                                 "cpuLimit": 500000000, |                                 "cpuLimit": 500000000, | ||||||
|                                 "clockLimit": 1000000000, |                                 "clockLimit": 1000000000, | ||||||
|                                 "memoryLimit": 5242880, |                                 "memoryLimit": 5242880 | ||||||
|                                 "procLimit": 50 |  | ||||||
|                             }, |                             }, | ||||||
|                             { |                             { | ||||||
|                                 "stdin": { |                                 "stdin": { | ||||||
|                                     "src": "/home/tt/.config/joj/basic/case1.in" |                                     "src": "/home/tt/.config/joj/basic/case1.in" | ||||||
|                                 }, |                                 }, | ||||||
|                                 "cpuLimit": 1000000000, |                                 "memoryLimit": 5242880 | ||||||
|                                 "clockLimit": 2000000000, |  | ||||||
|                                 "memoryLimit": 5242880, |  | ||||||
|                                 "procLimit": 50 |  | ||||||
|                             } |                             } | ||||||
|                         ] |                         ] | ||||||
|                     } |                     } | ||||||
|  |  | ||||||
|  | @ -66,10 +66,7 @@ | ||||||
|                                 "stdin": { |                                 "stdin": { | ||||||
|                                     "src": "/home/tt/.config/joj/diff/case0.in" |                                     "src": "/home/tt/.config/joj/diff/case0.in" | ||||||
|                                 }, |                                 }, | ||||||
|                                 "cpuLimit": 1000000000, |                                 "memoryLimit": 2097152 | ||||||
|                                 "clockLimit": 2000000000, |  | ||||||
|                                 "memoryLimit": 2097152, |  | ||||||
|                                 "procLimit": 50 |  | ||||||
|                             }, |                             }, | ||||||
|                             { |                             { | ||||||
|                                 "stdin": { |                                 "stdin": { | ||||||
|  | @ -77,8 +74,7 @@ | ||||||
|                                 }, |                                 }, | ||||||
|                                 "cpuLimit": 2000000000, |                                 "cpuLimit": 2000000000, | ||||||
|                                 "clockLimit": 4000000000, |                                 "clockLimit": 4000000000, | ||||||
|                                 "memoryLimit": 4194304, |                                 "memoryLimit": 4194304 | ||||||
|                                 "procLimit": 50 |  | ||||||
|                             } |                             } | ||||||
|                         ] |                         ] | ||||||
|                     } |                     } | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user