From lennart at karssen.org Mon Feb 3 17:01:44 2014 From: lennart at karssen.org (L.C. Karssen) Date: Mon, 03 Feb 2014 17:01:44 +0100 Subject: [GenABEL-dev] Submitted updated version of MetABEL to CRAN Message-ID: <52EFBD68.2000809@karssen.org> Dear list, Today I fixed a small 'bug' in MetABEL (values show on the vertical axis of the forest plot [1]). While at it I also converted the documentation to roxygen format and made some other small improvements to the layout of the forest plots. I've just uploaded these changes to CRAN. Best, Lennart. -- *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* L.C. Karssen Utrecht The Netherlands lennart at karssen.org http://blog.karssen.org GPG key ID: A88F554A -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 230 bytes Desc: OpenPGP digital signature URL: From yurii.aulchenko at gmail.com Mon Feb 3 18:46:21 2014 From: yurii.aulchenko at gmail.com (Yury Aulchenko) Date: Mon, 3 Feb 2014 18:46:21 +0100 Subject: [GenABEL-dev] Submitted updated version of MetABEL to CRAN In-Reply-To: <52EFBD68.2000809@karssen.org> References: <52EFBD68.2000809@karssen.org> Message-ID: <43BF8E02-33B1-4E2E-85EC-7D73A2CC9808@gmail.com> note that they do not like too frequent updates (or at least that was the case some time before)... Y On Feb 3, 2014, at 17:01, L.C. Karssen wrote: > Dear list, > > Today I fixed a small 'bug' in MetABEL (values show on the vertical axis > of the forest plot [1]). While at it I also converted the documentation > to roxygen format and made some other small improvements to the layout > of the forest plots. > > I've just uploaded these changes to CRAN. > > > Best, > > Lennart. > -- > *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* > L.C. Karssen > Utrecht > The Netherlands > > lennart at karssen.org > http://blog.karssen.org > GPG key ID: A88F554A > -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > _______________________________________________ > genabel-devel mailing list > genabel-devel at lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-devel From lennart at karssen.org Mon Feb 3 20:55:19 2014 From: lennart at karssen.org (L.C. Karssen) Date: Mon, 03 Feb 2014 20:55:19 +0100 Subject: [GenABEL-dev] Submitted updated version of MetABEL to CRAN In-Reply-To: <43BF8E02-33B1-4E2E-85EC-7D73A2CC9808@gmail.com> References: <52EFBD68.2000809@karssen.org> <43BF8E02-33B1-4E2E-85EC-7D73A2CC9808@gmail.com> Message-ID: <52EFF427.60704@karssen.org> Hi Yurii, Thanks. I'll keep that in mind. I decided to submit anyway, since I don't expect any other changes any time soon. Anyway, Kurt mailed me that the package has been accepted. Best, Lennart. On 03-02-14 18:46, Yury Aulchenko wrote: > note that they do not like too frequent updates (or at least that was the case some time before)... > > Y > > On Feb 3, 2014, at 17:01, L.C. Karssen wrote: > >> Dear list, >> >> Today I fixed a small 'bug' in MetABEL (values show on the vertical axis >> of the forest plot [1]). While at it I also converted the documentation >> to roxygen format and made some other small improvements to the layout >> of the forest plots. >> >> I've just uploaded these changes to CRAN. >> >> >> Best, >> >> Lennart. >> -- >> *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* >> L.C. Karssen >> Utrecht >> The Netherlands >> >> lennart at karssen.org >> http://blog.karssen.org >> GPG key ID: A88F554A >> -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- >> >> _______________________________________________ >> genabel-devel mailing list >> genabel-devel at lists.r-forge.r-project.org >> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-devel > -- *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* L.C. Karssen Utrecht The Netherlands lennart at karssen.org http://blog.karssen.org GPG key ID: A88F554A -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 230 bytes Desc: OpenPGP digital signature URL: From yurii.aulchenko at gmail.com Mon Feb 3 20:56:31 2014 From: yurii.aulchenko at gmail.com (Yurii Aulchenko) Date: Mon, 3 Feb 2014 20:56:31 +0100 Subject: [GenABEL-dev] Submitted updated version of MetABEL to CRAN In-Reply-To: <52EFF427.60704@karssen.org> References: <52EFBD68.2000809@karssen.org> <43BF8E02-33B1-4E2E-85EC-7D73A2CC9808@gmail.com> <52EFF427.60704@karssen.org> Message-ID: Good news! - thank you! Yurii PS we actually have a nasty bug in MetA :( On Mon, Feb 3, 2014 at 8:55 PM, L.C. Karssen wrote: > Hi Yurii, > > Thanks. I'll keep that in mind. I decided to submit anyway, since I > don't expect any other changes any time soon. > > Anyway, Kurt mailed me that the package has been accepted. > > > Best, > > Lennart. > > On 03-02-14 18:46, Yury Aulchenko wrote: > > note that they do not like too frequent updates (or at least that was > the case some time before)... > > > > Y > > > > On Feb 3, 2014, at 17:01, L.C. Karssen wrote: > > > >> Dear list, > >> > >> Today I fixed a small 'bug' in MetABEL (values show on the vertical axis > >> of the forest plot [1]). While at it I also converted the documentation > >> to roxygen format and made some other small improvements to the layout > >> of the forest plots. > >> > >> I've just uploaded these changes to CRAN. > >> > >> > >> Best, > >> > >> Lennart. > >> -- > >> *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* > >> L.C. Karssen > >> Utrecht > >> The Netherlands > >> > >> lennart at karssen.org > >> http://blog.karssen.org > >> GPG key ID: A88F554A > >> -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > >> > >> _______________________________________________ > >> genabel-devel mailing list > >> genabel-devel at lists.r-forge.r-project.org > >> > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-devel > > > > -- > *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* > L.C. Karssen > Utrecht > The Netherlands > > lennart at karssen.org > http://blog.karssen.org > GPG key ID: A88F554A > -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > -- ----------------------------------------------------- Yurii S. Aulchenko [ LinkedIn ] [ Twitter] [ Blog ] -------------- next part -------------- An HTML attachment was scrubbed... URL: From lennart at karssen.org Mon Feb 3 21:00:11 2014 From: lennart at karssen.org (L.C. Karssen) Date: Mon, 03 Feb 2014 21:00:11 +0100 Subject: [GenABEL-dev] Submitted updated version of MetABEL to CRAN In-Reply-To: References: <52EFBD68.2000809@karssen.org> <43BF8E02-33B1-4E2E-85EC-7D73A2CC9808@gmail.com> <52EFF427.60704@karssen.org> Message-ID: <52EFF54B.7040205@karssen.org> Hmm, I didn't see a bug report. Or didn't I look carefully enough? Lennart. On 03-02-14 20:56, Yurii Aulchenko wrote: > Good news! - thank you! > > Yurii > > PS we actually have a nasty bug in MetA :( > > > On Mon, Feb 3, 2014 at 8:55 PM, L.C. Karssen > wrote: > > Hi Yurii, > > Thanks. I'll keep that in mind. I decided to submit anyway, since I > don't expect any other changes any time soon. > > Anyway, Kurt mailed me that the package has been accepted. > > > Best, > > Lennart. > > On 03-02-14 18:46, Yury Aulchenko wrote: > > note that they do not like too frequent updates (or at least that > was the case some time before)... > > > > Y > > > > On Feb 3, 2014, at 17:01, L.C. Karssen > wrote: > > > >> Dear list, > >> > >> Today I fixed a small 'bug' in MetABEL (values show on the > vertical axis > >> of the forest plot [1]). While at it I also converted the > documentation > >> to roxygen format and made some other small improvements to the > layout > >> of the forest plots. > >> > >> I've just uploaded these changes to CRAN. > >> > >> > >> Best, > >> > >> Lennart. > >> -- > >> *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* > >> L.C. Karssen > >> Utrecht > >> The Netherlands > >> > >> lennart at karssen.org > >> http://blog.karssen.org > >> GPG key ID: A88F554A > >> -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > >> > >> _______________________________________________ > >> genabel-devel mailing list > >> genabel-devel at lists.r-forge.r-project.org > > >> > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-devel > > > > -- > *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* > L.C. Karssen > Utrecht > The Netherlands > > lennart at karssen.org > http://blog.karssen.org > GPG key ID: A88F554A > -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > > > > -- > ----------------------------------------------------- > Yurii S. Aulchenko > > [ LinkedIn ] [ Twitter > ] [ Blog > ] -- *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* L.C. Karssen Utrecht The Netherlands lennart at karssen.org http://blog.karssen.org GPG key ID: A88F554A -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 230 bytes Desc: OpenPGP digital signature URL: From yurii.aulchenko at gmail.com Mon Feb 3 21:04:04 2014 From: yurii.aulchenko at gmail.com (Yurii Aulchenko) Date: Mon, 3 Feb 2014 21:04:04 +0100 Subject: [GenABEL-dev] Submitted updated version of MetABEL to CRAN In-Reply-To: <52EFF54B.7040205@karssen.org> References: <52EFBD68.2000809@karssen.org> <43BF8E02-33B1-4E2E-85EC-7D73A2CC9808@gmail.com> <52EFF427.60704@karssen.org> <52EFF54B.7040205@karssen.org> Message-ID: I get this as top entry in bug tracker :) https://r-forge.r-project.org/tracker/index.php?func=detail&aid=1187&group_id=505&atid=2058 it looks small but is a bit nasty - I remember I was looking at it, thinking it is very easy one, and giving up soon (like 30 minutes) after realizing it is not *that* simple. On Mon, Feb 3, 2014 at 9:00 PM, L.C. Karssen wrote: > Hmm, I didn't see a bug report. Or didn't I look carefully enough? > > > Lennart. > > On 03-02-14 20:56, Yurii Aulchenko wrote: > > Good news! - thank you! > > > > Yurii > > > > PS we actually have a nasty bug in MetA :( > > > > > > On Mon, Feb 3, 2014 at 8:55 PM, L.C. Karssen > > wrote: > > > > Hi Yurii, > > > > Thanks. I'll keep that in mind. I decided to submit anyway, since I > > don't expect any other changes any time soon. > > > > Anyway, Kurt mailed me that the package has been accepted. > > > > > > Best, > > > > Lennart. > > > > On 03-02-14 18:46, Yury Aulchenko wrote: > > > note that they do not like too frequent updates (or at least that > > was the case some time before)... > > > > > > Y > > > > > > On Feb 3, 2014, at 17:01, L.C. Karssen > > wrote: > > > > > >> Dear list, > > >> > > >> Today I fixed a small 'bug' in MetABEL (values show on the > > vertical axis > > >> of the forest plot [1]). While at it I also converted the > > documentation > > >> to roxygen format and made some other small improvements to the > > layout > > >> of the forest plots. > > >> > > >> I've just uploaded these changes to CRAN. > > >> > > >> > > >> Best, > > >> > > >> Lennart. > > >> -- > > >> *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* > > >> L.C. Karssen > > >> Utrecht > > >> The Netherlands > > >> > > >> lennart at karssen.org > > >> http://blog.karssen.org > > >> GPG key ID: A88F554A > > >> -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > >> > > >> _______________________________________________ > > >> genabel-devel mailing list > > >> genabel-devel at lists.r-forge.r-project.org > > > > >> > > > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-devel > > > > > > > -- > > *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* > > L.C. Karssen > > Utrecht > > The Netherlands > > > > lennart at karssen.org > > http://blog.karssen.org > > GPG key ID: A88F554A > > -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > > > > > > > > > -- > > ----------------------------------------------------- > > Yurii S. Aulchenko > > > > [ LinkedIn ] [ Twitter > > ] [ Blog > > ] > > -- > *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* > L.C. Karssen > Utrecht > The Netherlands > > lennart at karssen.org > http://blog.karssen.org > GPG key ID: A88F554A > -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > -- ----------------------------------------------------- Yurii S. Aulchenko [ LinkedIn ] [ Twitter] [ Blog ] -------------- next part -------------- An HTML attachment was scrubbed... URL: From lennart at karssen.org Mon Feb 3 22:32:35 2014 From: lennart at karssen.org (L.C. Karssen) Date: Mon, 03 Feb 2014 22:32:35 +0100 Subject: [GenABEL-dev] Submitted updated version of MetABEL to CRAN In-Reply-To: References: <52EFBD68.2000809@karssen.org> <43BF8E02-33B1-4E2E-85EC-7D73A2CC9808@gmail.com> <52EFF427.60704@karssen.org> <52EFF54B.7040205@karssen.org> Message-ID: <52F00AF3.3060202@karssen.org> Oops, missed it somehow. Lennart. On 03-02-14 21:04, Yurii Aulchenko wrote: > I get this as top entry in bug tracker :) > > https://r-forge.r-project.org/tracker/index.php?func=detail&aid=1187&group_id=505&atid=2058 > > it looks small but is a bit nasty - I remember I was looking at it, > thinking it is very easy one, and giving up soon (like 30 minutes) after > realizing it is not *that* simple. > > > On Mon, Feb 3, 2014 at 9:00 PM, L.C. Karssen > wrote: > > Hmm, I didn't see a bug report. Or didn't I look carefully enough? > > > Lennart. > > On 03-02-14 20:56, Yurii Aulchenko wrote: > > Good news! - thank you! > > > > Yurii > > > > PS we actually have a nasty bug in MetA :( > > > > > > On Mon, Feb 3, 2014 at 8:55 PM, L.C. Karssen > > >> wrote: > > > > Hi Yurii, > > > > Thanks. I'll keep that in mind. I decided to submit anyway, > since I > > don't expect any other changes any time soon. > > > > Anyway, Kurt mailed me that the package has been accepted. > > > > > > Best, > > > > Lennart. > > > > On 03-02-14 18:46, Yury Aulchenko wrote: > > > note that they do not like too frequent updates (or at least > that > > was the case some time before)... > > > > > > Y > > > > > > On Feb 3, 2014, at 17:01, L.C. Karssen > > >> wrote: > > > > > >> Dear list, > > >> > > >> Today I fixed a small 'bug' in MetABEL (values show on the > > vertical axis > > >> of the forest plot [1]). While at it I also converted the > > documentation > > >> to roxygen format and made some other small improvements to the > > layout > > >> of the forest plots. > > >> > > >> I've just uploaded these changes to CRAN. > > >> > > >> > > >> Best, > > >> > > >> Lennart. > > >> -- > > >> *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* > > >> L.C. Karssen > > >> Utrecht > > >> The Netherlands > > >> > > >> lennart at karssen.org > > > > >> http://blog.karssen.org > > >> GPG key ID: A88F554A > > >> -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > >> > > >> _______________________________________________ > > >> genabel-devel mailing list > > >> genabel-devel at lists.r-forge.r-project.org > > > > > > >> > > > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-devel > > > > > > > -- > > *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* > > L.C. Karssen > > Utrecht > > The Netherlands > > > > lennart at karssen.org > > > > http://blog.karssen.org > > GPG key ID: A88F554A > > -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > > > > > > > > > -- > > ----------------------------------------------------- > > Yurii S. Aulchenko > > > > [ LinkedIn ] [ Twitter > > ] [ Blog > > ] > > -- > *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* > L.C. Karssen > Utrecht > The Netherlands > > lennart at karssen.org > http://blog.karssen.org > GPG key ID: A88F554A > -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > > > > -- > ----------------------------------------------------- > Yurii S. Aulchenko > > [ LinkedIn ] [ Twitter > ] [ Blog > ] -- *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* L.C. Karssen Utrecht The Netherlands lennart at karssen.org http://blog.karssen.org GPG key ID: A88F554A -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 230 bytes Desc: OpenPGP digital signature URL: From lennart at karssen.org Wed Feb 5 22:13:20 2014 From: lennart at karssen.org (L.C. Karssen) Date: Wed, 05 Feb 2014 22:13:20 +0100 Subject: [GenABEL-dev] [Genabel-commits] r1594 - branches/ProbABEL-0.50/src In-Reply-To: <20140204210043.DA5C9186CAD@r-forge.r-project.org> References: <20140204210043.DA5C9186CAD@r-forge.r-project.org> Message-ID: <52F2A970.4030101@karssen.org> Hi Maarten, Interesting commit! I didn't know about std::copy(). To help me understand: is this a bug in the current version ProbABEL as well, or one that was introduced by one of your previous commits? Thanks for the good work, Lennart. On 04-02-14 22:00, noreply at r-forge.r-project.org wrote: > Author: maartenk > Date: 2014-02-04 22:00:43 +0100 (Tue, 04 Feb 2014) > New Revision: 1594 > > Modified: > branches/ProbABEL-0.50/src/maskedmatrix.cpp > branches/ProbABEL-0.50/src/reg1.cpp > branches/ProbABEL-0.50/src/regdata.cpp > Log: > -fixed incorrect multiplication with mmscore: other object was returned then expected. > > > > Modified: branches/ProbABEL-0.50/src/maskedmatrix.cpp > =================================================================== > --- branches/ProbABEL-0.50/src/maskedmatrix.cpp 2014-02-04 11:27:35 UTC (rev 1593) > +++ branches/ProbABEL-0.50/src/maskedmatrix.cpp 2014-02-04 21:00:43 UTC (rev 1594) > @@ -67,7 +67,6 @@ > nmeasured++; > } > } > - > //Check update mask is the same as original matrix > if (nmeasured == length_of_mask) > { > > Modified: branches/ProbABEL-0.50/src/reg1.cpp > =================================================================== > --- branches/ProbABEL-0.50/src/reg1.cpp 2014-02-04 11:27:35 UTC (rev 1593) > +++ branches/ProbABEL-0.50/src/reg1.cpp 2014-02-04 21:00:43 UTC (rev 1594) > @@ -164,9 +164,11 @@ > // column with Prob(A1A1). Note the order is swapped cf the file! > int c2 = X.ncol - 1; > > - for (int i = 0; i < X.nrow; i++) > - for (int j = 0; j < (X.ncol - 2); j++) > + for (int i = 0; i < X.nrow; i++){ > + for (int j = 0; j < (X.ncol - 2); j++){ > nX[i * nX.ncol + j] = X[i * X.ncol + j]; > + } > + } > > for (int i = 0; i < nX.nrow; i++) > { > > Modified: branches/ProbABEL-0.50/src/regdata.cpp > =================================================================== > --- branches/ProbABEL-0.50/src/regdata.cpp 2014-02-04 11:27:35 UTC (rev 1593) > +++ branches/ProbABEL-0.50/src/regdata.cpp 2014-02-04 21:00:43 UTC (rev 1594) > @@ -14,7 +14,7 @@ > #include "fvlib/frversion.h" > #include "fvlib/Logger.h" > #include "fvlib/Transposer.h" > - > +#include // STL algoritms > #include "regdata.h" > > regdata::regdata() > @@ -203,7 +203,6 @@ > int dim2X = X.ncol; > (to.X).reinit(to.nids, dim2X); > (to.Y).reinit(to.nids, dim2Y); > - > int j = 0; > for (int i = 0; i < nids; i++) > { > @@ -223,13 +222,10 @@ > } > > // delete [] to.masked_data; > - to.masked_data = new unsigned short int[to.nids]; > - for (int i = 0; i < to.nids; i++) > - { > - to.masked_data[i] = 0; > - } > - // std::cout << "get_unmasked: " << to.nids << " " > - // << dim2X << " " << dim2Y << "\n"; > + const int arr_size = nids; > + to.masked_data = new unsigned short int[arr_size]; > + std::copy(masked_data, masked_data+arr_size,to.masked_data); > + > return (to); > } > > > _______________________________________________ > Genabel-commits mailing list > Genabel-commits at lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-commits > -- *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* L.C. Karssen Utrecht The Netherlands lennart at karssen.org http://blog.karssen.org GPG key ID: A88F554A -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 230 bytes Desc: OpenPGP digital signature URL: From lennart at karssen.org Wed Feb 5 22:16:46 2014 From: lennart at karssen.org (L.C. Karssen) Date: Wed, 05 Feb 2014 22:16:46 +0100 Subject: [GenABEL-dev] [Genabel-commits] r1596 - branches/ProbABEL-0.50 In-Reply-To: <20140205202601.BAB3E186B9D@r-forge.r-project.org> References: <20140205202601.BAB3E186B9D@r-forge.r-project.org> Message-ID: <52F2AA3E.6080200@karssen.org> Hi Maarten, I haven't yet compiled this branch, but will be interested to see what -Wextra gives in terms of warnings. One more question below: On 05-02-14 21:26, noreply at r-forge.r-project.org wrote: > Author: maartenk > Date: 2014-02-05 21:26:01 +0100 (Wed, 05 Feb 2014) > New Revision: 1596 > > Modified: > branches/ProbABEL-0.50/configure.ac > Log: > added CXXflags -DEIGENNO_DEBUG :removes checks for conformability (which gives a speedup in eigen) > added CXXflags -Wextra: adds adittional check (see http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html for more info) > > > > > > Modified: branches/ProbABEL-0.50/configure.ac > =================================================================== > --- branches/ProbABEL-0.50/configure.ac 2014-02-05 16:35:59 UTC (rev 1595) > +++ branches/ProbABEL-0.50/configure.ac 2014-02-05 20:26:01 UTC (rev 1596) > @@ -21,9 +21,10 @@ > AC_PROG_LN_S > if test -z "$CXXFLAGS"; then > # User did not set CXXFLAGS, so we can put in our own defaults > - CXXFLAGS="-g -O2" > + CXXFLAGS="-g -O2 -DEIGEN_NO_DEBUG -Wextra" > fi > -if test -z "$CPPFLAGS"; then > +if test -z "$ > +"; then > # User did not set CPPFLAGS, so we can put in our own defaults > CPPFLAGS="-Wall" > fi > Is this correct? It seems that the name of the CPPFLAGS variable was removed and ";then moved to a new line. Thanks, Lennart. > _______________________________________________ > Genabel-commits mailing list > Genabel-commits at lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-commits > -- *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* L.C. Karssen Utrecht The Netherlands lennart at karssen.org http://blog.karssen.org GPG key ID: A88F554A -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 230 bytes Desc: OpenPGP digital signature URL: From lennart at karssen.org Thu Feb 6 14:11:09 2014 From: lennart at karssen.org (L.C. Karssen) Date: Thu, 06 Feb 2014 14:11:09 +0100 Subject: [GenABEL-dev] Abstract for the EMGM 2014 conference In-Reply-To: <52EBE228.70503@karssen.org> References: <52EAA7D1.5080106@karssen.org> <52EBE228.70503@karssen.org> Message-ID: <52F389ED.4080909@karssen.org> Dear all, I have just received notification from the EMGM committee that my abstract has been selected for a poster presentation. Thank you for all you contributions! Lennart. On 31-01-14 18:49, L.C. Karssen wrote: > Dear GenABEL devs, > > Thank you for the various comments you sent. I have incorporated them, > but also hd to shorten the abstract to 250 words. Please find below the > abstract I submitted. > > > > Best regards, > > Lennart. > > > Title: New software and developments in the GenABEL project > > Authors: L.C. Karssen, on behalf of the GenABEL team > > Abstract: > In the last year the GenABEL project has seen a considerable number > of improvements. These improvements do not only consist of updates > to the packages in the GenABEL suite, but we also improved the > development process and the way packages are made available to > our users. > > We will demonstrate newly implemented features in the GenABEL > suite packages, as well as introduce OmicABEL, a package for rapid > mixed-model based genome-wide association analysis of multiple > traits (for example, metabolomics, glycomics, etc.). > > Recently we started using the Jenkins Continuous Integration server > to help us release software of higher quality. Jenkins is a > framework that automatically runs several tests (e.g. static code > analysis, checks for memory leaks) after a new commit to our version > control system. This allows us to detect problems in the code at an > early stage, before they bug the user. > > After GenABEL, ProbABEL is the second package that is available as a > Debian package, allowing users of upcoming Debian releases to > install and upgrade ProbABEL with a single command. This also > benefits users of Linux distributions derived from Debian, like > Ubuntu. > > In the coming year more packages are expected to be added the > GenABEL suite as well as continued efforts to improve the existing > ones. Moreover, we plan to increase both the ease of installation as > well as the visibility of the GenABEL suite by adding more packages > into both the Debian and Red Hat Linux repositories (as > well as derivatives like CentOS and Scientific Linux). > > > > On 30-01-14 20:28, L.C. Karssen wrote: >> Dear list, >> >> I'm planning to go to the EMGM (European Mathematical Genetics Meeting) >> in Cologne in April. I'd like to present a poster there and wrote the >> abstract below. >> Please let me know any comments or suggestions as soon possible as the >> deadline for abstract submission is tomorrow (Fri 31 Jan). >> >> Thank you very much, >> >> Lennart. >> >> >> --------------8<----------------8<------------------8<------------- >> Over the last year the GenABEL project has seen a considerable >> number of improvements. These improvements do not only consist of >> updates to the existing packages of the GenABEL suite, but are also >> manifest in the way the development process is being handled and >> the way the packages are made available to the users. >> >> On our poster we will demonstrate the newly implemented features in >> the various packages of the GenABEL suite. We also welcome a new >> member to the GenABEL family: OmicABEL, a package for rapid >> mixed-model based genome-wide association analysis of multiple >> traits (think metabolomics, glycomics, etc.). >> >> Recently we started using the open source Jenkins Continuous >> Integration server to help us release software of higher >> quality. Jenkins is a framework that automatically runs several >> tests (e.g. static code analysis, checks for memory leaks) for each >> of our packages. It builds and tests each project after a new commit >> in our version control system. This allows us to detect problems in >> the code at an early stage, before they bug the user. >> >> After the GenABEL package, ProbABEL is the second package that is >> available as a Debian package. This means that users of upcoming >> Debian releases will be able to install ProbABEL with a simple click >> of a button or a single command. Moreover, since many other Linux >> distributions like Ubuntu and Linux Mint are derived from Debian, >> users of these distributions automatically benefit as well. >> >> In the coming year more packages are expected to be added the >> GenABEL suite as well as continued efforts to improve the existing >> ones. Moreover, we plan to increase both the ease of installation as >> well as the visibility of the GenABEL suite by adding more packages >> into both the Debian and Red Hat Enterprise Linux repositories (as >> well as derivatives like CentOS and Scientific Linux). >> --------------8<----------------8<------------------8<------------- >> >> >> >> >> >> >> >> >> >> >> >> >> _______________________________________________ >> genabel-devel mailing list >> genabel-devel at lists.r-forge.r-project.org >> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-devel >> > > -- > ----------------------------------------------------------------- > L.C. Karssen > Utrecht > The Netherlands > > lennart at karssen.org > http://blog.karssen.org > > Stuur mij aub geen Word of Powerpoint bestanden! > Zie http://www.gnu.org/philosophy/no-word-attachments.nl.html > ------------------------------------------------------------------ > > > > _______________________________________________ > genabel-devel mailing list > genabel-devel at lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-devel > -- *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* L.C. Karssen Utrecht The Netherlands lennart at karssen.org http://blog.karssen.org GPG key ID: A88F554A -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 230 bytes Desc: OpenPGP digital signature URL: From kooyman at gmail.com Thu Feb 6 17:46:03 2014 From: kooyman at gmail.com (Maarten Kooyman) Date: Thu, 06 Feb 2014 17:46:03 +0100 Subject: [GenABEL-dev] [Genabel-commits] r1594 - branches/ProbABEL-0.50/src In-Reply-To: <52F2A970.4030101@karssen.org> References: <20140204210043.DA5C9186CAD@r-forge.r-project.org> <52F2A970.4030101@karssen.org> Message-ID: <52F3BC4B.6030205@gmail.com> Hi Lennart, Thanks: there is also a std:count function which count the amount of a certain value in a array. This bug is created when I removed multiple calling of get_masked_data for each snp. KInd regards, Maarten On 05-02-14 22:13, L.C. Karssen wrote: > Hi Maarten, > > Interesting commit! I didn't know about std::copy(). > > To help me understand: is this a bug in the current version ProbABEL as > well, or one that was introduced by one of your previous commits? > > > Thanks for the good work, > > Lennart. > > On 04-02-14 22:00, noreply at r-forge.r-project.org wrote: >> Author: maartenk >> Date: 2014-02-04 22:00:43 +0100 (Tue, 04 Feb 2014) >> New Revision: 1594 >> >> Modified: >> branches/ProbABEL-0.50/src/maskedmatrix.cpp >> branches/ProbABEL-0.50/src/reg1.cpp >> branches/ProbABEL-0.50/src/regdata.cpp >> Log: >> -fixed incorrect multiplication with mmscore: other object was returned then expected. >> >> >> >> Modified: branches/ProbABEL-0.50/src/maskedmatrix.cpp >> =================================================================== >> --- branches/ProbABEL-0.50/src/maskedmatrix.cpp 2014-02-04 11:27:35 UTC (rev 1593) >> +++ branches/ProbABEL-0.50/src/maskedmatrix.cpp 2014-02-04 21:00:43 UTC (rev 1594) >> @@ -67,7 +67,6 @@ >> nmeasured++; >> } >> } >> - >> //Check update mask is the same as original matrix >> if (nmeasured == length_of_mask) >> { >> >> Modified: branches/ProbABEL-0.50/src/reg1.cpp >> =================================================================== >> --- branches/ProbABEL-0.50/src/reg1.cpp 2014-02-04 11:27:35 UTC (rev 1593) >> +++ branches/ProbABEL-0.50/src/reg1.cpp 2014-02-04 21:00:43 UTC (rev 1594) >> @@ -164,9 +164,11 @@ >> // column with Prob(A1A1). Note the order is swapped cf the file! >> int c2 = X.ncol - 1; >> >> - for (int i = 0; i < X.nrow; i++) >> - for (int j = 0; j < (X.ncol - 2); j++) >> + for (int i = 0; i < X.nrow; i++){ >> + for (int j = 0; j < (X.ncol - 2); j++){ >> nX[i * nX.ncol + j] = X[i * X.ncol + j]; >> + } >> + } >> >> for (int i = 0; i < nX.nrow; i++) >> { >> >> Modified: branches/ProbABEL-0.50/src/regdata.cpp >> =================================================================== >> --- branches/ProbABEL-0.50/src/regdata.cpp 2014-02-04 11:27:35 UTC (rev 1593) >> +++ branches/ProbABEL-0.50/src/regdata.cpp 2014-02-04 21:00:43 UTC (rev 1594) >> @@ -14,7 +14,7 @@ >> #include "fvlib/frversion.h" >> #include "fvlib/Logger.h" >> #include "fvlib/Transposer.h" >> - >> +#include // STL algoritms >> #include "regdata.h" >> >> regdata::regdata() >> @@ -203,7 +203,6 @@ >> int dim2X = X.ncol; >> (to.X).reinit(to.nids, dim2X); >> (to.Y).reinit(to.nids, dim2Y); >> - >> int j = 0; >> for (int i = 0; i < nids; i++) >> { >> @@ -223,13 +222,10 @@ >> } >> >> // delete [] to.masked_data; >> - to.masked_data = new unsigned short int[to.nids]; >> - for (int i = 0; i < to.nids; i++) >> - { >> - to.masked_data[i] = 0; >> - } >> - // std::cout << "get_unmasked: " << to.nids << " " >> - // << dim2X << " " << dim2Y << "\n"; >> + const int arr_size = nids; >> + to.masked_data = new unsigned short int[arr_size]; >> + std::copy(masked_data, masked_data+arr_size,to.masked_data); >> + >> return (to); >> } >> >> >> _______________________________________________ >> Genabel-commits mailing list >> Genabel-commits at lists.r-forge.r-project.org >> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-commits >> > > > _______________________________________________ > genabel-devel mailing list > genabel-devel at lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-devel -------------- next part -------------- An HTML attachment was scrubbed... URL: From kooyman at gmail.com Thu Feb 6 18:00:42 2014 From: kooyman at gmail.com (Maarten Kooyman) Date: Thu, 06 Feb 2014 18:00:42 +0100 Subject: [GenABEL-dev] [Genabel-commits] r1596 - branches/ProbABEL-0.50 In-Reply-To: <52F2AA3E.6080200@karssen.org> References: <20140205202601.BAB3E186B9D@r-forge.r-project.org> <52F2AA3E.6080200@karssen.org> Message-ID: <52F3BFBA.4030805@gmail.com> Hi Lennart, It does not look that -Wextra produce any extra warnings. On 05-02-14 22:16, L.C. Karssen wrote: > Hi Maarten, > > I haven't yet compiled this branch, but will be interested to see what > -Wextra gives in terms of warnings. > > One more question below: > > On 05-02-14 21:26, noreply at r-forge.r-project.org wrote: >> Author: maartenk >> Date: 2014-02-05 21:26:01 +0100 (Wed, 05 Feb 2014) >> New Revision: 1596 >> >> Modified: >> branches/ProbABEL-0.50/configure.ac >> Log: >> added CXXflags -DEIGENNO_DEBUG :removes checks for conformability (which gives a speedup in eigen) >> added CXXflags -Wextra: adds adittional check (see http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html for more info) >> >> >> >> >> >> Modified: branches/ProbABEL-0.50/configure.ac >> =================================================================== >> --- branches/ProbABEL-0.50/configure.ac 2014-02-05 16:35:59 UTC (rev 1595) >> +++ branches/ProbABEL-0.50/configure.ac 2014-02-05 20:26:01 UTC (rev 1596) >> @@ -21,9 +21,10 @@ >> AC_PROG_LN_S >> if test -z "$CXXFLAGS"; then >> # User did not set CXXFLAGS, so we can put in our own defaults >> - CXXFLAGS="-g -O2" >> + CXXFLAGS="-g -O2 -DEIGEN_NO_DEBUG -Wextra" >> fi >> -if test -z "$CPPFLAGS"; then >> +if test -z "$ >> +"; then >> # User did not set CPPFLAGS, so we can put in our own defaults >> CPPFLAGS="-Wall" >> fi >> > Is this correct? It seems that the name of the CPPFLAGS variable was > removed and > ";then > moved to a new line. Well spotted! This was a copy paste error. I committed a fix. I think there should be a configure option to use or use not -DNDEBUG: disabling this is inconvenient when developing and debugging. I think something like ./configure --develop-flags. I don't have any experience with autotools, so this might take a while. > > > > Thanks, > > Lennart. > >> _______________________________________________ >> Genabel-commits mailing list >> Genabel-commits at lists.r-forge.r-project.org >> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-commits >> > > > _______________________________________________ > genabel-devel mailing list > genabel-devel at lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-devel -------------- next part -------------- An HTML attachment was scrubbed... URL: From lennart at karssen.org Sun Feb 9 11:27:07 2014 From: lennart at karssen.org (L.C. Karssen) Date: Sun, 09 Feb 2014 11:27:07 +0100 Subject: [GenABEL-dev] Preparing for ProbABEL 0.4.3 release Message-ID: <52F757FB.8070707@karssen.org> Dear list, I am currently preparing the 0.4.3 release of ProbABEL. If you have any updates/fixes/etc. that you would like to have in this release, please let me know. I aim to do the release somewhere in the coming week. Best regards, Lennart Karssen. -- *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* L.C. Karssen Utrecht The Netherlands lennart at karssen.org http://blog.karssen.org GPG key ID: A88F554A -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 230 bytes Desc: OpenPGP digital signature URL: From lennart at karssen.org Sun Feb 9 14:13:29 2014 From: lennart at karssen.org (L.C. Karssen) Date: Sun, 09 Feb 2014 14:13:29 +0100 Subject: [GenABEL-dev] Design: Versions for filevector library, change symlinks Message-ID: <52F77EF9.5010504@karssen.org> Dear list, As you may know I have been playing with the idea of creating filevector (more specifically the fvlib directory) a separate library (see the discussions at [1-3]). I also created a separate SVN branch to play around with that idea. Basically this would mean that packages like ProbABEL, DatABEL and VariABEL would get a dependency in the form of what I call 'libfilevector'. Especially for the R packages in the GenABEL suite this may not be very user-friendly because many of them would not have admin rights (I assume) and therefore cannot simply install operating system packages that contain libfilevector. Obviously such a change to libfilevector would be a major one. Apart from the discussions on the mailing list this topic came up again a few weeks ago in a discussion with Maksim and Yurii. We discussed many of the pros and cons (mostly revolving around user-friendliness vs. technical advantages) and in the end we came up with the following: Let's start to put versions on the filevector code. So far filevector has never been released separately (always as part of the ABEL packages). By putting a version number on the fv code and by making tags of those releases in SVN we can solve several issues: - It can be made clear which *ABEL package depends on which version of the filevector code - Improvements in the filevector code do not immediately affect the 'trunk' of the other packages - This allows packages like ProbABEL to depend on a separate libfilevector, whereas R packages can create a symlink to the tagged code instead of filevector trunk (as is the present situation) A final advantage may be that it becomes easier to treat filevector as one of various file-format backends to the *ABELs. But this is something I'll elaborate on in another e-mail to this list. We would like to hear your opinions about this versioning of filevector and tagging of these official filevector releases, as well as on the use of symlinks to these tags by other packages (this may not be ideal, but it solves the user-friendliness issue, while allowing the creation and release of libfilevector). Hope to hear from you! Lennart. [1]http://lists.r-forge.r-project.org/pipermail/genabel-devel/2013-July/000714.html [2] http://lists.r-forge.r-project.org/pipermail/genabel-devel/2013-November/000779.html [2] http://lists.r-forge.r-project.org/pipermail/genabel-devel/2013-November/000797.html -- *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* L.C. Karssen Utrecht The Netherlands lennart at karssen.org http://blog.karssen.org GPG key ID: A88F554A -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 230 bytes Desc: OpenPGP digital signature URL: From lennart at karssen.org Sun Feb 9 22:31:40 2014 From: lennart at karssen.org (L.C. Karssen) Date: Sun, 09 Feb 2014 22:31:40 +0100 Subject: [GenABEL-dev] Score option in ProbABEL Message-ID: <52F7F3BC.6070203@karssen.org> Dear list, I was wondering if one of the developers of the 'early days' knows why the 'score' option has been disabled since v 0.1-6 of ProbABEL (see the output of e.g. 'palinear -p p.phe -i i.info -d d.dose --score': probabel v. 0.4.2 (C) Yurii Aulchenko, Lennart C. Karssen, Maksim Struchalin, EMCR Using EIGEN version 3.2.0 for matrix operations option --score suppressed from v 0.1-6 If this option is no longer used we could remove its code to reduce clutter. Looking forward to hearing from you! Lennart. -- *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* L.C. Karssen Utrecht The Netherlands lennart at karssen.org http://blog.karssen.org GPG key ID: A88F554A -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 230 bytes Desc: OpenPGP digital signature URL: From lennart at karssen.org Tue Feb 11 15:28:44 2014 From: lennart at karssen.org (L.C. Karssen) Date: Tue, 11 Feb 2014 15:28:44 +0100 Subject: [GenABEL-dev] Fwd: Re: [Genabel-commits] r1606 - pkg/VariABEL/src/VARlib In-Reply-To: <52F9F5D8.3010501@karssen.org> References: <52F9F5D8.3010501@karssen.org> Message-ID: <52FA339C.5040200@karssen.org> Dear Maksim, all, The e-mail below should have gone to the devel list, not the commit list. Best, Lennart. -------- Original Message -------- Subject: Re: [Genabel-commits] r1606 - pkg/VariABEL/src/VARlib Date: Tue, 11 Feb 2014 11:05:12 +0100 From: L.C. Karssen Reply-To: genabel-devel at lists.r-forge.r-project.org To: genabel-commits at lists.r-forge.r-project.org Thanks Maksim, for adding the 2df test! One question below: On 11-02-14 09:29, noreply at r-forge.r-project.org wrote: > Author: maksim > Date: 2014-02-11 09:29:43 +0100 (Tue, 11 Feb 2014) > New Revision: 1606 > > Modified: > pkg/VariABEL/src/VARlib/var_homogeneity_tests.h > Log: > Fixed > > Modified: pkg/VariABEL/src/VARlib/var_homogeneity_tests.h > =================================================================== > --- pkg/VariABEL/src/VARlib/var_homogeneity_tests.h 2014-02-11 07:55:37 UTC (rev 1605) > +++ pkg/VariABEL/src/VARlib/var_homogeneity_tests.h 2014-02-11 08:29:43 UTC (rev 1606) > @@ -55,7 +55,7 @@ > double var(my_small_vector vec); > > extern "C" { > -void variance_homogeneity_test_C(double* snp, double *trait, double *design_matrix_geno_means, double *design_matrix, int *p, long unsigned* nids, double *betas, double *se, double * chi2, int * df, double * residuals, int *analys_type_, int * is_trait_na, int *testname, /*auxiliary variables:*/ double *qty, int *jpvt, double *qraux, double *work, double *v, double *x_for_ch2inv); > +void variance_homogeneity_test_C(double* snp, double *trait, double *design_matrix_geno_means, double *design_matrix, int *p, long unsigned* nids, double *betas, double *se, double * chi2, int * df, double * residuals, int *analys_type_, int * is_trait_na, int *testname, /*auxiliary variables:*/ double *qty, int *jpvt, double *qraux, double *work, double *v, double *x_for_ch2inv, > unsigned step); I am wondering about this last argument: 'unsigned step'. Shouldn't that be 'unsigned int step'? Best, Lennart. > } > > #endif > > _______________________________________________ > Genabel-commits mailing list > Genabel-commits at lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-commits > -- ----------------------------------------------------------------- L.C. Karssen Utrecht The Netherlands lennart at karssen.org http://blog.karssen.org Stuur mij aub geen Word of Powerpoint bestanden! Zie http://www.gnu.org/philosophy/no-word-attachments.nl.html ------------------------------------------------------------------ -------------- next part -------------- _______________________________________________ Genabel-commits mailing list Genabel-commits at lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-commits -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 230 bytes Desc: OpenPGP digital signature URL: From m.v.struchalin at mail.ru Tue Feb 11 16:06:09 2014 From: m.v.struchalin at mail.ru (Maksim Struchalin) Date: Tue, 11 Feb 2014 22:06:09 +0700 Subject: [GenABEL-dev] Fwd: Re: [Genabel-commits] r1606 - pkg/VariABEL/src/VARlib In-Reply-To: <52FA339C.5040200@karssen.org> References: <52F9F5D8.3010501@karssen.org> <52FA339C.5040200@karssen.org> Message-ID: <52FA3C61.2050204@mail.ru> Dear Lennart, 'unsigned' stands for 'unsigned int' but I think you are right, it is better to write a full type name. best, Maksim On 11/02/2014 21:28, L.C. Karssen wrote: > Dear Maksim, all, > > The e-mail below should have gone to the devel list, not the commit list. > > > Best, > > Lennart. > > > -------- Original Message -------- > Subject: Re: [Genabel-commits] r1606 - pkg/VariABEL/src/VARlib > Date: Tue, 11 Feb 2014 11:05:12 +0100 > From: L.C. Karssen > Reply-To: genabel-devel at lists.r-forge.r-project.org > To: genabel-commits at lists.r-forge.r-project.org > > Thanks Maksim, for adding the 2df test! > > One question below: > > > On 11-02-14 09:29, noreply at r-forge.r-project.org wrote: >> Author: maksim >> Date: 2014-02-11 09:29:43 +0100 (Tue, 11 Feb 2014) >> New Revision: 1606 >> >> Modified: >> pkg/VariABEL/src/VARlib/var_homogeneity_tests.h >> Log: >> Fixed >> >> Modified: pkg/VariABEL/src/VARlib/var_homogeneity_tests.h >> =================================================================== >> --- pkg/VariABEL/src/VARlib/var_homogeneity_tests.h 2014-02-11 07:55:37 UTC (rev 1605) >> +++ pkg/VariABEL/src/VARlib/var_homogeneity_tests.h 2014-02-11 08:29:43 UTC (rev 1606) >> @@ -55,7 +55,7 @@ >> double var(my_small_vector vec); >> >> extern "C" { >> -void variance_homogeneity_test_C(double* snp, double *trait, double *design_matrix_geno_means, double *design_matrix, int *p, long unsigned* nids, double *betas, double *se, double * chi2, int * df, double * residuals, int *analys_type_, int * is_trait_na, int *testname, /*auxiliary variables:*/ double *qty, int *jpvt, double *qraux, double *work, double *v, double *x_for_ch2inv); >> +void variance_homogeneity_test_C(double* snp, double *trait, double *design_matrix_geno_means, double *design_matrix, int *p, long unsigned* nids, double *betas, double *se, double * chi2, int * df, double * residuals, int *analys_type_, int * is_trait_na, int *testname, /*auxiliary variables:*/ double *qty, int *jpvt, double *qraux, double *work, double *v, double *x_for_ch2inv, >> unsigned step); > I am wondering about this last argument: 'unsigned step'. Shouldn't that > be 'unsigned int step'? > > > Best, > > Lennart. > > >> } >> >> #endif >> >> _______________________________________________ >> Genabel-commits mailing list >> Genabel-commits at lists.r-forge.r-project.org >> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-commits >> > > > _______________________________________________ > genabel-devel mailing list > genabel-devel at lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-devel -------------- next part -------------- An HTML attachment was scrubbed... URL: From m.v.struchalin at mail.ru Wed Feb 12 05:22:36 2014 From: m.v.struchalin at mail.ru (Maksim Struchalin) Date: Wed, 12 Feb 2014 11:22:36 +0700 Subject: [GenABEL-dev] 'free' genetic model, test on significance In-Reply-To: References: <633975060.12301.1391763223671.JavaMail.mobile-sync@veei10> <8399649340900060896@unknownmsgid> <52F4A3B8.3010409@mail.ru> <52F9BBAB.4090806@mail.ru> Message-ID: <52FAF70C.1030204@mail.ru> Hi All from the devel list, Sodbo (cc) is going to test GxG and GxE interactions in his date using genotypic variance heterogeneity comparison (VariABEL package). Currently, VariABEL can test only genotyped date or imputed dosages and for only three genetic models (additive, dominant, recessive). But Sodbo would like to make a test which does not assume any genetic model. As I proposed, for this, we need to run the model 'trait_residuals2 ~ P_AB + P_BB', where trait_residuals2 is the squared residuals of a trait adjusted on covariates (environmental factors and others), P_AB and P_BB are probabilities of having AB and BB genotypes by a given individual (imputed SNPs from MACH). Now, I am in charge of implementing such a test in VariABEL and thinking about how to test the significance jointly for P_AB and P_BB. Because of its simIicity, I propose to implement a test expained in page 46 of http://academic.reed.edu/economics/parker/s10/312/notes/Notes5.pdf in a section 'Alternative calculation of F under classical assumption'. This test gives a 'liiiiiiitle' bit overestimated p-value if copmare to the test implemented in summary.lm() in R. We would like to ask an advice on this issue from all of you. Does this regression model and the test on significance allows us to test a SNP without a prior assumption on genetic model? Any comments are welcome. best, Maksim On 12/02/2014 03:48, Yury Aulchenko wrote: > Hi Maksim, > > It may be good if you could formulate your ideas concerning the 2df > test and send these to the devel list - then we will have a chance to > pick on the brains of people who are very knowledgable about > statistics (e.g. Xia and William) > > Let us know if you could do this. > > best wishes, > Yurii > > On Feb 11, 2014, at 06:56, Maksim Struchalin > wrote: > >> ?????? ????? ? ???, >> >> ???????? ?? ?????? ????? ?????? ??? ????? ?? ??????. ? ???? ??????? >> ????? ?????????: >> - beta_AB, sigma_AB - ?????? ? ?????? ??? AB >> - beta_BB, sigma_BB - ?????? ? ?????? ??? BB >> - chisq_AB, chisq_BB - ??-???????? ??? AB ? BB >> - wald test ??? AB ? BB >> - F ???? ?? ??????? (sigma_0 - sigma_1), ??? sigma_0 - ????????? >> '???????? ? ????????', ? sigma_1 - ????????? ???????? ????? >> ?????????. ???? ???? ??????? ?????????? ?????????????? ????????????? >> AB ? BB. >> (??. ???. 46, ????? "Alternative calculation..." ? >> http://academic.reed.edu/economics/parker/s10/312/notes/Notes5.pdf). >> >> ? ???? ????????????? ???? ????? ??? AB ? BB, 2df ???? ???? ? ????? ?????. >> >> ?????? >> >> >> On 09/02/2014 20:12, Sodbo Sharapov wrote: >>> ?????? ????! >>> >>> ?????? ???????? ?? ??????:https: >>> https://www.dropbox.com/s/w6gayszobvgzr7o/Ara_2_Maksim.rdata.zip >>> >>> ??????? ???? - "X30.Mo98" - ???????????? ?????????. SNP ?????? ?? >>> 2?? ????????? (?? ??? ???? ????). ? ara_gwaa.rdata ???????? ??????? >>> ? ???????? ????????. >>> ? prob_ara_2_Maksim.rdata ???????? ?????????????? ???????? - ? >>> ??????? ?????????????? ?????????. ????? ??? ???? 10 ???????? SNP - >>> ??? ????. >>> ? prob_ara_2_Maksim.fvd/fvi - ???? ????? ? DatABEL ??????? - ??? >>> ?????????????? SNP ?????? ????? ????? >>> ????? ??????? - ??????=) >>> >>> >>> 7 ??????? 2014 ?., 20:03 ???????????? Yury Aulchenko >>> > ???????: >>> >>> Sodbo, togda navernoye stoit snachala sgenerit' danniye i >>> poslat' Maximu, a potom sozvonites', obsudite testy >>> >>> nu i napominayu chto v principe eto horosho by sdelat' za >>> nedelyu-dve konechno do stadii chtob ty mog nachat' analiz >>> real'nih dannih :) >>> >>> Y >>> >>> On Feb 7, 2014, at 10:13, Maksim Struchalin >>> > wrote: >>> >>> > ??? ???? ?? ????????????. ????? ????? ? ????? ??????. >>> > ?????? >>> > >>> > On 07/02/2014 16:06, Yurii Aulchenko wrote: >>> >> ??????, ?????, ? ?????? - ????? ????? ??????? ????????? ???? >>> ?????? ??? ????? >>> >> >>> >> ---------------------- >>> >> Yurii Aulchenko >>> >> (sent from mobile device) >>> >> >>> >>> On Feb 7, 2014, at 9:53 AM, Maksim Struchalin >>> > wrote: >>> >>> >>> >>> ??????, ?????, >>> >>> >>> >>> ? ?????? ???????? 2df ??????. ?????? ??? ??????? ??????? >>> ?????? ??? >>> >>> ??????? ?? ??????????? ????? ???? ????. ???? ?????????? >>> ?????? ?????? + >>> >>> ? ??? ???? ???????????? ??? ??????? ?????. >>> >>> >>> >>> ???? ??????? :-), >>> >>> ?????? >>> > >>> >>> >>> >>> >>> -- >>> ___________________________________ >>> _ >>> _With best regards >>> >>> Sodbo Zh. Sharapov >>> Phone: +79831347688 >>> Email: sharapovsodbo at gmail.com >>> sharapov at bionet.nsc.ru >>> Skype: sharapovsodbo >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lennart at karssen.org Wed Feb 12 09:43:40 2014 From: lennart at karssen.org (L.C. Karssen) Date: Wed, 12 Feb 2014 09:43:40 +0100 Subject: [GenABEL-dev] Fwd: Re: [Genabel-commits] r1606 - pkg/VariABEL/src/VARlib In-Reply-To: <52FA3C61.2050204@mail.ru> References: <52F9F5D8.3010501@karssen.org> <52FA339C.5040200@karssen.org> <52FA3C61.2050204@mail.ru> Message-ID: <52FB343C.80209@karssen.org> Thanks Maksim! Lennart. On 11-02-14 16:06, Maksim Struchalin wrote: > Dear Lennart, > > 'unsigned' stands for 'unsigned int' but I think you are right, it is > better to write a full type name. > > best, > Maksim > > On 11/02/2014 21:28, L.C. Karssen wrote: >> Dear Maksim, all, >> >> The e-mail below should have gone to the devel list, not the commit list. >> >> >> Best, >> >> Lennart. >> >> >> -------- Original Message -------- >> Subject: Re: [Genabel-commits] r1606 - pkg/VariABEL/src/VARlib >> Date: Tue, 11 Feb 2014 11:05:12 +0100 >> From: L.C. Karssen >> Reply-To: genabel-devel at lists.r-forge.r-project.org >> To: genabel-commits at lists.r-forge.r-project.org >> >> Thanks Maksim, for adding the 2df test! >> >> One question below: >> >> >> On 11-02-14 09:29, noreply at r-forge.r-project.org wrote: >>> Author: maksim >>> Date: 2014-02-11 09:29:43 +0100 (Tue, 11 Feb 2014) >>> New Revision: 1606 >>> >>> Modified: >>> pkg/VariABEL/src/VARlib/var_homogeneity_tests.h >>> Log: >>> Fixed >>> >>> Modified: pkg/VariABEL/src/VARlib/var_homogeneity_tests.h >>> =================================================================== >>> --- pkg/VariABEL/src/VARlib/var_homogeneity_tests.h 2014-02-11 07:55:37 UTC (rev 1605) >>> +++ pkg/VariABEL/src/VARlib/var_homogeneity_tests.h 2014-02-11 08:29:43 UTC (rev 1606) >>> @@ -55,7 +55,7 @@ >>> double var(my_small_vector vec); >>> >>> extern "C" { >>> -void variance_homogeneity_test_C(double* snp, double *trait, double *design_matrix_geno_means, double *design_matrix, int *p, long unsigned* nids, double *betas, double *se, double * chi2, int * df, double * residuals, int *analys_type_, int * is_trait_na, int *testname, /*auxiliary variables:*/ double *qty, int *jpvt, double *qraux, double *work, double *v, double *x_for_ch2inv); >>> +void variance_homogeneity_test_C(double* snp, double *trait, double *design_matrix_geno_means, double *design_matrix, int *p, long unsigned* nids, double *betas, double *se, double * chi2, int * df, double * residuals, int *analys_type_, int * is_trait_na, int *testname, /*auxiliary variables:*/ double *qty, int *jpvt, double *qraux, double *work, double *v, double *x_for_ch2inv, >>> unsigned step); >> I am wondering about this last argument: 'unsigned step'. Shouldn't that >> be 'unsigned int step'? >> >> >> Best, >> >> Lennart. >> >> >>> } >>> >>> #endif >>> >>> _______________________________________________ >>> Genabel-commits mailing list >>> Genabel-commits at lists.r-forge.r-project.org >>> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-commits >>> >> >> >> _______________________________________________ >> genabel-devel mailing list >> genabel-devel at lists.r-forge.r-project.org >> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-devel > > > > _______________________________________________ > genabel-devel mailing list > genabel-devel at lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-devel > -- *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* L.C. Karssen Utrecht The Netherlands lennart at karssen.org http://blog.karssen.org GPG key ID: A88F554A -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 230 bytes Desc: OpenPGP digital signature URL: From 340071rs at student.eur.nl Wed Feb 12 13:24:00 2014 From: 340071rs at student.eur.nl (Rebecca Steenaard) Date: Wed, 12 Feb 2014 12:24:00 +0000 Subject: [GenABEL-dev] Bug in GenABEL-tutorial.pdf Message-ID: Dear, Yurri Aulchenko told me to send this email to correct a bug in the GenABEL-tutorial pdf used during the GWAS course of NIHES. On page 241 the following line is used: Thus the pooled estimate of Odds Ratio from association between type 2diabetes and "Ala" allele is Given the rest of the exercise and the answers, the "Ala" should be "Pro", otherwise the answer is inverted. With kind regards, Rebecca Steenaard -------------- next part -------------- An HTML attachment was scrubbed... URL: From lennart at karssen.org Wed Feb 12 13:57:44 2014 From: lennart at karssen.org (L.C. Karssen) Date: Wed, 12 Feb 2014 13:57:44 +0100 Subject: [GenABEL-dev] Bug in GenABEL-tutorial.pdf In-Reply-To: References: Message-ID: <52FB6FC8.7050509@karssen.org> Dear Rebecca, Thank you for reporting this bug. I've reported it in our bug tracker at https://r-forge.r-project.org/tracker/index.php?func=detail&aid=5367&group_id=505&atid=2058 Kind regards, Lennart Karssen. On 12-02-14 13:24, Rebecca Steenaard wrote: > > > Dear, > > > > Yurri Aulchenko told me to send this email to correct a bug in the > GenABEL-tutorial pdf used during the GWAS course of NIHES. On page 241 > the following line is used: > > Thus the pooled estimate of Odds Ratio from association between type > 2diabetes and "Ala" allele is > > Given the rest of the exercise and the answers, the "Ala" should be > "Pro", otherwise the answer is inverted. > > > > With kind regards, > > Rebecca Steenaard > > > > _______________________________________________ > genabel-devel mailing list > genabel-devel at lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-devel > -- *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* L.C. Karssen Utrecht The Netherlands lennart at karssen.org http://blog.karssen.org GPG key ID: A88F554A -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 230 bytes Desc: OpenPGP digital signature URL: From kooyman at gmail.com Wed Feb 12 20:44:02 2014 From: kooyman at gmail.com (Maarten Kooyman) Date: Wed, 12 Feb 2014 20:44:02 +0100 Subject: [GenABEL-dev] Fwd: Re: [Genabel-commits] r1606 - pkg/VariABEL/src/VARlib In-Reply-To: <52FB343C.80209@karssen.org> References: <52F9F5D8.3010501@karssen.org> <52FA339C.5040200@karssen.org> <52FA3C61.2050204@mail.ru> <52FB343C.80209@karssen.org> Message-ID: <52FBCF02.4080008@gmail.com> Dear All, There is some nice information about (unsigned) integer in c++ on http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Integer_Types and there problems. Kind regards, Maarten Kooyman On 12-02-14 09:43, L.C. Karssen wrote: > Thanks Maksim! > > > > Lennart. > > On 11-02-14 16:06, Maksim Struchalin wrote: >> Dear Lennart, >> >> 'unsigned' stands for 'unsigned int' but I think you are right, it is >> better to write a full type name. >> >> best, >> Maksim >> >> On 11/02/2014 21:28, L.C. Karssen wrote: >>> Dear Maksim, all, >>> >>> The e-mail below should have gone to the devel list, not the commit list. >>> >>> >>> Best, >>> >>> Lennart. >>> >>> >>> -------- Original Message -------- >>> Subject: Re: [Genabel-commits] r1606 - pkg/VariABEL/src/VARlib >>> Date: Tue, 11 Feb 2014 11:05:12 +0100 >>> From: L.C. Karssen >>> Reply-To: genabel-devel at lists.r-forge.r-project.org >>> To: genabel-commits at lists.r-forge.r-project.org >>> >>> Thanks Maksim, for adding the 2df test! >>> >>> One question below: >>> >>> >>> On 11-02-14 09:29, noreply at r-forge.r-project.org wrote: >>>> Author: maksim >>>> Date: 2014-02-11 09:29:43 +0100 (Tue, 11 Feb 2014) >>>> New Revision: 1606 >>>> >>>> Modified: >>>> pkg/VariABEL/src/VARlib/var_homogeneity_tests.h >>>> Log: >>>> Fixed >>>> >>>> Modified: pkg/VariABEL/src/VARlib/var_homogeneity_tests.h >>>> =================================================================== >>>> --- pkg/VariABEL/src/VARlib/var_homogeneity_tests.h 2014-02-11 07:55:37 UTC (rev 1605) >>>> +++ pkg/VariABEL/src/VARlib/var_homogeneity_tests.h 2014-02-11 08:29:43 UTC (rev 1606) >>>> @@ -55,7 +55,7 @@ >>>> double var(my_small_vector vec); >>>> >>>> extern "C" { >>>> -void variance_homogeneity_test_C(double* snp, double *trait, double *design_matrix_geno_means, double *design_matrix, int *p, long unsigned* nids, double *betas, double *se, double * chi2, int * df, double * residuals, int *analys_type_, int * is_trait_na, int *testname, /*auxiliary variables:*/ double *qty, int *jpvt, double *qraux, double *work, double *v, double *x_for_ch2inv); >>>> +void variance_homogeneity_test_C(double* snp, double *trait, double *design_matrix_geno_means, double *design_matrix, int *p, long unsigned* nids, double *betas, double *se, double * chi2, int * df, double * residuals, int *analys_type_, int * is_trait_na, int *testname, /*auxiliary variables:*/ double *qty, int *jpvt, double *qraux, double *work, double *v, double *x_for_ch2inv, >>>> unsigned step); >>> I am wondering about this last argument: 'unsigned step'. Shouldn't that >>> be 'unsigned int step'? >>> >>> >>> Best, >>> >>> Lennart. >>> >>> >>>> } >>>> >>>> #endif >>>> >>>> _______________________________________________ >>>> Genabel-commits mailing list >>>> Genabel-commits at lists.r-forge.r-project.org >>>> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-commits >>>> >>> >>> _______________________________________________ >>> genabel-devel mailing list >>> genabel-devel at lists.r-forge.r-project.org >>> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-devel >> >> >> _______________________________________________ >> genabel-devel mailing list >> genabel-devel at lists.r-forge.r-project.org >> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-devel >> > > > _______________________________________________ > genabel-devel mailing list > genabel-devel at lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-devel -------------- next part -------------- An HTML attachment was scrubbed... URL: From lennart at karssen.org Fri Feb 14 11:32:20 2014 From: lennart at karssen.org (L.C. Karssen) Date: Fri, 14 Feb 2014 11:32:20 +0100 Subject: [GenABEL-dev] [Genabel-commits] r1609 - pkg/OmicABELnoMM/src In-Reply-To: <20140213204258.0DD561849B8@r-forge.r-project.org> References: <20140213204258.0DD561849B8@r-forge.r-project.org> Message-ID: <52FDF0B4.10008@karssen.org> Hi Alvaro, Thanks for your contribution and congratulations on your first commit in the GenABEL project. Glad to see that the number of has been reduced a lot! I still get a few errors after running ./configure LDFLAGS="-L/usr/lib/openblas-base" make -j4 but they seem to be minor and easy to fix. Have a look at http://jenkins.genabel.org/jenkins/job/OmicABELnoMM/15/warnings23Result/ for the warning messages and corresponding lines in the code. Also try to have a look at the CPPcheck results in Jenkins. It warns about three (possible) memory leaks. Thanks a lot and looking forward to your next commits. Lennart. On 13-02-14 21:42, noreply at r-forge.r-project.org wrote: > Author: afrank > Date: 2014-02-13 21:42:52 +0100 (Thu, 13 Feb 2014) > New Revision: 1609 > > Modified: > pkg/OmicABELnoMM/src/AIOwrapper.cpp > pkg/OmicABELnoMM/src/Algorithm.cpp > pkg/OmicABELnoMM/src/Algorithm.h > pkg/OmicABELnoMM/src/Definitions.h > pkg/OmicABELnoMM/src/Utility.cpp > pkg/OmicABELnoMM/src/Utility.h > pkg/OmicABELnoMM/src/main.cpp > Log: > Warnings from c/c++ inconsistencies and -Wall fixed. Legacy code from unused functionality removed. A few bugs with indices fixed. Stable code. > > Modified: pkg/OmicABELnoMM/src/AIOwrapper.cpp > =================================================================== > --- pkg/OmicABELnoMM/src/AIOwrapper.cpp 2014-02-13 09:24:32 UTC (rev 1608) > +++ pkg/OmicABELnoMM/src/AIOwrapper.cpp 2014-02-13 20:42:52 UTC (rev 1609) > @@ -29,9 +29,9 @@ > > Fhandler->fakefiles = params.use_fake_files; > > - databel_fvi* Yfvi; > - databel_fvi* ALfvi; > - databel_fvi* ARfvi; > +// databel_fvi* Yfvi; > +// databel_fvi* ALfvi; > +// databel_fvi* ARfvi; > > if (!Fhandler->fakefiles) > { > @@ -49,7 +49,7 @@ > params.l = ALfvi->fvi_header.numVariables; > > //block size to keep mem under 1 gigabyte > - int opt_block = params.n / (4*1000^3) * (1/(2*params.r)); > + //int opt_block = params.n / (4*1000^3) * (1/(2*params.r)); > int opt_tb = 1000; > int opt_mb = 1000; > > @@ -81,7 +81,7 @@ > void AIOwrapper::finalize() > { > //cout << "f"; > - void *status; > + //void *status; > > Fhandler->not_done = false; > pthread_mutex_lock(&(Fhandler->m_more)); > @@ -368,13 +368,15 @@ > } > // > // //!induce realistic fileread delay > + > + return 0; > } > > > void AIOwrapper::load_ARblock(type_precision** Ar, int &Ar_blockSize) > { > - int status; > - int createstatus = 0; > + //int status; > + //int createstatus = 0; > //cout<<"^"; > > while (Fhandler->ar_full_buffers.empty()) > @@ -428,8 +430,8 @@ > > void AIOwrapper::load_Yblock(type_precision** Y, int &y_blockSize) > { > - int status; > - int createstatus = 0; > + //int status; > + //int createstatus = 0; > > while (Fhandler->full_buffers.empty()) > { > @@ -528,7 +530,7 @@ > > void AIOwrapper::reset_Y() > { > - void *status; > + //void *status; > > Fhandler->seed = 1337; > > @@ -569,7 +571,7 @@ > > void AIOwrapper::reset_AR() > { > - void *status; > + //void *status; > > > //cout << "ra" << flush; > @@ -697,7 +699,7 @@ > FILE * AIOwrapper::fgls_fopen( const char *path, const char *mode ) > { > FILE * f; > - char err[100]; > + //char err[100]; > > f = fopen(path, mode ); > if ( f == NULL ) > > Modified: pkg/OmicABELnoMM/src/Algorithm.cpp > =================================================================== > --- pkg/OmicABELnoMM/src/Algorithm.cpp 2014-02-13 09:24:32 UTC (rev 1608) > +++ pkg/OmicABELnoMM/src/Algorithm.cpp 2014-02-13 20:42:52 UTC (rev 1609) > @@ -16,30 +16,12 @@ > { > switch (type) > { > - case FULL_NEQ: > - fullNEQ(params, out); > - break; > - case P_NEQ: > - partialNEQ(params, out); > - break; > - case P_NEQ_B_OPT: > - partialNEQ_Blocked_STL(params, out); > - break; > - case FULL_QR: > - fullQR(params, out); > - break; > - case P_QR: > - partialQR(params, out); > - break; > - case P_QR_B_OPT: > - partialQR_Blocked_Rtl(params, out); > - break; > - case P_NEQ_B_OPT_MD: > - partialNEQ_Blocked_STL_MD(params, out); > - break; > + case P_NEQ_B_OPT_MD: > + partialNEQ_Blocked_STL_MD(params, out); > + break; > > - default: > - break; > + default: > + break; > } > } > > @@ -74,7 +56,7 @@ > int dim2_b, int dim1_b_bot) > { > // memcpy are faster version of the fors > - int i, k, w, top_idx, bot_idx, max = dim1_b*dim2_b; > + int i, k, w, top_idx, bot_idx; > int size; > top_idx = 0; > bot_idx = 0; > @@ -111,7 +93,7 @@ > type_precision* bot, int dim1_QY, > int dim2_QY, int dim1_qy_bot, int bot_blocks ) > { > - int i, k, w, top_idx, bot_idx, max = dim1_QY*dim2_QY; > + int i, k, w, top_idx, bot_idx; > top_idx = 0; > bot_idx = 0; > for (k = 0; k < dim2_QY; k++) > @@ -326,12 +308,9 @@ > blas_set_num_threads(max_threads); > > > - type_precision *Ytemp; > - lapack_int info, n, lda, ldy, l, r, k, p; > + //type_precision *Ytemp; > + lapack_int info, n, lda, l, r, p; > > - int i, j, w; > - int m; > - > cputime_type start_tick, start_tick2, end_tick; > > AIOfile.initialize(params); > @@ -349,12 +328,12 @@ > int y_iters = (y_amount + y_block_size - 1) / y_block_size; > > > - lda = n; ldy = n; > - k = p; > + lda = n; > > + > for (int j = 0; j < y_iters; j++) > { > - if (y_iters >= 40 && (i%(y_iters/40)) == 0) > + if (y_iters >= 40 && (j%(y_iters/40)) == 0) > { > cout << "*" << flush; > } > @@ -389,7 +368,9 @@ > > > AIOfile.load_AL(&backupAL); > - int total_al_nans = replace_nans(0, backupAL, n, l); > + //int total_al_nans = replace_nans(0, backupAL, n, l); > + replace_nans(0, backupAL, n, l); > + > copy_vec(backupAL, AL, n*l); > > > @@ -402,7 +383,7 @@ > > for (int j = 0; j < y_iters; j++) > { > - if (y_iters >= 40 && (i%(y_iters/40)) == 0) > + if (y_iters >= 40 && (j%(y_iters/40)) == 0) > { > cout << AIOfile.io_overhead << flush; > AIOfile.io_overhead = "*"; > @@ -412,7 +393,8 @@ > > list y_nan_idxs[y_block_size]; > > - int total_y_nans = replace_nans(&y_nan_idxs[0], Y, n, y_block_size); > + //int total_y_nans = replace_nans(&y_nan_idxs[0], Y, n, y_block_size); > + replace_nans(&y_nan_idxs[0], Y, n, y_block_size); > > > //! Ay_top = AL'*Y > @@ -424,7 +406,8 @@ > for (int i = 0; i < a_iters; i++) > { > AIOfile.load_ARblock(&backupAR, a_block_size); > - int total_ar_nans = replace_nans(0, backupAR, n, a_block_size * r); > + //int total_ar_nans = replace_nans(0, backupAR, n, a_block_size * r); > + replace_nans(0, backupAR, n, a_block_size * r); > copy_vec(backupAR, AR, n * r * a_block_size); > > get_ticks(start_tick2); > @@ -501,7 +484,7 @@ > &Ay[l+ii*p], r); > > > - type_precision* B = Ay; > + //type_precision* B = Ay; > type_precision S[p * p]; > > //! Rebuild S > @@ -564,1194 +547,187 @@ > > //!*************************************************!// > > - > +//for reference > void Algorithm::partialNEQ_Blocked_STL(struct Settings params, > struct Outputs &out) > { > - int max_threads = params.threads; > - > - srand(time(NULL)); > - > - blas_set_num_threads(max_threads); > - > - type_precision *Ytemp; > - lapack_int info, n, lda, ldy, l, r, k, p; > - > - int i, j, w; > - int m; > - > - cputime_type start_tick, start_tick2, end_tick; > - > - AIOfile.initialize(params); > - > - n = params.n; l = params.l; r = params.r; p = l+r; > - > - int y_amount = params.m; > - int y_block_size = params.mb; // kk > - > - int a_amount = params.t; > - int a_block_size = params.tb; > - > - int a_iters = (a_amount + a_block_size - 1) / a_block_size; > - > - lda = n; ldy = n; > - k = p; > - > - > - > - type_precision* backupAL; > - > - AIOfile.load_AL(&backupAL); > - > - > - type_precision Stl[l * l]; > - type_precision Str[l * r * a_block_size]; > - > - > - type_precision* Ay_top = new type_precision[l * y_amount]; > - type_precision* Ay_bot = new type_precision[y_block_size * a_block_size * r]; > - type_precision* A = new type_precision[n * p]; > - type_precision* AR = new type_precision[n * r * a_block_size]; > - type_precision* AL = new type_precision[n * l]; > - > - copy_vec(backupAL, AL, n * l); > - copy_vec(backupAL, A, n * l); > - > - > - int y_iters = y_amount/y_block_size; > - > - type_precision* Y; > - type_precision* backupAR; > - > - // printf("\n\n%%Computations\n%%"); > - > - > - get_ticks(start_tick); > - > - > - //! Generate S > - cblas_ssyrk(CblasColMajor, CblasUpper, CblasTrans, > - l, n, 1.0, backupAL, lda, 0.0, Stl, l); > - > - for (j = 0; j < y_iters; j++) > - { > - AIOfile.load_Yblock(&Y, y_block_size); > - > - //! Ay_top = AL'*Y > - cblas_sgemm(CblasColMajor, CblasTrans, CblasNoTrans, > - l, y_block_size, n, 1.0, AL, n, Y, n, 0.0, > - &Ay_top[j * l * y_block_size], l); > - } > - > - > - for (i = 0; i < a_iters; i++) > - { > - if (a_iters > 10 && (i%(a_iters/10)) == 0) > - { > - cout << "%" << flush; > - } > - > - > - AIOfile.load_ARblock(&backupAR, a_block_size); > - AIOfile.reset_Y(); > - copy_vec(backupAR, AR, n*r*a_block_size); > - > - // matlab_print_matrix("A", n, p, A); > - //! Generate Str > - cblas_sgemm(CblasColMajor, CblasTrans, CblasNoTrans, > - l, r * a_block_size, n, 1.0, AL, n, AR, n, 0.0, Str, l); > - > - type_precision Sbr[r*r*a_block_size]; > - > - #pragma omp parallel for default(shared) schedule(static) > - for (int ii= 0; ii < a_block_size; ii++) > - { > - //! Generate Sbr > - cblas_sgemm(CblasColMajor, CblasTrans, CblasNoTrans, > - r, r, n, 1.0, &AR[ii*r*n], n, &AR[ii*r*n], > - n, 0.0, &Sbr[ii*r*r], r); > - } > - > - type_precision Ay[y_block_size*p]; > - type_precision S[p*p]; > - > - > - for (j = 0; j < y_iters; j++) > - { > - if (a_iters < 10 && (y_iters < 10 || (j%(y_iters/10)) == 0)) > - { > - cout << "%" << flush; > - } > - > - > - AIOfile.load_Yblock(&Y, y_block_size); > - > - //! Ay_bot = AR'*Y > - cblas_sgemm(CblasColMajor, CblasTrans, CblasNoTrans, > - r * a_block_size, y_block_size, n, 1.0, AR, n, Y, n, > - 0.0, Ay_bot, r * a_block_size); > - > - #pragma omp parallel for private(S, Ay) default(shared) schedule(static) > - for (int ii= 0; ii < a_block_size; ii++) > - { > - // matlab_print_matrix("Y", n, y_block_size, Y); > - > - //! Rebuild AY > - > - for (int jj = 0; jj < y_block_size; jj++) > - { > - copy_vec(&Ay_top[j*l*y_block_size+jj*l], &Ay[jj*p], l); > - copy_vec(&Ay_bot[ii*r + jj*r*a_block_size], &Ay[l+jj*p], r); > - } > - > - type_precision* B = Ay; > - // matlab_print_matrix("Ay_top", l, y_block_size,&Ay_top[j*l*y_block_size]); > - // matlab_print_matrix("Ay_bot", r, y_block_size, Ay_bot); > - // matlab_print_matrix("Ay", p, y_block_size, Ay); > - > - //! Rebuild S > - build_S(S, Stl, &Str[ii*r*l], &Sbr[ii*r*r], l, r); > - // matlab_print_matrix("S", p, p, S); > - > - //! b = S\Ay > - info = LAPACKE_sposv(STORAGE_TYPE, 'U', p, y_block_size, > - S, p, Ay, p); > - // assert(info == 0,"POSV"); > - > - > - if (ForceCheck) > - { > - check_result(backupAL, &AR[ii * r * n], n, p, > - y_block_size, r, Y, B); > - } > - } > - } > - } > - > - get_ticks(end_tick); > - out.duration = ticks2sec(end_tick - start_tick, cpu_freq); > - // out.gflops = a_amount/1000.0*(n*l*r+n*r*r+y_amount*(n*r+p*p*p)))/1000.0/1000.0; > - out.gflops = gemm_flops(l, n, l, 0) + gemm_flops(l, n, y_amount, 0) + > - a_amount * (gemm_flops(l, n, r, 0) + > - gemm_flops(r, n, r, 0) + > - gemm_flops(r, n, y_amount, 0) + > - (y_amount/1000.0) * > - (p * p * p / 3.0) / 1000.0/1000.0); > - > - > - AIOfile.finalize(); > - > - delete []Ay_top; > - delete []Ay_bot; > - delete []A; > - delete []AL; > - delete []AR; > -} > - > - > -void Algorithm::partialNEQ(struct Settings params, struct Outputs &out) > -{ > - int max_threads = params.threads; > - > - > - srand(time(NULL)); > - > - > - blas_set_num_threads(max_threads); > - > - > - type_precision *Ytemp; > - lapack_int info, n, lda, ldy, l, r, k, p; > - > - int i, j, w; > - int m; > - > - cputime_type start_tick, start_tick2, end_tick; > - AIOfile.initialize(params); > - > - n = params.n; l = params.l; r = params.r; p = l+r; > - > - int y_amount = params.m; > - int y_block_size = params.mb;// kk > - > - int a_amount = params.t; > - int a_block_size = 1; > - > - int a_iters = a_amount/a_block_size; > - > - lda = n; ldy = n; > - k = p; > - > - > - > - type_precision* backupAL; > - > - AIOfile.load_AL(&backupAL); > - > - type_precision* S = new type_precision[p * p]; > - type_precision Stl[l * l]; > - type_precision Str[l * r]; > - type_precision Sbr[r * r]; > - type_precision* A = new type_precision[n * p]; > - type_precision* AL = A; > - type_precision* AR = &A[l * n]; > - > - copy_vec(backupAL, AL, n*l); > - > - > - int y_iters = y_amount / y_block_size; > - > - type_precision* Y; > - type_precision* backupAR; > - > - // printf("\n\n%%Computations\n%%"); > - > - get_ticks(start_tick); > - > - //! Generate S > - cblas_ssyrk(CblasColMajor, CblasUpper, CblasTrans, > - l, n, 1.0, backupAL, lda, 0.0, Stl, l); > - > - for (i = 0; i < a_iters; i++) > - { > - if (a_iters < 10 || (i%(a_iters/10)) == 0) > - { > - cout << "%" << flush; > - } > - > - AIOfile.load_ARblock(&backupAR, a_block_size); > - AIOfile.reset_Y(); > - copy_vec(backupAR, AR, n*r); > - > - // matlab_print_matrix("A", n, p, A); > - //! Generate Str > - cblas_sgemm(CblasColMajor, CblasTrans, CblasNoTrans, > - l, r, n, 1.0, AL, n, AR, n, 0.0, Str, l); > - > - //! Generate Sbr > - cblas_ssyrk(CblasColMajor, CblasUpper, CblasTrans, > - r, n, 1.0, backupAR, lda, 0.0, Sbr, r); > - > - > - > - // matlab_print_matrix("S", p, p, S); > - > - for (j = 0; j < y_iters; j++) > - { > - build_S(S, Stl, Str, Sbr, l, r); > - > - AIOfile.load_Yblock(&Y, y_block_size); > - type_precision Ay[y_block_size * p]; > - > - // matlab_print_matrix("Y", n, y_block_size, Y); > - > - //! Ay = A'*Y > - cblas_sgemm(CblasColMajor, CblasTrans, CblasNoTrans, > - p, y_block_size, n, 1.0, A, n, Y, n, 0.0, Ay, p); > - > - type_precision* B = Ay; > - // matlab_print_matrix("Ay", p, y_block_size, Ay); > - > - //! b = S\qy > - info = LAPACKE_sposv(STORAGE_TYPE, 'U', p, y_block_size, > - S, p, Ay, p); > - assert(info == 0, "POSV"); > - > - // matlab_print_matrix("B", p, y_block_size, B); > - // exit(0); > - if ( ForceCheck) > - { > - check_result(backupAL, backupAR, n, p, y_block_size, r, Y, B); > - } > - } // END for over j < y_iters > - } // END for over i < a_iters > - > - get_ticks(end_tick); > - out.duration = ticks2sec(end_tick - start_tick, cpu_freq); > - out.gflops = 2.0 * (n * l * l / 1000.0 + a_amount / 1000.0 * > - (n * l * r + n * r * r + > - y_amount * (p * n + p * p * p))) /1000.0 /1000.0; > - > - > - > - AIOfile.finalize(); > - > - delete []A; > - delete []S; > -} > - > - > -void Algorithm::fullNEQ(struct Settings params, struct Outputs &out) > -{ > - int max_threads = params.threads; > - > - > - srand(time(NULL)); > - > - > - blas_set_num_threads(max_threads); > - > - > - type_precision *Ytemp; > - lapack_int info, n, lda, ldy, l, r, k, p; > - > - int i, j, w; > - int m; > - > - cputime_type start_tick, start_tick2, end_tick; > - > - AIOfile.initialize(params); > - > - n = params.n; l = params.l; r = params.r; p = l+r; > - > - int y_amount = params.m; > - int y_block_size = params.mb;// kk > - > - int a_amount = params.t; > - int a_block_size = 1; > - > - int a_iters = a_amount/a_block_size; > - > - lda = n; ldy = n; > - k = p; > - > - > - > - type_precision* backupAL; > - > - AIOfile.load_AL(&backupAL); > - > - type_precision* S = new type_precision[p * p]; > - type_precision* Stemp = new type_precision[p * p]; > - type_precision* A = new type_precision[n * p]; > - type_precision* AL = A; > - type_precision* AR = &A[l * n]; > - > - int y_iters = y_amount / y_block_size; > - > - type_precision* Y; > - type_precision* backupAR; > - > - // printf("\n\n%%Computations\n%%"); > - > - get_ticks(start_tick); > - > - for (i = 0; i < a_iters; i++) > - { > - if (a_iters < 10 || (i%(a_iters/10)) == 0) > - { > - cout << "%" << flush; > - } > - > - copy_vec(backupAL, AL, n * l); > - > - AIOfile.load_ARblock(&backupAR, a_block_size); > - AIOfile.reset_Y(); > - copy_vec(backupAR, AR, n*r); > - > - // matlab_print_matrix("A", n, p, A); > - //! Generate S > - cblas_ssyrk(CblasColMajor, CblasUpper, CblasTrans, > - p, n, 1.0, A, lda, 0.0, S, p); > - // matlab_print_matrix("S", p, p, S); > - > - for (j = 0; j < y_iters; j++) > - { > - AIOfile.load_Yblock(&Y, y_block_size); > - type_precision Ay[y_block_size * p]; > - copy_vec(S, Stemp, p*p); > - > - // matlab_print_matrix("Y", n, y_block_size, Y); > - > - //! Ay = A'*Y > - cblas_sgemm(CblasColMajor, CblasTrans, CblasNoTrans, > - p, y_block_size, n, 1.0, A, n, Y, n, 0.0, Ay, p); > - > - type_precision* B = Ay; > - // matlab_print_matrix("Ay", p, y_block_size, Ay); > - > - //! b = S\qy > - info = LAPACKE_sposv(STORAGE_TYPE, 'U', p, y_block_size, > - Stemp, p, Ay, p); > - assert(info == 0, "POSV"); > - > - // matlab_print_matrix("B", p, y_block_size, B); > - // exit(0); > - if ( ForceCheck) > - { > - check_result(backupAL, backupAR, n, p, y_block_size, r, Y, B); > - } > - } > - } > - > - get_ticks(end_tick); > - out.duration = ticks2sec(end_tick - start_tick, cpu_freq); > - out.gflops = 2.0 * a_amount * (n * p * p / 1000.0 + y_amount / 1000.0 * > - (p * n + p * p * p))/1000.0/1000.0; > - > - > - AIOfile.finalize(); > - > - > - free(AL); > - delete []A; > - delete []S; > - delete []Stemp; > -} > - > - > -//!*************************************************!// > -void Algorithm::fullQR(struct Settings params, struct Outputs &out) > -{ > - int max_threads = params.threads; > - > - > - srand(time(NULL)); > - > - blas_set_num_threads(max_threads); > - > - > - > - cputime_type start_tick, start_tick2, end_tick; > - double acc_gemm = 0; > - double acc_trsm = 0; > - double acc_other = 0; > - double acc_atemp = 0; > - double acc_rtr = 0; > - double acc_rqr = 0; > - > - > - type_precision *Ytemp; > - lapack_int info, n, lda, ldy, l, r, k, p; > - > - int i, j, w; > - int m; > - > - AIOfile.initialize(params); > - > - n = params.n; l = params.l; r = params.r; p = l+r; > - > - int y_amount = params.m; > - int y_block_size = 1;// kk > - > - int a_amount = params.t; > - int a_block_size = 1; > - > - int a_iters = a_amount/a_block_size; > - > - lda = n; ldy = n; > - k = p; > - > - > - > - type_precision* backupAL; > - > - AIOfile.load_AL(&backupAL); > - > - type_precision* Q = new type_precision[n*p]; > - type_precision* A = Q; > - type_precision* AL = A; > - type_precision* AR = &A[l*n]; > - > - type_precision tau[k]; > - > - > - int y_iters = y_amount / y_block_size; > - > - > - type_precision* Y; > - type_precision* backupAR; > - > - > - > - // printf("\n\n%%Computations\n%%"); > - > - get_ticks(start_tick); > - for (i = 0; i < a_iters; i++) > - { > - if (a_iters < 10 || (i%(a_iters/10)) == 0) > - { > - cout << "%" << flush; > - } > - > - copy_vec(backupAL, AL, n*l); > - > - AIOfile.load_ARblock(&backupAR, a_block_size); > - AIOfile.reset_Y(); > - copy_vec(backupAR, AR, n*r); > - > - //! Generate R > - info = LAPACKE_sgeqrf(STORAGE_TYPE, n, p, A, lda, tau); > - assert(info == 0, "QR decomp"); > - type_precision* R = extract_R(A, n, p); > - > - //! generate Q > - info = LAPACKE_sorgqr(STORAGE_TYPE, n, p, k, Q, lda, tau); > - assert(info == 0, "Q form"); > - > - > - > -// matlab_print_matrix("ALL", n, l, backupAL); > -// matlab_print_matrix("ARR", n, r, backupAR); > - > - for (j = 0; j < y_iters; j++) > - { > - // matlab_print_matrix("RR", p, p, R); > - // matlab_print_matrix("QQ", n, p, Q); > - > - AIOfile.load_Yblock(&Y, y_block_size); > - type_precision Qy[y_block_size*p]; > - > - //! qy = Q'*Y > - cblas_sgemm(CblasColMajor, CblasTrans, CblasNoTrans, > - p, y_block_size, n, 1.0, Q, n, Y, n, 0.0, Qy, p); > - > - type_precision* B = Qy; > - > - //! b = R\qy > - cblas_strsm(CblasColMajor, CblasLeft, CblasUpper, > - CblasNoTrans, CblasNonUnit, > - p, y_block_size, 1.0, R, p, Qy, p); > - > - if (ForceCheck) > - { > - check_result(backupAL, backupAR, n, p, y_block_size, r, Y, B); > - } > - } > - > - free(R); > - } > - > - get_ticks(end_tick); > - out.duration = ticks2sec(end_tick - start_tick, cpu_freq); > - out.gflops = 2.0 * a_amount * > - (2.0 * n * p * p / 1000.0 + y_amount / 1000.0 * > - (p * n + p * p * p)) / 1000.0 / 1000.0; > - > - > - AIOfile.finalize(); > - > - > - free(AL); > - delete[] Q; > -} > - > - > -void Algorithm::partialQR(struct Settings params, struct Outputs &out) > -{ > - int max_threads = params.threads; > - > - > - srand(time(NULL)); > - > - blas_set_num_threads(max_threads); > - > - > - > - cputime_type start_tick, start_tick2, end_tick; > - double acc_gemm = 0; > - double acc_trsm = 0; > - double acc_other = 0; > - double acc_atemp = 0; > - double acc_rtr = 0; > - double acc_rqr = 0; > - > - > - type_precision *RL, *Ytemp, *RtlRtr; > - lapack_int info, n, lda, ldy, l, r, k, p; > - > - int i, j, w; > - int m; > - > - AIOfile.initialize(params); > - > - n = params.n; l = params.l; r = params.r; p = l+r; > - > - int y_amount = params.m; > - int y_block_size = params.mb;// kk > - > - int a_amount = params.t; > - int a_block_size = 1; > - > - int a_iters = a_amount/a_block_size; > - > - lda = n; ldy = n; > - k = l; > - > - > - > - type_precision* backupAL; > - > - AIOfile.load_AL(&backupAL); > - > - type_precision* Q = new type_precision[n*p]; > - type_precision* AL = Q; > - copy_vec(backupAL, AL, n*l); > - > - > - type_precision tau[k]; > - > - type_precision* QL; > - type_precision* QR = &Q[n*l]; > - > - int y_iters = y_amount / y_block_size; > - > - > - type_precision* Y; > - > - type_precision Rtr[l*r]; > - type_precision* Ar; > - type_precision Rbr[r*r]; > - > - get_ticks(start_tick); > - //! Generate RTL > - info = LAPACKE_sgeqrf(STORAGE_TYPE, n, l, AL, lda, tau); > - assert(info == 0, "QR decomp"); > - > - type_precision* R =prepare_R(AL, n, l, r); > - type_precision* Rtl = R; > - > - QL = AL;// same as Q > - AL = backupAL; > - //! generate QL > - info = LAPACKE_sorgqr(STORAGE_TYPE, n, l, k, QL, lda, tau); > - > - assert(info == 0, "Q form"); > - > - // printf("\n\n%%Computations\n%%"); > - > - > - for (i = 0; i < a_iters; i++) > - { > - if (a_iters < 10 || (i%(a_iters/10)) == 0) > - { > - cout << "%" << flush; > - } > - > - AIOfile.load_ARblock(&Ar, a_block_size); > - AIOfile.reset_Y(); > - > - //! Rtr = Q1'*AR > - cblas_sgemm(CblasColMajor, CblasTrans, CblasNoTrans, > - l, r*a_block_size, n, 1.0, QL, n, Ar, n, 0.0, Rtr, l); > - > - type_precision* Atemp = replicate_vec(Ar, n*r*a_block_size); > - > - //! Atemp = AR-Q1*Rtr > - cblas_sgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, > - n, r*a_block_size, l, -1.0, QL, n, Rtr, l, 1.0, Atemp, n); > - > - type_precision* QrRbr = QR; > - copy_vec(Atemp, QrRbr, n*r); > - info = LAPACKE_sgeqrf(STORAGE_TYPE, n, r, QrRbr, lda, tau); > - assert(info == 0, "QR decomp of QrRbr"); > - > - // reuse of old function > - type_precision* Rbrtemp = prepare_R(QrRbr, n, r, 0); > - > - copy_vec(Rbrtemp, Rbr, r*r); > - info = LAPACKE_sorgqr(STORAGE_TYPE, n, r, r, QrRbr, lda, tau); > - assert(info == 0, "QR form"); > - free(Rbrtemp); > - > - update_R(R, Rtr, Rbr, p, p, r); > - > -// matlab_print_matrix("RL", p, l, Rtl); > -// matlab_print_matrix("Rtr", l, r, Rtr); > -// matlab_print_matrix("Rbr", r, r, Rbr); > -// matlab_print_matrix("RR", p, p, R); > -// matlab_print_matrix("QQ", n, p, Q); > - // matlab_print_matrix("ALL", n, l, AL); > - // matlab_print_matrix("ARR", n, r, Ar); > - // matlab_print_matrix("R", p, p, R); > - int top_idx = 0; > - > - for (j = 0; j < y_iters; j++) > - { > - AIOfile.load_Yblock(&Y, y_block_size); > - type_precision Qy[y_block_size*p]; > - > - > - //! qy = Q'*Y > - cblas_sgemm(CblasColMajor, CblasTrans, CblasNoTrans, > - p, y_block_size, n, 1.0, Q, n, Y, n, 0.0, Qy, p); > - > - type_precision* B = Qy; > - > - //! b = R\qy > - cblas_strsm(CblasColMajor, CblasLeft, CblasUpper, > - CblasNoTrans, CblasNonUnit, > - p, y_block_size, 1.0, R, p, Qy, p); > - > - // matlab_print_matrix("bcomp", p, y_block_size, B); > - > - > - if ( ForceCheck) > - { > - check_result(AL, Ar, n, p, y_block_size, r, Y, B); > - } > - } > - > - free(Atemp); > - } > - > - > - get_ticks(end_tick); > - out.duration = ticks2sec(end_tick - start_tick, cpu_freq); > - out.gflops = 2.0*(n*l*l/1000.0 + a_amount * > - (2.0 * n * l * r / 1000.0 + > - n * r * r / 1000.0 + > - y_amount / 1000.0 * (p * n + p * p * p))) / > - 1000.0 / 1000.0; > - > - > - AIOfile.finalize(); > - > - > - free(Rtl); > - free(AL); > - delete[] Q; > -} > - > - > -void Algorithm::partialQR_Blocked_Rtl(struct Settings params, > - struct Outputs &out) > -{ > - int max_threads = params.threads; > - > - // srand (time(NULL)); > - > - int cpu_cores = max_threads; > - > - > - blas_set_num_threads(max_threads); > - omp_set_num_threads(max_threads); > - > - > - > - > - cputime_type start_tick, start_tick2, end_tick; > - double acc_pre = 0; > - double acc_trsm = 0; > - double acc_other = 0; > - double acc_atemp = 0; > - double acc_rtr = 0; > - double acc_rqr = 0; > - double acc_RTL_QLY = 0; > - > - > - type_precision *AL, *RL, *RQy_top, *Ytemp, *RtlRtr; > - lapack_int info, n, lda, ldy, l, r, k, p; > - > - int i, j, w; > - int m; > - > - > - AIOfile.initialize(params); > - > - n = params.n; l = params.l; r = params.r; p = l+r; > - > - > - > - double lvl_3_cache_size = 6; > - > - > - int y_amount = params.t; > - int y_block_size = params.tb;// kk > - > - int a_amount = params.m; > - int a_block_size = params.mb; > - > - int a_iters = (a_amount + a_block_size - 1) / a_block_size; > - > - int y_iters = (y_amount+ y_block_size - 1)/y_block_size; > - > - int qy_idx = 0; > - > - out.gflops = n/1000.0*l/1000.0*l/1000.0 + > - gemm_flops(l, n, y_amount, 0) + > - y_amount*l/1000.0*l/1000.0/1000.0 + > - a_amount * (gemm_flops(l, n, r, 0) + > - l/1000.0*l/1000.0/1000.0 + > - gemm_flops(n, l, r, 1) + > - n/1000.0*r/1000.0*r/1000.0 + > - gemm_flops(r, n, y_amount, 0) + > - y_amount/1000.0*r/1000.0*r/1000.0 + > - y_amount/1000.0*l/1000.0/1000.0); > - > - int sch_block_size = max(1.0, > - min((double)a_block_size / (double)max_threads, > - (1.0*1000*1000) / > - (double)((sizeof(type_precision) * n * r)))); > - > - // cout << endl<< "taskChunk "<< sch_block_size < - > - lda = n; ldy = n; > - k = l; > - > - AIOfile.load_AL(&AL); > - > - type_precision* backupAL = replicate_vec(AL, n*l); > - > - > - > - RQy_top = new type_precision[l*y_amount]; > - > - type_precision* Bfinal = (type_precision*)malloc(max_threads * p * > - y_block_size * > - sizeof(type_precision)); > - > - type_precision tau[k]; > - > - type_precision* QL; > - > - type_precision* Rtr = (type_precision*)malloc(l * r * a_block_size * > - sizeof(type_precision)); > - type_precision* Qy_bot = (type_precision*)malloc(a_block_size * > - y_block_size * r * > - sizeof(type_precision)); > - > - type_precision* B_top = new type_precision[max_threads*y_block_size*l]; > - type_precision* B_bot = new type_precision[max_threads*y_block_size*r]; > - > - type_precision* Ar; > - type_precision Rbr[r*r*a_block_size]; > - > - > - > - // printf("\n\n%%Computations\n%%"); > - for (i = 0; i < a_iters; i++) > - { > - if (a_iters >= 10 && (i%(a_iters/10)) == 0) > - { > - // cout << "*" << flush; > - } > - > - for (j = 0; j < y_iters; j++) > - { > - if (a_iters < 10 && (y_iters < 10 || (j%(y_iters/10)) == 0)) > - { > - // cout << "*" << flush; > - } > - } > - } > - cout << endl; > - > - > - //! Start of Computations > - > - get_ticks(start_tick); > - > - > - info = LAPACKE_sgeqrf(STORAGE_TYPE, n, l, AL, lda, tau); > - assert(info == 0, "QR decomp"); > - > - type_precision* Rtl = prepare_R(AL, n, l, 0); > - > - QL = AL; > - AL = backupAL; > - > - info = LAPACKE_sorgqr(STORAGE_TYPE, n, l, k, QL, lda, tau); > - > - assert(info == 0, "Q form"); > - > - matlab_print_matrix("QL", n, l, QL); > - > - qy_idx = 0; > - > - // printf("\n%%Preparing IO\n"); > - //! Prepare File for the Y > - > - > - type_precision* Y; > - > - // #pragma omp parallel default(shared) > +// int max_threads = params.threads; > +// > +// srand(time(NULL)); > +// > +// blas_set_num_threads(max_threads); > +// > +// type_precision *Ytemp; > +// lapack_int info, n, lda,ldy, l, r, p; > +// > +// int i,k; > +// > +// cputime_type start_tick, start_tick2, end_tick; > +// > +// AIOfile.initialize(params); > +// > +// n = params.n; l = params.l; r = params.r; p = l+r; > +// > +// int y_amount = params.m; > +// int y_block_size = params.mb; // kk > +// > +// int a_amount = params.t; > +// int a_block_size = params.tb; > +// > +// int a_iters = (a_amount + a_block_size - 1) / a_block_size; > +// > +// lda = n; ldy = n; > +// k = p; > +// > +// > +// > +// type_precision* backupAL; > +// > +// AIOfile.load_AL(&backupAL); > +// > +// > +// type_precision Stl[l * l]; > +// type_precision Str[l * r * a_block_size]; > +// > +// > +// type_precision* Ay_top = new type_precision[l * y_amount]; > +// type_precision* Ay_bot = new type_precision[y_block_size * a_block_size * r]; > +// type_precision* A = new type_precision[n * p]; > +// type_precision* AR = new type_precision[n * r * a_block_size]; > +// type_precision* AL = new type_precision[n * l]; > +// > +// copy_vec(backupAL, AL, n * l); > +// copy_vec(backupAL, A, n * l); > +// > +// > +// int y_iters = y_amount/y_block_size; > +// > +// type_precision* Y; > +// type_precision* backupAR; > +// > +// // printf("\n\n%%Computations\n%%"); > +// > +// > +// get_ticks(start_tick); > +// > +// > +// //! Generate S > +// cblas_ssyrk(CblasColMajor, CblasUpper, CblasTrans, > +// l, n, 1.0, backupAL, lda, 0.0, Stl, l); > +// > +// for (int j = 0; j < y_iters; j++) > // { > -// // #pragma omp for private(Y, y_block_size, qy_idx) nowait schedule(static, 1) > +// AIOfile.load_Yblock(&Y, y_block_size); > +// > +// //! Ay_top = AL'*Y > +// cblas_sgemm(CblasColMajor, CblasTrans, CblasNoTrans, > +// l, y_block_size, n, 1.0, AL, n, Y, n, 0.0, > +// &Ay_top[j * l * y_block_size], l); > +// } > +// > +// > +// for (int i = 0; i < a_iters; i++) > +// { > +// if (a_iters > 10 && (i%(a_iters/10)) == 0) > +// { > +// cout << "%" << flush; > +// } > +// > +// > +// AIOfile.load_ARblock(&backupAR, a_block_size); > +// AIOfile.reset_Y(); > +// copy_vec(backupAR, AR, n*r*a_block_size); > +// > +// // matlab_print_matrix("A", n, p, A); > +// //! Generate Str > +// cblas_sgemm(CblasColMajor, CblasTrans, CblasNoTrans, > +// l, r * a_block_size, n, 1.0, AL, n, AR, n, 0.0, Str, l); > +// > +// type_precision Sbr[r*r*a_block_size]; > +// > +// #pragma omp parallel for default(shared) schedule(static) > +// for (int ii= 0; ii < a_block_size; ii++) > +// { > +// //! Generate Sbr > +// cblas_sgemm(CblasColMajor, CblasTrans, CblasNoTrans, > +// r, r, n, 1.0, &AR[ii*r*n], n, &AR[ii*r*n], > +// n, 0.0, &Sbr[ii*r*r], r); > +// } > +// > +// type_precision Ay[y_block_size*p]; > +// type_precision S[p*p]; > +// > +// > // for (int j = 0; j < y_iters; j++) > // { > -// // qy_idx = j*y_block_size*l; > -// // #pragma omp critical > -// {AIOfile.load_Yblock(&Y, y_block_size);} > +// if (a_iters < 10 && (y_iters < 10 || (j%(y_iters/10)) == 0)) > +// { > +// cout << "%" << flush; > +// } > // > -// //! qy_top = QL'*Y > +// > +// AIOfile.load_Yblock(&Y, y_block_size); > +// > +// //! Ay_bot = AR'*Y > // cblas_sgemm(CblasColMajor, CblasTrans, CblasNoTrans, > -// l, y_block_size, n, 1.0, QL, n, Y, n, 0.0,&RQy_top[qy_idx], l); > +// r * a_block_size, y_block_size, n, 1.0, AR, n, Y, n, > +// 0.0, Ay_bot, r * a_block_size); > // > -// //! K | RtlQlY =RTL\qy_top > -// cblas_strsm(CblasColMajor, CblasLeft, CblasUpper, CblasNoTrans, CblasNonUnit, > -// l, y_block_size, 1.0, Rtl, l,&RQy_top[qy_idx], l); > -// qy_idx += y_block_size*l; > +// #pragma omp parallel for private(S, Ay) default(shared) schedule(static) > +// for (int ii= 0; ii < a_block_size; ii++) > +// { > [TRUNCATED] > > To get the complete diff run: > svnlook diff /svnroot/genabel -r 1609 > _______________________________________________ > Genabel-commits mailing list > Genabel-commits at lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-commits > -- *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* L.C. Karssen Utrecht The Netherlands lennart at karssen.org http://blog.karssen.org GPG key ID: A88F554A -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 230 bytes Desc: OpenPGP digital signature URL: From lennart at karssen.org Sat Feb 15 23:12:32 2014 From: lennart at karssen.org (L.C. Karssen) Date: Sat, 15 Feb 2014 23:12:32 +0100 Subject: [GenABEL-dev] [Genabel-commits] r1612 - in branches/ProbABEL-0.50: checks/R-tests src In-Reply-To: <20140215213914.9A9001803B5@r-forge.r-project.org> References: <20140215213914.9A9001803B5@r-forge.r-project.org> Message-ID: <52FFE650.3010102@karssen.org> Thanks Maarten. Good to see you're not only improving the code, but also stick to the coding guidelines. Enjoy the weekend, Lennart. On 15-02-14 22:39, noreply at r-forge.r-project.org wrote: > Author: maartenk > Date: 2014-02-15 22:39:14 +0100 (Sat, 15 Feb 2014) > New Revision: 1612 > > Modified: > branches/ProbABEL-0.50/checks/R-tests/run_models_in_R_palinear.R > branches/ProbABEL-0.50/src/command_line_settings.cpp > branches/ProbABEL-0.50/src/command_line_settings.h > branches/ProbABEL-0.50/src/data.cpp > branches/ProbABEL-0.50/src/data.h > branches/ProbABEL-0.50/src/main.cpp > branches/ProbABEL-0.50/src/main_functions_dump.cpp > branches/ProbABEL-0.50/src/maskedmatrix.cpp > branches/ProbABEL-0.50/src/maskedmatrix.h > branches/ProbABEL-0.50/src/reg1.cpp > branches/ProbABEL-0.50/src/reg1.h > Log: > -Fixed typo in run_models_in_R_palinear.R in a variable name (test will now succeed) > -Comment out 2 unused functions (getProgramName andNmeasured ) made todo's to remove them in the future > -Solved some cpplint and cppcheck warnings > > > Modified: branches/ProbABEL-0.50/checks/R-tests/run_models_in_R_palinear.R > =================================================================== > --- branches/ProbABEL-0.50/checks/R-tests/run_models_in_R_palinear.R 2014-02-14 14:14:21 UTC (rev 1611) > +++ branches/ProbABEL-0.50/checks/R-tests/run_models_in_R_palinear.R 2014-02-15 21:39:14 UTC (rev 1612) > @@ -123,7 +123,7 @@ > } > colnames(prob.2df.R) <- cols2df > rownames(prob.2df.R) <- NULL > -#stopifnot( all.equal(prob.2df.PA1[1:5,], prob.2df.R[1:5,], tol=tol) ) > +stopifnot( all.equal(prob.2df.PA[1:5,], prob.2df.R[1:5,], tol=tol) ) > cat("2df\n") > > cat("\t\t\t\t\t\tOK\n") > > Modified: branches/ProbABEL-0.50/src/command_line_settings.cpp > =================================================================== > --- branches/ProbABEL-0.50/src/command_line_settings.cpp 2014-02-14 14:14:21 UTC (rev 1611) > +++ branches/ProbABEL-0.50/src/command_line_settings.cpp 2014-02-15 21:39:14 UTC (rev 1612) > @@ -120,12 +120,12 @@ > { > return outfilename; > } > +//TODO(unknown) This function is not used. Remove in near future > +//char* cmdvars::getProgramName() const > +//{ > +// return program_name; > +//} > > -char* cmdvars::getProgramName() const > -{ > - return program_name; > -} > - > int cmdvars::getRobust() const > { > return robust; > > Modified: branches/ProbABEL-0.50/src/command_line_settings.h > =================================================================== > --- branches/ProbABEL-0.50/src/command_line_settings.h 2014-02-14 14:14:21 UTC (rev 1611) > +++ branches/ProbABEL-0.50/src/command_line_settings.h 2014-02-15 21:39:14 UTC (rev 1612) > @@ -116,7 +116,8 @@ > int getNoutcomes() const; > int getNpeople() const; > string getOutfilename() const; > - char* getProgramName() const; > +//TODO(unknown) This function is not used. Remove in near future > +// char* getProgramName() const; > int getRobust() const; > int getScore() const; > string getSep() const; > > Modified: branches/ProbABEL-0.50/src/data.cpp > =================================================================== > --- branches/ProbABEL-0.50/src/data.cpp 2014-02-14 14:14:21 UTC (rev 1611) > +++ branches/ProbABEL-0.50/src/data.cpp 2014-02-15 21:39:14 UTC (rev 1612) > @@ -47,49 +47,45 @@ > #endif > #include "utilities.h" > > +//TODO(unknown) This function is not used. Remove in near future > +//unsigned int Nmeasured(char * fname, int nphenocols, int npeople) > +//{ > +//// first pass -- find unmeasured people > +// std::ifstream infile(fname); > +// if (!infile) > +// { > +// std::cerr << "Nmeasured: cannot open file " << fname << endl; > +// } > +// char tmp[100]; > +// > +// for (int i = 0; i < nphenocols; i++) > +// { > +// infile >> tmp; > +// } > +// > +// unsigned short int * allmeasured = new unsigned short int[npeople]; > +// int nids = 0; > +// for (int i = 0; i < npeople; i++) > +// { > +// allmeasured[i] = 1; > +// infile >> tmp; > +// for (int j = 1; j < nphenocols; j++) > +// { > +// infile >> tmp; > +// if (tmp[0] == 'N' || tmp[0] == 'n') > +// allmeasured[i] = 0; > +// } > +// if (allmeasured[i] == 1) > +// nids++; > +// } > +// infile.close(); > +// > +// delete[] allmeasured; > +// > +// return (nids); > +//} > > -unsigned int Nmeasured(char * fname, int nphenocols, int npeople) > -{ > -//TODO: unused variables remove them for good if there is no reason to keep them > -//int ncov = nphenocols - 2; > -//int nids_all = npeople; > > -// first pass -- find unmeasured people > - std::ifstream infile(fname); > - if (!infile) > - { > - std::cerr << "Nmeasured: cannot open file " << fname << endl; > - } > - char tmp[100]; > - > - for (int i = 0; i < nphenocols; i++) > - { > - infile >> tmp; > - } > - > - unsigned short int * allmeasured = new unsigned short int[npeople]; > - int nids = 0; > - for (int i = 0; i < npeople; i++) > - { > - allmeasured[i] = 1; > - infile >> tmp; > - for (int j = 1; j < nphenocols; j++) > - { > - infile >> tmp; > - if (tmp[0] == 'N' || tmp[0] == 'n') > - allmeasured[i] = 0; > - } > - if (allmeasured[i] == 1) > - nids++; > - } > - infile.close(); > - > - delete[] allmeasured; > - > - return (nids); > -} > - > - > /** > * Read SNP information from an mlinfo file generated by the > * imputation software. > @@ -269,5 +265,3 @@ > { > return matrix; > } > - > -//________________________________________Maksim_end > > Modified: branches/ProbABEL-0.50/src/data.h > =================================================================== > --- branches/ProbABEL-0.50/src/data.h 2014-02-14 14:14:21 UTC (rev 1611) > +++ branches/ProbABEL-0.50/src/data.h 2014-02-15 21:39:14 UTC (rev 1612) > @@ -31,8 +31,8 @@ > #include > > extern bool is_interaction_excluded; > - > -unsigned int Nmeasured(char * fname, int nphenocols, int npeople); > +//TODO(unknown) This function is not used. Remove in near future > +//unsigned int Nmeasured(char * fname, int nphenocols, int npeople); > #include "phedata.h" > #include "gendata.h" > > @@ -80,4 +80,4 @@ > ~InvSigma(); > }; > > -#endif /* DATA_H_ */ > +#endif//DATA_H_ > > Modified: branches/ProbABEL-0.50/src/main.cpp > =================================================================== > --- branches/ProbABEL-0.50/src/main.cpp 2014-02-14 14:14:21 UTC (rev 1611) > +++ branches/ProbABEL-0.50/src/main.cpp 2014-02-15 21:39:14 UTC (rev 1612) > @@ -151,7 +151,7 @@ > #if LOGISTIC > logistic_reg nrd = logistic_reg(nrgd); > > - nrd.estimate( 0, MAXITER, EPS, 0, > + nrd.estimate(0, MAXITER, EPS, 0, > input_var.getInteraction(), > input_var.getNgpreds(), > invvarmatrix, > @@ -163,7 +163,7 @@ > #if DEBUG > std::cout << "[DEBUG] linear_reg nrd = linear_reg(nrgd); DONE."; > #endif > - nrd.estimate( 0, CHOLTOL, 0, input_var.getInteraction(), > + nrd.estimate(0, CHOLTOL, 0, input_var.getInteraction(), > input_var.getNgpreds(), invvarmatrix, > input_var.getRobust(), 1); > #elif COXPH > @@ -199,7 +199,8 @@ > { > create_header(outfile, input_var, phd, interaction_cox); > } > - } else // Dosage data: Only additive model => only one output file > + } > + else // Dosage data: Only additive model => only one output file > { > outfile.push_back( > new std::ofstream((outfilename_str + "_add.out.txt").c_str())); > @@ -278,8 +279,7 @@ > write_mlinfo(outfile, file, mli, csnp, input_var, > rgd.gcount, rgd.freq); > } > - } else > - { > + } else{ > // Dosage data: only additive model > int file = 0; > write_mlinfo(outfile, file, mli, csnp, input_var, > @@ -304,7 +304,7 @@ > } > else > { > - rd.estimate( 0, MAXITER, EPS, model, > + rd.estimate(0, MAXITER, EPS, model, > input_var.getInteraction(), > input_var.getNgpreds(), > invvarmatrix, > @@ -321,7 +321,7 @@ > } > else > { > - rd.estimate( 0, CHOLTOL, model, > + rd.estimate(0, CHOLTOL, model, > input_var.getInteraction(), > input_var.getNgpreds(), > invvarmatrix, > @@ -405,7 +405,7 @@ > regdata new_rgd = rgd; > new_rgd.remove_snp_from_X(); > linear_reg new_null_rd(new_rgd); > - new_null_rd.estimate( 0, > + new_null_rd.estimate(0, > CHOLTOL, model, > input_var.getInteraction(), > input_var.getNgpreds(), > @@ -416,7 +416,7 @@ > regdata new_rgd = rgd; > new_rgd.remove_snp_from_X(); > logistic_reg new_null_rd(new_rgd); > - new_null_rd.estimate( 0, MAXITER, EPS, > + new_null_rd.estimate(0, MAXITER, EPS, > model, > input_var.getInteraction(), > input_var.getNgpreds(), > @@ -440,8 +440,7 @@ > // No missing SNP data, we can compute the LRT > *chi2[model] << 2. * (loglik - null_loglik); > } > - } else > - { > + } else{ > // We want score test output > *chi2[model] << rd.chi2_score; > } > @@ -481,8 +480,7 @@ > if (input_var.getNgpreds() == 0) > { > end_pos = rgd.X.ncol; > - } else > - { > + } else{ > end_pos = rgd.X.ncol - 1; > } > > @@ -511,16 +509,15 @@ > *covvalue[model] << "nan" > << input_var.getSep() > << "nan"; > - } else > - { > + } else{ > *covvalue[model] << "nan"; > } > } > #endif > // Oct 26, 2009 > *chi2[model] << "nan"; > - } else > - { // ngpreds==1 (and SNP is rare) > + } else{ > + // ngpreds==1 (and SNP is rare) > if (input_var.getInverseFilename() == NULL) > { > // Han Chen > > Modified: branches/ProbABEL-0.50/src/main_functions_dump.cpp > =================================================================== > --- branches/ProbABEL-0.50/src/main_functions_dump.cpp 2014-02-14 14:14:21 UTC (rev 1611) > +++ branches/ProbABEL-0.50/src/main_functions_dump.cpp 2014-02-15 21:39:14 UTC (rev 1612) > @@ -417,8 +417,7 @@ > if (input_var.getNgpreds() == 2) > { > start_pos = number_of_rows_or_columns - 2; > - } else > - { > + } else{ > start_pos = number_of_rows_or_columns - 1; > } > } else if (!input_var.getAllcov() && model == 0 > @@ -427,8 +426,7 @@ > if (input_var.getNgpreds() == 2) > { > start_pos = number_of_rows_or_columns - 4; > - } else > - { > + } else{ > start_pos = number_of_rows_or_columns - 2; > } > } else if (!input_var.getAllcov() && model != 0 > @@ -439,8 +437,7 @@ > && input_var.getInteraction() != 0) > { > start_pos = number_of_rows_or_columns - 2; > - } else > - { > + } else{ > start_pos = 0; > } > > > Modified: branches/ProbABEL-0.50/src/maskedmatrix.cpp > =================================================================== > --- branches/ProbABEL-0.50/src/maskedmatrix.cpp 2014-02-14 14:14:21 UTC (rev 1611) > +++ branches/ProbABEL-0.50/src/maskedmatrix.cpp 2014-02-15 21:39:14 UTC (rev 1612) > @@ -26,6 +26,9 @@ > */ > > > + > + > +#include > #include "maskedmatrix.h" > #if EIGEN > #include "eigen_mematrix.h" > @@ -47,11 +50,8 @@ > // matrix_original = M; > masked_data = &matrix_original; > mask_of_old = new unsigned short int[M.nrow]; > - std::fill (mask_of_old,mask_of_old+M.nrow,0); > - //TODO:set length of mask for all types > + std::fill(mask_of_old, mask_of_old+M.nrow, 0); > length_of_mask = M.nrow; > - //TODO:set type (row,column,symmetric) > - //type="symmetric"; > } > > void masked_matrix::set_matrix(const mematrix &M) > @@ -59,11 +59,8 @@ > matrix_original = M; > masked_data = &matrix_original; > mask_of_old = new unsigned short int[M.nrow]; > - std::fill (mask_of_old,mask_of_old+M.nrow,0); > - //TODO:set length of mask for all types > + std::fill(mask_of_old, mask_of_old+M.nrow, 0); > length_of_mask = M.nrow; > - //TODO:set type (row,column,symmetric) > - //type="symmetric"; > } > > masked_matrix::~masked_matrix() > @@ -85,7 +82,7 @@ > else > { > //Check update mask is the same as old matrix > - if (std::equal (newmask, newmask+length_of_mask, mask_of_old)) > + if (std::equal(newmask, newmask+length_of_mask, mask_of_old)) > { > //new mask is the same as old matrix > masked_data = &matrix_masked_data; > @@ -94,7 +91,7 @@ > { > // new mask differs from old matrix and create new. > // mask_of_old = newmask; > - std::copy(newmask, newmask+length_of_mask,mask_of_old); > + std::copy(newmask, newmask+length_of_mask, mask_of_old); > mask_symmetric(nmeasured); > masked_data = &matrix_masked_data; > } > > Modified: branches/ProbABEL-0.50/src/maskedmatrix.h > =================================================================== > --- branches/ProbABEL-0.50/src/maskedmatrix.h 2014-02-14 14:14:21 UTC (rev 1611) > +++ branches/ProbABEL-0.50/src/maskedmatrix.h 2014-02-15 21:39:14 UTC (rev 1612) > @@ -55,4 +55,4 @@ > void mask_symmetric(int nmeasured); > }; > > -#endif /* MASKEDMATRIX_H_ */ > +#endif//MASKEDMATRIX_H_ > > Modified: branches/ProbABEL-0.50/src/reg1.cpp > =================================================================== > --- branches/ProbABEL-0.50/src/reg1.cpp 2014-02-14 14:14:21 UTC (rev 1611) > +++ branches/ProbABEL-0.50/src/reg1.cpp 2014-02-15 21:39:14 UTC (rev 1612) > @@ -91,14 +91,14 @@ > { > col_new++; > nX_without_interact_phe[row > - * nX_without_interact_phe.ncol + col_new] = > + * nX_without_interact_phe.ncol + col_new] = > nX[row * nX.ncol + col]; > } > if (col != interaction - 1 && iscox) > { > col_new++; > nX_without_interact_phe[row > - * nX_without_interact_phe.ncol + col_new] = > + * nX_without_interact_phe.ncol + col_new] = > nX[row * nX.ncol + col]; > } > } // interaction_only, model==0, ngpreds==2 > @@ -148,14 +148,14 @@ > { > col_new++; > nX_without_interact_phe[row > - * nX_without_interact_phe.ncol + col_new] = > + * nX_without_interact_phe.ncol + col_new] = > nX[row * nX.ncol + col]; > } > if (col != interaction - 1 && iscox) > { > col_new++; > nX_without_interact_phe[row > - * nX_without_interact_phe.ncol + col_new] = > + * nX_without_interact_phe.ncol + col_new] = > nX[row * nX.ncol + col]; > } > } > @@ -311,7 +311,7 @@ > } > > > -void linear_reg::estimate( int verbose, double tol_chol, > +void linear_reg::estimate(int verbose, double tol_chol, > int model, int interaction, int ngpreds, masked_matrix& invvarmatrixin, > int robust, int nullmodel) { > // suda interaction parameter > @@ -357,7 +357,7 @@ > double sigma2_internal; > > #if EIGEN > - LDLT Ch ; > + LDLT Ch; > #else > mematrix tXX_i; > #endif > @@ -373,13 +373,15 @@ > //Oct 26, 2009 > > #if EIGEN > - MatrixXd tXW = X.data.transpose() * invvarmatrixin.masked_data->data; // flops 5997000 > + // next line is 5997000 flops > + MatrixXd tXW = X.data.transpose() * invvarmatrixin.masked_data->data; > Ch = LDLT (tXW * X.data); // 17991 flops > - beta.data = Ch.solve(tXW * reg_data.Y.data); > - sigma2 = (reg_data.Y.data - tXW.transpose() * beta.data).squaredNorm() ; //flops: 1000+5000+3000 > + beta.data = Ch.solve(tXW * reg_data.Y.data);//5997 flops > + //next line is: 1000+5000+3000= 9000 flops > + sigma2 = (reg_data.Y.data - tXW.transpose() * beta.data).squaredNorm(); > #else > - > - mematrix tXW = transpose(X) * invvarmatrixin.masked_data; // flops 5997000 > + // next line is 5997000 flops > + mematrix tXW = transpose(X) * invvarmatrixin.masked_data; > tXX_i = tXW * X; // 17991 flops > // use cholesky to invert > cholesky2_mm(tXX_i, tol_chol); > @@ -387,11 +389,12 @@ > beta = tXX_i * (tXW * reg_data.Y); // flops 15+5997 > // now compute residual variance > sigma2 = 0.; > + //next line is: 1000+5000+= 6000 flops > mematrix sigma2_matrix = reg_data.Y - (transpose(tXW) * beta); //flops: 1000+5000 > for (int i = 0; i < sigma2_matrix.nrow; i++) > { > double val = sigma2_matrix.get(i, 0); > - sigma2 += val * val; // flops: 3000 > + sigma2 += val * val; // flops: 3000 (iterations counted) > } > #endif > double N = X.nrow; > @@ -409,9 +412,9 @@ > int m = X.ncol; > MatrixXd txx = MatrixXd(m, m).setZero().selfadjointView().\ > rankUpdate(X.data.adjoint()); > - Ch=LDLT (txx.selfadjointView()); > - beta.data= Ch.solve(X.data.adjoint() * reg_data.Y.data); > - sigma2 = (reg_data.Y.data - (X.data * beta.data)).squaredNorm() ; > + Ch = LDLT (txx.selfadjointView()); > + beta.data = Ch.solve(X.data.adjoint() * reg_data.Y.data); > + sigma2 = (reg_data.Y.data - (X.data * beta.data)).squaredNorm(); > > #else > mematrix tX = transpose(X); > @@ -431,7 +434,7 @@ > } > #endif > double N = static_cast(X.nrow); > - double P=static_cast(length_beta); > + double P = static_cast(length_beta); > sigma2_internal = sigma2 / (N - P); > sigma2 /= N; > } > @@ -456,16 +459,16 @@ > > #if EIGEN > double intercept = beta.get(0, 0); > - residuals.data= reg_data.Y.data.array()-intercept; > + residuals.data = reg_data.Y.data.array()-intercept; > //matrix. > - ArrayXXd betacol = beta.data.block(1,0,beta.data.rows()-1,1)\ > + ArrayXXd betacol = beta.data.block(1, 0, beta.data.rows()-1, 1)\ > .array().transpose(); > - ArrayXXd resid_sub = (X.data.block(0,1,X.data.rows(),X.data.cols()-1)\ > - *betacol.matrix().asDiagonal()).rowwise().sum() ; > + ArrayXXd resid_sub = (X.data.block(0, 1, X.data.rows(), X.data.cols()-1)\ > + *betacol.matrix().asDiagonal()).rowwise().sum(); > //std::cout << resid_sub << std::endl; > - residuals.data-=resid_sub.matrix(); > + residuals.data -= resid_sub.matrix(); > //residuals[i] -= resid_sub; > - loglik-=(residuals.data.array().square()*halfrecsig2).sum(); > + loglik -= (residuals.data.array().square()*halfrecsig2).sum(); > > //loglik -= halfrecsig2 * residuals[i] * residuals[i]; > > @@ -483,7 +486,7 @@ > > loglik -= static_cast(reg_data.nids) * log(sqrt(sigma2)); > #if EIGEN > - MatrixXd tXX_inv=Ch.solve(MatrixXd(length_beta, length_beta). > + MatrixXd tXX_inv = Ch.solve(MatrixXd(length_beta, length_beta). > Identity(length_beta,length_beta)); > #endif > > @@ -512,7 +515,6 @@ > > #endif > > - > } > //cout << "estimate 0\n"; > #if EIGEN > @@ -526,18 +528,17 @@ > (sigma2_internal > * tXX_inv.diagonal().array()).sqrt(); > } > - int offset=X.ncol- 1; > + int offset = X.ncol- 1; > //if additive and interaction and 2 predictors and more then 2 betas > > if (model == 0 && interaction != 0 && ngpreds == 2 && length_beta > 2){ > - offset=X.ncol - 2; > + offset = X.ncol - 2; > } > > if (robust) > { > covariance.data = robust_sigma2.data.bottomLeftCorner( > offset, offset).diagonal(); > - > } > else > { > @@ -603,13 +604,12 @@ > } > } > #endif > - > } > > void linear_reg::score(mematrix& resid, > double tol_chol, int model, int interaction, int ngpreds, > const masked_matrix& invvarmatrix, int nullmodel) { > - // regdata rdata = rdatain.get_unmasked_data(); > + //regdata rdata = rdatain.get_unmasked_data(); > base_score(resid, tol_chol, model, interaction, ngpreds, > invvarmatrix, nullmodel = 0); > } > @@ -632,7 +632,7 @@ > chi2_score = -1.; > } > > -void logistic_reg::estimate( int verbose, int maxiter, > +void logistic_reg::estimate(int verbose, int maxiter, > double eps, int model, int interaction, int ngpreds, > masked_matrix& invvarmatrixin, int robust, int nullmodel) { > // In contrast to the 'linear' case 'invvarmatrix' contains the > @@ -656,7 +656,6 @@ > > if (length_beta > 1) > { > - > if (model == 0 && interaction != 0 && ngpreds == 2 && length_beta > 2) > { > covariance.reinit(length_beta - 2, 1); > @@ -687,7 +686,7 @@ > > if (invvarmatrix.nrow != 0 && invvarmatrix.ncol != 0) > { > - //TODO(maarten):invvarmatix is symmetric:is there an more effective way? > + //TODO(maarten) invvarmatix is symmetric:is there an more effective way? > tX = tX * invvarmatrix; > } > /* > @@ -706,7 +705,6 @@ > */ > niter = 0; > double delta = 1.; > - double prevlik = 0.; > while (niter < maxiter && delta > eps) > { > mematrix eMu = (X) * beta; > @@ -776,7 +774,7 @@ > } > // std::cout << "beta:\n"; beta.print(); > // compute likelihood > - prevlik = loglik; > + double prevlik = loglik; > loglik = 0.; > for (int i = 0; i < eMu.nrow; i++) > loglik += reg_data.Y[i] * eMu_us[i] - log(1. + exp(eMu_us[i])); > > Modified: branches/ProbABEL-0.50/src/reg1.h > =================================================================== > --- branches/ProbABEL-0.50/src/reg1.h 2014-02-14 14:14:21 UTC (rev 1611) > +++ branches/ProbABEL-0.50/src/reg1.h 2014-02-15 21:39:14 UTC (rev 1612) > @@ -85,13 +85,13 @@ > linear_reg(regdata& rdatain); > ~linear_reg() > { > - delete [] reg_data.masked_data ; > + delete [] reg_data.masked_data; > // delete beta; > // delete sebeta; > // delete residuals; > } > > - void estimate( int verbose, double tol_chol, int model, > + void estimate(int verbose, double tol_chol, int model, > int interaction, int ngpreds, > masked_matrix& invvarmatrixin, > int robust, int nullmodel = 0); > @@ -108,12 +108,12 @@ > logistic_reg(regdata& rdatain); > ~logistic_reg() > { > - delete [] reg_data.masked_data ; > + delete [] reg_data.masked_data; > // delete beta; > // delete sebeta; > } > > - void estimate( int verbose, int maxiter, double eps, > + void estimate(int verbose, int maxiter, double eps, > int model, int interaction, int ngpreds, > masked_matrix& invvarmatrixin, int robust, > int nullmodel = 0); > @@ -123,4 +123,4 @@ > masked_matrix& invvarmatrix, int nullmodel = 0); > }; > > -#endif > +#endif//REG1_H_ > > _______________________________________________ > Genabel-commits mailing list > Genabel-commits at lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-commits > -- *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* L.C. Karssen Utrecht The Netherlands lennart at karssen.org http://blog.karssen.org GPG key ID: A88F554A -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 230 bytes Desc: OpenPGP digital signature URL: From lennart at karssen.org Mon Feb 17 12:03:54 2014 From: lennart at karssen.org (L.C. Karssen) Date: Mon, 17 Feb 2014 12:03:54 +0100 Subject: [GenABEL-dev] [Genabel-commits] r1609 - pkg/OmicABELnoMM/src In-Reply-To: <52FDF0B4.10008@karssen.org> References: <20140213204258.0DD561849B8@r-forge.r-project.org> <52FDF0B4.10008@karssen.org> Message-ID: <5301EC9A.9020902@karssen.org> Dear list, As you may have noticed, I have given Alvaro Frank commit access to our SVN repository. As announced in December [1], Alvaro is the main force behind OmicABELnoMM. Alvaro will initially concentrate on removing the compiler warnings and creating a test suite for OmicABELnoMM. Welcome Alvaro, and looking forward to seeing more of your work/code! Best regards, Lennart. [1] http://lists.r-forge.r-project.org/pipermail/genabel-devel/2013-December/000891.html On 14-02-14 11:32, L.C. Karssen wrote: > Hi Alvaro, > > Thanks for your contribution and congratulations on your first commit in > the GenABEL project. > > Glad to see that the number of has been reduced a lot! I still get a few > errors after running > ./configure LDFLAGS="-L/usr/lib/openblas-base" > make -j4 > but they seem to be minor and easy to fix. Have a look at > http://jenkins.genabel.org/jenkins/job/OmicABELnoMM/15/warnings23Result/ > for the warning messages and corresponding lines in the code. > Also try to have a look at the CPPcheck results in Jenkins. It warns > about three (possible) memory leaks. > > > Thanks a lot and looking forward to your next commits. > > > Lennart. > > > On 13-02-14 21:42, noreply at r-forge.r-project.org wrote: >> Author: afrank >> Date: 2014-02-13 21:42:52 +0100 (Thu, 13 Feb 2014) >> New Revision: 1609 >> >> Modified: >> pkg/OmicABELnoMM/src/AIOwrapper.cpp >> pkg/OmicABELnoMM/src/Algorithm.cpp >> pkg/OmicABELnoMM/src/Algorithm.h >> pkg/OmicABELnoMM/src/Definitions.h >> pkg/OmicABELnoMM/src/Utility.cpp >> pkg/OmicABELnoMM/src/Utility.h >> pkg/OmicABELnoMM/src/main.cpp >> Log: >> Warnings from c/c++ inconsistencies and -Wall fixed. Legacy code from unused functionality removed. A few bugs with indices fixed. Stable code. >> >> Modified: pkg/OmicABELnoMM/src/AIOwrapper.cpp >> =================================================================== >> --- pkg/OmicABELnoMM/src/AIOwrapper.cpp 2014-02-13 09:24:32 UTC (rev 1608) >> +++ pkg/OmicABELnoMM/src/AIOwrapper.cpp 2014-02-13 20:42:52 UTC (rev 1609) >> @@ -29,9 +29,9 @@ >> >> Fhandler->fakefiles = params.use_fake_files; >> >> - databel_fvi* Yfvi; >> - databel_fvi* ALfvi; >> - databel_fvi* ARfvi; >> +// databel_fvi* Yfvi; >> +// databel_fvi* ALfvi; >> +// databel_fvi* ARfvi; >> >> if (!Fhandler->fakefiles) >> { >> @@ -49,7 +49,7 @@ >> params.l = ALfvi->fvi_header.numVariables; >> >> //block size to keep mem under 1 gigabyte >> - int opt_block = params.n / (4*1000^3) * (1/(2*params.r)); >> + //int opt_block = params.n / (4*1000^3) * (1/(2*params.r)); >> int opt_tb = 1000; >> int opt_mb = 1000; >> >> @@ -81,7 +81,7 @@ >> void AIOwrapper::finalize() >> { >> //cout << "f"; >> - void *status; >> + //void *status; >> >> Fhandler->not_done = false; >> pthread_mutex_lock(&(Fhandler->m_more)); >> @@ -368,13 +368,15 @@ >> } >> // >> // //!induce realistic fileread delay >> + >> + return 0; >> } >> >> >> void AIOwrapper::load_ARblock(type_precision** Ar, int &Ar_blockSize) >> { >> - int status; >> - int createstatus = 0; >> + //int status; >> + //int createstatus = 0; >> //cout<<"^"; >> >> while (Fhandler->ar_full_buffers.empty()) >> @@ -428,8 +430,8 @@ >> >> void AIOwrapper::load_Yblock(type_precision** Y, int &y_blockSize) >> { >> - int status; >> - int createstatus = 0; >> + //int status; >> + //int createstatus = 0; >> >> while (Fhandler->full_buffers.empty()) >> { >> @@ -528,7 +530,7 @@ >> >> void AIOwrapper::reset_Y() >> { >> - void *status; >> + //void *status; >> >> Fhandler->seed = 1337; >> >> @@ -569,7 +571,7 @@ >> >> void AIOwrapper::reset_AR() >> { >> - void *status; >> + //void *status; >> >> >> //cout << "ra" << flush; >> @@ -697,7 +699,7 @@ >> FILE * AIOwrapper::fgls_fopen( const char *path, const char *mode ) >> { >> FILE * f; >> - char err[100]; >> + //char err[100]; >> >> f = fopen(path, mode ); >> if ( f == NULL ) >> >> Modified: pkg/OmicABELnoMM/src/Algorithm.cpp >> =================================================================== >> --- pkg/OmicABELnoMM/src/Algorithm.cpp 2014-02-13 09:24:32 UTC (rev 1608) >> +++ pkg/OmicABELnoMM/src/Algorithm.cpp 2014-02-13 20:42:52 UTC (rev 1609) >> @@ -16,30 +16,12 @@ >> { >> switch (type) >> { >> - case FULL_NEQ: >> - fullNEQ(params, out); >> - break; >> - case P_NEQ: >> - partialNEQ(params, out); >> - break; >> - case P_NEQ_B_OPT: >> - partialNEQ_Blocked_STL(params, out); >> - break; >> - case FULL_QR: >> - fullQR(params, out); >> - break; >> - case P_QR: >> - partialQR(params, out); >> - break; >> - case P_QR_B_OPT: >> - partialQR_Blocked_Rtl(params, out); >> - break; >> - case P_NEQ_B_OPT_MD: >> - partialNEQ_Blocked_STL_MD(params, out); >> - break; >> + case P_NEQ_B_OPT_MD: >> + partialNEQ_Blocked_STL_MD(params, out); >> + break; >> >> - default: >> - break; >> + default: >> + break; >> } >> } >> >> @@ -74,7 +56,7 @@ >> int dim2_b, int dim1_b_bot) >> { >> // memcpy are faster version of the fors >> - int i, k, w, top_idx, bot_idx, max = dim1_b*dim2_b; >> + int i, k, w, top_idx, bot_idx; >> int size; >> top_idx = 0; >> bot_idx = 0; >> @@ -111,7 +93,7 @@ >> type_precision* bot, int dim1_QY, >> int dim2_QY, int dim1_qy_bot, int bot_blocks ) >> { >> - int i, k, w, top_idx, bot_idx, max = dim1_QY*dim2_QY; >> + int i, k, w, top_idx, bot_idx; >> top_idx = 0; >> bot_idx = 0; >> for (k = 0; k < dim2_QY; k++) >> @@ -326,12 +308,9 @@ >> blas_set_num_threads(max_threads); >> >> >> - type_precision *Ytemp; >> - lapack_int info, n, lda, ldy, l, r, k, p; >> + //type_precision *Ytemp; >> + lapack_int info, n, lda, l, r, p; >> >> - int i, j, w; >> - int m; >> - >> cputime_type start_tick, start_tick2, end_tick; >> >> AIOfile.initialize(params); >> @@ -349,12 +328,12 @@ >> int y_iters = (y_amount + y_block_size - 1) / y_block_size; >> >> >> - lda = n; ldy = n; >> - k = p; >> + lda = n; >> >> + >> for (int j = 0; j < y_iters; j++) >> { >> - if (y_iters >= 40 && (i%(y_iters/40)) == 0) >> + if (y_iters >= 40 && (j%(y_iters/40)) == 0) >> { >> cout << "*" << flush; >> } >> @@ -389,7 +368,9 @@ >> >> >> AIOfile.load_AL(&backupAL); >> - int total_al_nans = replace_nans(0, backupAL, n, l); >> + //int total_al_nans = replace_nans(0, backupAL, n, l); >> + replace_nans(0, backupAL, n, l); >> + >> copy_vec(backupAL, AL, n*l); >> >> >> @@ -402,7 +383,7 @@ >> >> for (int j = 0; j < y_iters; j++) >> { >> - if (y_iters >= 40 && (i%(y_iters/40)) == 0) >> + if (y_iters >= 40 && (j%(y_iters/40)) == 0) >> { >> cout << AIOfile.io_overhead << flush; >> AIOfile.io_overhead = "*"; >> @@ -412,7 +393,8 @@ >> >> list y_nan_idxs[y_block_size]; >> >> - int total_y_nans = replace_nans(&y_nan_idxs[0], Y, n, y_block_size); >> + //int total_y_nans = replace_nans(&y_nan_idxs[0], Y, n, y_block_size); >> + replace_nans(&y_nan_idxs[0], Y, n, y_block_size); >> >> >> //! Ay_top = AL'*Y >> @@ -424,7 +406,8 @@ >> for (int i = 0; i < a_iters; i++) >> { >> AIOfile.load_ARblock(&backupAR, a_block_size); >> - int total_ar_nans = replace_nans(0, backupAR, n, a_block_size * r); >> + //int total_ar_nans = replace_nans(0, backupAR, n, a_block_size * r); >> + replace_nans(0, backupAR, n, a_block_size * r); >> copy_vec(backupAR, AR, n * r * a_block_size); >> >> get_ticks(start_tick2); >> @@ -501,7 +484,7 @@ >> &Ay[l+ii*p], r); >> >> >> - type_precision* B = Ay; >> + //type_precision* B = Ay; >> type_precision S[p * p]; >> >> //! Rebuild S >> @@ -564,1194 +547,187 @@ >> >> //!*************************************************!// >> >> - >> +//for reference >> void Algorithm::partialNEQ_Blocked_STL(struct Settings params, >> struct Outputs &out) >> { >> - int max_threads = params.threads; >> - >> - srand(time(NULL)); >> - >> - blas_set_num_threads(max_threads); >> - >> - type_precision *Ytemp; >> - lapack_int info, n, lda, ldy, l, r, k, p; >> - >> - int i, j, w; >> - int m; >> - >> - cputime_type start_tick, start_tick2, end_tick; >> - >> - AIOfile.initialize(params); >> - >> - n = params.n; l = params.l; r = params.r; p = l+r; >> - >> - int y_amount = params.m; >> - int y_block_size = params.mb; // kk >> - >> - int a_amount = params.t; >> - int a_block_size = params.tb; >> - >> - int a_iters = (a_amount + a_block_size - 1) / a_block_size; >> - >> - lda = n; ldy = n; >> - k = p; >> - >> - >> - >> - type_precision* backupAL; >> - >> - AIOfile.load_AL(&backupAL); >> - >> - >> - type_precision Stl[l * l]; >> - type_precision Str[l * r * a_block_size]; >> - >> - >> - type_precision* Ay_top = new type_precision[l * y_amount]; >> - type_precision* Ay_bot = new type_precision[y_block_size * a_block_size * r]; >> - type_precision* A = new type_precision[n * p]; >> - type_precision* AR = new type_precision[n * r * a_block_size]; >> - type_precision* AL = new type_precision[n * l]; >> - >> - copy_vec(backupAL, AL, n * l); >> - copy_vec(backupAL, A, n * l); >> - >> - >> - int y_iters = y_amount/y_block_size; >> - >> - type_precision* Y; >> - type_precision* backupAR; >> - >> - // printf("\n\n%%Computations\n%%"); >> - >> - >> - get_ticks(start_tick); >> - >> - >> - //! Generate S >> - cblas_ssyrk(CblasColMajor, CblasUpper, CblasTrans, >> - l, n, 1.0, backupAL, lda, 0.0, Stl, l); >> - >> - for (j = 0; j < y_iters; j++) >> - { >> - AIOfile.load_Yblock(&Y, y_block_size); >> - >> - //! Ay_top = AL'*Y >> - cblas_sgemm(CblasColMajor, CblasTrans, CblasNoTrans, >> - l, y_block_size, n, 1.0, AL, n, Y, n, 0.0, >> - &Ay_top[j * l * y_block_size], l); >> - } >> - >> - >> - for (i = 0; i < a_iters; i++) >> - { >> - if (a_iters > 10 && (i%(a_iters/10)) == 0) >> - { >> - cout << "%" << flush; >> - } >> - >> - >> - AIOfile.load_ARblock(&backupAR, a_block_size); >> - AIOfile.reset_Y(); >> - copy_vec(backupAR, AR, n*r*a_block_size); >> - >> - // matlab_print_matrix("A", n, p, A); >> - //! Generate Str >> - cblas_sgemm(CblasColMajor, CblasTrans, CblasNoTrans, >> - l, r * a_block_size, n, 1.0, AL, n, AR, n, 0.0, Str, l); >> - >> - type_precision Sbr[r*r*a_block_size]; >> - >> - #pragma omp parallel for default(shared) schedule(static) >> - for (int ii= 0; ii < a_block_size; ii++) >> - { >> - //! Generate Sbr >> - cblas_sgemm(CblasColMajor, CblasTrans, CblasNoTrans, >> - r, r, n, 1.0, &AR[ii*r*n], n, &AR[ii*r*n], >> - n, 0.0, &Sbr[ii*r*r], r); >> - } >> - >> - type_precision Ay[y_block_size*p]; >> - type_precision S[p*p]; >> - >> - >> - for (j = 0; j < y_iters; j++) >> - { >> - if (a_iters < 10 && (y_iters < 10 || (j%(y_iters/10)) == 0)) >> - { >> - cout << "%" << flush; >> - } >> - >> - >> - AIOfile.load_Yblock(&Y, y_block_size); >> - >> - //! Ay_bot = AR'*Y >> - cblas_sgemm(CblasColMajor, CblasTrans, CblasNoTrans, >> - r * a_block_size, y_block_size, n, 1.0, AR, n, Y, n, >> - 0.0, Ay_bot, r * a_block_size); >> - >> - #pragma omp parallel for private(S, Ay) default(shared) schedule(static) >> - for (int ii= 0; ii < a_block_size; ii++) >> - { >> - // matlab_print_matrix("Y", n, y_block_size, Y); >> - >> - //! Rebuild AY >> - >> - for (int jj = 0; jj < y_block_size; jj++) >> - { >> - copy_vec(&Ay_top[j*l*y_block_size+jj*l], &Ay[jj*p], l); >> - copy_vec(&Ay_bot[ii*r + jj*r*a_block_size], &Ay[l+jj*p], r); >> - } >> - >> - type_precision* B = Ay; >> - // matlab_print_matrix("Ay_top", l, y_block_size,&Ay_top[j*l*y_block_size]); >> - // matlab_print_matrix("Ay_bot", r, y_block_size, Ay_bot); >> - // matlab_print_matrix("Ay", p, y_block_size, Ay); >> - >> - //! Rebuild S >> - build_S(S, Stl, &Str[ii*r*l], &Sbr[ii*r*r], l, r); >> - // matlab_print_matrix("S", p, p, S); >> - >> - //! b = S\Ay >> - info = LAPACKE_sposv(STORAGE_TYPE, 'U', p, y_block_size, >> - S, p, Ay, p); >> - // assert(info == 0,"POSV"); >> - >> - >> - if (ForceCheck) >> - { >> - check_result(backupAL, &AR[ii * r * n], n, p, >> - y_block_size, r, Y, B); >> - } >> - } >> - } >> - } >> - >> - get_ticks(end_tick); >> - out.duration = ticks2sec(end_tick - start_tick, cpu_freq); >> - // out.gflops = a_amount/1000.0*(n*l*r+n*r*r+y_amount*(n*r+p*p*p)))/1000.0/1000.0; >> - out.gflops = gemm_flops(l, n, l, 0) + gemm_flops(l, n, y_amount, 0) + >> - a_amount * (gemm_flops(l, n, r, 0) + >> - gemm_flops(r, n, r, 0) + >> - gemm_flops(r, n, y_amount, 0) + >> - (y_amount/1000.0) * >> - (p * p * p / 3.0) / 1000.0/1000.0); >> - >> - >> - AIOfile.finalize(); >> - >> - delete []Ay_top; >> - delete []Ay_bot; >> - delete []A; >> - delete []AL; >> - delete []AR; >> -} >> - >> - >> -void Algorithm::partialNEQ(struct Settings params, struct Outputs &out) >> -{ >> - int max_threads = params.threads; >> - >> - >> - srand(time(NULL)); >> - >> - >> - blas_set_num_threads(max_threads); >> - >> - >> - type_precision *Ytemp; >> - lapack_int info, n, lda, ldy, l, r, k, p; >> - >> - int i, j, w; >> - int m; >> - >> - cputime_type start_tick, start_tick2, end_tick; >> - AIOfile.initialize(params); >> - >> - n = params.n; l = params.l; r = params.r; p = l+r; >> - >> - int y_amount = params.m; >> - int y_block_size = params.mb;// kk >> - >> - int a_amount = params.t; >> - int a_block_size = 1; >> - >> - int a_iters = a_amount/a_block_size; >> - >> - lda = n; ldy = n; >> - k = p; >> - >> - >> - >> - type_precision* backupAL; >> - >> - AIOfile.load_AL(&backupAL); >> - >> - type_precision* S = new type_precision[p * p]; >> - type_precision Stl[l * l]; >> - type_precision Str[l * r]; >> - type_precision Sbr[r * r]; >> - type_precision* A = new type_precision[n * p]; >> - type_precision* AL = A; >> - type_precision* AR = &A[l * n]; >> - >> - copy_vec(backupAL, AL, n*l); >> - >> - >> - int y_iters = y_amount / y_block_size; >> - >> - type_precision* Y; >> - type_precision* backupAR; >> - >> - // printf("\n\n%%Computations\n%%"); >> - >> - get_ticks(start_tick); >> - >> - //! Generate S >> - cblas_ssyrk(CblasColMajor, CblasUpper, CblasTrans, >> - l, n, 1.0, backupAL, lda, 0.0, Stl, l); >> - >> - for (i = 0; i < a_iters; i++) >> - { >> - if (a_iters < 10 || (i%(a_iters/10)) == 0) >> - { >> - cout << "%" << flush; >> - } >> - >> - AIOfile.load_ARblock(&backupAR, a_block_size); >> - AIOfile.reset_Y(); >> - copy_vec(backupAR, AR, n*r); >> - >> - // matlab_print_matrix("A", n, p, A); >> - //! Generate Str >> - cblas_sgemm(CblasColMajor, CblasTrans, CblasNoTrans, >> - l, r, n, 1.0, AL, n, AR, n, 0.0, Str, l); >> - >> - //! Generate Sbr >> - cblas_ssyrk(CblasColMajor, CblasUpper, CblasTrans, >> - r, n, 1.0, backupAR, lda, 0.0, Sbr, r); >> - >> - >> - >> - // matlab_print_matrix("S", p, p, S); >> - >> - for (j = 0; j < y_iters; j++) >> - { >> - build_S(S, Stl, Str, Sbr, l, r); >> - >> - AIOfile.load_Yblock(&Y, y_block_size); >> - type_precision Ay[y_block_size * p]; >> - >> - // matlab_print_matrix("Y", n, y_block_size, Y); >> - >> - //! Ay = A'*Y >> - cblas_sgemm(CblasColMajor, CblasTrans, CblasNoTrans, >> - p, y_block_size, n, 1.0, A, n, Y, n, 0.0, Ay, p); >> - >> - type_precision* B = Ay; >> - // matlab_print_matrix("Ay", p, y_block_size, Ay); >> - >> - //! b = S\qy >> - info = LAPACKE_sposv(STORAGE_TYPE, 'U', p, y_block_size, >> - S, p, Ay, p); >> - assert(info == 0, "POSV"); >> - >> - // matlab_print_matrix("B", p, y_block_size, B); >> - // exit(0); >> - if ( ForceCheck) >> - { >> - check_result(backupAL, backupAR, n, p, y_block_size, r, Y, B); >> - } >> - } // END for over j < y_iters >> - } // END for over i < a_iters >> - >> - get_ticks(end_tick); >> - out.duration = ticks2sec(end_tick - start_tick, cpu_freq); >> - out.gflops = 2.0 * (n * l * l / 1000.0 + a_amount / 1000.0 * >> - (n * l * r + n * r * r + >> - y_amount * (p * n + p * p * p))) /1000.0 /1000.0; >> - >> - >> - >> - AIOfile.finalize(); >> - >> - delete []A; >> - delete []S; >> -} >> - >> - >> -void Algorithm::fullNEQ(struct Settings params, struct Outputs &out) >> -{ >> - int max_threads = params.threads; >> - >> - >> - srand(time(NULL)); >> - >> - >> - blas_set_num_threads(max_threads); >> - >> - >> - type_precision *Ytemp; >> - lapack_int info, n, lda, ldy, l, r, k, p; >> - >> - int i, j, w; >> - int m; >> - >> - cputime_type start_tick, start_tick2, end_tick; >> - >> - AIOfile.initialize(params); >> - >> - n = params.n; l = params.l; r = params.r; p = l+r; >> - >> - int y_amount = params.m; >> - int y_block_size = params.mb;// kk >> - >> - int a_amount = params.t; >> - int a_block_size = 1; >> - >> - int a_iters = a_amount/a_block_size; >> - >> - lda = n; ldy = n; >> - k = p; >> - >> - >> - >> - type_precision* backupAL; >> - >> - AIOfile.load_AL(&backupAL); >> - >> - type_precision* S = new type_precision[p * p]; >> - type_precision* Stemp = new type_precision[p * p]; >> - type_precision* A = new type_precision[n * p]; >> - type_precision* AL = A; >> - type_precision* AR = &A[l * n]; >> - >> - int y_iters = y_amount / y_block_size; >> - >> - type_precision* Y; >> - type_precision* backupAR; >> - >> - // printf("\n\n%%Computations\n%%"); >> - >> - get_ticks(start_tick); >> - >> - for (i = 0; i < a_iters; i++) >> - { >> - if (a_iters < 10 || (i%(a_iters/10)) == 0) >> - { >> - cout << "%" << flush; >> - } >> - >> - copy_vec(backupAL, AL, n * l); >> - >> - AIOfile.load_ARblock(&backupAR, a_block_size); >> - AIOfile.reset_Y(); >> - copy_vec(backupAR, AR, n*r); >> - >> - // matlab_print_matrix("A", n, p, A); >> - //! Generate S >> - cblas_ssyrk(CblasColMajor, CblasUpper, CblasTrans, >> - p, n, 1.0, A, lda, 0.0, S, p); >> - // matlab_print_matrix("S", p, p, S); >> - >> - for (j = 0; j < y_iters; j++) >> - { >> - AIOfile.load_Yblock(&Y, y_block_size); >> - type_precision Ay[y_block_size * p]; >> - copy_vec(S, Stemp, p*p); >> - >> - // matlab_print_matrix("Y", n, y_block_size, Y); >> - >> - //! Ay = A'*Y >> - cblas_sgemm(CblasColMajor, CblasTrans, CblasNoTrans, >> - p, y_block_size, n, 1.0, A, n, Y, n, 0.0, Ay, p); >> - >> - type_precision* B = Ay; >> - // matlab_print_matrix("Ay", p, y_block_size, Ay); >> - >> - //! b = S\qy >> - info = LAPACKE_sposv(STORAGE_TYPE, 'U', p, y_block_size, >> - Stemp, p, Ay, p); >> - assert(info == 0, "POSV"); >> - >> - // matlab_print_matrix("B", p, y_block_size, B); >> - // exit(0); >> - if ( ForceCheck) >> - { >> - check_result(backupAL, backupAR, n, p, y_block_size, r, Y, B); >> - } >> - } >> - } >> - >> - get_ticks(end_tick); >> - out.duration = ticks2sec(end_tick - start_tick, cpu_freq); >> - out.gflops = 2.0 * a_amount * (n * p * p / 1000.0 + y_amount / 1000.0 * >> - (p * n + p * p * p))/1000.0/1000.0; >> - >> - >> - AIOfile.finalize(); >> - >> - >> - free(AL); >> - delete []A; >> - delete []S; >> - delete []Stemp; >> -} >> - >> - >> -//!*************************************************!// >> -void Algorithm::fullQR(struct Settings params, struct Outputs &out) >> -{ >> - int max_threads = params.threads; >> - >> - >> - srand(time(NULL)); >> - >> - blas_set_num_threads(max_threads); >> - >> - >> - >> - cputime_type start_tick, start_tick2, end_tick; >> - double acc_gemm = 0; >> - double acc_trsm = 0; >> - double acc_other = 0; >> - double acc_atemp = 0; >> - double acc_rtr = 0; >> - double acc_rqr = 0; >> - >> - >> - type_precision *Ytemp; >> - lapack_int info, n, lda, ldy, l, r, k, p; >> - >> - int i, j, w; >> - int m; >> - >> - AIOfile.initialize(params); >> - >> - n = params.n; l = params.l; r = params.r; p = l+r; >> - >> - int y_amount = params.m; >> - int y_block_size = 1;// kk >> - >> - int a_amount = params.t; >> - int a_block_size = 1; >> - >> - int a_iters = a_amount/a_block_size; >> - >> - lda = n; ldy = n; >> - k = p; >> - >> - >> - >> - type_precision* backupAL; >> - >> - AIOfile.load_AL(&backupAL); >> - >> - type_precision* Q = new type_precision[n*p]; >> - type_precision* A = Q; >> - type_precision* AL = A; >> - type_precision* AR = &A[l*n]; >> - >> - type_precision tau[k]; >> - >> - >> - int y_iters = y_amount / y_block_size; >> - >> - >> - type_precision* Y; >> - type_precision* backupAR; >> - >> - >> - >> - // printf("\n\n%%Computations\n%%"); >> - >> - get_ticks(start_tick); >> - for (i = 0; i < a_iters; i++) >> - { >> - if (a_iters < 10 || (i%(a_iters/10)) == 0) >> - { >> - cout << "%" << flush; >> - } >> - >> - copy_vec(backupAL, AL, n*l); >> - >> - AIOfile.load_ARblock(&backupAR, a_block_size); >> - AIOfile.reset_Y(); >> - copy_vec(backupAR, AR, n*r); >> - >> - //! Generate R >> - info = LAPACKE_sgeqrf(STORAGE_TYPE, n, p, A, lda, tau); >> - assert(info == 0, "QR decomp"); >> - type_precision* R = extract_R(A, n, p); >> - >> - //! generate Q >> - info = LAPACKE_sorgqr(STORAGE_TYPE, n, p, k, Q, lda, tau); >> - assert(info == 0, "Q form"); >> - >> - >> - >> -// matlab_print_matrix("ALL", n, l, backupAL); >> -// matlab_print_matrix("ARR", n, r, backupAR); >> - >> - for (j = 0; j < y_iters; j++) >> - { >> - // matlab_print_matrix("RR", p, p, R); >> - // matlab_print_matrix("QQ", n, p, Q); >> - >> - AIOfile.load_Yblock(&Y, y_block_size); >> - type_precision Qy[y_block_size*p]; >> - >> - //! qy = Q'*Y >> - cblas_sgemm(CblasColMajor, CblasTrans, CblasNoTrans, >> - p, y_block_size, n, 1.0, Q, n, Y, n, 0.0, Qy, p); >> - >> - type_precision* B = Qy; >> - >> - //! b = R\qy >> - cblas_strsm(CblasColMajor, CblasLeft, CblasUpper, >> - CblasNoTrans, CblasNonUnit, >> - p, y_block_size, 1.0, R, p, Qy, p); >> - >> - if (ForceCheck) >> - { >> - check_result(backupAL, backupAR, n, p, y_block_size, r, Y, B); >> - } >> - } >> - >> - free(R); >> - } >> - >> - get_ticks(end_tick); >> - out.duration = ticks2sec(end_tick - start_tick, cpu_freq); >> - out.gflops = 2.0 * a_amount * >> - (2.0 * n * p * p / 1000.0 + y_amount / 1000.0 * >> - (p * n + p * p * p)) / 1000.0 / 1000.0; >> - >> - >> - AIOfile.finalize(); >> - >> - >> - free(AL); >> - delete[] Q; >> -} >> - >> - >> -void Algorithm::partialQR(struct Settings params, struct Outputs &out) >> -{ >> - int max_threads = params.threads; >> - >> - >> - srand(time(NULL)); >> - >> - blas_set_num_threads(max_threads); >> - >> - >> - >> - cputime_type start_tick, start_tick2, end_tick; >> - double acc_gemm = 0; >> - double acc_trsm = 0; >> - double acc_other = 0; >> - double acc_atemp = 0; >> - double acc_rtr = 0; >> - double acc_rqr = 0; >> - >> - >> - type_precision *RL, *Ytemp, *RtlRtr; >> - lapack_int info, n, lda, ldy, l, r, k, p; >> - >> - int i, j, w; >> - int m; >> - >> - AIOfile.initialize(params); >> - >> - n = params.n; l = params.l; r = params.r; p = l+r; >> - >> - int y_amount = params.m; >> - int y_block_size = params.mb;// kk >> - >> - int a_amount = params.t; >> - int a_block_size = 1; >> - >> - int a_iters = a_amount/a_block_size; >> - >> - lda = n; ldy = n; >> - k = l; >> - >> - >> - >> - type_precision* backupAL; >> - >> - AIOfile.load_AL(&backupAL); >> - >> - type_precision* Q = new type_precision[n*p]; >> - type_precision* AL = Q; >> - copy_vec(backupAL, AL, n*l); >> - >> - >> - type_precision tau[k]; >> - >> - type_precision* QL; >> - type_precision* QR = &Q[n*l]; >> - >> - int y_iters = y_amount / y_block_size; >> - >> - >> - type_precision* Y; >> - >> - type_precision Rtr[l*r]; >> - type_precision* Ar; >> - type_precision Rbr[r*r]; >> - >> - get_ticks(start_tick); >> - //! Generate RTL >> - info = LAPACKE_sgeqrf(STORAGE_TYPE, n, l, AL, lda, tau); >> - assert(info == 0, "QR decomp"); >> - >> - type_precision* R =prepare_R(AL, n, l, r); >> - type_precision* Rtl = R; >> - >> - QL = AL;// same as Q >> - AL = backupAL; >> - //! generate QL >> - info = LAPACKE_sorgqr(STORAGE_TYPE, n, l, k, QL, lda, tau); >> - >> - assert(info == 0, "Q form"); >> - >> - // printf("\n\n%%Computations\n%%"); >> - >> - >> - for (i = 0; i < a_iters; i++) >> - { >> - if (a_iters < 10 || (i%(a_iters/10)) == 0) >> - { >> - cout << "%" << flush; >> - } >> - >> - AIOfile.load_ARblock(&Ar, a_block_size); >> - AIOfile.reset_Y(); >> - >> - //! Rtr = Q1'*AR >> - cblas_sgemm(CblasColMajor, CblasTrans, CblasNoTrans, >> - l, r*a_block_size, n, 1.0, QL, n, Ar, n, 0.0, Rtr, l); >> - >> - type_precision* Atemp = replicate_vec(Ar, n*r*a_block_size); >> - >> - //! Atemp = AR-Q1*Rtr >> - cblas_sgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, >> - n, r*a_block_size, l, -1.0, QL, n, Rtr, l, 1.0, Atemp, n); >> - >> - type_precision* QrRbr = QR; >> - copy_vec(Atemp, QrRbr, n*r); >> - info = LAPACKE_sgeqrf(STORAGE_TYPE, n, r, QrRbr, lda, tau); >> - assert(info == 0, "QR decomp of QrRbr"); >> - >> - // reuse of old function >> - type_precision* Rbrtemp = prepare_R(QrRbr, n, r, 0); >> - >> - copy_vec(Rbrtemp, Rbr, r*r); >> - info = LAPACKE_sorgqr(STORAGE_TYPE, n, r, r, QrRbr, lda, tau); >> - assert(info == 0, "QR form"); >> - free(Rbrtemp); >> - >> - update_R(R, Rtr, Rbr, p, p, r); >> - >> -// matlab_print_matrix("RL", p, l, Rtl); >> -// matlab_print_matrix("Rtr", l, r, Rtr); >> -// matlab_print_matrix("Rbr", r, r, Rbr); >> -// matlab_print_matrix("RR", p, p, R); >> -// matlab_print_matrix("QQ", n, p, Q); >> - // matlab_print_matrix("ALL", n, l, AL); >> - // matlab_print_matrix("ARR", n, r, Ar); >> - // matlab_print_matrix("R", p, p, R); >> - int top_idx = 0; >> - >> - for (j = 0; j < y_iters; j++) >> - { >> - AIOfile.load_Yblock(&Y, y_block_size); >> - type_precision Qy[y_block_size*p]; >> - >> - >> - //! qy = Q'*Y >> - cblas_sgemm(CblasColMajor, CblasTrans, CblasNoTrans, >> - p, y_block_size, n, 1.0, Q, n, Y, n, 0.0, Qy, p); >> - >> - type_precision* B = Qy; >> - >> - //! b = R\qy >> - cblas_strsm(CblasColMajor, CblasLeft, CblasUpper, >> - CblasNoTrans, CblasNonUnit, >> - p, y_block_size, 1.0, R, p, Qy, p); >> - >> - // matlab_print_matrix("bcomp", p, y_block_size, B); >> - >> - >> - if ( ForceCheck) >> - { >> - check_result(AL, Ar, n, p, y_block_size, r, Y, B); >> - } >> - } >> - >> - free(Atemp); >> - } >> - >> - >> - get_ticks(end_tick); >> - out.duration = ticks2sec(end_tick - start_tick, cpu_freq); >> - out.gflops = 2.0*(n*l*l/1000.0 + a_amount * >> - (2.0 * n * l * r / 1000.0 + >> - n * r * r / 1000.0 + >> - y_amount / 1000.0 * (p * n + p * p * p))) / >> - 1000.0 / 1000.0; >> - >> - >> - AIOfile.finalize(); >> - >> - >> - free(Rtl); >> - free(AL); >> - delete[] Q; >> -} >> - >> - >> -void Algorithm::partialQR_Blocked_Rtl(struct Settings params, >> - struct Outputs &out) >> -{ >> - int max_threads = params.threads; >> - >> - // srand (time(NULL)); >> - >> - int cpu_cores = max_threads; >> - >> - >> - blas_set_num_threads(max_threads); >> - omp_set_num_threads(max_threads); >> - >> - >> - >> - >> - cputime_type start_tick, start_tick2, end_tick; >> - double acc_pre = 0; >> - double acc_trsm = 0; >> - double acc_other = 0; >> - double acc_atemp = 0; >> - double acc_rtr = 0; >> - double acc_rqr = 0; >> - double acc_RTL_QLY = 0; >> - >> - >> - type_precision *AL, *RL, *RQy_top, *Ytemp, *RtlRtr; >> - lapack_int info, n, lda, ldy, l, r, k, p; >> - >> - int i, j, w; >> - int m; >> - >> - >> - AIOfile.initialize(params); >> - >> - n = params.n; l = params.l; r = params.r; p = l+r; >> - >> - >> - >> - double lvl_3_cache_size = 6; >> - >> - >> - int y_amount = params.t; >> - int y_block_size = params.tb;// kk >> - >> - int a_amount = params.m; >> - int a_block_size = params.mb; >> - >> - int a_iters = (a_amount + a_block_size - 1) / a_block_size; >> - >> - int y_iters = (y_amount+ y_block_size - 1)/y_block_size; >> - >> - int qy_idx = 0; >> - >> - out.gflops = n/1000.0*l/1000.0*l/1000.0 + >> - gemm_flops(l, n, y_amount, 0) + >> - y_amount*l/1000.0*l/1000.0/1000.0 + >> - a_amount * (gemm_flops(l, n, r, 0) + >> - l/1000.0*l/1000.0/1000.0 + >> - gemm_flops(n, l, r, 1) + >> - n/1000.0*r/1000.0*r/1000.0 + >> - gemm_flops(r, n, y_amount, 0) + >> - y_amount/1000.0*r/1000.0*r/1000.0 + >> - y_amount/1000.0*l/1000.0/1000.0); >> - >> - int sch_block_size = max(1.0, >> - min((double)a_block_size / (double)max_threads, >> - (1.0*1000*1000) / >> - (double)((sizeof(type_precision) * n * r)))); >> - >> - // cout << endl<< "taskChunk "<< sch_block_size <> - >> - lda = n; ldy = n; >> - k = l; >> - >> - AIOfile.load_AL(&AL); >> - >> - type_precision* backupAL = replicate_vec(AL, n*l); >> - >> - >> - >> - RQy_top = new type_precision[l*y_amount]; >> - >> - type_precision* Bfinal = (type_precision*)malloc(max_threads * p * >> - y_block_size * >> - sizeof(type_precision)); >> - >> - type_precision tau[k]; >> - >> - type_precision* QL; >> - >> - type_precision* Rtr = (type_precision*)malloc(l * r * a_block_size * >> - sizeof(type_precision)); >> - type_precision* Qy_bot = (type_precision*)malloc(a_block_size * >> - y_block_size * r * >> - sizeof(type_precision)); >> - >> - type_precision* B_top = new type_precision[max_threads*y_block_size*l]; >> - type_precision* B_bot = new type_precision[max_threads*y_block_size*r]; >> - >> - type_precision* Ar; >> - type_precision Rbr[r*r*a_block_size]; >> - >> - >> - >> - // printf("\n\n%%Computations\n%%"); >> - for (i = 0; i < a_iters; i++) >> - { >> - if (a_iters >= 10 && (i%(a_iters/10)) == 0) >> - { >> - // cout << "*" << flush; >> - } >> - >> - for (j = 0; j < y_iters; j++) >> - { >> - if (a_iters < 10 && (y_iters < 10 || (j%(y_iters/10)) == 0)) >> - { >> - // cout << "*" << flush; >> - } >> - } >> - } >> - cout << endl; >> - >> - >> - //! Start of Computations >> - >> - get_ticks(start_tick); >> - >> - >> - info = LAPACKE_sgeqrf(STORAGE_TYPE, n, l, AL, lda, tau); >> - assert(info == 0, "QR decomp"); >> - >> - type_precision* Rtl = prepare_R(AL, n, l, 0); >> - >> - QL = AL; >> - AL = backupAL; >> - >> - info = LAPACKE_sorgqr(STORAGE_TYPE, n, l, k, QL, lda, tau); >> - >> - assert(info == 0, "Q form"); >> - >> - matlab_print_matrix("QL", n, l, QL); >> - >> - qy_idx = 0; >> - >> - // printf("\n%%Preparing IO\n"); >> - //! Prepare File for the Y >> - >> - >> - type_precision* Y; >> - >> - // #pragma omp parallel default(shared) >> +// int max_threads = params.threads; >> +// >> +// srand(time(NULL)); >> +// >> +// blas_set_num_threads(max_threads); >> +// >> +// type_precision *Ytemp; >> +// lapack_int info, n, lda,ldy, l, r, p; >> +// >> +// int i,k; >> +// >> +// cputime_type start_tick, start_tick2, end_tick; >> +// >> +// AIOfile.initialize(params); >> +// >> +// n = params.n; l = params.l; r = params.r; p = l+r; >> +// >> +// int y_amount = params.m; >> +// int y_block_size = params.mb; // kk >> +// >> +// int a_amount = params.t; >> +// int a_block_size = params.tb; >> +// >> +// int a_iters = (a_amount + a_block_size - 1) / a_block_size; >> +// >> +// lda = n; ldy = n; >> +// k = p; >> +// >> +// >> +// >> +// type_precision* backupAL; >> +// >> +// AIOfile.load_AL(&backupAL); >> +// >> +// >> +// type_precision Stl[l * l]; >> +// type_precision Str[l * r * a_block_size]; >> +// >> +// >> +// type_precision* Ay_top = new type_precision[l * y_amount]; >> +// type_precision* Ay_bot = new type_precision[y_block_size * a_block_size * r]; >> +// type_precision* A = new type_precision[n * p]; >> +// type_precision* AR = new type_precision[n * r * a_block_size]; >> +// type_precision* AL = new type_precision[n * l]; >> +// >> +// copy_vec(backupAL, AL, n * l); >> +// copy_vec(backupAL, A, n * l); >> +// >> +// >> +// int y_iters = y_amount/y_block_size; >> +// >> +// type_precision* Y; >> +// type_precision* backupAR; >> +// >> +// // printf("\n\n%%Computations\n%%"); >> +// >> +// >> +// get_ticks(start_tick); >> +// >> +// >> +// //! Generate S >> +// cblas_ssyrk(CblasColMajor, CblasUpper, CblasTrans, >> +// l, n, 1.0, backupAL, lda, 0.0, Stl, l); >> +// >> +// for (int j = 0; j < y_iters; j++) >> // { >> -// // #pragma omp for private(Y, y_block_size, qy_idx) nowait schedule(static, 1) >> +// AIOfile.load_Yblock(&Y, y_block_size); >> +// >> +// //! Ay_top = AL'*Y >> +// cblas_sgemm(CblasColMajor, CblasTrans, CblasNoTrans, >> +// l, y_block_size, n, 1.0, AL, n, Y, n, 0.0, >> +// &Ay_top[j * l * y_block_size], l); >> +// } >> +// >> +// >> +// for (int i = 0; i < a_iters; i++) >> +// { >> +// if (a_iters > 10 && (i%(a_iters/10)) == 0) >> +// { >> +// cout << "%" << flush; >> +// } >> +// >> +// >> +// AIOfile.load_ARblock(&backupAR, a_block_size); >> +// AIOfile.reset_Y(); >> +// copy_vec(backupAR, AR, n*r*a_block_size); >> +// >> +// // matlab_print_matrix("A", n, p, A); >> +// //! Generate Str >> +// cblas_sgemm(CblasColMajor, CblasTrans, CblasNoTrans, >> +// l, r * a_block_size, n, 1.0, AL, n, AR, n, 0.0, Str, l); >> +// >> +// type_precision Sbr[r*r*a_block_size]; >> +// >> +// #pragma omp parallel for default(shared) schedule(static) >> +// for (int ii= 0; ii < a_block_size; ii++) >> +// { >> +// //! Generate Sbr >> +// cblas_sgemm(CblasColMajor, CblasTrans, CblasNoTrans, >> +// r, r, n, 1.0, &AR[ii*r*n], n, &AR[ii*r*n], >> +// n, 0.0, &Sbr[ii*r*r], r); >> +// } >> +// >> +// type_precision Ay[y_block_size*p]; >> +// type_precision S[p*p]; >> +// >> +// >> // for (int j = 0; j < y_iters; j++) >> // { >> -// // qy_idx = j*y_block_size*l; >> -// // #pragma omp critical >> -// {AIOfile.load_Yblock(&Y, y_block_size);} >> +// if (a_iters < 10 && (y_iters < 10 || (j%(y_iters/10)) == 0)) >> +// { >> +// cout << "%" << flush; >> +// } >> // >> -// //! qy_top = QL'*Y >> +// >> +// AIOfile.load_Yblock(&Y, y_block_size); >> +// >> +// //! Ay_bot = AR'*Y >> // cblas_sgemm(CblasColMajor, CblasTrans, CblasNoTrans, >> -// l, y_block_size, n, 1.0, QL, n, Y, n, 0.0,&RQy_top[qy_idx], l); >> +// r * a_block_size, y_block_size, n, 1.0, AR, n, Y, n, >> +// 0.0, Ay_bot, r * a_block_size); >> // >> -// //! K | RtlQlY =RTL\qy_top >> -// cblas_strsm(CblasColMajor, CblasLeft, CblasUpper, CblasNoTrans, CblasNonUnit, >> -// l, y_block_size, 1.0, Rtl, l,&RQy_top[qy_idx], l); >> -// qy_idx += y_block_size*l; >> +// #pragma omp parallel for private(S, Ay) default(shared) schedule(static) >> +// for (int ii= 0; ii < a_block_size; ii++) >> +// { >> [TRUNCATED] >> >> To get the complete diff run: >> svnlook diff /svnroot/genabel -r 1609 >> _______________________________________________ >> Genabel-commits mailing list >> Genabel-commits at lists.r-forge.r-project.org >> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-commits >> > > > > _______________________________________________ > genabel-devel mailing list > genabel-devel at lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-devel > -- *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* L.C. Karssen Utrecht The Netherlands lennart at karssen.org http://blog.karssen.org GPG key ID: A88F554A -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 230 bytes Desc: OpenPGP digital signature URL: From lennart at karssen.org Tue Feb 18 13:56:15 2014 From: lennart at karssen.org (L.C. Karssen) Date: Tue, 18 Feb 2014 13:56:15 +0100 Subject: [GenABEL-dev] [Genabel-commits] r1611 - in branches/ProbABEL-0.50: checks/R-tests examples src In-Reply-To: <20140214141421.B62EB185DF0@r-forge.r-project.org> References: <20140214141421.B62EB185DF0@r-forge.r-project.org> Message-ID: <5303586F.4000801@karssen.org> Hi Maarten, I found this commit e-mail in my inbox still waiting for review. Please have a look at the comments below. Thanks a lot for your contributions, Lennart. On 14-02-14 15:14, noreply at r-forge.r-project.org wrote: > Author: maartenk > Date: 2014-02-14 15:14:21 +0100 (Fri, 14 Feb 2014) > New Revision: 1611 > > Modified: > branches/ProbABEL-0.50/checks/R-tests/run_models_in_R_palinear.R > branches/ProbABEL-0.50/examples/mmscore.R > branches/ProbABEL-0.50/src/reg1.cpp > Log: > -removed unnecessary lines from examples/mmscore.R Nice! Having this lying around in the examples would only confuse a user. > -Disabled in run_models_in_R_palinear.R last snp in 2df model because 2 variables were completely anti correlated. There should be a check on Rank of Cholesky decompositions for this kind of problem I agree that such a check would be appropriate. Doesn't EIGEN give a warning? Maybe someone else knows how we can tell R's lm() or glm() to do these kinds of checks? > -rewrote mmscore weighted regression to EIGEN form for palinear > > Modified: branches/ProbABEL-0.50/checks/R-tests/run_models_in_R_palinear.R > =================================================================== > --- branches/ProbABEL-0.50/checks/R-tests/run_models_in_R_palinear.R 2014-02-14 07:58:43 UTC (rev 1610) > +++ branches/ProbABEL-0.50/checks/R-tests/run_models_in_R_palinear.R 2014-02-14 14:14:21 UTC (rev 1611) > @@ -123,7 +123,7 @@ > } > colnames(prob.2df.R) <- cols2df > rownames(prob.2df.R) <- NULL > -stopifnot( all.equal(prob.2df.PA, prob.2df.R, tol=tol) ) > +#stopifnot( all.equal(prob.2df.PA1[1:5,], prob.2df.R[1:5,], tol=tol) ) > cat("2df\n") > > cat("\t\t\t\t\t\tOK\n") > > Modified: branches/ProbABEL-0.50/examples/mmscore.R > =================================================================== > --- branches/ProbABEL-0.50/examples/mmscore.R 2014-02-14 07:58:43 UTC (rev 1610) > +++ branches/ProbABEL-0.50/examples/mmscore.R 2014-02-14 14:14:21 UTC (rev 1611) > @@ -90,83 +90,3 @@ > > ## Mow, go to ProbABEL and start analysis > > - > - > - > - > -##____________________________________________________ > -## The following part is for historic purposes only. It is not > -## necessary for using the --mmscore option of ProbABEL's palinear. > - > -## Create test file with genotypes > - > -data_cut <- data[, snps] > -gen_table <- as.numeric(data_cut) > -prob_table <- matrix() > - > -#Replace NA by mean for each snp. NA is forbiden in genotypes in ProbABEL input (!). > -#for(snpnum in 1:dim(gen_table)[2]) > -# { > -# mean <- mean(gen_table[,snpnum], na.rm=T) > -# gen_table[is.na(gen_table[,snpnum]),snpnum] <- mean > -# } > - > - > -gen_table_df <- data.frame(gen_table) > -gen_table_df$MLDOSE <- gen_table_df[, 1] > -gen_table_df[,1] <- "MLDOSE" > -colnam <- colnames(gen_table_df) > - > -#colnam[-c(1:length(colnam)-1)] <- colnam[1] > -#colnam[1] <- "MLDOSE" > - > -colnam[length(colnam)] <- colnam[1] > -colnam[1] <- "MLDOSE" > -colnames(gen_table_df) <- colnam > - > - > -rownames <- rownames(gen_table_df) > -rownames <- paste("1->", rownames, sep="") > -rownames(gen_table_df) <- rownames > - > -write.table(file="mmscore_gen.mldose", > - gen_table_df, > - row.names=TRUE, > - col.names=FALSE, > - quote=FALSE, > - na="NaN") > - > -mlinfo <- data.frame(SNP=colnam[2:length(colnam)]) > -mlinfo$Al1 <- "A" > -mlinfo$Al2 <- "B" > -mlinfo$Freq1 <- 0.5847 > -mlinfo$MAF <- 0.5847 > -mlinfo$Quality <- 0.5847 > -mlinfo$Rsq <- 0.5847 > - > -write.table(mlinfo, "mmscore_gen.mlinfo", row.names=FALSE, quote=FALSE) > - > -## arrange probability-file > -prob_table <- matrix(NA, > - ncol=(dim(gen_table_df)[2]-1) * 2, > - nrow=dim(gen_table_df)[1]) > -j <- 1 > -for (i in (1:(dim(gen_table_df)[2]-1))) { > - prob_table[,j] <- rep(0, dim(prob_table)[1]) > - prob_table[gen_table_df[,i+1]==2, j] <- 1 > - prob_table[is.na(gen_table_df[, i+1]), j] <- NA > - j <- j + 1 > - prob_table[, j] <- rep(0,dim(prob_table)[1]) > - prob_table[gen_table_df[, i+1]==1, j] <- 1 > - prob_table[is.na(gen_table_df[, i+1]),j] <- NA > - j <- j + 1 > -} > -prob_table_df <- data.frame(MLPROB="MLPROB", prob_table) > -rownames(prob_table_df) <- rownames(gen_table_df) > - > -write.table(file="mmscore_gen.mlprob", > - prob_table_df, > - row.names=TRUE, > - col.names=FILE, > - quote=FILE, > - na="NaN") > > Modified: branches/ProbABEL-0.50/src/reg1.cpp > =================================================================== > --- branches/ProbABEL-0.50/src/reg1.cpp 2014-02-14 07:58:43 UTC (rev 1610) > +++ branches/ProbABEL-0.50/src/reg1.cpp 2014-02-14 14:14:21 UTC (rev 1611) > @@ -355,9 +355,11 @@ > } > > double sigma2_internal; > - mematrix tXX_i; > + > #if EIGEN > LDLT Ch ; > +#else > + mematrix tXX_i; > #endif > if (invvarmatrixin.length_of_mask != 0) > { > @@ -369,12 +371,16 @@ > //C=AB (m X n matrix A and n x P matrix B) > //flops=mp(2n-1) (when n is big enough flops=mpn2) > //Oct 26, 2009 > + > +#if EIGEN > + MatrixXd tXW = X.data.transpose() * invvarmatrixin.masked_data->data; // flops 5997000 > + Ch = LDLT (tXW * X.data); // 17991 flops > + beta.data = Ch.solve(tXW * reg_data.Y.data); > + sigma2 = (reg_data.Y.data - tXW.transpose() * beta.data).squaredNorm() ; //flops: 1000+5000+3000 > +#else > + > Are you sure you want to keep these flops values here? I guess they are no longer accurate when using EIGEN. > mematrix tXW = transpose(X) * invvarmatrixin.masked_data; // flops 5997000 > tXX_i = tXW * X; // 17991 flops > -#if EIGEN > - Ch=LDLT (tXX_i.data.selfadjointView()); > -#endif > - > // use cholesky to invert > cholesky2_mm(tXX_i, tol_chol); > chinv2_mm(tXX_i); > @@ -387,6 +393,7 @@ > double val = sigma2_matrix.get(i, 0); > sigma2 += val * val; // flops: 3000 > } > +#endif > double N = X.nrow; > //sigma2_internal = sigma2 / (N - static_cast(length_beta)); > // Ugly fix to the fact that if we do mmscore, sigma2 is already > @@ -400,15 +407,12 @@ > { > #if EIGEN > int m = X.ncol; > - MatrixXd txx = MatrixXd(m, m).setZero().selfadjointView().rankUpdate(X.data.adjoint()); > + MatrixXd txx = MatrixXd(m, m).setZero().selfadjointView().\ > + rankUpdate(X.data.adjoint()); > Ch=LDLT (txx.selfadjointView()); > beta.data= Ch.solve(X.data.adjoint() * reg_data.Y.data); > + sigma2 = (reg_data.Y.data - (X.data * beta.data)).squaredNorm() ; > > - tXX_i.data=Ch.solve(MatrixXd(m, m).Identity(m,m)); > - tXX_i.nrow=tXX_i.data.rows(); > - tXX_i.ncol=tXX_i.data.cols(); > - tXX_i.nelements=tXX_i.ncol*tXX_i.nrow; > - > #else > mematrix tX = transpose(X); > // use cholesky to invert > @@ -416,14 +420,10 @@ > cholesky2_mm(tXX_i, tol_chol); > chinv2_mm(tXX_i); > beta = tXX_i * (tX * (reg_data.Y)); > -#endif > > // now compute residual variance > sigma2 = 0.; > mematrix sigma2_matrix = reg_data.Y - (X * beta); > -#if EIGEN > - sigma2 = sigma2_matrix.data.squaredNorm() ; > -#else > for (int i = 0; i < sigma2_matrix.nrow; i++) > { > double val = sigma2_matrix.get(i, 0); > @@ -458,8 +458,10 @@ > double intercept = beta.get(0, 0); > residuals.data= reg_data.Y.data.array()-intercept; > //matrix. > - ArrayXXd betacol = beta.data.block(1,0,beta.data.rows()-1,1).array().transpose(); > - ArrayXXd resid_sub = (X.data.block(0,1,X.data.rows(),X.data.cols()-1)*betacol.matrix().asDiagonal()).rowwise().sum() ; > + ArrayXXd betacol = beta.data.block(1,0,beta.data.rows()-1,1)\ > + .array().transpose(); > + ArrayXXd resid_sub = (X.data.block(0,1,X.data.rows(),X.data.cols()-1)\ > + *betacol.matrix().asDiagonal()).rowwise().sum() ; > //std::cout << resid_sub << std::endl; > residuals.data-=resid_sub.matrix(); > //residuals[i] -= resid_sub; > @@ -481,15 +483,18 @@ > > loglik -= static_cast(reg_data.nids) * log(sqrt(sigma2)); > #if EIGEN > - MatrixXd tXX_inv=Ch.solve(MatrixXd(length_beta, length_beta).Identity(length_beta,length_beta)); > + MatrixXd tXX_inv=Ch.solve(MatrixXd(length_beta, length_beta). > + Identity(length_beta,length_beta)); > #endif > > mematrix robust_sigma2(X.ncol, X.ncol); > if (robust) > { > #if EIGEN > - MatrixXd Xresiduals = X.data.array().colwise()*residuals.data.col(0).array(); > - MatrixXd XbyR = MatrixXd(X.ncol, X.ncol).setZero().selfadjointView().rankUpdate(Xresiduals.adjoint()); > + MatrixXd Xresiduals = X.data.array().colwise()\ > + *residuals.data.col(0).array(); > + MatrixXd XbyR = MatrixXd(X.ncol, X.ncol).setZero()\ > + .selfadjointView().rankUpdate(Xresiduals.adjoint()); > robust_sigma2.data= tXX_inv*XbyR *tXX_inv; > #else > > > _______________________________________________ > Genabel-commits mailing list > Genabel-commits at lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-commits > Best regards, Lennart. -- *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* L.C. Karssen Utrecht The Netherlands lennart at karssen.org http://blog.karssen.org GPG key ID: A88F554A -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 230 bytes Desc: OpenPGP digital signature URL: From lennart at karssen.org Tue Feb 18 13:59:05 2014 From: lennart at karssen.org (L.C. Karssen) Date: Tue, 18 Feb 2014 13:59:05 +0100 Subject: [GenABEL-dev] [Genabel-commits] r1589 - branches/ProbABEL-0.50/src In-Reply-To: <20140203222918.2BF0018663E@r-forge.r-project.org> References: <20140203222918.2BF0018663E@r-forge.r-project.org> Message-ID: <53035919.2060307@karssen.org> Hi Maarten, This is another even older commit waiting for review. One question: In the log message you mention this leads to minor memory leaks. Any idea why? I assume they have been detected by valgrind? Or was it cppcheck that warns about them? Or have they been resolved in the mean time? Thanks, Lennart. On 03-02-14 23:29, noreply at r-forge.r-project.org wrote: > Author: maartenk > Date: 2014-02-03 23:29:17 +0100 (Mon, 03 Feb 2014) > New Revision: 1589 > > Modified: > branches/ProbABEL-0.50/src/main.cpp > branches/ProbABEL-0.50/src/reg1.cpp > branches/ProbABEL-0.50/src/reg1.h > branches/ProbABEL-0.50/src/regdata.cpp > branches/ProbABEL-0.50/src/regdata.h > Log: > Removes mutiple masking the data per snp in linear and logistic regression. This commit speeds up palinear by ~11%. This introduces minor memory leaks. > > Modified: branches/ProbABEL-0.50/src/main.cpp > =================================================================== > --- branches/ProbABEL-0.50/src/main.cpp 2014-02-03 22:05:56 UTC (rev 1588) > +++ branches/ProbABEL-0.50/src/main.cpp 2014-02-03 22:29:17 UTC (rev 1589) > @@ -126,7 +126,8 @@ > std::cout << " loaded null data..." << std::flush; > #if LOGISTIC > logistic_reg nrd = logistic_reg(nrgd); > - nrd.estimate(nrgd, 0, MAXITER, EPS, CHOLTOL, 0, > + > + nrd.estimate( 0, MAXITER, EPS, CHOLTOL, 0, > input_var.getInteraction(), > input_var.getNgpreds(), > invvarmatrix, > @@ -138,7 +139,7 @@ > #if DEBUG > std::cout << "[DEBUG] linear_reg nrd = linear_reg(nrgd); DONE."; > #endif > - nrd.estimate(nrgd, 0, CHOLTOL, 0, input_var.getInteraction(), > + nrd.estimate( 0, CHOLTOL, 0, input_var.getInteraction(), > input_var.getNgpreds(), invvarmatrix, > input_var.getRobust(), 1); > #elif COXPH > @@ -272,14 +273,14 @@ > logistic_reg rd(rgd); > if (input_var.getScore()) > { > - rd.score(nrd.residuals, rgd, 0, CHOLTOL, model, > + rd.score(nrd.residuals, 0, CHOLTOL, model, > input_var.getInteraction(), > input_var.getNgpreds(), > invvarmatrix); > } > else > { > - rd.estimate(rgd, 0, MAXITER, EPS, CHOLTOL, model, > + rd.estimate( 0, MAXITER, EPS, CHOLTOL, model, > input_var.getInteraction(), > input_var.getNgpreds(), > invvarmatrix, > @@ -289,14 +290,14 @@ > linear_reg rd(rgd); > if (input_var.getScore()) > { > - rd.score(nrd.residuals, rgd, 0, CHOLTOL, model, > + rd.score(nrd.residuals, 0, CHOLTOL, model, > input_var.getInteraction(), > input_var.getNgpreds(), > invvarmatrix); > } > else > { > - rd.estimate(rgd, 0, CHOLTOL, model, > + rd.estimate( 0, CHOLTOL, model, > input_var.getInteraction(), > input_var.getNgpreds(), > invvarmatrix, > @@ -380,7 +381,7 @@ > regdata new_rgd = rgd; > new_rgd.remove_snp_from_X(); > linear_reg new_null_rd(new_rgd); > - new_null_rd.estimate(new_rgd, 0, > + new_null_rd.estimate( 0, > CHOLTOL, model, > input_var.getInteraction(), > input_var.getNgpreds(), > @@ -391,7 +392,7 @@ > regdata new_rgd = rgd; > new_rgd.remove_snp_from_X(); > logistic_reg new_null_rd(new_rgd); > - new_null_rd.estimate(new_rgd, 0, MAXITER, EPS, > + new_null_rd.estimate( 0, MAXITER, EPS, > CHOLTOL, model, > input_var.getInteraction(), > input_var.getNgpreds(), > > Modified: branches/ProbABEL-0.50/src/reg1.cpp > =================================================================== > --- branches/ProbABEL-0.50/src/reg1.cpp 2014-02-03 22:05:56 UTC (rev 1588) > +++ branches/ProbABEL-0.50/src/reg1.cpp 2014-02-03 22:29:17 UTC (rev 1589) > @@ -224,10 +224,10 @@ > } > > linear_reg::linear_reg(regdata& rdatain) { > - regdata rdata = rdatain.get_unmasked_data(); > + reg_data = rdatain.get_unmasked_data(); > // std::cout << "linear_reg: " << rdata.nids << " " << (rdata.X).ncol > // << " " << (rdata.Y).ncol << "\n"; > - int length_beta = (rdata.X).ncol; > + int length_beta = (reg_data.X).ncol; > beta.reinit(length_beta, 1); > sebeta.reinit(length_beta, 1); > //Han Chen > @@ -236,18 +236,18 @@ > covariance.reinit(length_beta - 1, 1); > } > //Oct 26, 2009 > - residuals.reinit(rdata.nids, 1); > + residuals.reinit(reg_data.nids, 1); > sigma2 = -1.; > loglik = -9.999e+32; > chi2_score = -1.; > } > > -void base_reg::base_score(mematrix& resid, regdata& rdata, int verbose, > +void base_reg::base_score(mematrix& resid, int verbose, > double tol_chol, int model, int interaction, int ngpreds, > const masked_matrix& invvarmatrix, int nullmodel) { > - mematrix oX = rdata.extract_genotypes(); > + mematrix oX = reg_data.extract_genotypes(); > mematrix X = apply_model(oX, model, interaction, ngpreds, > - rdata.is_interaction_excluded, false, nullmodel); > + reg_data.is_interaction_excluded, false, nullmodel); > beta.reinit(X.ncol, 1); > sebeta.reinit(X.ncol, 1); > double N = static_cast(resid.nrow); > @@ -286,31 +286,31 @@ > } > > > -void linear_reg::estimate(regdata& rdatain, int verbose, double tol_chol, > +void linear_reg::estimate( int verbose, double tol_chol, > int model, int interaction, int ngpreds, masked_matrix& invvarmatrixin, > int robust, int nullmodel) { > // suda interaction parameter > // model should come here > - regdata rdata = rdatain.get_unmasked_data(); > + //regdata rdata = rdatain.get_unmasked_data(); > > if (verbose) > { > - cout << rdata.is_interaction_excluded > + cout << reg_data.is_interaction_excluded > << " <-rdata.is_interaction_excluded\n"; > // std::cout << "invvarmatrix:\n"; > // invvarmatrixin.masked_data->print(); > std::cout << "rdata.X:\n"; > - rdata.X.print(); > + reg_data.X.print(); > } > > - mematrix X = apply_model(rdata.X, model, interaction, ngpreds, > - rdata.is_interaction_excluded, false, nullmodel); > + mematrix X = apply_model(reg_data.X, model, interaction, ngpreds, > + reg_data.is_interaction_excluded, false, nullmodel); > if (verbose) > { > std::cout << "X:\n"; > X.print(); > std::cout << "Y:\n"; > - rdata.Y.print(); > + reg_data.Y.print(); > } > > int length_beta = X.ncol; > @@ -337,7 +337,7 @@ > if (invvarmatrixin.length_of_mask != 0) > { > //retrieve masked data W > - invvarmatrixin.update_mask(rdatain.masked_data); > + invvarmatrixin.update_mask(reg_data.masked_data); > > // This regression is Weighted Least Square: used for mmscore : > // FLOPS count are calculated for 3*1000 matrix as follow: > @@ -353,10 +353,10 @@ > // use cholesky to invert > cholesky2_mm(tXX_i, tol_chol); > chinv2_mm(tXX_i); > - beta = tXX_i * (tXW * rdata.Y); // flops 15+5997 > + beta = tXX_i * (tXW * reg_data.Y); // flops 15+5997 > // now compute residual variance > sigma2 = 0.; > - mematrix sigma2_matrix = rdata.Y - (transpose(tXW) * beta); //flops: 1000+5000 > + mematrix sigma2_matrix = reg_data.Y - (transpose(tXW) * beta); //flops: 1000+5000 > for (int i = 0; i < sigma2_matrix.nrow; i++) > { > double val = sigma2_matrix.get(i, 0); > @@ -377,7 +377,7 @@ > int m = X.ncol; > MatrixXd txx = MatrixXd(m, m).setZero().selfadjointView().rankUpdate(X.data.adjoint()); > Ch=LDLT (txx.selfadjointView()); > - beta.data= Ch.solve(X.data.adjoint() * rdata.Y.data); > + beta.data= Ch.solve(X.data.adjoint() * reg_data.Y.data); > > tXX_i.data=Ch.solve(MatrixXd(m, m).Identity(m,m)); > tXX_i.nrow=tXX_i.data.rows(); > @@ -390,12 +390,12 @@ > tXX_i = tX * X; > cholesky2_mm(tXX_i, tol_chol); > chinv2_mm(tXX_i); > - beta = tXX_i * (tX * (rdata.Y)); > + beta = tXX_i * (tX * (reg_data.Y)); > #endif > > // now compute residual variance > sigma2 = 0.; > - mematrix sigma2_matrix = rdata.Y - (X * beta); > + mematrix sigma2_matrix = reg_data.Y - (X * beta); > #if EIGEN > sigma2 = sigma2_matrix.data.squaredNorm() ; > #else > @@ -431,7 +431,7 @@ > > #if EIGEN > double intercept = beta.get(0, 0); > - residuals.data= rdata.Y.data.array()-intercept; > + residuals.data= reg_data.Y.data.array()-intercept; > //matrix. > ArrayXXd betacol = beta.data.block(1,0,beta.data.rows()-1,1).array().transpose(); > ArrayXXd resid_sub = (X.data.block(0,1,X.data.rows(),X.data.cols()-1)*betacol.matrix().asDiagonal()).rowwise().sum() ; > @@ -443,9 +443,9 @@ > //loglik -= halfrecsig2 * residuals[i] * residuals[i]; > > #else > - for (int i = 0; i < rdata.nids; i++) > + for (int i = 0; i < reg_data.nids; i++) > { > - double resid = rdata.Y[i] - beta.get(0, 0); // intercept > + double resid = reg_data.Y[i] - beta.get(0, 0); // intercept > for (int j = 1; j < beta.nrow; j++){ > resid -= beta.get(j, 0) * X.get(i, j); > } > @@ -454,7 +454,7 @@ > } > #endif > > - loglik -= static_cast(rdata.nids) * log(sqrt(sigma2)); > + loglik -= static_cast(reg_data.nids) * log(sqrt(sigma2)); > #if EIGEN > MatrixXd tXX_inv=Ch.solve(MatrixXd(length_beta, length_beta).Identity(length_beta,length_beta)); > #endif > @@ -576,17 +576,17 @@ > > } > > -void linear_reg::score(mematrix& resid, regdata& rdatain, int verbose, > +void linear_reg::score(mematrix& resid, int verbose, > double tol_chol, int model, int interaction, int ngpreds, > const masked_matrix& invvarmatrix, int nullmodel) { > - regdata rdata = rdatain.get_unmasked_data(); > - base_score(resid, rdata, verbose, tol_chol, model, interaction, ngpreds, > + // regdata rdata = rdatain.get_unmasked_data(); > + base_score(resid, verbose, tol_chol, model, interaction, ngpreds, > invvarmatrix, nullmodel = 0); > } > > logistic_reg::logistic_reg(regdata& rdatain) { > - regdata rdata = rdatain.get_unmasked_data(); > - int length_beta = (rdata.X).ncol; > + reg_data = rdatain.get_unmasked_data(); > + int length_beta = reg_data.X.ncol; > beta.reinit(length_beta, 1); > sebeta.reinit(length_beta, 1); > //Han Chen > @@ -595,37 +595,38 @@ > covariance.reinit(length_beta - 1, 1); > } > //Oct 26, 2009 > - residuals.reinit((rdata.X).nrow, 1); > + residuals.reinit(reg_data.X.nrow, 1); > sigma2 = -1.; > loglik = -9.999e+32; // should actually be MAX of the corresponding type > niter = -1; > chi2_score = -1.; > } > > -void logistic_reg::estimate(regdata& rdatain, int verbose, int maxiter, > +void logistic_reg::estimate( int verbose, int maxiter, > double eps, double tol_chol, int model, int interaction, int ngpreds, > masked_matrix& invvarmatrixin, int robust, int nullmodel) { > // In contrast to the 'linear' case 'invvarmatrix' contains the > // inverse of correlation matrix (not the inverse of var-cov matrix) > // h2.object$InvSigma * h.object2$h2an$estimate[length(h2$h2an$estimate)] > // the inverse of var-cov matrix scaled by total variance > - regdata rdata = rdatain.get_unmasked_data(); > + //regdata rdata = rdatain.get_unmasked_data(); > // a lot of code duplicated between linear and logistic... > // e.g. a piece below... > mematrix invvarmatrix; > if (invvarmatrixin.length_of_mask != 0) > { > - invvarmatrixin.update_mask(rdatain.masked_data); > + invvarmatrixin.update_mask(reg_data.masked_data); > } > - > - mematrix X = apply_model(rdata.X, model, interaction, ngpreds, > - rdata.is_interaction_excluded, false, nullmodel); > + mematrix X = apply_model(reg_data.X, model, interaction, ngpreds, > + reg_data.is_interaction_excluded, false, nullmodel); > int length_beta = X.ncol; > beta.reinit(length_beta, 1); > sebeta.reinit(length_beta, 1); > //Han Chen > + > if (length_beta > 1) > { > + > if (model == 0 && interaction != 0 && ngpreds == 2 && length_beta > 2) > { > covariance.reinit(length_beta - 2, 1); > @@ -635,13 +636,14 @@ > covariance.reinit(length_beta - 1, 1); > } > } > + > //Oct 26, 2009 > mematrix W((X).nrow, 1); > mematrix z((X).nrow, 1); > mematrix tXWX(length_beta, length_beta); > mematrix tXWX_i(length_beta, length_beta); > mematrix tXWz(length_beta, 1); > - double prev = (rdata.Y).column_mean(0); > + double prev = (reg_data.Y).column_mean(0); > if (prev >= 1. || prev <= 0.) > { > std::cerr << "prevalence not within (0,1)\n"; > @@ -652,6 +654,7 @@ > > beta.put(log(prev / (1. - prev)), 0, 0); > mematrix tX = transpose(X); > + > if (invvarmatrix.nrow != 0 && invvarmatrix.ncol != 0) > { > //TODO(maarten):invvarmatix is symmetric:is there an more effective way? > @@ -684,12 +687,12 @@ > double value = emu; > double zval; > value = exp(value) / (1. + exp(value)); > - residuals[i] = (rdata.Y).get(i, 0) - value; > + residuals[i] = (reg_data.Y).get(i, 0) - value; > eMu.put(value, i, 0); > W.put(value * (1. - value), i, 0); > zval = emu > + (1. / (value * (1. - value))) > - * (((rdata.Y).get(i, 0)) - value); > + * (((reg_data.Y).get(i, 0)) - value); > z.put(zval, i, 0); > } > > @@ -746,7 +749,7 @@ > prevlik = loglik; > loglik = 0.; > for (int i = 0; i < eMu.nrow; i++) > - loglik += rdata.Y[i] * eMu_us[i] - log(1. + exp(eMu_us[i])); > + loglik += reg_data.Y[i] * eMu_us[i] - log(1. + exp(eMu_us[i])); > > delta = fabs(1. - (prevlik / loglik)); > niter++; > @@ -829,9 +832,9 @@ > // exit(1); > } > > -void logistic_reg::score(mematrix& resid, regdata& rdata, int verbose, > +void logistic_reg::score(mematrix& resid, int verbose, > double tol_chol, int model, int interaction, int ngpreds, > masked_matrix& invvarmatrix, int nullmodel) { > - base_score(resid, rdata, verbose, tol_chol, model, interaction, ngpreds, > + base_score(resid, verbose, tol_chol, model, interaction, ngpreds, > invvarmatrix, nullmodel = 0); > } > > Modified: branches/ProbABEL-0.50/src/reg1.h > =================================================================== > --- branches/ProbABEL-0.50/src/reg1.h 2014-02-03 22:05:56 UTC (rev 1588) > +++ branches/ProbABEL-0.50/src/reg1.h 2014-02-03 22:29:17 UTC (rev 1589) > @@ -49,8 +49,9 @@ > double sigma2; > double loglik; > double chi2_score; > + regdata reg_data; > > - void base_score(mematrix& resid, regdata& rdata, int verbose, > + void base_score(mematrix& resid, int verbose, > double tol_chol, int model, int interaction, int ngpreds, > const masked_matrix& invvarmatrix, int nullmodel); > }; > @@ -60,17 +61,18 @@ > linear_reg(regdata& rdatain); > ~linear_reg() > { > + delete [] reg_data.masked_data ; > // delete beta; > // delete sebeta; > // delete residuals; > } > > - void estimate(regdata& rdatain, int verbose, double tol_chol, int model, > + void estimate( int verbose, double tol_chol, int model, > int interaction, int ngpreds, > masked_matrix& invvarmatrixin, > int robust, int nullmodel = 0); > > - void score(mematrix& resid, regdata& rdatain, int verbose, > + void score(mematrix& resid, int verbose, > double tol_chol, int model, int interaction, int ngpreds, > const masked_matrix& invvarmatrix, int nullmodel = 0); > }; > @@ -82,16 +84,17 @@ > logistic_reg(regdata& rdatain); > ~logistic_reg() > { > + delete [] reg_data.masked_data ; > // delete beta; > // delete sebeta; > } > > - void estimate(regdata& rdatain, int verbose, int maxiter, double eps, > + void estimate( int verbose, int maxiter, double eps, > double tol_chol, int model, int interaction, int ngpreds, > masked_matrix& invvarmatrixin, int robust, > int nullmodel = 0); > // just a stupid copy from linear_reg > - void score(mematrix& resid, regdata& rdata, int verbose, > + void score(mematrix& resid, int verbose, > double tol_chol, int model, int interaction, int ngpreds, > masked_matrix& invvarmatrix, int nullmodel = 0); > }; > > Modified: branches/ProbABEL-0.50/src/regdata.cpp > =================================================================== > --- branches/ProbABEL-0.50/src/regdata.cpp 2014-02-03 22:05:56 UTC (rev 1588) > +++ branches/ProbABEL-0.50/src/regdata.cpp 2014-02-03 22:29:17 UTC (rev 1589) > @@ -175,15 +175,15 @@ > } > } > > +// > +//regdata::~regdata() > +//{ > +// //delete[] regdata::masked_data; > +// // delete X; > +// // delete Y; > +//} > > -regdata::~regdata() > -{ > - delete[] regdata::masked_data; > - // delete X; > - // delete Y; > -} > > - > regdata regdata::get_unmasked_data() > { > regdata to; // = regdata(*this); > > Modified: branches/ProbABEL-0.50/src/regdata.h > =================================================================== > --- branches/ProbABEL-0.50/src/regdata.h 2014-02-03 22:05:56 UTC (rev 1588) > +++ branches/ProbABEL-0.50/src/regdata.h 2014-02-03 22:29:17 UTC (rev 1589) > @@ -38,7 +38,7 @@ > void update_snp(gendata *gend, const int snpnum); > void remove_snp_from_X(); > regdata get_unmasked_data(); > - ~regdata(); > + //~regdata(); > > private: > }; > > _______________________________________________ > Genabel-commits mailing list > Genabel-commits at lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-commits > -- *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* L.C. Karssen Utrecht The Netherlands lennart at karssen.org http://blog.karssen.org GPG key ID: A88F554A -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 230 bytes Desc: OpenPGP digital signature URL: From yurii.aulchenko at gmail.com Tue Feb 18 16:43:35 2014 From: yurii.aulchenko at gmail.com (Yurii Aulchenko) Date: Tue, 18 Feb 2014 16:43:35 +0100 Subject: [GenABEL-dev] Score option in ProbABEL In-Reply-To: <52F7F3BC.6070203@karssen.org> References: <52F7F3BC.6070203@karssen.org> Message-ID: I think it was "too much trouble" to support this (meaning to parse command line correctly; to add code :)) while it is of relatively limited use (even in theory it does not combine with all other analysis options) and usefulness (decrease run time by a factor of ~2 - some times). Y On Sun, Feb 9, 2014 at 10:31 PM, L.C. Karssen wrote: > Dear list, > > I was wondering if one of the developers of the 'early days' knows why > the 'score' option has been disabled since v 0.1-6 of ProbABEL (see the > output of e.g. 'palinear -p p.phe -i i.info -d d.dose --score': > > probabel v. 0.4.2 > (C) Yurii Aulchenko, Lennart C. Karssen, Maksim Struchalin, EMCR > > Using EIGEN version 3.2.0 for matrix operations > option --score suppressed from v 0.1-6 > > > If this option is no longer used we could remove its code to reduce > clutter. > > Looking forward to hearing from you! > > Lennart. > -- > *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* > L.C. Karssen > Utrecht > The Netherlands > > lennart at karssen.org > http://blog.karssen.org > GPG key ID: A88F554A > -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > > _______________________________________________ > genabel-devel mailing list > genabel-devel at lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-devel > -- ----------------------------------------------------- Yurii S. Aulchenko [ LinkedIn ] [ Twitter] [ Blog ] -------------- next part -------------- An HTML attachment was scrubbed... URL: From alvaro.frank at rwth-aachen.de Tue Feb 18 17:16:53 2014 From: alvaro.frank at rwth-aachen.de (Frank, Alvaro Jesus) Date: Tue, 18 Feb 2014 16:16:53 +0000 Subject: [GenABEL-dev] jenkins gcc to g++ Message-ID: <244CF001646FF74FB34F372310A332C57A9C45@MBX2.rwth-ad.de> Hi all, I have been trying to replicate Jenkins behavior locally to avoid unnecessary numbers commit>bugfix that could be committed at once. but the project locally ahs to be compiled using g++ and not gcc. Jenkins uses gcc for the unused variables warnings. Is there a way to perhaps change https://jenkins.genabel.org/jenkins/job/OmicABELnoMM/ to check using g++ for more consistent results? Thank you for the help. -Alvaro -------------- next part -------------- An HTML attachment was scrubbed... URL: From lennart at karssen.org Tue Feb 18 17:49:49 2014 From: lennart at karssen.org (L.C. Karssen) Date: Tue, 18 Feb 2014 17:49:49 +0100 Subject: [GenABEL-dev] jenkins gcc to g++ In-Reply-To: <244CF001646FF74FB34F372310A332C57A9C45@MBX2.rwth-ad.de> References: <244CF001646FF74FB34F372310A332C57A9C45@MBX2.rwth-ad.de> Message-ID: <53038F2D.8060807@karssen.org> Hi Alvaro, Thank you for looking into this! On 18-02-14 17:16, Frank, Alvaro Jesus wrote: > Hi all, > > I have been trying to replicate Jenkins behavior locally to avoid > unnecessary numbers commit>bugfix that could be committed at once. but > the project locally ahs to be compiled using g++ and not gcc. Jenkins > uses gcc for the unused variables warnings. If I understand you correctly, you mean that the output of the "GNU Make + GNU C compiler warnings" is run by gcc instead of g++. Right? I didn't check in detail which compiler is used by this check, but in the Jenkins config it says that it uses the console log (see URL in the next sentence). If I look at the console output of the last build (http://www.karssen.org/jenkins/job/OmicABELnoMM/18/console) I see the same warnings pop up. For example: g++ -DHAVE_CONFIG_H -I. -I./src -Wall -fopenmp -g -O2 -MT src/Algorithm.o -MD -MP -MF $depbase.Tpo -c -o src/Algorithm.o src/Algorithm.cpp &&\ mv -f $depbase.Tpo $depbase.Po src/AIOwrapper.cpp: In static member function ?static void* AIOwrapper::async_io(void*)?: src/AIOwrapper.cpp:227:82: warning: ignoring return value of ?size_t fread(void*, size_t, size_t, FILE*)?, declared with attribute warn_unused_result [-Wunused-result] fread (tobeFilled->buff, sizeof(type_precision), size_buff, fp_Y); So I'm not sure if there is a problem with the "Gnu Make + ..." check. What the Jenkins build does is the following (Jenkins runs on an Ubuntu 13.10 machine, so look there for the exact package versions of automake, gcc, etc.): - Check SVN every 15 minutes for changes - If there are changes, run the following: - Remove files not in SVN (e.g. Makefile.in and .o files from previous builds) - Count lines of code (sloccount) and run cppcheck: sloccount --duplicates --wide --details src/ | grep -vP ".svn|cppcheck-result.xml|sloccount.sc" > sloccount.sc cppcheck --quiet --enable=all --xml src/ 2> cppcheck-result.xml - Run cpplint.py: #!/bin/bash -x cpplint.py --filter=-whitespace/tab,-whitespace/comments,-whitespace/newline,-whitespace/braces,-build/header_guard,-build/include src/*.{cpp,h} 2> src/cpplint.log exit 0 - Do the actual build: autoreconf -i if [ -f Makefile ]; then make distclean fi ./configure --disable-silent-rules LDFLAGS="-L/usr/lib/openblas-base" make -j2 - Scan for compiler warnings ("Gnu Make + ..."). - Publish cppcheck results - Publish sloccount results - Report violations from cpplint.log Best, Lennart. > Is there a way to perhaps change > https://jenkins.genabel.org/jenkins/job/OmicABELnoMM/ to check using g++ > for more consistent results? > > Thank you for the help. > > -Alvaro > > > _______________________________________________ > genabel-devel mailing list > genabel-devel at lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-devel > -- *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* L.C. Karssen Utrecht The Netherlands lennart at karssen.org http://blog.karssen.org GPG key ID: A88F554A -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 230 bytes Desc: OpenPGP digital signature URL: From alvaro.frank at rwth-aachen.de Tue Feb 18 17:56:34 2014 From: alvaro.frank at rwth-aachen.de (Frank, Alvaro Jesus) Date: Tue, 18 Feb 2014 16:56:34 +0000 Subject: [GenABEL-dev] jenkins gcc to g++ In-Reply-To: <53038F2D.8060807@karssen.org> References: <244CF001646FF74FB34F372310A332C57A9C45@MBX2.rwth-ad.de>, <53038F2D.8060807@karssen.org> Message-ID: <244CF001646FF74FB34F372310A332C57A9C67@MBX2.rwth-ad.de> Hi Lennart, thank you for the quick response, it is interesting to note that using g++ *.cpp -L/usr/lib/openblas-base -lpthread -lopenblas -llapacke -fopenmp -Wall -pedantic -Wunused-result -Wmaybe-uninitialized wont yield the warnings from the "-Wmaybe-uninitialized" flag, but adding the optimizations "-02" will: g++ *.cpp -L/usr/lib/openblas-base -lpthread -lopenblas -llapacke -fopenmp -O2 -Wall -pedantic -Wunused-result -Wmaybe-uninitialized O2 seems to trigger the warnings only when present. -Alvaro ________________________________________ From: genabel-devel-bounces at lists.r-forge.r-project.org [genabel-devel-bounces at lists.r-forge.r-project.org] on behalf of L.C. Karssen [lennart at karssen.org] Sent: Tuesday, February 18, 2014 5:49 PM To: genabel-devel at lists.r-forge.r-project.org Subject: Re: [GenABEL-dev] jenkins gcc to g++ Hi Alvaro, Thank you for looking into this! On 18-02-14 17:16, Frank, Alvaro Jesus wrote: > Hi all, > > I have been trying to replicate Jenkins behavior locally to avoid > unnecessary numbers commit>bugfix that could be committed at once. but > the project locally ahs to be compiled using g++ and not gcc. Jenkins > uses gcc for the unused variables warnings. If I understand you correctly, you mean that the output of the "GNU Make + GNU C compiler warnings" is run by gcc instead of g++. Right? I didn't check in detail which compiler is used by this check, but in the Jenkins config it says that it uses the console log (see URL in the next sentence). If I look at the console output of the last build (http://www.karssen.org/jenkins/job/OmicABELnoMM/18/console) I see the same warnings pop up. For example: g++ -DHAVE_CONFIG_H -I. -I./src -Wall -fopenmp -g -O2 -MT src/Algorithm.o -MD -MP -MF $depbase.Tpo -c -o src/Algorithm.o src/Algorithm.cpp &&\ mv -f $depbase.Tpo $depbase.Po src/AIOwrapper.cpp: In static member function ?static void* AIOwrapper::async_io(void*)?: src/AIOwrapper.cpp:227:82: warning: ignoring return value of ?size_t fread(void*, size_t, size_t, FILE*)?, declared with attribute warn_unused_result [-Wunused-result] fread (tobeFilled->buff, sizeof(type_precision), size_buff, fp_Y); So I'm not sure if there is a problem with the "Gnu Make + ..." check. What the Jenkins build does is the following (Jenkins runs on an Ubuntu 13.10 machine, so look there for the exact package versions of automake, gcc, etc.): - Check SVN every 15 minutes for changes - If there are changes, run the following: - Remove files not in SVN (e.g. Makefile.in and .o files from previous builds) - Count lines of code (sloccount) and run cppcheck: sloccount --duplicates --wide --details src/ | grep -vP ".svn|cppcheck-result.xml|sloccount.sc" > sloccount.sc cppcheck --quiet --enable=all --xml src/ 2> cppcheck-result.xml - Run cpplint.py: #!/bin/bash -x cpplint.py --filter=-whitespace/tab,-whitespace/comments,-whitespace/newline,-whitespace/braces,-build/header_guard,-build/include src/*.{cpp,h} 2> src/cpplint.log exit 0 - Do the actual build: autoreconf -i if [ -f Makefile ]; then make distclean fi ./configure --disable-silent-rules LDFLAGS="-L/usr/lib/openblas-base" make -j2 - Scan for compiler warnings ("Gnu Make + ..."). - Publish cppcheck results - Publish sloccount results - Report violations from cpplint.log Best, Lennart. > Is there a way to perhaps change > https://jenkins.genabel.org/jenkins/job/OmicABELnoMM/ to check using g++ > for more consistent results? > > Thank you for the help. > > -Alvaro > > > _______________________________________________ > genabel-devel mailing list > genabel-devel at lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-devel > -- *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* L.C. Karssen Utrecht The Netherlands lennart at karssen.org http://blog.karssen.org GPG key ID: A88F554A -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- From lennart at karssen.org Tue Feb 18 18:08:41 2014 From: lennart at karssen.org (L.C. Karssen) Date: Tue, 18 Feb 2014 18:08:41 +0100 Subject: [GenABEL-dev] jenkins gcc to g++ In-Reply-To: <244CF001646FF74FB34F372310A332C57A9C67@MBX2.rwth-ad.de> References: <244CF001646FF74FB34F372310A332C57A9C45@MBX2.rwth-ad.de>, <53038F2D.8060807@karssen.org> <244CF001646FF74FB34F372310A332C57A9C67@MBX2.rwth-ad.de> Message-ID: <53039399.2020302@karssen.org> Hi Alvaro, On 18-02-14 17:56, Frank, Alvaro Jesus wrote: > Hi Lennart, > > thank you for the quick response, it is interesting to note that using > > g++ *.cpp -L/usr/lib/openblas-base -lpthread -lopenblas -llapacke -fopenmp -Wall -pedantic -Wunused-result -Wmaybe-uninitialized > > wont yield the warnings from the "-Wmaybe-uninitialized" flag, but adding the optimizations "-02" will: > > g++ *.cpp -L/usr/lib/openblas-base -lpthread -lopenblas -llapacke -fopenmp -O2 -Wall -pedantic -Wunused-result -Wmaybe-uninitialized > > O2 seems to trigger the warnings only when present. That's interesting! Learned something new. I guess that when using -O2 the optimisations may be such that it cannot guarantee certain initialisations. You probably know more about compiler optimisations, but my understanding is that -O2 is sort of the least -O flag you should use if you want to make use of the capabilities of current hardware. Maybe it's worth trying to profile your code with and without the -O2 option to see what the difference in speed is. By the way, the -O2 is added in configure.ac (if the user didn't specify CPPFLAGS when running ./configure. Best, Lennart. > > -Alvaro > > > ________________________________________ > From: genabel-devel-bounces at lists.r-forge.r-project.org [genabel-devel-bounces at lists.r-forge.r-project.org] on behalf of L.C. Karssen [lennart at karssen.org] > Sent: Tuesday, February 18, 2014 5:49 PM > To: genabel-devel at lists.r-forge.r-project.org > Subject: Re: [GenABEL-dev] jenkins gcc to g++ > > Hi Alvaro, > > Thank you for looking into this! > > On 18-02-14 17:16, Frank, Alvaro Jesus wrote: >> Hi all, >> >> I have been trying to replicate Jenkins behavior locally to avoid >> unnecessary numbers commit>bugfix that could be committed at once. but >> the project locally ahs to be compiled using g++ and not gcc. Jenkins >> uses gcc for the unused variables warnings. > > If I understand you correctly, you mean that the output of the "GNU Make > + GNU C compiler warnings" is run by gcc instead of g++. Right? > I didn't check in detail which compiler is used by this check, but in > the Jenkins config it says that it uses the console log (see URL in the > next sentence). > > If I look at the console output of the last build > (http://www.karssen.org/jenkins/job/OmicABELnoMM/18/console) I see the > same warnings pop up. For example: > > g++ -DHAVE_CONFIG_H -I. -I./src -Wall -fopenmp -g -O2 -MT > src/Algorithm.o -MD -MP -MF $depbase.Tpo -c -o src/Algorithm.o > src/Algorithm.cpp &&\ > mv -f $depbase.Tpo $depbase.Po > src/AIOwrapper.cpp: In static member function ?static void* > AIOwrapper::async_io(void*)?: > src/AIOwrapper.cpp:227:82: warning: ignoring return value of ?size_t > fread(void*, size_t, size_t, FILE*)?, declared with attribute > warn_unused_result [-Wunused-result] > fread (tobeFilled->buff, sizeof(type_precision), > size_buff, fp_Y); > > So I'm not sure if there is a problem with the "Gnu Make + ..." check. > > What the Jenkins build does is the following (Jenkins runs on an Ubuntu > 13.10 machine, so look there for the exact package versions of automake, > gcc, etc.): > > - Check SVN every 15 minutes for changes > > - If there are changes, run the following: > > - Remove files not in SVN (e.g. Makefile.in and .o files from previous > builds) > > - Count lines of code (sloccount) and run cppcheck: > sloccount --duplicates --wide --details src/ | grep -vP > ".svn|cppcheck-result.xml|sloccount.sc" > sloccount.sc > cppcheck --quiet --enable=all --xml src/ 2> cppcheck-result.xml > > - Run cpplint.py: > #!/bin/bash -x > cpplint.py > --filter=-whitespace/tab,-whitespace/comments,-whitespace/newline,-whitespace/braces,-build/header_guard,-build/include > src/*.{cpp,h} 2> src/cpplint.log > exit 0 > > - Do the actual build: > autoreconf -i > if [ -f Makefile ]; then > make distclean > fi > ./configure --disable-silent-rules LDFLAGS="-L/usr/lib/openblas-base" > make -j2 > > - Scan for compiler warnings ("Gnu Make + ..."). > - Publish cppcheck results > - Publish sloccount results > - Report violations from cpplint.log > > > Best, > > Lennart. > >> Is there a way to perhaps change >> https://jenkins.genabel.org/jenkins/job/OmicABELnoMM/ to check using g++ >> for more consistent results? >> >> Thank you for the help. >> >> -Alvaro >> >> >> _______________________________________________ >> genabel-devel mailing list >> genabel-devel at lists.r-forge.r-project.org >> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-devel >> > > -- > *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* > L.C. Karssen > Utrecht > The Netherlands > > lennart at karssen.org > http://blog.karssen.org > GPG key ID: A88F554A > -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > -- *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* L.C. Karssen Utrecht The Netherlands lennart at karssen.org http://blog.karssen.org GPG key ID: A88F554A -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 230 bytes Desc: OpenPGP digital signature URL: From lennart at karssen.org Sun Feb 23 23:33:38 2014 From: lennart at karssen.org (L.C. Karssen) Date: Sun, 23 Feb 2014 23:33:38 +0100 Subject: [GenABEL-dev] Problem when loading filevector files in current DatABEL on CRAN (?) Message-ID: <530A7742.3020006@karssen.org> Dear all, I was trying to load a filevector/DatABEL file in R today using R 3.0.2 and DatABEL 0.9-4 (from CRAN). I tried several files (e.g. the ones included in the ProbABEL examples directory) and always got the following error: library(DatABEL) DatABEL v.0.9-4 (March 12, 2013) loaded > databel("./mach1.dose.large") uninames$unique.names = TRUE uninames$unique.rownames = TRUE uninames$unique.colnames = TRUE backingfilename = ./mach1.dose.large cachesizeMb = 64 number of columns (variables) = 5000 number of rows (observations) = 1320 usedRowIndex: 1 2 3 4 5 ... usedColIndex: 1 2 3 4 5 6 7 8 9 10 ... Upper-left 10 columns and 5 rows: file contains data of unknown type 5 Error in !.Call("assignDoubleMatrix", from at data, newi, newj, ret, as.integer(1)) : invalid argument type After I checked out the latest version from SVN, built it (using the makedistrib_DatABEL.sh script) and installed it (I gave it a fake 0.9-5 version number) I was able to read the file: > library(DatABEL) DatABEL v.0.9-5 (March 12, 2013) loaded Installed DatABEL version (0.9-5) is not the same as stable version available from CRAN (0.9-4). Unless used intentionally, consider updating to the latest CRAN version. For that, use 'install.packages("DatABEL")', or ask your system administrator to update the package. > databel("./mach1.dose.large") uninames$unique.names = TRUE uninames$unique.rownames = TRUE uninames$unique.colnames = TRUE backingfilename = ./mach1.dose.large cachesizeMb = 64 number of columns (variables) = 5000 number of rows (observations) = 1320 usedRowIndex: 1 2 3 4 5 ... usedColIndex: 1 2 3 4 5 6 7 8 9 10 ... Upper-left 10 columns and 5 rows: rs48146833818 rs60765062039 rs61390741602 rs14182581817 rs72744993535 id1 0.472 1.369 0.001 0.555 1.955 id2 1.983 1.992 1.984 1.985 1.999 id3 1.112 1.897 0.991 1.115 1.981 id4 0.307 1.523 0.001 0.330 1.960 id5 0.519 0.988 0.003 0.533 1.727 rs61166101522 rs130430004482 rs60542571458 rs60866164126 rs60394033150 id1 2 2 0.064 0.789 0.427 id2 2 2 1.969 1.203 0.545 id3 2 2 1.002 0.868 0.442 id4 2 2 0.048 0.568 0.308 id5 2 2 0.161 1.092 0.939 > Any reason why this happened? As far as I traced back in SVN I can see that both Maksim and I made some changes in the DatABEL code in the past few months, but they don't seem to be in relevant sections of the code. Maybe this has to do with changes we made in filevector (fvlib)... Anyway, can somebody else verify this? If so, we should upload a new version to CRAN ASAP. Thanks, Lennart. P.S. If this is indeed related to changes in fvlib it makes the changes to the way we use fvlib Maksim, Yurii and I proposed earlier even more urgent (see http://lists.r-forge.r-project.org/pipermail/genabel-devel/2014-February/000958.html). Looking forward to any comments you may have on that proposal as well! -- *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* L.C. Karssen Utrecht The Netherlands lennart at karssen.org http://blog.karssen.org GPG key ID: A88F554A -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 230 bytes Desc: OpenPGP digital signature URL: From lennart at karssen.org Thu Feb 27 23:46:57 2014 From: lennart at karssen.org (L.C. Karssen) Date: Thu, 27 Feb 2014 23:46:57 +0100 Subject: [GenABEL-dev] [Genabel-commits] r1625 - branches/ProbABEL-0.50/src In-Reply-To: <20140227215638.BC3BA186EA1@r-forge.r-project.org> References: <20140227215638.BC3BA186EA1@r-forge.r-project.org> Message-ID: <530FC061.6050002@karssen.org> Hi Maarten, On 27-02-14 22:56, noreply at r-forge.r-project.org wrote: > Author: maartenk > Date: 2014-02-27 22:56:38 +0100 (Thu, 27 Feb 2014) > New Revision: 1625 > > Modified: > branches/ProbABEL-0.50/src/reg1.cpp > Log: > using predefined matrices in mmscore method. Initial testing showed a 35% speedup in the regression part with(in a separate toy program to test regression) So you're saying that using predefined Matrix sizes speeds up the computation by roughly a third? Wow! SO if I understand it correctly, the allocation of an fixed/known sized matrix followed by matrix multiplication is much faster than in the case that dimensions of the matrix are not fixed... Right? > > Modified: branches/ProbABEL-0.50/src/reg1.cpp > =================================================================== > --- branches/ProbABEL-0.50/src/reg1.cpp 2014-02-26 21:43:42 UTC (rev 1624) > +++ branches/ProbABEL-0.50/src/reg1.cpp 2014-02-27 21:56:38 UTC (rev 1625) > @@ -357,6 +357,7 @@ > double sigma2_internal; > > #if EIGEN > + > LDLT Ch; > #else > mematrix tXX_i; > @@ -373,12 +374,30 @@ > //Oct 26, 2009 > > #if EIGEN > - // next line is 5997000 flops > - MatrixXd tXW = X.data.transpose() * invvarmatrixin.masked_data->data; > - Ch = LDLT (tXW * X.data); // 17991 flops > - beta.data = Ch.solve(tXW * reg_data.Y.data);//5997 flops > - //next line is: 1000+5000+3000= 9000 flops > - sigma2 = (reg_data.Y.data - tXW.transpose() * beta.data).squaredNorm(); > + cout << "BB"< + if (X.data.cols()== 3){ > + Matrix tXW = X.data.transpose()*invvarmatrixin.masked_data->data; > + Matrix3d xWx = tXW * X.data; > + Ch = LDLT (xWx ); > + Vector3d beta_3f = Ch.solve(tXW * reg_data.Y.data); > + sigma2 = (reg_data.Y.data - tXW.transpose() * beta_3f).squaredNorm(); > + beta.data = beta_3f; The two lines above are repeated almost identically in the cases below. Wouldn't it make more sense to simple call the Vector{3d,2d,beta.data} in each of the cases 'betaf'. Then you could take the sigma2 calculation and assignment to beta.data out of the ifs. Like this: Vector3d betaf = Ch.solve(tXW * reg_data.Y.data); } ... the else if and else here... } sigma2 = (reg_data.Y.data - tXW.transpose() * betaf).squaredNorm(); beta.data = betaf; #else Thanks! Lennart. > + } > + else if(X.data.cols()== 2){ > + Matrix tXW = X.data.transpose()*invvarmatrixin.masked_data->data; > + Matrix2d xWx = tXW * X.data; > + Ch = LDLT (xWx ); > + Vector2d beta_2f = Ch.solve(tXW * reg_data.Y.data); > + sigma2 = (reg_data.Y.data - tXW.transpose() * beta_2f).squaredNorm(); > + beta.data = beta_2f; > + }else{ > + // next line is 5997000 flops > + MatrixXd tXW = X.data.transpose() * invvarmatrixin.masked_data->data; > + Ch = LDLT (tXW * X.data); // 17991 flops > + beta.data = Ch.solve(tXW * reg_data.Y.data);//5997 flops > + //next line is: 1000+5000+3000= 9000 flops > + sigma2 = (reg_data.Y.data - tXW.transpose() * beta.data).squaredNorm(); > + } > #else > // next line is 5997000 flops > mematrix tXW = transpose(X) * invvarmatrixin.masked_data; > > _______________________________________________ > Genabel-commits mailing list > Genabel-commits at lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-commits > -- *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* L.C. Karssen Utrecht The Netherlands lennart at karssen.org http://blog.karssen.org GPG key ID: A88F554A -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 230 bytes Desc: OpenPGP digital signature URL: From shenxia911 at gmail.com Fri Feb 28 09:39:12 2014 From: shenxia911 at gmail.com (Xia Shen) Date: Fri, 28 Feb 2014 09:39:12 +0100 Subject: [GenABEL-dev] Suggested change of default weight in GenABEL/ibs() Message-ID: <768CB804-C3EF-4E6A-B524-937A1B54331C@gmail.com> Hi, I suggest to change the default weight argument in the GenABEL/ibs() function to be set to ?freq? instead of ?no?. I have colleagues constantly forget to set to ?freq? and produce, what I would call, ?wrong? kinship matrix. Xia Shen PhD Division of Computational Genetics Department of Clinical Science Swedish University of Agricultural Sciences Uppsala, Sweden www.shen.se -------------- next part -------------- An HTML attachment was scrubbed... URL: From yurii.aulchenko at gmail.com Fri Feb 28 14:15:36 2014 From: yurii.aulchenko at gmail.com (Yurii Aulchenko) Date: Fri, 28 Feb 2014 20:15:36 +0700 Subject: [GenABEL-dev] Suggested change of default weight in GenABEL/ibs() In-Reply-To: <768CB804-C3EF-4E6A-B524-937A1B54331C@gmail.com> References: <768CB804-C3EF-4E6A-B524-937A1B54331C@gmail.com> Message-ID: <-317756408431031488@unknownmsgid> In principle I agree this is good idea, rarely "no" (default) option is used; but I am always worried to change defaults as this may destroy people pipelines. We need third opinion :) Best, Y ---------------------- Yurii Aulchenko (sent from mobile device) On Feb 28, 2014, at 3:45 PM, Xia Shen wrote: Hi, I suggest to change the default weight argument in the GenABEL/ibs() function to be set to "freq" instead of "no". I have colleagues constantly forget to set to "freq" and produce, what I would call, "wrong" kinship matrix. *Xia Shen* PhD Division of Computational Genetics Department of Clinical Science *Swedish University of Agricultural Sciences* Uppsala, Sweden www.shen.se _______________________________________________ genabel-devel mailing list genabel-devel at lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-devel -------------- next part -------------- An HTML attachment was scrubbed... URL: From maoj at mail.nih.gov Fri Feb 28 19:51:15 2014 From: maoj at mail.nih.gov (Jean Mao) Date: Fri, 28 Feb 2014 13:51:15 -0500 Subject: [GenABEL-dev] Error wil testing ProbABEL 0.4.2 Message-ID: <5310DAA3.4020405@mail.nih.gov> Hi, Thank you very much for providing this software to scientific community. We have installed it in our cluster for NIH scientists. Recently, while trying to update to 0.4.2 version, I ran into error message when testing the installation. Attached is the log file. Any help will be appreciated. Thank you. Jean Mao Helix Staff CIT, NIH -------------- next part -------------- =================================================== ProbABEL 0.4.2: checks/R-tests/test-suite.log =================================================== # TOTAL: 3 # PASS: 1 # SKIP: 0 # XFAIL: 1 # FAIL: 1 # XPASS: 0 # ERROR: 0 .. contents:: :depth: 2 XFAIL: run_R_test_palogist.sh ============================= Checking logistic regression... Dose: check consistency of names OK Prob: check consistency of names OK Check consistency dose <-> prob gtdata OK Running ProbABEL... OK Comparing R output with ProbABEL output Error: all.equal(dose.add.PA, dose.add.R, tol = tol) are not all TRUE Execution halted FAIL: run_R_test_pacox.sh ========================= Checking Cox PH regression... Loading required package: splines Dose: check consistency of names OK Prob: check consistency of names OK Check consistency dose <-> prob gtdata OK Running ProbABEL... OK Comparing R output with ProbABEL output Error: all.equal(dose.add.PA, dose.add.R, tol = tol) are not all TRUE Execution halted From kooyman at gmail.com Fri Feb 28 22:21:28 2014 From: kooyman at gmail.com (Maarten Kooyman) Date: Fri, 28 Feb 2014 22:21:28 +0100 Subject: [GenABEL-dev] Error wil testing ProbABEL 0.4.2 In-Reply-To: <5310DAA3.4020405@mail.nih.gov> References: <5310DAA3.4020405@mail.nih.gov> Message-ID: <5310FDD8.6000705@gmail.com> Dear Jean, Can you please send the output of ./configure and make. This helps to recreate the error and inspect the source of the problem. Kind regards, Maarten On 28-02-14 19:51, Jean Mao wrote: > Hi, > > Thank you very much for providing this software to scientific > community. We have installed it in our cluster for NIH scientists. > > Recently, while trying to update to 0.4.2 version, I ran into error > message when testing the installation. Attached is the log file. Any > help will be appreciated. Thank you. > > Jean Mao > Helix Staff > CIT, NIH > > > _______________________________________________ > genabel-devel mailing list > genabel-devel at lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-devel -------------- next part -------------- An HTML attachment was scrubbed... URL: