Notes / System Reminders

Processes, CPUs and parallelization

A program or process running on a machine will not use automatically all available cores/CPUs. For a program can leverage multiple cores/CPUs, it must:

  • have been designed to be able to perform different tasks in parallel,

  • explicitly run these tasks on different threads or sub-processes in order to be executed on several cores/CPUs.

NB: Many specific frameworks (written in Java, Lua, R...) support this parallelization (but not always) and the make it transparent to the user. Be careful, however, to configure (if possible) the number of threads or workers spawned by the framework and match the number of CPUs you reserve so to optimize the total execution time.

Notes on Running a Program on a Compute Server

The execution of a program on a calculation server is done in a way non-interactive:

  • No Input: User has no option to input anything or to respond to a request from the program (not input, standard input disabled). This should run from totally autonomous way.
  • Screen output: the display returned by the program (output, output standard). is accumulated in a text file (whose name and the location are configurable in the batch) and will be accessible only after the execution of the job is finished.

Environment Variables

Retrieving the value of an environment variable "VAR" in ...

Shell/Bash/[T]CSH: $VAR
Python: os.environ.get('VAR') [OU] os.getenv('VAR')
Java: System.getenv("VAR")
Lua os.getenv(VAR)