如何在远程GPU上运行R脚本?

时间:2018-07-07 12:34:12

标签: r remote-access

我正在尝试在研究所提供的GPU服务器上运行r脚本。 GPU服务器的规格如下:

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">

<ScrollView
    android:layout_width="match_parent"
    android:layout_height="250dp"

    android:id="@+id/myScrollView">

    <android.support.constraint.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <TextView
            android:id="@+id/txtViewExpense"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="8dp"
            android:layout_marginStart="8dp"
            android:layout_marginTop="10dp"
            android:text="@string/expense"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <EditText
            android:id="@+id/txtExpenseValue"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="10dp"
            android:layout_marginTop="5dp"
            android:ems="10"
            android:inputType="textPersonName"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/txtViewExpense" />

        <TextView
            android:id="@+id/txtViewPrice"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="10dp"
            android:layout_marginTop="10dp"
            android:text="@string/expense_price"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/txtExpenseValue" />

        <EditText
            android:id="@+id/txtViewPriceValue"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="8dp"
            android:layout_marginTop="5dp"
            android:ems="10"
            android:inputType="number"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/txtViewPrice" />

        <TextView
            android:id="@+id/txtViewCategory"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="10dp"
            android:layout_marginStart="10dp"
            android:layout_marginTop="10dp"
            android:text="@string/expense_category"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/txtViewPriceValue" />

        <Spinner
            android:id="@+id/spnCategory"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="10dp"
            android:layout_marginTop="10dp"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/txtViewCategory" />

        <TextView
            android:id="@+id/txtViewFrequency"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="10dp"
            android:layout_marginStart="10dp"
            android:layout_marginTop="5dp"
            android:text="@string/expense_frequency"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/spnCategory" />

        <Spinner
            android:id="@+id/spnFrequency"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="10dp"
            android:layout_marginTop="5dp"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/txtViewFrequency" />

        <TextView
            android:id="@+id/txtViewExpenseDate"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="10dp"
            android:layout_marginTop="5dp"
            android:text="@string/expense_date"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/spnFrequency" />

        <EditText
            android:id="@+id/txtExpenseDateValue"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="10dp"
            android:layout_marginTop="5dp"
            android:ems="10"
            android:inputType="date"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/txtViewExpenseDate" />

        <Button
            android:id="@+id/btnExpenseDate"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="8dp"
            android:layout_marginRight="8dp"
            android:layout_marginTop="5dp"
            android:text="Button"
            app:layout_constraintHorizontal_bias="0.509"
            app:layout_constraintLeft_toRightOf="@+id/txtExpenseDateValue"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/txtViewExpenseDate" />

        <Button
            android:id="@+id/btnRegister"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="8dp"
            android:layout_marginRight="8dp"
            android:layout_marginTop="5dp"
            android:text="Button"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/txtExpenseDateValue" />

    </android.support.constraint.ConstraintLayout>

  </ScrollView>

  <com.baoyz.swipemenulistview.SwipeMenuListView
    android:id="@+id/listViewExpense"
    android:layout_width="0dp"
    android:layout_height="0dp"
    android:layout_marginBottom="10dp"
    android:layout_marginTop="5dp"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toRightOf="parent"
    app:layout_constraintTop_toBottomOf="@+id/myScrollView" />





    </android.support.constraint.ConstraintLayout>

R代码:

Host Name: gpu01.cc.iitk.ac.in,  
Configuration: Four Tesla T10 GPUs added to each machine with 8 cores in each
Operating System: Linux  
Specific Usage: Parallel Programming under Linux using CUDA with C Language

错误:

setwd("~/Documents/tm dataset")
library(ssh)
session <- ssh_connect("dgaurav@gpu01.cc.iitk.ac.in")
print(session)
out <- ssh_exec_wait(session, command = 'articles1_test.R')

1 个答案:

答案 0 :(得分:0)

您的数据集和脚本仅在本地计算机上...您需要先将其迁移到远程服务器,然后才能运行它们。