Octopus
restart.F90
Go to the documentation of this file.
1!! Copyright (C) 2002-2006 M. Marques, A. Castro, A. Rubio, G. Bertsch
2!! Copyright (C) 2014 M. Oliveira
3!! Copyright (C) 2021 S. Ohlmann
4!! Copyright (C) 2025 M. Lueders
5!!
6!! This program is free software; you can redistribute it and/or modify
7!! it under the terms of the GNU General Public License as published by
8!! the Free Software Foundation; either version 2, or (at your option)
9!! any later version.
10!!
11!! This program is distributed in the hope that it will be useful,
12!! but WITHOUT ANY WARRANTY; without even the implied warranty of
13!! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14!! GNU General Public License for more details.
15!!
16!! You should have received a copy of the GNU General Public License
17!! along with this program; if not, write to the Free Software
18!! Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19!! 02110-1301, USA.
20!!
21
22#include "global.h"
23
24module restart_oct_m
25 use batch_oct_m
27 use debug_oct_m
28 use global_oct_m
29 use index_oct_m
30 use io_oct_m
32 use loct_oct_m
33 use mesh_oct_m
36 use mpi_oct_m
39 use parser_oct_m
42 use space_oct_m
43 use string_oct_m
46
47 implicit none
48
49 private
50 public :: &
52 restart_t, &
53 clean_stop, &
56
57
59 integer, parameter :: RESTART_N_DATA_TYPES = 15
60
61 integer, parameter, public :: &
62 RESTART_UNDEFINED = -1, &
63 restart_all = 0, &
64 restart_gs = 1, &
65 restart_unocc = 2, &
66 restart_td = 3, &
67 restart_em_resp = 4, &
69 restart_kdotp = 6, &
71 restart_vdw = 8, &
72 restart_casida = 9, &
73 restart_oct = 10, &
74 restart_partition = 11, &
75 restart_proj = 12, &
76 restart_iteration = 13, &
77 restart_custom = 14, &
78 restart_dm = 15
79
81 private
82 character(len=20) :: tag
83 character(len=MAX_PATH_LEN) :: basedir
84 character(len=MAX_PATH_LEN) :: dir
85 integer :: flags
86 end type restart_data_t
87
88
89 integer, parameter, public :: &
90 RESTART_TYPE_DUMP = 1, &
92
94 integer, parameter, public :: &
95 RESTART_FLAG_STATES = 1, &
96 restart_flag_rho = 2, &
98 restart_flag_mix = 8, &
99 restart_flag_skip = 16, &
101
105 private
106 character(len=20) :: tag
107 character(len=MAX_PATH_LEN) :: dir
108 ! !! These will be appended to the basedir
109 integer :: default_flags = 0
110 end type restart_basic_data_t
111
112 character(len=4), parameter :: type_string(2) = (/ "DUMP", "LOAD"/)
113
114
121 !
122 type restart_basic_t
123 private
124 type(namespace_t), pointer, public :: namespace
125 integer :: data_type = restart_undefined
126 integer :: type = restart_undefined
127 logical :: skip_
128 character(len=MAX_PATH_LEN) :: dir_
129 character(len=MAX_PATH_LEN) :: pwd
130 ! !! from or dumped to. It can be either dir or a subdirectory of dir.
131 ! !! pwd is set by restart_basic_open_dir()/restart_basic_close_dir()
132 character(len=MAX_PATH_LEN), public :: basedir
133 integer :: flags
134 type(mpi_grp_t) , public :: mpi_grp
135 logical :: initialized = .false.
136 logical, public :: grid_changed = .false.
137 contains
138 !note: the generic name 'init' here is introduced to be able to combine the two functions (restart_basic_init and restart_init)
139 ! with a common name, despite having a different signature (optional arguments in restart_init)
140 procedure, private :: restart_basic_init
141 generic :: init => restart_basic_init
142 procedure :: end => restart_basic_end
143 procedure :: open => restart_basic_open
144 procedure :: close => restart_basic_close
145 procedure :: open_dir => restart_basic_open_dir
146 procedure :: close_dir => restart_basic_close_dir
147 procedure :: mkdir => restart_basic_mkdir
148 procedure :: dir => restart_basic_dir
149 procedure :: rm => restart_basic_rm
150 procedure :: read => restart_basic_read
151 procedure :: write => restart_basic_write
152 procedure :: get_data_type => restart_basic_get_data_type
153 procedure :: get_info => restart_basic_get_info
154 procedure :: do_i_write => restart_basic_do_i_write
155 procedure :: skip => restart_basic_skip
156 procedure :: has_flag => restart_basic_has_flag
157 end type
158
159 type, extends(restart_basic_t) :: restart_t
160 private
161 type(multicomm_t), pointer :: mc
162 logical :: has_mesh
163 ! !! and mesh functions cannot be written or read.
164 integer(int64), allocatable :: map(:)
165 ! !! used in the current calculations.
166 integer, public :: file_format_states
167
168 contains
169 !note: the generic name 'init' here is introduced to be able to combine the two functions (restart_basic_init and restart_init)
170 ! with a common name, despite having a different signature (optional arguments in restart_init)
171 procedure, private :: restart_init
172 generic :: init => restart_init
173 procedure :: end => restart_end
174 procedure :: has_map => restart_has_map
175 procedure, private :: drestart_write_mesh_function, zrestart_write_mesh_function
176 generic :: write_mesh_function => drestart_write_mesh_function, zrestart_write_mesh_function
195 procedure :: get_info => restart_get_info
196
197 end type restart_t
198
203 type(restart_basic_data_t), parameter :: basic_info(restart_undefined:restart_n_data_types)= [&
204 restart_basic_data_t("Undefined", ""), &
205 restart_basic_data_t("All", ""), &
206 restart_basic_data_t("Ground-state", gs_dir), &
207 restart_basic_data_t("Unoccupied states", gs_dir), &
208 restart_basic_data_t("Time-dependent", td_dir), &
209 restart_basic_data_t("EM Resp.", em_resp_dir), &
210 restart_basic_data_t("EM Resp. FD", em_resp_fd_dir), &
212 restart_basic_data_t("Vib. Modes", vib_modes_dir), &
214 restart_basic_data_t("Casida", casida_dir), &
215 restart_basic_data_t("Optimal Control", oct_dir), &
217 restart_basic_data_t("GS for TDOutput", gs_dir), &
218 restart_basic_data_t("Iteration counter", iteration_dir), &
219 restart_basic_data_t("Custom data", ""), &
220 restart_basic_data_t("Adiabatic-state", dm_dir) &
224 ! from signals.c
226 interface restart_block_signals
227 subroutine block_signals()
228 implicit none
229 end subroutine block_signals
234 subroutine unblock_signals()
235 implicit none
236 end subroutine unblock_signals
237 end interface
239contains
242 function clean_stop(mpi_grp)
243 type(mpi_grp_t), intent(in) :: mpi_grp
244 logical :: clean_stop
246 logical :: file_exists
248 push_sub(clean_stop)
250 clean_stop = .false.
252 if (mpi_grp%is_root()) then
253 inquire(file='stop', exist=file_exists)
254 if (file_exists) then
255 call loct_rm('stop')
257 end if
258 end if
260 ! make sure all nodes agree on whether this condition occurred
261 call mpi_grp%bcast(clean_stop, 1, mpi_logical, 0)
262
263 if (clean_stop) then
264 message(1) = 'Clean STOP'
265 call messages_warning(1)
266 end if
268 pop_sub(clean_stop)
269 end function clean_stop
272 subroutine restart_basic_init(restart, namespace, data_type, type, ierr, dir)
273 class(restart_basic_t), intent(out) :: restart
274 type(namespace_t), target, intent(in) :: namespace
275 integer, intent(in) :: data_type
276 integer, intent(in) :: type
278 integer, intent(out) :: ierr
279 character(len=*), optional, intent(in) :: dir
281
282 character(len=MAX_PATH_LEN) :: basedir, dirname
283 integer :: iline, n_cols, idata_type, i
284 character(len=MAX_PATH_LEN) :: default_basedir
285 character(len=20) :: tag
286 type(block_t) :: blk
287 logical :: restart_write, dir_exists
288 character(len=MAX_NAMESPACE_LEN) :: namespace_prefix
289
291 push_sub(restart_basic_init)
292
293 ! Some initializations
294 restart%type = type
295
296 namespace_prefix = trim(namespace%get())
297
298 default_basedir = trim(io_workdir())//'/restart/'
299 restart%basedir = default_basedir
300 restart%skip_ = .false.
301 restart%data_type = data_type
302 if(data_type>0 .and. data_type<=restart_n_data_types) then
303 restart%flags = basic_info(data_type)%default_flags
304 else
305 restart%flags = 0
306 end if
307
308 if (data_type < restart_undefined .and. data_type > restart_n_data_types) then
309 message(1) = "Illegal data_type in restart_init"
310 call messages_fatal(1, namespace=namespace)
311 end if
312 restart%namespace => namespace
313
314 ierr = 0
315
316 ! Read input
317 call messages_obsolete_variable(namespace, 'RestartFileFormat', 'RestartOptions')
318 call messages_obsolete_variable(namespace, 'TmpDir', 'RestartOptions')
319 call messages_obsolete_variable(namespace, 'RestartDir', 'RestartOptions')
320 call messages_obsolete_variable(namespace, 'MeshPartitionRead', 'RestartOptions')
321 call messages_obsolete_variable(namespace, 'MeshPartitionWrite', 'RestartOptions')
322 call messages_obsolete_variable(namespace, 'MeshPartitionDir', 'RestartOptions')
323
324 !%Variable RestartOptions
325 !%Type block
326 !%Section Execution::IO
327 !%Description
328 !% <tt>Octopus</tt> usually stores binary information, such as the wavefunctions, to be used
329 !% in subsequent calculations. The most common example is the ground-state states
330 !% that are used to start a time-dependent calculation. This variable allows to control
331 !% where this information is written to or read from. The format of this block is the following:
332 !% for each line, the first column indicates the type of data, the second column indicates
333 !% the path to the directory that should be used to read and write that restart information, and the
334 !% third column, which is optional, allows one to set some flags to modify the way how the data
335 !% is read or written. For example, if you are running a time-dependent calculation, you can
336 !% indicate where <tt>Octopus</tt> can find the ground-state information in the following way:
337 !%
338 !% <tt>%RestartOptions
339 !% <br>&nbsp;&nbsp;restart_gs | "gs_restart"
340 !% <br>&nbsp;&nbsp;restart_td | "td_restart"
341 !% <br>%</tt>
342 !%
343 !% The second line of the above example also tells <tt>Octopus</tt> that the time-dependent restart data
344 !% should be read from and written to the "td_restart" directory.
345 !%
346 !% In case you want to change the path of all the restart directories, you can use the <tt>restart_all</tt> option.
347 !% When using the <tt>restart_all</tt> option, it is still possible to have a different restart directory for specific
348 !% data types. For example, when including the following block in your input file:
349 !%
350 !% <tt>%RestartOptions
351 !% <br>&nbsp;&nbsp;restart_all | "my_restart"
352 !% <br>&nbsp;&nbsp;restart_td&nbsp; | "td_restart"
353 !% <br>%</tt>
354 !%
355 !% the time-dependent restart information will be stored in the "td_restart" directory, while all the remaining
356 !% restart information will be stored in the "my_restart" directory.
357 !%
358 !% By default, the name of the "restart_all" directory is set to "restart".
359 !%
360 !%
361 !% For multisystem calculations, the namespace of each system is inserted between the `restart top` folder and the specific
362 !% directory for each data type. When specifying a folder for a given system, the corresponding namespace is added
363 !% automatically to the folder name, unless the flag `restart_literal` is added.
364 !%
365 !% Some <tt>CalculationMode</tt>s also take into account specific flags set in the third column of the <tt>RestartOptions</tt>
366 !% block. These are used to determine if some specific part of the restart data is to be taken into account
367 !% or not when reading the restart information. For example, when restarting a ground-state calculation, one can
368 !% set the <tt>restart_rho</tt> flags, so that the density used is not built from the saved wavefunctions, but is
369 !% instead read from the restart directory. In this case, the block should look like this:
370 !%
371 !% <tt>%RestartOptions
372 !% <br>&nbsp;&nbsp;restart_gs | "restart" | restart_rho
373 !% <br>%</tt>
374 !%
375 !% A list of available flags is given below, but note that the code might ignore some of them, which will happen if they
376 !% are not available for that particular calculation, or might assume some of them always present, which will happen
377 !% in case they are mandatory.
378 !%
379 !% Finally, note that all the restart information of a given data type is always stored in a subdirectory of the
380 !% specified path. The name of this subdirectory is fixed and cannot be changed. For example, ground-state information
381 !% will always be stored in a subdirectory named "gs". This makes it safe in most situations to use the same path for
382 !% all the data types. The name of these subdirectories is indicated in the description of the data types below.
383 !%
384 !% Currently, the available restart data types and flags are the following:
385 !%Option restart_all 0
386 !% (data type)
387 !% Option to globally change the path of all the restart information.
388 !%Option restart_gs 1
389 !% (data type)
390 !% The data resulting from a ground-state calculation.
391 !% This information is stored under the "gs" subdirectory.
392 !%Option restart_unocc 2
393 !% (data type)
394 !% The data resulting from an unoccupied states calculation. This information also corresponds to a ground state and
395 !% can be used as such, so it is stored under the same subdirectory as the one of restart_gs.
396 !%Option restart_td 3
397 !% (data type)
398 !% The data resulting from a real-time time-dependent calculation.
399 !% This information is stored under the "td" subdirectory.
400 !%Option restart_em_resp 4
401 !% (data type)
402 !% The data resulting from the calculation of the electromagnetic response using the Sternheimer approach.
403 !% This information is stored under the "em_resp" subdirectory.
404 !%Option restart_em_resp_fd 5
405 !% (data type)
406 !% The data resulting from the calculation of the electromagnetic response using finite-differences.
407 !% This information is stored under the "em_resp_fd" subdirectory.
408 !%Option restart_kdotp 6
409 !% (data type)
410 !% The data resulting from the calculation of effective masses by k.p perturbation theory.
411 !% This information is stored under the "kdotp" subdirectory.
412 !%Option restart_vib_modes 7
413 !% (data type)
414 !% The data resulting from the calculation of vibrational modes.
415 !% This information is stored under the "vib_modes" subdirectory.
416 !%Option restart_vdw 8
417 !% (data type)
418 !% The data resulting from the calculation of van der Waals coefficients.
419 !% This information is stored under the "vdw" subdirectory.
420 !%Option restart_casida 9
421 !% (data type)
422 !% The data resulting from a Casida calculation.
423 !% This information is stored under the "casida" subdirectory.
424 !%Option restart_oct 10
425 !% (data type)
426 !% The data for optimal control calculations.
427 !% This information is stored under the "opt-control" subdirectory.
428 !%Option restart_partition 11
429 !% (data type)
430 !% The data for the mesh partitioning.
431 !% This information is stored under the "partition" subdirectory.
432 !%Option restart_proj 12
433 !% (data type)
434 !% The ground-state to be used with the td_occup and populations options of <tt>TDOutput</tt>.
435 !% This information should be a ground state, so the "gs" subdirectory is used.
436 !%Option restart_states 1
437 !% (flag)
438 !% Read the electronic states. (not yet implemented)
439 !%Option restart_rho 2
440 !% (flag)
441 !% Read the electronic density.
442 !%Option restart_vhxc 4
443 !% (flag)
444 !% Read the Hartree and XC potentials.
445 !%Option restart_mix 8
446 !% (flag)
447 !% Read the SCF mixing information.
448 !%Option restart_skip 16
449 !% (flag)
450 !% This flag allows to selectively skip the reading and writing of specific restart information.
451 !%Option restart_literal 32
452 !% (flag)
453 !% Treat the given path literally, i.e. do not insert the namespace. This is useful for ensembles
454 !% if a given replica should read from a specific restart folder.
455 !% This flag only affects reading: when writing restart information it is ignored, so that each
456 !% system still dumps into its own namespaced folder and different replicas cannot overwrite
457 !% each others restart data.
458 !%End
459 if (parse_block(namespace, 'RestartOptions', blk) == 0) then
460
461
462 do iline = 1, parse_block_n(blk)
463 n_cols = parse_block_cols(blk,iline-1)
464
465 call parse_block_integer(blk, iline-1, 0, idata_type)
466 if (idata_type < 0 .or. idata_type > restart_n_data_types) then
467 call messages_input_error(namespace, 'RestartOptions', "Invalid data type", row=iline-1, column=0)
468 end if
469 if (data_type == 0) then
470 call parse_block_string(blk, iline-1, 1, default_basedir)
471 end if
472
473 if (idata_type == data_type .or. idata_type == 0) then
474 call parse_block_string(blk, iline-1, 1, restart%basedir)
475 if (n_cols > 2) call parse_block_integer(blk, iline-1, 2, restart%flags)
476
477 namespace_prefix = parse_get_full_name(namespace, 'RestartOptions')
478 namespace_prefix = namespace_prefix(1:len_trim(namespace_prefix)-len_trim('.RestartOptions'))
479
480 if (len_trim(namespace_prefix) == 0 .or. trim(namespace%get()) == trim(namespace_prefix)) then
481 namespace_prefix = trim(namespace%get())
482 end if
483
484 ! restart_literal is a read-side modifier only: it lets several systems
485 ! read from one shared folder. For dumps it is ignored, so each system
486 ! still writes to its own namespaced folder.
487 if (bitand(restart%flags, restart_flag_literal) > 0 .and. restart%type == restart_type_load) then
488 namespace_prefix = ""
489 end if
490
491 end if
492
493
494 end do
495 call parse_block_end(blk)
496
497 end if
498
499 basedir = restart%basedir
500 call add_last_slash(basedir)
501
502 do i=1, len(namespace_prefix)
503 if (namespace_prefix(i:i) == '.') namespace_prefix(i:i) = '/'
504 end do
505
506 ! append namespace and ensure a single trailing slash
507 basedir = trim(basedir)//trim(namespace_prefix)
508 call add_last_slash(basedir)
509 dirname = trim(basic_info(restart%data_type)%dir)
510
511 call mpi_grp_init(restart%mpi_grp, mpi_comm_undefined)
512
513 select case (restart%type)
514 case (restart_type_dump)
515 !%Variable RestartWrite
516 !%Type logical
517 !%Default true
518 !%Section Execution::IO
519 !%Description
520 !% If this variable is set to no, restart information is not
521 !% written. Note that some run modes will ignore this
522 !% option and write some restart information anyway.
523 !%End
524
525 call parse_variable(namespace, 'RestartWrite', .true., restart_write)
526 restart%skip_ = .not. restart_write
527
528 if (restart%skip_) then
529 message(1) = 'Restart information will not be written.'
530 call messages_info(1, namespace=namespace)
531 end if
532
533 case (restart_type_load)
534 ! This is set to true as an error condition, checked by assertions in some routines.
535 restart%skip_ = .false.
536
537 case default
538 message(1) = "Unknown restart type in restart_init"
539 call messages_fatal(1, namespace=namespace)
540 end select
541
542
543 ! If the restart data type is not defined, the directories should be set explicitly
544 if (restart%data_type == restart_undefined) then
545 assert(present(dir))
546 basedir = trim(dir)
547 dirname = ""
548 end if
549
550 ! Set final path
551 restart%dir_ = trim(basedir)//trim(dirname)
552 ! Remove any trailing "/" from the path (all the routines from this module should add the trailing "/" when needed)
553 if (index(restart%dir_, '/', .true.) == len_trim(restart%dir_)) then
554 restart%dir_ = restart%dir_(1:len_trim(restart%dir_)-1)
555 end if
556
557 ! Set initial path to the working directory
558 restart%pwd = restart%dir_
559
560 ! Check if the directory already exists and create it if necessary
561 if (restart%mpi_grp%is_root()) then
562 dir_exists = io_dir_exists(restart%pwd)
563 if (restart%type == restart_type_dump .and. .not. dir_exists) then
564 ! restart%pwd already encodes the namespace (or its suppression for
565 ! restart_literal); do not let io_workpath re-insert it, so that the
566 ! created directory matches where the payload is written and where the
567 ! io_dir_exists check above looked.
568 call io_mkdir(restart%pwd, parents=.true.)
569 end if
570 end if
571 if (restart%mpi_grp%size > 1) then
572 call restart%mpi_grp%bcast(dir_exists, 1, mpi_logical, 0)
573 end if
574
575 if (restart%data_type == restart_undefined) then
576 tag = "Some "
577 else
578 tag = trim(basic_info(data_type)%tag)
579 end if
580
581 select case (restart%type)
582 case (restart_type_dump)
583 if (.not. restart%skip_) then
584 message(1) = "Info: "//trim(tag)//" restart information will be written to '"//trim(restart%pwd)//"'."
585 call messages_info(1, namespace=namespace)
586 end if
587
588 case (restart_type_load)
589 if (.not. dir_exists) then
590 ierr = 1
591 restart%skip_ = .true.
592
593 message(1) = "Info: Could not find '"//trim(restart%pwd)//"' directory for restart."
594 message(2) = "Info: No restart information will be read."
595 call messages_info(2, namespace=namespace)
596 else
597 message(1) = "Info: "//trim(tag)//" restart information will be read from '"//trim(restart%pwd)//"'."
598 call messages_info(1, namespace=namespace)
599 end if
600
601 end select
602
603 restart%initialized = .true.
604
605 pop_sub(restart_basic_init)
606 end subroutine restart_basic_init
607
608 function restart_basic_do_i_write(restart) result(res)
609 class(restart_basic_t), intent(in) :: restart
610 logical :: res
611
612 res = restart%mpi_grp%is_root()
613
614 end function restart_basic_do_i_write
615
616 ! ---------------------------------------------------------
622 subroutine restart_init(restart, namespace, data_type, type, mc, ierr, mesh, dir, exact)
623 class(restart_t), intent(out) :: restart
624 type(namespace_t), target, intent(in) :: namespace
625 integer, intent(in) :: data_type
626 integer, intent(in) :: type
628 type(multicomm_t), target, intent(in) :: mc
629 integer, intent(out) :: ierr
630 class(mesh_t), optional, intent(in) :: mesh
632 character(len=*), optional, intent(in) :: dir
634 logical, optional, intent(in) :: exact
636
637 logical :: grid_changed, grid_reordered, exact_, with_changed_grid
638 integer :: default_format
639
640 push_sub(restart_init)
641
642 ierr = 0
643
644 call restart_basic_init(restart, namespace, data_type, type, ierr, dir)
645 ! At this point, ierr == 1 indicates that the folder did not exist for RESTART_TYPE_LOAD.
646 ! In this case, also restart%skip_ has been set.
647
648 restart%has_mesh = present(mesh)
649 restart%mc => mc
650 call mpi_grp_init(restart%mpi_grp, mc%master_comm)
651
652 ! Sanity checks
653 if (present(exact) .and. .not. present(mesh)) then
654 message(1) = "Error in restart_init: the 'exact' optional argument requires a mesh."
655 call messages_fatal(1, namespace=namespace)
656 end if
657
658 exact_ = optional_default(exact, .false.)
659
660 restart%has_mesh = present(mesh)
661 restart%mc => mc
662
663 if(present(mesh)) then
664 !%Variable RestartFileFormatStates
665 !%Type integer
666 !%Section Execution::IO
667 !%Description
668 !% File format used for writing and reading the restart files for the states.
669 !% Default is adios2 if support is available, otherwise obf.
670 !% Restart files for linear response calculations always use obf.
671 !%Option obf 1
672 !% obf is the Octopus binary format, for which there is one file for
673 !% each state.
674 !%Option adios2 2
675 !% For large systems, especially with many k points, having one file per state can
676 !% be problematic for the file system. This option selects a format based on the
677 !% ADIOS2 library which needs to be available. The library handles IO efficiently
678 !% including aggregation and makes the restart IO much faster. However, it does
679 !% not support all features that the default obf format supports. Moreover, it
680 !% might use more memory for internal aggregation. In case of out-of-memory issues,
681 !% you might need to rerun on more nodes.
682 !%End
683#ifdef HAVE_ADIOS2
684 default_format = option__restartfileformatstates__adios2
685#else
686 default_format = option__restartfileformatstates__obf
687#endif
688 call parse_variable(namespace, 'RestartFileFormatStates', default_format, restart%file_format_states)
689 if (.not. varinfo_valid_option('RestartFileFormatStates', restart%file_format_states)) then
690 call messages_input_error(namespace, 'RestartFileFormatStates')
691 end if
692
693 if (restart%file_format_states == option__restartfileformatstates__adios2) then
694 ! the ADIOS2 format requires the exact same mesh for restarting
695 exact_ = .true.
696#ifndef HAVE_ADIOS2
697 message(1) = "Error: adios2 restart file format requested, but not compiled against ADIOS2 library."
698 call messages_fatal(1)
699#endif
700 end if
701
702 !%Variable RestartWithChangedGrid
703 !%Type logical
704 !%Default false
705 !%Section Execution::IO
706 !%Description
707 !% Use restart data even when the grid has changed. Normally, this is not needed, but can be enabled.
708 !%End
709 call parse_variable(namespace, 'RestartWithChangedGrid', .false., with_changed_grid)
710
711 select case (restart%type)
712 case (restart_type_dump)
713 if (.not. restart%skip_) then
714 ! Dump the grid information. The main parameters of the grid should not change
715 ! during the calculation, so we should only need to dump it once.
716 ! Use global_namespace (as the load side does below): restart%pwd already
717 ! encodes the namespace, so io_workpath must not re-insert it, otherwise
718 ! the grid metadata and the payload would be written to different paths.
719 call index_dump(mesh%idx, mesh%np_part_global, restart%pwd, restart%mpi_grp, &
720 global_namespace, ierr)
721 if (ierr /= 0) then
722 message(1) = "Unable to write index map to '"//trim(restart%pwd)//"'."
723 call messages_fatal(1, namespace=namespace)
724 end if
725
726 call mesh_write_fingerprint(mesh, restart%pwd, "grid", restart%mpi_grp, global_namespace, ierr)
727 if (ierr /= 0) then
728 message(1) = "Unable to write mesh fingerprint to '"//trim(restart%pwd)//"/grid'."
729 call messages_fatal(1, namespace=namespace)
730 end if
731 end if
732
733 case (restart_type_load)
734 if(.not. restart%skip_) then
735 call mesh_check_dump_compatibility(mesh, restart%pwd, "grid", global_namespace, &
736 restart%mpi_grp, grid_changed, grid_reordered, restart%map, ierr)
737
738 ! Check whether an error occurred. In this case we cannot read.
739 if (ierr /= 0) then
740 if (ierr == 1) then
741 message(1) = "Unable to check mesh compatibility: unable to read mesh fingerprint"
742 message(2) = "in '"//trim(restart%pwd)//"'."
743 else if (ierr > 1) then
744 message(1) = "Mesh from current calculation is not compatible with mesh found in"
745 message(2) = "'"//trim(restart%pwd)//"'."
746 end if
747 message(3) = "No restart information will be read."
748 call messages_warning(3, namespace=namespace)
749 ierr = 1
750 end if
751
752 restart%grid_changed = grid_changed
753
754 ! Print some warnings in case the mesh is compatible, but changed.
755 if (grid_changed) then
756 if (grid_reordered) then
757 message(1) = "Info: Octopus is attempting to restart from a mesh with a different order of points."
758 else
759 message(1) = "Info: Octopus is attempting to restart from a different mesh."
760 end if
761 if (with_changed_grid) then
762 call messages_info(1, namespace=namespace)
763 else
764 message(2) = "This is disabled. To enable this, set RestartWithChangedGrid=True."
765 call messages_warning(2, namespace=namespace)
766 ierr = 1
767 end if
768 end if
769
770 if (exact_) then
771 restart%skip_ = grid_changed .and. .not. grid_reordered
772 if (restart%skip_) then
773 message(1) = "This calculation requires the exact same mesh to restart."
774 message(2) = "No restart information will be read from '"//trim(restart%pwd)//"'."
775 call messages_warning(2, namespace=namespace)
776 ierr = 1
777 end if
778 else
779 restart%skip_ = .false.
780 end if
781 end if
782 end select
783
784 ! Make sure all the processes have finished reading/writing all the grid information,
785 ! as there might be some subsequent calls to this function where that information will
786 ! be written/read to/from the same directory.
787 if (restart%mpi_grp%size > 1) then
788 call restart%mpi_grp%barrier()
789 end if
790
791 end if
792
793 pop_sub(restart_init)
794 end subroutine restart_init
795
796
797 subroutine restart_basic_end(restart)
798 class(restart_basic_t), intent(inout) :: restart
799
800 push_sub(restart_basic_end)
801
802 restart%type = 0
803 restart%data_type = 0
804 restart%skip_ = .true.
805
806 pop_sub(restart_basic_end)
807
808 end subroutine restart_basic_end
809
810 ! ---------------------------------------------------------
811 subroutine restart_end(restart)
812 class(restart_t), intent(inout) :: restart
813
814 push_sub(restart_end)
815
816 if (restart%mpi_grp%is_root() .and. .not. restart%skip_) then
817 select case (restart%type)
818 case (restart_type_load)
819 message(1) = "Info: Finished reading information "//trim(basic_info(restart%type)%tag)//" from '"//trim(restart%dir_)//"'."
820 call io_rm(trim(restart%pwd)//"/loading")
821 case (restart_type_dump)
822 call io_rm(trim(restart%pwd)//"/dumping")
823 message(1) = "Info: Finished writing information "//trim(basic_info(restart%type)%tag)//" to '"//trim(restart%dir_)//"'."
824 end select
825 call messages_info(1, namespace=restart%namespace)
826 end if
827
828 safe_deallocate_a(restart%map)
829 restart%has_mesh = .false.
830 nullify(restart%mc)
831
832 call restart_basic_end(restart)
833
834 pop_sub(restart_end)
835 end subroutine restart_end
836
837
838 ! ---------------------------------------------------------
845 function restart_basic_dir(restart)
846 class(restart_basic_t), intent(in) :: restart
847 character(len=MAX_PATH_LEN) :: restart_basic_dir
848
849 push_sub(restart_basic_dir)
850
851 restart_basic_dir = io_workpath(restart%pwd)
852
853 pop_sub(restart_basic_dir)
854 end function restart_basic_dir
855
856
857 ! ---------------------------------------------------------
860 subroutine restart_basic_open_dir(restart, dirname, ierr)
861 class(restart_basic_t), intent(inout) :: restart
862 character(len=*), intent(in) :: dirname
863 integer, intent(out) :: ierr
864
865 push_sub(restart_basic_open_dir)
866
867 assert(.not. restart%skip_)
868
869 ierr = 0
870
871 select case (restart%type)
872 case (restart_type_dump)
873 call restart_basic_mkdir(restart, dirname)
874 case (restart_type_load)
875 if (.not. loct_dir_exists(trim(restart%dir_)//"/"//trim(dirname))) then
876 ierr = 1
877 end if
878 end select
879
880 if (ierr == 0) then
881 if (index(dirname, '/', .true.) == len_trim(dirname)) then
882 restart%pwd = trim(restart%dir_)//"/"//dirname(1:len_trim(dirname)-1)
883 else
884 restart%pwd = trim(restart%dir_)//"/"//trim(dirname)
885 end if
886 end if
887
889 end subroutine restart_basic_open_dir
890
891
892 ! ---------------------------------------------------------
894 subroutine restart_basic_close_dir(restart)
895 class(restart_basic_t), intent(inout) :: restart
896
898
899 assert(.not. restart%skip_)
900
901 restart%pwd = restart%dir_
902
904 end subroutine restart_basic_close_dir
905
907 ! ---------------------------------------------------------
909 subroutine restart_basic_mkdir(restart, dirname)
910 class(restart_basic_t), intent(in) :: restart
911 character(len=*), intent(in) :: dirname
912
913 push_sub(restart_basic_mkdir)
914
915 assert(.not. restart%skip_)
916
917 assert(restart%type == restart_type_dump)
918
919 call io_mkdir(trim(restart%pwd)//"/"//trim(dirname), parents=.true.)
920
921 pop_sub(restart_basic_mkdir)
922 end subroutine restart_basic_mkdir
923
924
925 ! ---------------------------------------------------------
927 subroutine restart_basic_rm(restart, name)
928 class(restart_basic_t), intent(in) :: restart
929 character(len=*), intent(in) :: name
930
931 assert(.not. restart%skip_)
932 assert(restart%type == restart_type_dump)
933
934 push_sub(restart_basic_rm)
935
936 call io_rm(trim(restart%pwd)//"/"//trim(name))
937
938 pop_sub(restart_basic_rm)
939 end subroutine restart_basic_rm
941
942 ! ---------------------------------------------------------
949 function restart_basic_open(restart, filename, status, position, silent)
950 class(restart_basic_t), intent(in) :: restart
951 character(len=*), intent(in) :: filename
952 character(len=*), optional, intent(in) :: status
953 character(len=*), optional, intent(in) :: position
954 logical, optional, intent(in) :: silent
955 integer :: restart_basic_open
956
957 logical :: die
958 character(len=20) :: action, status_
959
960 push_sub(restart_basic_open)
961
962 assert(restart%initialized)
963 assert(.not. restart%skip_)
964
965 select case (restart%type)
966 case (restart_type_dump)
967 status_ = 'unknown'
968 action = 'write'
969 die = .true.
970
971 case (restart_type_load)
972 status_ = 'old'
973 action = 'read'
974 die = .false.
975
976 case default
977 message(1) = "Error in restart_basic_open: illegal restart type"
978 call messages_fatal(1)
979 end select
980
981 if (present(status)) status_ = status
982
983 restart_basic_open = io_open(trim(restart%pwd)//"/"//trim(filename), &
984 action=trim(action), status=trim(status_), &
985 die=die, position=position, form="formatted", grp=restart%mpi_grp)
986
987 if (restart_basic_open == -1 .and. .not. optional_default(silent, .false.)) then
988 message(1) = "Unable to open file '"//trim(restart%pwd)//"/"//trim(filename)//"'."
990 end if
991
992 pop_sub(restart_basic_open)
993 end function restart_basic_open
994
995
996 ! ---------------------------------------------------------
997 subroutine restart_basic_write(restart, iunit, lines, nlines, ierr)
998 class(restart_basic_t), intent(in) :: restart
999 integer, intent(in) :: iunit
1000 character(len=*), intent(in) :: lines(:)
1001 integer, intent(in) :: nlines
1002 integer, intent(out) :: ierr
1003
1004 integer :: iline
1005
1006 push_sub(restart_basic_write)
1007
1008 if (iunit /= -1) then
1009 ierr = 0
1010 if (restart%mpi_grp%is_root()) then
1011 do iline = 1, nlines
1012 write(iunit,"(a)") trim(lines(iline))
1013 end do
1014 end if
1015 else
1016 ierr = 1
1017 end if
1018
1019 pop_sub(restart_basic_write)
1020 end subroutine restart_basic_write
1021
1023 ! ---------------------------------------------------------
1024 subroutine restart_basic_read(restart, iunit, lines, nlines, ierr)
1025 class(restart_basic_t), intent(in) :: restart
1026 integer, intent(in) :: iunit
1027 character(len=*), intent(out) :: lines(:)
1028 integer, intent(in) :: nlines
1029 integer, intent(out) :: ierr
1030
1031 push_sub(restart_basic_read)
1032
1033 call iopar_read(restart%mpi_grp, iunit, lines, nlines, ierr)
1034
1035 pop_sub(restart_basic_read)
1036 end subroutine restart_basic_read
1037
1038
1039 ! ---------------------------------------------------------
1041 subroutine restart_basic_close(restart, iunit)
1042 class(restart_basic_t), intent(in) :: restart
1043 integer, intent(inout) :: iunit
1045 push_sub(restart_basic_close)
1046
1047 if (iunit /= -1) call io_close(iunit, restart%mpi_grp)
1048
1049 call restart%mpi_grp%barrier()
1050
1051 pop_sub(restart_basic_close)
1052 end subroutine restart_basic_close
1053
1054
1055 ! ---------------------------------------------------------
1060 logical pure function restart_basic_skip(restart)
1061 class(restart_basic_t), intent(in) :: restart
1062
1063 restart_basic_skip = restart%skip_ .or. restart%has_flag(restart_flag_skip)
1064
1065 end function restart_basic_skip
1066
1067
1068 ! ---------------------------------------------------------
1070 logical pure function restart_basic_has_flag(restart, flag)
1071 class(restart_basic_t), intent(in) :: restart
1072 integer, intent(in) :: flag
1073
1074 restart_basic_has_flag = bitand(restart%flags, flag) /= 0
1075
1076 end function restart_basic_has_flag
1077
1078
1079 ! ---------------------------------------------------------
1081 logical pure function restart_has_map(restart)
1082 class(restart_t), intent(in) :: restart
1083
1084 restart_has_map = allocated(restart%map)
1085
1086 end function restart_has_map
1087
1088
1090 integer pure function restart_basic_get_data_type(restart)
1091 class(restart_basic_t), intent(in) :: restart
1093 restart_basic_get_data_type = restart%data_type
1094 end function restart_basic_get_data_type
1095
1096 function restart_basic_get_info(restart) result(info)
1097 class(restart_basic_t), intent(in) :: restart
1098
1099 character(:), allocatable :: info
1100
1101 info = "restart_basic "//trim(basic_info(restart%data_type)%tag)//" "//type_string(restart%type)
1102
1103 end function restart_basic_get_info
1104
1105 function restart_get_info(restart) result(info)
1106 class(restart_t), intent(in) :: restart
1107
1108 character(:), allocatable :: info
1109
1110 info = "restart "//trim(basic_info(restart%data_type)%tag)//" "//type_string(restart%type)
1111
1112 end function restart_get_info
1113
1114#include "undef.F90"
1115#include "real.F90"
1116#include "restart_inc.F90"
1117
1118#include "undef.F90"
1119#include "complex.F90"
1120#include "restart_inc.F90"
1121
1122end module restart_oct_m
1123
1124
1125!! Local Variables:
1126!! mode: f90
1127!! coding: utf-8
1128!! End:
block signals while writing the restart files
Definition: restart.F90:321
unblock signals when writing restart is finished
Definition: restart.F90:328
This module implements batches of mesh functions.
Definition: batch.F90:135
This module handles the calculation mode.
character(len= *), parameter, public em_resp_fd_dir
Definition: global.F90:282
character(len= *), parameter, public gs_dir
Definition: global.F90:278
character(len= *), parameter, public iteration_dir
Definition: global.F90:290
character(len= *), parameter, public casida_dir
Definition: global.F90:286
character(len= *), parameter, public vib_modes_dir
Definition: global.F90:284
character(len= *), parameter, public partition_dir
Definition: global.F90:289
character(len= *), parameter, public kdotp_dir
Definition: global.F90:283
character(len= *), parameter, public dm_dir
Definition: global.F90:291
character(len= *), parameter, public em_resp_dir
Definition: global.F90:281
character(len= *), parameter, public td_dir
Definition: global.F90:279
character(len= *), parameter, public vdw_dir
Definition: global.F90:285
character(len= *), parameter, public oct_dir
Definition: global.F90:287
This module implements the index, used for the mesh points.
Definition: index.F90:124
subroutine, public index_dump(idx, np, dir, mpi_grp, namespace, ierr)
Definition: index.F90:311
Definition: io.F90:116
subroutine, public io_close(iunit, grp)
Definition: io.F90:467
subroutine, public iopar_read(grp, iunit, lines, n_lines, ierr)
Definition: io.F90:588
character(len=max_path_len) function, public io_workpath(path, namespace)
construct path name from given name and namespace
Definition: io.F90:318
subroutine, public io_rm(fname, namespace)
Definition: io.F90:392
character(len=max_path_len) function, public io_workdir()
construct working directory
Definition: io.F90:286
subroutine, public io_mkdir(fname, namespace, parents)
Definition: io.F90:361
logical function, public io_dir_exists(dir, namespace)
Returns true if a dir with name 'dir' exists.
Definition: io.F90:579
integer function, public io_open(file, namespace, action, status, form, position, die, recl, grp)
Definition: io.F90:402
System information (time, memory, sysname)
Definition: loct.F90:117
subroutine, public loct_rm(name)
Definition: loct.F90:318
logical function, public loct_dir_exists(dirname)
Definition: loct.F90:349
This module defines functions over batches of mesh functions.
Definition: mesh_batch.F90:118
This module defines the meshes, which are used in Octopus.
Definition: mesh.F90:120
subroutine, public mesh_check_dump_compatibility(mesh, dir, filename, namespace, mpi_grp, grid_changed, grid_reordered, map, ierr)
Definition: mesh.F90:601
subroutine, public mesh_write_fingerprint(mesh, dir, filename, mpi_grp, namespace, ierr)
Definition: mesh.F90:465
subroutine, public messages_warning(no_lines, all_nodes, namespace)
Definition: messages.F90:525
subroutine, public messages_obsolete_variable(namespace, name, rep)
Definition: messages.F90:1000
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
Definition: messages.F90:162
subroutine, public messages_fatal(no_lines, only_root_writes, namespace)
Definition: messages.F90:410
subroutine, public messages_input_error(namespace, var, details, row, column)
Definition: messages.F90:691
subroutine, public messages_info(no_lines, iunit, debug_only, stress, all_nodes, namespace)
Definition: messages.F90:594
type(mpi_comm), parameter, public mpi_comm_undefined
used to indicate a communicator has not been initialized
Definition: mpi.F90:138
subroutine mpi_grp_init(grp, comm)
Initialize MPI group instance.
Definition: mpi.F90:407
This module handles the communicators for the various parallelization strategies.
Definition: multicomm.F90:147
type(namespace_t), public global_namespace
Definition: namespace.F90:135
Some general things and nomenclature:
Definition: par_vec.F90:173
character(len=:) function, allocatable, public parse_get_full_name(namespace, varname)
Given a namespace and a variable name, this function will iterate over all namespace ancestors contai...
Definition: parser.F90:781
subroutine, public parse_block_string(blk, l, c, res, convert_to_c)
Definition: parser.F90:818
integer function, public parse_block(namespace, name, blk, check_varinfo_)
Definition: parser.F90:623
subroutine zrestart_write_binary3_int32(restart, filename, np, ff, ierr, root)
Definition: restart.F90:2412
subroutine drestart_write_binary1_int32(restart, filename, np, ff, ierr, root)
Definition: restart.F90:1739
subroutine drestart_read_binary3(restart, filename, np, ff, ierr)
Definition: restart.F90:1685
logical pure function restart_has_map(restart)
Returns true if the restart was from a different order of mesh points.
Definition: restart.F90:1177
integer, parameter, public restart_partition
Definition: restart.F90:156
integer, parameter, public restart_custom
Definition: restart.F90:156
subroutine drestart_write_binary5(restart, filename, np, ff, ierr, root)
Definition: restart.F90:1587
subroutine restart_basic_end(restart)
Definition: restart.F90:893
subroutine restart_basic_open_dir(restart, dirname, ierr)
Change the restart directory to dirname, where "dirname" is a subdirectory of the base restart direct...
Definition: restart.F90:956
integer, parameter, public restart_dm
Definition: restart.F90:156
subroutine restart_basic_mkdir(restart, dirname)
Make directory "dirname" inside the current restart directory.
Definition: restart.F90:1005
integer, parameter, public restart_all
Definition: restart.F90:156
subroutine restart_basic_close(restart, iunit)
Close a file previously opened with restart_basic_open.
Definition: restart.F90:1137
subroutine drestart_read_binary1(restart, filename, np, ff, ierr)
Definition: restart.F90:1629
subroutine restart_basic_close_dir(restart)
Change back to the base directory. To be called after restart_basic_open_dir.
Definition: restart.F90:990
subroutine zrestart_write_binary1(restart, filename, np, ff, ierr, root)
Definition: restart.F90:2106
integer, parameter, public restart_casida
Definition: restart.F90:156
subroutine zrestart_write_binary5_int32(restart, filename, np, ff, ierr, root)
Definition: restart.F90:2426
subroutine zrestart_read_binary5_int32(restart, filename, np, ff, ierr)
Definition: restart.F90:2481
integer, parameter, public restart_kdotp
Definition: restart.F90:156
subroutine zrestart_read_binary3(restart, filename, np, ff, ierr)
Definition: restart.F90:2330
integer, parameter, public restart_oct
Definition: restart.F90:156
subroutine drestart_read_binary3_int32(restart, filename, np, ff, ierr)
Definition: restart.F90:1823
type(restart_basic_data_t), dimension(restart_undefined:restart_n_data_types), parameter basic_info
Information about the components for a given system.
Definition: restart.F90:298
subroutine zrestart_read_binary3_int32(restart, filename, np, ff, ierr)
Definition: restart.F90:2468
subroutine drestart_read_binary2(restart, filename, np, ff, ierr)
Definition: restart.F90:1657
integer, parameter, public restart_gs
Definition: restart.F90:156
subroutine zrestart_read_binary1_int32(restart, filename, np, ff, ierr)
Definition: restart.F90:2440
integer, parameter, public restart_iteration
Definition: restart.F90:156
subroutine drestart_write_binary3(restart, filename, np, ff, ierr, root)
Definition: restart.F90:1545
integer, parameter, public restart_flag_mix
Definition: restart.F90:189
subroutine drestart_write_binary3_int32(restart, filename, np, ff, ierr, root)
Definition: restart.F90:1767
subroutine zrestart_write_binary1_int32(restart, filename, np, ff, ierr, root)
Definition: restart.F90:2384
subroutine restart_init(restart, namespace, data_type, type, mc, ierr, mesh, dir, exact)
Initializes a specific restart object.
Definition: restart.F90:718
integer function restart_basic_open(restart, filename, status, position, silent)
Open file "filename" found inside the current restart directory. Depending on the type of restart,...
Definition: restart.F90:1045
integer, parameter, public restart_flag_skip
Definition: restart.F90:189
integer, parameter, public restart_em_resp_fd
Definition: restart.F90:156
subroutine drestart_read_binary2_int32(restart, filename, np, ff, ierr)
Definition: restart.F90:1809
subroutine drestart_write_binary5_int32(restart, filename, np, ff, ierr, root)
Definition: restart.F90:1781
subroutine restart_basic_rm(restart, name)
Remove directory or file "name" that is located inside the current restart directory.
Definition: restart.F90:1023
subroutine restart_end(restart)
Definition: restart.F90:907
integer, parameter, public restart_proj
Definition: restart.F90:156
subroutine zrestart_read_binary1(restart, filename, np, ff, ierr)
Definition: restart.F90:2274
integer, parameter, public restart_flag_rho
Definition: restart.F90:189
integer, parameter, public restart_em_resp
Definition: restart.F90:156
integer, parameter, public restart_vib_modes
Definition: restart.F90:156
logical function, public clean_stop(mpi_grp)
returns true if a file named stop exists
Definition: restart.F90:338
subroutine drestart_write_binary1(restart, filename, np, ff, ierr, root)
Definition: restart.F90:1461
subroutine drestart_read_binary1_int32(restart, filename, np, ff, ierr)
Definition: restart.F90:1795
subroutine zrestart_write_binary5(restart, filename, np, ff, ierr, root)
Definition: restart.F90:2232
subroutine zrestart_read_mesh_function(restart, filename, mesh, ff, ierr)
In domain parallel case each process reads a part of the file. At the end all the processes have the ...
Definition: restart.F90:2005
integer, parameter, public restart_flag_vhxc
Definition: restart.F90:189
logical pure function restart_basic_has_flag(restart, flag)
Returns true if...
Definition: restart.F90:1166
subroutine restart_basic_write(restart, iunit, lines, nlines, ierr)
Definition: restart.F90:1093
integer, parameter, public restart_flag_literal
Definition: restart.F90:189
subroutine drestart_read_binary5_int32(restart, filename, np, ff, ierr)
Definition: restart.F90:1836
subroutine drestart_write_binary2(restart, filename, np, ff, ierr, root)
Definition: restart.F90:1503
subroutine drestart_read_binary5(restart, filename, np, ff, ierr)
Definition: restart.F90:1712
character(len=max_path_len) function restart_basic_dir(restart)
Returns the name of the directory containing the restart information. The use of this function should...
Definition: restart.F90:941
subroutine zrestart_write_binary2_int32(restart, filename, np, ff, ierr, root)
Definition: restart.F90:2398
character(len=4), dimension(2), parameter type_string
Definition: restart.F90:207
logical pure function restart_basic_skip(restart)
Returns true if the restart information should neither be read nor written. This might happen because...
Definition: restart.F90:1156
integer, parameter, public restart_td
Definition: restart.F90:156
subroutine drestart_read_mesh_function(restart, filename, mesh, ff, ierr)
In domain parallel case each process reads a part of the file. At the end all the processes have the ...
Definition: restart.F90:1360
integer, parameter, public restart_type_load
Definition: restart.F90:184
character(:) function, allocatable restart_basic_get_info(restart)
Definition: restart.F90:1192
subroutine restart_basic_read(restart, iunit, lines, nlines, ierr)
Definition: restart.F90:1120
subroutine zrestart_read_binary2(restart, filename, np, ff, ierr)
Definition: restart.F90:2302
integer pure function restart_basic_get_data_type(restart)
Returns the data type of the restart.
Definition: restart.F90:1186
integer, parameter, public restart_vdw
Definition: restart.F90:156
subroutine zrestart_read_binary5(restart, filename, np, ff, ierr)
Definition: restart.F90:2357
subroutine zrestart_write_binary2(restart, filename, np, ff, ierr, root)
Definition: restart.F90:2148
integer, parameter, public restart_unocc
Definition: restart.F90:156
subroutine zrestart_write_binary3(restart, filename, np, ff, ierr, root)
Definition: restart.F90:2190
subroutine zrestart_read_binary2_int32(restart, filename, np, ff, ierr)
Definition: restart.F90:2454
logical function restart_basic_do_i_write(restart)
Definition: restart.F90:704
character(:) function, allocatable restart_get_info(restart)
Definition: restart.F90:1201
subroutine restart_basic_init(restart, namespace, data_type, type, ierr, dir)
Definition: restart.F90:368
subroutine drestart_write_binary2_int32(restart, filename, np, ff, ierr, root)
Definition: restart.F90:1753
subroutine, public add_last_slash(str)
Adds a '/' in the end of the string, only if it missing. Useful for directories.
Definition: string.F90:162
This module defines the unit system, used for input and output.
Describes mesh distribution to nodes.
Definition: mesh.F90:188
This is defined even when running serial.
Definition: mpi.F90:144
Stores all communicators and groups.
Definition: multicomm.F90:208
restart_basic_data_t stores global information about a specific component we want to save....
Definition: restart.F90:199
restart_basic_t stores the basic information about a restart object.
Definition: restart.F90:217
int true(void)