Cosmomc: Segmentation fault by adding new parameters

Use of Cobaya. camb, CLASS, cosmomc, compilers, etc.
Post Reply
Akhilesh Nautiyal(akhi)
Posts: 72
Joined: June 13 2007
Affiliation: Malaviya National Institute of Technology Jaipur

Cosmomc: Segmentation fault by adding new parameters

Post by Akhilesh Nautiyal(akhi) » January 04 2012

Hi,

I am using cosmomc Oct11 version to constrain some parameters. I have successfully
complied and run the cosmomc with standard parameter set.

but when I tried to add two extra parameters, I complied cosmomc but while running, it ii getting stopped showing segmentation fault. Here is the output

1: Initializing WMAP likelihood, version v4
4: reading WMAP7 data
4: Initializing WMAP likelihood, version v4
1: forrtl: severe (174): SIGSEGV, segmentation fault occurred
1: Image PC Routine Line Source
1: libpthread.so.0 00002B8D5C0F7C00 Unknown Unknown Unknown
1: libpthread.so.0 00002B8D5C0F7AAD Unknown Unknown Unknown
1: libguide.so 00002B8D5BFC5878 Unknown Unknown Unknown
1: forrtl: severe (174): SIGSEGV, segmentation fault occurred
1: Image PC Routine Line Source
1: libpthread.so.0 00002B8D5C0F7C00 Unknown Unknown Unknown
1: cosmomc 000000000053922C Unknown Unknown Unknown
1: cosmomc 00000000004FCEFA Unknown Unknown Unknown
1: cosmomc 0000000000535E56 Unknown Unknown Unknown
1: cosmomc 000000000052BC1A Unknown Unknown Unknown
1: cosmomc 00000000005380EA Unknown Unknown Unknown
1: cosmomc 000000000048BA74 Unknown Unknown Unknown
1: cosmomc 000000000049F4E4 Unknown Unknown Unknown
1: cosmomc 000000000049F16A Unknown Unknown Unknown
1: cosmomc 00000000004AACC0 Unknown Unknown Unknown
1: cosmomc 00000000004B2446 Unknown Unknown Unknown
1: cosmomc 000000000040A2A2 Unknown Unknown Unknown
1: libc.so.6 00002B8D5C8AB184 Unknown Unknown Unknown
1: cosmomc 000000000040A1E9 Unknown Unknown Unknown
rank 1 in job 1 c5pc3g_33121 caused collective abort of all ranks
exit status of rank 1: killed by signal 9


To locate the error I tried to compile cosmomc with the option -g -check all -traceback in the Makefile in source directory. Now I am getting the following output.

7: 8 DoUpdates
6: Chain 7 MPI communicating
7: Chain 8 MPI communicating
5: Chain 6 MPI communicating
4: Chain 5 MPI communicating
2: Chain 3 MPI communicating
3: Chain 4 MPI communicating
1: Chain 2 MPI communicating
0: Chain 1 MPI communicating
0: Current convergence R-1 = 39.58217 chain steps = 1235
0: updating proposal density
7: 7 rat: 8.4817640E-02 in 1179 (M) best: 3738.817
6: forrtl: warning (402): fort: (1): In call to I/O Write routine, an array temporary was created for argument #1
6:
3: 3 rat: 0.1197127 in 1253 (M) best: 3737.585
1: forrtl: warning (402): fort: (1): In call to I/O Write routine, an array temporary was created for argument #1
1:
7: forrtl: warning (402): fort: (1): In call to I/O Write routine, an array temporary was created for argument #1
7:
2: 2 rat: 0.1271186 in 1180 (M) best: 3737.912
0: 0 rat: 0.1184834 in 1266 (M) best: 3737.923
5: forrtl: warning (402): fort: (1): In call to I/O Write routine, an array temporary was created for argument #1
5:
1: 1 rat: 0.1138088 in 1318 (M) best: 3737.499
4: 4 rat: 0.1287554 in 1165 (M) best: 3737.751
2: forrtl: warning (402): fort: (1): In call to I/O Write routine, an array temporary was created for argument #1
2:
3: forrtl: warning (402): fort: (1): In call to I/O Write routine, an array temporary was created for argument #1
3:
4: forrtl: severe (408): fort: (3): Subscript #1 of the array XREC has value -2147483647 which is less than the lower bound of 1
4:
4: Image PC Routine Line Source
4: cosmomc 000000000082E3F6 Unknown Unknown Unknown
4: cosmomc 000000000082D388 Unknown Unknown Unknown
4: cosmomc 00000000007E0A52 Unknown Unknown Unknown
4: cosmomc 000000000079069F Unknown Unknown Unknown
4: cosmomc 000000000078F83C Unknown Unknown Unknown
4: cosmomc 00000000006166FB recombination_mp_ 443 recfast.f90
4: cosmomc 0000000000581816 thermodata_mp_ini 2193 modules.f90
4: cosmomc 000000000060D02D cambmain_mp_initv 623 cmbmain.f90
4: cosmomc 00000000005D87A6 cambmain_mp_cmbma 159 cmbmain.f90
4: cosmomc 0000000000611E6A camb_mp_camb_gett 41 camb.f90
4: cosmomc 00000000004D9882 cmb_cls_mp_getcls 107 CMB_Cls_simple.f90
4: cosmomc 00000000004FB756 calclike_mp_getlo 120 calclike.f90
4: cosmomc 00000000004FB304 calclike_mp_getlo 86 calclike.f90
4: cosmomc 000000000050A2FD montecarlo_mp_mcm 541 MCMC.f90
4: cosmomc 0000000000514C27 MAIN__ 370 driver.F90
4: cosmomc 000000000040A2A2 Unknown Unknown Unknown
4: libc.so.6 00002B2244806184 Unknown Unknown Unknown
4: cosmomc 000000000040A1E9 Unknown Unknown Unknown
rank 4 in job 1 c5pc3b_33489 caused collective abort of all ranks
exit status of rank 4: killed by signal 9

I am unable to understand whts happening.

Looking forward for your kind help.

Regards,
Akhilesh

Sheng Li
Posts: 57
Joined: May 26 2009
Affiliation: University of Sussex
Contact:

Re: Cosmomc: Segmentation fault by adding new parameters

Post by Sheng Li » January 12 2012

Akhilesh Nautiyal(akhi) wrote:Hi,

I am using cosmomc Oct11 version to constrain some parameters. I have successfully
complied and run the cosmomc with standard parameter set.
To locate the error I tried to compile cosmomc with the option -g -check all -traceback in the Makefile in source directory. Now I am getting the following output.

6: forrtl: warning (402): fort: (1): In call to I/O Write routine, an array temporary was created for argument #1

4: forrtl: severe (408): fort: (3): Subscript #1 of the array XREC has value -2147483647 which is less than the lower bound of 1

4: cosmomc 00000000006166FB recombination_mp_ 443 recfast.f90
4: cosmomc 0000000000581816 thermodata_mp_ini 2193 modules.f90
4: cosmomc 000000000060D02D cambmain_mp_initv 623 cmbmain.f90
4: cosmomc 00000000005D87A6 cambmain_mp_cmbma 159 cmbmain.f90
4: cosmomc 0000000000611E6A camb_mp_camb_gett 41 camb.f90
4: cosmomc 00000000004D9882 cmb_cls_mp_getcls 107 CMB_Cls_simple.f90
4: cosmomc 00000000004FB756 calclike_mp_getlo 120 calclike.f90
4: cosmomc 00000000004FB304 calclike_mp_getlo 86 calclike.f90
4: cosmomc 000000000050A2FD montecarlo_mp_mcm 541 MCMC.f90
4: cosmomc 0000000000514C27 MAIN__ 370 driver.F90
4: cosmomc 000000000040A2A2 Unknown Unknown Unknown
4: libc.so.6 00002B2244806184 Unknown Unknown Unknown
4: cosmomc 000000000040A1E9 Unknown Unknown Unknown
rank 4 in job 1 c5pc3b_33489 caused collective abort of all ranks
exit status of rank 4: killed by signal 9

I am unable to understand whts happening.

Looking forward for your kind help.

Regards,
Akhilesh

Obviously there are two flaws:

1): your additional codes are trying to read values but it comes from an array or sth else, then it did not find a intermediate (media) so that created a temporary value;

solution: create another variable say 'tmp', which is of allocatable attribution, then you need deallocate this variable 'tmp';

important 2): check your variable, file and line:
a variable or a phrase in the line: 443 in the file recfast.f90
probable the array XREC
which is said it 'has value −2147483647 which is less than the lower bound of 1 '
So your created array has badly defined or linked, then check its lower bound as well as the loop where XERC is located.


suggestion:
a): when you add variables or parameters, you make sure they are attributed well and have a proper/correct I/O flow;
b): Do add 'implicit none' at the very beginning in each subprogram or the main program as well;
c): Do NOT define a variable which is NEVER used in the program;

so far I just can reminder those above. You need to check the file recfast.f90 at first! Those failures came from this file. Or probably you need check also the file in progress or subprogram in 'thermodata_mp_ini 2193 modules.f90'.

Good luck.

Akhilesh Nautiyal(akhi)
Posts: 72
Joined: June 13 2007
Affiliation: Malaviya National Institute of Technology Jaipur

Cosmomc: Segmentation fault by adding new parameters

Post by Akhilesh Nautiyal(akhi) » February 05 2012

Dear Sheng,

Thanks a lot for your kind reply.
I checked in recfast.f90. I learned that the problem is coming due to the following reason.

My extra parameter varies between 0 to 1. When its value becomes 0 the error occurs. I checked it by running camb alone.

To fix it, I tried to avoid zero by varying the parameter between 0.1 to 1.0 with central value at
0.9 and start width 0.01. But still I am getting the same error in cosmomc. It is running up to some point and then showing the same error.

I even tried to use that parameter logarithmically to avoid zero. But again same error.
Hence I am unable to understand whts going wrong.


Regards,
Akhilesh

Sheng Li
Posts: 57
Joined: May 26 2009
Affiliation: University of Sussex
Contact:

Re: Cosmomc: Segmentation fault by adding new parameters

Post by Sheng Li » February 05 2012

Akhilesh Nautiyal(akhi) wrote:Dear Sheng,

Thanks a lot for your kind reply.
I checked in recfast.f90. I learned that the problem is coming due to the following reason.

My extra parameter varies between 0 to 1. When its value becomes 0 the error occurs. I checked it by running camb alone.

To fix it, I tried to avoid zero by varying the parameter between 0.1 to 1.0 with central value at
0.9 and start width 0.01. But still I am getting the same error in cosmomc. It is running up to some point and then showing the same error.

I even tried to use that parameter logarithmically to avoid zero. But again same error.
Hence I am unable to understand whts going wrong.


Regards,
Akhilesh

So if you have still the error for upper bound or lower bound for array (your data storage), you obviously were in wrong direction to correct your params.

so check your array XREC in recfast.f90 or somewhere.

That is the key I think.

Sheng

Post Reply