Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Job option in Batch command

Jean-Christophe Lavocat

Please login with a confirmed email address before reporting spam

Hi all,

I add trouble when using the batch command recently. I prepared one file with a parametric study (different amplitudes are used in a time dependent problem).

I didn't try yet the -pname and -plist option, but instead I tried to prepare my file with a parametric study ( I entered all my values), I also set the cluster settings so I can run them in parralel.

But then, when I tried to run it via batch, the option was not recognized... the job name was not recognized. I thus wonder how to call a dedicate study from one saved file. Let say that I have one of my study which is called 'parametrik' ... I want to use batch to compute this dedicate job. Is it possible? How should I write the command?



Here is the code I used :
comsol batch -inputfile batch_file.mph -outputfile batch_file.OUT.mph -job parametrik

Here is the log message :
Unknown_batch_feature
Exception:
com.comsol.util.exceptions.FlException: Unknown batch feature
Messages:
Unknown batch feature
- Tag: parametrik

5 Replies Last Post 3 déc. 2013, 22:10 UTC−5
Jean-Christophe Lavocat

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 14 janv. 2011, 03:54 UTC−5
I tried to launch it in various ways, but without success.

Is there anyone here who know how to name a study (within a model), and launch this study with a batch command?
I tried to launch it in various ways, but without success. Is there anyone here who know how to name a study (within a model), and launch this study with a batch command?

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 10 juin 2011, 11:13 UTC−4
Dear Jean-Christophe,
I would like to run batch jobs too, but I stuck at the same point as you did. Have you found out how to name the study or the batch job to run the study? Or have you found a good tutorial on using the batch mode from the command line?
Kind regards,
Stefan Wolf
Dear Jean-Christophe, I would like to run batch jobs too, but I stuck at the same point as you did. Have you found out how to name the study or the batch job to run the study? Or have you found a good tutorial on using the batch mode from the command line? Kind regards, Stefan Wolf

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 10 nov. 2012, 04:06 UTC−5
For anyone who is also looking for the solution: the -job command line parameter expects the tag of the batch job. To see the tag, right-click on the batch job and select "Properties". It's most likely "b1".

By the way, this is how I run parametric sweeps on a cluster:
1. Under Job Configurations, add a Parametric job. Define the parametric sweep there.
1a. In Parametric 1, check "Distribute parameters".
1b. Under Parametric > Solver, uncheck "Keep all solutions", otherwise the file will become enormous in some cases.
1c. Under Parametric, add "Save Model to File"
2. Under Job Configurations, add a Batch job.
2a. Under Batch 1, add Job Sequence.
2b. In Batch 1 > Job Sequence, specify Parametric 1.
3. On the commandline specify "comsol batch ... -job b1"

I find that, at least with version 4.2a, if I add a Parametric Sweep under Study, running the MPH file without specifying any -job won't run the parametric sweep, but will ignore it and do the same as selecting "Compute" for "Solver 1" (i.e. not "Compute" on "Study 1" as would be expected).
For anyone who is also looking for the solution: the -job command line parameter expects the [b]tag[/b] of the batch job. To see the tag, right-click on the batch job and select "Properties". It's most likely "b1". By the way, this is how I run parametric sweeps on a cluster: 1. Under Job Configurations, add a Parametric job. Define the parametric sweep there. 1a. In Parametric 1, check "Distribute parameters". 1b. Under Parametric > Solver, uncheck "Keep all solutions", otherwise the file will become enormous in some cases. 1c. Under Parametric, add "Save Model to File" 2. Under Job Configurations, add a Batch job. 2a. Under Batch 1, add Job Sequence. 2b. In Batch 1 > Job Sequence, specify Parametric 1. 3. On the commandline specify "comsol batch ... -job b1" I find that, at least with version 4.2a, if I add a Parametric Sweep under Study, running the MPH file without specifying any -job won't run the parametric sweep, but will ignore it and do the same as selecting "Compute" for "Solver 1" (i.e. not "Compute" on "Study 1" as would be expected).

Jean-Christophe Lavocat

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 29 nov. 2012, 09:33 UTC−5
Thanks Evgeni, very useful tips.

I want to add a new trick. Suppose you have several studies in your model... without creating a batch job, you can start a specific study from the command line by using :
"comsol batch -inputfile yourfile.mph -study study_tag"

Where you get the 'study_tag" by right-clicking on your study and finding the 'tag' property in the properties panel. Usually you will get std1, std2 etc...
Thanks Evgeni, very useful tips. I want to add a new trick. Suppose you have several studies in your model... without creating a batch job, you can start a specific study from the command line by using : "comsol batch -inputfile yourfile.mph -study study_tag" Where you get the 'study_tag" by right-clicking on your study and finding the 'tag' property in the properties panel. Usually you will get std1, std2 etc...

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 3 déc. 2013, 22:10 UTC−5
What if you want to solve multiple studies, but not all of them? Is it possible to run more than one?

Thanks,
Yelena
What if you want to solve multiple studies, but not all of them? Is it possible to run more than one? Thanks, Yelena

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.