Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ jobs:
os:
- ubuntu-latest
arch:
- x64
- x86
- x64

steps:
- uses: actions/checkout@v2
Expand All @@ -43,6 +43,11 @@ jobs:
- name: Run tests
run: |
export RANK=0
export LOCAL_RANK=0
export WORLD_SIZE=1
export MASTER_ADDR=localhost
export MASTER_PORT=12345
export PYTHONPATH=MCintegration
pytest --cov --cov-report=xml --ignore=examples
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
import torch.distributed as dist
import torch.multiprocessing as mp
import os
import MCintegration
from MCintegration import MonteCarlo, MarkovChainMonteCarlo
from integrators import MonteCarlo, MarkovChainMonteCarlo


def init_process(rank, world_size, fn, backend="gloo"):
Expand Down Expand Up @@ -53,7 +52,6 @@ def two_integrands(x, f):
# Only rank 0 prints the result
print("MarkovChainMonteCarlo Result:", mcmc_result)


if __name__ == "__main__":
def test_mcmc():
world_size = 8 # Number of processes to launch
mp.spawn(init_process, args=(world_size, run_mcmc), nprocs=world_size, join=True)
4 changes: 2 additions & 2 deletions examples/mc_multigpu_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
)


backend = "nccl"
# backend = "gloo"
# backend = "nccl"
backend = "gloo"
# set_seed(42)
setup(backend=backend)
device = get_device()
Expand Down
Loading