1 | %ERIC-MAC class definition
|
---|
2 | %
|
---|
3 | % Usage:
|
---|
4 | % cluster=eric-mac();
|
---|
5 | %
|
---|
6 | classdef astrid
|
---|
7 | properties (SetAccess=public)
|
---|
8 | %{{{1
|
---|
9 | name='eric-mac'
|
---|
10 | np =3; %number of processors
|
---|
11 | codepath=[issmdir '/bin'];
|
---|
12 | executionpath=[issmdir '../execution'];
|
---|
13 | valgrind=[issmdir '/externalpackages/valgrind/install/bin/valgrind'];
|
---|
14 | valgrindlib=[issmdir '/externalpackages/valgrind/install/lib/libmpidebug.so'];
|
---|
15 | valgrindsup=[issmdir 'externalpackages/valgrind/issm.supp'];
|
---|
16 | login='larour';
|
---|
17 | port=0;
|
---|
18 | %}}}
|
---|
19 | end
|
---|
20 | methods
|
---|
21 | function []=disp(md) %{{{1
|
---|
22 | % display the object
|
---|
23 | disp(sprintf('class ''%s'' object ''%s'' = ',class(md),inputname(1)));
|
---|
24 | disp(sprintf(' name: %s',md.name));
|
---|
25 | disp(sprintf(' np: %i',md.np));
|
---|
26 | disp(sprintf(' codepath: %s',md.codepath));
|
---|
27 | disp(sprintf(' executionpath: %s',md.executionpath));
|
---|
28 | disp(sprintf(' valgrind: %s',md.valgrind));
|
---|
29 | disp(sprintf(' valgrindlib: %s',md.valgrindlib));
|
---|
30 | disp(sprintf(' valgrindsup: %s',md.valgrindsup));
|
---|
31 | end
|
---|
32 | %}}}
|
---|
33 | function IsConsistent(md) %{{{1
|
---|
34 | if md.np>4,
|
---|
35 | error('IsConsistent error message: number of processors should be lest than 16!');
|
---|
36 | end
|
---|
37 | if isnan(md.np),
|
---|
38 | error('IsConsistent error message: number of processors should not be NaN!');
|
---|
39 | end
|
---|
40 | end
|
---|
41 | %}}}
|
---|
42 | function BuildQueueScript(md,modelname,analysis_type,mem_debug) %{{{1
|
---|
43 |
|
---|
44 | %open file for writing:
|
---|
45 | fid=fopen([modelname '.queue'],'w');
|
---|
46 |
|
---|
47 | %write instructions for launching a job on the cluster
|
---|
48 | fprintf(fid,'#!/bin/sh\n');
|
---|
49 | if mem_debug==0,
|
---|
50 | fprintf(fid,'mpirun -np %i %s/issm.exe %s %s %s.bin %s.outbin %s.lock 2> %s.errlog >%s.outlog & ',md.np,md.codepath,EnumToString(analysis_type),md.executionpath,modelname,modelname,modelname,modelname,modelname);
|
---|
51 | else
|
---|
52 | %fprintf(fid,'LD_PRELOAD=%s mpirun -np %i %s --leak-check=full --gen-suppressions=all --suppressions=%s %s/issm.exe %s %s %s.bin %s.outbin %s.lock 2> %s.errlog >%s.outlog & ',md.valgrindlib,md.np,md.valgrind,md.valgrindsup,md.codepath,EnumToString(analysis_type),md.executionpath,modelname,modelname,modelname,modelname,modelname);
|
---|
53 | fprintf(fid,'LD_PRELOAD=%s mpirun -np %i %s --leak-check=full --suppressions=%s %s/issm.exe %s %s %s.bin %s.outbin %s.lock 2> %s.errlog >%s.outlog & ',md.valgrindlib,md.np,md.valgrind,md.valgrindsup, md.codepath,EnumToString(analysis_type),md.executionpath,modelname,modelname,modelname,modelname,modelname);
|
---|
54 | end
|
---|
55 |
|
---|
56 | %close file
|
---|
57 | fclose(fid);
|
---|
58 |
|
---|
59 | end
|
---|
60 | %}}}
|
---|
61 | function command=LaunchCommand(md,modelruntimename,modelname)%{{{1
|
---|
62 | command=['cd ' md.executionpath ' && rm -rf ./' modelruntimename ' && mkdir ' modelruntimename ' && cd ' modelruntimename ' && mv ../' modelruntimename '.tar.gz ./ && tar -zxf ' modelruntimename '.tar.gz && source ' modelname '.queue '];
|
---|
63 | end
|
---|
64 | %}}}
|
---|
65 | end
|
---|
66 | end
|
---|