testing new version of coupling

This commit is contained in:
Steve Plimpton
2023-04-14 11:00:59 -06:00
parent 7f35ecffcc
commit 32f9800943
20 changed files with 2222 additions and 1945 deletions

View File

@ -4,16 +4,16 @@ SHELL = /bin/sh
# System-specific settings # System-specific settings
LAMMPS = /home/sjplimp/lammps/git/src LAMMPS = /home/sjplimp/lammps/git
SPPARKS = /home/sjplimp/spparks/git/src SPPARKS = /home/sjplimp/spparks/git
CC = mpicxx CC = mpicxx
CCFLAGS = -g -O -DMPICH_IGNORE_CXX_SEEK -I../library CCFLAGS = -g -O -DMPICH_IGNORE_CXX_SEEK -I../library
DEPFLAGS = -M DEPFLAGS = -M
LINK = mpicxx LINK = mpicxx
LINKFLAGS = -g -O -L../library -L${LAMMPS}/src -L${SPPARKS}/src LINKFLAGS = -g -O -L../library -L${LAMMPS}/src -L${SPPARKS}/src
USRLIB = -lcouple -llmp_g++ -lspk_g++ USRLIB = -lcouple -llammps_mpi -lspparks_mpi
SYSLIB = -lfftw -lmpich -lpthread SYSLIB =
ARCHIVE = ar ARCHIVE = ar
ARFLAGS = -rc ARFLAGS = -rc
SIZE = size SIZE = size

View File

@ -20,4 +20,4 @@ diag_style energy
temperature 1.0 temperature 1.0
stats 10.0 stats 10.0
dump 1 10.0 dump.mc dump 1 text 10.0 dump.mc id site x y

View File

@ -14,16 +14,16 @@
#include "lammps_data_write.h" #include "lammps_data_write.h"
#include "many2many.h" #include "many2many.h"
#include "memory.h" #include "memorylib.h"
#include "errorlib.h" #include "errorlib.h"
#define QUOTE_(x) #x #define QUOTE_(x) #x
#define QUOTE(x) QUOTE_(x) #define QUOTE(x) QUOTE_(x)
//#include "spkpath.h" #include "spkpath.h"
//#include QUOTE(SPKPATH/src/spparks.h) #include QUOTE(SPKPATH/src/spparks.h)
//#include QUOTE(SPKPATH/src/library.h) #include QUOTE(SPKPATH/src/library.h)
//#include QUOTE(SPKPATH/src/input.h) #include QUOTE(SPKPATH/src/input.h)
#include "lmppath.h" #include "lmppath.h"
#include QUOTE(LMPPATH/src/lammps.h) #include QUOTE(LMPPATH/src/lammps.h)
@ -32,7 +32,7 @@
#include QUOTE(LMPPATH/src/modify.h) #include QUOTE(LMPPATH/src/modify.h)
#include QUOTE(LMPPATH/src/compute.h) #include QUOTE(LMPPATH/src/compute.h)
//using namespace SPPARKS_NS; using namespace SPPARKS_NS;
using namespace LAMMPS_NS; using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
@ -51,8 +51,8 @@ int main(int narg, char **arg)
MPI_Comm_rank(comm,&me); MPI_Comm_rank(comm,&me);
MPI_Comm_size(comm,&nprocs); MPI_Comm_size(comm,&nprocs);
Memory *memory = new Memory(comm); MemoryLib *memory = new MemoryLib(comm);
Error *error = new Error(comm); ErrorLib *error = new ErrorLib(comm);
// command-line args // command-line args

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
SPPARKS (26 Aug 2010) SPPARKS (19 Sept 2022)
# SPPARKS input for coupling MD/MC # SPPARKS input for coupling MD/MC
seed 56789 seed 56789
@ -28,244 +28,246 @@ diag_style energy
temperature 1.0 temperature 1.0
stats 10.0 stats 10.0
dump 1 10.0 dump.mc dump 1 text 10.0 dump.mc id site x y
run 10Setting up run ... run 10Setting up run ...
Running with 32-bit site IDs
Memory usage per processor = 2.375 Mbytes
Time Naccept Nreject Nsweeps CPU Energy Time Naccept Nreject Nsweeps CPU Energy
0 0 0 0 0 19766 0 0 0 0 0 19766
10 17929 0 0 0.0776 5324 10 18978 0 13 0.0259 5500
Loop time of 0.077626 on 1 procs Loop time of 0.0258905 on 1 procs
Solve time (%) = 0.0070138 (9.03537) Solve time (%) = 0.00155363 (6.00079)
Update time (%) = 0 (0) Update time (%) = 0 (0)
Comm time (%) = 0.00146031 (1.88122) Comm time (%) = 0.000642316 (2.4809)
Outpt time (%) = 0.00415015 (5.34634) Outpt time (%) = 0.000680321 (2.62769)
App time (%) = 0.0614648 (79.1807) App time (%) = 0.0226682 (87.5542)
Other time (%) = 0.00353694 (4.55639) Other time (%) = 0.000346003 (1.33641)
run 10Setting up run ... run 10Setting up run ...
Time Naccept Nreject Nsweeps CPU Energy Time Naccept Nreject Nsweeps CPU Energy
10 17929 0 0 0 5324 10 18978 0 13 0 5500
20 24582 0 0 0.0279 4750 20 25374 0 18 0.00709 4552
Loop time of 0.027904 on 1 procs Loop time of 0.00708869 on 1 procs
Solve time (%) = 0.00271416 (9.72676) Solve time (%) = 0.000496193 (6.99978)
Update time (%) = 0 (0) Update time (%) = 0 (0)
Comm time (%) = 0.000461817 (1.65502) Comm time (%) = 0.000158039 (2.22945)
Outpt time (%) = 0.0042181 (15.1165) Outpt time (%) = 0.0006739 (9.50669)
App time (%) = 0.0191288 (68.5521) App time (%) = 0.00564639 (79.6535)
Other time (%) = 0.00138116 (4.94967) Other time (%) = 0.000114167 (1.61055)
run 10Setting up run ... run 10Setting up run ...
Time Naccept Nreject Nsweeps CPU Energy Time Naccept Nreject Nsweeps CPU Energy
20 24582 0 0 0 4750 20 25374 0 18 0 4552
30 30109 0 0 0.0234 4264 30 30752 0 23 0.00575 4096
Loop time of 0.023375 on 1 procs Loop time of 0.00575649 on 1 procs
Solve time (%) = 0.00216675 (9.2695) Solve time (%) = 0.000415252 (7.21363)
Update time (%) = 0 (0) Update time (%) = 0 (0)
Comm time (%) = 0.000342846 (1.46672) Comm time (%) = 0.00013092 (2.2743)
Outpt time (%) = 0.00416183 (17.8046) Outpt time (%) = 0.000662723 (11.5126)
App time (%) = 0.015563 (66.5796) App time (%) = 0.00445117 (77.3244)
Other time (%) = 0.00114059 (4.87954) Other time (%) = 9.6422e-05 (1.67501)
run 10Setting up run ... run 10Setting up run ...
Time Naccept Nreject Nsweeps CPU Energy Time Naccept Nreject Nsweeps CPU Energy
30 30109 0 0 0 4264 30 30752 0 23 0 4096
40 35032 0 0 0.0208 3880 40 35529 0 27 0.00589 3596
Loop time of 0.020786 on 1 procs Loop time of 0.00589801 on 1 procs
Solve time (%) = 0.0019896 (9.57182) Solve time (%) = 0.000424563 (7.19841)
Update time (%) = 0 (0) Update time (%) = 0 (0)
Comm time (%) = 0.000316858 (1.52438) Comm time (%) = 0.000114131 (1.93508)
Outpt time (%) = 0.00413609 (19.8984) Outpt time (%) = 0.000763593 (12.9466)
App time (%) = 0.0132952 (63.962) App time (%) = 0.0044969 (76.2443)
Other time (%) = 0.00104833 (5.04341) Other time (%) = 9.8828e-05 (1.67562)
run 10Setting up run ... run 10Setting up run ...
Time Naccept Nreject Nsweeps CPU Energy Time Naccept Nreject Nsweeps CPU Energy
40 35032 0 0 0 3880 40 35529 0 27 0 3596
50 39543 0 0 0.0193 3784 50 39736 0 31 0.00444 3298
Loop time of 0.0193491 on 1 procs Loop time of 0.00444854 on 1 procs
Solve time (%) = 0.00185919 (9.60865) Solve time (%) = 0.000323247 (7.26637)
Update time (%) = 0 (0) Update time (%) = 0 (0)
Comm time (%) = 0.000333071 (1.72138) Comm time (%) = 9.6777e-05 (2.17548)
Outpt time (%) = 0.00412297 (21.3083) Outpt time (%) = 0.000637529 (14.3312)
App time (%) = 0.0120728 (62.3946) App time (%) = 0.00331502 (74.5193)
Other time (%) = 0.000961065 (4.96698) Other time (%) = 7.5967e-05 (1.70769)
run 10Setting up run ... run 10Setting up run ...
Time Naccept Nreject Nsweeps CPU Energy Time Naccept Nreject Nsweeps CPU Energy
50 39543 0 0 0 3784 50 39736 0 31 0 3298
60 43899 0 0 0.0187 3706 60 43567 0 35 0.00507 3296
Loop time of 0.018713 on 1 procs Loop time of 0.0050729 on 1 procs
Solve time (%) = 0.00176001 (9.40526) Solve time (%) = 0.000354098 (6.98019)
Update time (%) = 0 (0) Update time (%) = 0 (0)
Comm time (%) = 0.000314474 (1.68051) Comm time (%) = 0.000114818 (2.26336)
Outpt time (%) = 0.00413895 (22.118) Outpt time (%) = 0.000893366 (17.6106)
App time (%) = 0.0116153 (62.0706) App time (%) = 0.00362051 (71.3697)
Other time (%) = 0.000884295 (4.72556) Other time (%) = 9.0105e-05 (1.7762)
run 10Setting up run ... run 10Setting up run ...
Time Naccept Nreject Nsweeps CPU Energy Time Naccept Nreject Nsweeps CPU Energy
60 43899 0 0 0 3706 60 43567 0 35 0 3296
70 48028 0 0 0.0179 3392 70 47305 0 39 0.00417 3174
Loop time of 0.0178769 on 1 procs Loop time of 0.00417405 on 1 procs
Solve time (%) = 0.00174618 (9.76781) Solve time (%) = 0.00030627 (7.33747)
Update time (%) = 0 (0) Update time (%) = 0 (0)
Comm time (%) = 0.000296593 (1.65909) Comm time (%) = 9.1156e-05 (2.18387)
Outpt time (%) = 0.00414801 (23.2032) Outpt time (%) = 0.000689193 (16.5114)
App time (%) = 0.0108221 (60.5367) App time (%) = 0.00301511 (72.2347)
Other time (%) = 0.000864029 (4.83322) Other time (%) = 7.232e-05 (1.73261)
run 10Setting up run ... run 10Setting up run ...
Time Naccept Nreject Nsweeps CPU Energy Time Naccept Nreject Nsweeps CPU Energy
70 48028 0 0 0 3392 70 47305 0 39 0 3174
80 51900 0 0 0.017 3208 80 51214 0 43 0.00437 3252
Loop time of 0.0169971 on 1 procs Loop time of 0.00437516 on 1 procs
Solve time (%) = 0.00157022 (9.23819) Solve time (%) = 0.000332427 (7.59805)
Update time (%) = 0 (0) Update time (%) = 0 (0)
Comm time (%) = 0.000290394 (1.70849) Comm time (%) = 9.1593e-05 (2.09348)
Outpt time (%) = 0.00416803 (24.522) Outpt time (%) = 0.00064481 (14.738)
App time (%) = 0.0101995 (60.0076) App time (%) = 0.00323051 (73.8375)
Other time (%) = 0.0007689 (4.52371) Other time (%) = 7.5822e-05 (1.73301)
run 10Setting up run ... run 10Setting up run ...
Time Naccept Nreject Nsweeps CPU Energy Time Naccept Nreject Nsweeps CPU Energy
80 51900 0 0 0 3208 80 51214 0 43 0 3252
90 55450 0 0 0.0159 3162 90 54863 0 47 0.00417 3016
Loop time of 0.0158761 on 1 procs Loop time of 0.00417621 on 1 procs
Solve time (%) = 0.0014894 (9.38143) Solve time (%) = 0.000285188 (6.82887)
Update time (%) = 0 (0) Update time (%) = 0 (0)
Comm time (%) = 0.000301123 (1.89671) Comm time (%) = 9.0115e-05 (2.15782)
Outpt time (%) = 0.00413799 (26.0644) Outpt time (%) = 0.000719767 (17.2349)
App time (%) = 0.00924802 (58.2514) App time (%) = 0.00301373 (72.1642)
Other time (%) = 0.00069952 (4.40613) Other time (%) = 6.7413e-05 (1.61421)
run 10Setting up run ... run 10Setting up run ...
Time Naccept Nreject Nsweeps CPU Energy Time Naccept Nreject Nsweeps CPU Energy
90 55450 0 0 0 3162 90 54863 0 47 0 3016
100 59009 0 0 0.0158 3038 100 58060 0 51 0.00369 2766
Loop time of 0.0158172 on 1 procs Loop time of 0.00369187 on 1 procs
Solve time (%) = 0.00142503 (9.00938) Solve time (%) = 0.000253511 (6.86674)
Update time (%) = 0 (0) Update time (%) = 0 (0)
Comm time (%) = 0.000296831 (1.87664) Comm time (%) = 8.878e-05 (2.40475)
Outpt time (%) = 0.00412178 (26.0589) Outpt time (%) = 0.000686238 (18.5878)
App time (%) = 0.00923729 (58.4004) App time (%) = 0.00260318 (70.5111)
Other time (%) = 0.000736237 (4.65467) Other time (%) = 6.0163e-05 (1.62961)
run 10Setting up run ... run 10Setting up run ...
Time Naccept Nreject Nsweeps CPU Energy Time Naccept Nreject Nsweeps CPU Energy
100 59009 0 0 0 3038 100 58060 0 51 0 2766
110 62454 0 0 0.0155 3066 110 61110 0 55 0.00349 2840
Loop time of 0.015537 on 1 procs Loop time of 0.00349695 on 1 procs
Solve time (%) = 0.00135612 (8.72834) Solve time (%) = 0.000239587 (6.85131)
Update time (%) = 0 (0) Update time (%) = 0 (0)
Comm time (%) = 0.000293732 (1.89053) Comm time (%) = 8.1517e-05 (2.33109)
Outpt time (%) = 0.00415182 (26.7221) Outpt time (%) = 0.000719507 (20.5753)
App time (%) = 0.00904965 (58.2457) App time (%) = 0.0023994 (68.614)
Other time (%) = 0.000685692 (4.41328) Other time (%) = 5.6943e-05 (1.62836)
run 10Setting up run ... run 10Setting up run ...
Time Naccept Nreject Nsweeps CPU Energy Time Naccept Nreject Nsweeps CPU Energy
110 62454 0 0 0 3066 110 61110 0 55 0 2840
120 65856 0 0 0.0152 2898 120 64087 0 59 0.00325 2714
Loop time of 0.0152211 on 1 procs Loop time of 0.00324861 on 1 procs
Solve time (%) = 0.00139046 (9.13505) Solve time (%) = 0.000225271 (6.93437)
Update time (%) = 0 (0) Update time (%) = 0 (0)
Comm time (%) = 0.000291109 (1.91253) Comm time (%) = 8.3445e-05 (2.56863)
Outpt time (%) = 0.0041492 (27.2595) Outpt time (%) = 0.000647543 (19.9329)
App time (%) = 0.00871038 (57.2257) App time (%) = 0.00223748 (68.8748)
Other time (%) = 0.00067997 (4.46728) Other time (%) = 5.4877e-05 (1.68924)
run 10Setting up run ... run 10Setting up run ...
Time Naccept Nreject Nsweeps CPU Energy Time Naccept Nreject Nsweeps CPU Energy
120 65856 0 0 0 2898 120 64087 0 59 0 2714
130 68856 0 0 0.0137 2798 130 67004 0 63 0.00333 2664
Loop time of 0.0137191 on 1 procs Loop time of 0.00333198 on 1 procs
Solve time (%) = 0.00130701 (9.52695) Solve time (%) = 0.00022963 (6.89169)
Update time (%) = 0 (0) Update time (%) = 0 (0)
Comm time (%) = 0.000296831 (2.16364) Comm time (%) = 9.0368e-05 (2.71214)
Outpt time (%) = 0.00412989 (30.1032) Outpt time (%) = 0.000650383 (19.5194)
App time (%) = 0.00742817 (54.1448) App time (%) = 0.00230627 (69.2163)
Other time (%) = 0.000557184 (4.06138) Other time (%) = 5.5328e-05 (1.66051)
run 10Setting up run ... run 10Setting up run ...
Time Naccept Nreject Nsweeps CPU Energy Time Naccept Nreject Nsweeps CPU Energy
130 68856 0 0 0 2798 130 67004 0 63 0 2664
140 71967 0 0 0.0141 2700 140 69933 0 67 0.00324 2680
Loop time of 0.0141542 on 1 procs Loop time of 0.00324401 on 1 procs
Solve time (%) = 0.00132799 (9.38232) Solve time (%) = 0.000227399 (7.00982)
Update time (%) = 0 (0) Update time (%) = 0 (0)
Comm time (%) = 0.000284195 (2.00785) Comm time (%) = 8.818e-05 (2.71824)
Outpt time (%) = 0.00414681 (29.2974) Outpt time (%) = 0.000638812 (19.6921)
App time (%) = 0.00777125 (54.9042) App time (%) = 0.00223398 (68.8649)
Other time (%) = 0.000623941 (4.40817) Other time (%) = 5.5635e-05 (1.71501)
run 10Setting up run ... run 10Setting up run ...
Time Naccept Nreject Nsweeps CPU Energy Time Naccept Nreject Nsweeps CPU Energy
140 71967 0 0 0 2700 140 69933 0 67 0 2680
150 74773 0 0 0.0132 2644 150 72830 0 71 0.00314 2664
Loop time of 0.0131881 on 1 procs Loop time of 0.0031476 on 1 procs
Solve time (%) = 0.00111961 (8.48956) Solve time (%) = 0.000213509 (6.78324)
Update time (%) = 0 (0) Update time (%) = 0 (0)
Comm time (%) = 0.000277758 (2.10612) Comm time (%) = 8.6263e-05 (2.7406)
Outpt time (%) = 0.00413394 (31.3459) Outpt time (%) = 0.000676177 (21.4823)
App time (%) = 0.00711513 (53.951) App time (%) = 0.00211915 (67.326)
Other time (%) = 0.000541687 (4.10738) Other time (%) = 5.2495e-05 (1.66778)
run 10Setting up run ... run 10Setting up run ...
Time Naccept Nreject Nsweeps CPU Energy Time Naccept Nreject Nsweeps CPU Energy
150 74773 0 0 0 2644 150 72830 0 71 0 2664
160 77662 0 0 0.0134 2616 160 75877 0 75 0.00386 2640
Loop time of 0.0133891 on 1 procs Loop time of 0.00386614 on 1 procs
Solve time (%) = 0.00116301 (8.68621) Solve time (%) = 0.000262699 (6.79487)
Update time (%) = 0 (0) Update time (%) = 0 (0)
Comm time (%) = 0.00027895 (2.08341) Comm time (%) = 0.000115859 (2.99676)
Outpt time (%) = 0.00415397 (31.025) Outpt time (%) = 0.000745615 (19.2858)
App time (%) = 0.00725079 (54.1544) App time (%) = 0.00267785 (69.2643)
Other time (%) = 0.000542402 (4.05107) Other time (%) = 6.4111e-05 (1.65827)
run 10Setting up run ... run 10Setting up run ...
Time Naccept Nreject Nsweeps CPU Energy Time Naccept Nreject Nsweeps CPU Energy
160 77662 0 0 0 2616 160 75877 0 75 0 2640
170 80475 0 0 0.0131 2538 170 78733 0 79 0.00555 2486
Loop time of 0.0130939 on 1 procs Loop time of 0.0055484 on 1 procs
Solve time (%) = 0.00108457 (8.28296) Solve time (%) = 0.000407211 (7.33925)
Update time (%) = 0 (0) Update time (%) = 0 (0)
Comm time (%) = 0.000279665 (2.13583) Comm time (%) = 0.000168943 (3.04489)
Outpt time (%) = 0.00412798 (31.5259) Outpt time (%) = 0.000823976 (14.8507)
App time (%) = 0.00700951 (53.5324) App time (%) = 0.00404893 (72.9746)
Other time (%) = 0.000592232 (4.52294) Other time (%) = 9.9346e-05 (1.79053)
run 10Setting up run ... run 10Setting up run ...
Time Naccept Nreject Nsweeps CPU Energy Time Naccept Nreject Nsweeps CPU Energy
170 80475 0 0 0 2538 170 78733 0 79 0 2486
180 83407 0 0 0.0136 2660 180 81400 0 83 0.00291 2396
Loop time of 0.0136199 on 1 procs Loop time of 0.00291697 on 1 procs
Solve time (%) = 0.00117278 (8.61079) Solve time (%) = 0.000197105 (6.75718)
Update time (%) = 0 (0) Update time (%) = 0 (0)
Comm time (%) = 0.000262737 (1.92907) Comm time (%) = 8.6733e-05 (2.97339)
Outpt time (%) = 0.00413108 (30.3312) Outpt time (%) = 0.000641861 (22.0044)
App time (%) = 0.0074532 (54.7229) App time (%) = 0.00194335 (66.6221)
Other time (%) = 0.0006001 (4.40605) Other time (%) = 4.7923e-05 (1.6429)
run 10Setting up run ... run 10Setting up run ...
Time Naccept Nreject Nsweeps CPU Energy Time Naccept Nreject Nsweeps CPU Energy
180 83407 0 0 0 2660 180 81400 0 83 0 2396
190 86407 0 0 0.0138 2656 190 84097 0 86 0.00291 2418
Loop time of 0.013859 on 1 procs Loop time of 0.00290961 on 1 procs
Solve time (%) = 0.00119066 (8.59124) Solve time (%) = 0.000198685 (6.82859)
Update time (%) = 0 (0) Update time (%) = 0 (0)
Comm time (%) = 0.000247717 (1.7874) Comm time (%) = 6.5496e-05 (2.25103)
Outpt time (%) = 0.00414801 (29.93) Outpt time (%) = 0.000671627 (23.0831)
App time (%) = 0.00767326 (55.3665) App time (%) = 0.00192582 (66.1883)
Other time (%) = 0.000599384 (4.32486) Other time (%) = 4.7978e-05 (1.64895)
run 10Setting up run ... run 10Setting up run ...
Time Naccept Nreject Nsweeps CPU Energy Time Naccept Nreject Nsweeps CPU Energy
190 86407 0 0 0 2656 190 84097 0 86 0 2418
200 88961 0 0 0.0124 2374 200 86656 0 90 0.00332 2442
Loop time of 0.0124531 on 1 procs Loop time of 0.00332468 on 1 procs
Solve time (%) = 0.00107932 (8.6671) Solve time (%) = 0.000220838 (6.64238)
Update time (%) = 0 (0) Update time (%) = 0 (0)
Comm time (%) = 0.000233412 (1.87433) Comm time (%) = 9.3912e-05 (2.82469)
Outpt time (%) = 0.00414777 (33.3072) Outpt time (%) = 0.000744786 (22.4017)
App time (%) = 0.00648117 (52.0447) App time (%) = 0.00221113 (66.5064)
Other time (%) = 0.000511408 (4.10668) Other time (%) = 5.402e-05 (1.62482)

View File

@ -1,4 +1,4 @@
SPPARKS (26 Aug 2010) SPPARKS (19 Sept 2022)
# SPPARKS input for coupling MD/MC # SPPARKS input for coupling MD/MC
seed 56789 seed 56789
@ -28,244 +28,246 @@ diag_style energy
temperature 1.0 temperature 1.0
stats 10.0 stats 10.0
dump 1 10.0 dump.mc dump 1 text 10.0 dump.mc id site x y
run 10Setting up run ... run 10Setting up run ...
Running with 32-bit site IDs
Memory usage per processor = 2.375 Mbytes
Time Naccept Nreject Nsweeps CPU Energy Time Naccept Nreject Nsweeps CPU Energy
0 0 0 0 0 19766 0 0 0 0 0 19766
10 18695 0 0 0.024 5696 10 18709 0 14 0.00995 5410
Loop time of 0.0240365 on 4 procs Loop time of 0.00996147 on 4 procs
Solve time (%) = 0.0017997 (7.48737) Solve time (%) = 0.000401817 (4.03371)
Update time (%) = 0 (0) Update time (%) = 0 (0)
Comm time (%) = 0.00263286 (10.9536) Comm time (%) = 0.00184758 (18.5473)
Outpt time (%) = 0.00416493 (17.3275) Outpt time (%) = 0.000835493 (8.38724)
App time (%) = 0.0137114 (57.044) App time (%) = 0.00643178 (64.5665)
Other time (%) = 0.00172764 (7.18756) Other time (%) = 0.000444804 (4.46524)
run 10Setting up run ... run 10Setting up run ...
Time Naccept Nreject Nsweeps CPU Energy Time Naccept Nreject Nsweeps CPU Energy
10 18695 0 0 0 5696 10 18709 0 14 0 5410
20 25730 0 0 0.0114 4806 20 25405 0 20 0.00348 4414
Loop time of 0.0113776 on 4 procs Loop time of 0.00348928 on 4 procs
Solve time (%) = 0.000647247 (5.68877) Solve time (%) = 0.000145149 (4.15985)
Update time (%) = 0 (0) Update time (%) = 0 (0)
Comm time (%) = 0.0013088 (11.5033) Comm time (%) = 0.000562263 (16.114)
Outpt time (%) = 0.00417346 (36.6812) Outpt time (%) = 0.0007944 (22.7669)
App time (%) = 0.0045594 (40.0733) App time (%) = 0.00176801 (50.6697)
Other time (%) = 0.000688732 (6.05338) Other time (%) = 0.000219463 (6.28963)
run 10Setting up run ... run 10Setting up run ...
Time Naccept Nreject Nsweeps CPU Energy Time Naccept Nreject Nsweeps CPU Energy
20 25730 0 0 0 4806 20 25405 0 20 0 4414
30 31377 0 0 0.00985 4308 30 30724 0 25 0.00314 4092
Loop time of 0.00987101 on 4 procs Loop time of 0.00314216 on 4 procs
Solve time (%) = 0.000525832 (5.32704) Solve time (%) = 0.000123228 (3.92176)
Update time (%) = 0 (0) Update time (%) = 0 (0)
Comm time (%) = 0.0012235 (12.3949) Comm time (%) = 0.000561445 (17.8681)
Outpt time (%) = 0.00415748 (42.1181) Outpt time (%) = 0.00079681 (25.3586)
App time (%) = 0.00343758 (34.825) App time (%) = 0.00146373 (46.5835)
Other time (%) = 0.000526607 (5.33489) Other time (%) = 0.000196952 (6.26804)
run 10Setting up run ... run 10Setting up run ...
Time Naccept Nreject Nsweeps CPU Energy Time Naccept Nreject Nsweeps CPU Energy
30 31377 0 0 0 4308 30 30724 0 25 0 4092
40 36311 0 0 0.0092 3840 40 35289 0 30 0.00256 3496
Loop time of 0.00922179 on 4 procs Loop time of 0.0025659 on 4 procs
Solve time (%) = 0.000474155 (5.14168) Solve time (%) = 9.47535e-05 (3.6928)
Update time (%) = 0 (0) Update time (%) = 0 (0)
Comm time (%) = 0.00114667 (12.4344) Comm time (%) = 0.000508415 (19.8143)
Outpt time (%) = 0.00414455 (44.943) Outpt time (%) = 0.000788757 (30.74)
App time (%) = 0.00293165 (31.7905) App time (%) = 0.00106383 (41.4604)
Other time (%) = 0.000524759 (5.69043) Other time (%) = 0.000110143 (4.29259)
run 10Setting up run ... run 10Setting up run ...
Time Naccept Nreject Nsweeps CPU Energy Time Naccept Nreject Nsweeps CPU Energy
40 36311 0 0 0 3840 40 35289 0 30 0 3496
50 40886 0 0 0.00891 3534 50 39511 0 35 0.00252 3294
Loop time of 0.0089252 on 4 procs Loop time of 0.00252512 on 4 procs
Solve time (%) = 0.000433862 (4.86109) Solve time (%) = 8.7092e-05 (3.44903)
Update time (%) = 0 (0) Update time (%) = 0 (0)
Comm time (%) = 0.00113171 (12.68) Comm time (%) = 0.000631729 (25.0178)
Outpt time (%) = 0.00413698 (46.3517) Outpt time (%) = 0.000780138 (30.8952)
App time (%) = 0.00268257 (30.0561) App time (%) = 0.000963016 (38.1375)
Other time (%) = 0.000540078 (6.05116) Other time (%) = 6.31405e-05 (2.5005)
run 10Setting up run ... run 10Setting up run ...
Time Naccept Nreject Nsweeps CPU Energy Time Naccept Nreject Nsweeps CPU Energy
50 40886 0 0 0 3534 50 39511 0 35 0 3294
60 44888 0 0 0.00831 3306 60 43241 0 40 0.00254 3158
Loop time of 0.00833625 on 4 procs Loop time of 0.00254794 on 4 procs
Solve time (%) = 0.000383437 (4.59963) Solve time (%) = 8.5528e-05 (3.35675)
Update time (%) = 0 (0) Update time (%) = 0 (0)
Comm time (%) = 0.00106108 (12.7285) Comm time (%) = 0.000598337 (23.4831)
Outpt time (%) = 0.00413227 (49.5699) Outpt time (%) = 0.000777931 (30.5317)
App time (%) = 0.00232393 (27.8774) App time (%) = 0.000940118 (36.8971)
Other time (%) = 0.000435531 (5.22455) Other time (%) = 0.00014603 (5.73128)
run 10Setting up run ... run 10Setting up run ...
Time Naccept Nreject Nsweeps CPU Energy Time Naccept Nreject Nsweeps CPU Energy
60 44888 0 0 0 3306 60 43241 0 40 0 3158
70 48583 0 0 0.00806 3078 70 46797 0 44 0.00248 3060
Loop time of 0.0080772 on 4 procs Loop time of 0.00248266 on 4 procs
Solve time (%) = 0.000353277 (4.37375) Solve time (%) = 8.14515e-05 (3.28081)
Update time (%) = 0 (0) Update time (%) = 0 (0)
Comm time (%) = 0.00102895 (12.739) Comm time (%) = 0.000482648 (19.4407)
Outpt time (%) = 0.0041061 (50.8357) Outpt time (%) = 0.000991271 (39.9277)
App time (%) = 0.00213838 (26.4742) App time (%) = 0.00085854 (34.5814)
Other time (%) = 0.000450492 (5.57732) Other time (%) = 6.87532e-05 (2.76933)
run 10Setting up run ... run 10Setting up run ...
Time Naccept Nreject Nsweeps CPU Energy Time Naccept Nreject Nsweeps CPU Energy
70 48583 0 0 0 3078 70 46797 0 44 0 3060
80 52044 0 0 0.00786 2998 80 50183 0 48 0.0024 3102
Loop time of 0.00788343 on 4 procs Loop time of 0.00240397 on 4 procs
Solve time (%) = 0.000333607 (4.23175) Solve time (%) = 8.22802e-05 (3.42268)
Update time (%) = 0 (0) Update time (%) = 0 (0)
Comm time (%) = 0.00101435 (12.8669) Comm time (%) = 0.000494873 (20.5856)
Outpt time (%) = 0.00420028 (53.2799) Outpt time (%) = 0.00085299 (35.4825)
App time (%) = 0.00198931 (25.234) App time (%) = 0.000883469 (36.7504)
Other time (%) = 0.000345886 (4.3875) Other time (%) = 9.03613e-05 (3.75883)
run 10Setting up run ... run 10Setting up run ...
Time Naccept Nreject Nsweeps CPU Energy Time Naccept Nreject Nsweeps CPU Energy
80 52044 0 0 0 2998 80 50183 0 48 0 3102
90 55352 0 0 0.0083 3026 90 53732 0 52 0.00272 3028
Loop time of 0.00831437 on 4 procs Loop time of 0.00272017 on 4 procs
Solve time (%) = 0.00031358 (3.77154) Solve time (%) = 9.94713e-05 (3.6568)
Update time (%) = 0 (0) Update time (%) = 0 (0)
Comm time (%) = 0.00111783 (13.4445) Comm time (%) = 0.000613542 (22.5553)
Outpt time (%) = 0.00467652 (56.2462) Outpt time (%) = 0.000800183 (29.4166)
App time (%) = 0.00188529 (22.6751) App time (%) = 0.00108281 (39.8067)
Other time (%) = 0.00032115 (3.86259) Other time (%) = 0.000124164 (4.56456)
run 10Setting up run ... run 10Setting up run ...
Time Naccept Nreject Nsweeps CPU Energy Time Naccept Nreject Nsweeps CPU Energy
90 55352 0 0 0 3026 90 53732 0 52 0 3028
100 58494 0 0 0.00733 2742 100 57112 0 56 0.0023 2942
Loop time of 0.00735307 on 4 procs Loop time of 0.00230787 on 4 procs
Solve time (%) = 0.000297189 (4.0417) Solve time (%) = 7.58975e-05 (3.28864)
Update time (%) = 0 (0) Update time (%) = 0 (0)
Comm time (%) = 0.000801027 (10.8938) Comm time (%) = 0.000502726 (21.7831)
Outpt time (%) = 0.00418043 (56.8529) Outpt time (%) = 0.000796114 (34.4956)
App time (%) = 0.00179577 (24.422) App time (%) = 0.000828819 (35.9127)
Other time (%) = 0.000278652 (3.7896) Other time (%) = 0.000104316 (4.51999)
run 10Setting up run ... run 10Setting up run ...
Time Naccept Nreject Nsweeps CPU Energy Time Naccept Nreject Nsweeps CPU Energy
100 58494 0 0 0 2742 100 57112 0 56 0 2942
110 61498 0 0 0.00732 2636 110 60445 0 60 0.00192 2850
Loop time of 0.00733691 on 4 procs Loop time of 0.00192261 on 4 procs
Solve time (%) = 0.000282168 (3.84587) Solve time (%) = 6.89883e-05 (3.58826)
Update time (%) = 0 (0) Update time (%) = 0 (0)
Comm time (%) = 0.000877678 (11.9625) Comm time (%) = 0.000257782 (13.4079)
Outpt time (%) = 0.00414526 (56.4987) Outpt time (%) = 0.000791242 (41.1545)
App time (%) = 0.00174332 (23.7609) App time (%) = 0.000735212 (38.2403)
Other time (%) = 0.000288486 (3.93199) Other time (%) = 6.9388e-05 (3.60905)
run 10Setting up run ... run 10Setting up run ...
Time Naccept Nreject Nsweeps CPU Energy Time Naccept Nreject Nsweeps CPU Energy
110 61498 0 0 0 2636 110 60445 0 60 0 2850
120 64343 0 0 0.00719 2518 120 63603 0 64 0.00193 2866
Loop time of 0.00721735 on 4 procs Loop time of 0.00193198 on 4 procs
Solve time (%) = 0.000270605 (3.74937) Solve time (%) = 6.44032e-05 (3.33354)
Update time (%) = 0 (0) Update time (%) = 0 (0)
Comm time (%) = 0.00078702 (10.9046) Comm time (%) = 0.00027428 (14.1969)
Outpt time (%) = 0.00416625 (57.7254) Outpt time (%) = 0.000812462 (42.0534)
App time (%) = 0.00162369 (22.497) App time (%) = 0.000682923 (35.3484)
Other time (%) = 0.000369787 (5.12359) Other time (%) = 9.79088e-05 (5.0678)
run 10Setting up run ... run 10Setting up run ...
Time Naccept Nreject Nsweeps CPU Energy Time Naccept Nreject Nsweeps CPU Energy
120 64343 0 0 0 2518 120 63603 0 64 0 2866
130 66901 0 0 0.00709 2480 130 66749 0 68 0.0022 2710
Loop time of 0.00710845 on 4 procs Loop time of 0.00220226 on 4 procs
Solve time (%) = 0.000247002 (3.47476) Solve time (%) = 8.013e-05 (3.63854)
Update time (%) = 0 (0) Update time (%) = 0 (0)
Comm time (%) = 0.00100386 (14.1221) Comm time (%) = 0.000362387 (16.4552)
Outpt time (%) = 0.00416774 (58.6307) Outpt time (%) = 0.000819649 (37.2186)
App time (%) = 0.00143349 (20.166) App time (%) = 0.000844146 (38.3309)
Other time (%) = 0.00025636 (3.60641) Other time (%) = 9.59462e-05 (4.35672)
run 10Setting up run ... run 10Setting up run ...
Time Naccept Nreject Nsweeps CPU Energy Time Naccept Nreject Nsweeps CPU Energy
130 66901 0 0 0 2480 130 66749 0 68 0 2710
140 69617 0 0 0.00723 2462 140 69868 0 72 0.00276 2822
Loop time of 0.00725645 on 4 procs Loop time of 0.00276561 on 4 procs
Solve time (%) = 0.000262678 (3.61992) Solve time (%) = 8.8444e-05 (3.19799)
Update time (%) = 0 (0) Update time (%) = 0 (0)
Comm time (%) = 0.000848353 (11.691) Comm time (%) = 0.000566006 (20.4659)
Outpt time (%) = 0.00418752 (57.7076) Outpt time (%) = 0.00100224 (36.2395)
App time (%) = 0.00152171 (20.9704) App time (%) = 0.000938724 (33.9427)
Other time (%) = 0.000436187 (6.01102) Other time (%) = 0.000170192 (6.15388)
run 10Setting up run ... run 10Setting up run ...
Time Naccept Nreject Nsweeps CPU Energy Time Naccept Nreject Nsweeps CPU Energy
140 69617 0 0 0 2462 140 69868 0 72 0 2822
150 72516 0 0 0.0077 2368 150 72809 0 77 0.00203 2530
Loop time of 0.00771403 on 4 procs Loop time of 0.00203296 on 4 procs
Solve time (%) = 0.000279188 (3.61922) Solve time (%) = 6.10922e-05 (3.00508)
Update time (%) = 0 (0) Update time (%) = 0 (0)
Comm time (%) = 0.00115103 (14.9212) Comm time (%) = 0.000430907 (21.196)
Outpt time (%) = 0.00420797 (54.5495) Outpt time (%) = 0.000773949 (38.07)
App time (%) = 0.00164241 (21.2911) App time (%) = 0.000649508 (31.9488)
Other time (%) = 0.000433445 (5.61892) Other time (%) = 0.000117508 (5.78011)
run 10Setting up run ... run 10Setting up run ...
Time Naccept Nreject Nsweeps CPU Energy Time Naccept Nreject Nsweeps CPU Energy
150 72516 0 0 0 2368 150 72809 0 77 0 2530
160 75201 0 0 0.00745 2384 160 75490 0 82 0.00243 2560
Loop time of 0.00747746 on 4 procs Loop time of 0.00243939 on 4 procs
Solve time (%) = 0.00026089 (3.48901) Solve time (%) = 7.29237e-05 (2.98943)
Update time (%) = 0 (0) Update time (%) = 0 (0)
Comm time (%) = 0.00115579 (15.457) Comm time (%) = 0.000533877 (21.8857)
Outpt time (%) = 0.00416714 (55.7293) Outpt time (%) = 0.000900521 (36.9159)
App time (%) = 0.0015164 (20.2796) App time (%) = 0.000753532 (30.8902)
Other time (%) = 0.000377238 (5.045) Other time (%) = 0.000178534 (7.31879)
run 10Setting up run ... run 10Setting up run ...
Time Naccept Nreject Nsweeps CPU Energy Time Naccept Nreject Nsweeps CPU Energy
160 75201 0 0 0 2384 160 75490 0 82 0 2560
170 77794 0 0 0.00709 2286 170 78382 0 86 0.00203 2424
Loop time of 0.00710869 on 4 procs Loop time of 0.00203432 on 4 procs
Solve time (%) = 0.000261724 (3.68175) Solve time (%) = 6.05745e-05 (2.97762)
Update time (%) = 0 (0) Update time (%) = 0 (0)
Comm time (%) = 0.000879705 (12.3751) Comm time (%) = 0.000357404 (17.5687)
Outpt time (%) = 0.00419676 (59.0371) Outpt time (%) = 0.000830967 (40.8473)
App time (%) = 0.00145274 (20.4362) App time (%) = 0.000642883 (31.6018)
Other time (%) = 0.000317752 (4.46992) Other time (%) = 0.000142495 (7.00454)
run 10Setting up run ... run 10Setting up run ...
Time Naccept Nreject Nsweeps CPU Energy Time Naccept Nreject Nsweeps CPU Energy
170 77794 0 0 0 2286 170 78382 0 86 0 2424
180 80320 0 0 0.00723 2186 180 81046 0 90 0.00266 2450
Loop time of 0.00725418 on 4 procs Loop time of 0.00266286 on 4 procs
Solve time (%) = 0.000241041 (3.32279) Solve time (%) = 7.05732e-05 (2.65028)
Update time (%) = 0 (0) Update time (%) = 0 (0)
Comm time (%) = 0.00100464 (13.8491) Comm time (%) = 0.000638214 (23.9672)
Outpt time (%) = 0.00413877 (57.0535) Outpt time (%) = 0.00102986 (38.6749)
App time (%) = 0.00144053 (19.8579) App time (%) = 0.000760398 (28.5557)
Other time (%) = 0.000429213 (5.91677) Other time (%) = 0.000163817 (6.15191)
run 10Setting up run ... run 10Setting up run ...
Time Naccept Nreject Nsweeps CPU Energy Time Naccept Nreject Nsweeps CPU Energy
180 80320 0 0 0 2186 180 81046 0 90 0 2450
190 82621 0 0 0.00686 2204 190 83562 0 94 0.00216 2402
Loop time of 0.00687295 on 4 procs Loop time of 0.0021675 on 4 procs
Solve time (%) = 0.000222385 (3.23565) Solve time (%) = 6.2358e-05 (2.87696)
Update time (%) = 0 (0) Update time (%) = 0 (0)
Comm time (%) = 0.000860512 (12.5203) Comm time (%) = 0.000536287 (24.7422)
Outpt time (%) = 0.00418121 (60.8357) Outpt time (%) = 0.000802317 (37.0158)
App time (%) = 0.00126499 (18.4053) App time (%) = 0.000649124 (29.9481)
Other time (%) = 0.000343859 (5.00308) Other time (%) = 0.000117412 (5.41694)
run 10Setting up run ... run 10Setting up run ...
Time Naccept Nreject Nsweeps CPU Energy Time Naccept Nreject Nsweeps CPU Energy
190 82621 0 0 0 2204 190 83562 0 94 0 2402
200 84907 0 0 0.00681 2276 200 86036 0 98 0.0021 2306
Loop time of 0.0068413 on 4 procs Loop time of 0.00210625 on 4 procs
Solve time (%) = 0.000233412 (3.4118) Solve time (%) = 5.94018e-05 (2.82026)
Update time (%) = 0 (0) Update time (%) = 0 (0)
Comm time (%) = 0.000758171 (11.0823) Comm time (%) = 0.000492842 (23.399)
Outpt time (%) = 0.00421125 (61.5562) Outpt time (%) = 0.000817012 (38.7899)
App time (%) = 0.00125164 (18.2953) App time (%) = 0.000597335 (28.3601)
Other time (%) = 0.000386834 (5.65439) Other time (%) = 0.00013966 (6.63072)

View File

@ -2,7 +2,7 @@
#include <cstdlib> #include <cstdlib>
#include <cstring> #include <cstring>
#include "irregular.h" #include "irregular.h"
#include "memory.h" #include "memorylib.h"
#include "errorlib.h" #include "errorlib.h"
#define MAX(A,B) ((A) > (B)) ? (A) : (B) #define MAX(A,B) ((A) > (B)) ? (A) : (B)
@ -18,7 +18,7 @@ Irregular::Irregular(MPI_Comm caller)
MPI_Comm_rank(comm,&me); MPI_Comm_rank(comm,&me);
MPI_Comm_size(comm,&nprocs); MPI_Comm_size(comm,&nprocs);
memory = new Memory(comm); memory = new MemoryLib(comm);
error = new ErrorLib(comm); error = new ErrorLib(comm);
init(); init();

View File

@ -46,7 +46,7 @@ class Irregular {
MPI_Status *status; // MPI statuses for Waitall MPI_Status *status; // MPI statuses for Waitall
MPI_Comm comm; // MPI communicator for all communication MPI_Comm comm; // MPI communicator for all communication
class Memory *memory; class MemoryLib *memory;
class ErrorLib *error; class ErrorLib *error;
void exchange_same(char *, char *); void exchange_same(char *, char *);

View File

@ -2,7 +2,7 @@
#include <cstdlib> #include <cstdlib>
#include <cstring> #include <cstring>
#include "lammps_data_write.h" #include "lammps_data_write.h"
#include "memory.h" #include "memorylib.h"
#include "errorlib.h" #include "errorlib.h"
#define DELTA 4; #define DELTA 4;

View File

@ -3,7 +3,7 @@
#include <cstdio> #include <cstdio>
#include "many2many.h" #include "many2many.h"
#include "irregular.h" #include "irregular.h"
#include "memory.h" #include "memorylib.h"
#include "errorlib.h" #include "errorlib.h"
#include <map> #include <map>
@ -18,7 +18,7 @@ Many2Many::Many2Many(MPI_Comm caller)
MPI_Comm_rank(comm,&me); MPI_Comm_rank(comm,&me);
MPI_Comm_size(comm,&nprocs); MPI_Comm_size(comm,&nprocs);
memory = new Memory(comm); memory = new MemoryLib(comm);
error = new ErrorLib(comm); error = new ErrorLib(comm);
src_own = dest_own = NULL; src_own = dest_own = NULL;

View File

@ -15,7 +15,7 @@ class Many2Many {
protected: protected:
int me,nprocs; int me,nprocs;
MPI_Comm comm; MPI_Comm comm;
class Memory *memory; class MemoryLib *memory;
class ErrorLib *error; class ErrorLib *error;
int nown; // # of IDs common to src and dest int nown; // # of IDs common to src and dest

View File

@ -2,7 +2,7 @@
#include <cstdio> #include <cstdio>
#include <cstdlib> #include <cstdlib>
#include "many2one.h" #include "many2one.h"
#include "memory.h" #include "memorylib.h"
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
@ -12,7 +12,7 @@ Many2One::Many2One(MPI_Comm caller_comm)
MPI_Comm_rank(comm,&me); MPI_Comm_rank(comm,&me);
MPI_Comm_size(comm,&nprocs); MPI_Comm_size(comm,&nprocs);
memory = new Memory(comm); memory = new MemoryLib(comm);
if (me == 0) { if (me == 0) {
counts = new int[nprocs]; counts = new int[nprocs];

View File

@ -14,7 +14,7 @@ class Many2One {
protected: protected:
int me,nprocs; int me,nprocs;
MPI_Comm comm; MPI_Comm comm;
class Memory *memory; class MemoryLib *memory;
int nsrc,nall; int nsrc,nall;
int *counts,*multicounts; int *counts,*multicounts;

View File

@ -1,19 +1,19 @@
#include <mpi.h> #include <mpi.h>
#include <cstdlib> #include <cstdlib>
#include <cstdio> #include <cstdio>
#include "memory.h" #include "memorylib.h"
#include "errorlib.h" #include "errorlib.h"
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
Memory::Memory(MPI_Comm comm) MemoryLib::MemoryLib(MPI_Comm comm)
{ {
error = new ErrorLib(comm); error = new ErrorLib(comm);
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
Memory::~Memory() MemoryLib::~MemoryLib()
{ {
delete error; delete error;
} }
@ -22,7 +22,7 @@ Memory::~Memory()
safe malloc safe malloc
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
void *Memory::smalloc(int n, const char *name) void *MemoryLib::smalloc(int n, const char *name)
{ {
if (n == 0) return NULL; if (n == 0) return NULL;
void *ptr = malloc(n); void *ptr = malloc(n);
@ -38,7 +38,7 @@ void *Memory::smalloc(int n, const char *name)
safe free safe free
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
void Memory::sfree(void *ptr) void MemoryLib::sfree(void *ptr)
{ {
if (ptr == NULL) return; if (ptr == NULL) return;
free(ptr); free(ptr);
@ -48,7 +48,7 @@ void Memory::sfree(void *ptr)
safe realloc safe realloc
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
void *Memory::srealloc(void *ptr, int n, const char *name) void *MemoryLib::srealloc(void *ptr, int n, const char *name)
{ {
if (n == 0) { if (n == 0) {
sfree(ptr); sfree(ptr);
@ -68,7 +68,7 @@ void *Memory::srealloc(void *ptr, int n, const char *name)
create a 2d double array create a 2d double array
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
double **Memory::create_2d_double_array(int n1, int n2, const char *name) double **MemoryLib::create_2d_double_array(int n1, int n2, const char *name)
{ {
double *data = (double *) smalloc(n1*n2*sizeof(double),name); double *data = (double *) smalloc(n1*n2*sizeof(double),name);
@ -89,7 +89,7 @@ double **Memory::create_2d_double_array(int n1, int n2, const char *name)
if either dim is 0, return NULL if either dim is 0, return NULL
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
double **Memory::grow_2d_double_array(double **array, double **MemoryLib::grow_2d_double_array(double **array,
int n1, int n2, const char *name) int n1, int n2, const char *name)
{ {
@ -111,7 +111,7 @@ double **Memory::grow_2d_double_array(double **array,
free a 2d double array free a 2d double array
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
void Memory::destroy_2d_double_array(double **array) void MemoryLib::destroy_2d_double_array(double **array)
{ {
if (array == NULL) return; if (array == NULL) return;

View File

@ -1,12 +1,12 @@
#ifndef MEMORY_H #ifndef MEMORY_LIB_H
#define MEMORY_H #define MEMORY_LIB_H
#include <mpi.h> #include <mpi.h>
class Memory { class MemoryLib {
public: public:
Memory(MPI_Comm); MemoryLib(MPI_Comm);
~Memory(); ~MemoryLib();
void *smalloc(int n, const char *); void *smalloc(int n, const char *);
void sfree(void *); void sfree(void *);

View File

@ -1,7 +1,7 @@
#include <mpi.h> #include <mpi.h>
#include <cstdlib> #include <cstdlib>
#include "one2many.h" #include "one2many.h"
#include "memory.h" #include "memorylib.h"
#include <map> #include <map>
@ -13,7 +13,7 @@ One2Many::One2Many(MPI_Comm caller_comm)
MPI_Comm_rank(comm,&me); MPI_Comm_rank(comm,&me);
MPI_Comm_size(comm,&nprocs); MPI_Comm_size(comm,&nprocs);
memory = new Memory(comm); memory = new MemoryLib(comm);
hash = new std::map<int,int>(); hash = new std::map<int,int>();
} }

View File

@ -16,7 +16,7 @@ class One2Many {
protected: protected:
int me,nprocs; int me,nprocs;
MPI_Comm comm; MPI_Comm comm;
class Memory *memory; class MemoryLib *memory;
std::map<int,int> *hash; std::map<int,int> *hash;
int nsrc; int nsrc;
}; };

View File

@ -2,7 +2,7 @@
#include <cstdlib> #include <cstdlib>
#include <cstdio> #include <cstdio>
#include "send2one.h" #include "send2one.h"
#include "memory.h" #include "memorylib.h"
#include "errorlib.h" #include "errorlib.h"
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
@ -13,7 +13,7 @@ Send2One::Send2One(MPI_Comm caller_comm)
MPI_Comm_rank(comm,&me); MPI_Comm_rank(comm,&me);
MPI_Comm_size(comm,&nprocs); MPI_Comm_size(comm,&nprocs);
memory = new Memory(comm); memory = new MemoryLib(comm);
error = new ErrorLib(comm); error = new ErrorLib(comm);
buf = NULL; buf = NULL;

View File

@ -13,7 +13,7 @@ class Send2One {
protected: protected:
int me,nprocs; int me,nprocs;
MPI_Comm comm; MPI_Comm comm;
class Memory *memory; class MemoryLib *memory;
class ErrorLib *error; class ErrorLib *error;
int maxbuf; int maxbuf;