Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

How should we use pyjulia in parallel?

Đang mở
#472 5 bình luận 1 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
julia, python
Lĩnh vực
backend

Hướng nghiên cứu

Start by reviewing the decorator and the Parallel(..., mmap_mode="w+") example in the issue, then compare it with the linked test.py example. Decide whether per-process loading and memmapping should be supported or documented, and record the agreed parallel-usage guidance as done.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

I want to propose a discussion about how pyjulia should be used in parallel computing.

I recently found a way that seems rather stable:

  1. we should make sure that code is loaded only once per each process
  2. we should use w+ mode for memmapping

Here is a mini snippet with a decorator that could be added to pyjulia to ensure point 1.
For point 2, instead, joblib has an option in Parallel. Should we may explicit this in the documentation?

def julia_import(module: str, filename: str):
    def decorator(fn):
        def wrapper(*args, **kwargs):
            # including stuffs
            from julia import Main
            if not hasattr(Main, module):
                Main.include(filename)

            return fn(Main, *args, **kwargs)
        return wrapper
    return decorator


@julia_import("MyModule", "lib.jl")
def python_function_using_julia(Main, *args, **kwargs):
    return Main.MyModule.julia_function(*args, **kwargs)

res = Parallel(n_jobs=-1, mmap_mode="w+")(
            delayed(python_function_using_julia)(arr) for arr in tqdm(data))

Example from: https://github.com/00sapo/pyjulia-vs-juliacall/blob/master/test.py

Ngôn ngữ chính
Python
Star
893
Fork
101
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của JuliaPy/pyjulia

Tất cả issue của JuliaPy/pyjulia

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.