OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
kill_zombi.F
Go to the documentation of this file.
1Copyright> OpenRadioss
2Copyright> Copyright (C) 1986-2025 Altair Engineering Inc.
3Copyright>
4Copyright> This program is free software: you can redistribute it and/or modify
5Copyright> it under the terms of the GNU Affero General Public License as published by
6Copyright> the Free Software Foundation, either version 3 of the License, or
7Copyright> (at your option) any later version.
8Copyright>
9Copyright> This program is distributed in the hope that it will be useful,
10Copyright> but WITHOUT ANY WARRANTY; without even the implied warranty of
11Copyright> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12Copyright> GNU Affero General Public License for more details.
13Copyright>
14Copyright> You should have received a copy of the GNU Affero General Public License
15Copyright> along with this program. If not, see <https://www.gnu.org/licenses/>.
16Copyright>
17Copyright>
18Copyright> Commercial Alternative: Altair Radioss Software
19Copyright>
20Copyright> As an alternative to this open-source version, Altair also offers Altair Radioss
21Copyright> software under a commercial license. Contact Altair to discuss further if the
22Copyright> commercial version may interest you: https://www.altair.com/radioss/.
23
24! These subroutines are not called by radioss, but are used by the QA
25! team. Do not modify them.
26!||====================================================================
27!|| get_env_variable_zombi ../common_source/qa/kill_zombi.F
28!||--- called by ------------------------------------------------------
29!|| walking_dead_mode ../common_source/qa/kill_zombi.F
30!||--- calls -----------------------------------------------------
31!||====================================================================
32 subroutine get_env_variable_zombi(zombi_activation)
33#include "implicit_f.inc"
34 character(len=100) env
35 logical, intent(inout) :: zombi_activation
36
37 env(1:len(env)) = ''
38 call getenv ( 'ENABLE_PID_PRINT', env )
39 zombi_activation = .false.
40 if ( env(1:2)=='ON' ) then
41 zombi_activation = .true.
42 endif
43
44 return
45 end subroutine get_env_variable_zombi
46 ! -----------------------------------
47!||====================================================================
48!|| get_process_pid_zombi ../common_source/qa/kill_zombi.F
49!||--- called by ------------------------------------------------------
50!|| walking_dead_mode ../common_source/qa/kill_zombi.F
51!||====================================================================
52 subroutine get_process_pid_zombi(current_process_pid)
53#include "implicit_f.inc"
54 integer, intent(inout) :: current_process_pid
55 integer :: GETPID
56
57 current_process_pid = getpid()
58
59 return
60 end subroutine get_process_pid_zombi
61 ! -----------------------------------
62!||====================================================================
63!|| write_process_pid_zombi ../common_source/qa/kill_zombi.F
64!||--- called by ------------------------------------------------------
65!|| walking_dead_mode ../common_source/qa/kill_zombi.F
66!||====================================================================
67 subroutine write_process_pid_zombi( current_process_pid,
68 . radflex_process_pid ,nspmd,list_process)
69#include "implicit_f.inc"
70 integer, intent(in) :: radflex_process_pid
71 integer, intent(in) :: current_process_pid
72 integer, intent(in) :: nspmd
73 integer, dimension(nspmd+1), intent(in) :: list_process
74 integer :: i
75
76 open(file="running_pids",unit=666,access="append",
77 . status="unknown",action="readwrite")
78 do i=1,nspmd+1
79 if(list_process(i)/=0) write(666,*) list_process(i)
80 enddo
81 close(666)
82 return
83 end subroutine write_process_pid_zombi
84 ! -----------------------------------
85!||====================================================================
86!|| init_list_process_pid ../common_source/qa/kill_zombi.F
87!||--- called by ------------------------------------------------------
88!|| walking_dead_mode ../common_source/qa/kill_zombi.F
89!||--- calls -----------------------------------------------------
90!||====================================================================
91 subroutine init_list_process_pid( radflex_process_pid,
92 . current_process_pid,nspmd,list_process )
93
94#include "implicit_f.inc"
95#ifdef MPI
96#include "mpif.h"
97#endif
98 integer, intent(in) :: radflex_process_pid,nspmd
99 integer, dimension(nspmd+1), intent(inout) :: list_process
100 integer, intent(in) :: current_process_pid
101
102 integer :: i
103 integer :: ierror
104
105 list_process(1:nspmd+1 ) = 0
106#ifdef MPI
107 call mpi_gather(current_process_pid,1,mpi_integer,
108 . list_process,1,mpi_integer,0,mpi_comm_world,ierror)
109 list_process(nspmd+1) = radflex_process_pid
110#endif
111 if(nspmd==1) then
112 list_process(1) = current_process_pid
113 list_process(2) = radflex_process_pid
114 endif
115
116 return
117 end subroutine init_list_process_pid
118 ! -----------------------------------
119!||====================================================================
120!|| walking_dead_mode ../common_source/qa/kill_zombi.F
121!||--- calls -----------------------------------------------------
122!|| get_env_variable_zombi ../common_source/qa/kill_zombi.F
123!|| get_process_pid_zombi ../common_source/qa/kill_zombi.F
124!|| init_list_process_pid ../common_source/qa/kill_zombi.F
125!|| write_process_pid_zombi ../common_source/qa/kill_zombi.F
126!||====================================================================
127 subroutine walking_dead_mode(radflex_process_pid,ispmd,nspmd)
128#include "implicit_f.inc"
129#ifdef MPI
130#include "mpif.h"
131#endif
132 integer, intent(in) :: radflex_process_pid,nspmd,ispmd
133 logical :: zombi_activation
134 integer :: current_process_pid
135 integer, dimension(nspmd+1) :: list_process
136
137
138 call get_env_variable_zombi(zombi_activation)
139
140 if(zombi_activation) then
141
142 call get_process_pid_zombi(current_process_pid)
143 call init_list_process_pid( radflex_process_pid,
144 . current_process_pid,nspmd,list_process )
145 if(ispmd==0) call write_process_pid_zombi(
146 . current_process_pid,radflex_process_pid,nspmd,list_process )
147 endif
148
149 return
150 end subroutine walking_dead_mode
151 ! -----------------------------------
subroutine get_env_variable_zombi(zombi_activation)
Definition kill_zombi.F:33
subroutine write_process_pid_zombi(current_process_pid, radflex_process_pid, nspmd, list_process)
Definition kill_zombi.F:69
subroutine walking_dead_mode(radflex_process_pid, ispmd, nspmd)
Definition kill_zombi.F:128
subroutine get_process_pid_zombi(current_process_pid)
Definition kill_zombi.F:53
subroutine init_list_process_pid(radflex_process_pid, current_process_pid, nspmd, list_process)
Definition kill_zombi.F:93
subroutine mpi_gather(sendbuf, cnt, datatype, recvbuf, reccnt, rectype, root, comm, ierr)
Definition mpi.f:56