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(comm)
243 type(mpi_comm), intent(in) :: comm
244 logical :: clean_stop
246 logical :: file_exists
248 push_sub(clean_stop)
250 clean_stop = .false.
252 if (mpi_world%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#ifdef HAVE_MPI
261 ! make sure all nodes agree on whether this condition occurred
262 call mpi_bcast(clean_stop, 1, mpi_logical, 0, comm)
263#endif
264
265 if (clean_stop) then
266 message(1) = 'Clean STOP'
268 end if
270 pop_sub(clean_stop)
271 end function clean_stop
274 subroutine restart_basic_init(restart, namespace, data_type, type, ierr, dir)
275 class(restart_basic_t), intent(out) :: restart
276 type(namespace_t), target, intent(in) :: namespace
277 integer, intent(in) :: data_type
278 integer, intent(in) :: type
280 integer, intent(out) :: ierr
281 character(len=*), optional, intent(in) :: dir
283
284 character(len=MAX_PATH_LEN) :: basedir, dirname
285 integer :: iline, n_cols, idata_type, i
286 character(len=MAX_PATH_LEN) :: default_basedir
287 character(len=20) :: tag
288 type(block_t) :: blk
289 logical :: restart_write, dir_exists
290 character(len=MAX_NAMESPACE_LEN) :: namespace_prefix
291
292
293 push_sub(restart_basic_init)
294
295 ! Some initializations
296 restart%type = type
297
298 namespace_prefix = trim(namespace%get())
299
300 default_basedir = trim(io_workdir())//'/restart/'
301 restart%basedir = default_basedir
302 restart%skip_ = .false.
303 restart%data_type = data_type
304 if(data_type>0 .and. data_type<=restart_n_data_types) then
305 restart%flags = basic_info(data_type)%default_flags
306 else
307 restart%flags = 0
308 end if
309
310 if (data_type < restart_undefined .and. data_type > restart_n_data_types) then
311 message(1) = "Illegal data_type in restart_init"
312 call messages_fatal(1, namespace=namespace)
313 end if
314 restart%namespace => namespace
315
316 ierr = 0
317
318 ! Read input
319 call messages_obsolete_variable(namespace, 'RestartFileFormat', 'RestartOptions')
320 call messages_obsolete_variable(namespace, 'TmpDir', 'RestartOptions')
321 call messages_obsolete_variable(namespace, 'RestartDir', 'RestartOptions')
322 call messages_obsolete_variable(namespace, 'MeshPartitionRead', 'RestartOptions')
323 call messages_obsolete_variable(namespace, 'MeshPartitionWrite', 'RestartOptions')
324 call messages_obsolete_variable(namespace, 'MeshPartitionDir', 'RestartOptions')
325
326 !%Variable RestartOptions
327 !%Type block
328 !%Section Execution::IO
329 !%Description
330 !% <tt>Octopus</tt> usually stores binary information, such as the wavefunctions, to be used
331 !% in subsequent calculations. The most common example is the ground-state states
332 !% that are used to start a time-dependent calculation. This variable allows to control
333 !% where this information is written to or read from. The format of this block is the following:
334 !% for each line, the first column indicates the type of data, the second column indicates
335 !% the path to the directory that should be used to read and write that restart information, and the
336 !% third column, which is optional, allows one to set some flags to modify the way how the data
337 !% is read or written. For example, if you are running a time-dependent calculation, you can
338 !% indicate where <tt>Octopus</tt> can find the ground-state information in the following way:
339 !%
340 !% <tt>%RestartOptions
341 !% <br>&nbsp;&nbsp;restart_gs | "gs_restart"
342 !% <br>&nbsp;&nbsp;restart_td | "td_restart"
343 !% <br>%</tt>
344 !%
345 !% The second line of the above example also tells <tt>Octopus</tt> that the time-dependent restart data
346 !% should be read from and written to the "td_restart" directory.
347 !%
348 !% In case you want to change the path of all the restart directories, you can use the <tt>restart_all</tt> option.
349 !% When using the <tt>restart_all</tt> option, it is still possible to have a different restart directory for specific
350 !% data types. For example, when including the following block in your input file:
351 !%
352 !% <tt>%RestartOptions
353 !% <br>&nbsp;&nbsp;restart_all | "my_restart"
354 !% <br>&nbsp;&nbsp;restart_td&nbsp; | "td_restart"
355 !% <br>%</tt>
356 !%
357 !% the time-dependent restart information will be stored in the "td_restart" directory, while all the remaining
358 !% restart information will be stored in the "my_restart" directory.
359 !%
360 !% By default, the name of the "restart_all" directory is set to "restart".
361 !%
362 !%
363 !% For multisystem calculations, the namespace of each system is inserted between the `restart top` folder and the specific
364 !% directory for each data type. When specifying a folder for a given system, the corresponding namespace is added
365 !% automatically to the folder name, unless the flag `restart_literal` is added.
366 !%
367 !% Some <tt>CalculationMode</tt>s also take into account specific flags set in the third column of the <tt>RestartOptions</tt>
368 !% block. These are used to determine if some specific part of the restart data is to be taken into account
369 !% or not when reading the restart information. For example, when restarting a ground-state calculation, one can
370 !% set the <tt>restart_rho</tt> flags, so that the density used is not built from the saved wavefunctions, but is
371 !% instead read from the restart directory. In this case, the block should look like this:
372 !%
373 !% <tt>%RestartOptions
374 !% <br>&nbsp;&nbsp;restart_gs | "restart" | restart_rho
375 !% <br>%</tt>
376 !%
377 !% A list of available flags is given below, but note that the code might ignore some of them, which will happen if they
378 !% are not available for that particular calculation, or might assume some of them always present, which will happen
379 !% in case they are mandatory.
380 !%
381 !% Finally, note that all the restart information of a given data type is always stored in a subdirectory of the
382 !% specified path. The name of this subdirectory is fixed and cannot be changed. For example, ground-state information
383 !% will always be stored in a subdirectory named "gs". This makes it safe in most situations to use the same path for
384 !% all the data types. The name of these subdirectories is indicated in the description of the data types below.
385 !%
386 !% Currently, the available restart data types and flags are the following:
387 !%Option restart_all 0
388 !% (data type)
389 !% Option to globally change the path of all the restart information.
390 !%Option restart_gs 1
391 !% (data type)
392 !% The data resulting from a ground-state calculation.
393 !% This information is stored under the "gs" subdirectory.
394 !%Option restart_unocc 2
395 !% (data type)
396 !% The data resulting from an unoccupied states calculation. This information also corresponds to a ground state and
397 !% can be used as such, so it is stored under the same subdirectory as the one of restart_gs.
398 !%Option restart_td 3
399 !% (data type)
400 !% The data resulting from a real-time time-dependent calculation.
401 !% This information is stored under the "td" subdirectory.
402 !%Option restart_em_resp 4
403 !% (data type)
404 !% The data resulting from the calculation of the electromagnetic response using the Sternheimer approach.
405 !% This information is stored under the "em_resp" subdirectory.
406 !%Option restart_em_resp_fd 5
407 !% (data type)
408 !% The data resulting from the calculation of the electromagnetic response using finite-differences.
409 !% This information is stored under the "em_resp_fd" subdirectory.
410 !%Option restart_kdotp 6
411 !% (data type)
412 !% The data resulting from the calculation of effective masses by k.p perturbation theory.
413 !% This information is stored under the "kdotp" subdirectory.
414 !%Option restart_vib_modes 7
415 !% (data type)
416 !% The data resulting from the calculation of vibrational modes.
417 !% This information is stored under the "vib_modes" subdirectory.
418 !%Option restart_vdw 8
419 !% (data type)
420 !% The data resulting from the calculation of van der Waals coefficients.
421 !% This information is stored under the "vdw" subdirectory.
422 !%Option restart_casida 9
423 !% (data type)
424 !% The data resulting from a Casida calculation.
425 !% This information is stored under the "casida" subdirectory.
426 !%Option restart_oct 10
427 !% (data type)
428 !% The data for optimal control calculations.
429 !% This information is stored under the "opt-control" subdirectory.
430 !%Option restart_partition 11
431 !% (data type)
432 !% The data for the mesh partitioning.
433 !% This information is stored under the "partition" subdirectory.
434 !%Option restart_proj 12
435 !% (data type)
436 !% The ground-state to be used with the td_occup and populations options of <tt>TDOutput</tt>.
437 !% This information should be a ground state, so the "gs" subdirectory is used.
438 !%Option restart_states 1
439 !% (flag)
440 !% Read the electronic states. (not yet implemented)
441 !%Option restart_rho 2
442 !% (flag)
443 !% Read the electronic density.
444 !%Option restart_vhxc 4
445 !% (flag)
446 !% Read the Hartree and XC potentials.
447 !%Option restart_mix 8
448 !% (flag)
449 !% Read the SCF mixing information.
450 !%Option restart_skip 16
451 !% (flag)
452 !% This flag allows to selectively skip the reading and writing of specific restart information.
453 !%Option restart_literal 32
454 !% (flag)
455 !% Treat the given path literally, i.e. do not insert the namespace. This is useful for ensembles
456 !% if a given replica should read from a specific restart folder.
457 !% This flag only affects reading: when writing restart information it is ignored, so that each
458 !% system still dumps into its own namespaced folder and different replicas cannot overwrite
459 !% each others restart data.
460 !%End
461 if (parse_block(namespace, 'RestartOptions', blk) == 0) then
462
463
464 do iline = 1, parse_block_n(blk)
465 n_cols = parse_block_cols(blk,iline-1)
466
467 call parse_block_integer(blk, iline-1, 0, idata_type)
468 if (idata_type < 0 .or. idata_type > restart_n_data_types) then
469 call messages_input_error(namespace, 'RestartOptions', "Invalid data type", row=iline-1, column=0)
470 end if
471 if (data_type == 0) then
472 call parse_block_string(blk, iline-1, 1, default_basedir)
473 end if
474
475 if (idata_type == data_type .or. idata_type == 0) then
476 call parse_block_string(blk, iline-1, 1, restart%basedir)
477 if (n_cols > 2) call parse_block_integer(blk, iline-1, 2, restart%flags)
478
479 namespace_prefix = parse_get_full_name(namespace, 'RestartOptions')
480 namespace_prefix = namespace_prefix(1:len_trim(namespace_prefix)-len_trim('.RestartOptions'))
481
482 if (len_trim(namespace_prefix) == 0 .or. trim(namespace%get()) == trim(namespace_prefix)) then
483 namespace_prefix = trim(namespace%get())
484 end if
485
486 ! restart_literal is a read-side modifier only: it lets several systems
487 ! read from one shared folder. For dumps it is ignored, so each system
488 ! still writes to its own namespaced folder.
489 if (bitand(restart%flags, restart_flag_literal) > 0 .and. restart%type == restart_type_load) then
490 namespace_prefix = ""
491 end if
492
493 end if
494
495
496 end do
497 call parse_block_end(blk)
498
499 end if
500
501 basedir = restart%basedir
502 call add_last_slash(basedir)
503
504 do i=1, len(namespace_prefix)
505 if (namespace_prefix(i:i) == '.') namespace_prefix(i:i) = '/'
506 end do
507
508 ! append namespace and ensure a single trailing slash
509 basedir = trim(basedir)//trim(namespace_prefix)
510 call add_last_slash(basedir)
511 dirname = trim(basic_info(restart%data_type)%dir)
512
513 call mpi_grp_init(restart%mpi_grp, mpi_comm_undefined)
514
515 select case (restart%type)
516 case (restart_type_dump)
517 !%Variable RestartWrite
518 !%Type logical
519 !%Default true
520 !%Section Execution::IO
521 !%Description
522 !% If this variable is set to no, restart information is not
523 !% written. Note that some run modes will ignore this
524 !% option and write some restart information anyway.
525 !%End
526
527 call parse_variable(namespace, 'RestartWrite', .true., restart_write)
528 restart%skip_ = .not. restart_write
529
530 if (restart%skip_) then
531 message(1) = 'Restart information will not be written.'
532 call messages_info(1, namespace=namespace)
533 end if
534
535 case (restart_type_load)
536 ! This is set to true as an error condition, checked by assertions in some routines.
537 restart%skip_ = .false.
538
539 case default
540 message(1) = "Unknown restart type in restart_init"
541 call messages_fatal(1, namespace=namespace)
542 end select
543
544
545 ! If the restart data type is not defined, the directories should be set explicitly
546 if (restart%data_type == restart_undefined) then
547 assert(present(dir))
548 basedir = trim(dir)
549 dirname = ""
550 end if
551
552 ! Set final path
553 restart%dir_ = trim(basedir)//trim(dirname)
554 ! Remove any trailing "/" from the path (all the routines from this module should add the trailing "/" when needed)
555 if (index(restart%dir_, '/', .true.) == len_trim(restart%dir_)) then
556 restart%dir_ = restart%dir_(1:len_trim(restart%dir_)-1)
557 end if
558
559 ! Set initial path to the working directory
560 restart%pwd = restart%dir_
561
562 ! Check if the directory already exists and create it if necessary
563 if (restart%mpi_grp%is_root()) then
564 dir_exists = io_dir_exists(restart%pwd)
565 if (restart%type == restart_type_dump .and. .not. dir_exists) then
566 ! restart%pwd already encodes the namespace (or its suppression for
567 ! restart_literal); do not let io_workpath re-insert it, so that the
568 ! created directory matches where the payload is written and where the
569 ! io_dir_exists check above looked.
570 call io_mkdir(restart%pwd, parents=.true.)
571 end if
572 end if
573 if (restart%mpi_grp%size > 1) then
574 call restart%mpi_grp%bcast(dir_exists, 1, mpi_logical, 0)
575 end if
576
577 if (restart%data_type == restart_undefined) then
578 tag = "Some "
579 else
580 tag = trim(basic_info(data_type)%tag)
581 end if
582
583 select case (restart%type)
584 case (restart_type_dump)
585 if (.not. restart%skip_) then
586 message(1) = "Info: "//trim(tag)//" restart information will be written to '"//trim(restart%pwd)//"'."
587 call messages_info(1, namespace=namespace)
588 end if
589
590 case (restart_type_load)
591 if (.not. dir_exists) then
592 ierr = 1
593 restart%skip_ = .true.
594
595 message(1) = "Info: Could not find '"//trim(restart%pwd)//"' directory for restart."
596 message(2) = "Info: No restart information will be read."
597 call messages_info(2, namespace=namespace)
598 else
599 message(1) = "Info: "//trim(tag)//" restart information will be read from '"//trim(restart%pwd)//"'."
600 call messages_info(1, namespace=namespace)
601 end if
602
603 end select
604
605 restart%initialized = .true.
606
607 pop_sub(restart_basic_init)
608 end subroutine restart_basic_init
609
610 function restart_basic_do_i_write(restart) result(res)
611 class(restart_basic_t), intent(in) :: restart
612 logical :: res
613
614 res = restart%mpi_grp%is_root()
615
616 end function restart_basic_do_i_write
617
618 ! ---------------------------------------------------------
624 subroutine restart_init(restart, namespace, data_type, type, mc, ierr, mesh, dir, exact)
625 class(restart_t), intent(out) :: restart
626 type(namespace_t), target, intent(in) :: namespace
627 integer, intent(in) :: data_type
628 integer, intent(in) :: type
630 type(multicomm_t), target, intent(in) :: mc
631 integer, intent(out) :: ierr
632 class(mesh_t), optional, intent(in) :: mesh
634 character(len=*), optional, intent(in) :: dir
636 logical, optional, intent(in) :: exact
638
639 logical :: grid_changed, grid_reordered, exact_, with_changed_grid
640 integer :: default_format
641
642 push_sub(restart_init)
643
644 ierr = 0
645
646 call restart_basic_init(restart, namespace, data_type, type, ierr, dir)
647 ! At this point, ierr == 1 indicates that the folder did not exist for RESTART_TYPE_LOAD.
648 ! In this case, also restart%skip_ has been set.
649
650 restart%has_mesh = present(mesh)
651 restart%mc => mc
652 call mpi_grp_init(restart%mpi_grp, mc%master_comm)
653
654 ! Sanity checks
655 if (present(exact) .and. .not. present(mesh)) then
656 message(1) = "Error in restart_init: the 'exact' optional argument requires a mesh."
657 call messages_fatal(1, namespace=namespace)
658 end if
659
660 exact_ = optional_default(exact, .false.)
661
662 restart%has_mesh = present(mesh)
663 restart%mc => mc
664
665 if(present(mesh)) then
666 !%Variable RestartFileFormatStates
667 !%Type integer
668 !%Section Execution::IO
669 !%Description
670 !% File format used for writing and reading the restart files for the states.
671 !% Default is adios2 if support is available, otherwise obf.
672 !% Restart files for linear response calculations always use obf.
673 !%Option obf 1
674 !% obf is the Octopus binary format, for which there is one file for
675 !% each state.
676 !%Option adios2 2
677 !% For large systems, especially with many k points, having one file per state can
678 !% be problematic for the file system. This option selects a format based on the
679 !% ADIOS2 library which needs to be available. The library handles IO efficiently
680 !% including aggregation and makes the restart IO much faster. However, it does
681 !% not support all features that the default obf format supports. Moreover, it
682 !% might use more memory for internal aggregation. In case of out-of-memory issues,
683 !% you might need to rerun on more nodes.
684 !%End
685#ifdef HAVE_ADIOS2
686 default_format = option__restartfileformatstates__adios2
687#else
688 default_format = option__restartfileformatstates__obf
689#endif
690 call parse_variable(namespace, 'RestartFileFormatStates', default_format, restart%file_format_states)
691 if (.not. varinfo_valid_option('RestartFileFormatStates', restart%file_format_states)) then
692 call messages_input_error(namespace, 'RestartFileFormatStates')
693 end if
694
695 if (restart%file_format_states == option__restartfileformatstates__adios2) then
696 ! the ADIOS2 format requires the exact same mesh for restarting
697 exact_ = .true.
698#ifndef HAVE_ADIOS2
699 message(1) = "Error: adios2 restart file format requested, but not compiled against ADIOS2 library."
700 call messages_fatal(1)
701#endif
702 end if
703
704 !%Variable RestartWithChangedGrid
705 !%Type logical
706 !%Default false
707 !%Section Execution::IO
708 !%Description
709 !% Use restart data even when the grid has changed. Normally, this is not needed, but can be enabled.
710 !%End
711 call parse_variable(namespace, 'RestartWithChangedGrid', .false., with_changed_grid)
712
713 select case (restart%type)
714 case (restart_type_dump)
715 if (.not. restart%skip_) then
716 ! Dump the grid information. The main parameters of the grid should not change
717 ! during the calculation, so we should only need to dump it once.
718 ! Use global_namespace (as the load side does below): restart%pwd already
719 ! encodes the namespace, so io_workpath must not re-insert it, otherwise
720 ! the grid metadata and the payload would be written to different paths.
721 call index_dump(mesh%idx, mesh%np_part_global, restart%pwd, restart%mpi_grp, &
722 global_namespace, ierr)
723 if (ierr /= 0) then
724 message(1) = "Unable to write index map to '"//trim(restart%pwd)//"'."
725 call messages_fatal(1, namespace=namespace)
726 end if
727
728 call mesh_write_fingerprint(mesh, restart%pwd, "grid", restart%mpi_grp, global_namespace, ierr)
729 if (ierr /= 0) then
730 message(1) = "Unable to write mesh fingerprint to '"//trim(restart%pwd)//"/grid'."
731 call messages_fatal(1, namespace=namespace)
732 end if
733 end if
734
735 case (restart_type_load)
736 if(.not. restart%skip_) then
737 call mesh_check_dump_compatibility(mesh, restart%pwd, "grid", global_namespace, &
738 restart%mpi_grp, grid_changed, grid_reordered, restart%map, ierr)
739
740 ! Check whether an error occurred. In this case we cannot read.
741 if (ierr /= 0) then
742 if (ierr == 1) then
743 message(1) = "Unable to check mesh compatibility: unable to read mesh fingerprint"
744 message(2) = "in '"//trim(restart%pwd)//"'."
745 else if (ierr > 1) then
746 message(1) = "Mesh from current calculation is not compatible with mesh found in"
747 message(2) = "'"//trim(restart%pwd)//"'."
748 end if
749 message(3) = "No restart information will be read."
750 call messages_warning(3, namespace=namespace)
751 ierr = 1
752 end if
753
754 restart%grid_changed = grid_changed
755
756 ! Print some warnings in case the mesh is compatible, but changed.
757 if (grid_changed) then
758 if (grid_reordered) then
759 message(1) = "Info: Octopus is attempting to restart from a mesh with a different order of points."
760 else
761 message(1) = "Info: Octopus is attempting to restart from a different mesh."
762 end if
763 if (with_changed_grid) then
764 call messages_info(1, namespace=namespace)
765 else
766 message(2) = "This is disabled. To enable this, set RestartWithChangedGrid=True."
767 call messages_warning(2, namespace=namespace)
768 ierr = 1
769 end if
770 end if
771
772 if (exact_) then
773 restart%skip_ = grid_changed .and. .not. grid_reordered
774 if (restart%skip_) then
775 message(1) = "This calculation requires the exact same mesh to restart."
776 message(2) = "No restart information will be read from '"//trim(restart%pwd)//"'."
777 call messages_warning(2, namespace=namespace)
778 ierr = 1
779 end if
780 else
781 restart%skip_ = .false.
782 end if
783 end if
784 end select
785
786 ! Make sure all the processes have finished reading/writing all the grid information,
787 ! as there might be some subsequent calls to this function where that information will
788 ! be written/read to/from the same directory.
789 if (restart%mpi_grp%size > 1) then
790 call restart%mpi_grp%barrier()
791 end if
792
793 end if
794
795 pop_sub(restart_init)
796 end subroutine restart_init
797
798
799 subroutine restart_basic_end(restart)
800 class(restart_basic_t), intent(inout) :: restart
801
802 push_sub(restart_basic_end)
803
804 restart%type = 0
805 restart%data_type = 0
806 restart%skip_ = .true.
807
808 pop_sub(restart_basic_end)
809
810 end subroutine restart_basic_end
811
812 ! ---------------------------------------------------------
813 subroutine restart_end(restart)
814 class(restart_t), intent(inout) :: restart
815
816 push_sub(restart_end)
817
818 if (restart%mpi_grp%is_root() .and. .not. restart%skip_) then
819 select case (restart%type)
820 case (restart_type_load)
821 message(1) = "Info: Finished reading information "//trim(basic_info(restart%type)%tag)//" from '"//trim(restart%dir_)//"'."
822 call io_rm(trim(restart%pwd)//"/loading")
823 case (restart_type_dump)
824 call io_rm(trim(restart%pwd)//"/dumping")
825 message(1) = "Info: Finished writing information "//trim(basic_info(restart%type)%tag)//" to '"//trim(restart%dir_)//"'."
826 end select
827 call messages_info(1, namespace=restart%namespace)
828 end if
829
830 safe_deallocate_a(restart%map)
831 restart%has_mesh = .false.
832 nullify(restart%mc)
833
834 call restart_basic_end(restart)
835
836 pop_sub(restart_end)
837 end subroutine restart_end
838
839
840 ! ---------------------------------------------------------
847 function restart_basic_dir(restart)
848 class(restart_basic_t), intent(in) :: restart
849 character(len=MAX_PATH_LEN) :: restart_basic_dir
850
851 push_sub(restart_basic_dir)
852
853 restart_basic_dir = io_workpath(restart%pwd)
854
855 pop_sub(restart_basic_dir)
856 end function restart_basic_dir
857
858
859 ! ---------------------------------------------------------
862 subroutine restart_basic_open_dir(restart, dirname, ierr)
863 class(restart_basic_t), intent(inout) :: restart
864 character(len=*), intent(in) :: dirname
865 integer, intent(out) :: ierr
866
867 push_sub(restart_basic_open_dir)
868
869 assert(.not. restart%skip_)
870
871 ierr = 0
872
873 select case (restart%type)
874 case (restart_type_dump)
875 call restart_basic_mkdir(restart, dirname)
876 case (restart_type_load)
877 if (.not. loct_dir_exists(trim(restart%dir_)//"/"//trim(dirname))) then
878 ierr = 1
879 end if
880 end select
881
882 if (ierr == 0) then
883 if (index(dirname, '/', .true.) == len_trim(dirname)) then
884 restart%pwd = trim(restart%dir_)//"/"//dirname(1:len_trim(dirname)-1)
885 else
886 restart%pwd = trim(restart%dir_)//"/"//trim(dirname)
887 end if
888 end if
889
891 end subroutine restart_basic_open_dir
892
893
894 ! ---------------------------------------------------------
896 subroutine restart_basic_close_dir(restart)
897 class(restart_basic_t), intent(inout) :: restart
898
900
901 assert(.not. restart%skip_)
902
903 restart%pwd = restart%dir_
904
906 end subroutine restart_basic_close_dir
907
909 ! ---------------------------------------------------------
911 subroutine restart_basic_mkdir(restart, dirname)
912 class(restart_basic_t), intent(in) :: restart
913 character(len=*), intent(in) :: dirname
914
915 push_sub(restart_basic_mkdir)
916
917 assert(.not. restart%skip_)
918
919 assert(restart%type == restart_type_dump)
920
921 call io_mkdir(trim(restart%pwd)//"/"//trim(dirname), parents=.true.)
922
923 pop_sub(restart_basic_mkdir)
924 end subroutine restart_basic_mkdir
925
926
927 ! ---------------------------------------------------------
929 subroutine restart_basic_rm(restart, name)
930 class(restart_basic_t), intent(in) :: restart
931 character(len=*), intent(in) :: name
932
933 assert(.not. restart%skip_)
934 assert(restart%type == restart_type_dump)
935
936 push_sub(restart_basic_rm)
937
938 call io_rm(trim(restart%pwd)//"/"//trim(name))
939
940 pop_sub(restart_basic_rm)
941 end subroutine restart_basic_rm
943
944 ! ---------------------------------------------------------
951 function restart_basic_open(restart, filename, status, position, silent)
952 class(restart_basic_t), intent(in) :: restart
953 character(len=*), intent(in) :: filename
954 character(len=*), optional, intent(in) :: status
955 character(len=*), optional, intent(in) :: position
956 logical, optional, intent(in) :: silent
957 integer :: restart_basic_open
958
959 logical :: die
960 character(len=20) :: action, status_
961
962 push_sub(restart_basic_open)
963
964 assert(restart%initialized)
965 assert(.not. restart%skip_)
966
967 select case (restart%type)
968 case (restart_type_dump)
969 status_ = 'unknown'
970 action = 'write'
971 die = .true.
972
973 case (restart_type_load)
974 status_ = 'old'
975 action = 'read'
976 die = .false.
977
978 case default
979 message(1) = "Error in restart_basic_open: illegal restart type"
980 call messages_fatal(1)
981 end select
982
983 if (present(status)) status_ = status
984
985 restart_basic_open = io_open(trim(restart%pwd)//"/"//trim(filename), &
986 action=trim(action), status=trim(status_), &
987 die=die, position=position, form="formatted", grp=restart%mpi_grp)
988
989 if (restart_basic_open == -1 .and. .not. optional_default(silent, .false.)) then
990 message(1) = "Unable to open file '"//trim(restart%pwd)//"/"//trim(filename)//"'."
992 end if
993
994 pop_sub(restart_basic_open)
995 end function restart_basic_open
996
997
998 ! ---------------------------------------------------------
999 subroutine restart_basic_write(restart, iunit, lines, nlines, ierr)
1000 class(restart_basic_t), intent(in) :: restart
1001 integer, intent(in) :: iunit
1002 character(len=*), intent(in) :: lines(:)
1003 integer, intent(in) :: nlines
1004 integer, intent(out) :: ierr
1005
1006 integer :: iline
1007
1008 push_sub(restart_basic_write)
1009
1010 if (iunit /= -1) then
1011 ierr = 0
1012 if (restart%mpi_grp%is_root()) then
1013 do iline = 1, nlines
1014 write(iunit,"(a)") trim(lines(iline))
1015 end do
1016 end if
1017 else
1018 ierr = 1
1019 end if
1020
1021 pop_sub(restart_basic_write)
1022 end subroutine restart_basic_write
1023
1025 ! ---------------------------------------------------------
1026 subroutine restart_basic_read(restart, iunit, lines, nlines, ierr)
1027 class(restart_basic_t), intent(in) :: restart
1028 integer, intent(in) :: iunit
1029 character(len=*), intent(out) :: lines(:)
1030 integer, intent(in) :: nlines
1031 integer, intent(out) :: ierr
1032
1033 push_sub(restart_basic_read)
1034
1035 call iopar_read(restart%mpi_grp, iunit, lines, nlines, ierr)
1036
1037 pop_sub(restart_basic_read)
1038 end subroutine restart_basic_read
1039
1040
1041 ! ---------------------------------------------------------
1043 subroutine restart_basic_close(restart, iunit)
1044 class(restart_basic_t), intent(in) :: restart
1045 integer, intent(inout) :: iunit
1047 push_sub(restart_basic_close)
1048
1049 if (iunit /= -1) call io_close(iunit, restart%mpi_grp)
1050
1051 call restart%mpi_grp%barrier()
1052
1053 pop_sub(restart_basic_close)
1054 end subroutine restart_basic_close
1055
1056
1057 ! ---------------------------------------------------------
1062 logical pure function restart_basic_skip(restart)
1063 class(restart_basic_t), intent(in) :: restart
1064
1065 restart_basic_skip = restart%skip_ .or. restart%has_flag(restart_flag_skip)
1066
1067 end function restart_basic_skip
1068
1069
1070 ! ---------------------------------------------------------
1072 logical pure function restart_basic_has_flag(restart, flag)
1073 class(restart_basic_t), intent(in) :: restart
1074 integer, intent(in) :: flag
1075
1076 restart_basic_has_flag = bitand(restart%flags, flag) /= 0
1077
1078 end function restart_basic_has_flag
1079
1080
1081 ! ---------------------------------------------------------
1083 logical pure function restart_has_map(restart)
1084 class(restart_t), intent(in) :: restart
1085
1086 restart_has_map = allocated(restart%map)
1087
1088 end function restart_has_map
1089
1090
1092 integer pure function restart_basic_get_data_type(restart)
1093 class(restart_basic_t), intent(in) :: restart
1095 restart_basic_get_data_type = restart%data_type
1096 end function restart_basic_get_data_type
1097
1098 function restart_basic_get_info(restart) result(info)
1099 class(restart_basic_t), intent(in) :: restart
1100
1101 character(:), allocatable :: info
1102
1103 info = "restart_basic "//trim(basic_info(restart%data_type)%tag)//" "//type_string(restart%type)
1104
1105 end function restart_basic_get_info
1106
1107 function restart_get_info(restart) result(info)
1108 class(restart_t), intent(in) :: restart
1109
1110 character(:), allocatable :: info
1111
1112 info = "restart "//trim(basic_info(restart%data_type)%tag)//" "//type_string(restart%type)
1113
1114 end function restart_get_info
1115
1116#include "undef.F90"
1117#include "real.F90"
1118#include "restart_inc.F90"
1119
1120#include "undef.F90"
1121#include "complex.F90"
1122#include "restart_inc.F90"
1123
1124end module restart_oct_m
1125
1126
1127!! Local Variables:
1128!! mode: f90
1129!! coding: utf-8
1130!! 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:597
subroutine, public mesh_write_fingerprint(mesh, dir, filename, mpi_grp, namespace, ierr)
Definition: mesh.F90:461
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
type(mpi_grp_t), public mpi_world
Definition: mpi.F90:338
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:2414
subroutine drestart_write_binary1_int32(restart, filename, np, ff, ierr, root)
Definition: restart.F90:1741
subroutine drestart_read_binary3(restart, filename, np, ff, ierr)
Definition: restart.F90:1687
logical pure function restart_has_map(restart)
Returns true if the restart was from a different order of mesh points.
Definition: restart.F90:1179
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:1589
subroutine restart_basic_end(restart)
Definition: restart.F90:895
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:958
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:1007
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:1139
subroutine drestart_read_binary1(restart, filename, np, ff, ierr)
Definition: restart.F90:1631
subroutine restart_basic_close_dir(restart)
Change back to the base directory. To be called after restart_basic_open_dir.
Definition: restart.F90:992
subroutine zrestart_write_binary1(restart, filename, np, ff, ierr, root)
Definition: restart.F90:2108
integer, parameter, public restart_casida
Definition: restart.F90:156
subroutine zrestart_write_binary5_int32(restart, filename, np, ff, ierr, root)
Definition: restart.F90:2428
logical function, public clean_stop(comm)
returns true if a file named stop exists
Definition: restart.F90:338
subroutine zrestart_read_binary5_int32(restart, filename, np, ff, ierr)
Definition: restart.F90:2483
integer, parameter, public restart_kdotp
Definition: restart.F90:156
subroutine zrestart_read_binary3(restart, filename, np, ff, ierr)
Definition: restart.F90:2332
integer, parameter, public restart_oct
Definition: restart.F90:156
subroutine drestart_read_binary3_int32(restart, filename, np, ff, ierr)
Definition: restart.F90:1825
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:2470
subroutine drestart_read_binary2(restart, filename, np, ff, ierr)
Definition: restart.F90:1659
integer, parameter, public restart_gs
Definition: restart.F90:156
subroutine zrestart_read_binary1_int32(restart, filename, np, ff, ierr)
Definition: restart.F90:2442
integer, parameter, public restart_iteration
Definition: restart.F90:156
subroutine drestart_write_binary3(restart, filename, np, ff, ierr, root)
Definition: restart.F90:1547
integer, parameter, public restart_flag_mix
Definition: restart.F90:189
subroutine drestart_write_binary3_int32(restart, filename, np, ff, ierr, root)
Definition: restart.F90:1769
subroutine zrestart_write_binary1_int32(restart, filename, np, ff, ierr, root)
Definition: restart.F90:2386
subroutine restart_init(restart, namespace, data_type, type, mc, ierr, mesh, dir, exact)
Initializes a specific restart object.
Definition: restart.F90:720
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:1047
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:1811
subroutine drestart_write_binary5_int32(restart, filename, np, ff, ierr, root)
Definition: restart.F90:1783
subroutine restart_basic_rm(restart, name)
Remove directory or file "name" that is located inside the current restart directory.
Definition: restart.F90:1025
subroutine restart_end(restart)
Definition: restart.F90:909
integer, parameter, public restart_proj
Definition: restart.F90:156
subroutine zrestart_read_binary1(restart, filename, np, ff, ierr)
Definition: restart.F90:2276
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
subroutine drestart_write_binary1(restart, filename, np, ff, ierr, root)
Definition: restart.F90:1463
subroutine drestart_read_binary1_int32(restart, filename, np, ff, ierr)
Definition: restart.F90:1797
subroutine zrestart_write_binary5(restart, filename, np, ff, ierr, root)
Definition: restart.F90:2234
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:2007
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:1168
subroutine restart_basic_write(restart, iunit, lines, nlines, ierr)
Definition: restart.F90:1095
integer, parameter, public restart_flag_literal
Definition: restart.F90:189
subroutine drestart_read_binary5_int32(restart, filename, np, ff, ierr)
Definition: restart.F90:1838
subroutine drestart_write_binary2(restart, filename, np, ff, ierr, root)
Definition: restart.F90:1505
subroutine drestart_read_binary5(restart, filename, np, ff, ierr)
Definition: restart.F90:1714
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:943
subroutine zrestart_write_binary2_int32(restart, filename, np, ff, ierr, root)
Definition: restart.F90:2400
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:1158
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:1362
integer, parameter, public restart_type_load
Definition: restart.F90:184
character(:) function, allocatable restart_basic_get_info(restart)
Definition: restart.F90:1194
subroutine restart_basic_read(restart, iunit, lines, nlines, ierr)
Definition: restart.F90:1122
subroutine zrestart_read_binary2(restart, filename, np, ff, ierr)
Definition: restart.F90:2304
integer pure function restart_basic_get_data_type(restart)
Returns the data type of the restart.
Definition: restart.F90:1188
integer, parameter, public restart_vdw
Definition: restart.F90:156
subroutine zrestart_read_binary5(restart, filename, np, ff, ierr)
Definition: restart.F90:2359
subroutine zrestart_write_binary2(restart, filename, np, ff, ierr, root)
Definition: restart.F90:2150
integer, parameter, public restart_unocc
Definition: restart.F90:156
subroutine zrestart_write_binary3(restart, filename, np, ff, ierr, root)
Definition: restart.F90:2192
subroutine zrestart_read_binary2_int32(restart, filename, np, ff, ierr)
Definition: restart.F90:2456
logical function restart_basic_do_i_write(restart)
Definition: restart.F90:706
character(:) function, allocatable restart_get_info(restart)
Definition: restart.F90:1203
subroutine restart_basic_init(restart, namespace, data_type, type, ierr, dir)
Definition: restart.F90:370
subroutine drestart_write_binary2_int32(restart, filename, np, ff, ierr, root)
Definition: restart.F90:1755
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:187
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)