Skip to content

Commit 1b8bbd8

Browse files
committed
Reindent, removing all tab characters
1 parent 1f7dacf commit 1b8bbd8

File tree

2 files changed

+25
-31
lines changed

2 files changed

+25
-31
lines changed

src/MPI.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ module MPI
55
using Compat
66

77
@windows_only begin
8-
const depfile = "win_mpiconstants.jl"
8+
const depfile = "win_mpiconstants.jl"
99
end
1010

1111
@unix_only begin
12-
const depfile = joinpath(dirname(@__FILE__), "..", "deps", "src", "compile-time.jl")
13-
isfile(depfile) || error("MPI not properly installed. Please run Pkg.build(\"MPI\")")
12+
const depfile = joinpath(dirname(@__FILE__), "..", "deps", "src", "compile-time.jl")
13+
isfile(depfile) || error("MPI not properly installed. Please run Pkg.build(\"MPI\")")
1414
end
1515

1616
include(depfile)
@@ -20,8 +20,9 @@ include("cman.jl")
2020

2121
function __init__()
2222
@unix_only begin
23-
# need to open libmpi with RTLD_GLOBAL flag for Linux, before any ccall
24-
# cannot use RTLD_DEEPBIND; this leads to segfaults at least on Ubuntu 15.10
23+
# need to open libmpi with RTLD_GLOBAL flag for Linux, before
24+
# any ccall cannot use RTLD_DEEPBIND; this leads to segfaults
25+
# at least on Ubuntu 15.10
2526
@eval const libmpi_handle =
2627
Libdl.dlopen(libmpi, Libdl.RTLD_LAZY | Libdl.RTLD_GLOBAL)
2728

@@ -57,7 +58,6 @@ function __init__()
5758
Float64 => MPI_REAL8,
5859
Complex64 => MPI_COMPLEX8,
5960
Complex128 => MPI_COMPLEX16)
60-
6161
end
6262

6363
end

src/mpi-base.jl

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,12 @@ typealias MPIDatatype Union{Char,
33
UInt64,
44
Float32, Float64, Complex64, Complex128}
55

6-
# Define a function mpitype(T) that returns the MPI datatype code
7-
# for a given type T. The dictonary is defined in __init__ so
8-
# the module can be precompiled
6+
# Define a function mpitype(T) that returns the MPI datatype code for
7+
# a given type T. The dictonary is defined in __init__ so the module
8+
# can be precompiled
99

1010
# accessor function for getting MPI datatypes
11-
# use a function in case more behavior is needed later
12-
function mpitype{T}(::Type{T})
13-
return mpitype_dict[T]
14-
end
11+
mpitype{T}(::Type{T}) = mpitype_dict[T]
1512

1613
type Comm
1714
val::Cint
@@ -170,7 +167,6 @@ function type_create(T::DataType)
170167
return nothing
171168
end
172169

173-
174170
# Point-to-point communication
175171

176172
function Probe(src::Integer, tag::Integer, comm::Comm)
@@ -468,7 +464,7 @@ function Barrier(comm::Comm)
468464
end
469465

470466
function Bcast!{T}(buffer::Union{Ptr{T},Array{T}}, count::Integer,
471-
root::Integer, comm::Comm)
467+
root::Integer, comm::Comm)
472468
ccall(MPI_BCAST, Void,
473469
(Ptr{T}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}),
474470
buffer, &count, &mpitype(T), &root, &comm.val, &0)
@@ -506,7 +502,7 @@ function bcast(obj, root::Integer, comm::Comm)
506502
end
507503

508504
function Reduce{T}(sendbuf::Union{Ptr{T},Array{T}}, count::Integer,
509-
op::Op, root::Integer, comm::Comm)
505+
op::Op, root::Integer, comm::Comm)
510506
isroot = Comm_rank(comm) == root
511507
recvbuf = Array(T, isroot ? count : 0)
512508
ccall(MPI_REDUCE, Void,
@@ -517,8 +513,7 @@ function Reduce{T}(sendbuf::Union{Ptr{T},Array{T}}, count::Integer,
517513
isroot ? recvbuf : nothing
518514
end
519515

520-
function Reduce{T}(sendbuf::Array{T}, op::Op, root::Integer,
521-
comm::Comm)
516+
function Reduce{T}(sendbuf::Array{T}, op::Op, root::Integer, comm::Comm)
522517
Reduce(sendbuf, length(sendbuf), op, root, comm)
523518
end
524519

@@ -530,7 +525,7 @@ function Reduce{T}(object::T, op::Op, root::Integer, comm::Comm)
530525
end
531526

532527
function Scatter{T}(sendbuf::Union{Ptr{T},Array{T}},
533-
count::Integer, root::Integer, comm::Comm)
528+
count::Integer, root::Integer, comm::Comm)
534529
recvbuf = Array(T, count)
535530
ccall(MPI_SCATTER, Void,
536531
(Ptr{T}, Ptr{Cint}, Ptr{Cint}, Ptr{T}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}),
@@ -539,8 +534,8 @@ function Scatter{T}(sendbuf::Union{Ptr{T},Array{T}},
539534
end
540535

541536
function Scatterv{T}(sendbuf::Union{Ptr{T},Array{T}},
542-
counts::Vector{Cint}, root::Integer,
543-
comm::Comm)
537+
counts::Vector{Cint}, root::Integer,
538+
comm::Comm)
544539
recvbuf = Array(T, counts[Comm_rank(comm) + 1])
545540
recvcnt = counts[Comm_rank(comm) + 1]
546541
disps = cumsum(counts) - counts
@@ -551,7 +546,7 @@ function Scatterv{T}(sendbuf::Union{Ptr{T},Array{T}},
551546
end
552547

553548
function Gather{T}(sendbuf::Union{Ptr{T},Array{T}}, count::Integer,
554-
root::Integer, comm::Comm)
549+
root::Integer, comm::Comm)
555550
isroot = Comm_rank(comm) == root
556551
recvbuf = Array(T, isroot ? Comm_size(comm) * count : 0)
557552
ccall(MPI_GATHER, Void,
@@ -560,8 +555,7 @@ function Gather{T}(sendbuf::Union{Ptr{T},Array{T}}, count::Integer,
560555
isroot ? recvbuf : nothing
561556
end
562557

563-
function Gather{T}(sendbuf::Array{T}, root::Integer,
564-
comm::Comm)
558+
function Gather{T}(sendbuf::Array{T}, root::Integer, comm::Comm)
565559
Gather(sendbuf, length(sendbuf), root, comm)
566560
end
567561

@@ -573,7 +567,7 @@ function Gather{T}(object::T, root::Integer, comm::Comm)
573567
end
574568

575569
function Allgather{T}(sendbuf::Union{Ptr{T},Array{T}}, count::Integer,
576-
comm::Comm)
570+
comm::Comm)
577571
recvbuf = Array(T, Comm_size(comm) * count)
578572
ccall(MPI_ALLGATHER, Void,
579573
(Ptr{T}, Ptr{Cint}, Ptr{Cint}, Ptr{T}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}),
@@ -592,7 +586,7 @@ function Allgather{T}(object::T, comm::Comm)
592586
end
593587

594588
function Gatherv{T}(sendbuf::Union{Ptr{T},Array{T}}, counts::Vector{Cint},
595-
root::Integer, comm::Comm)
589+
root::Integer, comm::Comm)
596590
isroot = Comm_rank(comm) == root
597591
displs = cumsum(counts) - counts
598592
sendcnt = counts[Comm_rank(comm) + 1]
@@ -604,7 +598,7 @@ function Gatherv{T}(sendbuf::Union{Ptr{T},Array{T}}, counts::Vector{Cint},
604598
end
605599

606600
function Allgatherv{T}(sendbuf::Union{Ptr{T},Array{T}}, counts::Vector{Cint},
607-
comm::Comm)
601+
comm::Comm)
608602
displs = cumsum(counts) - counts
609603
sendcnt = counts[Comm_rank(comm) + 1]
610604
recvbuf = Array(T, sum(counts))
@@ -615,7 +609,7 @@ function Allgatherv{T}(sendbuf::Union{Ptr{T},Array{T}}, counts::Vector{Cint},
615609
end
616610

617611
function Alltoall{T}(sendbuf::Union{Ptr{T},Array{T}}, count::Integer,
618-
comm::Comm)
612+
comm::Comm)
619613
recvbuf = Array(T, Comm_size(comm)*count)
620614
ccall(MPI_ALLTOALL, Void,
621615
(Ptr{T}, Ptr{Cint}, Ptr{Cint}, Ptr{T}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}),
@@ -624,7 +618,7 @@ function Alltoall{T}(sendbuf::Union{Ptr{T},Array{T}}, count::Integer,
624618
end
625619

626620
function Alltoallv{T}(sendbuf::Union{Ptr{T},Array{T}}, scounts::Vector{Cint},
627-
rcounts::Vector{Cint}, comm::Comm)
621+
rcounts::Vector{Cint}, comm::Comm)
628622
recvbuf = Array(T, sum(rcounts))
629623
sdispls = cumsum(scounts) - scounts
630624
rdispls = cumsum(rcounts) - rcounts
@@ -635,7 +629,7 @@ function Alltoallv{T}(sendbuf::Union{Ptr{T},Array{T}}, scounts::Vector{Cint},
635629
end
636630

637631
function Scan{T}(sendbuf::Union{Ptr{T},Array{T}}, count::Integer,
638-
op::Op, comm::Comm)
632+
op::Op, comm::Comm)
639633
recvbuf = Array(T, count)
640634
ccall(MPI_SCAN, Void,
641635
(Ptr{T}, Ptr{T}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}),
@@ -649,7 +643,7 @@ function Scan{T}(object::T, op::Op, comm::Comm)
649643
end
650644

651645
function ExScan{T}(sendbuf::Union{Ptr{T},Array{T}}, count::Integer,
652-
op::Op, comm::Comm)
646+
op::Op, comm::Comm)
653647
recvbuf = Array(T, count)
654648
ccall(MPI_EXSCAN, Void,
655649
(Ptr{T}, Ptr{T}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}),

0 commit comments

Comments
 (0)