OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_printcpuinfo.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/.
23C
24!||====================================================================
25!|| spmd_printcpuinfo ../engine/source/mpi/output/spmd_printcpuinfo.F
26!||--- called by ------------------------------------------------------
27!|| printcpu ../engine/source/system/timer.F
28!||--- calls -----------------------------------------------------
29!||--- uses -----------------------------------------------------
30!|| spmd_comm_world_mod ../engine/source/mpi/spmd_comm_world.F90
31!||====================================================================
32 SUBROUTINE spmd_printcpuinfo(HOSTNAME,LENH,CPUNAM,LENC,FREQUENCE,
33 * MEM,SWAP)
34C-----------------------------------------------
35C I m p l i c i t T y p e s
36C-----------------------------------------------
37 USE spmd_comm_world_mod, ONLY : spmd_comm_world
38#include "implicit_f.inc"
39C-----------------------------------------------------------------
40C M e s s a g e P a s s i n g
41C-----------------------------------------------
42#include "spmd.inc"
43C-----------------------------------------------
44C C o m m o n B l o c k s
45C-----------------------------------------------
46#include "task_c.inc"
47#include "com01_c.inc"
48#include "units_c.inc"
49C-----------------------------------------------
50C D u m m y A r g u m e n t s
51C-----------------------------------------------
52 CHARACTER*256 HOSTNAME,CPUNAM
53 INTEGER LENH, LENC, FREQUENCE,MEM,SWAP
54C-----------------------------------------------
55C L o c a l V a r i a b l e s
56C-----------------------------------------------
57#ifdef MPI
58 INTEGER STATUS(MPI_STATUS_SIZE),IERROR,MSGTYP,
59 . msgoff,msgoff2,msgoff3,i
60 DATA msgoff/190/
61 DATA msgoff2/191/
62 DATA msgoff3/192/
63 CHARACTER*256 CBUF1,CBUF2
64 INTEGER LENR(5)
65
66 IF (ispmd==0) THEN
67 DO i=2,nspmd
68 msgtyp = msgoff
69 CALL mpi_recv(
70 . lenr,5,mpi_integer,it_spmd(i),msgtyp,
71 . spmd_comm_world,status,ierror)
72
73 msgtyp = msgoff2
74 CALL mpi_recv(
75 . cbuf1,lenr(1),mpi_character,it_spmd(i),msgtyp,
76 . spmd_comm_world,status,ierror)
77
78 msgtyp = msgoff3
79 CALL mpi_recv(
80 . cbuf2,lenr(2),mpi_character,it_spmd(i),msgtyp,
81 . spmd_comm_world,status,ierror)
82
83 IF (mem>-1)THEN
84 WRITE(iout,'(I4,A,A,A,A,A,I4,A,I6,A,I6,A)') i,' ',
85 . cbuf1(1:lenr(1)),' ',cbuf2(1:lenr(2)),', ',lenr(3),
86 . ' MHz, ',lenr(4),' MB RAM, ',lenr(5),' MB swap'
87 ELSE
88 WRITE(iout,'(I4,A,A,A,A,A,I4,A)') i,' ',
89 . cbuf1(1:lenr(1)),' ',cbuf2(1:lenr(2)),', ',lenr(3),' MHz '
90 ENDIF
91
92 ENDDO
93 ELSE
94 lenr(1) = lenh
95 lenr(2) = lenc
96 lenr(3) = frequence
97 lenr(4) = mem
98 lenr(5) = swap
99
100 msgtyp = msgoff
101 CALL mpi_send(lenr,5,mpi_integer,it_spmd(1),msgtyp,
102 . spmd_comm_world,ierror)
103
104 msgtyp = msgoff2
105 CALL mpi_send(hostname,lenh,mpi_character,it_spmd(1),msgtyp,
106 . spmd_comm_world,ierror)
107
108 msgtyp = msgoff3
109 CALL mpi_send(cpunam,lenc,mpi_character,it_spmd(1),msgtyp,
110 . spmd_comm_world,ierror)
111 ENDIF
112
113#endif
114 RETURN
115 END
subroutine mpi_recv(buf, cnt, datatype, source, tag, comm, status, ierr)
Definition mpi.f:461
subroutine mpi_send(buf, cnt, datatype, dest, tag, comm, ierr)
Definition mpi.f:480
subroutine spmd_printcpuinfo(hostname, lenh, cpunam, lenc, frequence, mem, swap)