Skip to content

Commit

Permalink
Merge pull request #3 from Dead-fisher/master
Browse files Browse the repository at this point in the history
Add unittests. Make it running on localhost
  • Loading branch information
amcadmus authored Jun 7, 2021
2 parents f3afb51 + d1f62d6 commit 5f2a3ef
Show file tree
Hide file tree
Showing 77 changed files with 15,515 additions and 1,272 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: rid python package test

on:
- push
- pull_request

jobs:
Unittest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup package
run: |
wget -q https://github.com/Dead-fisher/rid-kit/releases/download/v1.0/gromacs-dp-rid-0.0.5-float-gpu-Linux-x86_64.sh > download.log
sh gromacs-dp-rid-0.0.5-float-gpu-Linux-x86_64.sh
export PATH="$HOME/gromacs-dp-rid/bin:$PATH"
which python
pip install numpy
pip install sklearn
pip install dpdispatcher
pip install mock
- name: Run unittest
run: |
export PATH="$HOME/gromacs-dp-rid/bin:$PATH"
cd ./tests
python -m unittest
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
__pycache__
*.pyc
.nfs*
rid.egg-info
*.egg
dist
build
.gitignore
rid/old
markdown.py
examples/__pycache__
examples/logs
examples/test*
examples/*.slurm
examples/context.py
examples/dpdisp.log
example_for_plumed
tests/dpdisp.log
tests/scrip_tt.py
tests/__pycache__
rid.egg-info
215 changes: 163 additions & 52 deletions README.md

Large diffs are not rendered by default.

File renamed without changes.
89 changes: 89 additions & 0 deletions examples/jsons/local.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
"_comment": "system resources",


"enhcMD": {
"machine":{
"batch_type": "Shell",
"context_type": "LazyLocalContext",
"local_root": "./",
"remote_root": "./"
},
"resources":{
"queue_name": "shell",
"number_node": 0,
"cpu_per_node": 0,
"gpu_per_node": 1,
"group_size": 1,
"if_cuda_multi_devices": false
}
},

"post_enhc": {
"machine":{
"batch_type": "Shell",
"context_type": "LazyLocalContext",
"local_root": "./",
"remote_root": "./"
},
"resources":{
"queue_name": "shell",
"number_node": 0,
"cpu_per_node": 0,
"gpu_per_node": 0,
"group_size": 1,
"if_cuda_multi_devices": false
}
},

"resMD": {
"machine":{
"batch_type": "Shell",
"context_type": "LazyLocalContext",
"local_root": "./",
"remote_root": "./"
},
"resources":{
"queue_name": "shell",
"number_node": 0,
"cpu_per_node": 0,
"gpu_per_node": 1,
"group_size": 10,
"if_cuda_multi_devices": false
}
},

"cmpf": {
"machine":{
"batch_type": "Shell",
"context_type": "LazyLocalContext",
"local_root": "./",
"remote_root": "./"
},
"resources":{
"queue_name": "shell",
"number_node": 0,
"cpu_per_node": 0,
"gpu_per_node": 0,
"group_size": 1000,
"if_cuda_multi_devices": false
}
},

"train": {
"machine":{
"batch_type": "Shell",
"context_type": "LazyLocalContext",
"local_root": "./",
"remote_root": "./"
},
"resources":{
"queue_name": "shell",
"number_node": 0,
"cpu_per_node": 0,
"gpu_per_node": 1,
"group_size": 1,
"if_cuda_multi_devices": false
}
}
}
89 changes: 89 additions & 0 deletions examples/jsons/machine.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
"_comment": "system resources",


"enhcMD": {
"machine":{
"batch_type": "Slurm",
"context_type": "LazyLocalContext",
"local_root": "./",
"remote_root": "./"
},
"resources":{
"queue_name": "GPU_2080Ti",
"number_node": 1,
"cpu_per_node": 8,
"gpu_per_node": 1,
"group_size": 1,
"if_cuda_multi_devices": false
}
},

"post_enhc": {
"machine":{
"batch_type": "Slurm",
"context_type": "LazyLocalContext",
"local_root": "./",
"remote_root": "./"
},
"resources":{
"queue_name": "GPU_2080Ti",
"number_node": 1,
"cpu_per_node": 4,
"gpu_per_node": 0,
"group_size": 1,
"if_cuda_multi_devices": false
}
},

"resMD": {
"machine":{
"batch_type": "Slurm",
"context_type": "LazyLocalContext",
"local_root": "./",
"remote_root": "./"
},
"resources":{
"queue_name": "GPU_2080Ti",
"number_node": 1,
"cpu_per_node": 8,
"gpu_per_node": 1,
"group_size": 10,
"if_cuda_multi_devices": false
}
},

"cmpf": {
"machine":{
"batch_type": "Shell",
"context_type": "LazyLocalContext",
"local_root": "./",
"remote_root": "./"
},
"resources":{
"queue_name": null,
"number_node": null,
"cpu_per_node": null,
"gpu_per_node": 0,
"group_size": 1000,
"if_cuda_multi_devices": false
}
},

"train": {
"machine":{
"batch_type": "Slurm",
"context_type": "LazyLocalContext",
"local_root": "./",
"remote_root": "./"
},
"resources":{
"queue_name": "GPU_2080Ti",
"number_node": 1,
"cpu_per_node": 8,
"gpu_per_node": 1,
"group_size": 1,
"if_cuda_multi_devices": false
}
}
}
4 changes: 3 additions & 1 deletion examples/rid.json → examples/jsons/rid.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"bias_frame_freq": 25,
"sel_threshold": 2,
"cluster_threshold": 1.5,
"num_of_cluster_threshhold": 8,
"num_of_cluster_threshold": 8,
"max_sel": 30,
"bias_dt": 0.002,
"bias_temperature": 300,
Expand Down Expand Up @@ -59,6 +59,8 @@
"res_decay_steps": 120,
"res_decay_rate": 0.96,
"train_thread": 8,

"cleanup": false,

"_comment": "That's all"
}
Expand Down
46 changes: 0 additions & 46 deletions examples/machine.json

This file was deleted.

3 changes: 1 addition & 2 deletions examples/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ def main(out_dir, mol_dir, rid_json, machine_json, cv_file, init_model, record_n
fp = open(rid_json, 'r')
jdata = json.load(fp)
fp.close()
# record_file = out_dir + record_name
record_file = os.path.join(out_dir, record_name)
checkpoint = get_checkpoint(record_file)
max_tasks = 10
Expand All @@ -21,7 +20,7 @@ def main(out_dir, mol_dir, rid_json, machine_json, cv_file, init_model, record_n

if sum(checkpoint) < 0:
print("prepare gen_rid")
gen_rid.gen_rid (out_dir, mol_dir, rid_json)
gen_rid (out_dir, mol_dir, rid_json)

for iter_idx in range(iter_numb):
if iter_idx > 0 :
Expand Down
Loading

0 comments on commit 5f2a3ef

Please sign in to comment.