I don't know what to do with the error when loading the file.

Asked 2 years ago, Updated 2 years ago, 106 views

Error loading file from command prompt.

include("c:\\Users\\name\\desktop\\test.jl")
ERROR: LoadError: syntax: invalid character "."
Stacktrace:
 [1] include at.\boot.jl:317 [inlined]
 [2] include_relative(::Module,::String) at.\loading.jl:1044
 [3] include(::Module,::String) at.\sysimg.jl:29
 [4] include(::String) at.\client.jl:392
 [5] top-level scope at none:0
in expression starting at c:\Users\name\desktop\test.jl:71

I don't know where this character "." refers, and the code I read works fine with other editors.The editor for loading is done in Notepad.
Notepad (test.jl) Contents

function run(itr)
    n = 27
    c0 = zeros(Int, nthreads())
    c1 = zeros(Int, nthreads())
    c2 = zeros(Int, nthreads())
    c3 = zeros(Int, nthreads())
    c4 = zeros(Int, nthreads())
    c5 = zeros(Int, nthreads())
    @ threads for in 1:itr
        walk=zeros(Int8,n,n,n)
        walk[1,1,1] = 1
        fort in 0—3600
            next_walk=zero(Int8,n,n,n)
            number = land (UnitRange {Int8} (1:6))
            if t == 0
                c0[threadid()]+=1
            else
                for x = 1:n, y = 1:n, z = 1:n
                    x1 = ((x-1+(n-1)%n)+1
                    x2 = ((x+1+(n-1)%n)+1
                    y1 = ((y-1+(n-1)%n)+1
                    y2 = ((y+1+(n-1)%n)+1
                    z1 = ((z-1+(n-1)%n)+1 
                    z2=((z+1+(n-1)%n)+1
                    if Stage [x,y,z] == 0
                        continue
                    else
                        if walk[x,y,z] == 0
                            continue
                        else
                            if number == 1
                                if Stage [x2,y,z] == 1
                                    next_walk[x2,y,z] = walk[x,y,z]
                                else
                                    next_walk[x,y,z] = walk[x,y,z]
                                end
                            elseif number == 2
                                if Stage [x,y2,z] == 1
                                    next_walk[x,y2,z] = walk[x,y,z]
                                else
                                    next_walk[x,y,z] = walk[x,y,z]
                                end
                            elseif number == 3
                                if Stage [x,y,z2] == 1
                                    next_walk[x,y,z2] = walk[x,y,z]
                                else
                                    next_walk[x,y,z] = walk[x,y,z]
                                end
                            elseif number == 4
                                if Stage [x1,y,z] == 1
                                    next_walk[x1,y,z] = walk[x,y,z]
                                else
                                    next_walk[x,y,z] = walk[x,y,z]
                                end
                            elseif number == 5
                                if Stage [x,y1,z] == 1
                                    next_walk[x,y1,z] = walk[x,y,z]
                                else
                                    next_walk[x,y,z] = walk[x,y,z]
                                end
                            elseif number == 6
                                if Stage [x,y,z1] == 1
                                    next_walk[x,y,z1] = walk[x,y,z]
                                else
                                    next_walk[x,y,z] = walk[x,y,z]
                                end
                            end
                        end
                    end
                end
              walk=copy(next_walk)
            # println(t,walk, "\n")
            if == 2 & walk [1,1,1] == 1
                c1[threadid()]+=1
            else == 4 & walk [1,1,1] ==1
                c2[threadid()]+=1
            select==6&walk[1,1,1]==1
                c3[threadid()]+=1
            else == 16 & walk [1,1,1] == 1
                c4[threadid()]+=1
            else == 36 & walk [1,1,1] == 1
                c5[threadid()]+=1
            else
                continue
            end
            end
        end
    end
    println("t=0:", sum(c0), "\n", "t=2:", sum(c1), "\n", "t=4:", sum(c2), "\n", "t=6:", sum(c3))
    println("t=16:", sum(c4), "\n", "t=36:", cum(c5))
end

julia

2022-09-30 21:36

1 Answers

In addition to the program above,
beginning using Base.Threads()
using Benchmark.Tools
It was solved by simply adding and so on.

on the command prompt before running. set(export for mac) JULIA_NUM_THREADS=Number of threads
and then > Julia→>using IJulia>notebook()


2022-09-30 21:36

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.