siesta-project / flos

Interfacing SIESTA to Lua scripts using the flook code
https://siesta-project.github.io/flos/index.html
MIT License
6 stars 4 forks source link

run lua on single cpu #16

Closed mgoonde closed 1 year ago

mgoonde commented 1 year ago

Hello, i do not have much experience with lua, so i might be asking a stupid question here. If i run a simple lua script that just prints "hello", and run siesta with mpirun -np N, the printed "hello" appears N times. Looking around the examples of siesta.lua scripts i haven't found any mpi-related directives, so i am slightly confused. Is there any simple way to limit the lua script to a single cpu?

zerothi commented 1 year ago

In siesta there are a couple of paths:

siesta:IOprint("only the primary IO rank will write out")
-- or
if siesta.Node == 0 then
   print("This will only be printed by rank 0")
end

this should work. I'll close, thanks for asking!