Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion tdi/remote/MdsConnect.fun
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ call: _host = Host name eg elpp1.epfl.ch or elpp1.epfl.ch:9000
write(*,"Host taken from MDS_HOST ["//_host//"]");
}
_status = TdiShrExt->rMdsConnect(ref(_host//char(0)));
if (present(_abort) && _status == 0) abort();
_invalid_id = -1
if (present(_abort) && _status == _invalid_id) abort();
return(_status);
}
14 changes: 11 additions & 3 deletions tdi/remote/remote_submit_helper.fun
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,25 @@ public fun remote_submit_helper(_host,_file,_shot)
if (_host == "any")
{
_queues = remote_submit_queues();
_stat = 0;
while (_stat == 0)

_start = cvttime();
_elapsed = 0;
_max_seconds = 300;
_invalid_id = -1;

/* Note that mdsconnect() returns a connection id, not a status code */
_stat = _invalid_id;
while ((_stat == _invalid_id) AND (_elapsed < _max_seconds))
{
_host = _queues[long(random()*size(_queues))];
write(*,"Trying ",_host);
_stat = mdsconnect(_host);
_elapsed = cvttime() - _start;
}
}
else
_stat=mdsconnect(_host);
if (_stat > 0)
if (_stat > _invalid_id)
{
_stat=mdsvalue('tcl("spawn/nowait unix_submit '//_file//' '//_shot//'")');
} else {
Expand Down