How to access task resources info from task script?

Is there any built in tool or environment variable(s) , which can provide in the tasks resources info such as a) hostname it is running b) queue name, wallclock, memory etc d) topology used by mpi program
For example, from another sequencer, nodeinfo tool provides:

node.wallclock=120  ..wall clock in minutes
node.cpu=37x46x2  ...topology, 37*46 ...number of MPI tiles, 2 is openmp threads
node.machine=cluster_name
node.queue=development

I need to know these info inside task script....

-also looking for a small example to run mpi program [flow.cylc, fortran code using openmp/mpi) with cylc.

a) hostname it is running

$HOSTNAME


b) queue name, wallclock, memory etc

This information isn’t necessarily available to Cylc (which only knows the directives used to submit the job), however, your batch system (e.g, pbs, slurm, etc) may provide access to this information.

Note, the directives Cylc was configured to use are written to the top of the job file for inspection.


d) topology used by mpi program

Not that I’m aware of?


also looking for a small example to run mpi program [flow.cylc, fortran code using openmp/mpi) with cylc.

Cylc is just automating the writing and tracking of your job scripts. However you would run the MPI job with your batch system normally, provide those scripts, directives and environment variables to Cylc and it will work the same.


Cheers,
O

1 Like

According to Google:

The nodeinfo command on high-performance computing (HPC) clusters running Slurm is a custom convenience script or alias built around the native sinfo

So it just queries the batch system (Slurm) as @oliver.sanders suggested.

If you have nodeinfo (or sinfo) on your system, you can use it just the same in Cylc task scripting.

You could also store the details as environment variables yourself in the task definition. There was similar discussion in this thread Cylc 8.6.2 how to grab execution time limit as variable