0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ADDA > chp_time > used to trigger SaveIterChpoint() > chp_time / chpoint

Last updated at Posted at 2016-11-28
My_Environment
Ubuntu 14.04 LTS Japanese Remix
on VMWare Fusion v8.5.2 (4635224)
on OS X El Captian v10.11.4

GNU bash, version 4.3.11(1)-release

gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4 
(also for g++)
ADDA v.1.3b6

This article is related to ADDA (light scattering simulator based on the discrete dipole approximation).

Related: http://qiita.com/7of9/items/01d974c607dc70bfd68c

The SaveIterChpoint() is started as follows:

iterative.c
static void ProgressReport(void)
...
{
    ...
	// check condition for checkpoint; checkpoint is saved at first time
	if (chp_type!=CHP_NONE && chp_time!=UNDEF && complete) {
		time(&wt);
		elapsed=difftime(wt,last_chp_wt);
		if (chp_time<elapsed) {
			SaveIterChpoint();
			time(&last_chp_wt);
			if (chp_type!=CHP_REGULAR) chp_exit=true;
		}
	}
    ...

The chp_time is set as follows:

param.c
PARSE_FUNC(chpoint)
{
	chp_time=ScanTime(argv[1]);
	if (chp_time<=0) {
		chp_time=UNDEF;
		if (chp_type==CHP_NONE) chp_type=CHP_ALWAYS;
	}
	else if (chp_type==CHP_NONE) chp_type=CHP_NORMAL;
}

The chpoint is defined as:

param.c
	{PAR(chpoint),"<time>","Specifies the time for checkpoints in format '#d#h#m#s'. All fields are optional, numbers "
		"are integers, 's' can be omitted, the format is not case sensitive.\n"
		"Examples: 12h30M, 1D10s, 3600",1,NULL},

I could use them as:

$ ./adda -chp_type normal -chpoint 1s

However, because the calculation takes only 0.3 seconds, the checkpoint was not created. I need to increase the size parameter of the calculation or increase the number of dipoles.

test run using chpoint

Related: http://qiita.com/7of9/items/9537252c79f5318d8f55

$ ./adda -grid 25 -chp_type normal -chpoint 1s > log
log
all data is saved in 'run018_sphere_g26_m1.5'
box dimensions: 26x26x26
lambda: 6.283185307   Dipoles/lambda: 15
Required relative residual norm: 1e-05
Total number of occupied dipoles: 9328
Memory usage for MatVec matrices: 5.3 MB
Calculating Green's function (Dmatrix)
Fourier transform of Dmatrix......
Initializing FFTW3
Total memory usage: 9.0 MB

here we go, calc Y

CoupleConstant:0.005259037197+1.843854148e-05i
x_0 = 0
RE_000 = 1.0000000000E+00
RE_001 = 9.9999576080E-01  + 
RE_002 = 9.6702179389E-01  + 
RE_003 = 9.5831484425E-01  + 
RE_004 = 8.7074351921E-01  + 
RE_005 = 8.4916072387E-01  + 
RE_006 = 7.4282306413E-01  + 
RE_007 = 7.3262106923E-01  + 
RE_008 = 6.5035228833E-01  + 
RE_009 = 6.5117783214E-01  - 
RE_010 = 6.0982893876E-01  + 
RE_011 = 6.0823892388E-01  + 
RE_012 = 6.0241885893E-01  + 
RE_013 = 5.9666909434E-01  + 
RE_014 = 5.8941129188E-01  + 
RE_015 = 5.7639110255E-01  + 
RE_016 = 5.7319829615E-01  + 
RE_017 = 5.6840168119E-01  + 
RE_018 = 5.6997623448E-01  - 
RE_019 = 5.7424475423E-01  - 
RE_020 = 5.7379895988E-01  -+
RE_021 = 5.7728328553E-01  - 
RE_022 = 5.6229360311E-01  + 
RE_023 = 5.5057173156E-01  + 
RE_024 = 5.2459311069E-01  + 
RE_025 = 4.9768116661E-01  + 
RE_026 = 4.7140145287E-01  + 
RE_027 = 4.4819382540E-01  + 
RE_028 = 4.2843841329E-01  + 
RE_029 = 4.1411171881E-01  + 
RE_030 = 4.0170471453E-01  + 
RE_031 = 3.9493687302E-01  + 
RE_032 = 3.8822095382E-01  + 
RE_033 = 3.8577540826E-01  + 
RE_034 = 3.8317197411E-01  + 
RE_035 = 3.8176790244E-01  + 
RE_036 = 3.8210811964E-01  - 
RE_037 = 3.8026702280E-01  + 
RE_038 = 3.8206834511E-01  - 
RE_039 = 3.7897419062E-01  + 
RE_040 = 3.8036053619E-01  - 
RE_041 = 3.7475621885E-01  + 
RE_042 = 3.7431151347E-01  + 
RE_043 = 3.6375549040E-01  + 
RE_044 = 3.6142688108E-01  + 
RE_045 = 3.4917939850E-01  + 
RE_046 = 3.4599066211E-01  + 
RE_047 = 3.4145929416E-01  + 
RE_048 = 3.3851426348E-01  + 
RE_049 = 3.3733980979E-01  + 
RE_050 = 3.3512074405E-01  + 
RE_051 = 3.3315194186E-01  + 
RE_052 = 3.3098144752E-01  + 
RE_053 = 3.2839613884E-01  + 
RE_054 = 3.2540677697E-01  + 
RE_055 = 3.2272283461E-01  + 
RE_056 = 3.1993934324E-01  + 
RE_057 = 3.1759752392E-01  + 
RE_058 = 3.1569013293E-01  + 
RE_059 = 3.1391979338E-01  + 
RE_060 = 3.1244712143E-01  + 
RE_061 = 3.1060965154E-01  + 
RE_062 = 3.0880072102E-01  + 
RE_063 = 3.0669579455E-01  + 
RE_064 = 3.0311303942E-01  + 
RE_065 = 3.0107858770E-01  + 
RE_066 = 2.9932322500E-01  + 
RE_067 = 2.9700039780E-01  + 
RE_068 = 2.9759622342E-01  - 
RE_069 = 2.9664898477E-01  + 
RE_070 = 2.9756365444E-01  - 
RE_071 = 2.9800501975E-01  - 
RE_072 = 2.9874181331E-01  - 
RE_073 = 2.9949798499E-01  - 
RE_074 = 2.9992909792E-01  - 
RE_075 = 3.0060777200E-01  - 
RE_076 = 3.0070770086E-01  - 
RE_077 = 3.0088458842E-01  - 
RE_078 = 3.0093868966E-01  - 
RE_079 = 3.0089677962E-01  -+
RE_080 = 3.0142861333E-01  - 
RE_081 = 3.0190185846E-01  - 
RE_082 = 3.0274418279E-01  - 
RE_083 = 3.0366630238E-01  - 
RE_084 = 3.0465627589E-01  - 
RE_085 = 3.0581386473E-01  - 
RE_086 = 3.0694109264E-01  - 
RE_087 = 3.0827569606E-01  - 
RE_088 = 3.0962343848E-01  - 
RE_089 = 3.1110011556E-01  - 
Checkpoint (iteration) saved
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?