exapde / Exasim

Exasim: Generating Discontinuous Galerkin Codes For Extreme Scalable Simulations
MIT License
65 stars 19 forks source link

Julia and Python apps fail GPU compilation #5

Open rloekvh opened 3 years ago

rloekvh commented 3 years ago

There are a few issues compiling GPU code with Julia or Python apps.

  1. Compilation will fail with 4 errors of the form
    gpuFbou.cu(32): error: identifier "gpuFbou1" is undefined

In the generated file gpuUbou.cu in the app folder, the function is called kernelgpuFbou1, not gpuFbou1. These functions are generated in Gencode/gencodeface files. They are generated correctly in the matlab version, but not in Julia or Python for versions 0.1-0.3

  1. After that, an error appears that opuApp.a does not exist. This is due to missing lines in compilecode.jl and compilecode.py. Line 110-113 in the Julia code is
    elseif app.platform == "gpu"
    run(string2cmd(compilerstr[3]));
    run(string2cmd(compilerstr[4]));
    if app.mpiprocs==1
        run(string2cmd(compilerstr[7]));
    else
        run(string2cmd(compilerstr[8]));
    end
    end

    while the same code block in matlab is

    elseif app.platform == "gpu"
    eval(char("!" + compilerstr{1}));
    eval(char("!" + compilerstr{2}));       
    eval(char("!" + compilerstr{3}));
    eval(char("!" + compilerstr{4}));
    if app.mpiprocs==1
        eval(char("!" + compilerstr{7}));
    else
        eval(char("!" + compilerstr{8}));
    end
    end

    The Julia code also needs to run compilestr(1) and compilestr(2). Same holds for Python