Newer
Older
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
write(6,*)""
IF(mem_pe.lt.0) THEN
write(6,*)"WARNING: Available RAM memory ",mem_pe," is wrong. Re-enter this value!"
write(6,*)""
GOTO 73
ENDIF
IF(mem_pe.lt.50) THEN
write(6,*)"WARNING: Available RAM memory value",mem_pe," is too low. Check it!"
write(6,*)""
ENDIF
75 write(6,FMT=100,ADVANCE='NO')"Maximum Interaction List length [1000] : "
read(5,FMT='(I6)') maxnterm
IF(maxnterm.eq.0) maxnterm=1000
write(6,*)""
IF(maxnterm.lt.0) THEN
write(6,*)"WARNING: Maximum Interaction List length value ",maxnterm," is wrong. Re-enter this value!"
write(6,*)""
GOTO 75
ENDIF
IF(nbodies.ge.2000000 .and. maxnterm.lt.800) THEN
write(6,*)"WARNING: Maximum Interaction List length value ",maxnterm," may be too small. Check it!"
write(6,*)""
ENDIF
write(6,*)""
write(6,*)"Please check the input data you given."
write(6,*)""
write(6,*)'----------------------------'
write(6,*)'fly_h.F Module File INPUT DATA'
write(6,*)'----------------------------'
WRITE(6,*) 'Number of processors= ',npes
WRITE(6,*) 'Number of Bodies= ',nbodies
WRITE(6,*) 'RAM per processor (MBytes)= ',mem_pe
WRITE(6,*) 'Maximum Interaction List length= ',maxnterm
write(6,*)'----------------------------'
write(6,*)'fly_h.F Module File'
write(6,*)'----------------------------'
write(6,*)""
74 write(6,100,ADVANCE='NO')"Confirm these parameter values (Y/N) : "
read(5,FMT='(A1)') y_n
y_n=TRIM(y_n)
IF(y_n.eq.'n') y_n='N'
IF(y_n.eq.'y') y_n='Y'
write(6,*)""
IF(y_n.ne.'Y'.and. Y_n.ne.'N') GOTO 74
IF(y_n.eq.'N') THEN
npes=0
nbodies=0
GOTO 70
ENDIF
OPEN(UNIT=10, FILE='fly_dat.F90',STATUS='UNKNOWN')
write(10,100)"!======================================================================="
write(10,100)"!"
write(10,100)"!"
write(10,100)" MODULE fly_h "
write(10,100)"!"
write(10,100)"!"
write(10,100)"!======================================================================="
write(10,100)"!"
write(10,100)"!"
write(10,100)"! Parameter declarations, allocation of array storage, common"
write(10,100)"! block definitions."
write(10,100)"!"
write(10,100)"!======================================================================="
write(10,100)""
write(10,100)"!-------------------------------------------------------------------------------"
write(10,100)"! SPECIFY THE NUMBER OF PEs"
write(10,100)"!-------------------------------------------------------------------------------"
write(10,100)""
write(10,FMT='(a,I4)')" INTEGER, PARAMETER :: N_PES=",npes
write(10,100)""
write(10,100)"!-------------------------------------------------------------------------------"
write(10,100)"! SPECIFY THE AVAILABLE MEMORY (in Mbyte) FOR EACH PE"
write(10,100)"!-------------------------------------------------------------------------------"
write(10,FMT='(a,I5)')" INTEGER, PARAMETER :: MEM_PE=",mem_pe
write(10,100)" INTEGER, PARAMETER :: MEM_SO= 15 !so occ."
write(10,100)" INTEGER, PARAMETER :: MEM_FX= 5 !fix mem occ."
write(10,100)""
write(10,100)"!-------------------------------------------------------------------------------"
write(10,100)"! SPECIFY the nbodsmax DIMENSION (MUST BE EQUAL "
write(10,100)"! to the number of bodies used (nbodies variable) "
write(10,100)"!-------------------------------------------------------------------------------"
write(10,100)""
write(10,FMT='(a,I20)')" INTEGER(KIND=4), PARAMETER :: nbodsmax=", nbodies
write(10,100)""
write(10,100)"!-------------------------------------------------------------------------------"
write(10,100)"! SPECIFY THE DIMENSION: maxnterm (max length of IL) and maxilf (max length of"
write(10,100)"! temporary storage to form IL) (suggested value maxilf=maxnterm*64) "
write(10,100)"!-------------------------------------------------------------------------------"
write(10,100)" "
write(10,FMT='(a,I6)')" INTEGER, PARAMETER :: maxnterm=",maxnterm
write(10,100)" INTEGER, PARAMETER :: maxilf= maxnterm * 64 !USER def."
write(10,100)""
CLOSE(UNIT=10)
CMD="cat fly_dat.F90 fly_gen.F90 > fly_h.F90"
CALL SYSTEM(CMD)
CMD="rm fly_dat.F90"
CALL SYSTEM(CMD)
write(6,*)""
write(6,*)" The fly_h.F MODULE file ... created! "
write(6,*)""
!===================
!
! Makefile section
!
!===================
80 write(6,*)""
write(6,*)"Starting generation of mkfl_FLY and mkfl_FLY_sort makefiles and FLY and FLY_sort executables"
write(6,*)""
write(6,*)""
86 write(6,100,ADVANCE='NO')"Do you want to create these files (Y/N) : "
read(5,FMT='(A1)') y_n
y_n=TRIM(y_n)
IF(y_n.eq.'n') y_n='N'
IF(y_n.eq.'y') y_n='Y'
write(6,*)""
IF(y_n.ne.'Y'.and. Y_n.ne.'N') GOTO 86
IF(y_n.eq.'N') GOTO 300
fly_exe=TRIM(wd_st)//"FLY_mpi"
write(6,*)""
write(6,*)""
write(6,*)"NOT-ABSOLUTE filename path will be ", TRIM(wd_st)
write(6,*)""
write(6,ADVANCE='NO',FMT='(3A)')"Please give the FLY executable filename [",TRIM(fly_exe),"] : "
read(5,FMT='(A256)') fly_exe
fly_exe=TRIM(fly_exe)
IF(fly_exe.eq."") fly_exe=TRIM(wd_st)//"FLY_mpi"
fly_exe=TRIM(fly_exe)
fly_exe_name=TRIM(fly_exe)
IF(fly_exe(1:1).NE."/" .AND. fly_exe(1:1).NE.".") fly_exe=TRIM(wd_st)//TRIM(fly_exe)
85 write(6,ADVANCE='NO',FMT=100)"Do you want to have a statistical code performance output? (Not recommended!) (Y/N) [N] : "
read(5,FMT='(A1)') sta
write(6,*)""
sta=TRIM(sta)
IF(sta.eq.'') sta='N'
IF(sta.eq.'n') sta='N'
IF(sta.eq.'y') sta='Y'
IF(sta.ne.'N'.and. sta.ne.'Y') GOTO 85
fc_comp="ifc"
write(6,ADVANCE='NO',FMT=100)"Fortran compiler to be adopted [ifc] : "
read(5,FMT='(A)') fc_comp
write(6,*)""
IF(fc_comp.eq."") fc_comp="ifc"
fc_comp=TRIM(fc_comp)
write(6,ADVANCE='NO',FMT=100)"Fortran compiler options [-quiet -O0 -r8 -w95 -Vaxlib -I/usr/local/include] : "
read(5,FMT='(A)') fc_opt
write(6,*)""
IF(fc_opt.eq."") fc_opt="-quiet -O0 -r8 -w95 -Vaxlib -I/usr/local/include"
fc_opt=TRIM(fc_opt)
write(6,ADVANCE='NO',FMT=100)"C compiler to be adopted [gcc] : "
read(5,FMT='(A)') cc_comp
write(6,*)""
IF(cc_comp.eq."") cc_comp="gcc"
cc_comp=TRIM(cc_comp)
write(6,ADVANCE='NO',FMT=100)"C compiler options [] : "
read(5,FMT='(A)') cc_opt
write(6,*)""
cc_opt=TRIM(cc_opt)
write(6,ADVANCE='NO',FMT=100)"Library path [-L/usr/local/lib -lmpich -L.] : "
read(5,FMT='(A)') lib
write(6,*)""
IF(lib.eq."") lib="-L/usr/local/lib -lmpich -L."
lib=TRIM(lib)
write(6,*)""
write(6,*)"Please check the input data you given."
write(6,*)""
write(6,*)'----------------------------'
write(6,*)'mkfl_FLY and mkfl_FLY_sort INPUT DATA'
write(6,*)'----------------------------'
WRITE(6,*) 'Executable FLY filename =', fly_exe(1:LEN_TRIM(fly_exe))
WRITE(6,*) 'Executable FLY_sort filenam =', TRIM(fly_exe),'_sort'
WRITE(6,*) 'Statistical code performances = ',sta
WRITE(6,*) 'Fortran Compiler = ',TRIM(fc_comp)
WRITE(6,*) 'Fortran Compiler options = ',TRIM(fc_opt)
WRITE(6,*) 'C Compiler = ',TRIM(cc_comp)
WRITE(6,*) 'C Compiler options = ',TRIM(cc_opt)
WRITE(6,*) 'Library path = ',TRIM(lib)
write(6,*)'----------------------------'
write(6,*)'fly_h.F Module File'
write(6,*)'----------------------------'
write(6,*)""
84 write(6,100,ADVANCE='NO')"Confirm these parameter values (Y/N) : "
read(5,FMT='(A1)') y_n
y_n=TRIM(y_n)
IF(y_n.eq.'n') y_n='N'
IF(y_n.eq.'y') y_n='Y'
write(6,*)""
IF(y_n.ne.'Y'.and. Y_n.ne.'N') GOTO 84
IF(y_n.eq.'N') GOTO 80
OPEN(UNIT=10,FILE='mkfl_gen2',STATUS='UNKNOWN')
write(10,*)"CF = ",fc_comp(1:LEN_TRIM(fc_comp))
write(10,*)"CC = ",cc_comp(1:LEN_TRIM(cc_comp))
write(10,*)"LIBS =",lib(1:LEN_TRIM(lib))
write(10,*)""
write(10,*)"CMD = ",fly_exe(1:LEN_TRIM(fly_exe))
write(10,*)""
IF(sta.eq.'Y') THEN
write(10,*)"FFLAGS = -DSTA ",fc_opt(1:LEN_TRIM(fc_opt))
write(10,*)"CFLAGS = -DSTA ",cc_opt(1:LEN_TRIM(cc_opt))
ELSE
write(10,*)"FFLAGS = ",fc_opt(1:LEN_TRIM(fc_opt))
write(10,*)"CFLAGS = ",cc_opt(1:LEN_TRIM(cc_opt))
ENDIF
write(10,*)""
write(10,*)""
CLOSE(UNIT=10)
CMD='cat mkfl_gen1 mkfl_gen2 mkfl_gen3 > mkfl_FLY'
CALL SYSTEM(CMD)
CMD='make -f mkfl_FLY clean'
CALL SYSTEM(CMD)
CMD='make -f mkfl_FLY'
CALL SYSTEM(CMD)
OPEN(UNIT=15,FILE='mkfl_gen2_sort',STATUS='UNKNOWN')
write(15,*)"CF = ",fc_comp(1:LEN_TRIM(fc_comp))
write(15,*)"CC = ",cc_comp(1:LEN_TRIM(cc_comp))
write(15,*)"LIBS =",lib(1:LEN_TRIM(lib))
write(15,*)""
write(15,*)"CMD = ",fly_exe(1:LEN_TRIM(fly_exe)),"_sort"
write(15,*)""
write(15,*)"FFLAGS = -DSORT ",fc_opt(1:LEN_TRIM(fc_opt))
write(15,*)"CFLAGS = -DSORT ",cc_opt(1:LEN_TRIM(cc_opt))
write(15,*)""
write(15,*)""
CLOSE(UNIT=15)
CMD='cat mkfl_gen1 mkfl_gen2_sort mkfl_gen3 > mkfl_FLY_sort'
CALL SYSTEM(CMD)
CMD='make -f mkfl_FLY_sort clean'
CALL SYSTEM(CMD)
CMD='make -f mkfl_FLY_sort'
CALL SYSTEM(CMD)
!===================
!
! END section
!
!===================
300 write(6,*)""
write(6,*)"To start the run, you must cd in the working directory."
write(6,*)"If need, start mpd on the system: "
write(6,*)""
write(6,*)"mpdboot -n N -f my_mpd_hostfile"
write(6,*)""
write(6,*)"where N is the number of different hosts listed in the file my_mpd_hostfile"
write(6,*)"and execute the run: "
write(6,*)""
write(6,*)"mpiexec -n ", npes," fly_executable > filename_out_log"
write(6,*)""
write(6,*)"or submit it in a queue system"
write(6,*)""
write(6,*)"FLY assistant has completed. Have yourself a good FLY .... in the Universe!"
write(6,*)""
write(6,*)""
write(6,*)""
!===================
!
! FORMAT section
!
!===================
100 FORMAT(a)
103 FORMAT(2A)
105 FORMAT(3A)
110 FORMAT(A10,F20.15)
112 FORMAT(A10,F15.10)
113 FORMAT(A10,E20.15)
115 FORMAT(A10,I4)
120 FORMAT(A10,F5.2)
122 FORMAT(A10,F9.4)
125 FORMAT(A10,F10.6)
130 FORMAT(A10,A)
132 FORMAT(A12,A)
133 FORMAT(12x,A256)
140 FORMAT(A10,A1)
145 FORMAT(A10,I20)
147 FORMAT(A10,I7)
160 FORMAT(F7.3)
170 FORMAT(I6)
180 FORMAT(A,I4,A,I4,A,I4)
stop
end