这是我使用的工作脚本,
#!/bin/bash
#PBS -q batch
#PBS -N simulation
#PBS -j n
#PBS -o /dev/null
#PBS -l nodes=1:ppn=1,pmem=3400mb
#PBS -l ncpus=1,mem=3400mb
cd ${PBS_O_WORKDIR} && \
./executable
我收到此错误:
Operating system error: Cannot allocate memory
Allocation would exceed memory limit
我尝试增加ppn和ncpus以及mem以使其符合我的程序要求(~6GB)。也没帮助。
当我在终端中运行命令时,不会发生这种情况。它运作得很好。
答案 0 :(得分:0)
尝试运行程序,将系统中的所有内存分配给作业。
然后最后执行lpszDriver
,查看Torque对已用资源的看法。
[DllImport("gdi32.dll", SetLastError = true, CharSet = CharSet.Auto)]
internal static extern IntPtr CreateDC(string lpszDriver, string lpszDevice, string lpszOutput, IntPtr lpInitData);
[DllImport("gdi32.dll", SetLastError = true, EntryPoint = "DeleteDC")]
internal static extern bool DeleteDC([In] IntPtr hdc);
public static IntPtr CreateDCFromDeviceName(string deviceName)
{
return CreateDC(deviceName, null, null, IntPtr.Zero);
}
Screen[] screens = Screen.AllScreens;
IntPtr screenDC1 = CreateDCFromDeviceName(screens[0].DeviceName);
IntPtr screenDC2 = CreateDCFromDeviceName(screens[1].DeviceName);
using (Graphics g1 = Graphics.FromHdc(screenDC1))
using (Graphics g2 = Graphics.FromHdc(screenDC2))
using (Pen pen = new Pen(Color.Red, 10))
{
g1.DrawRectangle(pen, new Rectangle(new Point(100, 100), new Size(200, 200)));
g2.DrawRectangle(pen, new Rectangle(new Point(100, 100), new Size(200, 200)));
}
DeleteDC(screenDC1);
DeleteDC(screenDC2);