sinanshi / LPJmL_Calibration

0 stars 1 forks source link

For trees code unstable #15

Open mfader opened 9 years ago

mfader commented 9 years ago

Running for trees the code causes segmentation faut in the plotting part in console R, but runs through in R studio.

source("/home/mfader/_R/LPJmL_Calibration/src/init.r") Loading required package: spam Spam version 0.29-3 (2013-04-23) is loaded. Type 'help( Spam)' or 'demo( spam)' for a short introduction and overview of this package. Help for individual functions is also obtained by adding the suffix '.spam' to the function name, e.g. 'help( chol.spam)'.

Attaching package: ‘spam’

The following object(s) are masked from ‘package:base’:

backsolve, forwardsolve

Loading required package: maps country.name country global.area local.area proportion 1 Albania 1 16 16 1.000000000 2 Algeria 2 869 835 0.960874568 3 Armenia 6 13 11 0.846153846 4 Austria 7 39 39 1.000000000 5 Azerbaijan 8 45 30 0.666666667 6 Belgium 11 19 17 0.894736842 7 Bosnia_and_Herzegovina 16 24 24 1.000000000 8 Bulgaria 19 49 49 1.000000000 9 Burundi 21 10 4 0.400000000 10 Central_African_Republic 27 204 1 0.004901961 11 Chad 28 429 85 0.198135198 12 Croatia 35 38 38 1.000000000 13 Cyprus 37 11 11 1.000000000 14 Czech_Republic 38 41 10 0.243902439 15 Egypt 43 385 385 1.000000000 16 Eritrea 46 51 1 0.019607843 17 Ethiopia 48 369 122 0.330623306 18 France 54 290 290 1.000000000 19 Georgia 60 31 18 0.580645161 20 Germany 61 200 85 0.425000000 21 Greece 63 116 116 1.000000000 22 Hungary 72 44 44 1.000000000 23 Iran 75 643 96 0.149300156 24 Iraq 76 171 133 0.777777778 25 Israel 78 10 10 1.000000000 26 Italy 79 214 214 1.000000000 27 Jordan 83 35 19 0.542857143 28 Kenya 85 194 14 0.072164948 29 Lebanon 91 6 6 1.000000000 30 Libya 94 609 609 1.000000000 31 Luxembourg 96 1 1 1.000000000 32 Macedonia 97 11 11 1.000000000 33 Mali 102 427 67 0.156908665 34 Mauritania 104 367 130 0.354223433 35 Moldova 107 16 6 0.375000000 36 Montenegro 109 7 7 1.000000000 37 Morocco 110 175 175 1.000000000 38 Netherlands 115 20 9 0.450000000 39 Niger 119 404 87 0.215346535 40 Portugal 133 61 51 0.836065574 41 Romania 137 116 112 0.965517241 42 Rwanda 138 10 8 0.800000000 43 Saudi_Arabia 140 715 48 0.067132867 44 Serbia 142 37 37 1.000000000 45 Slovakia 144 26 24 0.923076923 46 Slovenia 145 9 9 1.000000000 47 Spain 151 265 264 0.996226415 48 Sudan 154 839 730 0.870083433 49 Switzerland 159 18 18 1.000000000 50 Syria 160 76 76 1.000000000 51 Tanzania_United_Republic_of 163 316 38 0.120253165 52 Tunisia 168 74 74 1.000000000 53 Turkey 169 369 369 1.000000000 54 Uganda 172 82 79 0.963414634 55 Ukraine 173 320 13 0.040625000 56 West_Bank 183 2 2 1.000000000 57 Western_Sahara 184 100 10 0.100000000 58 Zaire_DR_Congo 187 767 7 0.009126467 countries selected: 1 2 7 16 19 35 37 43 54 63 72 78 79 91 94 96 97 109 110 137 142 144 145 151 159 160 168 169 172 183 countries excluded: 6 8 11 21 27 28 38 46 48 60 61 75 76 83 85 102 104 107 115 119 133 138 140 154 163 173 184 187 FAO TABLE: Years:1961-2012 reading lpjml outputs... computing best k_est rgeos version: 0.3-8, (SVN revision 460) GEOS runtime version: 3.4.2-CAPI-1.8.2 r3921 Polygon checking: TRUE

Loading required package: sp rgdal: version: 0.9-2, (SVN revision 526) Geospatial Data Abstraction Library extensions to R successfully loaded Loaded GDAL runtime: GDAL 1.11.2, released 2015/02/10 Path to GDAL shared files: /usr/local/share/gdal Loaded PROJ.4 runtime: Rel. 4.9.1, 04 March 2015, [PJ_VERSION: 491] Path to PROJ.4 shared files: (autodetected) OGR data source with driver: ESRI Shapefile Source: "/home/mfader/_R/LPJmL_Calibration/src/country_polygon/", layer: "ne_10m_admin_0_countries" with 254 features It has 63 fields reading lpjml outputs...

* caught segfault * address 0x10637a6b8, cause 'memory not mapped'

Traceback: 1: plot.new() 2: plot.default(fao.yields[b, ], best_yields[b, ], main = "", xlab = "", ylab = "", col = "white", pch = 3, lwd = 0.8, yaxt = "n") 3: plot(fao.yields[b, ], best_yields[b, ], main = "", xlab = "", ylab = "", col = "white", pch = 3, lwd = 0.8, yaxt = "n") 4: plot(fao.yields[b, ], best_yields[b, ], main = "", xlab = "", ylab = "", col = "white", pch = 3, lwd = 0.8, yaxt = "n") 5: eval(expr, envir, enclos) 6: eval(ei, envir) 7: withVisible(eval(ei, envir)) 8: source(paste(src.path, "plot_tree.r", sep = "")) 9: eval(expr, envir, enclos) 10: eval(ei, envir) 11: withVisible(eval(ei, envir)) 12: source(paste(wkdir, "src/tree_calibr.r", sep = "")) 13: eval(expr, envir, enclos) 14: eval(ei, envir) 15: withVisible(eval(ei, envir)) 16: source("/home/mfader/_R/LPJmL_Calibration/src/init.r")

Possible actions: 1: abort (with core dump, if enabled) 2: normal R exit 3: exit R without saving workspace 4: exit R saving workspace Selection: 1 aborting ... Segmentation fault

sinanshi commented 9 years ago

I will have a look, later tomorrow. Have you ever changed your code? it maybe worthwhile to push it so that I can modify everything based on yours.

mfader commented 9 years ago

On 05/13/2015 05:51 PM, Sinan Shi wrote:

I will have a look, later tomorrow. Have you ever changed your code? it maybe worthwhile to push it so that I can modify everything based on yours.

— Reply to this email directly or view it on GitHub https://github.com/sinanshi/LPJmL_Calibration/issues/15#issuecomment-101722459.

yes, I have modified.

I am sorry, I made a mistake by not taking notes the last time you guide me for pushing stuff. Would you make me a step-by-step command list? I remember that was not that long, something like 6 commands or so...

sinanshi commented 9 years ago

once you have changed anything, go to the repository, type in the linux terminal, 1) git status - it will tell you what has been modified or so. 2) let's say you have modified file1 file2 and file3. You think file1 and file2 modification should be tracked, and file3 shouldn't then, you type,

git add file1 file2
git commit -m 'here is the comments, i.e. explain in human language what have you changed'

So far, we have already made the revision control. Then you want to upload your modification and share with me, then you should do,

git push

Here it may not work, but you should read the error message and follow the instruction provided by it.

So what if I have modified the file and push them before you? Then that will be quite complicated, at this stage what we should do is to avoid such a thing happen. Since normally we well open a branch for everybody and merge them afterwards.

sinanshi commented 9 years ago

Please just try these three command. If it doesn't work, just let it go.

mfader commented 9 years ago

yes, ok, but let me finish the modifications, I am in the middle of that

sinanshi commented 9 years ago

sure, no problem :+1:

sinanshi commented 9 years ago

wait a minute, this happend on trees? I thought it was just for the crops.

mfader commented 9 years ago

nop, on trees! As the title of the iddue indicates :-)

sinanshi commented 9 years ago

But it works well all the time from my side.

sinanshi commented 9 years ago

Trees should work in the last version in the repository, while some problems occured in ploting part while dealing with crops.

  1. So did you change anything?
  2. Make sure the data is correct.
sinanshi commented 9 years ago

sorry, dealing with crops

mfader commented 9 years ago

So in my machine the code was unstable from the beginning, but not constantly. I thought it was due to the errors in crops runs, filling the memory and messing around also with the posterior tree runs. But as it turns out, no, after restarting the computer also SOME TIMES the code while running with trees (and only in console) got segmentation fault.

I did change things, but not anything that could have affected that. In any case, I just pushed everything, but I kept a version from the old repository in my machine.

Now's status is: both version (crops, trees) run through in R studio, both get always a segmentation fault in console R with the same traceback shown above.

sinanshi commented 9 years ago

OKi. But were the result correct?

mfader commented 9 years ago

How can I know? They do not look crazy.

sinanshi commented 9 years ago

I will have a look at that. sorry for producing shitty codes.

mfader commented 9 years ago

no sorry here, you are being very nice.

mfader commented 9 years ago

probably Nela's R library has to be updated...