Relionはジョブ管理システム(SGE、Torque、PBSProら)と連携できて、
ジョブ投入画面の「Submit to queue?」をYesにすれば既設のジョブ管理システムへジョブが投入される
2018y08m03d_121758190.png

指定した「queue」の先で指定したMPI分のリソースを確保して計算するのだが、
指定先の「queue」で1台当たりのコア数を「Minimum deficated core per node」に記載する必要がある。
一様にcore数が揃ったクラスターマシンが数組なら便利です。
っが、購入時期によってcore数が異なるクラスターマシン群が複数存在すると面倒かな。

そう思って「queue指定 -> 使用するノードの数 -> 使用するMPIの数 -> MPI当たりのthreads数」で
ジョブを定義できるような変更を行ってみた.
2018y09m13d_053604415.png

注意 ソースコードの改変あり
このソース変更で RELION_QSUB_TEMPLATE(qsub.sh)も変更する必要があります。参照Relion/qsub.sh

修正コード

留意
動かない場合もあります。各自の責任でお使い下さい

「git diff」の結果です. diffファイルはこちら filerelion-3.1.1.diff

diff --git a/src/gui_jobwindow.cpp b/src/gui_jobwindow.cpp
index c9731aa..672e822 100644
--- a/src/gui_jobwindow.cpp
+++ b/src/gui_jobwindow.cpp
@@ -38,16 +38,6 @@ void JobWindow::setupTabs(int nr_tabs)
 {
 	current_y = y; // top of the GUI
 
-	char * my_allow_change_dedicated = getenv ("RELION_ALLOW_CHANGE_MINIMUM_DEDICATED");
-	if (my_allow_change_dedicated == NULL)
-	{
-		do_allow_change_minimum_dedicated = DEFAULTMININIMUMDEDICATED;
-	}
-	else
-	{
-		int check_allow =  textToInteger(my_allow_change_dedicated);
-		do_allow_change_minimum_dedicated = (check_allow == 0) ? false : true;
-	}
 
 	// Set up tabs
 	if (nr_tabs >= 1) // there is always the running tab, which is not counted on the input nr_tabs!
@@ -131,6 +121,7 @@ void JobWindow::setupRunTab()
 
 	if (myjob.joboptions.find("nr_mpi") != myjob.joboptions.end())
 	{
+		if (myjob.joboptions.find("nr_nodes") != myjob.joboptions.end()) place("nr_nodes", TOGGLE_LEAVE_ACTIVE);
 		place("nr_mpi", TOGGLE_LEAVE_ACTIVE);
 		has_parallel = true;
 	}
@@ -172,11 +163,6 @@ void JobWindow::setupRunTab()
 
 	place("qsubscript");
 
-	place("min_dedicated");
-	if (do_allow_change_minimum_dedicated)
-		guientries["min_dedicated"].deactivate(false);
-	else
-		guientries["min_dedicated"].deactivate(true);
 
 	queue_group->end();
 	guientries["do_queue"].cb_menu_i(); // This is to make the default effective
diff --git a/src/pipeline_jobs.cpp b/src/pipeline_jobs.cpp
index 46c54b5..4a46684 100644
--- a/src/pipeline_jobs.cpp
+++ b/src/pipeline_jobs.cpp
@@ -533,28 +533,26 @@ bool RelionJob::saveJobSubmissionScript(std::string newfilename, std::string out
 		int nthr = (joboptions.find("nr_threads") != joboptions.end()) ? joboptions["nr_threads"].getNumber(error_message) : 1;
 		if (error_message != "") return false;
 
-		int ncores = nmpi * nthr;
-		int ndedi = joboptions["min_dedicated"].getNumber(error_message);
+		int nr_nodes = (joboptions.find("nr_nodes") != joboptions.end()) ? joboptions["nr_nodes"].getNumber(error_message) : 1;
 		if (error_message != "") return false;
 
-		float fnodes = (float)ncores / (float)ndedi;
-		int nnodes = CEIL(fnodes);
-		if (fmod(fnodes, 1) > 0)
-		{
-			std:: cout << std::endl;
-			std::cout << " Warning! You're using " << nmpi << " MPI processes with " << nthr << " threads each (i.e. "(略
-			std::cout << " It is more efficient to make the number of cores (i.e. mpi*threads) a multiple of the minim(略
-		}
+		int ncores = nmpi * nthr;
+
+		int nsum = nr_nodes * ncores;
+		int nmpiproc = nr_nodes * nmpi;
 
 		fh.clear(); // reset eof if happened...
 		fh.seekg(0, std::ios::beg);
 		std::string line;
 		std::map<std::string, std::string> replacing;
+		replacing["XXXversionXXX"] = RELION_SHORT_VERSION;
+		replacing["XXXsumXXX"] = floatToString(nsum);
+		replacing["XXXmpiprocXXX"] = floatToString(nmpiproc);
+
 		replacing["XXXmpinodesXXX"] = floatToString(nmpi);
 		replacing["XXXthreadsXXX"] = floatToString(nthr);
 		replacing["XXXcoresXXX"] = floatToString(ncores);
-		replacing["XXXdedicatedXXX"] = floatToString(ndedi);
-		replacing["XXXnodesXXX"] = floatToString(nnodes);
+		replacing["XXXnodesXXX"] = floatToString(nr_nodes);
 		replacing["XXXnameXXX"] = outputname;
 		replacing["XXXerrfileXXX"] = outputname + "run.err";
 		replacing["XXXoutfileXXX"] = outputname + "run.out";
@@ -853,7 +851,8 @@ void RelionJob::initialise(int _job_type)
 	const char qsub_nrmpi_val = (qsub_nrmpi_text ? atoi(qsub_nrmpi_text) : DEFAULTNRMPI);
 	if (has_mpi)
 	{
-		joboptions["nr_mpi"] = JobOption("Number of MPI procs:", qsub_nrmpi_val , 1, mpi_max, 1, "Number of MPI nodes to (略
+		joboptions["nr_mpi"] = JobOption("Number of MPI procs per node:", qsub_nrmpi_val , 1, mpi_max , 1, "Number of MPI(略
+		joboptions["nr_nodes"] = JobOption("Number of nodes:", 1, 1, 8 , 1, "Number of nodes");
 	}
 
 	const char *thread_max_input = getenv("RELION_THREAD_MAX");
@@ -938,11 +937,12 @@ Its default location may be changed by setting the environment variable RELION_Q
 In the template script a number of variables will be replaced: \n \
 XXXcommandXXX = relion command + arguments; \n \
 XXXqueueXXX = The queue name; \n \
-XXXmpinodesXXX = The number of MPI nodes; \n \
-XXXthreadsXXX = The number of threads; \n \
+XXXmpinodesXXX = The number of MPI per node; \n \
+XXXmpiprocXXX = The total number of MPI; \n \
+XXXthreadsXXX = The number of threads per MPI; \n \
 XXXcoresXXX = XXXmpinodesXXX * XXXthreadsXXX; \n \
-XXXdedicatedXXX = The minimum number of dedicated cores on each node; \n \
-XXXnodesXXX = The number of requested nodes = CEIL(XXXcoresXXX / XXXdedicatedXXX); \n \
+XXXsumXXX = The total number of core; \n \
+XXXnodesXXX = The number of requested nodes \n \
 If these options are not enough for your standard jobs, you may define a user-specified number of extra variables: XXXextra1XXX(略
 The number of extra variables is controlled through the environment variable RELION_QSUB_EXTRA_COUNT. \
 Their help text is set by the environment variables RELION_QSUB_EXTRA1, RELION_QSUB_EXTRA2, etc \
@@ -952,9 +952,6 @@ Likewise, default values for the extra entries can be set through environment va
 But note that (unlike all other entries in the GUI) the extra values are not remembered from one run to the other.");
 
 	// Check for environment variable RELION_QSUB_TEMPLATE
-	char * my_minimum_dedicated = getenv ("RELION_MINIMUM_DEDICATED");
-	int minimum_nr_dedicated = (my_minimum_dedicated == NULL) ? DEFAULTMININIMUMDEDICATED : textToInteger(my_minimum_dedicated);
-	joboptions["min_dedicated"] = JobOption("Minimum dedicated cores per node:", minimum_nr_dedicated, 1, 64, 1, "Minimum numbe(略
 
 	// Need the std::string(), as otherwise it will be overloaded and passed as a boolean....
 	joboptions["other_args"] = JobOption("Additional arguments:", std::string(""), "In this box command-line arguments may be(略
diff --git a/src/pipeline_jobs.h b/src/pipeline_jobs.h
index 47b9f81..a8607ef 100644
--- a/src/pipeline_jobs.h
+++ b/src/pipeline_jobs.h
@@ -128,8 +128,6 @@ static const std::vector<std::string> job_ctffit_options{
 	"Per-particle"
 };
 
-// To have a line on the GUI to change the minimum number of dedicated in a job
-static bool do_allow_change_minimum_dedicated;
 
 // Optional output file for any jobtype that explicitly defines the output nodes
 #define RELION_OUTPUT_NODES "RELION_OUTPUT_NODES.star"
 
 

上記diffファイルを入手して/tmpらに配置します。
そして、適用方法は

[root@c ~]# cd /apps/src/
[root@c src]# git clone https://github.com/3dem/relion
[root@c src]# cd relion
[root@c relion]# git checkout -b v3.1.1 refs/tags/3.1.1
[root@c relion]# git branch
  master
* v3.1.1
[root@c relion]# 
[root@c relion]# patch -p1 < /tmp/relion-3.1.1.diff
patching file src/gui_jobwindow.cpp
patching file src/pipeline_jobs.cpp
patching file src/pipeline_jobs.h
 
[root@c relion]#

で適用されます。その後にコンパイル、インストールしてください。
もし適用した後で外したいのなら、

[root@c relion]# git checkout .

で元の状態に戻ります。


トップ   編集 添付 複製 名前変更     ヘルプ   最終更新のRSS
Last-modified: 2021-02-16 (火) 00:23:36 (60d)