(git:34ef472)
machine Module Reference

Machine interface based on Fortran 2003 and POSIX. More...

Functions/Subroutines

subroutine, public m_flush (lunit)
 flushes units if the &GLOBAL flag is set accordingly More...
 
real(kind=dp) function, public m_walltime ()
 returns time from a real-time clock, protected against rolling early/easily More...
 
subroutine, public m_cpuinfo (model_name)
 reads /proc/cpuinfo if it exists (i.e. Linux) to return relevant info More...
 
pure integer function, public m_cpuid ()
 Target architecture or instruction set extension according to CPU-check at runtime. More...
 
character(len=default_string_length) function, pointer, public m_cpuid_name (cpuid)
 Determine name of target architecture for a given CPUID. More...
 
real(kind=dp) function, public m_energy ()
 returns the energy used since some time in the past. The precise meaning depends on the infrastructure is available. In the cray_pm_energy case, this is the energy used by the node in kJ. More...
 
subroutine, public m_datum (cal_date)
 returns a datum in human readable format using a standard Fortran routine More...
 
subroutine, public m_abort ()
 Can be used to get a nice core. More...
 
integer function, public m_procrun (pid)
 Returns if a process is running on the local machine 1 if yes and 0 if not. More...
 
subroutine, public m_memory (mem)
 Returns the total amount of memory [bytes] in use, if known, zero otherwise. More...
 
subroutine, public m_memory_details (MemTotal, MemFree, Buffers, Cached, Slab, SReclaimable, MemLikelyFree)
 get more detailed memory info, all units are bytes. the only 'useful' option is MemLikelyFree which is an estimate of remaining memory assumed to give info like /proc/meminfo while MeMLikelyFree is the amount of memory we're likely to be able to allocate, but not necessarily in one chunk zero means not available... More...
 
subroutine, public m_hostnm (hname)
 ... More...
 
subroutine, public m_getcwd (curdir)
 ... More...
 
subroutine, public m_chdir (dir, ierror)
 ... More...
 
subroutine, public m_getpid (pid)
 ... More...
 
subroutine, public m_mov (source, TARGET)
 ... More...
 
subroutine, public m_getlog (user)
 ... More...
 
subroutine, public m_get_omp_stacksize (omp_stacksize)
 Retrieve environment variable OMP_STACKSIZE. More...
 

Variables

integer, parameter, public default_output_unit = output_unit
 
integer, parameter, public default_input_unit = input_unit
 
integer, parameter, public machine_cpu_generic = CP_MACHINE_CPU_GENERIC
 
integer, parameter, public machine_x86_sse4 = CP_MACHINE_X86_SSE4
 
integer, parameter, public machine_x86_avx = CP_MACHINE_X86_AVX
 
integer, parameter, public machine_x86_avx2 = CP_MACHINE_X86_AVX2
 
integer, parameter, public machine_x86_avx512 = CP_MACHINE_X86_AVX512
 
integer, parameter, public machine_x86 = MACHINE_X86_AVX512
 
logical, save, public flush_should_flush = .TRUE.
 
integer(kind=int_8), save, public m_memory_max = 0
 

Detailed Description

Machine interface based on Fortran 2003 and POSIX.

History
JGH (05.07.2001) : added G95 interface
  • m_flush added (12.06.2002,MK)
  • Missing print_memory added (24.09.2002,MK)
  • Migrate to generic implementation based on F2003 + POSIX (2014, Ole Schuett)
Author
APSI, JGH, Ole Schuett

Function/Subroutine Documentation

◆ m_flush()

subroutine, public machine::m_flush ( integer, intent(in)  lunit)

flushes units if the &GLOBAL flag is set accordingly

Parameters
lunit...
History
10.2008 created [Joost VandeVondele]
Note
flushing might degrade performance significantly (30% and more)

Definition at line 105 of file machine.F.

◆ m_walltime()

real(kind=dp) function, public machine::m_walltime

returns time from a real-time clock, protected against rolling early/easily

Returns
...
History
03.2006 created [Joost VandeVondele]
Note
same implementation for all machines. might still roll, if not called multiple times per count_max/count_rate

Definition at line 122 of file machine.F.

◆ m_cpuinfo()

subroutine, public machine::m_cpuinfo ( character(len=default_string_length)  model_name)

reads /proc/cpuinfo if it exists (i.e. Linux) to return relevant info

Parameters
model_nameas obtained from the 'model name' field, UNKNOWN otherwise

Definition at line 136 of file machine.F.

Here is the caller graph for this function:

◆ m_cpuid()

pure integer function, public machine::m_cpuid

Target architecture or instruction set extension according to CPU-check at runtime.

Returns
cpuid according to MACHINE_* integer-parameter.
History
04.2019 created [Hans Pabst]

Definition at line 168 of file machine.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m_cpuid_name()

character(len=default_string_length) function, pointer, public machine::m_cpuid_name ( integer  cpuid)

Determine name of target architecture for a given CPUID.

Parameters
cpuidinteger value (MACHINE_*)
Returns
name or short name.
History
06.2019 created [Hans Pabst]

Definition at line 186 of file machine.F.

Here is the caller graph for this function:

◆ m_energy()

real(kind=dp) function, public machine::m_energy

returns the energy used since some time in the past. The precise meaning depends on the infrastructure is available. In the cray_pm_energy case, this is the energy used by the node in kJ.

Returns
...
History
09.2013 created [Joost VandeVondele, Ole Schuett]

Definition at line 218 of file machine.F.

Here is the caller graph for this function:

◆ m_datum()

subroutine, public machine::m_datum ( character(len=*), intent(out)  cal_date)

returns a datum in human readable format using a standard Fortran routine

Parameters
cal_date...
History
10.2009 created [Joost VandeVondele]

Definition at line 269 of file machine.F.

Here is the caller graph for this function:

◆ m_abort()

subroutine, public machine::m_abort

Can be used to get a nice core.

Definition at line 283 of file machine.F.

Here is the caller graph for this function:

◆ m_procrun()

integer function, public machine::m_procrun ( integer, intent(in)  pid)

Returns if a process is running on the local machine 1 if yes and 0 if not.

Parameters
pid...
Returns
...

Definition at line 298 of file machine.F.

Here is the caller graph for this function:

◆ m_memory()

subroutine, public machine::m_memory ( integer(kind=int_8), intent(out), optional  mem)

Returns the total amount of memory [bytes] in use, if known, zero otherwise.

Parameters
mem...

Definition at line 331 of file machine.F.

Here is the caller graph for this function:

◆ m_memory_details()

subroutine, public machine::m_memory_details ( integer(kind=int_8), optional  MemTotal,
integer(kind=int_8), optional  MemFree,
integer(kind=int_8), optional  Buffers,
integer(kind=int_8), optional  Cached,
integer(kind=int_8), optional  Slab,
integer(kind=int_8), optional  SReclaimable,
integer(kind=int_8), optional  MemLikelyFree 
)

get more detailed memory info, all units are bytes. the only 'useful' option is MemLikelyFree which is an estimate of remaining memory assumed to give info like /proc/meminfo while MeMLikelyFree is the amount of memory we're likely to be able to allocate, but not necessarily in one chunk zero means not available...

Parameters
MemTotal...
MemFree...
Buffers...
Cached...
Slab...
SReclaimable...
MemLikelyFree...

Definition at line 403 of file machine.F.

Here is the caller graph for this function:

◆ m_hostnm()

subroutine, public machine::m_hostnm ( character(len=*), intent(out)  hname)

...

Parameters
hname...

Definition at line 473 of file machine.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m_getcwd()

subroutine, public machine::m_getcwd ( character(len=*), intent(out)  curdir)

...

Parameters
curdir...

Definition at line 506 of file machine.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m_chdir()

subroutine, public machine::m_chdir ( character(len=*), intent(in)  dir,
integer, intent(out)  ierror 
)

...

Parameters
dir...
ierror...

Definition at line 535 of file machine.F.

Here is the caller graph for this function:

◆ m_getpid()

subroutine, public machine::m_getpid ( integer, intent(out)  pid)

...

Parameters
pid...

Definition at line 554 of file machine.F.

Here is the caller graph for this function:

◆ m_mov()

subroutine, public machine::m_mov ( character(len=*), intent(in)  source,
character(len=*), intent(in)  TARGET 
)

...

Parameters
source...
TARGET...

Definition at line 594 of file machine.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m_getlog()

subroutine, public machine::m_getlog ( character(len=*), intent(out)  user)

...

Parameters
user...

Definition at line 631 of file machine.F.

Here is the caller graph for this function:

◆ m_get_omp_stacksize()

subroutine, public machine::m_get_omp_stacksize ( character(len=*), intent(out)  omp_stacksize)

Retrieve environment variable OMP_STACKSIZE.

Parameters
omp_stacksizeValue of OMP_STACKSIZE

Definition at line 655 of file machine.F.

Here is the caller graph for this function:

Variable Documentation

◆ default_output_unit

integer, parameter, public machine::default_output_unit = output_unit

Definition at line 45 of file machine.F.

◆ default_input_unit

integer, parameter, public machine::default_input_unit = input_unit

Definition at line 45 of file machine.F.

◆ machine_cpu_generic

integer, parameter, public machine::machine_cpu_generic = CP_MACHINE_CPU_GENERIC

Definition at line 55 of file machine.F.

◆ machine_x86_sse4

integer, parameter, public machine::machine_x86_sse4 = CP_MACHINE_X86_SSE4

Definition at line 55 of file machine.F.

◆ machine_x86_avx

integer, parameter, public machine::machine_x86_avx = CP_MACHINE_X86_AVX

Definition at line 55 of file machine.F.

◆ machine_x86_avx2

integer, parameter, public machine::machine_x86_avx2 = CP_MACHINE_X86_AVX2

Definition at line 55 of file machine.F.

◆ machine_x86_avx512

integer, parameter, public machine::machine_x86_avx512 = CP_MACHINE_X86_AVX512

Definition at line 55 of file machine.F.

◆ machine_x86

integer, parameter, public machine::machine_x86 = MACHINE_X86_AVX512

Definition at line 55 of file machine.F.

◆ flush_should_flush

logical, save, public machine::flush_should_flush = .TRUE.

Definition at line 91 of file machine.F.

◆ m_memory_max

integer(kind=int_8), save, public machine::m_memory_max = 0

Definition at line 93 of file machine.F.