Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: Split multi.jl into multiple files. Wrap parallel into its own module. #19056

Closed
wants to merge 1 commit into from
Closed
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
90 changes: 46 additions & 44 deletions base/exports.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export
Markdown,
Threads,
Iterators,
Parallel,

# Types
AbstractChannel,
Expand Down Expand Up @@ -63,7 +64,6 @@ export
Factorization,
FileMonitor,
FloatRange,
Future,
Hermitian,
UniformScaling,
InsertionSort,
Expand All @@ -88,7 +88,6 @@ export
Rational,
Regex,
RegexMatch,
RemoteChannel,
RepString,
RevString,
RoundFromZero,
Expand Down Expand Up @@ -123,7 +122,6 @@ export
Vector,
VersionNumber,
WeakKeyDict,
WorkerConfig,

# Ccall types
Cchar,
Expand Down Expand Up @@ -162,7 +160,6 @@ export
NullException,
ParseError,
ProcessExitedException,
RemoteException,
SystemError,
TypeError,
AssertionError,
Expand Down Expand Up @@ -995,6 +992,15 @@ export
unlock,
yield,
yieldto,
wait,
timedwait,
asyncmap,

# channels
take!,
put!,
isready,
fetch,

# time
sleep,
Expand Down Expand Up @@ -1176,37 +1182,6 @@ export
TCPSocket,
UDPSocket,

# multiprocessing
addprocs,
asyncmap,
CachingPool,
clear!,
ClusterManager,
default_worker_pool,
fetch,
init_worker,
interrupt,
isready,
launch,
manage,
myid,
nprocs,
nworkers,
pmap,
procs,
put!,
remote,
remotecall,
remotecall_fetch,
remotecall_wait,
remote_do,
rmprocs,
take!,
timedwait,
wait,
workers,
WorkerPool,

# multimedia I/O
Display,
display,
Expand Down Expand Up @@ -1382,14 +1357,6 @@ export
@task,
@threadcall,

# multiprocessing
@spawn,
@spawnat,
@fetch,
@fetchfrom,
@everywhere,
@parallel,

# metaprogramming utilities
@generated,
@gensym,
Expand Down Expand Up @@ -1430,4 +1397,39 @@ export
symperm,
rowvals,
nzrange,
nnz
nnz,

# Parallel module re-exports
@spawn,
@spawnat,
@fetch,
@fetchfrom,
@everywhere,
@parallel,

addprocs,
CachingPool,
clear!,
ClusterManager,
default_worker_pool,
init_worker,
interrupt,
launch,
manage,
myid,
nprocs,
nworkers,
pmap,
procs,
remote,
remotecall,
remotecall_fetch,
remotecall_wait,
remote_do,
rmprocs,
workers,
WorkerPool,
RemoteChannel,
Future,
WorkerConfig,
RemoteException
41 changes: 0 additions & 41 deletions base/initdefs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,32 +45,6 @@ function init_load_path()
#push!(LOAD_CACHE_PATH, abspath(JULIA_HOME, "..", "lib", "julia")) #TODO: add a builtin location?
end

# initialize the local proc network address / port
function init_bind_addr()
opts = JLOptions()
if opts.bindto != C_NULL
bind_to = split(unsafe_string(opts.bindto), ":")
bind_addr = string(parse(IPAddr, bind_to[1]))
if length(bind_to) > 1
bind_port = parse(Int,bind_to[2])
else
bind_port = 0
end
else
bind_port = 0
try
bind_addr = string(getipaddr())
catch
# All networking is unavailable, initialize bind_addr to the loopback address
# Will cause an exception to be raised only when used.
bind_addr = "127.0.0.1"
end
end
global LPROC
LPROC.bind_addr = bind_addr
LPROC.bind_port = UInt16(bind_port)
end

function early_init()
global const JULIA_HOME = ccall(:jl_get_julia_home, Any, ())
# make sure OpenBLAS does not set CPU affinity (#1070, #9639)
Expand All @@ -89,21 +63,6 @@ A string containing the full path to the directory containing the `julia` execut
"""
:JULIA_HOME

function init_parallel()
start_gc_msgs_task()
atexit(terminate_all_workers)

init_bind_addr()

# start in "head node" mode, if worker, will override later.
global PGRP
global LPROC
LPROC.id = 1
cluster_cookie(randstring(HDR_COOKIE_LEN))
assert(isempty(PGRP.workers))
register_worker(LPROC)
end

const atexit_hooks = []

atexit(f::Function) = (unshift!(atexit_hooks, f); nothing)
Expand Down
Loading