Octopus
messages.F90
Go to the documentation of this file.
1!! Copyright (C) 2002-2021 M. Marques, A. Castro, A. Rubio, G. Bertsch, X. Andrade,
2!! Copyright (C) 2021 M. Lueders
3!!
4!! This program is free software; you can redistribute it and/or modify
5!! it under the terms of the GNU General Public License as published by
6!! the Free Software Foundation; either version 2, or (at your option)
7!! any later version.
8!!
9!! This program is distributed in the hope that it will be useful,
10!! but WITHOUT ANY WARRANTY; without even the implied warranty of
11!! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12!! GNU General Public License for more details.
13!!
14!! You should have received a copy of the GNU General Public License
15!! along with this program; if not, write to the Free Software
16!! Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17!! 02110-1301, USA.
18!!
19
20#include "global.h"
21
22module messages_oct_m
23 use debug_oct_m
24 use global_oct_m
25 use io_oct_m
26 use iso_fortran_env
27 use loct_oct_m
28 use mpi_oct_m
30 use parser_oct_m
31 use string_oct_m
32 use sihash_oct_m
33 use sphash_oct_m
34 use unit_oct_m
36
37 implicit none
38
39 private
40
41 public :: &
48 print_date, &
63
64
65 integer, parameter :: max_lines = 20
66 character(len=256), dimension(max_lines), public :: message
67 character(len=68), parameter, public :: hyphens = &
68 '--------------------------------------------------------------------'
69 character(len=69), parameter, public :: shyphens = '*'//hyphens
70
71 character(len=512), private :: msg
72 integer, parameter, private :: SLEEPYTIME_ALL = 1, sleepytime_nonwriters = 60
73 character(len=64), private :: oct_status = 'undefined'
74
75 type(sihash_t), private :: namespace_unit
76 type(sphash_t), private :: namespace_mpi_grp
77 character(len=256), private :: msg_dir = 'exec'
78
79 ! ---------------------------------------------------------
85 ! ---------------------------------------------------------
87 module procedure messages_print_var_valuei
88 module procedure messages_print_var_values
89 module procedure messages_print_var_valuer
90 module procedure messages_print_var_valuel
91 module procedure messages_print_var_valuear
92 end interface messages_print_var_value
93
95 module procedure messages_write_float
96 module procedure messages_write_integer
97 module procedure messages_write_integer8
98 module procedure messages_write_str
99 module procedure messages_write_logical
100 end interface messages_write
101
102
104 module procedure messages_print_var_option_4
105 module procedure messages_print_var_option_8
106 end interface messages_print_var_option
107
108 integer :: warnings
109 integer :: experimentals
110 integer :: current_line
111
113 interface
114 subroutine trap_segfault()
115 implicit none
116 end subroutine trap_segfault
117 end interface
118
119
120contains
121
122 ! ---------------------------------------------------------
123 subroutine messages_init(output_dir)
124 character(len=*), intent(in), optional :: output_dir
125
126 logical :: trap_signals
127
128 if (present(output_dir)) then
129 msg_dir = trim(output_dir)
130 endif
131
132 call sihash_init(namespace_unit)
133 call sphash_init(namespace_mpi_grp)
134
135 call messages_obsolete_variable(global_namespace, 'DevelVersion', 'ExperimentalFeatures')
136
137 !%Variable ExperimentalFeatures
138 !%Type logical
139 !%Default no
140 !%Section Execution::Debug
141 !%Description
142 !% If true, allows the use of certain parts of the code that are
143 !% still under development and are not suitable for production
144 !% runs. This should not be used unless you know what you are doing.
145 !% See details on
146 !% <a href=https://www.octopus-code.org/documentation/main/variables/execution/debug/experimentalfeatures>wiki page</a>.
147 !%End
148 call parse_variable(global_namespace, 'ExperimentalFeatures', .false., conf%devel_version)
150 call messages_obsolete_variable(global_namespace, 'DebugLevel', 'Debug')
151
153
154 warnings = 0
155 experimentals = 0
156
157 !%Variable DebugTrapSignals
158 !%Type logical
159 !%Default yes
160 !%Section Execution::Debug
161 !%Description
162 !% If true, trap signals to handle them in octopus itself and
163 !% print a custom backtrace. If false, do not trap signals; then,
164 !% core dumps can be produced or gdb can be used to stop at the
165 !% point a signal was produced (e.g. a segmentation fault).
166 !%End
167 call parse_variable(global_namespace, 'DebugTrapSignals', .true., trap_signals)
168
169 if (trap_signals) call trap_segfault()
170
172
173 end subroutine messages_init
174
175 ! ---------------------------------------------------------
176 subroutine messages_end()
177
178 type(sihash_iterator_t) :: it
179 integer :: iu
181 if (mpi_world%is_root()) then
183 if (experimentals > 0 .or. warnings > 0) then
184 message(1) = ''
185 call messages_info(1)
186 end if
187
188
189 if (warnings > 0) then
190 call messages_write('Octopus emitted ')
191 call messages_write(warnings)
192 if (warnings > 1) then
193 call messages_write(' warnings.')
194 else
195 call messages_write(' warning.')
196 end if
197 call messages_info()
198 end if
199
200 if (experimentals > 0) then
201 call messages_new_line()
202 call messages_write('Octopus used ')
203 call messages_write(experimentals)
204 if (experimentals > 1) then
205 call messages_write(' experimental features:')
206 else
207 call messages_write(' experimental feature:')
208 end if
209 call messages_new_line()
210 call messages_new_line()
211 call messages_write(' Since you used one or more experimental features, results are likely')
212 call messages_new_line()
213 call messages_write(' wrong and should not be considered as valid scientific data. Check')
214 call messages_new_line()
215 call messages_new_line()
216 call messages_write(' https://www.octopus-code.org/documentation/main/variables/execution/debug/experimentalfeatures')
217 call messages_new_line()
218 call messages_new_line()
219 call messages_write(' or contact the octopus developers for details.')
220 call messages_new_line()
221 call messages_info()
222 end if
223
224 open(unit = iunit_out, file = trim(msg_dir) // '/messages', action = 'write')
225 write(iunit_out, '(a, i9)') "warnings = ", warnings
226 write(iunit_out, '(a, i9)') "experimental = ", experimentals
227 close(iunit_out)
228
229 end if
230
231 call it%start(namespace_unit)
232 do while(it%has_next())
233 iu = it%get_next()
234 if (iu /= stderr .and. iu /= stdout) call io_close(iu)
235 end do
236
237 call sphash_end(namespace_mpi_grp)
238 call sihash_end(namespace_unit)
239
240 end subroutine messages_end
241
242 ! ---------------------------------------------------------
243 integer function messages_get_unit(namespace) result(iunit)
244 type(namespace_t), optional, intent(in) :: namespace
245
246 logical :: found
247
248 if (present(namespace)) then
249
250 if (namespace%get()=="") then
251 iunit = stdout
252 return
253 end if
254
255 iunit = sihash_lookup( namespace_unit, namespace%get(), found)
256
257 if (.not. found) then
258 call io_mkdir('', namespace)
259 iunit = io_open("log", namespace=namespace, action="write")
260 call sihash_insert(namespace_unit, namespace%get(), iunit)
261 endif
262
263 else
264 iunit = stdout
265 end if
266
267 end function messages_get_unit
268
269 ! ---------------------------------------------------------
270 subroutine messages_update_mpi_grp(namespace, mpigrp)
271 type(namespace_t), intent(in) :: namespace
272 type(mpi_grp_t), target, intent(in) :: mpigrp
273
274 ! messages not initialised
275 assert(namespace_mpi_grp%is_associated())
276 call sphash_insert(namespace_mpi_grp, namespace%get(), mpigrp, clone=.true.)
277
278 end subroutine messages_update_mpi_grp
279
280 ! ---------------------------------------------------------
281 function messages_get_mpi_grp(namespace) result(grp)
282 type(namespace_t), optional, intent(in) :: namespace
283 type(mpi_grp_t) :: grp
284
285 class(*), pointer :: value
286 logical :: found
287
288 if (present(namespace)) then
289 ! messages not initialised
290 assert(namespace_mpi_grp%is_associated())
291
292 value => sphash_lookup(namespace_mpi_grp, trim(namespace%get()), found)
293
294 if (.not.found) then
295 grp = mpi_world
296 return
297 endif
298
299 select type(value)
300 type is (mpi_grp_t)
301 grp = value
302 class default
303 write(message(1),*) "Cannot get mpi_grp for namespace ",namespace%get()
304 call messages_fatal(1)
305 end select
306 else
307 grp = mpi_world
308 end if
309
310 end function messages_get_mpi_grp
311
312 ! ---------------------------------------------------------
313 subroutine messages_fatal(no_lines, only_root_writes, namespace)
314 integer, optional, intent(in) :: no_lines
315 logical, optional, intent(in) :: only_root_writes
316 type(namespace_t), optional, intent(in) :: namespace
317
318 type(mpi_grp_t) :: msg_mpi_grp
319 integer :: ii, no_lines_
320 logical :: only_root_writes_, should_write
321 integer, allocatable :: recv_buf(:)
322 type(mpi_request), allocatable :: recv_req(:)
323#ifdef HAVE_MPI
324 integer, parameter :: fatal_tag = 32767
325 logical :: received
326 type(mpi_request) :: send_req
327#endif
328
329 no_lines_ = current_line
330 if (present(no_lines)) no_lines_ = no_lines
331
332 msg_mpi_grp = messages_get_mpi_grp(namespace)
333
334 if (present(only_root_writes)) then
335 should_write = msg_mpi_grp%is_root() .or. (.not. only_root_writes)
336 only_root_writes_ = only_root_writes
337 else
338 should_write = .true.
339 only_root_writes_ = .false.
340 end if
341
342 ! This is to avoid all nodes reporting an error. The root node
343 ! post a message reception to all nodes, the rest of the nodes
344 ! send a message. If the message is received, the non-root nodes
345 ! know that the root node will report the error, so they do not do
346 ! anything.
347
348 if (.not. only_root_writes_) then
349 if (msg_mpi_grp%is_root()) then
350
351 allocate(recv_buf(1:msg_mpi_grp%size - 1))
352 allocate(recv_req(1:msg_mpi_grp%size - 1))
353 do ii = 1, msg_mpi_grp%size - 1
354#ifdef HAVE_MPI
355 call mpi_recv_init(recv_buf(ii), 1, mpi_integer, ii, fatal_tag, msg_mpi_grp%comm, recv_req(ii))
356#endif
357 end do
358 deallocate(recv_buf)
359 deallocate(recv_req)
360
361 else
362
363#ifdef HAVE_MPI
364 call mpi_send_init(1, 1, mpi_integer, 0, fatal_tag, msg_mpi_grp%comm, send_req)
365#endif
366 !sleep for a second and check
367 call loct_nanosleep(sleepytime_all, 0)
368#ifdef HAVE_MPI
369 call mpi_test(send_req, received, mpi_status_ignore)
370#endif
371 should_write = .false.
372
373 end if
374 end if
375
376 ! Give a moment for all standard output hopefully to be printed
377 call loct_nanosleep(sleepytime_all, 0)
378
379 ! If we are not writing wait for the root node to get here and
380 ! write the error message. If the root doesn`t get here, we all print the
381 ! error messsage anyways and die. Otherwise, no message might be written.
382 if (.not. should_write) call loct_nanosleep(sleepytime_nonwriters, 0)
383
384 call messages_print_with_emphasis(msg="FATAL ERROR", iunit=stderr)
385 write(msg, '(a)') '*** Fatal Error (description follows)'
386 call flush_msg(msg, stderr)
387
388 if (present(namespace)) then
389 if (len_trim(namespace%get()) > 0) then
390 write(msg, '(3a)') '* In namespace ', trim(namespace%get()), ':'
391 call flush_msg(msg, stderr)
392 end if
393 end if
394
395#ifdef HAVE_MPI
396 if (.not. only_root_writes_ .or. .not. msg_mpi_grp%is_root()) then
397 call flush_msg(shyphens, stderr)
398 write(msg, '(a,i4)') "* From node = ", msg_mpi_grp%rank
399 call flush_msg(msg, stderr)
400 end if
401#endif
402 call flush_msg(shyphens, stderr)
403 do ii = 1, no_lines_
404 write(msg, '(a,1x,a)') '*', trim(message(ii))
405 call flush_msg(msg, stderr)
406 end do
407
408 ! We only dump the stack in debug mode because subroutine invocations
409 ! are only recorded in debug mode (via push_sub/pop_sub). Otherwise,
410 ! it is a bit confusing that the stack seems to be empty.
411 if (debug%trace) then
412 call flush_msg(shyphens, stderr)
413
414 write(msg, '(a)') '* Stack: '
415 call flush_msg(msg, stderr, adv='no')
416 do ii = 1, no_sub_stack
417 write(msg, '(a,a)') ' > ', trim(sub_stack(ii))
418 call flush_msg(msg, stderr, adv='no')
419 end do
420 call flush_msg(" ", stderr)
421 end if
422
423 if (should_write) then
424 call messages_print_with_emphasis(iunit=stderr)
425 end if
426
427 ! switch file indicator to state aborted
428 call messages_switch_status('aborted')
429
430 call mpi_world%abort()
431
432 end subroutine messages_fatal
433
434 ! ---------------------------------------------------------
435 subroutine messages_warning(no_lines, all_nodes, namespace)
436 integer, optional, intent(in) :: no_lines
437 logical, optional, intent(in) :: all_nodes
438 type(namespace_t), optional, intent(in) :: namespace
439
440 integer :: il, no_lines_
441 integer :: iunit_namespace
442 logical :: have_to_write, all_nodes_
443 type(mpi_grp_t) :: msg_mpi_grp
444
445 no_lines_ = current_line
446 if (present(no_lines)) no_lines_ = no_lines
447
448 warnings = warnings + 1
449
450 iunit_namespace = messages_get_unit(namespace)
451 msg_mpi_grp = messages_get_mpi_grp(namespace)
452
453 have_to_write = msg_mpi_grp%is_root()
454
455 all_nodes_ = .false.
456 if (present(all_nodes)) then
457 have_to_write = have_to_write .or. all_nodes
458 all_nodes_ = all_nodes
459 end if
460
461 if (have_to_write) then
462
463 call flush_msg('', stderr)
464 if (iunit_namespace /= stdout) then
465 call flush_msg('', iunit_namespace)
466 end if
467 write(msg, '(a)') '** Warning:'
468 call flush_msg(msg, stderr)
469 if (iunit_namespace /= stdout) then
470 call flush_msg(msg, iunit_namespace)
471 end if
472
473 if (present(namespace)) then
474 if (len_trim(namespace%get()) > 0) then
475 write(msg, '(3a)') '** In namespace ', trim(namespace%get()), ':'
476 call flush_msg(msg, stderr)
477 end if
478 end if
479
480#ifdef HAVE_MPI
481 if (all_nodes_) then
482 write(msg , '(a,i4)') '** From node = ', mpi_world%rank
483 call flush_msg(msg, stderr)
484 if (iunit_namespace /= stdout) then
485 call flush_msg(msg, iunit_namespace)
486 end if
487 end if
488#endif
489
490 do il = 1, no_lines_
491 write(msg , '(a,3x,a)') '**', trim(message(il))
492 call flush_msg(msg, stderr)
493 if (iunit_namespace /= stdout) then
494 call flush_msg(msg, iunit_namespace)
495 end if
496 end do
497 call flush_msg('', stderr)
498 if (iunit_namespace /= stdout) then
499 call flush_msg('', iunit_namespace)
500 end if
501
502 flush(stderr)
503 if (iunit_namespace /= stdout) then
504 flush(iunit_namespace)
505 end if
506
507 end if
508
510
511 end subroutine messages_warning
512
513 ! ---------------------------------------------------------
514 subroutine messages_info(no_lines, iunit, debug_only, stress, all_nodes, namespace)
515 integer, optional, intent(in) :: no_lines
516 integer, optional, intent(in) :: iunit
517 logical, optional, intent(in) :: debug_only
518 logical, optional, intent(in) :: stress
519 logical, optional, intent(in) :: all_nodes
520 type(namespace_t), optional, intent(in) :: namespace
521
522 integer :: il, no_lines_
523 integer :: iunit_
524 type(mpi_grp_t) :: msg_mpi_grp
525
526 assert(.not. (present(iunit) .and. present(namespace)))
527
528 if (present(iunit)) then
529 iunit_ = iunit
530 else
531 iunit_ = messages_get_unit(namespace)
532 end if
533 msg_mpi_grp = messages_get_mpi_grp(namespace)
534
535 if (.not. msg_mpi_grp%is_root() .and. .not. optional_default(all_nodes, .false.)) then
537 return
538 end if
539
540 no_lines_ = current_line
541 if (present(no_lines)) no_lines_ = no_lines
542
543 if (present(stress)) then
544 call messages_print_with_emphasis(iunit=iunit_)
545 end if
546
547 do il = 1, no_lines_
548 if (.not. optional_default(debug_only, .false.) .or. debug%info) then
549 write(msg, '(a)') trim(message(il))
550 call flush_msg(msg, iunit_)
551 end if
552 end do
553 if (present(stress)) then
554 call messages_print_with_emphasis(iunit=iunit_)
555 end if
556
557 flush(iunit_)
558
560
561 end subroutine messages_info
562
563 ! ---------------------------------------------------------
565 subroutine messages_switch_status(status)
566 character(len=*), intent(in) :: status
567
568 ! only root node is taking care of file I/O
569 if (.not. mpi_world%is_root()) return
570
571 ! remove old status files first, before we switch to a new state
572 call loct_rm(trim(msg_dir) // '/oct-status-running')
573 call loct_rm(trim(msg_dir) // '/oct-status-finished')
574 call loct_rm(trim(msg_dir) // '/oct-status-aborted')
575 if (oct_status /= 'walltimer-aborted') then
576 call loct_rm(trim(msg_dir) // '/oct-status-walltimer-aborted')
577 end if
578
579 oct_status = status
580
581 ! create empty status file to indicate new state
582 open(unit=iunit_err, file=trim(msg_dir) // '/oct-status-'//trim(status), &
583 action='write', status='unknown')
584 close(iunit_err)
585
586 end subroutine messages_switch_status
587
588 ! ---------------------------------------------------------
589 subroutine alloc_error(msg, stmt, file, line)
590 character(len=*), intent(in) :: msg
591 character(len=*), intent(in) :: stmt
592 character(len=*), intent(in) :: file
593 integer, intent(in) :: line
594
595 interface
596 subroutine c_abort() bind(C, name="abort")
597 end subroutine c_abort
598 end interface
599
600 if (mpi_call_is_thread_safe()) then
601 write(message(1), '(a)') msg
602 write(message(2), '(5a,i5)') "Failed to ", stmt, " in file '", trim(file), "' line ", line
603 call messages_fatal(2)
604 else
605 !$omp critical (memory_error_critical)
606 write(stderr, '(a)') trim(msg)
607 write(stderr, '(5a,i5)') "Failed to ", stmt, " in file '", trim(file), "' line ", line
608 flush(stderr)
609 call c_abort()
610 !$omp end critical (memory_error_critical)
611 end if
612 end subroutine alloc_error
613
614 ! ---------------------------------------------------------
615 subroutine messages_input_error(namespace, var, details, row, column)
616 type(namespace_t), intent(in) :: namespace
617 character(len=*), intent(in) :: var
618 character(len=*), optional, intent(in) :: details
619 integer, optional, intent(in) :: row
620 integer, optional, intent(in) :: column
621
622 character(len=10) :: row_str, column_str
623
624 call messages_write('Input error in the input variable '// trim(var))
625
626 if (present(row)) then
627 ! Print row and, if available, the column. We add one to both values
628 ! in order to translate from the C numbering used by the parser to a
629 ! more human-friendly numbering.
630 write(row_str, '(I10)') row + 1
631 call messages_write(' at row '//adjustl(row_str))
632 if (present(column)) then
633 write(column_str, '(I10)') column + 1
634 call messages_write(', column '//adjustl(column_str))
635 end if
636 end if
637 if (present(details)) then
638 call messages_write(':', new_line = .true.)
639 call messages_new_line()
640 call messages_write(' '//trim(details))
641 end if
642 call messages_write('.', new_line = .true.)
643
645
646 call messages_write('You can get the documentation of the variable with the command:', new_line = .true.)
647 call messages_write(' oct-help -p '//trim(var))
648 call messages_fatal(namespace=namespace)
649
650 end subroutine messages_input_error
651
652 ! ---------------------------------------------------------
653 subroutine messages_print_var_valuei(var, val, iunit, namespace)
654 character(len=*), intent(in) :: var
655 integer, intent(in) :: val
656 integer, optional, intent(in) :: iunit
657 type(namespace_t), optional, intent(in) :: namespace
658
659 character(len=10) :: intstring
660
661 assert(.not. (present(iunit) .and. present(namespace)))
662
663 write(intstring,'(i10)') val
664 message(1) = 'Input: ['//trim(var)//' = '//trim(adjustl(intstring))//']'
665 call messages_info(1, iunit=iunit, namespace=namespace)
666
667 end subroutine messages_print_var_valuei
668
669 ! ---------------------------------------------------------
670 subroutine messages_print_var_values(var, val, iunit, namespace)
671 character(len=*), intent(in) :: var
672 character(len=*), intent(in) :: val
673 integer, optional, intent(in) :: iunit
674 type(namespace_t), optional, intent(in) :: namespace
675
676 assert(.not. (present(iunit) .and. present(namespace)))
677
678 message(1) = 'Input: ['//trim(var)//' = '//trim(val)//']'
679 call messages_info(1, iunit=iunit, namespace=namespace)
680
681 end subroutine messages_print_var_values
682
683 ! ---------------------------------------------------------
684 subroutine messages_print_var_valuer(var, val, unit, iunit, namespace)
685 character(len=*), intent(in) :: var
686 real(real64), intent(in) :: val
687 type(unit_t), optional, intent(in) :: unit
688 integer, optional, intent(in) :: iunit
689 type(namespace_t), optional, intent(in) :: namespace
690
691 character(len=11) :: floatstring
692
693 assert(.not. (present(iunit) .and. present(namespace)))
694
695 if (.not. present(unit)) then
696 write(floatstring,'(g11.4)') val
697 message(1) = 'Input: ['//trim(var)//' = '//trim(adjustl(floatstring))//']'
698 else
699 write(floatstring,'(g11.4)') units_from_atomic(unit, val)
700 message(1) = 'Input: ['//trim(var)//' = '//trim(adjustl(floatstring))//' '//trim(units_abbrev(unit))//']'
701 end if
702 call messages_info(1, iunit=iunit, namespace=namespace)
703
704 end subroutine messages_print_var_valuer
705
706 ! ---------------------------------------------------------
707 subroutine messages_print_var_valuel(var, val, iunit, namespace)
708 character(len=*), intent(in) :: var
709 logical, intent(in) :: val
710 integer, optional, intent(in) :: iunit
711 type(namespace_t), optional, intent(in) :: namespace
712
713 character(len=3) :: lstring
714
715 assert(.not. (present(iunit) .and. present(namespace)))
716
717 if (val) then
718 lstring = 'yes'
719 else
720 lstring = 'no'
721 end if
722 message(1) = 'Input: ['//trim(var)//' = '//trim(lstring)//']'
723 call messages_info(1, iunit=iunit, namespace=namespace)
724
726
727 ! ---------------------------------------------------------
728 subroutine messages_print_var_valuear(var, val, unit, iunit, namespace)
729 character(len=*), intent(in) :: var
730 real(real64), intent(in) :: val(:)
731 type(unit_t), optional, intent(in) :: unit
732 integer, optional, intent(in) :: iunit
733 type(namespace_t), optional, intent(in) :: namespace
734
735 integer :: ii
736 character(len=11) :: floatstring
737
738 assert(.not. (present(iunit) .and. present(namespace)))
740 call messages_write('Input: ['//trim(var)//' = (')
741 do ii = 1, size(val)
742 write(floatstring,'(g11.4)') val(ii)
743 call messages_write(trim(adjustl(floatstring)))
744 if (ii < size(val)) call messages_write(', ')
745 end do
746 call messages_write(')')
747 if (present(unit)) then
748 call messages_write(' '//trim(units_abbrev(unit))//']')
749 else
750 call messages_write(']')
751 end if
752 call messages_info(iunit = iunit, namespace=namespace)
753
754 end subroutine messages_print_var_valuear
755
756 ! ---------------------------------------------------------
757 subroutine messages_print_var_info(var, iunit, namespace)
758 character(len=*), intent(in) :: var
759 integer, optional, intent(in) :: iunit
760 type(namespace_t), optional, intent(in) :: namespace
761
762 integer :: iunit_
763 type(mpi_grp_t) :: mpi_grp
764
765 assert(.not. (present(iunit) .and. present(namespace)))
766
767 mpi_grp = messages_get_mpi_grp(namespace)
768
769 if (.not. mpi_grp%is_root()) return
770
771 if (present(iunit)) then
772 iunit_ = iunit
773 else
774 iunit_ = messages_get_unit(namespace)
775 end if
776 call varinfo_print(iunit_, var)
777
778 end subroutine messages_print_var_info
779
780 ! ---------------------------------------------------------
781 subroutine messages_print_var_option_8(var, option, pre, iunit, namespace)
782 character(len=*), intent(in) :: var
783 integer(int64), intent(in) :: option
784 character(len=*), optional, intent(in) :: pre
785 integer, optional, intent(in) :: iunit
786 type(namespace_t), optional, intent(in) :: namespace
787
788 integer :: option4, iunit_
789 type(mpi_grp_t) :: mpi_grp
790
791 assert(.not. (present(iunit) .and. present(namespace)))
792
793 mpi_grp = messages_get_mpi_grp(namespace)
794 if (.not. mpi_grp%is_root()) return
795
796 option4 = int(option, int32)
797
798 if (present(iunit)) then
799 iunit_ = iunit
800 else
801 iunit_ = messages_get_unit(namespace)
802 end if
803 call varinfo_print_option(iunit_, var, option4, pre)
804
805 end subroutine messages_print_var_option_8
806
807 ! ---------------------------------------------------------
808 subroutine messages_print_var_option_4(var, option, pre, iunit, namespace)
809 character(len=*), intent(in) :: var
810 integer(int32), intent(in) :: option
811 character(len=*), optional, intent(in) :: pre
812 integer, optional, intent(in) :: iunit
813 type(namespace_t), optional, intent(in) :: namespace
814
815 assert(.not. (present(iunit) .and. present(namespace)))
816
817 call messages_print_var_option_8(var, int(option, int64), pre, iunit, namespace)
818
819 end subroutine messages_print_var_option_4
820
821 ! ---------------------------------------------------------
822 subroutine messages_print_with_emphasis(msg, iunit, namespace)
823 character(len=*), optional, intent(in) :: msg
824 integer, optional, intent(in) :: iunit
825 type(namespace_t), optional, intent(in) :: namespace
826
827 integer, parameter :: max_len = 70
828
829 integer :: ii, jj, length
830 integer :: iunit_
831 character(len=70) :: str
832 character(len=max_len) :: msg_combined
833 type(mpi_grp_t) :: msg_mpi_grp
834
835 if (present(iunit)) then
836 iunit_ = iunit
837 else
838 iunit_ = messages_get_unit(namespace)
839 end if
840 msg_mpi_grp = messages_get_mpi_grp(namespace)
841
842 if (.not. msg_mpi_grp%is_root()) return
843
844 if (present(msg)) then
845 ! make sure we do not get a segfault for too long messages
846 if (len_trim(msg) > max_len) then
847 msg_combined = trim(msg(1:max_len))
848 else
849 msg_combined = trim(msg)
850 end if
851 length = len_trim(msg_combined)
852
853 str = ''
854 jj = 1
855
856 do ii = 1, (max_len - (length + 2))/2
857 str(jj:jj) = '*'
858 jj = jj + 1
859 end do
860
861 str(jj:jj) = ' '
862 jj = jj + 1
864 do ii = 1, length
865 str(jj:jj) = msg_combined(ii:ii)
866 jj = jj + 1
867 end do
868
869 str(jj:jj) = ' '
870 jj = jj + 1
871
872 do ii = jj, max_len
873 str(jj:jj) = '*'
874 jj = jj + 1
875 end do
876
877 call flush_msg('', iunit_) ! empty line
878 call flush_msg(str, iunit_) ! print out nice line with the header
879 else
880 do ii = 1, max_len
881 str(ii:ii) = '*'
882 end do
883
884 call flush_msg(str, iunit_) ! print out nice line with the header
885 call flush_msg('', iunit_) ! empty line
886 end if
887
888 flush(iunit_)
889 end subroutine messages_print_with_emphasis
890
891 ! ---------------------------------------------------------
892 subroutine flush_msg(str, iunit, adv)
893 character(len = *), intent(in) :: str
894 integer, intent(in) :: iunit
895 character(len = *), optional, intent(in) :: adv
896
897 character(len = 20) :: adv_
898
899 adv_ = 'yes'
900 if (present(adv)) adv_ = trim(adv)
901
902 write(iunit, '(a)', advance=adv_) trim(str)
903
904 end subroutine flush_msg
905
906 ! ---------------------------------------------------------
907 subroutine print_date(str)
908 character(len = *), intent(in) :: str
909
910 integer :: val(8)
911
912 call date_and_time(values=val)
913 message(1) = ""
914 write(message(3),'(a,i4,a1,i2.2,a1,i2.2,a,i2.2,a1,i2.2,a1,i2.2)') &
915 str , val(1), "/", val(2), "/", val(3), &
916 " at ", val(5), ":", val(6), ":", val(7)
917 message(2) = str_center(trim(message(3)), 70)
918 message(3) = ""
919 call messages_info(3)
920
921 end subroutine print_date
922
923 ! ---------------------------------------------------------
924 subroutine messages_obsolete_variable(namespace, name, rep)
925 type(namespace_t), intent(in) :: namespace
926 character(len=*), intent(in) :: name
927 character(len=*), optional, intent(in) :: rep
928
929 if (parse_is_defined(namespace, trim(name))) then
930
931 write(message(1), '(a)') 'Input variable '//trim(name)//' is obsolete.'
932
933 if (present(rep)) then
934 write(message(2), '(a)') ' '
935 write(message(3), '(a)') 'Equivalent functionality can be obtained with the '//trim(rep)
936 write(message(4), '(a)') 'variable. Check the documentation for details.'
937 write(message(5), '(a)') '(You can use the `oct-help -p '//trim(rep)//'` command).'
938 call messages_fatal(5, only_root_writes = .true., namespace=namespace)
939 else
940 call messages_fatal(1, only_root_writes = .true., namespace=namespace)
941 end if
942
943 end if
944
945 end subroutine messages_obsolete_variable
946
947 ! ---------------------------------------------------------
948 subroutine messages_variable_is_block(namespace, name)
949 type(namespace_t), intent(in) :: namespace
950 character(len=*), intent(in) :: name
951
952 if (parse_is_defined(namespace, trim(name))) then
953
954 write(message(1), '(a)') 'Input variable `'//trim(name)//'` must be defined as a block.'
955 write(message(2), '(a)') 'Please check the documentation for details.'
956 write(message(3), '(a)') '(You can use the `oct-help -p '//trim(name)//'` command).'
957 call messages_fatal(3, only_root_writes = .true., namespace=namespace)
958
959 end if
960
961 end subroutine messages_variable_is_block
963 ! ---------------------------------------------------------
964 subroutine messages_experimental(name, namespace)
965 character(len=*), intent(in) :: name
966 type(namespace_t), optional, intent(in) :: namespace
967
968 experimentals = experimentals + 1
969
970 if (.not. conf%devel_version) then
971 call messages_write(trim(name)//' is an experimental feature.')
972 call messages_new_line()
973 call messages_new_line()
974 call messages_write('If you still want to use this feature (at your own risk), check:')
975 call messages_new_line()
976 call messages_new_line()
977 call messages_write('https://www.octopus-code.org/documentation/main/variables/execution/debug/experimentalfeatures')
978 call messages_new_line()
979 call messages_fatal(only_root_writes = .true., namespace=namespace)
980 else
981 write(message(1), '(a)') trim(name)//' is under development.'
982 write(message(2), '(a)') 'It might not work or produce wrong results.'
983 call messages_warning(2, namespace=namespace)
984
985 ! remove this warning from the count
986 warnings = warnings - 1
987 end if
988
989 end subroutine messages_experimental
990
991 ! ------------------------------------------------------------
992 subroutine messages_not_implemented(feature, namespace)
993 character(len=*), intent(in) :: feature
994 type(namespace_t), optional, intent(in) :: namespace
995
997
998 message(1) = trim(feature)//" not implemented."
999 call messages_fatal(1, only_root_writes = .true., namespace=namespace)
1000
1002 end subroutine messages_not_implemented
1004 ! ------------------------------------------------------------
1005 subroutine messages_reset_lines()
1006
1007 current_line = 1
1008 message(1) = ''
1009
1010 end subroutine messages_reset_lines
1011
1012 ! ------------------------------------------------------------
1013 subroutine messages_new_line()
1014
1015 current_line = current_line + 1
1016 if (current_line > max_lines) stop 'Too many message lines.'
1017
1018 message(current_line) = ''
1020 end subroutine messages_new_line
1021
1022 ! ------------------------------------------------------------
1023 subroutine messages_write_float(val, fmt, new_line, units, align_left, print_units)
1024 real(real64), intent(in) :: val
1025 character(len=*), optional, intent(in) :: fmt
1026 logical, optional, intent(in) :: new_line
1027 type(unit_t), optional, intent(in) :: units
1028 logical, optional, intent(in) :: align_left
1029 logical, optional, intent(in) :: print_units
1030
1031 character(len=30) :: number
1032 real(real64) :: tval
1033
1034 tval = val
1035 if (present(units)) tval = units_from_atomic(units, val)
1036
1037 if (present(fmt)) then
1038 write(number, '('//trim(fmt)//')') tval
1039 else
1040 write(number, '(f12.6)') tval
1041 end if
1042
1043 if (optional_default(align_left, .false.)) then
1044 number = adjustl(number)
1045 number(1:len(number)) = ' '//number(1:len(number)-1)
1046 end if
1048 write(message(current_line), '(a, a)') trim(message(current_line)), trim(number)
1049
1050 if (present(units) .and. optional_default(print_units, .true.)) then
1051 write(message(current_line), '(a, a, a)') trim(message(current_line)), ' ', trim(units_abbrev(units))
1052 end if
1053
1054 if (optional_default(new_line, .false.)) call messages_new_line()
1055
1056 end subroutine messages_write_float
1057
1058 ! ------------------------------------------------------------
1059 subroutine messages_write_integer8(val, fmt, new_line, units, print_units)
1060 integer(int64), intent(in) :: val
1061 character(len=*), optional, intent(in) :: fmt
1062 logical, optional, intent(in) :: new_line
1063 type(unit_t), optional, intent(in) :: units
1064 logical, optional, intent(in) :: print_units
1065
1066 character(len=20) :: number
1067 real(real64) :: val_conv_float
1069 if (present(units)) then
1070 val_conv_float = units_from_atomic(units, dble(val))
1071
1072 if (present(fmt)) then
1073 write(message(current_line), '(a, '//trim(fmt)//')') trim(message(current_line)), val_conv_float
1074 else
1075 write(number, '(f15.3)') val_conv_float
1076 write(message(current_line), '(3a)') trim(message(current_line)), ' ', trim(adjustl(number))
1077 end if
1079 else
1080
1081 if (present(fmt)) then
1082 write(message(current_line), '(a, '//trim(fmt)//')') trim(message(current_line)), val
1083 else
1084 write(number, '(i12)') val
1085 write(message(current_line), '(3a)') trim(message(current_line)), ' ', trim(adjustl(number))
1086 end if
1087
1088 end if
1089
1090
1091 if (present(units) .and. optional_default(print_units, .true.)) then
1092 write(message(current_line), '(a, a, a)') trim(message(current_line)), ' ', trim(adjustl(units_abbrev(units)))
1093 end if
1094
1095 if (present(new_line)) then
1096 if (new_line) call messages_new_line()
1097 end if
1098
1099 end subroutine messages_write_integer8
1100
1101 ! ------------------------------------------------------------
1102 subroutine messages_write_integer(val, fmt, new_line, units, print_units)
1103 integer(int32), intent(in) :: val
1104 character(len=*), optional, intent(in) :: fmt
1105 logical, optional, intent(in) :: new_line
1106 type(unit_t), optional, intent(in) :: units
1107 logical, optional, intent(in) :: print_units
1108
1109 call messages_write_integer8(int(val, int64), fmt, new_line, units, print_units)
1110
1111 end subroutine messages_write_integer
1112
1113 ! ------------------------------------------------------------
1114 subroutine messages_write_str(val, fmt, new_line)
1115 character(len=*), intent(in) :: val
1116 character(len=*), optional, intent(in) :: fmt
1117 logical, optional, intent(in) :: new_line
1118
1119 character(len=100) :: fmt_
1120
1121 if (len(trim(message(current_line))) + len(trim(val)) > len(message(current_line))) then
1122 ! cannot use normal message approach without interfering with message we are trying to write
1123 ! write directly in case trim(val) is itself too long
1124 write(error_unit, *) "Exceeded message line length limit, to write string:", trim(val)
1125 else
1126 fmt_ = optional_default(fmt, '(a)')
1127 write(message(current_line), '(a, '//trim(fmt_)//')') trim(message(current_line)), trim(val)
1128 end if
1129
1130 if (present(new_line)) then
1131 if (new_line) call messages_new_line()
1132 end if
1133
1134 end subroutine messages_write_str
1135
1136 ! ------------------------------------------------------------
1137 subroutine messages_write_logical(val, new_line)
1138 logical, intent(in) :: val
1139 logical, optional, intent(in) :: new_line
1140
1141 character(len=3) :: text
1142
1143 if (val) then
1144 text = 'yes'
1145 else
1146 text = 'no'
1147 end if
1148
1149 if (len(trim(message(current_line))) + len(trim(text)) > len(message(current_line))) then
1150 write(message(current_line + 1), '(3a)') "Exceeded message line length limit, to write logical value '", trim(text), "'"
1151 call messages_fatal(current_line + 1)
1152 end if
1153
1154 write(message(current_line), '(a,1x,a)') trim(message(current_line)), trim(text)
1155
1156 if (present(new_line)) then
1157 if (new_line) call messages_new_line()
1158 end if
1159
1160 end subroutine messages_write_logical
1161
1162 ! -----------------------------------------------------------
1163 subroutine messages_dump_stack(isignal)
1164 integer, intent(in) :: isignal
1165
1166 integer :: ii
1167 character(len=300) :: description
1168 character(kind=c_char) :: cstr(301)
1170 interface get_signal_description
1171 subroutine get_signal_description(signum, signame) bind(c)
1172 use iso_c_binding
1173 implicit none
1174 integer, intent(in) :: signum
1175 character(kind=c_char), intent(out) :: signame(*)
1176 end subroutine get_signal_description
1177 end interface get_signal_description
1178
1179 cstr = c_null_char
1180 call get_signal_description(isignal, cstr)
1181 call string_c_to_f(cstr, description)
1182
1183 write(msg, '(a)') ''
1184 call flush_msg(msg, stderr)
1185 write(msg, '(a)') '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'
1186 call flush_msg(msg, stderr)
1187 write(msg, '(a)') ''
1188 call flush_msg(msg, stderr)
1189 write(msg, '(a,i2,2a)') ' Octopus was killed by signal ', isignal, ': ', trim(description)
1190 call flush_msg(msg, stderr)
1191 write(msg, '(a,i2)') ''
1192 call flush_msg(msg, stderr)
1193 write(msg, '(a)') ' Note: Octopus is currently trapping signals. This might prevent the'
1194 call flush_msg(msg, stderr)
1195 write(msg, '(a)') ' use of debuggers or the generation of core dumps. To change this'
1196 call flush_msg(msg, stderr)
1197 write(msg, '(a)') ' behavior, use the DebugTrapSignals input option.'
1198 call flush_msg(msg, stderr)
1199 write(msg, '(a)') ''
1200 call flush_msg(msg, stderr)
1201 write(msg, '(a)') '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'
1202 call flush_msg(msg, stderr)
1203
1204 if (debug%trace) then
1205 call flush_msg(shyphens, iunit=stderr)
1206
1207 write(msg, '(a)') 'Octopus debug trace: '
1208 call flush_msg(msg, stderr)
1209 do ii = 1, no_sub_stack
1210 write(msg, '(a,a)') ' > ', trim(sub_stack(ii))
1211 call flush_msg(msg, stderr, adv='no')
1212 end do
1213 call flush_msg(" ", stderr)
1214 else
1215 write(msg, '(a)') " Octopus debug trace not available. You can enable it with 'Debug = trace'."
1216 call flush_msg(msg, stderr)
1217 end if
1219 end subroutine messages_dump_stack
1220
1221end module messages_oct_m
1222
1223! ---------------------------------------------------------
1227subroutine assert_die(s, f, l)
1228 use debug_oct_m
1229 use messages_oct_m
1230 use mpi_oct_m
1231
1232 implicit none
1233
1234 character(len=*), intent(in) :: s, f
1235 integer, intent(in) :: l
1236
1237 call messages_write('Node ')
1238 call messages_write(mpi_world%rank)
1239 call messages_write(':')
1240 call messages_new_line()
1241
1242 call messages_write(' Assertion "'//trim(s)//'"')
1243 call messages_new_line()
1244
1245 call messages_write(' failed in line ')
1246 call messages_write(l)
1247 call messages_write(' of file "'//trim(debug_clean_path(f))//'".')
1248 call messages_new_line()
1249
1250 call messages_write('This should not happen and is likely a bug in the code.')
1251 call messages_new_line()
1252 call messages_write('Please contact the developers and report how this occurred.')
1253 call messages_new_line()
1254 call messages_write('You can open an issue on gitlab as described in Contributing.md.')
1255 call messages_new_line()
1256
1257 call messages_fatal()
1258
1259end subroutine assert_die
1260
1261!-------------------------------------------------------
1262subroutine handle_segv(isignal) bind(c)
1263 use messages_oct_m
1264 use iso_c_binding
1265
1266 implicit none
1267
1268 integer(c_int), intent(in) :: isignal
1269
1270 ! Switch status to aborted
1271 call messages_switch_status('aborted')
1272
1273 ! Dump stack
1274 call messages_dump_stack(isignal)
1275
1276end subroutine handle_segv
1277
1278
1279!! Local Variables:
1280!! mode: f90
1281!! coding: utf-8
1282!! End:
Prints out to iunit a message in the form: ["InputVariable" = value] where "InputVariable" is given b...
Definition: messages.F90:158
subroutine handle_segv(isignal)
Definition: messages.F90:1318
subroutine assert_die(s, f, l)
This subroutine is called by the assert macro, it is not in a module so it can be called from any fil...
Definition: messages.F90:1283
character(len=max_path_len) function, public debug_clean_path(filename)
Prune a filename path to only include subdirectories of the "src" directory.
Definition: debug.F90:572
type(debug_t), save, public debug
Definition: debug.F90:133
subroutine, public debug_init(this, namespace)
Definition: debug.F90:155
integer, public no_sub_stack
Definition: global.F90:240
character(len=80), dimension(50), public sub_stack
The stack.
Definition: global.F90:238
type(conf_t), public conf
Global instance of Octopus configuration.
Definition: global.F90:163
Definition: io.F90:93
subroutine, public io_close(iunit, grp)
Definition: io.F90:444
subroutine, public io_mkdir(fname, namespace, parents)
Definition: io.F90:338
integer, parameter, public iunit_out
Definition: io.F90:128
integer, parameter, public iunit_err
Definition: io.F90:129
integer function, public io_open(file, namespace, action, status, form, position, die, recl, grp)
Definition: io.F90:379
System information (time, memory, sysname)
Definition: loct.F90:94
subroutine, public loct_rm(name)
Definition: loct.F90:295
subroutine string_c_to_f(c_string, f_string)
convert a C string to a Fortran string
Definition: loct.F90:235
subroutine, public messages_end()
Definition: messages.F90:249
subroutine messages_write_integer8(val, fmt, new_line, units, print_units)
Definition: messages.F90:1115
subroutine, public messages_print_with_emphasis(msg, iunit, namespace)
Definition: messages.F90:878
subroutine, public messages_not_implemented(feature, namespace)
Definition: messages.F90:1048
subroutine, public messages_init(output_dir)
Definition: messages.F90:196
subroutine messages_print_var_option_8(var, option, pre, iunit, namespace)
Definition: messages.F90:837
subroutine messages_print_var_valuear(var, val, unit, iunit, namespace)
Definition: messages.F90:784
subroutine, public messages_variable_is_block(namespace, name)
Definition: messages.F90:1004
subroutine, public messages_warning(no_lines, all_nodes, namespace)
Definition: messages.F90:501
subroutine messages_write_integer(val, fmt, new_line, units, print_units)
Definition: messages.F90:1158
subroutine messages_print_var_option_4(var, option, pre, iunit, namespace)
Definition: messages.F90:864
subroutine, public alloc_error(msg, stmt, file, line)
Definition: messages.F90:645
subroutine, public messages_obsolete_variable(namespace, name, rep)
Definition: messages.F90:980
subroutine, public messages_switch_status(status)
create status file for asynchronous communication
Definition: messages.F90:621
subroutine, public print_date(str)
Definition: messages.F90:963
subroutine flush_msg(str, iunit, adv)
Definition: messages.F90:948
subroutine, public messages_print_var_info(var, iunit, namespace)
Definition: messages.F90:813
subroutine, public messages_update_mpi_grp(namespace, mpigrp)
Definition: messages.F90:343
subroutine, public messages_new_line()
Definition: messages.F90:1069
subroutine messages_print_var_values(var, val, iunit, namespace)
Definition: messages.F90:726
subroutine, public messages_fatal(no_lines, only_root_writes, namespace)
Definition: messages.F90:386
subroutine messages_print_var_valuei(var, val, iunit, namespace)
Definition: messages.F90:709
subroutine, public messages_input_error(namespace, var, details, row, column)
Definition: messages.F90:671
subroutine messages_print_var_valuer(var, val, unit, iunit, namespace)
Definition: messages.F90:740
integer, parameter, private sleepytime_nonwriters
seconds
Definition: messages.F90:144
subroutine, public messages_experimental(name, namespace)
Definition: messages.F90:1020
subroutine messages_print_var_valuel(var, val, iunit, namespace)
Definition: messages.F90:763
subroutine messages_write_logical(val, new_line)
Definition: messages.F90:1193
subroutine, public messages_info(no_lines, iunit, debug_only, stress, all_nodes, namespace)
Definition: messages.F90:570
subroutine messages_write_str(val, fmt, new_line)
Definition: messages.F90:1170
type(mpi_grp_t) function messages_get_mpi_grp(namespace)
Definition: messages.F90:354
subroutine, public messages_dump_stack(isignal)
Definition: messages.F90:1219
integer function messages_get_unit(namespace)
Definition: messages.F90:316
subroutine messages_write_float(val, fmt, new_line, units, align_left, print_units)
Definition: messages.F90:1079
subroutine messages_reset_lines()
Definition: messages.F90:1061
procedure(omp_region_func), pointer mpi_call_is_thread_safe
Single-threaded without MPI.
Definition: mpi.F90:330
type(mpi_grp_t), public mpi_world
Definition: mpi.F90:317
type(namespace_t), public global_namespace
Definition: namespace.F90:112
logical function, public parse_is_defined(namespace, name)
Definition: parser.F90:440
This module implements a simple hash table for string valued keys and integer values using the C++ ST...
Definition: sihash.F90:97
subroutine, public sihash_insert(h, key, val)
Insert a (key, val) pair into the hash table h.
Definition: sihash.F90:182
subroutine, public sihash_init(h)
Initialize a hash table h with size entries. Since we use separate chaining, the number of entries in...
Definition: sihash.F90:141
integer function, public sihash_lookup(h, key, found)
Look up a value in the hash table h. If found is present, it indicates if key could be found in the t...
Definition: sihash.F90:208
subroutine, public sihash_end(h)
Free a hash table.
Definition: sihash.F90:162
This module implements a simple hash table for string valued keys and integer values using the C++ ST...
Definition: sphash.F90:97
subroutine, public sphash_init(h)
Initialize a hash table h with size entries. Since we use separate chaining, the number of entries in...
Definition: sphash.F90:200
subroutine, public sphash_insert(h, key, val, clone)
Insert a (key, val) pair into the hash table h. If clone=.true., the object will be copied.
Definition: sphash.F90:270
subroutine, public sphash_end(h)
Free a hash table.
Definition: sphash.F90:226
class(*) function, pointer, public sphash_lookup(h, key, found)
Look up a value in the hash table h. If found is present, it indicates if key could be found in the t...
Definition: sphash.F90:302
character(len=80) function, public str_center(s_in, l_in)
puts space around string, so that it is centered
Definition: string.F90:153
brief This module defines the class unit_t which is used by the unit_systems_oct_m module.
Definition: unit.F90:111
character(len=20) pure function, public units_abbrev(this)
Definition: unit.F90:202
subroutine, public varinfo_print_option(iunit, var, option, pre)
Definition: varinfo.F90:291
subroutine, public varinfo_print(iunit, var, ierr)
Definition: varinfo.F90:184
static double f(double w, void *p)
void get_signal_description(fint *signum, char *signame)
Definition: signals.c:8435
This is defined even when running serial.
Definition: mpi.F90:121
int true(void)