The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
MatLab alike software in Fedora MULTIVERSE Ubuntu 1 09-14-2007 08:22 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-23-2007
laether laether is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 2
Question qsub and Matlab

I am trying to run a Matlab function, file.m, with qsub. Here is a portion of my .sge file:

echo Starting to run Matlab
matlab -nojvm -nodesktop -r "file('${inputfile}');exit;"
echo finished running Matlab

The last two lines of the Matlab function are:

disp('finished');
exit

So my problem is this: The Matlab function runs fine, I haven't checked to see if it saves the .mat file, but the input file is what it should be, and it displays "finished" in the .o output file, and there are no errors. But I think that after it exits Matlab, UNIX doesn't know that it's finished because the "echo finished running Matlab" in the .sge file does not happen. It gets hung up after the "exit;" and stays in the "r" state when I qstat.

Does anyone have an idea of why this happens and how to fix it?

I can tell you that if I type in the "matlab -nojvm ..." line at the command line in my terminal, it runs fine, no errors, and exits Matlab like it should, and saves the .mat file.

What I don't want is to have to write a Matlab script...the codes right now are nice and compact and I have to pass an input file to the function. I could write a new UNIX script and just put the input file loop in the function and run it at the command line without qsub, but I've written this sge script and I'd like to see it work if it can.

Thanks.
  #2 (permalink)  
Old 10-23-2007
laether laether is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 2
Exclamation One More Thing

Quote:
Originally Posted by laether View Post

I can tell you that if I type in the "matlab -nojvm ..." line at the command line in my terminal, it runs fine, no errors, and exits Matlab like it should, and saves the .mat file.

Thanks.
I forgot to mention that within the Matlab function, there are UNIX commands that create and remove files, such as

run = 'rm temp.file'
unix(run)

Perhaps this is the source of the problem?
Closed Thread

Bookmarks

Tags
unix commands

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 01:52 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0