Skip to content

Commit

Permalink
Merge pull request #206 from felix5572/master
Browse files Browse the repository at this point in the history
add field abs_work_base to avoid submission hash  conflict
  • Loading branch information
felix5572 committed Jul 12, 2022
2 parents be02afa + 9d30808 commit e1ae97f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
5 changes: 4 additions & 1 deletion dpdispatcher/submission.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

# %%
import time,random,uuid,json,copy
import time,random,uuid,json,copy,os
from dargs.dargs import Argument, Variant
from dpdispatcher.JobStatus import JobStatus
from dpdispatcher import dlog
Expand Down Expand Up @@ -43,6 +43,8 @@ def __init__(self,
# self.submission_list = submission_list
self.local_root = None
self.work_base = work_base
self._abs_work_base = os.path.abspath(work_base)

self.resources = resources
self.forward_common_files= forward_common_files
self.backward_common_files = backward_common_files
Expand Down Expand Up @@ -114,6 +116,7 @@ def serialize(self, if_static=False):
# submission_dict['local_root'] = self.local_root

submission_dict['work_base'] = self.work_base
submission_dict['_abs_work_base'] = self._abs_work_base
machine = getattr(self, 'machine', None)
if machine is None:
submission_dict['machine'] = {}
Expand Down
2 changes: 1 addition & 1 deletion tests/devel_test_ali_ehpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
# pbs = SampleClass.get_sample_pbs_local_context()
# slurm = SampleClass.get_sample_slurm_local_context()

with open('jsons/compute_ali_ehpc.json', 'r') as f:
with open('jsons/machine_ali_ehpc.json', 'r') as f:
compute_dict = json.load(f)

machine = Machine.load_from_dict(compute_dict['machine'])
Expand Down
10 changes: 5 additions & 5 deletions tests/jsons/machine_ali_ehpc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
"batch_type": "PBS",
"context_type": "SSHContext",
"local_root": "./test_context_dir",
"remote_root": "/home/fengbo/work_path_dpdispatcher_test",
"remote_root": "/home/yuanfengbo/work_path_dpdispatcher_test",
"remote_profile": {
"hostname": "39.106.84.25",
"username": "fengbo"
"hostname": "39.103.186.143",
"username": "yuanfengbo"
}
},
"resources":{
"number_node": 1,
"cpu_per_node": 4,
"cpu_per_node": 8,
"gpu_per_node": 1,
"queue_name": "T4_4_15",
"queue_name": "V100_8_32",
"group_size": 5
}
}

0 comments on commit e1ae97f

Please sign in to comment.