Skip to content

Commit

Permalink
Merge branch 'master' of github.com:k3kaimu/TUT-HPCLIB4D
Browse files Browse the repository at this point in the history
  • Loading branch information
k3kaimu committed Oct 6, 2020
2 parents 1968780 + a8b0e62 commit f2cd161
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions source/tuthpc/taskqueue.d
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ ChildProcessType thisProcessType()
return type;
}

return ChildProcessType.SUBMITTER;
if(ClusterInfo.currInstance is null)
return ChildProcessType.TASK_MANAGER;
else
return ChildProcessType.SUBMITTER;
}


Expand Down Expand Up @@ -522,6 +525,7 @@ struct QueueOverflowProtector
void analyze(size_t jobSize, size_t runId, string file, size_t line)
{
auto cinfo = ClusterInfo.currInstance;
enforce(cinfo !is null);
enforce(thisProcessType() == ChildProcessType.SUBMITTER
|| thisProcessType() == ChildProcessType.ANALYZER);

Expand Down Expand Up @@ -771,7 +775,8 @@ if(isTaskList!TL)
if(env.isShowMode)
goto Lreturn;

if(thisProcessType() == ChildProcessType.SUBMITTER || thisProcessType() == ChildProcessType.ANALYZER)
if(cluster !is null
&& (thisProcessType() == ChildProcessType.SUBMITTER || thisProcessType() == ChildProcessType.ANALYZER))
{
enforce(nowInRunOld == false);
enforce(env.useArrayJob);
Expand Down Expand Up @@ -861,6 +866,7 @@ if(isTaskList!TL)
else
{
import std.parallelism;
enforce(cluster is null);

// Task実行プロセスかどうかチェック
if(EnvironmentKey.RUN_ID in environment){
Expand Down Expand Up @@ -1095,20 +1101,22 @@ if(isInputRange!R)
*/
string saveOrLoadENV(ref JobEnvironment env, string key, lazy string value)
{
if(thisProcessType() == ChildProcessType.SUBMITTER
|| thisProcessType() == ChildProcessType.ANALYZER)
auto cluster = ClusterInfo.currInstance;

bool setCond = false;
if(cluster is null)
setCond = (thisProcessType() == ChildProcessType.TASK_MANAGER);
else
setCond = (thisProcessType() == ChildProcessType.SUBMITTER || thisProcessType() == ChildProcessType.ANALYZER);

if(setCond)
{
auto v = value;
env.envs[key] = v;
return v;
}
else if(thisProcessType() == ChildProcessType.TASK_MANAGER
|| thisProcessType() == ChildProcessType.TASK_PROCESSOR)
{
else
return environment[key];
} else {
return value;
}
}


Expand Down

0 comments on commit f2cd161

Please sign in to comment.