SlideShare uma empresa Scribd logo
1 de 18
Baixar para ler offline
Rmpi       snow

                   2011   2   27
                          (@mokjpn)




2011   2   27                         1
snow



2011   2   27          2
“R”
                Wiki   RjpWiki




2011   2   27                          3
.....




2011   2   27           4
....




2011   2   27          5
Mac, 8     ....
                12           ....          R CPU
                  100%




2011   2   27                                      6
,
                ,   50       (         5       )

                ,        ,       ,   ID,   ,




2011   2   27                                      7
2       0.3
                          (             )

                1   ±90
                              (
                                            )



2011   2   27                                   8
(5        )
                             ...50
                5

                        (5           )
                    1




2011   2   27                                9
(R        ,                   ...)




                Simple Network of Workstations: snow
                        parLapply




2011   2   27                                          10
snow     ”SOCK”, “MPI”, “PVM”
                                        ,             Mac
                              Leopard       OpenMPI
                                 (/usr/bin/mpirun     )
                MPI

                R      Rmpi


2011   2   27                                               11
50        sample         5
                                         2   )
                          system.time                     (Mac Pro,
                    2.66GHz Quad-Core Xeon), 4


                                35.815           6.944        42.481
                4               5.226            21.670       26.806
                8               5.169            28.009       34.398
                2               7.339            23.668       30.854


2011   2   27                                                          12
snow
                > # Rmpi          snow


                > library(Rmpi)

                > library(snow)

                > cl <- makeCluster(4, “MPI”)

                > #(              :      ).....


                > stopCluster(cl)


2011   2   27                                     13
all2list <- function(cl, all=fakeall, columns=c("OrderAcceptDate.D","Sex",
           "Age", "XFT4000", "XQM9800")) {
             clusterExport(cl,c("all","columns"))
                id <- paste("P",unique(all$PatientID),sep="")
                idlist <- as.list(unique(all$PatientID))
                names(idlist) <- id



             parLapply(cl, idlist, function(x) { ctable <- all[which(all$PatientID ==
           x), columns]
                 return(ctable.sorted <- ctable[order(ctable$OrderAcceptDate.D),])
             } )
           }



                ※                clusterExport
                export                              (RjpWiki “R       ”      )

2011   2   27                                                                           14
OrderAcceptDate.D XFT4000 XQM9800 Admission Age Sex PatientID
                1        2008-11-11      NA    1.13           55   F   5664297
                2        2009-09-11     0.95       0.27            61     M   2989233
                3        2010-05-28     0.82       0.92            70     F   3204964
                4        2007-08-27     0.21       1.01            38     F   7503779
                5        2010-02-18     7.26       0.88            73     M   3090135
                6        2010-02-04     0.50       3.30            63     M   7271333


                       $P2989233

                       OrderAcceptDate.D Sex Age XFT4000 Admission XQM9800
                       2009-01-20         M 60     1.09            0.07
                       2009-02-13         M   60   1.06            0.63
                       2009-03-03         M   60   0.91            0.27
                       2009-09-11         M   61   0.95            0.27
                       2010-05-28         M   61   0.92            0.82
                       2010-06-25         M   62   1.17            0.33
                       2010-06-29         M   62   1.10            6.94


                     ※ID,
2011   2   27                                                                           15
parLapply                 lapply
                 function(x)



                                           unlist        vector

                                                                     rbind



                                                                  parLapply
                 lapply

           # parLapply         : result,                             : d
           d <- data.frame()
           for(n in names(result)) {
             if(!is.null(a <- result[[n]] )) {
               d <<- rbind(d,data.frame(name=n, Sex=a$Sex,Age=a$Age, XFT4000=a$XFT4000))
             }
           }

2011   2   27                                                                              16
Mac R           , Rmpi snow



                parLapply               lapply



                list
                   unlist   ,                    $
                   [[ ]]


2011   2   27                                        17
Rmpi    , snow    ,R                  50




                    R

                                   B5
                           , ISBN 978-4-489-02097-1

                4
2011   2   27                                              18

Mais conteúdo relacionado

Semelhante a Rmpiとsnowで 並列処理

Top500 11/2011 BOF Slides
Top500 11/2011 BOF SlidesTop500 11/2011 BOF Slides
Top500 11/2011 BOF Slidestop500
 
SPICE MODEL of TPC6109-H (Standard+BDS Model) in SPICE PARK
SPICE MODEL of TPC6109-H (Standard+BDS Model) in SPICE PARKSPICE MODEL of TPC6109-H (Standard+BDS Model) in SPICE PARK
SPICE MODEL of TPC6109-H (Standard+BDS Model) in SPICE PARKTsuyoshi Horigome
 
SPICE MODEL of TPCP8102 (Standard+BDS Model) in SPICE PARK
SPICE MODEL of TPCP8102 (Standard+BDS Model) in SPICE PARKSPICE MODEL of TPCP8102 (Standard+BDS Model) in SPICE PARK
SPICE MODEL of TPCP8102 (Standard+BDS Model) in SPICE PARKTsuyoshi Horigome
 
SPICE MODEL of TPCP8102 (Professional+BDP Model) in SPICE PARK
SPICE MODEL of TPCP8102 (Professional+BDP Model) in SPICE PARKSPICE MODEL of TPCP8102 (Professional+BDP Model) in SPICE PARK
SPICE MODEL of TPCP8102 (Professional+BDP Model) in SPICE PARKTsuyoshi Horigome
 
SPICE MODEL of 2SK2350 (Professional+BDP Model) in SPICE PARK
SPICE MODEL of 2SK2350 (Professional+BDP Model) in SPICE PARKSPICE MODEL of 2SK2350 (Professional+BDP Model) in SPICE PARK
SPICE MODEL of 2SK2350 (Professional+BDP Model) in SPICE PARKTsuyoshi Horigome
 
Connor McDonald Partitioning
Connor McDonald PartitioningConnor McDonald Partitioning
Connor McDonald PartitioningInSync Conference
 
SPICE MODEL of 2SK4042 (Professional+BDP Model) in SPICE PARK
SPICE MODEL of 2SK4042 (Professional+BDP Model) in SPICE PARKSPICE MODEL of 2SK4042 (Professional+BDP Model) in SPICE PARK
SPICE MODEL of 2SK4042 (Professional+BDP Model) in SPICE PARKTsuyoshi Horigome
 
76 07
76 0776 07
76 07env76
 
Device Modeling Report of TPC8014(TOSHIBA)
Device Modeling Report of TPC8014(TOSHIBA)Device Modeling Report of TPC8014(TOSHIBA)
Device Modeling Report of TPC8014(TOSHIBA)Tsuyoshi Horigome
 
SPICE MODEL of 2SK2611 (Professional+BDP Model) in SPICE PARK
SPICE MODEL of 2SK2611 (Professional+BDP Model) in SPICE PARKSPICE MODEL of 2SK2611 (Professional+BDP Model) in SPICE PARK
SPICE MODEL of 2SK2611 (Professional+BDP Model) in SPICE PARKTsuyoshi Horigome
 
SPICE MODEL of SF10LC40 (Standard Model) in SPICE PARK
SPICE MODEL of SF10LC40 (Standard Model) in SPICE PARKSPICE MODEL of SF10LC40 (Standard Model) in SPICE PARK
SPICE MODEL of SF10LC40 (Standard Model) in SPICE PARKTsuyoshi Horigome
 
SPICE MODEL of TPCF8104 (Professional+BDP Model) in SPICE PARK
SPICE MODEL of TPCF8104 (Professional+BDP Model) in SPICE PARKSPICE MODEL of TPCF8104 (Professional+BDP Model) in SPICE PARK
SPICE MODEL of TPCF8104 (Professional+BDP Model) in SPICE PARKTsuyoshi Horigome
 
SPICE MODEL of 2SK2543 (Standard+BDS Model) in SPICE PARK
SPICE MODEL of 2SK2543 (Standard+BDS Model) in SPICE PARKSPICE MODEL of 2SK2543 (Standard+BDS Model) in SPICE PARK
SPICE MODEL of 2SK2543 (Standard+BDS Model) in SPICE PARKTsuyoshi Horigome
 
SPICE MODEL of TPC6004 (Professional+BDP Model) in SPICE PARK
SPICE MODEL of TPC6004 (Professional+BDP Model) in SPICE PARKSPICE MODEL of TPC6004 (Professional+BDP Model) in SPICE PARK
SPICE MODEL of TPC6004 (Professional+BDP Model) in SPICE PARKTsuyoshi Horigome
 
SPICE MODEL of 2SK3797 (Professional+BDP Model) in SPICE PARK
SPICE MODEL of 2SK3797 (Professional+BDP Model) in SPICE PARKSPICE MODEL of 2SK3797 (Professional+BDP Model) in SPICE PARK
SPICE MODEL of 2SK3797 (Professional+BDP Model) in SPICE PARKTsuyoshi Horigome
 
SPICE MODEL of 2SJ380 (Professional+BDP Model) in SPICE PARK
SPICE MODEL of 2SJ380 (Professional+BDP Model) in SPICE PARKSPICE MODEL of 2SJ380 (Professional+BDP Model) in SPICE PARK
SPICE MODEL of 2SJ380 (Professional+BDP Model) in SPICE PARKTsuyoshi Horigome
 
SPICE MODEL of TPC8111 (Professional+BDP Model) in SPICE PARK
SPICE MODEL of TPC8111 (Professional+BDP Model) in SPICE PARKSPICE MODEL of TPC8111 (Professional+BDP Model) in SPICE PARK
SPICE MODEL of TPC8111 (Professional+BDP Model) in SPICE PARKTsuyoshi Horigome
 

Semelhante a Rmpiとsnowで 並列処理 (20)

Top500 11/2011 BOF Slides
Top500 11/2011 BOF SlidesTop500 11/2011 BOF Slides
Top500 11/2011 BOF Slides
 
SPICE MODEL of TPC6109-H (Standard+BDS Model) in SPICE PARK
SPICE MODEL of TPC6109-H (Standard+BDS Model) in SPICE PARKSPICE MODEL of TPC6109-H (Standard+BDS Model) in SPICE PARK
SPICE MODEL of TPC6109-H (Standard+BDS Model) in SPICE PARK
 
SPICE MODEL of TPCP8102 (Standard+BDS Model) in SPICE PARK
SPICE MODEL of TPCP8102 (Standard+BDS Model) in SPICE PARKSPICE MODEL of TPCP8102 (Standard+BDS Model) in SPICE PARK
SPICE MODEL of TPCP8102 (Standard+BDS Model) in SPICE PARK
 
SPICE MODEL of TPCP8102 (Professional+BDP Model) in SPICE PARK
SPICE MODEL of TPCP8102 (Professional+BDP Model) in SPICE PARKSPICE MODEL of TPCP8102 (Professional+BDP Model) in SPICE PARK
SPICE MODEL of TPCP8102 (Professional+BDP Model) in SPICE PARK
 
AA-sort with SSE4.1
AA-sort with SSE4.1AA-sort with SSE4.1
AA-sort with SSE4.1
 
SPICE MODEL of 2SK2350 (Professional+BDP Model) in SPICE PARK
SPICE MODEL of 2SK2350 (Professional+BDP Model) in SPICE PARKSPICE MODEL of 2SK2350 (Professional+BDP Model) in SPICE PARK
SPICE MODEL of 2SK2350 (Professional+BDP Model) in SPICE PARK
 
Connor McDonald Partitioning
Connor McDonald PartitioningConnor McDonald Partitioning
Connor McDonald Partitioning
 
SPICE MODEL of 2SK4042 (Professional+BDP Model) in SPICE PARK
SPICE MODEL of 2SK4042 (Professional+BDP Model) in SPICE PARKSPICE MODEL of 2SK4042 (Professional+BDP Model) in SPICE PARK
SPICE MODEL of 2SK4042 (Professional+BDP Model) in SPICE PARK
 
76 07
76 0776 07
76 07
 
Device Modeling Report of TPC8014(TOSHIBA)
Device Modeling Report of TPC8014(TOSHIBA)Device Modeling Report of TPC8014(TOSHIBA)
Device Modeling Report of TPC8014(TOSHIBA)
 
SPICE MODEL of 2SK2611 (Professional+BDP Model) in SPICE PARK
SPICE MODEL of 2SK2611 (Professional+BDP Model) in SPICE PARKSPICE MODEL of 2SK2611 (Professional+BDP Model) in SPICE PARK
SPICE MODEL of 2SK2611 (Professional+BDP Model) in SPICE PARK
 
SPICE MODEL of SF10LC40 (Standard Model) in SPICE PARK
SPICE MODEL of SF10LC40 (Standard Model) in SPICE PARKSPICE MODEL of SF10LC40 (Standard Model) in SPICE PARK
SPICE MODEL of SF10LC40 (Standard Model) in SPICE PARK
 
SPICE MODEL of TPCF8104 (Professional+BDP Model) in SPICE PARK
SPICE MODEL of TPCF8104 (Professional+BDP Model) in SPICE PARKSPICE MODEL of TPCF8104 (Professional+BDP Model) in SPICE PARK
SPICE MODEL of TPCF8104 (Professional+BDP Model) in SPICE PARK
 
SPICE MODEL of 2SK2543 (Standard+BDS Model) in SPICE PARK
SPICE MODEL of 2SK2543 (Standard+BDS Model) in SPICE PARKSPICE MODEL of 2SK2543 (Standard+BDS Model) in SPICE PARK
SPICE MODEL of 2SK2543 (Standard+BDS Model) in SPICE PARK
 
Ch2007slide02
Ch2007slide02Ch2007slide02
Ch2007slide02
 
SPICE MODEL of TPC6004 (Professional+BDP Model) in SPICE PARK
SPICE MODEL of TPC6004 (Professional+BDP Model) in SPICE PARKSPICE MODEL of TPC6004 (Professional+BDP Model) in SPICE PARK
SPICE MODEL of TPC6004 (Professional+BDP Model) in SPICE PARK
 
รายงาน
รายงานรายงาน
รายงาน
 
SPICE MODEL of 2SK3797 (Professional+BDP Model) in SPICE PARK
SPICE MODEL of 2SK3797 (Professional+BDP Model) in SPICE PARKSPICE MODEL of 2SK3797 (Professional+BDP Model) in SPICE PARK
SPICE MODEL of 2SK3797 (Professional+BDP Model) in SPICE PARK
 
SPICE MODEL of 2SJ380 (Professional+BDP Model) in SPICE PARK
SPICE MODEL of 2SJ380 (Professional+BDP Model) in SPICE PARKSPICE MODEL of 2SJ380 (Professional+BDP Model) in SPICE PARK
SPICE MODEL of 2SJ380 (Professional+BDP Model) in SPICE PARK
 
SPICE MODEL of TPC8111 (Professional+BDP Model) in SPICE PARK
SPICE MODEL of TPC8111 (Professional+BDP Model) in SPICE PARKSPICE MODEL of TPC8111 (Professional+BDP Model) in SPICE PARK
SPICE MODEL of TPC8111 (Professional+BDP Model) in SPICE PARK
 

Mais de Masafumi Okada

Rとkerasを使った臨床試験登録情報のテキスト分類
Rとkerasを使った臨床試験登録情報のテキスト分類Rとkerasを使った臨床試験登録情報のテキスト分類
Rとkerasを使った臨床試験登録情報のテキスト分類Masafumi Okada
 
Rとcdisc@moss10 公開用
Rとcdisc@moss10 公開用Rとcdisc@moss10 公開用
Rとcdisc@moss10 公開用Masafumi Okada
 
第19回疫学セミナー 統計解析ソフトRの活用「Rで線形モデル」
第19回疫学セミナー 統計解析ソフトRの活用「Rで線形モデル」第19回疫学セミナー 統計解析ソフトRの活用「Rで線形モデル」
第19回疫学セミナー 統計解析ソフトRの活用「Rで線形モデル」Masafumi Okada
 
FOSS4G 2009 Tokyo (R and Geo) in Japanese
FOSS4G 2009 Tokyo (R and Geo) in JapaneseFOSS4G 2009 Tokyo (R and Geo) in Japanese
FOSS4G 2009 Tokyo (R and Geo) in JapaneseMasafumi Okada
 

Mais de Masafumi Okada (7)

Rとkerasを使った臨床試験登録情報のテキスト分類
Rとkerasを使った臨床試験登録情報のテキスト分類Rとkerasを使った臨床試験登録情報のテキスト分類
Rとkerasを使った臨床試験登録情報のテキスト分類
 
RとIoT
RとIoTRとIoT
RとIoT
 
Rとcdisc@moss10 公開用
Rとcdisc@moss10 公開用Rとcdisc@moss10 公開用
Rとcdisc@moss10 公開用
 
RとCDISC
RとCDISCRとCDISC
RとCDISC
 
第19回疫学セミナー 統計解析ソフトRの活用「Rで線形モデル」
第19回疫学セミナー 統計解析ソフトRの活用「Rで線形モデル」第19回疫学セミナー 統計解析ソフトRの活用「Rで線形モデル」
第19回疫学セミナー 統計解析ソフトRの活用「Rで線形モデル」
 
R新機能抄出
R新機能抄出R新機能抄出
R新機能抄出
 
FOSS4G 2009 Tokyo (R and Geo) in Japanese
FOSS4G 2009 Tokyo (R and Geo) in JapaneseFOSS4G 2009 Tokyo (R and Geo) in Japanese
FOSS4G 2009 Tokyo (R and Geo) in Japanese
 

Rmpiとsnowで 並列処理

  • 1. Rmpi snow 2011 2 27 (@mokjpn) 2011 2 27 1
  • 2. snow 2011 2 27 2
  • 3. “R” Wiki RjpWiki 2011 2 27 3
  • 4. ..... 2011 2 27 4
  • 5. .... 2011 2 27 5
  • 6. Mac, 8 .... 12 .... R CPU 100% 2011 2 27 6
  • 7. , , 50 ( 5 ) , , , ID, , 2011 2 27 7
  • 8. 2 0.3 ( ) 1 ±90 ( ) 2011 2 27 8
  • 9. (5 ) ...50 5 (5 ) 1 2011 2 27 9
  • 10. (R , ...) Simple Network of Workstations: snow parLapply 2011 2 27 10
  • 11. snow ”SOCK”, “MPI”, “PVM” , Mac Leopard OpenMPI (/usr/bin/mpirun ) MPI R Rmpi 2011 2 27 11
  • 12. 50 sample 5 2 ) system.time (Mac Pro, 2.66GHz Quad-Core Xeon), 4 35.815 6.944 42.481 4 5.226 21.670 26.806 8 5.169 28.009 34.398 2 7.339 23.668 30.854 2011 2 27 12
  • 13. snow > # Rmpi snow > library(Rmpi) > library(snow) > cl <- makeCluster(4, “MPI”) > #( : )..... > stopCluster(cl) 2011 2 27 13
  • 14. all2list <- function(cl, all=fakeall, columns=c("OrderAcceptDate.D","Sex", "Age", "XFT4000", "XQM9800")) { clusterExport(cl,c("all","columns")) id <- paste("P",unique(all$PatientID),sep="") idlist <- as.list(unique(all$PatientID)) names(idlist) <- id parLapply(cl, idlist, function(x) { ctable <- all[which(all$PatientID == x), columns] return(ctable.sorted <- ctable[order(ctable$OrderAcceptDate.D),]) } ) } ※ clusterExport export (RjpWiki “R ” ) 2011 2 27 14
  • 15. OrderAcceptDate.D XFT4000 XQM9800 Admission Age Sex PatientID 1 2008-11-11 NA 1.13 55 F 5664297 2 2009-09-11 0.95 0.27 61 M 2989233 3 2010-05-28 0.82 0.92 70 F 3204964 4 2007-08-27 0.21 1.01 38 F 7503779 5 2010-02-18 7.26 0.88 73 M 3090135 6 2010-02-04 0.50 3.30 63 M 7271333 $P2989233 OrderAcceptDate.D Sex Age XFT4000 Admission XQM9800 2009-01-20 M 60 1.09 0.07 2009-02-13 M 60 1.06 0.63 2009-03-03 M 60 0.91 0.27 2009-09-11 M 61 0.95 0.27 2010-05-28 M 61 0.92 0.82 2010-06-25 M 62 1.17 0.33 2010-06-29 M 62 1.10 6.94 ※ID, 2011 2 27 15
  • 16. parLapply lapply function(x) unlist vector rbind parLapply lapply # parLapply : result, : d d <- data.frame() for(n in names(result)) { if(!is.null(a <- result[[n]] )) { d <<- rbind(d,data.frame(name=n, Sex=a$Sex,Age=a$Age, XFT4000=a$XFT4000)) } } 2011 2 27 16
  • 17. Mac R , Rmpi snow parLapply lapply list unlist , $ [[ ]] 2011 2 27 17
  • 18. Rmpi , snow ,R 50 R B5 , ISBN 978-4-489-02097-1 4 2011 2 27 18