Skip to content
Merged
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
84 changes: 84 additions & 0 deletions modules/mp/apps/ansys/26.1.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
whatis("ANSYS")
family("ansys")
extensions("fluent/26R1, ansys/26R1, mapdl/26R1, autodyn/26R1, cfx5/26R1, ansysedt/26R1, siwave/26R1, polyflow/26R1")

help([[Name: Ansys
Version: 26R1
Website: https://www.ansys.com/
License Owners : SMU?

Ansys Fluent, Mechanical, Workbench
]])

local container_name=os.getenv("APPTAINER_CONTAINER") or ""
local cuda=os.getenv("CUDA_VISIBLE_DEVICES") or ""
local container_path="/hpc/m3/containers/remote_desktop/remote_desktop_1.3.0.sif"
local flags=""
if (cuda ~= "") then
container_path="/hpc/m3/containers/remote_desktop/remote_desktop_1.3.0_gpu.sif"
flags=" --nv "
end
setenv("CONTAINER_IMAGE", container_path)
setenv("CONTAINER_FLAGS", flags)
setenv("QTWEBENGINE_DISABLE_SANDBOX", "1")

source_sh("bash", "/hpc/mp/apps/ansys/26R1/additive_server_helper.sh")


-- Ansys needs GUI stuff not installed on compute nodes, so this install
-- currently only runs in the remote desktop container. For users
-- already on the remote desktop, there's no issue. However, we'll
-- provide shell functions for users trying to run from a normal term.

if (container_name == "") then
-- make shell functions that run inside a container
setenv("APPTAINERENV_GALLIUM_DRIVER","softpipe")
always_load('apptainer')

function build_command(app, app_path)
local app_command = pathJoin(app_path, app)
local cmd = 'apptainer exec ' .. flags .. container_path .. ' ' .. app_command
local sh_ending = ' "$@"'
local csh_ending = ' $*'
local sh_cmd = cmd .. sh_ending
local csh_cmd = cmd .. csh_ending
set_shell_function(app, sh_cmd, csh_cmd)
end

build_command("runwb2", "/hpc/mp/apps/ansys/26R1/ansys_inc/v261/Framework/bin/Linux64/")
build_command("fluent", "/hpc/mp/apps/ansys/26R1/ansys_inc/v261/fluent/bin")
build_command("mapdl", "/hpc/mp/apps/ansys/26R1/ansys_inc/v261/ansys/bin/")
build_command("ansys261", "/hpc/mp/apps/ansys/26R1/ansys_inc/v261/ansys/bin/")
build_command("autodyn", "/hpc/mp/apps/ansys/26R1/ansys_inc/v261/autodyn/bin/")
build_command("cfx5", "/hpc/mp/apps/ansys/26R1/ansys_inc/v261/CFD-Post/bin/")
build_command("ansysedt", "/hpc/mp/apps/ansys/26R1/ansys_inc/v261/AnsysEM/")
build_command("siwave", "/hpc/mp/apps/ansys/26R1/ansys_inc/v261/AnsysEM/")
build_command("polyflow", "/hpc/mp/apps/ansys/26R1/ansys_inc/v261/polyflow/bin/")
build_command("additiveserver", "/hpc/mp/apps/ansys/26R1/ansys_inc/v261/Additive/additiveserver")

else

-- already in a container
-- note: this does not check for the "correct" container so this might
-- not work


append_path("PATH", "/hpc/mp/apps/ansys/26R1/ansys_inc/v261/Framework/bin/Linux64/")
append_path("PATH", "/hpc/mp/apps/ansys/26R1/ansys_inc/v261/fluent/bin/")
append_path("PATH", "/hpc/mp/apps/ansys/26R1/ansys_inc/v261/ansys/bin/")
append_path("PATH", "/hpc/mp/apps/ansys/26R1/ansys_inc/v261/autodyn/bin/")
append_path("PATH", "/hpc/mp/apps/ansys/26R1/ansys_inc/v261/CFD-Post/bin/")
append_path("PATH", "/hpc/mp/apps/ansys/26R1/ansys_inc/v261/AnsysEM/")
append_path("PATH", "/hpc/mp/apps/ansys/26R1/ansys_inc/v261/polyflow/bin/")
append_path("PATH", "/hpc/mp/apps/ansys/26R1/ansys_inc/v261/Additive/additiveserver")

setenv("GALLIUM_DRIVER","softpipe")
end

-- slurm doesn't work work in the almalinux container
-- this breaks ansys because it tries to call slurm commands internally
if string.find(container_name, "almalinux") then

LmodMessage("\nAnsys may not work as expected in AlmaLinux.\nYou may need to do the following: \n\nunset $(compgen -v | grep \"SLURM\") \nansysedt -local \n\nInside Ansys make sure the number of cores and gpus in the HPC Options menu of the Simulation tab match your job request.\n")

end